@dfosco/storyboard-react-reshaped 1.14.0 → 1.15.1
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 +1 -1
- package/src/Checkbox.jsx +0 -1
- package/src/Select.jsx +0 -1
- package/src/StoryboardForm.jsx +3 -3
- package/src/TextInput.jsx +0 -1
- package/src/Textarea.jsx +0 -1
package/package.json
CHANGED
package/src/Checkbox.jsx
CHANGED
package/src/Select.jsx
CHANGED
package/src/StoryboardForm.jsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/* eslint-disable react/prop-types */
|
|
2
1
|
import { useRef, useCallback } from 'react'
|
|
3
2
|
import { FormContext } from '@dfosco/storyboard-react'
|
|
4
|
-
import { setParam } from '@dfosco/storyboard-core'
|
|
3
|
+
import { setParam, isHideMode, setShadow } from '@dfosco/storyboard-core'
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* A form wrapper that buffers input values locally and only
|
|
@@ -32,8 +31,9 @@ export default function StoryboardForm({ data, onSubmit, children, ...props }) {
|
|
|
32
31
|
const handleSubmit = (e) => {
|
|
33
32
|
e.preventDefault()
|
|
34
33
|
if (prefix) {
|
|
34
|
+
const write = isHideMode() ? setShadow : setParam
|
|
35
35
|
for (const [name, value] of Object.entries(draftsRef.current)) {
|
|
36
|
-
|
|
36
|
+
write(`${prefix}.${name}`, value)
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
if (onSubmit) onSubmit(e)
|
package/src/TextInput.jsx
CHANGED
package/src/Textarea.jsx
CHANGED