@bikdotai/bik-component-library 1.1.1-beta.48 → 1.1.1-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/SingleselectDropdownFreeText.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -0
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/SingleselectDropdownFreeText.js +1 -1
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
- package/dist/esm/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),a=require("../../DropdownWrapper.js");const i=i=>{let{onChange:n,extra:r,val:o,isLoading:t,errors:s,disabled:d}=i;const[u,c]=l.useState([]),v=o;return l.useEffect((()=>{var e;const l=(null==r?void 0:r.options)&&Array.isArray(r.options)?r.options.filter((e=>!!Object.keys(e).length)).map((e=>({selected:!!(null==v?void 0:v.find((l=>l.name===e.name||l.id===e.id))),label:e.name,value:e.id}))):[],a=null!==(e=null==v?void 0:v.map((e=>e.id)))&&void 0!==e?e:[],i=[...l.filter((e=>!a.includes(e.value)))].concat((null!=v?v:[]).map((e=>({value:e.id,label:e.name}))));null==v||v.forEach((e=>{let{name:l,id:a}=e;const n=i.findIndex((e=>e.value===a&&e.label===l));-1!==n&&(i[n].selected=!0)})),c([...i])}),[r,v]),e.jsx("div",{children:e.jsx(a.default,{disabled:d,allowFreeForm
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),a=require("../../DropdownWrapper.js");const i=i=>{let{onChange:n,extra:r,val:o,isLoading:t,errors:s,disabled:d}=i;const[u,c]=l.useState([]),v=o;return l.useEffect((()=>{var e;const l=(null==r?void 0:r.options)&&Array.isArray(r.options)?r.options.filter((e=>!!Object.keys(e).length)).map((e=>({selected:!!(null==v?void 0:v.find((l=>l.name===e.name||l.id===e.id))),label:e.name,value:e.id}))):[],a=null!==(e=null==v?void 0:v.map((e=>e.id)))&&void 0!==e?e:[],i=[...l.filter((e=>!a.includes(e.value)))].concat((null!=v?v:[]).map((e=>({value:e.id,label:e.name}))));null==v||v.forEach((e=>{let{name:l,id:a}=e;const n=i.findIndex((e=>e.value===a&&e.label===l));-1!==n&&(i[n].selected=!0)})),c([...i])}),[r,v]),e.jsx("div",{children:e.jsx(a.default,{disabled:d,allowFreeForm:null==r?void 0:r.freeForm,isSearchable:!0,isLoading:t,error:null==s?void 0:s.val,isMultiSelect:!0,options:u,onSelect:function(e){if(Array.isArray(e)){const l=[];e.forEach((e=>{var a,i;e.options?null===(a=e.options)||void 0===a||a.forEach((e=>{l.push({name:e.label,id:e.value})})):l.push({name:null!==(i=e.label)&&void 0!==i?i:"",id:e.value})})),null==n||n(l)}}})})};exports.default=l=>e.jsx(i,Object.assign({},l));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),a=require("../../DropdownWrapper.js");const n=n=>{let{onChange:i,extra:r,val:t,isLoading:s,errors:o,disabled:d}=n;const[u,c]=l.useState([]),v=t;return l.useEffect((()=>{var e;const l=(null==r?void 0:r.options)&&Array.isArray(r.options)?r.options.filter((e=>!!Object.keys(e).length)).map((e=>({selected:!!(null==v?void 0:v.find((l=>l.name===e.name||l.id===e.id))),label:e.name,value:e.id}))):[],a=null!==(e=null==v?void 0:v.map((e=>e.id)))&&void 0!==e?e:[],n=[...l.filter((e=>!a.includes(e.value)))].concat((null!=v?v:[]).map((e=>({value:e.id,label:e.name}))));null==v||v.forEach((e=>{let{name:l,id:a}=e;const i=n.findIndex((e=>e.value===a&&e.label===l));-1!==i&&(n[i].selected=!0)})),c([...n])}),[r,v]),e.jsx("div",{children:e.jsx(a.default,{disabled:d,allowFreeForm:!
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),a=require("../../DropdownWrapper.js");const n=n=>{let{onChange:i,extra:r,val:t,isLoading:s,errors:o,disabled:d}=n;const[u,c]=l.useState([]),v=t;return l.useEffect((()=>{var e;const l=(null==r?void 0:r.options)&&Array.isArray(r.options)?r.options.filter((e=>!!Object.keys(e).length)).map((e=>({selected:!!(null==v?void 0:v.find((l=>l.name===e.name||l.id===e.id))),label:e.name,value:e.id}))):[],a=null!==(e=null==v?void 0:v.map((e=>e.id)))&&void 0!==e?e:[],n=[...l.filter((e=>!a.includes(e.value)))].concat((null!=v?v:[]).map((e=>({value:e.id,label:e.name}))));null==v||v.forEach((e=>{let{name:l,id:a}=e;const i=n.findIndex((e=>e.value===a&&e.label===l));-1!==i&&(n[i].selected=!0)})),c([...n])}),[r,v]),e.jsx("div",{children:e.jsx(a.default,{disabled:d,allowFreeForm:!1,isSearchable:!0,isLoading:s,error:null==o?void 0:o.val,isMultiSelect:!1,options:u,onSelect:function(e){const l=e,a=[];a.push({name:l.label,id:l.value}),null==i||i(a)}})})};exports.default=l=>e.jsx(n,Object.assign({},l));
|
package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),o=require("../../../constants/connectorPosition.js"),n=require("../../../helpers/ApiResponse.helper.js"),a=require("../../Connectors/Connector.js"),t=require("../../DropdownWrapper.js"),i=require("./PropertyNode.styled.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),o=require("../../../constants/connectorPosition.js"),n=require("../../../helpers/ApiResponse.helper.js"),a=require("../../Connectors/Connector.js"),t=require("../../DropdownWrapper.js"),i=require("./PropertyNode.styled.js"),s=require("./PropertyNodeUIWrapper.js");const l=new n.ApiResponseHelper,d=n=>{let{propertySelectorText:s,fetchPropertyData:d,onPropertyNameSelect:u,onPropertyOperatorChange:c,onPropertyValueChange:p,property:v,mode:y}=n;var j,g,m,b,f,O,h;const[x,A]=r.useState([]),[C,P]=r.useState({}),[T,w]=r.useState(!0),[S,q]=r.useState("create"===y),L=Array.isArray(x)?x.map((e=>Object.assign(Object.assign({},e),{label:e.name,value:e.id,description:e.description,selected:(null==v?void 0:v.name)===e.id}))):l.convertToGroupOptions(x,(null==v?void 0:v.name)?[v.name.toString()]:void 0);function N(e){if(!Array.isArray(e)){q(!0);let r=null;Array.isArray(x)?r=x.find((r=>{let{id:o}=r;return o===e.value})):Object.keys(x).forEach((o=>{const n=x[o].find((r=>{let{id:o}=r;return o===e.value}));n&&(r=n)})),P({}),r?null==u||u(r,v).then((e=>{const r=e;r.normalized&&r.originalData?P((e=>Object.assign(Object.assign({},e),{options:Array.isArray(r.normalized)?[...r.normalized]:Object.assign({},r.normalized),originalData:r.originalData}))):P((r=>Object.assign(Object.assign({},r),{options:Array.isArray(e)?[...e]:Object.assign({},e)}))),q(!1)})):q(!1)}}return r.useEffect((()=>{d?d().then((e=>{e&&(Array.isArray(e)?A([...e]):A(Object.assign({},e))),w(!1),q(!1)})):(w(!1),q(!1))}),[]),r.useEffect((()=>{if("create"!==y&&x&&(null==v?void 0:v.name)){const e=v,r=Array.isArray(x)?x.find((e=>e.id===(null==v?void 0:v.name))):l.findInGroupedApiResponse(x,null==v?void 0:v.name);r&&N({value:r.id,label:r.name}),null==p||p(null==e?void 0:e.value,v)}}),[x]),r.useEffect((()=>{"iceBreaker"===(null==v?void 0:v.dataType)?P((e=>Object.assign(Object.assign({},e),{freeForm:!1}))):P((e=>Object.assign(Object.assign({},e),{freeForm:!0})))}),[null==v?void 0:v.dataType]),e.jsxs(e.Fragment,{children:[e.jsxs(i.Container,{children:[e.jsx(t.default,{disabled:"view"===y,width:"200px",isLoading:T,dropdownLabel:null!=s?s:"Select property",options:L,onSelect:N,error:null===(j=null==v?void 0:v.error)||void 0===j?void 0:j.name}),(null==v?void 0:v.name)&&!(null===(g=o.isNewLineConnectorPosition[v.dataType])||void 0===g?void 0:g[v.operator])&&e.jsx(a.default,{isLoading:S,disabled:"view"===y,extra:C,errors:{val:null===(m=v.error)||void 0===m?void 0:m.value,operator:null===(b=v.error)||void 0===b?void 0:b.operator},connectorVal:v.value,connectorType:v.dataType,defaultConnector:v.operator,onOperatorChange:e=>{null==c||c(e,v)},onValueChange:e=>null==p?void 0:p(e,v)})]}),(null==v?void 0:v.name)&&(null===(f=o.isNewLineConnectorPosition[v.dataType])||void 0===f?void 0:f[v.operator])&&e.jsx(a.default,{isLoading:S,disabled:"view"===y,extra:C,errors:{val:null===(O=v.error)||void 0===O?void 0:O.value,operator:null===(h=v.error)||void 0===h?void 0:h.operator},connectorVal:v.value,connectorType:v.dataType,defaultConnector:v.operator,onOperatorChange:e=>null==c?void 0:c(e,v),onValueChange:e=>null==p?void 0:p(e,v)})]})};exports.PropertyNode=r=>e.jsx(s.default,Object.assign({isLast:r.isLast,mode:r.mode},{children:e.jsx("div",Object.assign({style:{padding:12,maxWidth:"calc(100% - 78px)"}},{children:e.jsx(d,Object.assign({},r))}))})),exports.PropertyNodeHeadless=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import o from"../../DropdownWrapper.js";const i=i=>{let{onChange:n,extra:r,val:t,isLoading:d,errors:s,disabled:u}=i;const[c,v]=l([]),m=t;return a((()=>{var e;const l=(null==r?void 0:r.options)&&Array.isArray(r.options)?r.options.filter((e=>!!Object.keys(e).length)).map((e=>({selected:!!(null==m?void 0:m.find((l=>l.name===e.name||l.id===e.id))),label:e.name,value:e.id}))):[],a=null!==(e=null==m?void 0:m.map((e=>e.id)))&&void 0!==e?e:[],o=[...l.filter((e=>!a.includes(e.value)))].concat((null!=m?m:[]).map((e=>({value:e.id,label:e.name}))));null==m||m.forEach((e=>{let{name:l,id:a}=e;const i=o.findIndex((e=>e.value===a&&e.label===l));-1!==i&&(o[i].selected=!0)})),v([...o])}),[r,m]),e("div",{children:e(o,{disabled:u,allowFreeForm:null==r?void 0:r.freeForm,isSearchable:!0,isLoading:d,error:null==s?void 0:s.val,isMultiSelect:!0,options:c,onSelect:function(e){if(Array.isArray(e)){const l=[];e.forEach((e=>{var a,o;e.options?null===(a=e.options)||void 0===a||a.forEach((e=>{l.push({name:e.label,id:e.value})})):l.push({name:null!==(o=e.label)&&void 0!==o?o:"",id:e.value})})),null==n||n(l)}}})})};var n=l=>e(i,Object.assign({},l));export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import n from"../../DropdownWrapper.js";const i=i=>{let{onChange:o,extra:r,val:t,isLoading:d,errors:s,disabled:c}=i;const[u,m]=l([]),p=t;return a((()=>{var e;const l=(null==r?void 0:r.options)&&Array.isArray(r.options)?r.options.filter((e=>!!Object.keys(e).length)).map((e=>({selected:!!(null==p?void 0:p.find((l=>l.name===e.name||l.id===e.id))),label:e.name,value:e.id}))):[],a=null!==(e=null==p?void 0:p.map((e=>e.id)))&&void 0!==e?e:[],n=[...l.filter((e=>!a.includes(e.value)))].concat((null!=p?p:[]).map((e=>({value:e.id,label:e.name}))));null==p||p.forEach((e=>{let{name:l,id:a}=e;const i=n.findIndex((e=>e.value===a&&e.label===l));-1!==i&&(n[i].selected=!0)})),m([...n])}),[r,p]),e("div",{children:e(n,{disabled:c,allowFreeForm:!
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import n from"../../DropdownWrapper.js";const i=i=>{let{onChange:o,extra:r,val:t,isLoading:d,errors:s,disabled:c}=i;const[u,m]=l([]),p=t;return a((()=>{var e;const l=(null==r?void 0:r.options)&&Array.isArray(r.options)?r.options.filter((e=>!!Object.keys(e).length)).map((e=>({selected:!!(null==p?void 0:p.find((l=>l.name===e.name||l.id===e.id))),label:e.name,value:e.id}))):[],a=null!==(e=null==p?void 0:p.map((e=>e.id)))&&void 0!==e?e:[],n=[...l.filter((e=>!a.includes(e.value)))].concat((null!=p?p:[]).map((e=>({value:e.id,label:e.name}))));null==p||p.forEach((e=>{let{name:l,id:a}=e;const i=n.findIndex((e=>e.value===a&&e.label===l));-1!==i&&(n[i].selected=!0)})),m([...n])}),[r,p]),e("div",{children:e(n,{disabled:c,allowFreeForm:!1,isSearchable:!0,isLoading:d,error:null==s?void 0:s.val,isMultiSelect:!1,options:u,onSelect:function(e){const l=e,a=[];a.push({name:l.label,id:l.value}),null==o||o(a)}})})};var o=l=>e(i,Object.assign({},l));export{o as default};
|
package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{useState as n,useEffect as a}from"react";import{isNewLineConnectorPosition as i}from"../../../constants/connectorPosition.js";import{ApiResponseHelper as t}from"../../../helpers/ApiResponse.helper.js";import l from"../../Connectors/Connector.js";import d from"../../DropdownWrapper.js";import{Container as s}from"./PropertyNode.styled.js";import p from"./PropertyNodeUIWrapper.js";const c=new t,u=r=>e(p,Object.assign({isLast:r.isLast,mode:r.mode},{children:e("div",Object.assign({style:{padding:12,maxWidth:"calc(100% - 78px)"}},{children:e(v,Object.assign({},r))}))})),v=t=>{let{propertySelectorText:p,fetchPropertyData:u,onPropertyNameSelect:v,onPropertyOperatorChange:m,onPropertyValueChange:y,property:g,mode:j}=t;var b,f,O,h,A,C,T;const[x,w]=n([]),[P,L]=n({}),[D,S]=n(!0),[V,z]=n("create"===j),N=Array.isArray(x)?x.map((e=>Object.assign(Object.assign({},e),{label:e.name,value:e.id,description:e.description,selected:(null==g?void 0:g.name)===e.id}))):c.convertToGroupOptions(x,(null==g?void 0:g.name)?[g.name.toString()]:void 0);function W(e){if(!Array.isArray(e)){z(!0);let r=null;Array.isArray(x)?r=x.find((r=>{let{id:o}=r;return o===e.value})):Object.keys(x).forEach((o=>{const n=x[o].find((r=>{let{id:o}=r;return o===e.value}));n&&(r=n)})),L({}),r?null==v||v(r,g).then((e=>{const r=e;r.normalized&&r.originalData?L((e=>Object.assign(Object.assign({},e),{options:Array.isArray(r.normalized)?[...r.normalized]:Object.assign({},r.normalized),originalData:r.originalData}))):L((r=>Object.assign(Object.assign({},r),{options:Array.isArray(e)?[...e]:Object.assign({},e)}))),z(!1)})):z(!1)}}return a((()=>{u?u().then((e=>{e&&(Array.isArray(e)?w([...e]):w(Object.assign({},e))),S(!1),z(!1)})):(S(!1),z(!1))}),[]),a((()=>{if("create"!==j&&x&&(null==g?void 0:g.name)){const e=g,r=Array.isArray(x)?x.find((e=>e.id===(null==g?void 0:g.name))):c.findInGroupedApiResponse(x,null==g?void 0:g.name);r&&W({value:r.id,label:r.name}),null==y||y(null==e?void 0:e.value,g)}}),[x]),a((()=>{"iceBreaker"===(null==g?void 0:g.dataType)?L((e=>Object.assign(Object.assign({},e),{freeForm:!1}))):L((e=>Object.assign(Object.assign({},e),{freeForm:!0})))}),[null==g?void 0:g.dataType]),r(o,{children:[r(s,{children:[e(d,{disabled:"view"===j,width:"200px",isLoading:D,dropdownLabel:null!=p?p:"Select property",options:N,onSelect:W,error:null===(b=null==g?void 0:g.error)||void 0===b?void 0:b.name}),(null==g?void 0:g.name)&&!(null===(f=i[g.dataType])||void 0===f?void 0:f[g.operator])&&e(l,{isLoading:V,disabled:"view"===j,extra:P,errors:{val:null===(O=g.error)||void 0===O?void 0:O.value,operator:null===(h=g.error)||void 0===h?void 0:h.operator},connectorVal:g.value,connectorType:g.dataType,defaultConnector:g.operator,onOperatorChange:e=>{null==m||m(e,g)},onValueChange:e=>null==y?void 0:y(e,g)})]}),(null==g?void 0:g.name)&&(null===(A=i[g.dataType])||void 0===A?void 0:A[g.operator])&&e(l,{isLoading:V,disabled:"view"===j,extra:P,errors:{val:null===(C=g.error)||void 0===C?void 0:C.value,operator:null===(T=g.error)||void 0===T?void 0:T.operator},connectorVal:g.value,connectorType:g.dataType,defaultConnector:g.operator,onOperatorChange:e=>null==m?void 0:m(e,g),onValueChange:e=>null==y?void 0:y(e,g)})]})};export{u as PropertyNode,v as PropertyNodeHeadless};
|