@react-querybuilder/bulma
Advanced tools
Comparing version 7.0.0-alpha.7 to 7.0.0-beta.0
import * as React from 'react'; | ||
import * as react_querybuilder from 'react-querybuilder'; | ||
import { ActionProps, NotToggleProps, ValueEditorProps, ValueSelectorProps, Field } from 'react-querybuilder'; | ||
import { ActionProps, NotToggleProps, ValueEditorProps, ValueSelectorProps, FullField } from 'react-querybuilder'; | ||
@@ -35,7 +35,7 @@ declare const BulmaActionElement: { | ||
valueEditor: { | ||
(props: react_querybuilder.ValueEditorProps<Field<string, string, string, react_querybuilder.Option<string>, react_querybuilder.Option<string>>, string>): React.JSX.Element | null; | ||
(props: react_querybuilder.ValueEditorProps<FullField<string, string, string, react_querybuilder.Option<string>, react_querybuilder.Option<string>>, string>): React.JSX.Element | null; | ||
displayName: string; | ||
}; | ||
valueSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): React.JSX.Element; | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.FullOption<string>>): React.JSX.Element; | ||
displayName: string; | ||
@@ -42,0 +42,0 @@ }; |
import * as React from 'react'; | ||
import * as react_querybuilder from 'react-querybuilder'; | ||
import { ActionProps, NotToggleProps, ValueEditorProps, ValueSelectorProps, Field } from 'react-querybuilder'; | ||
import { ActionProps, NotToggleProps, ValueEditorProps, ValueSelectorProps, FullField } from 'react-querybuilder'; | ||
@@ -35,7 +35,7 @@ declare const BulmaActionElement: { | ||
valueEditor: { | ||
(props: react_querybuilder.ValueEditorProps<Field<string, string, string, react_querybuilder.Option<string>, react_querybuilder.Option<string>>, string>): React.JSX.Element | null; | ||
(props: react_querybuilder.ValueEditorProps<FullField<string, string, string, react_querybuilder.Option<string>, react_querybuilder.Option<string>>, string>): React.JSX.Element | null; | ||
displayName: string; | ||
}; | ||
valueSelector: { | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.Option<string>>): React.JSX.Element; | ||
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, }: react_querybuilder.ValueSelectorProps<react_querybuilder.FullOption<string>>): React.JSX.Element; | ||
displayName: string; | ||
@@ -42,0 +42,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
"use strict";var O=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var T=(e,t)=>{for(var a in t)d(e,a,{get:t[a],enumerable:!0})},A=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of S(t))!H.call(e,o)&&o!==a&&d(e,o,{get:()=>t[o],enumerable:!(n=P(t,o))||n.enumerable});return e};var y=(e,t,a)=>(a=e!=null?O($(e)):{},A(t||!e||!e.__esModule?d(a,"default",{value:e,enumerable:!0}):a,e)),q=e=>A(d({},"__esModule",{value:!0}),e);var R={};T(R,{BulmaActionElement:()=>N,BulmaNotToggle:()=>b,BulmaValueEditor:()=>h,BulmaValueSelector:()=>v,QueryBuilderBulma:()=>w,bulmaControlElements:()=>B});module.exports=q(R);var E=require("react-querybuilder");var k=y(require("react")),N=({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);N.displayName="BulmaActionElement";var x=y(require("react")),b=({className:e,handleOnChange:t,label:a,checked:n,title:o,disabled:r})=>x.createElement("label",{className:`${e} checkbox`,title:o},x.createElement("input",{type:"checkbox",disabled:r,checked:n,onChange:l=>t(l.target.checked)}),a);b.displayName="BulmaNotToggle";var i=y(require("react")),s=require("react-querybuilder"),h=e=>{let{valueAsArray:t,multiValueHandler:a}=(0,s.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=e.schema.controls.valueSelector}=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((u,m)=>e.type==="text"?i.createElement("input",{key:u,type:e.inputType||"text",placeholder:o,value:t[m]??"",className:`${s.standardClassnames.valueListItem} input`,disabled:e.disabled,onChange:c=>a(c.target.value,m)}):i.createElement(n,{...e,key:u,className:s.standardClassnames.valueListItem,handleOnChange:c=>a(c,m),disabled:e.disabled,value:t[m]??(0,s.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(s.ValueEditor,{skipHook:!0,...e,className:"textarea"}));case"switch":case"checkbox":return i.createElement("label",{title:e.title,className:`${e.className} checkbox`},i.createElement(s.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(s.ValueEditor,{skipHook:!0,...e,disabled:e.disabled,className:"input"}))};h.displayName="BulmaValueEditor";var C=y(require("react")),f=require("react-querybuilder");var g=require("react-querybuilder");var v=({className:e,handleOnChange:t,options:a,value:n,title:o,disabled:r,multiple:l,listsAsArrays:u})=>{let{onChange:m,val:c}=(0,f.useValueSelector)({handleOnChange:t,listsAsArrays:u,multiple:l,value:n}),V=(0,f.useSelectElementChangeHandler)({multiple:l,onChange:m});return C.createElement("div",{title:o,className:`${e} select${l?" is-multiple":""}`},C.createElement("select",{value:c,multiple:l,disabled:r,onChange:V},(0,g.toOptions)(a)))};v.displayName="BulmaValueSelector";var B={actionElement:N,notToggle:b,valueEditor:h,valueSelector:v},w=(0,E.getCompatContextProvider)({key:"bulma",controlElements:B});0&&(module.exports={BulmaActionElement,BulmaNotToggle,BulmaValueEditor,BulmaValueSelector,QueryBuilderBulma,bulmaControlElements}); | ||
"use strict";var O=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var T=(e,t)=>{for(var a in t)d(e,a,{get:t[a],enumerable:!0})},A=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of S(t))!H.call(e,o)&&o!==a&&d(e,o,{get:()=>t[o],enumerable:!(n=P(t,o))||n.enumerable});return e};var y=(e,t,a)=>(a=e!=null?O($(e)):{},A(t||!e||!e.__esModule?d(a,"default",{value:e,enumerable:!0}):a,e)),F=e=>A(d({},"__esModule",{value:!0}),e);var w={};T(w,{BulmaActionElement:()=>N,BulmaNotToggle:()=>b,BulmaValueEditor:()=>h,BulmaValueSelector:()=>v,QueryBuilderBulma:()=>q,bulmaControlElements:()=>B});module.exports=F(w);var E=require("react-querybuilder");var k=y(require("react")),N=({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);N.displayName="BulmaActionElement";var x=y(require("react")),b=({className:e,handleOnChange:t,label:a,checked:n,title:o,disabled:r})=>x.createElement("label",{className:`${e} checkbox`,title:o},x.createElement("input",{type:"checkbox",disabled:r,checked:n,onChange:l=>t(l.target.checked)}),a);b.displayName="BulmaNotToggle";var i=y(require("react")),s=require("react-querybuilder"),h=e=>{let{valueAsArray:t,multiValueHandler:a}=(0,s.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=e.schema.controls.valueSelector}=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((u,m)=>e.type==="text"?i.createElement("input",{key:u,type:e.inputType||"text",placeholder:o,value:t[m]??"",className:`${s.standardClassnames.valueListItem} input`,disabled:e.disabled,onChange:c=>a(c.target.value,m)}):i.createElement(n,{...e,key:u,className:s.standardClassnames.valueListItem,handleOnChange:c=>a(c,m),disabled:e.disabled,value:t[m]??(0,s.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(s.ValueEditor,{skipHook:!0,...e,className:"textarea"}));case"switch":case"checkbox":return i.createElement("label",{title:e.title,className:`${e.className} checkbox`},i.createElement(s.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(s.ValueEditor,{skipHook:!0,...e,disabled:e.disabled,className:"input"}))};h.displayName="BulmaValueEditor";var C=y(require("react")),f=require("react-querybuilder");var g=require("react-querybuilder");var v=({className:e,handleOnChange:t,options:a,value:n,title:o,disabled:r,multiple:l,listsAsArrays:u})=>{let{onChange:m,val:c}=(0,f.useValueSelector)({handleOnChange:t,listsAsArrays:u,multiple:l,value:n}),V=(0,f.useSelectElementChangeHandler)({multiple:l,onChange:m});return C.createElement("div",{title:o,className:`${e} select${l?" is-multiple":""}`},C.createElement("select",{value:c,multiple:l,disabled:r,onChange:V},(0,g.toOptions)(a)))};v.displayName="BulmaValueSelector";var B={actionElement:N,notToggle:b,valueEditor:h,valueSelector:v},q=(0,E.getCompatContextProvider)({key:"bulma",controlElements:B});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.7", | ||
"version": "7.0.0-beta.0", | ||
"publishConfig": { | ||
@@ -42,3 +42,3 @@ "access": "public" | ||
"@testing-library/react": "^14.2.1", | ||
"@types/react": "^18.2.51", | ||
"@types/react": "^18.2.55", | ||
"@vitejs/plugin-react-swc": "^3.6.0", | ||
@@ -48,3 +48,3 @@ "bulma": "^0.9.4", | ||
"react-dom": "^18.2.0", | ||
"react-querybuilder": "^7.0.0-alpha.7", | ||
"react-querybuilder": "^7.0.0-beta.0", | ||
"rollup-plugin-visualizer": "^5.12.0", | ||
@@ -57,5 +57,5 @@ "typescript": "^5.3.3", | ||
"react": ">=16.8.0", | ||
"react-querybuilder": "^7.0.0-alpha.7" | ||
"react-querybuilder": "^7.0.0-beta.0" | ||
}, | ||
"gitHead": "e428b6e4130e02f23e5161efbfdc2ceb4bf6aba7" | ||
"gitHead": "38fa66a823d000ac814b41a5e71abcee3971bdb0" | ||
} |
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
100499