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