@ikas/bp-storefront 0.133.0 → 1.2.0

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.
@@ -1 +1 @@
1
- import{__assign as e}from'./../../../ext/tslib/tslib.es6.mjs.js';import{I18n as r}from"../../../i18n/index.js";import{withRoutePrefix as t}from"../../../router/index.js";import{customerStore as n}from"../../../stores/customer/index.js";import{formatCurrency as u}from"../../../utils/currency.js";import{validateEmail as a,formatDate as o}from"../../../utils/helper.js";import{getOrderAdjustmentDisplayName as i}from"./adjustment/index.js";import{getOrderLineItemRefundQuantity as s}from"./line-item/index.js";function c(r){var t,n,u;return e(e({},r),{orderLineItems:(null===(t=r.orderLineItems)||void 0===t?void 0:t.filter(function(e){return!e.deleted}))||[],orderAdjustments:(null===(n=r.orderAdjustments)||void 0===n?void 0:n.map(function(t){return e(e({},t),{currencyCode:r.currencyCode,currencySymbol:r.currencySymbol||""})}))||null,giftPackageLines:(null===(u=r.giftPackageLines)||void 0===u?void 0:u.map(function(t){return e(e({},t),{currencyCode:r.currencyCode,currencySymbol:r.currencySymbol||""})}))||null})}function d(e){var r;return(null===(r=e.orderLineItems)||void 0===r?void 0:r.length)||0}function l(e){var r;return(null===(r=e.orderLineItems)||void 0===r?void 0:r.reduce(function(e,r){return e+r.quantity},0))||0}function f(r){var t,n=E(r),u=null===(t=r.orderPackages)||void 0===t?void 0:t.filter(function(e){return!e.deleted}),a=r.orderLineItems.filter(function(e){return!e.deleted&&"CANCELLED"===e.status}),o=[];return n.length&&o.push({id:r.id+"-u",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItems:n,orderLineItemIds:n.map(function(e){return e.id}),statusTranslation:C({orderPackageStatus:"UNFULFILLED"}),orderPackageFulfillStatus:"UNFULFILLED",orderPackageNumber:r.orderNumber?r.orderNumber+"-u":"u",stockLocationId:n[0].stockLocationId||"",trackingInfo:null}),u&&o.push.apply(o,u.map(function(t){return e(e({},t),{statusTranslation:C({orderPackageStatus:t.orderPackageFulfillStatus}),orderLineItems:r.orderLineItems.filter(function(e){return t.orderLineItemIds.includes(e.id)})})})),a.length&&o.push({id:r.id+"-c",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItems:a,orderLineItemIds:a.map(function(e){return e.id}),statusTranslation:C({orderPackageStatus:"CANCELLED"}),orderPackageFulfillStatus:"CANCELLED",orderPackageNumber:r.orderNumber?r.orderNumber+"-c":"c",stockLocationId:a[0].stockLocationId||"",trackingInfo:null}),o}function m(e){if(n._refundSettings&&!n._refundSettings.isActiveRefundSection)return[];var r=function(e){var r=e.orderedAt,t=Date.now();return Math.abs(t-r)/864e5}(e);return e.orderLineItems.filter(function(e){var t;return["FULFILLED","UNFULFILLED","DELIVERED"].includes(e.status)&&(!(null===(t=n._refundSettings)||void 0===t?void 0:t.orderRefundDayLimit)||n._refundSettings.orderRefundDayLimit>=r)})}function _(e){return!!m(e).some(function(e){return!!s(e)})}function E(e){return e.orderLineItems.filter(function(e){return"UNFULFILLED"===e.status})}function L(e){return e.orderLineItems.filter(function(e){return"REFUNDED"===e.status||"REFUND_REQUESTED"===e.status||"REFUND_REQUEST_ACCEPTED"===e.status||"REFUND_REJECTED"===e.status})}function p(e){var r;return(null===(r=e.taxLines)||void 0===r?void 0:r.reduce(function(e,r){return e+r.price},0))||0}function v(e){return u(p(e),e.currencyCode,e.currencySymbol||"")}function D(e){var r;return(null===(r=e.shippingLines)||void 0===r?void 0:r.reduce(function(e,r){return e+r.finalPrice},0))||0}function I(e){return u(D(e),e.currencyCode,e.currencySymbol||"")}function g(e){return u(e.totalFinalPrice,e.currencyCode,e.currencySymbol||"")}function k(e){return u(e.totalPrice,e.currencyCode,e.currencySymbol||"")}function y(e){var r;return!!(null===(r=e.customer)||void 0===r?void 0:r.id)&&!e.customer.isGuestCheckout}function R(e){var r;return!!(null===(r=e.customer)||void 0===r?void 0:r.email)&&a(e.customer.email)}function A(e){var r,t;return"".concat((null===(r=e.customer)||void 0===r?void 0:r.firstName)||""," ").concat((null===(t=e.customer)||void 0===t?void 0:t.lastName)||"")}function N(e){var r=new Date;return r.setTime(e.updatedAt),o(r)}function F(e){if(!e.orderedAt)return null;var r=new Date;return r.setTime(e.orderedAt),o(r)}function C(e){if(!e.orderPackageStatus)return"";switch(e.orderPackageStatus){case"CANCELLED":return r.translate("order_package_status.cancelled");case"CANCEL_REJECTED":return r.translate("order_package_status.cancel_rejected");case"CANCEL_REQUESTED":return r.translate("order_package_status.cancel_requested");case"DELIVERED":return r.translate("order_package_status.delivered");case"FULFILLED":return r.translate("order_package_status.fulfilled");case"PARTIALLY_CANCELLED":return r.translate("order_package_status.partially_cancelled");case"PARTIALLY_DELIVERED":return r.translate("order_package_status.partially_delivered");case"PARTIALLY_FULFILLED":return r.translate("order_package_status.partially_fulfilled");case"PARTIALLY_READY_FOR_SHIPMENT":return r.translate("order_package_status.partially_ready_for_shipment");case"PARTIALLY_REFUNDED":return r.translate("order_package_status.partially_refunded");case"READY_FOR_PICK_UP":return r.translate("order_package_status.ready_for_pick_up");case"READY_FOR_SHIPMENT":return r.translate("order_package_status.ready_for_shipment");case"REFUNDED":return r.translate("order_package_status.refunded");case"REFUND_REJECTED":return r.translate("order_package_status.refund_rejected");case"REFUND_REQUESTED":return r.translate("order_package_status.refund_requested");case"REFUND_REQUEST_ACCEPTED":return r.translate("order_package_status.refund_request_accepted");case"UNABLE_TO_DELIVER":return r.translate("order_package_status.unable_to_deliver");case"UNFULFILLED":return r.translate("order_package_status.unfulfilled");default:return""}}function S(e){var r;return null===(r=e.orderAdjustments)||void 0===r?void 0:r.find(function(e){return!!e.couponId})}function U(e){var r;return null===(r=e.orderAdjustments)||void 0===r?void 0:r.filter(function(e){return!e.couponId})}function P(e){return e.orderLineItems.filter(function(e){return!!e.variant.fileId&&"REFUNDED"!==e.status}).map(function(e){return e.variant.fileId})}function T(r){var t;return null===(t=r.orderAdjustments)||void 0===t?void 0:t.filter(function(e){return"FREE_SHIPPING"!==e.campaignType}).map(function(r){return"INTEREST"===r.name?e(e({},r),{name:i(r)}):r})}function b(e){return t("/account/orders/".concat(e.id))}function j(e){return e.orderLineItems.map(function(e){return e.variant.name}).join(", ")}export{S as getIkasOrderCouponAdjustment,A as getIkasOrderCustomerFullName,T as getIkasOrderDisplayedAdjustments,f as getIkasOrderDisplayedPackages,d as getIkasOrderDistinctItemCount,N as getIkasOrderFormattedDate,F as getIkasOrderFormattedOrderedAt,I as getIkasOrderFormattedShippingTotal,g as getIkasOrderFormattedTotalFinalPrice,k as getIkasOrderFormattedTotalPrice,v as getIkasOrderFormattedTotalTax,b as getIkasOrderHref,U as getIkasOrderNonCouponAdjustments,C as getIkasOrderPackageStatusTranslation,P as getIkasOrderProductFiles,m as getIkasOrderRefundableItems,L as getIkasOrderRefundedItems,D as getIkasOrderShippingTotal,l as getIkasOrderTotalItemCount,p as getIkasOrderTotalTax,E as getIkasOrderUnfullfilledItems,j as getIkasOrderVariantNames,y as hasIkasOrderCustomer,R as hasValidIkasOrderCustomerEmail,c as initIkasOrder,_ as isIkasOrderRefundable};
1
+ import{__assign as e}from'./../../../ext/tslib/tslib.es6.mjs.js';import{I18n as r}from"../../../i18n/index.js";import{withRoutePrefix as t}from"../../../router/index.js";import{customerStore as n}from"../../../stores/customer/index.js";import{formatCurrency as a}from"../../../utils/currency.js";import{validateEmail as u,formatDate as o}from"../../../utils/helper.js";import{getOrderAdjustmentDisplayName as i}from"./adjustment/index.js";import{getOrderLineItemRefundQuantity as s}from"./line-item/index.js";function c(r){var t,n,a;return e(e({},r),{orderLineItems:(null===(t=r.orderLineItems)||void 0===t?void 0:t.filter(function(e){return!e.deleted}))||[],orderAdjustments:(null===(n=r.orderAdjustments)||void 0===n?void 0:n.map(function(t){return e(e({},t),{currencyCode:r.currencyCode,currencySymbol:r.currencySymbol||""})}))||null,giftPackageLines:(null===(a=r.giftPackageLines)||void 0===a?void 0:a.map(function(t){return e(e({},t),{currencyCode:r.currencyCode,currencySymbol:r.currencySymbol||""})}))||null})}function d(e){var r;return(null===(r=e.orderLineItems)||void 0===r?void 0:r.length)||0}function l(e){var r;return(null===(r=e.orderLineItems)||void 0===r?void 0:r.reduce(function(e,r){return e+r.quantity},0))||0}function _(r){var t,n=m(r),a=null===(t=r.orderPackages)||void 0===t?void 0:t.filter(function(e){return!e.deleted}),u=r.orderLineItems.filter(function(e){return!e.deleted&&"CANCELLED"===e.status}),o=[];return n.length&&o.push({id:r.id+"-u",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItems:n,orderLineItemIds:n.map(function(e){return e.id}),statusTranslation:T({orderPackageStatus:"UNFULFILLED"}),orderPackageFulfillStatus:"UNFULFILLED",orderPackageNumber:r.orderNumber?r.orderNumber+"-u":"u",stockLocationId:n[0].stockLocationId||"",trackingInfo:null}),a&&o.push.apply(o,a.map(function(t){return e(e({},t),{statusTranslation:T({orderPackageStatus:t.orderPackageFulfillStatus}),orderLineItems:r.orderLineItems.filter(function(e){return t.orderLineItemIds.includes(e.id)})})})),u.length&&o.push({id:r.id+"-c",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItems:u,orderLineItemIds:u.map(function(e){return e.id}),statusTranslation:T({orderPackageStatus:"CANCELLED"}),orderPackageFulfillStatus:"CANCELLED",orderPackageNumber:r.orderNumber?r.orderNumber+"-c":"c",stockLocationId:u[0].stockLocationId||"",trackingInfo:null}),o}function f(e){if(n._refundSettings&&!n._refundSettings.isActiveRefundSection)return[];var r=function(e){var r=e.orderedAt,t=Date.now();return Math.abs(t-r)/864e5}(e);return e.orderLineItems.filter(function(e){var t;return["FULFILLED","UNFULFILLED","DELIVERED"].includes(e.status)&&(!(null===(t=n._refundSettings)||void 0===t?void 0:t.orderRefundDayLimit)||n._refundSettings.orderRefundDayLimit>=r)})}function E(e){return!!f(e).some(function(e){return!!s(e)})}function m(e){return e.orderLineItems.filter(function(e){return"UNFULFILLED"===e.status})}function L(e){return e.orderLineItems.filter(function(e){return"REFUNDED"===e.status||"REFUND_REQUESTED"===e.status||"REFUND_REQUEST_ACCEPTED"===e.status||"REFUND_REJECTED"===e.status})}function p(e){var r;return(null===(r=e.taxLines)||void 0===r?void 0:r.reduce(function(e,r){return e+r.price},0))||0}function I(e){return a(p(e),e.currencyCode,e.currencySymbol||"")}function v(e){var r;return(null===(r=e.shippingLines)||void 0===r?void 0:r.reduce(function(e,r){return e+r.finalPrice},0))||0}function D(e){return a(v(e),e.currencyCode,e.currencySymbol||"")}function g(e){return a(e.totalFinalPrice,e.currencyCode,e.currencySymbol||"")}function R(e){return a(e.totalPrice,e.currencyCode,e.currencySymbol||"")}function k(e){var r;return!!(null===(r=e.customer)||void 0===r?void 0:r.id)&&!e.customer.isGuestCheckout}function N(e){var r;return!!(null===(r=e.customer)||void 0===r?void 0:r.email)&&u(e.customer.email)}function A(e){var r,t;return"".concat((null===(r=e.customer)||void 0===r?void 0:r.firstName)||""," ").concat((null===(t=e.customer)||void 0===t?void 0:t.lastName)||"")}function y(e){var r=new Date;return r.setTime(e.updatedAt),o(r)}function F(e){if(!e.orderedAt)return null;var r=new Date;return r.setTime(e.orderedAt),o(r)}function T(e){if(!e.orderPackageStatus)return"";switch(e.orderPackageStatus){case"CANCELLED":return r.translate("order_package_status.cancelled");case"CANCEL_REJECTED":return r.translate("order_package_status.cancel_rejected");case"CANCEL_REQUESTED":return r.translate("order_package_status.cancel_requested");case"DELIVERED":return r.translate("order_package_status.delivered");case"FULFILLED":return r.translate("order_package_status.fulfilled");case"PARTIALLY_CANCELLED":return r.translate("order_package_status.partially_cancelled");case"PARTIALLY_DELIVERED":return r.translate("order_package_status.partially_delivered");case"PARTIALLY_FULFILLED":return r.translate("order_package_status.partially_fulfilled");case"PARTIALLY_READY_FOR_SHIPMENT":return r.translate("order_package_status.partially_ready_for_shipment");case"PARTIALLY_REFUNDED":return r.translate("order_package_status.partially_refunded");case"READY_FOR_PICK_UP":return r.translate("order_package_status.ready_for_pick_up");case"READY_FOR_SHIPMENT":return r.translate("order_package_status.ready_for_shipment");case"REFUNDED":return r.translate("order_package_status.refunded");case"REFUND_REJECTED":return r.translate("order_package_status.refund_rejected");case"REFUND_REQUESTED":return r.translate("order_package_status.refund_requested");case"REFUND_REQUEST_ACCEPTED":return r.translate("order_package_status.refund_request_accepted");case"RETURN_PARCEL_WAITING":return r.translate("order_package_status.return_parcel_waiting");case"RETURN_IN_TRANSIT":return r.translate("order_package_status.return_in_transit");case"RETURN_DELIVERED":return r.translate("order_package_status.return_delivered");case"RETURN_REJECTED":return r.translate("order_package_status.return_rejected");case"UNABLE_TO_DELIVER":return r.translate("order_package_status.unable_to_deliver");case"UNFULFILLED":return r.translate("order_package_status.unfulfilled");default:return""}}function U(e){var r;return null===(r=e.orderAdjustments)||void 0===r?void 0:r.find(function(e){return!!e.couponId})}function C(e){var r;return null===(r=e.orderAdjustments)||void 0===r?void 0:r.filter(function(e){return!e.couponId})}function S(e){return e.orderLineItems.filter(function(e){return!!e.variant.fileId&&"REFUNDED"!==e.status}).map(function(e){return e.variant.fileId})}function P(r){var t;return null===(t=r.orderAdjustments)||void 0===t?void 0:t.filter(function(e){return"FREE_SHIPPING"!==e.campaignType}).map(function(r){return"INTEREST"===r.name?e(e({},r),{name:i(r)}):r})}function j(e){return t("/account/orders/".concat(e.id))}function b(e){return e.orderLineItems.map(function(e){return e.variant.name}).join(", ")}export{U as getIkasOrderCouponAdjustment,A as getIkasOrderCustomerFullName,P as getIkasOrderDisplayedAdjustments,_ as getIkasOrderDisplayedPackages,d as getIkasOrderDistinctItemCount,y as getIkasOrderFormattedDate,F as getIkasOrderFormattedOrderedAt,D as getIkasOrderFormattedShippingTotal,g as getIkasOrderFormattedTotalFinalPrice,R as getIkasOrderFormattedTotalPrice,I as getIkasOrderFormattedTotalTax,j as getIkasOrderHref,C as getIkasOrderNonCouponAdjustments,T as getIkasOrderPackageStatusTranslation,S as getIkasOrderProductFiles,f as getIkasOrderRefundableItems,L as getIkasOrderRefundedItems,v as getIkasOrderShippingTotal,l as getIkasOrderTotalItemCount,p as getIkasOrderTotalTax,m as getIkasOrderUnfullfilledItems,b as getIkasOrderVariantNames,k as hasIkasOrderCustomer,N as hasValidIkasOrderCustomerEmail,c as initIkasOrder,E as isIkasOrderRefundable};
@@ -155,6 +155,25 @@ export declare class Router {
155
155
  * ```
156
156
  */
157
157
  static getPageParams(): Record<string, string>;
158
+ /**
159
+ * Get the current URL query parameters as an object.
160
+ *
161
+ * @ai-category Navigation
162
+ * @ai-related getCurrentPath, getPageParams
163
+ *
164
+ * @returns Object containing query parameters parsed from the current URL
165
+ *
166
+ * @example
167
+ * ```typescript
168
+ * import { Router } from "@ikas/bp-storefront";
169
+ *
170
+ * // URL: /search?q=shoes&color=red
171
+ * const query = Router.router_getQueryParams();
172
+ * console.log(query.q); // "shoes"
173
+ * console.log(query.color); // "red"
174
+ * ```
175
+ */
176
+ static router_getQueryParams(): Record<string, string>;
158
177
  private static handleRouteChange;
159
178
  private static handlePopState;
160
179
  private static interceptAnchorClicks;
@@ -1 +1 @@
1
- import{IkasStorefrontConfig as e}from"../packages/storefront-config/src/index.js";import{getCheckoutUrlFromCartStore as t}from"../functions/stores/cart/index.js";import{cartStore as a}from"../stores/cart/index.js";var r=function(){function r(){}return r.initialize=function(e,t){var a=this;this.window=t||window,this.currentPath=void 0!==this.window?this.window.location.pathname:"/",void 0!==this.window&&(r.pageParams=e,this.window.addEventListener("popstate",r.handlePopState),r.interceptAnchorClicks(),this.window.addEventListener("pageshow",function(e){return a.isFromBFCache=e.persisted}))},r.navigate=function(t,a,n){if(void 0===a&&(a=!1),void 0===n&&(n=!1),void 0!==this.window){var o=r.ensurePathPrefix(t);e.getIsPreview()||(a?this.window.history.replaceState({},"",o):n?this.window.open(o,"_blank"):this.window.location.href=o),r.handleRouteChange(o)}},r.navigateToPage=function(e,n,c,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1);var u=Object.entries(c||{}).map(function(e){var t=e[0],a=e[1];return"".concat(t,"=").concat(encodeURIComponent(a))}).join("&"),d="";switch(e){case"INDEX":d="/";break;case"ACCOUNT":d="/account";break;case"ACTIVATE_CUSTOMER":d="/account/activate";break;case"ADDRESSES":d="/account/addresses";break;case"FAVORITE_PRODUCTS":d="/account/favorite-products";break;case"FORGOT_PASSWORD":d="/account/forgot-password";break;case"LOGIN":d="/account/login";break;case"RAFFLE_ACCOUNT":d="/account/raffles";break;case"RECOVER_PASSWORD":d="/account/recover-password";break;case"REGISTER":d="/account/register";break;case"ORDERS":d="/account/orders";break;case"ORDER_DETAIL":d="/account/orders/".concat(n);break;case"BLOG_INDEX":d="/blog";break;case"BLOG":case"BLOG_CATEGORY":d="/blog/".concat(n);break;case"CART":d="/cart";break;case"CHECKOUT":d=t(a);break;case"CUSTOM":d="/pages/".concat(n);break;case"RAFFLE":d="/raffle";break;case"RAFFLE_DETAIL":d="/raffle/".concat(n);break;case"SEARCH":d="/search";break;case"NOT_FOUND":d="/404"}u&&(d+="?".concat(u)),r.navigate(o(d),i,s)},r.addObserver=function(e){r.observers.push(e)},r.removeObserver=function(e){r.observers=r.observers.filter(function(t){return t!==e})},r.goBack=function(){this.window.history.back()},r.getCurrentPath=function(){return r.currentPath},r.getPageParams=function(){return r.pageParams},r.handleRouteChange=function(e){r.currentPath=e,r.notifyObservers()},r.handlePopState=function(){void 0!==this.window&&r.handleRouteChange(this.window.location.pathname)},r.interceptAnchorClicks=function(){void 0!==this.window&&this.window.addEventListener("click",function(e){var t=e.target.closest("a");if(t&&"A"===t.tagName&&t.getAttribute("href")){var a=t.getAttribute("href");if(e.metaKey||e.ctrlKey)return;if(/^(mailto|tel|sms|javascript):/i.test(a))return;e.preventDefault();var n="_blank"===t.getAttribute("target");r.navigate(a,!1,n)}})},r.notifyObservers=function(){r.observers.forEach(function(e){return e(r.currentPath)})},r.ensurePathPrefix=function(e){return e.startsWith("http")||e.startsWith("/")?e:"/".concat(e)},r.currentPath="undefined"!=typeof window?window.location.pathname:"/",r.observers=[],r.pageParams={},r.isFromBFCache=!1,r}(),n=r;function o(t){var a=e.getCurrentPath(),r=t.split("/").filter(function(e){return""!==e})[0];return r&&e.getSupportedPaths().includes(r)?t:"".concat(a?"/".concat(a):"").concat(t).replace("//","/")}export{r as Router,n as router,o as withRoutePrefix};
1
+ import{IkasStorefrontConfig as e}from"../packages/storefront-config/src/index.js";import{getCheckoutUrlFromCartStore as t}from"../functions/stores/cart/index.js";import{cartStore as a}from"../stores/cart/index.js";var r=function(){function r(){}return r.initialize=function(e,t){var a=this;this.window=t||window,this.currentPath=void 0!==this.window?this.window.location.pathname:"/",void 0!==this.window&&(r.pageParams=e,this.window.addEventListener("popstate",r.handlePopState),r.interceptAnchorClicks(),this.window.addEventListener("pageshow",function(e){return a.isFromBFCache=e.persisted}))},r.navigate=function(t,a,n){if(void 0===a&&(a=!1),void 0===n&&(n=!1),void 0!==this.window){var o=r.ensurePathPrefix(t);e.getIsPreview()||(a?this.window.history.replaceState({},"",o):n?this.window.open(o,"_blank"):this.window.location.href=o),r.handleRouteChange(o)}},r.navigateToPage=function(e,n,i,c,s){void 0===c&&(c=!1),void 0===s&&(s=!1);var u=Object.entries(i||{}).map(function(e){var t=e[0],a=e[1];return"".concat(t,"=").concat(encodeURIComponent(a))}).join("&"),h="";switch(e){case"INDEX":h="/";break;case"ACCOUNT":h="/account";break;case"ACTIVATE_CUSTOMER":h="/account/activate";break;case"ADDRESSES":h="/account/addresses";break;case"FAVORITE_PRODUCTS":h="/account/favorite-products";break;case"FORGOT_PASSWORD":h="/account/forgot-password";break;case"LOGIN":h="/account/login";break;case"RAFFLE_ACCOUNT":h="/account/raffles";break;case"RECOVER_PASSWORD":h="/account/recover-password";break;case"REGISTER":h="/account/register";break;case"ORDERS":h="/account/orders";break;case"ORDER_DETAIL":h="/account/orders/".concat(n);break;case"BLOG_INDEX":h="/blog";break;case"BLOG":case"BLOG_CATEGORY":h="/blog/".concat(n);break;case"CART":h="/cart";break;case"CHECKOUT":h=t(a);break;case"CUSTOM":h="/pages/".concat(n);break;case"RAFFLE":h="/raffle";break;case"RAFFLE_DETAIL":h="/raffle/".concat(n);break;case"SEARCH":h="/search";break;case"NOT_FOUND":h="/404"}u&&(h+="?".concat(u)),r.navigate(o(h),c,s)},r.addObserver=function(e){r.observers.push(e)},r.removeObserver=function(e){r.observers=r.observers.filter(function(t){return t!==e})},r.goBack=function(){this.window.history.back()},r.getCurrentPath=function(){return r.currentPath},r.getPageParams=function(){return r.pageParams},r.router_getQueryParams=function(){if(void 0===this.window)return{};var e={};return new URLSearchParams(this.window.location.search).forEach(function(t,a){e[a]=t}),e},r.handleRouteChange=function(e){r.currentPath=e,r.notifyObservers()},r.handlePopState=function(){void 0!==this.window&&r.handleRouteChange(this.window.location.pathname)},r.interceptAnchorClicks=function(){void 0!==this.window&&this.window.addEventListener("click",function(e){var t=e.target.closest("a");if(t&&"A"===t.tagName&&t.getAttribute("href")){var a=t.getAttribute("href");if(e.metaKey||e.ctrlKey)return;if(/^(mailto|tel|sms|javascript):/i.test(a))return;e.preventDefault();var n="_blank"===t.getAttribute("target");r.navigate(a,!1,n)}})},r.notifyObservers=function(){r.observers.forEach(function(e){return e(r.currentPath)})},r.ensurePathPrefix=function(e){return e.startsWith("http")||e.startsWith("/")?e:"/".concat(e)},r.currentPath="undefined"!=typeof window?window.location.pathname:"/",r.observers=[],r.pageParams={},r.isFromBFCache=!1,r}(),n=r;function o(t){var a=e.getCurrentPath(),r=t.split("/").filter(function(e){return""!==e})[0];return r&&e.getSupportedPaths().includes(r)?t:"".concat(a?"/".concat(a):"").concat(t).replace("//","/")}export{r as Router,n as router,o as withRoutePrefix};
@@ -92,7 +92,8 @@ export type StorefrontB2BShowProductsEnum = "StorefrontB2BShowProductsEnum" | "A
92
92
  export type StorefrontPageTypesEnum = "StorefrontPageTypesEnum" | "BLOG" | "BLOG_CATEGORY" | "BRAND" | "CATEGORY" | "CUSTOM" | "PRODUCT";
93
93
  export type StorefrontPolicyTypeEnum = "StorefrontPolicyTypeEnum" | "IMPRINT" | "OTHER" | "PRIVACY_POLICY" | "RETURN_POLICY" | "SHIPPING_POLICY" | "TERMS_OF_SERVICE";
94
94
  export type StorefrontPopupDeviceTypeEnum = "StorefrontPopupDeviceTypeEnum" | "ALL" | "DESKTOP" | "MOBILE";
95
- export type StorefrontPopupDisplayFilterTypeEnum = "StorefrontPopupDisplayFilterTypeEnum" | "CART_TOTAL" | "CUSTOMER_SEGMENT";
95
+ export type StorefrontPopupDisplayFilterTypeEnum = "StorefrontPopupDisplayFilterTypeEnum" | "APPLIED_CAMPAIGN" | "BRAND_IN_CART" | "CART_ITEM_COUNT" | "CART_TOTAL" | "CATEGORY_IN_CART" | "CUSTOMER_AUTH_STATUS" | "CUSTOMER_GENDER" | "CUSTOMER_GROUP" | "CUSTOMER_SEGMENT" | "CUSTOMER_SUBSCRIPTION" | "PRODUCT_IN_CART";
96
+ export type StorefrontPopupDisplayFilterOperatorEnum = "StorefrontPopupDisplayFilterOperatorEnum" | "ANY_OF" | "BETWEEN" | "EQUALS" | "GREATER_THAN" | "GREATER_THAN_OR_EQUAL" | "LESS_THAN" | "LESS_THAN_OR_EQUAL" | "NONE_OF" | "NOT_EQUALS";
96
97
  export type StorefrontPopupDisplayFrequencyEnum = "StorefrontPopupDisplayFrequencyEnum" | "EVERY_TIME" | "ONCE_PER_SESSION";
97
98
  export type StorefrontPopupDisplayTriggerTypeEnum = "StorefrontPopupDisplayTriggerTypeEnum" | "EXIT_INTENT" | "ON_PAGE_LOAD" | "SCROLL_DOWN";
98
99
  export type StorefrontPopupPageFilterDataTypeEnum = "StorefrontPopupPageFilterDataTypeEnum" | "CONTAINS" | "DOES_NOT_CONTAIN" | "EXACT_MATCH" | "ID_LIST";
@@ -2659,6 +2660,7 @@ export interface StorefrontPopup {
2659
2660
  deleted: boolean;
2660
2661
  displayFilters: StorefrontPopupDisplayFilter[] | null;
2661
2662
  displaySettings: StorefrontPopupDisplaySettings;
2663
+ hideFilters: StorefrontPopupDisplayFilter[] | null;
2662
2664
  id: string;
2663
2665
  name: string;
2664
2666
  pageFilters: StorefrontPopupPageFilter[] | null;
@@ -2678,9 +2680,9 @@ export interface StorefrontPopupDateFilter {
2678
2680
  startDate: any | null;
2679
2681
  }
2680
2682
  export interface StorefrontPopupDisplayFilter {
2681
- operator: string;
2683
+ operator: StorefrontPopupDisplayFilterOperatorEnum;
2682
2684
  type: StorefrontPopupDisplayFilterTypeEnum;
2683
- value: string;
2685
+ value: string[];
2684
2686
  }
2685
2687
  export interface StorefrontPopupDisplaySettings {
2686
2688
  frequency: StorefrontPopupDisplayFrequencyEnum;
@@ -45,7 +45,7 @@ export type IkasOrder = {
45
45
  transactions?: IkasOrderTransaction[];
46
46
  };
47
47
  export type IkasOrderCancelReason = "CUSTOMER" | "DECLINED" | "INVENTORY" | "OTHER";
48
- export type IkasOrderPackageStatus = "CANCELLED" | "CANCEL_REJECTED" | "CANCEL_REQUESTED" | "DELIVERED" | "FULFILLED" | "PARTIALLY_CANCELLED" | "PARTIALLY_DELIVERED" | "PARTIALLY_FULFILLED" | "PARTIALLY_READY_FOR_SHIPMENT" | "PARTIALLY_REFUNDED" | "READY_FOR_PICK_UP" | "READY_FOR_SHIPMENT" | "REFUNDED" | "REFUND_REJECTED" | "REFUND_REQUESTED" | "REFUND_REQUEST_ACCEPTED" | "UNABLE_TO_DELIVER" | "UNFULFILLED";
48
+ export type IkasOrderPackageStatus = "CANCELLED" | "CANCEL_REJECTED" | "CANCEL_REQUESTED" | "DELIVERED" | "FULFILLED" | "PARTIALLY_CANCELLED" | "PARTIALLY_DELIVERED" | "PARTIALLY_FULFILLED" | "PARTIALLY_READY_FOR_SHIPMENT" | "PARTIALLY_REFUNDED" | "READY_FOR_PICK_UP" | "READY_FOR_SHIPMENT" | "REFUNDED" | "REFUND_REJECTED" | "REFUND_REQUESTED" | "REFUND_REQUEST_ACCEPTED" | "RETURN_DELIVERED" | "RETURN_IN_TRANSIT" | "RETURN_PARCEL_WAITING" | "RETURN_REJECTED" | "UNABLE_TO_DELIVER" | "UNFULFILLED";
49
49
  export type IkasOrderPaymentStatus = "PAID" | "PARTIALLY_PAID" | "WAITING";
50
50
  export type IkasOrderStatus = "CANCELLED" | "CREATED" | "DRAFT" | "PARTIALLY_CANCELLED" | "PARTIALLY_REFUNDED" | "REFUNDED" | "REFUND_REJECTED" | "REFUND_REQUESTED";
51
51
  export type IkasOrderShippingMethod = "CLICK_AND_COLLECT" | "NO_SHIPMENT" | "SHIPMENT" | "DIGITAL_DELIVERY";
@@ -14,6 +14,7 @@ export type IkasStorefrontPopup = {
14
14
  dateFilter: IkasStorefrontPopupDateFilter | null;
15
15
  displayFilters: IkasStorefrontPopupDisplayFilter[] | null;
16
16
  displaySettings: IkasStorefrontPopupDisplaySettings;
17
+ hideFilters: IkasStorefrontPopupDisplayFilter[] | null;
17
18
  name: string;
18
19
  pageFilters: IkasStorefrontPopupPageFilter[] | null;
19
20
  status: IkasStorefrontPopupStatusEnum;
@@ -1,6 +1,7 @@
1
1
  export type IkasStorefrontPopupDisplayFilter = {
2
- operator: string;
2
+ operator: IkasStorefrontPopupDisplayFilterOperatorEnum;
3
3
  type: IkasStorefrontPopupDisplayFilterTypeEnum;
4
- value: string;
4
+ value: string[];
5
5
  };
6
- export type IkasStorefrontPopupDisplayFilterTypeEnum = "CART_TOTAL" | "CUSTOMER_SEGMENT";
6
+ export type IkasStorefrontPopupDisplayFilterTypeEnum = "APPLIED_CAMPAIGN" | "BRAND_IN_CART" | "CART_ITEM_COUNT" | "CART_TOTAL" | "CATEGORY_IN_CART" | "CUSTOMER_AUTH_STATUS" | "CUSTOMER_GENDER" | "CUSTOMER_GROUP" | "CUSTOMER_SEGMENT" | "CUSTOMER_SUBSCRIPTION" | "PRODUCT_IN_CART";
7
+ export type IkasStorefrontPopupDisplayFilterOperatorEnum = "ANY_OF" | "BETWEEN" | "EQUALS" | "GREATER_THAN" | "GREATER_THAN_OR_EQUAL" | "LESS_THAN" | "LESS_THAN_OR_EQUAL" | "NONE_OF" | "NOT_EQUALS";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "0.133.0",
3
+ "version": "1.2.0",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",