@kaspernj/api-maker 1.0.2025 → 1.0.2027
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/build/bootstrap/attribute-row.js +5 -5
- package/build/bootstrap/sort-link.js +3 -3
- package/build/draggable-sort/index.js +6 -6
- package/build/draggable-sort/item.js +6 -6
- package/build/link.js +2 -2
- package/build/modal.js +4 -4
- package/build/super-admin/edit-page/edit-attribute-checkbox.js +3 -3
- package/build/super-admin/edit-page/edit-attribute-input.js +4 -4
- package/build/super-admin/edit-page/edit-attribute.js +5 -5
- package/build/super-admin/edit-page.js +5 -5
- package/build/super-admin/layout/header/index.js +13 -16
- package/build/super-admin/layout/menu/index.js +7 -7
- package/build/table/filters/filter.js +4 -4
- package/build/table/filters/index.js +7 -5
- package/build/table/header-column-content.js +6 -6
- package/build/table/header-column.js +3 -3
- package/build/table/header-select.js +5 -5
- package/build/table/model-column.js +4 -4
- package/build/table/model-row.js +9 -9
- package/build/table/settings/column-row.js +3 -3
- package/build/table/settings/download-action.js +3 -3
- package/build/table/settings/index.js +8 -8
- package/build/table/table.js +10 -14
- package/build/utils/card.js +2 -1
- package/build/utils/checkbox.js +2 -2
- package/build/utils/checkboxes.js +9 -11
- package/build/utils/icon.js +1 -6
- package/build/utils/invalid-feedback.js +2 -2
- package/build/utils/modal.js +11 -10
- package/package.json +1 -1
- package/src/bootstrap/attribute-row.jsx +2 -2
- package/src/bootstrap/sort-link.jsx +2 -2
- package/src/draggable-sort/index.jsx +23 -24
- package/src/draggable-sort/item.jsx +11 -14
- package/src/link.jsx +1 -1
- package/src/modal.jsx +3 -3
- package/src/super-admin/edit-page/edit-attribute-checkbox.jsx +4 -1
- package/src/super-admin/edit-page/edit-attribute-input.jsx +11 -3
- package/src/super-admin/edit-page/edit-attribute.jsx +5 -2
- package/src/super-admin/edit-page.jsx +4 -4
- package/src/super-admin/layout/header/index.jsx +13 -13
- package/src/super-admin/layout/menu/index.jsx +6 -6
- package/src/table/filters/filter.jsx +6 -2
- package/src/table/filters/index.jsx +2 -2
- package/src/table/header-column-content.jsx +5 -5
- package/src/table/header-column.jsx +2 -2
- package/src/table/header-select.jsx +9 -4
- package/src/table/model-column.jsx +3 -3
- package/src/table/model-row.jsx +9 -5
- package/src/table/settings/column-row.jsx +1 -1
- package/src/table/settings/download-action.jsx +2 -2
- package/src/table/settings/index.jsx +7 -7
- package/src/table/table.jsx +8 -8
- package/src/utils/card.jsx +1 -0
- package/src/utils/checkbox.jsx +1 -1
- package/src/utils/checkboxes.jsx +8 -9
- package/src/utils/icon.jsx +0 -4
- package/src/utils/invalid-feedback.jsx +1 -1
- package/src/utils/modal.jsx +14 -10
|
@@ -90,16 +90,16 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayoutHeader extends
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
return (
|
|
93
|
-
<View dataSet={{component: "super-admin--layout--header"}} style={headerStyle}>
|
|
94
|
-
<View dataSet={{class: "header-title-container"}}>
|
|
95
|
-
<Text style={{color: "#282a33", fontSize: 22}}>
|
|
93
|
+
<View dataSet={this.rootViewDataSet ||= {component: "super-admin--layout--header"}} style={headerStyle}>
|
|
94
|
+
<View dataSet={this.headerTitleViewDataSet ||= {class: "header-title-container"}}>
|
|
95
|
+
<Text style={this.headerTitleTextStyle ||= {color: "#282a33", fontSize: 22}}>
|
|
96
96
|
{title}
|
|
97
97
|
</Text>
|
|
98
98
|
</View>
|
|
99
99
|
{actions &&
|
|
100
100
|
<View dataSet={{active: this.s.headerActionsActive, class: "header-actions-container"}} style={headerActionsContainerStyle}>
|
|
101
101
|
<View
|
|
102
|
-
dataSet={{class: "header-actions"}}
|
|
102
|
+
dataSet={this.headerActionsViewDataSet ||= {class: "header-actions"}}
|
|
103
103
|
ref={this.tt.headerActionsRef}
|
|
104
104
|
style={headerActionsStyle}
|
|
105
105
|
>
|
|
@@ -109,18 +109,22 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayoutHeader extends
|
|
|
109
109
|
}
|
|
110
110
|
{!mdUp &&
|
|
111
111
|
<View
|
|
112
|
-
dataSet={{class: "burger-menu-container"}}
|
|
113
|
-
style={{
|
|
112
|
+
dataSet={this.burgerMenuContainerDataSet ||= {class: "burger-menu-container"}}
|
|
113
|
+
style={this.burgerMenuContainerStyle ||= {
|
|
114
114
|
flexDirection: "row",
|
|
115
115
|
marginLeft: "auto"
|
|
116
116
|
}}
|
|
117
117
|
>
|
|
118
118
|
{actions &&
|
|
119
|
-
<Pressable
|
|
119
|
+
<Pressable
|
|
120
|
+
dataSet={this.actionsLinkDataSet ||= {class: "actions-link"}}
|
|
121
|
+
onPress={this.tt.onGearsClicked}
|
|
122
|
+
style={this.actionsLinkStyle ||= {marginRight: 8, fontSize: 22}}
|
|
123
|
+
>
|
|
120
124
|
<Icon name="gear" size={20} />
|
|
121
125
|
</Pressable>
|
|
122
126
|
}
|
|
123
|
-
<Pressable dataSet={{class: "burger-menu-link"}} onPress={onTriggerMenu}>
|
|
127
|
+
<Pressable dataSet={this.burgerMenuLinkDataSet ||= {class: "burger-menu-link"}} onPress={onTriggerMenu}>
|
|
124
128
|
<Icon name="bars" size={20} />
|
|
125
129
|
</Pressable>
|
|
126
130
|
</View>
|
|
@@ -129,11 +133,7 @@ export default memo(shapeComponent(class ApiMakerSuperAdminLayoutHeader extends
|
|
|
129
133
|
)
|
|
130
134
|
}
|
|
131
135
|
|
|
132
|
-
onGearsClicked = () => {
|
|
133
|
-
console.log("onGearsClicked")
|
|
134
|
-
|
|
135
|
-
this.setState({headerActionsActive: !this.s.headerActionsActive})
|
|
136
|
-
}
|
|
136
|
+
onGearsClicked = () => this.setState({headerActionsActive: !this.s.headerActionsActive})
|
|
137
137
|
|
|
138
138
|
onWindowMouseUp = (e) => {
|
|
139
139
|
// Close the header actions menu if clicked happened outside
|
|
@@ -85,20 +85,20 @@ export default memo(shapeComponent(class ComponentsAdminLayoutMenu extends BaseC
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
return (
|
|
88
|
-
<View dataSet={{component: "super-admin--layout--menu", triggered}} style={style}>
|
|
89
|
-
<WithDefaultStyle style={{Text: {color: "#fff"}}}>
|
|
88
|
+
<View dataSet={this.rootViewDataSet ||= {component: "super-admin--layout--menu", triggered}} style={style}>
|
|
89
|
+
<WithDefaultStyle style={this.withDefaultStyleStyle ||= {Text: {color: "#fff"}}}>
|
|
90
90
|
<View
|
|
91
|
-
dataSet={{class: "menu-logo"}}
|
|
92
|
-
style={{
|
|
91
|
+
dataSet={this.menuLogoViewDataSet ||= {class: "menu-logo"}}
|
|
92
|
+
style={this.menuLogoViewStyle ||= {
|
|
93
93
|
overflow: "hidden",
|
|
94
94
|
marginTop: 25,
|
|
95
95
|
marginRight: "auto",
|
|
96
96
|
marginLeft: "auto"
|
|
97
97
|
}}
|
|
98
98
|
>
|
|
99
|
-
<Link dataSet={{class: "menu-logo-link"}} to={Params.withParams({})}>
|
|
99
|
+
<Link dataSet={this.menuLogoLinkDataSet ||= {class: "menu-logo-link"}} to={Params.withParams({})}>
|
|
100
100
|
<Text
|
|
101
|
-
style={{
|
|
101
|
+
style={this.menuLogoLinkTextStyle ||= {
|
|
102
102
|
fontSize: 42,
|
|
103
103
|
textOverflow: "ellipsis",
|
|
104
104
|
whiteSpace: "nowrap"
|
|
@@ -30,7 +30,7 @@ export default memo(shapeComponent(class ApiMakerTableFilter extends BaseCompone
|
|
|
30
30
|
const {a, pre, sc} = this.props
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<View style={{alignItems: "center", flexDirection: "row", backgroundColor: "grey", paddingVertical: 10, paddingHorizontal: 6}}>
|
|
33
|
+
<View style={this.rootViewStyle ||= {alignItems: "center", flexDirection: "row", backgroundColor: "grey", paddingVertical: 10, paddingHorizontal: 6}}>
|
|
34
34
|
<Pressable
|
|
35
35
|
dataSet={{
|
|
36
36
|
attribute: a,
|
|
@@ -46,7 +46,11 @@ export default memo(shapeComponent(class ApiMakerTableFilter extends BaseCompone
|
|
|
46
46
|
{a} {sc} {pre} {v}
|
|
47
47
|
</Text>
|
|
48
48
|
</Pressable>
|
|
49
|
-
<Pressable
|
|
49
|
+
<Pressable
|
|
50
|
+
dataSet={this.removeFilterButtonDataSet ||= {class: "remove-filter-button"}}
|
|
51
|
+
onPress={this.tt.onRemoveFilterPressed}
|
|
52
|
+
style={this.removeFilterButtonStyle ||= {marginLeft: 6}}
|
|
53
|
+
>
|
|
50
54
|
<Icon name="remove" />
|
|
51
55
|
</Pressable>
|
|
52
56
|
</View>
|
|
@@ -42,7 +42,7 @@ export default memo(shapeComponent(class ApiMakerTableFilters extends BaseCompon
|
|
|
42
42
|
const currentFilters = this.currentFilters()
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
|
-
<View dataSet={{class: "api-maker--table--filters"}} style={{alignItems: "flex-start"}}>
|
|
45
|
+
<View dataSet={this.rootViewDataSet ||= {class: "api-maker--table--filters"}} style={this.rootViewStyle ||= {alignItems: "flex-start"}}>
|
|
46
46
|
{filter &&
|
|
47
47
|
<FilterForm
|
|
48
48
|
filter={filter}
|
|
@@ -78,7 +78,7 @@ export default memo(shapeComponent(class ApiMakerTableFilters extends BaseCompon
|
|
|
78
78
|
{...filterData}
|
|
79
79
|
/>
|
|
80
80
|
)}
|
|
81
|
-
<View
|
|
81
|
+
<View dataSet={this.filterActionsDataSet ||= {class: "filter-actions"}} style={this.filterActionsStyle ||= {flexDirection: "row", marginTop: 10}}>
|
|
82
82
|
<button className="add-new-filter-button" onClick={this.tt.onAddFilterClicked}>
|
|
83
83
|
{this.t(".add_new_filter", {defaultValue: "Add new filter"})}
|
|
84
84
|
</button>
|
|
@@ -26,11 +26,11 @@ export default memo(shapeComponent(class ApiMakerTableHeaderColumn extends BaseC
|
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<View
|
|
29
|
-
dataSet={{
|
|
29
|
+
dataSet={this.cache("rootViewDataSet", {
|
|
30
30
|
component: "api-maker/table/header-column-content",
|
|
31
31
|
identifier: tableSettingColumn.identifier()
|
|
32
|
-
}}
|
|
33
|
-
style={{display: "flex", flexDirection: "row", alignItems: "center"}}
|
|
32
|
+
}, [tableSettingColumn.identifier()])}
|
|
33
|
+
style={this.rootViewStyle ||= {display: "flex", flexDirection: "row", alignItems: "center"}}
|
|
34
34
|
{...columnProps}
|
|
35
35
|
>
|
|
36
36
|
{tableSettingColumn.hasSortKey() && query &&
|
|
@@ -38,14 +38,14 @@ export default memo(shapeComponent(class ApiMakerTableHeaderColumn extends BaseC
|
|
|
38
38
|
attribute={tableSettingColumn.sortKey()}
|
|
39
39
|
defaultParams={defaultParams}
|
|
40
40
|
query={query}
|
|
41
|
-
style={{whiteSpace: "nowrap", overflow: "hidden"}}
|
|
41
|
+
style={this.sortLinkStyle ||= {whiteSpace: "nowrap", overflow: "hidden"}}
|
|
42
42
|
textProps={{ellipsizeMode: "clip", numberOfLines: 1, style: styleForHeaderText()}}
|
|
43
43
|
title={table.headerLabelForColumn(column)}
|
|
44
44
|
{...this.props.sortLinkProps}
|
|
45
45
|
/>
|
|
46
46
|
}
|
|
47
47
|
{(!tableSettingColumn.hasSortKey() || !query) &&
|
|
48
|
-
<Text ellipsizeMode="clip" numberOfLines={1} style={{fontWeight: "bold"}}>
|
|
48
|
+
<Text ellipsizeMode="clip" numberOfLines={1} style={this.headerLabelStyle ||= {fontWeight: "bold"}}>
|
|
49
49
|
{table.headerLabelForColumn(column)}
|
|
50
50
|
</Text>
|
|
51
51
|
}
|
|
@@ -100,12 +100,12 @@ export default memo(shapeComponent(class ApiMakerTableHeaderColumn extends BaseC
|
|
|
100
100
|
{...restColumnProps}
|
|
101
101
|
>
|
|
102
102
|
{mdUp &&
|
|
103
|
-
<Icon name="bars" style={{marginRight: 3, fontSize: 12}} {...touchProps} />
|
|
103
|
+
<Icon name="bars" style={this.barsIconStyle ||= {marginRight: 3, fontSize: 12}} {...touchProps} />
|
|
104
104
|
}
|
|
105
105
|
<HeaderColumnContent column={column} table={table} tableSettingColumn={tableSettingColumn} />
|
|
106
106
|
{mdUp &&
|
|
107
107
|
<Animated.View
|
|
108
|
-
style={{
|
|
108
|
+
style={this.resizeColumnViewStyle ||= {
|
|
109
109
|
position: "absolute",
|
|
110
110
|
top: 0,
|
|
111
111
|
right: 0,
|
|
@@ -38,15 +38,20 @@ export default memo(shapeComponent(class ApiMakerTableHeaderSelect extends BaseC
|
|
|
38
38
|
const columnLabel = column && table.headerLabelForColumn(column)
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
|
-
<View dataSet={{component: "api-maker/table/header-select"}}>
|
|
41
|
+
<View dataSet={this.rootViewDataSet ||= {component: "api-maker/table/header-select"}}>
|
|
42
42
|
{this.s.modalOpen &&
|
|
43
|
-
<Modal dataSet={{class: "table-header-select-modal"}} onRequestClose={this.tt.onModalRequestClose} transparent>
|
|
43
|
+
<Modal dataSet={this.modalDataSet ||= {class: "table-header-select-modal"}} onRequestClose={this.tt.onModalRequestClose} transparent>
|
|
44
44
|
{this.p.preparedColumns.map(({column, tableSettingColumn}) =>
|
|
45
45
|
<View
|
|
46
46
|
key={tableSettingColumn.identifier()}
|
|
47
|
-
style={{marginVertical: 5}}
|
|
47
|
+
style={this.headerColumnContentViewStyle ||= {marginVertical: 5}}
|
|
48
48
|
>
|
|
49
|
-
<HeaderColumnContent
|
|
49
|
+
<HeaderColumnContent
|
|
50
|
+
column={column}
|
|
51
|
+
table={table}
|
|
52
|
+
tableSettingColumn={tableSettingColumn}
|
|
53
|
+
sortLinkProps={this.sortLinkProps ||= {usePressable: true}}
|
|
54
|
+
/>
|
|
50
55
|
</View>
|
|
51
56
|
)}
|
|
52
57
|
</Modal>
|
|
@@ -58,13 +58,13 @@ export default memo(shapeComponent(class ApiMakerTableModelColumn extends BaseCo
|
|
|
58
58
|
{...restColumnProps}
|
|
59
59
|
>
|
|
60
60
|
{!mdUp &&
|
|
61
|
-
<View dataSet={{class: "table--column-label"}}>
|
|
62
|
-
<Text style={{fontWeight: "bold"}}>
|
|
61
|
+
<View dataSet={this.columnLabelDataSet ||= {class: "table--column-label"}}>
|
|
62
|
+
<Text style={this.columnLabelTextStyle ||= {fontWeight: "bold"}}>
|
|
63
63
|
{table.headerLabelForColumn(column)}
|
|
64
64
|
</Text>
|
|
65
65
|
</View>
|
|
66
66
|
}
|
|
67
|
-
<View dataSet={{class: "table--column-value"}}>
|
|
67
|
+
<View dataSet={this.columnValueDataSet ||= {class: "table--column-value"}}>
|
|
68
68
|
{new ColumnContent({column, l, model, t, table}).content()}
|
|
69
69
|
</View>
|
|
70
70
|
</Column>
|
package/src/table/model-row.jsx
CHANGED
|
@@ -63,11 +63,11 @@ export default memo(shapeComponent(class ApiMakerBootStrapLiveTableModelRow exte
|
|
|
63
63
|
style={styleForRow({even})}
|
|
64
64
|
>
|
|
65
65
|
{workplace &&
|
|
66
|
-
<Column dataSet={{class: "workplace-column"}} style={styleForColumn({even, style: {width: 41}})}>
|
|
66
|
+
<Column dataSet={this.columnDataSet ||= {class: "workplace-column"}} style={styleForColumn({even, style: {width: 41}})}>
|
|
67
67
|
<WorkerPluginsCheckbox
|
|
68
68
|
currentWorkplace={currentWorkplace}
|
|
69
69
|
model={model}
|
|
70
|
-
style={{marginHorizontal: "auto"}}
|
|
70
|
+
style={this.workerPluginsCheckboxStyle ||= {marginHorizontal: "auto"}}
|
|
71
71
|
/>
|
|
72
72
|
</Column>
|
|
73
73
|
}
|
|
@@ -75,17 +75,21 @@ export default memo(shapeComponent(class ApiMakerBootStrapLiveTableModelRow exte
|
|
|
75
75
|
<Column dataSet={{class: "actions-column"}} style={styleForColumn({even, style: {}, type: "actions"})}>
|
|
76
76
|
{actionsContent && actionsContent(this.tt.modelCallbackArgs)}
|
|
77
77
|
{viewPath &&
|
|
78
|
-
<Link dataSet={{class: "view-button"}} style={{marginLeft: 2, marginRight: 2}} to={viewPath}>
|
|
78
|
+
<Link dataSet={this.viewButtonDataSet ||= {class: "view-button"}} style={this.searchLinkStyle ||= {marginLeft: 2, marginRight: 2}} to={viewPath}>
|
|
79
79
|
<Icon name="search" size={18} />
|
|
80
80
|
</Link>
|
|
81
81
|
}
|
|
82
82
|
{editPath &&
|
|
83
|
-
<Link dataSet={{class: "edit-button"}} style={{marginLeft: 2, marginRight: 2}} to={editPath}>
|
|
83
|
+
<Link dataSet={this.editButtonDataSet ||= {class: "edit-button"}} style={this.editButtonStyle ||= {marginLeft: 2, marginRight: 2}} to={editPath}>
|
|
84
84
|
<Icon name="pencil" size={20} />
|
|
85
85
|
</Link>
|
|
86
86
|
}
|
|
87
87
|
{destroyEnabled && model.can("destroy") &&
|
|
88
|
-
<Pressable
|
|
88
|
+
<Pressable
|
|
89
|
+
dataSet={this.destroyButtonDataSet ||= {class: "destroy-button"}}
|
|
90
|
+
style={this.destroyButtonStyle ||= {marginLeft: 2, marginRight: 2}}
|
|
91
|
+
onPress={this.tt.onDestroyClicked}
|
|
92
|
+
>
|
|
89
93
|
<Icon name="remove" size={22} />
|
|
90
94
|
</Pressable>
|
|
91
95
|
}
|
|
@@ -35,7 +35,7 @@ export default memo(shapeComponent(class ColumnRow extends BaseComponent {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
<View dataSet={{component: "api-maker--table--settings--column-row"}} style={{justifyContent: "center"}}>
|
|
38
|
+
<View dataSet={this.rootViewDataSet ||= {component: "api-maker--table--settings--column-row"}} style={this.rootViewStyle ||= {justifyContent: "center"}}>
|
|
39
39
|
<label style={{whiteSpace: "nowrap"}}>
|
|
40
40
|
<input
|
|
41
41
|
className="api-maker--table--setings--column-checkbox"
|
|
@@ -20,9 +20,9 @@ export default memo(shapeComponent(class ApiMakerTableSettingsDownloadAction ext
|
|
|
20
20
|
|
|
21
21
|
render() {
|
|
22
22
|
return (
|
|
23
|
-
<Pressable onPress={this.tt.onDownloadPress} style={{flexDirection: "row", alignItems: "center"}}>
|
|
23
|
+
<Pressable onPress={this.tt.onDownloadPress} style={this.pressableStyle ||= {flexDirection: "row", alignItems: "center"}}>
|
|
24
24
|
<Icon name="download" size={20} />
|
|
25
|
-
<Text style={{marginLeft: 5}}>
|
|
25
|
+
<Text style={this.textStyle ||= {marginLeft: 5}}>
|
|
26
26
|
Download
|
|
27
27
|
</Text>
|
|
28
28
|
</Pressable>
|
|
@@ -33,10 +33,10 @@ export default memo(shapeComponent(class ApiMakerTableSettings extends BaseCompo
|
|
|
33
33
|
const {preparedColumns} = table.s
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
|
-
<Modal onBackdropPress={this.p.onRequestClose} onRequestClose={this.p.onRequestClose} style={{backgroundColor: "#000"}} transparent>
|
|
36
|
+
<Modal onBackdropPress={this.p.onRequestClose} onRequestClose={this.p.onRequestClose} style={this.rootModalStyle ||= {backgroundColor: "#000"}} transparent>
|
|
37
37
|
<View
|
|
38
|
-
dataSet={{class: "api-maker--table--settings"}}
|
|
39
|
-
style={{
|
|
38
|
+
dataSet={this.rootViewDataSet ||= {class: "api-maker--table--settings"}}
|
|
39
|
+
style={this.rootViewStyle ||= {
|
|
40
40
|
width: "100%",
|
|
41
41
|
maxWidth: 800,
|
|
42
42
|
padding: 20,
|
|
@@ -44,14 +44,14 @@ export default memo(shapeComponent(class ApiMakerTableSettings extends BaseCompo
|
|
|
44
44
|
border: "1px solid black"
|
|
45
45
|
}}
|
|
46
46
|
>
|
|
47
|
-
<View style={{marginBottom: 5}}>
|
|
48
|
-
<Text style={{fontSize: 16, fontWeight: "bold"}}>
|
|
47
|
+
<View style={this.settingsHeaderViewStyle ||= {marginBottom: 5}}>
|
|
48
|
+
<Text style={this.settingsHeaderTextSTyle ||= {fontSize: 16, fontWeight: "bold"}}>
|
|
49
49
|
{t(".settings", {defaultValue: "Settings"})}
|
|
50
50
|
</Text>
|
|
51
51
|
</View>
|
|
52
52
|
<DownloadAction table={table} />
|
|
53
|
-
<View style={{marginBottom: 5}}>
|
|
54
|
-
<Text style={{fontSize: 16, fontWeight: "bold"}}>
|
|
53
|
+
<View style={this.columnsHeaderViewStyle ||= {marginBottom: 5}}>
|
|
54
|
+
<Text style={this.columnsHeaderTextStyle ||= {fontSize: 16, fontWeight: "bold"}}>
|
|
55
55
|
{t(".columns", {defaultValue: "Columns"})}
|
|
56
56
|
</Text>
|
|
57
57
|
</View>
|
package/src/table/table.jsx
CHANGED
|
@@ -67,10 +67,10 @@ const ListHeaderComponent = memo(shapeComponent(class ListHeaderComponent extend
|
|
|
67
67
|
<WorkerPluginsCheckAllCheckbox
|
|
68
68
|
currentWorkplace={table.s.currentWorkplace}
|
|
69
69
|
query={queryWithoutPagination}
|
|
70
|
-
style={{marginHorizontal: "auto"}}
|
|
70
|
+
style={this.workerPlguinsCheckAllCheckboxStyle ||= {marginHorizontal: "auto"}}
|
|
71
71
|
/>
|
|
72
72
|
{!mdUp &&
|
|
73
|
-
<Text style={{marginLeft: 3}}>
|
|
73
|
+
<Text style={this.selectAllFoundTextStyle ||= {marginLeft: 3}}>
|
|
74
74
|
{t(".select_all_found", {defaultValue: "Select all found"})}
|
|
75
75
|
</Text>
|
|
76
76
|
}
|
|
@@ -730,16 +730,16 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
730
730
|
const {models, qParams, query, result} = digs(this.collection, "models", "qParams", "query", "result")
|
|
731
731
|
|
|
732
732
|
return (
|
|
733
|
-
<View style={{flexDirection: "row"}}>
|
|
733
|
+
<View style={this.rootViewStyle ||= {flexDirection: "row"}}>
|
|
734
734
|
{controls && controls({models, qParams, query, result})}
|
|
735
735
|
<Pressable dataSet={{class: "filter-button"}} onPress={this.tt.onFilterClicked}>
|
|
736
736
|
<Icon name="search" size={20} />
|
|
737
737
|
</Pressable>
|
|
738
|
-
<View
|
|
738
|
+
<View>
|
|
739
739
|
{showSettings &&
|
|
740
740
|
<Settings onRequestClose={this.tt.onRequestCloseSettings} table={this} />
|
|
741
741
|
}
|
|
742
|
-
<Pressable dataSet={{class: "settings-button"}} onPress={this.tt.onSettingsClicked}>
|
|
742
|
+
<Pressable dataSet={this.settingsButtonDataSet ||= {class: "settings-button"}} onPress={this.tt.onSettingsClicked}>
|
|
743
743
|
<Icon name="gear" size={20} />
|
|
744
744
|
</Pressable>
|
|
745
745
|
</View>
|
|
@@ -759,13 +759,13 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
759
759
|
if (to === 0) from = 0
|
|
760
760
|
|
|
761
761
|
return (
|
|
762
|
-
<View style={{flexDirection: "row", justifyContent: "space-between", marginTop: 10}}>
|
|
763
|
-
<View dataSet={{class: "showing-counts"}} style={{flexDirection: "row"}}>
|
|
762
|
+
<View style={this.rootViewStyle ||= {flexDirection: "row", justifyContent: "space-between", marginTop: 10}}>
|
|
763
|
+
<View dataSet={this.showingCountsDataSet ||= {class: "showing-counts"}} style={this.showingCountsStyle ||= {flexDirection: "row"}}>
|
|
764
764
|
<Text>
|
|
765
765
|
{this.t(".showing_from_to_out_of_total", {defaultValue, from, to, total_count: totalCount})}
|
|
766
766
|
</Text>
|
|
767
767
|
{this.p.workplace && this.s.currentWorkplaceCount !== null &&
|
|
768
|
-
<Text style={{marginLeft: 3}}>
|
|
768
|
+
<Text style={this.xSelectedTextStyle ||= {marginLeft: 3}}>
|
|
769
769
|
{this.t(".x_selected", {defaultValue: "%{selected} selected.", selected: this.s.currentWorkplaceCount})}
|
|
770
770
|
</Text>
|
|
771
771
|
}
|
package/src/utils/card.jsx
CHANGED
|
@@ -5,6 +5,7 @@ import PropTypes from "prop-types"
|
|
|
5
5
|
import propTypesExact from "prop-types-exact"
|
|
6
6
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component"
|
|
7
7
|
import Text from "./text"
|
|
8
|
+
import View from "react-native"
|
|
8
9
|
|
|
9
10
|
export default memo(shapeComponent(class ApiMakerUtilsCard extends ShapeComponent {
|
|
10
11
|
static propTypes = propTypesExact({
|
package/src/utils/checkbox.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import BaseComponent from "../base-component"
|
|
2
1
|
import {CheckBox, Pressable, View} from "react-native"
|
|
3
2
|
import React, {useMemo} from "react"
|
|
3
|
+
import BaseComponent from "../base-component"
|
|
4
4
|
import memo from "set-state-compare/src/memo"
|
|
5
5
|
import PropTypes from "prop-types"
|
|
6
6
|
import propTypesExact from "prop-types-exact"
|
package/src/utils/checkboxes.jsx
CHANGED
|
@@ -22,16 +22,17 @@ const OptionElement = memo(shapeComponent(class OptionElement extends ShapeCompo
|
|
|
22
22
|
|
|
23
23
|
render() {
|
|
24
24
|
const {checked, inputName, option} = this.p
|
|
25
|
+
const dataSet = useMemo(() => ({
|
|
26
|
+
component: "api-maker/utils/checkboxes/option",
|
|
27
|
+
name: inputName,
|
|
28
|
+
value: option[1]
|
|
29
|
+
}), [inputName, option[1]])
|
|
25
30
|
|
|
26
31
|
return (
|
|
27
32
|
<View >
|
|
28
33
|
<Checkbox
|
|
29
34
|
checked={checked}
|
|
30
|
-
dataSet={
|
|
31
|
-
component: "api-maker/utils/checkboxes/option",
|
|
32
|
-
name: inputName,
|
|
33
|
-
value: option[1]
|
|
34
|
-
}}
|
|
35
|
+
dataSet={dataSet}
|
|
35
36
|
label={option[0]}
|
|
36
37
|
onCheckedChange={this.tt.onChange}
|
|
37
38
|
/>
|
|
@@ -88,8 +89,8 @@ export default memo(shapeComponent(class ApiMakerUtilsCheckboxes extends ShapeCo
|
|
|
88
89
|
const {errors} = digs(wrapperOpts, "errors")
|
|
89
90
|
|
|
90
91
|
return (
|
|
91
|
-
<View dataSet={{component: "api-maker/utils/checkboxes"}}>
|
|
92
|
-
<Text style={{fontWeight: "bold"}}>
|
|
92
|
+
<View dataSet={this.rootViewDataSet ||= {component: "api-maker/utils/checkboxes"}}>
|
|
93
|
+
<Text style={this.textStyle ||= {fontWeight: "bold"}}>
|
|
93
94
|
{this.tt.wrapperOpts.label}
|
|
94
95
|
</Text>
|
|
95
96
|
{this.props.options.map((option) =>
|
|
@@ -145,8 +146,6 @@ export default memo(shapeComponent(class ApiMakerUtilsCheckboxes extends ShapeCo
|
|
|
145
146
|
this.setState({checkedOptions: newOptions})
|
|
146
147
|
}
|
|
147
148
|
|
|
148
|
-
console.log({checkedOptions: this.s.checkedOptions})
|
|
149
|
-
|
|
150
149
|
if (this.props.onChange) {
|
|
151
150
|
this.p.onChange({checked, option})
|
|
152
151
|
}
|
package/src/utils/icon.jsx
CHANGED
|
@@ -36,10 +36,6 @@ export default memo(shapeComponent(class ApiMakerUtilsIcon extends BaseComponent
|
|
|
36
36
|
return actualStylesList
|
|
37
37
|
}, [stylesList, style])
|
|
38
38
|
|
|
39
|
-
if (this.props.name == "person") {
|
|
40
|
-
console.log("Icon", {props: this.props})
|
|
41
|
-
}
|
|
42
|
-
|
|
43
39
|
if (version == "FontAwesome") {
|
|
44
40
|
return <FontAwesomeIcon style={actualStylesList} {...restProps} />
|
|
45
41
|
} else if (version == "FontAwesome5") {
|
package/src/utils/modal.jsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {Modal, Pressable, View} from "react-native"
|
|
2
|
+
import React, {useMemo} from "react"
|
|
2
3
|
import BaseComponent from "../base-component"
|
|
3
4
|
import Card from "./card"
|
|
4
5
|
import Icon from "../utils/icon"
|
|
5
6
|
import memo from "set-state-compare/src/memo"
|
|
6
|
-
import React from "react"
|
|
7
7
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
8
8
|
import useBreakpoint from "../use-breakpoint"
|
|
9
9
|
|
|
@@ -11,12 +11,14 @@ export default memo(shapeComponent(class ApiMakerUtilsComponent extends BaseComp
|
|
|
11
11
|
render() {
|
|
12
12
|
const {xs, sm} = useBreakpoint()
|
|
13
13
|
const {children, dataSet, ...restProps} = this.props
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
|
|
15
|
+
const actualDataSet = useMemo(() =>
|
|
16
|
+
Object.assign(
|
|
17
|
+
{component: "api-maker/utils/modal"},
|
|
18
|
+
dataSet
|
|
19
|
+
)
|
|
20
|
+
, [dataSet])
|
|
21
|
+
|
|
20
22
|
let width, maxWidth
|
|
21
23
|
|
|
22
24
|
if (xs || sm) {
|
|
@@ -26,10 +28,12 @@ export default memo(shapeComponent(class ApiMakerUtilsComponent extends BaseComp
|
|
|
26
28
|
maxWidth = 800
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
const cardStyle = useMemo(() => ({width, maxWidth}), [width, maxWidth])
|
|
32
|
+
|
|
29
33
|
return (
|
|
30
34
|
<Modal dataSet={actualDataSet} {...restProps}>
|
|
31
35
|
<View
|
|
32
|
-
style={{
|
|
36
|
+
style={this.rootViewStyle ||= {
|
|
33
37
|
alignItems: "center",
|
|
34
38
|
justifyContent: "center",
|
|
35
39
|
width: "100%",
|
|
@@ -39,7 +43,7 @@ export default memo(shapeComponent(class ApiMakerUtilsComponent extends BaseComp
|
|
|
39
43
|
>
|
|
40
44
|
<Card
|
|
41
45
|
controls={this.cardHeaderControls()}
|
|
42
|
-
style={
|
|
46
|
+
style={cardStyle}
|
|
43
47
|
>
|
|
44
48
|
{children}
|
|
45
49
|
</Card>
|
|
@@ -50,7 +54,7 @@ export default memo(shapeComponent(class ApiMakerUtilsComponent extends BaseComp
|
|
|
50
54
|
|
|
51
55
|
cardHeaderControls() {
|
|
52
56
|
return (
|
|
53
|
-
<Pressable onPress={this.tt.onModalClosePress} style={{marginLeft: "auto", padding: 5}}>
|
|
57
|
+
<Pressable onPress={this.tt.onModalClosePress} style={this.pressableStyle ||= {marginLeft: "auto", padding: 5}}>
|
|
54
58
|
<Icon name="remove" />
|
|
55
59
|
</Pressable>
|
|
56
60
|
)
|