@axdspub/axiom-ui-forms 0.1.2 → 0.1.4
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/.gitlab-ci.yml +0 -31
- package/README.md +172 -8
- package/library/axiom-ui-forms.d.ts +9 -1
- package/library/index.js +306 -254
- package/library/index.js.map +1 -1
- package/library/umd.js +600 -547
- package/library/umd.js.map +1 -1
- package/package.json +3 -2
- package/rollup.config.mjs +10 -0
- package/src/Form/Components/FieldCreator.tsx +1 -1
- package/src/Form/SchemaToForm.tsx +3 -3
- package/src/Form/index.ts +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@axdspub/axiom-ui-forms",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.4",
|
4
4
|
"private": false,
|
5
5
|
"main": "./library/index.js",
|
6
6
|
"module": "./library/index.js",
|
@@ -42,7 +42,7 @@
|
|
42
42
|
},
|
43
43
|
"scripts": {
|
44
44
|
"start": "set PORT=3080 && craco start ",
|
45
|
-
"build": "craco build",
|
45
|
+
"build": "craco build && npx typedoc src/library.ts --out build/docs",
|
46
46
|
"test": "craco test",
|
47
47
|
"eject": "react-scripts eject",
|
48
48
|
"clean": "rimraf library",
|
@@ -97,6 +97,7 @@
|
|
97
97
|
"eslint-plugin-react": "^7.33.2",
|
98
98
|
"tailwindcss": "^3.3.3",
|
99
99
|
"ts-node": "^10.9.1",
|
100
|
+
"typedoc": "^0.27.7",
|
100
101
|
"web-vitals": "^2.1.4",
|
101
102
|
"webpack": "^5.88.2"
|
102
103
|
}
|
package/rollup.config.mjs
CHANGED
@@ -30,6 +30,16 @@ const config = [
|
|
30
30
|
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
|
31
31
|
return
|
32
32
|
}
|
33
|
+
// got same warning as with d3.. assuming same deal for now (bostock sez: it's allowed in the spec, not gonna fix. just supress it)
|
34
|
+
// https://github.com/d3/d3-selection/issues/168#issuecomment-451983830
|
35
|
+
if (warning.code === 'CIRCULAR_DEPENDENCY') return
|
36
|
+
|
37
|
+
// rollup says - what do you expect to happen with eval? make sure code isn't evil https://github.com/rollup/rollup/issues/4366#issuecomment-1023346209
|
38
|
+
// cesium says - there's a reason we use eval and (I'm assuming they aren't particularly evil)
|
39
|
+
// also, it sounds like they're getting close to removing eval
|
40
|
+
// https://github.com/CesiumGS/cesium/issues/9024#issuecomment-1533025563 and https://github.com/CesiumGS/cesium/issues/9473 (and FF blocker https://bugzilla.mozilla.org/show_bug.cgi?id=1247687)
|
41
|
+
if (warning.code === 'EVAL') return
|
42
|
+
|
33
43
|
warn(warning)
|
34
44
|
},
|
35
45
|
output: [
|
@@ -55,7 +55,7 @@ const validateAgainstSchema = (schema: JSONSchema7, formValues: IFormValues): st
|
|
55
55
|
return undefined
|
56
56
|
}
|
57
57
|
|
58
|
-
const
|
58
|
+
const makeFormFieldId = (options: Array<string | number | undefined | null>): string => {
|
59
59
|
const validOptions = options.filter((o) => o !== undefined && o !== null)
|
60
60
|
if (validOptions.length === 0) {
|
61
61
|
return crypto !== undefined ? crypto.randomUUID() : Math.random().toString(36).substring(2)
|
@@ -144,7 +144,7 @@ const schemaToFormField = (schema: JSONSchema7, property: string, multiple?: boo
|
|
144
144
|
return schemaToFormField(schema.items as JSONSchema7, property, true)
|
145
145
|
}
|
146
146
|
const type = getFieldType(schema)
|
147
|
-
const id =
|
147
|
+
const id = makeFormFieldId([
|
148
148
|
schema.$id,
|
149
149
|
property,
|
150
150
|
schema.title?.toLowerCase().replace(' ', '-')
|
@@ -214,7 +214,7 @@ export const schemaToFormObject = (schema: JSONSchema7): IForm => {
|
|
214
214
|
}
|
215
215
|
}
|
216
216
|
return {
|
217
|
-
id:
|
217
|
+
id: makeFormFieldId([schema.$id, schema.title?.toLowerCase().replace(' ', '-')]),
|
218
218
|
label: schema.title ?? 'Untitled',
|
219
219
|
fields: formFields
|
220
220
|
}
|
package/src/Form/index.ts
CHANGED