react-crud-mobile 1.0.71 → 1.0.73
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/UIChildren.d.ts +2 -2
- package/dist/react-crud-mobile.cjs.development.js +81 -86
- 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 +81 -86
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +66 -66
- package/src/elements/UI.tsx +57 -57
- package/src/elements/UIChildren.tsx +114 -117
- package/src/elements/UIComplete.tsx +14 -14
- package/src/elements/UIElement.tsx +408 -418
- package/src/elements/UITag.tsx +13 -13
- package/src/elements/card/ElCard.tsx +25 -25
- package/src/elements/charts/ElChart.tsx +10 -10
- package/src/elements/core/Input.tsx +40 -40
- package/src/elements/grid/ElGrid.tsx +48 -48
- package/src/elements/grid/ElGridBotom.tsx +21 -21
- package/src/elements/grid/ElGridCheck.tsx +67 -67
- package/src/elements/grid/ElGridColumn.tsx +32 -32
- package/src/elements/grid/ElGridFilter.tsx +5 -5
- package/src/elements/grid/ElGridPaginator.tsx +82 -82
- package/src/elements/grid/ElGridRow.tsx +123 -123
- package/src/elements/grid/ElGridTop.tsx +44 -44
- package/src/elements/grid/ElInclude.tsx +40 -40
- package/src/elements/grid/ElLabel.tsx +50 -50
- package/src/elements/grid/ElRepeat.tsx +24 -24
- package/src/elements/grid/ElRepeatRow.tsx +40 -40
- package/src/elements/index.ts +1 -1
- package/src/elements/tabs/ElTabs.tsx +178 -178
- package/src/index.ts +1 -1
|
@@ -7,9 +7,9 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var reactCrudUtils = require('react-crud-utils');
|
|
10
|
+
var reactNative = require('react-native');
|
|
10
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
12
|
var Ionicons = _interopDefault(require('@expo/vector-icons/Ionicons'));
|
|
12
|
-
var reactNative = require('react-native');
|
|
13
13
|
var vectorIcons = require('@expo/vector-icons');
|
|
14
14
|
|
|
15
15
|
function _extends() {
|
|
@@ -35,8 +35,8 @@ function UIChildren(props) {
|
|
|
35
35
|
var _useState = React.useState(reactCrudUtils.Utils.nvl(props.scope, reactCrudUtils.ScopeUtils.create(props))),
|
|
36
36
|
scope = _useState[0];
|
|
37
37
|
var crud = reactCrudUtils.Utils.nvl(props.crud, scope.crud);
|
|
38
|
-
var validateScope = reactCrudUtils.Utils.nvl(props.validateScope,
|
|
39
|
-
var name = reactCrudUtils.Utils.nvl(props.part,
|
|
38
|
+
var validateScope = reactCrudUtils.Utils.nvl(props.validateScope, 'global');
|
|
39
|
+
var name = reactCrudUtils.Utils.nvl(props.part, 'child');
|
|
40
40
|
if (scope.isInput()) {
|
|
41
41
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
42
42
|
}
|
|
@@ -45,7 +45,7 @@ function UIChildren(props) {
|
|
|
45
45
|
if (!child) {
|
|
46
46
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
47
47
|
}
|
|
48
|
-
if (typeof child ===
|
|
48
|
+
if (typeof child === 'string') {
|
|
49
49
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
50
50
|
children: child
|
|
51
51
|
});
|
|
@@ -53,7 +53,7 @@ function UIChildren(props) {
|
|
|
53
53
|
var Custom = child.type;
|
|
54
54
|
var pps = _extends({}, child.props);
|
|
55
55
|
delete pps.children;
|
|
56
|
-
if (typeof Custom ===
|
|
56
|
+
if (typeof Custom === 'string') {
|
|
57
57
|
if (reactCrudUtils.Utils.isEmpty(child.props.children)) {
|
|
58
58
|
return /*#__PURE__*/jsxRuntime.jsx(Custom, _extends({}, pps));
|
|
59
59
|
}
|
|
@@ -66,7 +66,7 @@ function UIChildren(props) {
|
|
|
66
66
|
crud: crud
|
|
67
67
|
}))
|
|
68
68
|
}));
|
|
69
|
-
} else if (typeof Custom ===
|
|
69
|
+
} else if (typeof Custom === 'function') {
|
|
70
70
|
return /*#__PURE__*/jsxRuntime.jsx(Custom, _extends({
|
|
71
71
|
validateScope: validateScope
|
|
72
72
|
}, child.props, {
|
|
@@ -110,8 +110,7 @@ function UIChildren(props) {
|
|
|
110
110
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
111
111
|
}
|
|
112
112
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
113
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
114
|
-
className: scope.getStyleClass(name),
|
|
113
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, _extends({
|
|
115
114
|
style: scope.getStyle(name)
|
|
116
115
|
}, props.childProps, {
|
|
117
116
|
children: /*#__PURE__*/jsxRuntime.jsx(Draw, {})
|
|
@@ -1199,87 +1198,83 @@ function UIElement(props) {
|
|
|
1199
1198
|
return true;
|
|
1200
1199
|
};
|
|
1201
1200
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1202
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
children: [
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
})
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
}), scope.is('format', 'icon') && /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1267
|
-
className: scope.getDisplayValue()
|
|
1268
|
-
}), !scope.is('format', 'icon', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1269
|
-
children: scope.getDisplayValue()
|
|
1270
|
-
})]
|
|
1271
|
-
}), scope.is('type', 'output') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1201
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
|
|
1202
|
+
ref: ref,
|
|
1203
|
+
style: getStyle(),
|
|
1204
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1205
|
+
children: [isShowLabel() && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1206
|
+
style: getStyle('label'),
|
|
1207
|
+
children: scope.getLabel()
|
|
1208
|
+
}), isShowInner() && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1209
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
|
|
1210
|
+
style: getStyle('inner'),
|
|
1211
|
+
children: [scope.is('type', 'button') && /*#__PURE__*/jsxRuntime.jsxs(Button, _extends({}, defaultsUI, {
|
|
1212
|
+
onClick: onClick,
|
|
1213
|
+
variant: scope.attr('variant', 'outlined'),
|
|
1214
|
+
children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1215
|
+
style: scope.getPart('label', 'button'),
|
|
1216
|
+
children: scope.getLabel()
|
|
1217
|
+
})]
|
|
1218
|
+
})), scope.is('type', 'icon') && /*#__PURE__*/jsxRuntime.jsx(Icon, _extends({}, defaultsUI, {
|
|
1219
|
+
onClick: onClick,
|
|
1220
|
+
variant: scope.attr('variant', 'outlined'),
|
|
1221
|
+
children: scope.getDisplayValue()
|
|
1222
|
+
})), scope.is('type', 'link') && /*#__PURE__*/jsxRuntime.jsxs(Link, _extends({}, defaultsUI, {
|
|
1223
|
+
onClick: onClick,
|
|
1224
|
+
variant: scope.attr('variant', 'outlined'),
|
|
1225
|
+
children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1226
|
+
style: scope.getPart('label', 'link'),
|
|
1227
|
+
children: scope.getLabel()
|
|
1228
|
+
})]
|
|
1229
|
+
})), scope.is('type', 'text', 'number', 'phone', 'postalCode', 'money', 'password', 'email') && /*#__PURE__*/jsxRuntime.jsx(Input, _extends({}, defaultsInput, defaultsUI, {
|
|
1230
|
+
InputProps: _extends({}, original.inputProps)
|
|
1231
|
+
})), scope.is('type', 'complete', 'autocomplete') && /*#__PURE__*/jsxRuntime.jsx(UIComplete, {
|
|
1232
|
+
scope: scope,
|
|
1233
|
+
defaultsInput: defaultsInput,
|
|
1234
|
+
defaultsUI: defaultsUI
|
|
1235
|
+
}), scope.is('type', 'checkbox', 'boolean', 'switch') && /*#__PURE__*/jsxRuntime.jsx(Switch, _extends({
|
|
1236
|
+
checked: isChecked()
|
|
1237
|
+
}, defaultsInput, {
|
|
1238
|
+
onChange: onCheck
|
|
1239
|
+
})), scope.is('type', 'select') && /*#__PURE__*/jsxRuntime.jsxs(Select, _extends({}, defaultsInput, defaultsUI, {
|
|
1240
|
+
value: scope.getSelectedValue(),
|
|
1241
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Option, {
|
|
1242
|
+
value: '',
|
|
1243
|
+
children: "Selecione"
|
|
1244
|
+
}), options.map(function (row, i) {
|
|
1245
|
+
return /*#__PURE__*/jsxRuntime.jsx(Option, {
|
|
1246
|
+
value: row.value,
|
|
1247
|
+
children: row.label
|
|
1248
|
+
}, 'i' + i);
|
|
1249
|
+
})]
|
|
1250
|
+
})), scope.is('type', 'radio') && /*#__PURE__*/jsxRuntime.jsx(Radio, _extends({}, defaultsInput, defaultsUI, {
|
|
1251
|
+
row: true,
|
|
1252
|
+
children: options.map(function (row, i) {
|
|
1253
|
+
return /*#__PURE__*/jsxRuntime.jsx(Option, {
|
|
1254
|
+
control: /*#__PURE__*/jsxRuntime.jsx(Radio, _extends({}, defaultsUI)),
|
|
1255
|
+
label: row.label,
|
|
1256
|
+
value: row.value
|
|
1257
|
+
}, 'i' + i);
|
|
1258
|
+
})
|
|
1259
|
+
})), scope.is('type', 'custom') && /*#__PURE__*/jsxRuntime.jsx(Custom, {}), scope.is('type', 'column') && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1260
|
+
children: [scope.is('format', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
|
|
1261
|
+
source: scope.getDisplayValue()
|
|
1262
|
+
}), scope.is('format', 'icon') && /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1263
|
+
className: scope.getDisplayValue()
|
|
1264
|
+
}), !scope.is('format', 'icon', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1272
1265
|
children: scope.getDisplayValue()
|
|
1273
1266
|
})]
|
|
1274
|
-
}),
|
|
1275
|
-
|
|
1276
|
-
children: error
|
|
1267
|
+
}), scope.is('type', 'output') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1268
|
+
children: scope.getDisplayValue()
|
|
1277
1269
|
})]
|
|
1278
|
-
}),
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
})
|
|
1282
|
-
})
|
|
1270
|
+
}), error && /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
|
|
1271
|
+
style: getStyle('error'),
|
|
1272
|
+
children: error
|
|
1273
|
+
})]
|
|
1274
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CurrentRouter, {}), !scope.is('type', 'card', 'tabs', 'grid', 'list', 'define', 'repeat') && /*#__PURE__*/jsxRuntime.jsx(UIChildren, _extends({}, props, {
|
|
1275
|
+
scope: scope,
|
|
1276
|
+
crud: crud
|
|
1277
|
+
}))]
|
|
1283
1278
|
})
|
|
1284
1279
|
})
|
|
1285
1280
|
});
|