react-crud-mobile 1.0.90 → 1.0.92
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/UI.d.ts +11 -10
- package/dist/elements/core/UIAutoComplete.d.ts +2 -0
- package/dist/elements/core/UIButton.d.ts +3 -0
- package/dist/elements/core/UIIcon.d.ts +2 -0
- package/dist/elements/core/UIInput.d.ts +3 -0
- package/dist/elements/core/UILink.d.ts +2 -0
- package/dist/elements/core/UIOption.d.ts +2 -0
- package/dist/elements/core/UIRadio.d.ts +2 -0
- package/dist/elements/core/UISelect.d.ts +2 -0
- package/dist/elements/core/UISwitch.d.ts +3 -0
- package/dist/react-crud-mobile.cjs.development.js +49 -44
- 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 +50 -45
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/UI.tsx +16 -14
- package/src/elements/UIComplete.tsx +1 -1
- package/src/elements/UIElement.tsx +27 -27
- package/src/elements/core/{AutoComplete.tsx → UIAutoComplete.tsx} +1 -1
- package/src/elements/core/{Button.tsx → UIButton.tsx} +1 -1
- package/src/elements/core/{Radio.tsx → UIIcon.tsx} +1 -1
- package/src/elements/core/{Input.tsx → UIInput.tsx} +1 -1
- package/src/elements/core/{Icon.tsx → UILink.tsx} +1 -1
- package/src/elements/core/{Option.tsx → UIOption.tsx} +1 -1
- package/src/elements/core/{Link.tsx → UIRadio.tsx} +1 -1
- package/src/elements/core/UISelect.tsx +17 -0
- package/src/elements/core/UISwitch.tsx +26 -0
- package/src/elements/grid/ElLabel.tsx +1 -1
- package/dist/elements/core/AutoComplete.d.ts +0 -2
- package/dist/elements/core/Button.d.ts +0 -3
- package/dist/elements/core/Icon.d.ts +0 -2
- package/dist/elements/core/Input.d.ts +0 -3
- package/dist/elements/core/Link.d.ts +0 -2
- package/dist/elements/core/Option.d.ts +0 -2
- package/dist/elements/core/Radio.d.ts +0 -2
- package/dist/elements/core/Select.d.ts +0 -2
- package/dist/elements/core/Switch.d.ts +0 -2
- package/src/elements/core/Select.tsx +0 -17
- package/src/elements/core/Switch.tsx +0 -17
package/dist/elements/UI.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ListType } from
|
|
3
|
-
import { UserType } from
|
|
4
|
-
import { InputType } from
|
|
5
|
-
import { ChartType } from
|
|
6
|
-
import { ContainerType } from
|
|
7
|
-
import { ListInputType } from
|
|
8
|
-
import { TabsType } from
|
|
9
|
-
import { DefineType } from
|
|
10
|
-
import { ButtonType } from
|
|
11
|
-
import { LinkType } from
|
|
2
|
+
import { ListType } from 'react-crud-utils';
|
|
3
|
+
import { UserType } from 'react-crud-utils';
|
|
4
|
+
import { InputType } from 'react-crud-utils';
|
|
5
|
+
import { ChartType } from 'react-crud-utils';
|
|
6
|
+
import { ContainerType } from 'react-crud-utils';
|
|
7
|
+
import { ListInputType } from 'react-crud-utils';
|
|
8
|
+
import { TabsType } from 'react-crud-utils';
|
|
9
|
+
import { DefineType } from 'react-crud-utils';
|
|
10
|
+
import { ButtonType } from 'react-crud-utils';
|
|
11
|
+
import { LinkType } from 'react-crud-utils';
|
|
12
12
|
declare const UI: {
|
|
13
13
|
Grid: (props: ListType) => import("react").JSX.Element;
|
|
14
14
|
Repeat: (props: ListType) => import("react").JSX.Element;
|
|
@@ -39,6 +39,7 @@ declare const UI: {
|
|
|
39
39
|
Password: (props: InputType) => import("react").JSX.Element;
|
|
40
40
|
Complete: (props: InputType) => import("react").JSX.Element;
|
|
41
41
|
Checkbox: (props: InputType) => import("react").JSX.Element;
|
|
42
|
+
Switch: (props: InputType) => import("react").JSX.Element;
|
|
42
43
|
Radio: (props: ListInputType) => import("react").JSX.Element;
|
|
43
44
|
Select: (props: ListInputType) => import("react").JSX.Element;
|
|
44
45
|
Entity: (props: ListInputType) => import("react").JSX.Element;
|
|
@@ -425,7 +425,7 @@ function ElGridBotom(props) {
|
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
-
function
|
|
428
|
+
function UIIcon(props) {
|
|
429
429
|
var handlePress = function handlePress() {
|
|
430
430
|
reactNative.Linking.openURL('https://reactnative.dev/');
|
|
431
431
|
};
|
|
@@ -457,7 +457,7 @@ function ElLabel(props) {
|
|
|
457
457
|
if (typeof original.icon === 'string') {
|
|
458
458
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
459
459
|
className: "ui-label-icon",
|
|
460
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
460
|
+
children: /*#__PURE__*/jsxRuntime.jsx(UIIcon, {
|
|
461
461
|
className: scope.getIcon()
|
|
462
462
|
})
|
|
463
463
|
});
|
|
@@ -701,7 +701,7 @@ function ElChart(props) {
|
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
703
|
|
|
704
|
-
function
|
|
704
|
+
function UIAutoComplete(props) {
|
|
705
705
|
var handlePress = function handlePress() {
|
|
706
706
|
reactNative.Linking.openURL('https://reactnative.dev/');
|
|
707
707
|
};
|
|
@@ -721,7 +721,7 @@ function UIComplete(_ref) {
|
|
|
721
721
|
var defaultsInput = _ref.defaultsInput,
|
|
722
722
|
defaultsUI = _ref.defaultsUI;
|
|
723
723
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
724
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
724
|
+
children: /*#__PURE__*/jsxRuntime.jsx(UIAutoComplete, _extends({}, defaultsInput, defaultsUI))
|
|
725
725
|
});
|
|
726
726
|
}
|
|
727
727
|
|
|
@@ -777,7 +777,7 @@ function ElRepeat(props) {
|
|
|
777
777
|
});
|
|
778
778
|
}
|
|
779
779
|
|
|
780
|
-
function
|
|
780
|
+
function UILink(props) {
|
|
781
781
|
var handlePress = function handlePress() {
|
|
782
782
|
reactNative.Linking.openURL('https://reactnative.dev/');
|
|
783
783
|
};
|
|
@@ -793,7 +793,7 @@ var styles$3 = {
|
|
|
793
793
|
link: {}
|
|
794
794
|
};
|
|
795
795
|
|
|
796
|
-
function
|
|
796
|
+
function UIButton(props) {
|
|
797
797
|
var scope = props.scope;
|
|
798
798
|
var element = scope.original;
|
|
799
799
|
var color = element.color;
|
|
@@ -860,7 +860,7 @@ function Button(props) {
|
|
|
860
860
|
});
|
|
861
861
|
}
|
|
862
862
|
|
|
863
|
-
function
|
|
863
|
+
function UISelect(props) {
|
|
864
864
|
var handlePress = function handlePress() {
|
|
865
865
|
reactNative.Linking.openURL('https://reactnative.dev/');
|
|
866
866
|
};
|
|
@@ -876,55 +876,55 @@ var styles$4 = {
|
|
|
876
876
|
link: {}
|
|
877
877
|
};
|
|
878
878
|
|
|
879
|
-
function
|
|
880
|
-
var
|
|
881
|
-
|
|
879
|
+
function UISwitch(props) {
|
|
880
|
+
var scope = props.scope;
|
|
881
|
+
var initial = reactCrudUtils.Utils.nvl(scope.getValue(), false);
|
|
882
|
+
var _useState = React.useState(initial),
|
|
883
|
+
value = _useState[0],
|
|
884
|
+
setValue = _useState[1];
|
|
885
|
+
var onChange = function onChange(v) {
|
|
886
|
+
scope.changeValue(v);
|
|
887
|
+
setValue(v);
|
|
882
888
|
};
|
|
883
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactNative.
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
style: styles$5.link,
|
|
887
|
-
children: "Clique aqui para acessar o React Native"
|
|
888
|
-
})
|
|
889
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Switch, {
|
|
890
|
+
value: value,
|
|
891
|
+
onValueChange: onChange // Alterna o estado
|
|
889
892
|
});
|
|
890
893
|
}
|
|
891
|
-
var styles$5 = {
|
|
892
|
-
link: {}
|
|
893
|
-
};
|
|
894
894
|
|
|
895
|
-
function
|
|
895
|
+
function UIOption(props) {
|
|
896
896
|
var handlePress = function handlePress() {
|
|
897
897
|
reactNative.Linking.openURL('https://reactnative.dev/');
|
|
898
898
|
};
|
|
899
899
|
return /*#__PURE__*/jsxRuntime.jsx(reactNative.TouchableOpacity, {
|
|
900
900
|
onPress: handlePress,
|
|
901
901
|
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
902
|
-
style: styles$
|
|
902
|
+
style: styles$5.link,
|
|
903
903
|
children: "Clique aqui para acessar o React Native"
|
|
904
904
|
})
|
|
905
905
|
});
|
|
906
906
|
}
|
|
907
|
-
var styles$
|
|
907
|
+
var styles$5 = {
|
|
908
908
|
link: {}
|
|
909
909
|
};
|
|
910
910
|
|
|
911
|
-
function
|
|
911
|
+
function UIRadio(props) {
|
|
912
912
|
var handlePress = function handlePress() {
|
|
913
913
|
reactNative.Linking.openURL('https://reactnative.dev/');
|
|
914
914
|
};
|
|
915
915
|
return /*#__PURE__*/jsxRuntime.jsx(reactNative.TouchableOpacity, {
|
|
916
916
|
onPress: handlePress,
|
|
917
917
|
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
918
|
-
style: styles$
|
|
918
|
+
style: styles$6.link,
|
|
919
919
|
children: "Clique aqui para acessar o React Native"
|
|
920
920
|
})
|
|
921
921
|
});
|
|
922
922
|
}
|
|
923
|
-
var styles$
|
|
923
|
+
var styles$6 = {
|
|
924
924
|
link: {}
|
|
925
925
|
};
|
|
926
926
|
|
|
927
|
-
function
|
|
927
|
+
function UIInput(props) {
|
|
928
928
|
var scope = props.scope;
|
|
929
929
|
var initial = reactCrudUtils.Utils.nvl(scope.getValue(), '');
|
|
930
930
|
var label = scope.getLabel();
|
|
@@ -937,13 +937,13 @@ function Input(props) {
|
|
|
937
937
|
setValue(v);
|
|
938
938
|
};
|
|
939
939
|
return /*#__PURE__*/jsxRuntime.jsx(reactNative.TextInput, {
|
|
940
|
-
style: styles$
|
|
940
|
+
style: styles$7.input,
|
|
941
941
|
onChangeText: onChange,
|
|
942
942
|
value: value,
|
|
943
943
|
placeholder: placeholder
|
|
944
944
|
});
|
|
945
945
|
}
|
|
946
|
-
var styles$
|
|
946
|
+
var styles$7 = /*#__PURE__*/reactNative.StyleSheet.create({
|
|
947
947
|
input: {
|
|
948
948
|
borderRadius: 20,
|
|
949
949
|
padding: 10,
|
|
@@ -1065,7 +1065,7 @@ function UIElement(props) {
|
|
|
1065
1065
|
var _elementStyle$type, _elementStyle$type2;
|
|
1066
1066
|
var type = reactCrudUtils.Utils.nvl(original.type, 'none');
|
|
1067
1067
|
var key = reactCrudUtils.Utils.nvl(part, 'root');
|
|
1068
|
-
var def = _extends({}, styles$
|
|
1068
|
+
var def = _extends({}, styles$8[key], elementStyle == null || (_elementStyle$type = elementStyle[type]) == null ? void 0 : _elementStyle$type[key]);
|
|
1069
1069
|
var hasChild = hasChildren();
|
|
1070
1070
|
if (!part && !hasChild) {
|
|
1071
1071
|
def = _extends({}, def, {
|
|
@@ -1108,7 +1108,7 @@ function UIElement(props) {
|
|
|
1108
1108
|
});
|
|
1109
1109
|
var CustomIcon = function CustomIcon() {
|
|
1110
1110
|
if (typeof original.icon === 'string') {
|
|
1111
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
1111
|
+
return /*#__PURE__*/jsxRuntime.jsx(UIIcon, {
|
|
1112
1112
|
children: scope.getIcon()
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
@@ -1175,50 +1175,50 @@ function UIElement(props) {
|
|
|
1175
1175
|
}), isShowInner() && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1176
1176
|
children: [/*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
|
|
1177
1177
|
style: getStyle('inner'),
|
|
1178
|
-
children: [scope.is('type', 'button') && /*#__PURE__*/jsxRuntime.jsxs(
|
|
1178
|
+
children: [scope.is('type', 'button') && /*#__PURE__*/jsxRuntime.jsxs(UIButton, _extends({}, defaultsUI, {
|
|
1179
1179
|
onClick: onClick,
|
|
1180
1180
|
variant: scope.attr('variant', 'outlined'),
|
|
1181
1181
|
children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1182
1182
|
style: scope.getPart('label', 'button'),
|
|
1183
1183
|
children: scope.getLabel()
|
|
1184
1184
|
})]
|
|
1185
|
-
})), scope.is('type', 'icon') && /*#__PURE__*/jsxRuntime.jsx(
|
|
1185
|
+
})), scope.is('type', 'icon') && /*#__PURE__*/jsxRuntime.jsx(UIIcon, _extends({}, defaultsUI, {
|
|
1186
1186
|
onClick: onClick,
|
|
1187
1187
|
variant: scope.attr('variant', 'outlined'),
|
|
1188
1188
|
children: scope.getDisplayValue()
|
|
1189
|
-
})), scope.is('type', 'link') && /*#__PURE__*/jsxRuntime.jsxs(
|
|
1189
|
+
})), scope.is('type', 'link') && /*#__PURE__*/jsxRuntime.jsxs(UILink, _extends({}, defaultsUI, {
|
|
1190
1190
|
onClick: onClick,
|
|
1191
1191
|
variant: scope.attr('variant', 'outlined'),
|
|
1192
1192
|
children: [original.icon && /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {}), original.label && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1193
1193
|
style: scope.getPart('label', 'link'),
|
|
1194
1194
|
children: scope.getLabel()
|
|
1195
1195
|
})]
|
|
1196
|
-
})), scope.is('type', 'text', 'number', 'phone', 'postalCode', 'money', 'password', 'email') && /*#__PURE__*/jsxRuntime.jsx(
|
|
1196
|
+
})), scope.is('type', 'text', 'number', 'phone', 'postalCode', 'money', 'password', 'email') && /*#__PURE__*/jsxRuntime.jsx(UIInput, _extends({}, defaultsInput, defaultsUI, {
|
|
1197
1197
|
InputProps: _extends({}, original.inputProps)
|
|
1198
1198
|
})), scope.is('type', 'complete', 'autocomplete') && /*#__PURE__*/jsxRuntime.jsx(UIComplete, {
|
|
1199
1199
|
scope: scope,
|
|
1200
1200
|
defaultsInput: defaultsInput,
|
|
1201
1201
|
defaultsUI: defaultsUI
|
|
1202
|
-
}), scope.is('type', 'checkbox', 'boolean', 'switch') && /*#__PURE__*/jsxRuntime.jsx(
|
|
1202
|
+
}), scope.is('type', 'checkbox', 'boolean', 'switch') && /*#__PURE__*/jsxRuntime.jsx(UISwitch, _extends({
|
|
1203
1203
|
checked: isChecked()
|
|
1204
1204
|
}, defaultsInput, {
|
|
1205
1205
|
onChange: onCheck
|
|
1206
|
-
})), scope.is('type', 'select') && /*#__PURE__*/jsxRuntime.jsxs(
|
|
1206
|
+
})), scope.is('type', 'select') && /*#__PURE__*/jsxRuntime.jsxs(UISelect, _extends({}, defaultsInput, defaultsUI, {
|
|
1207
1207
|
value: scope.getSelectedValue(),
|
|
1208
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1208
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(UIOption, {
|
|
1209
1209
|
value: '',
|
|
1210
1210
|
children: "Selecione"
|
|
1211
1211
|
}), options.map(function (row, i) {
|
|
1212
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
1212
|
+
return /*#__PURE__*/jsxRuntime.jsx(UIOption, {
|
|
1213
1213
|
value: row.value,
|
|
1214
1214
|
children: row.label
|
|
1215
1215
|
}, 'i' + i);
|
|
1216
1216
|
})]
|
|
1217
|
-
})), scope.is('type', 'radio') && /*#__PURE__*/jsxRuntime.jsx(
|
|
1217
|
+
})), scope.is('type', 'radio') && /*#__PURE__*/jsxRuntime.jsx(UIRadio, _extends({}, defaultsInput, defaultsUI, {
|
|
1218
1218
|
row: true,
|
|
1219
1219
|
children: options.map(function (row, i) {
|
|
1220
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
1221
|
-
control: /*#__PURE__*/jsxRuntime.jsx(
|
|
1220
|
+
return /*#__PURE__*/jsxRuntime.jsx(UIOption, {
|
|
1221
|
+
control: /*#__PURE__*/jsxRuntime.jsx(UIRadio, _extends({}, defaultsUI)),
|
|
1222
1222
|
label: row.label,
|
|
1223
1223
|
value: row.value
|
|
1224
1224
|
}, 'i' + i);
|
|
@@ -1226,7 +1226,7 @@ function UIElement(props) {
|
|
|
1226
1226
|
})), scope.is('type', 'custom') && /*#__PURE__*/jsxRuntime.jsx(Custom, {}), scope.is('type', 'column') && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1227
1227
|
children: [scope.is('format', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
|
|
1228
1228
|
source: scope.getDisplayValue()
|
|
1229
|
-
}), scope.is('format', 'icon') && /*#__PURE__*/jsxRuntime.jsx(
|
|
1229
|
+
}), scope.is('format', 'icon') && /*#__PURE__*/jsxRuntime.jsx(UIIcon, {
|
|
1230
1230
|
className: scope.getDisplayValue()
|
|
1231
1231
|
}), !scope.is('format', 'icon', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1232
1232
|
children: scope.getDisplayValue()
|
|
@@ -1267,7 +1267,7 @@ elementStyle.card = /*#__PURE__*/reactNative.StyleSheet.create({
|
|
|
1267
1267
|
paddingTop: 5
|
|
1268
1268
|
}
|
|
1269
1269
|
});
|
|
1270
|
-
var styles$
|
|
1270
|
+
var styles$8 = /*#__PURE__*/reactNative.StyleSheet.create({
|
|
1271
1271
|
root: {
|
|
1272
1272
|
gap: 5,
|
|
1273
1273
|
flexDirection: 'column',
|
|
@@ -1474,7 +1474,12 @@ var UI = {
|
|
|
1474
1474
|
},
|
|
1475
1475
|
Checkbox: function Checkbox(props) {
|
|
1476
1476
|
return /*#__PURE__*/jsxRuntime.jsx(UIElement, _extends({}, props, {
|
|
1477
|
-
type: "
|
|
1477
|
+
type: "switch"
|
|
1478
|
+
}));
|
|
1479
|
+
},
|
|
1480
|
+
Switch: function Switch(props) {
|
|
1481
|
+
return /*#__PURE__*/jsxRuntime.jsx(UIElement, _extends({}, props, {
|
|
1482
|
+
type: "switch"
|
|
1478
1483
|
}));
|
|
1479
1484
|
},
|
|
1480
1485
|
Radio: function Radio(props) {
|