@react-querybuilder/bulma
Advanced tools
Comparing version 7.0.0-alpha.0 to 7.0.0-alpha.1
@@ -0,7 +1,7 @@ | ||
import * as react from 'react'; | ||
import * as react_querybuilder from 'react-querybuilder'; | ||
import { ActionProps, NotToggleProps, ValueEditorProps, ValueSelectorProps, Controls } from 'react-querybuilder'; | ||
import * as React from 'react'; | ||
import { ActionProps, NotToggleProps, ValueEditorProps, ValueSelectorProps } from 'react-querybuilder'; | ||
declare const BulmaActionElement: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: ActionProps): React.JSX.Element; | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: ActionProps): react.JSX.Element; | ||
displayName: string; | ||
@@ -11,3 +11,3 @@ }; | ||
declare const BulmaNotToggle: { | ||
({ className, handleOnChange, label, checked, title, disabled, }: NotToggleProps): React.JSX.Element; | ||
({ className, handleOnChange, label, checked, title, disabled, }: NotToggleProps): react.JSX.Element; | ||
displayName: string; | ||
@@ -17,3 +17,3 @@ }; | ||
declare const BulmaValueEditor: { | ||
(props: ValueEditorProps): React.JSX.Element | null; | ||
(props: ValueEditorProps): react.JSX.Element | null; | ||
displayName: string; | ||
@@ -23,9 +23,66 @@ }; | ||
declare const BulmaValueSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: ValueSelectorProps): React.JSX.Element; | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: ValueSelectorProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
declare const bulmaControlElements: Partial<Controls>; | ||
declare const bulmaControlElements: { | ||
notToggle: { | ||
({ className, handleOnChange, label, checked, title, disabled, }: react_querybuilder.NotToggleProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
valueEditor: { | ||
(props: react_querybuilder.ValueEditorProps<react_querybuilder.Field<string, string, string, react_querybuilder.Option<string>, react_querybuilder.Option<string>>, string>): react.JSX.Element | null; | ||
displayName: string; | ||
}; | ||
addGroupAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
addRuleAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
cloneGroupAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
cloneRuleAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
combinatorSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
fieldSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
operatorSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
lockRuleAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
lockGroupAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
removeGroupAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
removeRuleAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
valueSourceSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
}; | ||
declare const QueryBuilderBulma: react_querybuilder.QueryBuilderContextProvider<Record<string, any>>; | ||
export { BulmaActionElement, BulmaNotToggle, BulmaValueEditor, BulmaValueSelector, QueryBuilderBulma, bulmaControlElements }; |
@@ -0,7 +1,7 @@ | ||
import * as react from 'react'; | ||
import * as react_querybuilder from 'react-querybuilder'; | ||
import { ActionProps, NotToggleProps, ValueEditorProps, ValueSelectorProps, Controls } from 'react-querybuilder'; | ||
import * as React from 'react'; | ||
import { ActionProps, NotToggleProps, ValueEditorProps, ValueSelectorProps } from 'react-querybuilder'; | ||
declare const BulmaActionElement: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: ActionProps): React.JSX.Element; | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: ActionProps): react.JSX.Element; | ||
displayName: string; | ||
@@ -11,3 +11,3 @@ }; | ||
declare const BulmaNotToggle: { | ||
({ className, handleOnChange, label, checked, title, disabled, }: NotToggleProps): React.JSX.Element; | ||
({ className, handleOnChange, label, checked, title, disabled, }: NotToggleProps): react.JSX.Element; | ||
displayName: string; | ||
@@ -17,3 +17,3 @@ }; | ||
declare const BulmaValueEditor: { | ||
(props: ValueEditorProps): React.JSX.Element | null; | ||
(props: ValueEditorProps): react.JSX.Element | null; | ||
displayName: string; | ||
@@ -23,9 +23,66 @@ }; | ||
declare const BulmaValueSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: ValueSelectorProps): React.JSX.Element; | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: ValueSelectorProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
declare const bulmaControlElements: Partial<Controls>; | ||
declare const bulmaControlElements: { | ||
notToggle: { | ||
({ className, handleOnChange, label, checked, title, disabled, }: react_querybuilder.NotToggleProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
valueEditor: { | ||
(props: react_querybuilder.ValueEditorProps<react_querybuilder.Field<string, string, string, react_querybuilder.Option<string>, react_querybuilder.Option<string>>, string>): react.JSX.Element | null; | ||
displayName: string; | ||
}; | ||
addGroupAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
addRuleAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
cloneGroupAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
cloneRuleAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
combinatorSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
fieldSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
operatorSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
lockRuleAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
lockGroupAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
removeGroupAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
removeRuleAction: { | ||
({ className, handleOnClick, label, title, disabled, disabledTranslation, }: react_querybuilder.ActionProps): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
valueSourceSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): react.JSX.Element; | ||
displayName: string; | ||
}; | ||
}; | ||
declare const QueryBuilderBulma: react_querybuilder.QueryBuilderContextProvider<Record<string, any>>; | ||
export { BulmaActionElement, BulmaNotToggle, BulmaValueEditor, BulmaValueSelector, QueryBuilderBulma, bulmaControlElements }; |
@@ -1,2 +0,2 @@ | ||
"use strict";var S=Object.create;var b=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var a in t)b(e,a,{get:t[a],enumerable:!0})},C=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of P(t))!R.call(e,o)&&o!==a&&b(e,o,{get:()=>t[o],enumerable:!(i=O(t,o))||i.enumerable});return e};var N=(e,t,a)=>(a=e!=null?S($(e)):{},C(t||!e||!e.__esModule?b(a,"default",{value:e,enumerable:!0}):a,e)),T=e=>C(b({},"__esModule",{value:!0}),e);var G={};H(G,{BulmaActionElement:()=>c,BulmaNotToggle:()=>h,BulmaValueEditor:()=>A,BulmaValueSelector:()=>s,QueryBuilderBulma:()=>p,bulmaControlElements:()=>E});module.exports=T(G);var B=require("react-querybuilder");var k=N(require("react")),c=({className:e,handleOnClick:t,label:a,title:i,disabled:o,disabledTranslation:r})=>k.createElement("button",{type:"button",className:`button ${e}`,title:r&&o?r.title:i,onClick:l=>t(l),disabled:o&&!r},r&&o?r.label:a);c.displayName="BulmaActionElement";var v=N(require("react")),h=({className:e,handleOnChange:t,label:a,checked:i,title:o,disabled:r})=>v.createElement("label",{className:`${e} checkbox`,title:o},v.createElement("input",{type:"checkbox",disabled:r,checked:i,onChange:l=>t(l.target.checked)}),a);h.displayName="BulmaNotToggle";var n=N(require("react")),m=require("react-querybuilder");var x=N(require("react")),f=require("react-querybuilder");var g=require("react-querybuilder");var s=({className:e,handleOnChange:t,options:a,value:i,title:o,disabled:r,multiple:l,listsAsArrays:y})=>{let{onChange:u,val:d}=(0,f.useValueSelector)({handleOnChange:t,listsAsArrays:y,multiple:l,value:i}),V=(0,f.useSelectElementChangeHandler)({multiple:l,onChange:u});return x.createElement("div",{title:o,className:`${e} select${l?" is-multiple":""}`},x.createElement("select",{value:d,multiple:l,disabled:r,onChange:V},(0,g.toOptions)(a)))};s.displayName="BulmaValueSelector";var A=e=>{let{valueAsArray:t,multiValueHandler:a}=(0,m.useValueEditor)({handleOnChange:e.handleOnChange,inputType:e.inputType,operator:e.operator,value:e.value,type:e.type,listsAsArrays:e.listsAsArrays,parseNumbers:e.parseNumbers,values:e.values}),{selectorComponent:i=s}=e;if(e.operator==="null"||e.operator==="notNull")return null;let o=e.fieldData?.placeholder??"",{values:r=[]}=e;if((e.operator==="between"||e.operator==="notBetween")&&(e.type==="select"||e.type==="text")){let l=["from","to"].map((y,u)=>e.type==="text"?n.createElement("input",{key:y,type:e.inputType||"text",placeholder:o,value:t[u]??"",className:`${m.standardClassnames.valueListItem} input`,disabled:e.disabled,onChange:d=>a(d.target.value,u)}):n.createElement(i,{...e,key:y,className:m.standardClassnames.valueListItem,handleOnChange:d=>a(d,u),disabled:e.disabled,value:t[u]??(0,m.getFirstOption)(r),options:r,listsAsArrays:e.listsAsArrays}));return n.createElement("span",{"data-testid":e.testID,className:e.className,title:e.title},l[0],e.separator,l[1])}switch(e.type){case"select":case"multiselect":return n.createElement(i,{...e,title:e.title,className:e.className,handleOnChange:e.handleOnChange,options:r,value:e.value,disabled:e.disabled,multiple:e.type==="multiselect",listsAsArrays:e.listsAsArrays});case"textarea":return n.createElement("div",{className:`${e.className} control`},n.createElement(m.ValueEditor,{skipHook:!0,...e,className:"textarea"}));case"switch":case"checkbox":return n.createElement("label",{title:e.title,className:`${e.className} checkbox`},n.createElement(m.ValueEditor,{skipHook:!0,...e,title:"",className:""}));case"radio":return n.createElement("div",{className:`${e.className} control`,title:e.title},r.map(l=>n.createElement("label",{key:l.name,className:"radio"},n.createElement("input",{type:"radio",value:l.name,checked:e.value===l.name,onChange:()=>e.handleOnChange(l.name),disabled:e.disabled}),l.label)))}return n.createElement("div",{className:`${e.className} control`},n.createElement(m.ValueEditor,{skipHook:!0,...e,disabled:e.disabled,className:"input"}))};A.displayName="BulmaValueEditor";var E={notToggle:h,valueEditor:A,addGroupAction:c,addRuleAction:c,cloneGroupAction:c,cloneRuleAction:c,combinatorSelector:s,fieldSelector:s,operatorSelector:s,lockRuleAction:c,lockGroupAction:c,removeGroupAction:c,removeRuleAction:c,valueSourceSelector:s},p=(0,B.getCompatContextProvider)({key:"bulma",controlElements:E});0&&(module.exports={BulmaActionElement,BulmaNotToggle,BulmaValueEditor,BulmaValueSelector,QueryBuilderBulma,bulmaControlElements}); | ||
"use strict";var S=Object.create;var b=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var a in t)b(e,a,{get:t[a],enumerable:!0})},C=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of P(t))!R.call(e,o)&&o!==a&&b(e,o,{get:()=>t[o],enumerable:!(n=O(t,o))||n.enumerable});return e};var N=(e,t,a)=>(a=e!=null?S($(e)):{},C(t||!e||!e.__esModule?b(a,"default",{value:e,enumerable:!0}):a,e)),T=e=>C(b({},"__esModule",{value:!0}),e);var G={};H(G,{BulmaActionElement:()=>c,BulmaNotToggle:()=>h,BulmaValueEditor:()=>A,BulmaValueSelector:()=>s,QueryBuilderBulma:()=>p,bulmaControlElements:()=>E});module.exports=T(G);var B=require("react-querybuilder");var k=N(require("react")),c=({className:e,handleOnClick:t,label:a,title:n,disabled:o,disabledTranslation:r})=>k.createElement("button",{type:"button",className:`button ${e}`,title:r&&o?r.title:n,onClick:l=>t(l),disabled:o&&!r},r&&o?r.label:a);c.displayName="BulmaActionElement";var v=N(require("react")),h=({className:e,handleOnChange:t,label:a,checked:n,title:o,disabled:r})=>v.createElement("label",{className:`${e} checkbox`,title:o},v.createElement("input",{type:"checkbox",disabled:r,checked:n,onChange:l=>t(l.target.checked)}),a);h.displayName="BulmaNotToggle";var i=N(require("react")),m=require("react-querybuilder");var x=N(require("react")),g=require("react-querybuilder");var f=require("react-querybuilder");var s=({className:e,handleOnChange:t,options:a,value:n,title:o,disabled:r,multiple:l,listsAsArrays:y})=>{let{onChange:u,val:d}=(0,g.useValueSelector)({handleOnChange:t,listsAsArrays:y,multiple:l,value:n}),V=(0,g.useSelectElementChangeHandler)({multiple:l,onChange:u});return x.createElement("div",{title:o,className:`${e} select${l?" is-multiple":""}`},x.createElement("select",{value:d,multiple:l,disabled:r,onChange:V},(0,f.toOptions)(a)))};s.displayName="BulmaValueSelector";var A=e=>{let{valueAsArray:t,multiValueHandler:a}=(0,m.useValueEditor)({handleOnChange:e.handleOnChange,inputType:e.inputType,operator:e.operator,value:e.value,type:e.type,listsAsArrays:e.listsAsArrays,parseNumbers:e.parseNumbers,values:e.values}),{selectorComponent:n=s}=e;if(e.operator==="null"||e.operator==="notNull")return null;let o=e.fieldData?.placeholder??"",{values:r=[]}=e;if((e.operator==="between"||e.operator==="notBetween")&&(e.type==="select"||e.type==="text")){let l=["from","to"].map((y,u)=>e.type==="text"?i.createElement("input",{key:y,type:e.inputType||"text",placeholder:o,value:t[u]??"",className:`${m.standardClassnames.valueListItem} input`,disabled:e.disabled,onChange:d=>a(d.target.value,u)}):i.createElement(n,{...e,key:y,className:m.standardClassnames.valueListItem,handleOnChange:d=>a(d,u),disabled:e.disabled,value:t[u]??(0,m.getFirstOption)(r),options:r,listsAsArrays:e.listsAsArrays}));return i.createElement("span",{"data-testid":e.testID,className:e.className,title:e.title},l[0],e.separator,l[1])}switch(e.type){case"select":case"multiselect":return i.createElement(n,{...e,title:e.title,className:e.className,handleOnChange:e.handleOnChange,options:r,value:e.value,disabled:e.disabled,multiple:e.type==="multiselect",listsAsArrays:e.listsAsArrays});case"textarea":return i.createElement("div",{className:`${e.className} control`},i.createElement(m.ValueEditor,{skipHook:!0,...e,className:"textarea"}));case"switch":case"checkbox":return i.createElement("label",{title:e.title,className:`${e.className} checkbox`},i.createElement(m.ValueEditor,{skipHook:!0,...e,title:"",className:""}));case"radio":return i.createElement("div",{className:`${e.className} control`,title:e.title},r.map(l=>i.createElement("label",{key:l.name,className:"radio"},i.createElement("input",{type:"radio",value:l.name,checked:e.value===l.name,onChange:()=>e.handleOnChange(l.name),disabled:e.disabled}),l.label)))}return i.createElement("div",{className:`${e.className} control`},i.createElement(m.ValueEditor,{skipHook:!0,...e,disabled:e.disabled,className:"input"}))};A.displayName="BulmaValueEditor";var E={notToggle:h,valueEditor:A,addGroupAction:c,addRuleAction:c,cloneGroupAction:c,cloneRuleAction:c,combinatorSelector:s,fieldSelector:s,operatorSelector:s,lockRuleAction:c,lockGroupAction:c,removeGroupAction:c,removeRuleAction:c,valueSourceSelector:s},p=(0,B.getCompatContextProvider)({key:"bulma",controlElements:E});0&&(module.exports={BulmaActionElement,BulmaNotToggle,BulmaValueEditor,BulmaValueSelector,QueryBuilderBulma,bulmaControlElements}); | ||
//# sourceMappingURL=react-querybuilder_bulma.cjs.production.js.map |
{ | ||
"name": "@react-querybuilder/bulma", | ||
"description": "Custom Bulma components for react-querybuilder", | ||
"version": "7.0.0-alpha.0", | ||
"version": "7.0.0-alpha.1", | ||
"publishConfig": { | ||
@@ -42,8 +42,8 @@ "access": "public" | ||
"@testing-library/react": "^14.0.0", | ||
"@types/react": "^18.2.31", | ||
"@vitejs/plugin-react-swc": "^3.4.0", | ||
"@types/react": "^18.2.33", | ||
"@vitejs/plugin-react-swc": "^3.4.1", | ||
"bulma": "^0.9.4", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-querybuilder": "^7.0.0-alpha.0", | ||
"react-querybuilder": "^7.0.0-alpha.1", | ||
"rollup-plugin-visualizer": "^5.9.2", | ||
@@ -56,5 +56,5 @@ "typescript": "^5.2.2", | ||
"react": ">=16.8.0", | ||
"react-querybuilder": "^7.0.0-alpha.0" | ||
"react-querybuilder": "^7.0.0-alpha.1" | ||
}, | ||
"gitHead": "1ba3a219a05b23e406b253ff6f2bf501e3397fcf" | ||
"gitHead": "07b50090de711f00f3ddeeaddb5666706a6e7c9f" | ||
} |
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
115717
844