@bikdotai/bik-component-library 0.0.658 → 0.0.659-beta.0

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.
Files changed (17) hide show
  1. package/dist/cjs/components/QueryBuilder/Filters/CustomField/components/CustomField.js +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  6. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  7. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +2 -0
  8. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  9. package/dist/esm/components/QueryBuilder/Filters/CustomField/components/CustomField.js +1 -1
  10. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  11. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  12. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  13. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  14. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  15. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +2 -0
  16. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  17. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("../../../components/AllowedListDropdown.js"),i=require("../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),t=require("../../../components/QueryBuilderNode/Property/PropertyNode.js"),d=require("../../../hooks/useQueryBuilder.js"),a=require("../../../hooks/useQueryBuilderCache.js");exports.default=s=>{let{node:l,allowedNodes:n,apiHandler:u,mode:p,selectorKey:c}=s;var y;const{selectType:v,createProperty:j,updateProperty:_}=d.useQueryBuilder(c),{cacheWrap:m}=a.useQueryBuilderCache();return r.jsx(i.BaseQueryBuilderNode,Object.assign({node:l,mode:p},{children:r.jsxs("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12,alignItems:"flex-start"}},{children:[r.jsx(o.default,{disabled:"view"===p,selectedType:l.type,allowedList:n,onSelect:e=>v(e.value,l._id)}),r.jsx(t.PropertyNodeHeadless,{mode:p,property:null===(y=null==l?void 0:l.properties)||void 0===y?void 0:y[0],fetchPropertyData:()=>m((()=>u({})),"CUSTOM_FIELDS"),onPropertyNameSelect:function(r){var o,i;return e.__awaiter(this,void 0,void 0,(function*(){if((null===(o=l.properties)||void 0===o?void 0:o[0])?_(Object.assign(Object.assign({},null===(i=l.properties)||void 0===i?void 0:i[0]),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),l._id):j({name:r.id,dataType:r.type},l._id),r.needValuesRetrieval){const e=yield(e=>m((()=>u({query:{propertyName:e}})),`CUSTOM_FIELDS-${e}`))(r.id);return null!=e?e:[]}return[]}))},onPropertyOperatorChange:function(e){_(Object.assign(Object.assign({},l.properties[0]),{operator:e,value:void 0,error:{}}),l._id)},onPropertyValueChange:function(e){_(Object.assign(Object.assign({},l.properties[0]),{value:e,error:{}}),l._id)},onPropertyValueSearch:function(r,o){var i,t;return e.__awaiter(this,void 0,void 0,(function*(){const d=yield((r,o)=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield u({query:{propertyName:r,searchKey:o}})})))(o.name,r);return null!==(t=null===(i=null==d?void 0:d.data)||void 0===i?void 0:i.map((e=>({label:e.name,value:e.id,selected:!1}))))&&void 0!==t?t:[]}))}})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("../../../components/AllowedListDropdown.js"),i=require("../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),t=require("../../../components/QueryBuilderNode/Property/PropertyNode.js"),a=require("../../../hooks/useQueryBuilder.js"),d=require("../../../hooks/useQueryBuilderCache.js");exports.default=s=>{let{node:n,allowedNodes:l,apiHandler:u,mode:p,selectorKey:c}=s;var y;const{selectType:v,createProperty:j,updateProperty:_}=a.useQueryBuilder(c),{cacheWrap:m}=d.useQueryBuilderCache();return r.jsx(i.BaseQueryBuilderNode,Object.assign({node:n,mode:p},{children:r.jsxs("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12,alignItems:"flex-start"}},{children:[r.jsx(o.default,{disabled:"view"===p,selectedType:n.type,allowedList:l,onSelect:e=>v(e.value,n._id)}),r.jsx(t.PropertyNodeHeadless,{mode:p,property:null===(y=null==n?void 0:n.properties)||void 0===y?void 0:y[0],fetchPropertyData:()=>m((()=>u({})),"CUSTOM_FIELDS"),onPropertyNameSelect:function(r){var o,i;return e.__awaiter(this,void 0,void 0,(function*(){if((null===(o=n.properties)||void 0===o?void 0:o[0])?_(Object.assign(Object.assign({},null===(i=n.properties)||void 0===i?void 0:i[0]),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),n._id):j({name:r.id,dataType:r.type},n._id),r.needValuesRetrieval){const e=yield((e,r)=>m((()=>u({query:Object.assign({propertyName:e},r)})),`CUSTOM_FIELDS-${e}`))(r.id,r);return null!=e?e:[]}return[]}))},onPropertyOperatorChange:function(e){_(Object.assign(Object.assign({},n.properties[0]),{operator:e,value:void 0,error:{}}),n._id)},onPropertyValueChange:function(e){_(Object.assign(Object.assign({},n.properties[0]),{value:e,error:{}}),n._id)},onPropertyValueSearch:function(r,o){var i,t;return e.__awaiter(this,void 0,void 0,(function*(){const a=yield((r,o)=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield u({query:{propertyName:r,searchKey:o}})})))(o.name,r);return null!==(t=null===(i=null==a?void 0:a.data)||void 0===i?void 0:i.map((e=>({label:e.name,value:e.id,selected:!1}))))&&void 0!==t?t:[]}))}})]}))}))};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -37,5 +37,7 @@ export type LineChartProps = {
37
37
  titleTooltipCallback?: (context: any) => void;
38
38
  isInternationalStore?: boolean;
39
39
  customYHeaders?: any;
40
+ legendsAndIconDirection?: 'row-reverse' | 'row';
41
+ headerIcons?: React.ReactNode[];
40
42
  };
