@kaspernj/api-maker 1.0.410 → 1.0.412
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.jsx +7 -2
- package/src/table/model-row.jsx +6 -6
- package/src/table/table.jsx +5 -1
package/package.json
CHANGED
package/src/inputs/input.jsx
CHANGED
|
@@ -216,14 +216,19 @@ const ApiMakerInputsInput = memo(shapeComponent(class ApiMakerInputsInput extend
|
|
|
216
216
|
|
|
217
217
|
onInputChanged = (e) => {
|
|
218
218
|
const {form} = this.tt
|
|
219
|
-
const {attribute, autoSubmit, inputProps, model,
|
|
219
|
+
const {attribute, autoSubmit, inputProps, model, onChange} = this.props
|
|
220
220
|
const {localizedNumber} = digs(this.props, "localizedNumber")
|
|
221
|
+
const {name} = inputProps
|
|
221
222
|
|
|
222
223
|
if (localizedNumber) this.inputReference().current.value = this.actualValue(digg(e, "target"))
|
|
223
224
|
|
|
224
225
|
if (attribute && autoSubmit && model) this.delayAutoSubmit()
|
|
225
226
|
if (digg(inputProps, "type") == "file") this.setState({blankInputName: this.getBlankInputName()})
|
|
226
|
-
|
|
227
|
+
|
|
228
|
+
if (form && name) {
|
|
229
|
+
form.setValue(name, e.target.value)
|
|
230
|
+
}
|
|
231
|
+
|
|
227
232
|
if (onChange) onChange(e)
|
|
228
233
|
}
|
|
229
234
|
|
package/src/table/model-row.jsx
CHANGED
|
@@ -64,7 +64,7 @@ export default memo(shapeComponent(class ApiMakerBootStrapLiveTableModelRow exte
|
|
|
64
64
|
</Column>
|
|
65
65
|
}
|
|
66
66
|
{columns && this.columnsContentFromColumns(model, even)}
|
|
67
|
-
<Column dataSet={{class: "actions-column"}} style={styleForColumn({even, style: {
|
|
67
|
+
<Column dataSet={{class: "actions-column"}} style={styleForColumn({even, style: {}, type: "actions"})}>
|
|
68
68
|
{actionsContent && actionsContent(this.modelCallbackArgs)}
|
|
69
69
|
{viewPath &&
|
|
70
70
|
<Link dataSet={{class: "view-button"}} to={viewPath}>
|
|
@@ -96,7 +96,7 @@ export default memo(shapeComponent(class ApiMakerBootStrapLiveTableModelRow exte
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
columnsContentFromColumns(model, even) {
|
|
99
|
-
const {isSmallScreen, preparedColumns} = this.p
|
|
99
|
+
const {isSmallScreen, liveTable, preparedColumns} = this.p
|
|
100
100
|
|
|
101
101
|
return preparedColumns?.map(({column, tableSettingColumn, width}, columnIndex) => columnVisible(column, tableSettingColumn) &&
|
|
102
102
|
<Column
|
|
@@ -105,13 +105,13 @@ export default memo(shapeComponent(class ApiMakerBootStrapLiveTableModelRow exte
|
|
|
105
105
|
identifier: columnIdentifier(column)
|
|
106
106
|
}}
|
|
107
107
|
key={columnIdentifier(column)}
|
|
108
|
-
style={
|
|
109
|
-
{...
|
|
108
|
+
style={liveTable.styleForColumn({column, columnIndex, even, style: {width: `${width}%`}})}
|
|
109
|
+
{...liveTable.columnProps(column)}
|
|
110
110
|
>
|
|
111
111
|
{isSmallScreen &&
|
|
112
112
|
<View dataSet={{class: "table--column-label"}}>
|
|
113
113
|
<Text>
|
|
114
|
-
{
|
|
114
|
+
{liveTable.headerLabelForColumn(column)}
|
|
115
115
|
</Text>
|
|
116
116
|
</View>
|
|
117
117
|
}
|
|
@@ -152,7 +152,7 @@ export default memo(shapeComponent(class ApiMakerBootStrapLiveTableModelRow exte
|
|
|
152
152
|
const attribute = currentModel.constructor.attributes().find((attribute) => attribute.name() == attributeNameUnderscore)
|
|
153
153
|
const modelColumn = attribute?.getColumn()
|
|
154
154
|
|
|
155
|
-
if (modelColumn?.getType() == "date") {
|
|
155
|
+
if (modelColumn?.getType() == "date" && value) {
|
|
156
156
|
return (
|
|
157
157
|
<Text>{this.presentDateTime({apiMakerType: "date", value})}</Text>
|
|
158
158
|
)
|
package/src/table/table.jsx
CHANGED
|
@@ -495,7 +495,11 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
495
495
|
backgroundColor: even ? "#f5f5f5" : undefined
|
|
496
496
|
}
|
|
497
497
|
|
|
498
|
-
if (type
|
|
498
|
+
if (type == "actions") {
|
|
499
|
+
defaultStyle.flexDirection = "row"
|
|
500
|
+
defaultStyle.alignItems = "center"
|
|
501
|
+
defaultStyle.marginLeft = "auto"
|
|
502
|
+
} else {
|
|
499
503
|
defaultStyle.borderRight = "1px solid #dbdbdb"
|
|
500
504
|
}
|
|
501
505
|
|