vanjs-jsf 0.0.12 → 0.0.13

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/dist/main.js CHANGED
@@ -55,49 +55,23 @@ const jsonSchemaDemo = {
55
55
  };
56
56
  // App
57
57
  const App = () => {
58
- let initialValues = {
59
- type: "image",
60
- identifier: "a",
61
- cron: "",
62
- name: "",
63
- tag: "",
64
- configurationPath: "",
65
- header: "{}",
66
- body: "{}",
67
- method: "",
68
- url: ""
69
- };
70
- const formValues = {
71
- type: "image",
72
- identifier: "",
73
- cron: "",
74
- name: "",
75
- tag: "",
76
- configurationPath: "",
77
- header: "{}",
78
- body: "{}",
79
- method: "",
80
- url: ""
81
- };
82
- const isValid = van.state(false);
58
+ const initialValues = { pet_name: "Simon" };
83
59
  const jsfConfig = {
84
60
  strictInputType: false,
85
61
  initialValues: initialValues,
86
- formValues: formValues,
87
- //valid: isValid
62
+ formValues: initialValues,
88
63
  };
89
- const handleOnChange = (e) => {
90
- //e.preventDefault();
64
+ const handleOnSubmit = (e) => {
65
+ e.preventDefault();
91
66
  const values = jsfConfig.formValues;
92
- //alert(`Submitted successfully: ${JSON.stringify(values, null, 2)}`);
67
+ alert(`Submitted successfully: ${JSON.stringify(values, null, 2)}`);
68
+ console.log("Submitted!", values);
93
69
  };
94
- const closed = van.state(false);
95
- return div(h1("json-schema-form + VanJS"), p("This demo uses VanJS without any other form library."), p(() => isValid.val), jsform({
70
+ return div(h1("json-schema-form + VanJS"), p("This demo uses VanJS without any other form library."), jsform({
96
71
  name: "my-jsf-form",
97
72
  schema: jsonSchemaDemo,
98
73
  config: jsfConfig,
99
- isValid: isValid,
100
- onchange: handleOnChange,
74
+ onsubmit: handleOnSubmit,
101
75
  }, button({ type: "submit" }, "Submit")));
102
76
  };
103
77
  // Render the app
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "form",
9
9
  "ui-library"
10
10
  ],
11
- "version": "0.0.12",
11
+ "version": "0.0.13",
12
12
  "author": {
13
13
  "name": "Carlos Prados",
14
14
  "email": "carlos.prados@gmail.com"
@@ -41,6 +41,7 @@
41
41
  "eslint4b-prebuilt": "^6.7.2",
42
42
  "globals": "^15.15.0",
43
43
  "pikaday": "^1.8.2",
44
+ "van-ui-extended": "^0.0.6",
44
45
  "vanjs-core": "^1.5.3",
45
46
  "vanjs-ext": "^0.6.2"
46
47
  },