react-crud-mobile 1.0.813 → 1.0.814

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,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),n=e(t),r=require("react-crud-utils"),i=require("react-native"),l=require("react/jsx-runtime"),a=e(require("@expo/vector-icons/Ionicons")),o=require("@expo/vector-icons"),s=require("react-native-safe-area-context");function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function u(e){var a=t.useState(r.Utils.nvl(e.scope,r.ScopeUtils.create(e)))[0],o=r.Utils.nvl(e.crud,a.crud),s=r.Utils.nvl(e.validateScope,"global"),p=r.Utils.nvl(e.part,"child");if(a.isInput())return l.jsx(l.Fragment,{});var f,g,x,h,y,m=function(e){var t,n=e.child;if(!n)return l.jsx(l.Fragment,{});if("string"==typeof n)return l.jsx(l.Fragment,{children:n});var i=n.type,d=c({},n.props);return delete d.children,"string"==typeof i?r.Utils.isEmpty(n.props.children)?l.jsx(i,c({},d)):l.jsx(i,c({},d,{children:l.jsx(u,c({transient:!0,validateScope:s},n.props,{scope:a,crud:o}))})):"function"==typeof i?l.jsx(i,c({validateScope:s},n.props,{parent:a,crud:o})):r.Utils.isEmpty(null==(t=n.props)?void 0:t.children)?l.jsx(l.Fragment,{}):l.jsx(u,c({validateScope:s},n.props,{scope:a,crud:o,transient:!0}))},j=function(){return l.jsx(l.Fragment,e.elements?{children:Object.entries(e.elements).map((function(e,t){return l.jsx(K,c({crud:o},e[1]))}))}:{children:n.Children.map(e.children,(function(e){return l.jsx(m,{child:e})}))})};return e.transient?l.jsx(j,{}):r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements)?l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{children:l.jsx(i.View,{style:(f=p,x=r.Utils.nvl(f,"root"),h=d[x],y={},r.Utils.isEmpty(e.style)||(null!=(g=e.style)&&g.push?r.Utils.each(e.style,(function(e){e&&(y=c({},y,e))})):y=c({},e.style)),c({},h,y,a.getStyle(f))),children:l.jsx(j,{})})})}var d=i.StyleSheet.create({child:{width:"100%"},inner:{width:"100%"}});function p(e){var i=e.scope,o=t.useState(0),s=o[0],d=o[1],p=i.original,f=i.getItems(),g=0,x=[],h=t.useState(null),y=h[0],m=h[1],j=function(e,t){void 0===t&&(t=!0),e&&i.execute({event:{validate:t,validateScope:p.validateScope,action:function(){i.changeValue(e.data),y=e,d(s=e.index),m(e)}}})},v=function(e){var t,n="ui-tabs-item ui-click";return(null==(t=y)?void 0:t.index)===e.index&&(n+=" ui-tab-selected"),n},b=function(e,t){var n=c({},e.props);t||(t=i.crud.data);var l=r.CrudUtils.create("tabs",{data:t,changed:t,parent:i.crud}),a=r.Utils.resolve(n,l);!1!==a.rendered&&x.push(c({},a,{child:e,element:a,original:n,index:g++,data:t}))};n.Children.map(e.children,(function(e,t){if(r.Utils.isEmpty(f))b(e,{});else for(var n in f)b(e,f[n])})),y||j(x[s],!1);var S=function(e){j(x[s+e])},w="stepper"===p.layout;return l.jsx("div",{className:i.getStyleClass("inner"),style:i.getStyle("inner"),children:l.jsxs("div",{className:"ui-tabs-content",children:[l.jsx("div",{className:"ui-tabs-items",children:x.map((function(e,t){return l.jsxs("div",{className:v(e),onClick:function(){j(e)},children:[w&&l.jsx("div",{className:"ui-tab-item-divisor"}),l.jsxs("div",{className:"ui-tab-item-inner",children:[w&&l.jsx("div",{className:"ui-step-line"}),l.jsx("div",{className:"ui-tab-item-label",children:w?e.index+1:e.label})]})]},r.Utils.key(p.id,"tab",t))}))}),y&&l.jsxs(l.Fragment,{children:[w&&l.jsx("div",{className:"ui-tabs-label",children:y.label}),l.jsx("div",{className:"ui-tabs-area",children:l.jsx(u,c({},e,{scope:i,children:y.child}))}),"stepper"===p.layout&&l.jsxs("div",{className:"ui-tabs-actions",children:[l.jsx($.Output,{space:6,layout:"left",children:l.jsx($.Include,c({},e,{transient:!0,name:"left",default:l.jsx($.Button,{rendered:s>0,icon:l.jsx(a,{}),click:function(){S(-1)}})}))}),l.jsx($.Output,{space:6,layout:"right",children:l.jsx($.Include,c({},e,{transient:!0,name:"right",default:l.jsx($.Button,{rendered:s<x.length-1,icon:l.jsx(a,{}),click:function(){S(1)}})}))})]})]})]})})}function f(e){var t=e.scope;return t.getItems(),r.Utils.asList(t.original.columns),l.jsx("div",{className:"ui-chart-data"})}function g(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:x.link,children:"Clique aqui para acessar o React Native"})})}var x={link:{}};function h(e){return l.jsx(l.Fragment,{children:l.jsx(g,c({},e.defaultsInput,e.defaultsUI))})}function y(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:m.link,children:"Clique aqui para acessar o React Native"})})}var m={link:{}};function j(e){var t=e.scope,n=t.getValue(),i={ion:o.Ionicons,ant:o.AntDesign,entypo:o.Entypo,evil:o.EvilIcons,material:o.MaterialCommunityIcons},a=r.Utils.nvl(t.original.library,"ion");return l.jsx(i[a],{name:n,style:t.getStyle("icon")})}var v={small:{minWidth:30,height:30}},b={small:{fontSize:20}};function S(e){var t=e.scope,n=t.original,a=r.Utils.nvl(n.size,"default"),s=r.Utils.nvl(n.variant,"default"),u=n.color,d=n.label,p=n.icon;u||(u="primaryLight");var f={buttonLabel:{color:"#ffffff",fontWeight:"500",fontSize:16},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center",height:44,minWidth:44},buttonIcon:{color:"#fff",fontSize:18},button:{backgroundColor:u,borderRadius:24,gap:10,justifyContent:"center",alignItems:"center",flexDirection:"row"}},g=function(e,n){var r=c({},f[e],n);return t.getStyle(e,r)},x={};x.button=p?{padding:0,height:40}:{height:50};var h=r.Utils.call((function(){var e=g("button",x.button);if(!e.width){var t=e.height;"number"==typeof t&&(e.minWidth=t)}return"text"===s&&(e.backgroundColor="transparent",e.color="text"),a&&(e=c({},e,v[a])),e})),y=r.Utils.call((function(){var e=g("buttonIcon",x.icon);return"text"===s&&(e.color="text"),a&&(e=c({},e,b[a])),e}));return l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(e){t.call("click",{})},style:h,children:l.jsxs(l.Fragment,{children:[p&&l.jsx(l.Fragment,{children:l.jsx(o.Ionicons,{size:30,style:y,name:p})}),d&&l.jsx(i.Text,{style:g("buttonLabel"),children:d})]})})}function w(e){var n=t.useState(!1),a=n[0],s=n[1],u=e.scope,d=r.Utils.nvl(u.getOptions(),[]),p=u.attr("placeholder","Selecione..."),f=u.getDisplayValue(),g=r.useTheme(),x=r.ViewUtils.getCrud("view"),h=function(){var e=!a;x.data.selectIsOpen=e,s(e)},y=function(e,t){return c({},C[e],u.getStyle(e),t)};return l.jsxs(i.View,{style:y("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:h,style:y("selectInput"),children:[l.jsx(i.Text,{style:y("selectLabel"),children:r.Utils.nvl(f,p)}),l.jsx(o.Ionicons,{name:"arrow-down",size:20,color:"#888"})]}),l.jsxs(i.Modal,{animationType:"slide",transparent:!0,visible:a,onRequestClose:function(){return s(!1)},children:[l.jsx(i.StatusBar,{barStyle:"dark-content",backgroundColor:g.colors.primary}),l.jsxs(i.SafeAreaView,{style:y("modalSafe"),children:[l.jsxs(i.View,{style:y("modalHeader"),children:[l.jsx(i.TouchableOpacity,{onPress:function(){return s(!1)},style:y("modalCloseButton"),children:l.jsx(i.Text,{style:y("modalCloseText"),children:"X"})}),l.jsx(i.Text,{style:y("modalTitle"),children:p})]}),l.jsx(i.View,{style:y("modalContent"),children:l.jsx($.List,{data:d,name:u.getName("list"),click:function(e){u.changeValue(e.value),h()},children:l.jsx($.Value,{value:"#{@this.label}"})})})]})]})]})}var C=i.StyleSheet.create({selectRoot:{justifyContent:"flex-start",alignItems:"flex-start",flex:1},selectInput:{width:"100%",flexDirection:"row",borderRadius:5,paddingHorizontal:15,paddingVertical:10},selectLabel:{flex:1},modalSafe:{flex:1,backgroundColor:"background",paddingTop:i.StatusBar.currentHeight||0},modalHeader:{flexDirection:"row",alignItems:"center",padding:15,backgroundColor:"#6200ea"},modalCloseButton:{padding:10},modalCloseText:{fontSize:18,color:"white"},modalTitle:{fontSize:18,color:"white",fontWeight:"bold",marginLeft:10},modalContent:{flex:1,width:"100%",alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",padding:20}});function U(e){var n=e.scope,a=r.Utils.nvl(n.getValue(),!1),o=t.useState(a),s=o[1];return l.jsx(i.Switch,{value:o[0],style:n.getStyle("element"),onValueChange:function(e){n.changeValue(e),s(e)}})}function T(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:k.link,children:"Clique aqui para acessar o React Native"})})}var k={link:{}};function I(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:V.link,children:"Clique aqui para acessar o React Native"})})}var V={link:{}};function F(e){var n=e.scope,a=r.Utils.nvl(n.getValue(),""),s=n.getLabel(),u=n.getPart("placeholder",null,s),d=n.original,p=t.useState(a),f=p[0],g=p[1],x=function(e,t){return c({},n.getStyle(e,B[e]),t)},h=function(){var e=d.icon;return l.jsx(l.Fragment,e?"string"==typeof e?{children:d.icon&&l.jsx(o.Ionicons,{name:d.icon,size:n.attr("iconSize",20),color:n.attr("iconColor","#888")})}:{children:e}:{})};return l.jsxs(l.Fragment,{children:[l.jsxs(i.View,{style:x("base"),children:[n.getPart("left"),l.jsx(i.TextInput,{style:x("input"),onChangeText:function(e){n.changeValue(e),g(e)},value:f,placeholder:u}),l.jsx(h,{})]}),n.getPart("right")]})}var B=i.StyleSheet.create({base:{flex:1,width:"100%",paddingBottom:0,paddingTop:0,alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:5,paddingHorizontal:15,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10},icon:{marginRight:10},input:{marginHorizontal:0,marginVertical:0,height:40,flex:1}});function P(e){var n,a=e.scope,o=e.index,s=a.original,d=e.item,p=a.getPart("cols",void 0,-1),f=Math.floor(100/p)+"%",g=null==(n={repeat:z,list:D})?void 0:n[s.type],x=""+a.key("row",o,""),h=t.useState(r.ScopeUtils.create(c({},s,{parent:a,name:x,crud:a.crud,index:o,type:"row",data:d})))[0],y=t.useRef(null),m=function(e,n){var r=t.useState(!0===n.visible),l=r[0],a=r[1];return t.useEffect((function(){var t=setInterval((function(){var t;if(e.current&&!l&&null!=(t=n.original)&&t.useIsInView)if("web"===i.Platform.OS){var r=null==e.current.getBoundingClientRect?void 0:e.current.getBoundingClientRect();if(r&&"undefined"!=typeof window){var o=window.innerHeight,s=r.top<o&&r.bottom>0;s&&(n.visible=s),a(s)}}else null==e.current.measureInWindow||e.current.measureInWindow((function(e,t,r,l){var o=t<i.Dimensions.get("window").height&&t+l>0;o&&(n.visible=o),a(o)}))}),300);return function(){return clearInterval(t)}}),[e]),l}(y,h),j=function(){return l.jsx(l.Fragment,!m&&s.useIsInView&&!h.visible&&o>20?{}:{children:l.jsx(u,{scope:h,crud:h.crud,children:e.children})})};return l.jsx((function(){var e=t.useState(0),n=e[0],r=e[1],u=a.key("item"),x=function(){var e=h.getStyle("row",c({},g.row,{minHeight:40}));return p>0&&(e.width=f),e};return h.update=function(){a.updateIndex=a.updateIndex+1,r(++n)},!1===h.getPart("renderedItem",void 0,!0)?l.jsx(l.Fragment,{}):s.click?l.jsx(i.TouchableHighlight,{style:x(),underlayColor:"transparent",ref:y,onPress:function(e){e.stopPropagation(),function(e){h.call("click",{value:e,item:e,edit:!0,index:o})}(d)},children:l.jsx(j,{})},u):l.jsx(i.View,{style:x(),ref:y,children:l.jsx(j,{})},u)}),{})}var D=i.StyleSheet.create({row:{padding:5,margin:0,width:"100%",backgroundColor:"background",gap:10,borderRadius:8,justifyContent:"center"}}),z=i.StyleSheet.create({row:{padding:0,width:"100%",justifyContent:"center"}});function L(e){var n,a=e.scope,s=a.crud,u=a.original,d=r.Utils.nvl(a.getPart("cols",void 0,1)),p=null==(n={repeat:R,list:E})?void 0:n[u.type],f=r.ComponentUtils.getDefine(e,"add"),g=u.hideAddWhenEmpty,x=function(){var n=t.useState(a.updateIndex),o=n[0],x=n[1];a.update=function(){a.updateIndex=++o,x(o)};var h,y=a.key("data"),m=r.Utils.call((function(){var e,t=r.Utils.nvl(a.getItems(),[]);if(u.search&&(null==(e=u.list)||!e.url)){var n=s.get("query","").toLowerCase().trim();if(n.length>1){var i=[],l=r.Utils.nvl(u.filterBy,"label");return r.Utils.each(t,(function(e){var t=e[l];t&&t.includes(n)&&i.push(e)})),i}}return t})),j=function(){if(!r.Utils.isEmpty(m))return l.jsx(l.Fragment,{});var e=a.attr("empty","Sem registro");return e?"string"==typeof e?l.jsx(i.Text,{style:a.getStyle("empty",{flex:1,fontWeight:500,fontSize:20,padding:10,textAlign:"center",justifyContent:"center",alignItems:"center"}),children:e}):l.jsx(l.Fragment,{children:e}):l.jsx(l.Fragment,{})};return l.jsxs(i.View,{style:(h=a.getStyle("container",c({},{},p.container)),d>1&&(h=c({},h,{flexDirection:"row",flexWrap:"wrap"})),h),children:[l.jsx(j,{}),m.map((function(t,n){return l.jsx(P,{index:n,item:t,scope:a,children:e.children})})),(!r.Utils.isEmpty(m)||!0!==g)&&l.jsx(l.Fragment,{children:f})]},y)};return l.jsxs(l.Fragment,{children:[!1!==u.search&&l.jsx($.Text,{placeholder:"Pesquisar...",field:"query",crud:s,style:{marginBottom:10},change:{action:function(){a.search()}},icon:l.jsx(o.Ionicons,{name:"search",size:20,color:"#888"})}),l.jsx(x,{})]})}var E=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}}),R=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}});function W(e){var n=e.scope,a=r.Utils.nvl(n.getOptions(),[]),o=n.getInputValue(),s=t.useState(0),u=s[0],d=s[1],p=function(e){return(null==e?void 0:e.value)===o},f=function(t){var a=t.item,o=t.index,s=p(a),u=c({},q.text);return s&&(u.color="#ffffff"),r.Utils.isEmpty(e.children)?l.jsx(i.Text,{style:u,children:a.label}):l.jsx(P,{scope:n,item:a.object,index:o,children:e.children})},g=function(e){var t=c({},q.item,n.getStyle("item")),r=Math.floor(100/a.length)+"%";if(p(e)){var i=n.getPart("selectedColor",void 0,"primary");(t=c({},t,n.getStyle("selected",{backgroundColor:i,color:"#ffffff"}))).color||(t.color="#ffffff")}return t.width=r,t};return l.jsx(l.Fragment,{children:a.map((function(e,t){return l.jsx(i.TouchableHighlight,{style:g(e),onPress:function(t){!function(e){n.changeValue(e.object),d(++u)}(e)},children:l.jsx(f,{item:e,index:t})},"k-"+t)}))})}var q=i.StyleSheet.create({container:{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row"},item:{padding:10,marginVertical:8,backgroundColor:"background",borderRadius:8,justifyContent:"center",width:"auto",flexDirection:"row"},text:{fontSize:15,fontWeight:"500"}});function O(e){var n=e.scope,a=n.original,s=t.useState(0),u=s[0],d=s[1],p=n.getValue(0),f=a.color;f||(f="primary");var g={padding:10,alignItems:"center",height:44,width:44,textAlign:"center",verticalAling:"middle",borderRadius:24,backgroundColor:f,color:"#ffffff",justifyContent:"center"},x={buttonLabel:{color:"#ffffff",fontWeight:"500",fontSize:16},value:{flex:1,flexDirection:"row",textAlign:"center"},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center"},buttonIcon:{color:"#fff",fontSize:18},button:g,addButton:c({},g),delButton:c({},g)},h=function(e){n.changeValue(p+e),d(++u)},y=function(e,t){var r=c({},x[e],t);return n.getStyle(e,r)};return l.jsxs(l.Fragment,{children:[l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){h(-1)},style:y("delButton"),children:l.jsx(o.Ionicons,{size:30,style:y("buttonIcon"),name:"remove"})}),l.jsx(i.Text,{style:y("value"),children:r.Utils.nvl(p,0)}),l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){h(1)},style:y("addButton"),children:l.jsx(o.Ionicons,{size:30,style:y("buttonIcon"),name:"add"})})]})}function H(e){var n,o,s=t.useState(!1),d=s[0],p=s[1],f=t.useState(0),g=f[0],x=f[1],h=r.ViewUtils.getCrud("view"),y=e.scope,m=y.getLabel(),j=y.getTheme(),v=r.Utils.nvl(null==(n=j.styles)||null==(n=n.defaults)?void 0:n.header,{}),b=function(e,t){var n=c({},N[e],t);return c({},y.getStyle(e,n))},S=function(){y.close({scope:y,crud:y.currentDialog,event:{}})},w=function(e){p(d=e)};y.update=function(){x(++g)},y.dialogShow=function(e){var t=e.crud,n=y.getName("modal"),i=!0===e.edit,l={},a=null;t.is("row")?(l.parent=t.parent.parent,l.search=t.parent,a=t.data):t.is("search")&&(l.parent=t.parent,l.search=t);var o=r.Utils.nvl(e.item,a,{}),s=r.CrudUtils.create("dialog",c({parent:t,root:t,name:n,dialog:h.dialog,data:o,edit:i,scope:y},l));h.dialog=s,y.currentDialog=s,w(!0),y.update()},y.dialogHide=function(e){var t;h.dialog=r.Utils.nvl(y.currentDialog.dialog,null),y.currentDialog=null,w(!1),null!=(t=h.dialog)&&t.scope&&h.dialog.scope.update(),y.update()},t.useEffect((function(){i.StatusBar.setBarStyle("light-content"),null==i.StatusBar.setBackgroundColor||i.StatusBar.setBackgroundColor(j.colors.primary)}),[d]);var C=y.currentDialog;if(!C)return l.jsx(l.Fragment,{});if(C.uuid!==(null==(o=h.dialog)?void 0:o.uuid))return l.jsx(l.Fragment,{});var U=r.ComponentUtils.getDefine(e,"header","right");return l.jsxs(i.Modal,{animationType:"slide",transparent:!0,visible:d,onRequestClose:S,children:[l.jsx(i.SafeAreaView,{style:b("modalTop")}),l.jsxs(i.SafeAreaView,{style:b("modalSafe"),children:[l.jsxs(i.View,{style:y.getStyle("header",v),children:[l.jsx(i.TouchableOpacity,{onPress:S,style:b("modalCloseButton"),children:l.jsx(a,{name:"chevron-back-outline",size:24,color:"white",style:b("modalCloseText")})}),l.jsx(i.Text,{style:b("modalTitle"),children:m}),!r.Utils.isEmpty(U)&&l.jsx(u,{scope:y,crud:y.currentDialog,transient:!0,children:U})]}),l.jsx(i.ScrollView,{contentContainerStyle:{flexGrow:1},style:b("modalContent"),children:l.jsx(i.View,{style:{flex:1},children:l.jsx(u,{scope:y,crud:y.currentDialog,children:e.children})})})]})]})}var N=i.StyleSheet.create({modalTop:{backgroundColor:"primary",width:"100%"},modalSafe:{flex:1,width:"100%",backgroundColor:"background"},modalCloseButton:{padding:10},modalCloseText:{fontSize:18,color:"white"},modalTitle:{fontSize:18,color:"white",fontWeight:"bold",marginLeft:10},modalContent:{flex:1,backgroundColor:"background",paddingHorizontal:16,paddingVertical:20}});function A(e){var n,a,o=e.scope,s=e.children,c=o.getTheme(),d=o.getPart("header",null,[]),p=r.Utils.nvl(null==(n=c.styles)||null==(n=n.defaults)?void 0:n.header,{}),f=r.Utils.nvl(null==(a=c.styles)||null==(a=a.defaults)?void 0:a.headerText,{});t.useEffect((function(){i.StatusBar.setBarStyle("light-content"),null==i.StatusBar.setBackgroundColor||i.StatusBar.setBackgroundColor(c.colors.primary)}),[]);var g=o.getStyle("header",p),x=!r.Utils.isEmpty(d);return l.jsxs(l.Fragment,{children:[x&&l.jsx(i.View,{style:g,children:l.jsx((function(){return"string"==typeof d?l.jsx(i.Text,{style:f,children:d}):l.jsx(l.Fragment,{children:d})}),{})}),l.jsx(i.View,{style:o.getStyle("container",M.container),children:l.jsx(i.ScrollView,{onScroll:function(){var e=r.ViewUtils.getCrud();r.Utils.each(e.scroll,(function(e){e.onScroll&&e.onScroll.call(e)}))},scrollEventThrottle:16,keyboardShouldPersistTaps:"handled",contentContainerStyle:o.getStyle("contentContainer",{}),style:o.getStyle("scroll",M.scroll),children:l.jsx(u,{scope:o,children:s})})})]})}var M=i.StyleSheet.create({scroll:{paddingHorizontal:16,paddingVertical:20},container:{backgroundColor:"primary"},view:{backgroundColor:"primary"}}),G=t.createContext({});function K(e){var n,a,s=t.useContext(G),d=r.Utils.nvl(e.theme,null==s?void 0:s.theme),g=r.Utils.nvl(e.crud,null==s?void 0:s.crud),x=t.useState(r.ScopeUtils.create(c({crud:g},e,{theme:d})))[0],m=t.useState(0),v=m[0],b=m[1],C=t.useState(null),k=C[0],V=C[1];g=x.crud;var B=x.getOptions(),P=x.original,D=t.useRef(null);x.update=function(){b(++v)},x.updateElement=function(){b(++v)},x.prompt=function(e){var t=e.event;if(t){var n="Você tem certeza que deseja continuar?",l="Atenção",a=t.prompt;"string"==typeof a&&(n=a),"object"==typeof a&&(n=r.Utils.nvl(a.message,n),l=r.Utils.nvl(a.title,l)),i.Alert.alert(l,n,[{text:"Cancelar",style:"cancel"},{text:"Confirmar",onPress:function(){return x.execute(e)}}],{cancelable:!1})}};var z=function(){var e=P.custom;return e?l.jsx(K,"string"==typeof e?{element:{value:e,type:"dummy"},crud:g}:c({type:e.type,tag:e.type},e.props,{crud:g})):l.jsx(l.Fragment,{})};if(x.is("type","dummy"))return l.jsx(l.Fragment,{children:x.getDisplayValue()});var E=function(){var e=x.getValue();R({target:{value:!(!0===e)}})},R=function(e){var t=e.target.value;x.isType("integer","int","number")?t=parseInt(t):x.isType("decimal")&&(t=parseFloat(t)),x.isType("select","complete")&&(t=x.getSelectedItem(t)),x.changeValue(t),x.update()},q=function(e){x.call("click")},N={scope:x,crud:g,onChange:R};x.isType("password")&&(N.type="password");var M=function(){return!(x.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},_=x.is("type","text","number","phone","postalCode","money","password","email"),Y=function(e,t){var n,i=r.Utils.nvl(P.type,"none"),l=r.Utils.nvl(e,"root"),a=c({},X[l]),o=M();return i=r.Utils.nvl(P.layout,i),e||o||(a=c({},a)),x.isInput()&&(a=c({},a,Q.input[l])),a=c({},a,null==Q||null==(n=Q[i])?void 0:n[l]),o&&e&&(a=c({},a,J[e])),c({},a,x.getStyle(e,a),t)},Z=Y("element"),$={required:x.isRequired(),size:"small",scope:x,crud:g,style:Z,placeholder:x.attr("placeholder","Digite aqui")};x.error=function(e){k=e,V(e)},null!=(n=P.list)&&n.url||null!=(a=P.load)&&a.url||x.start(),t.useEffect((function(){x.start()}));var ee=function(){return"string"==typeof P.icon?l.jsx(o.Ionicons,{name:P.icon,style:x.getStyle("icon")}):l.jsx(l.Fragment,{children:P.icon})};if(x.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=D&&D.current&&x.is("type","card","list","tabs","stepper")){var e=null==D?void 0:D.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!x.isRendered()||x.is("type","define"))return l.jsx(l.Fragment,{});var te=i.View,ne={};!x.isType("input","grid","list","repeat")&&P.click&&(te=i.TouchableHighlight,ne.underlayColor="transparent",ne.onPress=q);var re=function(){return l.jsxs(l.Fragment,{children:[x.is("type","button")&&l.jsxs(S,c({},$,{onClick:q,variant:x.attr("variant","outlined"),children:[P.icon&&l.jsx(ee,{}),P.label&&l.jsx(i.Text,{style:x.getPart("label","button"),children:x.getLabel()})]})),x.is("type","icon")&&l.jsx(j,c({},$,{onClick:q,variant:x.attr("variant","outlined"),children:x.getDisplayValue()})),x.is("type","link")&&l.jsxs(y,c({},$,{onClick:q,variant:x.attr("variant","outlined"),children:[P.icon&&l.jsx(ee,{}),P.label&&l.jsx(i.Text,{style:x.getPart("label","link"),children:x.getLabel()})]})),_&&l.jsx(F,c({},N,$,{InputProps:c({},P.inputProps)})),x.is("type","complete","autocomplete")&&l.jsx(h,{scope:x,defaultsInput:N,defaultsUI:$}),x.is("type","quantity")&&l.jsx(O,{scope:x,defaultsInput:N,defaultsUI:$}),x.is("type","checkbox","boolean","switch")&&l.jsx(U,c({checked:!0===x.getValue()},N,{onChange:E})),x.is("type","select")&&l.jsx(w,c({},N,$,{value:x.getSelectedValue()})),x.is("type","toggle")&&l.jsx(W,c({},N,$,{value:x.getSelectedValue()})),x.is("type","radio")&&l.jsx(I,c({},N,$,{row:!0,children:B.map((function(e,t){return l.jsx(T,{control:l.jsx(I,c({},$)),label:e.label,value:e.value},"i"+t)}))})),x.is("type","custom")&&l.jsx(z,{}),x.is("type","column")&&l.jsxs(l.Fragment,{children:[x.is("format","img")&&l.jsx(i.Image,{source:x.getDisplayValue()}),x.is("format","icon")&&l.jsx(j,{scope:x,crud:g}),!x.is("format","icon","img")&&l.jsx(i.Text,{children:x.getDisplayValue()})]}),x.is("type","output","value")&&l.jsx(i.Text,{style:Y("value"),children:x.getDisplayValue()})]})},ie=function(t){var n=t.name,i=t.style;if(e[n]){var a=r.ComponentUtils.getDefine(e,n);if(!r.Utils.isEmpty(a))return l.jsx(u,c({},e,{scope:x,crud:g,style:Y(n,i),children:a}))}return l.jsx(l.Fragment,{})};return l.jsx(G.Provider,{value:{crud:g,theme:d},children:l.jsx(te,c({ref:D,style:Y()},ne,{children:l.jsxs(l.Fragment,{children:[void 0!==P.label&&!1!==P.label&&!x.isType("button","dialog","modal")&&l.jsxs(i.View,{style:Y("outerLabel",{alignSelf:"flex-start",flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}),children:[l.jsx(i.Text,{style:Y("label"),children:x.getLabel()}),l.jsx(ie,{name:"actions",style:{width:"auto"}})]}),!M()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:Y("inner"),children:l.jsx(re,{})}),k&&l.jsx(i.View,{style:Y("error"),children:k})]}),x.isType("list","repeat")&&l.jsx(L,c({},e,{scope:x,crud:g})),x.isType("dialog")&&l.jsx(H,c({},e,{scope:x,crud:g})),x.isType("chart")&&l.jsx(f,c({},e,{scope:x,crud:g})),x.isType("tabs")&&l.jsx(p,c({},e,{scope:x,crud:g})),x.isType("view")&&l.jsx(A,c({},e,{scope:x,crud:g})),!x.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(u,c({},e,{scope:x,crud:g,style:Y("inner")}))]})}))})}var _=c({},i.StyleSheet.create({box:{borderWidth:1,borderColor:"#dedede",borderStyle:"solid",backgroundColor:"white",paddingVertical:10,paddingHorizontal:15,borderRadius:10,width:"100%"}}).box),Q={view:{inner:{width:"100%",alignItems:"normal",flex:1},container:{width:"100%",backgroundColor:"background",flex:1,gap:10},root:{width:"100%",flex:1,alignItems:"normal",padding:0}}};Q.card=i.StyleSheet.create({root:c({},_),inner:{flex:1,width:"100%",paddingBottom:10,paddingTop:5,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10}}),Q.input=i.StyleSheet.create({label:{paddingLeft:0},inner:{flex:1,width:"100%",padding:0,gap:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),Q.switch={inner:{paddingBottom:6,paddingTop:6,paddingHorizontal:25}},Q.quantity={inner:c({},_,{backgroundColor:"primarySoft",fontWeight:600,fontSize:16,borderRadius:25,borderWidth:0,padding:5,paddingHorizontal:5,paddingVertical:5,flexWrap:"nowrap",flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"})},Q.toggle=i.StyleSheet.create({inner:c({},_,{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row",paddingHorizontal:10,paddingVertical:0,alignSelf:"flex-start",flexWrap:"nowrap"})});var X=i.StyleSheet.create({root:{gap:5,flexDirection:"column",flexWrap:"wrap",width:"100%",alignItems:"flex-start"},label:{fontWeight:400,fontSize:12,color:"labelColor"},inner:{width:"100%"}}),J=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function Y(e){if(!1===e.rendered)return l.jsx(l.Fragment,{});var t=r.ComponentUtils.getDefine(e,e.name,e.position);return r.Utils.isEmpty(t)&&(t=e.default),r.Utils.isEmpty(t)?l.jsx(l.Fragment,{children:t}):l.jsx((function(t){var n=e.tag;return r.Utils.isEmpty(n)?l.jsx(l.Fragment,{children:t.children}):l.jsx(n,c({},t,{children:t.children}))}),c({},e.tagProps,{children:l.jsx(u,c({transient:!0},e,{scope:e.scope,crud:e.crud,part:e.name,children:t}))}))}var Z=["type"],$={List:function(e){return l.jsx(K,c({},e,{type:"list"}))},Row:function(e){return l.jsx(K,c({},e,{type:"row"}))},Value:function(e){return l.jsx(K,c({},e,{type:"value"}))},Label:function(e){return l.jsx(K,c({},e,{type:"label"}))},Repeat:function(e){return l.jsx(K,c({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(K,c({},e,{type:"define"}))},Include:function(e){return l.jsx(Y,c({},e))},Column:function(e){var t=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,Z);return l.jsx(K,c({},t,{type:"column"}))},Input:function(e){return l.jsx(K,c({},e))},Text:function(e){return l.jsx(K,c({},e,{type:"text"}))},Email:function(e){return l.jsx(K,c({},e,{type:"email"}))},Button:function(e){return l.jsx(K,c({},e,{type:"button"}))},Link:function(e){return l.jsx(K,c({},e,{type:"link"}))},Icon:function(e){return l.jsx(K,c({},e,{type:"icon"}))},Output:function(e){return l.jsx(K,c({},e,{type:"output"}))},Form:function(e){return l.jsx(K,c({},e,{type:"form"}))},Crud:function(e){return l.jsx(K,c({},e,{type:"crud"}))},View:function(e){return l.jsx(K,c({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(K,c({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(K,c({},e,{type:"dialog"}))},Content:function(e){return l.jsx(K,c({},e,{type:"content"}))},Top:function(e){return l.jsx(K,c({},e,{type:"top"}))},Card:function(e){return l.jsx(K,c({},e,{type:"card"}))},Tab:function(e){return l.jsx(K,c({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(K,c({},e,{type:"tabs"}))},Step:function(e){return l.jsx(K,c({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(K,c({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(K,c({},e,{type:"money"}))},Chart:function(e){return l.jsx(K,c({},e,{type:"chart"}))},Password:function(e){return l.jsx(K,c({},e,{type:"password"}))},Complete:function(e){return l.jsx(K,c({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(K,c({},e,{type:"switch"}))},Switch:function(e){return l.jsx(K,c({},e,{type:"switch"}))},Radio:function(e){return l.jsx(K,c({},e,{type:"radio"}))},Select:function(e){return l.jsx(K,c({},e,{type:"select"}))},Toggle:function(e){return l.jsx(K,c({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(K,c({},e,{type:"entity"}))},Element:function(e){return l.jsx(K,c({},e,{type:"element"}))},Quantity:function(e){return l.jsx(K,c({},e,{type:"quantity"}))},SafeView:function(e){var n,a=r.ThemeUtils.getCurrentTheme();return r.Utils.isEmpty(a)&&(a=r.useTheme()),t.useEffect((function(){i.StatusBar.setBarStyle("light-content"),null==i.StatusBar.setBackgroundColor||i.StatusBar.setBackgroundColor(a.colors.primary)}),[]),l.jsxs(s.SafeAreaProvider,{children:[l.jsx(i.StatusBar,{barStyle:"light-content"}),l.jsx(s.SafeAreaView,{style:c({backgroundColor:null==(n=a.colors)?void 0:n.primary},e.viewStyle,{flex:1}),children:l.jsx(i.KeyboardAvoidingView,{behavior:"ios"===i.Platform.OS?"padding":"height",style:{flex:1,justifyContent:"center"},children:l.jsx(i.TouchableWithoutFeedback,{onPress:function(){"web"!==i.Platform.OS&&i.Keyboard.dismiss()},accessible:!1,children:l.jsx(l.Fragment,{children:e.children})})})})]})}};exports.UI=$;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),n=e(t),r=require("react-crud-utils"),i=require("react-native"),l=require("react/jsx-runtime"),a=e(require("@expo/vector-icons/Ionicons")),o=require("@expo/vector-icons"),s=require("react-native-safe-area-context");function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function u(e){var a=t.useState(r.Utils.nvl(e.scope,r.ScopeUtils.create(e)))[0],o=r.Utils.nvl(e.crud,a.crud),s=r.Utils.nvl(e.validateScope,"global"),p=r.Utils.nvl(e.part,"child");if(a.isInput())return l.jsx(l.Fragment,{});var f,g,x,h,y,m=function(e){var t,n=e.child;if(!n)return l.jsx(l.Fragment,{});if("string"==typeof n)return l.jsx(l.Fragment,{children:n});var i=n.type,d=c({},n.props);return delete d.children,"string"==typeof i?r.Utils.isEmpty(n.props.children)?l.jsx(i,c({},d)):l.jsx(i,c({},d,{children:l.jsx(u,c({transient:!0,validateScope:s},n.props,{scope:a,crud:o}))})):"function"==typeof i?l.jsx(i,c({validateScope:s},n.props,{parent:a,crud:o})):r.Utils.isEmpty(null==(t=n.props)?void 0:t.children)?l.jsx(l.Fragment,{}):l.jsx(u,c({validateScope:s},n.props,{scope:a,crud:o,transient:!0}))},j=function(){return l.jsx(l.Fragment,e.elements?{children:Object.entries(e.elements).map((function(e,t){return l.jsx(K,c({crud:o},e[1]))}))}:{children:n.Children.map(e.children,(function(e){return l.jsx(m,{child:e})}))})};return e.transient?l.jsx(j,{}):r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements)?l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{children:l.jsx(i.View,{style:(f=p,x=r.Utils.nvl(f,"root"),h=d[x],y={},r.Utils.isEmpty(e.style)||(null!=(g=e.style)&&g.push?r.Utils.each(e.style,(function(e){e&&(y=c({},y,e))})):y=c({},e.style)),c({},h,y,a.getStyle(f))),children:l.jsx(j,{})})})}var d=i.StyleSheet.create({child:{width:"100%"},inner:{width:"100%"}});function p(e){var i=e.scope,o=t.useState(0),s=o[0],d=o[1],p=i.original,f=i.getItems(),g=0,x=[],h=t.useState(null),y=h[0],m=h[1],j=function(e,t){void 0===t&&(t=!0),e&&i.execute({event:{validate:t,validateScope:p.validateScope,action:function(){i.changeValue(e.data),y=e,d(s=e.index),m(e)}}})},v=function(e){var t,n="ui-tabs-item ui-click";return(null==(t=y)?void 0:t.index)===e.index&&(n+=" ui-tab-selected"),n},b=function(e,t){var n=c({},e.props);t||(t=i.crud.data);var l=r.CrudUtils.create("tabs",{data:t,changed:t,parent:i.crud}),a=r.Utils.resolve(n,l);!1!==a.rendered&&x.push(c({},a,{child:e,element:a,original:n,index:g++,data:t}))};n.Children.map(e.children,(function(e,t){if(r.Utils.isEmpty(f))b(e,{});else for(var n in f)b(e,f[n])})),y||j(x[s],!1);var S=function(e){j(x[s+e])},w="stepper"===p.layout;return l.jsx("div",{className:i.getStyleClass("inner"),style:i.getStyle("inner"),children:l.jsxs("div",{className:"ui-tabs-content",children:[l.jsx("div",{className:"ui-tabs-items",children:x.map((function(e,t){return l.jsxs("div",{className:v(e),onClick:function(){j(e)},children:[w&&l.jsx("div",{className:"ui-tab-item-divisor"}),l.jsxs("div",{className:"ui-tab-item-inner",children:[w&&l.jsx("div",{className:"ui-step-line"}),l.jsx("div",{className:"ui-tab-item-label",children:w?e.index+1:e.label})]})]},r.Utils.key(p.id,"tab",t))}))}),y&&l.jsxs(l.Fragment,{children:[w&&l.jsx("div",{className:"ui-tabs-label",children:y.label}),l.jsx("div",{className:"ui-tabs-area",children:l.jsx(u,c({},e,{scope:i,children:y.child}))}),"stepper"===p.layout&&l.jsxs("div",{className:"ui-tabs-actions",children:[l.jsx($.Output,{space:6,layout:"left",children:l.jsx($.Include,c({},e,{transient:!0,name:"left",default:l.jsx($.Button,{rendered:s>0,icon:l.jsx(a,{}),click:function(){S(-1)}})}))}),l.jsx($.Output,{space:6,layout:"right",children:l.jsx($.Include,c({},e,{transient:!0,name:"right",default:l.jsx($.Button,{rendered:s<x.length-1,icon:l.jsx(a,{}),click:function(){S(1)}})}))})]})]})]})})}function f(e){var t=e.scope;return t.getItems(),r.Utils.asList(t.original.columns),l.jsx("div",{className:"ui-chart-data"})}function g(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:x.link,children:"Clique aqui para acessar o React Native"})})}var x={link:{}};function h(e){return l.jsx(l.Fragment,{children:l.jsx(g,c({},e.defaultsInput,e.defaultsUI))})}function y(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:m.link,children:"Clique aqui para acessar o React Native"})})}var m={link:{}};function j(e){var t=e.scope,n=t.getValue(),i={ion:o.Ionicons,ant:o.AntDesign,entypo:o.Entypo,evil:o.EvilIcons,material:o.MaterialCommunityIcons},a=r.Utils.nvl(t.original.library,"ion");return l.jsx(i[a],{name:n,style:t.getStyle("icon")})}var v={small:{minWidth:30,height:30}},b={small:{fontSize:16}};function S(e){var t=e.scope,n=t.original,a=r.Utils.nvl(n.size,"default"),s=r.Utils.nvl(n.variant,"default"),u=n.color,d=n.label,p=n.icon;u||(u="primaryLight");var f={buttonLabel:{color:"#ffffff",fontWeight:"500",fontSize:16},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center",height:44,minWidth:44},buttonIcon:{color:"#fff",fontSize:18},button:{backgroundColor:u,borderRadius:24,gap:10,justifyContent:"center",alignItems:"center",flexDirection:"row"}},g=function(e,n){var r=c({},f[e],n);return t.getStyle(e,r)},x={};x.button=p?{padding:0,height:40}:{height:50};var h=r.Utils.call((function(){var e=g("button",x.button);if(!e.width){var t=e.height;"number"==typeof t&&(e.minWidth=t)}return"text"===s&&(e.backgroundColor="transparent",e.color="text"),a&&(e=c({},e,v[a])),e})),y=r.Utils.call((function(){var e=g("buttonIcon",x.icon);return"text"===s&&(e.color="text"),a&&(e=c({},e,b[a])),e}));return l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(e){t.call("click",{})},style:h,children:l.jsxs(l.Fragment,{children:[p&&l.jsx(l.Fragment,{children:l.jsx(o.Ionicons,{size:30,style:y,name:p})}),d&&l.jsx(i.Text,{style:g("buttonLabel"),children:d})]})})}function w(e){var n=t.useState(!1),a=n[0],s=n[1],u=e.scope,d=r.Utils.nvl(u.getOptions(),[]),p=u.attr("placeholder","Selecione..."),f=u.getDisplayValue(),g=r.useTheme(),x=r.ViewUtils.getCrud("view"),h=function(){var e=!a;x.data.selectIsOpen=e,s(e)},y=function(e,t){return c({},C[e],u.getStyle(e),t)};return l.jsxs(i.View,{style:y("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:h,style:y("selectInput"),children:[l.jsx(i.Text,{style:y("selectLabel"),children:r.Utils.nvl(f,p)}),l.jsx(o.Ionicons,{name:"arrow-down",size:20,color:"#888"})]}),l.jsxs(i.Modal,{animationType:"slide",transparent:!0,visible:a,onRequestClose:function(){return s(!1)},children:[l.jsx(i.StatusBar,{barStyle:"dark-content",backgroundColor:g.colors.primary}),l.jsxs(i.SafeAreaView,{style:y("modalSafe"),children:[l.jsxs(i.View,{style:y("modalHeader"),children:[l.jsx(i.TouchableOpacity,{onPress:function(){return s(!1)},style:y("modalCloseButton"),children:l.jsx(i.Text,{style:y("modalCloseText"),children:"X"})}),l.jsx(i.Text,{style:y("modalTitle"),children:p})]}),l.jsx(i.View,{style:y("modalContent"),children:l.jsx($.List,{data:d,name:u.getName("list"),click:function(e){u.changeValue(e.value),h()},children:l.jsx($.Value,{value:"#{@this.label}"})})})]})]})]})}var C=i.StyleSheet.create({selectRoot:{justifyContent:"flex-start",alignItems:"flex-start",flex:1},selectInput:{width:"100%",flexDirection:"row",borderRadius:5,paddingHorizontal:15,paddingVertical:10},selectLabel:{flex:1},modalSafe:{flex:1,backgroundColor:"background",paddingTop:i.StatusBar.currentHeight||0},modalHeader:{flexDirection:"row",alignItems:"center",padding:15,backgroundColor:"#6200ea"},modalCloseButton:{padding:10},modalCloseText:{fontSize:18,color:"white"},modalTitle:{fontSize:18,color:"white",fontWeight:"bold",marginLeft:10},modalContent:{flex:1,width:"100%",alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",padding:20}});function U(e){var n=e.scope,a=r.Utils.nvl(n.getValue(),!1),o=t.useState(a),s=o[1];return l.jsx(i.Switch,{value:o[0],style:n.getStyle("element"),onValueChange:function(e){n.changeValue(e),s(e)}})}function T(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:k.link,children:"Clique aqui para acessar o React Native"})})}var k={link:{}};function I(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:V.link,children:"Clique aqui para acessar o React Native"})})}var V={link:{}};function F(e){var n=e.scope,a=r.Utils.nvl(n.getValue(),""),s=n.getLabel(),u=n.getPart("placeholder",null,s),d=n.original,p=t.useState(a),f=p[0],g=p[1],x=function(e,t){return c({},n.getStyle(e,B[e]),t)},h=function(){var e=d.icon;return l.jsx(l.Fragment,e?"string"==typeof e?{children:d.icon&&l.jsx(o.Ionicons,{name:d.icon,size:n.attr("iconSize",20),color:n.attr("iconColor","#888")})}:{children:e}:{})};return l.jsxs(l.Fragment,{children:[l.jsxs(i.View,{style:x("base"),children:[n.getPart("left"),l.jsx(i.TextInput,{style:x("input"),onChangeText:function(e){n.changeValue(e),g(e)},value:f,placeholder:u}),l.jsx(h,{})]}),n.getPart("right")]})}var B=i.StyleSheet.create({base:{flex:1,width:"100%",paddingBottom:0,paddingTop:0,alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:5,paddingHorizontal:15,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10},icon:{marginRight:10},input:{marginHorizontal:0,marginVertical:0,height:40,flex:1}});function P(e){var n,a=e.scope,o=e.index,s=a.original,d=e.item,p=a.getPart("cols",void 0,-1),f=Math.floor(100/p)+"%",g=null==(n={repeat:z,list:D})?void 0:n[s.type],x=""+a.key("row",o,""),h=t.useState(r.ScopeUtils.create(c({},s,{parent:a,name:x,crud:a.crud,index:o,type:"row",data:d})))[0],y=t.useRef(null),m=function(e,n){var r=t.useState(!0===n.visible),l=r[0],a=r[1];return t.useEffect((function(){var t=setInterval((function(){var t;if(e.current&&!l&&null!=(t=n.original)&&t.useIsInView)if("web"===i.Platform.OS){var r=null==e.current.getBoundingClientRect?void 0:e.current.getBoundingClientRect();if(r&&"undefined"!=typeof window){var o=window.innerHeight,s=r.top<o&&r.bottom>0;s&&(n.visible=s),a(s)}}else null==e.current.measureInWindow||e.current.measureInWindow((function(e,t,r,l){var o=t<i.Dimensions.get("window").height&&t+l>0;o&&(n.visible=o),a(o)}))}),300);return function(){return clearInterval(t)}}),[e]),l}(y,h),j=function(){return l.jsx(l.Fragment,!m&&s.useIsInView&&!h.visible&&o>20?{}:{children:l.jsx(u,{scope:h,crud:h.crud,children:e.children})})};return l.jsx((function(){var e=t.useState(0),n=e[0],r=e[1],u=a.key("item"),x=function(){var e=h.getStyle("row",c({},g.row,{minHeight:40}));return p>0&&(e.width=f),e};return h.update=function(){a.updateIndex=a.updateIndex+1,r(++n)},!1===h.getPart("renderedItem",void 0,!0)?l.jsx(l.Fragment,{}):s.click?l.jsx(i.TouchableHighlight,{style:x(),underlayColor:"transparent",ref:y,onPress:function(e){e.stopPropagation(),function(e){h.call("click",{value:e,item:e,edit:!0,index:o})}(d)},children:l.jsx(j,{})},u):l.jsx(i.View,{style:x(),ref:y,children:l.jsx(j,{})},u)}),{})}var D=i.StyleSheet.create({row:{padding:5,margin:0,width:"100%",backgroundColor:"background",gap:10,borderRadius:8,justifyContent:"center"}}),z=i.StyleSheet.create({row:{padding:0,width:"100%",justifyContent:"center"}});function L(e){var n,a=e.scope,s=a.crud,u=a.original,d=r.Utils.nvl(a.getPart("cols",void 0,1)),p=null==(n={repeat:R,list:E})?void 0:n[u.type],f=r.ComponentUtils.getDefine(e,"add"),g=u.hideAddWhenEmpty,x=function(){var n=t.useState(a.updateIndex),o=n[0],x=n[1];a.update=function(){a.updateIndex=++o,x(o)};var h,y=a.key("data"),m=r.Utils.call((function(){var e,t=r.Utils.nvl(a.getItems(),[]);if(u.search&&(null==(e=u.list)||!e.url)){var n=s.get("query","").toLowerCase().trim();if(n.length>1){var i=[],l=r.Utils.nvl(u.filterBy,"label");return r.Utils.each(t,(function(e){var t=e[l];t&&t.includes(n)&&i.push(e)})),i}}return t})),j=function(){if(!r.Utils.isEmpty(m))return l.jsx(l.Fragment,{});var e=a.attr("empty","Sem registro");return e?"string"==typeof e?l.jsx(i.Text,{style:a.getStyle("empty",{flex:1,fontWeight:500,fontSize:20,padding:10,textAlign:"center",justifyContent:"center",alignItems:"center"}),children:e}):l.jsx(l.Fragment,{children:e}):l.jsx(l.Fragment,{})};return l.jsxs(i.View,{style:(h=a.getStyle("container",c({},{},p.container)),d>1&&(h=c({},h,{flexDirection:"row",flexWrap:"wrap"})),h),children:[l.jsx(j,{}),m.map((function(t,n){return l.jsx(P,{index:n,item:t,scope:a,children:e.children})})),(!r.Utils.isEmpty(m)||!0!==g)&&l.jsx(l.Fragment,{children:f})]},y)};return l.jsxs(l.Fragment,{children:[!1!==u.search&&l.jsx($.Text,{placeholder:"Pesquisar...",field:"query",crud:s,style:{marginBottom:10},change:{action:function(){a.search()}},icon:l.jsx(o.Ionicons,{name:"search",size:20,color:"#888"})}),l.jsx(x,{})]})}var E=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}}),R=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}});function W(e){var n=e.scope,a=r.Utils.nvl(n.getOptions(),[]),o=n.getInputValue(),s=t.useState(0),u=s[0],d=s[1],p=function(e){return(null==e?void 0:e.value)===o},f=function(t){var a=t.item,o=t.index,s=p(a),u=c({},q.text);return s&&(u.color="#ffffff"),r.Utils.isEmpty(e.children)?l.jsx(i.Text,{style:u,children:a.label}):l.jsx(P,{scope:n,item:a.object,index:o,children:e.children})},g=function(e){var t=c({},q.item,n.getStyle("item")),r=Math.floor(100/a.length)+"%";if(p(e)){var i=n.getPart("selectedColor",void 0,"primary");(t=c({},t,n.getStyle("selected",{backgroundColor:i,color:"#ffffff"}))).color||(t.color="#ffffff")}return t.width=r,t};return l.jsx(l.Fragment,{children:a.map((function(e,t){return l.jsx(i.TouchableHighlight,{style:g(e),onPress:function(t){!function(e){n.changeValue(e.object),d(++u)}(e)},children:l.jsx(f,{item:e,index:t})},"k-"+t)}))})}var q=i.StyleSheet.create({container:{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row"},item:{padding:10,marginVertical:8,backgroundColor:"background",borderRadius:8,justifyContent:"center",width:"auto",flexDirection:"row"},text:{fontSize:15,fontWeight:"500"}});function O(e){var n=e.scope,a=n.original,s=t.useState(0),u=s[0],d=s[1],p=n.getValue(0),f=a.color;f||(f="primary");var g={padding:10,alignItems:"center",height:44,width:44,textAlign:"center",verticalAling:"middle",borderRadius:24,backgroundColor:f,color:"#ffffff",justifyContent:"center"},x={buttonLabel:{color:"#ffffff",fontWeight:"500",fontSize:16},value:{flex:1,flexDirection:"row",textAlign:"center"},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center"},buttonIcon:{color:"#fff",fontSize:18},button:g,addButton:c({},g),delButton:c({},g)},h=function(e){n.changeValue(p+e),d(++u)},y=function(e,t){var r=c({},x[e],t);return n.getStyle(e,r)};return l.jsxs(l.Fragment,{children:[l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){h(-1)},style:y("delButton"),children:l.jsx(o.Ionicons,{size:30,style:y("buttonIcon"),name:"remove"})}),l.jsx(i.Text,{style:y("value"),children:r.Utils.nvl(p,0)}),l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){h(1)},style:y("addButton"),children:l.jsx(o.Ionicons,{size:30,style:y("buttonIcon"),name:"add"})})]})}function H(e){var n,o,s=t.useState(!1),d=s[0],p=s[1],f=t.useState(0),g=f[0],x=f[1],h=r.ViewUtils.getCrud("view"),y=e.scope,m=y.getLabel(),j=y.getTheme(),v=r.Utils.nvl(null==(n=j.styles)||null==(n=n.defaults)?void 0:n.header,{}),b=function(e,t){var n=c({},N[e],t);return c({},y.getStyle(e,n))},S=function(){y.close({scope:y,crud:y.currentDialog,event:{}})},w=function(e){p(d=e)};y.update=function(){x(++g)},y.dialogShow=function(e){var t=e.crud,n=y.getName("modal"),i=!0===e.edit,l={},a=null;t.is("row")?(l.parent=t.parent.parent,l.search=t.parent,a=t.data):t.is("search")&&(l.parent=t.parent,l.search=t);var o=r.Utils.nvl(e.item,a,{}),s=r.CrudUtils.create("dialog",c({parent:t,root:t,name:n,dialog:h.dialog,data:o,edit:i,scope:y},l));h.dialog=s,y.currentDialog=s,w(!0),y.update()},y.dialogHide=function(e){var t;h.dialog=r.Utils.nvl(y.currentDialog.dialog,null),y.currentDialog=null,w(!1),null!=(t=h.dialog)&&t.scope&&h.dialog.scope.update(),y.update()},t.useEffect((function(){i.StatusBar.setBarStyle("light-content"),null==i.StatusBar.setBackgroundColor||i.StatusBar.setBackgroundColor(j.colors.primary)}),[d]);var C=y.currentDialog;if(!C)return l.jsx(l.Fragment,{});if(C.uuid!==(null==(o=h.dialog)?void 0:o.uuid))return l.jsx(l.Fragment,{});var U=r.ComponentUtils.getDefine(e,"header","right");return l.jsxs(i.Modal,{animationType:"slide",transparent:!0,visible:d,onRequestClose:S,children:[l.jsx(i.SafeAreaView,{style:b("modalTop")}),l.jsxs(i.SafeAreaView,{style:b("modalSafe"),children:[l.jsxs(i.View,{style:y.getStyle("header",v),children:[l.jsx(i.TouchableOpacity,{onPress:S,style:b("modalCloseButton"),children:l.jsx(a,{name:"chevron-back-outline",size:24,color:"white",style:b("modalCloseText")})}),l.jsx(i.Text,{style:b("modalTitle"),children:m}),!r.Utils.isEmpty(U)&&l.jsx(u,{scope:y,crud:y.currentDialog,transient:!0,children:U})]}),l.jsx(i.ScrollView,{contentContainerStyle:{flexGrow:1},style:b("modalContent"),children:l.jsx(i.View,{style:{flex:1},children:l.jsx(u,{scope:y,crud:y.currentDialog,children:e.children})})})]})]})}var N=i.StyleSheet.create({modalTop:{backgroundColor:"primary",width:"100%"},modalSafe:{flex:1,width:"100%",backgroundColor:"background"},modalCloseButton:{padding:10},modalCloseText:{fontSize:18,color:"white"},modalTitle:{fontSize:18,color:"white",fontWeight:"bold",marginLeft:10},modalContent:{flex:1,backgroundColor:"background",paddingHorizontal:16,paddingVertical:20}});function A(e){var n,a,o=e.scope,s=e.children,c=o.getTheme(),d=o.getPart("header",null,[]),p=r.Utils.nvl(null==(n=c.styles)||null==(n=n.defaults)?void 0:n.header,{}),f=r.Utils.nvl(null==(a=c.styles)||null==(a=a.defaults)?void 0:a.headerText,{});t.useEffect((function(){i.StatusBar.setBarStyle("light-content"),null==i.StatusBar.setBackgroundColor||i.StatusBar.setBackgroundColor(c.colors.primary)}),[]);var g=o.getStyle("header",p),x=!r.Utils.isEmpty(d);return l.jsxs(l.Fragment,{children:[x&&l.jsx(i.View,{style:g,children:l.jsx((function(){return"string"==typeof d?l.jsx(i.Text,{style:f,children:d}):l.jsx(l.Fragment,{children:d})}),{})}),l.jsx(i.View,{style:o.getStyle("container",M.container),children:l.jsx(i.ScrollView,{onScroll:function(){var e=r.ViewUtils.getCrud();r.Utils.each(e.scroll,(function(e){e.onScroll&&e.onScroll.call(e)}))},scrollEventThrottle:16,keyboardShouldPersistTaps:"handled",contentContainerStyle:o.getStyle("contentContainer",{}),style:o.getStyle("scroll",M.scroll),children:l.jsx(u,{scope:o,children:s})})})]})}var M=i.StyleSheet.create({scroll:{paddingHorizontal:16,paddingVertical:20},container:{backgroundColor:"primary"},view:{backgroundColor:"primary"}}),G=t.createContext({});function K(e){var n,a,s=t.useContext(G),d=r.Utils.nvl(e.theme,null==s?void 0:s.theme),g=r.Utils.nvl(e.crud,null==s?void 0:s.crud),x=t.useState(r.ScopeUtils.create(c({crud:g},e,{theme:d})))[0],m=t.useState(0),v=m[0],b=m[1],C=t.useState(null),k=C[0],V=C[1];g=x.crud;var B=x.getOptions(),P=x.original,D=t.useRef(null);x.update=function(){b(++v)},x.updateElement=function(){b(++v)},x.prompt=function(e){var t=e.event;if(t){var n="Você tem certeza que deseja continuar?",l="Atenção",a=t.prompt;"string"==typeof a&&(n=a),"object"==typeof a&&(n=r.Utils.nvl(a.message,n),l=r.Utils.nvl(a.title,l)),i.Alert.alert(l,n,[{text:"Cancelar",style:"cancel"},{text:"Confirmar",onPress:function(){return x.execute(e)}}],{cancelable:!1})}};var z=function(){var e=P.custom;return e?l.jsx(K,"string"==typeof e?{element:{value:e,type:"dummy"},crud:g}:c({type:e.type,tag:e.type},e.props,{crud:g})):l.jsx(l.Fragment,{})};if(x.is("type","dummy"))return l.jsx(l.Fragment,{children:x.getDisplayValue()});var E=function(){var e=x.getValue();R({target:{value:!(!0===e)}})},R=function(e){var t=e.target.value;x.isType("integer","int","number")?t=parseInt(t):x.isType("decimal")&&(t=parseFloat(t)),x.isType("select","complete")&&(t=x.getSelectedItem(t)),x.changeValue(t),x.update()},q=function(e){x.call("click")},N={scope:x,crud:g,onChange:R};x.isType("password")&&(N.type="password");var M=function(){return!(x.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},_=x.is("type","text","number","phone","postalCode","money","password","email"),Y=function(e,t){var n,i=r.Utils.nvl(P.type,"none"),l=r.Utils.nvl(e,"root"),a=c({},X[l]),o=M();return i=r.Utils.nvl(P.layout,i),e||o||(a=c({},a)),x.isInput()&&(a=c({},a,Q.input[l])),a=c({},a,null==Q||null==(n=Q[i])?void 0:n[l]),o&&e&&(a=c({},a,J[e])),c({},a,x.getStyle(e,a),t)},Z=Y("element"),$={required:x.isRequired(),size:"small",scope:x,crud:g,style:Z,placeholder:x.attr("placeholder","Digite aqui")};x.error=function(e){k=e,V(e)},null!=(n=P.list)&&n.url||null!=(a=P.load)&&a.url||x.start(),t.useEffect((function(){x.start()}));var ee=function(){return"string"==typeof P.icon?l.jsx(o.Ionicons,{name:P.icon,style:x.getStyle("icon")}):l.jsx(l.Fragment,{children:P.icon})};if(x.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=D&&D.current&&x.is("type","card","list","tabs","stepper")){var e=null==D?void 0:D.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!x.isRendered()||x.is("type","define"))return l.jsx(l.Fragment,{});var te=i.View,ne={};!x.isType("input","grid","list","repeat")&&P.click&&(te=i.TouchableHighlight,ne.underlayColor="transparent",ne.onPress=q);var re=function(){return l.jsxs(l.Fragment,{children:[x.is("type","button")&&l.jsxs(S,c({},$,{onClick:q,variant:x.attr("variant","outlined"),children:[P.icon&&l.jsx(ee,{}),P.label&&l.jsx(i.Text,{style:x.getPart("label","button"),children:x.getLabel()})]})),x.is("type","icon")&&l.jsx(j,c({},$,{onClick:q,variant:x.attr("variant","outlined"),children:x.getDisplayValue()})),x.is("type","link")&&l.jsxs(y,c({},$,{onClick:q,variant:x.attr("variant","outlined"),children:[P.icon&&l.jsx(ee,{}),P.label&&l.jsx(i.Text,{style:x.getPart("label","link"),children:x.getLabel()})]})),_&&l.jsx(F,c({},N,$,{InputProps:c({},P.inputProps)})),x.is("type","complete","autocomplete")&&l.jsx(h,{scope:x,defaultsInput:N,defaultsUI:$}),x.is("type","quantity")&&l.jsx(O,{scope:x,defaultsInput:N,defaultsUI:$}),x.is("type","checkbox","boolean","switch")&&l.jsx(U,c({checked:!0===x.getValue()},N,{onChange:E})),x.is("type","select")&&l.jsx(w,c({},N,$,{value:x.getSelectedValue()})),x.is("type","toggle")&&l.jsx(W,c({},N,$,{value:x.getSelectedValue()})),x.is("type","radio")&&l.jsx(I,c({},N,$,{row:!0,children:B.map((function(e,t){return l.jsx(T,{control:l.jsx(I,c({},$)),label:e.label,value:e.value},"i"+t)}))})),x.is("type","custom")&&l.jsx(z,{}),x.is("type","column")&&l.jsxs(l.Fragment,{children:[x.is("format","img")&&l.jsx(i.Image,{source:x.getDisplayValue()}),x.is("format","icon")&&l.jsx(j,{scope:x,crud:g}),!x.is("format","icon","img")&&l.jsx(i.Text,{children:x.getDisplayValue()})]}),x.is("type","output","value")&&l.jsx(i.Text,{style:Y("value"),children:x.getDisplayValue()})]})},ie=function(t){var n=t.name,i=t.style;if(e[n]){var a=r.ComponentUtils.getDefine(e,n);if(!r.Utils.isEmpty(a))return l.jsx(u,c({},e,{scope:x,crud:g,style:Y(n,i),children:a}))}return l.jsx(l.Fragment,{})};return l.jsx(G.Provider,{value:{crud:g,theme:d},children:l.jsx(te,c({ref:D,style:Y()},ne,{children:l.jsxs(l.Fragment,{children:[void 0!==P.label&&!1!==P.label&&!x.isType("button","dialog","modal")&&l.jsxs(i.View,{style:Y("outerLabel",{alignSelf:"flex-start",flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}),children:[l.jsx(i.Text,{style:Y("label"),children:x.getLabel()}),l.jsx(ie,{name:"actions",style:{width:"auto"}})]}),!M()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:Y("inner"),children:l.jsx(re,{})}),k&&l.jsx(i.View,{style:Y("error"),children:k})]}),x.isType("list","repeat")&&l.jsx(L,c({},e,{scope:x,crud:g})),x.isType("dialog")&&l.jsx(H,c({},e,{scope:x,crud:g})),x.isType("chart")&&l.jsx(f,c({},e,{scope:x,crud:g})),x.isType("tabs")&&l.jsx(p,c({},e,{scope:x,crud:g})),x.isType("view")&&l.jsx(A,c({},e,{scope:x,crud:g})),!x.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(u,c({},e,{scope:x,crud:g,style:Y("inner")}))]})}))})}var _=c({},i.StyleSheet.create({box:{borderWidth:1,borderColor:"#dedede",borderStyle:"solid",backgroundColor:"white",paddingVertical:10,paddingHorizontal:15,borderRadius:10,width:"100%"}}).box),Q={view:{inner:{width:"100%",alignItems:"normal",flex:1},container:{width:"100%",backgroundColor:"background",flex:1,gap:10},root:{width:"100%",flex:1,alignItems:"normal",padding:0}}};Q.card=i.StyleSheet.create({root:c({},_),inner:{flex:1,width:"100%",paddingBottom:10,paddingTop:5,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10}}),Q.input=i.StyleSheet.create({label:{paddingLeft:0},inner:{flex:1,width:"100%",padding:0,gap:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),Q.switch={inner:{paddingBottom:6,paddingTop:6,paddingHorizontal:25}},Q.quantity={inner:c({},_,{backgroundColor:"primarySoft",fontWeight:600,fontSize:16,borderRadius:25,borderWidth:0,padding:5,paddingHorizontal:5,paddingVertical:5,flexWrap:"nowrap",flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"})},Q.toggle=i.StyleSheet.create({inner:c({},_,{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row",paddingHorizontal:10,paddingVertical:0,alignSelf:"flex-start",flexWrap:"nowrap"})});var X=i.StyleSheet.create({root:{gap:5,flexDirection:"column",flexWrap:"wrap",width:"100%",alignItems:"flex-start"},label:{fontWeight:400,fontSize:12,color:"labelColor"},inner:{width:"100%"}}),J=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function Y(e){if(!1===e.rendered)return l.jsx(l.Fragment,{});var t=r.ComponentUtils.getDefine(e,e.name,e.position);return r.Utils.isEmpty(t)&&(t=e.default),r.Utils.isEmpty(t)?l.jsx(l.Fragment,{children:t}):l.jsx((function(t){var n=e.tag;return r.Utils.isEmpty(n)?l.jsx(l.Fragment,{children:t.children}):l.jsx(n,c({},t,{children:t.children}))}),c({},e.tagProps,{children:l.jsx(u,c({transient:!0},e,{scope:e.scope,crud:e.crud,part:e.name,children:t}))}))}var Z=["type"],$={List:function(e){return l.jsx(K,c({},e,{type:"list"}))},Row:function(e){return l.jsx(K,c({},e,{type:"row"}))},Value:function(e){return l.jsx(K,c({},e,{type:"value"}))},Label:function(e){return l.jsx(K,c({},e,{type:"label"}))},Repeat:function(e){return l.jsx(K,c({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(K,c({},e,{type:"define"}))},Include:function(e){return l.jsx(Y,c({},e))},Column:function(e){var t=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,Z);return l.jsx(K,c({},t,{type:"column"}))},Input:function(e){return l.jsx(K,c({},e))},Text:function(e){return l.jsx(K,c({},e,{type:"text"}))},Email:function(e){return l.jsx(K,c({},e,{type:"email"}))},Button:function(e){return l.jsx(K,c({},e,{type:"button"}))},Link:function(e){return l.jsx(K,c({},e,{type:"link"}))},Icon:function(e){return l.jsx(K,c({},e,{type:"icon"}))},Output:function(e){return l.jsx(K,c({},e,{type:"output"}))},Form:function(e){return l.jsx(K,c({},e,{type:"form"}))},Crud:function(e){return l.jsx(K,c({},e,{type:"crud"}))},View:function(e){return l.jsx(K,c({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(K,c({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(K,c({},e,{type:"dialog"}))},Content:function(e){return l.jsx(K,c({},e,{type:"content"}))},Top:function(e){return l.jsx(K,c({},e,{type:"top"}))},Card:function(e){return l.jsx(K,c({},e,{type:"card"}))},Tab:function(e){return l.jsx(K,c({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(K,c({},e,{type:"tabs"}))},Step:function(e){return l.jsx(K,c({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(K,c({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(K,c({},e,{type:"money"}))},Chart:function(e){return l.jsx(K,c({},e,{type:"chart"}))},Password:function(e){return l.jsx(K,c({},e,{type:"password"}))},Complete:function(e){return l.jsx(K,c({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(K,c({},e,{type:"switch"}))},Switch:function(e){return l.jsx(K,c({},e,{type:"switch"}))},Radio:function(e){return l.jsx(K,c({},e,{type:"radio"}))},Select:function(e){return l.jsx(K,c({},e,{type:"select"}))},Toggle:function(e){return l.jsx(K,c({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(K,c({},e,{type:"entity"}))},Element:function(e){return l.jsx(K,c({},e,{type:"element"}))},Quantity:function(e){return l.jsx(K,c({},e,{type:"quantity"}))},SafeView:function(e){var n,a=r.ThemeUtils.getCurrentTheme();return r.Utils.isEmpty(a)&&(a=r.useTheme()),t.useEffect((function(){i.StatusBar.setBarStyle("light-content"),null==i.StatusBar.setBackgroundColor||i.StatusBar.setBackgroundColor(a.colors.primary)}),[]),l.jsxs(s.SafeAreaProvider,{children:[l.jsx(i.StatusBar,{barStyle:"light-content"}),l.jsx(s.SafeAreaView,{style:c({backgroundColor:null==(n=a.colors)?void 0:n.primary},e.viewStyle,{flex:1}),children:l.jsx(i.KeyboardAvoidingView,{behavior:"ios"===i.Platform.OS?"padding":"height",style:{flex:1,justifyContent:"center"},children:l.jsx(i.TouchableWithoutFeedback,{onPress:function(){"web"!==i.Platform.OS&&i.Keyboard.dismiss()},accessible:!1,children:l.jsx(l.Fragment,{children:e.children})})})})]})}};exports.UI=$;
2
2
  //# sourceMappingURL=react-crud-mobile.cjs.production.min.js.map