41
43
  export declare const LineChart: React.FC<LineChartProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js"),l=require("react"),r=require("react-chartjs-2"),n=require("../../../TypographyStyle.js"),i=require("../../../../constants/Theme.js"),o=require("../utils/calcPercentage.js"),a=require("./LineChart.styled.js");t.Chart.register(t.CategoryScale,t.LinearScale,t.PointElement,t.BarElement,t.LineElement,t.ArcElement,t.Filler,t.Title,t.Tooltip,t.Legend);exports.LineChart=t=>{let{scaleText:s,labels:d,canvasHeight:c,datas:u,maintainAspectRatio:g=!1,stepSize:p,min:y,max:b,isZeroState:v,tension:C,isNewStyles:O,prefixCurrencyInYAxis:h,pointRadius:x,useKFormat:S,lineThickness:j,ticksLabelCallback:m,labelCallback:L,afterBodyCallBack:k,titleTooltipCallback:f,isInternationalStore:R,customYHeaders:q}=t;var B,w,F;const[T,E]=l.useState(null),z=l.useRef();l.useEffect((()=>{var e,t,l,r;if(null===(r=null===(l=null===(t=null===(e=z.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===r?void 0:r.length){const e=38*z.current.scales.y.ticks.length;E(e)}}),[z]);const I=u.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?i.COLORS.content.placeholder:i.COLORS.background.brand,square:e.squareLegends}))),$={labels:d,datasets:u.map(((e,t)=>{var l,r,n;return Object.assign(Object.assign({tension:null!=C?C:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)};return O?Object.assign({pointStyle:"circle",pointRadius:x||(d&&d.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)},l):Object.assign({pointRadius:null!=x?x:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(r=null!==(l=e.lineWidth)&&void 0!==l?l:j)&&void 0!==r?r:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,T?T-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(n=e.backgroundColor)&&void 0!==n?n:"transparent",legend:e.legend})}))},A={maintainAspectRatio:g,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=O&&O,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>i.COLORS.content.primaryInverse,backgroundColor:i.COLORS.content.primary,callbacks:{labelTextColor:()=>i.COLORS.content.primaryInverse,title:f,label:L,afterBody:k},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:v?0:y,max:v?10:b,ticks:{color:i.COLORS.content.secondary,callback:e=>{var t,l;return S?`${null!==(t=null==s?void 0:s.yPrefix)&&void 0!==t?t:""}${R?o.truncateValueForInternationalStore(e):o.truncateValueForIndianStore(e)}${null!=h?h:""}`:q&&Object.keys(q).length>0?q[e]:`${null!==(l=null==s?void 0:s.yPrefix)&&void 0!==l?l:""}${e}${null!=h?h:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:v?1:p,padding:O?24:0},title:{display:!!(null==s?void 0:s.y),text:null==s?void 0:s.y},grid:{color:i.COLORS.background.base,drawBorder:null===(B=null==s?void 0:s.yDrawBorder)||void 0===B||B}},x:{ticks:{callback:m,color:i.COLORS.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==s?void 0:s.x),text:null==s?void 0:s.x},grid:{display:!1,drawBorder:null!==(w=null==s?void 0:s.xDrawBorder)&&void 0!==w&&w}}}};return e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},g?{}:{height:null!==(F=null!=c?c:T)&&void 0!==F?F:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e.jsx(a.LegendWrapper,{children:I.map(((t,l)=>{let{text:r,color:i,square:o}=t;return r?e.jsxs(a.LegendContainer,{children:[e.jsx(a.LegendColor,{color:i,square:o,newStyle:O}),e.jsx(n.BodyTiny,Object.assign({color:"#667085"},{children:r}))]},l):e.jsx(e.Fragment,{})}))}),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(r.Line,{ref:z,options:A,data:$})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js"),n=require("react"),l=require("react-chartjs-2"),r=require("../../../TypographyStyle.js"),i=require("../../../../constants/Theme.js"),o=require("../utils/calcPercentage.js"),a=require("./LineChart.styled.js");t.Chart.register(t.CategoryScale,t.LinearScale,t.PointElement,t.BarElement,t.LineElement,t.ArcElement,t.Filler,t.Title,t.Tooltip,t.Legend);exports.LineChart=t=>{let{scaleText:s,labels:d,canvasHeight:c,datas:u,maintainAspectRatio:g=!1,stepSize:p,min:y,max:b,isZeroState:C,tension:v,isNewStyles:h,prefixCurrencyInYAxis:x,pointRadius:O,useKFormat:j,lineThickness:m,ticksLabelCallback:S,labelCallback:L,afterBodyCallBack:f,titleTooltipCallback:k,isInternationalStore:R,customYHeaders:w,headerIcons:q=[],legendsAndIconDirection:B="row"}=t;var F,T,I;const[E,z]=n.useState(null),A=n.useRef();n.useEffect((()=>{var e,t,n,l;if(null===(l=null===(n=null===(t=null===(e=A.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===n?void 0:n.ticks)||void 0===l?void 0:l.length){const e=38*A.current.scales.y.ticks.length;z(e)}}),[A]);const D=u.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?i.COLORS.content.placeholder:i.COLORS.background.brand,square:e.squareLegends}))),$={labels:d,datasets:u.map(((e,t)=>{var n,l,r;return Object.assign(Object.assign({tension:null!=v?v:.4,fill:e.gradient?"start":0},((e,t)=>{const n={borderColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)};return h?Object.assign({pointStyle:"circle",pointRadius:O||(d&&d.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)},n):Object.assign({pointRadius:null!=O?O:1},n)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(l=null!==(n=e.lineWidth)&&void 0!==n?n:m)&&void 0!==l?l:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,E?E-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(r=e.backgroundColor)&&void 0!==r?r:"transparent",legend:e.legend})}))},P={maintainAspectRatio:g,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=h&&h,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>i.COLORS.content.primaryInverse,backgroundColor:i.COLORS.content.primary,callbacks:{labelTextColor:()=>i.COLORS.content.primaryInverse,title:k,label:L,afterBody:f},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:C?0:y,max:C?10:b,ticks:{color:i.COLORS.content.secondary,callback:e=>{var t,n;return j?`${null!==(t=null==s?void 0:s.yPrefix)&&void 0!==t?t:""}${R?o.truncateValueForInternationalStore(e):o.truncateValueForIndianStore(e)}${null!=x?x:""}`:w&&Object.keys(w).length>0?w[e]:`${null!==(n=null==s?void 0:s.yPrefix)&&void 0!==n?n:""}${e}${null!=x?x:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:C?1:p,padding:h?24:0},title:{display:!!(null==s?void 0:s.y),text:null==s?void 0:s.y},grid:{color:i.COLORS.background.base,drawBorder:null===(F=null==s?void 0:s.yDrawBorder)||void 0===F||F}},x:{ticks:{callback:S,color:i.COLORS.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==s?void 0:s.x),text:null==s?void 0:s.x},grid:{display:!1,drawBorder:null!==(T=null==s?void 0:s.xDrawBorder)&&void 0!==T&&T}}}};return e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},g?{}:{height:null!==(I=null!=c?c:E)&&void 0!==I?I:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",justifyContent:"space-between",width:"100%",flexDirection:B}},{children:[e.jsx(a.LegendWrapper,{children:D.map(((t,n)=>{let{text:l,color:i,square:o}=t;return l?e.jsxs(a.LegendContainer,{children:[e.jsx(a.LegendColor,{color:i,square:o,newStyle:h}),e.jsx(r.BodyTiny,Object.assign({color:"#667085"},{children:l}))]},n):e.jsx(e.Fragment,{})}))}),e.jsx(a.LegendWrapper,{children:q.map(((t,n)=>e.jsx(a.LegendContainer,{children:t},n)))})]})),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(l.Line,{ref:A,options:P,data:$})}))]}))};
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../../../_virtual/_tslib.js";import{jsx as r,jsxs as o}from"react/jsx-runtime";import t from"../../../components/AllowedListDropdown.js";import{BaseQueryBuilderNode as i}from"../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";import{PropertyNodeHeadless as n}from"../../../components/QueryBuilderNode/Property/PropertyNode.js";import{useQueryBuilder as d}from"../../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as a}from"../../../hooks/useQueryBuilderCache.js";const l=l=>{let{node:s,allowedNodes:p,apiHandler:u,mode:c,selectorKey:v}=l;var y;const{selectType:m,createProperty:f,updateProperty:j}=d(v),{cacheWrap:h}=a();return r(i,Object.assign({node:s,mode:c},{children:o("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12,alignItems:"flex-start"}},{children:[r(t,{disabled:"view"===c,selectedType:s.type,allowedList:p,onSelect:e=>m(e.value,s._id)}),r(n,{mode:c,property:null===(y=null==s?void 0:s.properties)||void 0===y?void 0:y[0],fetchPropertyData:()=>h((()=>u({})),"CUSTOM_FIELDS"),onPropertyNameSelect:function(r){var o,t;return e(this,void 0,void 0,(function*(){if((null===(o=s.properties)||void 0===o?void 0:o[0])?j(Object.assign(Object.assign({},null===(t=s.properties)||void 0===t?void 0:t[0]),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),s._id):f({name:r.id,dataType:r.type},s._id),r.needValuesRetrieval){const e=yield(e=>h((()=>u({query:{propertyName:e}})),`CUSTOM_FIELDS-${e}`))(r.id);return null!=e?e:[]}return[]}))},onPropertyOperatorChange:function(e){j(Object.assign(Object.assign({},s.properties[0]),{operator:e,value:void 0,error:{}}),s._id)},onPropertyValueChange:function(e){j(Object.assign(Object.assign({},s.properties[0]),{value:e,error:{}}),s._id)},onPropertyValueSearch:function(r,o){var t,i;return e(this,void 0,void 0,(function*(){const n=yield((r,o)=>e(void 0,void 0,void 0,(function*(){return yield u({query:{propertyName:r,searchKey:o}})})))(o.name,r);return null!==(i=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.map((e=>({label:e.name,value:e.id,selected:!1}))))&&void 0!==i?i:[]}))}})]}))}))};export{l as default};
1
+ import{__awaiter as e}from"../../../../../_virtual/_tslib.js";import{jsx as r,jsxs as o}from"react/jsx-runtime";import t from"../../../components/AllowedListDropdown.js";import{BaseQueryBuilderNode as i}from"../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";import{PropertyNodeHeadless as n}from"../../../components/QueryBuilderNode/Property/PropertyNode.js";import{useQueryBuilder as d}from"../../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as a}from"../../../hooks/useQueryBuilderCache.js";const l=l=>{let{node:s,allowedNodes:p,apiHandler:u,mode:c,selectorKey:v}=l;var y;const{selectType:m,createProperty:f,updateProperty:j}=d(v),{cacheWrap:g}=a();return r(i,Object.assign({node:s,mode:c},{children:o("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12,alignItems:"flex-start"}},{children:[r(t,{disabled:"view"===c,selectedType:s.type,allowedList:p,onSelect:e=>m(e.value,s._id)}),r(n,{mode:c,property:null===(y=null==s?void 0:s.properties)||void 0===y?void 0:y[0],fetchPropertyData:()=>g((()=>u({})),"CUSTOM_FIELDS"),onPropertyNameSelect:function(r){var o,t;return e(this,void 0,void 0,(function*(){if((null===(o=s.properties)||void 0===o?void 0:o[0])?j(Object.assign(Object.assign({},null===(t=s.properties)||void 0===t?void 0:t[0]),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),s._id):f({name:r.id,dataType:r.type},s._id),r.needValuesRetrieval){const e=yield((e,r)=>g((()=>u({query:Object.assign({propertyName:e},r)})),`CUSTOM_FIELDS-${e}`))(r.id,r);return null!=e?e:[]}return[]}))},onPropertyOperatorChange:function(e){j(Object.assign(Object.assign({},s.properties[0]),{operator:e,value:void 0,error:{}}),s._id)},onPropertyValueChange:function(e){j(Object.assign(Object.assign({},s.properties[0]),{value:e,error:{}}),s._id)},onPropertyValueSearch:function(r,o){var t,i;return e(this,void 0,void 0,(function*(){const n=yield((r,o)=>e(void 0,void 0,void 0,(function*(){return yield u({query:{propertyName:r,searchKey:o}})})))(o.name,r);return null!==(i=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.map((e=>({label:e.name,value:e.id,selected:!1}))))&&void 0!==i?i:[]}))}})]}))}))};export{l as default};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -37,5 +37,7 @@ export type LineChartProps = {
37
37
  titleTooltipCallback?: (context: any) => void;
38
38
  isInternationalStore?: boolean;
39
39
  customYHeaders?: any;
40
+ legendsAndIconDirection?: 'row-reverse' | 'row';
41
+ headerIcons?: React.ReactNode[];
40
42
  };
