@bikdotai/bik-component-library 0.0.52 → 0.0.53

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),t=require("react"),o=require("../../helpers/ApiResponse.helper.js"),i=require("../../hooks/useQueryBuilder.js"),a=require("../../hooks/useQueryBuilderCache.js"),n=require("../../components/DropdownWrapper.js"),u=require("../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js");const l=new o.ApiResponseHelper,s="triggerName";exports.default=o=>{let{node:d,apiHandler:c,cacheKey:p,propertyAddBtnText:v,mode:y,selectorKey:j}=o;var g;const[f,h]=t.useState([]),{updateMeta:_,createMeta:O,createProperty:m,deleteProperty:P,updateProperty:b,selectPropertyJoinOperator:x,clearProperty:B}=i.useQueryBuilder(j),{cacheWrap:q}=a.useQueryBuilderCache(),[A,N]=t.useState(!0),Q=d.metas.find((e=>e.key===s)),k=e=>q((()=>c({query:{triggerName:e}})),`${p}_${e}`),w=(e,r)=>q((()=>c({query:{triggerName:e,propertyName:r}})),`${p}_${e}_${r}`);return t.useEffect((()=>{q((()=>c({})),p).then((e=>{var r;if(e)if(Array.isArray(e)){const t=null!==(r=null==e?void 0:e.map((e=>({label:e.name,value:e.id,description:e.description,selected:"create"!==y&&(!!(null==Q?void 0:Q.value)&&Q.value===e.id)}))))&&void 0!==r?r:[];h([...t])}else{const r=l.convertToGroupOptions(e,(null==Q?void 0:Q.value)?[Q.value]:void 0);h([...r])}N(!1)}))}),[]),r.jsx(u.BaseQueryBuilderNode,Object.assign({node:d,addPropertyBtnText:(null==Q?void 0:Q.value)&&v,deleteProperty:P,createProperty:m,propertySelectorText:"Select condition",fetchPropertyData:function(){return e.__awaiter(this,void 0,void 0,(function*(){if(null==Q?void 0:Q.value){return yield k(null==Q?void 0:Q.value)}return null}))},onPropertyNameSelect:function(r,t){return e.__awaiter(this,void 0,void 0,(function*(){b(Object.assign(Object.assign({},t),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),d._id);const e=yield w(null==Q?void 0:Q.value,r.id);return e?Array.isArray(e)?e:l.convertToGroupOptions(e):[]}))},onPropertyOperatorChange:function(e,r){b(Object.assign(Object.assign({},r),{operator:e,value:void 0,error:{}}),d._id)},onPropertyValueChange:function(e,r){b(Object.assign(Object.assign({},r),{value:e}),d._id)},selectPropertyJoinOperator:x,mode:y},{children:r.jsx("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:8}},{children:r.jsx(n.default,{isLoading:A,error:null===(g=null==Q?void 0:Q.error)||void 0===g?void 0:g.key,width:"200px",options:f,onSelect:function(e){Array.isArray(e)||(B(d._id),(null==Q?void 0:Q.key)===s?_(Object.assign(Object.assign({},Q),{value:e.value,error:{}}),d._id):O({key:s,value:e.value},d._id))}})}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),t=require("react"),i=require("../../helpers/ApiResponse.helper.js"),o=require("../../hooks/useQueryBuilder.js"),a=require("../../hooks/useQueryBuilderCache.js"),s=require("../../components/DropdownWrapper.js"),n=require("../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js");const u=new i.ApiResponseHelper,l="triggerName";exports.default=i=>{let{node:d,apiHandler:c,cacheKey:p,propertyAddBtnText:v,mode:y,selectorKey:j}=i;var g;const[O,b]=t.useState([]),{updateMeta:f,createMeta:h,createProperty:_,deleteProperty:m,updateProperty:P,selectPropertyJoinOperator:x,clearProperty:B}=o.useQueryBuilder(j),{cacheWrap:A}=a.useQueryBuilderCache(),[q,N]=t.useState(!0),Q=d.metas.find((e=>e.key===l)),k=e=>A((()=>c({query:{triggerName:e}})),`${p}_${e}`),w=(e,r)=>A((()=>c({query:{triggerName:e,propertyName:r}})),`${p}_${e}_${r}`);return t.useEffect((()=>{A((()=>c({})),p).then((e=>{var r;if(e)if(Array.isArray(e)){const t=null!==(r=null==e?void 0:e.map((e=>({label:e.name,value:e.id,description:e.description,selected:"create"!==y&&(!!(null==Q?void 0:Q.value)&&Q.value===e.id)}))))&&void 0!==r?r:[];b([...t])}else{const r=u.convertToGroupOptions(e,(null==Q?void 0:Q.value)?[Q.value]:void 0);b([...r])}N(!1)}))}),[]),r.jsx(n.BaseQueryBuilderNode,Object.assign({node:d,addPropertyBtnText:(null==Q?void 0:Q.value)&&v,deleteProperty:m,createProperty:_,propertySelectorText:"Select condition",fetchPropertyData:function(){return e.__awaiter(this,void 0,void 0,(function*(){if(null==Q?void 0:Q.value){return yield k(null==Q?void 0:Q.value)}return null}))},onPropertyNameSelect:function(r,t){return e.__awaiter(this,void 0,void 0,(function*(){P(Object.assign(Object.assign({},t),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),d._id);const e=yield w(null==Q?void 0:Q.value,r.id);return e?Array.isArray(e)?e:u.convertToGroupOptions(e):[]}))},onPropertyOperatorChange:function(e,r){P(Object.assign(Object.assign({},r),{operator:e,value:void 0,error:{}}),d._id)},onPropertyValueChange:function(e,r){P(Object.assign(Object.assign({},r),{value:e}),d._id)},selectPropertyJoinOperator:x,mode:y},{children:r.jsx("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:8}},{children:r.jsx(s.default,{isLoading:q,error:null===(g=null==Q?void 0:Q.error)||void 0===g?void 0:g.key,width:"200px",options:O,onSelect:function(e){Array.isArray(e)||(B(d._id),Array.isArray(O)&&b([...O.map((r=>{if(r.options){const t=r.options.map((r=>r.value===e.value?Object.assign(Object.assign({},r),{selected:!0}):Object.assign(Object.assign({},r),{selected:!1})));return Object.assign(Object.assign({},r),{options:t})}return r.value==r.value?Object.assign(Object.assign({},r),{selected:!0}):Object.assign(Object.assign({},r),{selected:!1})}))]),(null==Q?void 0:Q.key)===l?f(Object.assign(Object.assign({},Q),{value:e.value,error:{}}),d._id):h({key:l,value:e.value},d._id))}})}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react/jsx-runtime"),e=require("@tippyjs/react"),n=require("react"),r=require("./TooltipInternal.js"),i=require("../../constants/Theme.js");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=o(e),l=o(n);const s=`\n .tippy-content {\n padding: 0px;\n }\n .tippy-arrow {\n \tcolor: ${t=>i.COLORS.content.primary};\n }\n`;exports.Tooltip=e=>l.default.isValidElement(e.children)?t.jsxs(t.Fragment,{children:[t.jsx("style",{children:s}),t.jsx(a.default,Object.assign({placement:e.placement||"right",maxWidth:e.width,animation:"fade",arrow:!0,interactive:!0,content:e.tooltipContent?e.tooltipContent:t.jsx(r.default,{title:e.title,body:e.body,buttonProps:e.buttonProps})},{children:e.children}))]}):null;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react/jsx-runtime"),e=require("@tippyjs/react"),n=require("react"),r=require("./TooltipInternal.js"),o=require("../../constants/Theme.js");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=i(e),l=i(n);const p=`\n\t.tippy-content {\n\t\tpadding: 0px;\n\t}\n\t.tippy-arrow {\n\t\tcolor: ${t=>o.COLORS.content.primary};\n\t}\n\t.overflow-wrap-tippy {\n\t\toverflow-wrap: anywhere;\n\t}\n`;exports.Tooltip=e=>l.default.isValidElement(e.children)?t.jsxs(t.Fragment,{children:[t.jsx("style",{children:p}),t.jsx(a.default,Object.assign({appendTo:document.body,className:"overflow-wrap-tippy",placement:e.placement||"right",maxWidth:e.width,animation:"fade",arrow:!0,interactive:!0,content:e.tooltipContent?e.tooltipContent:t.jsx(r.default,{title:e.title,body:e.body,buttonProps:e.buttonProps})},{children:e.children}))]}):null;
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsx as r}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import{ApiResponseHelper as i}from"../../helpers/ApiResponse.helper.js";import{useQueryBuilder as n}from"../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as a}from"../../hooks/useQueryBuilderCache.js";import l from"../../components/DropdownWrapper.js";import{BaseQueryBuilderNode as d}from"../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";const s=new i,u="triggerName",p=i=>{let{node:p,apiHandler:c,cacheKey:v,propertyAddBtnText:y,mode:m,selectorKey:f}=i;var g;const[j,h]=o([]),{updateMeta:O,createMeta:P,createProperty:b,deleteProperty:_,updateProperty:x,selectPropertyJoinOperator:A,clearProperty:B}=n(f),{cacheWrap:N}=a(),[k,T]=o(!0),$=p.metas.find((e=>e.key===u)),w=e=>N((()=>c({query:{triggerName:e}})),`${v}_${e}`),Q=(e,r)=>N((()=>c({query:{triggerName:e,propertyName:r}})),`${v}_${e}_${r}`);return t((()=>{N((()=>c({})),v).then((e=>{var r;if(e)if(Array.isArray(e)){const o=null!==(r=null==e?void 0:e.map((e=>({label:e.name,value:e.id,description:e.description,selected:"create"!==m&&(!!(null==$?void 0:$.value)&&$.value===e.id)}))))&&void 0!==r?r:[];h([...o])}else{const r=s.convertToGroupOptions(e,(null==$?void 0:$.value)?[$.value]:void 0);h([...r])}T(!1)}))}),[]),r(d,Object.assign({node:p,addPropertyBtnText:(null==$?void 0:$.value)&&y,deleteProperty:_,createProperty:b,propertySelectorText:"Select condition",fetchPropertyData:function(){return e(this,void 0,void 0,(function*(){if(null==$?void 0:$.value){return yield w(null==$?void 0:$.value)}return null}))},onPropertyNameSelect:function(r,o){return e(this,void 0,void 0,(function*(){x(Object.assign(Object.assign({},o),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),p._id);const e=yield Q(null==$?void 0:$.value,r.id);return e?Array.isArray(e)?e:s.convertToGroupOptions(e):[]}))},onPropertyOperatorChange:function(e,r){x(Object.assign(Object.assign({},r),{operator:e,value:void 0,error:{}}),p._id)},onPropertyValueChange:function(e,r){x(Object.assign(Object.assign({},r),{value:e}),p._id)},selectPropertyJoinOperator:A,mode:m},{children:r("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:8}},{children:r(l,{isLoading:k,error:null===(g=null==$?void 0:$.error)||void 0===g?void 0:g.key,width:"200px",options:j,onSelect:function(e){Array.isArray(e)||(B(p._id),(null==$?void 0:$.key)===u?O(Object.assign(Object.assign({},$),{value:e.value,error:{}}),p._id):P({key:u,value:e.value},p._id))}})}))}))};export{p as default};
1
+ import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsx as r}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{ApiResponseHelper as i}from"../../helpers/ApiResponse.helper.js";import{useQueryBuilder as a}from"../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as n}from"../../hooks/useQueryBuilderCache.js";import s from"../../components/DropdownWrapper.js";import{BaseQueryBuilderNode as l}from"../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";const d=new i,c="triggerName",u=i=>{let{node:u,apiHandler:p,cacheKey:v,propertyAddBtnText:y,mode:m,selectorKey:g}=i;var j;const[O,f]=t([]),{updateMeta:b,createMeta:h,createProperty:P,deleteProperty:_,updateProperty:A,selectPropertyJoinOperator:x,clearProperty:B}=a(g),{cacheWrap:N}=n(),[k,T]=t(!0),$=u.metas.find((e=>e.key===c)),w=e=>N((()=>p({query:{triggerName:e}})),`${v}_${e}`),Q=(e,r)=>N((()=>p({query:{triggerName:e,propertyName:r}})),`${v}_${e}_${r}`);return o((()=>{N((()=>p({})),v).then((e=>{var r;if(e)if(Array.isArray(e)){const t=null!==(r=null==e?void 0:e.map((e=>({label:e.name,value:e.id,description:e.description,selected:"create"!==m&&(!!(null==$?void 0:$.value)&&$.value===e.id)}))))&&void 0!==r?r:[];f([...t])}else{const r=d.convertToGroupOptions(e,(null==$?void 0:$.value)?[$.value]:void 0);f([...r])}T(!1)}))}),[]),r(l,Object.assign({node:u,addPropertyBtnText:(null==$?void 0:$.value)&&y,deleteProperty:_,createProperty:P,propertySelectorText:"Select condition",fetchPropertyData:function(){return e(this,void 0,void 0,(function*(){if(null==$?void 0:$.value){return yield w(null==$?void 0:$.value)}return null}))},onPropertyNameSelect:function(r,t){return e(this,void 0,void 0,(function*(){A(Object.assign(Object.assign({},t),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),u._id);const e=yield Q(null==$?void 0:$.value,r.id);return e?Array.isArray(e)?e:d.convertToGroupOptions(e):[]}))},onPropertyOperatorChange:function(e,r){A(Object.assign(Object.assign({},r),{operator:e,value:void 0,error:{}}),u._id)},onPropertyValueChange:function(e,r){A(Object.assign(Object.assign({},r),{value:e}),u._id)},selectPropertyJoinOperator:x,mode:m},{children:r("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:8}},{children:r(s,{isLoading:k,error:null===(j=null==$?void 0:$.error)||void 0===j?void 0:j.key,width:"200px",options:O,onSelect:function(e){Array.isArray(e)||(B(u._id),Array.isArray(O)&&f([...O.map((r=>{if(r.options){const t=r.options.map((r=>r.value===e.value?Object.assign(Object.assign({},r),{selected:!0}):Object.assign(Object.assign({},r),{selected:!1})));return Object.assign(Object.assign({},r),{options:t})}return r.value==r.value?Object.assign(Object.assign({},r),{selected:!0}):Object.assign(Object.assign({},r),{selected:!1})}))]),(null==$?void 0:$.key)===c?b(Object.assign(Object.assign({},$),{value:e.value,error:{}}),u._id):h({key:c,value:e.value},u._id))}})}))}))};export{u as default};
@@ -1 +1 @@
1
- import{jsxs as t,Fragment as n,jsx as o}from"react/jsx-runtime";import r from"@tippyjs/react";import e from"react";import i from"./TooltipInternal.js";import{COLORS as p}from"../../constants/Theme.js";const l=`\n .tippy-content {\n padding: 0px;\n }\n .tippy-arrow {\n \tcolor: ${t=>p.content.primary};\n }\n`,a=p=>e.isValidElement(p.children)?t(n,{children:[o("style",{children:l}),o(r,Object.assign({placement:p.placement||"right",maxWidth:p.width,animation:"fade",arrow:!0,interactive:!0,content:p.tooltipContent?p.tooltipContent:o(i,{title:p.title,body:p.body,buttonProps:p.buttonProps})},{children:p.children}))]}):null;export{a as Tooltip};
1
+ import{jsxs as t,Fragment as n,jsx as o}from"react/jsx-runtime";import e from"@tippyjs/react";import r from"react";import i from"./TooltipInternal.js";import{COLORS as p}from"../../constants/Theme.js";const a=`\n\t.tippy-content {\n\t\tpadding: 0px;\n\t}\n\t.tippy-arrow {\n\t\tcolor: ${t=>p.content.primary};\n\t}\n\t.overflow-wrap-tippy {\n\t\toverflow-wrap: anywhere;\n\t}\n`,l=p=>r.isValidElement(p.children)?t(n,{children:[o("style",{children:a}),o(e,Object.assign({appendTo:document.body,className:"overflow-wrap-tippy",placement:p.placement||"right",maxWidth:p.width,animation:"fade",arrow:!0,interactive:!0,content:p.tooltipContent?p.tooltipContent:o(i,{title:p.title,body:p.body,buttonProps:p.buttonProps})},{children:p.children}))]}):null;export{l as Tooltip};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",