react-crud-mobile 1.3.344 → 1.3.346

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"),o=e(require("@expo/vector-icons/Ionicons")),a=require("@expo/vector-icons"),s=e(require("@react-native-community/slider")),c=require("react-native-toast-message"),u=e(c),d=require("react-native-gesture-handler"),p=require("react-native-draggable-flatlist"),f=e(p),g=require("react-native-safe-area-context");function x(){return(x=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 h(e){var o=t.useState(r.Utils.nvl(e.scope,r.ScopeUtils.create(e)))[0],a=r.Utils.nvl(e.crud,o.crud),s=r.Utils.nvl(e.validateScope,"global"),c=r.Utils.nvl(e.part,"child");if(o.isInput())return l.jsx(l.Fragment,{});var u,d,p,f,g,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,c=x({},n.props);return delete c.children,"string"==typeof i?r.Utils.isEmpty(n.props.children)?l.jsx(i,x({},c)):l.jsx(i,x({},c,{children:l.jsx(h,x({transient:!0,validateScope:s},n.props,{scope:o,crud:a}))})):"function"==typeof i?l.jsx(i,x({validateScope:s},n.props,{parent:o,crud:a})):r.Utils.isEmpty(null==(t=n.props)?void 0:t.children)?l.jsx(l.Fragment,{}):l.jsx(h,x({validateScope:s},n.props,{scope:o,crud:a,transient:!0}))},v=function(){return l.jsx(l.Fragment,e.elements?{children:Object.entries(e.elements).map((function(e,t){return l.jsx(ne,x({crud:a},e[1]))}))}:{children:n.Children.map(e.children,(function(e){return l.jsx(m,{child:e})}))})};return e.transient?l.jsx(v,{}):r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements)?l.jsx(l.Fragment,{}):e.transient?l.jsx(v,{}):l.jsx(l.Fragment,{children:l.jsx(i.View,{style:(u=c,p=r.Utils.nvl(u,"root"),f=y[p],g={},r.Utils.isEmpty(e.style)||(null!=(d=e.style)&&d.push?r.Utils.each(e.style,(function(e){e&&(g=x({},g,e))})):g=x({},e.style)),x({},f,g,o.getStyle(u))),children:l.jsx(v,{})})})}var y=i.StyleSheet.create({child:{width:"100%"},inner:{width:"100%"}});function m(e){var i=e.scope,a=t.useState(0),s=a[0],c=a[1],u=i.original,d=i.getItems(),p=0,f=[],g=t.useState(null),y=g[0],m=g[1],v=function(e,t){void 0===t&&(t=!0),e&&i.execute({event:{validate:t,validateScope:u.validateScope,action:function(){i.changeValue(e.data),y=e,c(s=e.index),m(e)}}})},j=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=x({},e.props);t||(t=i.crud.data);var l=r.CrudUtils.create("tabs",{data:t,changed:t,parent:i.crud}),o=r.Utils.resolve(n,l);!1!==o.rendered&&f.push(x({},o,{child:e,element:o,original:n,index:p++,data:t}))};n.Children.map(e.children,(function(e,t){if(r.Utils.isEmpty(d))b(e,{});else for(var n in d)b(e,d[n])})),y||v(f[s],!1);var S=function(e){v(f[s+e])},w="stepper"===u.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:f.map((function(e,t){return l.jsxs("div",{className:j(e),onClick:function(){v(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(u.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(h,x({},e,{scope:i,children:y.child}))}),"stepper"===u.layout&&l.jsxs("div",{className:"ui-tabs-actions",children:[l.jsx(ue.Output,{space:6,layout:"left",children:l.jsx(ue.Include,x({},e,{transient:!0,name:"left",default:l.jsx(ue.Button,{rendered:s>0,icon:l.jsx(o,{}),click:function(){S(-1)}})}))}),l.jsx(ue.Output,{space:6,layout:"right",children:l.jsx(ue.Include,x({},e,{transient:!0,name:"right",default:l.jsx(ue.Button,{rendered:s<f.length-1,icon:l.jsx(o,{}),click:function(){S(1)}})}))})]})]})]})})}function v(e){var t=e.scope;return t.getItems(),r.Utils.asList(t.original.columns),l.jsx("div",{className:"ui-chart-data"})}function j(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:b.link,children:"Clique aqui para acessar o React Native"})})}var b={link:{}};function S(e){return l.jsx(l.Fragment,{children:l.jsx(j,x({},e.defaultsInput,e.defaultsUI))})}function w(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:C.link,children:"Clique aqui para acessar o React Native"})})}var C={link:{}};function U(e){var t=e.scope,n=t.getValue(),i={ion:a.Ionicons,ant:a.AntDesign,entypo:a.Entypo,evil:a.EvilIcons,material:a.MaterialCommunityIcons},o=r.Utils.nvl(t.original.library,"ion");return l.jsx(i[o],{name:n,style:t.getStyle("icon")})}var T={small:{minWidth:30,height:30}};function V(e){var t=e.scope,n=t.original,o=r.Utils.nvl(n.size,"default"),s=r.Utils.nvl(n.align,"center"),c=r.Utils.nvl(n.variant,"default"),u=n.color,d=t.getLabel(),p=t.getPart("icon");u||(u="primaryLight");var f={buttonLabel:{color:"#ffffff",fontWeight:400,fontSize:15},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center",height:44,minWidth:44},buttonIcon:{color:"#fff",fontSize:16},button:{backgroundColor:u,borderRadius:20,gap:10,justifyContent:"center",alignItems:"center",flexDirection:"row"}},g=function(e,n){var i=x({},f[e],n);return"text"!==c&&"outlined"!==c||(i.backgroundColor="transparent",i.color=r.Utils.nvl(u,"text")),"small"===o&&(i.fontSize=12,i.fontWeight=500),"medium"===o&&(i.fontSize=14,i.fontWeight=500),"left"===s&&(i.justifyContent="flex-start"),t.getStyle(e,i)},h={};h.button=p?{height:40,padding:0}:{height:50};var y=r.Utils.call((function(){var e=x({},null==h?void 0:h.button);"outlined"===c&&(e.borderWidth=1,e.borderColor=r.Utils.nvl(u,"text")),o&&(e=x({},e,T[o])),d||(e=x({},e,{borderRadius:20}));var t=g("button",e);if(!t.width){var n=t.height;"number"==typeof n&&(t.minWidth=n)}return t})),m=g("buttonLabel"),v=r.Utils.call((function(){var e=g("buttonIcon",h.icon);return e.fontSize=r.Utils.nvl(m.fontSize,e.fontSize),e}));return l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(e){t.call("click",{})},style:y,children:l.jsxs(l.Fragment,{children:[p&&l.jsx(l.Fragment,{children:l.jsx(a.Ionicons,{size:r.Utils.nvl(n.iconSize,30),style:v,name:p})}),d&&l.jsx(i.Text,{style:m,children:d})]})})}function I(e){var n,o,s=t.useState(!1),c=s[0],u=s[1],d=e.scope,p=d.original,f=r.Utils.nvl(d.getOptions(),[]),g=d.attr("placeholder","Selecione..."),h=d.getDisplayValue(),y=d.getTheme(),m=r.Utils.nvl(null==(n=y.styles)||null==(n=n.defaults)?void 0:n.header,{}),v=function(){u(!c)},j=t.useRef(null),b=r.Utils.nvl(null==(o=y.colors)?void 0:o.text,"#100e0e"),S=r.Utils.nvl(m.color,"white"),w={color:S},C=function(e,t){var n=x({},k[e],t);return d.getStyle(e,n)},U=function(){var e=C("selectLabel"),t=parseInt(e.fontSize);t||(t=14);var n=r.Utils.nvl(e.lineHeight,t+2);return e.fontSize=t,e.lineHeight=n,e}(),T=r.Utils.nvl(U.fontSize,14)+2,V=d.getPart("iconSize",null,T);return l.jsxs(i.View,{style:C("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:v,style:C("selectInput"),children:[l.jsx(i.Text,{style:U,children:r.Utils.nvl(h,g)}),l.jsx(a.Ionicons,{name:"chevron-down-outline",size:V,color:d.getPart("iconColor",null,b),style:C("iconStyle",{})})]}),l.jsxs(i.Modal,{animationType:"slide",transparent:!0,visible:c,onRequestClose:function(){return u(!1)},children:[l.jsx(i.SafeAreaView,{style:C("modalTop")}),l.jsxs(i.SafeAreaView,{style:C("modalSafe"),children:[l.jsxs(i.View,{style:d.getStyle("header",m),children:[l.jsx(i.TouchableOpacity,{onPress:v,style:C("modalCloseButton"),children:l.jsx(a.Ionicons,{name:"close",size:24,color:S,style:C("modalCloseText",w)})}),l.jsx(i.Text,{style:C("modalTitle",w),children:g})]}),l.jsx(i.ScrollView,{contentContainerStyle:{flexGrow:1,paddingBottom:50},style:C("modalContent"),nestedScrollEnabled:!0,ref:j,children:l.jsx(i.View,{style:{flex:1,paddingLeft:15,paddingRight:15,paddingTop:10,paddingBottom:10},children:l.jsx(ue.List,x({data:f,name:d.getName("list"),layout:"card",search:!0===p.search,click:function(e){var t=e.value;d.changeValue(p.isObject&&null!=t&&t.object?null==t?void 0:t.object:null!=t&&t.value?null==t?void 0:t.value:t),u(!1)},rowStyle:x({paddingLeft:15,paddinRight:15},null==p?void 0:p.rowStyle)},null==p?void 0:p.listProps,{children:l.jsx(ue.Value,{value:"#{@this.label}"})}))})})]})]})]},d.getName(d.getPart("modal")+"_"+c))}var k=i.StyleSheet.create({selectRoot:{justifyContent:"flex-start",alignItems:"flex-start",flex:1},selectInput:{width:"100%",flexDirection:"row",borderRadius:5,paddingHorizontal:15,borderWidth:1,borderStyle:"solid",borderColor:"#dedede",paddingVertical:10},selectLabel:{flex:1,fontSize:14},modalTop:{backgroundColor:"primary",width:"100%"},modalSafe:{flex:1,width:"100%",backgroundColor:"background"},modalCloseButton:{padding:10},modalCloseText:{fontSize:18,color:"white"},modalTitle:{fontSize:18,fontWeight:"bold",marginLeft:10},modalContent:{flex:1,backgroundColor:"background"}});function F(e){var n=e.scope,o=r.Utils.nvl(n.getValue(),!1),a=t.useState(o),s=a[1];return l.jsx(i.Switch,{value:a[0],style:n.getStyle("element"),onValueChange:function(e){n.changeValue(e),s(e)}})}function P(e){var n=e.scope,i=r.Utils.nvl(n.getValue(),0),o=t.useState(i),a=o[0],c=o[1],u=n.attr("step",1),d=n.attr("min",0),p=n.attr("min",100),f=function(e){var t=r.ComponentUtils.getViewScope();if(n.original.debug&&console.log(t),t){var i,l=t.get("scrollRef");l&&(null==(i=l.current)||null==i.setNativeProps||i.setNativeProps({scrollEnabled:e}))}};return l.jsx(l.Fragment,{children:l.jsx(s,{minimumValue:d,maximumValue:p,step:u,minimumTrackTintColor:"#1EB1FC",maximumTrackTintColor:"#d3d3d3",thumbTintColor:"#1EB1FC",value:a,onSlidingStart:function(){return f(!1)},onSlidingComplete:function(){return f(!0)},style:x({width:"100%",height:40},n.getStyle("element")),onValueChange:function(e){e=r.Utils.nvl(e,0),console.log(e),n.changeValue(e),c(e)}})})}function z(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:L.link,children:"Clique aqui para acessar o React Native"})})}var L={link:{}};function R(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:E.link,children:"Clique aqui para acessar o React Native"})})}var E={link:{}};function D(e){var n=e.scope,o=r.Utils.call((function(){var e=r.Utils.nvl(n.getValue(),"");return e&&null!=e&&e.push?e.join(", ").trim():e})),s=n.getLabel(),c=n.getPart("placeholder",null,s),u=n.original,d=n.original,p=t.useState(80),f=p[0],g=p[1],h=t.useState(o),y=h[0],m=h[1],v=function(e,t){return x({},n.getStyle(e,x({},W[e],t)))},j=function(){var e=u.icon;return l.jsx(l.Fragment,e?"string"==typeof e?{children:u.icon&&l.jsx(a.Ionicons,{name:u.icon,size:n.attr("iconSize",20),color:n.attr("iconColor","#888")})}:{children:e}:{})},b=n.getPart("type",null,"text"),S={textarea:{multiline:!0,autoHeight:!1!==d.autoHeight,textAlignVertical:"top",numberOfLines:5,style:{height:Math.max(80,f)},baseStyle:{paddingVertical:10}}},w=x({},r.Utils.nvl(S[b],{}),d.inputProps),C=r.Utils.call((function(){var e={};return"small"===d.size&&(e.height=35,e.fontSize=12),e.fontSize=r.Utils.nvl(d.fontSize,e.fontSize),(e=x({},v(b),v("input",e))).lineHeight=parseInt(e.fontSize)+2,e}));return w.autoHeight&&(w.onContentSizeChange=function(e){g(e.nativeEvent.contentSize.height)},C=x({},C,w.style)),l.jsxs(l.Fragment,{children:[l.jsxs(i.View,{style:v("base",null==w?void 0:w.baseStyle),children:[n.getPart("left"),l.jsx(i.TextInput,x({onChangeText:function(e){e=n.changeValue(e),m(e)},value:y,placeholder:c},w,{style:C})),l.jsx(j,{})]}),n.getPart("right")]})}var W=i.StyleSheet.create({base:{flex:1,width:"100%",paddingBottom:0,paddingTop:0,alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:5,paddingHorizontal:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10},icon:{marginRight:10},input:{marginHorizontal:0,marginVertical:0,height:40,width:"100%",flex:1},textarea:{marginHorizontal:0,marginVertical:0,width:"100%",height:"auto",alignSelf:"stretch",flex:1}});function B(e){var n,o=e.scope,a=e.index,s=o.original,c=e.item,u=o.getPart("cols",void 0,-1),d=Math.floor(100/u)+"%",p=null==(n={repeat:H,list:q})?void 0:n[s.type],f=""+o.key("row",a,""),g=t.useState(r.ScopeUtils.create(x({},s,{parent:o,name:f,crud:o.crud,index:a,type:"row",data:c})))[0],y=t.useRef(null),m=function(e,n){var r=t.useState(!0===n.visible),l=r[0],o=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 a=window.innerHeight,s=r.top<a&&r.bottom>0;s&&(n.visible=s),o(s)}}else null==e.current.measureInWindow||e.current.measureInWindow((function(e,t,r,l){var a=t<i.Dimensions.get("window").height&&t+l>0;a&&(n.visible=a),o(a)}))}),300);return function(){return clearInterval(t)}}),[e]),l}(y,g),v=function(){return l.jsx(l.Fragment,!m&&s.useIsInView&&!g.visible&&a>20?{}:{children:l.jsx(h,{transient:!0,scope:g,crud:g.crud,children:e.children})})};return l.jsx((function(){var e=t.useState(0),n=e[0],r=e[1],f=o.key("item");g.selected=g.getPart("isSelectedRow",void 0,!1);var h=function(){var e=g.getStyle("row",x({},p.row,{minHeight:30}));return e=x({},e,g.getStyle(g.selected?"rowSelected":"rowUnSelected",{})),u>0&&(e.width=d),e};return g.update=function(){o.updateIndex=o.updateIndex+1,r(++n)},!1===g.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){g.call("click",{value:e,item:e,edit:!0,index:a})}(c)},children:l.jsx(v,{})},f):l.jsx(i.View,{style:h(),ref:y,children:l.jsx(v,{})},f)}),{})}var q=i.StyleSheet.create({row:{padding:5,margin:0,width:"100%",backgroundColor:"background",gap:10,borderRadius:8,justifyContent:"center"}}),H=i.StyleSheet.create({row:{padding:0,width:"100%",justifyContent:"center"}});function O(e){var n,o=e.scope,s=o.crud,c=o.original,u=r.Utils.nvl(o.getPart("cols",void 0,1)),d=null==(n={repeat:A,list:N})?void 0:n[c.type],p=r.ComponentUtils.getDefine(e,"add"),f=c.hideAddWhenEmpty,g=c.hideEmpty,h=function(){var n=t.useState(o.updateIndex),a=n[0],g=n[1],h=o.attr("empty","Sem registro");o.update=function(){o.updateIndex=++a,g(a)};var y,m=r.Utils.call((function(){var e,t=r.Utils.nvl(o.getItems(),[]);if(!1!==c.search&&(null==(e=c.list)||!e.url)){var n=s.get("query","").toLowerCase().trim();if(n.length>1){var i=[],l=r.Utils.nvl(c.filterBy,"label");return r.Utils.each(t,(function(e){var t=r.Utils.getValue(l,"none",e).toLowerCase();t&&t.includes(n)&&i.push(e)})),i}}return t})),v=r.Utils.isEmpty(m),j=function(){return v&&h?"string"==typeof h?l.jsx(i.Text,{style:o.getStyle("empty",{flex:1,fontWeight:400,fontSize:18,padding:10,textAlign:"center",width:"100%",justifyContent:"center",alignItems:"center"}),children:h}):l.jsx(l.Fragment,{children:h}):l.jsx(l.Fragment,{})};return!1===h&&v?l.jsx(l.Fragment,{}):l.jsxs(i.View,{style:(y=o.getStyle("container",x({},{},d.container)),u>1&&(y=x({},y,{flexDirection:"row",flexWrap:"wrap"})),y),children:[l.jsx(j,{}),m.map((function(t,n){return l.jsx(B,{index:n,item:t,scope:o,children:e.children})})),(!v||!0!==f)&&l.jsx(l.Fragment,{children:p})]})},y=r.Utils.nvl(o.getItems(),[]);return g&&r.Utils.isEmpty(y)?l.jsx(l.Fragment,{}):l.jsxs(l.Fragment,{children:[!1!==c.search&&l.jsx(ue.Text,{placeholder:"Pesquisar...",field:"query",crud:s,style:{marginBottom:10},change:{action:function(){o.search()}},icon:l.jsx(a.Ionicons,{name:"search",size:20,color:"#888"})}),l.jsx(h,{})]})}var N=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}}),A=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}});function M(e){var n=e.scope,o=r.Utils.nvl(n.getOptions(),[]),a=n.getInputValue(),s=t.useState(0),c=s[0],u=s[1],d=function(e){return(null==e?void 0:e.value)===a},p=function(t){var o=t.item,a=t.index,s=d(o),c=x({},G.text,n.getStyle("text"));return s&&(c.color="#ffffff"),r.Utils.isEmpty(e.children)?l.jsx(i.Text,{style:c,children:o.label}):l.jsx(B,{scope:n,item:o.object,index:a,children:e.children})},f=function(e){var t=x({},G.item,n.getStyle("item")),r=Math.floor(100/o.length)+"%";if(d(e)){var i=n.getPart("selectedColor",void 0,"primary");(t=x({},t,n.getStyle("selected",{backgroundColor:i,color:"#ffffff"}))).color||(t.color="#ffffff");var l=e.color;e.backgroundColor&&(t=x({},t,{backgroundColor:e.backgroundColor})),e.color&&(t=x({},t,{color:l}))}else t.backgroundColor="#fff",t.color="#000";return t.width=r,t};return l.jsx(i.View,{style:x({},G.container,n.getStyle("items")),children:o.map((function(e,t){return l.jsx(i.TouchableHighlight,{style:f(e),onPress:function(t){!function(e){n.changeValue(e.object),u(++c)}(e)},children:l.jsx(p,{item:e,index:t})},"k-"+t)}))})}var G=i.StyleSheet.create({container:{flex:1,width:"100%",justifyContent:"center",flexDirection:"row",alignItems:"center",margin:3,gap:5},item:{backgroundColor:"background",justifyContent:"center",alignItems:"center",width:"auto",flexDirection:"row",flex:1,padding:5,borderRadius:2},text:{fontSize:13,fontWeight:"400"}});function _(e){var n=e.scope,o=n.original,s=t.useState(0),c=s[0],u=s[1],d=n.getValue(0),p=o.color;p||(p="primary");var f={padding:0,alignItems:"center",height:30,width:30,textAlign:"center",verticalAling:"middle",borderRadius:24,backgroundColor:p,color:"#ffffff",justifyContent:"center"},g={buttonLabel:{color:"#ffffff",fontWeight:"500",fontSize:16},value:{flex:1,flexDirection:"row",textAlign:"center",fontWeight:"500"},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center"},buttonIcon:{color:"#fff",fontSize:18},button:f,addButton:x({},f),delButton:x({},f)},h=function(e){n.changeValue(d+e),u(++c)},y=function(e,t){var r=x({},g[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(a.Ionicons,{size:30,style:y("buttonIcon"),name:"remove"})}),l.jsx(i.Text,{style:y("value"),children:r.Utils.nvl(d,0)}),l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){h(1)},style:y("addButton"),children:l.jsx(a.Ionicons,{size:30,style:y("buttonIcon"),name:"add"})})]})}function K(){var e={success:function(e){return l.jsx(c.BaseToast,x({},e,{style:t.darkToast,contentContainerStyle:{paddingHorizontal:15},text1Style:t.text,text2Style:t.text}))},error:function(e){return l.jsx(c.ErrorToast,x({},e,{style:t.darkToast,text1Style:t.text,text2Style:t.text}))},info:function(e){return l.jsx(c.BaseToast,x({},e,{style:t.darkToast,text1Style:t.text,text2Style:t.text}))}},t=i.StyleSheet.create({darkToast:{backgroundColor:"rgba(34, 34, 34, 0.85)",borderLeftColor:"#222"},text:{color:"#fff",textAlign:"center"}});return l.jsx(u,{config:e})}function Q(e){var n,a=t.useRef(null),s=e.scope,c=t.useState(0),u=c[0],p=c[1],f=s.currentDialog,g=null==f?void 0:f.crud;if(!f)return l.jsx(l.Fragment,{});f.update=function(){p(++u)},f.debug&&console.log(f);var y=f.scope,m=y.getLabel(),v=y.getTheme(),j=r.Utils.nvl(null==(n=v.styles)||null==(n=n.defaults)?void 0:n.header,{}),b=r.ComponentUtils.getDefine(e,"header","right"),S=r.ComponentUtils.getDefine(e,"bottom"),w=function(e,t){var n=x({},J[e],t);return x({},y.getStyle(e,n))},C=function(){y.close({scope:y,crud:null==f?void 0:f.crud,event:{}})};y.put("scrollRef",a);var U=s.original;r.ComponentUtils.setViewScope(y);var T=r.Utils.nvl(j.color,"white"),V={color:T},I=g.name+"-"+u,k=function(e){var t=e.children,n=y.part("disableScroll",!1);return y.part("disableContent",!1)?l.jsx(l.Fragment,{children:t}):n?l.jsx(i.View,{style:w("modalContent"),children:t}):l.jsx(i.ScrollView,{contentContainerStyle:{flexGrow:1,paddingBottom:50},style:w("modalContent"),nestedScrollEnabled:!0,ref:a,children:t})};return l.jsx((function(e){var t=e.children;return U.gesture?l.jsx(d.GestureHandlerRootView,{style:{flex:1},children:t}):l.jsx(l.Fragment,{children:t})}),{children:l.jsx(i.Modal,{animationType:"slide",transparent:!0,visible:!0,onRequestClose:C,children:l.jsx((function(){var t=l.jsx((function(){return null!=f&&f.component?l.jsx(f.component,x({crud:g},f.props),g.uuid):l.jsx(h,{scope:y,crud:g,children:e.children})}),{});return U.transient?l.jsx(i.View,{style:w("modalSafe"),children:t}):l.jsxs(l.Fragment,{children:[l.jsx(i.SafeAreaView,{style:w("modalTop")}),l.jsxs(i.SafeAreaView,{style:w("modalSafe"),children:[l.jsxs(i.View,{style:y.getStyle("header",j),children:[l.jsx(i.TouchableOpacity,{onPress:C,style:w("modalCloseButton"),children:l.jsx(o,{name:"chevron-back-outline",size:24,color:T,style:w("modalCloseText",V)})}),l.jsx(i.Text,{style:w("modalTitle",V),children:m}),!r.Utils.isEmpty(b)&&l.jsx(h,{scope:y,crud:g,transient:!0,children:b})]}),l.jsx(k,{children:t}),S]}),l.jsx(K,{})]})}),{})},I)})}var J=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:22,fontWeight:600,marginLeft:10},modalContent:{flex:1,backgroundColor:"background",paddingLeft:15,paddingRight:15,paddingTop:10,paddingBottom:10}});function X(e){var t,n,o=e.scope,a=o.getTheme(),s=o.getPart("header",null,[]),c=r.Utils.nvl(null==(t=a.styles)||null==(t=t.defaults)?void 0:t.header,{}),u=r.Utils.nvl(null==(n=a.styles)||null==(n=n.defaults)?void 0:n.headerText,{}),d=r.Utils.call((function(){var e=o.getStyle("header",c),t=e.backgroundColor;return t&&(e.color=r.HtmlUtils.getTextColor(t)),e})),p=!r.Utils.isEmpty(s);return l.jsx(l.Fragment,{children:p&&l.jsx(i.View,{style:d,children:l.jsx((function(){return"string"==typeof s?l.jsx(i.Text,{style:u,children:s}):l.jsx(l.Fragment,{children:s})}),{})})})}function Y(e){var n=e.scope,o=e.children,a=t.useRef(null),s=n.original,c=function(){var e=r.ViewUtils.getCrud();r.Utils.each(e.scroll,(function(e){e.onScroll&&e.onScroll.call(e)}))};n.put("scrollRef",a),r.ComponentUtils.setViewScope(n);var u=function(){return!1===s.scroll?l.jsx(h,{scope:n,children:o}):l.jsx(i.View,{style:n.getStyle("container",Z.container),children:l.jsx(i.ScrollView,{onScroll:c,scrollEventThrottle:16,ref:a,nestedScrollEnabled:!0,keyboardShouldPersistTaps:"handled",contentContainerStyle:n.getStyle("contentContainer",{paddingBottom:50}),style:n.getStyle("scroll",Z.scroll),children:l.jsx(h,{scope:n,children:o})})})};return l.jsxs(l.Fragment,{children:[l.jsx(X,{scope:n}),l.jsx(u,{}),l.jsx(K,{})]})}var Z=i.StyleSheet.create({scroll:{paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},container:{},view:{}});function $(e){var n=e.scope,o=n.crud,s=n.original,c=(r.Utils.nvl(n.getPart("cols",void 0,1)),r.Utils.call((function(){var e,t=r.Utils.nvl(n.getItems(),[]);if(s.search&&(null==(e=s.list)||!e.url)){var i=o.get("query","").toLowerCase().trim();if(i.length>1){var l=[],a=r.Utils.nvl(s.filterBy,"label");return r.Utils.each(t,(function(e){var t=e[a];t&&t.includes(i)&&l.push(e)})),l}}return t}))),u=function(o){var c=o.item,u=o.drag,d=o.isActive,f=(0,o.getIndex)(),g=""+n.key("row",f,""),y=t.useState(r.ScopeUtils.create(x({},s,{parent:n,name:g,crud:n.crud,index:f,type:"row",data:c})))[0],m=x({},n.getStyle("row"));d&&(m=x({},m,n.getStyle("active"))),m=x({},m,y.getStyle(d?"rowSelected":"rowUnSelected",{}));var v=function(){return r.Utils.isEmpty(e.children)?l.jsxs(l.Fragment,{children:[l.jsx(a.MaterialCommunityIcons,{name:"drag",size:24,color:"black"}),l.jsx(i.Text,{style:ee.text,children:n.getItemLabel(c)})]}):l.jsx(l.Fragment,{children:l.jsx(h,{transient:!0,scope:y,crud:y.crud,children:e.children})})};return l.jsx(p.ScaleDecorator,{children:l.jsx(i.TouchableOpacity,{style:[ee.row,{backgroundColor:d?"lightblue":"white"},x({},m)],delayLongPress:100,onLongPress:u,children:l.jsx(v,{})})})},g=function(e){var t=e.pos;return r.Utils.nvl(s.headerPos,"outer")!==t?l.jsx(l.Fragment,{}):l.jsx(X,{scope:n})},y=function(){var e=t.useState(c),r=e[1];return l.jsx(f,{data:e[0],ListHeaderComponent:l.jsx(g,{pos:"inner"}),ListFooterComponent:l.jsx(l.Fragment,{children:n.getPart("footer")}),renderItem:u,containerStyle:x({},n.getStyle("list")),keyExtractor:function(e){var t=n.getItemValue(e);return null!=s&&s.debug&&console.log(t),t},onDragEnd:function(e){var t=e.data;r(t),n.changeValue(t)}})};return l.jsxs((function(e){var t=e.children;return!1!==s.gesture?l.jsx(d.GestureHandlerRootView,{style:x({flex:1,width:"100%"},n.getStyle("order",{justifyContent:"flex-start"})),children:t}):l.jsx(l.Fragment,{children:t})}),{children:[l.jsx(g,{pos:"outer"}),l.jsx(y,{})]})}var ee=i.StyleSheet.create({row:{flexDirection:"row",gap:10,padding:15,borderBottomWidth:1,borderBottomColor:"#ccc"},text:{fontSize:18}}),te=t.createContext({});function ne(e){var n,o,s=this,c=t.useContext(te),d=r.Utils.nvl(e.theme,null==c?void 0:c.theme),p=r.Utils.nvl(e.crud,null==c?void 0:c.crud),f=t.useState(r.ScopeUtils.create(x({crud:p},e,{theme:d})))[0],g=t.useState(0),y=g[0],j=g[1],b=t.useState(null),C=b[0],T=b[1];f.compile(e),p=f.crud;var k=f.getOptions(),L=f.original,E=t.useRef(null);f.update=function(){j(++y)},f.updateElement=function(){j(++y)},f.toast=function(e,t,n){void 0===t&&(t="info"),u.show(x({type:t,text1:e,position:"bottom",visibilityTime:3e3},n))},f.prompt=function(e){var t=e.event;if(t){var n="Você tem certeza que deseja continuar?",l="Atenção",o=t.prompt;"string"==typeof o&&(n=o),"object"==typeof o&&(n=r.Utils.nvl(o.message,n),l=r.Utils.nvl(o.title,l)),i.Alert.alert(l,n,[{text:"Cancelar",style:"cancel"},{text:"Confirmar",onPress:function(){return f.execute(e)}}],{cancelable:!1})}};var W=function(){var e=L.custom;return e?l.jsx(ne,"string"==typeof e?{element:{value:e,type:"dummy"},crud:p}:x({type:e.type,tag:e.type},e.props,{crud:p})):l.jsx(l.Fragment,{})};if(f.is("type","dummy"))return l.jsx(l.Fragment,{children:f.getDisplayValue()});var B=function(){var e=f.getValue();q({target:{value:!(!0===e)}})},q=function(e){var t=e.target.value;f.isType("integer","int","number")?t=parseInt(t):f.isType("decimal")&&(t=parseFloat(t)),f.isType("select","complete")&&(t=f.getSelectedItem(t)),f.changeValue(t),f.update()},H=function(e){var t;null!=(t=f.currentDialog)&&t.component||f.call("click")},N={scope:f,crud:p,onChange:q};f.isType("password")&&(N.type="password");var A=function(){return!(f.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},G=f.is("type","text","textarea","number","integer","int","phone","postalCode","money","password","email"),K=function(e,t){var n,i=r.Utils.nvl(L.type,"none"),l=r.Utils.nvl(e,"root"),o=x({},oe[l]),a=A();return i=r.Utils.nvl(L.layout,i),e||a||(o=x({},o)),f.isInput()&&(o=x({},o,le.input[l])),o=x({},o,null==le||null==(n=le[i])?void 0:n[l]),a&&e&&(o=x({},o,ae[e])),x({},o,f.getStyle(e,x({},o,t)))},J=K("element"),X={required:f.isRequired(),size:"small",scope:f,crud:p,style:J,placeholder:f.attr("placeholder","Digite aqui")};f.error=function(e){C=e,T(e)},null!=(n=L.list)&&n.url||null!=(o=L.load)&&o.url||f.start(),t.useEffect((function(){f.start()}));var Z=function(){return"string"==typeof L.icon?l.jsx(a.Ionicons,{name:L.icon,style:f.getStyle("icon")}):l.jsx(l.Fragment,{children:L.icon})};if(f.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=E&&E.current&&f.is("type","card","list","tabs","stepper")){var e=null==E?void 0:E.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!f.isRendered()||f.is("type","define"))return l.jsx(l.Fragment,{});var ee=!f.isType("input","grid","list","order","repeat")&&L.click,ie={};ee&&(ie.underlayColor="transparent",ie.onPress=H);var se=function(e){var t=i.View;return ee&&(t=i.TouchableHighlight),f.isType("dialog","order")||L.transient?l.jsx(l.Fragment,{children:e.children}):l.jsx(t,x({},e))},ce=function(){return l.jsxs(l.Fragment,{children:[f.getPart("render",null,l.jsx(l.Fragment,{})),f.is("type","button")&&l.jsxs(V,x({},X,{onClick:H,variant:f.attr("variant","outlined"),children:[L.icon&&l.jsx(Z,{}),L.label&&l.jsx(i.Text,{style:f.getPart("label","button"),children:f.getLabel()})]})),f.is("type","icon")&&l.jsx(U,x({},X,{onClick:H,variant:f.attr("variant","outlined"),children:f.getDisplayValue()})),f.is("type","link")&&l.jsxs(w,x({},X,{onClick:H,variant:f.attr("variant","outlined"),children:[L.icon&&l.jsx(Z,{}),L.label&&l.jsx(i.Text,{style:f.getPart("label","link"),children:f.getLabel()})]})),G&&l.jsx(D,x({},N,X,{InputProps:x({},L.inputProps)})),f.is("type","complete","autocomplete")&&l.jsx(S,{scope:f,defaultsInput:N,defaultsUI:X}),f.is("type","quantity")&&l.jsx(_,{scope:f,defaultsInput:N,defaultsUI:X}),f.is("type","checkbox","boolean","switch")&&l.jsx(F,x({checked:!0===f.getValue()},N,{onChange:B})),f.isType("slider")&&l.jsx(P,x({},N,{onChange:B})),f.is("type","select")&&l.jsx(I,x({},N,X,{value:f.getSelectedValue()})),f.is("type","toggle")&&l.jsx(M,x({},N,X,{value:f.getSelectedValue()})),f.is("type","radio")&&l.jsx(R,x({},N,X,{row:!0,children:k.map((function(e,t){return l.jsx(z,{control:l.jsx(R,x({},X)),label:e.label,value:e.value},"i"+t)}))})),f.is("type","custom")&&l.jsx(W,{}),f.is("type","column")&&l.jsxs(l.Fragment,{children:[f.is("format","img")&&l.jsx(i.Image,{source:f.getDisplayValue()}),f.is("format","icon")&&l.jsx(U,{scope:f,crud:p}),!f.is("format","icon","img")&&l.jsx(i.Text,{children:f.getDisplayValue()})]}),f.is("type","output","value")&&l.jsx(i.Text,{style:K("value"),children:f.getDisplayValue()})]})},ue=function(t){var n=t.name,i=t.style;if(e[n]){var o=r.ComponentUtils.getDefine(e,n);if(!r.Utils.isEmpty(o))return l.jsx(h,x({},e,{scope:f,crud:p,style:K(n,i),children:o}))}return l.jsx(l.Fragment,{})},de=function(){return l.jsxs(l.Fragment,{children:[void 0!==L.label&&!1!==L.label&&!f.isType("button","dialog","modal")&&l.jsxs(i.View,{style:K("outerLabel",{alignSelf:"flex-start",flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}),children:[l.jsx(i.Text,{style:K("label"),children:f.getLabel()}),l.jsx(ue,{name:"actions",style:{width:"auto"}})]}),!A()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:K("inner"),children:l.jsx(ce,{})}),C&&l.jsx(i.View,{style:K("error",{fontSize:12,paddingTop:4,color:"#e55b5b"}),children:C})]}),f.isType("list","repeat")&&l.jsx(O,x({},e,{scope:f,crud:p})),f.isType("order")&&l.jsx($,x({},e,{scope:f,crud:p})),f.isType("chart")&&l.jsx(v,x({},e,{scope:f,crud:p})),f.isType("tabs")&&l.jsx(m,x({},e,{scope:f,crud:p})),f.isType("view")&&l.jsx(Y,x({},e,{scope:f,crud:p})),!f.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(h,x({},e,{scope:f,crud:p,style:K("inner")})),l.jsx(Q,x({},e,{scope:f,crud:p}))]})},pe=function(e){var t=f.is("type|layout","card");if(f.isType("list")){var n=f.getPart("empty",null,void 0),o=f.getItems();!1===n&&r.Utils.isEmpty(o)&&(t=!1)}if(t){var a=x({},K("box",x({},re.box,{alignSelf:"stretch"}))),s=L.boxBorder;return(s||0===s)&&(!0===s&&(s=1),a=x({},a,{borderWidth:s})),l.jsx(i.View,{style:K("card",x({},a)),children:l.jsx(i.View,{style:K("boxInner",{paddingHorizontal:15,paddingVertical:10}),children:e.children})})}return f.isInput()||L.container?l.jsx(i.View,{style:K("container",{paddingVertical:5,width:"100%"}),children:e.children}):l.jsx(l.Fragment,{children:e.children})};if(f.dialogShow=function(e){var t,n=r.Utils.nvl(null==e?void 0:e.event,{});null!=n&&n.debug&&console.log(e);var i=e.caller,l=r.ViewUtils.getCrud("view"),o=l.dialog,a=e.crud,c=f.getName("modal"),u=!0===e.edit,d={},p=null,g=null==n?void 0:n.component,h=r.Utils.nvl(null==i?void 0:i.original,L);a.is("row")?(d.parent=a.parent.parent,d.search=a.parent,p=a.data):a.is("search")&&(d.parent=a.parent,d.search=a);var y=a.data,m=r.Utils.nvl(n.data,n.send);"function"==typeof m&&(m=m.call(s,e)),!1!==n.send&&!1!==n.data||(y={});var v=r.Utils.nvl(m,e.item,p,y,{}),j=r.CrudUtils.create("dialog",x({parent:a,root:a,name:c,data:v,edit:u,scope:f},d)),b={label:h.label,icon:h.icon,type:"dialog"},S=null==(t=n.dialog)?void 0:t.close;"object"==typeof n.dialog&&(b=x({},b,n.dialog)),n.header&&(b.header=n.header),n.label&&(b.label=n.label),n.title&&(b.title=n.title);var w=r.Utils.nvl(b.title,b.label);b.label=w;var C={crud:j,label:w,parent:o,component:g,scope:r.ScopeUtils.create(x({parent:f,crud:j},b,{owner:f})),close:S,props:n.props,debug:n.debug};l.dialog=C,f.currentDialog=C,o&&(null==o.update||o.update()),f.update()},f.dialogHide=function(e){var t,n,i=r.ViewUtils.getCrud("view"),l=i.dialog,o=r.Utils.nvl(l.parent,null);i.dialog=o,f.currentDialog=o;var a=null==o||null==(t=o.scope)?void 0:t.parent,s=null==l||null==(n=l.scope)?void 0:n.parent;if(s){var c=l.close;s.update(),c&&(null!=c&&c.debug&&console.log("Fechando"),l.scope.call("close",{close:c}))}a&&a.update()},L.hideEmpty&&!f.isType("list","select","complete")){var fe=f.getValue();if(r.Utils.isEmpty(fe))return l.jsx(l.Fragment,{})}return l.jsx(te.Provider,{value:{crud:p,theme:d},children:l.jsx(se,x({ref:E,style:K()},ie,{children:l.jsx(pe,{children:l.jsx(de,{})})}))})}var re=i.StyleSheet.create({box:{borderWidth:1,borderColor:"#dedede",borderStyle:"solid",backgroundColor:"white",borderRadius:12,width:"100%",shadowColor:"#000",shadowOpacity:.1,shadowRadius:4}}),ie=x({},re.box),le={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}}};le.input=i.StyleSheet.create({label:{paddingLeft:0},inner:{flex:1,width:"100%",padding:0,gap:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),le.quantity={inner:x({},ie,{backgroundColor:"primarySoft",fontWeight:600,fontSize:16,borderRadius:25,borderWidth:0,paddingHorizontal:5,paddingVertical:5,flexWrap:"nowrap",flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"})},le.toggle=i.StyleSheet.create({root:{height:"auto"},inner:x({},ie,{flex:1,width:"100%",gap:10,borderRadius:2,justifyContent:"center",flexDirection:"row",alignSelf:"flex-start",flexWrap:"nowrap"})});var oe=i.StyleSheet.create({root:{gap:5,flexDirection:"column",flexWrap:"wrap",width:"100%",alignItems:"flex-start"},label:{fontWeight:600,fontSize:12,paddingVertical:3,color:"labelColor"},inner:{width:"100%"}}),ae=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function se(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,x({},t,{children:t.children}))}),x({},e.tagProps,{children:l.jsx(h,x({transient:!0},e,{scope:e.scope,crud:e.crud,part:e.name,children:t}))}))}var ce=["type"],ue={Order:function(e){return l.jsx(ne,x({},e,{type:"order"}))},List:function(e){return l.jsx(ne,x({},e,{type:"list"}))},Row:function(e){return l.jsx(ne,x({},e,{type:"row"}))},Value:function(e){return l.jsx(ne,x({},e,{type:"value"}))},Label:function(e){return l.jsx(ne,x({},e,{type:"label"}))},Repeat:function(e){return l.jsx(ne,x({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(ne,x({},e,{type:"define"}))},Include:function(e){return l.jsx(se,x({},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,ce);return l.jsx(ne,x({},t,{type:"column"}))},Input:function(e){return l.jsx(ne,x({},e))},Text:function(e){return l.jsx(ne,x({},e,{type:"text"}))},Textarea:function(e){return l.jsx(ne,x({},e,{type:"textarea"}))},Email:function(e){return l.jsx(ne,x({},e,{type:"email"}))},Button:function(e){return l.jsx(ne,x({},e,{type:"button"}))},Link:function(e){return l.jsx(ne,x({},e,{type:"link"}))},Icon:function(e){return l.jsx(ne,x({},e,{type:"icon"}))},Output:function(e){return l.jsx(ne,x({},e,{type:"output"}))},Form:function(e){return l.jsx(ne,x({},e,{type:"form"}))},Crud:function(e){return l.jsx(ne,x({},e,{type:"crud"}))},View:function(e){return l.jsx(ne,x({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(ne,x({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(ne,x({},e,{type:"dialog"}))},Content:function(e){return l.jsx(ne,x({},e,{type:"content"}))},Top:function(e){return l.jsx(ne,x({},e,{type:"top"}))},Card:function(e){return l.jsx(ne,x({},e,{type:"card"}))},Tab:function(e){return l.jsx(ne,x({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(ne,x({},e,{type:"tabs"}))},Step:function(e){return l.jsx(ne,x({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(ne,x({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(ne,x({},e,{type:"money"}))},Chart:function(e){return l.jsx(ne,x({},e,{type:"chart"}))},Password:function(e){return l.jsx(ne,x({},e,{type:"password"}))},Complete:function(e){return l.jsx(ne,x({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(ne,x({},e,{type:"switch"}))},Switch:function(e){return l.jsx(ne,x({},e,{type:"switch"}))},Radio:function(e){return l.jsx(ne,x({},e,{type:"radio"}))},Select:function(e){return l.jsx(ne,x({},e,{type:"select"}))},Toggle:function(e){return l.jsx(ne,x({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(ne,x({},e,{type:"entity"}))},Element:function(e){return l.jsx(ne,x({},e,{type:"element"}))},Quantity:function(e){return l.jsx(ne,x({},e,{type:"quantity"}))},Slider:function(e){return l.jsx(ne,x({},e,{type:"slider"}))},SafeView:function(e){var t,n=r.ThemeUtils.getCurrentTheme();return r.Utils.isEmpty(n)&&(n=r.useTheme()),l.jsx(g.SafeAreaProvider,{children:l.jsxs(g.SafeAreaView,{style:x({backgroundColor:null==(t=n.colors)?void 0:t.theme},e.viewStyle,{flex:1}),children:[l.jsx(i.StatusBar,{barStyle:"dark-content",backgroundColor:"#f5f5f5"}),l.jsx(i.KeyboardAvoidingView,{behavior:"ios"===i.Platform.OS?"padding":"height",style:{flex:1,justifyContent:"flex-start"},children:l.jsx(i.TouchableWithoutFeedback,{onPress:function(){"web"!==i.Platform.OS&&i.Keyboard.dismiss()},accessible:!1,children:l.jsx(l.Fragment,{children:e.children})})})]})})},GestureView:function(e){return l.jsx(d.GestureHandlerRootView,{style:{flex:1},children:e.children})}};exports.UI=ue;
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"),o=e(require("@expo/vector-icons/Ionicons")),a=require("@expo/vector-icons"),s=e(require("@react-native-community/slider")),c=require("react-native-toast-message"),u=e(c),d=require("react-native-gesture-handler"),p=require("react-native-draggable-flatlist"),f=e(p),g=require("react-native-safe-area-context");function x(){return(x=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 h(e){var o=t.useState(r.Utils.nvl(e.scope,r.ScopeUtils.create(e)))[0],a=r.Utils.nvl(e.crud,o.crud),s=r.Utils.nvl(e.validateScope,"global"),c=r.Utils.nvl(e.part,"child");if(o.isInput())return l.jsx(l.Fragment,{});var u,d,p,f,g,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,c=x({},n.props);return delete c.children,"string"==typeof i?r.Utils.isEmpty(n.props.children)?l.jsx(i,x({},c)):l.jsx(i,x({},c,{children:l.jsx(h,x({transient:!0,validateScope:s},n.props,{scope:o,crud:a}))})):"function"==typeof i?l.jsx(i,x({validateScope:s},n.props,{parent:o,crud:a})):r.Utils.isEmpty(null==(t=n.props)?void 0:t.children)?l.jsx(l.Fragment,{}):l.jsx(h,x({validateScope:s},n.props,{scope:o,crud:a,transient:!0}))},v=function(){return l.jsx(l.Fragment,e.elements?{children:Object.entries(e.elements).map((function(e,t){return l.jsx(ne,x({crud:a},e[1]))}))}:{children:n.Children.map(e.children,(function(e){return l.jsx(m,{child:e})}))})};return e.transient?l.jsx(v,{}):r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements)?l.jsx(l.Fragment,{}):e.transient?l.jsx(v,{}):l.jsx(l.Fragment,{children:l.jsx(i.View,{style:(u=c,p=r.Utils.nvl(u,"root"),f=y[p],g={},r.Utils.isEmpty(e.style)||(null!=(d=e.style)&&d.push?r.Utils.each(e.style,(function(e){e&&(g=x({},g,e))})):g=x({},e.style)),x({},f,g,o.getStyle(u))),children:l.jsx(v,{})})})}var y=i.StyleSheet.create({child:{width:"100%"},inner:{width:"100%"}});function m(e){var i=e.scope,a=t.useState(0),s=a[0],c=a[1],u=i.original,d=i.getItems(),p=0,f=[],g=t.useState(null),y=g[0],m=g[1],v=function(e,t){void 0===t&&(t=!0),e&&i.execute({event:{validate:t,validateScope:u.validateScope,action:function(){i.changeValue(e.data),y=e,c(s=e.index),m(e)}}})},j=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=x({},e.props);t||(t=i.crud.data);var l=r.CrudUtils.create("tabs",{data:t,changed:t,parent:i.crud}),o=r.Utils.resolve(n,l);!1!==o.rendered&&f.push(x({},o,{child:e,element:o,original:n,index:p++,data:t}))};n.Children.map(e.children,(function(e,t){if(r.Utils.isEmpty(d))b(e,{});else for(var n in d)b(e,d[n])})),y||v(f[s],!1);var S=function(e){v(f[s+e])},w="stepper"===u.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:f.map((function(e,t){return l.jsxs("div",{className:j(e),onClick:function(){v(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(u.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(h,x({},e,{scope:i,children:y.child}))}),"stepper"===u.layout&&l.jsxs("div",{className:"ui-tabs-actions",children:[l.jsx(ue.Output,{space:6,layout:"left",children:l.jsx(ue.Include,x({},e,{transient:!0,name:"left",default:l.jsx(ue.Button,{rendered:s>0,icon:l.jsx(o,{}),click:function(){S(-1)}})}))}),l.jsx(ue.Output,{space:6,layout:"right",children:l.jsx(ue.Include,x({},e,{transient:!0,name:"right",default:l.jsx(ue.Button,{rendered:s<f.length-1,icon:l.jsx(o,{}),click:function(){S(1)}})}))})]})]})]})})}function v(e){var t=e.scope;return t.getItems(),r.Utils.asList(t.original.columns),l.jsx("div",{className:"ui-chart-data"})}function j(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:b.link,children:"Clique aqui para acessar o React Native"})})}var b={link:{}};function S(e){return l.jsx(l.Fragment,{children:l.jsx(j,x({},e.defaultsInput,e.defaultsUI))})}function w(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:C.link,children:"Clique aqui para acessar o React Native"})})}var C={link:{}};function U(e){var t=e.scope,n=t.getValue(),i={ion:a.Ionicons,ant:a.AntDesign,entypo:a.Entypo,evil:a.EvilIcons,material:a.MaterialCommunityIcons},o=r.Utils.nvl(t.original.library,"ion");return l.jsx(i[o],{name:n,style:t.getStyle("icon")})}var T={small:{minWidth:30,height:30}};function V(e){var t=e.scope,n=t.original,o=r.Utils.nvl(n.size,"default"),s=r.Utils.nvl(n.align,"center"),c=r.Utils.nvl(n.variant,"default"),u=n.color,d=t.getLabel(),p=t.getPart("icon");u||(u="primaryLight");var f={buttonLabel:{color:"#ffffff",fontWeight:400,fontSize:15},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center",height:44,minWidth:44},buttonIcon:{color:"#fff",fontSize:16},button:{backgroundColor:u,borderRadius:20,gap:10,justifyContent:"center",alignItems:"center",flexDirection:"row"}},g=function(e,n){var i=x({},f[e],n);return"text"!==c&&"outlined"!==c||(i.backgroundColor="transparent",i.color=r.Utils.nvl(u,"text")),"small"===o&&(i.fontSize=12,i.fontWeight=500),"medium"===o&&(i.fontSize=14,i.fontWeight=500),"left"===s&&(i.justifyContent="flex-start"),t.getStyle(e,i)},h={};h.button=p?{height:40,padding:0}:{height:50};var y=r.Utils.call((function(){var e=x({},null==h?void 0:h.button);"outlined"===c&&(e.borderWidth=1,e.borderColor=r.Utils.nvl(u,"text")),o&&(e=x({},e,T[o])),d||(e=x({},e,{borderRadius:20}));var t=g("button",e);if(!t.width){var n=t.height;"number"==typeof n&&(t.minWidth=n)}return t})),m=g("buttonLabel"),v=r.Utils.call((function(){var e=g("buttonIcon",h.icon);return e.fontSize=r.Utils.nvl(m.fontSize,e.fontSize),e}));return l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(e){t.call("click",{})},style:y,children:l.jsxs(l.Fragment,{children:[p&&l.jsx(l.Fragment,{children:l.jsx(a.Ionicons,{size:r.Utils.nvl(n.iconSize,30),style:v,name:p})}),d&&l.jsx(i.Text,{style:m,children:d})]})})}function I(e){var n,o,s=t.useState(!1),c=s[0],u=s[1],d=e.scope,p=d.original,f=r.Utils.nvl(d.getOptions(),[]),g=d.attr("placeholder","Selecione..."),h=d.getDisplayValue(),y=d.getTheme(),m=r.Utils.nvl(null==(n=y.styles)||null==(n=n.defaults)?void 0:n.header,{}),v=function(){u(!c)},j=t.useRef(null),b=r.Utils.nvl(null==(o=y.colors)?void 0:o.text,"#100e0e"),S=r.Utils.nvl(m.color,"white"),w={color:S},C=function(e,t){var n=x({},k[e],t);return d.getStyle(e,n)},U=function(){var e=C("selectLabel"),t=parseInt(e.fontSize);t||(t=14);var n=r.Utils.nvl(e.lineHeight,t+2);return e.fontSize=t,e.lineHeight=n,e}(),T=r.Utils.nvl(U.fontSize,14)+2,V=d.getPart("iconSize",null,T);return l.jsxs(i.View,{style:C("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:v,style:C("selectInput"),children:[l.jsx(i.Text,{style:U,children:r.Utils.nvl(h,g)}),l.jsx(a.Ionicons,{name:"chevron-down-outline",size:V,color:d.getPart("iconColor",null,b),style:C("iconStyle",{})})]}),l.jsxs(i.Modal,{animationType:"slide",transparent:!0,visible:c,onRequestClose:function(){return u(!1)},children:[l.jsx(i.SafeAreaView,{style:C("modalTop")}),l.jsxs(i.SafeAreaView,{style:C("modalSafe"),children:[l.jsxs(i.View,{style:d.getStyle("header",m),children:[l.jsx(i.TouchableOpacity,{onPress:v,style:C("modalCloseButton"),children:l.jsx(a.Ionicons,{name:"close",size:24,color:S,style:C("modalCloseText",w)})}),l.jsx(i.Text,{style:C("modalTitle",w),children:g})]}),l.jsx(i.ScrollView,{contentContainerStyle:{flexGrow:1,paddingBottom:50},style:C("modalContent"),nestedScrollEnabled:!0,ref:j,children:l.jsx(i.View,{style:{flex:1,paddingLeft:15,paddingRight:15,paddingTop:10,paddingBottom:10},children:l.jsx(ue.List,x({data:f,name:d.getName("list"),layout:"card",search:!0===p.search,click:function(e){var t=e.value;d.changeValue(p.isObject&&null!=t&&t.object?null==t?void 0:t.object:null!=t&&t.value?null==t?void 0:t.value:t),u(!1)},rowStyle:x({paddingLeft:15,paddinRight:15},null==p?void 0:p.rowStyle)},null==p?void 0:p.listProps,{children:l.jsx(ue.Value,{value:"#{@this.label}"})}))})})]})]})]},d.getName(d.getPart("modal")+"_"+c))}var k=i.StyleSheet.create({selectRoot:{justifyContent:"flex-start",alignItems:"flex-start",flex:1},selectInput:{width:"100%",flexDirection:"row",borderRadius:5,paddingHorizontal:15,borderWidth:1,borderStyle:"solid",borderColor:"#dedede",paddingVertical:10},selectLabel:{flex:1,fontSize:14},modalTop:{backgroundColor:"primary",width:"100%"},modalSafe:{flex:1,width:"100%",backgroundColor:"background"},modalCloseButton:{padding:10},modalCloseText:{fontSize:18,color:"white"},modalTitle:{fontSize:18,fontWeight:"bold",marginLeft:10},modalContent:{flex:1,backgroundColor:"background"}});function F(e){var n=e.scope,o=r.Utils.nvl(n.getValue(),!1),a=t.useState(o),s=a[1];return l.jsx(i.Switch,{value:a[0],style:n.getStyle("element"),onValueChange:function(e){n.changeValue(e),s(e)}})}function P(e){var n=e.scope,i=r.Utils.nvl(n.getValue(),0),o=t.useState(i),a=o[0],c=o[1],u=n.attr("step",1),d=n.attr("min",0),p=n.attr("min",100),f=function(e){var t=r.ComponentUtils.getViewScope();if(n.original.debug&&console.log(t),t){var i,l=t.get("scrollRef");l&&(null==(i=l.current)||null==i.setNativeProps||i.setNativeProps({scrollEnabled:e}))}};return l.jsx(l.Fragment,{children:l.jsx(s,{minimumValue:d,maximumValue:p,step:u,minimumTrackTintColor:"#1EB1FC",maximumTrackTintColor:"#d3d3d3",thumbTintColor:"#1EB1FC",value:a,onSlidingStart:function(){return f(!1)},onSlidingComplete:function(){return f(!0)},style:x({width:"100%",height:40},n.getStyle("element")),onValueChange:function(e){e=r.Utils.nvl(e,0),console.log(e),n.changeValue(e),c(e)}})})}function z(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:L.link,children:"Clique aqui para acessar o React Native"})})}var L={link:{}};function R(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:E.link,children:"Clique aqui para acessar o React Native"})})}var E={link:{}};function D(e){var n=e.scope,o=r.Utils.call((function(){var e=r.Utils.nvl(n.getValue(),"");return e&&null!=e&&e.push?e.join(", ").trim():e})),s=n.getLabel(),c=n.getPart("placeholder",null,s),u=n.original,d=n.original,p=t.useState(80),f=p[0],g=p[1],h=t.useState(o),y=h[0],m=h[1],v=function(e,t){return x({},n.getStyle(e,x({},W[e],t)))},j=function(){var e=u.icon;return l.jsx(l.Fragment,e?"string"==typeof e?{children:u.icon&&l.jsx(a.Ionicons,{name:u.icon,size:n.attr("iconSize",20),color:n.attr("iconColor","#888")})}:{children:e}:{})},b=n.getPart("type",null,"text"),S={textarea:{multiline:!0,autoHeight:!1!==d.autoHeight,textAlignVertical:"top",numberOfLines:5,style:{height:Math.max(80,f)},baseStyle:{paddingVertical:10}}},w=d.size,C=x({},r.Utils.nvl(S[b],{}),d.inputProps),U=r.Utils.call((function(){var e={};return"small"===w&&(e.fontSize=12),e.fontSize=r.Utils.nvl(d.fontSize,e.fontSize),(e=x({},v(b),v("input",e))).lineHeight=parseInt(e.fontSize)+2,e}));C.autoHeight&&(C.onContentSizeChange=function(e){g(e.nativeEvent.contentSize.height)},U=x({},U,C.style));var T=r.Utils.call((function(){var e=x({},v("base",null==C?void 0:C.baseStyle));return e.height=40,"small"===w&&(e.height=30),e}));return l.jsxs(l.Fragment,{children:[l.jsxs(i.View,{style:x({},T),children:[n.getPart("left"),l.jsx(i.TextInput,x({onChangeText:function(e){e=n.changeValue(e),m(e)},value:y,placeholder:c},C,{style:U})),l.jsx(j,{})]}),n.getPart("right")]})}var W=i.StyleSheet.create({base:{flex:1,width:"100%",paddingBottom:0,paddingTop:0,alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:5,paddingHorizontal:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10},icon:{marginRight:10},input:{marginHorizontal:0,marginVertical:0,width:"100%",flex:1},textarea:{marginHorizontal:0,marginVertical:0,width:"100%",height:"auto",alignSelf:"stretch",flex:1}});function B(e){var n,o=e.scope,a=e.index,s=o.original,c=e.item,u=o.getPart("cols",void 0,-1),d=Math.floor(100/u)+"%",p=null==(n={repeat:H,list:q})?void 0:n[s.type],f=""+o.key("row",a,""),g=t.useState(r.ScopeUtils.create(x({},s,{parent:o,name:f,crud:o.crud,index:a,type:"row",data:c})))[0],y=t.useRef(null),m=function(e,n){var r=t.useState(!0===n.visible),l=r[0],o=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 a=window.innerHeight,s=r.top<a&&r.bottom>0;s&&(n.visible=s),o(s)}}else null==e.current.measureInWindow||e.current.measureInWindow((function(e,t,r,l){var a=t<i.Dimensions.get("window").height&&t+l>0;a&&(n.visible=a),o(a)}))}),300);return function(){return clearInterval(t)}}),[e]),l}(y,g),v=function(){return l.jsx(l.Fragment,!m&&s.useIsInView&&!g.visible&&a>20?{}:{children:l.jsx(h,{transient:!0,scope:g,crud:g.crud,children:e.children})})};return l.jsx((function(){var e=t.useState(0),n=e[0],r=e[1],f=o.key("item");g.selected=g.getPart("isSelectedRow",void 0,!1);var h=function(){var e=g.getStyle("row",x({},p.row,{minHeight:30}));return e=x({},e,g.getStyle(g.selected?"rowSelected":"rowUnSelected",{})),u>0&&(e.width=d),e};return g.update=function(){o.updateIndex=o.updateIndex+1,r(++n)},!1===g.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){g.call("click",{value:e,item:e,edit:!0,index:a})}(c)},children:l.jsx(v,{})},f):l.jsx(i.View,{style:h(),ref:y,children:l.jsx(v,{})},f)}),{})}var q=i.StyleSheet.create({row:{padding:5,margin:0,width:"100%",backgroundColor:"background",gap:10,borderRadius:8,justifyContent:"center"}}),H=i.StyleSheet.create({row:{padding:0,width:"100%",justifyContent:"center"}});function O(e){var n,o=e.scope,s=o.crud,c=o.original,u=r.Utils.nvl(o.getPart("cols",void 0,1)),d=null==(n={repeat:A,list:N})?void 0:n[c.type],p=r.ComponentUtils.getDefine(e,"add"),f=c.hideAddWhenEmpty,g=c.hideEmpty,h=function(){var n=t.useState(o.updateIndex),a=n[0],g=n[1],h=o.attr("empty","Sem registro");o.update=function(){o.updateIndex=++a,g(a)};var y,m=r.Utils.call((function(){var e,t=r.Utils.nvl(o.getItems(),[]);if(!1!==c.search&&(null==(e=c.list)||!e.url)){var n=s.get("query","").toLowerCase().trim();if(n.length>1){var i=[],l=r.Utils.nvl(c.filterBy,"label");return r.Utils.each(t,(function(e){var t=r.Utils.getValue(l,"none",e).toLowerCase();t&&t.includes(n)&&i.push(e)})),i}}return t})),v=r.Utils.isEmpty(m),j=function(){return v&&h?"string"==typeof h?l.jsx(i.Text,{style:o.getStyle("empty",{flex:1,fontWeight:400,fontSize:18,padding:10,textAlign:"center",width:"100%",justifyContent:"center",alignItems:"center"}),children:h}):l.jsx(l.Fragment,{children:h}):l.jsx(l.Fragment,{})};return!1===h&&v?l.jsx(l.Fragment,{}):l.jsxs(i.View,{style:(y=o.getStyle("container",x({},{},d.container)),u>1&&(y=x({},y,{flexDirection:"row",flexWrap:"wrap"})),y),children:[l.jsx(j,{}),m.map((function(t,n){return l.jsx(B,{index:n,item:t,scope:o,children:e.children})})),(!v||!0!==f)&&l.jsx(l.Fragment,{children:p})]})},y=r.Utils.nvl(o.getItems(),[]);return g&&r.Utils.isEmpty(y)?l.jsx(l.Fragment,{}):l.jsxs(l.Fragment,{children:[!1!==c.search&&l.jsx(ue.Text,{placeholder:"Pesquisar...",field:"query",crud:s,style:{marginBottom:10},change:{action:function(){o.search()}},icon:l.jsx(a.Ionicons,{name:"search",size:20,color:"#888"})}),l.jsx(h,{})]})}var N=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}}),A=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}});function M(e){var n=e.scope,o=r.Utils.nvl(n.getOptions(),[]),a=n.getInputValue(),s=t.useState(0),c=s[0],u=s[1],d=function(e){return(null==e?void 0:e.value)===a},p=function(t){var o=t.item,a=t.index,s=d(o),c=x({},G.text,n.getStyle("text"));return s&&(c.color="#ffffff"),r.Utils.isEmpty(e.children)?l.jsx(i.Text,{style:c,children:o.label}):l.jsx(B,{scope:n,item:o.object,index:a,children:e.children})},f=function(e){var t=x({},G.item,n.getStyle("item")),r=Math.floor(100/o.length)+"%";if(d(e)){var i=n.getPart("selectedColor",void 0,"primary");(t=x({},t,n.getStyle("selected",{backgroundColor:i,color:"#ffffff"}))).color||(t.color="#ffffff");var l=e.color;e.backgroundColor&&(t=x({},t,{backgroundColor:e.backgroundColor})),e.color&&(t=x({},t,{color:l}))}else t.backgroundColor="#fff",t.color="#000";return t.width=r,t};return l.jsx(i.View,{style:x({},G.container,n.getStyle("items")),children:o.map((function(e,t){return l.jsx(i.TouchableHighlight,{style:f(e),onPress:function(t){!function(e){n.changeValue(e.object),u(++c)}(e)},children:l.jsx(p,{item:e,index:t})},"k-"+t)}))})}var G=i.StyleSheet.create({container:{flex:1,width:"100%",justifyContent:"center",flexDirection:"row",alignItems:"center",margin:3,gap:5},item:{backgroundColor:"background",justifyContent:"center",alignItems:"center",width:"auto",flexDirection:"row",flex:1,padding:5,borderRadius:2},text:{fontSize:13,fontWeight:"400"}});function _(e){var n=e.scope,o=n.original,s=t.useState(0),c=s[0],u=s[1],d=n.getValue(0),p=o.color;p||(p="primary");var f={padding:0,alignItems:"center",height:30,width:30,textAlign:"center",verticalAling:"middle",borderRadius:24,backgroundColor:p,color:"#ffffff",justifyContent:"center"},g={buttonLabel:{color:"#ffffff",fontWeight:"500",fontSize:16},value:{flex:1,flexDirection:"row",textAlign:"center",fontWeight:"500"},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center"},buttonIcon:{color:"#fff",fontSize:18},button:f,addButton:x({},f),delButton:x({},f)},h=function(e){n.changeValue(d+e),u(++c)},y=function(e,t){var r=x({},g[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(a.Ionicons,{size:30,style:y("buttonIcon"),name:"remove"})}),l.jsx(i.Text,{style:y("value"),children:r.Utils.nvl(d,0)}),l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){h(1)},style:y("addButton"),children:l.jsx(a.Ionicons,{size:30,style:y("buttonIcon"),name:"add"})})]})}function K(){var e={success:function(e){return l.jsx(c.BaseToast,x({},e,{style:t.darkToast,contentContainerStyle:{paddingHorizontal:15},text1Style:t.text,text2Style:t.text}))},error:function(e){return l.jsx(c.ErrorToast,x({},e,{style:t.darkToast,text1Style:t.text,text2Style:t.text}))},info:function(e){return l.jsx(c.BaseToast,x({},e,{style:t.darkToast,text1Style:t.text,text2Style:t.text}))}},t=i.StyleSheet.create({darkToast:{backgroundColor:"rgba(34, 34, 34, 0.85)",borderLeftColor:"#222"},text:{color:"#fff",textAlign:"center"}});return l.jsx(u,{config:e})}function Q(e){var n,a=t.useRef(null),s=e.scope,c=t.useState(0),u=c[0],p=c[1],f=s.currentDialog,g=null==f?void 0:f.crud;if(!f)return l.jsx(l.Fragment,{});f.update=function(){p(++u)},f.debug&&console.log(f);var y=f.scope,m=y.getLabel(),v=y.getTheme(),j=r.Utils.nvl(null==(n=v.styles)||null==(n=n.defaults)?void 0:n.header,{}),b=r.ComponentUtils.getDefine(e,"header","right"),S=r.ComponentUtils.getDefine(e,"bottom"),w=function(e,t){var n=x({},J[e],t);return x({},y.getStyle(e,n))},C=function(){y.close({scope:y,crud:null==f?void 0:f.crud,event:{}})};y.put("scrollRef",a);var U=s.original;r.ComponentUtils.setViewScope(y);var T=r.Utils.nvl(j.color,"white"),V={color:T},I=g.name+"-"+u,k=function(e){var t=e.children,n=y.part("disableScroll",!1);return y.part("disableContent",!1)?l.jsx(l.Fragment,{children:t}):n?l.jsx(i.View,{style:w("modalContent"),children:t}):l.jsx(i.ScrollView,{contentContainerStyle:{flexGrow:1,paddingBottom:50},style:w("modalContent"),nestedScrollEnabled:!0,ref:a,children:t})};return l.jsx((function(e){var t=e.children;return U.gesture?l.jsx(d.GestureHandlerRootView,{style:{flex:1},children:t}):l.jsx(l.Fragment,{children:t})}),{children:l.jsx(i.Modal,{animationType:"slide",transparent:!0,visible:!0,onRequestClose:C,children:l.jsx((function(){var t=l.jsx((function(){return null!=f&&f.component?l.jsx(f.component,x({crud:g},f.props),g.uuid):l.jsx(h,{scope:y,crud:g,children:e.children})}),{});return U.transient?l.jsx(i.View,{style:w("modalSafe"),children:t}):l.jsxs(l.Fragment,{children:[l.jsx(i.SafeAreaView,{style:w("modalTop")}),l.jsxs(i.SafeAreaView,{style:w("modalSafe"),children:[l.jsxs(i.View,{style:y.getStyle("header",j),children:[l.jsx(i.TouchableOpacity,{onPress:C,style:w("modalCloseButton"),children:l.jsx(o,{name:"chevron-back-outline",size:24,color:T,style:w("modalCloseText",V)})}),l.jsx(i.Text,{style:w("modalTitle",V),children:m}),!r.Utils.isEmpty(b)&&l.jsx(h,{scope:y,crud:g,transient:!0,children:b})]}),l.jsx(k,{children:t}),S]}),l.jsx(K,{})]})}),{})},I)})}var J=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:22,fontWeight:600,marginLeft:10},modalContent:{flex:1,backgroundColor:"background",paddingLeft:15,paddingRight:15,paddingTop:10,paddingBottom:10}});function X(e){var t,n,o=e.scope,a=o.getTheme(),s=o.getPart("header",null,[]),c=r.Utils.nvl(null==(t=a.styles)||null==(t=t.defaults)?void 0:t.header,{}),u=r.Utils.nvl(null==(n=a.styles)||null==(n=n.defaults)?void 0:n.headerText,{}),d=r.Utils.call((function(){var e=o.getStyle("header",c),t=e.backgroundColor;return t&&(e.color=r.HtmlUtils.getTextColor(t)),e})),p=!r.Utils.isEmpty(s);return l.jsx(l.Fragment,{children:p&&l.jsx(i.View,{style:d,children:l.jsx((function(){return"string"==typeof s?l.jsx(i.Text,{style:u,children:s}):l.jsx(l.Fragment,{children:s})}),{})})})}function Y(e){var n=e.scope,o=e.children,a=t.useRef(null),s=n.original,c=function(){var e=r.ViewUtils.getCrud();r.Utils.each(e.scroll,(function(e){e.onScroll&&e.onScroll.call(e)}))};n.put("scrollRef",a),r.ComponentUtils.setViewScope(n);var u=function(){return!1===s.scroll?l.jsx(h,{scope:n,children:o}):l.jsx(i.View,{style:n.getStyle("container",Z.container),children:l.jsx(i.ScrollView,{onScroll:c,scrollEventThrottle:16,ref:a,nestedScrollEnabled:!0,keyboardShouldPersistTaps:"handled",contentContainerStyle:n.getStyle("contentContainer",{paddingBottom:50}),style:n.getStyle("scroll",Z.scroll),children:l.jsx(h,{scope:n,children:o})})})};return l.jsxs(l.Fragment,{children:[l.jsx(X,{scope:n}),l.jsx(u,{}),l.jsx(K,{})]})}var Z=i.StyleSheet.create({scroll:{paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},container:{},view:{}});function $(e){var n=e.scope,o=n.crud,s=n.original,c=(r.Utils.nvl(n.getPart("cols",void 0,1)),r.Utils.call((function(){var e,t=r.Utils.nvl(n.getItems(),[]);if(s.search&&(null==(e=s.list)||!e.url)){var i=o.get("query","").toLowerCase().trim();if(i.length>1){var l=[],a=r.Utils.nvl(s.filterBy,"label");return r.Utils.each(t,(function(e){var t=e[a];t&&t.includes(i)&&l.push(e)})),l}}return t}))),u=function(o){var c=o.item,u=o.drag,d=o.isActive,f=(0,o.getIndex)(),g=""+n.key("row",f,""),y=t.useState(r.ScopeUtils.create(x({},s,{parent:n,name:g,crud:n.crud,index:f,type:"row",data:c})))[0],m=x({},n.getStyle("row"));d&&(m=x({},m,n.getStyle("active"))),m=x({},m,y.getStyle(d?"rowSelected":"rowUnSelected",{}));var v=function(){return r.Utils.isEmpty(e.children)?l.jsxs(l.Fragment,{children:[l.jsx(a.MaterialCommunityIcons,{name:"drag",size:24,color:"black"}),l.jsx(i.Text,{style:ee.text,children:n.getItemLabel(c)})]}):l.jsx(l.Fragment,{children:l.jsx(h,{transient:!0,scope:y,crud:y.crud,children:e.children})})};return l.jsx(p.ScaleDecorator,{children:l.jsx(i.TouchableOpacity,{style:[ee.row,{backgroundColor:d?"lightblue":"white"},x({},m)],delayLongPress:100,onLongPress:u,children:l.jsx(v,{})})})},g=function(e){var t=e.pos;return r.Utils.nvl(s.headerPos,"outer")!==t?l.jsx(l.Fragment,{}):l.jsx(X,{scope:n})},y=function(){var e=t.useState(c),r=e[1];return l.jsx(f,{data:e[0],ListHeaderComponent:l.jsx(g,{pos:"inner"}),ListFooterComponent:l.jsx(l.Fragment,{children:n.getPart("footer")}),renderItem:u,containerStyle:x({},n.getStyle("list")),keyExtractor:function(e){var t=n.getItemValue(e);return null!=s&&s.debug&&console.log(t),t},onDragEnd:function(e){var t=e.data;r(t),n.changeValue(t)}})};return l.jsxs((function(e){var t=e.children;return!1!==s.gesture?l.jsx(d.GestureHandlerRootView,{style:x({flex:1,width:"100%"},n.getStyle("order",{justifyContent:"flex-start"})),children:t}):l.jsx(l.Fragment,{children:t})}),{children:[l.jsx(g,{pos:"outer"}),l.jsx(y,{})]})}var ee=i.StyleSheet.create({row:{flexDirection:"row",gap:10,padding:15,borderBottomWidth:1,borderBottomColor:"#ccc"},text:{fontSize:18}}),te=t.createContext({});function ne(e){var n,o,s=this,c=t.useContext(te),d=r.Utils.nvl(e.theme,null==c?void 0:c.theme),p=r.Utils.nvl(e.crud,null==c?void 0:c.crud),f=t.useState(r.ScopeUtils.create(x({crud:p},e,{theme:d})))[0],g=t.useState(0),y=g[0],j=g[1],b=t.useState(null),C=b[0],T=b[1];f.compile(e),p=f.crud;var k=f.getOptions(),L=f.original,E=t.useRef(null);f.update=function(){j(++y)},f.updateElement=function(){j(++y)},f.toast=function(e,t,n){void 0===t&&(t="info"),u.show(x({type:t,text1:e,position:"bottom",visibilityTime:3e3},n))},f.prompt=function(e){var t=e.event;if(t){var n="Você tem certeza que deseja continuar?",l="Atenção",o=t.prompt;"string"==typeof o&&(n=o),"object"==typeof o&&(n=r.Utils.nvl(o.message,n),l=r.Utils.nvl(o.title,l)),i.Alert.alert(l,n,[{text:"Cancelar",style:"cancel"},{text:"Confirmar",onPress:function(){return f.execute(e)}}],{cancelable:!1})}};var W=function(){var e=L.custom;return e?l.jsx(ne,"string"==typeof e?{element:{value:e,type:"dummy"},crud:p}:x({type:e.type,tag:e.type},e.props,{crud:p})):l.jsx(l.Fragment,{})};if(f.is("type","dummy"))return l.jsx(l.Fragment,{children:f.getDisplayValue()});var B=function(){var e=f.getValue();q({target:{value:!(!0===e)}})},q=function(e){var t=e.target.value;f.isType("integer","int","number")?t=parseInt(t):f.isType("decimal")&&(t=parseFloat(t)),f.isType("select","complete")&&(t=f.getSelectedItem(t)),f.changeValue(t),f.update()},H=function(e){var t;null!=(t=f.currentDialog)&&t.component||f.call("click")},N={scope:f,crud:p,onChange:q};f.isType("password")&&(N.type="password");var A=function(){return!(f.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},G=f.is("type","text","textarea","number","integer","int","phone","postalCode","money","password","email"),K=function(e,t){var n,i=r.Utils.nvl(L.type,"none"),l=r.Utils.nvl(e,"root"),o=x({},oe[l]),a=A();return i=r.Utils.nvl(L.layout,i),e||a||(o=x({},o)),f.isInput()&&(o=x({},o,le.input[l])),o=x({},o,null==le||null==(n=le[i])?void 0:n[l]),a&&e&&(o=x({},o,ae[e])),x({},o,f.getStyle(e,x({},o,t)))},J=K("element"),X={required:f.isRequired(),size:"small",scope:f,crud:p,style:J,placeholder:f.attr("placeholder","Digite aqui")};f.error=function(e){C=e,T(e)},null!=(n=L.list)&&n.url||null!=(o=L.load)&&o.url||f.start(),t.useEffect((function(){f.start()}));var Z=function(){return"string"==typeof L.icon?l.jsx(a.Ionicons,{name:L.icon,style:f.getStyle("icon")}):l.jsx(l.Fragment,{children:L.icon})};if(f.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=E&&E.current&&f.is("type","card","list","tabs","stepper")){var e=null==E?void 0:E.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!f.isRendered()||f.is("type","define"))return l.jsx(l.Fragment,{});var ee=!f.isType("input","grid","list","order","repeat")&&L.click,ie={};ee&&(ie.underlayColor="transparent",ie.onPress=H);var se=function(e){var t=i.View;return ee&&(t=i.TouchableHighlight),f.isType("dialog","order")||L.transient?l.jsx(l.Fragment,{children:e.children}):l.jsx(t,x({},e))},ce=function(){return l.jsxs(l.Fragment,{children:[f.getPart("render",null,l.jsx(l.Fragment,{})),f.is("type","button")&&l.jsxs(V,x({},X,{onClick:H,variant:f.attr("variant","outlined"),children:[L.icon&&l.jsx(Z,{}),L.label&&l.jsx(i.Text,{style:f.getPart("label","button"),children:f.getLabel()})]})),f.is("type","icon")&&l.jsx(U,x({},X,{onClick:H,variant:f.attr("variant","outlined"),children:f.getDisplayValue()})),f.is("type","link")&&l.jsxs(w,x({},X,{onClick:H,variant:f.attr("variant","outlined"),children:[L.icon&&l.jsx(Z,{}),L.label&&l.jsx(i.Text,{style:f.getPart("label","link"),children:f.getLabel()})]})),G&&l.jsx(D,x({},N,X,{InputProps:x({},L.inputProps)})),f.is("type","complete","autocomplete")&&l.jsx(S,{scope:f,defaultsInput:N,defaultsUI:X}),f.is("type","quantity")&&l.jsx(_,{scope:f,defaultsInput:N,defaultsUI:X}),f.is("type","checkbox","boolean","switch")&&l.jsx(F,x({checked:!0===f.getValue()},N,{onChange:B})),f.isType("slider")&&l.jsx(P,x({},N,{onChange:B})),f.is("type","select")&&l.jsx(I,x({},N,X,{value:f.getSelectedValue()})),f.is("type","toggle")&&l.jsx(M,x({},N,X,{value:f.getSelectedValue()})),f.is("type","radio")&&l.jsx(R,x({},N,X,{row:!0,children:k.map((function(e,t){return l.jsx(z,{control:l.jsx(R,x({},X)),label:e.label,value:e.value},"i"+t)}))})),f.is("type","custom")&&l.jsx(W,{}),f.is("type","column")&&l.jsxs(l.Fragment,{children:[f.is("format","img")&&l.jsx(i.Image,{source:f.getDisplayValue()}),f.is("format","icon")&&l.jsx(U,{scope:f,crud:p}),!f.is("format","icon","img")&&l.jsx(i.Text,{children:f.getDisplayValue()})]}),f.is("type","output","value")&&l.jsx(i.Text,{style:K("value"),children:f.getDisplayValue()})]})},ue=function(t){var n=t.name,i=t.style;if(e[n]){var o=r.ComponentUtils.getDefine(e,n);if(!r.Utils.isEmpty(o))return l.jsx(h,x({},e,{scope:f,crud:p,style:K(n,i),children:o}))}return l.jsx(l.Fragment,{})},de=function(){return l.jsxs(l.Fragment,{children:[void 0!==L.label&&!1!==L.label&&!f.isType("button","dialog","modal")&&l.jsxs(i.View,{style:K("outerLabel",{alignSelf:"flex-start",flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}),children:[l.jsx(i.Text,{style:K("label"),children:f.getLabel()}),l.jsx(ue,{name:"actions",style:{width:"auto"}})]}),!A()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:K("inner"),children:l.jsx(ce,{})}),C&&l.jsx(i.View,{style:K("error",{fontSize:12,paddingTop:4,color:"#e55b5b"}),children:C})]}),f.isType("list","repeat")&&l.jsx(O,x({},e,{scope:f,crud:p})),f.isType("order")&&l.jsx($,x({},e,{scope:f,crud:p})),f.isType("chart")&&l.jsx(v,x({},e,{scope:f,crud:p})),f.isType("tabs")&&l.jsx(m,x({},e,{scope:f,crud:p})),f.isType("view")&&l.jsx(Y,x({},e,{scope:f,crud:p})),!f.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(h,x({},e,{scope:f,crud:p,style:K("inner")})),l.jsx(Q,x({},e,{scope:f,crud:p}))]})},pe=function(e){var t=f.is("type|layout","card");if(f.isType("list")){var n=f.getPart("empty",null,void 0),o=f.getItems();!1===n&&r.Utils.isEmpty(o)&&(t=!1)}if(t){var a=x({},K("box",x({},re.box,{alignSelf:"stretch"}))),s=L.boxBorder;return(s||0===s)&&(!0===s&&(s=1),a=x({},a,{borderWidth:s})),l.jsx(i.View,{style:K("card",x({},a)),children:l.jsx(i.View,{style:K("boxInner",{paddingHorizontal:15,paddingVertical:10}),children:e.children})})}return f.isInput()||L.container?l.jsx(i.View,{style:K("container",{paddingVertical:5,width:"100%"}),children:e.children}):l.jsx(l.Fragment,{children:e.children})};if(f.dialogShow=function(e){var t,n=r.Utils.nvl(null==e?void 0:e.event,{});null!=n&&n.debug&&console.log(e);var i=e.caller,l=r.ViewUtils.getCrud("view"),o=l.dialog,a=e.crud,c=f.getName("modal"),u=!0===e.edit,d={},p=null,g=null==n?void 0:n.component,h=r.Utils.nvl(null==i?void 0:i.original,L);a.is("row")?(d.parent=a.parent.parent,d.search=a.parent,p=a.data):a.is("search")&&(d.parent=a.parent,d.search=a);var y=a.data,m=r.Utils.nvl(n.data,n.send);"function"==typeof m&&(m=m.call(s,e)),!1!==n.send&&!1!==n.data||(y={});var v=r.Utils.nvl(m,e.item,p,y,{}),j=r.CrudUtils.create("dialog",x({parent:a,root:a,name:c,data:v,edit:u,scope:f},d)),b={label:h.label,icon:h.icon,type:"dialog"},S=null==(t=n.dialog)?void 0:t.close;"object"==typeof n.dialog&&(b=x({},b,n.dialog)),n.header&&(b.header=n.header),n.label&&(b.label=n.label),n.title&&(b.title=n.title);var w=r.Utils.nvl(b.title,b.label);b.label=w;var C={crud:j,label:w,parent:o,component:g,scope:r.ScopeUtils.create(x({parent:f,crud:j},b,{owner:f})),close:S,props:n.props,debug:n.debug};l.dialog=C,f.currentDialog=C,o&&(null==o.update||o.update()),f.update()},f.dialogHide=function(e){var t,n,i=r.ViewUtils.getCrud("view"),l=i.dialog,o=r.Utils.nvl(l.parent,null);i.dialog=o,f.currentDialog=o;var a=null==o||null==(t=o.scope)?void 0:t.parent,s=null==l||null==(n=l.scope)?void 0:n.parent;if(s){var c=l.close;s.update(),c&&(null!=c&&c.debug&&console.log("Fechando"),l.scope.call("close",{close:c}))}a&&a.update()},L.hideEmpty&&!f.isType("list","select","complete")){var fe=f.getValue();if(r.Utils.isEmpty(fe))return l.jsx(l.Fragment,{})}return l.jsx(te.Provider,{value:{crud:p,theme:d},children:l.jsx(se,x({ref:E,style:K()},ie,{children:l.jsx(pe,{children:l.jsx(de,{})})}))})}var re=i.StyleSheet.create({box:{borderWidth:1,borderColor:"#dedede",borderStyle:"solid",backgroundColor:"white",borderRadius:12,width:"100%",shadowColor:"#000",shadowOpacity:.1,shadowRadius:4}}),ie=x({},re.box),le={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}}};le.input=i.StyleSheet.create({label:{paddingLeft:0},inner:{flex:1,width:"100%",padding:0,gap:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),le.quantity={inner:x({},ie,{backgroundColor:"primarySoft",fontWeight:600,fontSize:16,borderRadius:25,borderWidth:0,paddingHorizontal:5,paddingVertical:5,flexWrap:"nowrap",flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"})},le.toggle=i.StyleSheet.create({root:{height:"auto"},inner:x({},ie,{flex:1,width:"100%",gap:10,borderRadius:2,justifyContent:"center",flexDirection:"row",alignSelf:"flex-start",flexWrap:"nowrap"})});var oe=i.StyleSheet.create({root:{gap:5,flexDirection:"column",flexWrap:"wrap",width:"100%",alignItems:"flex-start"},label:{fontWeight:600,fontSize:12,paddingVertical:3,color:"labelColor"},inner:{width:"100%"}}),ae=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function se(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,x({},t,{children:t.children}))}),x({},e.tagProps,{children:l.jsx(h,x({transient:!0},e,{scope:e.scope,crud:e.crud,part:e.name,children:t}))}))}var ce=["type"],ue={Order:function(e){return l.jsx(ne,x({},e,{type:"order"}))},List:function(e){return l.jsx(ne,x({},e,{type:"list"}))},Row:function(e){return l.jsx(ne,x({},e,{type:"row"}))},Value:function(e){return l.jsx(ne,x({},e,{type:"value"}))},Label:function(e){return l.jsx(ne,x({},e,{type:"label"}))},Repeat:function(e){return l.jsx(ne,x({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(ne,x({},e,{type:"define"}))},Include:function(e){return l.jsx(se,x({},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,ce);return l.jsx(ne,x({},t,{type:"column"}))},Input:function(e){return l.jsx(ne,x({},e))},Text:function(e){return l.jsx(ne,x({},e,{type:"text"}))},Textarea:function(e){return l.jsx(ne,x({},e,{type:"textarea"}))},Email:function(e){return l.jsx(ne,x({},e,{type:"email"}))},Button:function(e){return l.jsx(ne,x({},e,{type:"button"}))},Link:function(e){return l.jsx(ne,x({},e,{type:"link"}))},Icon:function(e){return l.jsx(ne,x({},e,{type:"icon"}))},Output:function(e){return l.jsx(ne,x({},e,{type:"output"}))},Form:function(e){return l.jsx(ne,x({},e,{type:"form"}))},Crud:function(e){return l.jsx(ne,x({},e,{type:"crud"}))},View:function(e){return l.jsx(ne,x({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(ne,x({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(ne,x({},e,{type:"dialog"}))},Content:function(e){return l.jsx(ne,x({},e,{type:"content"}))},Top:function(e){return l.jsx(ne,x({},e,{type:"top"}))},Card:function(e){return l.jsx(ne,x({},e,{type:"card"}))},Tab:function(e){return l.jsx(ne,x({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(ne,x({},e,{type:"tabs"}))},Step:function(e){return l.jsx(ne,x({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(ne,x({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(ne,x({},e,{type:"money"}))},Chart:function(e){return l.jsx(ne,x({},e,{type:"chart"}))},Password:function(e){return l.jsx(ne,x({},e,{type:"password"}))},Complete:function(e){return l.jsx(ne,x({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(ne,x({},e,{type:"switch"}))},Switch:function(e){return l.jsx(ne,x({},e,{type:"switch"}))},Radio:function(e){return l.jsx(ne,x({},e,{type:"radio"}))},Select:function(e){return l.jsx(ne,x({},e,{type:"select"}))},Toggle:function(e){return l.jsx(ne,x({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(ne,x({},e,{type:"entity"}))},Element:function(e){return l.jsx(ne,x({},e,{type:"element"}))},Quantity:function(e){return l.jsx(ne,x({},e,{type:"quantity"}))},Slider:function(e){return l.jsx(ne,x({},e,{type:"slider"}))},SafeView:function(e){var t,n=r.ThemeUtils.getCurrentTheme();return r.Utils.isEmpty(n)&&(n=r.useTheme()),l.jsx(g.SafeAreaProvider,{children:l.jsxs(g.SafeAreaView,{style:x({backgroundColor:null==(t=n.colors)?void 0:t.theme},e.viewStyle,{flex:1}),children:[l.jsx(i.StatusBar,{barStyle:"dark-content",backgroundColor:"#f5f5f5"}),l.jsx(i.KeyboardAvoidingView,{behavior:"ios"===i.Platform.OS?"padding":"height",style:{flex:1,justifyContent:"flex-start"},children:l.jsx(i.TouchableWithoutFeedback,{onPress:function(){"web"!==i.Platform.OS&&i.Keyboard.dismiss()},accessible:!1,children:l.jsx(l.Fragment,{children:e.children})})})]})})},GestureView:function(e){return l.jsx(d.GestureHandlerRootView,{style:{flex:1},children:e.children})}};exports.UI=ue;
2
2
  //# sourceMappingURL=react-crud-mobile.cjs.production.min.js.map