react-crud-mobile 1.0.749 → 1.0.751

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,h,x,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(M,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,h=r.Utils.nvl(f,"root"),x=d[h],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({},x,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,h=[],x=t.useState(null),y=x[0],m=x[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&&h.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(h[s],!1);var S=function(e){j(h[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:h.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(Y.Output,{space:6,layout:"left",children:l.jsx(Y.Include,c({},e,{transient:!0,name:"left",default:l.jsx(Y.Button,{rendered:s>0,icon:l.jsx(a,{}),click:function(){S(-1)}})}))}),l.jsx(Y.Output,{space:6,layout:"right",children:l.jsx(Y.Include,c({},e,{transient:!0,name:"right",default:l.jsx(Y.Button,{rendered:s<h.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:h.link,children:"Clique aqui para acessar o React Native"})})}var h={link:{}};function x(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")})}function v(e){var t=e.scope,n=t.original,a=n.color,s=n.label,u=n.icon;a||(a="primaryLight");var d={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:a,borderRadius:24,gap:10,justifyContent:"center",alignItems:"center",flexDirection:"row"}},p=function(e,n){var r=c({},d[e],n);return t.getStyle(e,r)},f={};f.button=u?{padding:0,height:40}:{height:50};var g=r.Utils.call((function(){var e=p("button",f.button);if(!e.width){var t=e.height;"number"==typeof t&&(e.minWidth=t)}return e}));return l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(e){t.call("click",{})},style:g,children:l.jsxs(l.Fragment,{children:[u&&l.jsx(l.Fragment,{children:l.jsx(o.Ionicons,{size:30,style:p("buttonIcon",f.icon),name:u})}),s&&l.jsx(i.Text,{style:p("buttonLabel"),children:s})]})})}function b(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(),h=r.ViewUtils.getCrud("view"),x=function(){var e=!a;h.data.selectIsOpen=e,s(e)},y=function(e,t){return c({},S[e],u.getStyle(e),t)};return l.jsxs(i.View,{style:y("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:x,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(Y.List,{data:d,name:u.getName("list"),click:function(e){u.changeValue(e.value),x()},children:l.jsx(Y.Value,{value:"#{@this.label}"})})})]})]})]})}var S=i.StyleSheet.create({selectRoot:{justifyContent:"flex-start",alignItems:"flex-start",flex:1},selectInput:{width:"100%",flexDirection:"row",borderRadius:20,paddingHorizontal:15,paddingVertical:10},selectLabel:{flex:1},modalSafe:{flex:1,backgroundColor:"#f5f5f5",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 w(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 C(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:T.link,children:"Clique aqui para acessar o React Native"})})}var T={link:{}};function I(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:U.link,children:"Clique aqui para acessar o React Native"})})}var U={link:{}};function k(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];return l.jsxs(l.Fragment,{children:[n.getPart("left"),l.jsx(i.TextInput,{style:c({},n.getStyle("input",V.input),void 0),onChangeText:function(e){n.changeValue(e),g(e)},value:f,placeholder:u}),d.icon&&l.jsx(o.Ionicons,{name:d.icon,size:n.attr("iconSize",20),color:n.attr("iconColor","#888")}),n.getPart("right")]})}var V=i.StyleSheet.create({base:{flexDirection:"row",alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:20,paddingHorizontal:10,paddingVertical:5,padding:10,paddingLeft:5,paddingRight:10},icon:{marginRight:10},input:{marginHorizontal:0,marginVertical:0,height:40,flex:1}});function F(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:B,list:P})?void 0:n[s.type],h=""+a.key("row",o,""),x=t.useState(r.ScopeUtils.create(c({},s,{parent:a,name:h,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,x),j=function(){return l.jsx(l.Fragment,!m&&s.useIsInView&&!x.visible&&o>20?{}:{children:l.jsx(u,{scope:x,crud:x.crud,children:e.children})})};return l.jsx((function(){var e=t.useState(0),n=e[0],r=e[1],u=a.key("item"),h=function(){var e=x.getStyle("row",c({},g.row,{minHeight:40}));return p>0&&(e.width=f),e};return x.update=function(){a.updateIndex=a.updateIndex+1,r(++n)},!1===x.getPart("renderedItem",void 0,!0)?l.jsx(l.Fragment,{}):s.click?l.jsx(i.TouchableHighlight,{style:h(),underlayColor:"transparent",ref:y,onPress:function(e){e.stopPropagation(),function(e){x.call("click",{value:e,item:e,edit:!0,index:o})}(d)},children:l.jsx(j,{})},u):l.jsx(i.View,{style:h(),ref:y,children:l.jsx(j,{})},u)}),{})}var P=i.StyleSheet.create({row:{padding:5,margin:0,width:"100%",backgroundColor:"#f5f5f5",gap:10,borderRadius:8,justifyContent:"center"}}),B=i.StyleSheet.create({row:{padding:0,width:"100%",justifyContent:"center"}});function D(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:L,list:R})?void 0:n[u.type],f=r.ComponentUtils.getDefine(e,"add"),g=u.hideAddWhenEmpty,h=function(){var n=t.useState(0),o=n[0],s=n[1];a.update=function(){a.updateIndex=++o,s(o)};var u,h=r.Utils.nvl(a.getItems(),[]),y=function(){if(!r.Utils.isEmpty(h))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:(u=a.getStyle("container",c({},{},p.container)),d>1&&(u=c({},u,{flexDirection:"row",flexWrap:"wrap"})),u),children:[l.jsx(y,{}),h.map((function(t,n){return l.jsx(F,{index:n,item:t,scope:a,children:e.children})})),(!r.Utils.isEmpty(h)||!0!==g)&&l.jsx(l.Fragment,{children:f})]},x)},x=a.key("data");return l.jsxs(l.Fragment,{children:[!1!==u.search&&l.jsx(Y.Text,{placeholder:"Pesquisar...",field:"query",crud:s,change:{action:function(){a.search()}},right:l.jsx(o.Ionicons,{name:"search",size:20,color:"#888"})}),l.jsx(h,{})]})}var R=i.StyleSheet.create({container:{flex:1,width:"100%",flexDirection:"row",flexWrap:"wrap",alignItems:"stretch",gap:10},text:{fontSize:18,fontWeight:"bold"}}),L=i.StyleSheet.create({container:{flex:1,width:"100%",flexDirection:"row",flexWrap:"wrap",gap:10,alignItems:"stretch"},text:{fontSize:18,fontWeight:"bold"}});function z(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({},E.text);return s&&(u.color="#ffffff"),r.Utils.isEmpty(e.children)?l.jsx(i.Text,{style:u,children:a.label}):l.jsx(F,{scope:n,item:a.object,index:o,children:e.children})},g=function(e){var t=c({},E.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 E=i.StyleSheet.create({container:{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row"},item:{padding:10,marginVertical:8,backgroundColor:"#f5f5f5",borderRadius:8,justifyContent:"center",width:"auto",flexDirection:"row"},text:{fontSize:15,fontWeight:"500"}});function W(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"},h={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)},x=function(e){n.changeValue(p+e),d(++u)},y=function(e,t){var r=c({},h[e],t);return n.getStyle(e,r)};return l.jsxs(l.Fragment,{children:[l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){x(-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(){x(1)},style:y("addButton"),children:l.jsx(o.Ionicons,{size:30,style:y("buttonIcon"),name:"add"})})]})}function q(e){var n,o,s=t.useState(!1),d=s[0],p=s[1],f=t.useState(0),g=f[0],h=f[1],x=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({},O[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(){h(++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:x.dialog,data:o,edit:i,scope:y},l));x.dialog=s,y.currentDialog=s,w(!0),y.update()},y.dialogHide=function(e){var t;x.dialog=r.Utils.nvl(y.currentDialog.dialog,null),y.currentDialog=null,w(!1),null!=(t=x.dialog)&&t.scope&&x.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=x.dialog)?void 0:o.uuid))return l.jsx(l.Fragment,{});var T=r.ComponentUtils.getDefine(e,"header","right");return l.jsx(i.Modal,{animationType:"slide",transparent:!0,visible:d,onRequestClose:S,children: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(T)&&l.jsx(u,{scope:y,crud:y.currentDialog,transient:!0,children:T})]}),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 O=i.StyleSheet.create({modalSafe:{flex:1,backgroundColor:"primary",width:"100%"},modalCloseButton:{padding:10},modalCloseText:{fontSize:18,color:"white"},modalTitle:{fontSize:18,color:"white",fontWeight:"bold",marginLeft:10},modalContent:{flex:1,backgroundColor:"#f5f5f5",padding:20}});function H(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),h=!r.Utils.isEmpty(d);return l.jsxs(l.Fragment,{children:[h&&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",N.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",N.scroll),children:l.jsx(u,{scope:o,children:s})})})]})}var N=i.StyleSheet.create({scroll:{padding:10},container:{backgroundColor:"primary"},view:{backgroundColor:"primary"}}),A=t.createContext({});function M(e){var n,a,s=t.useContext(A),d=r.Utils.nvl(e.theme,null==s?void 0:s.theme),g=r.Utils.nvl(e.crud,null==s?void 0:s.crud),h=t.useState(r.ScopeUtils.create(c({crud:g},e,{theme:d})))[0],m=t.useState(0),S=m[0],T=m[1],U=t.useState(null),V=U[0],F=U[1];g=h.crud;var P=h.getOptions(),B=h.original,R=t.useRef(null);h.update=function(){T(++S)},h.updateElement=function(){T(++S)},h.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 h.execute(e)}}],{cancelable:!1})}};var L=function(){var e=B.custom;return e?l.jsx(M,"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(h.is("type","dummy"))return l.jsx(l.Fragment,{children:h.getDisplayValue()});var E=function(){var e=h.getValue();O({target:{value:!(!0===e)}})},O=function(e){var t=e.target.value;h.isType("integer","int","number")?t=parseInt(t):h.isType("decimal")&&(t=parseFloat(t)),h.isType("select","complete")&&(t=h.getSelectedItem(t)),h.changeValue(t),h.update()},N=function(e){h.call("click")},G={scope:h,crud:g,onChange:O};h.isType("password")&&(G.type="password");var X=function(){return!(h.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},J=h.is("type","text","number","phone","postalCode","money","password","email"),Y=function(e){var t,n=r.Utils.nvl(B.type,"none"),i=r.Utils.nvl(e,"root"),l=c({},_[i]),a=X();return e||a||(l=c({},l)),h.isInput()&&(l=c({},l,K.input[i])),l=c({},l,null==K||null==(t=K[n])?void 0:t[i]),a&&e&&(l=c({},l,Q[e])),c({},l,h.getStyle(e,l))},Z=Y("element"),$={required:h.isRequired(),size:"small",scope:h,crud:g,style:Z,placeholder:h.attr("placeholder","Digite aqui")};h.error=function(e){V=e,F(e)},null!=(n=B.list)&&n.url||null!=(a=B.load)&&a.url||h.start(),t.useEffect((function(){h.start()}));var ee=function(){return"string"==typeof B.icon?l.jsx(o.Ionicons,{name:B.icon,style:h.getStyle("icon")}):l.jsx(l.Fragment,{children:B.icon})};if(h.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=R&&R.current&&h.is("type","card","list","tabs","stepper")){var e=null==R?void 0:R.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!h.isRendered()||h.is("type","define"))return l.jsx(l.Fragment,{});var te=i.View,ne={};!h.isType("input","grid","list","repeat")&&B.click&&(te=i.TouchableHighlight,ne.underlayColor="transparent",ne.onPress=N);var re=function(){return l.jsxs(l.Fragment,{children:[h.is("type","button")&&l.jsxs(v,c({},$,{onClick:N,variant:h.attr("variant","outlined"),children:[B.icon&&l.jsx(ee,{}),B.label&&l.jsx(i.Text,{style:h.getPart("label","button"),children:h.getLabel()})]})),h.is("type","icon")&&l.jsx(j,c({},$,{onClick:N,variant:h.attr("variant","outlined"),children:h.getDisplayValue()})),h.is("type","link")&&l.jsxs(y,c({},$,{onClick:N,variant:h.attr("variant","outlined"),children:[B.icon&&l.jsx(ee,{}),B.label&&l.jsx(i.Text,{style:h.getPart("label","link"),children:h.getLabel()})]})),J&&l.jsx(k,c({},G,$,{InputProps:c({},B.inputProps)})),h.is("type","complete","autocomplete")&&l.jsx(x,{scope:h,defaultsInput:G,defaultsUI:$}),h.is("type","quantity")&&l.jsx(W,{scope:h,defaultsInput:G,defaultsUI:$}),h.is("type","checkbox","boolean","switch")&&l.jsx(w,c({checked:!0===h.getValue()},G,{onChange:E})),h.is("type","select")&&l.jsx(b,c({},G,$,{value:h.getSelectedValue()})),h.is("type","toggle")&&l.jsx(z,c({},G,$,{value:h.getSelectedValue()})),h.is("type","radio")&&l.jsx(I,c({},G,$,{row:!0,children:P.map((function(e,t){return l.jsx(C,{control:l.jsx(I,c({},$)),label:e.label,value:e.value},"i"+t)}))})),h.is("type","custom")&&l.jsx(L,{}),h.is("type","column")&&l.jsxs(l.Fragment,{children:[h.is("format","img")&&l.jsx(i.Image,{source:h.getDisplayValue()}),h.is("format","icon")&&l.jsx(j,{scope:h,crud:g}),!h.is("format","icon","img")&&l.jsx(i.Text,{children:h.getDisplayValue()})]}),h.is("type","output","value")&&l.jsx(i.Text,{style:Y("value"),children:h.getDisplayValue()})]})};return l.jsx(A.Provider,{value:{crud:g,theme:d},children:l.jsx(te,c({ref:R,style:Y()},ne,{children:l.jsxs(l.Fragment,{children:[void 0!==B.label&&!1!==B.label&&!h.isType("button","dialog","modal")&&l.jsx(i.Text,{style:Y("label"),children:h.getLabel()}),!X()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:Y("inner"),children:l.jsx(re,{})}),V&&l.jsx(i.View,{style:Y("error"),children:V})]}),h.isType("list","repeat")&&l.jsx(D,c({},e,{scope:h,crud:g})),h.isType("dialog")&&l.jsx(q,c({},e,{scope:h,crud:g})),h.isType("chart")&&l.jsx(f,c({},e,{scope:h,crud:g})),h.isType("tabs")&&l.jsx(p,c({},e,{scope:h,crud:g})),h.isType("view")&&l.jsx(H,c({},e,{scope:h,crud:g})),!h.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(u,c({},e,{scope:h,crud:g,style:Y("inner")}))]})}))})}var G={backgroundColor:"white",padding:16,borderRadius:10,width:"100%",shadowColor:"#888",shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:3.84,elevation:3},K={view:{inner:{width:"100%",alignItems:"normal",flex:1},container:{width:"100%",backgroundColor:"#f5f5f5",flex:1,gap:10},child:{width:"100%",flex:1,gap:10,padding:10},root:{width:"100%",flex:1,alignItems:"normal",padding:0}}};K.card=i.StyleSheet.create({root:c({},G),inner:{flex:1,width:"100%",paddingBottom:10,paddingTop:5,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10}}),K.input=i.StyleSheet.create({label:{paddingLeft:8},inner:{flex:1,width:"100%",paddingBottom:0,paddingTop:0,alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:20,paddingHorizontal:15,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),K.switch={inner:{paddingBottom:6,paddingTop:6,paddingHorizontal:25}},K.quantity={inner:c({},G,{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"})},K.toggle=i.StyleSheet.create({inner:c({},G,{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row",paddingHorizontal:10,paddingVertical:0,alignSelf:"flex-start",flexWrap:"nowrap"})});var _=i.StyleSheet.create({root:{gap:5,flexDirection:"column",flexWrap:"wrap",width:"100%",alignItems:"flex-start"},label:{width:"100%",fontWeight:400,fontSize:12,color:"labelColor"},inner:{width:"100%"}}),Q=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function X(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 J=["type"],Y={List:function(e){return l.jsx(M,c({},e,{type:"list"}))},Row:function(e){return l.jsx(M,c({},e,{type:"row"}))},Value:function(e){return l.jsx(M,c({},e,{type:"value"}))},Label:function(e){return l.jsx(M,c({},e,{type:"label"}))},Repeat:function(e){return l.jsx(M,c({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(M,c({},e,{type:"define"}))},Include:function(e){return l.jsx(X,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,J);return l.jsx(M,c({},t,{type:"column"}))},Input:function(e){return l.jsx(M,c({},e))},Text:function(e){return l.jsx(M,c({},e,{type:"text"}))},Email:function(e){return l.jsx(M,c({},e,{type:"email"}))},Button:function(e){return l.jsx(M,c({},e,{type:"button"}))},Link:function(e){return l.jsx(M,c({},e,{type:"link"}))},Icon:function(e){return l.jsx(M,c({},e,{type:"icon"}))},Output:function(e){return l.jsx(M,c({},e,{type:"output"}))},Form:function(e){return l.jsx(M,c({},e,{type:"form"}))},Crud:function(e){return l.jsx(M,c({},e,{type:"crud"}))},View:function(e){return l.jsx(M,c({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(M,c({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(M,c({},e,{type:"dialog"}))},Content:function(e){return l.jsx(M,c({},e,{type:"content"}))},Top:function(e){return l.jsx(M,c({},e,{type:"top"}))},Card:function(e){return l.jsx(M,c({},e,{type:"card"}))},Tab:function(e){return l.jsx(M,c({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(M,c({},e,{type:"tabs"}))},Step:function(e){return l.jsx(M,c({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(M,c({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(M,c({},e,{type:"money"}))},Chart:function(e){return l.jsx(M,c({},e,{type:"chart"}))},Password:function(e){return l.jsx(M,c({},e,{type:"password"}))},Complete:function(e){return l.jsx(M,c({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(M,c({},e,{type:"switch"}))},Switch:function(e){return l.jsx(M,c({},e,{type:"switch"}))},Radio:function(e){return l.jsx(M,c({},e,{type:"radio"}))},Select:function(e){return l.jsx(M,c({},e,{type:"select"}))},Toggle:function(e){return l.jsx(M,c({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(M,c({},e,{type:"entity"}))},Element:function(e){return l.jsx(M,c({},e,{type:"element"}))},Quantity:function(e){return l.jsx(M,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=Y;
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,h,x,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(M,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,h=r.Utils.nvl(f,"root"),x=d[h],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({},x,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,h=[],x=t.useState(null),y=x[0],m=x[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&&h.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(h[s],!1);var S=function(e){j(h[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:h.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(Y.Output,{space:6,layout:"left",children:l.jsx(Y.Include,c({},e,{transient:!0,name:"left",default:l.jsx(Y.Button,{rendered:s>0,icon:l.jsx(a,{}),click:function(){S(-1)}})}))}),l.jsx(Y.Output,{space:6,layout:"right",children:l.jsx(Y.Include,c({},e,{transient:!0,name:"right",default:l.jsx(Y.Button,{rendered:s<h.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:h.link,children:"Clique aqui para acessar o React Native"})})}var h={link:{}};function x(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")})}function v(e){var t=e.scope,n=t.original,a=n.color,s=n.label,u=n.icon;a||(a="primaryLight");var d={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:a,borderRadius:24,gap:10,justifyContent:"center",alignItems:"center",flexDirection:"row"}},p=function(e,n){var r=c({},d[e],n);return t.getStyle(e,r)},f={};f.button=u?{padding:0,height:40}:{height:50};var g=r.Utils.call((function(){var e=p("button",f.button);if(!e.width){var t=e.height;"number"==typeof t&&(e.minWidth=t)}return e}));return l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(e){t.call("click",{})},style:g,children:l.jsxs(l.Fragment,{children:[u&&l.jsx(l.Fragment,{children:l.jsx(o.Ionicons,{size:30,style:p("buttonIcon",f.icon),name:u})}),s&&l.jsx(i.Text,{style:p("buttonLabel"),children:s})]})})}function b(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(),h=r.ViewUtils.getCrud("view"),x=function(){var e=!a;h.data.selectIsOpen=e,s(e)},y=function(e,t){return c({},S[e],u.getStyle(e),t)};return l.jsxs(i.View,{style:y("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:x,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(Y.List,{data:d,name:u.getName("list"),click:function(e){u.changeValue(e.value),x()},children:l.jsx(Y.Value,{value:"#{@this.label}"})})})]})]})]})}var S=i.StyleSheet.create({selectRoot:{justifyContent:"flex-start",alignItems:"flex-start",flex:1},selectInput:{width:"100%",flexDirection:"row",borderRadius:20,paddingHorizontal:15,paddingVertical:10},selectLabel:{flex:1},modalSafe:{flex:1,backgroundColor:"#f5f5f5",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 w(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 C(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:T.link,children:"Clique aqui para acessar o React Native"})})}var T={link:{}};function U(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:I.link,children:"Clique aqui para acessar o React Native"})})}var I={link:{}};function k(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];return l.jsxs(l.Fragment,{children:[n.getPart("left"),l.jsx(i.TextInput,{style:c({},n.getStyle("input",V.input),void 0),onChangeText:function(e){n.changeValue(e),g(e)},value:f,placeholder:u}),d.icon&&l.jsx(o.Ionicons,{name:d.icon,size:n.attr("iconSize",20),color:n.attr("iconColor","#888")}),n.getPart("right")]})}var V=i.StyleSheet.create({base:{flexDirection:"row",alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:20,paddingHorizontal:10,paddingVertical:5,padding:10,paddingLeft:5,paddingRight:10},icon:{marginRight:10},input:{marginHorizontal:0,marginVertical:0,height:40,flex:1}});function B(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:P,list:F})?void 0:n[s.type],h=""+a.key("row",o,""),x=t.useState(r.ScopeUtils.create(c({},s,{parent:a,name:h,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,x),j=function(){return l.jsx(l.Fragment,!m&&s.useIsInView&&!x.visible&&o>20?{}:{children:l.jsx(u,{scope:x,crud:x.crud,children:e.children})})};return l.jsx((function(){var e=t.useState(0),n=e[0],r=e[1],u=a.key("item"),h=function(){var e=x.getStyle("row",c({},g.row,{minHeight:40}));return p>0&&(e.width=f),e};return x.update=function(){a.updateIndex=a.updateIndex+1,r(++n)},!1===x.getPart("renderedItem",void 0,!0)?l.jsx(l.Fragment,{}):s.click?l.jsx(i.TouchableHighlight,{style:h(),underlayColor:"transparent",ref:y,onPress:function(e){e.stopPropagation(),function(e){x.call("click",{value:e,item:e,edit:!0,index:o})}(d)},children:l.jsx(j,{})},u):l.jsx(i.View,{style:h(),ref:y,children:l.jsx(j,{})},u)}),{})}var F=i.StyleSheet.create({row:{padding:5,margin:0,width:"100%",backgroundColor:"#f5f5f5",gap:10,borderRadius:8,justifyContent:"center"}}),P=i.StyleSheet.create({row:{padding:0,width:"100%",justifyContent:"center"}});function D(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:L})?void 0:n[u.type],f=r.ComponentUtils.getDefine(e,"add"),g=u.hideAddWhenEmpty,h=function(){var n=t.useState(0),o=n[0],h=n[1];a.update=function(){a.updateIndex=++o,h(o)};var y,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(console.log(n),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:(y=a.getStyle("container",c({},{},p.container)),d>1&&(y=c({},y,{flexDirection:"row",flexWrap:"wrap"})),y),children:[l.jsx(j,{}),m.map((function(t,n){return l.jsx(B,{index:n,item:t,scope:a,children:e.children})})),(!r.Utils.isEmpty(m)||!0!==g)&&l.jsx(l.Fragment,{children:f})]},x)},x=a.key("data");return l.jsxs(l.Fragment,{children:[!1!==u.search&&l.jsx(Y.Text,{placeholder:"Pesquisar...",field:"query",crud:s,change:{action:function(){a.search()}},right:l.jsx(o.Ionicons,{name:"search",size:20,color:"#888"})}),l.jsx(h,{})]})}var L=i.StyleSheet.create({container:{flex:1,width:"100%",flexDirection:"row",flexWrap:"wrap",alignItems:"stretch",gap:10},text:{fontSize:18,fontWeight:"bold"}}),R=i.StyleSheet.create({container:{flex:1,width:"100%",flexDirection:"row",flexWrap:"wrap",gap:10,alignItems:"stretch"},text:{fontSize:18,fontWeight:"bold"}});function z(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({},E.text);return s&&(u.color="#ffffff"),r.Utils.isEmpty(e.children)?l.jsx(i.Text,{style:u,children:a.label}):l.jsx(B,{scope:n,item:a.object,index:o,children:e.children})},g=function(e){var t=c({},E.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 E=i.StyleSheet.create({container:{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row"},item:{padding:10,marginVertical:8,backgroundColor:"#f5f5f5",borderRadius:8,justifyContent:"center",width:"auto",flexDirection:"row"},text:{fontSize:15,fontWeight:"500"}});function W(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"},h={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)},x=function(e){n.changeValue(p+e),d(++u)},y=function(e,t){var r=c({},h[e],t);return n.getStyle(e,r)};return l.jsxs(l.Fragment,{children:[l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){x(-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(){x(1)},style:y("addButton"),children:l.jsx(o.Ionicons,{size:30,style:y("buttonIcon"),name:"add"})})]})}function q(e){var n,o,s=t.useState(!1),d=s[0],p=s[1],f=t.useState(0),g=f[0],h=f[1],x=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({},O[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(){h(++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:x.dialog,data:o,edit:i,scope:y},l));x.dialog=s,y.currentDialog=s,w(!0),y.update()},y.dialogHide=function(e){var t;x.dialog=r.Utils.nvl(y.currentDialog.dialog,null),y.currentDialog=null,w(!1),null!=(t=x.dialog)&&t.scope&&x.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=x.dialog)?void 0:o.uuid))return l.jsx(l.Fragment,{});var T=r.ComponentUtils.getDefine(e,"header","right");return l.jsx(i.Modal,{animationType:"slide",transparent:!0,visible:d,onRequestClose:S,children: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(T)&&l.jsx(u,{scope:y,crud:y.currentDialog,transient:!0,children:T})]}),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 O=i.StyleSheet.create({modalSafe:{flex:1,backgroundColor:"primary",width:"100%"},modalCloseButton:{padding:10},modalCloseText:{fontSize:18,color:"white"},modalTitle:{fontSize:18,color:"white",fontWeight:"bold",marginLeft:10},modalContent:{flex:1,backgroundColor:"#f5f5f5",padding:20}});function H(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),h=!r.Utils.isEmpty(d);return l.jsxs(l.Fragment,{children:[h&&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",N.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",N.scroll),children:l.jsx(u,{scope:o,children:s})})})]})}var N=i.StyleSheet.create({scroll:{padding:10},container:{backgroundColor:"primary"},view:{backgroundColor:"primary"}}),A=t.createContext({});function M(e){var n,a,s=t.useContext(A),d=r.Utils.nvl(e.theme,null==s?void 0:s.theme),g=r.Utils.nvl(e.crud,null==s?void 0:s.crud),h=t.useState(r.ScopeUtils.create(c({crud:g},e,{theme:d})))[0],m=t.useState(0),S=m[0],T=m[1],I=t.useState(null),V=I[0],B=I[1];g=h.crud;var F=h.getOptions(),P=h.original,L=t.useRef(null);h.update=function(){T(++S)},h.updateElement=function(){T(++S)},h.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 h.execute(e)}}],{cancelable:!1})}};var R=function(){var e=P.custom;return e?l.jsx(M,"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(h.is("type","dummy"))return l.jsx(l.Fragment,{children:h.getDisplayValue()});var E=function(){var e=h.getValue();O({target:{value:!(!0===e)}})},O=function(e){var t=e.target.value;h.isType("integer","int","number")?t=parseInt(t):h.isType("decimal")&&(t=parseFloat(t)),h.isType("select","complete")&&(t=h.getSelectedItem(t)),h.changeValue(t),h.update()},N=function(e){h.call("click")},G={scope:h,crud:g,onChange:O};h.isType("password")&&(G.type="password");var X=function(){return!(h.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},J=h.is("type","text","number","phone","postalCode","money","password","email"),Y=function(e){var t,n=r.Utils.nvl(P.type,"none"),i=r.Utils.nvl(e,"root"),l=c({},_[i]),a=X();return e||a||(l=c({},l)),h.isInput()&&(l=c({},l,K.input[i])),l=c({},l,null==K||null==(t=K[n])?void 0:t[i]),a&&e&&(l=c({},l,Q[e])),c({},l,h.getStyle(e,l))},Z=Y("element"),$={required:h.isRequired(),size:"small",scope:h,crud:g,style:Z,placeholder:h.attr("placeholder","Digite aqui")};h.error=function(e){V=e,B(e)},null!=(n=P.list)&&n.url||null!=(a=P.load)&&a.url||h.start(),t.useEffect((function(){h.start()}));var ee=function(){return"string"==typeof P.icon?l.jsx(o.Ionicons,{name:P.icon,style:h.getStyle("icon")}):l.jsx(l.Fragment,{children:P.icon})};if(h.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=L&&L.current&&h.is("type","card","list","tabs","stepper")){var e=null==L?void 0:L.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!h.isRendered()||h.is("type","define"))return l.jsx(l.Fragment,{});var te=i.View,ne={};!h.isType("input","grid","list","repeat")&&P.click&&(te=i.TouchableHighlight,ne.underlayColor="transparent",ne.onPress=N);var re=function(){return l.jsxs(l.Fragment,{children:[h.is("type","button")&&l.jsxs(v,c({},$,{onClick:N,variant:h.attr("variant","outlined"),children:[P.icon&&l.jsx(ee,{}),P.label&&l.jsx(i.Text,{style:h.getPart("label","button"),children:h.getLabel()})]})),h.is("type","icon")&&l.jsx(j,c({},$,{onClick:N,variant:h.attr("variant","outlined"),children:h.getDisplayValue()})),h.is("type","link")&&l.jsxs(y,c({},$,{onClick:N,variant:h.attr("variant","outlined"),children:[P.icon&&l.jsx(ee,{}),P.label&&l.jsx(i.Text,{style:h.getPart("label","link"),children:h.getLabel()})]})),J&&l.jsx(k,c({},G,$,{InputProps:c({},P.inputProps)})),h.is("type","complete","autocomplete")&&l.jsx(x,{scope:h,defaultsInput:G,defaultsUI:$}),h.is("type","quantity")&&l.jsx(W,{scope:h,defaultsInput:G,defaultsUI:$}),h.is("type","checkbox","boolean","switch")&&l.jsx(w,c({checked:!0===h.getValue()},G,{onChange:E})),h.is("type","select")&&l.jsx(b,c({},G,$,{value:h.getSelectedValue()})),h.is("type","toggle")&&l.jsx(z,c({},G,$,{value:h.getSelectedValue()})),h.is("type","radio")&&l.jsx(U,c({},G,$,{row:!0,children:F.map((function(e,t){return l.jsx(C,{control:l.jsx(U,c({},$)),label:e.label,value:e.value},"i"+t)}))})),h.is("type","custom")&&l.jsx(R,{}),h.is("type","column")&&l.jsxs(l.Fragment,{children:[h.is("format","img")&&l.jsx(i.Image,{source:h.getDisplayValue()}),h.is("format","icon")&&l.jsx(j,{scope:h,crud:g}),!h.is("format","icon","img")&&l.jsx(i.Text,{children:h.getDisplayValue()})]}),h.is("type","output","value")&&l.jsx(i.Text,{style:Y("value"),children:h.getDisplayValue()})]})};return l.jsx(A.Provider,{value:{crud:g,theme:d},children:l.jsx(te,c({ref:L,style:Y()},ne,{children:l.jsxs(l.Fragment,{children:[void 0!==P.label&&!1!==P.label&&!h.isType("button","dialog","modal")&&l.jsx(i.Text,{style:Y("label"),children:h.getLabel()}),!X()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:Y("inner"),children:l.jsx(re,{})}),V&&l.jsx(i.View,{style:Y("error"),children:V})]}),h.isType("list","repeat")&&l.jsx(D,c({},e,{scope:h,crud:g})),h.isType("dialog")&&l.jsx(q,c({},e,{scope:h,crud:g})),h.isType("chart")&&l.jsx(f,c({},e,{scope:h,crud:g})),h.isType("tabs")&&l.jsx(p,c({},e,{scope:h,crud:g})),h.isType("view")&&l.jsx(H,c({},e,{scope:h,crud:g})),!h.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(u,c({},e,{scope:h,crud:g,style:Y("inner")}))]})}))})}var G={backgroundColor:"white",padding:16,borderRadius:10,width:"100%",shadowColor:"#888",shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:3.84,elevation:3},K={view:{inner:{width:"100%",alignItems:"normal",flex:1},container:{width:"100%",backgroundColor:"#f5f5f5",flex:1,gap:10},child:{width:"100%",flex:1,gap:10,padding:10},root:{width:"100%",flex:1,alignItems:"normal",padding:0}}};K.card=i.StyleSheet.create({root:c({},G),inner:{flex:1,width:"100%",paddingBottom:10,paddingTop:5,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10}}),K.input=i.StyleSheet.create({label:{paddingLeft:8},inner:{flex:1,width:"100%",paddingBottom:0,paddingTop:0,alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:20,paddingHorizontal:15,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),K.switch={inner:{paddingBottom:6,paddingTop:6,paddingHorizontal:25}},K.quantity={inner:c({},G,{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"})},K.toggle=i.StyleSheet.create({inner:c({},G,{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row",paddingHorizontal:10,paddingVertical:0,alignSelf:"flex-start",flexWrap:"nowrap"})});var _=i.StyleSheet.create({root:{gap:5,flexDirection:"column",flexWrap:"wrap",width:"100%",alignItems:"flex-start"},label:{width:"100%",fontWeight:400,fontSize:12,color:"labelColor"},inner:{width:"100%"}}),Q=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function X(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 J=["type"],Y={List:function(e){return l.jsx(M,c({},e,{type:"list"}))},Row:function(e){return l.jsx(M,c({},e,{type:"row"}))},Value:function(e){return l.jsx(M,c({},e,{type:"value"}))},Label:function(e){return l.jsx(M,c({},e,{type:"label"}))},Repeat:function(e){return l.jsx(M,c({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(M,c({},e,{type:"define"}))},Include:function(e){return l.jsx(X,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,J);return l.jsx(M,c({},t,{type:"column"}))},Input:function(e){return l.jsx(M,c({},e))},Text:function(e){return l.jsx(M,c({},e,{type:"text"}))},Email:function(e){return l.jsx(M,c({},e,{type:"email"}))},Button:function(e){return l.jsx(M,c({},e,{type:"button"}))},Link:function(e){return l.jsx(M,c({},e,{type:"link"}))},Icon:function(e){return l.jsx(M,c({},e,{type:"icon"}))},Output:function(e){return l.jsx(M,c({},e,{type:"output"}))},Form:function(e){return l.jsx(M,c({},e,{type:"form"}))},Crud:function(e){return l.jsx(M,c({},e,{type:"crud"}))},View:function(e){return l.jsx(M,c({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(M,c({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(M,c({},e,{type:"dialog"}))},Content:function(e){return l.jsx(M,c({},e,{type:"content"}))},Top:function(e){return l.jsx(M,c({},e,{type:"top"}))},Card:function(e){return l.jsx(M,c({},e,{type:"card"}))},Tab:function(e){return l.jsx(M,c({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(M,c({},e,{type:"tabs"}))},Step:function(e){return l.jsx(M,c({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(M,c({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(M,c({},e,{type:"money"}))},Chart:function(e){return l.jsx(M,c({},e,{type:"chart"}))},Password:function(e){return l.jsx(M,c({},e,{type:"password"}))},Complete:function(e){return l.jsx(M,c({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(M,c({},e,{type:"switch"}))},Switch:function(e){return l.jsx(M,c({},e,{type:"switch"}))},Radio:function(e){return l.jsx(M,c({},e,{type:"radio"}))},Select:function(e){return l.jsx(M,c({},e,{type:"select"}))},Toggle:function(e){return l.jsx(M,c({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(M,c({},e,{type:"entity"}))},Element:function(e){return l.jsx(M,c({},e,{type:"element"}))},Quantity:function(e){return l.jsx(M,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=Y;
2
2
  //# sourceMappingURL=react-crud-mobile.cjs.production.min.js.map