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.
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { Crud, Scope } from "react-crud-utils";
1
+ import React from 'react';
2
+ import { Crud, Scope } from 'react-crud-utils';
3
3
  interface UIChildrenType {
4
4
  scope: Scope;
5
5
  crud?: Crud;
@@ -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, "global");
39
- var name = reactCrudUtils.Utils.nvl(props.part, "child");
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 === "string") {
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 === "string") {
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 === "function") {
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("div", _extends({
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.TouchableWithoutFeedback, {
1203
- onPress: reactNative.Keyboard.dismiss,
1204
- accessible: false,
1205
- children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
1206
- ref: ref,
1207
- style: getStyle(),
1208
- children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1209
- children: [isShowLabel() && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1210
- style: getStyle('label'),
1211
- children: scope.getLabel()
1212
- }), isShowInner() && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1213
- children: [/*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
1214
- style: getStyle('inner'),
1215
- children: [scope.is('type', 'button') && /*#__PURE__*/jsxRuntime.jsxs(Button, _extends({}, defaultsUI, {
1216
- onClick: onClick,
1217
- variant: scope.attr('variant', 'outlined'),
1218
- children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1219
- style: scope.getPart('label', 'button'),
1220
- children: scope.getLabel()
1221
- })]
1222
- })), scope.is('type', 'icon') && /*#__PURE__*/jsxRuntime.jsx(Icon, _extends({}, defaultsUI, {
1223
- onClick: onClick,
1224
- variant: scope.attr('variant', 'outlined'),
1225
- children: scope.getDisplayValue()
1226
- })), scope.is('type', 'link') && /*#__PURE__*/jsxRuntime.jsxs(Link, _extends({}, defaultsUI, {
1227
- onClick: onClick,
1228
- variant: scope.attr('variant', 'outlined'),
1229
- children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1230
- style: scope.getPart('label', 'link'),
1231
- children: scope.getLabel()
1232
- })]
1233
- })), scope.is('type', 'text', 'number', 'phone', 'postalCode', 'money', 'password', 'email') && /*#__PURE__*/jsxRuntime.jsx(Input, _extends({}, defaultsInput, defaultsUI, {
1234
- InputProps: _extends({}, original.inputProps)
1235
- })), scope.is('type', 'complete', 'autocomplete') && /*#__PURE__*/jsxRuntime.jsx(UIComplete, {
1236
- scope: scope,
1237
- defaultsInput: defaultsInput,
1238
- defaultsUI: defaultsUI
1239
- }), scope.is('type', 'checkbox', 'boolean', 'switch') && /*#__PURE__*/jsxRuntime.jsx(Switch, _extends({
1240
- checked: isChecked()
1241
- }, defaultsInput, {
1242
- onChange: onCheck
1243
- })), scope.is('type', 'select') && /*#__PURE__*/jsxRuntime.jsxs(Select, _extends({}, defaultsInput, defaultsUI, {
1244
- value: scope.getSelectedValue(),
1245
- children: [/*#__PURE__*/jsxRuntime.jsx(Option, {
1246
- value: '',
1247
- children: "Selecione"
1248
- }), options.map(function (row, i) {
1249
- return /*#__PURE__*/jsxRuntime.jsx(Option, {
1250
- value: row.value,
1251
- children: row.label
1252
- }, 'i' + i);
1253
- })]
1254
- })), scope.is('type', 'radio') && /*#__PURE__*/jsxRuntime.jsx(Radio, _extends({}, defaultsInput, defaultsUI, {
1255
- row: true,
1256
- children: options.map(function (row, i) {
1257
- return /*#__PURE__*/jsxRuntime.jsx(Option, {
1258
- control: /*#__PURE__*/jsxRuntime.jsx(Radio, _extends({}, defaultsUI)),
1259
- label: row.label,
1260
- value: row.value
1261
- }, 'i' + i);
1262
- })
1263
- })), scope.is('type', 'custom') && /*#__PURE__*/jsxRuntime.jsx(Custom, {}), scope.is('type', 'column') && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1264
- children: [scope.is('format', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
1265
- source: scope.getDisplayValue()
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
- }), error && /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
1275
- style: getStyle('error'),
1276
- children: error
1267
+ }), scope.is('type', 'output') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1268
+ children: scope.getDisplayValue()
1277
1269
  })]
1278
- }), /*#__PURE__*/jsxRuntime.jsx(CurrentRouter, {}), !scope.is('type', 'card', 'tabs', 'grid', 'list', 'define', 'repeat') && /*#__PURE__*/jsxRuntime.jsx(UIChildren, _extends({}, props, {
1279
- scope: scope,
1280
- crud: crud
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
  });