@react-querybuilder/native
Advanced tools
Comparing version 7.4.0 to 7.4.1
@@ -560,7 +560,4 @@ "use strict"; | ||
const qb = (0, import_react_querybuilder6.useQueryBuilderSchema)(props, setup); | ||
qb.schema.styles = (0, import_react8.useMemo)( | ||
() => import_react_native10.StyleSheet.create(props.styles ?? {}), | ||
[props.styles] | ||
); | ||
return qb; | ||
const styles = (0, import_react8.useMemo)(() => import_react_native10.StyleSheet.create(props.styles ?? {}), [props.styles]); | ||
return { ...qb, schema: { ...qb.schema, styles } }; | ||
}; | ||
@@ -567,0 +564,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";var Oe=Object.create;var I=Object.defineProperty;var Fe=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty;var Ve=(t,o)=>{for(var e in o)I(t,e,{get:o[e],enumerable:!0})},ie=(t,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of Pe(o))!Be.call(t,s)&&s!==e&&I(t,s,{get:()=>o[s],enumerable:!(i=Fe(o,s))||i.enumerable});return t};var y=(t,o,e)=>(e=t!=null?Oe(we(t)):{},ie(o||!t||!t.__esModule?I(e,"default",{value:t,enumerable:!0}):e,t)),Ee=t=>ie(I({},"__esModule",{value:!0}),t);var qe={};Ve(qe,{NativeActionElement:()=>d,NativeInlineCombinator:()=>U,NativeNotToggle:()=>$,NativeShiftActions:()=>z,NativeValueEditor:()=>V,NativeValueEditorWeb:()=>J,NativeValueSelector:()=>m,NativeValueSelectorWeb:()=>b,QueryBuilderNative:()=>Le,RuleGroupNative:()=>X,RuleNative:()=>Z,defaultNativeControlElements:()=>W,defaultNativeSelectStyles:()=>p,defaultNativeStyles:()=>r,defaultNativeWebControlElements:()=>Qe});module.exports=Ee(qe);var se=y(require("react")),ue=require("react-native"),d=({handleOnClick:t,label:o,disabled:e,disabledTranslation:i,testID:s})=>se.createElement(ue.Button,{testID:s,disabled:e&&!i,title:`${i&&e?i.label??"":o??""}`,onPress:n=>t()});var _=y(require("react")),ae=require("react"),D=require("react-native"),K=require("react-querybuilder");var ne=require("react-native"),p={selector:{borderWidth:1,height:32,width:100},option:{}},Ae={combinatorOption:p.option,combinatorSelector:p.selector,dragHandle:{},fieldOption:p.option,fieldSelector:p.selector,inlineCombinator:{},notToggle:{flexDirection:"row"},notToggleLabel:{},notToggleSwitch:{},operatorOption:p.option,operatorSelector:p.selector,rule:{flexDirection:"row",paddingBottom:10},ruleGroup:{backgroundColor:"rgba(0, 75, 183, 0.2)",borderColor:"#8081a2",borderRadius:4,borderWidth:1,marginBottom:10},ruleGroupBody:{paddingTop:10,paddingRight:10,paddingLeft:10},ruleGroupHeader:{flexDirection:"row",paddingTop:10,paddingRight:10,paddingLeft:10},shiftActions:{flexDirection:"column"},value:{borderWidth:1,height:32,width:150},valueEditorOption:p.option,valueEditorSelector:p.selector,valueEditorSwitch:{},valueList:{flexDirection:"row"},valueSourceOption:p.option,valueSourceSelector:p.selector},r=ne.StyleSheet.create(Ae);var U=({component:t,path:o,...e})=>{let i=(0,ae.useMemo)(()=>({inlineCombinator:D.StyleSheet.flatten([r.inlineCombinator,e.schema.styles?.inlineCombinator])}),[e.schema.styles?.inlineCombinator]);return _.createElement(D.View,{style:i.inlineCombinator,key:"no-dnd",testID:K.TestID.inlineCombinator},_.createElement(t,{...e,path:o,testID:K.TestID.combinators}))};var L=y(require("react")),pe=require("react"),f=require("react-native");var $=({handleOnChange:t,label:o,checked:e,disabled:i,schema:s,testID:n})=>{let l=(0,pe.useMemo)(()=>({notToggle:f.StyleSheet.flatten([r.notToggle,s.styles?.notToggle]),notToggleLabel:f.StyleSheet.flatten([r.notToggleLabel,s.styles?.notToggleLabel]),notToggleSwitch:f.StyleSheet.flatten([r.notToggleSwitch,s.styles?.notToggleSwitch])}),[s.styles?.notToggle,s.styles?.notToggleLabel,s.styles?.notToggleSwitch]);return L.createElement(f.View,{style:l.notToggle,testID:n},L.createElement(f.Text,{style:l.notToggleLabel},o),L.createElement(f.Switch,{style:l.notToggleSwitch,disabled:i,value:e,onValueChange:u=>t(u)}))};var C=y(require("react")),T=require("react-native");var z=({shiftUp:t,shiftDown:o,shiftUpDisabled:e,shiftDownDisabled:i,disabled:s,labels:n,testID:l,schema:{styles:u}})=>{let R=C.useMemo(()=>({shiftActions:T.StyleSheet.flatten([r.shiftActions,u?.shiftActions])}),[u?.shiftActions]);return C.createElement(T.View,{testID:l,style:R.shiftActions},C.createElement(T.Button,{disabled:s||e,onPress:t,accessibilityLabel:n?.shiftUp,title:n?.shiftUp}),C.createElement(T.Button,{disabled:s||i,onPress:o,accessibilityLabel:n?.shiftDown,title:n?.shiftDown}))};var N=y(require("react")),ye=require("react"),c=require("react-native"),O=require("react-querybuilder");var me=y(require("react")),ce=require("react"),a=require("react-native"),v=require("react-querybuilder");var m=({handleOnChange:t,options:o,value:e,disabled:i,multiple:s,listsAsArrays:n,schema:l,testID:u})=>{let R=(0,ce.useMemo)(()=>u===v.TestID.combinators?{selector:a.StyleSheet.flatten([r.combinatorSelector,l.styles?.combinatorSelector]),option:a.StyleSheet.flatten([r.combinatorOption,l.styles?.combinatorOption])}:u===v.TestID.fields?{selector:a.StyleSheet.flatten([r.fieldSelector,l.styles?.fieldSelector]),option:a.StyleSheet.flatten([r.fieldOption,l.styles?.fieldOption])}:u===v.TestID.operators?{selector:a.StyleSheet.flatten([r.operatorSelector,l.styles?.operatorSelector]),option:a.StyleSheet.flatten([r.operatorOption,l.styles?.operatorOption])}:u===v.TestID.valueSourceSelector?{selector:a.StyleSheet.flatten([r.valueSourceSelector,l.styles?.valueSourceSelector]),option:a.StyleSheet.flatten([r.valueSourceOption,l.styles?.valueSourceOption])}:u===v.TestID.valueEditor?{selector:a.StyleSheet.flatten([r.valueEditorSelector,l.styles?.valueEditorSelector]),option:a.StyleSheet.flatten([r.valueEditorOption,l.styles?.valueEditorOption])}:a.StyleSheet.create(p),[l.styles?.combinatorOption,l.styles?.combinatorSelector,l.styles?.fieldOption,l.styles?.fieldSelector,l.styles?.operatorOption,l.styles?.operatorSelector,l.styles?.valueEditorOption,l.styles?.valueEditorSelector,l.styles?.valueSourceOption,l.styles?.valueSourceSelector,u]),{onChange:A}=(0,v.useValueSelector)({handleOnChange:t,listsAsArrays:n,multiple:s,value:e}),H=s&&Array.isArray(e)?(0,v.joinWith)(e,","):e;return me.createElement(a.TextInput,{testID:u,"aria-disabled":i,style:R.selector,value:H,onChangeText:A})};var V=({operator:t,value:o,handleOnChange:e,title:i,className:s,type:n="text",inputType:l="text",values:u=[],listsAsArrays:R,parseNumbers:A,fieldData:H,disabled:k,separator:Te=null,skipHook:Ce=!1,testID:w,selectorComponent:ee=m,...S})=>{let B=(0,ye.useMemo)(()=>({value:c.StyleSheet.flatten([r.value,S.schema.styles?.value]),valueEditorSwitch:c.StyleSheet.flatten([r.valueEditorSwitch,S.schema.styles?.valueEditorSwitch]),valueList:c.StyleSheet.flatten([r.valueList,S.schema.styles?.valueList])}),[S.schema.styles?.value,S.schema.styles?.valueEditorSwitch,S.schema.styles?.valueList]),{valueAsArray:te,multiValueHandler:oe}=(0,O.useValueEditor)({skipHook:Ce,handleOnChange:e,inputType:l,operator:t,value:o,type:n,listsAsArrays:R,parseNumbers:A,values:u});if(t==="null"||t==="notNull")return null;let M=H?.placeholder??"",re="default";if((t==="between"||t==="notBetween")&&(n==="select"||n==="text")){let x=["from","to"].map((le,Q)=>n==="text"?N.createElement(c.TextInput,{key:le,style:B.value,keyboardType:re,placeholder:M,value:te[Q]??"",onChangeText:j=>oe(j,Q)}):N.createElement(ee,{...S,key:le,handleOnChange:j=>oe(j,Q),className:s,disabled:k,value:te[Q]??(0,O.getFirstOption)(u),options:u,listsAsArrays:R}));return N.createElement(c.View,{testID:w,style:B.valueList},x[0],Te,x[1])}switch(n){case"select":case"multiselect":return N.createElement(ee,{...S,testID:w,className:s,title:i,handleOnChange:e,disabled:k,value:o,options:u,multiple:n==="multiselect",listsAsArrays:R});case"textarea":return N.createElement(c.TextInput,{testID:w,style:B.value,placeholder:M,value:o,onChangeText:x=>e(x)});case"switch":case"checkbox":return N.createElement(c.Switch,{testID:w,style:B.valueEditorSwitch,disabled:k,value:!!o,onValueChange:x=>e(x)})}return N.createElement(c.TextInput,{testID:w,style:B.value,keyboardType:re,placeholder:M,value:o,onChangeText:x=>e((0,O.parseNumber)(x,{parseNumbers:A}))})};var fe=y(require("react"));var de=y(require("react"));var b=t=>de.createElement(m,{...t});var J=t=>fe.createElement(V,{...t,selectorComponent:b});var E=y(require("react")),Ge=require("react"),G=require("react-querybuilder"),Re=require("react-redux");var xe=require("react");var F=y(require("react")),ve=require("react"),g=require("react-native"),h=require("react-querybuilder");var X=t=>{let o=(0,h.useRuleGroup)(t),e=o.schema,i=(0,ve.useMemo)(()=>({ruleGroup:g.StyleSheet.flatten([r.ruleGroup,e.styles?.ruleGroup]),ruleGroupHeader:g.StyleSheet.flatten([r.ruleGroupHeader,e.styles?.ruleGroupHeader]),ruleGroupBody:g.StyleSheet.flatten([r.ruleGroupBody,e.styles?.ruleGroupBody])}),[e.styles?.ruleGroup,e.styles?.ruleGroupBody,e.styles?.ruleGroupHeader]);return F.createElement(g.View,{style:i.ruleGroup,testID:h.TestID.ruleGroup},F.createElement(g.View,{style:i.ruleGroupHeader},F.createElement(h.RuleGroupHeaderComponents,{...o})),F.createElement(g.View,{style:i.ruleGroupBody},F.createElement(h.RuleGroupBodyComponents,{...o})))};var Y=y(require("react")),Se=require("react"),q=require("react-native"),P=require("react-querybuilder");var Z=t=>{let o=(0,P.useRule)(t),e=o.schema,i=(0,Se.useMemo)(()=>({rule:q.StyleSheet.flatten([r.rule,e.styles?.rule])}),[e.styles?.rule]);return Y.createElement(q.View,{style:i.rule,testID:P.TestID.rule},Y.createElement(P.RuleComponents,{...o}))};var W={actionElement:d,addGroupAction:d,addRuleAction:d,cloneGroupAction:d,cloneRuleAction:d,combinatorSelector:m,dragHandle:(0,xe.forwardRef)(()=>null),fieldSelector:m,inlineCombinator:U,lockGroupAction:d,lockRuleAction:d,notToggle:$,operatorSelector:m,removeGroupAction:d,removeRuleAction:d,rule:Z,ruleGroup:X,shiftActions:z,valueEditor:V,valueSelector:m,valueSourceSelector:m},Qe={...W,combinatorSelector:b,fieldSelector:b,operatorSelector:b,valueEditor:J,valueSelector:m,valueSourceSelector:b};var Ne=require("react"),be=require("react-native"),ge=require("react-querybuilder"),he=(t,o)=>{let e=(0,ge.useQueryBuilderSchema)(t,o);return e.schema.styles=(0,Ne.useMemo)(()=>be.StyleSheet.create(t.styles??{}),[t.styles]),e};var Ie=[],De=({props:t,setup:o})=>{let e=he(t,o),{ruleGroup:i}=e.schema.controls;return E.createElement(G.QueryBuilderContext.Provider,{value:e.rqbContext},E.createElement(i,{ruleGroup:e.rootGroup,...e.combinatorPropObject,path:Ie,translations:e.translations,schema:e.schema,actions:e.actions,id:e.rootGroup.id,disabled:e.rootGroupDisabled,parentDisabled:e.queryDisabled,context:e.context}))},Le=t=>{let o=(0,Ge.useMemo)(()=>({...W,...t.controlElements}),[t.controlElements]),e=(0,G.useQueryBuilderSetup)({...t,controlElements:o});return E.createElement(Re.Provider,{context:G.QueryBuilderStateContext,store:G.queryBuilderStore},E.createElement(De,{props:t,setup:e}))};0&&(module.exports={NativeActionElement,NativeInlineCombinator,NativeNotToggle,NativeShiftActions,NativeValueEditor,NativeValueEditorWeb,NativeValueSelector,NativeValueSelectorWeb,QueryBuilderNative,RuleGroupNative,RuleNative,defaultNativeControlElements,defaultNativeSelectStyles,defaultNativeStyles,defaultNativeWebControlElements}); | ||
"use strict";var Fe=Object.create;var D=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty;var Ve=(t,o)=>{for(var e in o)D(t,e,{get:o[e],enumerable:!0})},ie=(t,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of Pe(o))!Be.call(t,s)&&s!==e&&D(t,s,{get:()=>o[s],enumerable:!(i=Oe(o,s))||i.enumerable});return t};var y=(t,o,e)=>(e=t!=null?Fe(we(t)):{},ie(o||!t||!t.__esModule?D(e,"default",{value:t,enumerable:!0}):e,t)),Ee=t=>ie(D({},"__esModule",{value:!0}),t);var qe={};Ve(qe,{NativeActionElement:()=>d,NativeInlineCombinator:()=>U,NativeNotToggle:()=>$,NativeShiftActions:()=>z,NativeValueEditor:()=>V,NativeValueEditorWeb:()=>J,NativeValueSelector:()=>m,NativeValueSelectorWeb:()=>N,QueryBuilderNative:()=>Le,RuleGroupNative:()=>X,RuleNative:()=>Z,defaultNativeControlElements:()=>H,defaultNativeSelectStyles:()=>p,defaultNativeStyles:()=>r,defaultNativeWebControlElements:()=>Qe});module.exports=Ee(qe);var se=y(require("react")),ue=require("react-native"),d=({handleOnClick:t,label:o,disabled:e,disabledTranslation:i,testID:s})=>se.createElement(ue.Button,{testID:s,disabled:e&&!i,title:`${i&&e?i.label??"":o??""}`,onPress:n=>t()});var _=y(require("react")),ae=require("react"),I=require("react-native"),K=require("react-querybuilder");var ne=require("react-native"),p={selector:{borderWidth:1,height:32,width:100},option:{}},Ae={combinatorOption:p.option,combinatorSelector:p.selector,dragHandle:{},fieldOption:p.option,fieldSelector:p.selector,inlineCombinator:{},notToggle:{flexDirection:"row"},notToggleLabel:{},notToggleSwitch:{},operatorOption:p.option,operatorSelector:p.selector,rule:{flexDirection:"row",paddingBottom:10},ruleGroup:{backgroundColor:"rgba(0, 75, 183, 0.2)",borderColor:"#8081a2",borderRadius:4,borderWidth:1,marginBottom:10},ruleGroupBody:{paddingTop:10,paddingRight:10,paddingLeft:10},ruleGroupHeader:{flexDirection:"row",paddingTop:10,paddingRight:10,paddingLeft:10},shiftActions:{flexDirection:"column"},value:{borderWidth:1,height:32,width:150},valueEditorOption:p.option,valueEditorSelector:p.selector,valueEditorSwitch:{},valueList:{flexDirection:"row"},valueSourceOption:p.option,valueSourceSelector:p.selector},r=ne.StyleSheet.create(Ae);var U=({component:t,path:o,...e})=>{let i=(0,ae.useMemo)(()=>({inlineCombinator:I.StyleSheet.flatten([r.inlineCombinator,e.schema.styles?.inlineCombinator])}),[e.schema.styles?.inlineCombinator]);return _.createElement(I.View,{style:i.inlineCombinator,key:"no-dnd",testID:K.TestID.inlineCombinator},_.createElement(t,{...e,path:o,testID:K.TestID.combinators}))};var L=y(require("react")),pe=require("react"),f=require("react-native");var $=({handleOnChange:t,label:o,checked:e,disabled:i,schema:s,testID:n})=>{let l=(0,pe.useMemo)(()=>({notToggle:f.StyleSheet.flatten([r.notToggle,s.styles?.notToggle]),notToggleLabel:f.StyleSheet.flatten([r.notToggleLabel,s.styles?.notToggleLabel]),notToggleSwitch:f.StyleSheet.flatten([r.notToggleSwitch,s.styles?.notToggleSwitch])}),[s.styles?.notToggle,s.styles?.notToggleLabel,s.styles?.notToggleSwitch]);return L.createElement(f.View,{style:l.notToggle,testID:n},L.createElement(f.Text,{style:l.notToggleLabel},o),L.createElement(f.Switch,{style:l.notToggleSwitch,disabled:i,value:e,onValueChange:u=>t(u)}))};var T=y(require("react")),C=require("react-native");var z=({shiftUp:t,shiftDown:o,shiftUpDisabled:e,shiftDownDisabled:i,disabled:s,labels:n,testID:l,schema:{styles:u}})=>{let R=T.useMemo(()=>({shiftActions:C.StyleSheet.flatten([r.shiftActions,u?.shiftActions])}),[u?.shiftActions]);return T.createElement(C.View,{testID:l,style:R.shiftActions},T.createElement(C.Button,{disabled:s||e,onPress:t,accessibilityLabel:n?.shiftUp,title:n?.shiftUp}),T.createElement(C.Button,{disabled:s||i,onPress:o,accessibilityLabel:n?.shiftDown,title:n?.shiftDown}))};var b=y(require("react")),ye=require("react"),c=require("react-native"),F=require("react-querybuilder");var me=y(require("react")),ce=require("react"),a=require("react-native"),v=require("react-querybuilder");var m=({handleOnChange:t,options:o,value:e,disabled:i,multiple:s,listsAsArrays:n,schema:l,testID:u})=>{let R=(0,ce.useMemo)(()=>u===v.TestID.combinators?{selector:a.StyleSheet.flatten([r.combinatorSelector,l.styles?.combinatorSelector]),option:a.StyleSheet.flatten([r.combinatorOption,l.styles?.combinatorOption])}:u===v.TestID.fields?{selector:a.StyleSheet.flatten([r.fieldSelector,l.styles?.fieldSelector]),option:a.StyleSheet.flatten([r.fieldOption,l.styles?.fieldOption])}:u===v.TestID.operators?{selector:a.StyleSheet.flatten([r.operatorSelector,l.styles?.operatorSelector]),option:a.StyleSheet.flatten([r.operatorOption,l.styles?.operatorOption])}:u===v.TestID.valueSourceSelector?{selector:a.StyleSheet.flatten([r.valueSourceSelector,l.styles?.valueSourceSelector]),option:a.StyleSheet.flatten([r.valueSourceOption,l.styles?.valueSourceOption])}:u===v.TestID.valueEditor?{selector:a.StyleSheet.flatten([r.valueEditorSelector,l.styles?.valueEditorSelector]),option:a.StyleSheet.flatten([r.valueEditorOption,l.styles?.valueEditorOption])}:a.StyleSheet.create(p),[l.styles?.combinatorOption,l.styles?.combinatorSelector,l.styles?.fieldOption,l.styles?.fieldSelector,l.styles?.operatorOption,l.styles?.operatorSelector,l.styles?.valueEditorOption,l.styles?.valueEditorSelector,l.styles?.valueSourceOption,l.styles?.valueSourceSelector,u]),{onChange:A}=(0,v.useValueSelector)({handleOnChange:t,listsAsArrays:n,multiple:s,value:e}),W=s&&Array.isArray(e)?(0,v.joinWith)(e,","):e;return me.createElement(a.TextInput,{testID:u,"aria-disabled":i,style:R.selector,value:W,onChangeText:A})};var V=({operator:t,value:o,handleOnChange:e,title:i,className:s,type:n="text",inputType:l="text",values:u=[],listsAsArrays:R,parseNumbers:A,fieldData:W,disabled:k,separator:Ce=null,skipHook:Te=!1,testID:w,selectorComponent:ee=m,...S})=>{let B=(0,ye.useMemo)(()=>({value:c.StyleSheet.flatten([r.value,S.schema.styles?.value]),valueEditorSwitch:c.StyleSheet.flatten([r.valueEditorSwitch,S.schema.styles?.valueEditorSwitch]),valueList:c.StyleSheet.flatten([r.valueList,S.schema.styles?.valueList])}),[S.schema.styles?.value,S.schema.styles?.valueEditorSwitch,S.schema.styles?.valueList]),{valueAsArray:te,multiValueHandler:oe}=(0,F.useValueEditor)({skipHook:Te,handleOnChange:e,inputType:l,operator:t,value:o,type:n,listsAsArrays:R,parseNumbers:A,values:u});if(t==="null"||t==="notNull")return null;let M=W?.placeholder??"",re="default";if((t==="between"||t==="notBetween")&&(n==="select"||n==="text")){let x=["from","to"].map((le,Q)=>n==="text"?b.createElement(c.TextInput,{key:le,style:B.value,keyboardType:re,placeholder:M,value:te[Q]??"",onChangeText:j=>oe(j,Q)}):b.createElement(ee,{...S,key:le,handleOnChange:j=>oe(j,Q),className:s,disabled:k,value:te[Q]??(0,F.getFirstOption)(u),options:u,listsAsArrays:R}));return b.createElement(c.View,{testID:w,style:B.valueList},x[0],Ce,x[1])}switch(n){case"select":case"multiselect":return b.createElement(ee,{...S,testID:w,className:s,title:i,handleOnChange:e,disabled:k,value:o,options:u,multiple:n==="multiselect",listsAsArrays:R});case"textarea":return b.createElement(c.TextInput,{testID:w,style:B.value,placeholder:M,value:o,onChangeText:x=>e(x)});case"switch":case"checkbox":return b.createElement(c.Switch,{testID:w,style:B.valueEditorSwitch,disabled:k,value:!!o,onValueChange:x=>e(x)})}return b.createElement(c.TextInput,{testID:w,style:B.value,keyboardType:re,placeholder:M,value:o,onChangeText:x=>e((0,F.parseNumber)(x,{parseNumbers:A}))})};var fe=y(require("react"));var de=y(require("react"));var N=t=>de.createElement(m,{...t});var J=t=>fe.createElement(V,{...t,selectorComponent:N});var E=y(require("react")),Ge=require("react"),G=require("react-querybuilder"),Re=require("react-redux");var xe=require("react");var O=y(require("react")),ve=require("react"),g=require("react-native"),h=require("react-querybuilder");var X=t=>{let o=(0,h.useRuleGroup)(t),e=o.schema,i=(0,ve.useMemo)(()=>({ruleGroup:g.StyleSheet.flatten([r.ruleGroup,e.styles?.ruleGroup]),ruleGroupHeader:g.StyleSheet.flatten([r.ruleGroupHeader,e.styles?.ruleGroupHeader]),ruleGroupBody:g.StyleSheet.flatten([r.ruleGroupBody,e.styles?.ruleGroupBody])}),[e.styles?.ruleGroup,e.styles?.ruleGroupBody,e.styles?.ruleGroupHeader]);return O.createElement(g.View,{style:i.ruleGroup,testID:h.TestID.ruleGroup},O.createElement(g.View,{style:i.ruleGroupHeader},O.createElement(h.RuleGroupHeaderComponents,{...o})),O.createElement(g.View,{style:i.ruleGroupBody},O.createElement(h.RuleGroupBodyComponents,{...o})))};var Y=y(require("react")),Se=require("react"),q=require("react-native"),P=require("react-querybuilder");var Z=t=>{let o=(0,P.useRule)(t),e=o.schema,i=(0,Se.useMemo)(()=>({rule:q.StyleSheet.flatten([r.rule,e.styles?.rule])}),[e.styles?.rule]);return Y.createElement(q.View,{style:i.rule,testID:P.TestID.rule},Y.createElement(P.RuleComponents,{...o}))};var H={actionElement:d,addGroupAction:d,addRuleAction:d,cloneGroupAction:d,cloneRuleAction:d,combinatorSelector:m,dragHandle:(0,xe.forwardRef)(()=>null),fieldSelector:m,inlineCombinator:U,lockGroupAction:d,lockRuleAction:d,notToggle:$,operatorSelector:m,removeGroupAction:d,removeRuleAction:d,rule:Z,ruleGroup:X,shiftActions:z,valueEditor:V,valueSelector:m,valueSourceSelector:m},Qe={...H,combinatorSelector:N,fieldSelector:N,operatorSelector:N,valueEditor:J,valueSelector:m,valueSourceSelector:N};var be=require("react"),Ne=require("react-native"),ge=require("react-querybuilder"),he=(t,o)=>{let e=(0,ge.useQueryBuilderSchema)(t,o),i=(0,be.useMemo)(()=>Ne.StyleSheet.create(t.styles??{}),[t.styles]);return{...e,schema:{...e.schema,styles:i}}};var De=[],Ie=({props:t,setup:o})=>{let e=he(t,o),{ruleGroup:i}=e.schema.controls;return E.createElement(G.QueryBuilderContext.Provider,{value:e.rqbContext},E.createElement(i,{ruleGroup:e.rootGroup,...e.combinatorPropObject,path:De,translations:e.translations,schema:e.schema,actions:e.actions,id:e.rootGroup.id,disabled:e.rootGroupDisabled,parentDisabled:e.queryDisabled,context:e.context}))},Le=t=>{let o=(0,Ge.useMemo)(()=>({...H,...t.controlElements}),[t.controlElements]),e=(0,G.useQueryBuilderSetup)({...t,controlElements:o});return E.createElement(Re.Provider,{context:G.QueryBuilderStateContext,store:G.queryBuilderStore},E.createElement(Ie,{props:t,setup:e}))};0&&(module.exports={NativeActionElement,NativeInlineCombinator,NativeNotToggle,NativeShiftActions,NativeValueEditor,NativeValueEditorWeb,NativeValueSelector,NativeValueSelectorWeb,QueryBuilderNative,RuleGroupNative,RuleNative,defaultNativeControlElements,defaultNativeSelectStyles,defaultNativeStyles,defaultNativeWebControlElements}); | ||
//# sourceMappingURL=react-querybuilder_native.cjs.production.js.map |
@@ -595,10 +595,7 @@ var __defProp = Object.defineProperty; | ||
const qb = useQueryBuilderSchema(props, setup); | ||
qb.schema.styles = useMemo8( | ||
() => { | ||
var _a; | ||
return StyleSheet9.create((_a = props.styles) != null ? _a : {}); | ||
}, | ||
[props.styles] | ||
); | ||
return qb; | ||
const styles = useMemo8(() => { | ||
var _a; | ||
return StyleSheet9.create((_a = props.styles) != null ? _a : {}); | ||
}, [props.styles]); | ||
return __spreadProps(__spreadValues({}, qb), { schema: __spreadProps(__spreadValues({}, qb.schema), { styles }) }); | ||
}; | ||
@@ -605,0 +602,0 @@ |
{ | ||
"name": "@react-querybuilder/native", | ||
"description": "React Native components for react-querybuilder", | ||
"version": "7.4.0", | ||
"version": "7.4.1", | ||
"publishConfig": { | ||
@@ -41,13 +41,13 @@ "access": "public" | ||
"devDependencies": { | ||
"@babel/preset-flow": "^7.24.1", | ||
"@babel/preset-flow": "^7.24.6", | ||
"@testing-library/jest-native": "^5.4.3", | ||
"@testing-library/react-native": "^12.5.0", | ||
"@types/react": "^18.3.1", | ||
"@testing-library/react-native": "^12.5.1", | ||
"@types/react": "^18.3.3", | ||
"@types/react-test-renderer": "^18.3.0", | ||
"@vitejs/plugin-react-swc": "^3.6.0", | ||
"@vitejs/plugin-react-swc": "^3.7.0", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-native": "~0.74.1", | ||
"react-native-web": "~0.19.11", | ||
"react-querybuilder": "^7.4.0", | ||
"react-native-web": "~0.19.12", | ||
"react-querybuilder": "^7.4.1", | ||
"react-redux": "^9.1.2", | ||
@@ -57,10 +57,10 @@ "react-test-renderer": "^18.3.1", | ||
"typescript": "^5.4.5", | ||
"vite": "^5.2.11" | ||
"vite": "^5.2.12" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=18", | ||
"react-querybuilder": "^7.4.0", | ||
"react-querybuilder": "^7.4.1", | ||
"react-redux": "^9.1.0" | ||
}, | ||
"gitHead": "f5ce82d93eccd37d0fbe357e2268934a4e0341da" | ||
"gitHead": "6ec59eaa81a3eddee9842e1e8efa262720d81eb0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
324997
2230