@bikdotai/bik-component-library 0.0.89 → 0.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/DropdownWrapper.d.ts +1 -0
- package/dist/cjs/components/QueryBuilder/components/DropdownWrapper.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
- package/dist/cjs/components/TypographyStyle.d.ts +51 -17
- package/dist/cjs/components/TypographyStyle.js +135 -75
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/components/DropdownWrapper.d.ts +1 -0
- package/dist/esm/components/QueryBuilder/components/DropdownWrapper.js +1 -1
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
- package/dist/esm/components/TypographyStyle.d.ts +51 -17
- package/dist/esm/components/TypographyStyle.js +142 -82
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("react"),t=require("../../../components/AllowedListDropdown.js"),a=require("../../../components/Connectors/Connector.js"),l=require("../../../helpers/ApiResponse.helper.js"),u=require("../../../hooks/useQueryBuilder.js"),n=require("../../../hooks/useQueryBuilderCache.js"),i=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,k,x,N,Q,S,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}=n.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}`),ne=(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 ne(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,{isLoading:K,disabled:"view"===T,width:"200px",dropdownLabel:"Select event name",options:R,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:i.QueryBuilderConnectorType.frequency,operator:d.FREQUENCY_OPERATORS.atleast,value:1},error:{}},y._id),te(!1)}),1)):H({key:"frequency",value:{dataType:i.QueryBuilderConnectorType.frequency,operator:d.FREQUENCY_OPERATORS.atleast,value:1}},y._id),I?(le(!0),setTimeout((()=>{J({key:"date",value:{dataType:i.QueryBuilderConnectorType.date,operator:d.DATE_OPERATORS["last month"]},error:{}},y._id),le(!1)}),1)):H({key:"date",value:{dataType:i.QueryBuilderConnectorType.date,operator:d.DATE_OPERATORS["last month"]}},y._id))},error:null!==(k=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!==k?k:null===(x=null==Z?void 0:Z.error)||void 0===x?void 0:x.value})]})),(null==X?void 0:X.key)&&!oe&&r.jsx(a.default,{disabled:"view"===T,extra:{},errors:{val:null===(Q=null===(N=X.error)||void 0===N?void 0:N.value)||void 0===Q?void 0:Q.value,operator:null===(g=null===(S=X.error)||void 0===S?void 0:S.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:i.QueryBuilderConnectorType.frequency,operator:e,value:1},error:{}},y._id)},onValueChange:function(e){var r;D&&J({key:"frequency",value:{dataType:i.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:i.QueryBuilderConnectorType.date,operator:e,value:void 0},error:{}},y._id)},onValueChange:function(e){var r;D&&J({key:"date",value:{dataType:i.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"),n=require("../../../hooks/useQueryBuilderCache.js"),i=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,k,x,N,Q,S,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}=n.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}`),ne=(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 ne(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,{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:i.QueryBuilderConnectorType.frequency,operator:d.FREQUENCY_OPERATORS.atleast,value:1},error:{}},y._id),te(!1)}),1)):H({key:"frequency",value:{dataType:i.QueryBuilderConnectorType.frequency,operator:d.FREQUENCY_OPERATORS.atleast,value:1}},y._id),I?(le(!0),setTimeout((()=>{J({key:"date",value:{dataType:i.QueryBuilderConnectorType.date,operator:d.DATE_OPERATORS["last month"]},error:{}},y._id),le(!1)}),1)):H({key:"date",value:{dataType:i.QueryBuilderConnectorType.date,operator:d.DATE_OPERATORS["last month"]}},y._id))},error:null!==(k=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!==k?k:null===(x=null==Z?void 0:Z.error)||void 0===x?void 0:x.value})]})),(null==X?void 0:X.key)&&!oe&&r.jsx(a.default,{disabled:"view"===T,extra:{},errors:{val:null===(Q=null===(N=X.error)||void 0===N?void 0:N.value)||void 0===Q?void 0:Q.value,operator:null===(g=null===(S=X.error)||void 0===S?void 0:S.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:i.QueryBuilderConnectorType.frequency,operator:e,value:1},error:{}},y._id)},onValueChange:function(e){var r;D&&J({key:"frequency",value:{dataType:i.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:i.QueryBuilderConnectorType.date,operator:e,value:void 0},error:{}},y._id)},onValueChange:function(e){var r;D&&J({key:"date",value:{dataType:i.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("react/jsx-runtime"),r=require("react"),l=require("../../../components/AllowedListDropdown.js"),o=require("../../../helpers/ApiResponse.helper.js"),i=require("../../../hooks/useQueryBuilder.js"),d=require("../../../hooks/useQueryBuilderCache.js"),s=require("../../../components/DropdownWrapper.js"),u=require("../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js");const n=new o.ApiResponseHelper;exports.default=o=>{let{node:t,allowedNodes:a,apiHandler:v,mode:c,selectorKey:p}=o;var y,m,j,f,h,w,x,B,g;const{updateMeta:A,selectType:k,createMeta:q}=i.useQueryBuilder(p),{cacheWrap:b}=d.useQueryBuilderCache(),[Q,D]=r.useState(!1),[S,_]=r.useState([]),L=t.metas.find((e=>"segmentID"===e.key));return r.useEffect((()=>{q({key:"segmentID"},t._id),b((()=>v({})),"SEGMENT_FILTER").then((e=>{if(e&&Array.isArray(e))_([...e.map((e=>({label:e.name,value:e.id,description:e.description,selected:"create"!==c&&(!!(null==L?void 0:L.value)&&L.value===e.id)})))]);else{const r=n.convertToGroupOptions(e,(null==L?void 0:L.value)?[L.value]:void 0);_([...r])}D(!1)}))}),[]),e.jsx(u.BaseQueryBuilderNode,Object.assign({node:t,mode:c},{children:e.jsxs("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12}},{children:[e.jsx(l.default,{disabled:"view"===c,loading:Q,selectedType:t.type,allowedList:a,onSelect:function(e){Array.isArray(e)||(D(!0),k(e.value,t._id))}}),(null===(m=null===(y=null==t?void 0:t.metas)||void 0===y?void 0:y[0])||void 0===m?void 0:m.key)&&e.jsx(s.default,{isLoading:Q,disabled:"view"===c,width:"200px",dropdownLabel:"Select segment",options:S,onSelect:function(e){Array.isArray(e)||A({key:"segmentID",value:e.value,error:{}},t._id)},error:null!==(B=null!==(w=null===(h=null===(f=null===(j=t.metas)||void 0===j?void 0:j[0])||void 0===f?void 0:f.error)||void 0===h?void 0:h.key)&&void 0!==w?w:null===(x=null==L?void 0:L.error)||void 0===x?void 0:x.key)&&void 0!==B?B:null===(g=null==L?void 0:L.error)||void 0===g?void 0:g.value})]}))}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),l=require("../../../components/AllowedListDropdown.js"),o=require("../../../helpers/ApiResponse.helper.js"),i=require("../../../hooks/useQueryBuilder.js"),d=require("../../../hooks/useQueryBuilderCache.js"),s=require("../../../components/DropdownWrapper.js"),u=require("../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js");const n=new o.ApiResponseHelper;exports.default=o=>{let{node:t,allowedNodes:a,apiHandler:v,mode:c,selectorKey:p}=o;var y,m,j,f,h,w,x,B,g;const{updateMeta:A,selectType:k,createMeta:q}=i.useQueryBuilder(p),{cacheWrap:b}=d.useQueryBuilderCache(),[Q,D]=r.useState(!1),[S,_]=r.useState([]),L=t.metas.find((e=>"segmentID"===e.key));return r.useEffect((()=>{q({key:"segmentID"},t._id),b((()=>v({})),"SEGMENT_FILTER").then((e=>{if(e&&Array.isArray(e))_([...e.map((e=>({label:e.name,value:e.id,description:e.description,selected:"create"!==c&&(!!(null==L?void 0:L.value)&&L.value===e.id)})))]);else{const r=n.convertToGroupOptions(e,(null==L?void 0:L.value)?[L.value]:void 0);_([...r])}D(!1)}))}),[]),e.jsx(u.BaseQueryBuilderNode,Object.assign({node:t,mode:c},{children:e.jsxs("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12}},{children:[e.jsx(l.default,{disabled:"view"===c,loading:Q,selectedType:t.type,allowedList:a,onSelect:function(e){Array.isArray(e)||(D(!0),k(e.value,t._id))}}),(null===(m=null===(y=null==t?void 0:t.metas)||void 0===y?void 0:y[0])||void 0===m?void 0:m.key)&&e.jsx(s.default,{selectedValues:(null==L?void 0:L.value)?[L.value]:void 0,isLoading:Q,disabled:"view"===c,width:"200px",dropdownLabel:"Select segment",options:S,onSelect:function(e){Array.isArray(e)||A({key:"segmentID",value:e.value,error:{}},t._id)},error:null!==(B=null!==(w=null===(h=null===(f=null===(j=t.metas)||void 0===j?void 0:j[0])||void 0===f?void 0:f.error)||void 0===h?void 0:h.key)&&void 0!==w?w:null===(x=null==L?void 0:L.error)||void 0===x?void 0:x.key)&&void 0!==B?B:null===(g=null==L?void 0:L.error)||void 0===g?void 0:g.value})]}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
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})}))};
|
package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js
CHANGED
|
@@ -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"),t=require("../../Connectors/Connector.js"),a=require("../../DropdownWrapper.js"),i=require("./PropertyNode.styled.js"),l=require("./PropertyNodeUIWrapper.js");const s=new n.ApiResponseHelper,d=n=>{let{propertySelectorText:l,fetchPropertyData:d,onPropertyNameSelect:u,onPropertyOperatorChange:p,onPropertyValueChange:c,property:v,mode:y}=n;var j,f,g,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),o=require("../../../constants/connectorPosition.js"),n=require("../../../helpers/ApiResponse.helper.js"),t=require("../../Connectors/Connector.js"),a=require("../../DropdownWrapper.js"),i=require("./PropertyNode.styled.js"),l=require("./PropertyNodeUIWrapper.js");const s=new n.ApiResponseHelper,d=n=>{let{propertySelectorText:l,fetchPropertyData:d,onPropertyNameSelect:u,onPropertyOperatorChange:p,onPropertyValueChange:c,property:v,mode:y}=n;var j,f,m,g,h,x,b;const[A,C]=r.useState([]),[O,P]=r.useState({}),[w,S]=r.useState(!0),[q,L]=r.useState("create"===y),T=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 N(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)})),P({}),r?null==u||u(r,v).then((e=>{P({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))),S(!1),L(!1)})):(S(!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&&N({value:r.id,label:r.name}),null==c||c(null==e?void 0:e.value,v)}}),[A]),e.jsxs(e.Fragment,{children:[e.jsxs(i.Container,{children:[e.jsx(a.default,{disabled:"view"===y,width:"200px",isLoading:w,dropdownLabel:null!=l?l:"Select property",options:T,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===(f=o.isNewLineConnectorPosition[v.dataType])||void 0===f?void 0:f[v.operator])&&e.jsx(t.default,{isLoading:q,disabled:"view"===y,extra:O,errors:{val:null===(m=v.error)||void 0===m?void 0:m.value,operator:null===(g=v.error)||void 0===g?void 0:g.operator},connectorVal:v.value,connectorType:v.dataType,defaultConnector:v.operator,onOperatorChange:e=>{null==p||p(e,v)},onValueChange:e=>null==c?void 0:c(e,v)})]}),(null==v?void 0:v.name)&&(null===(h=o.isNewLineConnectorPosition[v.dataType])||void 0===h?void 0:h[v.operator])&&e.jsx(t.default,{isLoading:q,disabled:"view"===y,extra:O,errors:{val:null===(x=v.error)||void 0===x?void 0:x.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==p?void 0:p(e,v),onValueChange:e=>null==c?void 0:c(e,v)})]})};exports.PropertyNode=r=>e.jsx(l.default,Object.assign({isLast:r.isLast,mode:r.mode},{children:e.jsx("div",Object.assign({style:{padding:12}},{children:e.jsx(d,Object.assign({},r))}))})),exports.PropertyNodeHeadless=d;
|
|
@@ -1,17 +1,51 @@
|
|
|
1
|
-
export declare const TitleLarge: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
1
|
+
export declare const TitleLarge: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
numberOfLines?: number | undefined;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const TitleMedium: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
numberOfLines?: number | undefined;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const TitleRegular: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
numberOfLines?: number | undefined;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const TitleSmall: import("styled-components").StyledComponent<"div", any, {
|
|
11
|
+
numberOfLines?: number | undefined;
|
|
12
|
+
}, never>;
|
|
13
|
+
export declare const Display: import("styled-components").StyledComponent<"div", any, {
|
|
14
|
+
numberOfLines?: number | undefined;
|
|
15
|
+
}, never>;
|
|
16
|
+
export declare const BodyLarge: import("styled-components").StyledComponent<"div", any, {
|
|
17
|
+
numberOfLines?: number | undefined;
|
|
18
|
+
}, never>;
|
|
19
|
+
export declare const BodyPrimary: import("styled-components").StyledComponent<"div", any, {
|
|
20
|
+
numberOfLines?: number | undefined;
|
|
21
|
+
}, never>;
|
|
22
|
+
export declare const BodySecondary: import("styled-components").StyledComponent<"div", any, {
|
|
23
|
+
numberOfLines?: number | undefined;
|
|
24
|
+
}, never>;
|
|
25
|
+
export declare const BodyPrimaryLink: import("styled-components").StyledComponent<"div", any, {
|
|
26
|
+
numberOfLines?: number | undefined;
|
|
27
|
+
}, never>;
|
|
28
|
+
export declare const BodySecondaryLink: import("styled-components").StyledComponent<"div", any, {
|
|
29
|
+
numberOfLines?: number | undefined;
|
|
30
|
+
}, never>;
|
|
31
|
+
export declare const BodyCaption: import("styled-components").StyledComponent<"div", any, {
|
|
32
|
+
numberOfLines?: number | undefined;
|
|
33
|
+
}, never>;
|
|
34
|
+
export declare const BodyTiny: import("styled-components").StyledComponent<"div", any, {
|
|
35
|
+
numberOfLines?: number | undefined;
|
|
36
|
+
}, never>;
|
|
37
|
+
export declare const ButtonLarge: import("styled-components").StyledComponent<"div", any, {
|
|
38
|
+
numberOfLines?: number | undefined;
|
|
39
|
+
}, never>;
|
|
40
|
+
export declare const ButtonRegular: import("styled-components").StyledComponent<"div", any, {
|
|
41
|
+
numberOfLines?: number | undefined;
|
|
42
|
+
}, never>;
|
|
43
|
+
export declare const SubHeading: import("styled-components").StyledComponent<"div", any, {
|
|
44
|
+
numberOfLines?: number | undefined;
|
|
45
|
+
}, never>;
|
|
46
|
+
export declare const BodyRegular: import("styled-components").StyledComponent<"div", any, {
|
|
47
|
+
numberOfLines?: number | undefined;
|
|
48
|
+
}, never>;
|
|
49
|
+
export declare const Caption: import("styled-components").StyledComponent<"div", any, {
|
|
50
|
+
numberOfLines?: number | undefined;
|
|
51
|
+
}, never>;
|
|
@@ -1,100 +1,160 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../constants/Theme.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e);const n=e=>e+"px",r=o.default.div`
|
|
2
2
|
font-family: Inter;
|
|
3
|
-
color: ${
|
|
4
|
-
font-weight: ${
|
|
5
|
-
font-size: ${n(
|
|
6
|
-
line-height: ${n(
|
|
3
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
4
|
+
font-weight: ${t.FONTS.titleLarge.fontWeight};
|
|
5
|
+
font-size: ${n(t.FONTS.titleLarge.fontSize)};
|
|
6
|
+
line-height: ${n(t.FONTS.titleLarge.lineHeight)};
|
|
7
|
+
-webkit-box-orient: vertical;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
display: -webkit-box;
|
|
10
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
7
11
|
`,l=o.default.div`
|
|
8
12
|
font-family: Inter;
|
|
9
|
-
color: ${
|
|
10
|
-
font-weight: ${
|
|
11
|
-
font-size: ${n(
|
|
12
|
-
line-height: ${n(
|
|
13
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
14
|
+
font-weight: ${t.FONTS.titleMedium.fontWeight};
|
|
15
|
+
font-size: ${n(t.FONTS.titleMedium.fontSize)};
|
|
16
|
+
line-height: ${n(t.FONTS.titleMedium.lineHeight)};
|
|
17
|
+
-webkit-box-orient: vertical;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
display: -webkit-box;
|
|
20
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
13
21
|
`,a=o.default.div`
|
|
14
22
|
font-family: Inter;
|
|
15
|
-
color: ${
|
|
16
|
-
font-weight: ${
|
|
17
|
-
font-size: ${n(
|
|
18
|
-
line-height: ${n(
|
|
23
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
24
|
+
font-weight: ${t.FONTS.titleRegular.fontWeight};
|
|
25
|
+
font-size: ${n(t.FONTS.titleRegular.fontSize)};
|
|
26
|
+
line-height: ${n(t.FONTS.titleRegular.lineHeight)};
|
|
27
|
+
-webkit-box-orient: vertical;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
display: -webkit-box;
|
|
30
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
19
31
|
`,f=o.default.div`
|
|
20
32
|
font-family: Inter;
|
|
21
|
-
color: ${
|
|
22
|
-
font-weight: ${
|
|
23
|
-
font-size: ${n(
|
|
24
|
-
line-height: ${n(
|
|
25
|
-
|
|
33
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
34
|
+
font-weight: ${t.FONTS.titleSmall.fontWeight};
|
|
35
|
+
font-size: ${n(t.FONTS.titleSmall.fontSize)};
|
|
36
|
+
line-height: ${n(t.FONTS.titleSmall.lineHeight)};
|
|
37
|
+
-webkit-box-orient: vertical;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
display: -webkit-box;
|
|
40
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
41
|
+
`,d=o.default.div`
|
|
26
42
|
font-family: Inter;
|
|
27
|
-
color: ${
|
|
28
|
-
font-weight: ${
|
|
29
|
-
font-size: ${n(
|
|
30
|
-
line-height: ${n(
|
|
31
|
-
|
|
43
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
44
|
+
font-weight: ${t.FONTS.display.fontWeight};
|
|
45
|
+
font-size: ${n(t.FONTS.display.fontSize)};
|
|
46
|
+
line-height: ${n(t.FONTS.display.lineHeight)};
|
|
47
|
+
-webkit-box-orient: vertical;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
display: -webkit-box;
|
|
50
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
51
|
+
`,b=o.default.div`
|
|
32
52
|
font-family: Inter;
|
|
33
|
-
color: ${
|
|
34
|
-
font-weight: ${
|
|
35
|
-
font-size: ${n(
|
|
36
|
-
line-height: ${n(
|
|
53
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
54
|
+
font-weight: ${t.FONTS.bodyPrimary.fontWeight};
|
|
55
|
+
font-size: ${n(t.FONTS.bodyLarge.fontSize)};
|
|
56
|
+
line-height: ${n(t.FONTS.bodyLarge.lineHeight)};
|
|
57
|
+
-webkit-box-orient: vertical;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
display: -webkit-box;
|
|
60
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
37
61
|
`,O=o.default.div`
|
|
38
62
|
font-family: Inter;
|
|
39
|
-
color: ${
|
|
40
|
-
font-weight: ${
|
|
41
|
-
font-size: ${n(
|
|
42
|
-
line-height: ${n(
|
|
43
|
-
|
|
63
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
64
|
+
font-weight: ${t.FONTS.bodyPrimary.fontWeight};
|
|
65
|
+
font-size: ${n(t.FONTS.bodyPrimary.fontSize)};
|
|
66
|
+
line-height: ${n(t.FONTS.bodyPrimary.lineHeight)};
|
|
67
|
+
-webkit-box-orient: vertical;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
display: -webkit-box;
|
|
70
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
71
|
+
`,c=o.default.div`
|
|
44
72
|
font-family: Inter;
|
|
45
|
-
color: ${
|
|
46
|
-
font-weight: ${
|
|
47
|
-
font-size: ${n(
|
|
48
|
-
line-height: ${n(
|
|
73
|
+
color: ${t.COLORS.content.primary};
|
|
74
|
+
font-weight: ${t.FONTS.bodySecondary.fontWeight};
|
|
75
|
+
font-size: ${n(t.FONTS.bodySecondary.fontSize)};
|
|
76
|
+
line-height: ${n(t.FONTS.bodySecondary.lineHeight)};
|
|
77
|
+
-webkit-box-orient: vertical;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
display: -webkit-box;
|
|
80
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
49
81
|
`,h=o.default(O)`
|
|
50
82
|
text-decoration: underline;
|
|
51
|
-
color: ${
|
|
52
|
-
text-decoration-color: ${
|
|
83
|
+
color: ${t.COLORS.content.brand};
|
|
84
|
+
text-decoration-color: ${t.COLORS.content.brand};
|
|
53
85
|
cursor: pointer;
|
|
54
|
-
`,
|
|
86
|
+
`,S=o.default(c)`
|
|
55
87
|
text-decoration: underline;
|
|
56
|
-
color: ${
|
|
57
|
-
text-decoration-color: ${
|
|
88
|
+
color: ${t.COLORS.content.brand};
|
|
89
|
+
text-decoration-color: ${t.COLORS.content.brand};
|
|
58
90
|
cursor: pointer;
|
|
59
|
-
|
|
60
|
-
font-family: Inter;
|
|
61
|
-
color: ${t=>t.color||e.COLORS.text.primary};
|
|
62
|
-
font-weight: ${e.FONTS.caption.fontWeight};
|
|
63
|
-
font-size: ${n(e.FONTS.caption.fontSize)};
|
|
64
|
-
line-height: ${n(e.FONTS.caption.lineHeight)};
|
|
65
|
-
`,c=o.default.div`
|
|
66
|
-
color: ${t=>t.color||e.COLORS.text.primary};
|
|
67
|
-
font-weight: ${e.FONTS.tiny.fontWeight};
|
|
68
|
-
font-size: ${n(e.FONTS.tiny.fontSize)};
|
|
69
|
-
line-height: ${n(e.FONTS.tiny.lineHeight)};
|
|
70
|
-
`,u=o.default.div`
|
|
91
|
+
`,g=o.default.div`
|
|
71
92
|
font-family: Inter;
|
|
72
|
-
color: ${
|
|
73
|
-
font-weight: ${
|
|
74
|
-
font-size: ${n(
|
|
75
|
-
line-height: ${n(
|
|
93
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
94
|
+
font-weight: ${t.FONTS.caption.fontWeight};
|
|
95
|
+
font-size: ${n(t.FONTS.caption.fontSize)};
|
|
96
|
+
line-height: ${n(t.FONTS.caption.lineHeight)};
|
|
97
|
+
-webkit-box-orient: vertical;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
display: -webkit-box;
|
|
100
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
101
|
+
`,y=o.default.div`
|
|
102
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
103
|
+
font-weight: ${t.FONTS.tiny.fontWeight};
|
|
104
|
+
font-size: ${n(t.FONTS.tiny.fontSize)};
|
|
105
|
+
line-height: ${n(t.FONTS.tiny.lineHeight)};
|
|
106
|
+
-webkit-box-orient: vertical;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
display: -webkit-box;
|
|
109
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
76
110
|
`,p=o.default.div`
|
|
77
111
|
font-family: Inter;
|
|
78
|
-
color: ${
|
|
79
|
-
font-weight: ${
|
|
80
|
-
font-size: ${n(
|
|
81
|
-
line-height: ${n(
|
|
112
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
113
|
+
font-weight: ${t.FONTS.buttonLarge.fontWeight};
|
|
114
|
+
font-size: ${n(t.FONTS.buttonLarge.fontSize)};
|
|
115
|
+
line-height: ${n(t.FONTS.buttonLarge.lineHeight)};
|
|
116
|
+
-webkit-box-orient: vertical;
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
display: -webkit-box;
|
|
119
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
82
120
|
`,s=o.default.div`
|
|
83
121
|
font-family: Inter;
|
|
84
|
-
color: ${
|
|
85
|
-
font-weight: ${
|
|
86
|
-
font-size: ${n(
|
|
87
|
-
line-height: ${n(
|
|
88
|
-
|
|
122
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
123
|
+
font-weight: ${t.FONTS.buttonRegular.fontWeight};
|
|
124
|
+
font-size: ${n(t.FONTS.buttonRegular.fontSize)};
|
|
125
|
+
line-height: ${n(t.FONTS.buttonRegular.lineHeight)};
|
|
126
|
+
-webkit-box-orient: vertical;
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
display: -webkit-box;
|
|
129
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
130
|
+
`,$=o.default.div`
|
|
89
131
|
font-family: Inter;
|
|
90
|
-
color: ${
|
|
91
|
-
font-weight: ${
|
|
92
|
-
font-size: ${n(
|
|
93
|
-
line-height: ${n(
|
|
132
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
133
|
+
font-weight: ${t.FONTS.subHeading.fontWeight};
|
|
134
|
+
font-size: ${n(t.FONTS.subHeading.fontSize)};
|
|
135
|
+
line-height: ${n(t.FONTS.subHeading.lineHeight)};
|
|
136
|
+
-webkit-box-orient: vertical;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
display: -webkit-box;
|
|
139
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
94
140
|
`,m=o.default.div`
|
|
95
141
|
font-family: Inter;
|
|
96
|
-
color: ${e.COLORS.text.primary};
|
|
97
|
-
font-weight: ${
|
|
98
|
-
font-size: ${n(
|
|
99
|
-
line-height: ${n(
|
|
100
|
-
|
|
142
|
+
color: ${e=>e.color||t.COLORS.text.primary};
|
|
143
|
+
font-weight: ${t.FONTS.bodyRegular.fontWeight};
|
|
144
|
+
font-size: ${n(t.FONTS.bodyRegular.fontSize)};
|
|
145
|
+
line-height: ${n(t.FONTS.bodyRegular.lineHeight)};
|
|
146
|
+
-webkit-box-orient: vertical;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
display: -webkit-box;
|
|
149
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
150
|
+
`,w=o.default.div`
|
|
151
|
+
font-family: Inter;
|
|
152
|
+
color: ${t.COLORS.text.primary};
|
|
153
|
+
font-weight: ${t.FONTS.caption.fontWeight};
|
|
154
|
+
font-size: ${n(t.FONTS.caption.fontSize)};
|
|
155
|
+
line-height: ${n(t.FONTS.caption.lineHeight)};
|
|
156
|
+
-webkit-box-orient: vertical;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
display: -webkit-box;
|
|
159
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
160
|
+
`;exports.BodyCaption=g,exports.BodyLarge=b,exports.BodyPrimary=O,exports.BodyPrimaryLink=h,exports.BodyRegular=m,exports.BodySecondary=c,exports.BodySecondaryLink=S,exports.BodyTiny=y,exports.ButtonLarge=p,exports.ButtonRegular=s,exports.Caption=w,exports.Display=d,exports.SubHeading=$,exports.TitleLarge=r,exports.TitleMedium=l,exports.TitleRegular=a,exports.TitleSmall=f;
|
|
@@ -1 +1 @@
|
|
|
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"),
|
|
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"),l=require("../utils/iterationOnOptions.js"),i=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 h=304,f=290;exports.OpenedDropdown=j=>{let{options:S,isSearchable:b,isMultiSelect:O,width:x,allowFreeForm:g,height:v,onClose:m,onSelect:w}=j;const[y,q]=t.useState(null!=S?S:[]);t.useEffect((()=>{q(S)}),[S]);const[M,C]=t.useState(null!=x?x:f),[F,L]=t.useState(""),[D,A]=t.useState(null),B=t.useRef(null);n.useOutside(B,(()=>{A(null),null==m||m()}));const Z=null!=v?v:h,E="number"==typeof Z?b&&O?Z-96:b&&!O||!b&&O?Z-48:Z:Z;function H(e){if(O){const t=l.iterateOnOptions(y,{selected:e.selected},(t=>t.value===e.value));q([...t])}else null==w||w(e)}t.useEffect((()=>{const e=null!=x?x:f;if(null===D)C(e);else if("number"==typeof e)C(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));C(t)}}),[D]);const _=[],k=y.map((e=>{var t;if(F){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(F.toLowerCase()))&&(_.push(!F||e.label===F),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(F.toLowerCase()))?(_.push(!F||e.label===F),e):null}return e})).filter((e=>null!==e)),z=!!b&&F&&0===k.length;return e.jsxs(a.OpennedDropdownContainer,Object.assign({ref:B,style:{width:M}},{children:[e.jsxs("div",Object.assign({style:{width:D?"50%":"100%",display:"flex",flexDirection:"column"}},{children:[!!b&&e.jsx(d.SearchBox,{onSearch:function(e){L(e)}}),k.length||F?e.jsxs(a.MenuListContainer,Object.assign({minHeight:Z,maxHeight:E},{children:[!!O&&!z&&e.jsx(u.SelectAllMenu,{options:y,onSelect:function(e){if("selectAll"===e){const e=l.iterateOnOptions(y,{selected:!0},(e=>{var t;return F?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(F.toLowerCase()))&&!e.disabled:!e.disabled}));q([...e])}else if("notSelected"===e){const e=l.iterateOnOptions(y,{selected:!1},(e=>!e.disabled));q([...e])}}}),!g&&z&&e.jsx(p.SearchZeroState,{searchedString:F}),g&&(z||!!_.length&&_.every((e=>!1===e)))&&e.jsx(o.FreeFormMenu,{isMultiSelect:O,onSelect:function(e){if(!O)return void H({label:F,value:F,isFreeForm:!0,selected:!0});const t=y.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===F&&t.value===F?e:t.selected})));e&&(t.some((e=>e.label===F&&e.value===F))||t.unshift({label:F,value:F,isFreeForm:!0,selected:!0})),q([...t])},searchedString:F}),e.jsx(r.MenuList,{onSelect:H,showDescription:function(e,t){A(e&&t?{title:e,description:t}:null)},isMultiSelect:O,options:k})]})):e.jsx("div",Object.assign({style:{height:Z,display:"flex"}},{children:e.jsx(s.ZeroState,{title:"No options passed",subTitle:"Sorry we could not find any options to show"})})),!!O&&!(!k.length&&!F)&&e.jsx(c.default,{onClear:function(){const e=l.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(i.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"),
|
|
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("")},width:24,height:24,color:o.COLORS.content.placeholder}):e.jsx(e.Fragment,{})},reset:p,onChangeText:e=>{d(!1),l(e),a(e)}})}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../../../_virtual/_tslib.js";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as t,useEffect as a}from"react";import l from"../../../components/AllowedListDropdown.js";import i from"../../../components/Connectors/Connector.js";import{ApiResponseHelper as n}from"../../../helpers/ApiResponse.helper.js";import{useQueryBuilder as d}from"../../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as u}from"../../../hooks/useQueryBuilderCache.js";import{QueryBuilderConnectorType as v}from"../../../types/QueryBuilder.type.js";import{FREQUENCY_OPERATORS as p,DATE_OPERATORS as s}from"../../../types/QueryBuilderOperator.type.js";import y from"../../../components/DropdownWrapper.js";import{BaseQueryBuilderNode as c}from"../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";const m=new n,f=n=>{let{node:f,allowedNodes:T,apiHandler:_,mode:h,selectorKey:j}=n;var k,g,N,O,b,w,P,q,x,C,B,E,S,A,
|
|
1
|
+
import{__awaiter as e}from"../../../../../_virtual/_tslib.js";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as t,useEffect as a}from"react";import l from"../../../components/AllowedListDropdown.js";import i from"../../../components/Connectors/Connector.js";import{ApiResponseHelper as n}from"../../../helpers/ApiResponse.helper.js";import{useQueryBuilder as d}from"../../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as u}from"../../../hooks/useQueryBuilderCache.js";import{QueryBuilderConnectorType as v}from"../../../types/QueryBuilder.type.js";import{FREQUENCY_OPERATORS as p,DATE_OPERATORS as s}from"../../../types/QueryBuilderOperator.type.js";import y from"../../../components/DropdownWrapper.js";import{BaseQueryBuilderNode as c}from"../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";const m=new n,f=n=>{let{node:f,allowedNodes:T,apiHandler:_,mode:h,selectorKey:j}=n;var k,g,N,O,b,w,P,q,x,C,B,E,S,V,A,Q,D,M;const[L,$]=t([]),[J,W]=t(!1),{deleteProperty:G,createProperty:H,selectType:K,createMeta:R,updateMeta:z,updateProperty:F,selectPropertyJoinOperator:I,clearProperty:U}=d(j),{cacheWrap:X}=u(),[Y,Z]=t(!0),ee=null===(k=null==f?void 0:f.metas)||void 0===k?void 0:k.find((e=>"date"===e.key)),oe=null===(g=null==f?void 0:f.metas)||void 0===g?void 0:g.find((e=>"frequency"===e.key)),re=null===(N=null==f?void 0:f.metas)||void 0===N?void 0:N.find((e=>"eventName"===e.key)),[te,ae]=t(!1),[le,ie]=t(!1),[ne,de]=t(!1),ue=e=>X((()=>_({query:{eventName:e}})),`EVENT_NAMES_${e}`),ve=(e,o)=>X((()=>_({query:{eventName:e,propertyName:o}})),`EVENT_NAMES_${e}_${o}`);return a((()=>{X((()=>_({})),"EVENT_NAMES").then((e=>{Z(!1);const o=m.convertToGroupOptions(e,(null==re?void 0:re.value)?[re.value]:void 0);if("create"!==h&&re)return $([...o]),void W(!0);$([...o]),W(!0)}))}),[]),o(c,Object.assign({selectPropertyJoinOperator:I,node:f,addPropertyBtnText:(null==re?void 0:re.value)&&"Add event property",deleteProperty:G,createProperty:H,propertySelectorText:"Select property",fetchPropertyData:function(){return e(this,void 0,void 0,(function*(){return yield ue(null==re?void 0:re.value)}))},onPropertyNameSelect:function(o,r){return e(this,void 0,void 0,(function*(){F(Object.assign(Object.assign({},r),{name:o.id,dataType:o.type,operator:void 0,value:void 0,error:{}}),f._id);const e=yield ve(null==re?void 0:re.value,o.id);return null!=e?e:[]}))},onPropertyOperatorChange:function(e,o){F(Object.assign(Object.assign({},o),{operator:e,value:void 0,error:{}}),f._id)},onPropertyValueChange:function(e,o){F(Object.assign(Object.assign({},o),{value:e,error:{}}),f._id)},mode:h},{children:r("div",Object.assign({style:{flexDirection:"column",display:"flex",gap:12}},{children:[r("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12}},{children:[o(l,{disabled:"view"===h,selectedType:f.type,allowedList:T,onSelect:function(e){ae(!0),setTimeout((()=>{K(e.value,f._id),ae(!1)}),1)}}),!te&&o(y,{isLoading:Y,disabled:"view"===h,width:"200px",dropdownLabel:"Select event name",options:L,selectedValues:(null==re?void 0:re.value)?[re.value]:void 0,onSelect:function(e){Array.isArray(e)||(U(f._id),re?z({key:"eventName",value:e.value,error:{}},f._id):R({key:"eventName",value:e.value},f._id),oe?(ie(!0),setTimeout((()=>{z({key:"frequency",value:{dataType:v.frequency,operator:p.atleast,value:1},error:{}},f._id),ie(!1)}),1)):R({key:"frequency",value:{dataType:v.frequency,operator:p.atleast,value:1}},f._id),ee?(de(!0),setTimeout((()=>{z({key:"date",value:{dataType:v.date,operator:s["last month"]},error:{}},f._id),de(!1)}),1)):R({key:"date",value:{dataType:v.date,operator:s["last month"]}},f._id))},error:null!==(x=null!==(P=null===(w=null===(b=null===(O=f.metas)||void 0===O?void 0:O[0])||void 0===b?void 0:b.error)||void 0===w?void 0:w.key)&&void 0!==P?P:null===(q=null==re?void 0:re.error)||void 0===q?void 0:q.key)&&void 0!==x?x:null===(C=null==re?void 0:re.error)||void 0===C?void 0:C.value})]})),(null==oe?void 0:oe.key)&&!le&&o(i,{disabled:"view"===h,extra:{},errors:{val:null===(E=null===(B=oe.error)||void 0===B?void 0:B.value)||void 0===E?void 0:E.value,operator:null===(V=null===(S=oe.error)||void 0===S?void 0:S.value)||void 0===V?void 0:V.operator},connectorVal:oe.value.value,connectorType:oe.value.dataType,defaultConnector:oe.value.operator,onOperatorChange:function(e){z({key:"frequency",value:{dataType:v.frequency,operator:e,value:1},error:{}},f._id)},onValueChange:function(e){var o;J&&z({key:"frequency",value:{dataType:v.frequency,operator:null===(o=null==oe?void 0:oe.value)||void 0===o?void 0:o.operator,value:e},error:{}},f._id)}}),(null==ee?void 0:ee.key)&&!ne&&o(i,{disabled:"view"===h,extra:{},errors:{val:null===(Q=null===(A=ee.error)||void 0===A?void 0:A.value)||void 0===Q?void 0:Q.value,operator:null===(M=null===(D=ee.error)||void 0===D?void 0:D.value)||void 0===M?void 0:M.operator},connectorVal:ee.value.value,connectorType:ee.value.dataType,defaultConnector:ee.value.operator,onOperatorChange:function(e){z({key:"date",value:{dataType:v.date,operator:e,value:void 0},error:{}},f._id)},onValueChange:function(e){var o;J&&z({key:"date",value:{dataType:v.date,operator:null===(o=null==ee?void 0:ee.value)||void 0===o?void 0:o.operator,value:e},error:{}},f._id)}})]}))}))};export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as l,useEffect as r}from"react";import i from"../../../components/AllowedListDropdown.js";import{ApiResponseHelper as d}from"../../../helpers/ApiResponse.helper.js";import{useQueryBuilder as n}from"../../../hooks/useQueryBuilder.js";import{useQueryBuilderCache as t}from"../../../hooks/useQueryBuilderCache.js";import s from"../../../components/DropdownWrapper.js";import{BaseQueryBuilderNode as a}from"../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";const u=new d,v=d=>{let{node:v,allowedNodes:p,apiHandler:c,mode:m,selectorKey:y}=d;var f,w,h,g,j,k,A,b,B;const{updateMeta:D,selectType:x,createMeta:L}=n(y),{cacheWrap:T}=t(),[I,N]=l(!1),[Q,S]=l([]),_=v.metas.find((e=>"segmentID"===e.key));return r((()=>{L({key:"segmentID"},v._id),T((()=>c({})),"SEGMENT_FILTER").then((e=>{if(e&&Array.isArray(e))S([...e.map((e=>({label:e.name,value:e.id,description:e.description,selected:"create"!==m&&(!!(null==_?void 0:_.value)&&_.value===e.id)})))]);else{const o=u.convertToGroupOptions(e,(null==_?void 0:_.value)?[_.value]:void 0);S([...o])}N(!1)}))}),[]),e(a,Object.assign({node:v,mode:m},{children:o("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12}},{children:[e(i,{disabled:"view"===m,loading:I,selectedType:v.type,allowedList:p,onSelect:function(e){Array.isArray(e)||(N(!0),x(e.value,v._id))}}),(null===(w=null===(f=null==v?void 0:v.metas)||void 0===f?void 0:f[0])||void 0===w?void 0:w.key)&&e(s,{selectedValues:(null==_?void 0:_.value)?[_.value]:void 0,isLoading:I,disabled:"view"===m,width:"200px",dropdownLabel:"Select segment",options:Q,onSelect:function(e){Array.isArray(e)||D({key:"segmentID",value:e.value,error:{}},v._id)},error:null!==(b=null!==(k=null===(j=null===(g=null===(h=v.metas)||void 0===h?void 0:h[0])||void 0===g?void 0:g.error)||void 0===j?void 0:j.key)&&void 0!==k?k:null===(A=null==_?void 0:_.error)||void 0===A?void 0:A.key)&&void 0!==b?b:null===(B=null==_?void 0:_.error)||void 0===B?void 0:B.value})]}))}))};export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Dropdown as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Dropdown as i}from"../../dropdown/Dropdown.js";import t from"./InputLoader.js";const s=s=>{let{options:l,onSelect:o,defaultOption:a,isSearchable:r,isLoading:n,error:d,nativeID:c,dropdownLabel:p,isMultiSelect:u,allowFreeForm:m,width:b,disabled:g,selectedValues:h}=s;return n?e(t,{}):e("div",Object.assign({style:{maxWidth:200,width:200},id:c},{children:e(i,{height:(null==l?void 0:l.length)?void 0:208,disabled:g,allowFreeForm:null!=m&&m,isMultiSelect:u,width:b,size:"small",placeHolder:p,error:d,isSearchable:null!=r&&r,defaultOptions:a?Array.isArray(a)?a:[a]:void 0,options:h?l.map((e=>e.options?Object.assign(Object.assign({},e),{options:e.options.map((e=>Object.assign(Object.assign({},e),{selected:h.includes(e.value)})))}):Object.assign(Object.assign({},e),{selected:h.includes(e.value)}))):l,onSelect:o})}))};export{s as default};
|
package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{useState as n,useEffect as a}from"react";import{isNewLineConnectorPosition as t}from"../../../constants/connectorPosition.js";import{ApiResponseHelper as i}from"../../../helpers/ApiResponse.helper.js";import l from"../../Connectors/Connector.js";import d from"../../DropdownWrapper.js";import{Container as s}from"./PropertyNode.styled.js";import p from"./PropertyNodeUIWrapper.js";const c=new i,u=r=>e(p,Object.assign({isLast:r.isLast,mode:r.mode},{children:e("div",Object.assign({style:{padding:12}},{children:e(v,Object.assign({},r))}))})),v=i=>{let{propertySelectorText:p,fetchPropertyData:u,onPropertyNameSelect:v,onPropertyOperatorChange:m,onPropertyValueChange:y,property:f,mode:g}=i;var h,j,b,A,O,C,T;const[w,P]=n([]),[x,L]=n({}),[S
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{useState as n,useEffect as a}from"react";import{isNewLineConnectorPosition as t}from"../../../constants/connectorPosition.js";import{ApiResponseHelper as i}from"../../../helpers/ApiResponse.helper.js";import l from"../../Connectors/Connector.js";import d from"../../DropdownWrapper.js";import{Container as s}from"./PropertyNode.styled.js";import p from"./PropertyNodeUIWrapper.js";const c=new i,u=r=>e(p,Object.assign({isLast:r.isLast,mode:r.mode},{children:e("div",Object.assign({style:{padding:12}},{children:e(v,Object.assign({},r))}))})),v=i=>{let{propertySelectorText:p,fetchPropertyData:u,onPropertyNameSelect:v,onPropertyOperatorChange:m,onPropertyValueChange:y,property:f,mode:g}=i;var h,j,b,A,O,C,T;const[w,P]=n([]),[x,L]=n({}),[V,S]=n(!0),[N,D]=n("create"===g),G=Array.isArray(w)?w.map((e=>Object.assign(Object.assign({},e),{label:e.name,value:e.id,description:e.description,selected:(null==f?void 0:f.name)===e.id}))):c.convertToGroupOptions(w,(null==f?void 0:f.name)?[f.name.toString()]:void 0);function I(e){if(!Array.isArray(e)){D(!0);let r=null;Array.isArray(w)?r=w.find((r=>{let{id:o}=r;return o===e.value})):Object.keys(w).forEach((o=>{const n=w[o].find((r=>{let{id:o}=r;return o===e.value}));n&&(r=n)})),L({}),r?null==v||v(r,f).then((e=>{L({options:Array.isArray(e)?[...e]:Object.assign({},e)}),D(!1)})):D(!1)}}return a((()=>{u?u().then((e=>{e&&(Array.isArray(e)?P([...e]):P(Object.assign({},e))),S(!1),D(!1)})):(S(!1),D(!1))}),[]),a((()=>{if("create"!==g&&w&&(null==f?void 0:f.name)){const e=f,r=Array.isArray(w)?w.find((e=>e.id===(null==f?void 0:f.name))):c.findInGroupedApiResponse(w,null==f?void 0:f.name);r&&I({value:r.id,label:r.name}),null==y||y(null==e?void 0:e.value,f)}}),[w]),r(o,{children:[r(s,{children:[e(d,{disabled:"view"===g,width:"200px",isLoading:V,dropdownLabel:null!=p?p:"Select property",options:G,onSelect:I,selectedValues:(null==f?void 0:f.name)?[f.name]:void 0,error:null===(h=null==f?void 0:f.error)||void 0===h?void 0:h.name}),(null==f?void 0:f.name)&&!(null===(j=t[f.dataType])||void 0===j?void 0:j[f.operator])&&e(l,{isLoading:N,disabled:"view"===g,extra:x,errors:{val:null===(b=f.error)||void 0===b?void 0:b.value,operator:null===(A=f.error)||void 0===A?void 0:A.operator},connectorVal:f.value,connectorType:f.dataType,defaultConnector:f.operator,onOperatorChange:e=>{null==m||m(e,f)},onValueChange:e=>null==y?void 0:y(e,f)})]}),(null==f?void 0:f.name)&&(null===(O=t[f.dataType])||void 0===O?void 0:O[f.operator])&&e(l,{isLoading:N,disabled:"view"===g,extra:x,errors:{val:null===(C=f.error)||void 0===C?void 0:C.value,operator:null===(T=f.error)||void 0===T?void 0:T.operator},connectorVal:f.value,connectorType:f.dataType,defaultConnector:f.operator,onOperatorChange:e=>null==m?void 0:m(e,f),onValueChange:e=>null==y?void 0:y(e,f)})]})};export{u as PropertyNode,v as PropertyNodeHeadless};
|
|
@@ -1,17 +1,51 @@
|
|
|
1
|
-
export declare const TitleLarge: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
1
|
+
export declare const TitleLarge: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
numberOfLines?: number | undefined;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const TitleMedium: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
numberOfLines?: number | undefined;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const TitleRegular: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
numberOfLines?: number | undefined;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const TitleSmall: import("styled-components").StyledComponent<"div", any, {
|
|
11
|
+
numberOfLines?: number | undefined;
|
|
12
|
+
}, never>;
|
|
13
|
+
export declare const Display: import("styled-components").StyledComponent<"div", any, {
|
|
14
|
+
numberOfLines?: number | undefined;
|
|
15
|
+
}, never>;
|
|
16
|
+
export declare const BodyLarge: import("styled-components").StyledComponent<"div", any, {
|
|
17
|
+
numberOfLines?: number | undefined;
|
|
18
|
+
}, never>;
|
|
19
|
+
export declare const BodyPrimary: import("styled-components").StyledComponent<"div", any, {
|
|
20
|
+
numberOfLines?: number | undefined;
|
|
21
|
+
}, never>;
|
|
22
|
+
export declare const BodySecondary: import("styled-components").StyledComponent<"div", any, {
|
|
23
|
+
numberOfLines?: number | undefined;
|
|
24
|
+
}, never>;
|
|
25
|
+
export declare const BodyPrimaryLink: import("styled-components").StyledComponent<"div", any, {
|
|
26
|
+
numberOfLines?: number | undefined;
|
|
27
|
+
}, never>;
|
|
28
|
+
export declare const BodySecondaryLink: import("styled-components").StyledComponent<"div", any, {
|
|
29
|
+
numberOfLines?: number | undefined;
|
|
30
|
+
}, never>;
|
|
31
|
+
export declare const BodyCaption: import("styled-components").StyledComponent<"div", any, {
|
|
32
|
+
numberOfLines?: number | undefined;
|
|
33
|
+
}, never>;
|
|
34
|
+
export declare const BodyTiny: import("styled-components").StyledComponent<"div", any, {
|
|
35
|
+
numberOfLines?: number | undefined;
|
|
36
|
+
}, never>;
|
|
37
|
+
export declare const ButtonLarge: import("styled-components").StyledComponent<"div", any, {
|
|
38
|
+
numberOfLines?: number | undefined;
|
|
39
|
+
}, never>;
|
|
40
|
+
export declare const ButtonRegular: import("styled-components").StyledComponent<"div", any, {
|
|
41
|
+
numberOfLines?: number | undefined;
|
|
42
|
+
}, never>;
|
|
43
|
+
export declare const SubHeading: import("styled-components").StyledComponent<"div", any, {
|
|
44
|
+
numberOfLines?: number | undefined;
|
|
45
|
+
}, never>;
|
|
46
|
+
export declare const BodyRegular: import("styled-components").StyledComponent<"div", any, {
|
|
47
|
+
numberOfLines?: number | undefined;
|
|
48
|
+
}, never>;
|
|
49
|
+
export declare const Caption: import("styled-components").StyledComponent<"div", any, {
|
|
50
|
+
numberOfLines?: number | undefined;
|
|
51
|
+
}, never>;
|
|
@@ -1,100 +1,160 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"styled-components";import{COLORS as i,FONTS as t}from"../constants/Theme.js";const o=e=>e+"px",n=e.div`
|
|
2
2
|
font-family: Inter;
|
|
3
|
-
color: ${
|
|
4
|
-
font-weight: ${
|
|
5
|
-
font-size: ${o(
|
|
6
|
-
line-height: ${o(
|
|
7
|
-
|
|
3
|
+
color: ${e=>e.color||i.text.primary};
|
|
4
|
+
font-weight: ${t.titleLarge.fontWeight};
|
|
5
|
+
font-size: ${o(t.titleLarge.fontSize)};
|
|
6
|
+
line-height: ${o(t.titleLarge.lineHeight)};
|
|
7
|
+
-webkit-box-orient: vertical;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
display: -webkit-box;
|
|
10
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
11
|
+
`,r=e.div`
|
|
8
12
|
font-family: Inter;
|
|
9
|
-
color: ${
|
|
10
|
-
font-weight: ${
|
|
11
|
-
font-size: ${o(
|
|
12
|
-
line-height: ${o(
|
|
13
|
-
|
|
13
|
+
color: ${e=>e.color||i.text.primary};
|
|
14
|
+
font-weight: ${t.titleMedium.fontWeight};
|
|
15
|
+
font-size: ${o(t.titleMedium.fontSize)};
|
|
16
|
+
line-height: ${o(t.titleMedium.lineHeight)};
|
|
17
|
+
-webkit-box-orient: vertical;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
display: -webkit-box;
|
|
20
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
21
|
+
`,l=e.div`
|
|
14
22
|
font-family: Inter;
|
|
15
|
-
color: ${
|
|
16
|
-
font-weight: ${
|
|
17
|
-
font-size: ${o(
|
|
18
|
-
line-height: ${o(
|
|
19
|
-
|
|
23
|
+
color: ${e=>e.color||i.text.primary};
|
|
24
|
+
font-weight: ${t.titleRegular.fontWeight};
|
|
25
|
+
font-size: ${o(t.titleRegular.fontSize)};
|
|
26
|
+
line-height: ${o(t.titleRegular.lineHeight)};
|
|
27
|
+
-webkit-box-orient: vertical;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
display: -webkit-box;
|
|
30
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
31
|
+
`,a=e.div`
|
|
20
32
|
font-family: Inter;
|
|
21
|
-
color: ${
|
|
22
|
-
font-weight: ${
|
|
23
|
-
font-size: ${o(
|
|
24
|
-
line-height: ${o(
|
|
25
|
-
|
|
33
|
+
color: ${e=>e.color||i.text.primary};
|
|
34
|
+
font-weight: ${t.titleSmall.fontWeight};
|
|
35
|
+
font-size: ${o(t.titleSmall.fontSize)};
|
|
36
|
+
line-height: ${o(t.titleSmall.lineHeight)};
|
|
37
|
+
-webkit-box-orient: vertical;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
display: -webkit-box;
|
|
40
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
41
|
+
`,f=e.div`
|
|
26
42
|
font-family: Inter;
|
|
27
|
-
color: ${
|
|
28
|
-
font-weight: ${
|
|
29
|
-
font-size: ${o(
|
|
30
|
-
line-height: ${o(
|
|
31
|
-
|
|
43
|
+
color: ${e=>e.color||i.text.primary};
|
|
44
|
+
font-weight: ${t.display.fontWeight};
|
|
45
|
+
font-size: ${o(t.display.fontSize)};
|
|
46
|
+
line-height: ${o(t.display.lineHeight)};
|
|
47
|
+
-webkit-box-orient: vertical;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
display: -webkit-box;
|
|
50
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
51
|
+
`,b=e.div`
|
|
32
52
|
font-family: Inter;
|
|
33
|
-
color: ${
|
|
34
|
-
font-weight: ${
|
|
35
|
-
font-size: ${o(
|
|
36
|
-
line-height: ${o(
|
|
37
|
-
|
|
53
|
+
color: ${e=>e.color||i.text.primary};
|
|
54
|
+
font-weight: ${t.bodyPrimary.fontWeight};
|
|
55
|
+
font-size: ${o(t.bodyLarge.fontSize)};
|
|
56
|
+
line-height: ${o(t.bodyLarge.lineHeight)};
|
|
57
|
+
-webkit-box-orient: vertical;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
display: -webkit-box;
|
|
60
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
61
|
+
`,d=e.div`
|
|
38
62
|
font-family: Inter;
|
|
39
|
-
color: ${
|
|
40
|
-
font-weight: ${
|
|
41
|
-
font-size: ${o(
|
|
42
|
-
line-height: ${o(
|
|
43
|
-
|
|
63
|
+
color: ${e=>e.color||i.text.primary};
|
|
64
|
+
font-weight: ${t.bodyPrimary.fontWeight};
|
|
65
|
+
font-size: ${o(t.bodyPrimary.fontSize)};
|
|
66
|
+
line-height: ${o(t.bodyPrimary.lineHeight)};
|
|
67
|
+
-webkit-box-orient: vertical;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
display: -webkit-box;
|
|
70
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
71
|
+
`,h=e.div`
|
|
44
72
|
font-family: Inter;
|
|
45
|
-
color: ${
|
|
46
|
-
font-weight: ${
|
|
47
|
-
font-size: ${o(
|
|
48
|
-
line-height: ${o(
|
|
49
|
-
|
|
73
|
+
color: ${i.content.primary};
|
|
74
|
+
font-weight: ${t.bodySecondary.fontWeight};
|
|
75
|
+
font-size: ${o(t.bodySecondary.fontSize)};
|
|
76
|
+
line-height: ${o(t.bodySecondary.lineHeight)};
|
|
77
|
+
-webkit-box-orient: vertical;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
display: -webkit-box;
|
|
80
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
81
|
+
`,c=e(d)`
|
|
50
82
|
text-decoration: underline;
|
|
51
|
-
color: ${
|
|
52
|
-
text-decoration-color: ${
|
|
83
|
+
color: ${i.content.brand};
|
|
84
|
+
text-decoration-color: ${i.content.brand};
|
|
53
85
|
cursor: pointer;
|
|
54
|
-
`,
|
|
86
|
+
`,g=e(h)`
|
|
55
87
|
text-decoration: underline;
|
|
56
|
-
color: ${
|
|
57
|
-
text-decoration-color: ${
|
|
88
|
+
color: ${i.content.brand};
|
|
89
|
+
text-decoration-color: ${i.content.brand};
|
|
58
90
|
cursor: pointer;
|
|
59
|
-
|
|
91
|
+
`,$=e.div`
|
|
60
92
|
font-family: Inter;
|
|
61
|
-
color: ${
|
|
62
|
-
font-weight: ${
|
|
63
|
-
font-size: ${o(
|
|
64
|
-
line-height: ${o(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
93
|
+
color: ${e=>e.color||i.text.primary};
|
|
94
|
+
font-weight: ${t.caption.fontWeight};
|
|
95
|
+
font-size: ${o(t.caption.fontSize)};
|
|
96
|
+
line-height: ${o(t.caption.lineHeight)};
|
|
97
|
+
-webkit-box-orient: vertical;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
display: -webkit-box;
|
|
100
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
101
|
+
`,m=e.div`
|
|
102
|
+
color: ${e=>e.color||i.text.primary};
|
|
103
|
+
font-weight: ${t.tiny.fontWeight};
|
|
104
|
+
font-size: ${o(t.tiny.fontSize)};
|
|
105
|
+
line-height: ${o(t.tiny.lineHeight)};
|
|
106
|
+
-webkit-box-orient: vertical;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
display: -webkit-box;
|
|
109
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
110
|
+
`,w=e.div`
|
|
71
111
|
font-family: Inter;
|
|
72
|
-
color: ${
|
|
73
|
-
font-weight: ${
|
|
74
|
-
font-size: ${o(
|
|
75
|
-
line-height: ${o(
|
|
76
|
-
|
|
112
|
+
color: ${e=>e.color||i.text.primary};
|
|
113
|
+
font-weight: ${t.buttonLarge.fontWeight};
|
|
114
|
+
font-size: ${o(t.buttonLarge.fontSize)};
|
|
115
|
+
line-height: ${o(t.buttonLarge.lineHeight)};
|
|
116
|
+
-webkit-box-orient: vertical;
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
display: -webkit-box;
|
|
119
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
120
|
+
`,y=e.div`
|
|
77
121
|
font-family: Inter;
|
|
78
|
-
color: ${
|
|
79
|
-
font-weight: ${
|
|
80
|
-
font-size: ${o(
|
|
81
|
-
line-height: ${o(
|
|
82
|
-
|
|
122
|
+
color: ${e=>e.color||i.text.primary};
|
|
123
|
+
font-weight: ${t.buttonRegular.fontWeight};
|
|
124
|
+
font-size: ${o(t.buttonRegular.fontSize)};
|
|
125
|
+
line-height: ${o(t.buttonRegular.lineHeight)};
|
|
126
|
+
-webkit-box-orient: vertical;
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
display: -webkit-box;
|
|
129
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
130
|
+
`,p=e.div`
|
|
83
131
|
font-family: Inter;
|
|
84
|
-
color: ${
|
|
85
|
-
font-weight: ${
|
|
86
|
-
font-size: ${o(
|
|
87
|
-
line-height: ${o(
|
|
88
|
-
|
|
132
|
+
color: ${e=>e.color||i.text.primary};
|
|
133
|
+
font-weight: ${t.subHeading.fontWeight};
|
|
134
|
+
font-size: ${o(t.subHeading.fontSize)};
|
|
135
|
+
line-height: ${o(t.subHeading.lineHeight)};
|
|
136
|
+
-webkit-box-orient: vertical;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
display: -webkit-box;
|
|
139
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
140
|
+
`,s=e.div`
|
|
89
141
|
font-family: Inter;
|
|
90
|
-
color: ${
|
|
91
|
-
font-weight: ${
|
|
92
|
-
font-size: ${o(
|
|
93
|
-
line-height: ${o(
|
|
94
|
-
|
|
142
|
+
color: ${e=>e.color||i.text.primary};
|
|
143
|
+
font-weight: ${t.bodyRegular.fontWeight};
|
|
144
|
+
font-size: ${o(t.bodyRegular.fontSize)};
|
|
145
|
+
line-height: ${o(t.bodyRegular.lineHeight)};
|
|
146
|
+
-webkit-box-orient: vertical;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
display: -webkit-box;
|
|
149
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
150
|
+
`,x=e.div`
|
|
95
151
|
font-family: Inter;
|
|
96
|
-
color: ${
|
|
97
|
-
font-weight: ${
|
|
98
|
-
font-size: ${o(
|
|
99
|
-
line-height: ${o(
|
|
100
|
-
|
|
152
|
+
color: ${i.text.primary};
|
|
153
|
+
font-weight: ${t.caption.fontWeight};
|
|
154
|
+
font-size: ${o(t.caption.fontSize)};
|
|
155
|
+
line-height: ${o(t.caption.lineHeight)};
|
|
156
|
+
-webkit-box-orient: vertical;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
display: -webkit-box;
|
|
159
|
+
-webkit-line-clamp: ${e=>e.numberOfLines};
|
|
160
|
+
`;export{$ as BodyCaption,b as BodyLarge,d as BodyPrimary,c as BodyPrimaryLink,s as BodyRegular,h as BodySecondary,g as BodySecondaryLink,m as BodyTiny,w as ButtonLarge,y as ButtonRegular,x as Caption,f as Display,p as SubHeading,n as TitleLarge,r as TitleMedium,l as TitleRegular,a as TitleSmall};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as l,useRef as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as l,useRef as s}from"react";import{ZeroState as n}from"../../../zeroState/ZeroState.js";import{useOutside as i}from"../../../../hooks/useOutside.js";import{iterateOnOptions as r}from"../utils/iterationOnOptions.js";import{Description as c}from"./description/Description.js";import{FreeFormMenu as u}from"./menu/FreeFormMenu.js";import{MenuList as a}from"./menu/MenuList.js";import{SelectAllMenu as p}from"./menu/SelectAllMenu.js";import d from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as m,MenuListContainer as f}from"./OpennedDropdown.styled.js";import{SearchBox as h}from"./searchbox/SearchBox.js";import{SearchZeroState as b}from"./searchbox/SearchZeroState.js";const g=304,j=290,S=S=>{let{options:v,isSearchable:w,isMultiSelect:O,width:y,allowFreeForm:x,height:C,onClose:F,onSelect:L}=S;const[M,D]=o(null!=v?v:[]);l((()=>{D(v)}),[v]);const[A,B]=o(null!=y?y:j),[H,Z]=o(""),[k,z]=o(null),E=s(null);i(E,(()=>{z(null),null==F||F()}));const I=null!=C?C:g,N="number"==typeof I?w&&O?I-96:w&&!O||!w&&O?I-48:I:I;function T(e){if(O){const t=r(M,{selected:e.selected},(t=>t.value===e.value));D([...t])}else null==L||L(e)}l((()=>{const e=null!=y?y:j;if(null===k)B(e);else if("number"==typeof e)B(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));B(t)}}),[k]);const W=[],q=M.map((e=>{var t;if(H){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(H.toLowerCase()))&&(W.push(!H||e.label===H),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(H.toLowerCase()))?(W.push(!H||e.label===H),e):null}return e})).filter((e=>null!==e)),G=!!w&&H&&0===q.length;return e(m,Object.assign({ref:E,style:{width:A}},{children:[e("div",Object.assign({style:{width:k?"50%":"100%",display:"flex",flexDirection:"column"}},{children:[!!w&&t(h,{onSearch:function(e){Z(e)}}),q.length||H?e(f,Object.assign({minHeight:I,maxHeight:N},{children:[!!O&&!G&&t(p,{options:M,onSelect:function(e){if("selectAll"===e){const e=r(M,{selected:!0},(e=>{var t;return H?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(H.toLowerCase()))&&!e.disabled:!e.disabled}));D([...e])}else if("notSelected"===e){const e=r(M,{selected:!1},(e=>!e.disabled));D([...e])}}}),!x&&G&&t(b,{searchedString:H}),x&&(G||!!W.length&&W.every((e=>!1===e)))&&t(u,{isMultiSelect:O,onSelect:function(e){if(!O)return void T({label:H,value:H,isFreeForm:!0,selected:!0});const t=M.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===H&&t.value===H?e:t.selected})));e&&(t.some((e=>e.label===H&&e.value===H))||t.unshift({label:H,value:H,isFreeForm:!0,selected:!0})),D([...t])},searchedString:H}),t(a,{onSelect:T,showDescription:function(e,t){z(e&&t?{title:e,description:t}:null)},isMultiSelect:O,options:q})]})):t("div",Object.assign({style:{height:I,display:"flex"}},{children:t(n,{title:"No options passed",subTitle:"Sorry we could not find any options to show"})})),!!O&&!(!q.length&&!H)&&t(d,{onClear:function(){const e=r(M,{selected:!1});D([...e])},onApply:function(){const e=[];M.forEach((t=>{if(t.options){const o=t.options.filter((e=>!0===e.selected));e.push(Object.assign(Object.assign({},t),{options:[...o]}))}else t.selected&&e.push(Object.assign({},t))})),null==L||L([...e])},list:M})]})),!!k&&t(c,{title:k.title,description:k.description})]}))};export{S as OpenedDropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,Fragment as o}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as r,Fragment as o}from"react/jsx-runtime";import{useState as t}from"react";import{Input as e}from"../../../../input/Input.js";import{InputStyleContext as n}from"../../../../input/context/InputStyleProvider.js";import{COLORS as i}from"../../../../../constants/Theme.js";import s from"../../../../../assets/icons/cross.svg.js";import c from"../../../../../assets/icons/search.svg.js";const p=p=>{let{onSearch:m}=p;const[a,h]=t(""),[d,l]=t(!1);return r(n.Provider,Object.assign({value:{InputWrapper:{borderRadius:0,border:0,borderBottom:"1px solid "+i.stroke.primary,padding:"14px 16px"},IconHolder:{marginLeft:0},input:{marginLeft:4,minHeight:"100%"}}},{children:r(e,{placeholder:"Search",leftIcon:{icon:()=>r(c,{width:24,height:24,color:i.content.placeholder})},rightIcon:{icon:()=>a?r(s,{onClick:()=>{l(!0),m("")},width:24,height:24,color:i.content.placeholder}):r(o,{})},reset:d,onChangeText:r=>{l(!1),h(r),m(r)}})}))};export{p as SearchBox};
|