@axdspub/axiom-ui-forms 0.1.3 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axdspub/axiom-ui-forms",
3
- "version": "0.1.3",
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
  }
@@ -91,7 +91,7 @@ const OneOfMultiple = ({
91
91
  value={value}
92
92
  onChange={(v) => {
93
93
  const newValues = [...values]
94
- newValues[index] = String(v)
94
+ newValues[index] = v as IValueType
95
95
  onChange(newValues)
96
96
  }}
97
97
  />
@@ -55,7 +55,7 @@ const validateAgainstSchema = (schema: JSONSchema7, formValues: IFormValues): st
55
55
  return undefined
56
56
  }
57
57
 
58
- const makeId = (options: Array<string | number | undefined | null>): string => {
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 = makeId([
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: makeId([schema.$id, schema.title?.toLowerCase().replace(' ', '-')]),
217
+ id: makeFormFieldId([schema.$id, schema.title?.toLowerCase().replace(' ', '-')]),
218
218
  label: schema.title ?? 'Untitled',
219
219
  fields: formFields
220
220
  }