@kaspernj/api-maker 1.0.395 → 1.0.396

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": "@kaspernj/api-maker",
3
- "version": "1.0.395",
3
+ "version": "1.0.396",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "index.js",
@@ -34,15 +34,18 @@ const ApiMakerInputsInput = memo(shapeComponent(class ApiMakerInputsInput extend
34
34
  }
35
35
 
36
36
  setup() {
37
+ const {inputProps} = this.p
38
+ const {defaultValue, name} = inputProps
39
+
37
40
  this.form = useForm()
38
41
  this.visibleInputRef = useRef()
39
42
 
40
43
  this.useStates({
41
- blankInputName: digg(this, "props", "inputProps", "type") == "file"
44
+ blankInputName: digg(inputProps, "type") == "file"
42
45
  })
43
46
  useMemo(() => {
44
- if ("defaultValue" in this.props) {
45
- this.tt.form?.setValue(this.props.defaultValue)
47
+ if (name) {
48
+ this.tt.form?.setValue(name, defaultValue)
46
49
  }
47
50
  }, [])
48
51
  }
@@ -3,7 +3,9 @@ import debounceFunction from "debounce"
3
3
  import ModelEvents from "./model-events.mjs"
4
4
  import useShape from "set-state-compare/src/use-shape.js"
5
5
 
6
- const apiMakerUseUpdatedEvent = (model, onUpdated, {active = true, debounce, onConnected, ...restProps}) => {
6
+ const apiMakerUseUpdatedEvent = (model, onUpdated, props = {}) => {
7
+ const {active = true, debounce, onConnected, ...restProps} = props
8
+
7
9
  if (Object.keys(restProps).length > 0) {
8
10
  throw new Error(`Unknown props given to useUpdatedEvent: ${Object.keys(restProps).join(", ")}`)
9
11
  }