41
43
  export declare const LineChart: React.FC<LineChartProps>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as o,CategoryScale as r,LinearScale as n,PointElement as i,BarElement as a,LineElement as s,ArcElement as d,Filler as c,Title as u,Tooltip as p,Legend as g}from"chart.js";import{useState as b,useRef as y,useEffect as m}from"react";import{Line as v}from"react-chartjs-2";import{BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as f}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as k,truncateValueForIndianStore as x}from"../utils/calcPercentage.js";import{LegendWrapper as C,LegendContainer as j,LegendColor as w}from"./LineChart.styled.js";o.register(r,n,i,a,s,d,c,u,p,g);const B=o=>{let{scaleText:r,labels:n,canvasHeight:i,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:u,isZeroState:p,tension:g,isNewStyles:B,prefixCurrencyInYAxis:O,pointRadius:S,useKFormat:z,lineThickness:T,ticksLabelCallback:$,labelCallback:F,afterBodyCallBack:R,titleTooltipCallback:q,isInternationalStore:A,customYHeaders:D}=o;var I,L,P;const[E,H]=b(null),W=y();m((()=>{var e,t,l,o;if(null===(o=null===(l=null===(t=null===(e=W.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===o?void 0:o.length){const e=38*W.current.scales.y.ticks.length;H(e)}}),[W]);const Y=a.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?f.content.placeholder:f.background.brand,square:e.squareLegends}))),Z={labels:n,datasets:a.map(((e,t)=>{var l,o,r;return Object.assign(Object.assign({tension:null!=g?g:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?f.content.placeholder:f.background.brand)};return B?Object.assign({pointStyle:"circle",pointRadius:S||(n&&n.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?f.content.placeholder:f.background.brand)},l):Object.assign({pointRadius:null!=S?S:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(o=null!==(l=e.lineWidth)&&void 0!==l?l:T)&&void 0!==o?o:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,E?E-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(r=e.backgroundColor)&&void 0!==r?r:"transparent",legend:e.legend})}))},G={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=B&&B,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>f.content.primaryInverse,backgroundColor:f.content.primary,callbacks:{labelTextColor:()=>f.content.primaryInverse,title:q,label:F,afterBody:R},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:p?0:c,max:p?10:u,ticks:{color:f.content.secondary,callback:e=>{var t,l;return z?`${null!==(t=null==r?void 0:r.yPrefix)&&void 0!==t?t:""}${A?k(e):x(e)}${null!=O?O:""}`:D&&Object.keys(D).length>0?D[e]:`${null!==(l=null==r?void 0:r.yPrefix)&&void 0!==l?l:""}${e}${null!=O?O:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:p?1:d,padding:B?24:0},title:{display:!!(null==r?void 0:r.y),text:null==r?void 0:r.y},grid:{color:f.background.base,drawBorder:null===(I=null==r?void 0:r.yDrawBorder)||void 0===I||I}},x:{ticks:{callback:$,color:f.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==r?void 0:r.x),text:null==r?void 0:r.x},grid:{display:!1,drawBorder:null!==(L=null==r?void 0:r.xDrawBorder)&&void 0!==L&&L}}}};return e("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(P=null!=i?i:E)&&void 0!==P?P:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[t(C,{children:Y.map(((o,r)=>{let{text:n,color:i,square:a}=o;return n?e(j,{children:[t(w,{color:i,square:a,newStyle:B}),t(h,Object.assign({color:"#667085"},{children:n}))]},r):t(l,{})}))}),t("div",Object.assign({style:{flex:1}},{children:t(v,{ref:W,options:G,data:Z})}))]}))};export{B as LineChart};
1
+ import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as n,CategoryScale as o,LinearScale as r,PointElement as i,BarElement as a,LineElement as s,ArcElement as d,Filler as c,Title as u,Tooltip as p,Legend as g}from"chart.js";import{useState as b,useRef as y,useEffect as m}from"react";import{Line as v}from"react-chartjs-2";import{BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as f}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as x,truncateValueForIndianStore as k}from"../utils/calcPercentage.js";import{LegendWrapper as C,LegendContainer as j,LegendColor as w}from"./LineChart.styled.js";n.register(o,r,i,a,s,d,c,u,p,g);const O=n=>{let{scaleText:o,labels:r,canvasHeight:i,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:u,isZeroState:p,tension:g,isNewStyles:O,prefixCurrencyInYAxis:B,pointRadius:S,useKFormat:z,lineThickness:D,ticksLabelCallback:I,labelCallback:T,afterBodyCallBack:$,titleTooltipCallback:A,isInternationalStore:F,customYHeaders:R,headerIcons:q=[],legendsAndIconDirection:L="row"}=n;var P,E,H;const[W,Y]=b(null),Z=y();m((()=>{var e,t,l,n;if(null===(n=null===(l=null===(t=null===(e=Z.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===n?void 0:n.length){const e=38*Z.current.scales.y.ticks.length;Y(e)}}),[Z]);const G=a.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?f.content.placeholder:f.background.brand,square:e.squareLegends}))),K={labels:r,datasets:a.map(((e,t)=>{var l,n,o;return Object.assign(Object.assign({tension:null!=g?g:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?f.content.placeholder:f.background.brand)};return O?Object.assign({pointStyle:"circle",pointRadius:S||(r&&r.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?f.content.placeholder:f.background.brand)},l):Object.assign({pointRadius:null!=S?S:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(n=null!==(l=e.lineWidth)&&void 0!==l?l:D)&&void 0!==n?n:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,W?W-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(o=e.backgroundColor)&&void 0!==o?o:"transparent",legend:e.legend})}))},N={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=O&&O,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>f.content.primaryInverse,backgroundColor:f.content.primary,callbacks:{labelTextColor:()=>f.content.primaryInverse,title:A,label:T,afterBody:$},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:p?0:c,max:p?10:u,ticks:{color:f.content.secondary,callback:e=>{var t,l;return z?`${null!==(t=null==o?void 0:o.yPrefix)&&void 0!==t?t:""}${F?x(e):k(e)}${null!=B?B:""}`:R&&Object.keys(R).length>0?R[e]:`${null!==(l=null==o?void 0:o.yPrefix)&&void 0!==l?l:""}${e}${null!=B?B:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:p?1:d,padding:O?24:0},title:{display:!!(null==o?void 0:o.y),text:null==o?void 0:o.y},grid:{color:f.background.base,drawBorder:null===(P=null==o?void 0:o.yDrawBorder)||void 0===P||P}},x:{ticks:{callback:I,color:f.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==o?void 0:o.x),text:null==o?void 0:o.x},grid:{display:!1,drawBorder:null!==(E=null==o?void 0:o.xDrawBorder)&&void 0!==E&&E}}}};return e("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(H=null!=i?i:W)&&void 0!==H?H:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e("div",Object.assign({style:{display:"flex",justifyContent:"space-between",width:"100%",flexDirection:L}},{children:[t(C,{children:G.map(((n,o)=>{let{text:r,color:i,square:a}=n;return r?e(j,{children:[t(w,{color:i,square:a,newStyle:O}),t(h,Object.assign({color:"#667085"},{children:r}))]},o):t(l,{})}))}),t(C,{children:q.map(((e,l)=>t(j,{children:e},l)))})]})),t("div",Object.assign({style:{flex:1}},{children:t(v,{ref:Z,options:N,data:K})}))]}))};export{O as LineChart};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.658",
3
+ "version": "0.0.659-beta.0",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",