@kaspernj/api-maker 1.0.260 → 1.0.262
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/inputs/input-wrapper.jsx +21 -11
- package/src/table/model-row.jsx +1 -1
package/package.json
CHANGED
|
@@ -20,16 +20,16 @@ const inputWrapper = (WrapperComponentClass, wrapperOptions = {}) => {
|
|
|
20
20
|
this.setForm()
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
inputProps() {
|
|
24
|
+
const givenInputProps = this.props.inputProps || {}
|
|
25
|
+
const inputProps = Object.assign(
|
|
26
|
+
{
|
|
27
|
+
id: idForComponent(this),
|
|
28
|
+
name: nameForComponent(this),
|
|
29
|
+
ref: this.inputRef()
|
|
30
|
+
},
|
|
31
|
+
givenInputProps
|
|
32
|
+
)
|
|
33
33
|
|
|
34
34
|
if (this.handleAsCheckbox()) {
|
|
35
35
|
inputProps.defaultChecked = this.inputDefaultChecked()
|
|
@@ -37,6 +37,16 @@ const inputWrapper = (WrapperComponentClass, wrapperOptions = {}) => {
|
|
|
37
37
|
inputProps.defaultValue = this.inputDefaultValue()
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
return inputProps
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
render() {
|
|
44
|
+
const {inputProps: oldInputProps, ...restProps} = this.props
|
|
45
|
+
const {errors, form} = digs(this.state, "errors", "form")
|
|
46
|
+
const type = this.inputType()
|
|
47
|
+
const inputProps = this.inputProps()
|
|
48
|
+
|
|
49
|
+
if (!inputProps.ref) throw new Error("No input ref?")
|
|
40
50
|
if (!this.handleAsSelect()) inputProps.type = type
|
|
41
51
|
|
|
42
52
|
const wrapperOpts = {
|
|
@@ -53,7 +63,7 @@ const inputWrapper = (WrapperComponentClass, wrapperOptions = {}) => {
|
|
|
53
63
|
<WrapperComponentClass
|
|
54
64
|
inputProps={inputProps}
|
|
55
65
|
wrapperOpts={wrapperOpts}
|
|
56
|
-
{...
|
|
66
|
+
{...restProps}
|
|
57
67
|
/>
|
|
58
68
|
</>
|
|
59
69
|
)
|
package/src/table/model-row.jsx
CHANGED
|
@@ -117,7 +117,7 @@ export default class ApiMakerBootStrapLiveTableModelRow extends React.PureCompon
|
|
|
117
117
|
_modelCallbackArgs () {
|
|
118
118
|
const {model} = digs(this.props, "model")
|
|
119
119
|
const modelArgName = inflection.camelize(this.props.liveTable.props.modelClass.modelClassData().name, true)
|
|
120
|
-
const modelCallbackArgs = {}
|
|
120
|
+
const modelCallbackArgs = {model}
|
|
121
121
|
|
|
122
122
|
modelCallbackArgs[modelArgName] = model
|
|
123
123
|
|