react-crud-mobile 1.3.83 → 1.3.85
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/dist/elements/core/UIModal.d.ts +2 -1
- package/dist/react-crud-mobile.cjs.development.js +25 -11
- package/dist/react-crud-mobile.cjs.development.js.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js +25 -11
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/UIElement.tsx +7 -1
- package/src/elements/core/UIModal.tsx +23 -7
package/package.json
CHANGED
|
@@ -534,7 +534,13 @@ export default function UIElement(props: ElementType) {
|
|
|
534
534
|
)}
|
|
535
535
|
|
|
536
536
|
{dialog && (
|
|
537
|
-
<UIModal
|
|
537
|
+
<UIModal
|
|
538
|
+
{...props}
|
|
539
|
+
scope={scope}
|
|
540
|
+
crud={dialog.crud}
|
|
541
|
+
open
|
|
542
|
+
dialog={dialog}
|
|
543
|
+
>
|
|
538
544
|
{dialog.component}
|
|
539
545
|
</UIModal>
|
|
540
546
|
)}
|
|
@@ -22,15 +22,20 @@ import UIToast from './UIToast';
|
|
|
22
22
|
|
|
23
23
|
interface UIModalType extends ChildType {
|
|
24
24
|
open?: boolean;
|
|
25
|
+
dialog?: any;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export default function UIModal(
|
|
28
|
-
|
|
28
|
+
export default function UIModal({
|
|
29
|
+
scope,
|
|
30
|
+
open,
|
|
31
|
+
dialog,
|
|
32
|
+
...props
|
|
33
|
+
}: UIModalType) {
|
|
34
|
+
let [modalVisible, setModalVisible] = useState(open === true);
|
|
29
35
|
let [index, setIndex] = useState(0);
|
|
30
36
|
let main = ViewUtils.getCrud('view');
|
|
31
|
-
//
|
|
37
|
+
//v4
|
|
32
38
|
|
|
33
|
-
const scope = props.scope;
|
|
34
39
|
const label = scope.getLabel();
|
|
35
40
|
const theme = scope.getTheme();
|
|
36
41
|
const headerStyle = Utils.nvl(theme.styles?.defaults?.header, {});
|
|
@@ -128,6 +133,19 @@ export default function UIModal(props: UIModalType) {
|
|
|
128
133
|
let defaults = { color };
|
|
129
134
|
let key = `${scope.currentDialog.name}-${index}`;
|
|
130
135
|
|
|
136
|
+
let Content = () => {
|
|
137
|
+
if (dialog?.component) {
|
|
138
|
+
let Aux = dialog?.component;
|
|
139
|
+
|
|
140
|
+
return <Aux crud={scope.currentDialog} />;
|
|
141
|
+
}
|
|
142
|
+
return (
|
|
143
|
+
<UIChildren scope={scope} crud={scope.currentDialog}>
|
|
144
|
+
{props.children}
|
|
145
|
+
</UIChildren>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
|
|
131
149
|
return (
|
|
132
150
|
<Modal
|
|
133
151
|
key={key}
|
|
@@ -169,9 +187,7 @@ export default function UIModal(props: UIModalType) {
|
|
|
169
187
|
paddingBottom: 10,
|
|
170
188
|
}}
|
|
171
189
|
>
|
|
172
|
-
<
|
|
173
|
-
{props.children}
|
|
174
|
-
</UIChildren>
|
|
190
|
+
<Content />
|
|
175
191
|
</View>
|
|
176
192
|
</ScrollView>
|
|
177
193
|
{bottom}
|