@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.
- package/Designer.d.ts +89 -0
- package/FormSpec.TS/Components/HelloComponent.js +68 -0
- package/FormSpec.TS/Components/HelloComponent.js.map +1 -0
- package/FormSpec.TS/Components/HelloComponent.ts.map +1 -0
- package/FormSpec.TS/Designer.js +526 -0
- package/FormSpec.TS/Designer.js.map +1 -0
- package/FormSpec.TS/Designer.ts.map +1 -0
- package/FormSpec.TS/FormSpec.js +5400 -0
- package/FormSpec.TS/FormSpec.js.map +1 -0
- package/FormSpec.TS/FormSpec.ts.map +1 -0
- package/FormSpec.TS/FormSpecHelpers.js +382 -0
- package/FormSpec.TS/FormSpecHelpers.js.map +1 -0
- package/FormSpec.TS/FormSpecHelpers.ts.map +1 -0
- package/FormSpec.TS/Helpers.js +732 -0
- package/FormSpec.TS/Helpers.js.map +1 -0
- package/FormSpec.TS/Helpers.ts.map +1 -0
- package/FormSpec.TS/Interfaces.js +257 -0
- package/FormSpec.TS/Interfaces.js.map +1 -0
- package/FormSpec.TS/Interfaces.ts.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js +854 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.ts.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Option.js +1961 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Option.js.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Option.ts.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js +1367 -0
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
- package/FormSpec.TS/Logging/LogTypes.js +347 -0
- package/FormSpec.TS/Logging/LogTypes.js.map +1 -0
- package/FormSpec.TS/Logging/LogTypes.ts.map +1 -0
- package/FormSpec.TS/Migrator.js +230 -0
- package/FormSpec.TS/Migrator.js.map +1 -0
- package/FormSpec.TS/Migrator.ts.map +1 -0
- package/FormSpec.TS/PathwayDataExtractor.js +361 -0
- package/FormSpec.TS/PathwayDataExtractor.js.map +1 -0
- package/FormSpec.TS/PathwayDataExtractor.ts.map +1 -0
- package/FormSpec.TS/PathwayExecutor.js +1321 -0
- package/FormSpec.TS/PathwayExecutor.js.map +1 -0
- package/FormSpec.TS/PathwayExecutor.ts.map +1 -0
- package/FormSpec.TS/PathwayValidator.js +346 -0
- package/FormSpec.TS/PathwayValidator.js.map +1 -0
- package/FormSpec.TS/PathwayValidator.ts.map +1 -0
- package/FormSpec.TS/PluginInterface.js +171 -0
- package/FormSpec.TS/PluginInterface.js.map +1 -0
- package/FormSpec.TS/PluginInterface.ts.map +1 -0
- package/FormSpec.TS/Prelude.js +59 -0
- package/FormSpec.TS/Prelude.js.map +1 -0
- package/FormSpec.TS/Prelude.ts.map +1 -0
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js +958 -0
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js.map +1 -0
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
- package/FormSpec.TS/Renderers/MermaidRenderer.js +228 -0
- package/FormSpec.TS/Renderers/MermaidRenderer.js.map +1 -0
- package/FormSpec.TS/Renderers/MermaidRenderer.ts.map +1 -0
- package/FormSpec.TS/Renderers/PathwayRenderers.js +190 -0
- package/FormSpec.TS/Renderers/PathwayRenderers.js.map +1 -0
- package/FormSpec.TS/Renderers/PathwayRenderers.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs +511 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js +437 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs +16 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js +73 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs +50 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js +72 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Fable.Form.fableproj +28 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs +24 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js +56 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Fable.Form.Simple.fableproj +31 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs +178 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js +464 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Extensions.fs +17 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs +152 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js +25 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Types.fableproj +28 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs +218 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js +37 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.Types.fableproj +27 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs +82 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/BorderStyle.fs +59 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs +154 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js +32 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Feliz.fableproj +42 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Fonts.fs +240 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/GridTypes.fs +24 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Html.fs +826 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs +83 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js +292 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs +65 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js +229 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Length.fs +91 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Locale.fs +876 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs +4080 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js +133 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs +656 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js +561 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs +25 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js +46 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js +63 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs +41 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs +53 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Styles.fs +5740 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs +1455 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js +39 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationLine.fs +13 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationStyle.fs +33 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Transform.fs +181 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransformOrigin.fs +17 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransitionProperty.fs +162 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs +13 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +1768 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js +2337 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +811 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js +465 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +47 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js +18 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +34 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +68 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js +355 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -0
- package/FormSpec.d.ts +1257 -0
- package/FormSpecHelpers.d.ts +50 -0
- package/Helpers.d.ts +147 -0
- package/Interfaces.d.ts +70 -0
- package/Interop/FormSpec.Api.Helpers.d.ts +247 -0
- package/Interop/FormSpec.Api.Helpers.d.ts.map +1 -0
- package/Interop/FormSpec.Api.Option.d.ts +384 -0
- package/Interop/FormSpec.Api.Option.d.ts.map +1 -0
- package/Interop/FormSpec.Values.Api.Option.d.ts +324 -0
- package/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -0
- package/Migrator.d.ts +59 -0
- package/PathwayDataExtractor.d.ts +19 -0
- package/PathwayExecutor.d.ts +210 -0
- package/PathwayValidator.d.ts +52 -0
- package/PluginInterface.d.ts +36 -0
- package/Prelude.d.ts +11 -0
- package/README.TS.md +622 -0
- package/README.md +85 -0
- package/package.json +39 -0
- package/src/Components/HelloComponent.ts +48 -0
- package/src/Components/HelloComponent.ts.map +1 -0
- package/src/Designer.ts +389 -0
- package/src/Designer.ts.map +1 -0
- package/src/FormSpec.ts +3114 -0
- package/src/FormSpec.ts.map +1 -0
- package/src/FormSpecHelpers.ts +374 -0
- package/src/FormSpecHelpers.ts.map +1 -0
- package/src/Helpers.ts +765 -0
- package/src/Helpers.ts.map +1 -0
- package/src/Interfaces.ts +166 -0
- package/src/Interfaces.ts.map +1 -0
- package/src/Interop/FormSpec.Api.Helpers.ts +872 -0
- package/src/Interop/FormSpec.Api.Helpers.ts.map +1 -0
- package/src/Interop/FormSpec.Api.Option.ts +1618 -0
- package/src/Interop/FormSpec.Api.Option.ts.map +1 -0
- package/src/Interop/FormSpec.Values.Api.Option.ts +1214 -0
- package/src/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
- package/src/Logging/LogTypes.ts +212 -0
- package/src/Logging/LogTypes.ts.map +1 -0
- package/src/Migrator.ts +156 -0
- package/src/Migrator.ts.map +1 -0
- package/src/PathwayDataExtractor.ts +290 -0
- package/src/PathwayDataExtractor.ts.map +1 -0
- package/src/PathwayExecutor.ts +1102 -0
- package/src/PathwayExecutor.ts.map +1 -0
- package/src/PathwayValidator.ts +244 -0
- package/src/PathwayValidator.ts.map +1 -0
- package/src/PluginInterface.ts +79 -0
- package/src/PluginInterface.ts.map +1 -0
- package/src/Prelude.ts +21 -0
- package/src/Prelude.ts.map +1 -0
- package/src/Renderers/FormSpecMarkdownRenderer.ts +874 -0
- package/src/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
- package/src/Renderers/MermaidRenderer.ts +218 -0
- package/src/Renderers/MermaidRenderer.ts.map +1 -0
- package/src/Renderers/PathwayRenderers.ts +200 -0
- package/src/Renderers/PathwayRenderers.ts.map +1 -0
|
@@ -0,0 +1,464 @@
|
|
|
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 Action$1 () {
|
|
13
|
+
return Action$1;
|
|
14
|
+
},
|
|
15
|
+
get Action$1_$reflection () {
|
|
16
|
+
return Action$1_$reflection;
|
|
17
|
+
},
|
|
18
|
+
get Action$1_Custom () {
|
|
19
|
+
return Action$1_Custom;
|
|
20
|
+
},
|
|
21
|
+
get Action$1_SubmitOnly () {
|
|
22
|
+
return Action$1_SubmitOnly;
|
|
23
|
+
},
|
|
24
|
+
get ErrorTracking () {
|
|
25
|
+
return ErrorTracking;
|
|
26
|
+
},
|
|
27
|
+
get ErrorTracking_$reflection () {
|
|
28
|
+
return ErrorTracking_$reflection;
|
|
29
|
+
},
|
|
30
|
+
get FieldConfig$2 () {
|
|
31
|
+
return FieldConfig$2;
|
|
32
|
+
},
|
|
33
|
+
get FieldConfig$2_$reflection () {
|
|
34
|
+
return FieldConfig$2_$reflection;
|
|
35
|
+
},
|
|
36
|
+
get FormConfig$2 () {
|
|
37
|
+
return FormConfig$2;
|
|
38
|
+
},
|
|
39
|
+
get FormConfig$2_$reflection () {
|
|
40
|
+
return FormConfig$2_$reflection;
|
|
41
|
+
},
|
|
42
|
+
get Model$1 () {
|
|
43
|
+
return Model$1;
|
|
44
|
+
},
|
|
45
|
+
get Model$1_$reflection () {
|
|
46
|
+
return Model$1_$reflection;
|
|
47
|
+
},
|
|
48
|
+
get OnSubmit () {
|
|
49
|
+
return OnSubmit;
|
|
50
|
+
},
|
|
51
|
+
get OnSubmit_$reflection () {
|
|
52
|
+
return OnSubmit_$reflection;
|
|
53
|
+
},
|
|
54
|
+
get State () {
|
|
55
|
+
return State;
|
|
56
|
+
},
|
|
57
|
+
get State_$reflection () {
|
|
58
|
+
return State_$reflection;
|
|
59
|
+
},
|
|
60
|
+
get State_Error () {
|
|
61
|
+
return State_Error;
|
|
62
|
+
},
|
|
63
|
+
get State_Idle () {
|
|
64
|
+
return State_Idle;
|
|
65
|
+
},
|
|
66
|
+
get State_Loading () {
|
|
67
|
+
return State_Loading;
|
|
68
|
+
},
|
|
69
|
+
get State_ReadOnly () {
|
|
70
|
+
return State_ReadOnly;
|
|
71
|
+
},
|
|
72
|
+
get State_Success () {
|
|
73
|
+
return State_Success;
|
|
74
|
+
},
|
|
75
|
+
get Validation () {
|
|
76
|
+
return Validation;
|
|
77
|
+
},
|
|
78
|
+
get Validation_$reflection () {
|
|
79
|
+
return Validation_$reflection;
|
|
80
|
+
},
|
|
81
|
+
get Validation_ValidateOnBlur () {
|
|
82
|
+
return Validation_ValidateOnBlur;
|
|
83
|
+
},
|
|
84
|
+
get Validation_ValidateOnSubmit () {
|
|
85
|
+
return Validation_ValidateOnSubmit;
|
|
86
|
+
},
|
|
87
|
+
get ViewConfig$3 () {
|
|
88
|
+
return ViewConfig$3;
|
|
89
|
+
},
|
|
90
|
+
get ViewConfig$3_$reflection () {
|
|
91
|
+
return ViewConfig$3_$reflection;
|
|
92
|
+
},
|
|
93
|
+
get custom () {
|
|
94
|
+
return custom;
|
|
95
|
+
},
|
|
96
|
+
get errorToString () {
|
|
97
|
+
return errorToString;
|
|
98
|
+
},
|
|
99
|
+
get idle () {
|
|
100
|
+
return idle;
|
|
101
|
+
},
|
|
102
|
+
get setLoading () {
|
|
103
|
+
return setLoading;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
const _Types = require("@fable-org/fable-library-js/Types.js");
|
|
107
|
+
const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
|
|
108
|
+
const _Set = require("@fable-org/fable-library-js/Set.js");
|
|
109
|
+
const _Util = require("@fable-org/fable-library-js/Util.js");
|
|
110
|
+
const _List = require("@fable-org/fable-library-js/List.js");
|
|
111
|
+
const _Basefs = require("../Fable.Form.3.0.0/Base.fs.js");
|
|
112
|
+
class OnSubmit extends _Types.Union {
|
|
113
|
+
cases() {
|
|
114
|
+
return [
|
|
115
|
+
"OnSubmit"
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
constructor(Item){
|
|
119
|
+
super();
|
|
120
|
+
this.tag = 0;
|
|
121
|
+
this.fields = [
|
|
122
|
+
Item
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function OnSubmit_$reflection() {
|
|
127
|
+
return (0, _Reflection.union_type)("Fable.Form.Simple.Form.View.OnSubmit", [], OnSubmit, ()=>[
|
|
128
|
+
[
|
|
129
|
+
[
|
|
130
|
+
"Item",
|
|
131
|
+
(0, _Reflection.lambda_type)(_Reflection.unit_type, _Reflection.unit_type)
|
|
132
|
+
]
|
|
133
|
+
]
|
|
134
|
+
]);
|
|
135
|
+
}
|
|
136
|
+
function State_Idle() {
|
|
137
|
+
return new State(0, []);
|
|
138
|
+
}
|
|
139
|
+
function State_Loading() {
|
|
140
|
+
return new State(1, []);
|
|
141
|
+
}
|
|
142
|
+
function State_ReadOnly() {
|
|
143
|
+
return new State(2, []);
|
|
144
|
+
}
|
|
145
|
+
function State_Error(Item) {
|
|
146
|
+
return new State(3, [
|
|
147
|
+
Item
|
|
148
|
+
]);
|
|
149
|
+
}
|
|
150
|
+
function State_Success(Item) {
|
|
151
|
+
return new State(4, [
|
|
152
|
+
Item
|
|
153
|
+
]);
|
|
154
|
+
}
|
|
155
|
+
class State extends _Types.Union {
|
|
156
|
+
cases() {
|
|
157
|
+
return [
|
|
158
|
+
"Idle",
|
|
159
|
+
"Loading",
|
|
160
|
+
"ReadOnly",
|
|
161
|
+
"Error",
|
|
162
|
+
"Success"
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
constructor(tag, fields){
|
|
166
|
+
super(), this.tag = tag, this.fields = fields;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function State_$reflection() {
|
|
170
|
+
return (0, _Reflection.union_type)("Fable.Form.Simple.Form.View.State", [], State, ()=>[
|
|
171
|
+
[],
|
|
172
|
+
[],
|
|
173
|
+
[],
|
|
174
|
+
[
|
|
175
|
+
[
|
|
176
|
+
"Item",
|
|
177
|
+
_Reflection.string_type
|
|
178
|
+
]
|
|
179
|
+
],
|
|
180
|
+
[
|
|
181
|
+
[
|
|
182
|
+
"Item",
|
|
183
|
+
_Reflection.string_type
|
|
184
|
+
]
|
|
185
|
+
]
|
|
186
|
+
]);
|
|
187
|
+
}
|
|
188
|
+
class ErrorTracking extends _Types.Union {
|
|
189
|
+
cases() {
|
|
190
|
+
return [
|
|
191
|
+
"ErrorTracking"
|
|
192
|
+
];
|
|
193
|
+
}
|
|
194
|
+
constructor(Item){
|
|
195
|
+
super();
|
|
196
|
+
this.tag = 0;
|
|
197
|
+
this.fields = [
|
|
198
|
+
Item
|
|
199
|
+
];
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function ErrorTracking_$reflection() {
|
|
203
|
+
return (0, _Reflection.union_type)("Fable.Form.Simple.Form.View.ErrorTracking", [], ErrorTracking, ()=>[
|
|
204
|
+
[
|
|
205
|
+
[
|
|
206
|
+
"Item",
|
|
207
|
+
(0, _Reflection.anonRecord_type)([
|
|
208
|
+
"ShowAllErrors",
|
|
209
|
+
_Reflection.bool_type
|
|
210
|
+
], [
|
|
211
|
+
"ShowFieldError",
|
|
212
|
+
(0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpSet`1", [
|
|
213
|
+
_Reflection.string_type
|
|
214
|
+
])
|
|
215
|
+
])
|
|
216
|
+
]
|
|
217
|
+
]
|
|
218
|
+
]);
|
|
219
|
+
}
|
|
220
|
+
class Model$1 extends _Types.Record {
|
|
221
|
+
constructor(Values, State, ErrorTracking){
|
|
222
|
+
super();
|
|
223
|
+
this.Values = Values;
|
|
224
|
+
this.State = State;
|
|
225
|
+
this.ErrorTracking = ErrorTracking;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
function Model$1_$reflection(gen0) {
|
|
229
|
+
return (0, _Reflection.record_type)("Fable.Form.Simple.Form.View.Model`1", [
|
|
230
|
+
gen0
|
|
231
|
+
], Model$1, ()=>[
|
|
232
|
+
[
|
|
233
|
+
"Values",
|
|
234
|
+
gen0
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
"State",
|
|
238
|
+
State_$reflection()
|
|
239
|
+
],
|
|
240
|
+
[
|
|
241
|
+
"ErrorTracking",
|
|
242
|
+
ErrorTracking_$reflection()
|
|
243
|
+
]
|
|
244
|
+
]);
|
|
245
|
+
}
|
|
246
|
+
function Validation_ValidateOnBlur() {
|
|
247
|
+
return new Validation(0, []);
|
|
248
|
+
}
|
|
249
|
+
function Validation_ValidateOnSubmit() {
|
|
250
|
+
return new Validation(1, []);
|
|
251
|
+
}
|
|
252
|
+
class Validation extends _Types.Union {
|
|
253
|
+
cases() {
|
|
254
|
+
return [
|
|
255
|
+
"ValidateOnBlur",
|
|
256
|
+
"ValidateOnSubmit"
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
constructor(tag, fields){
|
|
260
|
+
super(), this.tag = tag, this.fields = fields;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function Validation_$reflection() {
|
|
264
|
+
return (0, _Reflection.union_type)("Fable.Form.Simple.Form.View.Validation", [], Validation, ()=>[
|
|
265
|
+
[],
|
|
266
|
+
[]
|
|
267
|
+
]);
|
|
268
|
+
}
|
|
269
|
+
function Action$1_SubmitOnly(Item) {
|
|
270
|
+
return new Action$1(0, [
|
|
271
|
+
Item
|
|
272
|
+
]);
|
|
273
|
+
}
|
|
274
|
+
function Action$1_Custom(Item) {
|
|
275
|
+
return new Action$1(1, [
|
|
276
|
+
Item
|
|
277
|
+
]);
|
|
278
|
+
}
|
|
279
|
+
class Action$1 extends _Types.Union {
|
|
280
|
+
cases() {
|
|
281
|
+
return [
|
|
282
|
+
"SubmitOnly",
|
|
283
|
+
"Custom"
|
|
284
|
+
];
|
|
285
|
+
}
|
|
286
|
+
constructor(tag, fields){
|
|
287
|
+
super(), this.tag = tag, this.fields = fields;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
function Action$1_$reflection(gen0) {
|
|
291
|
+
return (0, _Reflection.union_type)("Fable.Form.Simple.Form.View.Action`1", [
|
|
292
|
+
gen0
|
|
293
|
+
], Action$1, ()=>[
|
|
294
|
+
[
|
|
295
|
+
[
|
|
296
|
+
"Item",
|
|
297
|
+
_Reflection.string_type
|
|
298
|
+
]
|
|
299
|
+
],
|
|
300
|
+
[
|
|
301
|
+
[
|
|
302
|
+
"Item",
|
|
303
|
+
(0, _Reflection.lambda_type)(State_$reflection(), gen0)
|
|
304
|
+
]
|
|
305
|
+
]
|
|
306
|
+
]);
|
|
307
|
+
}
|
|
308
|
+
class ViewConfig$3 extends _Types.Record {
|
|
309
|
+
constructor(OnChange, OnSubmit, Action, Validation){
|
|
310
|
+
super();
|
|
311
|
+
this.OnChange = OnChange;
|
|
312
|
+
this.OnSubmit = OnSubmit;
|
|
313
|
+
this.Action = Action;
|
|
314
|
+
this.Validation = Validation;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
function ViewConfig$3_$reflection(gen0, gen1, gen2) {
|
|
318
|
+
return (0, _Reflection.record_type)("Fable.Form.Simple.Form.View.ViewConfig`3", [
|
|
319
|
+
gen0,
|
|
320
|
+
gen1,
|
|
321
|
+
gen2
|
|
322
|
+
], ViewConfig$3, ()=>[
|
|
323
|
+
[
|
|
324
|
+
"OnChange",
|
|
325
|
+
(0, _Reflection.lambda_type)(Model$1_$reflection(gen0), _Reflection.unit_type)
|
|
326
|
+
],
|
|
327
|
+
[
|
|
328
|
+
"OnSubmit",
|
|
329
|
+
(0, _Reflection.lambda_type)(gen1, _Reflection.unit_type)
|
|
330
|
+
],
|
|
331
|
+
[
|
|
332
|
+
"Action",
|
|
333
|
+
Action$1_$reflection(gen2)
|
|
334
|
+
],
|
|
335
|
+
[
|
|
336
|
+
"Validation",
|
|
337
|
+
Validation_$reflection()
|
|
338
|
+
]
|
|
339
|
+
]);
|
|
340
|
+
}
|
|
341
|
+
class FormConfig$2 extends _Types.Record {
|
|
342
|
+
constructor(OnSubmit, State, Action, Fields){
|
|
343
|
+
super();
|
|
344
|
+
this.OnSubmit = OnSubmit;
|
|
345
|
+
this.State = State;
|
|
346
|
+
this.Action = Action;
|
|
347
|
+
this.Fields = Fields;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function FormConfig$2_$reflection(gen0, gen1) {
|
|
351
|
+
return (0, _Reflection.record_type)("Fable.Form.Simple.Form.View.FormConfig`2", [
|
|
352
|
+
gen0,
|
|
353
|
+
gen1
|
|
354
|
+
], FormConfig$2, ()=>[
|
|
355
|
+
[
|
|
356
|
+
"OnSubmit",
|
|
357
|
+
(0, _Reflection.option_type)(OnSubmit_$reflection())
|
|
358
|
+
],
|
|
359
|
+
[
|
|
360
|
+
"State",
|
|
361
|
+
State_$reflection()
|
|
362
|
+
],
|
|
363
|
+
[
|
|
364
|
+
"Action",
|
|
365
|
+
Action$1_$reflection(gen1)
|
|
366
|
+
],
|
|
367
|
+
[
|
|
368
|
+
"Fields",
|
|
369
|
+
(0, _Reflection.list_type)(gen1)
|
|
370
|
+
]
|
|
371
|
+
]);
|
|
372
|
+
}
|
|
373
|
+
function idle(values) {
|
|
374
|
+
return new Model$1(values, State_Idle(), new ErrorTracking({
|
|
375
|
+
ShowAllErrors: false,
|
|
376
|
+
ShowFieldError: (0, _Set.empty)({
|
|
377
|
+
Compare: _Util.comparePrimitives
|
|
378
|
+
})
|
|
379
|
+
}));
|
|
380
|
+
}
|
|
381
|
+
function setLoading(formModel) {
|
|
382
|
+
return new Model$1(formModel.Values, State_Loading(), formModel.ErrorTracking);
|
|
383
|
+
}
|
|
384
|
+
class FieldConfig$2 extends _Types.Record {
|
|
385
|
+
constructor(OnChange, OnBlur, Disabled, IsReadOnly, ShowError){
|
|
386
|
+
super();
|
|
387
|
+
this.OnChange = OnChange;
|
|
388
|
+
this.OnBlur = OnBlur;
|
|
389
|
+
this.Disabled = Disabled;
|
|
390
|
+
this.IsReadOnly = IsReadOnly;
|
|
391
|
+
this.ShowError = ShowError;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
function FieldConfig$2_$reflection(gen0, gen1) {
|
|
395
|
+
return (0, _Reflection.record_type)("Fable.Form.Simple.Form.View.FieldConfig`2", [
|
|
396
|
+
gen0,
|
|
397
|
+
gen1
|
|
398
|
+
], FieldConfig$2, ()=>[
|
|
399
|
+
[
|
|
400
|
+
"OnChange",
|
|
401
|
+
(0, _Reflection.lambda_type)(gen0, _Reflection.unit_type)
|
|
402
|
+
],
|
|
403
|
+
[
|
|
404
|
+
"OnBlur",
|
|
405
|
+
(0, _Reflection.option_type)((0, _Reflection.lambda_type)(_Reflection.string_type, _Reflection.unit_type))
|
|
406
|
+
],
|
|
407
|
+
[
|
|
408
|
+
"Disabled",
|
|
409
|
+
_Reflection.bool_type
|
|
410
|
+
],
|
|
411
|
+
[
|
|
412
|
+
"IsReadOnly",
|
|
413
|
+
_Reflection.bool_type
|
|
414
|
+
],
|
|
415
|
+
[
|
|
416
|
+
"ShowError",
|
|
417
|
+
(0, _Reflection.lambda_type)(_Reflection.string_type, _Reflection.bool_type)
|
|
418
|
+
]
|
|
419
|
+
]);
|
|
420
|
+
}
|
|
421
|
+
function errorToString(error) {
|
|
422
|
+
switch(error.tag){
|
|
423
|
+
case /* ValidationFailed */ 1:
|
|
424
|
+
return error.fields[0];
|
|
425
|
+
case /* External */ 2:
|
|
426
|
+
return error.fields[0];
|
|
427
|
+
default:
|
|
428
|
+
return "This field is required";
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
function custom(viewConfig, renderForm, renderField, form, model) {
|
|
432
|
+
let msg;
|
|
433
|
+
let patternInput;
|
|
434
|
+
const res = (0, _Basefs.fill)(form, model.Values);
|
|
435
|
+
patternInput = [
|
|
436
|
+
res.Fields,
|
|
437
|
+
res.Result
|
|
438
|
+
];
|
|
439
|
+
const result = patternInput[1];
|
|
440
|
+
const errorTracking = model.ErrorTracking.fields[0];
|
|
441
|
+
return renderForm(new FormConfig$2(result.tag === /* Error */ 1 ? errorTracking.ShowAllErrors ? undefined : new OnSubmit(()=>{
|
|
442
|
+
viewConfig.OnChange(new Model$1(model.Values, model.State, new ErrorTracking({
|
|
443
|
+
ShowAllErrors: true,
|
|
444
|
+
ShowFieldError: errorTracking.ShowFieldError
|
|
445
|
+
})));
|
|
446
|
+
}) : (msg = result.fields[0], (0, _Util.equals)(model.State, State_Loading()) ? undefined : new OnSubmit(()=>{
|
|
447
|
+
viewConfig.OnSubmit(msg);
|
|
448
|
+
})), model.State, viewConfig.Action, (0, _List.map)((0, _Util.curry2)(renderField)(new FieldConfig$2((values)=>{
|
|
449
|
+
viewConfig.OnChange(new Model$1(values, model.State, model.ErrorTracking));
|
|
450
|
+
}, viewConfig.Validation.tag === /* ValidateOnBlur */ 0 ? (label)=>{
|
|
451
|
+
viewConfig.OnChange(new Model$1(model.Values, model.State, new ErrorTracking({
|
|
452
|
+
ShowAllErrors: errorTracking.ShowAllErrors,
|
|
453
|
+
ShowFieldError: (0, _Set.add)(label, errorTracking.ShowFieldError)
|
|
454
|
+
})));
|
|
455
|
+
} : undefined, (0, _Util.equals)(model.State, State_Loading()), (0, _Util.equals)(model.State, State_ReadOnly()), (label_1)=>{
|
|
456
|
+
if (errorTracking.ShowAllErrors) {
|
|
457
|
+
return true;
|
|
458
|
+
} else {
|
|
459
|
+
return (0, _Set.contains)(label_1, errorTracking.ShowFieldError);
|
|
460
|
+
}
|
|
461
|
+
})), patternInput[0])));
|
|
462
|
+
} //# sourceMappingURL=Form.fs.ts.map
|
|
463
|
+
|
|
464
|
+
//# sourceMappingURL=Form.fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.ts"],"names":["values","formModel","error","msg","patternInput","res","form","model","result","errorTracking","renderForm","viewConfig","renderField","label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA6DY,IAAA,QACaA,QAAAA,cAGL,IAAA,cAAA;uBAEwB;4BACC,UAAA,EAAA;;;;;;WAKjC,IAAA,QAAAC,UAAAA,MAAAA,EAAAA,iBAAAA,UAAAA,aAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAeMC,MAAAA,GAAAA;;YAGsC,OAAAA,MAAAA,MAAAA,CAAAA,EAAAA;;YAEV,OAAAA,MAAAA,MAAAA,CAAAA,EAAAA;;mBAJF;;;;QAuBvBC;IATLC,IAAAA;IACIC,MAAAA,UAAM,YAAA,EAAUC,MAAKC,MAAAA,MAAAA;IADzBH,eAAAA;QAGAC,IAAAA,MAAAA;QAAYA,IAAAA,MAAAA;KAAAA;IAHHG,MAAAA,SAATJ,YAAAA,CAAAA,EAAAA;IAKeK,MAAAA,gBAAiBF,MAAAA,aAAAA,CAAAA,MAAAA,CAAAA,EAAAA;IA+DpC,OAAAG,WACI,IAAA,aA7DM,AAAAF,OAAAA,GAAAA,KAAAA,SAAAA,GAAAA,IASCC,cAAAA,aAAAA,GACC,YAYG,IAAA,SAAA;QARCE,WAAAA,QAAAA,CACI,IAAA,QAAAJ,MAAAA,MAAAA,EAAAA,MAAAA,KAAAA,EAEQ,IAAA,cAAA;2BAEwB;4BADpBE,cAAAA,cAAAA;;UAjBvBN,MACDK,OAAAA,MAAAA,CAAAA,EAAAA,EAAG,gBAAA,EAAAD,MAAAA,KAAAA,EAAAA,mBACC,YAGuC,IAAA,SAAA;QAA5BI,WAAAA,QAAAA,CAAoBR;SA0D3BI,MAAAA,KAAAA,EADCI,WAAAA,MAAAA,MAEA,SAAA,EAAA,IAAA,YAAA,EAnBbC,aACI,IAAA,cAAA,CAAA;QAGYD,WAAAA,QAAAA,CACI,IAAA,QACaX,QADbO,MAAAA,KAAAA,EAAAA,MAAAA,aAAAA;OAzBd,AAAAI,WAAAA,UAAAA,CAAAA,GAAAA,KAAAA,kBAAAA,GAAAA,IAAAA,CAAAA;QAKEA,WAAAA,QAAAA,CACI,IAAA,QAAAJ,MAAAA,MAAAA,EAAAA,MAAAA,KAAAA,EAEQ,IAAA,cAAA;2BACIE,cAAAA,aAAAA;gCAEQ,QAAA,EAAQI,OAAMJ,cAAAA,cAAAA;;QAVxB,eA4BH,YAAA,EAAAF,MAAAA,KAAAA,EAAAA,sBACE,YAAA,EAAAA,MAAAA,KAAAA,EAAAA,mBAAAA,CAAAA;QAbrB,IAAAE,cAAAA,aAAAA,EAAAA;mBAAA;;YAA+B,WAAA,aAAA,EAAaI,SAAMJ,cAAAA,cAAAA;;SAnDlDL,YAAAA,CAAAA,EAAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["./Form.fs"],"names":["values","formModel","error","msg","patternInput","res","form","model","result","errorTracking","renderForm","viewConfig","renderField","label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA6DY,YACaA,sBAGL;uBAEwB;wBACC;;;;;;;WAKjC,YAAA,AAAAC,mCAAA,AAAAA;;;;;;;;;;;;;;;;;;;;;;;;YAeMC;;AAGsC,mBAAA,AAAAA;;AAEV,mBAAA,AAAAA;;mBAJF;;;;;QAuBvBC;AATLC;AACIC,6CAAM,4BAAUC,MAAK,AAAAC;AADzBH,qBAGA,AAAAC,YAAY,AAAAA;AAHHG,8FAAT,AAAAJ;AAKeK,yFAAf,AAAgC,AAAAF;AA\u002BDpC,WAAA,AAAAG,WACI,iBA7DM,CAAA,AAAAF,iCASF,AAAG,AAAAC,8BACC,aAYG;AARC,AAAAE,4BACI,YAAA,AAAAJ,cAAA,AAAAA,aAEQ;2BAEwB;4BADjB,AAAHE;;aAjBvBN,MACD,AAAAK,kBAAA,AAAG,OAAA,AAAAD,gCACC,aAGuC;AAA5B,AAAAI,4BAAoBR;WA0D3B,AAAAI,aADC,AAAAI,mBAEA,2CAnBbC,aACI;AAGY,AAAAD,4BACI,YACaX,QADb,AAAAO,aAAA,AAAAA;OAzBd,CAAA,AAAAI;AAKE,AAAAA,4BACI,YAAA,AAAAJ,cAAA,AAAAA,aAEQ;2BACO,AAAHE;4BAEQ,YAAQI,OAAM,AAAAJ;;SAVxB,WA4BH,OAAA,AAAAF,\u002BBACE,OAAA,AAAAA;AAbrB,YAAA,AAAAE;mBAAA;;;AAA\u002BB,mBAAA,iBAAaI,SAAM,AAAAJ;;SAnDlD,AAAAL","file":null,"sourcesContent":null,"sourceRoot":null}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[<AutoOpen>]
|
|
2
|
+
module Fable.React.Extensions
|
|
3
|
+
|
|
4
|
+
open Fable.Core
|
|
5
|
+
|
|
6
|
+
type Browser.Types.Event with
|
|
7
|
+
/// Access the value from target
|
|
8
|
+
/// Equivalent to `(this.target :?> HTMLInputElement).value`
|
|
9
|
+
[<Emit("$0.target.value")>]
|
|
10
|
+
member this.Value: string =
|
|
11
|
+
(this.target :?> Browser.Types.HTMLInputElement).value
|
|
12
|
+
|
|
13
|
+
/// Access the checked property from target
|
|
14
|
+
/// Equivalent to `(this.target :?> HTMLInputElement).checked`
|
|
15
|
+
[<Emit("$0.target.checked")>]
|
|
16
|
+
member this.Checked: bool =
|
|
17
|
+
(this.target :?> Browser.Types.HTMLInputElement).``checked``
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
namespace Fable.React
|
|
2
|
+
|
|
3
|
+
open Fable.Core
|
|
4
|
+
|
|
5
|
+
type IStateHook<'T> =
|
|
6
|
+
[<Emit("$0[0]")>]
|
|
7
|
+
abstract current: 'T
|
|
8
|
+
[<Emit("$0[1]($1)")>]
|
|
9
|
+
abstract update: 'T -> unit
|
|
10
|
+
[<Emit("$0[1]($1)")>]
|
|
11
|
+
abstract update: ('T -> 'T) -> unit
|
|
12
|
+
|
|
13
|
+
// Alias kept for backwards compatibility
|
|
14
|
+
type IRefHook<'T> = IRefValue<'T>
|
|
15
|
+
|
|
16
|
+
type IReducerHook<'State,'Msg> =
|
|
17
|
+
[<Emit("$0[0]")>]
|
|
18
|
+
abstract current: 'State
|
|
19
|
+
[<Emit("$0[1]($1)")>]
|
|
20
|
+
abstract update: 'Msg -> unit
|
|
21
|
+
|
|
22
|
+
type ITransitionHook =
|
|
23
|
+
[<Emit("$0[0]")>]
|
|
24
|
+
abstract isPending: bool
|
|
25
|
+
[<Emit("$0[1]($1)")>]
|
|
26
|
+
abstract startTransition: callback: (unit -> unit) -> unit
|
|
27
|
+
|
|
28
|
+
type IHooks =
|
|
29
|
+
/// Returns the current state with a function to update it.
|
|
30
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usestate
|
|
31
|
+
abstract useState: initialState: 'T -> IStateHook<'T>
|
|
32
|
+
|
|
33
|
+
/// Returns the current state with a function to update it.
|
|
34
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usestate
|
|
35
|
+
[<Emit("$0.useState($1)")>]
|
|
36
|
+
abstract useStateLazy: initialState: (unit->'T) -> IStateHook<'T>
|
|
37
|
+
|
|
38
|
+
/// Accepts a function that contains imperative, possibly effectful code.
|
|
39
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#useeffect
|
|
40
|
+
abstract useEffect: effect: (unit->unit) * ?dependencies: obj[] -> unit
|
|
41
|
+
|
|
42
|
+
/// Accepts a function that contains imperative, possibly effectful code.
|
|
43
|
+
/// The signature is identical to useEffect, but it fires synchronously after
|
|
44
|
+
/// all DOM mutations. Use this to read layout from the DOM and synchronously
|
|
45
|
+
/// re-render. Updates scheduled inside useLayoutEffect will be flushed
|
|
46
|
+
/// synchronously, before the browser has a chance to paint.
|
|
47
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
48
|
+
abstract useLayoutEffect: effect: (unit->unit) * ?dependencies: obj[] -> unit
|
|
49
|
+
|
|
50
|
+
/// Accepts a function that contains effectful code and returns a disposable for clean-up
|
|
51
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#useeffect
|
|
52
|
+
[<Emit("""$0.useEffect(() => {
|
|
53
|
+
const disp = $1();
|
|
54
|
+
return () => disp.Dispose();
|
|
55
|
+
}{{, $2}})""")>]
|
|
56
|
+
abstract useEffectDisposable: effect: (unit->System.IDisposable) * ?dependencies: obj[] -> unit
|
|
57
|
+
|
|
58
|
+
// abstract useCallback (callback: unit -> unit, dependencies: obj[]): unit -> unit
|
|
59
|
+
|
|
60
|
+
/// Accepts a "create" function and an array of dependencies and returns a memoized value
|
|
61
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usememo
|
|
62
|
+
abstract useMemo: callback: (unit->'T) * dependencies: obj[] -> 'T
|
|
63
|
+
|
|
64
|
+
/// The returned object will persist for the full lifetime of the component.
|
|
65
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#useref
|
|
66
|
+
abstract useRef: initialValue: 'T -> IRefValue<'T>
|
|
67
|
+
|
|
68
|
+
/// Accepts a context object (the value returned from createContext) and
|
|
69
|
+
/// returns the current context value for that context. The current context
|
|
70
|
+
/// value is determined by the value prop of the nearest <MyContext.Provider>
|
|
71
|
+
/// above the calling component in the tree.
|
|
72
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usecontext
|
|
73
|
+
abstract useContext: ctx: IContext<'T> -> 'T
|
|
74
|
+
|
|
75
|
+
/// Display a label for custom hooks in React DevTools.
|
|
76
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usedebugvalue
|
|
77
|
+
abstract useDebugValue: label: string -> unit
|
|
78
|
+
|
|
79
|
+
/// Defers formatting of debug value until the Hook is actually inspected
|
|
80
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usedebugvalue
|
|
81
|
+
abstract useDebugValue: value: 'T * format: ('T->string) -> unit
|
|
82
|
+
|
|
83
|
+
/// An alternative to useState. Accepts a reducer of type (state, action) => newState, and returns the current state paired with a dispatch method.
|
|
84
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usereducer
|
|
85
|
+
abstract useReducer: reducer: ('State -> 'Msg -> 'State) * initialState: 'State -> IReducerHook<'State, 'Msg>
|
|
86
|
+
|
|
87
|
+
/// An alternative to useState. Accepts a reducer of type (state, action) => newState, and returns the current state paired with a dispatch method.
|
|
88
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usereducer
|
|
89
|
+
abstract useReducer: reducer: ('State -> 'Msg -> 'State) * initialArg: 'I * init: ('I -> 'State) -> IReducerHook<'State, 'Msg>
|
|
90
|
+
|
|
91
|
+
/// Returns a stateful value for the pending state of the transition, and a function to start it.
|
|
92
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usetransition
|
|
93
|
+
/// Requires React 18.
|
|
94
|
+
abstract useTransition: unit -> ITransitionHook
|
|
95
|
+
|
|
96
|
+
/// useId is a hook for generating unique IDs that are stable across the server and client, while avoiding hydration mismatches.
|
|
97
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#useid
|
|
98
|
+
/// Requires React 18.
|
|
99
|
+
abstract useId: unit -> string
|
|
100
|
+
|
|
101
|
+
/// useDeferredValue accepts a value and returns a new copy of the value that will defer to more urgent updates. If the current render is the result of an urgent update, like user input, React will return the previous value and then render the new value after the urgent render has completed.
|
|
102
|
+
/// More info at https://reactjs.org/docs/hooks-reference.html#usedeferredvalue
|
|
103
|
+
/// Requires React 18.
|
|
104
|
+
abstract useDeferredValue: 'T -> 'T
|
|
105
|
+
|
|
106
|
+
[<AutoOpen>]
|
|
107
|
+
module HookBindings =
|
|
108
|
+
let private makeDummyStateHook value =
|
|
109
|
+
{ new IStateHook<'T> with
|
|
110
|
+
member __.current = value
|
|
111
|
+
member __.update(x: 'T) = ()
|
|
112
|
+
member __.update(f: 'T->'T) = () }
|
|
113
|
+
|
|
114
|
+
let private makeDummyReducerHook state =
|
|
115
|
+
{ new IReducerHook<'State,'Msg> with
|
|
116
|
+
member __.current = state
|
|
117
|
+
member __.update(msg: 'Msg) = () }
|
|
118
|
+
|
|
119
|
+
let private makeDummyTransitionHook () =
|
|
120
|
+
{ new ITransitionHook with
|
|
121
|
+
member __.isPending = false
|
|
122
|
+
member __.startTransition callback = () }
|
|
123
|
+
|
|
124
|
+
#if FABLE_REPL_LIB
|
|
125
|
+
[<Global("React")>]
|
|
126
|
+
#else
|
|
127
|
+
[<Import("*", "react")>]
|
|
128
|
+
#endif
|
|
129
|
+
let Hooks: IHooks =
|
|
130
|
+
// Placeholder for SSR
|
|
131
|
+
{ new IHooks with
|
|
132
|
+
member __.useState(initialState: 'T) =
|
|
133
|
+
makeDummyStateHook initialState
|
|
134
|
+
member __.useStateLazy(initialState) =
|
|
135
|
+
makeDummyStateHook (initialState())
|
|
136
|
+
member __.useEffect(effect, dependencies) = ()
|
|
137
|
+
member __.useEffectDisposable(effect, dependencies) = ()
|
|
138
|
+
member __.useMemo(callback, dependencies) = callback()
|
|
139
|
+
member __.useRef(initialValue) =
|
|
140
|
+
{ new IRefValue<_> with
|
|
141
|
+
member __.current with get() = initialValue and set _ = () }
|
|
142
|
+
member __.useContext ctx =
|
|
143
|
+
(ctx :?> ISSRContext<_>).DefaultValue
|
|
144
|
+
member __.useDebugValue(label): unit = ()
|
|
145
|
+
member __.useDebugValue(value, format): unit = ()
|
|
146
|
+
member __.useReducer(reducer,initialState) = makeDummyReducerHook initialState
|
|
147
|
+
member __.useReducer(reducer, initialArgument, init) = makeDummyReducerHook (init initialArgument)
|
|
148
|
+
member __.useTransition() = makeDummyTransitionHook()
|
|
149
|
+
member __.useDeferredValue value = value
|
|
150
|
+
member __.useId() = ""
|
|
151
|
+
member __.useLayoutEffect(effect, dependencies) = ()
|
|
152
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function HookBindings_makeDummyStateHook(value) {
|
|
6
|
+
return {
|
|
7
|
+
current: value,
|
|
8
|
+
update (x) {},
|
|
9
|
+
update (f) {}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function HookBindings_makeDummyReducerHook(state) {
|
|
13
|
+
return {
|
|
14
|
+
current: state,
|
|
15
|
+
update (msg) {}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function HookBindings_makeDummyTransitionHook() {
|
|
19
|
+
return {
|
|
20
|
+
isPending: false,
|
|
21
|
+
startTransition (callback) {}
|
|
22
|
+
};
|
|
23
|
+
} //# sourceMappingURL=Fable.React.Hooks.fs.ts.map
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=Fable.React.Hooks.fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.ts"],"names":["value","state"],"mappings":";;;;;;iBA6GgCA;;;;;;;iBAMAC;;;;;;mBAKE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["./Fable.React.Hooks.fs"],"names":["value","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6GgCA;;;;;;;;;;iBAMAC;;;;;;;;mBAKE","file":null,"sourcesContent":null,"sourceRoot":null}
|