react-crud-mobile 1.3.242 → 1.3.243
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-crud-mobile.cjs.development.js +3 -1
- package/dist/react-crud-mobile.cjs.development.js.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js +3 -1
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/UIElement.tsx +1 -0
- package/src/elements/core/UIModal.tsx +2 -0
@@ -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,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}function y(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,h=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(y,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(y,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(ie,x({crud:a},e[1]))}))}:{children:n.Children.map(e.children,(function(e){return l.jsx(h,{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=m[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 m=i.StyleSheet.create({child:{width:"100%"},inner:{width:"100%"}});function v(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),h=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),h=e,c(s=e.index),m(e)}}})},j=function(e){var t,n="ui-tabs-item ui-click";return(null==(t=h)?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])})),h||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))}))}),h&&l.jsxs(l.Fragment,{children:[w&&l.jsx("div",{className:"ui-tabs-label",children:h.label}),l.jsx("div",{className:"ui-tabs-area",children:l.jsx(y,x({},e,{scope:i,children:h.child}))}),"stepper"===u.layout&&l.jsxs("div",{className:"ui-tabs-actions",children:[l.jsx(pe.Output,{space:6,layout:"left",children:l.jsx(pe.Include,x({},e,{transient:!0,name:"left",default:l.jsx(pe.Button,{rendered:s>0,icon:l.jsx(o,{}),click:function(){S(-1)}})}))}),l.jsx(pe.Output,{space:6,layout:"right",children:l.jsx(pe.Include,x({},e,{transient:!0,name:"right",default:l.jsx(pe.Button,{rendered:s<f.length-1,icon:l.jsx(o,{}),click:function(){S(1)}})}))})]})]})]})})}function j(e){var t=e.scope;return t.getItems(),r.Utils.asList(t.original.columns),l.jsx("div",{className:"ui-chart-data"})}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){return l.jsx(l.Fragment,{children:l.jsx(b,x({},e.defaultsInput,e.defaultsUI))})}function C(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:U.link,children:"Clique aqui para acessar o React Native"})})}var U={link:{}};function T(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 V={small:{minWidth:30,height:30}};function I(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,V[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 k(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({},F[e],t);return d.getStyle(e,n)};return l.jsxs(i.View,{style:C("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:v,style:C("selectInput"),children:[l.jsx(i.Text,{style:C("selectLabel"),children:r.Utils.nvl(h,g)}),l.jsx(a.Ionicons,{name:"chevron-down-outline",size:d.getPart("iconSize",null,24),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(pe.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(pe.Value,{value:"#{@this.label}"})}))})})]})]})]},d.getName(d.getPart("modal")+"_"+c))}var F=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},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 P(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 D(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 L(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 z(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 W(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=t.useState(o),p=d[0],f=d[1],g=function(e,t){return x({},n.getStyle(e,q[e]),t)},h=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}:{})},y=n.getPart("type","none"),m=r.Utils.nvl({textarea:{multiline:!0,textAlignVertical:"top"}}[y],{});return l.jsxs(l.Fragment,{children:[l.jsxs(i.View,{style:g("base"),children:[n.getPart("left"),l.jsx(i.TextInput,x({style:g("input"),onChangeText:function(e){e=n.changeValue(e),f(e)},value:p,placeholder:c},m)),l.jsx(h,{})]}),n.getPart("right")]})}var q=i.StyleSheet.create({base:{flex:1,width:"100%",paddingBottom:0,paddingTop:0,alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:5,paddingHorizontal:15,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10},icon:{marginRight:10},input:{marginHorizontal:0,marginVertical:0,height:40,flex:1}});function 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:O})?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],h=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}(h,g),v=function(){return l.jsx(l.Fragment,!m&&s.useIsInView&&!g.visible&&a>20?{}:{children:l.jsx(y,{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 y=function(){var e=g.getStyle("row",x({},p.row,{minHeight:40}));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:y(),underlayColor:"transparent",ref:h,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:y(),ref:h,children:l.jsx(v,{})},f)}),{})}var O=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 N(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:M,list:A})?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(pe.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 A=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}}),M=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}});function G(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({},_.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({},_.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")}return t.width=r,t};return l.jsx(l.Fragment,{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 _=i.StyleSheet.create({container:{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row"},item:{padding:10,marginVertical:8,backgroundColor:"background",borderRadius:8,justifyContent:"center",width:"auto",flexDirection:"row"},text:{fontSize:15,fontWeight:"500"}});function K(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 Q(){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})}var J=["scope","open","dialog"];function X(e){var n,a,s,c=e.scope,u=e.open,p=e.dialog,f=h(e,J),g=t.useState(!0===u),m=g[0],v=g[1],j=t.useState(0),b=j[0],S=j[1],w=c.getLabel(),C=c.getTheme(),U=r.Utils.nvl(null==(n=C.styles)||null==(n=n.defaults)?void 0:n.header,{}),T=t.useRef(null),V=function(e,t){var n=x({},Y[e],t);return x({},c.getStyle(e,n))},I=function(){var e;c.close({scope:c,crud:null==(e=c.currentDialog)?void 0:e.crud,event:{}})};c.toggleDialog=function(e){v(m=e)},c.update=function(){S(++b)};var k=null==(a=c.currentDialog)?void 0:a.crud,F=r.ViewUtils.getCrud("view");if(!k)return l.jsx(l.Fragment,{});if(k.uuid!==(null==(s=F.dialog)||null==(s=s.crud)?void 0:s.uuid))return l.jsx(l.Fragment,{});var P=r.ComponentUtils.getDefine(f,"header","right"),D=r.ComponentUtils.getDefine(f,"bottom");c.put("scrollRef",T);var L=c.original;r.ComponentUtils.setViewScope(c);var R=r.Utils.nvl(U.color,"white"),z={color:R},E=k.name+"-"+b,W=function(e){var t=e.children,n=c.part("disableScroll",!1);return c.part("disableContent",!1)?l.jsx(l.Fragment,{children:t}):n?l.jsx(i.View,{style:V("modalContent"),children:t}):l.jsx(i.ScrollView,{contentContainerStyle:{flexGrow:1,paddingBottom:50},style:V("modalContent"),nestedScrollEnabled:!0,ref:T,children:t})};return l.jsx((function(e){var t=e.children;return L.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:m,onRequestClose:I,children:l.jsx((function(){var e=l.jsx((function(){return null!=p&&p.component?l.jsx(p.component,x({crud:k},p.props),k.uuid):l.jsx(y,{scope:c,crud:k,children:f.children})}),{});return L.transient?l.jsx(i.View,{style:V("modalSafe"),children:e}):l.jsxs(l.Fragment,{children:[l.jsx(i.SafeAreaView,{style:V("modalTop")}),l.jsxs(i.SafeAreaView,{style:V("modalSafe"),children:[l.jsxs(i.View,{style:c.getStyle("header",U),children:[l.jsx(i.TouchableOpacity,{onPress:I,style:V("modalCloseButton"),children:l.jsx(o,{name:"chevron-back-outline",size:24,color:R,style:V("modalCloseText",z)})}),l.jsx(i.Text,{style:V("modalTitle",z),children:w}),!r.Utils.isEmpty(P)&&l.jsx(y,{scope:c,crud:k,transient:!0,children:P})]}),l.jsx(W,{children:e}),D]}),l.jsx(Q,{})]})}),{})},E)})}var Y=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 Z(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 $(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(y,{scope:n,children:o}):l.jsx(i.View,{style:n.getStyle("container",ee.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",ee.scroll),children:l.jsx(y,{scope:n,children:o})})})};return l.jsxs(l.Fragment,{children:[l.jsx(Z,{scope:n}),l.jsx(u,{}),l.jsx(Q,{})]})}var ee=i.StyleSheet.create({scroll:{paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},container:{},view:{}});function te(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,""),h=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,h.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:ne.text,children:n.getItemLabel(c)})]}):l.jsx(l.Fragment,{children:l.jsx(y,{transient:!0,scope:h,crud:h.crud,children:e.children})})};return l.jsx(p.ScaleDecorator,{children:l.jsx(i.TouchableOpacity,{style:[ne.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(Z,{scope:n})},h=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(h,{})]})}var ne=i.StyleSheet.create({row:{flexDirection:"row",gap:10,padding:15,borderBottomWidth:1,borderBottomColor:"#ccc"},text:{fontSize:18}}),re=t.createContext({});function ie(e){var n,o,s=this,c=t.useContext(re),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),h=g[0],m=g[1],b=t.useState(null),S=b[0],U=b[1];f.compile(e),p=f.crud;var V=f.getOptions(),F=f.original,R=t.useRef(null);f.update=function(){m(++h)},f.updateElement=function(){m(++h)},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 E=function(){var e=F.custom;return e?l.jsx(ie,"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 q=function(){var e=f.getValue();B({target:{value:!(!0===e)}})},B=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()},O=function(e){var t;null!=(t=f.currentDialog)&&t.component||f.call("click")},H={scope:f,crud:p,onChange:B};f.isType("password")&&(H.type="password");var A=function(){return!(f.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},M=f.is("type","text","textarea","number","integer","int","phone","postalCode","money","password","email"),_=function(e,t){var n,i=r.Utils.nvl(F.type,"none"),l=r.Utils.nvl(e,"root"),o=x({},se[l]),a=A();return i=r.Utils.nvl(F.layout,i),e||a||(o=x({},o)),f.isInput()&&(o=x({},o,ae.input[l])),o=x({},o,null==ae||null==(n=ae[i])?void 0:n[l]),a&&e&&(o=x({},o,ce[e])),x({},o,f.getStyle(e,x({},o,t)))},Q=_("element"),J={required:f.isRequired(),size:"small",scope:f,crud:p,style:Q,placeholder:f.attr("placeholder","Digite aqui")};f.error=function(e){S=e,U(e)},null!=(n=F.list)&&n.url||null!=(o=F.load)&&o.url||f.start(),t.useEffect((function(){f.start()}));var Y=function(){return"string"==typeof F.icon?l.jsx(a.Ionicons,{name:F.icon,style:f.getStyle("icon")}):l.jsx(l.Fragment,{children:F.icon})};if(f.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=R&&R.current&&f.is("type","card","list","tabs","stepper")){var e=null==R?void 0:R.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!f.isRendered()||f.is("type","define"))return l.jsx(l.Fragment,{});var Z=!f.isType("input","grid","list","order","repeat")&&F.click,ee={};Z&&(ee.underlayColor="transparent",ee.onPress=O);var ne=function(e){var t=i.View;return Z&&(t=i.TouchableHighlight),f.isType("dialog","order")||F.transient?l.jsx(l.Fragment,{children:e.children}):l.jsx(t,x({},e))},oe=function(){return l.jsxs(l.Fragment,{children:[f.getPart("render",null,l.jsx(l.Fragment,{})),f.is("type","button")&&l.jsxs(I,x({},J,{onClick:O,variant:f.attr("variant","outlined"),children:[F.icon&&l.jsx(Y,{}),F.label&&l.jsx(i.Text,{style:f.getPart("label","button"),children:f.getLabel()})]})),f.is("type","icon")&&l.jsx(T,x({},J,{onClick:O,variant:f.attr("variant","outlined"),children:f.getDisplayValue()})),f.is("type","link")&&l.jsxs(C,x({},J,{onClick:O,variant:f.attr("variant","outlined"),children:[F.icon&&l.jsx(Y,{}),F.label&&l.jsx(i.Text,{style:f.getPart("label","link"),children:f.getLabel()})]})),M&&l.jsx(W,x({},H,J,{InputProps:x({},F.inputProps)})),f.is("type","complete","autocomplete")&&l.jsx(w,{scope:f,defaultsInput:H,defaultsUI:J}),f.is("type","quantity")&&l.jsx(K,{scope:f,defaultsInput:H,defaultsUI:J}),f.is("type","checkbox","boolean","switch")&&l.jsx(P,x({checked:!0===f.getValue()},H,{onChange:q})),f.isType("slider")&&l.jsx(D,x({},H,{onChange:q})),f.is("type","select")&&l.jsx(k,x({},H,J,{value:f.getSelectedValue()})),f.is("type","toggle")&&l.jsx(G,x({},H,J,{value:f.getSelectedValue()})),f.is("type","radio")&&l.jsx(z,x({},H,J,{row:!0,children:V.map((function(e,t){return l.jsx(L,{control:l.jsx(z,x({},J)),label:e.label,value:e.value},"i"+t)}))})),f.is("type","custom")&&l.jsx(E,{}),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(T,{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:_("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(y,x({},e,{scope:f,crud:p,style:_(n,i),children:o}))}return l.jsx(l.Fragment,{})},de=function(){var t,n,r;return l.jsxs(l.Fragment,{children:[void 0!==F.label&&!1!==F.label&&!f.isType("button","dialog","modal")&&l.jsxs(i.View,{style:_("outerLabel",{alignSelf:"flex-start",flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}),children:[l.jsx(i.Text,{style:_("label"),children:f.getLabel()}),l.jsx(ue,{name:"actions",style:{width:"auto"}})]}),!A()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:_("inner"),children:l.jsx(oe,{})}),S&&l.jsx(i.View,{style:_("error",{fontSize:12,paddingTop:4,color:"#e55b5b"}),children:S})]}),f.isType("list","repeat")&&l.jsx(N,x({},e,{scope:f,crud:p})),f.isType("order")&&l.jsx(te,x({},e,{scope:f,crud:p})),f.isType("dialog")&&l.jsx(X,x({},e,{scope:f,crud:p})),(null==(t=f.currentDialog)?void 0:t.component)&&l.jsx(X,{scope:null==(n=f.currentDialog)?void 0:n.scope,crud:null==(r=f.currentDialog)?void 0:r.crud,open:!0,dialog:f.currentDialog}),f.isType("chart")&&l.jsx(j,x({},e,{scope:f,crud:p})),f.isType("tabs")&&l.jsx(v,x({},e,{scope:f,crud:p})),f.isType("view")&&l.jsx($,x({},e,{scope:f,crud:p})),!f.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(y,x({},e,{scope:f,crud:p,style:_("inner")}))]})},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({},_("box",x({},le.box,{alignSelf:"stretch"})));return l.jsx(i.View,{style:_("card",x({},a)),children:l.jsx(i.View,{style:_("boxInner",{paddingHorizontal:15,paddingVertical:10}),children:e.children})})}return f.isInput()||F.container?l.jsx(i.View,{style:_("container",{paddingVertical:5,width:"100%"}),children:e.children}):l.jsx(l.Fragment,{children:e.children})};return 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=r.ViewUtils.getCrud("view"),l=i.dialog,o=e.crud,a=f.getName("modal"),c=!0===e.edit,u={},d=null,p=null==n?void 0:n.component;o.is("row")?(u.parent=o.parent.parent,u.search=o.parent,d=o.data):o.is("search")&&(u.parent=o.parent,u.search=o);var g=o.data,h=r.Utils.nvl(n.data,n.send);"function"==typeof h&&(h=h.call(s,e)),!1!==n.send&&!1!==n.data||(g={});var y=r.Utils.nvl(h,e.item,d,g,{}),m=r.CrudUtils.create("dialog",x({parent:o,root:o,name:a,data:y,edit:c,scope:f},u)),v={label:F.label,icon:F.icon,type:"dialog"},j=null==(t=n.dialog)?void 0:t.close;"object"==typeof n.dialog&&(v=x({},v,n.dialog)),n.header&&(v.header=n.header),n.label&&(v.label=n.label),n.title&&(v.title=n.title),v.label=r.Utils.nvl(v.title,v.label);var b=r.ScopeUtils.create(x({parent:f,crud:m},v,{owner:f})),S={crud:m,parent:l,component:p,scope:b,close:j,props:n.props};i.dialog=S,f.toggleDialog(!0),f.currentDialog=S,b.currentDialog=S,b.toggleDialog(!0),f.update()},f.dialogHide=function(e){var t,n,i=r.ViewUtils.getCrud("view"),l=f.currentDialog,o=l.scope.parent;i.dialog=r.Utils.nvl(l.parent,null),f.currentDialog=null,null!=(t=i.dialog)&&null!=(t=t.crud)&&t.scope&&(null==(n=i.dialog)||n.crud.scope.update()),f.toggleDialog(!1),f.update();var a=l.close;o&&a&&(null!=a&&a.debug&&console.log("Fechando"),o.call("close",{close:a}))},l.jsx(re.Provider,{value:{crud:p,theme:d},children:l.jsx(ne,x({ref:R,style:_()},ee,{children:l.jsx(pe,{children:l.jsx(de,{})})}))})}var le=i.StyleSheet.create({box:{borderWidth:0,borderColor:"#dedede",borderStyle:"solid",backgroundColor:"white",borderRadius:12,width:"100%",shadowColor:"#000",shadowOpacity:.1,shadowRadius:4}}),oe=x({},le.box),ae={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}}};ae.input=i.StyleSheet.create({label:{paddingLeft:0},inner:{flex:1,width:"100%",padding:0,gap:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),ae.quantity={inner:x({},oe,{backgroundColor:"primarySoft",fontWeight:600,fontSize:16,borderRadius:25,borderWidth:0,paddingHorizontal:5,paddingVertical:5,flexWrap:"nowrap",flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"})},ae.toggle=i.StyleSheet.create({inner:x({},oe,{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row",paddingHorizontal:10,paddingVertical:0,alignSelf:"flex-start",flexWrap:"nowrap"})});var se=i.StyleSheet.create({root:{gap:5,flexDirection:"column",flexWrap:"wrap",width:"100%",alignItems:"flex-start"},label:{fontWeight:400,fontSize:12,paddingVertical:3,color:"labelColor"},inner:{width:"100%"}}),ce=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function ue(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(y,x({transient:!0},e,{scope:e.scope,crud:e.crud,part:e.name,children:t}))}))}var de=["type"],pe={Order:function(e){return l.jsx(ie,x({},e,{type:"order"}))},List:function(e){return l.jsx(ie,x({},e,{type:"list"}))},Row:function(e){return l.jsx(ie,x({},e,{type:"row"}))},Value:function(e){return l.jsx(ie,x({},e,{type:"value"}))},Label:function(e){return l.jsx(ie,x({},e,{type:"label"}))},Repeat:function(e){return l.jsx(ie,x({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(ie,x({},e,{type:"define"}))},Include:function(e){return l.jsx(ue,x({},e))},Column:function(e){var t=h(e,de);return l.jsx(ie,x({},t,{type:"column"}))},Input:function(e){return l.jsx(ie,x({},e))},Text:function(e){return l.jsx(ie,x({},e,{type:"text"}))},Email:function(e){return l.jsx(ie,x({},e,{type:"email"}))},Button:function(e){return l.jsx(ie,x({},e,{type:"button"}))},Link:function(e){return l.jsx(ie,x({},e,{type:"link"}))},Icon:function(e){return l.jsx(ie,x({},e,{type:"icon"}))},Output:function(e){return l.jsx(ie,x({},e,{type:"output"}))},Form:function(e){return l.jsx(ie,x({},e,{type:"form"}))},Crud:function(e){return l.jsx(ie,x({},e,{type:"crud"}))},View:function(e){return l.jsx(ie,x({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(ie,x({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(ie,x({},e,{type:"dialog"}))},Content:function(e){return l.jsx(ie,x({},e,{type:"content"}))},Top:function(e){return l.jsx(ie,x({},e,{type:"top"}))},Card:function(e){return l.jsx(ie,x({},e,{type:"card"}))},Tab:function(e){return l.jsx(ie,x({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(ie,x({},e,{type:"tabs"}))},Step:function(e){return l.jsx(ie,x({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(ie,x({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(ie,x({},e,{type:"money"}))},Chart:function(e){return l.jsx(ie,x({},e,{type:"chart"}))},Password:function(e){return l.jsx(ie,x({},e,{type:"password"}))},Complete:function(e){return l.jsx(ie,x({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(ie,x({},e,{type:"switch"}))},Switch:function(e){return l.jsx(ie,x({},e,{type:"switch"}))},Radio:function(e){return l.jsx(ie,x({},e,{type:"radio"}))},Select:function(e){return l.jsx(ie,x({},e,{type:"select"}))},Toggle:function(e){return l.jsx(ie,x({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(ie,x({},e,{type:"entity"}))},Element:function(e){return l.jsx(ie,x({},e,{type:"element"}))},Quantity:function(e){return l.jsx(ie,x({},e,{type:"quantity"}))},Slider:function(e){return l.jsx(ie,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=pe;
|
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,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}function y(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,h=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(y,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(y,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(ie,x({crud:a},e[1]))}))}:{children:n.Children.map(e.children,(function(e){return l.jsx(h,{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=m[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 m=i.StyleSheet.create({child:{width:"100%"},inner:{width:"100%"}});function v(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),h=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),h=e,c(s=e.index),m(e)}}})},j=function(e){var t,n="ui-tabs-item ui-click";return(null==(t=h)?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])})),h||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))}))}),h&&l.jsxs(l.Fragment,{children:[w&&l.jsx("div",{className:"ui-tabs-label",children:h.label}),l.jsx("div",{className:"ui-tabs-area",children:l.jsx(y,x({},e,{scope:i,children:h.child}))}),"stepper"===u.layout&&l.jsxs("div",{className:"ui-tabs-actions",children:[l.jsx(pe.Output,{space:6,layout:"left",children:l.jsx(pe.Include,x({},e,{transient:!0,name:"left",default:l.jsx(pe.Button,{rendered:s>0,icon:l.jsx(o,{}),click:function(){S(-1)}})}))}),l.jsx(pe.Output,{space:6,layout:"right",children:l.jsx(pe.Include,x({},e,{transient:!0,name:"right",default:l.jsx(pe.Button,{rendered:s<f.length-1,icon:l.jsx(o,{}),click:function(){S(1)}})}))})]})]})]})})}function j(e){var t=e.scope;return t.getItems(),r.Utils.asList(t.original.columns),l.jsx("div",{className:"ui-chart-data"})}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){return l.jsx(l.Fragment,{children:l.jsx(b,x({},e.defaultsInput,e.defaultsUI))})}function C(e){return l.jsx(i.TouchableOpacity,{onPress:function(){i.Linking.openURL("https://reactnative.dev/")},children:l.jsx(i.Text,{style:U.link,children:"Clique aqui para acessar o React Native"})})}var U={link:{}};function T(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 V={small:{minWidth:30,height:30}};function I(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,V[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 k(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({},F[e],t);return d.getStyle(e,n)};return l.jsxs(i.View,{style:C("selectRoot"),children:[l.jsxs(i.TouchableOpacity,{onPress:v,style:C("selectInput"),children:[l.jsx(i.Text,{style:C("selectLabel"),children:r.Utils.nvl(h,g)}),l.jsx(a.Ionicons,{name:"chevron-down-outline",size:d.getPart("iconSize",null,24),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(pe.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(pe.Value,{value:"#{@this.label}"})}))})})]})]})]},d.getName(d.getPart("modal")+"_"+c))}var F=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},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 P(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 D(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 L(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 z(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 W(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=t.useState(o),p=d[0],f=d[1],g=function(e,t){return x({},n.getStyle(e,q[e]),t)},h=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}:{})},y=n.getPart("type","none"),m=r.Utils.nvl({textarea:{multiline:!0,textAlignVertical:"top"}}[y],{});return l.jsxs(l.Fragment,{children:[l.jsxs(i.View,{style:g("base"),children:[n.getPart("left"),l.jsx(i.TextInput,x({style:g("input"),onChangeText:function(e){e=n.changeValue(e),f(e)},value:p,placeholder:c},m)),l.jsx(h,{})]}),n.getPart("right")]})}var q=i.StyleSheet.create({base:{flex:1,width:"100%",paddingBottom:0,paddingTop:0,alignItems:"center",borderWidth:1,borderColor:"borderColor",borderRadius:5,paddingHorizontal:15,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap",gap:10},icon:{marginRight:10},input:{marginHorizontal:0,marginVertical:0,height:40,flex:1}});function 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:O})?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],h=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}(h,g),v=function(){return l.jsx(l.Fragment,!m&&s.useIsInView&&!g.visible&&a>20?{}:{children:l.jsx(y,{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 y=function(){var e=g.getStyle("row",x({},p.row,{minHeight:40}));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:y(),underlayColor:"transparent",ref:h,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:y(),ref:h,children:l.jsx(v,{})},f)}),{})}var O=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 N(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:M,list:A})?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(pe.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 A=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}}),M=i.StyleSheet.create({container:{display:"flex",flexWrap:"wrap",gap:10,width:"100%"},text:{fontSize:18,fontWeight:"bold"}});function G(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({},_.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({},_.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")}return t.width=r,t};return l.jsx(l.Fragment,{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 _=i.StyleSheet.create({container:{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row"},item:{padding:10,marginVertical:8,backgroundColor:"background",borderRadius:8,justifyContent:"center",width:"auto",flexDirection:"row"},text:{fontSize:15,fontWeight:"500"}});function K(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 Q(){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})}var J=["scope","open","dialog"];function X(e){var n,a,s,c=e.scope,u=e.open,p=e.dialog,f=h(e,J),g=t.useState(!0===u),m=g[0],v=g[1],j=t.useState(0),b=j[0],S=j[1],w=c.getLabel(),C=c.getTheme(),U=r.Utils.nvl(null==(n=C.styles)||null==(n=n.defaults)?void 0:n.header,{}),T=t.useRef(null),V=function(e,t){var n=x({},Y[e],t);return x({},c.getStyle(e,n))},I=function(){var e;c.close({scope:c,crud:null==(e=c.currentDialog)?void 0:e.crud,event:{}})};c.toggleDialog=function(e){v(m=e)},c.update=function(){S(++b)};var k=null==(a=c.currentDialog)?void 0:a.crud,F=r.ViewUtils.getCrud("view");if(null!=p&&p.debug&&console.log(k),!k)return l.jsx(l.Fragment,{});if(k.uuid!==(null==(s=F.dialog)||null==(s=s.crud)?void 0:s.uuid))return l.jsx(l.Fragment,{});var P=r.ComponentUtils.getDefine(f,"header","right"),D=r.ComponentUtils.getDefine(f,"bottom");c.put("scrollRef",T);var L=c.original;r.ComponentUtils.setViewScope(c);var R=r.Utils.nvl(U.color,"white"),z={color:R},E=k.name+"-"+b,W=function(e){var t=e.children,n=c.part("disableScroll",!1);return c.part("disableContent",!1)?l.jsx(l.Fragment,{children:t}):n?l.jsx(i.View,{style:V("modalContent"),children:t}):l.jsx(i.ScrollView,{contentContainerStyle:{flexGrow:1,paddingBottom:50},style:V("modalContent"),nestedScrollEnabled:!0,ref:T,children:t})};return l.jsx((function(e){var t=e.children;return L.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:m,onRequestClose:I,children:l.jsx((function(){var e=l.jsx((function(){return null!=p&&p.component?l.jsx(p.component,x({crud:k},p.props),k.uuid):l.jsx(y,{scope:c,crud:k,children:f.children})}),{});return L.transient?l.jsx(i.View,{style:V("modalSafe"),children:e}):l.jsxs(l.Fragment,{children:[l.jsx(i.SafeAreaView,{style:V("modalTop")}),l.jsxs(i.SafeAreaView,{style:V("modalSafe"),children:[l.jsxs(i.View,{style:c.getStyle("header",U),children:[l.jsx(i.TouchableOpacity,{onPress:I,style:V("modalCloseButton"),children:l.jsx(o,{name:"chevron-back-outline",size:24,color:R,style:V("modalCloseText",z)})}),l.jsx(i.Text,{style:V("modalTitle",z),children:w}),!r.Utils.isEmpty(P)&&l.jsx(y,{scope:c,crud:k,transient:!0,children:P})]}),l.jsx(W,{children:e}),D]}),l.jsx(Q,{})]})}),{})},E)})}var Y=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 Z(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 $(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(y,{scope:n,children:o}):l.jsx(i.View,{style:n.getStyle("container",ee.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",ee.scroll),children:l.jsx(y,{scope:n,children:o})})})};return l.jsxs(l.Fragment,{children:[l.jsx(Z,{scope:n}),l.jsx(u,{}),l.jsx(Q,{})]})}var ee=i.StyleSheet.create({scroll:{paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},container:{},view:{}});function te(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,""),h=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,h.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:ne.text,children:n.getItemLabel(c)})]}):l.jsx(l.Fragment,{children:l.jsx(y,{transient:!0,scope:h,crud:h.crud,children:e.children})})};return l.jsx(p.ScaleDecorator,{children:l.jsx(i.TouchableOpacity,{style:[ne.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(Z,{scope:n})},h=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(h,{})]})}var ne=i.StyleSheet.create({row:{flexDirection:"row",gap:10,padding:15,borderBottomWidth:1,borderBottomColor:"#ccc"},text:{fontSize:18}}),re=t.createContext({});function ie(e){var n,o,s=this,c=t.useContext(re),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),h=g[0],m=g[1],b=t.useState(null),S=b[0],U=b[1];f.compile(e),p=f.crud;var V=f.getOptions(),F=f.original,R=t.useRef(null);f.update=function(){m(++h)},f.updateElement=function(){m(++h)},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 E=function(){var e=F.custom;return e?l.jsx(ie,"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 q=function(){var e=f.getValue();B({target:{value:!(!0===e)}})},B=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()},O=function(e){var t;null!=(t=f.currentDialog)&&t.component||f.call("click")},H={scope:f,crud:p,onChange:B};f.isType("password")&&(H.type="password");var A=function(){return!(f.isInput()||r.Utils.isEmpty(e.children)&&r.Utils.isEmpty(e.elements))},M=f.is("type","text","textarea","number","integer","int","phone","postalCode","money","password","email"),_=function(e,t){var n,i=r.Utils.nvl(F.type,"none"),l=r.Utils.nvl(e,"root"),o=x({},se[l]),a=A();return i=r.Utils.nvl(F.layout,i),e||a||(o=x({},o)),f.isInput()&&(o=x({},o,ae.input[l])),o=x({},o,null==ae||null==(n=ae[i])?void 0:n[l]),a&&e&&(o=x({},o,ce[e])),x({},o,f.getStyle(e,x({},o,t)))},Q=_("element"),J={required:f.isRequired(),size:"small",scope:f,crud:p,style:Q,placeholder:f.attr("placeholder","Digite aqui")};f.error=function(e){S=e,U(e)},null!=(n=F.list)&&n.url||null!=(o=F.load)&&o.url||f.start(),t.useEffect((function(){f.start()}));var Y=function(){return"string"==typeof F.icon?l.jsx(a.Ionicons,{name:F.icon,style:f.getStyle("icon")}):l.jsx(l.Fragment,{children:F.icon})};if(f.open=function(e){i.Linking.openURL(e.url)},t.useLayoutEffect((function(){if(null!=R&&R.current&&f.is("type","card","list","tabs","stepper")){var e=null==R?void 0:R.current;if(null!=e&&e.classList){var t=r.HtmlUtils.getBGColor(e);e.classList.add("rgb(255, 255, 255)"===t?"ui-dark":"ui-light")}}})),!f.isRendered()||f.is("type","define"))return l.jsx(l.Fragment,{});var Z=!f.isType("input","grid","list","order","repeat")&&F.click,ee={};Z&&(ee.underlayColor="transparent",ee.onPress=O);var ne=function(e){var t=i.View;return Z&&(t=i.TouchableHighlight),f.isType("dialog","order")||F.transient?l.jsx(l.Fragment,{children:e.children}):l.jsx(t,x({},e))},oe=function(){return l.jsxs(l.Fragment,{children:[f.getPart("render",null,l.jsx(l.Fragment,{})),f.is("type","button")&&l.jsxs(I,x({},J,{onClick:O,variant:f.attr("variant","outlined"),children:[F.icon&&l.jsx(Y,{}),F.label&&l.jsx(i.Text,{style:f.getPart("label","button"),children:f.getLabel()})]})),f.is("type","icon")&&l.jsx(T,x({},J,{onClick:O,variant:f.attr("variant","outlined"),children:f.getDisplayValue()})),f.is("type","link")&&l.jsxs(C,x({},J,{onClick:O,variant:f.attr("variant","outlined"),children:[F.icon&&l.jsx(Y,{}),F.label&&l.jsx(i.Text,{style:f.getPart("label","link"),children:f.getLabel()})]})),M&&l.jsx(W,x({},H,J,{InputProps:x({},F.inputProps)})),f.is("type","complete","autocomplete")&&l.jsx(w,{scope:f,defaultsInput:H,defaultsUI:J}),f.is("type","quantity")&&l.jsx(K,{scope:f,defaultsInput:H,defaultsUI:J}),f.is("type","checkbox","boolean","switch")&&l.jsx(P,x({checked:!0===f.getValue()},H,{onChange:q})),f.isType("slider")&&l.jsx(D,x({},H,{onChange:q})),f.is("type","select")&&l.jsx(k,x({},H,J,{value:f.getSelectedValue()})),f.is("type","toggle")&&l.jsx(G,x({},H,J,{value:f.getSelectedValue()})),f.is("type","radio")&&l.jsx(z,x({},H,J,{row:!0,children:V.map((function(e,t){return l.jsx(L,{control:l.jsx(z,x({},J)),label:e.label,value:e.value},"i"+t)}))})),f.is("type","custom")&&l.jsx(E,{}),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(T,{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:_("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(y,x({},e,{scope:f,crud:p,style:_(n,i),children:o}))}return l.jsx(l.Fragment,{})},de=function(){var t,n,r;return l.jsxs(l.Fragment,{children:[void 0!==F.label&&!1!==F.label&&!f.isType("button","dialog","modal")&&l.jsxs(i.View,{style:_("outerLabel",{alignSelf:"flex-start",flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}),children:[l.jsx(i.Text,{style:_("label"),children:f.getLabel()}),l.jsx(ue,{name:"actions",style:{width:"auto"}})]}),!A()&&l.jsxs(l.Fragment,{children:[l.jsx(i.View,{style:_("inner"),children:l.jsx(oe,{})}),S&&l.jsx(i.View,{style:_("error",{fontSize:12,paddingTop:4,color:"#e55b5b"}),children:S})]}),f.isType("list","repeat")&&l.jsx(N,x({},e,{scope:f,crud:p})),f.isType("order")&&l.jsx(te,x({},e,{scope:f,crud:p})),f.isType("dialog")&&l.jsx(X,x({},e,{scope:f,crud:p})),(null==(t=f.currentDialog)?void 0:t.component)&&l.jsx(X,{scope:null==(n=f.currentDialog)?void 0:n.scope,crud:null==(r=f.currentDialog)?void 0:r.crud,open:!0,dialog:f.currentDialog}),f.isType("chart")&&l.jsx(j,x({},e,{scope:f,crud:p})),f.isType("tabs")&&l.jsx(v,x({},e,{scope:f,crud:p})),f.isType("view")&&l.jsx($,x({},e,{scope:f,crud:p})),!f.isType("tabs","view","grid","list","define","repeat","modal","dialog","chart")&&l.jsx(y,x({},e,{scope:f,crud:p,style:_("inner")}))]})},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({},_("box",x({},le.box,{alignSelf:"stretch"})));return l.jsx(i.View,{style:_("card",x({},a)),children:l.jsx(i.View,{style:_("boxInner",{paddingHorizontal:15,paddingVertical:10}),children:e.children})})}return f.isInput()||F.container?l.jsx(i.View,{style:_("container",{paddingVertical:5,width:"100%"}),children:e.children}):l.jsx(l.Fragment,{children:e.children})};return 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=r.ViewUtils.getCrud("view"),l=i.dialog,o=e.crud,a=f.getName("modal"),c=!0===e.edit,u={},d=null,p=null==n?void 0:n.component;o.is("row")?(u.parent=o.parent.parent,u.search=o.parent,d=o.data):o.is("search")&&(u.parent=o.parent,u.search=o);var g=o.data,h=r.Utils.nvl(n.data,n.send);"function"==typeof h&&(h=h.call(s,e)),!1!==n.send&&!1!==n.data||(g={});var y=r.Utils.nvl(h,e.item,d,g,{}),m=r.CrudUtils.create("dialog",x({parent:o,root:o,name:a,data:y,edit:c,scope:f},u)),v={label:F.label,icon:F.icon,type:"dialog"},j=null==(t=n.dialog)?void 0:t.close;"object"==typeof n.dialog&&(v=x({},v,n.dialog)),n.header&&(v.header=n.header),n.label&&(v.label=n.label),n.title&&(v.title=n.title),v.label=r.Utils.nvl(v.title,v.label);var b=r.ScopeUtils.create(x({parent:f,crud:m},v,{owner:f})),S={crud:m,parent:l,component:p,scope:b,close:j,props:n.props,debug:n.debug};i.dialog=S,f.toggleDialog(!0),f.currentDialog=S,b.currentDialog=S,b.toggleDialog(!0),f.update()},f.dialogHide=function(e){var t,n,i=r.ViewUtils.getCrud("view"),l=f.currentDialog,o=l.scope.parent;i.dialog=r.Utils.nvl(l.parent,null),f.currentDialog=null,null!=(t=i.dialog)&&null!=(t=t.crud)&&t.scope&&(null==(n=i.dialog)||n.crud.scope.update()),f.toggleDialog(!1),f.update();var a=l.close;o&&a&&(null!=a&&a.debug&&console.log("Fechando"),o.call("close",{close:a}))},l.jsx(re.Provider,{value:{crud:p,theme:d},children:l.jsx(ne,x({ref:R,style:_()},ee,{children:l.jsx(pe,{children:l.jsx(de,{})})}))})}var le=i.StyleSheet.create({box:{borderWidth:0,borderColor:"#dedede",borderStyle:"solid",backgroundColor:"white",borderRadius:12,width:"100%",shadowColor:"#000",shadowOpacity:.1,shadowRadius:4}}),oe=x({},le.box),ae={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}}};ae.input=i.StyleSheet.create({label:{paddingLeft:0},inner:{flex:1,width:"100%",padding:0,gap:10,alignSelf:"flex-start",flexDirection:"row",flexWrap:"wrap"}}),ae.quantity={inner:x({},oe,{backgroundColor:"primarySoft",fontWeight:600,fontSize:16,borderRadius:25,borderWidth:0,paddingHorizontal:5,paddingVertical:5,flexWrap:"nowrap",flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"})},ae.toggle=i.StyleSheet.create({inner:x({},oe,{flex:1,width:"100%",gap:10,justifyContent:"center",flexDirection:"row",paddingHorizontal:10,paddingVertical:0,alignSelf:"flex-start",flexWrap:"nowrap"})});var se=i.StyleSheet.create({root:{gap:5,flexDirection:"column",flexWrap:"wrap",width:"100%",alignItems:"flex-start"},label:{fontWeight:400,fontSize:12,paddingVertical:3,color:"labelColor"},inner:{width:"100%"}}),ce=i.StyleSheet.create({root:{gap:10},label:{width:"100%",fontWeight:500,fontSize:24}});function ue(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(y,x({transient:!0},e,{scope:e.scope,crud:e.crud,part:e.name,children:t}))}))}var de=["type"],pe={Order:function(e){return l.jsx(ie,x({},e,{type:"order"}))},List:function(e){return l.jsx(ie,x({},e,{type:"list"}))},Row:function(e){return l.jsx(ie,x({},e,{type:"row"}))},Value:function(e){return l.jsx(ie,x({},e,{type:"value"}))},Label:function(e){return l.jsx(ie,x({},e,{type:"label"}))},Repeat:function(e){return l.jsx(ie,x({},e,{type:"repeat",props:{search:!1}}))},Define:function(e){return l.jsx(ie,x({},e,{type:"define"}))},Include:function(e){return l.jsx(ue,x({},e))},Column:function(e){var t=h(e,de);return l.jsx(ie,x({},t,{type:"column"}))},Input:function(e){return l.jsx(ie,x({},e))},Text:function(e){return l.jsx(ie,x({},e,{type:"text"}))},Email:function(e){return l.jsx(ie,x({},e,{type:"email"}))},Button:function(e){return l.jsx(ie,x({},e,{type:"button"}))},Link:function(e){return l.jsx(ie,x({},e,{type:"link"}))},Icon:function(e){return l.jsx(ie,x({},e,{type:"icon"}))},Output:function(e){return l.jsx(ie,x({},e,{type:"output"}))},Form:function(e){return l.jsx(ie,x({},e,{type:"form"}))},Crud:function(e){return l.jsx(ie,x({},e,{type:"crud"}))},View:function(e){return l.jsx(ie,x({},e,{type:"view",transient:!0}))},Bottom:function(e){return l.jsx(ie,x({},e,{type:"bottom"}))},Dialog:function(e){return l.jsx(ie,x({},e,{type:"dialog"}))},Content:function(e){return l.jsx(ie,x({},e,{type:"content"}))},Top:function(e){return l.jsx(ie,x({},e,{type:"top"}))},Card:function(e){return l.jsx(ie,x({},e,{type:"card"}))},Tab:function(e){return l.jsx(ie,x({},e,{type:"tab"}))},Tabs:function(e){return l.jsx(ie,x({},e,{type:"tabs"}))},Step:function(e){return l.jsx(ie,x({},e,{type:"tab",layout:"step"}))},Stepper:function(e){return l.jsx(ie,x({},e,{type:"tabs",layout:"stepper"}))},Money:function(e){return l.jsx(ie,x({},e,{type:"money"}))},Chart:function(e){return l.jsx(ie,x({},e,{type:"chart"}))},Password:function(e){return l.jsx(ie,x({},e,{type:"password"}))},Complete:function(e){return l.jsx(ie,x({},e,{type:"complete"}))},Checkbox:function(e){return l.jsx(ie,x({},e,{type:"switch"}))},Switch:function(e){return l.jsx(ie,x({},e,{type:"switch"}))},Radio:function(e){return l.jsx(ie,x({},e,{type:"radio"}))},Select:function(e){return l.jsx(ie,x({},e,{type:"select"}))},Toggle:function(e){return l.jsx(ie,x({},e,{type:"toggle"}))},Entity:function(e){return l.jsx(ie,x({},e,{type:"entity"}))},Element:function(e){return l.jsx(ie,x({},e,{type:"element"}))},Quantity:function(e){return l.jsx(ie,x({},e,{type:"quantity"}))},Slider:function(e){return l.jsx(ie,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=pe;
|
2
2
|
//# sourceMappingURL=react-crud-mobile.cjs.production.min.js.map
|