@kaspernj/api-maker 1.0.2024 → 1.0.2026
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/column-content.js +6 -6
- 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 +11 -10
- package/build/utils/checkbox.js +15 -14
- 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 +2 -2
- 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/column-content.jsx +2 -2
- 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 +24 -17
- package/src/utils/checkbox.jsx +10 -17
- 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
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
|
)
|