@ikas/storefront 5.0.0-beta.2 → 5.0.0-beta.21
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/build/analytics/analytics.d.ts +32 -37
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/events.js +1 -1
- package/build/analytics/facebookPixel.d.ts +11 -15
- package/build/analytics/facebookPixel.js +1 -1
- package/build/analytics/googleAnalytics.d.ts +10 -13
- package/build/analytics/googleAnalytics.js +1 -1
- package/build/analytics/googleTagManager.d.ts +188 -191
- package/build/analytics/googleTagManager.js +1 -1
- package/build/analytics/googleUniversal.d.ts +5 -8
- package/build/analytics/googleUniversal.js +1 -1
- package/build/analytics/head/index.js +1 -1
- package/build/analytics/ikas.d.ts +33 -40
- package/build/analytics/ikas.js +1 -1
- package/build/analytics/index.d.ts +1 -1
- package/build/analytics/tiktokPixel.d.ts +9 -12
- package/build/analytics/tiktokPixel.js +1 -1
- package/build/components/checkout/components/address-form/index.js +1 -1
- package/build/components/checkout/components/address-form/model.d.ts +6 -6
- package/build/components/checkout/components/address-form/model.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/model.d.ts +4 -1
- package/build/components/checkout/components/customer-addresses/model.js +1 -1
- package/build/components/checkout/components/delivery-methods/index.js +1 -1
- package/build/components/checkout/components/epaykolay-button/index.d.ts +5 -0
- package/build/components/checkout/components/epaykolay-button/index.js +1 -0
- package/build/components/checkout/components/epaykolay-button/style.module.scss.js +1 -0
- package/build/components/checkout/components/error/customer-login-required-error/index.js +1 -1
- package/build/components/checkout/components/error/index.js +1 -1
- package/build/components/checkout/components/error/no-shipping-error/index.js +1 -1
- package/build/components/checkout/components/error/payment-error/index.d.ts +1 -1
- package/build/components/checkout/components/error/payment-error/index.js +1 -1
- package/build/components/checkout/components/error/stock-error/index.d.ts +2 -1
- package/build/components/checkout/components/error/stock-error/index.js +1 -1
- package/build/components/checkout/components/error/unknown-error/index.d.ts +1 -1
- package/build/components/checkout/components/error/unknown-error/index.js +1 -1
- package/build/components/checkout/components/expandable-section/index.js +1 -1
- package/build/components/checkout/components/form-item/index.js +1 -1
- package/build/components/checkout/components/klarna/index.js +1 -1
- package/build/components/checkout/components/master-pass/credit-card-form/index.js +1 -1
- package/build/components/checkout/components/master-pass/link-card-to-client/index.js +1 -1
- package/build/components/checkout/components/master-pass/modal-otp/index.js +1 -1
- package/build/components/checkout/components/offer-product/index.d.ts +2 -1
- package/build/components/checkout/components/offer-product/index.js +1 -1
- package/build/components/checkout/components/paypal/index.d.ts +7 -0
- package/build/components/checkout/components/paypal/index.js +1 -0
- package/build/components/checkout/components/paypal/style.module.scss.js +1 -0
- package/build/components/checkout/components/quick-registration/completed.js +1 -1
- package/build/components/checkout/components/quick-registration/index.js +1 -1
- package/build/components/checkout/components/quick-registration/model.js +1 -1
- package/build/components/checkout/components/svg/epaykolay.d.ts +6 -0
- package/build/components/checkout/components/svg/epaykolay.js +1 -0
- package/build/components/checkout/index.d.ts +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +22 -44
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/modelMasterPass.d.ts +13 -23
- package/build/components/checkout/modelMasterPass.js +1 -1
- package/build/components/checkout/steps/step-info/index.js +1 -1
- package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
- package/build/components/checkout/steps/step-payment/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/installments/index.js +1 -1
- package/build/components/checkout/steps/step-payment/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-shipping/index.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/checkout/style.module.scss.js +1 -1
- package/build/components/checkout/types.d.ts +29 -0
- package/build/components/checkout/types.js +1 -0
- package/build/components/google-captcha/index.js +1 -1
- package/build/components/image/index.d.ts +1 -1
- package/build/components/image/index.js +1 -1
- package/build/components/link/index.js +1 -1
- package/build/components/page/ThemeComponent.js +1 -1
- package/build/components/page/functions.d.ts +3 -0
- package/build/components/page/functions.js +1 -0
- package/build/components/page/head.d.ts +1 -1
- package/build/components/page/head.js +1 -1
- package/build/components/page/index.d.ts +4 -3
- package/build/components/page/index.js +1 -1
- package/build/components/page-editor/ThemeComponentEditor.js +1 -1
- package/build/components/page-editor/index.js +1 -1
- package/build/components/page-editor/model.d.ts +5 -1
- package/build/components/page-editor/model.js +1 -1
- package/build/ext/@ikas/fe-api-client/build/utils/api.js +1 -1
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/useCustomerReviews.d.ts +2 -3
- package/build/hooks/useCustomerReviews.js +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -1
- package/build/model-helpers/index.d.ts +5 -0
- package/build/model-helpers/order/line-item/option/value/functions.d.ts +3 -0
- package/build/model-helpers/order/line-item/option/value/functions.js +1 -0
- package/build/model-helpers/product/attribute-value/functions.d.ts +2 -0
- package/build/model-helpers/product/attribute-value/functions.js +1 -0
- package/build/model-helpers/product/functions.d.ts +10 -0
- package/build/model-helpers/product/functions.js +1 -0
- package/build/model-helpers/product/option-set/option/functions.d.ts +2 -0
- package/build/model-helpers/product/option-set/option/functions.js +1 -0
- package/build/model-helpers/product/variant/functions.d.ts +2 -0
- package/build/model-helpers/product/variant/functions.js +1 -0
- package/build/models/data/checkout/index.d.ts +4 -21
- package/build/models/data/index.d.ts +7 -138
- package/build/models/data/localized-customer-address/functions.d.ts +65 -0
- package/build/models/data/localized-customer-address/functions.js +1 -0
- package/build/models/data/localized-customer-address/index.d.ts +6 -0
- package/build/models/data/localized-order-address/functions.d.ts +63 -0
- package/build/models/data/localized-order-address/functions.js +1 -0
- package/build/models/data/localized-order-address/index.d.ts +6 -0
- package/build/models/data/review-form/index.d.ts +6 -0
- package/build/models/data/theme-json/component/index.d.ts +1 -0
- package/build/models/data/theme-json/component/index.js +1 -1
- package/build/models/data/theme-json/custom-data/index.d.ts +1 -2
- package/build/models/data/theme-json/custom-data/index.js +1 -1
- package/build/models/data/theme-json/settings/color/index.js +1 -1
- package/build/models/index.d.ts +1 -0
- package/build/models/ui/blog-category-list/functions.d.ts +6 -0
- package/build/models/ui/blog-category-list/functions.js +1 -0
- package/build/models/ui/blog-category-list/index.d.ts +8 -42
- package/build/models/ui/blog-category-list/index.js +1 -1
- package/build/models/ui/blog-list/functions.d.ts +6 -0
- package/build/models/ui/blog-list/functions.js +1 -0
- package/build/models/ui/blog-list/index.d.ts +9 -45
- package/build/models/ui/blog-list/index.js +1 -1
- package/build/models/ui/brand-list/functions.d.ts +8 -0
- package/build/models/ui/brand-list/functions.js +1 -0
- package/build/models/ui/brand-list/index.d.ts +9 -48
- package/build/models/ui/brand-list/index.js +1 -1
- package/build/models/ui/category-list/functions.d.ts +8 -0
- package/build/models/ui/category-list/functions.js +1 -0
- package/build/models/ui/category-list/index.d.ts +9 -48
- package/build/models/ui/category-list/index.js +1 -1
- package/build/models/ui/customer-review-list/functions.d.ts +7 -0
- package/build/models/ui/customer-review-list/functions.js +1 -0
- package/build/models/ui/customer-review-list/index.d.ts +8 -40
- package/build/models/ui/customer-review-summary-list/functions.d.ts +7 -0
- package/build/models/ui/customer-review-summary-list/functions.js +1 -0
- package/build/models/ui/customer-review-summary-list/index.d.ts +7 -39
- package/build/models/ui/index.d.ts +17 -10
- package/build/models/ui/list-commons/index.d.ts +13 -0
- package/build/models/ui/list-commons/index.js +1 -0
- package/build/models/ui/navigation-link/index.d.ts +3 -3
- package/build/models/ui/navigation-link/index.js +1 -1
- package/build/models/ui/product-attribute-detail/index.d.ts +1 -1
- package/build/models/ui/product-attribute-detail/index.js +1 -1
- package/build/models/ui/product-attribute-list/index.js +1 -1
- package/build/models/ui/product-list/functions.d.ts +32 -0
- package/build/models/ui/product-list/functions.js +1 -0
- package/build/models/ui/product-list/index.d.ts +18 -110
- package/build/models/ui/product-list/index.js +1 -1
- package/build/models/ui/raffle-list/functions.d.ts +6 -0
- package/build/models/ui/raffle-list/functions.js +1 -0
- package/build/models/ui/raffle-list/index.d.ts +14 -50
- package/build/models/ui/validator/form/account-info.js +1 -1
- package/build/models/ui/validator/form/address.js +1 -1
- package/build/models/ui/validator/form/contact-form.js +1 -1
- package/build/models/ui/validator/form/customer-review.js +1 -1
- package/build/models/ui/validator/form/forgot-password.js +1 -1
- package/build/models/ui/validator/form/ikas-address.d.ts +32 -20
- package/build/models/ui/validator/form/ikas-address.js +1 -1
- package/build/models/ui/validator/form/login.js +1 -1
- package/build/models/ui/validator/form/raffle-form.js +1 -1
- package/build/models/ui/validator/form/recover-password.js +1 -1
- package/build/models/ui/validator/form/register.d.ts +10 -1
- package/build/models/ui/validator/form/register.js +1 -1
- package/build/page-data-init/index.d.ts +7 -18
- package/build/page-data-init/index.js +1 -1
- package/build/pages/account/activate.d.ts +4 -0
- package/build/pages/account/activate.js +1 -0
- package/build/pages/checkout.js +1 -1
- package/build/pages/index.d.ts +1 -0
- package/build/store/analytics/index.d.ts +9 -0
- package/build/store/analytics/index.js +1 -0
- package/build/store/base/functions.d.ts +7 -0
- package/build/store/base/functions.js +1 -0
- package/build/store/{base.d.ts → base/index.d.ts} +7 -17
- package/build/store/base/index.js +1 -0
- package/build/store/base/public.d.ts +1 -0
- package/build/store/base/public.js +1 -0
- package/build/store/cart/functions.d.ts +24 -0
- package/build/store/cart/functions.js +1 -0
- package/build/store/cart/index.d.ts +7 -28
- package/build/store/cart/index.js +1 -1
- package/build/store/cart/public.d.ts +1 -0
- package/build/store/cart/public.js +1 -0
- package/build/store/customer/account-auth/data.d.ts +4 -0
- package/build/store/customer/account-auth/data.js +1 -0
- package/build/store/customer/account-auth/functions.d.ts +24 -0
- package/build/store/customer/account-auth/functions.js +1 -0
- package/build/store/customer/account-auth/public.d.ts +1 -0
- package/build/store/customer/captcha/data.d.ts +3 -0
- package/build/store/customer/captcha/data.js +1 -0
- package/build/store/customer/captcha/functions.d.ts +5 -0
- package/build/store/customer/captcha/functions.js +1 -0
- package/build/store/customer/captcha/public.d.ts +1 -0
- package/build/store/customer/consent/data.d.ts +3 -0
- package/build/store/customer/consent/data.js +1 -0
- package/build/store/customer/consent/functions.d.ts +6 -0
- package/build/store/customer/consent/functions.js +1 -0
- package/build/store/customer/consent/public.d.ts +1 -0
- package/build/store/customer/functions.d.ts +4 -0
- package/build/store/customer/functions.js +1 -0
- package/build/store/customer/index.d.ts +8 -82
- package/build/store/customer/index.js +1 -1
- package/build/store/customer/marketing/data.d.ts +3 -0
- package/build/store/customer/marketing/data.js +1 -0
- package/build/store/customer/marketing/functions.d.ts +5 -0
- package/build/store/customer/marketing/functions.js +1 -0
- package/build/store/customer/marketing/public.d.ts +1 -0
- package/build/store/customer/order/data.d.ts +4 -0
- package/build/store/customer/order/data.js +1 -0
- package/build/store/customer/order/functions.d.ts +11 -0
- package/build/store/customer/order/functions.js +1 -0
- package/build/store/customer/order/public.d.ts +1 -0
- package/build/store/customer/product/data.d.ts +17 -0
- package/build/store/customer/product/data.js +1 -0
- package/build/store/customer/product/functions.d.ts +20 -0
- package/build/store/customer/product/functions.js +1 -0
- package/build/store/customer/product/public.d.ts +1 -0
- package/build/store/customer/public.d.ts +8 -0
- package/build/store/customer/public.js +1 -0
- package/build/store/customer/raffle/functions.d.ts +1 -0
- package/build/store/customer/raffle/functions.js +1 -0
- package/build/store/customer/raffle/public.d.ts +1 -0
- package/build/store/index.d.ts +9 -4
- package/build/utils/constants.js +1 -1
- package/build/utils/helper.d.ts +1 -1
- package/build/utils/helper.js +1 -1
- package/build/utils/index.d.ts +1 -2
- package/package.json +17 -13
- package/build/ext/@builder.io/partytown/integration/index.mjs.js +0 -1
- package/build/ext/@builder.io/partytown/react/index.mjs.js +0 -1
- package/build/hooks/useStore.d.ts +0 -2
- package/build/hooks/useStore.js +0 -1
- package/build/models/data/base/index.d.ts +0 -8
- package/build/models/data/base/index.js +0 -1
- package/build/models/data/blog/category/index.d.ts +0 -12
- package/build/models/data/blog/category/index.js +0 -1
- package/build/models/data/blog/content/index.d.ts +0 -6
- package/build/models/data/blog/content/index.js +0 -1
- package/build/models/data/blog/index.d.ts +0 -27
- package/build/models/data/blog/index.js +0 -1
- package/build/models/data/blog/meta-data/index.d.ts +0 -16
- package/build/models/data/blog/meta-data/index.js +0 -1
- package/build/models/data/blog/tag/index.d.ts +0 -6
- package/build/models/data/blog/tag/index.js +0 -1
- package/build/models/data/blog/writer/index.d.ts +0 -6
- package/build/models/data/blog/writer/index.js +0 -1
- package/build/models/data/brand/index.d.ts +0 -26
- package/build/models/data/brand/index.js +0 -1
- package/build/models/data/brand/translation/index.d.ts +0 -7
- package/build/models/data/brand/translation/index.js +0 -1
- package/build/models/data/campaign-offer/index.d.ts +0 -21
- package/build/models/data/campaign-offer/index.js +0 -1
- package/build/models/data/campaign-offer/product/index.d.ts +0 -25
- package/build/models/data/campaign-offer/product/index.js +0 -1
- package/build/models/data/cart/available-shipping-method/index.d.ts +0 -10
- package/build/models/data/cart/available-shipping-method/index.js +0 -1
- package/build/models/data/cart/campaign-offer/index.d.ts +0 -16
- package/build/models/data/cart/campaign-offer/index.js +0 -1
- package/build/models/data/cart/index.d.ts +0 -14
- package/build/models/data/cart/index.js +0 -1
- package/build/models/data/category/index.d.ts +0 -22
- package/build/models/data/category/index.js +0 -1
- package/build/models/data/category/path-item/index.d.ts +0 -14
- package/build/models/data/category/path-item/index.js +0 -1
- package/build/models/data/category/translations/index.d.ts +0 -7
- package/build/models/data/category/translations/index.js +0 -1
- package/build/models/data/checkout/country-settings-model.d.ts +0 -141
- package/build/models/data/checkout/country-settings-model.js +0 -1
- package/build/models/data/checkout/index.js +0 -1
- package/build/models/data/checkout-settings/index.d.ts +0 -21
- package/build/models/data/checkout-settings/index.js +0 -1
- package/build/models/data/checkout-settings/option/index.d.ts +0 -6
- package/build/models/data/checkout-settings/option/index.js +0 -1
- package/build/models/data/checkout-settings/price/index.d.ts +0 -7
- package/build/models/data/checkout-settings/price/index.js +0 -1
- package/build/models/data/city/index.d.ts +0 -12
- package/build/models/data/city/index.js +0 -1
- package/build/models/data/contact-form/index.d.ts +0 -9
- package/build/models/data/contact-form/index.js +0 -1
- package/build/models/data/country/index.d.ts +0 -18
- package/build/models/data/country/index.js +0 -1
- package/build/models/data/country/location-translations/index.d.ts +0 -7
- package/build/models/data/customer/address/city/index.d.ts +0 -7
- package/build/models/data/customer/address/city/index.js +0 -1
- package/build/models/data/customer/address/country/index.d.ts +0 -9
- package/build/models/data/customer/address/country/index.js +0 -1
- package/build/models/data/customer/address/district/index.d.ts +0 -7
- package/build/models/data/customer/address/district/index.js +0 -1
- package/build/models/data/customer/address/ikas-localized-customer-address.d.ts +0 -50
- package/build/models/data/customer/address/ikas-localized-customer-address.js +0 -1
- package/build/models/data/customer/address/index.d.ts +0 -40
- package/build/models/data/customer/address/index.js +0 -1
- package/build/models/data/customer/address/state/index.d.ts +0 -7
- package/build/models/data/customer/address/state/index.js +0 -1
- package/build/models/data/customer/attribute/index.d.ts +0 -18
- package/build/models/data/customer/attribute/index.js +0 -1
- package/build/models/data/customer/attribute/option/index.d.ts +0 -9
- package/build/models/data/customer/attribute/option/index.js +0 -1
- package/build/models/data/customer/attribute/sales-channel/index.d.ts +0 -8
- package/build/models/data/customer/attribute/sales-channel/index.js +0 -1
- package/build/models/data/customer/attribute/translation/index.d.ts +0 -9
- package/build/models/data/customer/attribute/translation/index.js +0 -1
- package/build/models/data/customer/attribute/translation/option/index.d.ts +0 -6
- package/build/models/data/customer/attribute/translation/option/index.js +0 -1
- package/build/models/data/customer/attribute/value/index.d.ts +0 -11
- package/build/models/data/customer/attribute/value/index.js +0 -1
- package/build/models/data/customer/index.d.ts +0 -38
- package/build/models/data/customer/index.js +0 -1
- package/build/models/data/customer/review/index.d.ts +0 -24
- package/build/models/data/customer/review/index.js +0 -1
- package/build/models/data/customer/review/settings/index.d.ts +0 -6
- package/build/models/data/customer/review/settings/index.js +0 -1
- package/build/models/data/customer/review/summary/index.d.ts +0 -10
- package/build/models/data/customer/review/summary/index.js +0 -1
- package/build/models/data/customer/review/summary/star/index.d.ts +0 -6
- package/build/models/data/customer/review/summary/star/index.js +0 -1
- package/build/models/data/district/index.d.ts +0 -12
- package/build/models/data/district/index.js +0 -1
- package/build/models/data/favorite-product/index.d.ts +0 -7
- package/build/models/data/favorite-product/index.js +0 -1
- package/build/models/data/filter-category/index.d.ts +0 -12
- package/build/models/data/filter-category/index.js +0 -1
- package/build/models/data/html-meta-data/index.d.ts +0 -28
- package/build/models/data/html-meta-data/index.js +0 -1
- package/build/models/data/html-meta-data/translations/index.d.ts +0 -7
- package/build/models/data/html-meta-data/translations/index.js +0 -1
- package/build/models/data/image/index.d.ts +0 -10
- package/build/models/data/image/index.js +0 -1
- package/build/models/data/last-viewed-product/index.d.ts +0 -6
- package/build/models/data/last-viewed-product/index.js +0 -1
- package/build/models/data/merchant-settings/index.d.ts +0 -12
- package/build/models/data/merchant-settings/index.js +0 -1
- package/build/models/data/order/address/city/index.d.ts +0 -7
- package/build/models/data/order/address/city/index.js +0 -1
- package/build/models/data/order/address/country/index.d.ts +0 -9
- package/build/models/data/order/address/country/index.js +0 -1
- package/build/models/data/order/address/district/index.d.ts +0 -7
- package/build/models/data/order/address/district/index.js +0 -1
- package/build/models/data/order/address/ikas-localized-order-address.d.ts +0 -32
- package/build/models/data/order/address/ikas-localized-order-address.js +0 -1
- package/build/models/data/order/address/index.d.ts +0 -37
- package/build/models/data/order/address/index.js +0 -1
- package/build/models/data/order/address/state/index.d.ts +0 -7
- package/build/models/data/order/address/state/index.js +0 -1
- package/build/models/data/order/adjustment/applied-order-line/index.d.ts +0 -8
- package/build/models/data/order/adjustment/applied-order-line/index.js +0 -1
- package/build/models/data/order/adjustment/index.d.ts +0 -15
- package/build/models/data/order/adjustment/index.js +0 -1
- package/build/models/data/order/customer/index.d.ts +0 -11
- package/build/models/data/order/customer/index.js +0 -1
- package/build/models/data/order/gift-line/index.d.ts +0 -6
- package/build/models/data/order/gift-line/index.js +0 -1
- package/build/models/data/order/index.d.ts +0 -69
- package/build/models/data/order/index.js +0 -1
- package/build/models/data/order/invoice/index.d.ts +0 -12
- package/build/models/data/order/invoice/index.js +0 -1
- package/build/models/data/order/line-item/base-unit/index.d.ts +0 -9
- package/build/models/data/order/line-item/base-unit/index.js +0 -1
- package/build/models/data/order/line-item/base-unit/unit-type/index.d.ts +0 -6
- package/build/models/data/order/line-item/base-unit/unit-type/index.js +0 -1
- package/build/models/data/order/line-item/discount/index.d.ts +0 -11
- package/build/models/data/order/line-item/discount/index.js +0 -1
- package/build/models/data/order/line-item/index.d.ts +0 -46
- package/build/models/data/order/line-item/index.js +0 -1
- package/build/models/data/order/line-item/option/index.d.ts +0 -10
- package/build/models/data/order/line-item/option/index.js +0 -1
- package/build/models/data/order/line-item/option/value/index.d.ts +0 -9
- package/build/models/data/order/line-item/option/value/index.js +0 -1
- package/build/models/data/order/line-item/variant/brand/index.d.ts +0 -6
- package/build/models/data/order/line-item/variant/brand/index.js +0 -1
- package/build/models/data/order/line-item/variant/category/index.d.ts +0 -12
- package/build/models/data/order/line-item/variant/category/index.js +0 -1
- package/build/models/data/order/line-item/variant/index.d.ts +0 -32
- package/build/models/data/order/line-item/variant/index.js +0 -1
- package/build/models/data/order/line-item/variant/price/index.d.ts +0 -10
- package/build/models/data/order/line-item/variant/price/index.js +0 -1
- package/build/models/data/order/line-item/variant/tag/index.d.ts +0 -6
- package/build/models/data/order/line-item/variant/tag/index.js +0 -1
- package/build/models/data/order/line-item/variant/unit/index.d.ts +0 -6
- package/build/models/data/order/line-item/variant/unit/index.js +0 -1
- package/build/models/data/order/line-item/variant/value/index.d.ts +0 -11
- package/build/models/data/order/line-item/variant/value/index.js +0 -1
- package/build/models/data/order/package/index.d.ts +0 -16
- package/build/models/data/order/package/index.js +0 -1
- package/build/models/data/order/package/tracking-info/index.d.ts +0 -9
- package/build/models/data/order/package/tracking-info/index.js +0 -1
- package/build/models/data/order/payment-method/index.d.ts +0 -9
- package/build/models/data/order/payment-method/index.js +0 -1
- package/build/models/data/order/refund/index.d.ts +0 -7
- package/build/models/data/order/refund/index.js +0 -1
- package/build/models/data/order/refund/line-item/index.d.ts +0 -6
- package/build/models/data/order/refund/line-item/index.js +0 -1
- package/build/models/data/order/refund/settings/index.d.ts +0 -7
- package/build/models/data/order/refund/settings/index.js +0 -1
- package/build/models/data/order/shipping-line/index.d.ts +0 -12
- package/build/models/data/order/shipping-line/index.js +0 -1
- package/build/models/data/order/tax-line/index.d.ts +0 -6
- package/build/models/data/order/tax-line/index.js +0 -1
- package/build/models/data/order/transaction/error/index.d.ts +0 -7
- package/build/models/data/order/transaction/error/index.js +0 -1
- package/build/models/data/order/transaction/index.d.ts +0 -26
- package/build/models/data/order/transaction/index.js +0 -1
- package/build/models/data/order/transaction/payment-method-detail/index.d.ts +0 -13
- package/build/models/data/order/transaction/payment-method-detail/index.js +0 -1
- package/build/models/data/order/transaction/payment-method-detail/installment-price/index.d.ts +0 -9
- package/build/models/data/order/transaction/payment-method-detail/installment-price/index.js +0 -1
- package/build/models/data/payment-gateway/additional-price/index.d.ts +0 -9
- package/build/models/data/payment-gateway/additional-price/index.js +0 -1
- package/build/models/data/payment-gateway/index.d.ts +0 -31
- package/build/models/data/payment-gateway/index.js +0 -1
- package/build/models/data/payment-gateway/settings/index.d.ts +0 -10
- package/build/models/data/payment-gateway/settings/index.js +0 -1
- package/build/models/data/payment-gateway/translation/index.d.ts +0 -7
- package/build/models/data/payment-gateway/translation/index.js +0 -1
- package/build/models/data/product/attribute/index.d.ts +0 -15
- package/build/models/data/product/attribute/index.js +0 -1
- package/build/models/data/product/attribute/option/index.d.ts +0 -6
- package/build/models/data/product/attribute/option/index.js +0 -1
- package/build/models/data/product/attribute/table-cell/index.d.ts +0 -6
- package/build/models/data/product/attribute/table-cell/index.js +0 -1
- package/build/models/data/product/attribute/table-template/index.d.ts +0 -7
- package/build/models/data/product/attribute/table-template/index.js +0 -1
- package/build/models/data/product/attribute/translation/index.d.ts +0 -13
- package/build/models/data/product/attribute/translation/index.js +0 -1
- package/build/models/data/product/attribute-value/index.d.ts +0 -28
- package/build/models/data/product/attribute-value/index.js +0 -1
- package/build/models/data/product/back-in-stock-settings/index.d.ts +0 -5
- package/build/models/data/product/back-in-stock-settings/index.js +0 -1
- package/build/models/data/product/base-unit/index.d.ts +0 -12
- package/build/models/data/product/base-unit/index.js +0 -1
- package/build/models/data/product/campaign/data/index.d.ts +0 -27
- package/build/models/data/product/campaign/data/index.js +0 -1
- package/build/models/data/product/campaign/filter/index.d.ts +0 -7
- package/build/models/data/product/campaign/filter/index.js +0 -1
- package/build/models/data/product/campaign/index.d.ts +0 -7
- package/build/models/data/product/campaign/index.js +0 -1
- package/build/models/data/product/campaign/product-buyx-then-gety/index.d.ts +0 -20
- package/build/models/data/product/campaign/product-buyx-then-gety/index.js +0 -1
- package/build/models/data/product/campaign/product-campaign-date-range-field/index.d.ts +0 -6
- package/build/models/data/product/campaign/product-campaign-date-range-field/index.js +0 -1
- package/build/models/data/product/campaign/product-fixed-discount/index.d.ts +0 -14
- package/build/models/data/product/campaign/product-fixed-discount/index.js +0 -1
- package/build/models/data/product/filter/index.d.ts +0 -82
- package/build/models/data/product/filter/index.js +0 -1
- package/build/models/data/product/image/index.d.ts +0 -10
- package/build/models/data/product/image/index.js +0 -1
- package/build/models/data/product/index.d.ts +0 -77
- package/build/models/data/product/index.js +0 -1
- package/build/models/data/product/option-set/index.d.ts +0 -29
- package/build/models/data/product/option-set/index.js +0 -1
- package/build/models/data/product/option-set/option/index.d.ts +0 -70
- package/build/models/data/product/option-set/option/index.js +0 -1
- package/build/models/data/product/star/index.d.ts +0 -6
- package/build/models/data/product/star/index.js +0 -1
- package/build/models/data/product/stock-location/index.d.ts +0 -8
- package/build/models/data/product/stock-location/index.js +0 -1
- package/build/models/data/product/tag/index.d.ts +0 -6
- package/build/models/data/product/tag/index.js +0 -1
- package/build/models/data/product/variant/index.d.ts +0 -31
- package/build/models/data/product/variant/index.js +0 -1
- package/build/models/data/product/variant/price/index.d.ts +0 -19
- package/build/models/data/product/variant/price/index.js +0 -1
- package/build/models/data/product/variant/unit/index.d.ts +0 -6
- package/build/models/data/product/variant/unit/index.js +0 -1
- package/build/models/data/product/variant-type/index.d.ts +0 -8
- package/build/models/data/product/variant-type/index.js +0 -1
- package/build/models/data/raffle/index.d.ts +0 -63
- package/build/models/data/raffle/index.js +0 -1
- package/build/models/data/sales-channel/index.d.ts +0 -19
- package/build/models/data/sales-channel/index.js +0 -1
- package/build/models/data/state/index.d.ts +0 -11
- package/build/models/data/state/index.js +0 -1
- package/build/models/data/state/location-translations/index.d.ts +0 -7
- package/build/models/data/stock-location/address/city/index.d.ts +0 -7
- package/build/models/data/stock-location/address/city/index.js +0 -1
- package/build/models/data/stock-location/address/country/index.d.ts +0 -7
- package/build/models/data/stock-location/address/country/index.js +0 -1
- package/build/models/data/stock-location/address/district/index.d.ts +0 -7
- package/build/models/data/stock-location/address/district/index.js +0 -1
- package/build/models/data/stock-location/address/index.d.ts +0 -15
- package/build/models/data/stock-location/address/index.js +0 -1
- package/build/models/data/stock-location/address/state/index.d.ts +0 -7
- package/build/models/data/stock-location/address/state/index.js +0 -1
- package/build/models/data/stock-location/available/index.d.ts +0 -10
- package/build/models/data/stock-location/available/index.js +0 -1
- package/build/models/data/stock-location/index.d.ts +0 -14
- package/build/models/data/stock-location/index.js +0 -1
- package/build/models/data/storefront/domain/index.d.ts +0 -9
- package/build/models/data/storefront/domain/index.js +0 -1
- package/build/models/data/storefront/index.d.ts +0 -30
- package/build/models/data/storefront/index.js +0 -1
- package/build/models/data/storefront/localization/index.d.ts +0 -8
- package/build/models/data/storefront/localization/index.js +0 -1
- package/build/models/data/storefront/meta-templates/index.d.ts +0 -8
- package/build/models/data/storefront/meta-templates/index.js +0 -1
- package/build/models/data/storefront/routing/dynamic-currency/index.d.ts +0 -6
- package/build/models/data/storefront/routing/dynamic-currency/index.js +0 -1
- package/build/models/data/storefront/routing/index.d.ts +0 -14
- package/build/models/data/storefront/routing/index.js +0 -1
- package/build/models/data/storefront/theme/index.d.ts +0 -10
- package/build/models/data/storefront/theme/index.js +0 -1
- package/build/models/data/storefront/theme-localization/index.d.ts +0 -15
- package/build/models/data/storefront/theme-localization/index.js +0 -1
- package/build/models/data/variant-type/index.d.ts +0 -13
- package/build/models/data/variant-type/index.js +0 -1
- package/build/models/data/variant-type/variant-value/index.d.ts +0 -12
- package/build/models/data/variant-type/variant-value/index.js +0 -1
- package/build/models/ui/customer-review-list/index.js +0 -1
- package/build/models/ui/customer-review-summary-list/index.js +0 -1
- package/build/models/ui/raffle-list/index.js +0 -1
- package/build/store/base.js +0 -1
- package/build/store/blog/index.d.ts +0 -26
- package/build/store/blog/index.js +0 -1
- package/build/store/brand/index.d.ts +0 -12
- package/build/store/brand/index.js +0 -1
- package/build/store/cart/api.d.ts +0 -10
- package/build/store/cart/api.js +0 -1
- package/build/store/category/index.d.ts +0 -12
- package/build/store/category/index.js +0 -1
- package/build/store/checkout/index.d.ts +0 -16
- package/build/store/checkout/index.js +0 -1
- package/build/store/customer/api.d.ts +0 -54
- package/build/store/customer/api.js +0 -1
- package/build/store/html-meta-data/index.d.ts +0 -6
- package/build/store/html-meta-data/index.js +0 -1
- package/build/store/location/index.d.ts +0 -9
- package/build/store/location/index.js +0 -1
- package/build/store/merchant/index.d.ts +0 -6
- package/build/store/product/index.d.ts +0 -47
- package/build/store/product/index.js +0 -1
- package/build/store/raffle/index.d.ts +0 -15
- package/build/store/raffle/index.js +0 -1
- package/build/store/storefront/index.d.ts +0 -5
- package/build/utils/currency.d.ts +0 -7
- package/build/utils/currency.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as t,computed as s,observable as o,action as i}from"mobx";import{Validator as a}from"../index.js";import{
|
|
1
|
+
import{__awaiter as e,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as t,computed as s,observable as o,action as i}from"mobx";import{Validator as a}from"../index.js";import{login as n}from"../../../../store/customer/account-auth/functions.js";import{RequiredRule as l,EmailRule as u,MinRule as d}from"../rules/index.js";var m=function(){function m(e){var r=this;this.model={email:"",password:""},this.onEmailChange=function(e){r.email=e},this.onPasswordChange=function(e){r.password=e},t(this,{emailErrorMessage:s,passwordErrorMessage:s,hasError:s,redirect:s,email:s,password:s,model:o,validateAll:i,login:i}),this.validator=new a(this.model,[new l({fieldKey:"email",valuePath:"email",message:e.message.requiredRule}),new l({fieldKey:"password",valuePath:"password",message:e.message.requiredRule}),new u({fieldKey:"email",valuePath:"email",message:e.message.emailRule}),new d({fieldKey:"password",valuePath:"password",minValue:6,message:e.message.minRule})])}return Object.defineProperty(m.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"email",{get:function(){return this.model.email},set:function(e){this.model.email=e},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"password",{get:function(){return this.model.password},set:function(e){this.model.password=e},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),m.prototype.validateAll=function(){return this.validator.validateAll()},m.prototype.login=function(){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e={isFormError:!1,isSuccess:!1},[4,this.validateAll()];case 1:if(r.sent())return e.isFormError=!0,[2,e];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,n(this.model.email,this.model.password)];case 3:return r.sent()&&(e.isSuccess=!0),[2,e];case 4:return r.sent(),[2,e];case 5:return[2]}}))}))},m}();export{m as LoginForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{saveRaffleParticipant as r}from"@ikas/storefront-api";import{makeObservable as
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{saveRaffleParticipant as r}from"@ikas/storefront-api";import{makeObservable as i,computed as a,observable as o,action as s}from"mobx";import{Validator as n}from"../index.js";import"../../../../store/base/index.js";import"@ikas/storefront-config";import"lodash/flatten";import"lodash/sortBy";import{IkasProductFunctions as l}from"@ikas/storefront-model-functions";import"../../../../store/cart/index.js";import"../../../../components/checkout/types.js";import{IkasCustomerStore as u}from"../../../../store/customer/index.js";import"../../../../analytics/events.js";import"lodash/cloneDeep";import"../../../../store/analytics/index.js";import"../../../../analytics/ikas.js";import"../../../../store/customer/consent/data.js";import"../../../../analytics/head/index.js";import"../../../../store/customer/account-auth/data.js";import"../../../../store/customer/captcha/data.js";import"../../../../store/customer/product/data.js";import"lodash/xorBy";import'./../../../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../../../ext/axios/index.js';import'./../../../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import"@ikas/storefront-models";import"@ikas/localized-address";import"../../../../store/customer/marketing/data.js";import"../../../../store/customer/order/data.js";import"@ikas/storefront-providers";import{RequiredRule as m,EmailRule as d,PhoneRule as f,MinRule as c,MaxRule as p,IdentityNumberRule as h}from"../rules/index.js";var b=function(){function b(e){var t,r,l,b=this;this.model={firstName:(null===(t=u.customer)||void 0===t?void 0:t.firstName)||"",lastName:(null===(r=u.customer)||void 0===r?void 0:r.lastName)||"",email:(null===(l=u.customer)||void 0===l?void 0:l.email)||"",extraData:{birthYear:null,identityNumber:null},phone:""},this.onFirstNameChange=function(e){b.firstName=e},this.onLastNameChange=function(e){b.lastName=e},this.onEmailChange=function(e){b.email=e},this.onBirthYearChange=function(e){b.birthYear=e},this.onIdentityNumberChange=function(e){b.identityNumber=e},this.onPhoneChange=function(e){b.phone=e},i(this,{emailErrorMessage:a,firstNameErrorMessage:a,lastNameErrorMessage:a,birthYearErrorMessage:a,identityNumberErrorMessage:a,hasValidatorError:a,results:a,redirect:a,model:o,validateAll:s}),this.raffle=e.raffle,this.validator=new n(this.model,[new m({fieldKey:"firstName",valuePath:"firstName",message:e.message.requiredRule}),new m({fieldKey:"lastName",valuePath:"lastName",message:e.message.requiredRule}),new m({fieldKey:"email",valuePath:"email",message:e.message.requiredRule}),new m({fieldKey:"birthYear",valuePath:"extraData.birthYear",message:e.message.requiredRule}),new m({fieldKey:"identityNumber",valuePath:"extraData.identityNumber",message:e.message.requiredRule}),new d({fieldKey:"email",valuePath:"email",message:e.message.emailRule}),new f({fieldKey:"phone",valuePath:"phone",message:e.message.phoneRule}),new c({fieldKey:"birthYear",valuePath:"extraData.birthYear",message:e.message.birthdayRule,minValue:1e3}),new p({fieldKey:"birthYear",valuePath:"extraData.birthYear",message:e.message.birthdayRule,maxValue:9999}),new h({fieldKey:"identityNumber",valuePath:"extraData.identityNumber",message:e.message.identityNumberRule})])}return Object.defineProperty(b.prototype,"firstName",{get:function(){return this.model.firstName},set:function(e){this.model.firstName=e},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"lastName",{get:function(){return this.model.lastName},set:function(e){this.model.lastName=e},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"email",{get:function(){return this.model.email},set:function(e){this.model.email=e},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"birthYear",{get:function(){return this.model.extraData.birthYear},set:function(e){this.model.extraData.birthYear=e},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"identityNumber",{get:function(){return this.model.extraData.identityNumber},set:function(e){this.model.extraData.identityNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"phone",{get:function(){return this.model.phone},set:function(e){this.model.phone=e},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"firstNameErrorMessage",{get:function(){return this.validator.results.firstName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"lastNameErrorMessage",{get:function(){return this.validator.results.lastName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"birthYearErrorMessage",{get:function(){return this.validator.results.birthYear.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"identityNumberErrorMessage",{get:function(){return this.validator.results.identityNumber.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"phoneErrorMessage",{get:function(){return this.validator.results.phone.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"hasValidatorError",{get:function(){var e;return this.validator.hasError||!(null===(e=this.raffle.variants)||void 0===e?void 0:e.length)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"results",{get:function(){return this.validator.results},enumerable:!1,configurable:!0}),b.prototype.validateAll=function(){return this.validator.validateAll()},b.prototype.submit=function(){return e(this,void 0,void 0,(function(){var e,i,a,o,s;return t(this,(function(t){switch(t.label){case 0:return e={isFormError:!1,isSuccess:!1},[4,this.validateAll()];case 1:if(t.sent())return e.isFormError=!0,[2,e];t.label=2;case 2:return t.trys.push([2,4,,5]),i=l.getSelectedVariant,a=i(this.raffle.products[0]),[4,r({input:{appliedProduct:{productId:a.productId,variantId:a.id},email:this.email,firstName:this.firstName,lastName:this.lastName,raffleId:this.raffle.id,extraData:{birthYear:this.birthYear,identityNumber:this.identityNumber},phone:this.phone}})];case 3:return(null==(o=t.sent())?void 0:o.graphQLErrors)&&(e.errors=o.graphQLErrors,e.isSuccess=!1),o.data&&(e.isSuccess=!0),[2,e];case 4:return(s=t.sent())&&(e.errors=s),[2,e];case 5:return[2]}}))}))},b}();export{b as RaffleForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as o,observable as
|
|
1
|
+
import{__awaiter as e,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as o,observable as a,action as t}from"mobx";import{Validator as n}from"../index.js";import{recoverPassword as i}from"../../../../store/customer/account-auth/functions.js";import{RequiredRule as d,MinRule as u,EqualsRule as l}from"../rules/index.js";var p=function(){function p(e){var r=this;this.model={password:"",passwordAgain:""},this.onPasswordChange=function(e){r.password=e},this.onPasswordAgainChange=function(e){r.passwordAgain=e},s(this,{passwordErrorMessage:o,passwordAgainErrorMessage:o,hasError:o,redirect:o,password:o,passwordAgain:o,model:a,validateAll:t,submit:t,resetModel:t}),this.validator=new n(this.model,[new d({fieldKey:"password",valuePath:"password",message:e.message.requiredRule}),new d({fieldKey:"passwordAgain",valuePath:"passwordAgain",message:e.message.requiredRule}),new u({fieldKey:"password",valuePath:"password",minValue:6,message:e.message.minRule}),new u({fieldKey:"passwordAgain",valuePath:"passwordAgain",minValue:6,message:e.message.minRule}),new l({fieldKey:"passwordAgain",valuePath:"passwordAgain",equalsValuePath:"password",message:e.message.equalsRule})])}return p.prototype.resetModel=function(){this.model.password="",this.model.passwordAgain=""},Object.defineProperty(p.prototype,"password",{get:function(){return this.model.password},set:function(e){this.model.password=e},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"passwordAgain",{get:function(){return this.model.passwordAgain},set:function(e){this.model.passwordAgain=e},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"passwordAgainErrorMessage",{get:function(){return this.validator.results.passwordAgain.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),p.prototype.validateAll=function(){return this.validator.validateAll()},p.prototype.submit=function(){return e(this,void 0,void 0,(function(){var e,s,o;return r(this,(function(r){switch(r.label){case 0:return e="",s={isFormError:!1,isSuccess:!1},[4,this.validateAll()];case 1:if(r.sent())return s.isFormError=!0,[2,s];"undefined"!=typeof window&&(o=new URLSearchParams(window.location.search),e=o.get("token")||""),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,i(this.model.password,this.model.passwordAgain,e)];case 3:return r.sent()&&(s.isSuccess=!0),[2,s];case 4:return r.sent(),[2,s];case 5:return[2]}}))}))},p}();export{p as RecoverPasswordForm};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { EmailRule, MinRule, PhoneRule, RequiredRule } from "../rules";
|
|
1
2
|
import { IkasCustomerAttribute, IkasCustomerAttributeValue } from "../../../data";
|
|
2
3
|
declare type RegisterFormPropsValidatorMessage<T> = {
|
|
3
4
|
requiredRule: ((model: T) => string) | string;
|
|
4
5
|
emailRule: ((model: T) => string) | string;
|
|
5
6
|
minRule: ((model: T) => string) | string;
|
|
7
|
+
phoneRule?: ((model: T) => string) | string;
|
|
6
8
|
};
|
|
7
9
|
declare type RegisterFormProps<T> = {
|
|
8
10
|
message: RegisterFormPropsValidatorMessage<T>;
|
|
@@ -14,6 +16,7 @@ declare type RegisterFormModel = {
|
|
|
14
16
|
password: string;
|
|
15
17
|
attributes?: IkasCustomerAttributeValue[];
|
|
16
18
|
isMarketingAccepted?: boolean;
|
|
19
|
+
phone?: string | null;
|
|
17
20
|
};
|
|
18
21
|
declare type AttributeValue = {
|
|
19
22
|
isChecked?: boolean;
|
|
@@ -36,6 +39,7 @@ export declare class RegisterForm {
|
|
|
36
39
|
private isFormSubmit;
|
|
37
40
|
private _customerAttributes;
|
|
38
41
|
constructor(props: RegisterFormProps<RegisterFormModel>);
|
|
42
|
+
validatorRules: (includePhoneRule?: boolean) => (RequiredRule<RegisterFormModel> | EmailRule<RegisterFormModel> | MinRule<RegisterFormModel> | PhoneRule<RegisterFormModel>)[];
|
|
39
43
|
get firstName(): string;
|
|
40
44
|
set firstName(value: string);
|
|
41
45
|
get lastName(): string;
|
|
@@ -46,11 +50,14 @@ export declare class RegisterForm {
|
|
|
46
50
|
set password(value: string);
|
|
47
51
|
get isMarketingAccepted(): boolean | undefined;
|
|
48
52
|
set isMarketingAccepted(value: boolean | undefined);
|
|
53
|
+
get phone(): string | null | undefined;
|
|
54
|
+
set phone(value: string | null | undefined);
|
|
49
55
|
get hasError(): boolean;
|
|
50
56
|
get firstNameErrorMessage(): string | undefined;
|
|
51
57
|
get lastNameErrorMessage(): string | undefined;
|
|
52
58
|
get emailErrorMessage(): string | undefined;
|
|
53
59
|
get passwordErrorMessage(): string | undefined;
|
|
60
|
+
get phoneErrorMessage(): string | undefined;
|
|
54
61
|
get attributes(): IkasCustomerAttributeValue[] | undefined;
|
|
55
62
|
set attributes(attributes: IkasCustomerAttributeValue[] | undefined);
|
|
56
63
|
get redirect(): string | null | undefined;
|
|
@@ -59,6 +66,7 @@ export declare class RegisterForm {
|
|
|
59
66
|
onLastNameChange: (value: string) => void;
|
|
60
67
|
onEmailChange: (value: string) => void;
|
|
61
68
|
onPasswordChange: (value: string) => void;
|
|
69
|
+
onPhoneChange: (value: string) => void;
|
|
62
70
|
setCustomerAttributes: (customerAttributes: IkasCustomerAttribute[]) => void;
|
|
63
71
|
private getAttributeValue;
|
|
64
72
|
onAttributeChange: (attributeId: string, value: boolean | string | string[]) => void;
|
|
@@ -66,8 +74,9 @@ export declare class RegisterForm {
|
|
|
66
74
|
private validateCustomerAttribute;
|
|
67
75
|
validateAll(): Promise<boolean | undefined>;
|
|
68
76
|
register(): Promise<{
|
|
69
|
-
isFormError: boolean;
|
|
70
77
|
isSuccess: boolean;
|
|
78
|
+
errorCodes: import("@ikas/storefront-api").IkasRegisterError[];
|
|
79
|
+
isFormError: boolean;
|
|
71
80
|
}>;
|
|
72
81
|
}
|
|
73
82
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as
|
|
1
|
+
import{__awaiter as e,__generator as t,__spreadArray as r,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as o,observable as a,action as u}from"mobx";import{Validator as n}from"../index.js";import{PhoneRule as l,RequiredRule as d,EmailRule as m,MinRule as c}from"../rules/index.js";import{IkasCustomerAttributeType as p,IkasCustomerAttributeRegisterPageRequirement as f}from"@ikas/storefront-models";import"@ikas/localized-address";import{register as b}from"../../../../store/customer/account-auth/functions.js";import{IkasCustomerAttributeFunctions as h}from"@ikas/storefront-model-functions";var g=function(){function g(e){var t=this;this.model={firstName:"",lastName:"",email:"",password:"",attributes:void 0,isMarketingAccepted:!1,phone:null},this.isFormSubmit=!1,this._customerAttributes=void 0,this.validatorRules=function(e){return void 0===e&&(e=!1),r([new d({fieldKey:"firstName",valuePath:"firstName",message:t.message.requiredRule}),new d({fieldKey:"lastName",valuePath:"lastName",message:t.message.requiredRule}),new d({fieldKey:"email",valuePath:"email",message:t.message.requiredRule}),new d({fieldKey:"password",valuePath:"password",message:t.message.requiredRule}),new m({fieldKey:"email",valuePath:"email",message:t.message.emailRule}),new c({fieldKey:"password",valuePath:"password",minValue:6,message:t.message.minRule})],e?[new l({fieldKey:"phone",valuePath:"phone",message:t.message.phoneRule})]:[],!0)},this.onFirstNameChange=function(e){t.firstName=e},this.onLastNameChange=function(e){t.lastName=e},this.onEmailChange=function(e){t.email=e},this.onPasswordChange=function(e){t.password=e},this.onPhoneChange=function(e){t.phone=e},this.setCustomerAttributes=function(e){var r=h.getCustomerAttributeRegisterPageRequirement;t._customerAttributes=(null==e?void 0:e.filter((function(e){return r(e)!==f.INVISIBLE})).map((function(e){return{attribute:e,attributeValue:{isChecked:void 0,value:void 0,selectedIdList:void 0},validator:{isRequired:r(e)===f.MANDATORY,hasError:!1,message:""}}})))||[]},this.onAttributeChange=function(e,r){var i;if(t._customerAttributes){var s=t._customerAttributes.find((function(t){return t.attribute.id===e}));if(s){var o=null===(i=t._customerAttributes)||void 0===i?void 0:i.findIndex((function(t){return t.attribute.id===e}));void 0!==o&&-1!==o&&(t._customerAttributes[o].attributeValue=t.getAttributeValue(s.attribute,r),t.validateCustomerAttribute())}}},s(this,{emailErrorMessage:o,passwordErrorMessage:o,firstNameErrorMessage:o,lastNameErrorMessage:o,phoneErrorMessage:o,hasError:o,redirect:o,model:a,validateAll:u,register:u,customerAttributes:o,_customerAttributes:a}),this.message=e.message,this.validator=new n(this.model,this.validatorRules())}return Object.defineProperty(g.prototype,"firstName",{get:function(){return this.model.firstName},set:function(e){this.model.firstName=e},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"lastName",{get:function(){return this.model.lastName},set:function(e){this.model.lastName=e},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"email",{get:function(){return this.model.email},set:function(e){this.model.email=e},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"password",{get:function(){return this.model.password},set:function(e){this.model.password=e},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"isMarketingAccepted",{get:function(){return this.model.isMarketingAccepted},set:function(e){this.model.isMarketingAccepted=e},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"phone",{get:function(){return this.model.phone},set:function(e){this.model.phone=e},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"firstNameErrorMessage",{get:function(){return this.validator.results.firstName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"lastNameErrorMessage",{get:function(){return this.validator.results.lastName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"phoneErrorMessage",{get:function(){var e;return null===(e=this.validator.results.phone)||void 0===e?void 0:e.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"attributes",{get:function(){return this.model.attributes},set:function(e){this.model.attributes=e},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"customerAttributes",{get:function(){return this._customerAttributes},enumerable:!1,configurable:!0}),g.prototype.getAttributeValue=function(e,t){var r={isChecked:void 0,value:void 0,selectedIdList:void 0};if("string"!=typeof t||e.type!==p.TEXT&&e.type!==p.DATETIME&&e.type!==p.CHOICE||(r.value=t),"string"==typeof t&&e.type===p.NUMERIC){var i=parseInt(t);isNaN(i)?r.value=r.value||"":r.value=t}return"boolean"==typeof t&&e.type===p.BOOLEAN&&(r.isChecked=t),"object"==typeof t&&e.type===p.MULTIPLE_CHOICE&&(r.selectedIdList=t),r},Object.defineProperty(g.prototype,"formattedAttributesInput",{get:function(){if(!this._customerAttributes)return null;if(!this._customerAttributes.some((function(e){return void 0!==e.attributeValue.value||void 0!==e.attributeValue.isChecked||void 0!==e.attributeValue.selectedIdList})))return null;var e=[];return this._customerAttributes.map((function(t){var r=t.attributeValue,i=r.selectedIdList,s=r.isChecked,o=r.value;void 0!==i&&p.MULTIPLE_CHOICE&&i.map((function(r){e.push({customerAttributeId:t.attribute.id,customerAttributeOptionId:r,value:null})})),t.attribute.type===p.BOOLEAN&&e.push({customerAttributeId:t.attribute.id,customerAttributeOptionId:null,value:s?s.toString():"false"}),void 0!==o&&(t.attribute.type!==p.TEXT&&t.attribute.type!==p.NUMERIC||e.push({customerAttributeId:t.attribute.id,customerAttributeOptionId:null,value:o.toString()}),t.attribute.type===p.CHOICE&&e.push({customerAttributeId:t.attribute.id,customerAttributeOptionId:o,value:null}),t.attribute.type===p.DATETIME&&e.push({customerAttributeId:t.attribute.id,customerAttributeOptionId:null,value:new Date(o).getTime().toString()}))})),e},enumerable:!1,configurable:!0}),g.prototype.validateCustomerAttribute=function(){var e,t=this;this._customerAttributes=null===(e=this._customerAttributes)||void 0===e?void 0:e.map((function(e){var r;return e.validator.isRequired&&t.isFormSubmit&&(e.attribute.type===p.BOOLEAN||e.attributeValue.value||(null===(r=e.attributeValue.selectedIdList)||void 0===r?void 0:r.length)?(e.validator.hasError=!1,e.validator.message=""):(e.validator.hasError=!0,e.validator.message="string"==typeof t.message.requiredRule?t.message.requiredRule:t.message.requiredRule(t.model))),e}))},g.prototype.validateAll=function(){var r;return e(this,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return this.validateCustomerAttribute(),[4,this.validator.validateAll()];case 1:return e=t.sent(),i=null===(r=this._customerAttributes)||void 0===r?void 0:r.some((function(e){return e.validator.hasError})),[2,e||i]}}))}))},g.prototype.register=function(){return e(this,void 0,void 0,(function(){var e,r;return t(this,(function(t){switch(t.label){case 0:return this.isFormSubmit=!0,e={isFormError:!1,isSuccess:!1,errorCodes:[]},this.phone&&this.validator.setRules(this.validatorRules(!0)),[4,this.validateAll()];case 1:if(t.sent())return e.isFormError=!0,[2,e];t.label=2;case 2:return t.trys.push([2,4,,5]),[4,b(this.model.firstName,this.model.lastName,this.model.email,this.model.password,this.model.isMarketingAccepted,this.model.attributes||this.formattedAttributesInput||void 0,this.model.phone)];case 3:return r=t.sent(),[2,i(i({},e),r)];case 4:return t.sent(),[2,e];case 5:return[2]}}))}))},g}();export{g as RegisterForm};
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
import { IkasCategoryListParams } from "../models/ui/category-list";
|
|
2
1
|
import { IkasAttributeList } from "../models/ui/product-attribute-list";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { IkasAttributeDetail, IkasComponentRenderer, IkasProduct } from "../models";
|
|
3
|
+
import { IkasPageComponentPropValue, IkasSimplePageComponentPropValue, IkasAttributePropValueData, IkasAttributeListPropValueData, IkasBlogPropValueData, IkasBrandPropValueData, IkasCategoryPropValueData, IkasBlogCategoryPropValueData, IkasCustomDataPropValueData, IkasRafflePropValueData, IkasProductPropValueData } from "@ikas/storefront-providers";
|
|
4
|
+
import { IkasThemeJsonComponent, IkasThemeJsonPageType } from "@ikas/storefront-models";
|
|
5
|
+
import { IkasThemeJsonCustomData } from "../models/data/theme-json/custom-data";
|
|
6
|
+
import { IkasThemeJsonSettings } from "../models/data/theme-json/settings";
|
|
7
|
+
import { IkasThemeJsonComponentProp } from "../models/data/theme-json/component/prop";
|
|
8
8
|
export declare class IkasPageDataInit {
|
|
9
9
|
static pageSpecificData: any;
|
|
10
10
|
static flatCustomDataList: IkasThemeJsonCustomData[];
|
|
11
11
|
static isBrowser: boolean;
|
|
12
|
-
static setPageSpecificData(pageSpecificData: any, pageType: IkasThemeJsonPageType, isBrowser: boolean):
|
|
13
|
-
static isServer(): boolean;
|
|
12
|
+
static setPageSpecificData(pageSpecificData: any, pageType: IkasThemeJsonPageType, isBrowser: boolean): any;
|
|
14
13
|
static initPagePropValues(pageComponentPropValues: IkasSimplePageComponentPropValue[] | IkasPageComponentPropValue[], components: IkasThemeJsonComponent[], customDataList: IkasThemeJsonCustomData[], settings: IkasThemeJsonSettings, isBrowser?: boolean): IkasPageComponentPropValue[];
|
|
15
14
|
static initPageComponentPropValue(pageComponentPropValue: IkasSimplePageComponentPropValue | IkasPageComponentPropValue, components: IkasThemeJsonComponent[], settings: IkasThemeJsonSettings, isBrowser?: boolean): IkasPageComponentPropValue;
|
|
16
15
|
static initPropValue(prop: IkasThemeJsonComponentProp, propValue: any, settings: IkasThemeJsonSettings, isBrowser?: boolean): any;
|
|
17
16
|
static initBrandPropValue(propValue: IkasBrandPropValueData): any;
|
|
18
|
-
static initBrandListPropValue(propValue: IkasBrandListParams): IkasBrandList;
|
|
19
17
|
static initCategoryPropValue(propValue: IkasCategoryPropValueData): any;
|
|
20
|
-
static initCategoryListPropValue(propValue: IkasCategoryListParams): IkasCategoryList;
|
|
21
|
-
static initProductListPropValue(propValue: IkasProductListParams): IkasProductList;
|
|
22
18
|
static initProductPropValue(propValue: IkasProductPropValueData): IkasProduct;
|
|
23
19
|
static _initProductOnBrowser(product: IkasProduct): void;
|
|
24
20
|
static initAttributePropValue(propValue: IkasAttributePropValueData): IkasAttributeDetail;
|
|
25
21
|
static initAttributeListPropValue(propValue: IkasAttributeListPropValueData): IkasAttributeList;
|
|
26
|
-
static initLinkPropValue(propValue: IkasNavigationLink | IkasNavigationLink[]): IkasNavigationLink | IkasNavigationLink[] | undefined;
|
|
27
|
-
static initImagePropValue(propValue: IkasImage): IkasImage;
|
|
28
|
-
static initImageListPropValue(propValue: IkasImage[]): IkasImage[];
|
|
29
22
|
static initCustomDataPropValue(customDataValue: IkasCustomDataPropValueData | undefined, settings: IkasThemeJsonSettings, isBrowser?: boolean): any;
|
|
30
23
|
static _initCustomDataPropValue(customDataValue: IkasCustomDataPropValueData | undefined, customData: IkasThemeJsonCustomData, settings: IkasThemeJsonSettings, isBrowser?: boolean): any;
|
|
31
24
|
static initComponentPropValue(propValue: IkasPageComponentPropValue[], settings: IkasThemeJsonSettings, isBrowser?: boolean): IkasComponentRenderer | undefined;
|
|
@@ -33,10 +26,6 @@ export declare class IkasPageDataInit {
|
|
|
33
26
|
static initComponentListPropValue(propValue: IkasPageComponentPropValue[], settings: IkasThemeJsonSettings, isBrowser?: boolean): IkasComponentRenderer[];
|
|
34
27
|
static _initComponentListPropValue(propValue: IkasPageComponentPropValue[], settings: IkasThemeJsonSettings, isBrowser?: boolean): IkasComponentRenderer[];
|
|
35
28
|
static initBlogPropValue(propValue: IkasBlogPropValueData): any;
|
|
36
|
-
static initBlogListPropValue(propValue: IkasBlogListParams): IkasBlogList;
|
|
37
29
|
static initBlogCategoryPropValue(propValue: IkasBlogCategoryPropValueData): any;
|
|
38
|
-
static initBlogCategoryListPropValue(propValue: IkasBlogCategoryListParams): IkasBlogCategoryList;
|
|
39
30
|
static initRafflePropValue(propValue: IkasRafflePropValueData): any;
|
|
40
|
-
static initRaffleListPropValue(propValue: IkasRaffleListParams): IkasRaffleList;
|
|
41
|
-
static initSliderPropValue(propValue: IkasSliderPropValueData): IkasSliderPropValueData;
|
|
42
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from'./../ext/tslib/tslib.es6.js';import{renderComponent as e}from"../components/page/index.js";import{IkasAttributeList as i}from"../models/ui/product-attribute-list/index.js";import{IkasBlogCategory as a}from"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import{IkasBlog as r}from"../models/data/blog/index.js";import{IkasBrand as o}from"../models/data/brand/index.js";import{IkasThemeJsonPageType as n,IkasThemeJsonComponentPropType as s}from"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import{IkasCategory as u}from"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout/country-settings-model.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import{IkasImage as l}from"../models/data/image/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as d}from"../models/data/product/index.js";import{IkasRaffle as p}from"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/custom-data/index.js";import{IkasThemeJsonPageComponent as m}from"../models/data/theme-json/page/component/index.js";import"../models/data/variant-type/variant-value/index.js";import{IkasBlogList as c}from"../models/ui/blog-list/index.js";import{IkasBlogCategoryList as f}from"../models/ui/blog-category-list/index.js";import{IkasBrandList as P}from"../models/ui/brand-list/index.js";import{IkasCategoryList as g}from"../models/ui/category-list/index.js";import{IkasNavigationLink as V}from"../models/ui/navigation-link/index.js";import{IkasProductList as L}from"../models/ui/product-list/index.js";import{IkasAttributeDetail as j}from"../models/ui/product-attribute-detail/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import{IkasComponentRenderer as v}from"../models/ui/component-renderer/index.js";import{IkasRaffleList as D}from"../models/ui/raffle-list/index.js";import{IkasPageComponentPropValue as h,getPlaceholderBrand as x,getPlaceholderCategory as C,getPlaceholderProduct as T,getPlaceholderBlog as S,getPlaceholderBlogCategory as w,getPlaceholderRaffle as I}from"@ikas/storefront-providers";import b from"lodash/flatten";import{IkasBaseStore as y}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";var _=function(){function _(){}return _.setPageSpecificData=function(e,i,o){if(this.isBrowser=o,e)switch(i){case n.PRODUCT:var s=e;_.pageSpecificData=new d(t(t({},s),{selectedVariantValues:s.selectedVariantValues||s.variants[0].variantValues})),o&&this._initProductOnBrowser(_.pageSpecificData);break;case n.CATEGORY:var l=e;_.pageSpecificData=new u(l);break;case n.BRAND:var m=e;_.pageSpecificData=new u(m);break;case n.BLOG:var c=e;_.pageSpecificData=new r(c);break;case n.BLOG_CATEGORY:var f=e;_.pageSpecificData=new a(f);break;case n.RAFFLE_DETAIL:var P=e;_.pageSpecificData=new p(P)}else this.pageSpecificData=void 0},_.isServer=function(){return"undefined"==typeof window},_.initPagePropValues=function(t,e,i,a,r){return this.flatCustomDataList=b(i.map((function(t){return t.flat}))),t.map((function(t){return _.initPageComponentPropValue(t,e,a,r)}))},_.initPageComponentPropValue=function(e,i,a,r){var o=i.find((function(t){return t.id===e.pageComponent.componentId})),n=null==o?void 0:o.props,s={};return null==n||n.map((function(t){var i=e.propValues[t.name];s[t.name]=_.initPropValue(t,i,a,r)})),new h(t(t({},e),{pageComponent:new m(t(t({},e.pageComponent),{propValues:s,componentId:o.id})),component:o,propValues:s}))},_.initPropValue=function(t,e,i,a){if(null==e)return null;switch(t.type){case s.IMAGE:return _.initImagePropValue(e);case s.IMAGE_LIST:return _.initImageListPropValue(e);case s.BRAND:return _.initBrandPropValue(e);case s.BRAND_LIST:return _.initBrandListPropValue(e);case s.CATEGORY:return _.initCategoryPropValue(e);case s.CATEGORY_LIST:return _.initCategoryListPropValue(e);case s.PRODUCT_LIST:return _.initProductListPropValue(e);case s.PRODUCT_DETAIL:return _.initProductPropValue(e);case s.PRODUCT_ATTRIBUTE:return _.initAttributePropValue(e);case s.PRODUCT_ATTRIBUTE_LIST:return _.initAttributeListPropValue(e);case s.LINK:case s.LIST_OF_LINK:return _.initLinkPropValue(e);case s.COMPONENT:return _.initComponentPropValue(e,i,a);case s.COMPONENT_LIST:return _.initComponentListPropValue(e,i,a);case s.CUSTOM:return _.initCustomDataPropValue(e,i,a);case s.BLOG:return _.initBlogPropValue(e);case s.BLOG_LIST:return _.initBlogListPropValue(e);case s.BLOG_CATEGORY:return _.initBlogCategoryPropValue(e);case s.BLOG_LIST:return _.initBlogCategoryListPropValue(e);case s.RAFFLE:return _.initRafflePropValue(e);case s.RAFFLE_LIST:return _.initRaffleListPropValue(e);case s.SLIDER:return _.initSliderPropValue(e);default:return e}},_.initBrandPropValue=function(t){return t.brandPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.brand?new o(t.brand):x()},_.initBrandListPropValue=function(t){return new P(t)},_.initCategoryPropValue=function(t){return t.categoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.category?new u(t.category):C()},_.initCategoryListPropValue=function(t){return new g(t)},_.initProductListPropValue=function(t){return new L(t,y.getInstance().router)},_.initProductPropValue=function(e){var i=new d(T());if(e.productDetailPropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(e.productDetail){var a=e.productDetail;i=new d(t(t({},a),{selectedVariantValues:a.selectedVariantValues}))}return i},_._initProductOnBrowser=function(t){var e=new URLSearchParams(window.location.search),i=e.get("vid");if(i){var a=t.variants.find((function(t){return t.id===i}));a&&(t.selectedVariantValues=a.variantValues)}else{var r=t.variantTypes.map((function(t){return t.variantType.slug})),o=[];r.forEach((function(i,a){var r=t.variantTypes[a],n=e.get(i);if(n){var s=r.variantType.values.find((function(t){return t.slug===n}));s&&o.push(s)}})),o.length===t.selectedVariantValues.length&&(t.selectedVariantValues=o)}},_.initAttributePropValue=function(e){var i=null;if(e.attributePropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(e.productDetail){var a=e.productDetail;i=new d(t(t({},a),{selectedVariantValues:a.selectedVariantValues}))}return new j(i,e.attributePropValue)},_.initAttributeListPropValue=function(e){var a=null;if(e.attributeListPropValue.usePageData&&this.pageSpecificData)a=this.pageSpecificData;else if(e.productDetail){var r=e.productDetail;a=new d(t(t({},r),{selectedVariantValues:r.selectedVariantValues}))}return new i(a,e.attributeListPropValue)},_.initLinkPropValue=function(t){return Array.isArray(t)?t.map((function(t){return new V(t.href,t.label,t.subLinks,t.isExternal||void 0)})):t?new V(t.href,t.label,t.subLinks,t.isExternal||void 0):void 0},_.initImagePropValue=function(t){return new l(t)},_.initImageListPropValue=function(t){return t.map((function(t){return new l(t)}))},_.initCustomDataPropValue=function(t,e,i){if(t&&t.value&&t.customDataId){var a=this.flatCustomDataList.find((function(e){return e.id===t.customDataId}));if(a)return this._initCustomDataPropValue(t,a,e,i)}},_._initCustomDataPropValue=function(t,e,i,a){var r=this;if(!t)return null;var o=t.value;if(null==o)return null;switch(e.type){case s.BRAND:return this.initBrandPropValue(o);case s.BRAND_LIST:return this.initBrandListPropValue(o);case s.CATEGORY_LIST:return this.initCategoryListPropValue(o);case s.CATEGORY:return this.initCategoryPropValue(o);case s.IMAGE_LIST:return this.initImageListPropValue(o);case s.IMAGE:return this.initImagePropValue(o);case s.LINK:return this.initLinkPropValue(o);case s.PRODUCT_DETAIL:return this.initProductPropValue(o);case s.PRODUCT_LIST:return this.initProductListPropValue(o);case s.PRODUCT_ATTRIBUTE:return this.initAttributePropValue(o);case s.PRODUCT_ATTRIBUTE_LIST:return this.initAttributeListPropValue(o);case s.BLOG:return this.initBlogPropValue(o);case s.BLOG_LIST:return this.initBlogListPropValue(o);case s.BLOG_CATEGORY:return this.initBlogCategoryPropValue(o);case s.BLOG_CATEGORY_LIST:return this.initBlogCategoryListPropValue(o);case s.RAFFLE:return this.initRafflePropValue(o);case s.RAFFLE_LIST:return this.initRaffleListPropValue(o);case s.SLIDER:return this.initSliderPropValue(o);case s.OBJECT:for(var n={},u=function(t){var e=o[t.key],r=void 0;t.customDataId&&(r=l.flatCustomDataList.find((function(t){return t.id===e.customDataId}))),n[t.key]=l._initCustomDataPropValue(e,r||t,i,a)},l=this,d=0,p=e.nestedData||[];d<p.length;d++){u(p[d])}return n;case s.DYNAMIC_LIST:case s.STATIC_LIST:try{if(!o||!o.length)return null;var m=[],c=e.nestedData[0];return o.forEach((function(t){var e;c.customDataId&&(e=r.flatCustomDataList.find((function(e){return e.id===t.customDataId}))),m.push(r._initCustomDataPropValue(t,e||c,i,a))})),m}catch(t){return[]}case s.COMPONENT:return this.initComponentPropValue(o,i,a);case s.COMPONENT_LIST:return this.initComponentListPropValue(o,i,a);default:return o}},_.initComponentPropValue=function(t,e,i){return this._initComponentPropValue(t,e,i)},_._initComponentPropValue=function(t,i,a){var r=t.length?t[0]:void 0;if(r){var o=new h(r),n=_.initPageComponentPropValue(o,[o.component],i,a);if(n)return new v((function(){return e(n,i,-10)}))}},_.initComponentListPropValue=function(t,e,i){return this._initComponentListPropValue(t,e,i)},_._initComponentListPropValue=function(t,i,a){return t&&t.length?t.map((function(t){var r=new h(t),o=_.initPageComponentPropValue(r,[r.component],i,a);return new v((function(){return e(o,i,-1)}))})):[]},_.initBlogPropValue=function(t){return t.blogPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.blog?new r(t.blog):S()},_.initBlogListPropValue=function(t){return new c(t)},_.initBlogCategoryPropValue=function(t){return t.blogCategoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.blogCategory?new a(t.blogCategory):w()},_.initBlogCategoryListPropValue=function(t){return new f(t)},_.initRafflePropValue=function(t){return t.rafflePropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.raffle?new p(t.raffle):new p(I())},_.initRaffleListPropValue=function(t){return new D(t)},_.initSliderPropValue=function(t){return t},_.pageSpecificData={},_.flatCustomDataList=[],_.isBrowser=!1,_}();export{_ as IkasPageDataInit};
|
|
1
|
+
import{__assign as t}from'./../ext/tslib/tslib.es6.js';import{IkasAttributeList as e}from"../models/ui/product-attribute-list/index.js";import{IkasThemeJsonPageType as i,IkasThemeJsonComponentPropType as a}from"@ikas/storefront-models";import"@ikas/localized-address";import{observable as r}from"mobx";import"@ikas/storefront-api";import"../models/ui/blog-category-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import{IkasComponentRenderer as o}from"../models/ui/component-renderer/index.js";import"@ikas/storefront-config";import{IkasAttributeDetail as n}from"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-list/functions.js";import"../models/ui/product-list/index.js";import{IkasPageComponentPropValue as u,getPlaceholderBrand as s,getPlaceholderCategory as p,getPlaceholderProduct as l,getPlaceholderBlog as c,getPlaceholderBlogCategory as f,getPlaceholderRaffle as m}from"@ikas/storefront-providers";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import d from"lodash/flatten";import{IkasThemeJsonPageComponent as P}from"../models/data/theme-json/page/component/index.js";import{IkasVariantTypeFunctions as g,IkasVariantValueFunctions as V}from"@ikas/storefront-model-functions";import{renderComponent as D}from"../components/page/functions.js";var C=function(){function C(){}return C.setPageSpecificData=function(t,e,a){if(this.isBrowser=a,t){if(e===i.PRODUCT){var o=t;o.selectedVariantValues=o.selectedVariantValues||o.variants[0].variantValues,a&&this._initProductOnBrowser(o)}return this.pageSpecificData=r(t),this.pageSpecificData}this.pageSpecificData=void 0},C.initPagePropValues=function(t,e,i,a,r){return this.flatCustomDataList=d(i.map((function(t){return t.flat}))),t.map((function(t){return C.initPageComponentPropValue(t,e,a,r)}))},C.initPageComponentPropValue=function(e,i,a,r){var o=i.find((function(t){return t.id===e.pageComponent.componentId})),n=null==o?void 0:o.props,s={};return null==n||n.map((function(t){var i=e.propValues[t.name];s[t.name]=C.initPropValue(t,i,a,r)})),new u(t(t({},e),{pageComponent:new P(t(t({},e.pageComponent),{propValues:s,componentId:o.id})),component:o,propValues:s}))},C.initPropValue=function(t,e,i,r){if(null==e)return null;return function(){switch(t.type){case a.BRAND:return C.initBrandPropValue(e);case a.CATEGORY:return C.initCategoryPropValue(e);case a.PRODUCT_DETAIL:return C.initProductPropValue(e);case a.PRODUCT_ATTRIBUTE:return C.initAttributePropValue(e);case a.PRODUCT_ATTRIBUTE_LIST:return C.initAttributeListPropValue(e);case a.COMPONENT:return C.initComponentPropValue(e,i,r);case a.COMPONENT_LIST:return C.initComponentListPropValue(e,i,r);case a.CUSTOM:return C.initCustomDataPropValue(e,i,r);case a.BLOG:return C.initBlogPropValue(e);case a.BLOG_CATEGORY:return C.initBlogCategoryPropValue(e);case a.RAFFLE:return C.initRafflePropValue(e);default:return e}}()},C.initBrandPropValue=function(t){return t.brandPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.brand?t.brand:s()},C.initCategoryPropValue=function(t){return t.categoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.category?t.category:p()},C.initProductPropValue=function(t){var e=l();return t.productDetailPropValue.usePageData&&this.pageSpecificData?e=this.pageSpecificData:t.productDetail&&(e=t.productDetail),e},C._initProductOnBrowser=function(t){var e=new URLSearchParams(window.location.search),i=e.get("vid");if(i){var a=t.variants.find((function(t){return t.id===i}));a&&(t.selectedVariantValues=a.variantValues)}else{var r=g.getVariantTypeSlug,o=V.getVariantValueSlug,n=t.variantTypes.map((function(t){return r(t.variantType)})),u=[];n.forEach((function(i,a){var r=t.variantTypes[a],n=e.get(i);if(n){var s=r.variantType.values.find((function(t){return o(t)===n}));s&&u.push(s)}})),u.length===t.selectedVariantValues.length&&(t.selectedVariantValues=u)}},C.initAttributePropValue=function(t){var e=null;return t.attributePropValue.usePageData&&this.pageSpecificData?e=this.pageSpecificData:t.productDetail&&(e=t.productDetail),new n(e,t.attributePropValue)},C.initAttributeListPropValue=function(t){var i=null;return t.attributeListPropValue.usePageData&&this.pageSpecificData?i=this.pageSpecificData:t.productDetail&&(i=t.productDetail),new e(i,t.attributeListPropValue)},C.initCustomDataPropValue=function(t,e,i){if(t&&t.value&&t.customDataId){var a=this.flatCustomDataList.find((function(e){return e.id===t.customDataId}));if(a)return this._initCustomDataPropValue(t,a,e,i)}},C._initCustomDataPropValue=function(t,e,i,r){var o=this;if(!t)return null;var n=t.value;if(null==n)return null;return function(){switch(e.type){case a.BRAND:return o.initBrandPropValue(n);case a.CATEGORY:return o.initCategoryPropValue(n);case a.PRODUCT_DETAIL:return o.initProductPropValue(n);case a.PRODUCT_ATTRIBUTE:return o.initAttributePropValue(n);case a.PRODUCT_ATTRIBUTE_LIST:return o.initAttributeListPropValue(n);case a.BLOG:return o.initBlogPropValue(n);case a.BLOG_CATEGORY:return o.initBlogCategoryPropValue(n);case a.RAFFLE:return o.initRafflePropValue(n);case a.OBJECT:for(var t={},u=function(e){var a=n[e.key],u=void 0;e.customDataId&&(u=o.flatCustomDataList.find((function(t){return t.id===a.customDataId}))),t[e.key]=o._initCustomDataPropValue(a,u||e,i,r)},s=0,p=e.nestedData||[];s<p.length;s++){u(p[s])}return t;case a.DYNAMIC_LIST:case a.STATIC_LIST:try{if(!n||!n.length)return null;var l=[],c=e.nestedData[0];return n.forEach((function(t){var e;c.customDataId&&(e=o.flatCustomDataList.find((function(e){return e.id===t.customDataId}))),l.push(o._initCustomDataPropValue(t,e||c,i,r))})),l}catch(t){return[]}case a.COMPONENT:return o.initComponentPropValue(n,i,r);case a.COMPONENT_LIST:return o.initComponentListPropValue(n,i,r);default:return n}}()},C.initComponentPropValue=function(t,e,i){return this._initComponentPropValue(t,e,i)},C._initComponentPropValue=function(t,e,i){var a=t.length?t[0]:void 0;if(a){var r=new u(a),n=C.initPageComponentPropValue(r,[r.component],e,i);if(n)return new o((function(){return D(n,e,-10)}))}},C.initComponentListPropValue=function(t,e,i){return this._initComponentListPropValue(t,e,i)},C._initComponentListPropValue=function(t,e,i){return t&&t.length?t.map((function(t){var a=new u(t),r=C.initPageComponentPropValue(a,[a.component],e,i);return new o((function(){return D(r,e,-1)}))})):[]},C.initBlogPropValue=function(t){return t.blogPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.blog?t.blog:c()},C.initBlogCategoryPropValue=function(t){return t.blogCategoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.blogCategory?t.blogCategory:f()},C.initRafflePropValue=function(t){return t.rafflePropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:t.raffle?t.raffle:m()},C.pageSpecificData={},C.flatCustomDataList=[],C.isBrowser=!1,C}();export{C as IkasPageDataInit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import{IkasPage as r}from"../../components/page/index.js";var m=o((function(o){return t.createElement(r,e({},o))}));export{m as default};
|
package/build/pages/checkout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o,__awaiter as
|
|
1
|
+
import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as n from"react";import{observer as l}from"mobx-react-lite";import c from"../components/checkout/index.js";import{useRouter as s}from"next/router.js";import{FullscreenLoading as i}from"../components/checkout/components/fullscreen-loading/index.js";import{setAPIClientConfig as u,getCartById as d}from"@ikas/storefront-api";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{initIkasEvents as a}from"../analytics/events.js";import{APIErrorCode as p}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{checkLocalization as y}from"../store/base/functions.js";import{createIkasLocalizedOrderAddress as h}from"../models/data/localized-order-address/functions.js";import{CheckoutStep as f}from"../components/checkout/types.js";var g=l((function(l){var g=l.checkoutSettings,b=l.customizationProps,F=l.configJson,E=o(l,["checkoutSettings","customizationProps","configJson"]),k=s(),C=n.useState(),v=C[0],P=C[1];m.init(F),u(),n.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED")}(b)}),[b]),n.useEffect((function(){y(),x(),a()}),[]);var x=n.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,n,l,c,s;return t(this,(function(t){switch(t.label){case 0:return o=new URLSearchParams(window.location.search),e=o.get("id"),n=o.get("step"),e?(l=!1,n&&n===f.SUCCESS&&(l=!0),[4,d({id:e,getCompletedCart:l})]):[2,k.replace("/")];case 1:return(c=t.sent()).isSuccess&&c.data?(s=c.data,P(r(r({},s),{billingAddress:s.billingAddress?h(s.billingAddress):null,shippingAddress:s.shippingAddress?h(s.shippingAddress):null}))):c.errorCodes.some((function(o){return o===p.LOGIN_REQUIRED}))?k.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):k.replace("/"),[2]}}))}))}),[]);return v?n.createElement(c,r({checkout:v,checkoutSettings:g,customizationProps:b},E)):n.createElement(i,null)}));export{g as default};
|
package/build/pages/index.d.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IkasEventSubscriber } from "../../analytics/events";
|
|
2
|
+
export declare class IkasAnalyticsStore {
|
|
3
|
+
subscribers: IkasEventSubscriber[];
|
|
4
|
+
sessionId?: string | null;
|
|
5
|
+
visitorId?: string | null;
|
|
6
|
+
private static _instance;
|
|
7
|
+
private constructor();
|
|
8
|
+
static getInstance(): IkasAnalyticsStore;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeAutoObservable as n}from"mobx";var t=function(){function t(){this.subscribers=[],n(this)}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t}();export{t as IkasAnalyticsStore};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IkasLanguageOption, IkasLocaleOption } from ".";
|
|
2
|
+
import { IkasProduct, IkasVariantValue } from "@ikas/storefront-models";
|
|
3
|
+
export declare function setLocalization(localeOption: IkasLocaleOption): void;
|
|
4
|
+
export declare function setLanguage(language: IkasLanguageOption): void;
|
|
5
|
+
export declare function checkLocalization(): Promise<void>;
|
|
6
|
+
export declare function initBaseStore(): void;
|
|
7
|
+
export declare function selectVariantValueCallback(product: IkasProduct, variantValue: IkasVariantValue, disableRoute?: boolean): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as n,__generator as o}from'./../../ext/tslib/tslib.es6.js';import{listCountry as i,getMyCountry as t}from"@ikas/storefront-api";import{IkasStorefrontConfig as e}from"@ikas/storefront-config";import{IkasBaseStore as r}from"./index.js";import a from"lodash/flatten";import u from"lodash/sortBy";import{IkasProductFunctions as c,IkasVariantTypeFunctions as l,IkasVariantValueFunctions as s}from"@ikas/storefront-model-functions";import{initCustomerStore as d}from"../customer/functions.js";import{productView as f}from"../../analytics/analytics.js";import"../../analytics/head/index.js";function g(n){n.routing.domain?window.location.replace("https://"+n.routing.domain):window.location.replace(window.location.origin+(n.routing.path?"/"+n.routing.path:"")+(r.router?r.router.asPath:""))}function m(n){var o=e.getRoutings().find((function(o){return o.id===n.id}));o&&window.location.replace(window.location.origin+(o.path?"/"+o.path:"")+(r.router?r.router.asPath:""))}function v(){return n(this,void 0,void 0,(function(){var n,c,l,s,d,f,g,m,v,p,h;return o(this,(function(o){switch(o.label){case 0:return r.localeChecked?[2]:"undefined"==typeof window?(console.warn("checkLocalization should be called on the client side!"),[2]):[4,t()];case 1:return(n=o.sent()).isSuccess?(c=n.data,l=e.getCurrentRouting(),r.currentCountryCode=c,l&&c?(s=!0,d=e.getRoutings().filter((function(n){var o;return null===(o=n.countryCodes)||void 0===o?void 0:o.includes(c)})),f=e.getRoutings().find((function(n){var o;return!(null===(o=n.countryCodes)||void 0===o?void 0:o.length)})),d.length?d.some((function(n){return n.id===l.id}))||(s=!1):f&&l.id!==f.id&&(s=!1),g=[],m=[],v=a(e.getRoutings().map((function(n){return n.countryCodes||[]}))),[4,i({iso2:{in:v}})]):[3,3]):[2];case 2:if(!(p=o.sent()).isSuccess)return[2];h=p.data||[],e.getRoutings().forEach((function(n){var o;(null===(o=n.countryCodes)||void 0===o?void 0:o.length)?n.countryCodes.forEach((function(o){var i=h.find((function(n){return n.iso2===o}));g.some((function(n){return n.iso2===(null==i?void 0:i.iso2)}))||g.push({id:(null==i?void 0:i.iso2)||(null==i?void 0:i.iso3)||Date.now()+"",countryName:(null==i?void 0:i.native)||(null==i?void 0:i.name)||"",iso2:(null==i?void 0:i.iso2)||void 0,iso3:(null==i?void 0:i.iso3)||void 0,routing:n,isRecommended:o===c})})):g.push({id:n.id,routing:n,isRecommended:!e.getRoutings().some((function(n){var o;return null===(o=n.countryCodes)||void 0===o?void 0:o.includes(c)}))})})),d.length&&(e.getRoutings().forEach((function(n){var o;d.some((function(o){return o.id===n.id}))&&m.push({id:n.id,currencyCode:n.currencyCode,currencySymbol:n.currencySymbol,language:new Intl.DisplayNames([],{type:"language"}).of(n.locale)||"",locale:n.locale,isSelected:n.id===(null===(o=e.getCurrentRouting())||void 0===o?void 0:o.id)||!1})})),r.languageOptions=u(m,"language")),r.localeOptions=u(g,"countryName"),s||(r.showLocaleOptions=!0),r.localeChecked=!0,o.label=3;case 3:return[2]}}))}))}function p(){"undefined"!=typeof window&&(r.spaLinksDisabled=navigator.userAgent.includes("Instagram")),c._setSelectVariantValueCallback(h),d()}function h(n,o,i){var t,e=n.metaData,a=n.variantTypes.map((function(o){var i=o.variantType,t=i.values.find((function(o){return n.selectedVariantValues.some((function(n){return n.id===o.id}))}));if(t)return"".concat(l.getVariantTypeSlug(i),"=").concat(s.getVariantValueSlug(t))})).filter((function(n){return!!n})).join("&");if(!i){var u="/".concat(e.slug);if(a&&(u="/".concat(e.slug,"?").concat(a)),u===window.location.pathname)return;null===(t=r.router)||void 0===t||t.replace(u,void 0,{shallow:!1,scroll:!1})}f(n)}export{v as checkLocalization,p as initBaseStore,h as selectVariantValueCallback,m as setLanguage,g as setLocalization};
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IkasCustomerStore } from "./customer";
|
|
3
|
-
import { IkasStorefrontRouting } from "../models/data/storefront/routing";
|
|
4
|
-
import { IkasThemeJsonPageType } from "@ikas/storefront-models";
|
|
1
|
+
import { IkasStorefrontRouting, IkasThemeJsonPageType } from "@ikas/storefront-models";
|
|
5
2
|
import { NextRouter } from "next/router";
|
|
6
|
-
export declare
|
|
7
|
-
readonly customerStore: IkasCustomerStore;
|
|
8
|
-
readonly cartStore: IkasCartStore;
|
|
3
|
+
export declare type IkasBaseStoreData = {
|
|
9
4
|
currentPageType?: IkasThemeJsonPageType | null;
|
|
10
5
|
localeOptions: IkasLocaleOption[];
|
|
11
6
|
languageOptions: IkasLanguageOption[];
|
|
12
7
|
showLocaleOptions: boolean;
|
|
13
8
|
currentCountryCode?: string | null;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
private static _instance;
|
|
9
|
+
spaLinksDisabled: boolean;
|
|
10
|
+
localeChecked: boolean;
|
|
17
11
|
router?: NextRouter;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
setLanguage(language: IkasLanguageOption): void;
|
|
22
|
-
private checkLocalization;
|
|
23
|
-
private init;
|
|
24
|
-
}
|
|
12
|
+
};
|
|
13
|
+
export declare const IkasBaseStore: IkasBaseStoreData;
|
|
14
|
+
export declare function useBaseStore(): IkasBaseStoreData;
|
|
25
15
|
export declare type IkasLocaleOption = {
|
|
26
16
|
readonly id: string;
|
|
27
17
|
readonly countryName?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{configure as e,observable as o}from"mobx";import{enableStaticRendering as n}from"mobx-react-lite";e({enforceActions:"never"}),n("undefined"==typeof window);var r=o({currentPageType:null,localeOptions:[],languageOptions:[],showLocaleOptions:!1,currentCountryCode:null,spaLinksDisabled:!1,localeChecked:!1});function t(){return r}export{r as IkasBaseStore,t as useBaseStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setLocalization, setLanguage } from "./functions";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{setLanguage,setLocalization}from"./functions.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IkasCart, IkasOrderLineItem, IkasProduct, IkasProductOption, IkasProductVariant } from "@ikas/storefront-models";
|
|
2
|
+
import { IkasCartOperationResult } from ".";
|
|
3
|
+
import { CartLineOptionInput } from "@ikas/storefront-api";
|
|
4
|
+
export declare const CART_LS_KEY = "cartId";
|
|
5
|
+
export declare function getCheckoutId(): string | undefined;
|
|
6
|
+
export declare function getCheckoutUrl(): string | undefined;
|
|
7
|
+
export declare function addItem(variant: IkasProductVariant, product: IkasProduct, initialQuantity?: number): Promise<IkasCartOperationResult>;
|
|
8
|
+
export declare function changeItemQuantity(item: IkasOrderLineItem, quantity: number): Promise<IkasCartOperationResult>;
|
|
9
|
+
export declare function removeItem(item: IkasOrderLineItem): Promise<IkasCartOperationResult>;
|
|
10
|
+
export declare function removeCart(): void;
|
|
11
|
+
export declare function waitForCartStoreInit(): Promise<unknown>;
|
|
12
|
+
export declare function findExistingItem(variant: IkasProductVariant, product: IkasProduct): IkasOrderLineItem | undefined;
|
|
13
|
+
export declare function saveCouponCode(couponCode?: string | null): Promise<IkasCartOperationResult>;
|
|
14
|
+
export declare function removeCouponCode(): Promise<IkasCartOperationResult>;
|
|
15
|
+
export declare function saveCart(cart: IkasCart): Promise<IkasCartOperationResult>;
|
|
16
|
+
export declare function removeCardIfEmpty(): void;
|
|
17
|
+
export declare function getCart(): Promise<void>;
|
|
18
|
+
export declare function setCart(cart: IkasCart): Promise<void>;
|
|
19
|
+
export declare function beforeCartOperationCheck(): Promise<void>;
|
|
20
|
+
export declare function createCartLineOptions(item: IkasOrderLineItem): CartLineOptionInput[] | null;
|
|
21
|
+
export declare function getOptionValues(product: IkasProduct): CartLineOptionInput[];
|
|
22
|
+
export declare function checkOptionValues(productOptions: IkasProductOption[]): IkasProductOption[];
|
|
23
|
+
export declare function mergedProductOptions(productOptions: IkasProductOption[]): {};
|
|
24
|
+
export declare function setNewProductOptionValues(product: IkasProduct): IkasProductOption[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as n,__spreadArray as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{useCartStore as i,IkasCartStore as o,IkasCartOperationValidationError as s}from"./index.js";import{IkasProductFunctions as u,IkasProductVariantFunctions as a,IkasProductOptionSetFunctions as c,IkasOrderFunctions as d}from"@ikas/storefront-model-functions";import{addItemToCart as l,saveCartCouponCode as v,SaveCartInput as p,saveCart as f,getCartById as h}from"@ikas/storefront-api";import{IkasStorefrontConfig as I}from"@ikas/storefront-config";import{addToCart as m,removeFromCart as S}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasCustomerStore as g}from"../customer/index.js";var O="cartId";function b(){var t=i().cart;return null==t?void 0:t.id}function C(){var t=b();if(t)return"/checkout?id=".concat(t,"&step=info")}function L(e,r,i){var d;return void 0===i&&(i=1),t(this,void 0,void 0,(function(){var t,v,p,f,h,S,g,O,b,C,L;return n(this,(function(n){switch(n.label){case 0:t=u.hasValidProductOptionValues,v=a.hasVariantStock,p=c.initOptionValues,n.label=1;case 1:return n.trys.push([1,6,,7]),t(r)?v(e)||e.sellIfOutOfStock?[4,x()]:[2,{success:!1,validationError:s.INSUFFICIENT_STOCK}]:[2,{success:!1,validationError:s.INVALID_PRODUCT_OPTION_VALUES}];case 2:return n.sent(),(f=o.cart)&&(h=E(e,r))?(r.productOptionSet&&p(r.productOptionSet),[2,y(h,h.quantity+1)]):((null===(d=r.productOptionSet)||void 0===d?void 0:d.options.length)&&(r.productOptionSet.options=R(r)),S=N(r),g=(null==f?void 0:f.id)||localStorage.getItem("cartId"),[4,l({input:{cartId:g,item:{id:null,quantity:i,variant:{id:e.id,name:r.name}},options:S.length?S:null,priceListId:I.getPriceListId()||null,salesChannelId:I.getSalesChannelId(),storefrontThemeId:I.getStorefrontThemeId()}})]);case 3:return(O=n.sent()).isSuccess&&O.data?[4,q(O.data)]:[3,5];case 4:n.sent(),n.label=5;case 5:return(f=o.cart)&&(b="".concat(f.id,"-").concat(f.updatedAt),(C=f.orderLineItems.find((function(t){return t.variant.id===e.id})))&&m(C,i,b,f)),r.productOptionSet&&p(r.productOptionSet),[2,{success:O.isSuccess,response:O}];case 6:return L=n.sent(),console.log(L),[2,{success:!1}];case 7:return[2]}}))}))}function y(e,r){return t(this,void 0,void 0,(function(){var t,i,s,u,a;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,x()];case 1:return n.sent(),t=o.cart,[4,l({input:{cartId:(null==t?void 0:t.id)||null,item:{id:e.id,quantity:r,variant:{id:e.variant.id,name:e.variant.name}},options:F(e),priceListId:I.getPriceListId()||null,salesChannelId:I.getSalesChannelId(),storefrontThemeId:I.getStorefrontThemeId()}})];case 2:return(i=n.sent()).isSuccess&&i.data?[4,q(i.data)]:[3,4];case 3:n.sent(),n.label=4;case 4:return _(),(t=o.cart)&&(s="".concat(t.id,"-").concat(t.updatedAt),(u=e.quantity)>r?S(e,u-r,t):m(e,r-u,s,t)),[2,{success:i.isSuccess,response:i}];case 5:return a=n.sent(),console.log(a),[2,{success:!1}];case 6:return[2]}}))}))}function T(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,y(e,0)];case 1:return[2,t.sent()]}}))}))}function k(){localStorage.removeItem("cartId"),o.cart=null}function w(){return new Promise((function(t){var n=setInterval((function(){o.isCartLoadFinished&&(clearInterval(n),t(null))}),100)}))}function E(t,n){var e,r,i,s,u=o.cart;if(!n.productOptionSetId)return null==u?void 0:u.orderLineItems.find((function(n){return n.variant.id===t.id}));(null===(e=n.productOptionSet)||void 0===e?void 0:e.options.length)&&(n.productOptionSet.options=R(n));for(var a=N(n),c=(null==u?void 0:u.orderLineItems.filter((function(n){var e;return n.variant.id===t.id&&(null===(e=n.options)||void 0===e?void 0:e.length)===a.length})))||[],d=0,l=c;d<l.length;d++){var v=l[d];if(v.options){for(var p=!0,f=function(t){var e=t.values.map((function(t){return t.value})),o=null===(s=null===(i=null===(r=n.productOptionSet)||void 0===r?void 0:r.options)||void 0===i?void 0:i.find((function(n){return n.id===t.productOptionId})))||void 0===s?void 0:s.values;if(!(p=p&&e.length===(null==o?void 0:o.length)&&e.every((function(t){return null==o?void 0:o.includes(t)}))))return"break"},h=0,I=v.options;h<I.length;h++){if("break"===f(I[h]))break}if(p)return v}}}function P(e){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return(t=o.cart)?[4,v({cartId:t.id,couponCode:e})]:[2,{success:!1,validationError:s.EMPTY_CART}];case 1:return(r=n.sent()).isSuccess&&r.data&&(o.cart=r.data),[2,{success:r.isSuccess,response:r}]}}))}))}function j(){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,P(null)]}))}))}function V(e){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=new p(e),[4,f({input:t})];case 1:return[2,{success:(r=n.sent()).isSuccess,response:r}]}}))}))}function _(){o.cart&&0===d.getItemCount(o.cart)&&k()}function A(){var e,r;return t(this,void 0,void 0,(function(){var t,i,s,u;return n(this,(function(n){switch(n.label){case 0:if(!("undefined"!=typeof localStorage))return[2];n.label=1;case 1:return n.trys.push([1,6,7,8]),o.isLoadingCart=!0,t=null===(e=g.customer)||void 0===e?void 0:e.id,(i=(null===(r=o.cart)||void 0===r?void 0:r.id)||localStorage.getItem("cartId"))||t?[4,h({id:i})]:[2];case 2:return(s=n.sent()).isSuccess&&s.data?[4,q(s.data)]:[3,4];case 3:return n.sent(),[3,5];case 4:k(),n.label=5;case 5:return[3,8];case 6:return u=n.sent(),console.log(u),[3,8];case 7:return o.isLoadingCart=!1,o.isCartLoadFinished=!0,[7];case 8:return[2]}}))}))}function q(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return localStorage.setItem("cartId",e.id),o.cart=e,[2]}))}))}function x(){return t(this,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return t=localStorage.getItem("cartId"),!o.cart||t?[3,1]:(k(),[3,3]);case 1:return o.cart||!t?[3,3]:[4,A()];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}function F(t){if(t&&t.options){for(var n=[],e=0,r=t.options;e<r.length;e++){var i=r[e],o={productOptionId:i.productOptionId,productOptionsSetId:i.productOptionsSetId,values:i.values.map((function(t){return t.value}))};n.push(o)}return n}return null}function N(t){var n,e=[];return null===(n=t.productOptionSet)||void 0===n||n.options.forEach((function(t){t.values.length&&e.push({productOptionId:t.id,productOptionsSetId:t.productOptionSetId,values:t.values})})),e}function U(t){for(var n=[],e=0,r=t;e<r.length;e++){var i=r[e];n.push(i),n=n.concat(U(i.childOptions))}return n}function D(t){return t.reduce((function(t,n){return t[n.id]?t[n.id].values=e([],t[n.id].values,!0):t[n.id]=r({},n),t}),{})}function R(t){var n,e,r=[],i=(null===(n=t.productOptionSet)||void 0===n?void 0:n.options.length)?U(t.productOptionSet.options):[];return(null===(e=t.productOptionSet)||void 0===e?void 0:e.options.length)&&i.length&&(r=Object.values(D(i))),r}export{O as CART_LS_KEY,L as addItem,x as beforeCartOperationCheck,y as changeItemQuantity,U as checkOptionValues,F as createCartLineOptions,E as findExistingItem,A as getCart,b as getCheckoutId,C as getCheckoutUrl,N as getOptionValues,D as mergedProductOptions,_ as removeCardIfEmpty,k as removeCart,j as removeCouponCode,T as removeItem,V as saveCart,P as saveCouponCode,q as setCart,R as setNewProductOptionValues,w as waitForCartStoreInit};
|
|
@@ -1,33 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IkasCart, IkasOrderLineItem, IkasProduct, IkasProductVariant } from "../../models/data";
|
|
1
|
+
import { IkasCart } from "../../models/data";
|
|
3
2
|
import { APIResponse } from "@ikas/storefront-api";
|
|
4
|
-
export declare
|
|
5
|
-
export declare class IkasCartStore {
|
|
3
|
+
export declare type IkasCartStoreData = {
|
|
6
4
|
cart?: IkasCart | null;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
get isCartLoadFinished(): boolean;
|
|
13
|
-
get checkoutId(): string | undefined;
|
|
14
|
-
get checkoutUrl(): string | undefined;
|
|
15
|
-
addItem: (variant: IkasProductVariant, product: IkasProduct, initialQuantity?: number) => Promise<IkasCartOperationResult>;
|
|
16
|
-
changeItemQuantity: (item: IkasOrderLineItem, quantity: number) => Promise<IkasCartOperationResult>;
|
|
17
|
-
removeItem: (item: IkasOrderLineItem) => Promise<IkasCartOperationResult>;
|
|
18
|
-
removeCart: () => void;
|
|
19
|
-
waitUntilInitialized: () => Promise<unknown>;
|
|
20
|
-
findExistingItem: (variant: IkasProductVariant, product: IkasProduct) => IkasOrderLineItem | undefined;
|
|
21
|
-
saveCouponCode: (couponCode?: string | null) => Promise<IkasCartOperationResult>;
|
|
22
|
-
removeCouponCode: () => Promise<IkasCartOperationResult>;
|
|
23
|
-
saveCart: (cart: IkasCart) => Promise<IkasCartOperationResult>;
|
|
24
|
-
private removeCardIfEmpty;
|
|
25
|
-
getCart: () => Promise<void>;
|
|
26
|
-
private setCart;
|
|
27
|
-
private beforeCartOperationCheck;
|
|
28
|
-
private createCartLineOptions;
|
|
29
|
-
private getOptionValues;
|
|
30
|
-
}
|
|
5
|
+
isLoadingCart: boolean;
|
|
6
|
+
isCartLoadFinished: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const IkasCartStore: IkasCartStoreData;
|
|
9
|
+
export declare function useCartStore(): IkasCartStoreData;
|
|
31
10
|
export declare type IkasCartOperationResult = {
|
|
32
11
|
success: boolean;
|
|
33
12
|
validationError?: IkasCartOperationValidationError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{observable as I}from"mobx";var T,C=I({cart:null,isLoadingCart:!1,isCartLoadFinished:!1});function _(){return C}!function(I){I.INSUFFICIENT_STOCK="INSUFFICIENT_STOCK",I.INVALID_PRODUCT_OPTION_VALUES="INVALID_PRODUCT_OPTION_VALUES",I.EMPTY_CART="EMPTY_CART"}(T||(T={}));export{T as IkasCartOperationValidationError,C as IkasCartStore,_ as useCartStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getCheckoutId, getCheckoutUrl, addItem, removeItem, changeItemQuantity, removeCart, waitForCartStoreInit as waitUntilInitialized, findExistingItem, saveCouponCode, removeCouponCode, saveCart, getCart, } from "./functions";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{addItem,changeItemQuantity,findExistingItem,getCart,getCheckoutId,getCheckoutUrl,removeCart,removeCouponCode,removeItem,saveCart,saveCouponCode,waitForCartStoreInit as waitUntilInitialized}from"./functions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=function(){function n(){}return n.token=null,n.tokenExpiry=null,n}();export{n as IkasCustomerAuthData};
|