react-crud-mobile 1.0.67 → 1.0.69

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.
@@ -971,19 +971,16 @@ var styles$6 = {
971
971
 
972
972
  function Input(props) {
973
973
  var scope = props.scope;
974
- var value = scope.getValue();
974
+ var initial = reactCrudUtils.Utils.nvl(scope.getValue(), '');
975
975
  var label = scope.getLabel();
976
976
  var placeholder = scope.getPart('placeholder', null, label);
977
- var _useState = React.useState(0),
978
- index = _useState[0],
979
- setIndex = _useState[1];
977
+ var _useState = React.useState(initial),
978
+ value = _useState[0],
979
+ setValue = _useState[1];
980
980
  var onChange = function onChange(v) {
981
981
  scope.changeValue(v);
982
- setIndex(++index);
982
+ setValue(v);
983
983
  };
984
- if (!value) {
985
- value = '';
986
- }
987
984
  return /*#__PURE__*/jsxRuntime.jsx(reactNative.TextInput, {
988
985
  style: styles$7.input,
989
986
  onChangeText: onChange,
@@ -1202,82 +1199,86 @@ function UIElement(props) {
1202
1199
  return true;
1203
1200
  };
1204
1201
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
1205
- children: /*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
1202
+ children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
1206
1203
  ref: ref,
1207
1204
  style: getStyle(),
1208
- children: [isShowLabel() && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1209
- style: getStyle('label'),
1210
- children: scope.getLabel()
1211
- }), isShowInner() && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1212
- children: [/*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
1213
- style: getStyle('inner'),
1214
- children: [scope.is('type', 'button') && /*#__PURE__*/jsxRuntime.jsxs(Button, _extends({}, defaultsUI, {
1215
- onClick: onClick,
1216
- variant: scope.attr('variant', 'outlined'),
1217
- children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1218
- style: scope.getPart('label', 'button'),
1219
- children: scope.getLabel()
1220
- })]
1221
- })), scope.is('type', 'icon') && /*#__PURE__*/jsxRuntime.jsx(Icon, _extends({}, defaultsUI, {
1222
- onClick: onClick,
1223
- variant: scope.attr('variant', 'outlined'),
1224
- children: scope.getDisplayValue()
1225
- })), scope.is('type', 'link') && /*#__PURE__*/jsxRuntime.jsxs(Link, _extends({}, defaultsUI, {
1226
- onClick: onClick,
1227
- variant: scope.attr('variant', 'outlined'),
1228
- children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1229
- style: scope.getPart('label', 'link'),
1230
- children: scope.getLabel()
1231
- })]
1232
- })), scope.is('type', 'text', 'number', 'phone', 'postalCode', 'money', 'password', 'email') && /*#__PURE__*/jsxRuntime.jsx(Input, _extends({}, defaultsInput, defaultsUI, {
1233
- InputProps: _extends({}, original.inputProps)
1234
- })), scope.is('type', 'complete', 'autocomplete') && /*#__PURE__*/jsxRuntime.jsx(UIComplete, {
1235
- scope: scope,
1236
- defaultsInput: defaultsInput,
1237
- defaultsUI: defaultsUI
1238
- }), scope.is('type', 'checkbox', 'boolean', 'switch') && /*#__PURE__*/jsxRuntime.jsx(Switch, _extends({
1239
- checked: isChecked()
1240
- }, defaultsInput, {
1241
- onChange: onCheck
1242
- })), scope.is('type', 'select') && /*#__PURE__*/jsxRuntime.jsxs(Select, _extends({}, defaultsInput, defaultsUI, {
1243
- value: scope.getSelectedValue(),
1244
- children: [/*#__PURE__*/jsxRuntime.jsx(Option, {
1245
- value: '',
1246
- children: "Selecione"
1247
- }), options.map(function (row, i) {
1248
- return /*#__PURE__*/jsxRuntime.jsx(Option, {
1249
- value: row.value,
1250
- children: row.label
1251
- }, 'i' + i);
1252
- })]
1253
- })), scope.is('type', 'radio') && /*#__PURE__*/jsxRuntime.jsx(Radio, _extends({}, defaultsInput, defaultsUI, {
1254
- row: true,
1255
- children: options.map(function (row, i) {
1256
- return /*#__PURE__*/jsxRuntime.jsx(Option, {
1257
- control: /*#__PURE__*/jsxRuntime.jsx(Radio, _extends({}, defaultsUI)),
1258
- label: row.label,
1259
- value: row.value
1260
- }, 'i' + i);
1261
- })
1262
- })), scope.is('type', 'custom') && /*#__PURE__*/jsxRuntime.jsx(Custom, {}), scope.is('type', 'column') && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1263
- children: [scope.is('format', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
1264
- source: scope.getDisplayValue()
1265
- }), scope.is('format', 'icon') && /*#__PURE__*/jsxRuntime.jsx(Icon, {
1266
- className: scope.getDisplayValue()
1267
- }), !scope.is('format', 'icon', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1205
+ children: /*#__PURE__*/jsxRuntime.jsxs(reactNative.TouchableWithoutFeedback, {
1206
+ onPress: reactNative.Keyboard.dismiss,
1207
+ accessible: false,
1208
+ children: [isShowLabel() && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1209
+ style: getStyle('label'),
1210
+ children: scope.getLabel()
1211
+ }), isShowInner() && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1212
+ children: [/*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
1213
+ style: getStyle('inner'),
1214
+ children: [scope.is('type', 'button') && /*#__PURE__*/jsxRuntime.jsxs(Button, _extends({}, defaultsUI, {
1215
+ onClick: onClick,
1216
+ variant: scope.attr('variant', 'outlined'),
1217
+ children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1218
+ style: scope.getPart('label', 'button'),
1219
+ children: scope.getLabel()
1220
+ })]
1221
+ })), scope.is('type', 'icon') && /*#__PURE__*/jsxRuntime.jsx(Icon, _extends({}, defaultsUI, {
1222
+ onClick: onClick,
1223
+ variant: scope.attr('variant', 'outlined'),
1224
+ children: scope.getDisplayValue()
1225
+ })), scope.is('type', 'link') && /*#__PURE__*/jsxRuntime.jsxs(Link, _extends({}, defaultsUI, {
1226
+ onClick: onClick,
1227
+ variant: scope.attr('variant', 'outlined'),
1228
+ children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1229
+ style: scope.getPart('label', 'link'),
1230
+ children: scope.getLabel()
1231
+ })]
1232
+ })), scope.is('type', 'text', 'number', 'phone', 'postalCode', 'money', 'password', 'email') && /*#__PURE__*/jsxRuntime.jsx(Input, _extends({}, defaultsInput, defaultsUI, {
1233
+ InputProps: _extends({}, original.inputProps)
1234
+ })), scope.is('type', 'complete', 'autocomplete') && /*#__PURE__*/jsxRuntime.jsx(UIComplete, {
1235
+ scope: scope,
1236
+ defaultsInput: defaultsInput,
1237
+ defaultsUI: defaultsUI
1238
+ }), scope.is('type', 'checkbox', 'boolean', 'switch') && /*#__PURE__*/jsxRuntime.jsx(Switch, _extends({
1239
+ checked: isChecked()
1240
+ }, defaultsInput, {
1241
+ onChange: onCheck
1242
+ })), scope.is('type', 'select') && /*#__PURE__*/jsxRuntime.jsxs(Select, _extends({}, defaultsInput, defaultsUI, {
1243
+ value: scope.getSelectedValue(),
1244
+ children: [/*#__PURE__*/jsxRuntime.jsx(Option, {
1245
+ value: '',
1246
+ children: "Selecione"
1247
+ }), options.map(function (row, i) {
1248
+ return /*#__PURE__*/jsxRuntime.jsx(Option, {
1249
+ value: row.value,
1250
+ children: row.label
1251
+ }, 'i' + i);
1252
+ })]
1253
+ })), scope.is('type', 'radio') && /*#__PURE__*/jsxRuntime.jsx(Radio, _extends({}, defaultsInput, defaultsUI, {
1254
+ row: true,
1255
+ children: options.map(function (row, i) {
1256
+ return /*#__PURE__*/jsxRuntime.jsx(Option, {
1257
+ control: /*#__PURE__*/jsxRuntime.jsx(Radio, _extends({}, defaultsUI)),
1258
+ label: row.label,
1259
+ value: row.value
1260
+ }, 'i' + i);
1261
+ })
1262
+ })), scope.is('type', 'custom') && /*#__PURE__*/jsxRuntime.jsx(Custom, {}), scope.is('type', 'column') && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1263
+ children: [scope.is('format', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
1264
+ source: scope.getDisplayValue()
1265
+ }), scope.is('format', 'icon') && /*#__PURE__*/jsxRuntime.jsx(Icon, {
1266
+ className: scope.getDisplayValue()
1267
+ }), !scope.is('format', 'icon', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1268
+ children: scope.getDisplayValue()
1269
+ })]
1270
+ }), scope.is('type', 'output') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1268
1271
  children: scope.getDisplayValue()
1269
1272
  })]
1270
- }), scope.is('type', 'output') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1271
- children: scope.getDisplayValue()
1273
+ }), error && /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
1274
+ style: getStyle('error'),
1275
+ children: error
1272
1276
  })]
1273
- }), error && /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
1274
- style: getStyle('error'),
1275
- children: error
1276
- })]
1277
- }), /*#__PURE__*/jsxRuntime.jsx(CurrentRouter, {}), !scope.is('type', 'card', 'tabs', 'grid', 'list', 'define', 'repeat') && /*#__PURE__*/jsxRuntime.jsx(UIChildren, _extends({}, props, {
1278
- scope: scope,
1279
- crud: crud
1280
- }))]
1277
+ }), /*#__PURE__*/jsxRuntime.jsx(CurrentRouter, {}), !scope.is('type', 'card', 'tabs', 'grid', 'list', 'define', 'repeat') && /*#__PURE__*/jsxRuntime.jsx(UIChildren, _extends({}, props, {
1278
+ scope: scope,
1279
+ crud: crud
1280
+ }))]
1281
+ })
1281
1282
  })
1282
1283
  });
1283
1284
  }