@bikdotai/bik-component-library 0.0.146 → 0.0.147

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.
@@ -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 e=require("@emotion/styled/base"),I=require("react/jsx-runtime"),d=require("react"),g=require("../../../../dropdown/Dropdown.js");require("../../../../dropdown/DropdownPopover/index.js"),require("../../../../zeroState/ZeroState.js"),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 l=require("../../../../input/Input.js"),c=require("../../../../input/context/InputStyleProvider.js");require("../../../../dropdown/MenuItem/MenuItem.js");var n=require("../../InputLoader.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const u=o(e).default("div","production"===process.env.NODE_ENV?{target:"e18hgh550"}:{target:"e18hgh550",label:"Container"})("production"===process.env.NODE_ENV?{name:"180p6fo",styles:"display:flex;flex-direction:row;gap:12px"}:{name:"180p6fo",styles:"display:flex;flex-direction:row;gap:12px",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3V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SB2b2lkIDAgPyB2b2lkIDAgOiBvbkNoYW5nZShbdGV4dCwgdGltZV0pIH0pLCBfanN4KERyb3Bkb3duLCB7IGRpc2FibGVkOiBkaXNhYmxlZCwgcGxhY2VIb2xkZXI6IFwiVGltZVwiLCB3aWR0aDogXCIxMDhweFwiLCBzaXplOiBcInNtYWxsXCIsIG9wdGlvbnM6IG9wdGlvbnMsIG9uU2VsZWN0OiAob3B0aW9uKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlID09PSBudWxsIHx8IG9uQ2hhbmdlID09PSB2b2lkIDAgPyB2b2lkIDAgOiBvbkNoYW5nZShbbnVtLCBvcHRpb24udmFsdWVdKTtcclxuICAgICAgICAgICAgICAgICAgICB9IH0pXSB9KSB9KSkpO1xyXG59O1xyXG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgcmVhY3QvZGlzcGxheS1uYW1lXHJcbmV4cG9ydCBkZWZhdWx0IChwcm9wcykgPT4gX2pzeChJblRoZUxhc3QsIE9iamVjdC5hc3NpZ24oe30sIHByb3BzKSk7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUluVGhlTGFzdC5qcy5tYXAiXX0= */",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)."}}),s=[{label:"day(s)",value:"days"},{label:"minute(s)",value:"minutes"},{label:"hour(s)",value:"hours"}],i=e=>{let{val:o,onChange:i,errors:t,isLoading:C,disabled:b}=e;var r,p;const[A,B]=d.useState(s),a=null!==(r=null==o?void 0:o[1])&&void 0!==r?r:"days",y=null!==(p=null==o?void 0:o[0])&&void 0!==p?p:"1";return d.useEffect((()=>{var e;const I=null!==(e=null==o?void 0:o[1])&&void 0!==e?e:"days";B((e=>e.map((e=>Object.assign(Object.assign({},e),{selected:I===e.value})))))}),[o]),d.useEffect((()=>{var e;if(void 0===(null==o?void 0:o[0])){const I=null!==(e=null==o?void 0:o[1])&&void 0!==e?e:"days";null==i||i(["1",I])}}),[]),C?I.jsx("div",Object.assign({style:{width:200}},{children:I.jsx(n.default,{containerStyle:{padding:"5px 8px"}})})):I.jsx(c.InputStyleContext.Provider,Object.assign({value:{InputWrapper:{width:104}}},{children:I.jsxs(u,{children:[I.jsx(l.Input,{type:"number",variant:"small",state:b?"disabled":"none",errorMessage:null==t?void 0:t.val,value:y,onChangeText:e=>null==i?void 0:i([e,a])}),I.jsx(g.Dropdown,{disabled:b,placeHolder:"Time",width:"108px",size:"small",options:A,onSelect:e=>{null==i||i([y,e.value])}})]})}))};exports.default=e=>I.jsx(i,Object.assign({},e));
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../../../utils/unCamelCase.js"),n=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/MultiselectDropdownFreeText.js"),C=require("./Components/NoInput.js"),m=require("./Components/NumberTime.js"),j=require("./Components/SingleDate.js"),q=require("./Components/SingleselectDropdownFreeText.js"),v=require("./Components/StringSingleValue.js"),f=require("./Components/TwoDate.js"),S=require("./Components/TwoNumberInputsSeperatedByAnd.js"),I=require("./Connector.styled.js");const P={FreeText:u.default,IntegerPositiveSingle:p.default,IntegerSingleValue:c.default,StringSingleValue:v.default,MultiselectDropdownFreeText:g.default,SingleselectDropdownFreeText:q.default,NoInput:C.default,SingleDate:j.default,TwoNumberInputsSeperatedByAnd:S.default,FrequencyIntegerPositiveSingle:a.default,TwoDate:f.default,NumberTime:m.default,PostIgPicker:d.PostIgPicker,ReelIgPicker:d.ReelIgPicker,StoryIgPicker:d.StoryIgPicker,EmojiPicker:s.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}=s;var v,f,S;const[y,T]=r.useState(null),[x,b]=r.useState(!1),w=o.ConnectorHelper.getConnectorType(d).map((e=>({selected:e===p,value:e,label:t.unCamelCaseWithFirstUppercase(e)})));function D(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];b(!0);const t=o.ConnectorHelper.getConnectorComponent(d,e.value);void 0!==t?d===i.QueryBuilderConnectorType.frequency&&"IntegerPositiveSingle"===t?T("FrequencyIntegerPositiveSingle"):T(t):T(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(I.Container,{children:[e.jsx("div",{children:!(null===(v=null===n.disableOperatorDropdown||void 0===n.disableOperatorDropdown?void 0:n.disableOperatorDropdown[d])||void 0===v?void 0:v[p])&&e.jsx(l.default,{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===(S=P[y])||void 0===S?void 0:S.call(P,{disabled:q,val:C,onChange:g,extra:m,errors:j,isLoading:u}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../../../utils/unCamelCase.js"),n=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"),f=require("./Components/StringSingleValue.js"),S=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:f.default,MultiselectDropdownFreeText:C.default,SingleselectDropdownFreeText:v.default,NoInput:m.default,SingleDate:q.default,TwoNumberInputsSeperatedByAnd:I.default,FrequencyIntegerPositiveSingle:a.default,TwoDate:S.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}=s;var v,f,S;const[I,y]=r.useState(null),[x,b]=r.useState(!1),w=o.ConnectorHelper.getConnectorType(d).map((e=>({selected:e===p,value:e,label:t.unCamelCaseWithFirstUppercase(e)})));function D(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];b(!0);const t=o.ConnectorHelper.getConnectorComponent(d,e.value);void 0!==t?d===i.QueryBuilderConnectorType.frequency&&"IntegerPositiveSingle"===t?y("FrequencyIntegerPositiveSingle"):y(t):y(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===(v=null===n.disableOperatorDropdown||void 0===n.disableOperatorDropdown?void 0:n.disableOperatorDropdown[d])||void 0===v?void 0:v[p])&&e.jsx(l.default,{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!==I&&!x&&(null===(S=T[I])||void 0===S?void 0:S.call(T,{disabled:q,val:C,onChange:g,extra:m,errors:j,isLoading:u}))]})};
@@ -19,7 +19,8 @@ export declare enum CONNECTOR_VALUE_COMPONENT_TYPES {
19
19
  PostIgPicker = "PostIgPicker",
20
20
  ReelIgPicker = "ReelIgPicker",
21
21
  StoryIgPicker = "StoryIgPicker",
22
- EmojiPicker = "EmojiPicker"
22
+ EmojiPicker = "EmojiPicker",
23
+ InTheLast = "InTheLast"
23
24
  }
24
25
  export declare const INTEGER_OPERATORS_COMPONENT: {
25
26
  is: 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";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},r={[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},t={[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.NumberTime},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},i={[O.ANY_AD_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},s={[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]:s,[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]:r,[e.QueryBuilderConnectorType.anyAd]:i,[e.QueryBuilderConnectorType.specificAd]:t,[e.QueryBuilderConnectorType.iceBreaker]:R};exports.AD_STRING_OPERATORS_COMPONENT=t,exports.ANY_AD_OPERATORS_COMPONENT=i,exports.ANY_IG_OPERATORS_COMPONENT=A,exports.BOOLEAN_OPERATORS_COMPONENT=s,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=r,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";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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/chevronLeft.svg.js"),t=require("../../assets/icons/chevronRight.svg.js"),n=require("./TablePagination.styled.js"),a=require("../../constants/Theme.js"),i=require("../dropdown/Dropdown.js"),r=require("../TypographyStyle.js");exports.TablePagination=o=>{let{pageNumber:l,pageSize:c,totalRows:d,updatePageNumber:g,updatePageSize:h,hidePageSizeOptions:j}=o;const p=a.DEFAULT_THEME.colorsV2,u=(l-1)*c+1,y=(l-1)*c+c,b=Math.ceil(d/c),x=1==b;let v=[];v=b>=5?l===b?[l-4,l-3,l-2,l-1,l]:1===l?[l,l+1,l+2,l+3,l+4]:2===l?[l-1,l,l+1,l+2,l+3]:l===b-1?[l-3,l-2,l-1,l,l+1]:[l-2,l-1,l,l+1,l+2]:Array.from({length:b},((e,s)=>s+1));const m=[{label:"5 rows per page",value:"5",selected:5===c},{label:"10 rows per page",value:"10",selected:10===c},{label:"20 rows per page",value:"20",selected:20===c}];return e.jsxs(n.StyledTablePaginationContainer,{children:[!j&&e.jsx("div",{children:e.jsx(i.Dropdown,{size:"small",options:m,onSelect:h,width:"162px"})}),e.jsxs("div",Object.assign({className:"paging__container"},{children:[!j&&d&&e.jsxs(r.BodySecondary,Object.assign({style:{color:p.content.placeholder,marginRight:8}},{children:["Showing ",u,"-",y>d?d:y," of"," ",d," results"]})),e.jsxs("div",Object.assign({className:"pages__buttons-container"},{children:[!x&&e.jsx(n.StyledPagingContainer,Object.assign({active:!1,onClick:()=>{1!==l&&g(Math.max(l-1,1))},disabled:1===l},{children:e.jsx(s.default,{color:p.content.secondary,height:14,width:14})})),v.map((s=>e.jsx(n.StyledPagingContainer,Object.assign({active:s==l,onClick:()=>g(s),style:{display:1==s&&d<=c?"none":"flex"}},{children:e.jsx(r.BodySecondary,Object.assign({style:{color:s==l?p.content.primaryInverse:p.content.secondary}},{children:s}))}),s))),!x&&e.jsx(n.StyledPagingContainer,Object.assign({isLast:!0,active:!1,onClick:()=>{l!==b&&g(Math.min(l+1,b))},disabled:l===b},{children:e.jsx(t.default,{color:p.content.secondary,height:14,width:14})}))]}))]}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/chevronLeft.svg.js"),t=require("../../assets/icons/chevronRight.svg.js"),n=require("./TablePagination.styled.js"),a=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),r=require("../dropdown/Dropdown.js");exports.TablePagination=o=>{let{pageNumber:l,pageSize:c,totalRows:d,updatePageNumber:g,updatePageSize:h,hidePageSizeOptions:j}=o;const p=a.DEFAULT_THEME.colorsV2,u=(l-1)*c+1,y=(l-1)*c+c,b=Math.ceil(d/c),x=1==b;let v=[];v=b>=5?l===b?[l-4,l-3,l-2,l-1,l]:1===l?[l,l+1,l+2,l+3,l+4]:2===l?[l-1,l,l+1,l+2,l+3]:l===b-1?[l-3,l-2,l-1,l,l+1]:[l-2,l-1,l,l+1,l+2]:Array.from({length:b},((e,s)=>s+1));const m=[{label:"5 rows per page",value:"5",selected:5===c},{label:"10 rows per page",value:"10",selected:10===c},{label:"20 rows per page",value:"20",selected:20===c}];return e.jsxs(n.StyledTablePaginationContainer,{children:[!j&&e.jsx("div",{children:e.jsx(r.Dropdown,{size:"small",options:m,onSelect:h,width:"162px"})}),e.jsxs("div",Object.assign({className:"paging__container"},{children:[!j&&d&&e.jsxs(i.BodySecondary,Object.assign({style:{color:p.content.placeholder,marginRight:8}},{children:["Showing ",u,"-",y>d?d:y," of"," ",d," results"]})),e.jsxs("div",Object.assign({className:"pages__buttons-container"},{children:[!x&&e.jsx(n.StyledPagingContainer,Object.assign({active:!1,onClick:()=>{1!==l&&g(Math.max(l-1,1))},disabled:1===l},{children:e.jsx(s.default,{color:p.content.secondary,height:14,width:14})})),v.map((s=>e.jsx(n.StyledPagingContainer,Object.assign({active:s==l,onClick:()=>g(s),style:{display:1==s&&d<=c?"none":"flex"}},{children:e.jsx(i.BodySecondary,Object.assign({style:{color:s==l?p.content.primaryInverse:p.content.secondary}},{children:s}))}),s))),!x&&e.jsx(n.StyledPagingContainer,Object.assign({isLast:!0,active:!1,onClick:()=>{l!==b&&g(Math.min(l+1,b))},disabled:l===b},{children:e.jsx(t.default,{color:p.content.secondary,height:14,width:14})}))]}))]}))]})};
@@ -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"),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((()=>{q(b)}),[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,E="number"==typeof Z?S&&O?Z-96:S&&!O||!S&&O?Z-48:Z:Z;function k(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"}},{children:[!!S&&e.jsx(d.SearchBox,{onSearch:function(e){F(e)}}),P.length||L?e.jsxs(a.MenuListContainer,Object.assign({minHeight:Z,maxHeight:E},{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 k({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:k,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
+ "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 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((()=>{q(b.sort((e=>e.selected?-1:1)))}),[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,E="number"==typeof Z?S&&O?Z-96:S&&!O||!S&&O?Z-48:Z:Z;function k(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: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"}},{children:[!!S&&e.jsx(d.SearchBox,{onSearch:function(e){F(e)}}),P.length||L?e.jsxs(a.MenuListContainer,Object.assign({minHeight:Z,maxHeight:E},{children:[!!O&&!_&&e.jsx(u.SelectAllMenu,{options:y,onSelect:function(e){if("selectAll"===e){const e=l.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=l.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 k({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:k,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=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})]}))};
@@ -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
+ import I from"@emotion/styled/base";import{jsx as g,jsxs as d}from"react/jsx-runtime";import{useState as l,useEffect as o}from"react";import{Dropdown as e}from"../../../../dropdown/Dropdown.js";import"../../../../dropdown/DropdownPopover/index.js";import"../../../../zeroState/ZeroState.js";import"../../../../TypographyStyle.js";import"../../../../../constants/Theme.js";import"../../../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../../../checkBox/CheckBox.styled.js";import"../../../../list-item/ListItem.js";import"../../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js";import"../../../../button/Button.js";import"../../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as c}from"../../../../input/Input.js";import{InputStyleContext as n}from"../../../../input/context/InputStyleProvider.js";import"../../../../dropdown/MenuItem/MenuItem.js";import i from"../../InputLoader.js";const t=I("div","production"===process.env.NODE_ENV?{target:"e18hgh550"}:{target:"e18hgh550",label:"Container"})("production"===process.env.NODE_ENV?{name:"180p6fo",styles:"display:flex;flex-direction:row;gap:12px"}:{name:"180p6fo",styles:"display:flex;flex-direction:row;gap:12px",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkluVGhlTGFzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTzZCIiwiZmlsZSI6IkluVGhlTGFzdC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cyB9IGZyb20gXCJyZWFjdC9qc3gtcnVudGltZVwiO1xyXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IERyb3Bkb3duIH0gZnJvbSBcIi4uLy4uLy4uLy4uL2Ryb3Bkb3duXCI7XHJcbmltcG9ydCB7IElucHV0IH0gZnJvbSBcIi4uLy4uLy4uLy4uL2lucHV0XCI7XHJcbmltcG9ydCB7IElucHV0U3R5bGVDb250ZXh0IH0gZnJvbSBcIi4uLy4uLy4uLy4uL2lucHV0L2NvbnRleHQvSW5wdXRTdHlsZVByb3ZpZGVyXCI7XHJcbmltcG9ydCBJbnB1dExvYWRlciBmcm9tICcuLi8uLi9JbnB1dExvYWRlcic7XHJcbmNvbnN0IENvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRmbGV4LWRpcmVjdGlvbjogcm93O1xuXHRnYXA6IDEycHg7XG5gO1xyXG5jb25zdCB0aW1lT3B0aW9ucyA9IFtcclxuICAgIHtcclxuICAgICAgICBsYWJlbDogJ2RheShzKScsXHJcbiAgICAgICAgdmFsdWU6ICdkYXlzJyxcclxuICAgIH0sXHJcbiAgICB7I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GVycm9ycyA9PT0gbnVsbCB8fCBlcnJvcnMgPT09IHZvaWQgMCA/IHZvaWQgMCA6IGVycm9ycy52YWwsIHZhbHVlOiBudW0sIG9uQ2hhbmdlVGV4dDogKHRleHQpID0+IG9uQ2hhbmdlID09PSBudWxsIHx8IG9uQ2hhbmdlID09PSB2b2lkIDAgPyB2b2lkIDAgOiBvbkNoYW5nZShbdGV4dCwgdGltZV0pIH0pLCBfanN4KERyb3Bkb3duLCB7IGRpc2FibGVkOiBkaXNhYmxlZCwgcGxhY2VIb2xkZXI6IFwiVGltZVwiLCB3aWR0aDogXCIxMDhweFwiLCBzaXplOiBcInNtYWxsXCIsIG9wdGlvbnM6IG9wdGlvbnMsIG9uU2VsZWN0OiAob3B0aW9uKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlID09PSBudWxsIHx8IG9uQ2hhbmdlID09PSB2b2lkIDAgPyB2b2lkIDAgOiBvbkNoYW5nZShbbnVtLCBvcHRpb24udmFsdWVdKTtcclxuICAgICAgICAgICAgICAgICAgICB9IH0pXSB9KSB9KSkpO1xyXG59O1xyXG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgcmVhY3QvZGlzcGxheS1uYW1lXHJcbmV4cG9ydCBkZWZhdWx0IChwcm9wcykgPT4gX2pzeChJblRoZUxhc3QsIE9iamVjdC5hc3NpZ24oe30sIHByb3BzKSk7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUluVGhlTGFzdC5qcy5tYXAiXX0= */",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)."}}),s=[{label:"day(s)",value:"days"},{label:"minute(s)",value:"minutes"},{label:"hour(s)",value:"hours"}],C=I=>{let{val:C,onChange:b,errors:p,isLoading:u,disabled:m}=I;var A,B;const[a,y]=l(s),r=null!==(A=null==C?void 0:C[1])&&void 0!==A?A:"days",G=null!==(B=null==C?void 0:C[0])&&void 0!==B?B:"1";return o((()=>{var I;const g=null!==(I=null==C?void 0:C[1])&&void 0!==I?I:"days";y((I=>I.map((I=>Object.assign(Object.assign({},I),{selected:g===I.value})))))}),[C]),o((()=>{var I;if(void 0===(null==C?void 0:C[0])){const g=null!==(I=null==C?void 0:C[1])&&void 0!==I?I:"days";null==b||b(["1",g])}}),[]),u?g("div",Object.assign({style:{width:200}},{children:g(i,{containerStyle:{padding:"5px 8px"}})})):g(n.Provider,Object.assign({value:{InputWrapper:{width:104}}},{children:d(t,{children:[g(c,{type:"number",variant:"small",state:m?"disabled":"none",errorMessage:null==p?void 0:p.val,value:G,onChangeText:I=>null==b?void 0:b([I,r])}),g(e,{disabled:m,placeHolder:"Time",width:"108px",size:"small",options:a,onSelect:I=>{null==b||b([G,I.value])}})]})}))};var b=I=>g(C,Object.assign({},I));export{b as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useEffect as n}from"react";import{unCamelCaseWithFirstUppercase as r}from"../../../../utils/unCamelCase.js";import{disableOperatorDropdown as i}from"../../constants/connectorPosition.js";import{ConnectorHelper as l}from"../../helpers/Connector.helper.js";import{QueryBuilderConnectorType as s}from"../../types/QueryBuilder.type.js";import m from"../DropdownWrapper.js";import p from"./Components/EmojiPicker.js";import a from"./Components/FreeText.js";import u from"./Components/FrequencyIntegerPositiveSingle.js";import{PostIgPicker as d,ReelIgPicker as c,StoryIgPicker as g}from"./Components/IgPicker.js";import f from"./Components/IntegerPositiveSingle.js";import C from"./Components/IntegerSingleValue.js";import j from"./Components/MultiselectDropdownFreeText.js";import v from"./Components/NoInput.js";import S from"./Components/NumberTime.js";import I from"./Components/SingleDate.js";import T from"./Components/SingleselectDropdownFreeText.js";import P from"./Components/StringSingleValue.js";import y from"./Components/TwoDate.js";import x from"./Components/TwoNumberInputsSeperatedByAnd.js";import{Container as w}from"./Connector.styled.js";const D={FreeText:a,IntegerPositiveSingle:f,IntegerSingleValue:C,StringSingleValue:P,MultiselectDropdownFreeText:j,SingleselectDropdownFreeText:T,NoInput:v,SingleDate:I,TwoNumberInputsSeperatedByAnd:x,FrequencyIntegerPositiveSingle:u,TwoDate:y,NumberTime:S,PostIgPicker:d,ReelIgPicker:c,StoryIgPicker:g,EmojiPicker:p},b=p=>{let{isLoading:a,noDefault:u,connectorType:d,defaultConnector:c,onOperatorChange:g,onValueChange:f,connectorVal:C,extra:j,errors:v,disabled:S}=p;var I,T,P;const[y,x]=t(null),[b,h]=t(!1),F=l.getConnectorType(d).map((e=>({selected:e===c,value:e,label:r(e)})));function k(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];h(!0);const t=l.getConnectorComponent(d,e.value);void 0!==t?d===s.frequency&&"IntegerPositiveSingle"===t?x("FrequencyIntegerPositiveSingle"):x(t):x(null),o||g(e.value),setTimeout((()=>{h(!1)}),5)}return n((()=>{u||(c?k({value:c,label:c},!0):(null==F?void 0:F[0])&&k(F[0]))}),[c]),e(w,{children:[o("div",{children:!(null===(I=null==i?void 0:i[d])||void 0===I?void 0:I[c])&&o(m,{disabled:S,width:"200px",isLoading:b,options:F,defaultOption:null===(T=F.filter((e=>e.selected)))||void 0===T?void 0:T[0],onSelect:k})}),null!==y&&!b&&(null===(P=D[y])||void 0===P?void 0:P.call(D,{disabled:S,val:C,onChange:f,extra:j,errors:v,isLoading:a}))]})};export{b as default};
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useEffect as n}from"react";import{unCamelCaseWithFirstUppercase as r}from"../../../../utils/unCamelCase.js";import{disableOperatorDropdown as i}from"../../constants/connectorPosition.js";import{ConnectorHelper as l}from"../../helpers/Connector.helper.js";import{QueryBuilderConnectorType as s}from"../../types/QueryBuilder.type.js";import m from"../DropdownWrapper.js";import p from"./Components/EmojiPicker.js";import a from"./Components/FreeText.js";import u from"./Components/FrequencyIntegerPositiveSingle.js";import{PostIgPicker as d,ReelIgPicker as c,StoryIgPicker as g}from"./Components/IgPicker.js";import f from"./Components/IntegerPositiveSingle.js";import C from"./Components/IntegerSingleValue.js";import j from"./Components/InTheLast.js";import v from"./Components/MultiselectDropdownFreeText.js";import S from"./Components/NoInput.js";import I from"./Components/NumberTime.js";import T from"./Components/SingleDate.js";import P from"./Components/SingleselectDropdownFreeText.js";import y from"./Components/StringSingleValue.js";import h from"./Components/TwoDate.js";import x from"./Components/TwoNumberInputsSeperatedByAnd.js";import{Container as w}from"./Connector.styled.js";const D={FreeText:a,IntegerPositiveSingle:f,IntegerSingleValue:C,StringSingleValue:y,MultiselectDropdownFreeText:v,SingleselectDropdownFreeText:P,NoInput:S,SingleDate:T,TwoNumberInputsSeperatedByAnd:x,FrequencyIntegerPositiveSingle:u,TwoDate:h,NumberTime:I,PostIgPicker:d,ReelIgPicker:c,StoryIgPicker:g,EmojiPicker:p,InTheLast:j},b=p=>{let{isLoading:a,noDefault:u,connectorType:d,defaultConnector:c,onOperatorChange:g,onValueChange:f,connectorVal:C,extra:j,errors:v,disabled:S}=p;var I,T,P;const[y,h]=t(null),[x,b]=t(!1),F=l.getConnectorType(d).map((e=>({selected:e===c,value:e,label:r(e)})));function k(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];b(!0);const t=l.getConnectorComponent(d,e.value);void 0!==t?d===s.frequency&&"IntegerPositiveSingle"===t?h("FrequencyIntegerPositiveSingle"):h(t):h(null),o||g(e.value),setTimeout((()=>{b(!1)}),5)}return n((()=>{u||(c?k({value:c,label:c},!0):(null==F?void 0:F[0])&&k(F[0]))}),[c]),e(w,{children:[o("div",{children:!(null===(I=null==i?void 0:i[d])||void 0===I?void 0:I[c])&&o(m,{disabled:S,width:"200px",isLoading:x,options:F,defaultOption:null===(T=F.filter((e=>e.selected)))||void 0===T?void 0:T[0],onSelect:k})}),null!==y&&!x&&(null===(P=D[y])||void 0===P?void 0:P.call(D,{disabled:S,val:C,onChange:f,extra:j,errors:v,isLoading:a}))]})};export{b as default};
@@ -19,7 +19,8 @@ export declare enum CONNECTOR_VALUE_COMPONENT_TYPES {
19
19
  PostIgPicker = "PostIgPicker",
20
20
  ReelIgPicker = "ReelIgPicker",
21
21
  StoryIgPicker = "StoryIgPicker",
22
- EmojiPicker = "EmojiPicker"
22
+ EmojiPicker = "EmojiPicker",
23
+ InTheLast = "InTheLast"
23
24
  }
24
25
  export declare const INTEGER_OPERATORS_COMPONENT: {
25
26
  is: CONNECTOR_VALUE_COMPONENT_TYPES;
@@ -1 +1 @@
1
- import{QueryBuilderConnectorType as e}from"../types/QueryBuilder.type.js";import{BOOLEAN_OPERATORS as t,STRING_OPERATORS as i,INTEGER_OPERATORS as n,FREQUENCY_OPERATORS as r,DATE_OPERATORS as o,SPECIFIC_IG_OPERATORS as s,ANY_IG_OPERATORS as l,REACTION_OPERATORS as a,IG_STRING_OPERATORS as g,ANY_AD_OPERATORS as c,AD_STRING_OPERATORS as u,ICE_BREAKER_OPERATORS as p}from"../types/QueryBuilderOperator.type.js";const I={[e.boolean]:t,[e.string]:i,[e.integer]:n,[e.frequency]:r,[e.date]:o,[e.specificPost]:s,[e.specificReel]:s,[e.specificStory]:s,[e.anyIg]:l,[e.reaction]:a,[e.activityString]:g,[e.anyAd]:c,[e.specificAd]:u,[e.iceBreaker]:p};var T;!function(e){e.FreeText="FreeText",e.NoInput="NoInput",e.IntegerSingleValue="IntegerSingleValue",e.StringSingleValue="StringSingleValue",e.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",e.MultiselectDropdownFreeText="MultiselectDropdownFreeText",e.SingleselectDropdownFreeText="SingleselectDropdownFreeText",e.SingleDate="SingleDate",e.TwoDate="TwoDate",e.IntegerPositiveSingle="IntegerPositiveSingle",e.NumberTime="NumberTime",e.PostIgPicker="PostIgPicker",e.ReelIgPicker="ReelIgPicker",e.StoryIgPicker="StoryIgPicker",e.EmojiPicker="EmojiPicker"}(T||(T={}));const S={[n.is]:T.FreeText,[n.isNot]:T.FreeText,[n.exists]:T.NoInput,[n.doesntExist]:T.NoInput,[n.lessThan]:T.IntegerSingleValue,[n.lessThanOrEqualTo]:T.IntegerSingleValue,[n.greaterThan]:T.IntegerSingleValue,[n.greaterThanOrEqualTo]:T.IntegerSingleValue},d={[i.is]:T.MultiselectDropdownFreeText,[i.isNot]:T.MultiselectDropdownFreeText,[i.contains]:T.FreeText,[i.doesntContain]:T.FreeText,[i.startsWith]:T.FreeText,[i.endsWith]:T.FreeText,[i.exists]:T.NoInput,[i.doesntExist]:T.NoInput},x={[g.any]:T.NoInput,[g.is]:T.MultiselectDropdownFreeText,[g.contains]:T.FreeText,[g.startsWith]:T.FreeText,[g.endsWith]:T.FreeText},y={[u.is]:T.SingleselectDropdownFreeText},N={[p.is]:T.MultiselectDropdownFreeText},P={[a.contains]:T.EmojiPicker},F={[o.on]:T.SingleDate,[o.notOn]:T.SingleDate,[o.inBetween]:T.TwoDate,[o.notInBetween]:T.TwoDate,[o.before]:T.SingleDate,[o.after]:T.SingleDate,[o.today]:T.NoInput,[o.yesterday]:T.NoInput,[o["last week"]]:T.NoInput,[o["last month"]]:T.NoInput,[o["last quarter"]]:T.NoInput,[o["in the last"]]:T.NumberTime},D={[s.in]:T.PostIgPicker},w={[s.in]:T.ReelIgPicker},m={[s.in]:T.StoryIgPicker},f={[l.in]:T.NoInput},k={[c.in]:T.NoInput},h={[t.isTrue]:T.NoInput,[t.isFalse]:T.NoInput,[t.exists]:T.NoInput,[t.doesntExist]:T.NoInput},b={[r.exactly]:T.IntegerPositiveSingle,[r.atleast]:T.IntegerPositiveSingle,[r.atMost]:T.IntegerPositiveSingle},v={[e.boolean]:h,[e.string]:d,[e.integer]:S,[e.frequency]:b,[e.date]:F,[e.specificPost]:D,[e.specificReel]:w,[e.specificStory]:m,[e.anyIg]:f,[e.reaction]:P,[e.activityString]:x,[e.anyAd]:k,[e.specificAd]:y,[e.iceBreaker]:N};export{y as AD_STRING_OPERATORS_COMPONENT,k as ANY_AD_OPERATORS_COMPONENT,f as ANY_IG_OPERATORS_COMPONENT,h as BOOLEAN_OPERATORS_COMPONENT,v as CONNECTOR_TYPE_TO_COMPONENT_MAP,I as CONNECTOR_TYPE_TO_OPERATORS,T as CONNECTOR_VALUE_COMPONENT_TYPES,F as DATE_OPERATORS_COMPONENT,b as FREQUENCY_OPERATORS_COMPONENT,N as ICE_BREAKER_OPERATORS_COMPONENT,x as IG_STRING_OPERATORS_COMPONENT,S as INTEGER_OPERATORS_COMPONENT,P as REACTION_OPERATORS_COMPONENT,D as SPECIFIC_IG_POST_OPERATORS_COMPONENT,w as SPECIFIC_IG_REEL_OPERATORS_COMPONENT,m as SPECIFIC_IG_STORY_OPERATORS_COMPONENT,d as STRING_OPERATORS_COMPONENT};
1
+ import{QueryBuilderConnectorType as e}from"../types/QueryBuilder.type.js";import{BOOLEAN_OPERATORS as t,STRING_OPERATORS as n,INTEGER_OPERATORS as i,FREQUENCY_OPERATORS as r,DATE_OPERATORS as o,SPECIFIC_IG_OPERATORS as s,ANY_IG_OPERATORS as a,REACTION_OPERATORS as l,IG_STRING_OPERATORS as g,ANY_AD_OPERATORS as c,AD_STRING_OPERATORS as u,ICE_BREAKER_OPERATORS as p}from"../types/QueryBuilderOperator.type.js";const I={[e.boolean]:t,[e.string]:n,[e.integer]:i,[e.frequency]:r,[e.date]:o,[e.specificPost]:s,[e.specificReel]:s,[e.specificStory]:s,[e.anyIg]:a,[e.reaction]:l,[e.activityString]:g,[e.anyAd]:c,[e.specificAd]:u,[e.iceBreaker]:p};var T;!function(e){e.FreeText="FreeText",e.NoInput="NoInput",e.IntegerSingleValue="IntegerSingleValue",e.StringSingleValue="StringSingleValue",e.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",e.MultiselectDropdownFreeText="MultiselectDropdownFreeText",e.SingleselectDropdownFreeText="SingleselectDropdownFreeText",e.SingleDate="SingleDate",e.TwoDate="TwoDate",e.IntegerPositiveSingle="IntegerPositiveSingle",e.NumberTime="NumberTime",e.PostIgPicker="PostIgPicker",e.ReelIgPicker="ReelIgPicker",e.StoryIgPicker="StoryIgPicker",e.EmojiPicker="EmojiPicker",e.InTheLast="InTheLast"}(T||(T={}));const S={[i.is]:T.FreeText,[i.isNot]:T.FreeText,[i.exists]:T.NoInput,[i.doesntExist]:T.NoInput,[i.lessThan]:T.IntegerSingleValue,[i.lessThanOrEqualTo]:T.IntegerSingleValue,[i.greaterThan]:T.IntegerSingleValue,[i.greaterThanOrEqualTo]:T.IntegerSingleValue},d={[n.is]:T.MultiselectDropdownFreeText,[n.isNot]:T.MultiselectDropdownFreeText,[n.contains]:T.FreeText,[n.doesntContain]:T.FreeText,[n.startsWith]:T.FreeText,[n.endsWith]:T.FreeText,[n.exists]:T.NoInput,[n.doesntExist]:T.NoInput},x={[g.any]:T.NoInput,[g.is]:T.MultiselectDropdownFreeText,[g.contains]:T.FreeText,[g.startsWith]:T.FreeText,[g.endsWith]:T.FreeText},y={[u.is]:T.SingleselectDropdownFreeText},N={[p.is]:T.MultiselectDropdownFreeText},P={[l.contains]:T.EmojiPicker},F={[o.on]:T.SingleDate,[o.notOn]:T.SingleDate,[o.inBetween]:T.TwoDate,[o.notInBetween]:T.TwoDate,[o.before]:T.SingleDate,[o.after]:T.SingleDate,[o.today]:T.NoInput,[o.yesterday]:T.NoInput,[o["last week"]]:T.NoInput,[o["last month"]]:T.NoInput,[o["last quarter"]]:T.NoInput,[o["in the last"]]:T.InTheLast},D={[s.in]:T.PostIgPicker},w={[s.in]:T.ReelIgPicker},f={[s.in]:T.StoryIgPicker},k={[a.in]:T.NoInput},m={[c.in]:T.NoInput},h={[t.isTrue]:T.NoInput,[t.isFalse]:T.NoInput,[t.exists]:T.NoInput,[t.doesntExist]:T.NoInput},v={[r.exactly]:T.IntegerPositiveSingle,[r.atleast]:T.IntegerPositiveSingle,[r.atMost]:T.IntegerPositiveSingle},B={[e.boolean]:h,[e.string]:d,[e.integer]:S,[e.frequency]:v,[e.date]:F,[e.specificPost]:D,[e.specificReel]:w,[e.specificStory]:f,[e.anyIg]:k,[e.reaction]:P,[e.activityString]:x,[e.anyAd]:m,[e.specificAd]:y,[e.iceBreaker]:N};export{y as AD_STRING_OPERATORS_COMPONENT,m as ANY_AD_OPERATORS_COMPONENT,k as ANY_IG_OPERATORS_COMPONENT,h as BOOLEAN_OPERATORS_COMPONENT,B as CONNECTOR_TYPE_TO_COMPONENT_MAP,I as CONNECTOR_TYPE_TO_OPERATORS,T as CONNECTOR_VALUE_COMPONENT_TYPES,F as DATE_OPERATORS_COMPONENT,v as FREQUENCY_OPERATORS_COMPONENT,N as ICE_BREAKER_OPERATORS_COMPONENT,x as IG_STRING_OPERATORS_COMPONENT,S as INTEGER_OPERATORS_COMPONENT,P as REACTION_OPERATORS_COMPONENT,D as SPECIFIC_IG_POST_OPERATORS_COMPONENT,w as SPECIFIC_IG_REEL_OPERATORS_COMPONENT,f as SPECIFIC_IG_STORY_OPERATORS_COMPONENT,d as STRING_OPERATORS_COMPONENT};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import s from"../../assets/icons/chevronLeft.svg.js";import o from"../../assets/icons/chevronRight.svg.js";import{StyledTablePaginationContainer as i,StyledPagingContainer as n}from"./TablePagination.styled.js";import{DEFAULT_THEME as a}from"../../constants/Theme.js";import{Dropdown as r}from"../dropdown/Dropdown.js";import{BodySecondary as c}from"../TypographyStyle.js";const l=l=>{let{pageNumber:d,pageSize:p,totalRows:g,updatePageNumber:h,updatePageSize:m,hidePageSizeOptions:b}=l;const j=a.colorsV2,v=(d-1)*p+1,y=(d-1)*p+p,f=Math.ceil(g/p),u=1==f;let w=[];w=f>=5?d===f?[d-4,d-3,d-2,d-1,d]:1===d?[d,d+1,d+2,d+3,d+4]:2===d?[d-1,d,d+1,d+2,d+3]:d===f-1?[d-3,d-2,d-1,d,d+1]:[d-2,d-1,d,d+1,d+2]:Array.from({length:f},((e,t)=>t+1));return e(i,{children:[!b&&t("div",{children:t(r,{size:"small",options:[{label:"5 rows per page",value:"5",selected:5===p},{label:"10 rows per page",value:"10",selected:10===p},{label:"20 rows per page",value:"20",selected:20===p}],onSelect:m,width:"162px"})}),e("div",Object.assign({className:"paging__container"},{children:[!b&&g&&e(c,Object.assign({style:{color:j.content.placeholder,marginRight:8}},{children:["Showing ",v,"-",y>g?g:y," of"," ",g," results"]})),e("div",Object.assign({className:"pages__buttons-container"},{children:[!u&&t(n,Object.assign({active:!1,onClick:()=>{1!==d&&h(Math.max(d-1,1))},disabled:1===d},{children:t(s,{color:j.content.secondary,height:14,width:14})})),w.map((e=>t(n,Object.assign({active:e==d,onClick:()=>h(e),style:{display:1==e&&g<=p?"none":"flex"}},{children:t(c,Object.assign({style:{color:e==d?j.content.primaryInverse:j.content.secondary}},{children:e}))}),e))),!u&&t(n,Object.assign({isLast:!0,active:!1,onClick:()=>{d!==f&&h(Math.min(d+1,f))},disabled:d===f},{children:t(o,{color:j.content.secondary,height:14,width:14})}))]}))]}))]})};export{l as TablePagination};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import s from"../../assets/icons/chevronLeft.svg.js";import o from"../../assets/icons/chevronRight.svg.js";import{StyledTablePaginationContainer as i,StyledPagingContainer as n}from"./TablePagination.styled.js";import{DEFAULT_THEME as a}from"../../constants/Theme.js";import{BodySecondary as r}from"../TypographyStyle.js";import{Dropdown as c}from"../dropdown/Dropdown.js";const l=l=>{let{pageNumber:d,pageSize:p,totalRows:g,updatePageNumber:h,updatePageSize:m,hidePageSizeOptions:b}=l;const j=a.colorsV2,v=(d-1)*p+1,y=(d-1)*p+p,f=Math.ceil(g/p),u=1==f;let w=[];w=f>=5?d===f?[d-4,d-3,d-2,d-1,d]:1===d?[d,d+1,d+2,d+3,d+4]:2===d?[d-1,d,d+1,d+2,d+3]:d===f-1?[d-3,d-2,d-1,d,d+1]:[d-2,d-1,d,d+1,d+2]:Array.from({length:f},((e,t)=>t+1));return e(i,{children:[!b&&t("div",{children:t(c,{size:"small",options:[{label:"5 rows per page",value:"5",selected:5===p},{label:"10 rows per page",value:"10",selected:10===p},{label:"20 rows per page",value:"20",selected:20===p}],onSelect:m,width:"162px"})}),e("div",Object.assign({className:"paging__container"},{children:[!b&&g&&e(r,Object.assign({style:{color:j.content.placeholder,marginRight:8}},{children:["Showing ",v,"-",y>g?g:y," of"," ",g," results"]})),e("div",Object.assign({className:"pages__buttons-container"},{children:[!u&&t(n,Object.assign({active:!1,onClick:()=>{1!==d&&h(Math.max(d-1,1))},disabled:1===d},{children:t(s,{color:j.content.secondary,height:14,width:14})})),w.map((e=>t(n,Object.assign({active:e==d,onClick:()=>h(e),style:{display:1==e&&g<=p?"none":"flex"}},{children:t(r,Object.assign({style:{color:e==d?j.content.primaryInverse:j.content.secondary}},{children:e}))}),e))),!u&&t(n,Object.assign({isLast:!0,active:!1,onClick:()=>{d!==f&&h(Math.min(d+1,f))},disabled:d===f},{children:t(o,{color:j.content.secondary,height:14,width:14})}))]}))]}))]})};export{l as TablePagination};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as l,useRef as s}from"react";import{ZeroState as i}from"../../../zeroState/ZeroState.js";import{useOutside as n}from"../../../../hooks/useOutside.js";import{iterateOnOptions as r}from"../utils/iterationOnOptions.js";import{Description as c}from"./description/Description.js";import{FreeFormMenu as a}from"./menu/FreeFormMenu.js";import{MenuList as u}from"./menu/MenuList.js";import{SelectAllMenu as d}from"./menu/SelectAllMenu.js";import p from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as f,MenuListContainer as m}from"./OpennedDropdown.styled.js";import{SearchBox as h}from"./searchbox/SearchBox.js";import{SearchZeroState as b}from"./searchbox/SearchZeroState.js";const g=304,j=290,v=v=>{let{options:S,isSearchable:w,isMultiSelect:y,width:O,allowFreeForm:x,height:C,onClose:L,onSelect:F}=v;const[M,D]=o(null!=S?S:[]);l((()=>{D(S)}),[S]);const[A,B]=o(null!=O?O:j),[k,H]=o(""),[Z,q]=o(null),z=s(null);n(z,(()=>{q(null),null==L||L()}));const E=null!=C?C:g,I="number"==typeof E?w&&y?E-96:w&&!y||!w&&y?E-48:E:E;function K(e){if(y){const t=r(M,{selected:e.selected},(t=>t.value===e.value));D([...t])}else null==F||F(e)}l((()=>{const e=null!=O?O:j;if(null===Z)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)}}),[Z]);const N=[],P=M.map((e=>{var t,o;if(k){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(k.toLowerCase()))&&(N.push(!k||e.label===k),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(k.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(k.toLowerCase()))?(N.push(!k||e.label===k),e):null}return e})).filter((e=>null!==e)),T=!!w&&k&&0===P.length;return e(f,Object.assign({ref:z,style:{width:A}},{children:[e("div",Object.assign({style:{width:Z?"50%":"100%",display:"flex",flexDirection:"column"}},{children:[!!w&&t(h,{onSearch:function(e){H(e)}}),P.length||k?e(m,Object.assign({minHeight:E,maxHeight:I},{children:[!!y&&!T&&t(d,{options:M,onSelect:function(e){if("selectAll"===e){const e=r(M,{selected:!0},(e=>{var t;return k?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(k.toLowerCase()))&&!e.disabled:!e.disabled}));D([...e])}else if("notSelected"===e){const e=r(M,{selected:!1},(e=>!e.disabled));D([...e])}}}),!x&&T&&t(b,{searchedString:k}),x&&(T||!!N.length&&N.every((e=>!1===e)))&&t(a,{isMultiSelect:y,onSelect:function(e){if(!y)return void K({label:k,value:k,isFreeForm:!0,selected:!0});const t=M.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===k&&t.value===k?e:t.selected})));e&&(t.some((e=>e.label===k&&e.value===k))||t.unshift({label:k,value:k,isFreeForm:!0,selected:!0})),D([...t])},searchedString:k}),t(u,{onSelect:K,showDescription:function(e,t){q(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:P})]})):t("div",Object.assign({style:{height:E,display:"flex"}},{children:t(i,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})),!!y&&!(!P.length&&!k)&&t(p,{onClear:function(){const e=r(M,{selected:!1});D([...e])},onApply:function(){const e=[];M.forEach((t=>{if(t.options){const o=t.options.filter((e=>!0===e.selected));e.push(Object.assign(Object.assign({},t),{options:[...o]}))}else t.selected&&e.push(Object.assign({},t))})),null==F||F([...e])},list:M})]})),!!Z&&t(c,{title:Z.title,description:Z.description})]}))};export{v as OpenedDropdown};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as l,useRef as s}from"react";import{ZeroState as i}from"../../../zeroState/ZeroState.js";import{useOutside as n}from"../../../../hooks/useOutside.js";import{iterateOnOptions as r}from"../utils/iterationOnOptions.js";import{Description as c}from"./description/Description.js";import{FreeFormMenu as a}from"./menu/FreeFormMenu.js";import{MenuList as u}from"./menu/MenuList.js";import{SelectAllMenu as d}from"./menu/SelectAllMenu.js";import p from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as f,MenuListContainer as m}from"./OpennedDropdown.styled.js";import{SearchBox as h}from"./searchbox/SearchBox.js";import{SearchZeroState as b}from"./searchbox/SearchZeroState.js";const g=304,j=290,v=v=>{let{options:S,isSearchable:w,isMultiSelect:y,width:O,allowFreeForm:x,height:C,onClose:L,onSelect:F}=v;const[M,D]=o(null!=S?S:[]);l((()=>{D(S.sort((e=>e.selected?-1:1)))}),[S]);const[A,B]=o(null!=O?O:j),[k,H]=o(""),[Z,q]=o(null),z=s(null);n(z,(()=>{q(null),null==L||L()}));const E=null!=C?C:g,I="number"==typeof E?w&&y?E-96:w&&!y||!w&&y?E-48:E:E;function K(e){if(y){const t=r(M,{selected:e.selected},(t=>t.value===e.value));D([...t])}else null==F||F(e)}l((()=>{const e=null!=O?O:j;if(null===Z)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)}}),[Z]);const N=[],P=M.map((e=>{var t,o;if(k){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(k.toLowerCase()))&&(N.push(!k||e.label===k),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(k.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(k.toLowerCase()))?(N.push(!k||e.label===k),e):null}return e})).filter((e=>null!==e)),T=!!w&&k&&0===P.length;return e(f,Object.assign({ref:z,style:{width:A}},{children:[e("div",Object.assign({style:{width:Z?"50%":"100%",display:"flex",flexDirection:"column"}},{children:[!!w&&t(h,{onSearch:function(e){H(e)}}),P.length||k?e(m,Object.assign({minHeight:E,maxHeight:I},{children:[!!y&&!T&&t(d,{options:M,onSelect:function(e){if("selectAll"===e){const e=r(M,{selected:!0},(e=>{var t;return k?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(k.toLowerCase()))&&!e.disabled:!e.disabled}));D([...e])}else if("notSelected"===e){const e=r(M,{selected:!1},(e=>!e.disabled));D([...e])}}}),!x&&T&&t(b,{searchedString:k}),x&&(T||!!N.length&&N.every((e=>!1===e)))&&t(a,{isMultiSelect:y,onSelect:function(e){if(!y)return void K({label:k,value:k,isFreeForm:!0,selected:!0});const t=M.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===k&&t.value===k?e:t.selected})));e&&(t.some((e=>e.label===k&&e.value===k))||t.unshift({label:k,value:k,isFreeForm:!0,selected:!0})),D([...t])},searchedString:k}),t(u,{onSelect:K,showDescription:function(e,t){q(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:P})]})):t("div",Object.assign({style:{height:E,display:"flex"}},{children:t(i,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})),!!y&&!(!P.length&&!k)&&t(p,{onClear:function(){const e=r(M,{selected:!1});D([...e])},onApply:function(){const e=[];M.forEach((t=>{if(t.options){const o=t.options.filter((e=>!0===e.selected));e.push(Object.assign(Object.assign({},t),{options:[...o]}))}else t.selected&&e.push(Object.assign({},t))})),null==F||F([...e])},list:M})]})),!!Z&&t(c,{title:Z.title,description:Z.description})]}))};export{v as OpenedDropdown};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.146",
3
+ "version": "0.0.147",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",