@bikdotai/bik-component-library 0.0.246-0 → 0.0.246
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/constants/connector.d.ts +4 -2
- package/dist/cjs/components/QueryBuilder/constants/connector.js +1 -1
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +4 -2
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.js +1 -1
- package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
- package/dist/esm/components/QueryBuilder/constants/connector.d.ts +4 -2
- package/dist/esm/components/QueryBuilder/constants/connector.js +1 -1
- package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +4 -2
- package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.js +1 -1
- package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
- package/package.json +1 -1
|
@@ -45,8 +45,10 @@ export declare const STRING_OPERATORS_COMPONENT: {
|
|
|
45
45
|
doesntExist: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
46
46
|
};
|
|
47
47
|
export declare const STRING_RESTRICTED_OPERATORS_COMPONENT: {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
contains: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
49
|
+
doesntContain: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
50
|
+
startsWith: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
51
|
+
endsWith: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
50
52
|
exists: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
51
53
|
doesntExist: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
52
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var O=require("../types/QueryBuilder.type.js"),e=require("../types/QueryBuilderOperator.type.js");const E={[O.QueryBuilderConnectorType.boolean]:e.BOOLEAN_OPERATORS,[O.QueryBuilderConnectorType.string]:e.STRING_OPERATORS,[O.QueryBuilderConnectorType.string_restricted]:e.STRING_RESTRICTED_OPERATORS,[O.QueryBuilderConnectorType.integer]:e.INTEGER_OPERATORS,[O.QueryBuilderConnectorType.frequency]:e.FREQUENCY_OPERATORS,[O.QueryBuilderConnectorType.date]:e.DATE_OPERATORS,[O.QueryBuilderConnectorType.specificPost]:e.SPECIFIC_IG_OPERATORS,[O.QueryBuilderConnectorType.specificReel]:e.SPECIFIC_IG_OPERATORS,[O.QueryBuilderConnectorType.specificStory]:e.SPECIFIC_IG_OPERATORS,[O.QueryBuilderConnectorType.anyIg]:e.ANY_IG_OPERATORS,[O.QueryBuilderConnectorType.reaction]:e.REACTION_OPERATORS,[O.QueryBuilderConnectorType.activityString]:e.IG_STRING_OPERATORS,[O.QueryBuilderConnectorType.anyAd]:e.ANY_AD_OPERATORS,[O.QueryBuilderConnectorType.specificAd]:e.AD_STRING_OPERATORS,[O.QueryBuilderConnectorType.iceBreaker]:e.ICE_BREAKER_OPERATORS};var T;exports.CONNECTOR_VALUE_COMPONENT_TYPES=void 0,(T=exports.CONNECTOR_VALUE_COMPONENT_TYPES||(exports.CONNECTOR_VALUE_COMPONENT_TYPES={})).FreeText="FreeText",T.NoInput="NoInput",T.IntegerSingleValue="IntegerSingleValue",T.StringSingleValue="StringSingleValue",T.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",T.MultiselectDropdownFreeText="MultiselectDropdownFreeText",T.SingleselectDropdownFreeText="SingleselectDropdownFreeText",T.SingleDate="SingleDate",T.TwoDate="TwoDate",T.IntegerPositiveSingle="IntegerPositiveSingle",T.NumberTime="NumberTime",T.PostIgPicker="PostIgPicker",T.ReelIgPicker="ReelIgPicker",T.StoryIgPicker="StoryIgPicker",T.EmojiPicker="EmojiPicker",T.InTheLast="InTheLast",T.InTwoLast="InTwoLast",T.InTheLastAgo="InTheLastAgo";const N={[e.INTEGER_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.INTEGER_OPERATORS.isNot]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.INTEGER_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.INTEGER_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.INTEGER_OPERATORS.lessThan]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[e.INTEGER_OPERATORS.lessThanOrEqualTo]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[e.INTEGER_OPERATORS.greaterThan]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[e.INTEGER_OPERATORS.greaterThanOrEqualTo]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue},_={[e.STRING_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[e.STRING_OPERATORS.isNot]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[e.STRING_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.doesntContain]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.startsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.endsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.STRING_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},t={[e.STRING_OPERATORS.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var O=require("../types/QueryBuilder.type.js"),e=require("../types/QueryBuilderOperator.type.js");const E={[O.QueryBuilderConnectorType.boolean]:e.BOOLEAN_OPERATORS,[O.QueryBuilderConnectorType.string]:e.STRING_OPERATORS,[O.QueryBuilderConnectorType.string_restricted]:e.STRING_RESTRICTED_OPERATORS,[O.QueryBuilderConnectorType.integer]:e.INTEGER_OPERATORS,[O.QueryBuilderConnectorType.frequency]:e.FREQUENCY_OPERATORS,[O.QueryBuilderConnectorType.date]:e.DATE_OPERATORS,[O.QueryBuilderConnectorType.specificPost]:e.SPECIFIC_IG_OPERATORS,[O.QueryBuilderConnectorType.specificReel]:e.SPECIFIC_IG_OPERATORS,[O.QueryBuilderConnectorType.specificStory]:e.SPECIFIC_IG_OPERATORS,[O.QueryBuilderConnectorType.anyIg]:e.ANY_IG_OPERATORS,[O.QueryBuilderConnectorType.reaction]:e.REACTION_OPERATORS,[O.QueryBuilderConnectorType.activityString]:e.IG_STRING_OPERATORS,[O.QueryBuilderConnectorType.anyAd]:e.ANY_AD_OPERATORS,[O.QueryBuilderConnectorType.specificAd]:e.AD_STRING_OPERATORS,[O.QueryBuilderConnectorType.iceBreaker]:e.ICE_BREAKER_OPERATORS};var T;exports.CONNECTOR_VALUE_COMPONENT_TYPES=void 0,(T=exports.CONNECTOR_VALUE_COMPONENT_TYPES||(exports.CONNECTOR_VALUE_COMPONENT_TYPES={})).FreeText="FreeText",T.NoInput="NoInput",T.IntegerSingleValue="IntegerSingleValue",T.StringSingleValue="StringSingleValue",T.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",T.MultiselectDropdownFreeText="MultiselectDropdownFreeText",T.SingleselectDropdownFreeText="SingleselectDropdownFreeText",T.SingleDate="SingleDate",T.TwoDate="TwoDate",T.IntegerPositiveSingle="IntegerPositiveSingle",T.NumberTime="NumberTime",T.PostIgPicker="PostIgPicker",T.ReelIgPicker="ReelIgPicker",T.StoryIgPicker="StoryIgPicker",T.EmojiPicker="EmojiPicker",T.InTheLast="InTheLast",T.InTwoLast="InTwoLast",T.InTheLastAgo="InTheLastAgo";const N={[e.INTEGER_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.INTEGER_OPERATORS.isNot]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.INTEGER_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.INTEGER_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.INTEGER_OPERATORS.lessThan]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[e.INTEGER_OPERATORS.lessThanOrEqualTo]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[e.INTEGER_OPERATORS.greaterThan]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[e.INTEGER_OPERATORS.greaterThanOrEqualTo]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue},_={[e.STRING_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[e.STRING_OPERATORS.isNot]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[e.STRING_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.doesntContain]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.startsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.endsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.STRING_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},t={[e.STRING_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.doesntContain]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.startsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.endsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.STRING_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.STRING_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},R={[e.IG_STRING_OPERATORS.any]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.IG_STRING_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[e.IG_STRING_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.IG_STRING_OPERATORS.startsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[e.IG_STRING_OPERATORS.endsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText},r={[e.AD_STRING_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleselectDropdownFreeText},C={[e.ICE_BREAKER_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText},P={[e.REACTION_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.EmojiPicker},o={[e.DATE_OPERATORS.today]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS.yesterday]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["last 30 days"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["last 7 days"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["this month"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["this week"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["last month"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["last week"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS.exactly]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTheLastAgo,[e.DATE_OPERATORS["in the last"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTheLast,[e.DATE_OPERATORS["in between last"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTwoLast,[e.DATE_OPERATORS.on]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleDate,[e.DATE_OPERATORS.notOn]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleDate,[e.DATE_OPERATORS.inBetween]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.TwoDate,[e.DATE_OPERATORS.notInBetween]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.TwoDate,[e.DATE_OPERATORS.before]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleDate,[e.DATE_OPERATORS.after]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleDate,[e.DATE_OPERATORS.today]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS.yesterday]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["last week"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["last month"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["last quarter"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.DATE_OPERATORS["in the last"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTheLast},S={[e.SPECIFIC_IG_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.PostIgPicker},A={[e.SPECIFIC_IG_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.ReelIgPicker},n={[e.SPECIFIC_IG_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.StoryIgPicker},s={[e.ANY_IG_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},p={[e.ANY_AD_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},i={[e.BOOLEAN_OPERATORS.isTrue]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.BOOLEAN_OPERATORS.isFalse]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.BOOLEAN_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[e.BOOLEAN_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},I={[e.FREQUENCY_OPERATORS.exactly]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerPositiveSingle,[e.FREQUENCY_OPERATORS.atleast]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerPositiveSingle,[e.FREQUENCY_OPERATORS.atMost]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerPositiveSingle},u={[O.QueryBuilderConnectorType.boolean]:i,[O.QueryBuilderConnectorType.string]:_,[O.QueryBuilderConnectorType.integer]:N,[O.QueryBuilderConnectorType.frequency]:I,[O.QueryBuilderConnectorType.date]:o,[O.QueryBuilderConnectorType.specificPost]:S,[O.QueryBuilderConnectorType.specificReel]:A,[O.QueryBuilderConnectorType.specificStory]:n,[O.QueryBuilderConnectorType.anyIg]:s,[O.QueryBuilderConnectorType.reaction]:P,[O.QueryBuilderConnectorType.activityString]:R,[O.QueryBuilderConnectorType.anyAd]:p,[O.QueryBuilderConnectorType.specificAd]:r,[O.QueryBuilderConnectorType.iceBreaker]:C,[O.QueryBuilderConnectorType.string_restricted]:t};exports.AD_STRING_OPERATORS_COMPONENT=r,exports.ANY_AD_OPERATORS_COMPONENT=p,exports.ANY_IG_OPERATORS_COMPONENT=s,exports.BOOLEAN_OPERATORS_COMPONENT=i,exports.CONNECTOR_TYPE_TO_COMPONENT_MAP=u,exports.CONNECTOR_TYPE_TO_OPERATORS=E,exports.DATE_OPERATORS_COMPONENT=o,exports.FREQUENCY_OPERATORS_COMPONENT=I,exports.ICE_BREAKER_OPERATORS_COMPONENT=C,exports.IG_STRING_OPERATORS_COMPONENT=R,exports.INTEGER_OPERATORS_COMPONENT=N,exports.REACTION_OPERATORS_COMPONENT=P,exports.SPECIFIC_IG_POST_OPERATORS_COMPONENT=S,exports.SPECIFIC_IG_REEL_OPERATORS_COMPONENT=A,exports.SPECIFIC_IG_STORY_OPERATORS_COMPONENT=n,exports.STRING_OPERATORS_COMPONENT=_,exports.STRING_RESTRICTED_OPERATORS_COMPONENT=t;
|
|
@@ -23,8 +23,10 @@ export declare enum STRING_OPERATORS {
|
|
|
23
23
|
doesntExist = "doesntExist"
|
|
24
24
|
}
|
|
25
25
|
export declare enum STRING_RESTRICTED_OPERATORS {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
contains = "contains",
|
|
27
|
+
doesntContain = "doesntContain",
|
|
28
|
+
startsWith = "startsWith",
|
|
29
|
+
endsWith = "endsWith",
|
|
28
30
|
exists = "exists",
|
|
29
31
|
doesntExist = "doesntExist"
|
|
30
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,
|
|
1
|
+
"use strict";var t,e,s,o,n,i,R,r;Object.defineProperty(exports,"__esModule",{value:!0}),exports.INTEGER_OPERATORS=void 0,(t=exports.INTEGER_OPERATORS||(exports.INTEGER_OPERATORS={})).is="is",t.isNot="isNot",t.exists="exists",t.doesntExist="doesntExist",t.lessThan="lessThan",t.lessThanOrEqualTo="lessThanOrEqualTo",t.greaterThan="greaterThan",t.greaterThanOrEqualTo="greaterThanOrEqualTo",exports.STRING_OPERATORS=void 0,(e=exports.STRING_OPERATORS||(exports.STRING_OPERATORS={})).is="is",e.isNot="isNot",e.contains="contains",e.doesntContain="doesntContain",e.startsWith="startsWith",e.endsWith="endsWith",e.exists="exists",e.doesntExist="doesntExist",exports.STRING_RESTRICTED_OPERATORS=void 0,(s=exports.STRING_RESTRICTED_OPERATORS||(exports.STRING_RESTRICTED_OPERATORS={})).contains="contains",s.doesntContain="doesntContain",s.startsWith="startsWith",s.endsWith="endsWith",s.exists="exists",s.doesntExist="doesntExist",exports.IG_STRING_OPERATORS=void 0,(o=exports.IG_STRING_OPERATORS||(exports.IG_STRING_OPERATORS={})).any="any",o.is="is",o.contains="contains",o.startsWith="startsWith",o.endsWith="endsWith",exports.AD_STRING_OPERATORS=void 0,(exports.AD_STRING_OPERATORS||(exports.AD_STRING_OPERATORS={})).is="is",exports.SPECIFIC_IG_OPERATORS=void 0,(exports.SPECIFIC_IG_OPERATORS||(exports.SPECIFIC_IG_OPERATORS={})).in="in",exports.ICE_BREAKER_OPERATORS=void 0,(exports.ICE_BREAKER_OPERATORS||(exports.ICE_BREAKER_OPERATORS={})).is="is",exports.ANY_IG_OPERATORS=void 0,(exports.ANY_IG_OPERATORS||(exports.ANY_IG_OPERATORS={})).in="in",exports.ANY_AD_OPERATORS=void 0,(exports.ANY_AD_OPERATORS||(exports.ANY_AD_OPERATORS={})).in="in",exports.REACTION_OPERATORS=void 0,(exports.REACTION_OPERATORS||(exports.REACTION_OPERATORS={})).contains="contains",exports.DATE_OPERATORS=void 0,(n=exports.DATE_OPERATORS||(exports.DATE_OPERATORS={})).today="today",n.yesterday="yesterday",n["last 7 days"]="last 7 days",n["last 30 days"]="last 30 days",n["this week"]="this week",n["last week"]="last week",n["this month"]="this month",n["last month"]="last month",n.exactly="exactly",n["not exactly"]="not exactly",n["in the last"]="in the last",n["not in the last"]="not in the last",n["in between last"]="in between last",n["not in between last"]="not in between last",n.on="on",n.notOn="notOn",n.inBetween="inBetween",n.notInBetween="notInBetween",n.before="before",n.after="after",n["last quarter"]="last quarter",exports.BOOLEAN_OPERATORS=void 0,(i=exports.BOOLEAN_OPERATORS||(exports.BOOLEAN_OPERATORS={})).isTrue="isTrue",i.isFalse="isFalse",i.exists="exists",i.doesntExist="doesntExist",exports.FREQUENCY_OPERATORS=void 0,(R=exports.FREQUENCY_OPERATORS||(exports.FREQUENCY_OPERATORS={})).exactly="exactly",R.atleast="atleast",R.atMost="atMost",exports.EVENT_VALUES=void 0,(r=exports.EVENT_VALUES||(exports.EVENT_VALUES={})).FreeText="FreeText",r.NoInput="NoInput",r.IntegerSingleValue="IntegerSingleValue",r.StringSingleValue="StringSingleValue",r.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",r.MultiselectDropdownFreeText="MultiselectDropdownFreeText",r.SingleselectDropdownFreeText="SingleselectDropdownFreeText",r.SingleDate="SingleDate",r.TwoDate="TwoDate",r.IntegerPositiveSingle="IntegerPositiveSingle",r.NumberTime="NumberTime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("./type.js");require("../dropdown/DropdownPopover/index.js");var i=require("../dropdown/Dropdown.js");require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js"),r=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("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");var s=require("../modals/styledModal.js"),d=require("../product-picker/ProductPickerModal.js"),a=require("../tag/Tag.js"),u=require("../tooltips/Tooltip.js"),c=require("../../assets/icons/triangle_error.svg.js"),l=require("./DiscountModal.styled.js"),T=require("./DiscountUtils.js"),p=require("./DynamicCoupon/DynamicCoupon.js"),E=require("./StaticCoupon/StaticCoupon.js");exports.DiscountModal=S=>{var C,I,P,_;const[y,O]=t.useState(),[b,D]=t.useState(null!==(C=S.data)&&void 0!==C?C:{isStaticCoupon:!1}),[N,j]=t.useState(!0),[v,U]=t.useState(),[g,m]=t.useState((null===(I=S.data)||void 0===I?void 0:I.minAmount)?o.MIN_PURCHASE_REQUIREMENT.AMOUNT:(null===(P=S.data)||void 0===P?void 0:P.minQuantity)?o.MIN_PURCHASE_REQUIREMENT.QUANTITY:o.MIN_PURCHASE_REQUIREMENT.NA),[q,A]=t.useState([]),[h,x]=t.useState([]),[R,Y]=t.useState(0);t.useEffect((()=>{let e;S.hideProbability||(e=M()),j(T.validateDiscountData(b,g,v,S.hideProbability||!1,e,!!b.isStaticCoupon)),S.hideProbability||M()}),[]),t.useEffect((()=>{let e;S.hideProbability||(e=M()),j(T.validateDiscountData(b,g,v,S.hideProbability||!1,e,!!b.isStaticCoupon))}),[b,R,v,g]),t.useEffect((()=>{var e,t;if(S.products){if(null===(e=S.data)||void 0===e?void 0:e.entitledProductIds){const e=S.products.filter((e=>{var t,o;return null===(o=null===(t=S.data)||void 0===t?void 0:t.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));x(e)}if(null===(t=S.data)||void 0===t?void 0:t.prerequisiteProductIds){const e=S.products.filter((e=>{var t,o;return null===(o=null===(t=S.data)||void 0===t?void 0:t.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));A(e)}}}),[]),t.useEffect((()=>{const e=h.map((e=>parseInt(e.id)));D(Object.assign(Object.assign({},b),{entitledProductIds:e}))}),[h]),t.useEffect((()=>{const e=q.map((e=>parseInt(e.id)));D(Object.assign(Object.assign({},b),{prerequisiteProductIds:e}))}),[q]),t.useEffect((()=>{b.targetType===o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE?U(o.DISCOUNT_TYPES.FREE_SHIPPING):b.targetSelection===o.DISCOUNT_TARGET_SELECTION.ENTITLED?U(o.DISCOUNT_TYPES.BUY_X_GET_Y):b.valueType===o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?U(o.DISCOUNT_TYPES.FIXED_AMOUNT):b.valueType===o.DISCOUNT_VALUE_TYPES.PERCENTAGE&&U(o.DISCOUNT_TYPES.PERCENTAGE)}),[]);const L=[{value:o.DISCOUNT_TYPES.FIXED_AMOUNT,label:"Fixed Amount",selected:v===o.DISCOUNT_TYPES.FIXED_AMOUNT},{value:o.DISCOUNT_TYPES.PERCENTAGE,label:"Percentage",selected:v===o.DISCOUNT_TYPES.PERCENTAGE},{value:o.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:v===o.DISCOUNT_TYPES.BUY_X_GET_Y},{value:o.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:v===o.DISCOUNT_TYPES.FREE_SHIPPING}],M=()=>{if(!S.quadrant||!S.probability)return;const e=[...S.probability];let t=[];e.length>=S.quadrant&&e.splice(S.quadrant-1,1),t=e;const o=t.reduce(((e,t)=>e+t),0)+(b.probability||0);return Y(o),parseFloat(o.toFixed(4))},G=e=>{const t=e.value;U(t),t===o.DISCOUNT_TYPES.FREE_SHIPPING?(A([]),x([]),D(Object.assign(Object.assign({},b),{value:100,targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):t===o.DISCOUNT_TYPES.BUY_X_GET_Y?D(Object.assign(Object.assign({},b),{targetSelection:o.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE})):t===o.DISCOUNT_TYPES.PERCENTAGE?(A([]),x([]),D(Object.assign(Object.assign({},b),{targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):t===o.DISCOUNT_TYPES.FIXED_AMOUNT&&(A([]),x([]),D(Object.assign(Object.assign({},b),{targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0})))};return e.jsxs(s.StyledModal,Object.assign({open:S.isOpen,headingTitle:y?"Select Products":S.title,headingSubtitle:y?void 0:S.subTitle,footerLeftCustomElement:!S.quadrant||S.hideProbability?e.jsx(e.Fragment,{}):R<=1?e.jsx(a.Tag,{theme:"light",tagText:`Current probability sum: ${R}`,type:"white"}):e.jsx(u.Tooltip,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e.jsx("div",{children:e.jsx(a.Tag,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${R}`,type:"negative",LeadingIcon:c.default})})})),headerRightCustomElement:S.allowStaticCoupon||y?void 0:e.jsx(i.Dropdown,{options:L,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{G(e)}}),onClose:S.onClose,footerShadow:!0,primaryButton:y?{buttonType:"primary",onClick:()=>{O(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:N,onClick:()=>{b.isStaticCoupon?S.onSaveClicked({quadrant:b.quadrant,couponCode:b.couponCode,description:b.description,isStaticCoupon:b.isStaticCoupon,probability:b.probability,title:b.title}):S.onSaveClicked(b),D({})}},secondaryButton:y?{buttonType:"tertiaryGray",onClick:()=>{O(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:S.onClose,buttonText:"Close"}},{children:[!y&&e.jsxs(l.StyledDiscountDialogueContainer,{children:[S.allowStaticCoupon&&!y&&e.jsxs(l.CouponTypeContainerStyled,Object.assign({selectedDiv:b.isStaticCoupon?1:2},{children:[e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{D({isStaticCoupon:!0,couponCode:b.couponCode,description:b.description,quadrant:b.quadrant})}},{children:[e.jsx(n.TitleSmall,Object.assign({style:b.isStaticCoupon?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"Static code"})),e.jsx(n.BodyCaption,Object.assign({style:b.isStaticCoupon?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{D(Object.assign(Object.assign({},b),{isStaticCoupon:!1}))}},{children:[e.jsx(n.TitleSmall,Object.assign({style:b.isStaticCoupon?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"Dynamic code"})),e.jsx(n.BodyCaption,Object.assign({style:b.isStaticCoupon?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),b.isStaticCoupon&&!y&&e.jsx(E.default,{discountData:b,setDiscountData:D,hideProbability:S.hideProbability||!1,discountAdminUrl:S.discountAdminUrl}),!b.isStaticCoupon&&!y&&e.jsx(p.default,{currency:S.currency,entitledProducts:h,prerequisiteProducts:q,setEntitledProducts:x,setPrerequisiteProducts:A,discountData:b,productPickerOpen:y,setIsProductPickerOpen:O,setDiscountData:D,selectedCouponType:v,setSelectedCouponType:U,selectedMinimumRequirement:g,setSelectedMinimumRequirement:m,hideProbability:S.hideProbability||!1,hideExpiration:S.hideExpiration||!1,allowStaticCoupon:S.allowStaticCoupon,onChangeCouponType:G})]}),!!y&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsx(d.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(_=S.products)&&void 0!==_?_:[],title:"Select Products",onClose:()=>{O(void 0)},selectedProducts:y===p.DISCOUNT_PRODUCTS.ENTITLED?h:q,setSelectedProducts:y===p.DISCOUNT_PRODUCTS.ENTITLED?x:A,onSearchKeyChange:S.onProductSearch})}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("./type.js");require("../dropdown/DropdownPopover/index.js");var i=require("../dropdown/Dropdown.js");require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js"),r=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("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");var s=require("../modals/styledModal.js"),d=require("../product-picker/ProductPickerModal.js"),a=require("../tag/Tag.js"),u=require("../tooltips/Tooltip.js"),c=require("../../assets/icons/triangle_error.svg.js"),l=require("./DiscountModal.styled.js"),T=require("./DiscountUtils.js"),p=require("./DynamicCoupon/DynamicCoupon.js"),E=require("./StaticCoupon/StaticCoupon.js");exports.DiscountModal=S=>{var C,I,P,_;const[y,O]=t.useState(),[b,D]=t.useState(null!==(C=S.data)&&void 0!==C?C:{isStaticCoupon:!1}),[N,j]=t.useState(!0),[v,U]=t.useState(),[g,m]=t.useState((null===(I=S.data)||void 0===I?void 0:I.minAmount)?o.MIN_PURCHASE_REQUIREMENT.AMOUNT:(null===(P=S.data)||void 0===P?void 0:P.minQuantity)?o.MIN_PURCHASE_REQUIREMENT.QUANTITY:o.MIN_PURCHASE_REQUIREMENT.NA),[q,A]=t.useState([]),[h,x]=t.useState([]),[R,Y]=t.useState(0);t.useEffect((()=>{let e;S.hideProbability||(e=M()),j(T.validateDiscountData(b,g,v,S.hideProbability||!1,e,!!b.isStaticCoupon)),S.hideProbability||M()}),[]),t.useEffect((()=>{let e;S.hideProbability||(e=M()),j(T.validateDiscountData(b,g,v,S.hideProbability||!1,e,!!b.isStaticCoupon))}),[b,R,v,g]),t.useEffect((()=>{var e,t;if(S.products){if(null===(e=S.data)||void 0===e?void 0:e.entitledProductIds){const e=S.products.filter((e=>{var t,o;return null===(o=null===(t=S.data)||void 0===t?void 0:t.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));x(e)}if(null===(t=S.data)||void 0===t?void 0:t.prerequisiteProductIds){const e=S.products.filter((e=>{var t,o;return null===(o=null===(t=S.data)||void 0===t?void 0:t.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));A(e)}}}),[]),t.useEffect((()=>{const e=h.map((e=>parseInt(e.id)));D(Object.assign(Object.assign({},b),{entitledProductIds:e}))}),[h]),t.useEffect((()=>{const e=q.map((e=>parseInt(e.id)));D(Object.assign(Object.assign({},b),{prerequisiteProductIds:e}))}),[q]),t.useEffect((()=>{b.targetType===o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE?U(o.DISCOUNT_TYPES.FREE_SHIPPING):b.targetSelection===o.DISCOUNT_TARGET_SELECTION.ENTITLED?U(o.DISCOUNT_TYPES.BUY_X_GET_Y):b.valueType===o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?U(o.DISCOUNT_TYPES.FIXED_AMOUNT):b.valueType===o.DISCOUNT_VALUE_TYPES.PERCENTAGE&&U(o.DISCOUNT_TYPES.PERCENTAGE)}),[]);const L=[{value:o.DISCOUNT_TYPES.FIXED_AMOUNT,label:"Fixed Amount",selected:v===o.DISCOUNT_TYPES.FIXED_AMOUNT},{value:o.DISCOUNT_TYPES.PERCENTAGE,label:"Percentage",selected:v===o.DISCOUNT_TYPES.PERCENTAGE},{value:o.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:v===o.DISCOUNT_TYPES.BUY_X_GET_Y},{value:o.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:v===o.DISCOUNT_TYPES.FREE_SHIPPING}],M=()=>{if(!S.quadrant||!S.probability)return;const e=[...S.probability];let t=[];e.length>=S.quadrant&&e.splice(S.quadrant-1,1),t=e;const o=t.reduce(((e,t)=>e+t),0)+(b.probability||0);return Y(parseFloat(o.toFixed(4))),parseFloat(o.toFixed(4))},G=e=>{const t=e.value;U(t),t===o.DISCOUNT_TYPES.FREE_SHIPPING?(A([]),x([]),D(Object.assign(Object.assign({},b),{value:100,targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):t===o.DISCOUNT_TYPES.BUY_X_GET_Y?D(Object.assign(Object.assign({},b),{targetSelection:o.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE})):t===o.DISCOUNT_TYPES.PERCENTAGE?(A([]),x([]),D(Object.assign(Object.assign({},b),{targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):t===o.DISCOUNT_TYPES.FIXED_AMOUNT&&(A([]),x([]),D(Object.assign(Object.assign({},b),{targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0})))};return e.jsxs(s.StyledModal,Object.assign({open:S.isOpen,headingTitle:y?"Select Products":S.title,headingSubtitle:y?void 0:S.subTitle,footerLeftCustomElement:!S.quadrant||S.hideProbability?e.jsx(e.Fragment,{}):R<=1?e.jsx(a.Tag,{theme:"light",tagText:`Current probability sum: ${R}`,type:"white"}):e.jsx(u.Tooltip,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e.jsx("div",{children:e.jsx(a.Tag,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${R}`,type:"negative",LeadingIcon:c.default})})})),headerRightCustomElement:S.allowStaticCoupon||y?void 0:e.jsx(i.Dropdown,{options:L,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{G(e)}}),onClose:S.onClose,footerShadow:!0,primaryButton:y?{buttonType:"primary",onClick:()=>{O(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:N,onClick:()=>{b.isStaticCoupon?S.onSaveClicked({quadrant:b.quadrant,couponCode:b.couponCode,description:b.description,isStaticCoupon:b.isStaticCoupon,probability:b.probability,title:b.title}):S.onSaveClicked(b),D({})}},secondaryButton:y?{buttonType:"tertiaryGray",onClick:()=>{O(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:S.onClose,buttonText:"Close"}},{children:[!y&&e.jsxs(l.StyledDiscountDialogueContainer,{children:[S.allowStaticCoupon&&!y&&e.jsxs(l.CouponTypeContainerStyled,Object.assign({selectedDiv:b.isStaticCoupon?1:2},{children:[e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{D({isStaticCoupon:!0,couponCode:b.couponCode,description:b.description,quadrant:b.quadrant})}},{children:[e.jsx(n.TitleSmall,Object.assign({style:b.isStaticCoupon?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"Static code"})),e.jsx(n.BodyCaption,Object.assign({style:b.isStaticCoupon?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{D(Object.assign(Object.assign({},b),{isStaticCoupon:!1}))}},{children:[e.jsx(n.TitleSmall,Object.assign({style:b.isStaticCoupon?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"Dynamic code"})),e.jsx(n.BodyCaption,Object.assign({style:b.isStaticCoupon?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),b.isStaticCoupon&&!y&&e.jsx(E.default,{discountData:b,setDiscountData:D,hideProbability:S.hideProbability||!1,discountAdminUrl:S.discountAdminUrl}),!b.isStaticCoupon&&!y&&e.jsx(p.default,{currency:S.currency,entitledProducts:h,prerequisiteProducts:q,setEntitledProducts:x,setPrerequisiteProducts:A,discountData:b,productPickerOpen:y,setIsProductPickerOpen:O,setDiscountData:D,selectedCouponType:v,setSelectedCouponType:U,selectedMinimumRequirement:g,setSelectedMinimumRequirement:m,hideProbability:S.hideProbability||!1,hideExpiration:S.hideExpiration||!1,allowStaticCoupon:S.allowStaticCoupon,onChangeCouponType:G})]}),!!y&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsx(d.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(_=S.products)&&void 0!==_?_:[],title:"Select Products",onClose:()=>{O(void 0)},selectedProducts:y===p.DISCOUNT_PRODUCTS.ENTITLED?h:q,setSelectedProducts:y===p.DISCOUNT_PRODUCTS.ENTITLED?x:A,onSearchKeyChange:S.onProductSearch})}))]}))};
|
|
@@ -45,8 +45,10 @@ export declare const STRING_OPERATORS_COMPONENT: {
|
|
|
45
45
|
doesntExist: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
46
46
|
};
|
|
47
47
|
export declare const STRING_RESTRICTED_OPERATORS_COMPONENT: {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
contains: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
49
|
+
doesntContain: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
50
|
+
startsWith: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
51
|
+
endsWith: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
50
52
|
exists: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
51
53
|
doesntExist: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
52
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{QueryBuilderConnectorType as e}from"../types/QueryBuilder.type.js";import{BOOLEAN_OPERATORS as t,STRING_OPERATORS as n,STRING_RESTRICTED_OPERATORS as i,INTEGER_OPERATORS as o,FREQUENCY_OPERATORS as r,DATE_OPERATORS as s,SPECIFIC_IG_OPERATORS as a,ANY_IG_OPERATORS as l,REACTION_OPERATORS as I,IG_STRING_OPERATORS as
|
|
1
|
+
import{QueryBuilderConnectorType as e}from"../types/QueryBuilder.type.js";import{BOOLEAN_OPERATORS as t,STRING_OPERATORS as n,STRING_RESTRICTED_OPERATORS as i,INTEGER_OPERATORS as o,FREQUENCY_OPERATORS as r,DATE_OPERATORS as s,SPECIFIC_IG_OPERATORS as a,ANY_IG_OPERATORS as l,REACTION_OPERATORS as I,IG_STRING_OPERATORS as g,ANY_AD_OPERATORS as u,AD_STRING_OPERATORS as p,ICE_BREAKER_OPERATORS as c}from"../types/QueryBuilderOperator.type.js";const T={[e.boolean]:t,[e.string]:n,[e.string_restricted]:i,[e.integer]:o,[e.frequency]:r,[e.date]:s,[e.specificPost]:a,[e.specificReel]:a,[e.specificStory]:a,[e.anyIg]:l,[e.reaction]:I,[e.activityString]:g,[e.anyAd]:u,[e.specificAd]:p,[e.iceBreaker]:c};var d;!function(e){e.FreeText="FreeText",e.NoInput="NoInput",e.IntegerSingleValue="IntegerSingleValue",e.StringSingleValue="StringSingleValue",e.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",e.MultiselectDropdownFreeText="MultiselectDropdownFreeText",e.SingleselectDropdownFreeText="SingleselectDropdownFreeText",e.SingleDate="SingleDate",e.TwoDate="TwoDate",e.IntegerPositiveSingle="IntegerPositiveSingle",e.NumberTime="NumberTime",e.PostIgPicker="PostIgPicker",e.ReelIgPicker="ReelIgPicker",e.StoryIgPicker="StoryIgPicker",e.EmojiPicker="EmojiPicker",e.InTheLast="InTheLast",e.InTwoLast="InTwoLast",e.InTheLastAgo="InTheLastAgo"}(d||(d={}));const x={[o.is]:d.FreeText,[o.isNot]:d.FreeText,[o.exists]:d.NoInput,[o.doesntExist]:d.NoInput,[o.lessThan]:d.IntegerSingleValue,[o.lessThanOrEqualTo]:d.IntegerSingleValue,[o.greaterThan]:d.IntegerSingleValue,[o.greaterThanOrEqualTo]:d.IntegerSingleValue},N={[n.is]:d.MultiselectDropdownFreeText,[n.isNot]:d.MultiselectDropdownFreeText,[n.contains]:d.FreeText,[n.doesntContain]:d.FreeText,[n.startsWith]:d.FreeText,[n.endsWith]:d.FreeText,[n.exists]:d.NoInput,[n.doesntExist]:d.NoInput},S={[n.contains]:d.FreeText,[n.doesntContain]:d.FreeText,[n.startsWith]:d.FreeText,[n.endsWith]:d.FreeText,[n.exists]:d.NoInput,[n.doesntExist]:d.NoInput},y={[g.any]:d.NoInput,[g.is]:d.MultiselectDropdownFreeText,[g.contains]:d.FreeText,[g.startsWith]:d.FreeText,[g.endsWith]:d.FreeText},F={[p.is]:d.SingleselectDropdownFreeText},h={[c.is]:d.MultiselectDropdownFreeText},w={[I.contains]:d.EmojiPicker},P={[s.today]:d.NoInput,[s.yesterday]:d.NoInput,[s["last 30 days"]]:d.NoInput,[s["last 7 days"]]:d.NoInput,[s["this month"]]:d.NoInput,[s["this week"]]:d.NoInput,[s["last month"]]:d.NoInput,[s["last week"]]:d.NoInput,[s.exactly]:d.InTheLastAgo,[s["in the last"]]:d.InTheLast,[s["in between last"]]:d.InTwoLast,[s.on]:d.SingleDate,[s.notOn]:d.SingleDate,[s.inBetween]:d.TwoDate,[s.notInBetween]:d.TwoDate,[s.before]:d.SingleDate,[s.after]:d.SingleDate,[s.today]:d.NoInput,[s.yesterday]:d.NoInput,[s["last week"]]:d.NoInput,[s["last month"]]:d.NoInput,[s["last quarter"]]:d.NoInput,[s["in the last"]]:d.InTheLast},D={[a.in]:d.PostIgPicker},k={[a.in]:d.ReelIgPicker},m={[a.in]:d.StoryIgPicker},f={[l.in]:d.NoInput},L={[u.in]:d.NoInput},A={[t.isTrue]:d.NoInput,[t.isFalse]:d.NoInput,[t.exists]:d.NoInput,[t.doesntExist]:d.NoInput},E={[r.exactly]:d.IntegerPositiveSingle,[r.atleast]:d.IntegerPositiveSingle,[r.atMost]:d.IntegerPositiveSingle},b={[e.boolean]:A,[e.string]:N,[e.integer]:x,[e.frequency]:E,[e.date]:P,[e.specificPost]:D,[e.specificReel]:k,[e.specificStory]:m,[e.anyIg]:f,[e.reaction]:w,[e.activityString]:y,[e.anyAd]:L,[e.specificAd]:F,[e.iceBreaker]:h,[e.string_restricted]:S};export{F as AD_STRING_OPERATORS_COMPONENT,L as ANY_AD_OPERATORS_COMPONENT,f as ANY_IG_OPERATORS_COMPONENT,A as BOOLEAN_OPERATORS_COMPONENT,b as CONNECTOR_TYPE_TO_COMPONENT_MAP,T as CONNECTOR_TYPE_TO_OPERATORS,d as CONNECTOR_VALUE_COMPONENT_TYPES,P as DATE_OPERATORS_COMPONENT,E as FREQUENCY_OPERATORS_COMPONENT,h as ICE_BREAKER_OPERATORS_COMPONENT,y as IG_STRING_OPERATORS_COMPONENT,x as INTEGER_OPERATORS_COMPONENT,w as REACTION_OPERATORS_COMPONENT,D as SPECIFIC_IG_POST_OPERATORS_COMPONENT,k as SPECIFIC_IG_REEL_OPERATORS_COMPONENT,m as SPECIFIC_IG_STORY_OPERATORS_COMPONENT,N as STRING_OPERATORS_COMPONENT,S as STRING_RESTRICTED_OPERATORS_COMPONENT};
|
|
@@ -23,8 +23,10 @@ export declare enum STRING_OPERATORS {
|
|
|
23
23
|
doesntExist = "doesntExist"
|
|
24
24
|
}
|
|
25
25
|
export declare enum STRING_RESTRICTED_OPERATORS {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
contains = "contains",
|
|
27
|
+
doesntContain = "doesntContain",
|
|
28
|
+
startsWith = "startsWith",
|
|
29
|
+
endsWith = "endsWith",
|
|
28
30
|
exists = "exists",
|
|
29
31
|
doesntExist = "doesntExist"
|
|
30
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,e,n,s,i,a,o,l,r,u,c,
|
|
1
|
+
var t,e,n,s,i,a,o,l,r,u,d,c,h,x;!function(t){t.is="is",t.isNot="isNot",t.exists="exists",t.doesntExist="doesntExist",t.lessThan="lessThan",t.lessThanOrEqualTo="lessThanOrEqualTo",t.greaterThan="greaterThan",t.greaterThanOrEqualTo="greaterThanOrEqualTo"}(t||(t={})),function(t){t.is="is",t.isNot="isNot",t.contains="contains",t.doesntContain="doesntContain",t.startsWith="startsWith",t.endsWith="endsWith",t.exists="exists",t.doesntExist="doesntExist"}(e||(e={})),function(t){t.contains="contains",t.doesntContain="doesntContain",t.startsWith="startsWith",t.endsWith="endsWith",t.exists="exists",t.doesntExist="doesntExist"}(n||(n={})),function(t){t.any="any",t.is="is",t.contains="contains",t.startsWith="startsWith",t.endsWith="endsWith"}(s||(s={})),function(t){t.is="is"}(i||(i={})),function(t){t.in="in"}(a||(a={})),function(t){t.is="is"}(o||(o={})),function(t){t.in="in"}(l||(l={})),function(t){t.in="in"}(r||(r={})),function(t){t.contains="contains"}(u||(u={})),function(t){t.today="today",t.yesterday="yesterday",t["last 7 days"]="last 7 days",t["last 30 days"]="last 30 days",t["this week"]="this week",t["last week"]="last week",t["this month"]="this month",t["last month"]="last month",t.exactly="exactly",t["not exactly"]="not exactly",t["in the last"]="in the last",t["not in the last"]="not in the last",t["in between last"]="in between last",t["not in between last"]="not in between last",t.on="on",t.notOn="notOn",t.inBetween="inBetween",t.notInBetween="notInBetween",t.before="before",t.after="after",t["last quarter"]="last quarter"}(d||(d={})),function(t){t.isTrue="isTrue",t.isFalse="isFalse",t.exists="exists",t.doesntExist="doesntExist"}(c||(c={})),function(t){t.exactly="exactly",t.atleast="atleast",t.atMost="atMost"}(h||(h={})),function(t){t.FreeText="FreeText",t.NoInput="NoInput",t.IntegerSingleValue="IntegerSingleValue",t.StringSingleValue="StringSingleValue",t.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",t.MultiselectDropdownFreeText="MultiselectDropdownFreeText",t.SingleselectDropdownFreeText="SingleselectDropdownFreeText",t.SingleDate="SingleDate",t.TwoDate="TwoDate",t.IntegerPositiveSingle="IntegerPositiveSingle",t.NumberTime="NumberTime"}(x||(x={}));export{i as AD_STRING_OPERATORS,r as ANY_AD_OPERATORS,l as ANY_IG_OPERATORS,c as BOOLEAN_OPERATORS,d as DATE_OPERATORS,x as EVENT_VALUES,h as FREQUENCY_OPERATORS,o as ICE_BREAKER_OPERATORS,s as IG_STRING_OPERATORS,t as INTEGER_OPERATORS,u as REACTION_OPERATORS,a as SPECIFIC_IG_OPERATORS,e as STRING_OPERATORS,n as STRING_RESTRICTED_OPERATORS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import{MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_TARGET_TYPES as d,DISCOUNT_TYPES as s,DISCOUNT_TARGET_SELECTION as a,DISCOUNT_VALUE_TYPES as c}from"./type.js";import"../dropdown/DropdownPopover/index.js";import{Dropdown as l}from"../dropdown/Dropdown.js";import"../zeroState/ZeroState.js";import{TitleSmall as p,BodyCaption as u}from"../TypographyStyle.js";import{DEFAULT_THEME as m}from"../../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"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as b}from"../modals/styledModal.js";import{ProductPickerContent as y}from"../product-picker/ProductPickerModal.js";import{Tag as E}from"../tag/Tag.js";import{Tooltip as v}from"../tooltips/Tooltip.js";import T from"../../assets/icons/triangle_error.svg.js";import{StyledDiscountDialogueContainer as P,CouponTypeContainerStyled as C}from"./DiscountModal.styled.js";import{validateDiscountData as g}from"./DiscountUtils.js";import I,{DISCOUNT_PRODUCTS as j}from"./DynamicCoupon/DynamicCoupon.js";import S from"./StaticCoupon/StaticCoupon.js";const h=h=>{var O,N,D,_;const[w,f]=i(),[A,q]=i(null!==(O=h.data)&&void 0!==O?O:{isStaticCoupon:!1}),[G,M]=i(!0),[
|
|
1
|
+
import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import{MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_TARGET_TYPES as d,DISCOUNT_TYPES as s,DISCOUNT_TARGET_SELECTION as a,DISCOUNT_VALUE_TYPES as c}from"./type.js";import"../dropdown/DropdownPopover/index.js";import{Dropdown as l}from"../dropdown/Dropdown.js";import"../zeroState/ZeroState.js";import{TitleSmall as p,BodyCaption as u}from"../TypographyStyle.js";import{DEFAULT_THEME as m}from"../../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"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as b}from"../modals/styledModal.js";import{ProductPickerContent as y}from"../product-picker/ProductPickerModal.js";import{Tag as E}from"../tag/Tag.js";import{Tooltip as v}from"../tooltips/Tooltip.js";import T from"../../assets/icons/triangle_error.svg.js";import{StyledDiscountDialogueContainer as P,CouponTypeContainerStyled as C}from"./DiscountModal.styled.js";import{validateDiscountData as g}from"./DiscountUtils.js";import I,{DISCOUNT_PRODUCTS as j}from"./DynamicCoupon/DynamicCoupon.js";import S from"./StaticCoupon/StaticCoupon.js";const h=h=>{var O,N,D,_;const[w,f]=i(),[A,q]=i(null!==(O=h.data)&&void 0!==O?O:{isStaticCoupon:!1}),[G,M]=i(!0),[x,F]=i(),[L,R]=i((null===(N=h.data)||void 0===N?void 0:N.minAmount)?r.AMOUNT:(null===(D=h.data)||void 0===D?void 0:D.minQuantity)?r.QUANTITY:r.NA),[k,U]=i([]),[B,X]=i([]),[Y,Q]=i(0);n((()=>{let t;h.hideProbability||(t=V()),M(g(A,L,x,h.hideProbability||!1,t,!!A.isStaticCoupon)),h.hideProbability||V()}),[]),n((()=>{let t;h.hideProbability||(t=V()),M(g(A,L,x,h.hideProbability||!1,t,!!A.isStaticCoupon))}),[A,Y,x,L]),n((()=>{var t,e;if(h.products){if(null===(t=h.data)||void 0===t?void 0:t.entitledProductIds){const t=h.products.filter((t=>{var e,o;return null===(o=null===(e=h.data)||void 0===e?void 0:e.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));X(t)}if(null===(e=h.data)||void 0===e?void 0:e.prerequisiteProductIds){const t=h.products.filter((t=>{var e,o;return null===(o=null===(e=h.data)||void 0===e?void 0:e.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(t.id))}));U(t)}}}),[]),n((()=>{const t=B.map((t=>parseInt(t.id)));q(Object.assign(Object.assign({},A),{entitledProductIds:t}))}),[B]),n((()=>{const t=k.map((t=>parseInt(t.id)));q(Object.assign(Object.assign({},A),{prerequisiteProductIds:t}))}),[k]),n((()=>{A.targetType===d.SHIPPING_LINE?F(s.FREE_SHIPPING):A.targetSelection===a.ENTITLED?F(s.BUY_X_GET_Y):A.valueType===c.FIXED_AMOUNT?F(s.FIXED_AMOUNT):A.valueType===c.PERCENTAGE&&F(s.PERCENTAGE)}),[]);const H=[{value:s.FIXED_AMOUNT,label:"Fixed Amount",selected:x===s.FIXED_AMOUNT},{value:s.PERCENTAGE,label:"Percentage",selected:x===s.PERCENTAGE},{value:s.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:x===s.BUY_X_GET_Y},{value:s.FREE_SHIPPING,label:"Free shipping",selected:x===s.FREE_SHIPPING}],V=()=>{if(!h.quadrant||!h.probability)return;const t=[...h.probability];let e=[];t.length>=h.quadrant&&t.splice(h.quadrant-1,1),e=t;const o=e.reduce(((t,e)=>t+e),0)+(A.probability||0);return Q(parseFloat(o.toFixed(4))),parseFloat(o.toFixed(4))},z=t=>{const e=t.value;F(e),e===s.FREE_SHIPPING?(U([]),X([]),q(Object.assign(Object.assign({},A),{value:100,targetSelection:a.ALL,targetType:d.SHIPPING_LINE,valueType:c.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):e===s.BUY_X_GET_Y?q(Object.assign(Object.assign({},A),{targetSelection:a.ENTITLED,targetType:d.LINE_ITEM,valueType:c.PERCENTAGE})):e===s.PERCENTAGE?(U([]),X([]),q(Object.assign(Object.assign({},A),{targetSelection:a.ALL,targetType:d.LINE_ITEM,valueType:c.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):e===s.FIXED_AMOUNT&&(U([]),X([]),q(Object.assign(Object.assign({},A),{targetSelection:a.ALL,targetType:d.LINE_ITEM,valueType:c.FIXED_AMOUNT,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0})))};return t(b,Object.assign({open:h.isOpen,headingTitle:w?"Select Products":h.title,headingSubtitle:w?void 0:h.subTitle,footerLeftCustomElement:!h.quadrant||h.hideProbability?e(o,{}):Y<=1?e(E,{theme:"light",tagText:`Current probability sum: ${Y}`,type:"white"}):e(v,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e("div",{children:e(E,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${Y}`,type:"negative",LeadingIcon:T})})})),headerRightCustomElement:h.allowStaticCoupon||w?void 0:e(l,{options:H,width:"200px",placement:"bottom-start",size:"small",onSelect:t=>{z(t)}}),onClose:h.onClose,footerShadow:!0,primaryButton:w?{buttonType:"primary",onClick:()=>{f(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:G,onClick:()=>{A.isStaticCoupon?h.onSaveClicked({quadrant:A.quadrant,couponCode:A.couponCode,description:A.description,isStaticCoupon:A.isStaticCoupon,probability:A.probability,title:A.title}):h.onSaveClicked(A),q({})}},secondaryButton:w?{buttonType:"tertiaryGray",onClick:()=>{f(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:h.onClose,buttonText:"Close"}},{children:[!w&&t(P,{children:[h.allowStaticCoupon&&!w&&t(C,Object.assign({selectedDiv:A.isStaticCoupon?1:2},{children:[t("div",Object.assign({className:"coupon-type__container",onClick:()=>{q({isStaticCoupon:!0,couponCode:A.couponCode,description:A.description,quadrant:A.quadrant})}},{children:[e(p,Object.assign({style:A.isStaticCoupon?{color:m.colorsV2.content.brand}:{}},{children:"Static code"})),e(u,Object.assign({style:A.isStaticCoupon?{color:m.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),t("div",Object.assign({className:"coupon-type__container",onClick:()=>{q(Object.assign(Object.assign({},A),{isStaticCoupon:!1}))}},{children:[e(p,Object.assign({style:A.isStaticCoupon?{}:{color:m.colorsV2.content.brand}},{children:"Dynamic code"})),e(u,Object.assign({style:A.isStaticCoupon?{}:{color:m.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),A.isStaticCoupon&&!w&&e(S,{discountData:A,setDiscountData:q,hideProbability:h.hideProbability||!1,discountAdminUrl:h.discountAdminUrl}),!A.isStaticCoupon&&!w&&e(I,{currency:h.currency,entitledProducts:B,prerequisiteProducts:k,setEntitledProducts:X,setPrerequisiteProducts:U,discountData:A,productPickerOpen:w,setIsProductPickerOpen:f,setDiscountData:q,selectedCouponType:x,setSelectedCouponType:F,selectedMinimumRequirement:L,setSelectedMinimumRequirement:R,hideProbability:h.hideProbability||!1,hideExpiration:h.hideExpiration||!1,allowStaticCoupon:h.allowStaticCoupon,onChangeCouponType:z})]}),!!w&&e("div",Object.assign({style:{padding:"12px 0"}},{children:e(y,{show:!0,onSave:()=>{},products:null!==(_=h.products)&&void 0!==_?_:[],title:"Select Products",onClose:()=>{f(void 0)},selectedProducts:w===j.ENTITLED?B:k,setSelectedProducts:w===j.ENTITLED?X:U,onSearchKeyChange:h.onProductSearch})}))]}))};export{h as DiscountModal};
|