@salla.sa/twilight-components 2.14.392 → 2.14.393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-oehrC7QI.js +39 -0
- package/dist/cjs/{filepond-D-ur1GA-.js → filepond-D7RVR_w_.js} +10 -5
- package/dist/cjs/{filepond-plugin-file-poster-DigEeKId.js → filepond-plugin-file-poster-DTuZK2ot.js} +11 -7
- package/dist/cjs/{filepond-plugin-file-validate-size-R9el3Yro.js → filepond-plugin-file-validate-size-DHc6pF_j.js} +1 -1
- package/dist/cjs/filepond-plugin-file-validate-type-DnkcvJVc.js +271 -0
- package/dist/cjs/{filepond-plugin-image-edit-bhI8kqN_.js → filepond-plugin-image-edit-vrZ1s7kw.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-COXZUVRV.js → filepond-plugin-image-exif-orientation-Bn5JSzQK.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-COP8QJBf.js → filepond-plugin-image-preview-8qWUFe9n.js} +1 -1
- package/dist/cjs/{index-CGnPURjZ.js → index-C5VeFDQ0.js} +1966 -1344
- package/dist/cjs/{index-BILBEE9f.js → index-CwD81m7i.js} +1 -1
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-accordion_6.cjs.entry.js +19 -15
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +12 -10
- package/dist/cjs/salla-advertisement.cjs.entry.js +3 -3
- package/dist/cjs/salla-alert_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +3 -3
- package/dist/cjs/salla-apps-icons.cjs.entry.js +3 -3
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +25 -23
- package/dist/cjs/salla-bullet-delivery.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +17 -17
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +3 -3
- package/dist/cjs/salla-count-down.cjs.entry.js +35 -11
- package/dist/cjs/salla-custom-fields.cjs.entry.js +3 -3
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +3 -3
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
- package/dist/cjs/salla-hook.cjs.entry.js +5 -2
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +3 -3
- package/dist/cjs/salla-installment.cjs.entry.js +3 -3
- package/dist/cjs/salla-list-tile.cjs.entry.js +3 -3
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty.cjs.entry.js +3 -3
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +3 -3
- package/dist/cjs/salla-map.cjs.entry.js +3 -3
- package/dist/cjs/salla-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-metadata.cjs.entry.js +3 -3
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +8 -6
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +6 -4
- package/dist/cjs/salla-notification-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-notifications.cjs.entry.js +50 -5
- package/dist/cjs/salla-offer-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details-options.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details.cjs.entry.js +6 -4
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-edit.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-summary.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +6 -4
- package/dist/cjs/salla-orders.cjs.entry.js +3 -3
- package/dist/cjs/salla-payments.cjs.entry.js +3 -3
- package/dist/cjs/salla-placeholder.cjs.entry.js +3 -3
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-card.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-list.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-slider.cjs.entry.js +3 -3
- package/dist/cjs/salla-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
- package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-scopes.cjs.entry.js +3 -3
- package/dist/cjs/salla-search.cjs.entry.js +6 -4
- package/dist/cjs/salla-skeleton.cjs.entry.js +3 -3
- package/dist/cjs/salla-slider.cjs.entry.js +20 -14
- package/dist/cjs/salla-social-share.cjs.entry.js +3 -3
- package/dist/cjs/salla-social.cjs.entry.js +3 -3
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +7 -7
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/salla-trust-badges.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-profile.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-settings.cjs.entry.js +3 -3
- package/dist/cjs/salla-verify.cjs.entry.js +3 -3
- package/dist/cjs/salla-wallet.cjs.entry.js +3 -3
- package/dist/cjs/twilight.cjs.js +5 -4
- package/dist/cjs/{vanilla-picker-DI3TImGd.js → vanilla-picker-yKERbLpx.js} +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
- package/dist/collection/components/salla-accordion/salla-accordion.js +4 -4
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +19 -19
- package/dist/collection/components/salla-alert/salla-alert.js +5 -5
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +6 -6
- package/dist/collection/components/salla-booking-field/salla-booking-field.js +4 -4
- package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +9 -9
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +6 -3
- package/dist/collection/components/salla-button/salla-button.js +11 -11
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +2 -1
- package/dist/collection/components/salla-cart-item-offers/salla-cart-item-offers.js +8 -8
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +2 -2
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +20 -14
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +6 -6
- package/dist/collection/components/salla-comments/salla-comment-item.js +2 -3
- package/dist/collection/components/salla-comments/salla-comments.js +18 -17
- package/dist/collection/components/salla-contacts/salla-contacts.js +10 -10
- package/dist/collection/components/salla-count-down/salla-count-down.js +66 -42
- package/dist/collection/components/salla-custom-fields/salla-custom-fields.js +9 -7
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +69 -65
- package/dist/collection/components/salla-drawer/salla-drawer.js +11 -11
- package/dist/collection/components/salla-file-upload/salla-file-upload.css +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +85 -84
- package/dist/collection/components/salla-filters/salla-filters.js +2 -2
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +4 -5
- package/dist/collection/components/salla-gifting/salla-gifting.js +11 -11
- package/dist/collection/components/salla-hook/salla-hook.js +2 -2
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +6 -6
- package/dist/collection/components/salla-installment/salla-installment.js +5 -5
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +2 -2
- package/dist/collection/components/salla-loading/salla-loading.js +4 -4
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +5 -5
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +14 -14
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +4 -3
- package/dist/collection/components/salla-loyalty/salla-loyalty.js +13 -12
- package/dist/collection/components/salla-map/salla-map.js +14 -14
- package/dist/collection/components/salla-menu/salla-menu.js +10 -9
- package/dist/collection/components/salla-metadata/salla-metadata.js +3 -3
- package/dist/collection/components/salla-modal/salla-modal.js +11 -11
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +8 -7
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +2 -2
- package/dist/collection/components/salla-notifications/salla-notification-item.js +2 -2
- package/dist/collection/components/salla-notifications/salla-notifications.js +50 -5
- package/dist/collection/components/salla-offer/salla-offer.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +5 -5
- package/dist/collection/components/salla-order-details/salla-order-details-options.js +6 -5
- package/dist/collection/components/salla-order-details/salla-order-details.js +4 -3
- package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +4 -4
- package/dist/collection/components/salla-order-edit/salla-order-edit.js +4 -4
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +2 -2
- package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +4 -3
- package/dist/collection/components/salla-orders/salla-orders.js +4 -4
- package/dist/collection/components/salla-payments/salla-payments.js +0 -1
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +3 -3
- package/dist/collection/components/salla-price-range/salla-price-range.js +8 -8
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +6 -6
- package/dist/collection/components/salla-product-card/salla-product-card.js +18 -18
- package/dist/collection/components/salla-product-options/salla-product-options.js +15 -13
- package/dist/collection/components/salla-products-list/salla-products-list.js +20 -21
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +22 -23
- package/dist/collection/components/salla-progress-bar/salla-progress-bar.js +21 -20
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +2 -2
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +16 -17
- package/dist/collection/components/salla-quick-order/salla-quick-order.js +11 -11
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +2 -2
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +8 -8
- package/dist/collection/components/salla-review-card/salla-review-card.js +3 -3
- package/dist/collection/components/salla-reviews/salla-reviews.js +16 -13
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +2 -2
- package/dist/collection/components/salla-scopes/salla-scopes.js +2 -2
- package/dist/collection/components/salla-search/salla-search.js +6 -6
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +3 -3
- package/dist/collection/components/salla-slider/salla-slider.css +9 -2
- package/dist/collection/components/salla-slider/salla-slider.js +25 -25
- package/dist/collection/components/salla-social-share/salla-social-share.js +3 -3
- package/dist/collection/components/salla-tabs/salla-tab-content.js +2 -2
- package/dist/collection/components/salla-tabs/salla-tab-header.js +5 -5
- package/dist/collection/components/salla-tabs/salla-tabs.js +2 -2
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +9 -8
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +5 -5
- package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +5 -5
- package/dist/collection/components/salla-user-profile/salla-user-profile.js +1 -1
- package/dist/collection/components/salla-verify/salla-verify.js +4 -4
- package/dist/components/Helper.js +1 -432
- package/dist/components/_commonjsHelpers.js +1 -7
- package/dist/components/anime.es.js +1 -1310
- package/dist/components/arrow-left.js +1 -8
- package/dist/components/axios.js +2 -3908
- package/dist/components/bell-ring.js +1 -8
- package/dist/components/camera.js +1 -8
- package/dist/components/cancel.js +1 -8
- package/dist/components/cart.js +1 -8
- package/dist/components/check-circle2.js +1 -15
- package/dist/components/check.js +1 -8
- package/dist/components/facebook.js +1 -10
- package/dist/components/filepond-plugin-file-poster.js +3 -659
- package/dist/components/filepond-plugin-file-validate-size.js +2 -204
- package/dist/components/filepond-plugin-file-validate-type.js +3 -279
- package/dist/components/filepond-plugin-image-edit.js +2 -487
- package/dist/components/filepond-plugin-image-exif-orientation.js +2 -214
- package/dist/components/filepond-plugin-image-preview.js +2 -2237
- package/dist/components/filepond.js +3 -11282
- package/dist/components/gift.js +1 -8
- package/dist/components/image.js +1 -8
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -8163
- package/dist/components/index2.js +1 -1709
- package/dist/components/index3.js +1 -2550
- package/dist/components/interfaces.js +1 -12
- package/dist/components/isObject.js +1 -292
- package/dist/components/keyboard_arrow_down.js +1 -8
- package/dist/components/keyboard_arrow_right.js +1 -15
- package/dist/components/location.js +1 -11
- package/dist/components/mail.js +1 -8
- package/dist/components/minus.js +1 -15
- package/dist/components/salla-accordion-body.js +1 -6
- package/dist/components/salla-accordion-body2.js +1 -30
- package/dist/components/salla-accordion-head.js +1 -6
- package/dist/components/salla-accordion-head2.js +1 -63
- package/dist/components/salla-accordion.js +1 -6
- package/dist/components/salla-accordion2.js +1 -68
- package/dist/components/salla-add-product-button.js +1 -6
- package/dist/components/salla-add-product-button2.js +1 -306
- package/dist/components/salla-advertisement.js +1 -155
- package/dist/components/salla-alert.js +1 -59
- package/dist/components/salla-app-install-alert.js +1 -91
- package/dist/components/salla-apps-icons.js +1 -63
- package/dist/components/salla-booking-field.js +1 -6
- package/dist/components/salla-booking-field2.js +1 -221
- package/dist/components/salla-bottom-alert.js +1 -214
- package/dist/components/salla-breadcrumb.js +1 -226
- package/dist/components/salla-bullet-delivery.js +1 -2114
- package/dist/components/salla-button.js +1 -6
- package/dist/components/salla-button2.js +1 -174
- package/dist/components/salla-cart-coupons.js +1 -284
- package/dist/components/salla-cart-item-offers.js +1 -143
- package/dist/components/salla-cart-summary.js +1 -136
- package/dist/components/salla-color-picker.js +1 -6
- package/dist/components/salla-color-picker2.js +1 -260
- package/dist/components/salla-comment-form.js +1 -6
- package/dist/components/salla-comment-form2.js +1 -64
- package/dist/components/salla-comment-item.js +1 -6
- package/dist/components/salla-comment-item2.js +1 -217
- package/dist/components/salla-comments.js +1 -395
- package/dist/components/salla-conditional-fields.js +1 -6
- package/dist/components/salla-conditional-fields2.js +1 -137
- package/dist/components/salla-conditional-offer.js +1 -194
- package/dist/components/salla-contacts.js +1 -125
- package/dist/components/salla-cookies-bar.js +1 -107
- package/dist/components/salla-count-down.js +1 -6
- package/dist/components/salla-count-down2.js +1 -247
- package/dist/components/salla-custom-fields.js +1 -175
- package/dist/components/salla-datetime-picker.js +1 -6
- package/dist/components/salla-datetime-picker2.js +1 -342
- package/dist/components/salla-delivery-promise.js +1 -263
- package/dist/components/salla-drawer.js +1 -6
- package/dist/components/salla-drawer2.js +1 -214
- package/dist/components/salla-file-upload.js +1 -6
- package/dist/components/salla-file-upload2.js +1 -583
- package/dist/components/salla-filters-widget.js +1 -6
- package/dist/components/salla-filters-widget2.js +1 -245
- package/dist/components/salla-filters.js +1 -253
- package/dist/components/salla-fulfillment-methods.js +1 -61
- package/dist/components/salla-gifting.js +1 -732
- package/dist/components/salla-hook.js +1 -47
- package/dist/components/salla-infinite-scroll.js +1 -112
- package/dist/components/salla-installment.js +1 -306
- package/dist/components/salla-list-tile.js +1 -6
- package/dist/components/salla-list-tile2.js +1 -47
- package/dist/components/salla-loading.js +1 -6
- package/dist/components/salla-loading2.js +1 -51
- package/dist/components/salla-localization-modal.js +1 -296
- package/dist/components/salla-login-modal.js +1 -6
- package/dist/components/salla-login-modal2.js +1 -359
- package/dist/components/salla-loyalty-prize-item.js +1 -39
- package/dist/components/salla-loyalty-program.js +1 -115
- package/dist/components/salla-loyalty.js +1 -304
- package/dist/components/salla-maintenance-alert.js +1 -57
- package/dist/components/salla-map.js +1 -6
- package/dist/components/salla-map2.js +1 -766
- package/dist/components/salla-menu.js +1 -165
- package/dist/components/salla-metadata.js +1 -97
- package/dist/components/salla-modal.js +1 -6
- package/dist/components/salla-modal2.js +1 -215
- package/dist/components/salla-multiple-bundle-product-cart.js +1 -6
- package/dist/components/salla-multiple-bundle-product-cart2.js +1 -151
- package/dist/components/salla-multiple-bundle-product-details.js +1 -6
- package/dist/components/salla-multiple-bundle-product-details2.js +1 -296
- package/dist/components/salla-multiple-bundle-product-options-modal.js +1 -6
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +1 -598
- package/dist/components/salla-multiple-bundle-product-slider.js +1 -6
- package/dist/components/salla-multiple-bundle-product-slider2.js +1 -136
- package/dist/components/salla-multiple-bundle-product.js +1 -207
- package/dist/components/salla-notification-item.js +1 -6
- package/dist/components/salla-notification-item2.js +1 -32
- package/dist/components/salla-notifications.js +1 -145
- package/dist/components/salla-offer-modal.js +1 -328
- package/dist/components/salla-offer.js +1 -478
- package/dist/components/salla-order-details-multiple-bundle-product.js +1 -6
- package/dist/components/salla-order-details-multiple-bundle-product2.js +1 -122
- package/dist/components/salla-order-details-options.js +1 -6
- package/dist/components/salla-order-details-options2.js +1 -140
- package/dist/components/salla-order-details.js +1 -122
- package/dist/components/salla-order-edit-item.js +1 -6
- package/dist/components/salla-order-edit-item2.js +1 -181
- package/dist/components/salla-order-edit.js +1 -288
- package/dist/components/salla-order-summary.js +1 -132
- package/dist/components/salla-order-totals-card.js +1 -87
- package/dist/components/salla-orders.js +1 -271
- package/dist/components/salla-payments.js +1 -76
- package/dist/components/salla-placeholder.js +1 -6
- package/dist/components/salla-placeholder2.js +1 -66
- package/dist/components/salla-price-range.js +1 -6
- package/dist/components/salla-price-range2.js +1 -204
- package/dist/components/salla-product-availability.js +1 -6
- package/dist/components/salla-product-availability2.js +1 -206
- package/dist/components/salla-product-card.js +1 -6
- package/dist/components/salla-product-card2.js +1 -241
- package/dist/components/salla-product-options.js +1 -6
- package/dist/components/salla-product-options2.js +1 -962
- package/dist/components/salla-product-size-guide.js +1 -130
- package/dist/components/salla-products-list.js +1 -6
- package/dist/components/salla-products-list2.js +1 -812
- package/dist/components/salla-products-slider.js +1 -6
- package/dist/components/salla-products-slider2.js +1 -215
- package/dist/components/salla-progress-bar.js +1 -6
- package/dist/components/salla-progress-bar2.js +1 -94
- package/dist/components/salla-quantity-input.js +1 -6
- package/dist/components/salla-quantity-input2.js +1 -127
- package/dist/components/salla-quick-buy.js +1 -6
- package/dist/components/salla-quick-buy2.js +1 -1181
- package/dist/components/salla-quick-order.js +1 -299
- package/dist/components/salla-rating-modal.js +1 -530
- package/dist/components/salla-rating-stars.js +1 -6
- package/dist/components/salla-rating-stars2.js +1 -162
- package/dist/components/salla-review-card.js +1 -6
- package/dist/components/salla-review-card2.js +1 -198
- package/dist/components/salla-reviews-page.js +1 -726
- package/dist/components/salla-reviews-summary.js +1 -6
- package/dist/components/salla-reviews-summary2.js +1 -132
- package/dist/components/salla-reviews.js +1 -143
- package/dist/components/salla-scopes.js +1 -249
- package/dist/components/salla-search.js +1 -213
- package/dist/components/salla-skeleton.js +1 -6
- package/dist/components/salla-skeleton2.js +1 -50
- package/dist/components/salla-slider.js +1 -6
- package/dist/components/salla-slider2.js +1 -10483
- package/dist/components/salla-social-share.js +1 -194
- package/dist/components/salla-social.js +1 -89
- package/dist/components/salla-tab-content.js +1 -6
- package/dist/components/salla-tab-content2.js +1 -55
- package/dist/components/salla-tab-header.js +1 -6
- package/dist/components/salla-tab-header2.js +1 -85
- package/dist/components/salla-tabs.js +1 -6
- package/dist/components/salla-tabs2.js +1 -75
- package/dist/components/salla-tel-input.js +1 -6
- package/dist/components/salla-tel-input2.js +1 -168
- package/dist/components/salla-tiered-offer.js +1 -366
- package/dist/components/salla-tooltip.js +1 -6
- package/dist/components/salla-tooltip2.js +1 -57
- package/dist/components/salla-trust-badges.js +1 -90
- package/dist/components/salla-user-menu.js +1 -344
- package/dist/components/salla-user-profile.js +1 -203
- package/dist/components/salla-user-settings.js +1 -139
- package/dist/components/salla-verify.js +1 -303
- package/dist/components/salla-wallet.js +1 -114
- package/dist/components/search.js +1 -8
- package/dist/components/shopping-bag.js +1 -8
- package/dist/components/special-discount.js +1 -8
- package/dist/components/star.js +1 -8
- package/dist/components/star2.js +1 -8
- package/dist/components/vanilla-picker.js +2 -1034
- package/dist/components/whatsapp2.js +1 -8
- package/dist/esm/app-globals-BFryt7-C.js +37 -0
- package/dist/esm/{filepond-kTbl0kuh.js → filepond-DlGaLh8N.js} +10 -5
- package/dist/esm/{filepond-plugin-file-poster-CyywnjKv.js → filepond-plugin-file-poster-BTVFYcQx.js} +11 -7
- package/dist/esm/{filepond-plugin-file-validate-size-DgteZhje.js → filepond-plugin-file-validate-size-DGryLmWv.js} +1 -1
- package/dist/esm/filepond-plugin-file-validate-type-DxKfCD0V.js +269 -0
- package/dist/esm/{filepond-plugin-image-edit-pZ_mETE7.js → filepond-plugin-image-edit-2W7pu9hn.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CjKYl7HL.js → filepond-plugin-image-exif-orientation-OQu-IvPH.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-BzJTl_2A.js → filepond-plugin-image-preview-DEW_tSNR.js} +1 -1
- package/dist/esm/{index-3Kis_Ivk.js → index-BDqMkCqE.js} +1 -1
- package/dist/esm/{index-C23tPnnH.js → index-DYB20YqN.js} +1966 -1344
- package/dist/esm/loader.js +4 -3
- package/dist/esm/salla-accordion-body_2.entry.js +5 -5
- package/dist/esm/salla-accordion_6.entry.js +19 -15
- package/dist/esm/salla-add-product-button_4.entry.js +12 -10
- package/dist/esm/salla-advertisement.entry.js +3 -3
- package/dist/esm/salla-alert_2.entry.js +5 -5
- package/dist/esm/salla-app-install-alert.entry.js +3 -3
- package/dist/esm/salla-apps-icons.entry.js +3 -3
- package/dist/esm/salla-booking-field_7.entry.js +25 -23
- package/dist/esm/salla-bullet-delivery.entry.js +3 -3
- package/dist/esm/salla-cart-coupons.entry.js +3 -3
- package/dist/esm/salla-cart-item-offers_2.entry.js +5 -5
- package/dist/esm/salla-comment-form_8.entry.js +17 -17
- package/dist/esm/salla-conditional-offer.entry.js +3 -3
- package/dist/esm/salla-contacts.entry.js +3 -3
- package/dist/esm/salla-cookies-bar.entry.js +3 -3
- package/dist/esm/salla-count-down.entry.js +35 -11
- package/dist/esm/salla-custom-fields.entry.js +3 -3
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +3 -3
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +3 -3
- package/dist/esm/salla-hook.entry.js +5 -2
- package/dist/esm/salla-infinite-scroll.entry.js +3 -3
- package/dist/esm/salla-installment.entry.js +3 -3
- package/dist/esm/salla-list-tile.entry.js +3 -3
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +3 -3
- package/dist/esm/salla-loyalty-prize-item.entry.js +3 -3
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty.entry.js +3 -3
- package/dist/esm/salla-maintenance-alert.entry.js +3 -3
- package/dist/esm/salla-map.entry.js +3 -3
- package/dist/esm/salla-menu.entry.js +3 -3
- package/dist/esm/salla-metadata.entry.js +3 -3
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +5 -5
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +8 -6
- package/dist/esm/salla-multiple-bundle-product.entry.js +6 -4
- package/dist/esm/salla-notification-item.entry.js +3 -3
- package/dist/esm/salla-notifications.entry.js +50 -5
- package/dist/esm/salla-offer-modal.entry.js +3 -3
- package/dist/esm/salla-offer.entry.js +3 -3
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +3 -3
- package/dist/esm/salla-order-details-options.entry.js +3 -3
- package/dist/esm/salla-order-details.entry.js +6 -4
- package/dist/esm/salla-order-edit-item.entry.js +3 -3
- package/dist/esm/salla-order-edit.entry.js +3 -3
- package/dist/esm/salla-order-summary.entry.js +3 -3
- package/dist/esm/salla-order-totals-card.entry.js +6 -4
- package/dist/esm/salla-orders.entry.js +3 -3
- package/dist/esm/salla-payments.entry.js +3 -3
- package/dist/esm/salla-placeholder.entry.js +3 -3
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-card.entry.js +3 -3
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +3 -3
- package/dist/esm/salla-products-slider.entry.js +3 -3
- package/dist/esm/salla-progress-bar.entry.js +3 -3
- package/dist/esm/salla-quick-order.entry.js +3 -3
- package/dist/esm/salla-rating-modal.entry.js +3 -3
- package/dist/esm/salla-scopes.entry.js +3 -3
- package/dist/esm/salla-search.entry.js +6 -4
- package/dist/esm/salla-skeleton.entry.js +3 -3
- package/dist/esm/salla-slider.entry.js +20 -14
- package/dist/esm/salla-social-share.entry.js +3 -3
- package/dist/esm/salla-social.entry.js +3 -3
- package/dist/esm/salla-tab-content_3.entry.js +7 -7
- package/dist/esm/salla-tiered-offer.entry.js +3 -3
- package/dist/esm/salla-tooltip.entry.js +3 -3
- package/dist/esm/salla-trust-badges.entry.js +3 -3
- package/dist/esm/salla-user-menu.entry.js +3 -3
- package/dist/esm/salla-user-profile.entry.js +3 -3
- package/dist/esm/salla-user-settings.entry.js +3 -3
- package/dist/esm/salla-verify.entry.js +3 -3
- package/dist/esm/salla-wallet.entry.js +3 -3
- package/dist/esm/twilight.js +5 -4
- package/dist/esm/{vanilla-picker-CEy5x8Cf.js → vanilla-picker-Dt9vZPZF.js} +1 -1
- package/dist/twilight/{p-651fe6e4.entry.js → p-06fa7327.entry.js} +1 -1
- package/dist/twilight/{p-a50f7f70.entry.js → p-09d39785.entry.js} +1 -1
- package/dist/twilight/{p-744d6394.entry.js → p-0add06f9.entry.js} +1 -1
- package/dist/twilight/{p-f251e744.entry.js → p-105b1dab.entry.js} +1 -1
- package/dist/twilight/{p-407828e4.entry.js → p-108d8c8b.entry.js} +1 -1
- package/dist/twilight/{p-2a1871c2.entry.js → p-1875537e.entry.js} +1 -1
- package/dist/twilight/{p-ff6f769c.entry.js → p-18bb0181.entry.js} +1 -1
- package/dist/twilight/p-1daeed6e.entry.js +4 -0
- package/dist/twilight/{p-2aa48902.entry.js → p-1ef2602d.entry.js} +1 -1
- package/dist/twilight/{p-27f34c85.entry.js → p-2881bb33.entry.js} +1 -1
- package/dist/twilight/{p-c3d0c062.entry.js → p-293c6cf3.entry.js} +1 -1
- package/dist/twilight/{p-866b297b.entry.js → p-296d2dd0.entry.js} +1 -1
- package/dist/twilight/{p-3a5aaa20.entry.js → p-2abaa633.entry.js} +1 -1
- package/dist/twilight/p-2ddb3fce.entry.js +4 -0
- package/dist/twilight/{p-81f648a2.entry.js → p-2fe01e44.entry.js} +1 -1
- package/dist/twilight/p-33779828.entry.js +4 -0
- package/dist/twilight/p-34968e31.entry.js +4 -0
- package/dist/twilight/{p-3745a7d0.entry.js → p-34b670fc.entry.js} +1 -1
- package/dist/twilight/{p-9f23dd30.entry.js → p-3ccc532d.entry.js} +1 -1
- package/dist/twilight/{p-f2ee9ceb.entry.js → p-41c733c2.entry.js} +1 -1
- package/dist/twilight/{p-67fe5680.entry.js → p-44fa7521.entry.js} +1 -1
- package/dist/twilight/{p-b4f07395.entry.js → p-4932857d.entry.js} +1 -1
- package/dist/twilight/{p-81f6638f.entry.js → p-4fa4547a.entry.js} +1 -1
- package/dist/twilight/{p-ba4b672c.entry.js → p-542d3277.entry.js} +1 -1
- package/dist/twilight/{p-a00e249b.entry.js → p-57ff1f25.entry.js} +1 -1
- package/dist/twilight/{p-827edf95.entry.js → p-59ae82bd.entry.js} +1 -1
- package/dist/twilight/{p-82e3c734.entry.js → p-647b6d76.entry.js} +1 -1
- package/dist/twilight/p-665189b4.entry.js +4 -0
- package/dist/twilight/{p-b55da21d.entry.js → p-6f36541a.entry.js} +1 -1
- package/dist/twilight/{p-c8aa5377.entry.js → p-7093a427.entry.js} +1 -1
- package/dist/twilight/{p-f201122a.entry.js → p-748df7e6.entry.js} +1 -1
- package/dist/twilight/p-776c9d33.entry.js +4 -0
- package/dist/twilight/{p-ce9fee6d.entry.js → p-7abddca8.entry.js} +1 -1
- package/dist/twilight/p-7b8313ef.entry.js +4 -0
- package/dist/twilight/p-7bd0ede5.entry.js +4 -0
- package/dist/twilight/p-817b8ba5.entry.js +4 -0
- package/dist/twilight/{p-5ef1b170.entry.js → p-87c0ca91.entry.js} +1 -1
- package/dist/twilight/p-8e8d9d7d.entry.js +4 -0
- package/dist/twilight/{p-BHjlzmYy.js → p-8r0S6BcZ.js} +1 -1
- package/dist/twilight/{p-face0448.entry.js → p-94dbc1e9.entry.js} +1 -1
- package/dist/twilight/{p-4e00f827.entry.js → p-96a20515.entry.js} +1 -1
- package/dist/twilight/{p-81f76d49.entry.js → p-96d03a28.entry.js} +1 -1
- package/dist/twilight/{p-97df32eb.entry.js → p-96e78428.entry.js} +1 -1
- package/dist/twilight/{p-CU-HtXWh.js → p-BZnoSB1s.js} +1 -1
- package/dist/twilight/p-BkClxrC4.js +9 -0
- package/dist/twilight/p-Ck4zxCil.js +9 -0
- package/dist/twilight/{p-IoI86ovS.js → p-Cw3UBzjl.js} +1 -1
- package/dist/twilight/p-D1vqXXNX.js +9 -0
- package/dist/twilight/p-DYB20YqN.js +5 -0
- package/dist/twilight/p-Vl6qpttb.js +4 -0
- package/dist/twilight/{p-BgG5eq1x.js → p-X6Yi3bYP.js} +1 -1
- package/dist/twilight/{p-d022b6ec.entry.js → p-a01f1992.entry.js} +1 -1
- package/dist/twilight/{p-5d37cc33.entry.js → p-aa7c5de0.entry.js} +1 -1
- package/dist/twilight/{p-b6ded196.entry.js → p-aaa0c743.entry.js} +1 -1
- package/dist/twilight/{p-713590e2.entry.js → p-ad041ab5.entry.js} +1 -1
- package/dist/twilight/{p-d1dd1db6.entry.js → p-ad07f67a.entry.js} +1 -1
- package/dist/twilight/{p-f1f74b41.entry.js → p-af3c74f4.entry.js} +1 -1
- package/dist/twilight/p-af60e72a.entry.js +4 -0
- package/dist/twilight/{p-bdcf3926.entry.js → p-b17d055d.entry.js} +1 -1
- package/dist/twilight/{p-c68f3054.entry.js → p-b598c0f7.entry.js} +1 -1
- package/dist/twilight/{p-8c6db6d7.entry.js → p-b64f3155.entry.js} +1 -1
- package/dist/twilight/p-bNzv71Xl.js +9 -0
- package/dist/twilight/{p-BqCmPfAo.js → p-bScl0xMh.js} +2 -2
- package/dist/twilight/{p-344c1910.entry.js → p-bff4c7b3.entry.js} +1 -1
- package/dist/twilight/{p-1b1f9f71.entry.js → p-c091e2dc.entry.js} +1 -1
- package/dist/twilight/{p-775b42ec.entry.js → p-c1fd45b1.entry.js} +1 -1
- package/dist/twilight/{p-1c215c8c.entry.js → p-c3ffb88a.entry.js} +1 -1
- package/dist/twilight/{p-9deae4f4.entry.js → p-c87951a2.entry.js} +1 -1
- package/dist/twilight/{p-1899f283.entry.js → p-ccfe5308.entry.js} +1 -1
- package/dist/twilight/{p-98eb495e.entry.js → p-d337c399.entry.js} +1 -1
- package/dist/twilight/{p-7b717899.entry.js → p-d371d450.entry.js} +1 -1
- package/dist/twilight/{p-f8b6967f.entry.js → p-d4a242f8.entry.js} +1 -1
- package/dist/twilight/{p-194d87c6.entry.js → p-d9f5a8cd.entry.js} +1 -1
- package/dist/twilight/{p-ff9b33bb.entry.js → p-dd2bd5dc.entry.js} +1 -1
- package/dist/twilight/{p-e89812d8.entry.js → p-df6853b5.entry.js} +1 -1
- package/dist/twilight/{p-05663bb1.entry.js → p-e28c0773.entry.js} +1 -1
- package/dist/twilight/{p-a76b3dba.entry.js → p-e3b8e0e1.entry.js} +1 -1
- package/dist/twilight/p-e679884a.entry.js +4 -0
- package/dist/twilight/{p-11767786.entry.js → p-e6bbf50d.entry.js} +1 -1
- package/dist/twilight/{p-1ca75c99.entry.js → p-e94f217b.entry.js} +1 -1
- package/dist/twilight/{p-d81ad2c3.entry.js → p-eac718cd.entry.js} +1 -1
- package/dist/twilight/{p-85ceef78.entry.js → p-ede67a08.entry.js} +1 -1
- package/dist/twilight/p-efab88c5.entry.js +4 -0
- package/dist/twilight/{p-1dbaefb8.entry.js → p-f176d41d.entry.js} +1 -1
- package/dist/twilight/p-f5d15e71.entry.js +4 -0
- package/dist/twilight/{p-50621375.entry.js → p-f7999a6d.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-count-down/salla-count-down.d.ts +6 -0
- package/dist/types/components/salla-notifications/interfaces.d.ts +20 -0
- package/dist/types/components/salla-notifications/salla-notifications.d.ts +17 -0
- package/dist/types/components.d.ts +763 -177
- package/dist/types/stencil-public-runtime.d.ts +169 -11
- package/package.json +5 -5
- package/dist/cjs/filepond-plugin-file-validate-type-Dfy66STE.js +0 -287
- package/dist/esm/filepond-plugin-file-validate-type-BYs_scJr.js +0 -285
- package/dist/twilight/p-0652987b.entry.js +0 -4
- package/dist/twilight/p-14529fd6.entry.js +0 -4
- package/dist/twilight/p-1c8394db.entry.js +0 -4
- package/dist/twilight/p-346b55d6.entry.js +0 -4
- package/dist/twilight/p-3962c34c.entry.js +0 -4
- package/dist/twilight/p-4e9e3ab1.entry.js +0 -4
- package/dist/twilight/p-549f59ed.entry.js +0 -4
- package/dist/twilight/p-54f65187.entry.js +0 -4
- package/dist/twilight/p-726513f8.entry.js +0 -4
- package/dist/twilight/p-753464fd.entry.js +0 -4
- package/dist/twilight/p-AfW2b46_.js +0 -9
- package/dist/twilight/p-C23tPnnH.js +0 -5
- package/dist/twilight/p-CrYUKEsF.js +0 -9
- package/dist/twilight/p-HWjjIZ9_.js +0 -9
- package/dist/twilight/p-Ig1Tafsp.js +0 -9
- package/dist/twilight/p-c9001d7f.entry.js +0 -4
- package/dist/twilight/p-cf9573fd.entry.js +0 -4
- package/dist/twilight/p-e6124fab.entry.js +0 -4
- package/dist/twilight/p-eb5a8329.entry.js +0 -4
|
@@ -1,347 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
-
import { A as ArrowDown } from './keyboard_arrow_down.js';
|
|
6
|
-
import { B as BellRing } from './bell-ring.js';
|
|
7
|
-
import { P as PendingOrdersIcon } from './cart.js';
|
|
8
|
-
import { W as WishListIcon } from './star.js';
|
|
9
|
-
import { C as Cancel } from './cancel.js';
|
|
10
|
-
import { R as Rate } from './star2.js';
|
|
11
|
-
import { l as loyaltyProgramIcon } from './gift.js';
|
|
12
|
-
import { d as defineCustomElement$4 } from './salla-loading2.js';
|
|
13
|
-
import { d as defineCustomElement$3 } from './salla-login-modal2.js';
|
|
14
|
-
import { d as defineCustomElement$2 } from './salla-modal2.js';
|
|
15
|
-
|
|
16
|
-
var OrderIcon = `<!-- Generated by IcoMoon.io -->
|
|
17
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
18
|
-
<title>box-bankers</title>
|
|
19
|
-
<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>
|
|
20
|
-
</svg>
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
var UserCircle = `<!-- Generated by IcoMoon.io -->
|
|
24
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
25
|
-
<title>user-circle</title>
|
|
26
|
-
<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>
|
|
27
|
-
</svg>
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
var LogoutIcon = `<!-- Generated by IcoMoon.io -->
|
|
31
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
32
|
-
<title>send-out</title>
|
|
33
|
-
<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>
|
|
34
|
-
</svg>
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
var WalletIcon = `<!-- Generated by IcoMoon.io -->
|
|
38
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
39
|
-
<title>wallet</title>
|
|
40
|
-
<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>
|
|
41
|
-
</svg>
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
var SettingstIcon = `<!-- Generated by IcoMoon.io -->
|
|
45
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
46
|
-
<title>settings</title>
|
|
47
|
-
<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16.016 18.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>
|
|
48
|
-
</svg>
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
const sallaUserMenuCss = "";
|
|
52
|
-
|
|
53
|
-
const SallaUserMenu$1 = /*@__PURE__*/ proxyCustomElement(class SallaUserMenu extends HTMLElement {
|
|
54
|
-
constructor() {
|
|
55
|
-
super();
|
|
56
|
-
this.__registerHost();
|
|
57
|
-
this.accountLoading = false;
|
|
58
|
-
this.opened = false;
|
|
59
|
-
this.notifications = salla.lang.get('common.titles.notifications');
|
|
60
|
-
this.orders = salla.lang.get('common.titles.orders');
|
|
61
|
-
this.pending_orders = salla.lang.get('common.titles.pending_orders');
|
|
62
|
-
this.wishlist = salla.lang.get('common.titles.wishlist');
|
|
63
|
-
this.profile = salla.lang.get('common.titles.profile');
|
|
64
|
-
this.rating = salla.lang.get('common.titles.rating');
|
|
65
|
-
this.wallet = salla.lang.get('common.titles.wallet');
|
|
66
|
-
this.settings = salla.lang.get('common.titles.settings');
|
|
67
|
-
this.loyalty_program = salla.lang.get('pages.loyalty_program.loyalty_points');
|
|
68
|
-
this.logout = salla.lang.get('blocks.header.logout');
|
|
69
|
-
this.hello = salla.lang.get('pages.checkout.hello');
|
|
70
|
-
this.first_name = salla.storage.get('user.first_name') || '';
|
|
71
|
-
this.last_name = salla.storage.get('user.last_name') || '';
|
|
72
|
-
this.avatar = salla.storage.get('user.avatar') || salla.url.cdn('images/avatar.png', 40, 40);
|
|
73
|
-
this.badges = {
|
|
74
|
-
notifications: salla.helpers.number(salla.storage.get('user.notifications') || 0),
|
|
75
|
-
pending_orders: salla.helpers.number(salla.storage.get('user.pending_orders') || 0),
|
|
76
|
-
};
|
|
77
|
-
this.sallaAccountEnabled = false;
|
|
78
|
-
this.hasBadges = Number(salla.storage.get('user.pending_orders')) > 0 ||
|
|
79
|
-
Number(salla.storage.get('user.notifications')) > 0;
|
|
80
|
-
/**
|
|
81
|
-
* To display only the list without the dropdown functionality
|
|
82
|
-
*/
|
|
83
|
-
this.inline = false;
|
|
84
|
-
/**
|
|
85
|
-
* To display the trigger as an avatar only
|
|
86
|
-
*/
|
|
87
|
-
this.avatarOnly = false;
|
|
88
|
-
/**
|
|
89
|
-
* To display the dropdown header in mobile sheet
|
|
90
|
-
*/
|
|
91
|
-
this.showHeader = false;
|
|
92
|
-
/**
|
|
93
|
-
* To Make the dropdown menu relative to parent element or not
|
|
94
|
-
*/
|
|
95
|
-
this.relativeDropdown = false;
|
|
96
|
-
/**
|
|
97
|
-
* To show the trigger button or not
|
|
98
|
-
*/
|
|
99
|
-
this.showTrigger = false;
|
|
100
|
-
this.onClickOutside = () => {
|
|
101
|
-
this.opened = false;
|
|
102
|
-
};
|
|
103
|
-
this.OrderUpdate = 0;
|
|
104
|
-
this.items = {
|
|
105
|
-
notifications: BellRing,
|
|
106
|
-
orders: OrderIcon,
|
|
107
|
-
pending_orders: PendingOrdersIcon,
|
|
108
|
-
wishlist: WishListIcon,
|
|
109
|
-
wallet: WalletIcon,
|
|
110
|
-
loyalty_program: loyaltyProgramIcon,
|
|
111
|
-
profile: UserCircle
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
async componentWillLoad() {
|
|
115
|
-
await salla.onReady();
|
|
116
|
-
await salla.lang.onLoaded();
|
|
117
|
-
this.loadTranslations();
|
|
118
|
-
this.initiate();
|
|
119
|
-
Salla.event.on('api::token.injected', (token) => this.profileUrl = this.buildProfileUrl(token));
|
|
120
|
-
this.sallaAccountEnabled = Salla.config.get('store.features')?.includes('salla-account');
|
|
121
|
-
this.items = this.sallaAccountEnabled ? { ...this.items, settings: SettingstIcon } : this.items;
|
|
122
|
-
//we need it only in theme-y
|
|
123
|
-
if (this.host.hasAttribute('with-rating')) {
|
|
124
|
-
this.items.rating = Rate;
|
|
125
|
-
}
|
|
126
|
-
//we need it to be the last item
|
|
127
|
-
this.items.logout = LogoutIcon;
|
|
128
|
-
let token = Salla.storage.get('token');
|
|
129
|
-
if (!token) {
|
|
130
|
-
token = '';
|
|
131
|
-
}
|
|
132
|
-
this.profileUrl = this.buildProfileUrl(token);
|
|
133
|
-
const trigger = this.host.querySelector('[slot="trigger"]');
|
|
134
|
-
this.triggerSlot =
|
|
135
|
-
'<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>';
|
|
136
|
-
if (!trigger) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
this.triggerSlot = trigger.innerHTML;
|
|
140
|
-
trigger.innerHTML = this.replaceParams(trigger.innerHTML);
|
|
141
|
-
}
|
|
142
|
-
loadTranslations() {
|
|
143
|
-
this.notifications = Salla.lang.get('common.titles.notifications');
|
|
144
|
-
this.orders = Salla.lang.get('common.titles.orders');
|
|
145
|
-
this.pending_orders = Salla.lang.get('common.titles.pending_orders');
|
|
146
|
-
this.wishlist = Salla.lang.get('common.titles.wishlist');
|
|
147
|
-
this.profile = Salla.lang.get('common.titles.profile');
|
|
148
|
-
this.hello = Salla.lang.get('pages.checkout.hello');
|
|
149
|
-
this.rating = Salla.lang.get('common.titles.rating');
|
|
150
|
-
this.wallet = Salla.lang.get('common.titles.wallet');
|
|
151
|
-
this.settings = Salla.lang.get('common.titles.settings');
|
|
152
|
-
this.loyalty_program = Salla.lang.get('pages.loyalty_program.loyalty_points');
|
|
153
|
-
this.logout = Salla.lang.get('blocks.header.logout');
|
|
154
|
-
}
|
|
155
|
-
initiate() {
|
|
156
|
-
if (Salla.config.isGuest()) {
|
|
157
|
-
return this.autoMountLoginModal();
|
|
158
|
-
}
|
|
159
|
-
this.is_loggedIn = true;
|
|
160
|
-
/**
|
|
161
|
-
* Get Fresh Notifications In These Cases:
|
|
162
|
-
* - is notification page, if user already changed the status of his orders (to reset notification badge)
|
|
163
|
-
* - is pending orders page, if user already changed the status of his orders (to reset orders badge)
|
|
164
|
-
* - is profile page, in case user changed his name or avatar, we need to update it
|
|
165
|
-
* - half hour is passed from the last user data fetched
|
|
166
|
-
*
|
|
167
|
-
* //todo:: update the data in the storage in customer pages
|
|
168
|
-
* //todo:: cover two requests in customer pages
|
|
169
|
-
* //todo:: make sure to run this only after token is set
|
|
170
|
-
*/
|
|
171
|
-
const shouldFetchProfile = !this.inline &&
|
|
172
|
-
(salla.url.is_page('customer.notifications') ||
|
|
173
|
-
salla.url.is_page('customer.orders.index.pending') ||
|
|
174
|
-
salla.url.is_page('customer.profile') ||
|
|
175
|
-
(Date.now() - (salla.storage.get('user.fetched_at') || 0)) / 1000 / 60 > 30);
|
|
176
|
-
if (shouldFetchProfile) {
|
|
177
|
-
return this.fetchFreshProfile();
|
|
178
|
-
}
|
|
179
|
-
salla.event.on('profile::info.fetched', res => {
|
|
180
|
-
this.updateProfileState(res);
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
autoMountLoginModal() {
|
|
184
|
-
if (!this.showTrigger) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
if (document.querySelector('salla-login-modal')) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
Salla.hooks.mount('body:end', document.createElement('salla-login-modal'));
|
|
191
|
-
}
|
|
192
|
-
fetchFreshProfile() {
|
|
193
|
-
//don't request fetchFreshProfile unless token is injected into the api
|
|
194
|
-
if (!salla.api.token) {
|
|
195
|
-
salla.log('trying to fetchFreshProfile before injected the token!!');
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
salla.profile.api.info().then(res => {
|
|
199
|
-
this.updateProfileState(res);
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
updateProfileState(res) {
|
|
203
|
-
this.badges = {
|
|
204
|
-
notifications: salla.helpers.number(res.data.notifications || 0),
|
|
205
|
-
pending_orders: salla.helpers.number(res.data.pending_orders || 0),
|
|
206
|
-
};
|
|
207
|
-
this.hasBadges = Number(res.data.pending_orders) > 0 || Number(res.data.notifications) > 0;
|
|
208
|
-
this.first_name = res.data.first_name;
|
|
209
|
-
this.last_name = res.data.last_name;
|
|
210
|
-
this.avatar = res.data.avatar || salla.url.cdn('images/avatar.png', 40, 40);
|
|
211
|
-
}
|
|
212
|
-
async open(e) {
|
|
213
|
-
this.opened = !this.opened;
|
|
214
|
-
e.stopPropagation();
|
|
215
|
-
if (this.opened) {
|
|
216
|
-
window.addEventListener('click', this.onClickOutside);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
menuItemClicked(event, itemKey) {
|
|
220
|
-
if (itemKey !== 'logout') {
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
event.preventDefault();
|
|
224
|
-
salla.auth.logout('sall-user-menu');
|
|
225
|
-
}
|
|
226
|
-
replaceParams(body) {
|
|
227
|
-
return body
|
|
228
|
-
.replace(/\{hello\}/g, this.hello)
|
|
229
|
-
.replace(/\{first_name\}/g, this.first_name)
|
|
230
|
-
.replace(/\{last_name\}/g, this.last_name)
|
|
231
|
-
.replace(/\{avatar\}/g, this.avatar)
|
|
232
|
-
.replace(/\{icon\}/g, ArrowDown);
|
|
233
|
-
}
|
|
234
|
-
getTheHeader() {
|
|
235
|
-
return (h("div", { class: {
|
|
236
|
-
's-user-menu-trigger-slot': true,
|
|
237
|
-
's-user-menu-red-dot': this.hasBadges,
|
|
238
|
-
's-user-menu-trigger-avatar-only': this.avatarOnly,
|
|
239
|
-
}, id: "trigger-slot", onClick: e => this.open(e), onKeyUp: e => this.open(e), innerHTML: this.replaceParams(this.triggerSlot) }));
|
|
240
|
-
}
|
|
241
|
-
getItemAnchorLinkAttrs(itemKey) {
|
|
242
|
-
if (itemKey === 'profile' && this.profileUrl && this.sallaAccountEnabled) {
|
|
243
|
-
return { href: this.profileUrl, target: '_blank', rel: 'noopener noreferrer' };
|
|
244
|
-
}
|
|
245
|
-
// Fix loyalty program URL mapping from master
|
|
246
|
-
const urlKey = itemKey === 'loyalty_program' ? 'loyalty' : itemKey;
|
|
247
|
-
return { href: Salla.url.get(urlKey) };
|
|
248
|
-
}
|
|
249
|
-
getMenuItem([itemKey, itemValue], i) {
|
|
250
|
-
//todo:: enhancement support slot here
|
|
251
|
-
if (itemKey === 'wallet' && !window.can_access_wallet)
|
|
252
|
-
return;
|
|
253
|
-
if (itemKey === 'loyalty_program' && !Salla.config.get('store.features').includes('loyalty-system'))
|
|
254
|
-
return;
|
|
255
|
-
return (h("li", { class: {
|
|
256
|
-
's-user-menu-dropdown-item': true,
|
|
257
|
-
's-user-menu-dropdown-item-logout': i + 1 === Object.entries(this.items).length,
|
|
258
|
-
} }, h("a", { ...this.getItemAnchorLinkAttrs(itemKey), class: "s-user-menu-dropdown-item-link", onClick: event => this.menuItemClicked(event, itemKey) }, h("i", { class: "s-user-menu-dropdown-item-prefix", innerHTML: itemValue }), h("span", { class: "s-user-menu-dropdown-item-title" }, this[itemKey]), !['٠', '0', undefined].includes(this.badges[itemKey]) ? (h("span", { class: "s-user-menu-dropdown-item-badge" }, this.badges[itemKey])) : (''))));
|
|
259
|
-
}
|
|
260
|
-
componentShouldUpdate() {
|
|
261
|
-
if (!this.opened) {
|
|
262
|
-
window.removeEventListener('click', this.onClickOutside);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
render() {
|
|
266
|
-
if (!this.is_loggedIn) {
|
|
267
|
-
return (h(Host, null, h("slot", { name: "login-btn" }, h("button", { type: "button", class: "s-user-menu-login-btn", onClick: () => salla.event.dispatch('login::open'), innerHTML: UserCircle }))));
|
|
268
|
-
}
|
|
269
|
-
if (this.inline) {
|
|
270
|
-
return (h(Host, null, h("ul", { class: "s-user-menu-inline" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i)))));
|
|
271
|
-
}
|
|
272
|
-
return (h(Host, null, h("div", { class: {
|
|
273
|
-
's-user-menu-wrapper': true,
|
|
274
|
-
's-user-menu-relative-dropdown': this.relativeDropdown,
|
|
275
|
-
} }, this.getTheHeader(), h("div", { class: { 's-user-menu-toggler': true, opened: this.opened } }, h("div", { class: "s-user-menu-dropdown", onClick: e => e.stopPropagation(), onKeyUp: e => e.stopPropagation() }, this.showHeader ? (h("div", { class: "s-user-menu-dropdown-header" }, h("img", { src: this.avatar, alt: `${this.first_name} ${this.last_name}` }), h("div", { class: "s-user-menu-dropdown-header-content" }, h("span", null, this.hello), h("p", null, this.first_name, " ", this.last_name)), h("button", { type: 'button', class: "s-user-menu-dropdown-header-close", innerHTML: Cancel, onClick: () => { this.opened = false; } }))) : (''), h("ul", { class: "s-user-menu-dropdown-list" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))))))));
|
|
276
|
-
}
|
|
277
|
-
componentDidLoad() {
|
|
278
|
-
document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));
|
|
279
|
-
}
|
|
280
|
-
buildProfileUrl(token) {
|
|
281
|
-
return `${Salla.config.get('account.url', 'https://accounts.salla.com')}/${salla.config.get('user.language_code')}/user?store=${Salla.config.get('store.id')}&info=${encodeURIComponent(token)}`;
|
|
282
|
-
}
|
|
283
|
-
get host() { return this; }
|
|
284
|
-
static get style() { return sallaUserMenuCss; }
|
|
285
|
-
}, [4, "salla-user-menu", {
|
|
286
|
-
"inline": [516],
|
|
287
|
-
"avatarOnly": [516, "avatar-only"],
|
|
288
|
-
"showHeader": [516, "show-header"],
|
|
289
|
-
"relativeDropdown": [516, "relative-dropdown"],
|
|
290
|
-
"showTrigger": [1540, "show-trigger"],
|
|
291
|
-
"accountLoading": [32],
|
|
292
|
-
"opened": [32],
|
|
293
|
-
"notifications": [32],
|
|
294
|
-
"orders": [32],
|
|
295
|
-
"pending_orders": [32],
|
|
296
|
-
"wishlist": [32],
|
|
297
|
-
"profile": [32],
|
|
298
|
-
"rating": [32],
|
|
299
|
-
"wallet": [32],
|
|
300
|
-
"settings": [32],
|
|
301
|
-
"loyalty_program": [32],
|
|
302
|
-
"logout": [32],
|
|
303
|
-
"hello": [32],
|
|
304
|
-
"first_name": [32],
|
|
305
|
-
"last_name": [32],
|
|
306
|
-
"avatar": [32],
|
|
307
|
-
"is_loggedIn": [32],
|
|
308
|
-
"badges": [32],
|
|
309
|
-
"sallaAccountEnabled": [32],
|
|
310
|
-
"hasBadges": [32],
|
|
311
|
-
"profileUrl": [32],
|
|
312
|
-
"OrderUpdate": [32]
|
|
313
|
-
}]);
|
|
314
|
-
function defineCustomElement$1() {
|
|
315
|
-
if (typeof customElements === "undefined") {
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
const components = ["salla-user-menu", "salla-loading", "salla-login-modal", "salla-modal"];
|
|
319
|
-
components.forEach(tagName => { switch (tagName) {
|
|
320
|
-
case "salla-user-menu":
|
|
321
|
-
if (!customElements.get(tagName)) {
|
|
322
|
-
customElements.define(tagName, SallaUserMenu$1);
|
|
323
|
-
}
|
|
324
|
-
break;
|
|
325
|
-
case "salla-loading":
|
|
326
|
-
if (!customElements.get(tagName)) {
|
|
327
|
-
defineCustomElement$4();
|
|
328
|
-
}
|
|
329
|
-
break;
|
|
330
|
-
case "salla-login-modal":
|
|
331
|
-
if (!customElements.get(tagName)) {
|
|
332
|
-
defineCustomElement$3();
|
|
333
|
-
}
|
|
334
|
-
break;
|
|
335
|
-
case "salla-modal":
|
|
336
|
-
if (!customElements.get(tagName)) {
|
|
337
|
-
defineCustomElement$2();
|
|
338
|
-
}
|
|
339
|
-
break;
|
|
340
|
-
} });
|
|
341
|
-
}
|
|
342
|
-
defineCustomElement$1();
|
|
343
|
-
|
|
344
|
-
const SallaUserMenu = SallaUserMenu$1;
|
|
345
|
-
const defineCustomElement = defineCustomElement$1;
|
|
346
|
-
|
|
347
|
-
export { SallaUserMenu, defineCustomElement };
|
|
4
|
+
import{transformTag as s,proxyCustomElement as t,HTMLElement as e,h as l,Host as a}from"@stencil/core/internal/client";import{A as i}from"./keyboard_arrow_down.js";import{B as o}from"./bell-ring.js";import{P as n}from"./cart.js";import{W as r}from"./star.js";import{C as c}from"./cancel.js";import{R as h}from"./star2.js";import{l as m}from"./gift.js";import{d}from"./salla-loading2.js";import{d as u}from"./salla-login-modal2.js";import{d as g}from"./salla-modal2.js";var p='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-circle</title>\n<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>\n</svg>\n';const w=t(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.accountLoading=!1,this.opened=!1,this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_program=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout"),this.hello=salla.lang.get("pages.checkout.hello"),this.first_name=salla.storage.get("user.first_name")||"",this.last_name=salla.storage.get("user.last_name")||"",this.avatar=salla.storage.get("user.avatar")||salla.url.cdn("images/avatar.png",40,40),this.badges={notifications:salla.helpers.number(salla.storage.get("user.notifications")||0),pending_orders:salla.helpers.number(salla.storage.get("user.pending_orders")||0)},this.sallaAccountEnabled=!1,this.hasBadges=Number(salla.storage.get("user.pending_orders"))>0||Number(salla.storage.get("user.notifications"))>0,this.inline=!1,this.avatarOnly=!1,this.showHeader=!1,this.relativeDropdown=!1,this.showTrigger=!1,this.onClickOutside=()=>{this.opened=!1},this.OrderUpdate=0,this.items={notifications:o,orders:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>box-bankers</title>\n<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',pending_orders:n,wishlist:r,wallet:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>wallet</title>\n<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>\n</svg>\n',loyalty_program:m,profile:p}}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.initiate(),Salla.event.on("api::token.injected",(s=>this.profileUrl=this.buildProfileUrl(s))),this.sallaAccountEnabled=Salla.config.get("store.features")?.includes("salla-account"),this.items=this.sallaAccountEnabled?{...this.items,settings:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>settings</title>\n<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16.016 18.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}:this.items,this.host.hasAttribute("with-rating")&&(this.items.rating=h),this.items.logout='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>send-out</title>\n<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>\n</svg>\n';let s=Salla.storage.get("token");s||(s=""),this.profileUrl=this.buildProfileUrl(s);const t=this.host.querySelector('[slot="trigger"]');this.triggerSlot='<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>',t&&(this.triggerSlot=t.innerHTML,t.innerHTML=this.replaceParams(t.innerHTML))}loadTranslations(){this.notifications=Salla.lang.get("common.titles.notifications"),this.orders=Salla.lang.get("common.titles.orders"),this.pending_orders=Salla.lang.get("common.titles.pending_orders"),this.wishlist=Salla.lang.get("common.titles.wishlist"),this.profile=Salla.lang.get("common.titles.profile"),this.hello=Salla.lang.get("pages.checkout.hello"),this.rating=Salla.lang.get("common.titles.rating"),this.wallet=Salla.lang.get("common.titles.wallet"),this.settings=Salla.lang.get("common.titles.settings"),this.loyalty_program=Salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=Salla.lang.get("blocks.header.logout")}initiate(){return Salla.config.isGuest()?this.autoMountLoginModal():(this.is_loggedIn=!0,!this.inline&&(salla.url.is_page("customer.notifications")||salla.url.is_page("customer.orders.index.pending")||salla.url.is_page("customer.profile")||(Date.now()-(salla.storage.get("user.fetched_at")||0))/1e3/60>30)?this.fetchFreshProfile():void salla.event.on("profile::info.fetched",(s=>{this.updateProfileState(s)})))}autoMountLoginModal(){this.showTrigger&&(document.querySelector("salla-login-modal")||Salla.hooks.mount("body:end",document.createElement("salla-login-modal")))}fetchFreshProfile(){salla.api.token?salla.profile.api.info().then((s=>{this.updateProfileState(s)})):salla.log("trying to fetchFreshProfile before injected the token!!")}updateProfileState(s){this.badges={notifications:salla.helpers.number(s.data.notifications||0),pending_orders:salla.helpers.number(s.data.pending_orders||0)},this.hasBadges=Number(s.data.pending_orders)>0||Number(s.data.notifications)>0,this.first_name=s.data.first_name,this.last_name=s.data.last_name,this.avatar=s.data.avatar||salla.url.cdn("images/avatar.png",40,40)}async open(s){this.opened=!this.opened,s.stopPropagation(),this.opened&&window.addEventListener("click",this.onClickOutside)}menuItemClicked(s,t){"logout"===t&&(s.preventDefault(),salla.auth.logout("sall-user-menu"))}replaceParams(s){return s.replace(/\{hello\}/g,this.hello).replace(/\{first_name\}/g,this.first_name).replace(/\{last_name\}/g,this.last_name).replace(/\{avatar\}/g,this.avatar).replace(/\{icon\}/g,i)}getTheHeader(){return l("div",{class:{"s-user-menu-trigger-slot":!0,"s-user-menu-red-dot":this.hasBadges,"s-user-menu-trigger-avatar-only":this.avatarOnly},id:"trigger-slot",onClick:s=>this.open(s),onKeyUp:s=>this.open(s),innerHTML:this.replaceParams(this.triggerSlot)})}getItemAnchorLinkAttrs(s){return"profile"===s&&this.profileUrl&&this.sallaAccountEnabled?{href:this.profileUrl,target:"_blank",rel:"noopener noreferrer"}:{href:Salla.url.get("loyalty_program"===s?"loyalty":s)}}getMenuItem([s,t],e){if(("wallet"!==s||window.can_access_wallet)&&("loyalty_program"!==s||Salla.config.get("store.features").includes("loyalty-system")))return l("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":e+1===Object.entries(this.items).length}},l("a",{...this.getItemAnchorLinkAttrs(s),class:"s-user-menu-dropdown-item-link",onClick:t=>this.menuItemClicked(t,s)},l("i",{class:"s-user-menu-dropdown-item-prefix",innerHTML:t}),l("span",{class:"s-user-menu-dropdown-item-title"},this[s]),["٠","0",void 0].includes(this.badges[s])?"":l("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[s])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return l(a,null,this.is_loggedIn?this.inline?l("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((s,t)=>this.getMenuItem(s,t)))):l("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),l("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},l("div",{class:"s-user-menu-dropdown",onClick:s=>s.stopPropagation(),onKeyUp:s=>s.stopPropagation()},this.showHeader?l("div",{class:"s-user-menu-dropdown-header"},l("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),l("div",{class:"s-user-menu-dropdown-header-content"},l("span",null,this.hello),l("p",null,this.first_name," ",this.last_name)),l("button",{type:"button",class:"s-user-menu-dropdown-header-close",innerHTML:c,onClick:()=>{this.opened=!1}})):"",l("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((s,t)=>this.getMenuItem(s,t))))))):l("slot",{name:"login-btn"},l("button",{type:"button",class:"s-user-menu-login-btn",onClick:()=>salla.event.dispatch("login::open"),innerHTML:p})))}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy"))}buildProfileUrl(s){return`${Salla.config.get("account.url","https://accounts.salla.com")}/${salla.config.get("user.language_code")}/user?store=${Salla.config.get("store.id")}&info=${encodeURIComponent(s)}`}get host(){return this}static get style(){return""}},[260,"salla-user-menu",{inline:[516],avatarOnly:[516,"avatar-only"],showHeader:[516,"show-header"],relativeDropdown:[516,"relative-dropdown"],showTrigger:[1540,"show-trigger"],accountLoading:[32],opened:[32],notifications:[32],orders:[32],pending_orders:[32],wishlist:[32],profile:[32],rating:[32],wallet:[32],settings:[32],loyalty_program:[32],logout:[32],hello:[32],first_name:[32],last_name:[32],avatar:[32],is_loggedIn:[32],badges:[32],sallaAccountEnabled:[32],hasBadges:[32],profileUrl:[32],OrderUpdate:[32]}]);function v(){"undefined"!=typeof customElements&&["salla-user-menu","salla-loading","salla-login-modal","salla-modal"].forEach((t=>{switch(t){case"salla-user-menu":customElements.get(s(t))||customElements.define(s(t),w);break;case"salla-loading":customElements.get(s(t))||d();break;case"salla-login-modal":customElements.get(s(t))||u();break;case"salla-modal":customElements.get(s(t))||g()}}))}v();const f=w,y=v;export{f as SallaUserMenu,y as defineCustomElement}
|
|
@@ -1,206 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
5
|
-
import { G as Genders } from './interfaces.js';
|
|
6
|
-
import { d as defineCustomElement$5 } from './salla-button2.js';
|
|
7
|
-
import { d as defineCustomElement$4 } from './salla-datetime-picker2.js';
|
|
8
|
-
import { d as defineCustomElement$3 } from './salla-skeleton2.js';
|
|
9
|
-
import { d as defineCustomElement$2 } from './salla-tel-input2.js';
|
|
10
|
-
|
|
11
|
-
const sallaUserProfileCss = ":host{display:block}";
|
|
12
|
-
|
|
13
|
-
const SallaUserProfile$1 = /*@__PURE__*/ proxyCustomElement(class SallaUserProfile extends HTMLElement {
|
|
14
|
-
// Constructor
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
this.__registerHost();
|
|
18
|
-
/**
|
|
19
|
-
* The minimum allowed age for a user. Users with a birthdate indicating an age less than this value will be considered invalid.
|
|
20
|
-
* Defaults to 10.
|
|
21
|
-
*/
|
|
22
|
-
this.minAge = 10;
|
|
23
|
-
this.isEditable = true;
|
|
24
|
-
this.disableAction = false;
|
|
25
|
-
this.isLoading = true;
|
|
26
|
-
// Translated Strings State
|
|
27
|
-
this.first_name_trans = salla.lang.get('pages.profile.first_name');
|
|
28
|
-
this.last_name_trans = salla.lang.get('pages.profile.last_name');
|
|
29
|
-
this.birthday_trans = salla.lang.get('pages.profile.birthday');
|
|
30
|
-
this.birthday_placeholder_trans = salla.lang.get('pages.profile.birthday_placeholder');
|
|
31
|
-
this.gender_trans = salla.lang.get('pages.profile.gender');
|
|
32
|
-
this.gender_placeholder_trans = salla.lang.get('pages.profile.gender_placeholder');
|
|
33
|
-
this.male_trans = salla.lang.get('pages.profile.male');
|
|
34
|
-
this.female_trans = salla.lang.get('pages.profile.female');
|
|
35
|
-
this.email_trans = salla.lang.get('common.elements.email');
|
|
36
|
-
this.mobile_trans = salla.lang.get('common.elements.mobile');
|
|
37
|
-
this.save_btn_trans = salla.lang.get('common.elements.save');
|
|
38
|
-
this.drag_and_drop_trans = salla.lang.get('common.uploader.drag_and_drop');
|
|
39
|
-
this.browse_trans = salla.lang.get('common.uploader.browse');
|
|
40
|
-
this.email_required_trans = salla.lang.get('pages.checkout.email_required');
|
|
41
|
-
this.invalid_email_trans = salla.lang.get('pages.error.invalid_value', {
|
|
42
|
-
attribute: 'email',
|
|
43
|
-
});
|
|
44
|
-
// Localization setup when the language is loaded
|
|
45
|
-
salla.lang.onLoaded(() => {
|
|
46
|
-
// Assigning translated strings to state properties
|
|
47
|
-
// These translations are fetched from the localization object
|
|
48
|
-
this.first_name_trans = salla.lang.get('pages.profile.first_name');
|
|
49
|
-
this.last_name_trans = salla.lang.get('pages.profile.last_name');
|
|
50
|
-
this.birthday_trans = salla.lang.get('pages.profile.birthday');
|
|
51
|
-
this.birthday_placeholder_trans = salla.lang.get('pages.profile.birthday_placeholder');
|
|
52
|
-
this.gender_trans = salla.lang.get('pages.profile.gender');
|
|
53
|
-
this.gender_placeholder_trans = salla.lang.get('pages.profile.gender_placeholder');
|
|
54
|
-
this.male_trans = salla.lang.get('pages.profile.male');
|
|
55
|
-
this.female_trans = salla.lang.get('pages.profile.female');
|
|
56
|
-
this.email_trans = salla.lang.get('common.elements.email');
|
|
57
|
-
this.mobile_trans = salla.lang.get('common.elements.mobile');
|
|
58
|
-
this.save_btn_trans = salla.lang.get('common.elements.save');
|
|
59
|
-
this.drag_and_drop_trans = salla.lang.get('common.uploader.drag_and_drop');
|
|
60
|
-
this.browse_trans = salla.lang.get('common.uploader.browse');
|
|
61
|
-
this.email_required_trans = salla.lang.get('pages.checkout.email_required');
|
|
62
|
-
this.invalid_email_trans = salla.lang.get('pages.error.invalid_value', {
|
|
63
|
-
attribute: 'email',
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
// Event handler for phone number field changes
|
|
68
|
-
phoneNumberFieldEventHandler(data) {
|
|
69
|
-
if (!data.detail.number) {
|
|
70
|
-
this.disableAction = true;
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
this.userData.phone.number = Number.parseInt(data.detail.number);
|
|
74
|
-
this.userData.phone.country = data.detail.country_code;
|
|
75
|
-
this.disableAction = false;
|
|
76
|
-
}
|
|
77
|
-
// Event handler for generic field changes
|
|
78
|
-
handleFieldChange(key, event, required = false) {
|
|
79
|
-
if (event.target.value) {
|
|
80
|
-
this.userData[key] = event.target.value;
|
|
81
|
-
this.disableAction = false;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
if (required) {
|
|
85
|
-
this.disableAction = true;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// Event handler for email input changes
|
|
90
|
-
handleEmailInput(key, event) {
|
|
91
|
-
const emailErrorDisplaySection = document.getElementById('email-error');
|
|
92
|
-
const email = event.target.value;
|
|
93
|
-
if (!email) {
|
|
94
|
-
this.disableAction = true;
|
|
95
|
-
emailErrorDisplaySection.textContent = this.email_required_trans;
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const emailPattern = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i;
|
|
99
|
-
if (!emailPattern.test(email)) {
|
|
100
|
-
this.disableAction = true;
|
|
101
|
-
emailErrorDisplaySection.textContent = this.invalid_email_trans;
|
|
102
|
-
}
|
|
103
|
-
emailErrorDisplaySection.textContent = '';
|
|
104
|
-
this.userData[key] = email;
|
|
105
|
-
this.disableAction = false;
|
|
106
|
-
}
|
|
107
|
-
// Submit form method
|
|
108
|
-
submitForm(event) {
|
|
109
|
-
event.preventDefault();
|
|
110
|
-
this.disableAction = true;
|
|
111
|
-
const payload = Object.assign({}, this.userData);
|
|
112
|
-
payload.phone = undefined;
|
|
113
|
-
//@ts-ignore
|
|
114
|
-
payload.phone = this.userData.phone.number;
|
|
115
|
-
payload.country_code = this.userData.phone.country;
|
|
116
|
-
salla.api.profile.update(payload).finally(() => { this.disableAction = false; });
|
|
117
|
-
}
|
|
118
|
-
getBirthDateRestriction() {
|
|
119
|
-
const now = new Date();
|
|
120
|
-
const pastYear = now.getFullYear() - this.minAge;
|
|
121
|
-
now.setFullYear(pastYear);
|
|
122
|
-
return now;
|
|
123
|
-
}
|
|
124
|
-
fetchData() {
|
|
125
|
-
return salla.api.profile
|
|
126
|
-
.info()
|
|
127
|
-
.then(resp => { this.userData = resp.data; })
|
|
128
|
-
.finally(() => {
|
|
129
|
-
this.isLoading = false;
|
|
130
|
-
this.isEditable = !Salla.config.get('store.features').includes('sso-login');
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
renderLoadingSection() {
|
|
134
|
-
return (h("div", { class: "s-user-profile-skeleton-wrapper" }, Array.from({ length: 6 }, (_, i) => (h("salla-skeleton", { class: "skeleton-item", width: "100%", height: "50px", key: i })))));
|
|
135
|
-
}
|
|
136
|
-
componentWillLoad() {
|
|
137
|
-
Salla.onReady().then(() => this.fetchData());
|
|
138
|
-
}
|
|
139
|
-
render() {
|
|
140
|
-
if (this.isLoading) {
|
|
141
|
-
return this.renderLoadingSection();
|
|
142
|
-
}
|
|
143
|
-
return (h("form", { onSubmit: event => this.submitForm(event) }, h("div", { class: "s-user-profile-wrapper" }, h("div", { class: "s-user-profile-field" }, h("label", { htmlFor: "first-name", class: "s-user-profile-field-label" }, this.first_name_trans), h("input", { disabled: !this.isEditable, type: "text", name: "first_name", value: this.userData.first_name, id: "first-name", required: true, autocomplete: "first_name", class: "form-input", onChange: event => this.handleFieldChange('first_name', event) })), h("div", { class: "s-user-profile-field" }, h("label", { htmlFor: "last-name", class: "s-user-profile-field-label" }, this.last_name_trans), h("input", { disabled: !this.isEditable, type: "text", name: "last_name", value: this.userData.last_name, id: "last-name", required: true, autocomplete: "last_name", class: "form-input", onChange: event => this.handleFieldChange('last_name', event) })), h("div", { class: "s-user-profile-field" }, h("label", { htmlFor: "birthday", class: "s-user-profile-field-label" }, this.birthday_trans), h("salla-datetime-picker", { disabled: !this.isEditable, dateFormat: "Y-m-d", value: this.userData.birthday, placeholder: this.birthday_placeholder_trans, required: true, maxDate: this.getBirthDateRestriction(), name: "birthday", onPicked: event => this.handleFieldChange('birthday', event) })), h("div", { class: "s-user-profile-field" }, h("label", { htmlFor: "gender", class: "s-user-profile-field-label" }, this.gender_trans), h("select", { disabled: !this.isEditable, class: "form-input", name: "gender", required: true, onChange: event => this.handleFieldChange('gender', event) }, h("option", { value: "" }, this.gender_placeholder_trans), h("option", { value: Genders.Male, selected: this.userData.gender === Genders.Male }, this.male_trans), h("option", { value: Genders.Female, selected: this.userData.gender === Genders.Female }, this.female_trans))), h("div", { class: "s-user-profile-field" }, h("label", { htmlFor: "email", class: "s-user-profile-field-label" }, this.email_trans), h("input", { disabled: !this.isEditable, type: "email", name: "email", value: this.userData.email, id: "email", class: "form-input", required: true, onInput: event => this.handleEmailInput('email', event) }), h("p", { id: "email-error", class: "s-user-profile-field-error" })), h("div", { class: "s-user-profile-field" }, h("label", { htmlFor: "international-mobile", class: "s-user-profile-field-label" }, this.mobile_trans), h("salla-tel-input", { disabled: !this.isEditable, name: "international-mobile", "country-code": this.userData.phone.country, phone: `${this.userData.phone.number}`, onPhoneEntered: data => this.phoneNumberFieldEventHandler(data) }))), h("salla-button", { type: "submit", loading: this.disableAction, disabled: this.disableAction || !this.isEditable, "loader-position": "end", class: "s-user-profile-submit" }, this.save_btn_trans)));
|
|
144
|
-
}
|
|
145
|
-
static get style() { return sallaUserProfileCss; }
|
|
146
|
-
}, [0, "salla-user-profile", {
|
|
147
|
-
"minAge": [2, "min-age"],
|
|
148
|
-
"userData": [32],
|
|
149
|
-
"isEditable": [32],
|
|
150
|
-
"disableAction": [32],
|
|
151
|
-
"isLoading": [32],
|
|
152
|
-
"first_name_trans": [32],
|
|
153
|
-
"last_name_trans": [32],
|
|
154
|
-
"birthday_trans": [32],
|
|
155
|
-
"birthday_placeholder_trans": [32],
|
|
156
|
-
"gender_trans": [32],
|
|
157
|
-
"gender_placeholder_trans": [32],
|
|
158
|
-
"male_trans": [32],
|
|
159
|
-
"female_trans": [32],
|
|
160
|
-
"email_trans": [32],
|
|
161
|
-
"mobile_trans": [32],
|
|
162
|
-
"save_btn_trans": [32],
|
|
163
|
-
"drag_and_drop_trans": [32],
|
|
164
|
-
"browse_trans": [32],
|
|
165
|
-
"email_required_trans": [32],
|
|
166
|
-
"invalid_email_trans": [32]
|
|
167
|
-
}]);
|
|
168
|
-
function defineCustomElement$1() {
|
|
169
|
-
if (typeof customElements === "undefined") {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
const components = ["salla-user-profile", "salla-button", "salla-datetime-picker", "salla-skeleton", "salla-tel-input"];
|
|
173
|
-
components.forEach(tagName => { switch (tagName) {
|
|
174
|
-
case "salla-user-profile":
|
|
175
|
-
if (!customElements.get(tagName)) {
|
|
176
|
-
customElements.define(tagName, SallaUserProfile$1);
|
|
177
|
-
}
|
|
178
|
-
break;
|
|
179
|
-
case "salla-button":
|
|
180
|
-
if (!customElements.get(tagName)) {
|
|
181
|
-
defineCustomElement$5();
|
|
182
|
-
}
|
|
183
|
-
break;
|
|
184
|
-
case "salla-datetime-picker":
|
|
185
|
-
if (!customElements.get(tagName)) {
|
|
186
|
-
defineCustomElement$4();
|
|
187
|
-
}
|
|
188
|
-
break;
|
|
189
|
-
case "salla-skeleton":
|
|
190
|
-
if (!customElements.get(tagName)) {
|
|
191
|
-
defineCustomElement$3();
|
|
192
|
-
}
|
|
193
|
-
break;
|
|
194
|
-
case "salla-tel-input":
|
|
195
|
-
if (!customElements.get(tagName)) {
|
|
196
|
-
defineCustomElement$2();
|
|
197
|
-
}
|
|
198
|
-
break;
|
|
199
|
-
} });
|
|
200
|
-
}
|
|
201
|
-
defineCustomElement$1();
|
|
202
|
-
|
|
203
|
-
const SallaUserProfile = SallaUserProfile$1;
|
|
204
|
-
const defineCustomElement = defineCustomElement$1;
|
|
205
|
-
|
|
206
|
-
export { SallaUserProfile, defineCustomElement };
|
|
4
|
+
import{transformTag as e,proxyCustomElement as s,HTMLElement as a,h as l}from"@stencil/core/internal/client";import{G as t}from"./interfaces.js";import{d as i}from"./salla-button2.js";import{d as r}from"./salla-datetime-picker2.js";import{d as o}from"./salla-skeleton2.js";import{d as n}from"./salla-tel-input2.js";const h=s(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.minAge=10,this.isEditable=!0,this.disableAction=!1,this.isLoading=!0,this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"}),salla.lang.onLoaded((()=>{this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"})}))}phoneNumberFieldEventHandler(e){e.detail.number?(this.userData.phone.number=Number.parseInt(e.detail.number),this.userData.phone.country=e.detail.country_code,this.disableAction=!1):this.disableAction=!0}handleFieldChange(e,s,a=!1){s.target.value?(this.userData[e]=s.target.value,this.disableAction=!1):a&&(this.disableAction=!0)}handleEmailInput(e,s){const a=document.getElementById("email-error"),l=s.target.value;if(!l)return this.disableAction=!0,void(a.textContent=this.email_required_trans);/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(l)||(this.disableAction=!0,a.textContent=this.invalid_email_trans),a.textContent="",this.userData[e]=l,this.disableAction=!1}submitForm(e){e.preventDefault(),this.disableAction=!0;const s=Object.assign({},this.userData);s.phone=void 0,s.phone=this.userData.phone.number,s.country_code=this.userData.phone.country,salla.api.profile.update(s).finally((()=>{this.disableAction=!1}))}getBirthDateRestriction(){const e=new Date,s=e.getFullYear()-this.minAge;return e.setFullYear(s),e}fetchData(){return salla.api.profile.info().then((e=>{this.userData=e.data})).finally((()=>{this.isLoading=!1,this.isEditable=!Salla.config.get("store.features").includes("sso-login")}))}renderLoadingSection(){return l("div",{class:"s-user-profile-skeleton-wrapper"},Array.from({length:6},((e,s)=>l("salla-skeleton",{class:"skeleton-item",width:"100%",height:"50px",key:s}))))}componentWillLoad(){Salla.onReady().then((()=>this.fetchData()))}render(){return this.isLoading?this.renderLoadingSection():l("form",{onSubmit:e=>this.submitForm(e)},l("div",{class:"s-user-profile-wrapper"},l("div",{class:"s-user-profile-field"},l("label",{htmlFor:"first-name",class:"s-user-profile-field-label"},this.first_name_trans),l("input",{disabled:!this.isEditable,type:"text",name:"first_name",value:this.userData.first_name,id:"first-name",required:!0,autocomplete:"first_name",class:"form-input",onChange:e=>this.handleFieldChange("first_name",e)})),l("div",{class:"s-user-profile-field"},l("label",{htmlFor:"last-name",class:"s-user-profile-field-label"},this.last_name_trans),l("input",{disabled:!this.isEditable,type:"text",name:"last_name",value:this.userData.last_name,id:"last-name",required:!0,autocomplete:"last_name",class:"form-input",onChange:e=>this.handleFieldChange("last_name",e)})),l("div",{class:"s-user-profile-field"},l("label",{htmlFor:"birthday",class:"s-user-profile-field-label"},this.birthday_trans),l("salla-datetime-picker",{disabled:!this.isEditable,dateFormat:"Y-m-d",value:this.userData.birthday,placeholder:this.birthday_placeholder_trans,required:!0,maxDate:this.getBirthDateRestriction(),name:"birthday",onPicked:e=>this.handleFieldChange("birthday",e)})),l("div",{class:"s-user-profile-field"},l("label",{htmlFor:"gender",class:"s-user-profile-field-label"},this.gender_trans),l("select",{disabled:!this.isEditable,class:"form-input",name:"gender",required:!0,onChange:e=>this.handleFieldChange("gender",e)},l("option",{value:""},this.gender_placeholder_trans),l("option",{value:t.Male,selected:this.userData.gender===t.Male},this.male_trans),l("option",{value:t.Female,selected:this.userData.gender===t.Female},this.female_trans))),l("div",{class:"s-user-profile-field"},l("label",{htmlFor:"email",class:"s-user-profile-field-label"},this.email_trans),l("input",{disabled:!this.isEditable,type:"email",name:"email",value:this.userData.email,id:"email",class:"form-input",required:!0,onInput:e=>this.handleEmailInput("email",e)}),l("p",{id:"email-error",class:"s-user-profile-field-error"})),l("div",{class:"s-user-profile-field"},l("label",{htmlFor:"international-mobile",class:"s-user-profile-field-label"},this.mobile_trans),l("salla-tel-input",{disabled:!this.isEditable,name:"international-mobile","country-code":this.userData.phone.country,phone:""+this.userData.phone.number,onPhoneEntered:e=>this.phoneNumberFieldEventHandler(e)}))),l("salla-button",{type:"submit",loading:this.disableAction,disabled:this.disableAction||!this.isEditable,"loader-position":"end",class:"s-user-profile-submit"},this.save_btn_trans))}static get style(){return":host{display:block}"}},[0,"salla-user-profile",{minAge:[2,"min-age"],userData:[32],isEditable:[32],disableAction:[32],isLoading:[32],first_name_trans:[32],last_name_trans:[32],birthday_trans:[32],birthday_placeholder_trans:[32],gender_trans:[32],gender_placeholder_trans:[32],male_trans:[32],female_trans:[32],email_trans:[32],mobile_trans:[32],save_btn_trans:[32],drag_and_drop_trans:[32],browse_trans:[32],email_required_trans:[32],invalid_email_trans:[32]}]);function m(){"undefined"!=typeof customElements&&["salla-user-profile","salla-button","salla-datetime-picker","salla-skeleton","salla-tel-input"].forEach((s=>{switch(s){case"salla-user-profile":customElements.get(e(s))||customElements.define(e(s),h);break;case"salla-button":customElements.get(e(s))||i();break;case"salla-datetime-picker":customElements.get(e(s))||r();break;case"salla-skeleton":customElements.get(e(s))||o();break;case"salla-tel-input":customElements.get(e(s))||n()}}))}m();const d=h,p=m;export{d as SallaUserProfile,p as defineCustomElement}
|