@bikdotai/bik-component-library 0.0.209-beta.7 → 0.0.210-beta.1
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/Filters/Event/components/EventFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.d.ts +4 -0
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -0
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Connector.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/DropdownWrapper.d.ts +0 -1
- package/dist/cjs/components/QueryBuilder/components/DropdownWrapper.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.d.ts +1 -5
- package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
- package/dist/cjs/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.d.ts +2 -0
- package/dist/cjs/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -0
- package/dist/cjs/components/QueryBuilder/constants/connector.d.ts +16 -7
- package/dist/cjs/components/QueryBuilder/constants/connector.js +1 -1
- package/dist/cjs/components/QueryBuilder/helpers/Connector.helper.d.ts +2 -0
- package/dist/cjs/components/QueryBuilder/helpers/Connector.helper.js +1 -1
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -3
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +15 -7
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.js +1 -1
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderPropertyProps.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +0 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +1 -1
- package/dist/cjs/components/dropdown/type.d.ts +0 -1
- package/dist/cjs/components/input/Input.d.ts +0 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.d.ts +4 -0
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -0
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Connector.js +1 -1
- package/dist/esm/components/QueryBuilder/components/DropdownWrapper.d.ts +0 -1
- package/dist/esm/components/QueryBuilder/components/DropdownWrapper.js +1 -1
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.d.ts +1 -5
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
- package/dist/esm/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.d.ts +2 -0
- package/dist/esm/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -0
- package/dist/esm/components/QueryBuilder/constants/connector.d.ts +16 -7
- package/dist/esm/components/QueryBuilder/constants/connector.js +1 -1
- package/dist/esm/components/QueryBuilder/helpers/Connector.helper.d.ts +2 -0
- package/dist/esm/components/QueryBuilder/helpers/Connector.helper.js +1 -1
- package/dist/esm/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -3
- package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +15 -7
- package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.js +1 -1
- package/dist/esm/components/QueryBuilder/types/QueryBuilderPropertyProps.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +0 -1
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +1 -1
- package/dist/esm/components/dropdown/type.d.ts +0 -1
- package/dist/esm/components/input/Input.d.ts +0 -1
- package/dist/esm/components/input/Input.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/dropdown/hooks/useDropdown.d.ts +0 -39
- package/dist/cjs/components/dropdown/hooks/useDropdown.js +0 -1
- package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +0 -39
- package/dist/esm/components/dropdown/hooks/useDropdown.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../../../_virtual/_tslib.js";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as t,useEffect as a}from"react";import l from"../../../components/AllowedListDropdown.js";import i from"../../../components/Connectors/Connector.js";import{ApiResponseHelper as n}from"../../../helpers/ApiResponse.helper.js";import{useQueryBuilder as d}from"../../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as u}from"../../../hooks/useQueryBuilderCache.js";import{QueryBuilderConnectorType as v}from"../../../types/QueryBuilder.type.js";import{FREQUENCY_OPERATORS as p,DATE_OPERATORS as s}from"../../../types/QueryBuilderOperator.type.js";import c from"../../../components/DropdownWrapper.js";import{BaseQueryBuilderNode as y}from"../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";const m=new n,f=n=>{let{node:f,allowedNodes:
|
|
1
|
+
import{__awaiter as e}from"../../../../../_virtual/_tslib.js";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as t,useEffect as a}from"react";import l from"../../../components/AllowedListDropdown.js";import i from"../../../components/Connectors/Connector.js";import{ApiResponseHelper as n}from"../../../helpers/ApiResponse.helper.js";import{useQueryBuilder as d}from"../../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as u}from"../../../hooks/useQueryBuilderCache.js";import{QueryBuilderConnectorType as v}from"../../../types/QueryBuilder.type.js";import{FREQUENCY_OPERATORS as p,DATE_OPERATORS as s}from"../../../types/QueryBuilderOperator.type.js";import c from"../../../components/DropdownWrapper.js";import{BaseQueryBuilderNode as y}from"../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";const m=new n,f=n=>{let{node:f,allowedNodes:T,apiHandler:h,mode:_,selectorKey:j}=n;var k,g,b,N,O,w,P,q,x,C,S,B,E,V,A,Q,D,M;const[L,$]=t([]),[J,W]=t(!1),{deleteProperty:G,createProperty:H,selectType:K,createMeta:R,updateMeta:z,updateProperty:F,selectPropertyJoinOperator:I,clearProperty:U}=d(j),{cacheWrap:X}=u(),[Y,Z]=t(!0),ee=null===(k=null==f?void 0:f.metas)||void 0===k?void 0:k.find((e=>"date"===e.key)),oe=null===(g=null==f?void 0:f.metas)||void 0===g?void 0:g.find((e=>"frequency"===e.key)),re=null===(b=null==f?void 0:f.metas)||void 0===b?void 0:b.find((e=>"eventName"===e.key)),[te,ae]=t(!1),[le,ie]=t(!1),[ne,de]=t(!1),ue=e=>X((()=>h({query:{eventName:e}})),`EVENT_NAMES_${e}`),ve=(e,o)=>X((()=>h({query:{eventName:e,propertyName:o}})),`EVENT_NAMES_${e}_${o}`);return a((()=>{X((()=>h({})),"EVENT_NAMES").then((e=>{Z(!1);const o=m.convertToGroupOptions(e,(null==re?void 0:re.value)?[re.value]:void 0);if("create"!==_&&re)return $([...o]),void W(!0);$([...o]),W(!0)}))}),[]),o(y,Object.assign({selectPropertyJoinOperator:I,node:f,addPropertyBtnText:(null==re?void 0:re.value)&&"Add event property",deleteProperty:G,createProperty:H,propertySelectorText:"Select property",fetchPropertyData:function(){return e(this,void 0,void 0,(function*(){return yield ue(null==re?void 0:re.value)}))},onPropertyNameSelect:function(o,r){return e(this,void 0,void 0,(function*(){F(Object.assign(Object.assign({},r),{name:o.id,dataType:o.type,operator:void 0,value:void 0,error:{}}),f._id);const e=yield ve(null==re?void 0:re.value,o.id);return null!=e?e:[]}))},onPropertyOperatorChange:function(e,o){F(Object.assign(Object.assign({},o),{operator:e,value:void 0,error:{}}),f._id)},onPropertyValueChange:function(e,o){F(Object.assign(Object.assign({},o),{value:e,error:{}}),f._id)},mode:_},{children:r("div",Object.assign({style:{flexDirection:"column",display:"flex",gap:12}},{children:[r("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12}},{children:[o(l,{disabled:"view"===_,selectedType:f.type,allowedList:T,onSelect:function(e){ae(!0),setTimeout((()=>{K(e.value,f._id),ae(!1)}),1)}}),!te&&o(c,{isSearchable:!0,isLoading:Y,disabled:"view"===_,width:"200px",dropdownLabel:"Select event name",options:L,selectedValues:(null==re?void 0:re.value)?[re.value]:void 0,onSelect:function(e){Array.isArray(e)||(U(f._id),re?z({key:"eventName",value:e.value,error:{}},f._id):R({key:"eventName",value:e.value},f._id),oe?(ie(!0),setTimeout((()=>{z({key:"frequency",value:{dataType:v.frequency,operator:p.atleast,value:1},error:{}},f._id),ie(!1)}),1)):R({key:"frequency",value:{dataType:v.frequency,operator:p.atleast,value:1}},f._id),ee?(de(!0),setTimeout((()=>{z({key:"date",value:{dataType:v.date,operator:s["last month"]},error:{}},f._id),de(!1)}),1)):R({key:"date",value:{dataType:v.date,operator:s["last month"]}},f._id))},error:null!==(x=null!==(P=null===(w=null===(O=null===(N=f.metas)||void 0===N?void 0:N[0])||void 0===O?void 0:O.error)||void 0===w?void 0:w.key)&&void 0!==P?P:null===(q=null==re?void 0:re.error)||void 0===q?void 0:q.key)&&void 0!==x?x:null===(C=null==re?void 0:re.error)||void 0===C?void 0:C.value})]})),(null==oe?void 0:oe.key)&&!le&&o(i,{disabled:"view"===_,extra:{},errors:{val:null===(B=null===(S=oe.error)||void 0===S?void 0:S.value)||void 0===B?void 0:B.value,operator:null===(V=null===(E=oe.error)||void 0===E?void 0:E.value)||void 0===V?void 0:V.operator},connectorVal:oe.value.value,connectorType:oe.value.dataType,defaultConnector:oe.value.operator,onOperatorChange:function(e){z({key:"frequency",value:{dataType:v.frequency,operator:e,value:1},error:{}},f._id)},onValueChange:function(e){var o;J&&z({key:"frequency",value:{dataType:v.frequency,operator:null===(o=null==oe?void 0:oe.value)||void 0===o?void 0:o.operator,value:e},error:{}},f._id)}}),(null==ee?void 0:ee.key)&&!ne&&o(i,{disabled:"view"===_,extra:{},errors:{val:null===(Q=null===(A=ee.error)||void 0===A?void 0:A.value)||void 0===Q?void 0:Q.value,operator:null===(M=null===(D=ee.error)||void 0===D?void 0:D.value)||void 0===M?void 0:M.operator},connectorVal:ee.value.value,connectorType:ee.value.dataType,defaultConnector:ee.value.operator,onOperatorChange:function(e){z({key:"date",value:{dataType:v.date,operator:e,value:void 0},error:{}},f._id)},onValueChange:function(e){var o;J&&z({key:"date",value:{dataType:v.date,operator:null===(o=null==ee?void 0:ee.value)||void 0===o?void 0:o.operator,value:e},error:{}},f._id)}})]}))}))};export{f as default};
|
package/dist/esm/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js
CHANGED
|
@@ -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{PropertyNodeHeadless as i}from"../../../components/QueryBuilderNode/Property/PropertyNode.js";import{useQueryBuilder as
|
|
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{PropertyNodeHeadless as i}from"../../../components/QueryBuilderNode/Property/PropertyNode.js";import{useQueryBuilder as s}from"../../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as d}from"../../../hooks/useQueryBuilderCache.js";import{BaseQueryBuilderNode as a}from"../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";const n=n=>{let{node:p,allowedNodes:l,apiHandler:u,mode:c,selectorKey:y}=n;var m;const{selectType:v,createProperty:f,updateProperty:j}=s(y),{cacheWrap:g}=d(),P=e=>g((()=>u({query:{propertyName:e}})),`USER_PROPERTIES-${e}`);return r(a,Object.assign({node:p,mode:c},{children:o("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12,alignItems:"flex-start"}},{children:[r(t,{disabled:"view"===c,selectedType:p.type,allowedList:l,onSelect:e=>v(e.value,p._id)}),r(i,{mode:c,property:null===(m=null==p?void 0:p.properties)||void 0===m?void 0:m[0],fetchPropertyData:()=>g((()=>u({})),"USER_PROPERTIES"),onPropertyNameSelect:function(r){var o,t;return e(this,void 0,void 0,(function*(){if((null===(o=p.properties)||void 0===o?void 0:o[0])?j(Object.assign(Object.assign({},null===(t=p.properties)||void 0===t?void 0:t[0]),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),p._id):f({name:r.id,dataType:r.type},p._id),r.needValuesRetrieval){const e=yield P(r.id);return null!=e?e:[]}return[]}))},onPropertyOperatorChange:function(e){j(Object.assign(Object.assign({},p.properties[0]),{operator:e,value:void 0,error:{}}),p._id)},onPropertyValueChange:function(e){j(Object.assign(Object.assign({},p.properties[0]),{value:e,error:{}}),p._id)}})]}))}))};export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import I from"@emotion/styled/base";import{jsx as g,jsxs as C}from"react/jsx-runtime";import{useState as A,useEffect as d}from"react";import"../../../../dropdown/DropdownPopover/index.js";import{Dropdown as l}from"../../../../dropdown/Dropdown.js";import"../../../../zeroState/ZeroState.js";import{BodySecondary as c}from"../../../../TypographyStyle.js";import"../../../../../constants/Theme.js";import"../../../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../../../checkBox/CheckBox.styled.js";import"../../../../list-item/ListItem.js";import"../../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js";import"../../../../button/Button.js";import"../../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as e}from"../../../../input/Input.js";import{InputStyleContext as o}from"../../../../input/context/InputStyleProvider.js";import"../../../../dropdown/MenuItem/MenuItem.js";import n from"../../InputLoader.js";const i=I("div","production"===process.env.NODE_ENV?{target:"eqv4pu00"}:{target:"eqv4pu00",label:"Container"})("production"===process.env.NODE_ENV?{name:"1d5jh9x",styles:"display:flex;flex-direction:row;gap:12px;align-items:center"}:{name:"1d5jh9x",styles:"display:flex;flex-direction:row;gap:12px;align-items:center",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkluVHdvTGFzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUTZCIiwiZmlsZSI6IkluVHdvTGFzdC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cyB9IGZyb20gXCJyZWFjdC9qc3gtcnVudGltZVwiO1xyXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IERyb3Bkb3duIH0gZnJvbSBcIi4uLy4uLy4uLy4uL2Ryb3Bkb3duXCI7XHJcbmltcG9ydCB7IElucHV0IH0gZnJvbSBcIi4uLy4uLy4uLy4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ICBzdGFydDogdGV4dCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LFxyXG4gICAgICAgICAgICAgICAgICAgIH0pIH0pLCBfanN4KERyb3Bkb3duLCB7IGRpc2FibGVkOiBkaXNhYmxlZCwgcGxhY2VIb2xkZXI6IFwiVGltZVwiLCB3aWR0aDogXCIxMDhweFwiLCBzaXplOiBcInNtYWxsXCIsIG9wdGlvbnM6IG9wdGlvbnMsIG9uU2VsZWN0OiAob3B0aW9uKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlID09PSBudWxsIHx8IG9uQ2hhbmdlID09PSB2b2lkIDAgPyB2b2lkIDAgOiBvbkNoYW5nZSh7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBvcHRpb24udmFsdWUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSB9KV0gfSkgfSkpKTtcclxufTtcclxuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9iYW4tdHMtY29tbWVudFxyXG4vLyBAdHMtaWdub3JlXHJcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSByZWFjdC9kaXNwbGF5LW5hbWVcclxuZXhwb3J0IGRlZmF1bHQgKHByb3BzKSA9PiBfanN4KEluVHdvTGFzdCwgT2JqZWN0LmFzc2lnbih7fSwgcHJvcHMpKTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SW5Ud29MYXN0LmpzLm1hcCJdfQ== */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}),t=[{label:"day(s)",value:"days"},{label:"minute(s)",value:"minutes"},{label:"hour(s)",value:"hours"}],b=I=>{let{val:b,onChange:s,errors:B,isLoading:m,disabled:u}=I;var p,a,y;const[X,Z]=A(t),r=null!==(p=null==b?void 0:b.type)&&void 0!==p?p:"days",H=null!==(a=null==b?void 0:b.start)&&void 0!==a?a:"1",G=null!==(y=null==b?void 0:b.offset)&&void 0!==y?y:"2";return d((()=>{var I;const g=null!==(I=null==b?void 0:b.type)&&void 0!==I?I:"days";Z((I=>I.map((I=>Object.assign(Object.assign({},I),{selected:g===I.value})))))}),[b]),d((()=>{var I,g,C;if(void 0===(null==b?void 0:b.start)){const A=null!==(I=null==b?void 0:b.type)&&void 0!==I?I:"days",d=null!==(g=null==b?void 0:b.start)&&void 0!==g?g:"1",l=null!==(C=null==b?void 0:b.offset)&&void 0!==C?C:"2";null==s||s({type:A,start:d,offset:l})}}),[]),m?g("div",Object.assign({style:{width:200}},{children:g(n,{containerStyle:{padding:"5px 8px"}})})):g(o.Provider,Object.assign({value:{InputWrapper:{width:104}}},{children:C(i,{children:[g(e,{type:"number",variant:"small",state:u?"disabled":"none",errorMessage:null==B?void 0:B.val,value:G.toString(),onChangeText:I=>null==s?void 0:s({type:r,start:H,offset:I})}),g("div",{children:g(c,{children:"to"})}),g(e,{type:"number",variant:"small",state:u?"disabled":"none",errorMessage:null==B?void 0:B.val,value:H.toString(),onChangeText:I=>null==s?void 0:s({type:r,start:I,offset:G})}),g(l,{disabled:u,placeHolder:"Time",width:"108px",size:"small",options:X,onSelect:I=>{null==s||s({type:I.value,start:H,offset:G})}})]})}))};var s=I=>g(b,Object.assign({},I));export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l}from"react/jsx-runtime";import{useState as e,useEffect as o}from"react";import a from"../../DropdownWrapper.js";const i=i=>{let{onChange:n,extra:r,val:t,isLoading:d,errors:s,disabled:u
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{useState as e,useEffect as o}from"react";import a from"../../DropdownWrapper.js";const i=i=>{let{onChange:n,extra:r,val:t,isLoading:d,errors:s,disabled:u}=i;var c;const[v,p]=e([]),m=t;return o((()=>{var l;const e=(null==r?void 0:r.options)&&Array.isArray(r.options)?r.options.filter((l=>!!Object.keys(l).length)).map((l=>({selected:!!(null==m?void 0:m.find((e=>e.id===l.id))),label:l.name,value:l.id}))):[],o=null!==(l=null==m?void 0:m.map((l=>l.id)))&&void 0!==l?l:[],a=[...e.filter((l=>!o.includes(l.value)))].concat((null!=m?m:[]).map((l=>({value:l.id,label:l.name}))));null==m||m.forEach((l=>{let{name:e,id:o}=l;const i=a.findIndex((l=>l.value===o&&l.label===e));-1!==i&&(a[i].selected=!0)})),p([...a])}),[r,m]),l("div",{children:l(a,{disabled:u,allowFreeForm:null===(c=null==r?void 0:r.freeForm)||void 0===c||c,isSearchable:!0,isLoading:d,error:null==s?void 0:s.val,isMultiSelect:!0,options:v,onSelect:function(l){if(Array.isArray(l)){const e=[];l.forEach((l=>{var o,a;l.options?null===(o=l.options)||void 0===o||o.forEach((l=>{e.push({name:l.label,id:l.value})})):e.push({name:null!==(a=l.label)&&void 0!==a?a:"",id:l.value})})),null==n||n(e)}}})})};var n=e=>l(i,Object.assign({},e));export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as t}from"react";import{
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as t}from"react";import{disableOperatorDropdown as r}from"../../constants/connectorPosition.js";import{ConnectorHelper as i}from"../../helpers/Connector.helper.js";import{QueryBuilderConnectorType as s}from"../../types/QueryBuilder.type.js";import l from"../DropdownWrapper.js";import m from"./Components/EmojiPicker.js";import p from"./Components/FreeText.js";import a from"./Components/FrequencyIntegerPositiveSingle.js";import{PostIgPicker as c,ReelIgPicker as u,StoryIgPicker as d}from"./Components/IgPicker.js";import g from"./Components/IntegerPositiveSingle.js";import f from"./Components/IntegerSingleValue.js";import C from"./Components/InTheLast.js";import j from"./Components/InTwoLast.js";import v from"./Components/MultiselectDropdownFreeText.js";import S from"./Components/NoInput.js";import I from"./Components/NumberTime.js";import T from"./Components/SingleDate.js";import y from"./Components/SingleselectDropdownFreeText.js";import P from"./Components/StringSingleValue.js";import w from"./Components/TwoDate.js";import h from"./Components/TwoNumberInputsSeperatedByAnd.js";import{Container as D}from"./Connector.styled.js";const x={FreeText:p,IntegerPositiveSingle:g,IntegerSingleValue:f,StringSingleValue:P,MultiselectDropdownFreeText:v,SingleselectDropdownFreeText:y,NoInput:S,SingleDate:T,TwoNumberInputsSeperatedByAnd:h,FrequencyIntegerPositiveSingle:a,TwoDate:w,NumberTime:I,PostIgPicker:c,ReelIgPicker:u,StoryIgPicker:d,EmojiPicker:m,InTheLast:C,InTwoLast:j},F=m=>{let{isLoading:p,noDefault:a,connectorType:c,defaultConnector:u,onOperatorChange:d,onValueChange:g,connectorVal:f,extra:C,errors:j,disabled:v}=m;var S,I,T;const[y,P]=n(null),[w,h]=n(!1);console.log({connectorType:c,defaultConnector:u});const F=i.getDropdownOptionFromDataType(c,u);function b(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];h(!0);const n=i.getConnectorComponent(c,e.value);void 0!==n?c===s.frequency&&"IntegerPositiveSingle"===n?P("FrequencyIntegerPositiveSingle"):P(n):P(null),o||d(e.value),setTimeout((()=>{h(!1)}),5)}return t((()=>{a||(u?b({value:u,label:u},!0):(null==F?void 0:F[0])&&b(F[0]))}),[u]),e(D,{children:[o("div",{children:!(null===(S=null==r?void 0:r[c])||void 0===S?void 0:S[u])&&o(l,{isSearchable:!0,disabled:v,width:"200px",isLoading:w,options:F,defaultOption:null===(I=F.filter((e=>e.selected)))||void 0===I?void 0:I[0],onSelect:b})}),null!==y&&!w&&(null===(T=x[y])||void 0===T?void 0:T.call(x,{disabled:v,val:f,onChange:g,extra:C,errors:j,isLoading:p}))]})};export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Dropdown as i}from"../../dropdown/Dropdown.js";import t from"./InputLoader.js";const
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Dropdown as i}from"../../dropdown/Dropdown.js";import t from"./InputLoader.js";const s=s=>{let{options:l,onSelect:o,defaultOption:a,isSearchable:r,isLoading:n,error:d,nativeID:c,dropdownLabel:p,isMultiSelect:u,allowFreeForm:m,width:b,disabled:g,selectedValues:h}=s;return n?e(t,{}):e("div",Object.assign({style:{maxWidth:200,width:200},id:c},{children:e(i,{height:(null==l?void 0:l.length)?void 0:208,disabled:g,allowFreeForm:null!=m&&m,isMultiSelect:u,width:b,size:"small",placeHolder:p,error:d,isSearchable:null!=r&&r,defaultOptions:a?Array.isArray(a)?a:[a]:void 0,options:h?l.map((e=>e.options?Object.assign(Object.assign({},e),{options:e.options.map((e=>Object.assign(Object.assign({},e),{selected:h.includes(e.value)})))}):Object.assign(Object.assign({},e),{selected:h.includes(e.value)}))):l,onSelect:o})}))};export{s as default};
|
package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DropdownOption } from "../../../../dropdown/type";
|
|
3
2
|
import { BaseQueryBuilderNode as BaseQueryBuilderNodeType, QueryBuilderProperty } from "../../../types/QueryBuilder.type";
|
|
4
3
|
import { QueryBuilderPropertyProps } from "../../../types/QueryBuilderPropertyProps";
|
|
5
4
|
type BaseQueryBuilderNodeProps = Omit<QueryBuilderPropertyProps, 'property'> & {
|
|
@@ -9,7 +8,6 @@ type BaseQueryBuilderNodeProps = Omit<QueryBuilderPropertyProps, 'property'> & {
|
|
|
9
8
|
addPropertyBtnText?: string;
|
|
10
9
|
node: BaseQueryBuilderNodeType;
|
|
11
10
|
children: React.ReactNode;
|
|
12
|
-
onPropertyValueSearch?: (searchKey: string, property: QueryBuilderProperty) => Promise<DropdownOption[]>;
|
|
13
11
|
};
|
|
14
12
|
/**
|
|
15
13
|
* @exported
|
|
@@ -17,7 +15,5 @@ type BaseQueryBuilderNodeProps = Omit<QueryBuilderPropertyProps, 'property'> & {
|
|
|
17
15
|
* @param param0
|
|
18
16
|
* @returns
|
|
19
17
|
*/
|
|
20
|
-
export declare const BaseQueryBuilderNode: React.FC<BaseQueryBuilderNodeProps
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
}>;
|
|
18
|
+
export declare const BaseQueryBuilderNode: React.FC<BaseQueryBuilderNodeProps>;
|
|
23
19
|
export {};
|
package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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:b
|
|
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:b}=t;var j,f,h,O,A,C,T;const[x,w]=n([]),[P,L]=n({}),[S,V]=n(!0),[D,z]=n("create"===b),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))),V(!1),z(!1)})):(V(!1),z(!1))}),[]),a((()=>{if("create"!==b&&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})))}),[null==g?void 0:g.dataType]),r(o,{children:[r(s,{children:[e(d,{isSearchable:!0,disabled:"view"===b,width:"200px",isLoading:S,dropdownLabel:null!=p?p:"Select property",options:N,onSelect:W,selectedValues:(null==g?void 0:g.name)?[g.name]:void 0,error:null===(j=null==g?void 0:g.error)||void 0===j?void 0:j.name}),(null==g?void 0:g.name)&&!(null===(f=i[g.dataType])||void 0===f?void 0:f[g.operator])&&e(l,{isLoading:D,disabled:"view"===b,extra:P,errors:{val:null===(h=g.error)||void 0===h?void 0:h.value,operator:null===(O=g.error)||void 0===O?void 0:O.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:D,disabled:"view"===b,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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[{label:"Commonly used",options:[{selected:!1,value:"today",label:"Today"},{selected:!1,value:"yesterday",label:"Yesterday"},{selected:!1,value:"last 7 days",label:"Last 7 days"},{selected:!1,value:"last 30 days",label:"Last 30 days"},{selected:!1,value:"this week",label:"This week"},{selected:!1,value:"last week",label:"Last week"},{selected:!1,value:"this month",label:"This month"},{selected:!0,value:"last month",label:"Last month"}]},{label:"Relative",options:[{selected:!1,value:"exactly",label:"Exactly"},{selected:!1,value:"not exactly",label:"Not exactly"},{selected:!1,value:"in the last",label:"In the last"},{selected:!1,value:"not in the last",label:"Not in the last"},{selected:!1,value:"in between last",label:"In between last"},{selected:!1,value:"not in between last",label:"Not in between last"}]},{label:"Absolute",options:[{selected:!1,value:"on",label:"On"},{selected:!1,value:"notOn",label:"Not On"},{selected:!1,value:"inBetween",label:"In Between"},{selected:!1,value:"notInBetween",label:"Not In Between"},{selected:!1,value:"before",label:"Before"},{selected:!1,value:"after",label:"After"}]}];export{e as DATE_OPERATORS_OPTIONS};
|
|
@@ -20,7 +20,8 @@ export declare enum CONNECTOR_VALUE_COMPONENT_TYPES {
|
|
|
20
20
|
ReelIgPicker = "ReelIgPicker",
|
|
21
21
|
StoryIgPicker = "StoryIgPicker",
|
|
22
22
|
EmojiPicker = "EmojiPicker",
|
|
23
|
-
InTheLast = "InTheLast"
|
|
23
|
+
InTheLast = "InTheLast",
|
|
24
|
+
InTwoLast = "InTwoLast"
|
|
24
25
|
}
|
|
25
26
|
export declare const INTEGER_OPERATORS_COMPONENT: {
|
|
26
27
|
is: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
@@ -59,18 +60,26 @@ export declare const REACTION_OPERATORS_COMPONENT: {
|
|
|
59
60
|
contains: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
60
61
|
};
|
|
61
62
|
export declare const DATE_OPERATORS_COMPONENT: {
|
|
63
|
+
today: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
64
|
+
yesterday: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
65
|
+
"last 30 days": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
66
|
+
"last 7 days": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
67
|
+
"this month": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
68
|
+
"this week": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
69
|
+
"last month": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
70
|
+
"last week": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
71
|
+
exactly: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
72
|
+
"not exactly": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
73
|
+
"in the last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
74
|
+
"not in the last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
75
|
+
"in between last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
76
|
+
"not in between last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
62
77
|
on: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
63
78
|
notOn: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
64
79
|
inBetween: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
65
80
|
notInBetween: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
66
81
|
before: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
67
82
|
after: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
68
|
-
today: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
69
|
-
yesterday: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
70
|
-
"last week": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
71
|
-
"last month": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
72
|
-
"last quarter": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
73
|
-
"in the last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
74
83
|
};
|
|
75
84
|
export declare const SPECIFIC_IG_POST_OPERATORS_COMPONENT: {
|
|
76
85
|
in: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{QueryBuilderConnectorType as e}from"../types/QueryBuilder.type.js";import{BOOLEAN_OPERATORS as t,STRING_OPERATORS as n,INTEGER_OPERATORS as i,FREQUENCY_OPERATORS as
|
|
1
|
+
import{QueryBuilderConnectorType as e}from"../types/QueryBuilder.type.js";import{BOOLEAN_OPERATORS as t,STRING_OPERATORS as n,INTEGER_OPERATORS as i,FREQUENCY_OPERATORS as o,DATE_OPERATORS as r,SPECIFIC_IG_OPERATORS as s,ANY_IG_OPERATORS as a,REACTION_OPERATORS as l,IG_STRING_OPERATORS as I,ANY_AD_OPERATORS as c,AD_STRING_OPERATORS as g,ICE_BREAKER_OPERATORS as u}from"../types/QueryBuilderOperator.type.js";const p={[e.boolean]:t,[e.string]:n,[e.integer]:i,[e.frequency]:o,[e.date]:r,[e.specificPost]:s,[e.specificReel]:s,[e.specificStory]:s,[e.anyIg]:a,[e.reaction]:l,[e.activityString]:I,[e.anyAd]:c,[e.specificAd]:g,[e.iceBreaker]:u};var T;!function(e){e.FreeText="FreeText",e.NoInput="NoInput",e.IntegerSingleValue="IntegerSingleValue",e.StringSingleValue="StringSingleValue",e.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",e.MultiselectDropdownFreeText="MultiselectDropdownFreeText",e.SingleselectDropdownFreeText="SingleselectDropdownFreeText",e.SingleDate="SingleDate",e.TwoDate="TwoDate",e.IntegerPositiveSingle="IntegerPositiveSingle",e.NumberTime="NumberTime",e.PostIgPicker="PostIgPicker",e.ReelIgPicker="ReelIgPicker",e.StoryIgPicker="StoryIgPicker",e.EmojiPicker="EmojiPicker",e.InTheLast="InTheLast",e.InTwoLast="InTwoLast"}(T||(T={}));const S={[i.is]:T.FreeText,[i.isNot]:T.FreeText,[i.exists]:T.NoInput,[i.doesntExist]:T.NoInput,[i.lessThan]:T.IntegerSingleValue,[i.lessThanOrEqualTo]:T.IntegerSingleValue,[i.greaterThan]:T.IntegerSingleValue,[i.greaterThanOrEqualTo]:T.IntegerSingleValue},d={[n.is]:T.MultiselectDropdownFreeText,[n.isNot]:T.MultiselectDropdownFreeText,[n.contains]:T.FreeText,[n.doesntContain]:T.FreeText,[n.startsWith]:T.FreeText,[n.endsWith]:T.FreeText,[n.exists]:T.NoInput,[n.doesntExist]:T.NoInput},x={[I.any]:T.NoInput,[I.is]:T.MultiselectDropdownFreeText,[I.contains]:T.FreeText,[I.startsWith]:T.FreeText,[I.endsWith]:T.FreeText},y={[g.is]:T.SingleselectDropdownFreeText},N={[u.is]:T.MultiselectDropdownFreeText},w={[l.contains]:T.EmojiPicker},P={[r.today]:T.NoInput,[r.yesterday]:T.NoInput,[r["last 30 days"]]:T.NoInput,[r["last 7 days"]]:T.NoInput,[r["this month"]]:T.NoInput,[r["this week"]]:T.NoInput,[r["last month"]]:T.NoInput,[r["last week"]]:T.NoInput,[r.exactly]:T.InTheLast,[r["not exactly"]]:T.InTheLast,[r["in the last"]]:T.InTheLast,[r["not in the last"]]:T.InTheLast,[r["in between last"]]:T.InTwoLast,[r["not in between last"]]:T.InTwoLast,[r.on]:T.SingleDate,[r.notOn]:T.SingleDate,[r.inBetween]:T.TwoDate,[r.notInBetween]:T.TwoDate,[r.before]:T.SingleDate,[r.after]:T.SingleDate},F={[s.in]:T.PostIgPicker},h={[s.in]:T.ReelIgPicker},D={[s.in]:T.StoryIgPicker},k={[a.in]:T.NoInput},f={[c.in]:T.NoInput},m={[t.isTrue]:T.NoInput,[t.isFalse]:T.NoInput,[t.exists]:T.NoInput,[t.doesntExist]:T.NoInput},L={[o.exactly]:T.IntegerPositiveSingle,[o.atleast]:T.IntegerPositiveSingle,[o.atMost]:T.IntegerPositiveSingle},b={[e.boolean]:m,[e.string]:d,[e.integer]:S,[e.frequency]:L,[e.date]:P,[e.specificPost]:F,[e.specificReel]:h,[e.specificStory]:D,[e.anyIg]:k,[e.reaction]:w,[e.activityString]:x,[e.anyAd]:f,[e.specificAd]:y,[e.iceBreaker]:N};export{y as AD_STRING_OPERATORS_COMPONENT,f as ANY_AD_OPERATORS_COMPONENT,k as ANY_IG_OPERATORS_COMPONENT,m as BOOLEAN_OPERATORS_COMPONENT,b as CONNECTOR_TYPE_TO_COMPONENT_MAP,p as CONNECTOR_TYPE_TO_OPERATORS,T as CONNECTOR_VALUE_COMPONENT_TYPES,P as DATE_OPERATORS_COMPONENT,L as FREQUENCY_OPERATORS_COMPONENT,N as ICE_BREAKER_OPERATORS_COMPONENT,x as IG_STRING_OPERATORS_COMPONENT,S as INTEGER_OPERATORS_COMPONENT,w as REACTION_OPERATORS_COMPONENT,F as SPECIFIC_IG_POST_OPERATORS_COMPONENT,h as SPECIFIC_IG_REEL_OPERATORS_COMPONENT,D as SPECIFIC_IG_STORY_OPERATORS_COMPONENT,d as STRING_OPERATORS_COMPONENT};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { DropdownOption } from "../../dropdown/type";
|
|
1
2
|
import { QueryBuilderConnectorType } from '../types/QueryBuilder.type';
|
|
2
3
|
import { CONNECTOR_OPERATORS } from '../types/QueryBuilderOperator.type';
|
|
3
4
|
export declare class ConnectorHelper {
|
|
4
5
|
static getConnectorType(datatype: QueryBuilderConnectorType): string[];
|
|
6
|
+
static getDropdownOptionFromDataType(datatype: QueryBuilderConnectorType, defaultConnector: CONNECTOR_OPERATORS | undefined): DropdownOption[];
|
|
5
7
|
static getConnectorComponent(dataType: QueryBuilderConnectorType, connectorType: CONNECTOR_OPERATORS): "FreeText" | "NoInput" | "IntegerSingleValue" | "StringSingleValue" | "TwoNumberInputsSeperatedByAnd" | "MultiselectDropdownFreeText" | "SingleselectDropdownFreeText" | "SingleDate" | "TwoDate" | "IntegerPositiveSingle" | "NumberTime" | null;
|
|
6
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONNECTOR_TYPE_TO_OPERATORS as
|
|
1
|
+
import{unCamelCaseWithFirstUppercase as t}from"../../../utils/unCamelCase.js";import{CONNECTOR_TYPE_TO_OPERATORS as e,CONNECTOR_TYPE_TO_COMPONENT_MAP as s}from"../constants/connector.js";import{DATE_OPERATORS_OPTIONS as o}from"../constants/DATE_OPERATORS_OPTIONS.js";import{QueryBuilderConnectorType as n}from"../types/QueryBuilder.type.js";class r{static getConnectorType(t){const s=e[t];return s?Object.keys(s):[]}static getDropdownOptionFromDataType(e,s){const r=this.getConnectorType(e);return e===n.date?o.map((t=>Object.assign(Object.assign({},t),{options:t.options.map((t=>Object.assign(Object.assign({},t),{selected:t.value===s})))}))):r.map((e=>({selected:e===s,value:e,label:t(e)})))}static getConnectorComponent(t,o){if(e[t]){return s[t][o]}return null}}export{r as ConnectorHelper};
|
|
@@ -19,7 +19,6 @@ export type ConnectorComponentProps = {
|
|
|
19
19
|
nativeID?: string;
|
|
20
20
|
isLoading?: boolean;
|
|
21
21
|
disabled?: boolean;
|
|
22
|
-
onSearch?: (searchKey: string) => Promise<DropdownOption[]>;
|
|
23
22
|
};
|
|
24
23
|
export type ConnectorProps = {
|
|
25
24
|
isLoading?: boolean;
|
|
@@ -39,9 +38,8 @@ export type ConnectorProps = {
|
|
|
39
38
|
};
|
|
40
39
|
testID?: string;
|
|
41
40
|
disabled?: boolean;
|
|
42
|
-
onSearch?: (searchKey: string) => Promise<DropdownOption[]>;
|
|
43
41
|
};
|
|
44
|
-
export type CONNECTOR_VALUE_TYPE = string[] | number | Date[] | Date | number[] | number | undefined | /** for multiselect */ QueryBuilderAPIData[] | IG_VALUE[];
|
|
42
|
+
export type CONNECTOR_VALUE_TYPE = object | string[] | number | Date[] | Date | number[] | number | undefined | /** for multiselect */ QueryBuilderAPIData[] | IG_VALUE[];
|
|
45
43
|
type IG_VALUE = {
|
|
46
44
|
imageUrl: string;
|
|
47
45
|
redirectionUrl: string;
|
|
@@ -48,18 +48,26 @@ export declare enum REACTION_OPERATORS {
|
|
|
48
48
|
contains = "contains"
|
|
49
49
|
}
|
|
50
50
|
export declare enum DATE_OPERATORS {
|
|
51
|
+
today = "today",
|
|
52
|
+
yesterday = "yesterday",
|
|
53
|
+
'last 7 days' = "last 7 days",
|
|
54
|
+
'last 30 days' = "last 30 days",
|
|
55
|
+
'this week' = "this week",
|
|
56
|
+
'last week' = "last week",
|
|
57
|
+
'this month' = "this month",
|
|
58
|
+
'last month' = "last month",
|
|
59
|
+
'exactly' = "exactly",
|
|
60
|
+
'not exactly' = "not exactly",
|
|
61
|
+
'in the last' = "in the last",
|
|
62
|
+
'not in the last' = "not in the last",
|
|
63
|
+
'in between last' = "in between last",
|
|
64
|
+
'not in between last' = "not in between last",
|
|
51
65
|
on = "on",
|
|
52
66
|
notOn = "notOn",
|
|
53
67
|
inBetween = "inBetween",
|
|
54
68
|
notInBetween = "notInBetween",
|
|
55
69
|
before = "before",
|
|
56
|
-
after = "after"
|
|
57
|
-
today = "today",
|
|
58
|
-
yesterday = "yesterday",
|
|
59
|
-
'last week' = "last week",
|
|
60
|
-
'last month' = "last month",
|
|
61
|
-
'last quarter' = "last quarter",
|
|
62
|
-
'in the last' = "in the last"
|
|
70
|
+
after = "after"
|
|
63
71
|
}
|
|
64
72
|
export declare enum BOOLEAN_OPERATORS {
|
|
65
73
|
isTrue = "isTrue",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,
|
|
1
|
+
var t,e,n,s,i,a,o,l,r,u,c,d,h;!function(t){t.is="is",t.isNot="isNot",t.exists="exists",t.doesntExist="doesntExist",t.lessThan="lessThan",t.lessThanOrEqualTo="lessThanOrEqualTo",t.greaterThan="greaterThan",t.greaterThanOrEqualTo="greaterThanOrEqualTo"}(t||(t={})),function(t){t.is="is",t.isNot="isNot",t.contains="contains",t.doesntContain="doesntContain",t.startsWith="startsWith",t.endsWith="endsWith",t.exists="exists",t.doesntExist="doesntExist"}(e||(e={})),function(t){t.any="any",t.is="is",t.contains="contains",t.startsWith="startsWith",t.endsWith="endsWith"}(n||(n={})),function(t){t.is="is"}(s||(s={})),function(t){t.in="in"}(i||(i={})),function(t){t.is="is"}(a||(a={})),function(t){t.in="in"}(o||(o={})),function(t){t.in="in"}(l||(l={})),function(t){t.contains="contains"}(r||(r={})),function(t){t.today="today",t.yesterday="yesterday",t["last 7 days"]="last 7 days",t["last 30 days"]="last 30 days",t["this week"]="this week",t["last week"]="last week",t["this month"]="this month",t["last month"]="last month",t.exactly="exactly",t["not exactly"]="not exactly",t["in the last"]="in the last",t["not in the last"]="not in the last",t["in between last"]="in between last",t["not in between last"]="not in between last",t.on="on",t.notOn="notOn",t.inBetween="inBetween",t.notInBetween="notInBetween",t.before="before",t.after="after"}(u||(u={})),function(t){t.isTrue="isTrue",t.isFalse="isFalse",t.exists="exists",t.doesntExist="doesntExist"}(c||(c={})),function(t){t.exactly="exactly",t.atleast="atleast",t.atMost="atMost"}(d||(d={})),function(t){t.FreeText="FreeText",t.NoInput="NoInput",t.IntegerSingleValue="IntegerSingleValue",t.StringSingleValue="StringSingleValue",t.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",t.MultiselectDropdownFreeText="MultiselectDropdownFreeText",t.SingleselectDropdownFreeText="SingleselectDropdownFreeText",t.SingleDate="SingleDate",t.TwoDate="TwoDate",t.IntegerPositiveSingle="IntegerPositiveSingle",t.NumberTime="NumberTime"}(h||(h={}));export{s as AD_STRING_OPERATORS,l as ANY_AD_OPERATORS,o as ANY_IG_OPERATORS,c as BOOLEAN_OPERATORS,u as DATE_OPERATORS,h as EVENT_VALUES,d as FREQUENCY_OPERATORS,a as ICE_BREAKER_OPERATORS,n as IG_STRING_OPERATORS,t as INTEGER_OPERATORS,r as REACTION_OPERATORS,i as SPECIFIC_IG_OPERATORS,e as STRING_OPERATORS};
|
|
@@ -16,5 +16,4 @@ export type QueryBuilderPropertyProps = {
|
|
|
16
16
|
}>;
|
|
17
17
|
onPropertyOperatorChange?: (option: CONNECTOR_OPERATORS, property: QueryBuilderProperty) => void;
|
|
18
18
|
onPropertyValueChange?: (value: CONNECTOR_VALUE_TYPE | /** for multiselect */ QueryBuilderAPIData[], property: QueryBuilderProperty) => void;
|
|
19
|
-
onPropertyValueSearch(searchKey: string, property: QueryBuilderProperty): Promise<DropdownOption[]>;
|
|
20
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@emotion/styled/base";import{jsx as o,Fragment as e,jsxs as g}from"react/jsx-runtime";import I from"../../../../utils/StringUtils.js";import{COLORS as i}from"../../../../constants/Theme.js";import{useState as C,useEffect as r}from"react";import"../../../checkBox/CheckBox.styled.js";import{TitleMedium as c}from"../../../TypographyStyle.js";import"../../../list-item/ListItem.js";import"../../../pagination/Pagination.js";import"../../../radioButton/RadioButton.styled.js";import"react-toastify";import"../../../toaster/Toaster.styled.js";import"@tippyjs/react";import"../../../tooltips/TooltipInternal.js";import"../../../spinner/Spinner.js";import"../../../stepper/Stepper.styled.js";import"../../../tag/Tag.js";import"../../../icon-button/IconButton.js";import"../../../template-preview/TemplatePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../template-preview/models/TemplateMeta.js";import"../../../modals/styledModal.js";import"../../../template-preview/models/Channels.js";import"../../../template-context-mapper/context/templateModalContext.js";import"../../../template-context-mapper/modalElements/Footer.js";import"../../../template-context-mapper/modalElements/Body.js";import"../../../template-context-mapper/modalElements/Header.js";import"../../../zeroState/ZeroState.js";import"../../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js";import"../../../button/Button.js";import"../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../../../input/Input.js";import"react-bootstrap";import"../../../floating-action-button/FloatingActionButton.styles.js";import"../../../image-compress/ImageCompress.js";import"../../../progress-bar/ProgressBarComponent.js";import"../../../QueryBuilder/QueryBuilder.js";import"../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";import"../../../QueryBuilder/constants/connectorPosition.js";import"../../../QueryBuilder/constants/connector.js";import"../../../QueryBuilder/types/QueryBuilder.type.js";import"../../../dropdown/Dropdown.js";import"../../../QueryBuilder/components/InputLoader.js";import"../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js";import"react-chips";import"../../../input/ChipInput.styled.js";import"../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js";import"../../../QueryBuilder/components/Connectors/Components/IgPicker.js";import"../../../QueryBuilder/components/Connectors/Components/InTheLast.js";import"react-calendar";import"../../../../utils/DateUtils.js";import"../../../datePicker/DatePickerWrapper.styled.js";import"../../../QueryBuilder/components/Connectors/Connector.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js";import"../../../QueryBuilder/redux/queryBuilder.reducer.js";import"../../../QueryBuilder/redux/queryBuilderCache.reducer.js";import"../../../QueryBuilder/types/QueryBuilderOperator.type.js";import"../../../dropdown/DropdownPopover/index.js";import"../../../dropdown/MenuItem/MenuItem.js";import"../../../shimmer/ShimmerComponent/ShimmerStyled.js";import"../../../analytics-card/AnalyticsCard.styled.js";import"../../CommonStyles.js";import"../../../datePicker/DatePicker.styled.js";import"../../AnalyticsMetric.js";import"../LineChart/LineChart.js";import"../linearChipGroupedChart/LinearChipGroupedChart.styled.js";import{PieChart as s}from"./PieChart.js";import"../HorizontalBarGraph/HorizontalGraph.js";import"../StackedBarChart/StackedBarChart.js";import"../VerticalBarGraph/VerticalGraph.js";import"../heatmap/HeatMap.js";import"../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";import"../../../avatar/Avatar.js";import"../../../alerts/Alert.styled.js";import"../../../alerts/AlertHelper.js";import"../../../thumbnail/Thumbnail.js";import"../../../curtain/Curtain.styled.js";import"../../../curtain/CurtainHelper.js";import"../../../switch/Switch.js";import"../../../plans/SubscriptionPlanStyled.js";import"../../../plans/SubscriptionPlanSelector.js";import"../../../tabs/Tabs.js";import"../../../TablePagination/TablePagination.styled.js";import"../../../TablePagination/TablePaginationCard.js";import"../../../states/StateComponent.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditor.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js";import"../../../card-selection-modal/CardSelectionModal.styled.js";import"react-image-crop";import"../../../buttonGroup/ButtonGroupStyle.js";import"../../../accordion/Accordion.style.js";import"../../../accordion/AccordionArrow.js";import"../../../file-uploader/FileUploaderStyle.js";import"../../../colourInput/ColourInput.styled.js";import"../../../bik-layout/CommonStyles.js";import"../../../bik-layout/SidebarStyles.js";import"date-fns";import"react-popper";import"../../../dropdown/Common.styled.js";import"../../../custom-date-time/CustomDateTime.styled.js";import"../../../../node_modules/lodash.debounce/index.js";import"../../../product-picker/ProductPicker.styled.js";import"../../../discount-modal/type.js";import"../../../discount-modal/DiscountModal.styled.js";import"../../../discount-modal/DynamicCoupon/DynamicCoupon.js";import"../../../discount-modal/CouponExpiration/CouponExpiration.js";import"../../../country-code-picker/CountryCodePicker.styled.js";import"../../../product-picker-v2/emptyState.js";import"../../../product-picker-v2/style.js";import"lodash";import"../../../carousel/carousel.js";import"../../../carousel-secondary/CarouselSecondary.style.js";import"../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js";import"../../../radioList/RadioList.styled.js";import"../../../checkList/CheckList.styled.js";import"../../../postPicker/postPicker.js";import"../../../dropdown-button/DropdownButton.style.js";import{Chart as p,ArcElement as A,Legend as l}from"chart.js";import{Doughnut as d}from"react-chartjs-2";p.register(A,l);const a={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:t=>{if(!t.label)return" 0%";const o=t.dataset.data.reduce(((t,o)=>t+o),0),e=parseFloat((t.raw/o*100).toFixed(1));return` ${t.label}: ${e}%`}}}}},n=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],m=t("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(t=>i.surface.standard),";border:1px solid ",(t=>i.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRp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XMsIHNpemUsIH0pID0+IHtcclxuICAgIGNvbnN0IFtzbGljZXNXaXRoQ29sb3IsIHNldFNsaWNlc1dpdGhDb2xvcl0gPSB1c2VTdGF0ZShbXSk7XHJcbiAgICBjb25zdCBbZGF0YSwgc2V0RGF0YV0gPSB1c2VTdGF0ZSgpO1xyXG4gICAgdXNlRWZmZWN0KCgpID0+IHtcclxuICAgICAgICBjb25zdCB0b3RhbFN1bSA9IHNsaWNlcy5yZWR1Y2UoKHN1bSwgc2xpY2UpID0+IHN1bSArIHNsaWNlLmNvdW50LCAwKTtcclxuICAgICAgICBsZXQgdXBkYXRlZFNsaWNlc1dpdGhDb2xvciA9IFtdO1xyXG4gICAgICAgIHVwZGF0ZWRTbGljZXNXaXRoQ29sb3IgPSBPYmplY3Qua2V5cyhzbGljZXMpLm1hcCgoa2V5LCBpbmRleCkgPT4gKE9iamVjdC5hc3NpZ24oeyBjb2xvcjogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF0gfSwgc2xpY2VzW2tleV0pKSk7XHJcbiAgICAgICAgc2V0U2xpY2VzV2l0aENvbG9yKFsuLi51cGRhdGVkU2xpY2VzV2l0aENvbG9yXSk7XHJcbiAgICAgICAgaWYgKHRvdGFsU3VtID09PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3NsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW3RpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDE2LFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAncm93JyB9LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnIH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IGRhdGE6IGRhdGEsIG9wdGlvbnM6IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucyksIHsgbWFpbnRhaW5Bc3BlY3RSYXRpbzogc2l6ZSA/IGZhbHNlIDogdHJ1ZSB9KSB9KSB9KSkgfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */")),b=t=>o(m,Object.assign({style:{padding:24}},{children:t.children})),u=t=>{let{title:i,slices:p,size:A}=t;const[l,m]=C([]),[b,u]=C();return r((()=>{const t=p.reduce(((t,o)=>t+o.count),0);let o=[];if(o=Object.keys(p).map(((t,o)=>Object.assign({color:n[o%n.length]},p[t]))),m([...o]),0===t){u({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const t={labels:p.map((t=>I.capitalize(t.name))),datasets:[{data:p.map((t=>t.count)),backgroundColor:p.map(((t,o)=>{var e;return null!==(e=t.color)&&void 0!==e?e:n[o%n.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};u(t)}}),[p]),b?g(e,{children:[i&&o(c,Object.assign({style:{marginBottom:16}},{children:i})),g("div",Object.assign({className:"row"},{children:[o("div",Object.assign({className:"col-6"},{children:o("div",Object.assign({style:{width:A,height:A}},{children:o(d,{data:b,options:Object.assign(Object.assign({},a),{maintainAspectRatio:!A})})}))})),o("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:o(s,{slices:l})}))]}))]}):o(e,{})};export{b as Card,u as PieChartAnalytics};
|
|
1
|
+
import t from"@emotion/styled/base";import{jsx as o,Fragment as e,jsxs as g}from"react/jsx-runtime";import I from"../../../../utils/StringUtils.js";import{COLORS as i}from"../../../../constants/Theme.js";import{useState as r,useEffect as C}from"react";import"../../../checkBox/CheckBox.styled.js";import{TitleMedium as s}from"../../../TypographyStyle.js";import"../../../list-item/ListItem.js";import"../../../pagination/Pagination.js";import"../../../radioButton/RadioButton.styled.js";import"react-toastify";import"../../../toaster/Toaster.styled.js";import"@tippyjs/react";import"../../../tooltips/TooltipInternal.js";import"../../../spinner/Spinner.js";import"../../../stepper/Stepper.styled.js";import"../../../tag/Tag.js";import"../../../icon-button/IconButton.js";import"../../../template-preview/TemplatePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../template-preview/models/TemplateMeta.js";import"../../../modals/styledModal.js";import"../../../template-preview/models/Channels.js";import"../../../template-context-mapper/context/templateModalContext.js";import"../../../template-context-mapper/modalElements/Footer.js";import"../../../template-context-mapper/modalElements/Body.js";import"../../../template-context-mapper/modalElements/Header.js";import"../../../zeroState/ZeroState.js";import"../../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js";import"../../../button/Button.js";import"../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../../../input/Input.js";import"react-bootstrap";import"../../../floating-action-button/FloatingActionButton.styles.js";import"../../../image-compress/ImageCompress.js";import"../../../progress-bar/ProgressBarComponent.js";import"../../../QueryBuilder/QueryBuilder.js";import"../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";import"../../../QueryBuilder/constants/connectorPosition.js";import"../../../QueryBuilder/constants/connector.js";import"../../../QueryBuilder/types/QueryBuilder.type.js";import"../../../dropdown/Dropdown.js";import"../../../QueryBuilder/components/InputLoader.js";import"../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js";import"react-chips";import"../../../input/ChipInput.styled.js";import"../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js";import"../../../QueryBuilder/components/Connectors/Components/IgPicker.js";import"../../../QueryBuilder/components/Connectors/Components/InTheLast.js";import"../../../QueryBuilder/components/Connectors/Components/InTwoLast.js";import"react-calendar";import"../../../../utils/DateUtils.js";import"../../../datePicker/DatePickerWrapper.styled.js";import"../../../QueryBuilder/components/Connectors/Connector.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js";import"../../../QueryBuilder/redux/queryBuilder.reducer.js";import"../../../QueryBuilder/redux/queryBuilderCache.reducer.js";import"../../../QueryBuilder/types/QueryBuilderOperator.type.js";import"../../../dropdown/DropdownPopover/index.js";import"../../../dropdown/MenuItem/MenuItem.js";import"../../../shimmer/ShimmerComponent/ShimmerStyled.js";import"../../../analytics-card/AnalyticsCard.styled.js";import"../../CommonStyles.js";import"../../../datePicker/DatePicker.styled.js";import"../../AnalyticsMetric.js";import"../LineChart/LineChart.js";import"../linearChipGroupedChart/LinearChipGroupedChart.styled.js";import{PieChart as c}from"./PieChart.js";import"../HorizontalBarGraph/HorizontalGraph.js";import"../StackedBarChart/StackedBarChart.js";import"../VerticalBarGraph/VerticalGraph.js";import"../heatmap/HeatMap.js";import"../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";import"../../../avatar/Avatar.js";import"../../../alerts/Alert.styled.js";import"../../../alerts/AlertHelper.js";import"../../../thumbnail/Thumbnail.js";import"../../../curtain/Curtain.styled.js";import"../../../curtain/CurtainHelper.js";import"../../../switch/Switch.js";import"../../../plans/SubscriptionPlanStyled.js";import"../../../plans/SubscriptionPlanSelector.js";import"../../../tabs/Tabs.js";import"../../../TablePagination/TablePagination.styled.js";import"../../../TablePagination/TablePaginationCard.js";import"../../../states/StateComponent.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditor.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js";import"../../../card-selection-modal/CardSelectionModal.styled.js";import"react-image-crop";import"../../../buttonGroup/ButtonGroupStyle.js";import"../../../accordion/Accordion.style.js";import"../../../accordion/AccordionArrow.js";import"../../../file-uploader/FileUploaderStyle.js";import"../../../colourInput/ColourInput.styled.js";import"../../../bik-layout/CommonStyles.js";import"../../../bik-layout/SidebarStyles.js";import"date-fns";import"react-popper";import"../../../dropdown/Common.styled.js";import"../../../custom-date-time/CustomDateTime.styled.js";import"../../../../node_modules/lodash.debounce/index.js";import"../../../product-picker/ProductPicker.styled.js";import"../../../discount-modal/type.js";import"../../../discount-modal/DiscountModal.styled.js";import"../../../discount-modal/DynamicCoupon/DynamicCoupon.js";import"../../../discount-modal/CouponExpiration/CouponExpiration.js";import"../../../country-code-picker/CountryCodePicker.styled.js";import"../../../product-picker-v2/emptyState.js";import"../../../product-picker-v2/style.js";import"lodash";import"../../../carousel/carousel.js";import"../../../carousel-secondary/CarouselSecondary.style.js";import"../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js";import"../../../radioList/RadioList.styled.js";import"../../../checkList/CheckList.styled.js";import"../../../postPicker/postPicker.js";import"../../../dropdown-button/DropdownButton.style.js";import{Chart as p,ArcElement as A,Legend as l}from"chart.js";import{Doughnut as d}from"react-chartjs-2";p.register(A,l);const a={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:t=>{if(!t.label)return" 0%";const o=t.dataset.data.reduce(((t,o)=>t+o),0),e=parseFloat((t.raw/o*100).toFixed(1));return` ${t.label}: ${e}%`}}}}},n=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],m=t("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(t=>i.surface.standard),";border:1px solid ",(t=>i.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=ut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aXA6IHtcclxuICAgICAgICAgICAgZW5hYmxlZDogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHsocHJvcHMpID0+IENPTE9SUy5zdHJva2UucHJpbWFyeX07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0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3NsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW3RpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDE2LFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAncm93JyB9LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnIH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IGRhdGE6IGRhdGEsIG9wdGlvbnM6IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucyksIHsgbWFpbnRhaW5Bc3BlY3RSYXRpbzogc2l6ZSA/IGZhbHNlIDogdHJ1ZSB9KSB9KSB9KSkgfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */")),b=t=>o(m,Object.assign({style:{padding:24}},{children:t.children})),u=t=>{let{title:i,slices:p,size:A}=t;const[l,m]=r([]),[b,u]=r();return C((()=>{const t=p.reduce(((t,o)=>t+o.count),0);let o=[];if(o=Object.keys(p).map(((t,o)=>Object.assign({color:n[o%n.length]},p[t]))),m([...o]),0===t){u({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const t={labels:p.map((t=>I.capitalize(t.name))),datasets:[{data:p.map((t=>t.count)),backgroundColor:p.map(((t,o)=>{var e;return null!==(e=t.color)&&void 0!==e?e:n[o%n.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};u(t)}}),[p]),b?g(e,{children:[i&&o(s,Object.assign({style:{marginBottom:16}},{children:i})),g("div",Object.assign({className:"row"},{children:[o("div",Object.assign({className:"col-6"},{children:o("div",Object.assign({style:{width:A,height:A}},{children:o(d,{data:b,options:Object.assign(Object.assign({},a),{maintainAspectRatio:!A})})}))})),o("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:o(c,{slices:l})}))]}))]}):o(e,{})};export{b as Card,u as PieChartAnalytics};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as l,useRef as s}from"react";import{ZeroState as i}from"../../../zeroState/ZeroState.js";import{useOutside as n}from"../../../../hooks/useOutside.js";import{iterateOnOptions as r}from"../utils/iterationOnOptions.js";import{Description as c}from"./description/Description.js";import{FreeFormMenu as a}from"./menu/FreeFormMenu.js";import{MenuList as u}from"./menu/MenuList.js";import{SelectAllMenu as d}from"./menu/SelectAllMenu.js";import p from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as f,MenuListContainer as m}from"./OpennedDropdown.styled.js";import{SearchBox as h}from"./searchbox/SearchBox.js";import{SearchZeroState as b}from"./searchbox/SearchZeroState.js";const g=304,j=290,v=v=>{let{options:S,isSearchable:w,isMultiSelect:y,width:O,allowFreeForm:x,height:C,onClose:L,onSelect:F}=v;const[M,D]=o(null!=S?S:[]);l((()=>{if(S){const e=[...S];D(y?[...e.sort((e=>e.selected?-1:1))]:[...e])}}),[S]);const[k,A]=o(null!=O?O:j),[B,H]=o(""),[Z,q]=o(null),z=s(null);n(z,(()=>{q(null),null==L||L()}));const E=null!=C?C:g,I="number"==typeof E?w&&y?E-96:w&&!y||!w&&y?E-48:E:E;function K(e){if(y){const t=r(M,{selected:e.selected},(t=>t.value===e.value));D([...t])}else null==F||F(e)}l((()=>{const e=null!=O?O:j;if(null===Z)A(e);else if("number"==typeof e)A(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));A(t)}}),[Z]);const N=[],P=M.map((e=>{var t,o;if(B){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(B.toLowerCase()))&&(N.push(!B||e.label===B),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(B.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(B.toLowerCase()))?(N.push(!B||e.label===B),e):null}return e})).filter((e=>null!==e)),T=!!w&&B&&0===P.length;return e(f,Object.assign({ref:z,style:{width:k}},{children:[e("div",Object.assign({style:{width:Z?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!w&&t(h,{onSearch:function(e){H(e)}}),P.length||B?e(m,Object.assign({minHeight:E,maxHeight:I},{children:[!!y&&!T&&t(d,{options:M,onSelect:function(e){if("selectAll"===e){const e=r(M,{selected:!0},(e=>{var t;return B?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(B.toLowerCase()))&&!e.disabled:!e.disabled}));D([...e])}else if("notSelected"===e){const e=r(M,{selected:!1},(e=>!e.disabled));D([...e])}}}),!x&&T&&t(b,{searchedString:B}),x&&(T||!!N.length&&N.every((e=>!1===e)))&&t(a,{isMultiSelect:y,onSelect:function(e){if(!y)return void K({label:B,value:B,isFreeForm:!0,selected:!0});const t=M.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===B&&t.value===B?e:t.selected})));e&&(t.some((e=>e.label===B&&e.value===B))||t.unshift({label:B,value:B,isFreeForm:!0,selected:!0})),D([...t])},searchedString:B}),t(u,{onSelect:K,showDescription:function(e,t){q(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:P})]})):t("div",Object.assign({style:{height:E,display:"flex"}},{children:t(i,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})),!!y&&!(!P.length&&!B)&&t(p,{onClear:function(){const e=r(M,{selected:!1});D([...e])},onApply:function(){const e=[];M.forEach((t=>{if(t.options){const o=t.options.filter((e=>!0===e.selected));e.push(Object.assign(Object.assign({},t),{options:[...o]}))}else t.selected&&e.push(Object.assign({},t))})),null==F||F([...e])},list:M})]})),!!Z&&t(c,{title:Z.title,description:Z.description})]}))};export{v as OpenedDropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,Fragment as o}from"react/jsx-runtime";import{useState as t}from"react";import{Input as e}from"../../../../input/Input.js";import{InputStyleContext as n}from"../../../../input/context/InputStyleProvider.js";import{COLORS as i}from"../../../../../constants/Theme.js";import s from"../../../../../assets/icons/cross.svg.js";import c from"../../../../../assets/icons/search.svg.js";const p=p=>{let{onSearch:m}=p;const[a,h]=t(""),[d,l]=t(!1);return r(n.Provider,Object.assign({value:{InputWrapper:{borderRadius:0,border:0,borderBottom:"1px solid "+i.stroke.primary,padding:"14px 16px"},IconHolder:{marginLeft:0},input:{marginLeft:4,minHeight:"100%"}}},{children:r(e,{placeholder:"Search",leftIcon:{icon:()=>r(c,{width:24,height:24,color:i.content.placeholder})},rightIcon:{icon:()=>a?r(s,{onClick:()=>{l(!0),m(""),h("")},width:24,height:24,color:i.content.placeholder}):r(o,{})},reset:d,onChangeText:r=>{l(!1),h(r),m(r)}})}))};export{p as SearchBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function s(s,n,t){return s.map((s=>{if(s.options){const i=s.options.map((s=>!t||t(s)?Object.assign(Object.assign({},s),n):Object.assign({},s)));return Object.assign(Object.assign({},s),{options:[...i]})}return!t||t(s)?Object.assign(Object.assign({},s),n):Object.assign({},s)}))}
|
|
1
|
+
function s(s,n,t){return s.map((s=>{if(s.options){const i=s.options.map((s=>!t||t(s)?Object.assign(Object.assign({},s),n):Object.assign({},s)));return Object.assign(Object.assign({},s),{options:[...i]})}return!t||t(s)?Object.assign(Object.assign({},s),n):Object.assign({},s)}))}export{s as iterateOnOptions};
|
|
@@ -13,7 +13,6 @@ export interface OpenDropdownProps {
|
|
|
13
13
|
onSelect?: (option: DropdownOption | DropdownOption[]) => void;
|
|
14
14
|
placement?: Placement;
|
|
15
15
|
strategy?: PositioningStrategy;
|
|
16
|
-
onSearch?: (key: string) => Promise<DropdownOption[]>;
|
|
17
16
|
}
|
|
18
17
|
export type GroupedOption = {
|
|
19
18
|
label?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useContext as r,useRef as l,useEffect as o}from"react";import{Button as a}from"../button/Button.js";import{isFunction as s,validateInput as c}from"./Input-helper.js";import{BodySecondary as u}from"../TypographyStyle.js";import d from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as v}from"./context/InputStyleProvider.js";import{RootContainer as h,InputFooter as p,InputWrapper as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useContext as r,useRef as l,useEffect as o}from"react";import{Button as a}from"../button/Button.js";import{isFunction as s,validateInput as c}from"./Input-helper.js";import{BodySecondary as u}from"../TypographyStyle.js";import d from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as v}from"./context/InputStyleProvider.js";import{RootContainer as h,InputFooter as p,InputWrapper as m,IconHolder as g,PrefixHolder as f,InputContainer as x,InputContainerSmall as b,SuffixHolder as y,InputHeader as j,MaxCharStyle as I}from"./Input.styled.js";const C=C=>{var w,O,T,k,A;const{placeholder:L,leftIcon:z,rightIcon:B,labelText:M,maxCharLimit:S,isRequired:D,hintText:E,type:F,state:R,validate:H,variant:K,button:q,suffixText:N,prefixText:P,onChangeText:V,value:W,noErrorHint:G,reset:J,rangeValidation:Q}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},C),U=null==z?void 0:z.icon,X=null==B?void 0:B.icon,[Y,Z]=i(!1),[$,_]=i(!1),[ee,te]=i(),ne="small"===K?"18px":"22px",ie=r(v),[re,le]=i(),oe=l();o((()=>{le(W)}),[W]),o((()=>{var e;oe.current&&(null===(e=C.onReferenceInit)||void 0===e||e.call(C,oe.current))}),[oe]),o((()=>{J&&le("")}),[J]),o((()=>{var e;_(!!C.isActive),C.isActive&&(null===(e=oe.current)||void 0===e||e.focus())}),[C.isActive]),o((()=>{te(C.errorMessage)}),[C.errorMessage]),o((()=>{var e;Z(!1),("invalid"===C.state||ee)&&Z(!0),"active"===C.state&&(null===(e=oe.current)||void 0===e||e.focus())}),[C.state,ee]),o((()=>{Z(!!ee)}),[ee]);const ae=function(e){if(s(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];e(...n)}},se=e=>{const t=S||("zip"===F?6:60);V(W||"",e),![8].includes(e.which)&&t>0&&e.target.value.length===t&&e.preventDefault()},ce=e=>{const t=e.target.value;V(t,e),le(t);const n=H||c;if(!n||!s(n))return;const[i,r]=n(t,F,Q);Z(!i),te(C.errorMessage?C.errorMessage:r)},ue=()=>{var i;return e(n,{children:["multiline"!==F&&t("input",{id:C.id,style:null!==(i=null==ie?void 0:ie.input)&&void 0!==i?i:{},ref:oe,type:["phonenumber","zip","number"].includes(F)?"number":F,value:re,onFocus:()=>(_(!0),void ae(C.onFocus)),onBlur:e=>(e=>{var t;_(!1),ae(null===(t=C.onBlur)||void 0===t?void 0:t.call(C,e))})(e),placeholder:L||"Enter here",onChange:ce,onKeyDown:e=>se(e)}),"multiline"===F&&t("textarea",{value:re,ref:oe,onFocus:()=>_(!0),onBlur:()=>_(!1),placeholder:L||"Enter here",onChange:ce,onKeyDown:e=>se(e),maxLength:S>0?S:void 0})]})};return e(h,Object.assign({width:C.width,height:C.height,state:R,type:F,style:null!==(w=null==ie?void 0:ie.RootContainer)&&void 0!==w?w:{}},{children:[!G&&(!!E||!!ee)&&e(p,Object.assign({invalid:!!ee},{children:[!!ee&&t(d,{width:16,height:16}),ee||E]})),e(m,Object.assign({variant:K,state:R,width:C.width,isActive:"active"===R||$,isInvalid:Y,style:null!==(O=null==ie?void 0:ie.InputWrapper)&&void 0!==O?O:{}},{children:[!!U&&t(g,Object.assign({variant:K,iconSize:ne,onClick:()=>ae(null==z?void 0:z.callback),isLeft:!0,style:null!==(T=null==ie?void 0:ie.IconHolder)&&void 0!==T?T:{}},{children:t(U,{})})),!!P&&t(f,Object.assign({variant:K},{children:P})),"default"===K&&t(x,{children:ue()}),"small"===K&&t(b,{children:ue()}),!!X&&t(g,Object.assign({variant:K,iconSize:ne,onClick:()=>ae(null==B?void 0:B.callback),isLeft:!1},{children:t(X,{})})),!!N&&t(y,Object.assign({variant:K},{children:N})),q&&q.text&&t(a,{buttonText:q.text,onClick:()=>ae(null==q?void 0:q.onClick)})]})),(!!M||!!S)&&e(j,Object.assign({invalid:Y},{children:[e(u,{children:[M,D?t("span",{children:"*"}):""]}),S>0&&e(I,{children:[null!==(A=null===(k=C.value)||void 0===k?void 0:k.length)&&void 0!==A?A:0,"/",S]})]}))]}))};C.displayName="Input";export{C as Input};
|
package/package.json
CHANGED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { SelectAllCheckboxState } from '../OpenedDropdown/components/menu/SelectAllMenu';
|
|
3
|
-
import { DropdownOption, SingleOption } from '../type';
|
|
4
|
-
export declare const useDropdown: (options: DropdownOption[], onSelect: ((option: DropdownOption | DropdownOption[]) => void) | undefined, isMultiSelect?: boolean, onSearch?: ((searchKey: string) => Promise<DropdownOption[]>) | undefined) => {
|
|
5
|
-
dropdownOptions: DropdownOption[];
|
|
6
|
-
search: (searchKey: string) => void;
|
|
7
|
-
searchedString: string;
|
|
8
|
-
searchedOptions: DropdownOption[];
|
|
9
|
-
onApplyHandler: (optionSelect: SingleOption, returnOnly?: boolean) => ({
|
|
10
|
-
label: string;
|
|
11
|
-
value: string;
|
|
12
|
-
description?: string | null | undefined;
|
|
13
|
-
selected?: boolean | undefined;
|
|
14
|
-
disabled?: boolean | undefined;
|
|
15
|
-
isFreeForm?: boolean | undefined;
|
|
16
|
-
subText?: string | undefined;
|
|
17
|
-
trailingIcon?: JSX.Element | undefined;
|
|
18
|
-
leadingIcon?: JSX.Element | undefined;
|
|
19
|
-
customComponent?: JSX.Element | undefined;
|
|
20
|
-
searchKey?: string | undefined;
|
|
21
|
-
} | {
|
|
22
|
-
label?: string | undefined;
|
|
23
|
-
value?: string | undefined;
|
|
24
|
-
description?: string | null | undefined;
|
|
25
|
-
selected?: boolean | undefined;
|
|
26
|
-
disabled?: boolean | undefined;
|
|
27
|
-
isFreeForm?: boolean | undefined;
|
|
28
|
-
subText?: string | undefined;
|
|
29
|
-
trailingIcon?: JSX.Element | undefined;
|
|
30
|
-
leadingIcon?: JSX.Element | undefined;
|
|
31
|
-
customComponent?: JSX.Element | undefined;
|
|
32
|
-
searchKey?: string | undefined;
|
|
33
|
-
options: SingleOption[];
|
|
34
|
-
})[] | undefined;
|
|
35
|
-
selectAllHandler: (newState: SelectAllCheckboxState) => void;
|
|
36
|
-
onMultiSelectClear: () => void;
|
|
37
|
-
onFreeFormSelect: (selected: boolean) => void;
|
|
38
|
-
onMultiSelectApply: () => void;
|
|
39
|
-
};
|