@react-querybuilder/native
Advanced tools
Comparing version 6.2.0 to 6.3.0-alpha.0
@@ -511,9 +511,4 @@ "use strict"; | ||
// ../ctx/dist/react-querybuilder_ctx.mjs | ||
// src/components/QueryBuilderNative.tsx | ||
var import_react9 = require("react"); | ||
var QueryBuilderContext = (0, import_react9.createContext)({}); | ||
QueryBuilderContext.displayName = "QueryBuilderContext"; | ||
// src/components/QueryBuilderNative.tsx | ||
var import_react10 = require("react"); | ||
var import_react_native9 = require("react-native"); | ||
@@ -523,3 +518,3 @@ var import_react_querybuilder6 = require("react-querybuilder"); | ||
var QueryBuilderNative = (props) => { | ||
const controlElements = (0, import_react10.useMemo)( | ||
const controlElements = (0, import_react9.useMemo)( | ||
() => ({ ...defaultNativeControlElements, ...props.controlElements }), | ||
@@ -529,5 +524,5 @@ [props.controlElements] | ||
const qb = (0, import_react_querybuilder6.useQueryBuilder)({ ...props, controlElements }); | ||
qb.schema.styles = (0, import_react10.useMemo)(() => import_react_native9.StyleSheet.create(props.styles ?? {}), [props.styles]); | ||
qb.schema.styles = (0, import_react9.useMemo)(() => import_react_native9.StyleSheet.create(props.styles ?? {}), [props.styles]); | ||
const { ruleGroup: RuleGroupComponent } = controlElements; | ||
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(QueryBuilderContext.Provider, { value: qb.rqbContext, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( | ||
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_querybuilder6.QueryBuilderContext.Provider, { value: qb.rqbContext, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( | ||
RuleGroupComponent, | ||
@@ -534,0 +529,0 @@ { |
@@ -1,2 +0,2 @@ | ||
"use strict";var K=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var Ge=Object.prototype.hasOwnProperty;var Ce=(t,e)=>{for(var o in e)K(t,o,{get:e[o],enumerable:!0})},Ve=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of he(e))!Ge.call(t,i)&&i!==o&&K(t,i,{get:()=>e[i],enumerable:!(a=xe(e,i))||a.enumerable});return t};var we=t=>Ve(K({},"__esModule",{value:!0}),t);var Be={};Ce(Be,{NativeActionElement:()=>c,NativeInlineCombinator:()=>A,NativeNotToggle:()=>I,NativeValueEditor:()=>G,NativeValueEditorWeb:()=>z,NativeValueSelector:()=>y,NativeValueSelectorWeb:()=>v,QueryBuilderNative:()=>ge,RuleGroupNative:()=>L,RuleNative:()=>Q,defaultNativeControlElements:()=>D,defaultNativeSelectStyles:()=>u,defaultNativeStyles:()=>r,defaultNativeWebControlElements:()=>Re});module.exports=we(Be);var fe=require("react");var oe=require("react-native"),re=require("react/jsx-runtime"),c=({handleOnClick:t,label:e,disabled:o,disabledTranslation:a,testID:i})=>(0,re.jsx)(oe.Button,{testID:i,disabled:o&&!a,title:a&&o?a.label??"":e??"",onPress:p=>t(p)});c.displayName="NativeActionElement";var ie=require("react"),O=require("react-native"),_=require("react-querybuilder");var le=require("react-native"),u={selector:{borderWidth:1,height:32,width:100},option:{}},Ee={combinatorOption:u.option,combinatorSelector:u.selector,dragHandle:{},fieldOption:u.option,fieldSelector:u.selector,inlineCombinator:{},notToggle:{flexDirection:"row"},notToggleLabel:{},notToggleSwitch:{},operatorOption:u.option,operatorSelector:u.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},value:{borderWidth:1,height:32,width:150},valueEditorOption:u.option,valueEditorSelector:u.selector,valueEditorSwitch:{},valueList:{flexDirection:"row"},valueSourceOption:u.option,valueSourceSelector:u.selector},r=le.StyleSheet.create(Ee);var F=require("react/jsx-runtime"),A=({component:t,path:e,independentCombinators:o,...a})=>{let i=(0,ie.useMemo)(()=>({inlineCombinator:O.StyleSheet.flatten([r.inlineCombinator,a.schema.styles?.inlineCombinator])}),[a.schema.styles?.inlineCombinator]);return(0,F.jsx)(O.View,{style:i.inlineCombinator,testID:_.TestID.inlineCombinator,children:(0,F.jsx)(t,{...a,path:e,testID:_.TestID.combinators})},"no-dnd")};A.displayName="NativeInlineCombinator";var ae=require("react"),d=require("react-native");var R=require("react/jsx-runtime"),I=({handleOnChange:t,label:e,checked:o,disabled:a,schema:i,testID:p})=>{let l=(0,ae.useMemo)(()=>({notToggle:d.StyleSheet.flatten([r.notToggle,i.styles?.notToggle]),notToggleLabel:d.StyleSheet.flatten([r.notToggleLabel,i.styles?.notToggleLabel]),notToggleSwitch:d.StyleSheet.flatten([r.notToggleSwitch,i.styles?.notToggleSwitch])}),[i.styles?.notToggle,i.styles?.notToggleLabel,i.styles?.notToggleSwitch]);return(0,R.jsxs)(d.View,{style:l.notToggle,testID:p,children:[(0,R.jsx)(d.Text,{style:l.notToggleLabel,children:e}),(0,R.jsx)(d.Switch,{style:l.notToggleSwitch,disabled:a,value:o,onValueChange:n=>t(n)})]})};I.displayName="NativeNotToggle";var ue=require("react"),m=require("react-native"),h=require("react-querybuilder");var ne=require("react"),s=require("react-native"),f=require("react-querybuilder");var se=require("react/jsx-runtime"),y=({handleOnChange:t,options:e,value:o,disabled:a,multiple:i,listsAsArrays:p,schema:l,testID:n})=>{let V=(0,ne.useMemo)(()=>n===f.TestID.combinators?{selector:s.StyleSheet.flatten([r.combinatorSelector,l.styles?.combinatorSelector]),option:s.StyleSheet.flatten([r.combinatorOption,l.styles?.combinatorOption])}:n===f.TestID.fields?{selector:s.StyleSheet.flatten([r.fieldSelector,l.styles?.fieldSelector]),option:s.StyleSheet.flatten([r.fieldOption,l.styles?.fieldOption])}:n===f.TestID.operators?{selector:s.StyleSheet.flatten([r.operatorSelector,l.styles?.operatorSelector]),option:s.StyleSheet.flatten([r.operatorOption,l.styles?.operatorOption])}:n===f.TestID.valueSourceSelector?{selector:s.StyleSheet.flatten([r.valueSourceSelector,l.styles?.valueSourceSelector]),option:s.StyleSheet.flatten([r.valueSourceOption,l.styles?.valueSourceOption])}:n===f.TestID.valueEditor?{selector:s.StyleSheet.flatten([r.valueEditorSelector,l.styles?.valueEditorSelector]),option:s.StyleSheet.flatten([r.valueEditorOption,l.styles?.valueEditorOption])}:s.StyleSheet.create(u),[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:B}=(0,f.useValueSelector)({handleOnChange:t,listsAsArrays:p,multiple:i,value:o}),H=i&&Array.isArray(o)?(0,f.joinWith)(o,","):o;return(0,se.jsx)(s.TextInput,{testID:n,"aria-disabled":a,style:V.selector,value:H,onChangeText:B})};y.displayName="NativeValueSelector";var g=require("react/jsx-runtime"),pe=require("react"),G=({operator:t,value:e,handleOnChange:o,title:a,className:i,type:p="text",inputType:l="text",values:n=[],listsAsArrays:V,parseNumbers:B,fieldData:H,disabled:k,separator:be=null,skipHook:Te=!1,testID:w,selectorComponent:Z=y,...S})=>{let E=(0,ue.useMemo)(()=>({value:m.StyleSheet.flatten([r.value,S.schema.styles?.value]),valueEditorSwitch:m.StyleSheet.flatten([r.valueEditorSwitch,S.schema.styles?.valueEditorSwitch]),valueList:m.StyleSheet.flatten([r.valueList,S.schema.styles?.valueList])}),[S.schema.styles?.value,S.schema.styles?.valueEditorSwitch,S.schema.styles?.valueList]),{valueAsArray:$,multiValueHandler:j}=(0,h.useValueEditor)({skipHook:Te,handleOnChange:o,inputType:l,operator:t,value:e,type:p,listsAsArrays:V,parseNumbers:B,values:n});if(t==="null"||t==="notNull")return null;let M=H?.placeholder??"",ee="default";if((t==="between"||t==="notBetween")&&(p==="select"||p==="text")){let N=["from","to"].map((te,P)=>p==="text"?(0,g.jsx)(m.TextInput,{style:E.value,keyboardType:ee,placeholder:M,value:$[P]??"",onChangeText:q=>j(q,P)},te):(0,pe.createElement)(Z,{...S,key:te,handleOnChange:q=>j(q,P),className:i,disabled:k,value:$[P]??(0,h.getFirstOption)(n),options:n,listsAsArrays:V}));return(0,g.jsxs)(m.View,{testID:w,style:E.valueList,children:[N[0],be,N[1]]})}switch(p){case"select":case"multiselect":return(0,g.jsx)(Z,{...S,testID:w,className:i,title:a,handleOnChange:o,disabled:k,value:e,options:n,multiple:p==="multiselect",listsAsArrays:V});case"textarea":return(0,g.jsx)(m.TextInput,{testID:w,style:E.value,placeholder:M,value:e,onChangeText:N=>o(N)});case"switch":case"checkbox":return(0,g.jsx)(m.Switch,{testID:w,style:E.valueEditorSwitch,disabled:k,value:!!e,onValueChange:N=>o(N)})}return(0,g.jsx)(m.TextInput,{testID:w,style:E.value,keyboardType:ee,placeholder:M,value:e,onChangeText:N=>o((0,h.parseNumber)(N,{parseNumbers:B}))})};G.displayName="NativeValueEditor";var me=require("react/jsx-runtime"),v=t=>(0,me.jsx)(y,{...t});v.displayName="NativeValueSelectorWeb";var ce=require("react/jsx-runtime"),z=t=>(0,ce.jsx)(G,{...t,selectorComponent:v});var ye=require("react"),b=require("react-native"),T=require("react-querybuilder");var x=require("react/jsx-runtime"),L=t=>{let e={...t,...(0,T.useRuleGroup)(t)},o=(0,ye.useMemo)(()=>({ruleGroup:b.StyleSheet.flatten([r.ruleGroup,e.schema.styles?.ruleGroup]),ruleGroupHeader:b.StyleSheet.flatten([r.ruleGroupHeader,e.schema.styles?.ruleGroupHeader]),ruleGroupBody:b.StyleSheet.flatten([r.ruleGroupBody,e.schema.styles?.ruleGroupBody])}),[e.schema.styles?.ruleGroup,e.schema.styles?.ruleGroupBody,e.schema.styles?.ruleGroupHeader]);return(0,x.jsxs)(b.View,{style:o.ruleGroup,testID:T.TestID.ruleGroup,children:[(0,x.jsx)(b.View,{style:o.ruleGroupHeader,children:(0,x.jsx)(T.RuleGroupHeaderComponents,{...e})}),(0,x.jsx)(b.View,{style:o.ruleGroupBody,children:(0,x.jsx)(T.RuleGroupBodyComponents,{...e})})]})};L.displayName="RuleGroupNative";var de=require("react"),W=require("react-native"),C=require("react-querybuilder");var J=require("react/jsx-runtime"),Q=t=>{let e={...t,...(0,C.useRule)(t)},o=(0,de.useMemo)(()=>({rule:W.StyleSheet.flatten([r.rule,e.schema.styles?.rule])}),[e.schema.styles?.rule]);return(0,J.jsx)(W.View,{style:o.rule,testID:C.TestID.rule,children:(0,J.jsx)(C.RuleComponents,{...e})})};Q.displayName="RuleNative";var D={addGroupAction:c,addRuleAction:c,cloneGroupAction:c,cloneRuleAction:c,combinatorSelector:y,dragHandle:(0,fe.forwardRef)(()=>null),fieldSelector:y,inlineCombinator:A,lockGroupAction:c,lockRuleAction:c,notToggle:I,operatorSelector:y,removeGroupAction:c,removeRuleAction:c,rule:Q,ruleGroup:L,valueEditor:G,valueSourceSelector:y},Re={...D,combinatorSelector:v,fieldSelector:v,operatorSelector:v,valueEditor:z,valueSourceSelector:v};var ve=require("react"),U=(0,ve.createContext)({});U.displayName="QueryBuilderContext";var X=require("react"),Se=require("react-native"),Ne=require("react-querybuilder");var Y=require("react/jsx-runtime"),ge=t=>{let e=(0,X.useMemo)(()=>({...D,...t.controlElements}),[t.controlElements]),o=(0,Ne.useQueryBuilder)({...t,controlElements:e});o.schema.styles=(0,X.useMemo)(()=>Se.StyleSheet.create(t.styles??{}),[t.styles]);let{ruleGroup:a}=e;return(0,Y.jsx)(U.Provider,{value:o.rqbContext,children:(0,Y.jsx)(a,{ruleGroup:o.query,path:[],translations:o.translations,schema:o.schema,actions:o.actions})})};ge.displayName="QueryBuilderNative";0&&(module.exports={NativeActionElement,NativeInlineCombinator,NativeNotToggle,NativeValueEditor,NativeValueEditorWeb,NativeValueSelector,NativeValueSelectorWeb,QueryBuilderNative,RuleGroupNative,RuleNative,defaultNativeControlElements,defaultNativeSelectStyles,defaultNativeStyles,defaultNativeWebControlElements}); | ||
"use strict";var _=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var xe=(t,e)=>{for(var o in e)_(t,o,{get:e[o],enumerable:!0})},Ge=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!he.call(t,i)&&i!==o&&_(t,i,{get:()=>e[i],enumerable:!(a=be(e,i))||a.enumerable});return t};var Ve=t=>Ge(_({},"__esModule",{value:!0}),t);var Ee={};xe(Ee,{NativeActionElement:()=>c,NativeInlineCombinator:()=>A,NativeNotToggle:()=>I,NativeValueEditor:()=>G,NativeValueEditorWeb:()=>J,NativeValueSelector:()=>y,NativeValueSelectorWeb:()=>v,QueryBuilderNative:()=>Se,RuleGroupNative:()=>L,RuleNative:()=>D,defaultNativeControlElements:()=>H,defaultNativeSelectStyles:()=>u,defaultNativeStyles:()=>r,defaultNativeWebControlElements:()=>we});module.exports=Ve(Ee);var fe=require("react");var oe=require("react-native"),re=require("react/jsx-runtime"),c=({handleOnClick:t,label:e,disabled:o,disabledTranslation:a,testID:i})=>(0,re.jsx)(oe.Button,{testID:i,disabled:o&&!a,title:a&&o?a.label??"":e??"",onPress:p=>t(p)});c.displayName="NativeActionElement";var ie=require("react"),B=require("react-native"),F=require("react-querybuilder");var le=require("react-native"),u={selector:{borderWidth:1,height:32,width:100},option:{}},Ce={combinatorOption:u.option,combinatorSelector:u.selector,dragHandle:{},fieldOption:u.option,fieldSelector:u.selector,inlineCombinator:{},notToggle:{flexDirection:"row"},notToggleLabel:{},notToggleSwitch:{},operatorOption:u.option,operatorSelector:u.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},value:{borderWidth:1,height:32,width:150},valueEditorOption:u.option,valueEditorSelector:u.selector,valueEditorSwitch:{},valueList:{flexDirection:"row"},valueSourceOption:u.option,valueSourceSelector:u.selector},r=le.StyleSheet.create(Ce);var z=require("react/jsx-runtime"),A=({component:t,path:e,independentCombinators:o,...a})=>{let i=(0,ie.useMemo)(()=>({inlineCombinator:B.StyleSheet.flatten([r.inlineCombinator,a.schema.styles?.inlineCombinator])}),[a.schema.styles?.inlineCombinator]);return(0,z.jsx)(B.View,{style:i.inlineCombinator,testID:F.TestID.inlineCombinator,children:(0,z.jsx)(t,{...a,path:e,testID:F.TestID.combinators})},"no-dnd")};A.displayName="NativeInlineCombinator";var ae=require("react"),d=require("react-native");var R=require("react/jsx-runtime"),I=({handleOnChange:t,label:e,checked:o,disabled:a,schema:i,testID:p})=>{let l=(0,ae.useMemo)(()=>({notToggle:d.StyleSheet.flatten([r.notToggle,i.styles?.notToggle]),notToggleLabel:d.StyleSheet.flatten([r.notToggleLabel,i.styles?.notToggleLabel]),notToggleSwitch:d.StyleSheet.flatten([r.notToggleSwitch,i.styles?.notToggleSwitch])}),[i.styles?.notToggle,i.styles?.notToggleLabel,i.styles?.notToggleSwitch]);return(0,R.jsxs)(d.View,{style:l.notToggle,testID:p,children:[(0,R.jsx)(d.Text,{style:l.notToggleLabel,children:e}),(0,R.jsx)(d.Switch,{style:l.notToggleSwitch,disabled:a,value:o,onValueChange:n=>t(n)})]})};I.displayName="NativeNotToggle";var ue=require("react"),m=require("react-native"),x=require("react-querybuilder");var ne=require("react"),s=require("react-native"),f=require("react-querybuilder");var se=require("react/jsx-runtime"),y=({handleOnChange:t,options:e,value:o,disabled:a,multiple:i,listsAsArrays:p,schema:l,testID:n})=>{let C=(0,ne.useMemo)(()=>n===f.TestID.combinators?{selector:s.StyleSheet.flatten([r.combinatorSelector,l.styles?.combinatorSelector]),option:s.StyleSheet.flatten([r.combinatorOption,l.styles?.combinatorOption])}:n===f.TestID.fields?{selector:s.StyleSheet.flatten([r.fieldSelector,l.styles?.fieldSelector]),option:s.StyleSheet.flatten([r.fieldOption,l.styles?.fieldOption])}:n===f.TestID.operators?{selector:s.StyleSheet.flatten([r.operatorSelector,l.styles?.operatorSelector]),option:s.StyleSheet.flatten([r.operatorOption,l.styles?.operatorOption])}:n===f.TestID.valueSourceSelector?{selector:s.StyleSheet.flatten([r.valueSourceSelector,l.styles?.valueSourceSelector]),option:s.StyleSheet.flatten([r.valueSourceOption,l.styles?.valueSourceOption])}:n===f.TestID.valueEditor?{selector:s.StyleSheet.flatten([r.valueEditorSelector,l.styles?.valueEditorSelector]),option:s.StyleSheet.flatten([r.valueEditorOption,l.styles?.valueEditorOption])}:s.StyleSheet.create(u),[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:P}=(0,f.useValueSelector)({handleOnChange:t,listsAsArrays:p,multiple:i,value:o}),k=i&&Array.isArray(o)?(0,f.joinWith)(o,","):o;return(0,se.jsx)(s.TextInput,{testID:n,"aria-disabled":a,style:C.selector,value:k,onChangeText:P})};y.displayName="NativeValueSelector";var g=require("react/jsx-runtime"),pe=require("react"),G=({operator:t,value:e,handleOnChange:o,title:a,className:i,type:p="text",inputType:l="text",values:n=[],listsAsArrays:C,parseNumbers:P,fieldData:k,disabled:M,separator:Ne=null,skipHook:ge=!1,testID:w,selectorComponent:Z=y,...S})=>{let E=(0,ue.useMemo)(()=>({value:m.StyleSheet.flatten([r.value,S.schema.styles?.value]),valueEditorSwitch:m.StyleSheet.flatten([r.valueEditorSwitch,S.schema.styles?.valueEditorSwitch]),valueList:m.StyleSheet.flatten([r.valueList,S.schema.styles?.valueList])}),[S.schema.styles?.value,S.schema.styles?.valueEditorSwitch,S.schema.styles?.valueList]),{valueAsArray:$,multiValueHandler:j}=(0,x.useValueEditor)({skipHook:ge,handleOnChange:o,inputType:l,operator:t,value:e,type:p,listsAsArrays:C,parseNumbers:P,values:n});if(t==="null"||t==="notNull")return null;let q=k?.placeholder??"",ee="default";if((t==="between"||t==="notBetween")&&(p==="select"||p==="text")){let N=["from","to"].map((te,O)=>p==="text"?(0,g.jsx)(m.TextInput,{style:E.value,keyboardType:ee,placeholder:q,value:$[O]??"",onChangeText:K=>j(K,O)},te):(0,pe.createElement)(Z,{...S,key:te,handleOnChange:K=>j(K,O),className:i,disabled:M,value:$[O]??(0,x.getFirstOption)(n),options:n,listsAsArrays:C}));return(0,g.jsxs)(m.View,{testID:w,style:E.valueList,children:[N[0],Ne,N[1]]})}switch(p){case"select":case"multiselect":return(0,g.jsx)(Z,{...S,testID:w,className:i,title:a,handleOnChange:o,disabled:M,value:e,options:n,multiple:p==="multiselect",listsAsArrays:C});case"textarea":return(0,g.jsx)(m.TextInput,{testID:w,style:E.value,placeholder:q,value:e,onChangeText:N=>o(N)});case"switch":case"checkbox":return(0,g.jsx)(m.Switch,{testID:w,style:E.valueEditorSwitch,disabled:M,value:!!e,onValueChange:N=>o(N)})}return(0,g.jsx)(m.TextInput,{testID:w,style:E.value,keyboardType:ee,placeholder:q,value:e,onChangeText:N=>o((0,x.parseNumber)(N,{parseNumbers:P}))})};G.displayName="NativeValueEditor";var me=require("react/jsx-runtime"),v=t=>(0,me.jsx)(y,{...t});v.displayName="NativeValueSelectorWeb";var ce=require("react/jsx-runtime"),J=t=>(0,ce.jsx)(G,{...t,selectorComponent:v});var ye=require("react"),b=require("react-native"),T=require("react-querybuilder");var h=require("react/jsx-runtime"),L=t=>{let e={...t,...(0,T.useRuleGroup)(t)},o=(0,ye.useMemo)(()=>({ruleGroup:b.StyleSheet.flatten([r.ruleGroup,e.schema.styles?.ruleGroup]),ruleGroupHeader:b.StyleSheet.flatten([r.ruleGroupHeader,e.schema.styles?.ruleGroupHeader]),ruleGroupBody:b.StyleSheet.flatten([r.ruleGroupBody,e.schema.styles?.ruleGroupBody])}),[e.schema.styles?.ruleGroup,e.schema.styles?.ruleGroupBody,e.schema.styles?.ruleGroupHeader]);return(0,h.jsxs)(b.View,{style:o.ruleGroup,testID:T.TestID.ruleGroup,children:[(0,h.jsx)(b.View,{style:o.ruleGroupHeader,children:(0,h.jsx)(T.RuleGroupHeaderComponents,{...e})}),(0,h.jsx)(b.View,{style:o.ruleGroupBody,children:(0,h.jsx)(T.RuleGroupBodyComponents,{...e})})]})};L.displayName="RuleGroupNative";var de=require("react"),W=require("react-native"),V=require("react-querybuilder");var U=require("react/jsx-runtime"),D=t=>{let e={...t,...(0,V.useRule)(t)},o=(0,de.useMemo)(()=>({rule:W.StyleSheet.flatten([r.rule,e.schema.styles?.rule])}),[e.schema.styles?.rule]);return(0,U.jsx)(W.View,{style:o.rule,testID:V.TestID.rule,children:(0,U.jsx)(V.RuleComponents,{...e})})};D.displayName="RuleNative";var H={addGroupAction:c,addRuleAction:c,cloneGroupAction:c,cloneRuleAction:c,combinatorSelector:y,dragHandle:(0,fe.forwardRef)(()=>null),fieldSelector:y,inlineCombinator:A,lockGroupAction:c,lockRuleAction:c,notToggle:I,operatorSelector:y,removeGroupAction:c,removeRuleAction:c,rule:D,ruleGroup:L,valueEditor:G,valueSourceSelector:y},we={...H,combinatorSelector:v,fieldSelector:v,operatorSelector:v,valueEditor:J,valueSourceSelector:v};var X=require("react"),ve=require("react-native"),Q=require("react-querybuilder");var Y=require("react/jsx-runtime"),Se=t=>{let e=(0,X.useMemo)(()=>({...H,...t.controlElements}),[t.controlElements]),o=(0,Q.useQueryBuilder)({...t,controlElements:e});o.schema.styles=(0,X.useMemo)(()=>ve.StyleSheet.create(t.styles??{}),[t.styles]);let{ruleGroup:a}=e;return(0,Y.jsx)(Q.QueryBuilderContext.Provider,{value:o.rqbContext,children:(0,Y.jsx)(a,{ruleGroup:o.query,path:[],translations:o.translations,schema:o.schema,actions:o.actions})})};Se.displayName="QueryBuilderNative";0&&(module.exports={NativeActionElement,NativeInlineCombinator,NativeNotToggle,NativeValueEditor,NativeValueEditorWeb,NativeValueSelector,NativeValueSelectorWeb,QueryBuilderNative,RuleGroupNative,RuleNative,defaultNativeControlElements,defaultNativeSelectStyles,defaultNativeStyles,defaultNativeWebControlElements}); | ||
//# sourceMappingURL=react-querybuilder_native.cjs.production.js.map |
@@ -1,6 +0,5 @@ | ||
import { Controls, Schema, RuleGroupProps, RuleProps, NotToggleProps, InlineCombinatorProps, ActionProps, ValueSelectorProps, ValueEditorProps, RuleGroupType, RuleGroupTypeIC, QueryBuilderProps } from '@react-querybuilder/ts'; | ||
import * as react_querybuilder from 'react-querybuilder'; | ||
import { Controls, Schema, RuleGroupProps, RuleProps, NotToggleProps, InlineCombinatorProps, ActionProps, ValueSelectorProps, ValueEditorProps, RuleGroupType, RuleGroupTypeIC, QueryBuilderProps } from 'react-querybuilder'; | ||
import { ComponentType } from 'react'; | ||
import { StyleProp, TextStyle, ViewStyle } from 'react-native'; | ||
import * as react_querybuilder from 'react-querybuilder'; | ||
import { RuleGroupType as RuleGroupType$1, RuleGroupTypeIC as RuleGroupTypeIC$1 } from 'react-querybuilder'; | ||
@@ -93,3 +92,3 @@ declare const defaultNativeControlElements: Controls; | ||
declare const QueryBuilderNative: { | ||
<RG extends RuleGroupType$1<react_querybuilder.RuleType<string, string, any, string>, string> | RuleGroupTypeIC$1<react_querybuilder.RuleType<string, string, any, string>, string> = RuleGroupType$1<react_querybuilder.RuleType<string, string, any, string>, string>>(props: QueryBuilderNativeProps<RG>): JSX.Element; | ||
<RG extends RuleGroupType<react_querybuilder.RuleType<string, string, any, string>, string> | RuleGroupTypeIC<react_querybuilder.RuleType<string, string, any, string>, string> = RuleGroupType<react_querybuilder.RuleType<string, string, any, string>, string>>(props: QueryBuilderNativeProps<RG>): JSX.Element; | ||
displayName: string; | ||
@@ -96,0 +95,0 @@ }; |
@@ -553,11 +553,6 @@ var __defProp = Object.defineProperty; | ||
// ../ctx/dist/react-querybuilder_ctx.mjs | ||
import { createContext } from "react"; | ||
var QueryBuilderContext = createContext({}); | ||
QueryBuilderContext.displayName = "QueryBuilderContext"; | ||
// src/components/QueryBuilderNative.tsx | ||
import { useMemo as useMemo7 } from "react"; | ||
import { StyleSheet as StyleSheet8 } from "react-native"; | ||
import { useQueryBuilder } from "react-querybuilder"; | ||
import { QueryBuilderContext, useQueryBuilder } from "react-querybuilder"; | ||
import { jsx as jsx10 } from "react/jsx-runtime"; | ||
@@ -564,0 +559,0 @@ var QueryBuilderNative = (props) => { |
{ | ||
"name": "@react-querybuilder/native", | ||
"description": "React Native components for react-querybuilder", | ||
"version": "6.2.0", | ||
"version": "6.3.0-alpha.0", | ||
"publishConfig": { | ||
@@ -37,3 +37,2 @@ "access": "public" | ||
"@babel/preset-flow": "^7.21.4", | ||
"@react-querybuilder/ts": "^6.2.0", | ||
"@testing-library/jest-native": "^5.4.2", | ||
@@ -48,3 +47,3 @@ "@testing-library/react-native": "^12.0.1", | ||
"react-native-web": "~0.19.4", | ||
"react-querybuilder": "^6.2.0", | ||
"react-querybuilder": "^6.3.0-alpha.0", | ||
"react-test-renderer": "^18.2.0", | ||
@@ -57,5 +56,5 @@ "rollup-plugin-visualizer": "^5.9.0", | ||
"react": ">=16.8.0", | ||
"react-querybuilder": "^6.2.0" | ||
"react-querybuilder": "^6.3.0-alpha.0" | ||
}, | ||
"gitHead": "36c80581e9a487e9ec223a4a5149f3d2f1ca0f28" | ||
"gitHead": "fd69d09523be41dfb8515ae0bab1b9f9f70411c1" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
15
231497
1801
2