react-crud-mobile 1.3.376 → 1.3.377

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"),f=require("react-native-safe-area-context");function p(){return(p=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 g(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,f,x,v,y=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=p({},n.props);return delete c.children,"string"==typeof i?r.Utils.isEmpty(n.props.children)?l.jsx(i,p({},c)):l.jsx(i,p({},c,{children:l.jsx(g,p({transient:!0,validateScope:s},n.props,{scope:o,crud:a}))})):"function"==typeof i?l.jsx(i,p({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(g,p({validateScope:s},n.props,{scope:o,crud:a,transient:!0}))},m=function(){return l.jsx(l.Fragment,e.elements?{children:Object.entries(e.elements).map((function(e,t){return l.jsx(ee,p({crud:a},e[1]))}))}:{children:n.Children.map(e.children,(function(e){return l.jsx(y,{child:e})}))})};return e.transient?l.jsx(m,{}):r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements)?l.jsx(l.Fragment,{}):e.transient?l.jsx(m,{}):l.jsx(l.Fragment,{children:l.jsx(i.View,{style:(u=c,f=r.Utils.nvl(u,"root"),x=h[f],v={},r.Utils.isEmpty(e.style)||(null!=(d=e.style)&&d.push?r.Utils.each(e.style,(function(e){e&&(v=p({},v,e))})):v=p({},e.style)),p({},x,v,o.getStyle(u))),children:l.jsx(m,{})})})}var h=i.StyleSheet.create({child:{width:"100%"},inner:{width:"100%"}});function x(e){var i=e.scope,a=t.useState(0),s=a[0],c=a[1],u=i.original,d=i.getItems(),f=0,h=[],x=t.useState(null),v=x[0],y=x[1],m=function(e,t){void 0===t&&(t=!0),e&&i.execute({event:{validate:t,validateScope:u.validateScope,action:function(){i.changeValue(e.data),v=e,c(s=e.index),y(e)}}})},j=function(e){var t,n="ui-tabs-item ui-click";return(null==(t=v)?void 0:t.index)===e.index&&(n+=" ui-tab-selected"),n},b=function(e,t){var n=p({},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&&h.push(p({},o,{child:e,element:o,original:n,index:f++,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])})),v||m(h[s],!1);var S=function(e){m(h[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:h.map((function(e,t){return l.jsxs("div",{className:j(e),onClick:function(){m(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))}))}),v&&l.jsxs(l.Fragment,{children:[w&&l.jsx("div",{className:"ui-tabs-label",children:v.label}),l.jsx("div",{className:"ui-tabs-area",children:l.jsx(g,p({},e,{scope:i,children:v.child}))}),"stepper"===u.layout&&l.jsxs("div",{className:"ui-tabs-actions",children:[l.jsx(se.Output,{space:6,layout:"left",children:l.jsx(se.Include,p({},e,{transient:!0,name:"left",default:l.jsx(se.Button,{rendered:s>0,icon:l.jsx(o,{}),click:function(){S(-1)}})}))}),l.jsx(se.Output,{space:6,layout:"right",children:l.jsx(se.Include,p({},e,{transient:!0,name:"right",default:l.jsx(se.Button,{rendered:s<h.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 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){return l.jsx(l.Fragment,{children:l.jsx(y,p({},e.defaultsInput,e.defaultsUI))})}function b(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:S.link,children:"Clique aqui para acessar o React Native"})})}var S={link:{}};function w(e){var t,n=e.scope,i=n.getValue(),o={ion:a.Ionicons,ant:a.AntDesign,entypo:a.Entypo,evil:a.EvilIcons,material:a.MaterialCommunityIcons}[r.Utils.nvl(n.original.library,"ion")],s=n.getStyle("icon"),c=n.part("size",20),u=n.part("iconSize",c);return null!=(t=n.original)&&t.transient&&(s=p({},s,n.getStyle())),l.jsx(o,{size:u,name:i,style:s})}var C={small:{minWidth:30,height:30}};function U(e){var t=e.scope,n=t.original,o=r.Utils.nvl(n.size,"default"),a=r.Utils.nvl(n.align,"center"),s=r.Utils.nvl(n.variant,"default"),c=n.color,u=t.getLabel(),d=t.getPart("icon");c||(c="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:c,borderRadius:20,gap:10,justifyContent:"center",alignItems:"center",flexDirection:"row"}},g=function(e,n){var i=p({},f[e],n);return"text"!==s&&"outlined"!==s||(i.backgroundColor="transparent",i.color=r.Utils.nvl(c,"text")),"small"===o&&(i.fontSize=12,i.fontWeight=500),"medium"===o&&(i.fontSize=14,i.fontWeight=500),"left"===a&&(i.justifyContent="flex-start"),t.getStyle(e,i)},h={};h.button=d?{height:40,padding:0}:{height:50};var x=r.Utils.call((function(){var e=p({},null==h?void 0:h.button);"outlined"===s&&(e.borderWidth=1,e.borderColor=r.Utils.nvl(c,"text")),o&&(e=p({},e,C[o])),u||(e=p({},e,{borderRadius:20}));var t=g("button",e);if(!t.width){var n=t.height;"number"==typeof n&&(t.minWidth=n)}return t})),v=g("buttonLabel"),y=r.Utils.call((function(){var e=g("buttonIcon",h.icon);return e.fontSize=r.Utils.nvl(v.fontSize,e.fontSize),e}));return l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(e){t.call("click",{})},style:x,children:l.jsxs(l.Fragment,{children:[d&&l.jsx(l.Fragment,{children:l.jsx(se.Icon,{size:r.Utils.nvl(n.iconSize,30),style:y,value:d})}),u&&l.jsx(i.Text,{style:v,children:u})]})})}function T(e){var n,o,s=t.useState(!1),c=s[0],u=s[1],d=e.scope,f=d.original,g=r.Utils.nvl(d.getOptions(),[]),h=d.attr("placeholder","Selecione..."),x=d.getDisplayValue(),v=d.getTheme(),y=r.Utils.nvl(null==(n=v.styles)||null==(n=n.defaults)?void 0:n.header,{}),m=function(){u(!c)},j=t.useRef(null),b=r.Utils.nvl(null==(o=v.colors)?void 0:o.text,"#100e0e"),S=r.Utils.nvl(y.color,"white"),w={color:S},C=function(e,t){var n=p({},V[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,I=d.getPart("iconSize",null,T);return l.jsxs(i.View,{style:C("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:m,style:C("selectInput"),children:[l.jsx(i.Text,{style:U,children:r.Utils.nvl(x,h)}),l.jsx(a.Ionicons,{name:"chevron-down-outline",size:I,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",y),children:[l.jsx(i.TouchableOpacity,{onPress:m,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:h})]}),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(se.List,p({data:g,name:d.getName("list"),layout:"card",search:!0===f.search,click:function(e){var t=e.value;d.changeValue(f.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:p({paddingLeft:15,paddinRight:15},null==f?void 0:f.rowStyle)},null==f?void 0:f.listProps,{children:l.jsx(se.Value,{value:"#{@this.label}"})}))})})]})]})]},d.getName(d.getPart("modal")+"_"+c))}var V=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 I(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 k(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),f=n.attr("min",100),g=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:f,step:u,minimumTrackTintColor:"#1EB1FC",maximumTrackTintColor:"#d3d3d3",thumbTintColor:"#1EB1FC",value:a,onSlidingStart:function(){return g(!1)},onSlidingComplete:function(){return g(!0)},style:p({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:R.link,children:"Clique aqui para acessar o React Native"})})}var R={link:{}};function P(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:F.link,children:"Clique aqui para acessar o React Native"})})}var F={link:{}};function E(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,f=t.useState(80),g=f[0],h=f[1],x=t.useState(o),v=x[0],y=x[1],m=function(e,t){return p({},n.getStyle(e,p({},L[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,g)},baseStyle:{paddingVertical:10}}},w=p({},r.Utils.nvl(S[b],{}),d.inputProps),C=r.Utils.call((function(){var e={};return"small"===d.size&&(e.height=30,e.fontSize=12),e.fontSize=r.Utils.nvl(d.fontSize,e.fontSize),(e=p({},m("input"),m(b,e))).lineHeight=parseInt(e.fontSize)+2,e}));return w.autoHeight&&(w.onContentSizeChange=function(e){h(e.nativeEvent.contentSize.height)},C=p({},C,w.style)),l.jsxs(l.Fragment,{children:[l.jsxs(i.View,{style:m("base",null==w?void 0:w.baseStyle),children:[n.getPart("left"),l.jsx(i.TextInput,p({onChangeText:function(e){e=n.changeValue(e),y(e)},value:v,placeholder:c},w,{style:C})),l.jsx(j,{})]}),n.getPart("right")]})}var L=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,paddingVertical:0,height:40,width:"100%",flex:1},textarea:{marginHorizontal:0,marginVertical:0,paddingVertical:10,width:"100%",height:"auto",alignSelf:"stretch",flex:1}});function D(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)+"%",f=null==(n={repeat:q,list:W})?void 0:n[s.type],h=""+o.key("row",a,""),x=t.useState(r.ScopeUtils.create(p({},s,{parent:o,name:h,crud:o.crud,index:a,type:"row",data:c})))[0],v=t.useRef(null),y=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}(v,x),m=function(){return l.jsx(l.Fragment,!y&&s.useIsInView&&!x.visible&&a>20?{}:{children:l.jsx(g,{transient:!0,scope:x,crud:x.crud,children:e.children})})};return l.jsx((function(){var e=t.useState(0),n=e[0],r=e[1],g=o.key("item");x.selected=x.getPart("isSelectedRow",void 0,!1);var h=function(){var e=x.getStyle("row",p({},f.row,{minHeight:30}));return e=p({},e,x.getStyle(x.selected?"rowSelected":"rowUnSelected",{})),u>0&&(e.width=d),e};return x.update=function(){o.updateIndex=o.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:v,onPress:function(e){e.stopPropagation(),function(e){x.call("click",{value:e,item:e,edit:!0,index:a})}(c)},children:l.jsx(m,{})},g):l.jsx(i.View,{style:h(),ref:v,children:l.jsx(m,{})},g)}),{})}var W=i.StyleSheet.create({row:{padding:5,margin:0,width:"100%",backgroundColor:"background",gap:10,borderRadius:8,justifyContent:"center"}}),q=i.StyleSheet.create({row:{padding:0,width:"100%",justifyContent:"center"}});function B(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:H,list:O})?void 0:n[c.type],f=r.ComponentUtils.getDefine(e,"add"),g=c.hideAddWhenEmpty,h=c.hideEmpty,x=function(){var n=t.useState(o.updateIndex),a=n[0],h=n[1],x=o.attr("empty","Sem registro");o.update=function(){o.updateIndex=++a,h(a)};var v,y=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})),m=r.Utils.isEmpty(y),j=function(){return m&&x?"string"==typeof x?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:x}):l.jsx(l.Fragment,{children:x}):l.jsx(l.Fragment,{})};return!1===x&&m?l.jsx(l.Fragment,{}):l.jsxs(i.View,{style:(v=o.getStyle("container",p({},{},d.container)),u>1&&(v=p({},v,{flexDirection:"row",flexWrap:"wrap"})),v),children:[l.jsx(j,{}),y.map((function(t,n){return l.jsx(D,{index:n,item:t,scope:o,children:e.children})})),(!m||!0!==g)&&l.jsx(l.Fragment,{children:f})]})},v=r.Utils.nvl(o.getItems(),[]);return h&&r.Utils.isEmpty(v)?l.jsx(l.Fragment,{}):l.jsxs(l.Fragment,{children:[!1!==c.search&&l.jsx(se.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(x,{})]})}var O=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}}),H=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}});function N(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},f=function(t){var o=t.item,a=t.index,s=d(o),c=p({},A.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(D,{scope:n,item:o.object,index:a,children:e.children})},g=function(e){var t=p({},A.item,n.getStyle("item")),r=Math.floor(100/o.length)+"%";if(d(e)){var i=n.getPart("selectedColor",void 0,"primary");(t=p({},t,n.getStyle("selected",{backgroundColor:i,color:"#ffffff"}))).color||(t.color="#ffffff");var l=e.color;e.backgroundColor&&(t=p({},t,{backgroundColor:e.backgroundColor})),e.color&&(t=p({},t,{color:l}))}else t.backgroundColor="#fff",t.color="#000";return t.width=r,t};return l.jsx(i.View,{style:p({},A.container,n.getStyle("items")),children:o.map((function(e,t){return l.jsx(i.TouchableHighlight,{style:g(e),onPress:function(t){!function(e){n.changeValue(e.object),u(++c)}(e)},children:l.jsx(f,{item:e,index:t})},"k-"+t)}))})}var A=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 M(e){var n=e.scope,o=n.original,s=t.useState(0),c=s[0],u=s[1],d=n.getValue(0),f=o.color;f||(f="primary");var g={padding:0,alignItems:"center",height:30,width:30,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",fontWeight:"500"},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center"},buttonIcon:{color:"#fff",fontSize:18},button:g,addButton:p({},g),delButton:p({},g)},x=function(e){n.changeValue(d+e),u(++c)},v=function(e,t){var r=p({},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:v("delButton"),children:l.jsx(a.Ionicons,{size:30,style:v("buttonIcon"),name:"remove"})}),l.jsx(i.Text,{style:v("value"),children:r.Utils.nvl(d,0)}),l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){x(1)},style:v("addButton"),children:l.jsx(a.Ionicons,{size:30,style:v("buttonIcon"),name:"add"})})]})}function G(){var e={success:function(e){return l.jsx(c.BaseToast,p({},e,{style:t.darkToast,contentContainerStyle:{paddingHorizontal:15},text1Style:t.text,text2Style:t.text}))},error:function(e){return l.jsx(c.ErrorToast,p({},e,{style:t.darkToast,text1Style:t.text,text2Style:t.text}))},info:function(e){return l.jsx(c.BaseToast,p({},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 _(e){var n,a=t.useRef(null),s=e.scope,c=t.useState(0),u=c[0],f=c[1],h=s.currentDialog,x=null==h?void 0:h.crud;if(!h)return l.jsx(l.Fragment,{});h.update=function(){f(++u)},h.debug&&console.log(h);var v=h.scope,y=v.getLabel(),m=v.getTheme(),j=r.Utils.nvl(null==(n=m.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=p({},K[e],t);return p({},v.getStyle(e,n))},C=function(){v.close({scope:v,crud:null==h?void 0:h.crud,event:{}})};v.put("scrollRef",a);var U=s.original;r.ComponentUtils.setViewScope(v);var T=r.Utils.nvl(j.color,"white"),V={color:T},I=x.name+"-"+u,k=function(e){var t=e.children,n=v.part("disableScroll",!1);return v.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!=h&&h.component?l.jsx(h.component,p({crud:x},h.props),x.uuid):l.jsx(g,{scope:v,crud:x,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:v.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:y}),!r.Utils.isEmpty(b)&&l.jsx(g,{scope:v,crud:x,transient:!0,children:b})]}),l.jsx(k,{children:t}),S]}),l.jsx(G,{})]})}),{})},I)})}var K=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 Q(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})),f=!r.Utils.isEmpty(s);return l.jsx(l.Fragment,{children:f&&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 X(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(g,{scope:n,children:o}):l.jsx(i.View,{style:n.getStyle("container",Y.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",Y.scroll),children:l.jsx(g,{scope:n,children:o})})})};return l.jsxs(l.Fragment,{children:[l.jsx(Q,{scope:n}),l.jsx(u,{}),l.jsx(G,{})]})}var Y=i.StyleSheet.create({scroll:{paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},container:{},view:{}});function J(e){var n=e.scope,o=n.getOptions(),a=t.useState(o),s=a[0],c=a[1],u=t.useState(null),d=u[0],f=u[1],g=t.useRef(Object.fromEntries(o.map((function(e,t){return[e.value,new i.Animated.Value(70*t)]})))).current,h=t.useRef({}),x=t.useRef(null),v=t.useRef(-1),y=t.useRef(0),m=t.useRef(s);t.useEffect((function(){m.current=s}),[s]),t.useEffect((function(){s.forEach((function(e,t){g[e.value]||(g[e.value]=new i.Animated.Value(70*t)),i.Animated.spring(g[e.value],{toValue:70*t,useNativeDriver:!1}).start()}))}),[s]);var j=function(e){var t=[];r.Utils.each(e,(function(e){t.push(e.object)})),n.changeValue(t)};return s.forEach((function(e){var t;h.current[e.value]||(h.current[e.value]=(t=e,i.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(){var e=m.current;g[t.value]&&e.find((function(e){return e.value===t.value}))&&(x.current=t,v.current=e.findIndex((function(e){return e.value===t.value})),y.current=g[t.value]._value,f(t.value))},onPanResponderMove:function(e,n){var r=m.current;if(g[t.value]&&r.find((function(e){return e.value===t.value}))){var l=y.current+n.dy;g[t.value].setValue(l);var o=Math.max(0,Math.min(r.length-1,Math.floor((l+35)/70)));r.forEach((function(e,n){if(e.value!==t.value&&g[e.value]){var r=70*n;n>v.current&&n<=o?r=70*(n-1):n<v.current&&n>=o&&(r=70*(n+1)),i.Animated.timing(g[e.value],{toValue:r,duration:120,useNativeDriver:!1}).start()}}))}},onPanResponderRelease:function(){var e=x.current,t=m.current;if(e&&g[e.value]&&t.find((function(t){return t.value===e.value}))){var n=Math.max(0,Math.min(t.length-1,Math.floor((g[e.value]._value+35)/70))),r=v.current,i=[].concat(t),l=i.splice(r,1);i.splice(n,0,l[0]),c(i),j(i),f(null),x.current=null,v.current=-1}}})))})),l.jsxs(i.View,{style:Z.container,children:[l.jsx(i.Text,{style:Z.title,children:"Lista Dragável (Esperando que a correção final funcione 🙏)"}),l.jsx(i.View,{style:{height:70*s.length,width:"100%"},children:s.map((function(e){var t,n,r=g[e.value];if(!r)return null;var o=d===e.value;return l.jsxs(i.Animated.View,p({},null!=(t=null==(n=h.current[e.value])?void 0:n.panHandlers)?t:{},{style:[Z.item,{position:"absolute",left:0,right:0,height:62,transform:[{translateY:r}],zIndex:o?999:0,elevation:o?999:0}],children:[l.jsx(i.View,{style:Z.handle,children:l.jsx(i.Text,{style:Z.handleText,children:"≡"})}),l.jsx(i.Text,{style:Z.itemText,children:e.label}),l.jsx(i.TouchableOpacity,{onPress:function(){return d===(t=e.value)&&(f(null),x.current=null,v.current=-1),g[t]&&delete g[t],h.current[t]&&delete h.current[t],void c((function(e){var n=e.filter((function(e){return e.value!==t}));return n.forEach((function(e,t){g[e.value]&&i.Animated.spring(g[e.value],{toValue:70*t,useNativeDriver:!1}).start()})),j(n),n}));var t},style:Z.del,children:l.jsx(i.Text,{style:{color:"#fff"},children:"X"})})]}),e.value)}))})]})}var Z=i.StyleSheet.create({container:{flex:1,paddingHorizontal:20,backgroundColor:"#f5f7fb"},title:{fontSize:18,fontWeight:"600",marginBottom:12},item:{backgroundColor:"#fff",borderRadius:10,marginVertical:4,paddingHorizontal:12,alignItems:"center",flexDirection:"row",elevation:3,shadowColor:"#000",shadowOpacity:.05,shadowRadius:6},handle:{width:40,alignItems:"center",justifyContent:"center"},handleText:{fontSize:22,color:"#666"},itemText:{fontSize:16,flex:1},del:{backgroundColor:"#e74c3c",height:34,width:34,borderRadius:6,alignItems:"center",justifyContent:"center"}}),$=t.createContext({});function ee(e){var n,o,s=this,c=t.useContext($),d=r.Utils.nvl(e.theme,null==c?void 0:c.theme),f=r.Utils.nvl(e.crud,null==c?void 0:c.crud),h=t.useState(r.ScopeUtils.create(p({crud:f},e,{theme:d})))[0],y=t.useState(0),m=y[0],S=y[1],C=t.useState(null),V=C[0],R=C[1];h.compile(e),f=h.crud;var F=h.getOptions(),L=h.original,D=t.useRef(null);h.update=function(){S(++m)},h.updateElement=function(){S(++m)},h.toast=function(e,t,n){void 0===t&&(t="info"),u.show(p({type:t,text1:e,position:"bottom",visibilityTime:3e3},n))},h.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 h.execute(e)}}],{cancelable:!1})}};var W=function(){var e=L.custom;return e?l.jsx(ee,"string"==typeof e?{element:{value:e,type:"dummy"},crud:f}:p({type:e.type,tag:e.type},e.props,{crud:f})):l.jsx(l.Fragment,{})};if(h.is("type","dummy"))return l.jsx(l.Fragment,{children:h.getDisplayValue()});var q=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()},H=function(e){var t;null!=(t=h.currentDialog)&&t.component||h.call("click")},A={scope:h,crud:f,onChange:O};h.isType("password")&&(A.type="password");var G=function(){return!(h.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},K=h.is("type","text","textarea","number","integer","int","phone","postalCode","money","password","email"),Q=function(e,t){var n,i=r.Utils.nvl(L.type,"none"),l=r.Utils.nvl(e,"root"),o=p({},ie[l]),a=G();return i=r.Utils.nvl(L.layout,i),e||a||(o=p({},o)),h.isInput()&&(o=p({},o,re.input[l])),o=p({},o,null==re||null==(n=re[i])?void 0:n[l]),a&&e&&(o=p({},o,le[e])),p({},o,h.getStyle(e,p({},o,t)))},Y=Q("element"),Z={required:h.isRequired(),size:"small",scope:h,crud:f,style:Y,placeholder:h.attr("placeholder","Digite aqui")};h.error=function(e){V=e,R(e)},null!=(n=L.list)&&n.url||null!=(o=L.load)&&o.url||h.start(),t.useEffect((function(){h.start()}));var ne=function(){return"string"==typeof L.icon?l.jsx(a.Ionicons,{name:L.icon,style:h.getStyle("icon")}):l.jsx(l.Fragment,{children:L.icon})};if(h.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=D&&D.current&&h.is("type","card","list","tabs","stepper")){var e=null==D?void 0:D.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!h.isRendered()||h.is("type","define"))return l.jsx(l.Fragment,{});var oe=!h.isType("input","grid","list","order","repeat")&&L.click,ae={};oe&&(ae.underlayColor="transparent",ae.onPress=H);var se=function(e){var t=i.View;return oe&&(t=i.TouchableHighlight),h.isType("dialog","order")||L.transient?l.jsx(l.Fragment,{children:e.children}):l.jsx(t,p({},e))},ce=function(){return l.jsxs(l.Fragment,{children:[h.getPart("render",null,l.jsx(l.Fragment,{})),h.is("type","button")&&l.jsxs(U,p({},Z,{onClick:H,variant:h.attr("variant","outlined"),children:[L.icon&&l.jsx(ne,{}),L.label&&l.jsx(i.Text,{style:h.getPart("label","button"),children:h.getLabel()})]})),h.is("type","link")&&l.jsxs(b,p({},Z,{onClick:H,variant:h.attr("variant","outlined"),children:[L.icon&&l.jsx(ne,{}),L.label&&l.jsx(i.Text,{style:h.getPart("label","link"),children:h.getLabel()})]})),K&&l.jsx(E,p({},A,Z,{InputProps:p({},L.inputProps)})),h.is("type","complete","autocomplete")&&l.jsx(j,{scope:h,defaultsInput:A,defaultsUI:Z}),h.is("type","quantity")&&l.jsx(M,{scope:h,defaultsInput:A,defaultsUI:Z}),h.is("type","checkbox","boolean","switch")&&l.jsx(I,p({checked:!0===h.getValue()},A,{onChange:q})),h.isType("slider")&&l.jsx(k,p({},A,{onChange:q})),h.is("type","select")&&l.jsx(T,p({},A,Z,{value:h.getSelectedValue()})),h.is("type","toggle")&&l.jsx(N,p({},A,Z,{value:h.getSelectedValue()})),h.is("type","radio")&&l.jsx(P,p({},A,Z,{row:!0,children:F.map((function(e,t){return l.jsx(z,{control:l.jsx(P,p({},Z)),label:e.label,value:e.value},"i"+t)}))})),h.is("type","custom")&&l.jsx(W,{}),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(w,{scope:h,crud:f}),!h.is("format","icon","img")&&l.jsx(i.Text,{children:h.getDisplayValue()})]}),h.is("type","output","value")&&l.jsx(i.Text,{style:Q("value"),children:h.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(g,p({},e,{scope:h,crud:f,style:Q(n,i),children:o}))}return l.jsx(l.Fragment,{})},de=function(){return l.jsxs(l.Fragment,{children:[void 0!==L.label&&!1!==L.label&&!h.isType("button","dialog","modal")&&l.jsxs(i.View,{style:Q("outerLabel",{alignSelf:"flex-start",flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}),children:[l.jsx(i.Text,{style:Q("label"),children:h.getLabel()}),l.jsx(ue,{name:"actions",style:{width:"auto"}})]}),!h.isType("icon")&&!G()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:Q("inner"),children:l.jsx(ce,{})}),V&&l.jsx(i.View,{style:Q("error",{fontSize:12,paddingTop:4,color:"#e55b5b"}),children:V})]}),h.isType("list","repeat")&&l.jsx(B,p({},e,{scope:h,crud:f})),h.isType("order")&&l.jsx(J,p({},e,{scope:h,crud:f})),h.isType("chart")&&l.jsx(v,p({},e,{scope:h,crud:f})),h.isType("tabs")&&l.jsx(x,p({},e,{scope:h,crud:f})),h.isType("view")&&l.jsx(X,p({},e,{scope:h,crud:f})),h.is("type","icon")&&l.jsx(w,p({},Z,{onClick:H,variant:h.attr("variant","outlined"),children:h.getDisplayValue()})),!h.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(g,p({},e,{scope:h,crud:f,style:Q("inner")})),l.jsx(_,p({},e,{scope:h,crud:f}))]})},fe=function(e){var t=h.is("type|layout","card");if(h.isType("list")){var n=h.getPart("empty",null,void 0),o=h.getItems();!1===n&&r.Utils.isEmpty(o)&&(t=!1)}if(t){var a=p({},Q("box",p({},te.box,{alignSelf:"stretch"}))),s=L.boxBorder;return(s||0===s)&&(!0===s&&(s=1),a=p({},a,{borderWidth:s})),l.jsx(i.View,{style:Q("card",p({},a)),children:l.jsx(i.View,{style:Q("boxInner",{paddingHorizontal:15,paddingVertical:10}),children:e.children})})}return h.isInput()||L.container?l.jsx(i.View,{style:Q("container",{paddingVertical:5,width:"100%"}),children:e.children}):l.jsx(l.Fragment,{children:e.children})};if(h.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=h.getName("modal"),u=!0===e.edit,d={},f=null,g=null==n?void 0:n.component,x=r.Utils.nvl(null==i?void 0:i.original,L);a.is("row")?(d.parent=a.parent.parent,d.search=a.parent,f=a.data):a.is("search")&&(d.parent=a.parent,d.search=a);var v=a.data,y=r.Utils.nvl(n.data,n.send);"function"==typeof y&&(y=y.call(s,e)),!1!==n.send&&!1!==n.data||(v={});var m=r.Utils.nvl(y,e.item,f,v,{}),j=r.CrudUtils.create("dialog",p({parent:a,root:a,name:c,data:m,edit:u,scope:h},d)),b={label:x.label,icon:x.icon,type:"dialog"},S=null==(t=n.dialog)?void 0:t.close;"object"==typeof n.dialog&&(b=p({},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(p({parent:h,crud:j},b,{owner:h})),close:S,props:n.props,debug:n.debug};l.dialog=C,h.currentDialog=C,o&&(null==o.update||o.update()),h.update()},h.dialogHide=function(e){var t,n,i=r.ViewUtils.getCrud("view"),l=i.dialog,o=r.Utils.nvl(l.parent,null);i.dialog=o,h.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&&!h.isType("list","select","complete")){var pe=h.getValue();if(r.Utils.isEmpty(pe))return l.jsx(l.Fragment,{})}return l.jsx($.Provider,{value:{crud:f,theme:d},children:l.jsx(se,p({ref:D,style:Q()},ae,{children:l.jsx(fe,{children:l.jsx(de,{})})}))})}var te=i.StyleSheet.create({box:{borderWidth:1,borderColor:"#dedede",borderStyle:"solid",backgroundColor:"white",borderRadius:12,width:"100%",shadowColor:"#000",shadowOpacity:.1,shadowRadius:4}}),ne=p({},te.box),re={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}}};re.input=i.StyleSheet.create({label:{paddingLeft:0},inner:{flex:1,width:"100%",padding:0,gap:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),re.quantity={inner:p({},ne,{backgroundColor:"primarySoft",fontWeight:600,fontSize:16,borderRadius:25,borderWidth:0,paddingHorizontal:5,paddingVertical:5,flexWrap:"nowrap",flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"})},re.toggle=i.StyleSheet.create({root:{height:"auto"},inner:p({},ne,{flex:1,width:"100%",gap:10,borderRadius:2,justifyContent:"center",flexDirection:"row",alignSelf:"flex-start",flexWrap:"nowrap"})});var ie=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%",justifyContent:"space-between"}}),le=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function oe(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,p({},t,{children:t.children}))}),p({},e.tagProps,{children:l.jsx(g,p({transient:!0},e,{scope:e.scope,crud:e.crud,part:e.name,children:t}))}))}var ae=["type"],se={Order:function(e){return l.jsx(ee,p({},e,{type:"order"}))},List:function(e){return l.jsx(ee,p({},e,{type:"list"}))},Row:function(e){return l.jsx(ee,p({},e,{type:"row"}))},Value:function(e){return l.jsx(ee,p({},e,{type:"value"}))},Label:function(e){return l.jsx(ee,p({},e,{type:"label"}))},Repeat:function(e){return l.jsx(ee,p({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(ee,p({},e,{type:"define"}))},Include:function(e){return l.jsx(oe,p({},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,ae);return l.jsx(ee,p({},t,{type:"column"}))},Input:function(e){return l.jsx(ee,p({},e))},Text:function(e){return l.jsx(ee,p({},e,{type:"text"}))},Textarea:function(e){return l.jsx(ee,p({},e,{type:"textarea"}))},Email:function(e){return l.jsx(ee,p({},e,{type:"email"}))},Button:function(e){return l.jsx(ee,p({},e,{type:"button"}))},Link:function(e){return l.jsx(ee,p({},e,{type:"link"}))},Icon:function(e){return l.jsx(ee,p({},e,{type:"icon",transient:!0}))},Output:function(e){return l.jsx(ee,p({},e,{type:"output"}))},Form:function(e){return l.jsx(ee,p({},e,{type:"form"}))},Crud:function(e){return l.jsx(ee,p({},e,{type:"crud"}))},View:function(e){return l.jsx(ee,p({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(ee,p({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(ee,p({},e,{type:"dialog"}))},Content:function(e){return l.jsx(ee,p({},e,{type:"content"}))},Top:function(e){return l.jsx(ee,p({},e,{type:"top"}))},Card:function(e){return l.jsx(ee,p({},e,{type:"card"}))},Tab:function(e){return l.jsx(ee,p({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(ee,p({},e,{type:"tabs"}))},Step:function(e){return l.jsx(ee,p({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(ee,p({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(ee,p({},e,{type:"money"}))},Chart:function(e){return l.jsx(ee,p({},e,{type:"chart"}))},Password:function(e){return l.jsx(ee,p({},e,{type:"password"}))},Complete:function(e){return l.jsx(ee,p({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(ee,p({},e,{type:"switch"}))},Switch:function(e){return l.jsx(ee,p({},e,{type:"switch"}))},Radio:function(e){return l.jsx(ee,p({},e,{type:"radio"}))},Select:function(e){return l.jsx(ee,p({},e,{type:"select"}))},Toggle:function(e){return l.jsx(ee,p({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(ee,p({},e,{type:"entity"}))},Element:function(e){return l.jsx(ee,p({},e,{type:"element"}))},Quantity:function(e){return l.jsx(ee,p({},e,{type:"quantity"}))},Slider:function(e){return l.jsx(ee,p({},e,{type:"slider"}))},SafeView:function(e){var t,n=r.ThemeUtils.getCurrentTheme();return r.Utils.isEmpty(n)&&(n=r.useTheme()),l.jsx(f.SafeAreaProvider,{children:l.jsxs(f.SafeAreaView,{style:p({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=se;
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"),f=require("react-native-safe-area-context");function p(){return(p=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 g(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,f,x,v,y=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=p({},n.props);return delete c.children,"string"==typeof i?r.Utils.isEmpty(n.props.children)?l.jsx(i,p({},c)):l.jsx(i,p({},c,{children:l.jsx(g,p({transient:!0,validateScope:s},n.props,{scope:o,crud:a}))})):"function"==typeof i?l.jsx(i,p({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(g,p({validateScope:s},n.props,{scope:o,crud:a,transient:!0}))},m=function(){return l.jsx(l.Fragment,e.elements?{children:Object.entries(e.elements).map((function(e,t){return l.jsx(ee,p({crud:a},e[1]))}))}:{children:n.Children.map(e.children,(function(e){return l.jsx(y,{child:e})}))})};return e.transient?l.jsx(m,{}):r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements)?l.jsx(l.Fragment,{}):e.transient?l.jsx(m,{}):l.jsx(l.Fragment,{children:l.jsx(i.View,{style:(u=c,f=r.Utils.nvl(u,"root"),x=h[f],v={},r.Utils.isEmpty(e.style)||(null!=(d=e.style)&&d.push?r.Utils.each(e.style,(function(e){e&&(v=p({},v,e))})):v=p({},e.style)),p({},x,v,o.getStyle(u))),children:l.jsx(m,{})})})}var h=i.StyleSheet.create({child:{width:"100%"},inner:{width:"100%"}});function x(e){var i=e.scope,a=t.useState(0),s=a[0],c=a[1],u=i.original,d=i.getItems(),f=0,h=[],x=t.useState(null),v=x[0],y=x[1],m=function(e,t){void 0===t&&(t=!0),e&&i.execute({event:{validate:t,validateScope:u.validateScope,action:function(){i.changeValue(e.data),v=e,c(s=e.index),y(e)}}})},j=function(e){var t,n="ui-tabs-item ui-click";return(null==(t=v)?void 0:t.index)===e.index&&(n+=" ui-tab-selected"),n},b=function(e,t){var n=p({},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&&h.push(p({},o,{child:e,element:o,original:n,index:f++,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])})),v||m(h[s],!1);var S=function(e){m(h[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:h.map((function(e,t){return l.jsxs("div",{className:j(e),onClick:function(){m(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))}))}),v&&l.jsxs(l.Fragment,{children:[w&&l.jsx("div",{className:"ui-tabs-label",children:v.label}),l.jsx("div",{className:"ui-tabs-area",children:l.jsx(g,p({},e,{scope:i,children:v.child}))}),"stepper"===u.layout&&l.jsxs("div",{className:"ui-tabs-actions",children:[l.jsx(se.Output,{space:6,layout:"left",children:l.jsx(se.Include,p({},e,{transient:!0,name:"left",default:l.jsx(se.Button,{rendered:s>0,icon:l.jsx(o,{}),click:function(){S(-1)}})}))}),l.jsx(se.Output,{space:6,layout:"right",children:l.jsx(se.Include,p({},e,{transient:!0,name:"right",default:l.jsx(se.Button,{rendered:s<h.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 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){return l.jsx(l.Fragment,{children:l.jsx(y,p({},e.defaultsInput,e.defaultsUI))})}function b(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:S.link,children:"Clique aqui para acessar o React Native"})})}var S={link:{}};function w(e){var t,n=e.scope,i=n.getValue(),o={ion:a.Ionicons,ant:a.AntDesign,entypo:a.Entypo,evil:a.EvilIcons,material:a.MaterialCommunityIcons}[r.Utils.nvl(n.original.library,"ion")],s=n.getStyle("icon"),c=n.part("size",20),u=n.part("iconSize",c);return null!=(t=n.original)&&t.transient&&(s=p({},s,n.getStyle())),l.jsx(o,{size:u,name:i,style:s})}var C={small:{minWidth:30,height:30}};function U(e){var t=e.scope,n=t.original,o=r.Utils.nvl(n.size,"default"),a=r.Utils.nvl(n.align,"center"),s=r.Utils.nvl(n.variant,"default"),c=n.color,u=t.getLabel(),d=t.getPart("icon");c||(c="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:c,borderRadius:20,gap:10,justifyContent:"center",alignItems:"center",flexDirection:"row"}},g=function(e,n){var i=p({},f[e],n);return"text"!==s&&"outlined"!==s||(i.backgroundColor="transparent",i.color=r.Utils.nvl(c,"text")),"small"===o&&(i.fontSize=12,i.fontWeight=500),"medium"===o&&(i.fontSize=14,i.fontWeight=500),"left"===a&&(i.justifyContent="flex-start"),t.getStyle(e,i)},h={};h.button=d?{height:40,padding:0}:{height:50};var x=r.Utils.call((function(){var e=p({},null==h?void 0:h.button);"outlined"===s&&(e.borderWidth=1,e.borderColor=r.Utils.nvl(c,"text")),o&&(e=p({},e,C[o])),u||(e=p({},e,{borderRadius:20}));var t=g("button",e);if(!t.width){var n=t.height;"number"==typeof n&&(t.minWidth=n)}return t})),v=g("buttonLabel"),y=r.Utils.call((function(){var e=g("buttonIcon",h.icon);return e.fontSize=r.Utils.nvl(v.fontSize,e.fontSize),e}));return l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(e){t.call("click",{})},style:x,children:l.jsxs(l.Fragment,{children:[d&&l.jsx(l.Fragment,{children:l.jsx(se.Icon,{size:r.Utils.nvl(n.iconSize,30),style:y,value:d})}),u&&l.jsx(i.Text,{style:v,children:u})]})})}function T(e){var n,o,s=t.useState(!1),c=s[0],u=s[1],d=e.scope,f=d.original,g=r.Utils.nvl(d.getOptions(),[]),h=d.attr("placeholder","Selecione..."),x=d.getDisplayValue(),v=d.getTheme(),y=r.Utils.nvl(null==(n=v.styles)||null==(n=n.defaults)?void 0:n.header,{}),m=function(){u(!c)},j=t.useRef(null),b=r.Utils.nvl(null==(o=v.colors)?void 0:o.text,"#100e0e"),S=r.Utils.nvl(y.color,"white"),w={color:S},C=function(e,t){var n=p({},V[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,I=d.getPart("iconSize",null,T);return l.jsxs(i.View,{style:C("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:m,style:C("selectInput"),children:[l.jsx(i.Text,{style:U,children:r.Utils.nvl(x,h)}),l.jsx(a.Ionicons,{name:"chevron-down-outline",size:I,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",y),children:[l.jsx(i.TouchableOpacity,{onPress:m,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:h})]}),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(se.List,p({data:g,name:d.getName("list"),layout:"card",search:!0===f.search,click:function(e){var t=e.value;d.changeValue(f.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:p({paddingLeft:15,paddinRight:15},null==f?void 0:f.rowStyle)},null==f?void 0:f.listProps,{children:l.jsx(se.Value,{value:"#{@this.label}"})}))})})]})]})]},d.getName(d.getPart("modal")+"_"+c))}var V=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 I(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 k(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),f=n.attr("min",100),g=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:f,step:u,minimumTrackTintColor:"#1EB1FC",maximumTrackTintColor:"#d3d3d3",thumbTintColor:"#1EB1FC",value:a,onSlidingStart:function(){return g(!1)},onSlidingComplete:function(){return g(!0)},style:p({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:R.link,children:"Clique aqui para acessar o React Native"})})}var R={link:{}};function P(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:F.link,children:"Clique aqui para acessar o React Native"})})}var F={link:{}};function E(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,f=t.useState(80),g=f[0],h=f[1],x=t.useState(o),v=x[0],y=x[1],m=function(e,t){return p({},n.getStyle(e,p({},L[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,g)},baseStyle:{paddingVertical:10}}},w=p({},r.Utils.nvl(S[b],{}),d.inputProps),C=r.Utils.call((function(){var e={};return"small"===d.size&&(e.height=30,e.fontSize=12),e.fontSize=r.Utils.nvl(d.fontSize,e.fontSize),(e=p({},m("input"),m(b,e))).lineHeight=parseInt(e.fontSize)+2,e}));return w.autoHeight&&(w.onContentSizeChange=function(e){h(e.nativeEvent.contentSize.height)},C=p({},C,w.style)),l.jsxs(l.Fragment,{children:[l.jsxs(i.View,{style:m("base",null==w?void 0:w.baseStyle),children:[n.getPart("left"),l.jsx(i.TextInput,p({onChangeText:function(e){e=n.changeValue(e),y(e)},value:v,placeholder:c},w,{style:C})),l.jsx(j,{})]}),n.getPart("right")]})}var L=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,paddingVertical:0,height:40,width:"100%",flex:1},textarea:{marginHorizontal:0,marginVertical:0,paddingVertical:10,width:"100%",height:"auto",alignSelf:"stretch",flex:1}});function D(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)+"%",f=null==(n={repeat:B,list:W})?void 0:n[s.type],h=""+o.key("row",a,""),x=t.useState(r.ScopeUtils.create(p({},s,{parent:o,name:h,crud:o.crud,index:a,type:"row",data:c})))[0],v=t.useRef(null),y=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}(v,x),m=function(){return l.jsx(l.Fragment,!y&&s.useIsInView&&!x.visible&&a>20?{}:{children:l.jsx(g,{transient:!0,scope:x,crud:x.crud,children:e.children})})};return l.jsx((function(){var e=t.useState(0),n=e[0],r=e[1],g=o.key("item");x.selected=x.getPart("isSelectedRow",void 0,!1);var h=function(){var e=x.getStyle("row",p({},f.row,{minHeight:30}));return e=p({},e,x.getStyle(x.selected?"rowSelected":"rowUnSelected",{})),u>0&&(e.width=d),e};return x.update=function(){o.updateIndex=o.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:v,onPress:function(e){e.stopPropagation(),function(e){x.call("click",{value:e,item:e,edit:!0,index:a})}(c)},children:l.jsx(m,{})},g):l.jsx(i.View,{style:h(),ref:v,children:l.jsx(m,{})},g)}),{})}var W=i.StyleSheet.create({row:{padding:5,margin:0,width:"100%",backgroundColor:"background",gap:10,borderRadius:8,justifyContent:"center"}}),B=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:H,list:q})?void 0:n[c.type],f=r.ComponentUtils.getDefine(e,"add"),g=c.hideAddWhenEmpty,h=c.hideEmpty,x=function(){var n=t.useState(o.updateIndex),a=n[0],h=n[1],x=o.attr("empty","Sem registro");o.update=function(){o.updateIndex=++a,h(a)};var v,y=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})),m=r.Utils.isEmpty(y),j=function(){return m&&x?"string"==typeof x?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:x}):l.jsx(l.Fragment,{children:x}):l.jsx(l.Fragment,{})};return!1===x&&m?l.jsx(l.Fragment,{}):l.jsxs(i.View,{style:(v=o.getStyle("container",p({},{},d.container)),u>1&&(v=p({},v,{flexDirection:"row",flexWrap:"wrap"})),v),children:[l.jsx(j,{}),y.map((function(t,n){return l.jsx(D,{index:n,item:t,scope:o,children:e.children})})),(!m||!0!==g)&&l.jsx(l.Fragment,{children:f})]})},v=r.Utils.nvl(o.getItems(),[]);return h&&r.Utils.isEmpty(v)?l.jsx(l.Fragment,{}):l.jsxs(l.Fragment,{children:[!1!==c.search&&l.jsx(se.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(x,{})]})}var q=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}}),H=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}});function N(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},f=function(t){var o=t.item,a=t.index,s=d(o),c=p({},A.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(D,{scope:n,item:o.object,index:a,children:e.children})},g=function(e){var t=p({},A.item,n.getStyle("item")),r=Math.floor(100/o.length)+"%";if(d(e)){var i=n.getPart("selectedColor",void 0,"primary");(t=p({},t,n.getStyle("selected",{backgroundColor:i,color:"#ffffff"}))).color||(t.color="#ffffff");var l=e.color;e.backgroundColor&&(t=p({},t,{backgroundColor:e.backgroundColor})),e.color&&(t=p({},t,{color:l}))}else t.backgroundColor="#fff",t.color="#000";return t.width=r,t};return l.jsx(i.View,{style:p({},A.container,n.getStyle("items")),children:o.map((function(e,t){return l.jsx(i.TouchableHighlight,{style:g(e),onPress:function(t){!function(e){n.changeValue(e.object),u(++c)}(e)},children:l.jsx(f,{item:e,index:t})},"k-"+t)}))})}var A=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 M(e){var n=e.scope,o=n.original,s=t.useState(0),c=s[0],u=s[1],d=n.getValue(0),f=o.color;f||(f="primary");var g={padding:0,alignItems:"center",height:30,width:30,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",fontWeight:"500"},buttonInner:{flexDirection:"row",alignItems:"center",justifyContent:"center"},buttonIcon:{color:"#fff",fontSize:18},button:g,addButton:p({},g),delButton:p({},g)},x=function(e){n.changeValue(d+e),u(++c)},v=function(e,t){var r=p({},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:v("delButton"),children:l.jsx(a.Ionicons,{size:30,style:v("buttonIcon"),name:"remove"})}),l.jsx(i.Text,{style:v("value"),children:r.Utils.nvl(d,0)}),l.jsx(i.TouchableHighlight,{underlayColor:"transparent",onPress:function(){x(1)},style:v("addButton"),children:l.jsx(a.Ionicons,{size:30,style:v("buttonIcon"),name:"add"})})]})}function G(){var e={success:function(e){return l.jsx(c.BaseToast,p({},e,{style:t.darkToast,contentContainerStyle:{paddingHorizontal:15},text1Style:t.text,text2Style:t.text}))},error:function(e){return l.jsx(c.ErrorToast,p({},e,{style:t.darkToast,text1Style:t.text,text2Style:t.text}))},info:function(e){return l.jsx(c.BaseToast,p({},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 _(e){var n,a=t.useRef(null),s=e.scope,c=t.useState(0),u=c[0],f=c[1],h=s.currentDialog,x=null==h?void 0:h.crud;if(!h)return l.jsx(l.Fragment,{});h.update=function(){f(++u)},h.debug&&console.log(h);var v=h.scope,y=v.getLabel(),m=v.getTheme(),j=r.Utils.nvl(null==(n=m.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=p({},K[e],t);return p({},v.getStyle(e,n))},C=function(){v.close({scope:v,crud:null==h?void 0:h.crud,event:{}})};v.put("scrollRef",a);var U=s.original;r.ComponentUtils.setViewScope(v);var T=r.Utils.nvl(j.color,"white"),V={color:T},I=x.name+"-"+u,k=function(e){var t=e.children,n=v.part("disableScroll",!1);return v.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!=h&&h.component?l.jsx(h.component,p({crud:x},h.props),x.uuid):l.jsx(g,{scope:v,crud:x,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:v.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:y}),!r.Utils.isEmpty(b)&&l.jsx(g,{scope:v,crud:x,transient:!0,children:b})]}),l.jsx(k,{children:t}),S]}),l.jsx(G,{})]})}),{})},I)})}var K=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 Q(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})),f=!r.Utils.isEmpty(s);return l.jsx(l.Fragment,{children:f&&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 X(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(g,{scope:n,children:o}):l.jsx(i.View,{style:n.getStyle("container",Y.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",Y.scroll),children:l.jsx(g,{scope:n,children:o})})})};return l.jsxs(l.Fragment,{children:[l.jsx(Q,{scope:n}),l.jsx(u,{}),l.jsx(G,{})]})}var Y=i.StyleSheet.create({scroll:{paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},container:{},view:{}});function J(e){var n=e.scope,o=n.getOptions(),a=t.useState(o),s=a[0],c=a[1],u=t.useState(null),d=u[0],f=u[1],g=t.useRef(Object.fromEntries(o.map((function(e,t){return[e.value,new i.Animated.Value(70*t)]})))).current,h=t.useRef({}),x=t.useRef(null),v=t.useRef(-1),y=t.useRef(0),m=t.useRef(s);t.useEffect((function(){m.current=s}),[s]),t.useEffect((function(){s.forEach((function(e,t){g[e.value]||(g[e.value]=new i.Animated.Value(70*t)),i.Animated.spring(g[e.value],{toValue:70*t,useNativeDriver:!1}).start()}))}),[s]);var j=function(e){var t=[];r.Utils.each(e,(function(e){t.push(e.object)})),n.changeValue(t)};return s.forEach((function(e){var t;h.current[e.value]||(h.current[e.value]=(t=e,i.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(){var e=m.current;g[t.value]&&e.find((function(e){return e.value===t.value}))&&(x.current=t,v.current=e.findIndex((function(e){return e.value===t.value})),y.current=g[t.value]._value,f(t.value))},onPanResponderMove:function(e,n){var r=m.current;if(g[t.value]&&r.find((function(e){return e.value===t.value}))){var l=y.current+n.dy;g[t.value].setValue(l);var o=Math.max(0,Math.min(r.length-1,Math.floor((l+35)/70)));r.forEach((function(e,n){if(e.value!==t.value&&g[e.value]){var r=70*n;n>v.current&&n<=o?r=70*(n-1):n<v.current&&n>=o&&(r=70*(n+1)),i.Animated.timing(g[e.value],{toValue:r,duration:120,useNativeDriver:!1}).start()}}))}},onPanResponderRelease:function(){var e=x.current,t=m.current;if(e&&g[e.value]&&t.find((function(t){return t.value===e.value}))){var n=Math.max(0,Math.min(t.length-1,Math.floor((g[e.value]._value+35)/70))),r=v.current,i=[].concat(t),l=i.splice(r,1);i.splice(n,0,l[0]),c(i),j(i),f(null),x.current=null,v.current=-1}}})))})),l.jsx(i.View,{style:Z.container,children:l.jsx(i.View,{style:{height:70*s.length,width:"100%"},children:s.map((function(e){var t,n,r=g[e.value];if(!r)return null;var o=d===e.value;return l.jsxs(i.Animated.View,p({},null!=(t=null==(n=h.current[e.value])?void 0:n.panHandlers)?t:{},{style:[Z.item,{position:"absolute",left:0,right:0,height:62,transform:[{translateY:r}],zIndex:o?999:0,elevation:o?999:0}],children:[l.jsx(i.View,{style:Z.handle,children:l.jsx(i.Text,{style:Z.handleText,children:"≡"})}),l.jsx(i.Text,{style:Z.itemText,children:e.label}),l.jsx(i.TouchableOpacity,{onPress:function(){return d===(t=e.value)&&(f(null),x.current=null,v.current=-1),g[t]&&delete g[t],h.current[t]&&delete h.current[t],void c((function(e){var n=e.filter((function(e){return e.value!==t}));return n.forEach((function(e,t){g[e.value]&&i.Animated.spring(g[e.value],{toValue:70*t,useNativeDriver:!1}).start()})),j(n),n}));var t},style:Z.del,children:l.jsx(i.Text,{style:{color:"#fff"},children:"X"})})]}),e.value)}))})})}var Z=i.StyleSheet.create({container:{flex:1,paddingHorizontal:20,backgroundColor:"#f5f7fb"},title:{fontSize:18,fontWeight:"600",marginBottom:12},item:{backgroundColor:"#fff",borderRadius:10,marginVertical:4,paddingHorizontal:12,alignItems:"center",flexDirection:"row",elevation:3,shadowColor:"#000",shadowOpacity:.05,shadowRadius:6},handle:{width:40,alignItems:"center",justifyContent:"center"},handleText:{fontSize:22,color:"#666"},itemText:{fontSize:16,flex:1},del:{backgroundColor:"#e74c3c",height:34,width:34,borderRadius:6,alignItems:"center",justifyContent:"center"}}),$=t.createContext({});function ee(e){var n,o,s=this,c=t.useContext($),d=r.Utils.nvl(e.theme,null==c?void 0:c.theme),f=r.Utils.nvl(e.crud,null==c?void 0:c.crud),h=t.useState(r.ScopeUtils.create(p({crud:f},e,{theme:d})))[0],y=t.useState(0),m=y[0],S=y[1],C=t.useState(null),V=C[0],R=C[1];h.compile(e),f=h.crud;var F=h.getOptions(),L=h.original,D=t.useRef(null);h.update=function(){S(++m)},h.updateElement=function(){S(++m)},h.toast=function(e,t,n){void 0===t&&(t="info"),u.show(p({type:t,text1:e,position:"bottom",visibilityTime:3e3},n))},h.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 h.execute(e)}}],{cancelable:!1})}};var W=function(){var e=L.custom;return e?l.jsx(ee,"string"==typeof e?{element:{value:e,type:"dummy"},crud:f}:p({type:e.type,tag:e.type},e.props,{crud:f})):l.jsx(l.Fragment,{})};if(h.is("type","dummy"))return l.jsx(l.Fragment,{children:h.getDisplayValue()});var B=function(){var e=h.getValue();q({target:{value:!(!0===e)}})},q=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()},H=function(e){var t;null!=(t=h.currentDialog)&&t.component||h.call("click")},A={scope:h,crud:f,onChange:q};h.isType("password")&&(A.type="password");var G=function(){return!(h.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},K=h.is("type","text","textarea","number","integer","int","phone","postalCode","money","password","email"),Q=function(e,t){var n,i=r.Utils.nvl(L.type,"none"),l=r.Utils.nvl(e,"root"),o=p({},ie[l]),a=G();return i=r.Utils.nvl(L.layout,i),e||a||(o=p({},o)),h.isInput()&&(o=p({},o,re.input[l])),o=p({},o,null==re||null==(n=re[i])?void 0:n[l]),a&&e&&(o=p({},o,le[e])),p({},o,h.getStyle(e,p({},o,t)))},Y=Q("element"),Z={required:h.isRequired(),size:"small",scope:h,crud:f,style:Y,placeholder:h.attr("placeholder","Digite aqui")};h.error=function(e){V=e,R(e)},null!=(n=L.list)&&n.url||null!=(o=L.load)&&o.url||h.start(),t.useEffect((function(){h.start()}));var ne=function(){return"string"==typeof L.icon?l.jsx(a.Ionicons,{name:L.icon,style:h.getStyle("icon")}):l.jsx(l.Fragment,{children:L.icon})};if(h.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=D&&D.current&&h.is("type","card","list","tabs","stepper")){var e=null==D?void 0:D.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!h.isRendered()||h.is("type","define"))return l.jsx(l.Fragment,{});var oe=!h.isType("input","grid","list","order","repeat")&&L.click,ae={};oe&&(ae.underlayColor="transparent",ae.onPress=H);var se=function(e){var t=i.View;return oe&&(t=i.TouchableHighlight),h.isType("dialog","order")||L.transient?l.jsx(l.Fragment,{children:e.children}):l.jsx(t,p({},e))},ce=function(){return l.jsxs(l.Fragment,{children:[h.getPart("render",null,l.jsx(l.Fragment,{})),h.is("type","button")&&l.jsxs(U,p({},Z,{onClick:H,variant:h.attr("variant","outlined"),children:[L.icon&&l.jsx(ne,{}),L.label&&l.jsx(i.Text,{style:h.getPart("label","button"),children:h.getLabel()})]})),h.is("type","link")&&l.jsxs(b,p({},Z,{onClick:H,variant:h.attr("variant","outlined"),children:[L.icon&&l.jsx(ne,{}),L.label&&l.jsx(i.Text,{style:h.getPart("label","link"),children:h.getLabel()})]})),K&&l.jsx(E,p({},A,Z,{InputProps:p({},L.inputProps)})),h.is("type","complete","autocomplete")&&l.jsx(j,{scope:h,defaultsInput:A,defaultsUI:Z}),h.is("type","quantity")&&l.jsx(M,{scope:h,defaultsInput:A,defaultsUI:Z}),h.is("type","checkbox","boolean","switch")&&l.jsx(I,p({checked:!0===h.getValue()},A,{onChange:B})),h.isType("slider")&&l.jsx(k,p({},A,{onChange:B})),h.is("type","select")&&l.jsx(T,p({},A,Z,{value:h.getSelectedValue()})),h.is("type","toggle")&&l.jsx(N,p({},A,Z,{value:h.getSelectedValue()})),h.is("type","radio")&&l.jsx(P,p({},A,Z,{row:!0,children:F.map((function(e,t){return l.jsx(z,{control:l.jsx(P,p({},Z)),label:e.label,value:e.value},"i"+t)}))})),h.is("type","custom")&&l.jsx(W,{}),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(w,{scope:h,crud:f}),!h.is("format","icon","img")&&l.jsx(i.Text,{children:h.getDisplayValue()})]}),h.is("type","output","value")&&l.jsx(i.Text,{style:Q("value"),children:h.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(g,p({},e,{scope:h,crud:f,style:Q(n,i),children:o}))}return l.jsx(l.Fragment,{})},de=function(){return l.jsxs(l.Fragment,{children:[void 0!==L.label&&!1!==L.label&&!h.isType("button","dialog","modal")&&l.jsxs(i.View,{style:Q("outerLabel",{alignSelf:"flex-start",flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}),children:[l.jsx(i.Text,{style:Q("label"),children:h.getLabel()}),l.jsx(ue,{name:"actions",style:{width:"auto"}})]}),!h.isType("icon")&&!G()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:Q("inner"),children:l.jsx(ce,{})}),V&&l.jsx(i.View,{style:Q("error",{fontSize:12,paddingTop:4,color:"#e55b5b"}),children:V})]}),h.isType("list","repeat")&&l.jsx(O,p({},e,{scope:h,crud:f})),h.isType("order")&&l.jsx(J,p({},e,{scope:h,crud:f})),h.isType("chart")&&l.jsx(v,p({},e,{scope:h,crud:f})),h.isType("tabs")&&l.jsx(x,p({},e,{scope:h,crud:f})),h.isType("view")&&l.jsx(X,p({},e,{scope:h,crud:f})),h.is("type","icon")&&l.jsx(w,p({},Z,{onClick:H,variant:h.attr("variant","outlined"),children:h.getDisplayValue()})),!h.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(g,p({},e,{scope:h,crud:f,style:Q("inner")})),l.jsx(_,p({},e,{scope:h,crud:f}))]})},fe=function(e){var t=h.is("type|layout","card");if(h.isType("list")){var n=h.getPart("empty",null,void 0),o=h.getItems();!1===n&&r.Utils.isEmpty(o)&&(t=!1)}if(t){var a=p({},Q("box",p({},te.box,{alignSelf:"stretch"}))),s=L.boxBorder;return(s||0===s)&&(!0===s&&(s=1),a=p({},a,{borderWidth:s})),l.jsx(i.View,{style:Q("card",p({},a)),children:l.jsx(i.View,{style:Q("boxInner",{paddingHorizontal:15,paddingVertical:10}),children:e.children})})}return h.isInput()||L.container?l.jsx(i.View,{style:Q("container",{paddingVertical:5,width:"100%"}),children:e.children}):l.jsx(l.Fragment,{children:e.children})};if(h.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=h.getName("modal"),u=!0===e.edit,d={},f=null,g=null==n?void 0:n.component,x=r.Utils.nvl(null==i?void 0:i.original,L);a.is("row")?(d.parent=a.parent.parent,d.search=a.parent,f=a.data):a.is("search")&&(d.parent=a.parent,d.search=a);var v=a.data,y=r.Utils.nvl(n.data,n.send);"function"==typeof y&&(y=y.call(s,e)),!1!==n.send&&!1!==n.data||(v={});var m=r.Utils.nvl(y,e.item,f,v,{}),j=r.CrudUtils.create("dialog",p({parent:a,root:a,name:c,data:m,edit:u,scope:h},d)),b={label:x.label,icon:x.icon,type:"dialog"},S=null==(t=n.dialog)?void 0:t.close;"object"==typeof n.dialog&&(b=p({},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(p({parent:h,crud:j},b,{owner:h})),close:S,props:n.props,debug:n.debug};l.dialog=C,h.currentDialog=C,o&&(null==o.update||o.update()),h.update()},h.dialogHide=function(e){var t,n,i=r.ViewUtils.getCrud("view"),l=i.dialog,o=r.Utils.nvl(l.parent,null);i.dialog=o,h.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&&!h.isType("list","select","complete")){var pe=h.getValue();if(r.Utils.isEmpty(pe))return l.jsx(l.Fragment,{})}return l.jsx($.Provider,{value:{crud:f,theme:d},children:l.jsx(se,p({ref:D,style:Q()},ae,{children:l.jsx(fe,{children:l.jsx(de,{})})}))})}var te=i.StyleSheet.create({box:{borderWidth:1,borderColor:"#dedede",borderStyle:"solid",backgroundColor:"white",borderRadius:12,width:"100%",shadowColor:"#000",shadowOpacity:.1,shadowRadius:4}}),ne=p({},te.box),re={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}}};re.input=i.StyleSheet.create({label:{paddingLeft:0},inner:{flex:1,width:"100%",padding:0,gap:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),re.quantity={inner:p({},ne,{backgroundColor:"primarySoft",fontWeight:600,fontSize:16,borderRadius:25,borderWidth:0,paddingHorizontal:5,paddingVertical:5,flexWrap:"nowrap",flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"})},re.toggle=i.StyleSheet.create({root:{height:"auto"},inner:p({},ne,{flex:1,width:"100%",gap:10,borderRadius:2,justifyContent:"center",flexDirection:"row",alignSelf:"flex-start",flexWrap:"nowrap"})});var ie=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%",justifyContent:"space-between"}}),le=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function oe(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,p({},t,{children:t.children}))}),p({},e.tagProps,{children:l.jsx(g,p({transient:!0},e,{scope:e.scope,crud:e.crud,part:e.name,children:t}))}))}var ae=["type"],se={Order:function(e){return l.jsx(ee,p({},e,{type:"order"}))},List:function(e){return l.jsx(ee,p({},e,{type:"list"}))},Row:function(e){return l.jsx(ee,p({},e,{type:"row"}))},Value:function(e){return l.jsx(ee,p({},e,{type:"value"}))},Label:function(e){return l.jsx(ee,p({},e,{type:"label"}))},Repeat:function(e){return l.jsx(ee,p({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(ee,p({},e,{type:"define"}))},Include:function(e){return l.jsx(oe,p({},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,ae);return l.jsx(ee,p({},t,{type:"column"}))},Input:function(e){return l.jsx(ee,p({},e))},Text:function(e){return l.jsx(ee,p({},e,{type:"text"}))},Textarea:function(e){return l.jsx(ee,p({},e,{type:"textarea"}))},Email:function(e){return l.jsx(ee,p({},e,{type:"email"}))},Button:function(e){return l.jsx(ee,p({},e,{type:"button"}))},Link:function(e){return l.jsx(ee,p({},e,{type:"link"}))},Icon:function(e){return l.jsx(ee,p({},e,{type:"icon",transient:!0}))},Output:function(e){return l.jsx(ee,p({},e,{type:"output"}))},Form:function(e){return l.jsx(ee,p({},e,{type:"form"}))},Crud:function(e){return l.jsx(ee,p({},e,{type:"crud"}))},View:function(e){return l.jsx(ee,p({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(ee,p({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(ee,p({},e,{type:"dialog"}))},Content:function(e){return l.jsx(ee,p({},e,{type:"content"}))},Top:function(e){return l.jsx(ee,p({},e,{type:"top"}))},Card:function(e){return l.jsx(ee,p({},e,{type:"card"}))},Tab:function(e){return l.jsx(ee,p({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(ee,p({},e,{type:"tabs"}))},Step:function(e){return l.jsx(ee,p({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(ee,p({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(ee,p({},e,{type:"money"}))},Chart:function(e){return l.jsx(ee,p({},e,{type:"chart"}))},Password:function(e){return l.jsx(ee,p({},e,{type:"password"}))},Complete:function(e){return l.jsx(ee,p({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(ee,p({},e,{type:"switch"}))},Switch:function(e){return l.jsx(ee,p({},e,{type:"switch"}))},Radio:function(e){return l.jsx(ee,p({},e,{type:"radio"}))},Select:function(e){return l.jsx(ee,p({},e,{type:"select"}))},Toggle:function(e){return l.jsx(ee,p({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(ee,p({},e,{type:"entity"}))},Element:function(e){return l.jsx(ee,p({},e,{type:"element"}))},Quantity:function(e){return l.jsx(ee,p({},e,{type:"quantity"}))},Slider:function(e){return l.jsx(ee,p({},e,{type:"slider"}))},SafeView:function(e){var t,n=r.ThemeUtils.getCurrentTheme();return r.Utils.isEmpty(n)&&(n=r.useTheme()),l.jsx(f.SafeAreaProvider,{children:l.jsxs(f.SafeAreaView,{style:p({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=se;
2
2
  //# sourceMappingURL=react-crud-mobile.cjs.production.min.js.map