@kaspernj/api-maker 1.0.250 → 1.0.252
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/bootstrap/input.jsx +12 -7
- package/src/routes-native.mjs +3 -1
package/package.json
CHANGED
package/src/bootstrap/input.jsx
CHANGED
|
@@ -71,16 +71,10 @@ class ApiMakerBootstrapInput extends React.PureComponent {
|
|
|
71
71
|
}
|
|
72
72
|
{type == "money" &&
|
|
73
73
|
<Money
|
|
74
|
-
attribute={attribute}
|
|
75
|
-
currenciesCollection={currenciesCollection}
|
|
76
|
-
currencyName={currencyName}
|
|
77
|
-
model={model}
|
|
78
74
|
name={inputProps.name}
|
|
79
75
|
className={this.inputClassName()}
|
|
80
|
-
onChange={this.props.onChange}
|
|
81
|
-
placeholder={this.props.placeholder}
|
|
82
|
-
small={this.props.small}
|
|
83
76
|
ref="money"
|
|
77
|
+
{...this.moneyProps()}
|
|
84
78
|
/>
|
|
85
79
|
}
|
|
86
80
|
{type != "money" &&
|
|
@@ -147,6 +141,17 @@ class ApiMakerBootstrapInput extends React.PureComponent {
|
|
|
147
141
|
return classNames.join(" ")
|
|
148
142
|
}
|
|
149
143
|
|
|
144
|
+
moneyProps() {
|
|
145
|
+
const moneyProps = {}
|
|
146
|
+
const forwardedProps = ["attribute", "currenciesCollection", "currencyName", "model", "onChange", "placeholder", "small"]
|
|
147
|
+
|
|
148
|
+
for (const forwardedProp of forwardedProps) {
|
|
149
|
+
if (forwardedProp in this.props) moneyProps[forwardedProp] = this.props[forwardedProp]
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return moneyProps
|
|
153
|
+
}
|
|
154
|
+
|
|
150
155
|
wrapperClassName () {
|
|
151
156
|
const classNames = ["form-group", "component-bootstrap-string-input"]
|
|
152
157
|
|
package/src/routes-native.mjs
CHANGED
|
@@ -81,7 +81,9 @@ export default class ApiMakerRoutesNative {
|
|
|
81
81
|
let options
|
|
82
82
|
|
|
83
83
|
// Extract options from args if any
|
|
84
|
-
|
|
84
|
+
const lastArg = args[args.length - 1]
|
|
85
|
+
|
|
86
|
+
if (lastArg && typeof lastArg == "object") {
|
|
85
87
|
options = args.pop()
|
|
86
88
|
} else {
|
|
87
89
|
options = {}
|