@react-querybuilder/native
Advanced tools
Comparing version 7.0.0-rc.0 to 7.0.0-rc.1
@@ -18,4 +18,4 @@ import * as react from 'react'; | ||
} | ||
interface WithSchemaNative { | ||
schema: SchemaNative<any, any>; | ||
interface WithSchemaNative<F extends FullField = FullField, O extends string = string> { | ||
schema: SchemaNative<F, O>; | ||
} | ||
@@ -137,3 +137,3 @@ type QueryBuilderNativeStyles = { | ||
}; | ||
dragHandle: react.ForwardRefExoticComponent<Omit<react_querybuilder.DragHandleProps & react.RefAttributes<any>, "ref"> & react.RefAttributes<any>>; | ||
dragHandle: react.ForwardRefExoticComponent<Omit<react_querybuilder.DragHandleProps & react.RefAttributes<HTMLElement>, "ref"> & react.RefAttributes<HTMLElement>>; | ||
fieldSelector: { | ||
@@ -238,3 +238,3 @@ <Opt extends react_querybuilder.FullOption<string> = react_querybuilder.FullOption<string>>({ handleOnChange, options: _options, value, disabled, multiple, listsAsArrays, schema, testID, }: ValueSelectorNativeProps<Opt>): react.JSX.Element; | ||
}; | ||
dragHandle: react.ForwardRefExoticComponent<Omit<react_querybuilder.DragHandleProps & react.RefAttributes<any>, "ref"> & react.RefAttributes<any>>; | ||
dragHandle: react.ForwardRefExoticComponent<Omit<react_querybuilder.DragHandleProps & react.RefAttributes<HTMLElement>, "ref"> & react.RefAttributes<HTMLElement>>; | ||
inlineCombinator: { | ||
@@ -241,0 +241,0 @@ ({ component: CombinatorSelectorComponent, path, independentCombinators: _independentCombinators, ...props }: InlineCombinatorNativeProps): react.JSX.Element; |
@@ -66,3 +66,3 @@ "use strict"; | ||
title: `${disabledTranslation && disabled ? disabledTranslation.label ?? "" : label ?? ""}`, | ||
onPress: (e) => handleOnClick(e) | ||
onPress: (_e) => handleOnClick() | ||
} | ||
@@ -69,0 +69,0 @@ ); |
@@ -18,4 +18,4 @@ import * as react from 'react'; | ||
} | ||
interface WithSchemaNative { | ||
schema: SchemaNative<any, any>; | ||
interface WithSchemaNative<F extends FullField = FullField, O extends string = string> { | ||
schema: SchemaNative<F, O>; | ||
} | ||
@@ -137,3 +137,3 @@ type QueryBuilderNativeStyles = { | ||
}; | ||
dragHandle: react.ForwardRefExoticComponent<Omit<react_querybuilder.DragHandleProps & react.RefAttributes<any>, "ref"> & react.RefAttributes<any>>; | ||
dragHandle: react.ForwardRefExoticComponent<Omit<react_querybuilder.DragHandleProps & react.RefAttributes<HTMLElement>, "ref"> & react.RefAttributes<HTMLElement>>; | ||
fieldSelector: { | ||
@@ -238,3 +238,3 @@ <Opt extends react_querybuilder.FullOption<string> = react_querybuilder.FullOption<string>>({ handleOnChange, options: _options, value, disabled, multiple, listsAsArrays, schema, testID, }: ValueSelectorNativeProps<Opt>): react.JSX.Element; | ||
}; | ||
dragHandle: react.ForwardRefExoticComponent<Omit<react_querybuilder.DragHandleProps & react.RefAttributes<any>, "ref"> & react.RefAttributes<any>>; | ||
dragHandle: react.ForwardRefExoticComponent<Omit<react_querybuilder.DragHandleProps & react.RefAttributes<HTMLElement>, "ref"> & react.RefAttributes<HTMLElement>>; | ||
inlineCombinator: { | ||
@@ -241,0 +241,0 @@ ({ component: CombinatorSelectorComponent, path, independentCombinators: _independentCombinators, ...props }: InlineCombinatorNativeProps): react.JSX.Element; |
@@ -1,2 +0,2 @@ | ||
"use strict";var Fe=Object.create;var D=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Ve=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var Ee=(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))!we.call(t,s)&&s!==e&&D(t,s,{get:()=>o[s],enumerable:!(i=Be(o,s))||i.enumerable});return t};var d=(t,o,e)=>(e=t!=null?Fe(Ve(t)):{},ie(o||!t||!t.__esModule?D(e,"default",{value:t,enumerable:!0}):e,t)),Ae=t=>ie(D({},"__esModule",{value:!0}),t);var We={};Ee(We,{NativeActionElement:()=>c,NativeInlineCombinator:()=>L,NativeNotToggle:()=>H,NativeShiftActions:()=>q,NativeValueEditor:()=>F,NativeValueEditorWeb:()=>Y,NativeValueSelector:()=>m,NativeValueSelectorWeb:()=>S,QueryBuilderNative:()=>Te,RuleGroupNative:()=>k,RuleNative:()=>j,defaultNativeControlElements:()=>_,defaultNativeSelectStyles:()=>p,defaultNativeStyles:()=>r,defaultNativeWebControlElements:()=>De});module.exports=Ae(We);var se=d(require("react")),ae=require("react-native"),c=({handleOnClick:t,label:o,disabled:e,disabledTranslation:i,testID:s})=>se.createElement(ae.Button,{testID:s,disabled:e&&!i,title:`${i&&e?i.label??"":o??""}`,onPress:a=>t(a)});c.displayName="NativeActionElement";var J=d(require("react")),ue=require("react"),I=require("react-native"),X=require("react-querybuilder");var ne=require("react-native"),p={selector:{borderWidth:1,height:32,width:100},option:{}},Qe={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(Qe);var L=({component:t,path:o,independentCombinators:e,...i})=>{let s=(0,ue.useMemo)(()=>({inlineCombinator:I.StyleSheet.flatten([r.inlineCombinator,i.schema.styles?.inlineCombinator])}),[i.schema.styles?.inlineCombinator]);return J.createElement(I.View,{style:s.inlineCombinator,key:"no-dnd",testID:X.TestID.inlineCombinator},J.createElement(t,{...i,path:o,testID:X.TestID.combinators}))};L.displayName="NativeInlineCombinator";var W=d(require("react")),pe=require("react"),f=require("react-native");var H=({handleOnChange:t,label:o,checked:e,disabled:i,schema:s,testID:a})=>{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 W.createElement(f.View,{style:l.notToggle,testID:a},W.createElement(f.Text,{style:l.notToggleLabel},o),W.createElement(f.Switch,{style:l.notToggleSwitch,disabled:i,value:e,onValueChange:n=>t(n)}))};H.displayName="NativeNotToggle";var R=d(require("react")),T=require("react-native");var q=({shiftUp:t,shiftDown:o,shiftUpDisabled:e,shiftDownDisabled:i,disabled:s,labels:a,testID:l,schema:{styles:n}})=>{let G=R.useMemo(()=>({shiftActions:T.StyleSheet.flatten([r.shiftActions,n?.shiftActions])}),[n?.shiftActions]);return R.createElement(T.View,{testID:l,style:G.shiftActions},R.createElement(T.Button,{disabled:s||e,onPress:t,accessibilityLabel:a?.shiftUp,title:a?.shiftUp}),R.createElement(T.Button,{disabled:s||i,onPress:o,accessibilityLabel:a?.shiftDown,title:a?.shiftDown}))};q.displayName="NativeShiftActions";var x=d(require("react")),ye=require("react"),y=require("react-native"),O=require("react-querybuilder");var me=d(require("react")),ce=require("react"),u=require("react-native"),v=require("react-querybuilder");var m=({handleOnChange:t,options:o,value:e,disabled:i,multiple:s,listsAsArrays:a,schema:l,testID:n})=>{let G=(0,ce.useMemo)(()=>n===v.TestID.combinators?{selector:u.StyleSheet.flatten([r.combinatorSelector,l.styles?.combinatorSelector]),option:u.StyleSheet.flatten([r.combinatorOption,l.styles?.combinatorOption])}:n===v.TestID.fields?{selector:u.StyleSheet.flatten([r.fieldSelector,l.styles?.fieldSelector]),option:u.StyleSheet.flatten([r.fieldOption,l.styles?.fieldOption])}:n===v.TestID.operators?{selector:u.StyleSheet.flatten([r.operatorSelector,l.styles?.operatorSelector]),option:u.StyleSheet.flatten([r.operatorOption,l.styles?.operatorOption])}:n===v.TestID.valueSourceSelector?{selector:u.StyleSheet.flatten([r.valueSourceSelector,l.styles?.valueSourceSelector]),option:u.StyleSheet.flatten([r.valueSourceOption,l.styles?.valueSourceOption])}:n===v.TestID.valueEditor?{selector:u.StyleSheet.flatten([r.valueEditorSelector,l.styles?.valueEditorSelector]),option:u.StyleSheet.flatten([r.valueEditorOption,l.styles?.valueEditorOption])}:u.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,n]),{onChange:A}=(0,v.useValueSelector)({handleOnChange:t,listsAsArrays:a,multiple:s,value:e}),K=s&&Array.isArray(e)?(0,v.joinWith)(e,","):e;return me.createElement(u.TextInput,{testID:n,"aria-disabled":i,style:G.selector,value:K,onChangeText:A})};m.displayName="NativeValueSelector";var F=({operator:t,value:o,handleOnChange:e,title:i,className:s,type:a="text",inputType:l="text",values:n=[],listsAsArrays:G,parseNumbers:A,fieldData:K,disabled:U,separator:Re=null,skipHook:Oe=!1,testID:V,selectorComponent:ee=m,...N})=>{let w=(0,ye.useMemo)(()=>({value:y.StyleSheet.flatten([r.value,N.schema.styles?.value]),valueEditorSwitch:y.StyleSheet.flatten([r.valueEditorSwitch,N.schema.styles?.valueEditorSwitch]),valueList:y.StyleSheet.flatten([r.valueList,N.schema.styles?.valueList])}),[N.schema.styles?.value,N.schema.styles?.valueEditorSwitch,N.schema.styles?.valueList]),{valueAsArray:te,multiValueHandler:oe}=(0,O.useValueEditor)({skipHook:Oe,handleOnChange:e,inputType:l,operator:t,value:o,type:a,listsAsArrays:G,parseNumbers:A,values:n});if(t==="null"||t==="notNull")return null;let $=K?.placeholder??"",re="default";if((t==="between"||t==="notBetween")&&(a==="select"||a==="text")){let b=["from","to"].map((le,Q)=>a==="text"?x.createElement(y.TextInput,{key:le,style:w.value,keyboardType:re,placeholder:$,value:te[Q]??"",onChangeText:z=>oe(z,Q)}):x.createElement(ee,{...N,key:le,handleOnChange:z=>oe(z,Q),className:s,disabled:U,value:te[Q]??(0,O.getFirstOption)(n),options:n,listsAsArrays:G}));return x.createElement(y.View,{testID:V,style:w.valueList},b[0],Re,b[1])}switch(a){case"select":case"multiselect":return x.createElement(ee,{...N,testID:V,className:s,title:i,handleOnChange:e,disabled:U,value:o,options:n,multiple:a==="multiselect",listsAsArrays:G});case"textarea":return x.createElement(y.TextInput,{testID:V,style:w.value,placeholder:$,value:o,onChangeText:b=>e(b)});case"switch":case"checkbox":return x.createElement(y.Switch,{testID:V,style:w.valueEditorSwitch,disabled:U,value:!!o,onValueChange:b=>e(b)})}return x.createElement(y.TextInput,{testID:V,style:w.value,keyboardType:re,placeholder:$,value:o,onChangeText:b=>e((0,O.parseNumber)(b,{parseNumbers:A}))})};F.displayName="NativeValueEditor";var fe=d(require("react"));var de=d(require("react"));var S=t=>de.createElement(m,{...t});S.displayName="NativeValueSelectorWeb";var Y=t=>fe.createElement(F,{...t,selectorComponent:S});var E=d(require("react")),Ce=require("react"),C=require("react-querybuilder"),Ge=require("react-redux");var Ne=require("react");var B=d(require("react")),ve=require("react"),g=require("react-native"),h=require("react-querybuilder");var k=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 B.createElement(g.View,{style:i.ruleGroup,testID:h.TestID.ruleGroup},B.createElement(g.View,{style:i.ruleGroupHeader},B.createElement(h.RuleGroupHeaderComponents,{...o})),B.createElement(g.View,{style:i.ruleGroupBody},B.createElement(h.RuleGroupBodyComponents,{...o})))};k.displayName="RuleGroupNative";var Z=d(require("react")),Se=require("react"),M=require("react-native"),P=require("react-querybuilder");var j=t=>{let o=(0,P.useRule)(t),e=o.schema,i=(0,Se.useMemo)(()=>({rule:M.StyleSheet.flatten([r.rule,e.styles?.rule])}),[e.styles?.rule]);return Z.createElement(M.View,{style:i.rule,testID:P.TestID.rule},Z.createElement(P.RuleComponents,{...o}))};j.displayName="RuleNative";var _={actionElement:c,addGroupAction:c,addRuleAction:c,cloneGroupAction:c,cloneRuleAction:c,combinatorSelector:m,dragHandle:(0,Ne.forwardRef)(()=>null),fieldSelector:m,inlineCombinator:L,lockGroupAction:c,lockRuleAction:c,notToggle:H,operatorSelector:m,removeGroupAction:c,removeRuleAction:c,rule:j,ruleGroup:k,shiftActions:q,valueEditor:F,valueSelector:m,valueSourceSelector:m},De={..._,combinatorSelector:S,fieldSelector:S,operatorSelector:S,valueEditor:Y,valueSelector:m,valueSourceSelector:S};var be=require("react"),xe=require("react-native"),ge=require("react-querybuilder"),he=(t,o)=>{let e=(0,ge.useQueryBuilderSchema)(t,o);return e.schema.styles=(0,be.useMemo)(()=>xe.StyleSheet.create(t.styles??{}),[t.styles]),e};var Ie=[],Le=({props:t,setup:o})=>{let e=he(t,o),{ruleGroup:i}=e.schema.controls;return E.createElement(C.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}))},Te=t=>{let o=(0,Ce.useMemo)(()=>({..._,...t.controlElements}),[t.controlElements]),e=(0,C.useQueryBuilderSetup)({...t,controlElements:o});return E.createElement(Ge.Provider,{context:C.QueryBuilderStateContext,store:C.queryBuilderStore},E.createElement(Le,{props:t,setup:e}))};Te.displayName="QueryBuilderNative";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 I=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Ve=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var Ee=(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 Be(o))!we.call(t,s)&&s!==e&&I(t,s,{get:()=>o[s],enumerable:!(i=Pe(o,s))||i.enumerable});return t};var d=(t,o,e)=>(e=t!=null?Fe(Ve(t)):{},ie(o||!t||!t.__esModule?I(e,"default",{value:t,enumerable:!0}):e,t)),Ae=t=>ie(I({},"__esModule",{value:!0}),t);var We={};Ee(We,{NativeActionElement:()=>c,NativeInlineCombinator:()=>L,NativeNotToggle:()=>q,NativeShiftActions:()=>H,NativeValueEditor:()=>F,NativeValueEditorWeb:()=>Y,NativeValueSelector:()=>m,NativeValueSelectorWeb:()=>S,QueryBuilderNative:()=>Ce,RuleGroupNative:()=>k,RuleNative:()=>_,defaultNativeControlElements:()=>j,defaultNativeSelectStyles:()=>p,defaultNativeStyles:()=>r,defaultNativeWebControlElements:()=>Ie});module.exports=Ae(We);var se=d(require("react")),ae=require("react-native"),c=({handleOnClick:t,label:o,disabled:e,disabledTranslation:i,testID:s})=>se.createElement(ae.Button,{testID:s,disabled:e&&!i,title:`${i&&e?i.label??"":o??""}`,onPress:n=>t()});c.displayName="NativeActionElement";var J=d(require("react")),ue=require("react"),D=require("react-native"),X=require("react-querybuilder");var ne=require("react-native"),p={selector:{borderWidth:1,height:32,width:100},option:{}},Qe={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(Qe);var L=({component:t,path:o,independentCombinators:e,...i})=>{let s=(0,ue.useMemo)(()=>({inlineCombinator:D.StyleSheet.flatten([r.inlineCombinator,i.schema.styles?.inlineCombinator])}),[i.schema.styles?.inlineCombinator]);return J.createElement(D.View,{style:s.inlineCombinator,key:"no-dnd",testID:X.TestID.inlineCombinator},J.createElement(t,{...i,path:o,testID:X.TestID.combinators}))};L.displayName="NativeInlineCombinator";var W=d(require("react")),pe=require("react"),f=require("react-native");var q=({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 W.createElement(f.View,{style:l.notToggle,testID:n},W.createElement(f.Text,{style:l.notToggleLabel},o),W.createElement(f.Switch,{style:l.notToggleSwitch,disabled:i,value:e,onValueChange:a=>t(a)}))};q.displayName="NativeNotToggle";var T=d(require("react")),C=require("react-native");var H=({shiftUp:t,shiftDown:o,shiftUpDisabled:e,shiftDownDisabled:i,disabled:s,labels:n,testID:l,schema:{styles:a}})=>{let R=T.useMemo(()=>({shiftActions:C.StyleSheet.flatten([r.shiftActions,a?.shiftActions])}),[a?.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}))};H.displayName="NativeShiftActions";var x=d(require("react")),ye=require("react"),y=require("react-native"),O=require("react-querybuilder");var me=d(require("react")),ce=require("react"),u=require("react-native"),v=require("react-querybuilder");var m=({handleOnChange:t,options:o,value:e,disabled:i,multiple:s,listsAsArrays:n,schema:l,testID:a})=>{let R=(0,ce.useMemo)(()=>a===v.TestID.combinators?{selector:u.StyleSheet.flatten([r.combinatorSelector,l.styles?.combinatorSelector]),option:u.StyleSheet.flatten([r.combinatorOption,l.styles?.combinatorOption])}:a===v.TestID.fields?{selector:u.StyleSheet.flatten([r.fieldSelector,l.styles?.fieldSelector]),option:u.StyleSheet.flatten([r.fieldOption,l.styles?.fieldOption])}:a===v.TestID.operators?{selector:u.StyleSheet.flatten([r.operatorSelector,l.styles?.operatorSelector]),option:u.StyleSheet.flatten([r.operatorOption,l.styles?.operatorOption])}:a===v.TestID.valueSourceSelector?{selector:u.StyleSheet.flatten([r.valueSourceSelector,l.styles?.valueSourceSelector]),option:u.StyleSheet.flatten([r.valueSourceOption,l.styles?.valueSourceOption])}:a===v.TestID.valueEditor?{selector:u.StyleSheet.flatten([r.valueEditorSelector,l.styles?.valueEditorSelector]),option:u.StyleSheet.flatten([r.valueEditorOption,l.styles?.valueEditorOption])}:u.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,a]),{onChange:A}=(0,v.useValueSelector)({handleOnChange:t,listsAsArrays:n,multiple:s,value:e}),K=s&&Array.isArray(e)?(0,v.joinWith)(e,","):e;return me.createElement(u.TextInput,{testID:a,"aria-disabled":i,style:R.selector,value:K,onChangeText:A})};m.displayName="NativeValueSelector";var F=({operator:t,value:o,handleOnChange:e,title:i,className:s,type:n="text",inputType:l="text",values:a=[],listsAsArrays:R,parseNumbers:A,fieldData:K,disabled:U,separator:Te=null,skipHook:Oe=!1,testID:V,selectorComponent:ee=m,...N})=>{let w=(0,ye.useMemo)(()=>({value:y.StyleSheet.flatten([r.value,N.schema.styles?.value]),valueEditorSwitch:y.StyleSheet.flatten([r.valueEditorSwitch,N.schema.styles?.valueEditorSwitch]),valueList:y.StyleSheet.flatten([r.valueList,N.schema.styles?.valueList])}),[N.schema.styles?.value,N.schema.styles?.valueEditorSwitch,N.schema.styles?.valueList]),{valueAsArray:te,multiValueHandler:oe}=(0,O.useValueEditor)({skipHook:Oe,handleOnChange:e,inputType:l,operator:t,value:o,type:n,listsAsArrays:R,parseNumbers:A,values:a});if(t==="null"||t==="notNull")return null;let $=K?.placeholder??"",re="default";if((t==="between"||t==="notBetween")&&(n==="select"||n==="text")){let b=["from","to"].map((le,Q)=>n==="text"?x.createElement(y.TextInput,{key:le,style:w.value,keyboardType:re,placeholder:$,value:te[Q]??"",onChangeText:z=>oe(z,Q)}):x.createElement(ee,{...N,key:le,handleOnChange:z=>oe(z,Q),className:s,disabled:U,value:te[Q]??(0,O.getFirstOption)(a),options:a,listsAsArrays:R}));return x.createElement(y.View,{testID:V,style:w.valueList},b[0],Te,b[1])}switch(n){case"select":case"multiselect":return x.createElement(ee,{...N,testID:V,className:s,title:i,handleOnChange:e,disabled:U,value:o,options:a,multiple:n==="multiselect",listsAsArrays:R});case"textarea":return x.createElement(y.TextInput,{testID:V,style:w.value,placeholder:$,value:o,onChangeText:b=>e(b)});case"switch":case"checkbox":return x.createElement(y.Switch,{testID:V,style:w.valueEditorSwitch,disabled:U,value:!!o,onValueChange:b=>e(b)})}return x.createElement(y.TextInput,{testID:V,style:w.value,keyboardType:re,placeholder:$,value:o,onChangeText:b=>e((0,O.parseNumber)(b,{parseNumbers:A}))})};F.displayName="NativeValueEditor";var fe=d(require("react"));var de=d(require("react"));var S=t=>de.createElement(m,{...t});S.displayName="NativeValueSelectorWeb";var Y=t=>fe.createElement(F,{...t,selectorComponent:S});var E=d(require("react")),Ge=require("react"),G=require("react-querybuilder"),Re=require("react-redux");var Ne=require("react");var P=d(require("react")),ve=require("react"),g=require("react-native"),h=require("react-querybuilder");var k=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 P.createElement(g.View,{style:i.ruleGroup,testID:h.TestID.ruleGroup},P.createElement(g.View,{style:i.ruleGroupHeader},P.createElement(h.RuleGroupHeaderComponents,{...o})),P.createElement(g.View,{style:i.ruleGroupBody},P.createElement(h.RuleGroupBodyComponents,{...o})))};k.displayName="RuleGroupNative";var Z=d(require("react")),Se=require("react"),M=require("react-native"),B=require("react-querybuilder");var _=t=>{let o=(0,B.useRule)(t),e=o.schema,i=(0,Se.useMemo)(()=>({rule:M.StyleSheet.flatten([r.rule,e.styles?.rule])}),[e.styles?.rule]);return Z.createElement(M.View,{style:i.rule,testID:B.TestID.rule},Z.createElement(B.RuleComponents,{...o}))};_.displayName="RuleNative";var j={actionElement:c,addGroupAction:c,addRuleAction:c,cloneGroupAction:c,cloneRuleAction:c,combinatorSelector:m,dragHandle:(0,Ne.forwardRef)(()=>null),fieldSelector:m,inlineCombinator:L,lockGroupAction:c,lockRuleAction:c,notToggle:q,operatorSelector:m,removeGroupAction:c,removeRuleAction:c,rule:_,ruleGroup:k,shiftActions:H,valueEditor:F,valueSelector:m,valueSourceSelector:m},Ie={...j,combinatorSelector:S,fieldSelector:S,operatorSelector:S,valueEditor:Y,valueSelector:m,valueSourceSelector:S};var be=require("react"),xe=require("react-native"),ge=require("react-querybuilder"),he=(t,o)=>{let e=(0,ge.useQueryBuilderSchema)(t,o);return e.schema.styles=(0,be.useMemo)(()=>xe.StyleSheet.create(t.styles??{}),[t.styles]),e};var De=[],Le=({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}))},Ce=t=>{let o=(0,Ge.useMemo)(()=>({...j,...t.controlElements}),[t.controlElements]),e=(0,G.useQueryBuilderSetup)({...t,controlElements:o});return E.createElement(Re.Provider,{context:G.QueryBuilderStateContext,store:G.queryBuilderStore},E.createElement(Le,{props:t,setup:e}))};Ce.displayName="QueryBuilderNative";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 |
@@ -50,3 +50,3 @@ var __defProp = Object.defineProperty; | ||
title: `${disabledTranslation && disabled ? (_a = disabledTranslation.label) != null ? _a : "" : label != null ? label : ""}`, | ||
onPress: (e) => handleOnClick(e) | ||
onPress: (_e) => handleOnClick() | ||
} | ||
@@ -53,0 +53,0 @@ ); |
{ | ||
"name": "@react-querybuilder/native", | ||
"description": "React Native components for react-querybuilder", | ||
"version": "7.0.0-rc.0", | ||
"version": "7.0.0-rc.1", | ||
"publishConfig": { | ||
@@ -51,3 +51,3 @@ "access": "public" | ||
"react-native-web": "~0.19.10", | ||
"react-querybuilder": "^7.0.0-rc.0", | ||
"react-querybuilder": "^7.0.0-rc.1", | ||
"react-redux": "^9.1.0", | ||
@@ -61,6 +61,6 @@ "react-test-renderer": "^18.2.0", | ||
"react": ">=16.8.0", | ||
"react-querybuilder": "^7.0.0-rc.0", | ||
"react-querybuilder": "^7.0.0-rc.1", | ||
"react-redux": "^9.1.0" | ||
}, | ||
"gitHead": "77ba04a15cc5cf6923dd92314e204efc67941fd6" | ||
"gitHead": "eb7197269a2993c50c9449fed55ed51c91f3b7ae" | ||
} |
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
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
342624