@bikdotai/bik-component-library 0.0.27-beta.2 → 0.0.27-beta.3

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("react/jsx-runtime"),r=require("react"),o=require("../../../constants/connectorPosition.js"),t=require("../../../helpers/ApiResponse.helper.js"),n=require("../../Connectors/Connector.js"),a=require("../../DropdownWrapper.js"),i=require("./PropertyNode.styled.js"),s=require("./PropertyNodeUIWrapper.js");const l=new t.ApiResponseHelper,d=t=>{let{propertySelectorText:s,fetchPropertyData:d,onPropertyNameSelect:p,onPropertyOperatorChange:u,onPropertyValueChange:c,property:v,mode:y}=t;var j,g,h,x,f,b;const[m,C]=r.useState([]),[O,A]=r.useState({}),[P,w]=r.useState(!0),q=Array.isArray(m)?m.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(m,(null==v?void 0:v.name)?[v.name.toString()]:void 0);return r.useEffect((()=>{d?d().then((e=>{e&&(Array.isArray(e)?C([...e]):C(Object.assign({},e))),w(!1)})):w(!1)}),[]),e.jsxs(e.Fragment,{children:[e.jsxs(i.Container,{children:[e.jsx(a.default,{disabled:"view"===y,width:"200px",isLoading:P,dropdownLabel:null!=s?s:"Select property",options:q,onSelect:function(e){if(!Array.isArray(e)){let r=null;Array.isArray(m)?r=m.find((r=>{let{id:o}=r;return o===e.value})):Object.keys(m).forEach((o=>{const t=m[o].find((r=>{let{id:o}=r;return o===e.value}));t&&(r=t)})),A({}),r&&(null==p||p(r,v).then((e=>{A({options:Array.isArray(e)?[...e]:Object.assign({},e)})})))}}}),(null==v?void 0:v.name)&&!(null===(j=o.isNewLineConnectorPosition[v.dataType])||void 0===j?void 0:j[v.operator])&&e.jsx(n.default,{disabled:"view"===y,extra:O,errors:{val:null===(g=v.error)||void 0===g?void 0:g.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==u?void 0:u(e,v),onValueChange:e=>null==c?void 0:c(e,v)})]}),(null==v?void 0:v.name)&&(null===(x=o.isNewLineConnectorPosition[v.dataType])||void 0===x?void 0:x[v.operator])&&e.jsx(n.default,{disabled:"view"===y,extra:O,errors:{val:null===(f=v.error)||void 0===f?void 0:f.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==u?void 0:u(e,v),onValueChange:e=>null==c?void 0:c(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}},{children:e.jsx(d,Object.assign({},r))}))})),exports.PropertyNodeHeadless=d;
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"),t=require("../../Connectors/Connector.js"),a=require("../../DropdownWrapper.js"),i=require("./PropertyNode.styled.js"),l=require("./PropertyNodeUIWrapper.js");const s=new n.ApiResponseHelper,d=n=>{let{propertySelectorText:l,fetchPropertyData:d,onPropertyNameSelect:p,onPropertyOperatorChange:u,onPropertyValueChange:c,property:v,mode:y}=n;var j,g,h,x,f,b,m;const[C,O]=r.useState([]),[A,P]=r.useState({}),[w,q]=r.useState(!0),S=Array.isArray(C)?C.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}))):s.convertToGroupOptions(C,(null==v?void 0:v.name)?[v.name.toString()]:void 0);return r.useEffect((()=>{d?d().then((e=>{e&&(Array.isArray(e)?O([...e]):O(Object.assign({},e))),q(!1)})):q(!1)}),[]),e.jsxs(e.Fragment,{children:[e.jsxs(i.Container,{children:[e.jsx(a.default,{disabled:"view"===y,width:"200px",isLoading:w,dropdownLabel:null!=l?l:"Select property",options:S,onSelect:function(e){if(!Array.isArray(e)){let r=null;Array.isArray(C)?r=C.find((r=>{let{id:o}=r;return o===e.value})):Object.keys(C).forEach((o=>{const n=C[o].find((r=>{let{id:o}=r;return o===e.value}));n&&(r=n)})),P({}),r&&(null==p||p(r,v).then((e=>{P({options:Array.isArray(e)?[...e]:Object.assign({},e)})})))}},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(t.default,{disabled:"view"===y,extra:A,errors:{val:null===(h=v.error)||void 0===h?void 0:h.value,operator:null===(x=v.error)||void 0===x?void 0:x.operator},connectorVal:v.value,connectorType:v.dataType,defaultConnector:v.operator,onOperatorChange:e=>null==u?void 0:u(e,v),onValueChange:e=>null==c?void 0:c(e,v)})]}),(null==v?void 0:v.name)&&(null===(f=o.isNewLineConnectorPosition[v.dataType])||void 0===f?void 0:f[v.operator])&&e.jsx(t.default,{disabled:"view"===y,extra:A,errors:{val:null===(b=v.error)||void 0===b?void 0:b.value,operator:null===(m=v.error)||void 0===m?void 0:m.operator},connectorVal:v.value,connectorType:v.dataType,defaultConnector:v.operator,onOperatorChange:e=>null==u?void 0:u(e,v),onValueChange:e=>null==c?void 0:c(e,v)})]})};exports.PropertyNode=r=>e.jsx(l.default,Object.assign({isLast:r.isLast,mode:r.mode},{children:e.jsx("div",Object.assign({style:{padding:12}},{children:e.jsx(d,Object.assign({},r))}))})),exports.PropertyNodeHeadless=d;
@@ -1 +1 @@
1
- import{jsx as r,jsxs as e,Fragment as o}from"react/jsx-runtime";import{useState as n,useEffect as t}from"react";import{isNewLineConnectorPosition as a}from"../../../constants/connectorPosition.js";import{ApiResponseHelper as i}from"../../../helpers/ApiResponse.helper.js";import l from"../../Connectors/Connector.js";import d from"../../DropdownWrapper.js";import{Container as p}from"./PropertyNode.styled.js";import s from"./PropertyNodeUIWrapper.js";const c=new i,v=e=>r(s,Object.assign({isLast:e.isLast,mode:e.mode},{children:r("div",Object.assign({style:{padding:12}},{children:r(u,Object.assign({},e))}))})),u=i=>{let{propertySelectorText:s,fetchPropertyData:v,onPropertyNameSelect:u,onPropertyOperatorChange:m,onPropertyValueChange:y,property:h,mode:f}=i;var g,j,b,O,A,C;const[T,w]=n([]),[P,x]=n({}),[S,V]=n(!0),L=Array.isArray(T)?T.map((r=>Object.assign(Object.assign({},r),{label:r.name,value:r.id,description:r.description,selected:(null==h?void 0:h.name)===r.id}))):c.convertToGroupOptions(T,(null==h?void 0:h.name)?[h.name.toString()]:void 0);return t((()=>{v?v().then((r=>{r&&(Array.isArray(r)?w([...r]):w(Object.assign({},r))),V(!1)})):V(!1)}),[]),e(o,{children:[e(p,{children:[r(d,{disabled:"view"===f,width:"200px",isLoading:S,dropdownLabel:null!=s?s:"Select property",options:L,onSelect:function(r){if(!Array.isArray(r)){let e=null;Array.isArray(T)?e=T.find((e=>{let{id:o}=e;return o===r.value})):Object.keys(T).forEach((o=>{const n=T[o].find((e=>{let{id:o}=e;return o===r.value}));n&&(e=n)})),x({}),e&&(null==u||u(e,h).then((r=>{x({options:Array.isArray(r)?[...r]:Object.assign({},r)})})))}}}),(null==h?void 0:h.name)&&!(null===(g=a[h.dataType])||void 0===g?void 0:g[h.operator])&&r(l,{disabled:"view"===f,extra:P,errors:{val:null===(j=h.error)||void 0===j?void 0:j.value,operator:null===(b=h.error)||void 0===b?void 0:b.operator},connectorVal:h.value,connectorType:h.dataType,defaultConnector:h.operator,onOperatorChange:r=>null==m?void 0:m(r,h),onValueChange:r=>null==y?void 0:y(r,h)})]}),(null==h?void 0:h.name)&&(null===(O=a[h.dataType])||void 0===O?void 0:O[h.operator])&&r(l,{disabled:"view"===f,extra:P,errors:{val:null===(A=h.error)||void 0===A?void 0:A.value,operator:null===(C=h.error)||void 0===C?void 0:C.operator},connectorVal:h.value,connectorType:h.dataType,defaultConnector:h.operator,onOperatorChange:r=>null==m?void 0:m(r,h),onValueChange:r=>null==y?void 0:y(r,h)})]})};export{v as PropertyNode,u as PropertyNodeHeadless};
1
+ import{jsx as r,jsxs as e,Fragment as o}from"react/jsx-runtime";import{useState as n,useEffect as t}from"react";import{isNewLineConnectorPosition as a}from"../../../constants/connectorPosition.js";import{ApiResponseHelper as i}from"../../../helpers/ApiResponse.helper.js";import l from"../../Connectors/Connector.js";import d from"../../DropdownWrapper.js";import{Container as p}from"./PropertyNode.styled.js";import s from"./PropertyNodeUIWrapper.js";const c=new i,v=e=>r(s,Object.assign({isLast:e.isLast,mode:e.mode},{children:r("div",Object.assign({style:{padding:12}},{children:r(u,Object.assign({},e))}))})),u=i=>{let{propertySelectorText:s,fetchPropertyData:v,onPropertyNameSelect:u,onPropertyOperatorChange:m,onPropertyValueChange:y,property:h,mode:f}=i;var g,j,b,O,A,C,T;const[w,P]=n([]),[x,S]=n({}),[V,L]=n(!0),N=Array.isArray(w)?w.map((r=>Object.assign(Object.assign({},r),{label:r.name,value:r.id,description:r.description,selected:(null==h?void 0:h.name)===r.id}))):c.convertToGroupOptions(w,(null==h?void 0:h.name)?[h.name.toString()]:void 0);return t((()=>{v?v().then((r=>{r&&(Array.isArray(r)?P([...r]):P(Object.assign({},r))),L(!1)})):L(!1)}),[]),e(o,{children:[e(p,{children:[r(d,{disabled:"view"===f,width:"200px",isLoading:V,dropdownLabel:null!=s?s:"Select property",options:N,onSelect:function(r){if(!Array.isArray(r)){let e=null;Array.isArray(w)?e=w.find((e=>{let{id:o}=e;return o===r.value})):Object.keys(w).forEach((o=>{const n=w[o].find((e=>{let{id:o}=e;return o===r.value}));n&&(e=n)})),S({}),e&&(null==u||u(e,h).then((r=>{S({options:Array.isArray(r)?[...r]:Object.assign({},r)})})))}},error:null===(g=null==h?void 0:h.error)||void 0===g?void 0:g.name}),(null==h?void 0:h.name)&&!(null===(j=a[h.dataType])||void 0===j?void 0:j[h.operator])&&r(l,{disabled:"view"===f,extra:x,errors:{val:null===(b=h.error)||void 0===b?void 0:b.value,operator:null===(O=h.error)||void 0===O?void 0:O.operator},connectorVal:h.value,connectorType:h.dataType,defaultConnector:h.operator,onOperatorChange:r=>null==m?void 0:m(r,h),onValueChange:r=>null==y?void 0:y(r,h)})]}),(null==h?void 0:h.name)&&(null===(A=a[h.dataType])||void 0===A?void 0:A[h.operator])&&r(l,{disabled:"view"===f,extra:x,errors:{val:null===(C=h.error)||void 0===C?void 0:C.value,operator:null===(T=h.error)||void 0===T?void 0:T.operator},connectorVal:h.value,connectorType:h.dataType,defaultConnector:h.operator,onOperatorChange:r=>null==m?void 0:m(r,h),onValueChange:r=>null==y?void 0:y(r,h)})]})};export{v as PropertyNode,u as PropertyNodeHeadless};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.27-beta.2",
3
+ "version": "0.0.27-beta.3",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",