@salla.sa/twilight-components 2.12.5 → 2.12.7
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-4b66abc1.js → app-globals-4f8bbf37.js} +2 -2
- package/dist/cjs/app-globals-4f8bbf37.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-add-product-button_40.cjs.entry.js +22 -28
- package/dist/cjs/salla-add-product-button_40.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +2 -1
- package/dist/cjs/salla-product-options.cjs.entry.js.map +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +1 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js.map +1 -1
- package/dist/collection/components/salla-product-options/salla-product-options.js +2 -1
- package/dist/collection/components/salla-product-options/salla-product-options.js.map +1 -1
- package/dist/collection/components/salla-progress-bar/salla-progress-bar.js +2 -1
- package/dist/collection/components/salla-progress-bar/salla-progress-bar.js.map +1 -1
- package/dist/collection/components/salla-quick-order/salla-quick-order.css +3 -0
- package/dist/collection/components/salla-slider/salla-slider.js +1 -1
- package/dist/collection/components/salla-slider/salla-slider.js.map +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +16 -23
- package/dist/collection/components/salla-social-share/salla-social-share.js.map +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-add-product-button2.js +1 -1
- package/dist/components/salla-add-product-button2.js.map +1 -1
- package/dist/components/salla-product-options.js +2 -1
- package/dist/components/salla-product-options.js.map +1 -1
- package/dist/components/salla-progress-bar2.js +2 -1
- package/dist/components/salla-progress-bar2.js.map +1 -1
- package/dist/components/salla-quick-order.js +1 -1
- package/dist/components/salla-quick-order.js.map +1 -1
- package/dist/components/salla-slider2.js +1 -1
- package/dist/components/salla-slider2.js.map +1 -1
- package/dist/components/salla-social-share.js +16 -23
- package/dist/components/salla-social-share.js.map +1 -1
- package/dist/components/salla-user-menu.js +1 -1
- package/dist/components/salla-user-menu.js.map +1 -1
- package/dist/esm/{app-globals-4d6e9944.js → app-globals-9b658056.js} +2 -2
- package/dist/esm/app-globals-9b658056.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-add-product-button_40.entry.js +22 -28
- package/dist/esm/salla-add-product-button_40.entry.js.map +1 -1
- package/dist/esm/salla-product-options.entry.js +2 -1
- package/dist/esm/salla-product-options.entry.js.map +1 -1
- package/dist/esm/twilight.js +1 -1
- package/dist/esm-es5/{app-globals-4d6e9944.js → app-globals-9b658056.js} +2 -2
- package/dist/esm-es5/app-globals-9b658056.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-add-product-button_40.entry.js +2 -2
- package/dist/esm-es5/salla-add-product-button_40.entry.js.map +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js.map +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-6727a00e.system.js → p-03cfdef7.system.js} +2 -2
- package/dist/twilight/{p-1ffb1df3.js → p-17d95443.js} +2 -2
- package/dist/twilight/p-17d95443.js.map +1 -0
- package/dist/twilight/{p-5f434037.system.js → p-21935458.system.js} +2 -2
- package/dist/twilight/p-21935458.system.js.map +1 -0
- package/dist/twilight/{p-fd24efa8.system.entry.js → p-9a09ec73.system.entry.js} +3 -3
- package/dist/twilight/p-9a09ec73.system.entry.js.map +1 -0
- package/dist/twilight/{p-39da1865.system.entry.js → p-9c38bff9.system.entry.js} +2 -2
- package/dist/twilight/p-9c38bff9.system.entry.js.map +1 -0
- package/dist/twilight/{p-924df7a7.entry.js → p-d511f5f7.entry.js} +3 -3
- package/dist/twilight/p-d511f5f7.entry.js.map +1 -0
- package/dist/twilight/p-d5a1906c.entry.js +5 -0
- package/dist/twilight/p-d5a1906c.entry.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-social-share/salla-social-share.d.ts +0 -1
- package/package.json +3 -3
- package/dist/cjs/app-globals-4b66abc1.js.map +0 -1
- package/dist/esm/app-globals-4d6e9944.js.map +0 -1
- package/dist/esm-es5/app-globals-4d6e9944.js.map +0 -1
- package/dist/twilight/p-1ffb1df3.js.map +0 -1
- package/dist/twilight/p-39da1865.system.entry.js.map +0 -1
- package/dist/twilight/p-5f434037.system.js.map +0 -1
- package/dist/twilight/p-924df7a7.entry.js.map +0 -1
- package/dist/twilight/p-d9dd6370.entry.js +0 -5
- package/dist/twilight/p-d9dd6370.entry.js.map +0 -1
- package/dist/twilight/p-fd24efa8.system.entry.js.map +0 -1
- /package/dist/twilight/{p-6727a00e.system.js.map → p-03cfdef7.system.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"salla-progress-bar.js","sourceRoot":"","sources":["../../../src/components/salla-progress-bar/salla-progress-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOnD,MAAM,OAAO,gBAAgB;EAE3B;;;;
|
|
1
|
+
{"version":3,"file":"salla-progress-bar.js","sourceRoot":"","sources":["../../../src/components/salla-progress-bar/salla-progress-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOnD,MAAM,OAAO,gBAAgB;EAE3B;;;;kBAoD0C,MAAM;;;;;;IAnD9C,IAAI;MACF,IAAI,IAAI,CAAC,QAAQ,EAAE;QACjB,IAAI,YAAY,GAAG,OAAO,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,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,CACxD;MACN,WAAK,KAAK,EAAC,wBAAwB,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;QAClE,WAAK,KAAK,EAAE,EAAE,yBAAyB,EAAE,IAAI,EAAE,kCAAkC,EAAE,IAAI,CAAC,QAAQ,EAAE,EAChG,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,CAAC,KAAK,EAAE,GAC1E,CACF;KACP,CAAC,CAAC,CAAC,EAAE,CAAC;EACT,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\nimport { Donation } from \"../salla-product-options/interfaces\";\n\n@Component({\n tag: 'salla-progress-bar',\n styleUrl: 'salla-progress-bar.scss',\n})\nexport class SallaProgressBar {\n\n constructor() {\n try {\n if (this.donation) {\n let donationJson = typeof this.donation == 'string' ? JSON.parse(this.donation) : this.donation;\n if (donationJson.can_donate && donationJson.target_amount) {\n donationJson.target_end_date = donationJson.target_end_date == '0000-00-00' ? null : donationJson.target_end_date;\n this.value = donationJson.collected_amount;\n this.target = donationJson.target_amount;\n this.header = salla.lang.get('pages.products.target');\n this.message = donationJson.target_end_date ? salla.lang.get('pages.products.donation_target_date') + ' ' + donationJson.target_end_date : '';\n } else {\n //in case the product is not enabled target campaign\n this.message = donationJson.target_amount\n ? donationJson.target_message\n : '';\n }\n }\n } catch (e) {\n salla.log('Wrong donation json');\n }\n\n salla.lang.onLoaded(() => {\n this.header = this.header?.replace('pages.products.target', salla.lang.get('pages.products.target'))\n this.message = this.message?.replace('pages.products.donation_target_date', salla.lang.get('pages.products.donation_target_date'))\n });\n\n salla.onReady(() => {\n this.color = this.color || salla.config.get('theme.color.primary', \"#ffd5c4\")\n if (!this.unit) {\n this.unit = salla.config.currency().symbol;\n }\n })\n }\n\n /**\n * You can just pass the donation as json string ex: `{\"target_message\":null,\"target_date\":\"2023-04-18\",\"target_end_date\":\"2023-04-18\",\"target_amount\":400,\"collected_amount\":380,\"can_donate\":true}`\n */\n @Prop() donation: string | Donation;\n /**\n * The goal of the progress bar\n */\n @Prop({ mutable: true }) target: number;\n\n /**\n * The progress so far as of the goal.\n */\n @Prop({ mutable: true }) value: number;\n\n\n /**\n * Set height for the wrapper.\n */\n @Prop({ mutable: true }) height: string = \"10px\";\n\n /**\n * Big Title, before the progress bar.\n */\n @Prop({ mutable: true }) header: string;\n\n /**\n * Stripped effect for tje progress bar.\n */\n @Prop({ mutable: true }) stripped: boolean;\n\n /**\n * Subtitle under the progress bar or instead of it if the target not being set.\n */\n @Prop({ mutable: true }) message: string;\n\n /**\n * The unite to be added after the numbers, defaults to: `salla.config.currency().symbol`\n */\n @Prop({ mutable: true }) unit: string;\n\n /**\n * Progress bar color, defaults to: `salla.config.get('theme.color.primary', \"#ffd5c4\")`\n */\n @Prop({ mutable: true }) color: string;\n\n private getPercentage(): number {\n return (this.value / this.target) * 100;\n }\n\n render() {\n if (!this.target && !this.message) {\n return '';\n }\n\n return (\n <div class=\"s-progress-bar-container\">\n {this.header ? <div class=\"s-progress-bar-header\">{this.header}</div> : ''}\n {this.getProgressBar()}\n {this.message ? <span class=\"s-progress-bar-message\">{this.message}</span> : ''}\n </div>\n );\n }\n\n private getProgressBar() {\n return this.target ? [\n <div class=\"s-progress-bar-target-section\">\n <span>{salla.helpers.number(this.value)} {this.unit}</span>\n <span>{salla.helpers.number(this.target)} {this.unit}</span>\n </div>,\n <div class=\"s-progress-bar-wrapper\" style={{ 'height': this.height }}>\n <div class={{ \"s-progress-bar-progress\": true, 's-progress-bar-progress-stripped': this.stripped }}\n style={{ 'width': `${this.getPercentage()}%`, 'background-color': this.color }}>\n </div>\n </div>\n ] : '';\n }\n\n}\n"]}
|
|
@@ -234,7 +234,7 @@ export class SallaSlider {
|
|
|
234
234
|
salla.logger.warn('failed load swiper bundle', error);
|
|
235
235
|
reject(true);
|
|
236
236
|
};
|
|
237
|
-
this.swiperScript.src = 'https://cdn.
|
|
237
|
+
this.swiperScript.src = 'https://cdn.salla.network/js/swiper@8.js';
|
|
238
238
|
this.swiperScript.setAttribute('id', 'swiper-script');
|
|
239
239
|
document.body.appendChild(this.swiperScript);
|
|
240
240
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"salla-slider.js","sourceRoot":"","sources":["../../../src/components/salla-slider/salla-slider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAgB,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGtG,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,aAAa,MAAM,0CAA0C,CAAC;AAErE;;;GAGG;AAKH,MAAM,OAAO,WAAW;EAEtB;IA0WQ,iBAAY,GAAY,KAAK,CAAC;IAE9B,uBAAkB,GAAG;MAC3B,QAAQ,EAAE;QACR,KAAK,EAAE,GAAG;QACV,aAAa,EAAE,MAAM;QACrB,YAAY,EAAE,CAAC;OAChB;MACD,SAAS,EAAE;QACT,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,IAAI;OACf;MACD,UAAU,EAAE;QACV,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,UAAU;QACrB,YAAY,EAAE,KAAK;QACnB,mBAAmB,EAAE,IAAI;QACzB,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,EAAE;OACf;MACD,YAAY,EAAE;QACZ,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,CAAC;QAChB,WAAW,EAAE,EAAE,IAAI,EAAE,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, State, Prop, h, Event, Host, EventEmitter, Method, Element } from '@stencil/core';\nimport { Swiper as SwiperType } from 'swiper/types';\n\nimport ArrowRightIcon from \"../../assets/svg/keyboard_arrow_right.svg\";\nimport ArrowLeftIcon from \"../../assets/svg/keyboard_arrow_left.svg\";\n\n/**\n * @slot items - Slider items.\n * @slot thumbs - Thumbs slider items.\n */\n@Component({\n tag: 'salla-slider',\n styleUrl: 'salla-slider.scss',\n})\nexport class SallaSlider {\n @Element() host: HTMLElement;\n constructor() {\n this.direction = this.direction || document.documentElement.dir\n }\n\n /**\n * Show/hide slider block title\n */\n @Prop({ reflect: true }) blockTitle: string = '';\n\n /**\n * Enable call a specific slide by index from thumbnails option in `salla-slider-options` component, works only if `data-img-id` and `data-slid-index` attributes are set on each slide\n */\n @Prop({ reflect: true }) listenToThumbnailsOption: boolean = false;\n\n /**\n * Show/hide slider block sub title\n */\n @Prop({ reflect: true }) blockSubtitle: string = '';\n\n /**\n * Show/hide display all button beside arrows\n */\n @Prop({ reflect: true }) displayAllUrl: string = '';\n\n /**\n * Show/hide display all button beside arrows\n */\n @Prop({ reflect: true }) arrowsCentered: boolean = false;\n\n /**\n * Vertical or Horizontal thumbs slider\n */\n @Prop({ reflect: true }) verticalThumbs: boolean = false;\n\n /**\n * Disable thumbs slider and show it as a grid\n */\n @Prop({ reflect: true }) gridThumbs: boolean = false;\n\n /**\n * Vertical or Horizontal main slider\n */\n @Prop({ reflect: true }) vertical: boolean = false;\n\n /**\n * Auto Height slider\n */\n @Prop({ reflect: true }) autoHeight: boolean = false;\n\n /**\n * Show/hide arrows\n */\n @Prop({ reflect: true }) showControls: boolean = true;\n\n /**\n * Show/hide arrows\n */\n @Prop({ reflect: true }) controlsOuter: boolean = false;\n\n /**\n * Show/hide thumbs slider arrows\n */\n @Prop() showThumbsControls: boolean = true;\n\n /**\n * Enable autoplay - working with `type=\"carousel\" only`\n */\n @Prop() autoPlay: boolean = false;\n\n /**\n * slidesPerView\n */\n @Prop() slidesPerView: string = \"auto\";\n\n /**\n * Enable pagination\n */\n @Prop() pagination: boolean = false;\n\n /**\n * Enable center mode - working with `type=\"carousel\" only`\n */\n @Prop() centered: boolean = false;\n\n /**\n * Run slider in loop, Don't use it for slides with custom components inside it, because it may cause re-render issue\n */\n @Prop() loop: boolean = false;\n\n /**\n * Slider direction. Default: document.documentElement.dir\n */\n @Prop({ mutable: true, reflect: true }) direction: string;\n\n /**\n * Set the type of the slider\n * Default: ''\n */\n @Prop() type: 'carousel' | 'fullscreen' | 'thumbs' | 'default' | 'hero' | 'testimonials' | 'blog' | 'fullwidth' | '' = '';\n /**\n * Slider Configs refer to https://swiperjs.com/swiper-api#parameters and pass the entire config object\n * @example\n * let slider = document.querySelector('salla-slider');\n * slider.sliderConfig = {\n * slidesPerView: 1,\n * spaceBetween : 30,\n * lazy: true,\n * }\n *\n */\n @Prop({ reflect: true }) sliderConfig: any;\n /**\n * Thumbs Slider Configs refer to https://swiperjs.com/swiper-api#parameters and pass the entire config object\n * @example\n * let slider = document.querySelector('salla-slider');\n * slider.thumbsConfig = {\n * slidesPerView: 1,\n * spaceBetween : 30,\n * lazy: true,\n * }\n *\n */\n @Prop({ reflect: true }) thumbsConfig: any = {};\n\n // Events\n /**\n * Event will fired right after initialization.\n */\n @Event() afterInit: EventEmitter<any>;\n /**\n * Event will be fired when currently active slide is changed\n */\n @Event() slideChange: EventEmitter<any>;\n\n /**\n * Event will be fired when Swiper reach its beginning (initial position)\n */\n @Event() reachBeginning: EventEmitter<any>;\n\n /**\n * Event will be fired when Swiper reach last slide\n */\n @Event() reachEnd: EventEmitter<any>;\n\n /**\n * Event will be fired after animation to other slide (next or previous).\n */\n @Event() slideChangeTransitionEnd: EventEmitter<any>;\n\n /**\n * Event will be fired in the beginning of animation to other slide (next or previous).\n */\n @Event() slideChangeTransitionStart: EventEmitter<any>;\n\n /**\n * Same as \"slideChangeTransitionEnd\" but for \"forward\" direction only\n */\n @Event() slideNextTransitionEnd: EventEmitter<any>;\n\n /**\n * Same as \"slideChangeTransitionStart\" but for \"forward\" direction only\n */\n @Event() slideNextTransitionStart: EventEmitter<any>;\n\n /**\n * Same as \"slideChangeTransitionEnd\" but for \"backward\" direction only\n */\n @Event() slidePrevTransitionEnd: EventEmitter<any>;\n\n /**\n * Same as \"slideChangeTransitionStart\" but for \"backward\" direction only\n */\n @Event() slidePrevTransitionStart: EventEmitter<any>;\n\n /**\n * Event will be fired when user touch and move finger over Swiper and move it.\n * Receives touchmove event as an arguments.\n */\n @Event() sliderMove: EventEmitter<any>;\n\n /**\n * Event will be fired when user release Swiper. Receives touchend event as an arguments.\n */\n @Event() touchSliderEnd: EventEmitter<any>;\n\n /**\n * Event will be fired when user touch and move finger over Swiper.\n * Receives touchmove event as an arguments.\n */\n @Event() touchSliderMove: EventEmitter<any>;\n\n /**\n * Event will be fired when user touch Swiper. Receives touchstart event as an arguments.\n */\n @Event() touchSliderStart: EventEmitter<any>;\n\n /**\n * Event will be fired after transition.\n */\n @Event() sliderTransitionEnd: EventEmitter<any>;\n\n /**\n * Event will be fired in the beginning of transition.\n */\n @Event() sliderTransitionStart: EventEmitter<any>;\n\n\n // Methods\n\n /**\n * Run transition to the slide with index number equal to 'index' parameter for the duration equal to 'speed' parameter.\n *\n * @param {number} index - Index number of slide.\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideTo(index: number, speed?: number, runCallbacks?: boolean) {\n\n return this.slider.slideTo(index, speed, runCallbacks);\n }\n\n /**\n * Run transition to the next slide.\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideNext(speed?: number, runCallbacks?: boolean) {\n this.slider?.slideNext(speed, runCallbacks);\n }\n\n /**\n * Run transition to the previous slide.\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slidePrev(speed?: number, runCallbacks?: boolean) {\n this.slider?.slidePrev(speed, runCallbacks);\n }\n\n /**\n * Does the same as .slideTo but for the case when used with enabled loop. So this method will slide to slides with realIndex matching to passed index\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideToLoop(index: number, speed?: number, runCallbacks?: boolean) {\n this.slider.slideToLoop(index, speed, runCallbacks);\n }\n\n /**\n * Does the same as .slideNext but for the case when used with enabled loop. So this method will slide to next slide with realIndex matching to next index\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideNextLoop(speed?: number, runCallbacks?: boolean) {\n this.slider.slideNextLoop(speed, runCallbacks);\n }\n\n /**\n * Does the same as .slidePrev but for the case when used with enabled loop. So this method will slide to previous slide with realIndex matching to previous index\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slidePrevLoop(speed?: number, runCallbacks?: boolean) {\n this.slider.slidePrevLoop(speed, runCallbacks);\n }\n\n /**\n * Reset slider position to currently active slide for the duration equal to 'speed' parameter.\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideReset(speed?: number, runCallbacks?: boolean) {\n this.slider.slideReset(speed, runCallbacks);\n }\n\n /**\n * Reset slider position to closest slide/snap point for the duration equal to 'speed' parameter.\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideToClosest(speed?: number, runCallbacks?: boolean) {\n this.slider.slideToClosest(speed, runCallbacks);\n }\n\n /**\n * You should call it after you add/remove slides manually, or after you hide/show it, or do any custom DOM modifications with Swiper This method also includes subcall of the following methods which you can use separately:\n * **/\n @Method()\n async update() {\n this.slider.update();\n }\n\n /**\n * Force slider to update its height (when autoHeight enabled) for the duration equal to 'speed' parameter\n * @param {number} speed - Transition duration (in ms).\n * **/\n @Method()\n async updateAutoHeight(speed?: number) {\n this.slider.updateAutoHeight(speed);\n }\n\n /**\n * recalculate number of slides and their offsets. Useful after you add/remove slides with JavaScript\n * **/\n @Method()\n async updateSlides() {\n this.slider.updateSlides();\n }\n\n /**\n * recalculate slider progress\n * **/\n @Method()\n async updateProgress() {\n this.slider.updateProgress();\n }\n\n /**\n * update active/prev/next classes on slides and bullets\n * **/\n @Method()\n async updateSlidesClasses() {\n this.slider.updateSlidesClasses();\n }\n\n\n /**\n * Get slider slides\n * **/\n @Method()\n async getSlides() {\n return await this.slider?.slides;\n }\n\n\n // States\n @State() currentIndex: number | undefined = undefined;\n @State() isEnd: boolean = false;\n @State() isBeginning: boolean = true;\n @State() swiperScript: any;\n @State() displayAllTitle: string;\n\n private sliderContainer?: HTMLDivElement;\n private sliderWrapper?: HTMLDivElement;\n private thumbsSliderContainer?: HTMLDivElement;\n private thumbsSliderWrapper?: HTMLDivElement;\n private slider: any;\n private thumbsSlider: any;\n private hasThumbSlot: boolean = false;\n\n private pre_defined_config = {\n carousel: {\n speed: 300,\n slidesPerView: 'auto',\n spaceBetween: 0,\n },\n fullwidth: {\n speed: 750,\n parallax: true,\n },\n fullscreen: {\n speed: 1000,\n parallax: true,\n direction: \"vertical\",\n followFinger: false,\n touchReleaseOnEdges: true,\n lazy: true,\n mousewheel: {}\n },\n testimonials: {\n draggable: true,\n slidesPerView: 1,\n breakpoints: { 1024: { slidesPerView: 2 } }\n },\n blog: {\n parallax: true,\n speed: 800,\n loop: true,\n slidesPerView: 1,\n centeredSlides: true,\n spaceBetween: 30,\n breakpoints: {\n 320: { spaceBetween: 10 },\n 768: { spaceBetween: 15 },\n 980: { paceBetween: 30 },\n }\n },\n thumbs: {\n slidesPerView: 1,\n spaceBetween: 30\n }\n }\n\n componentWillLoad() {\n salla.lang.onLoaded(() => {\n this.displayAllTitle = salla.lang.get('blocks.home.display_all');\n })\n this.hasThumbSlot = !!this.host.querySelector('[slot=\"thumbs\"]');\n if (this.listenToThumbnailsOption) {\n salla.event.on('product-options::change', data => {\n if (data.option.type == 'thumbnail') {\n const slideIndex = this.sliderWrapper.querySelector(`[data-img-id=\"${data.detail.option_value}\"]`)?.getAttribute('data-slid-index');\n slideIndex ? this.slideTo(parseInt(slideIndex), 300, false) : '';\n }\n });\n }\n return new Promise((resolve, reject) => {\n // @ts-ignore\n if (typeof Swiper !== 'undefined') {\n return resolve(true);\n }\n\n if (document.getElementById('swiper-script')) {\n let interval = setInterval(() => {\n // @ts-ignore\n if (typeof Swiper !== 'undefined') {\n clearInterval(interval);\n resolve(true);\n }\n }, 5);\n } else {\n // ? There is an issue with stencil bundling it breaks the swiper import, so we need to import it manually by swiperjs rerendered file\n // ! IT'S NOT A GOOD SOLUTION, BUT IT WORKS, WE NEED TO FIND A BETTER SOLUTION\n this.swiperScript = document.createElement('script');\n this.swiperScript.onload = () => {\n resolve(true)\n salla.event.emit('swiper::loaded');\n }\n this.swiperScript.onerror = (error) => {\n salla.logger.warn('failed load swiper bundle', error);\n reject(true)\n }\n this.swiperScript.src = 'https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js';\n this.swiperScript.setAttribute('id', 'swiper-script');\n document.body.appendChild(this.swiperScript);\n }\n });\n }\n\n getSwiperConfig() {\n let pre_defined_config = {\n loop: this.loop,\n autoplay: this.type == 'fullwidth' && !!this.autoPlay ? { delay: 5000 } : this.autoPlay,\n centeredSlides: this.centered,\n slidesPerView: this.slidesPerView,\n autoHeight: this.autoHeight,\n lazy: true,\n on: {\n // todo:: find better way for this workaround to show lazyLoad for duplicated slides, because it clones the slide after it's already rendered,\n // then it re appended it as is,in this case the image is loaded but class not added.\n afterInit: (slider: SwiperType) => {\n this.afterInit.emit(slider);\n document.lazyLoadInstance?.update();\n this.loop && slider.slides.map(slide => {\n if (!slide.classList.contains('swiper-slide-duplicate')) {\n return;\n }\n slide.querySelectorAll('img.lazy:not(.loaded)').forEach(img => img.classList.add('loaded'));\n })\n },\n },\n pagination: this.pagination ? {\n el: this.host.id ? `#${this.host.id} .swiper-pagination` : '',\n clickable: true,\n } : false,\n navigation: this.showControls ? {\n nextEl: this.host.id ? `#${this.host.id} .s-slider-next` : '',\n prevEl: this.host.id ? `#${this.host.id} .s-slider-prev` : ''\n } : false,\n breakpoints: {\n 768: {\n direction: this.vertical ? \"vertical\" : \"horizontal\",\n },\n },\n };\n let pre_defined_thumbs_config = {\n freeMode: false,\n watchSlidesProgress: true,\n slidesPerView: 4,\n spaceBetween: 10,\n watchOverflow: true,\n watchSlidesVisibility: true,\n breakpoints: {\n 768: {\n direction: this.verticalThumbs ? \"vertical\" : \"horizontal\",\n spaceBetween: 16,\n },\n },\n navigation: this.showThumbsControls ? {\n nextEl: this.host.id ? `#${this.host.id} .s-slider-thumbs-next` : '',\n prevEl: this.host.id ? `#${this.host.id} .s-slider-thumbs-prev` : ''\n } : false,\n }\n this.pre_defined_config.fullscreen.mousewheel = {\n releaseOnEdges: this.host.querySelectorAll('.swiper-slide').length > 1 ? false : true\n },\n pre_defined_config = {\n ...pre_defined_config,\n ...(this.pre_defined_config[this.type] || {})\n };\n\n if (this.type == 'thumbs' && this.thumbsSliderWrapper) {\n for (const slide of this.thumbsSliderWrapper.children as any) {\n //todo:: use `s-slider-slide`\n slide.classList.add('swiper-slide')\n }\n\n if (this.hasThumbSlot && this.thumbsConfig) {\n try {\n pre_defined_thumbs_config = {\n ...pre_defined_thumbs_config,\n ...JSON.parse(this.thumbsConfig)\n }\n } catch (error) {\n salla.logger.warn('failed to parse thumbs slider config', error);\n }\n }\n // @ts-ignore\n this.thumbsSlider = new Swiper(this.thumbsSliderContainer, pre_defined_thumbs_config);\n \n // @ts-ignore\n pre_defined_config.thumbs = {\n swiper: this.thumbsSlider,\n };\n }\n\n pre_defined_config = {\n ...pre_defined_config,\n };\n if (this.sliderConfig) {\n try {\n pre_defined_config = {\n ...pre_defined_config,\n ...JSON.parse(this.sliderConfig)\n };\n } catch (error) {\n salla.logger.warn('failed to parse slider config', error);\n }\n }\n return pre_defined_config\n }\n\n initSlider() {\n for (const slide of this.sliderWrapper.children as any) {\n slide.classList.add('swiper-slide')\n }\n\n // @ts-ignore\n this.slider = new Swiper(this.sliderContainer, this.getSwiperConfig())\n\n // Expose slider events\n this.slider.on('slideChange', (slider: SwiperType) => {\n //todo:: it doesn't change when loop is active, always will be false\n this.isBeginning = slider.isBeginning;\n this.isEnd = slider.isEnd;\n this.slideChange.emit(slider);\n });\n this.slider.on('reachBeginning', (slider: SwiperType) => this.reachBeginning.emit(slider));\n this.slider.on('reachEnd', (slider: SwiperType) => this.reachEnd.emit(slider));\n this.slider.on('slideChangeTransitionEnd', (slider: SwiperType) => {\n if (this.type == \"fullscreen\") {\n const activeIndex = slider.activeIndex;\n (slider.params.mousewheel as any).releaseOnEdges = activeIndex === 0 || (activeIndex === slider.slides.length - 1);\n }\n this.slideChangeTransitionEnd.emit(slider)\n });\n this.slider.on('slideChangeTransitionStart', (slider: SwiperType) => this.slideChangeTransitionStart.emit(slider));\n this.slider.on('slideNextTransitionEnd', (slider: SwiperType) => this.slideNextTransitionEnd.emit(slider));\n this.slider.on('slideNextTransitionStart', (slider: SwiperType) => this.slideNextTransitionStart.emit(slider));\n this.slider.on('slidePrevTransitionEnd', (slider: SwiperType) => this.slidePrevTransitionEnd.emit(slider));\n this.slider.on('slidePrevTransitionStart', (slider: SwiperType) => this.slidePrevTransitionStart.emit(slider));\n this.slider.on('sliderMove', (slider: SwiperType) => this.sliderMove.emit(slider));\n this.slider.on('touchEnd', (slider: SwiperType) => this.touchSliderEnd.emit(slider));\n this.slider.on('touchMove', (slider: SwiperType) => this.touchSliderMove.emit(slider));\n this.slider.on('touchStart', (slider: SwiperType) => this.touchSliderStart.emit(slider));\n this.slider.on('transitionEnd', (slider: SwiperType) => this.sliderTransitionEnd.emit(slider));\n this.slider.on('transitionStart', (slider: SwiperType) => this.sliderTransitionStart.emit(slider));\n }\n\n render() {\n let classes = this.type ? this.type + '-slider ' : '';\n classes += this.controlsOuter ? ' s-slider-controls-outer ' : '';\n classes += this.blockTitle == '' ? ' s-slider-has-notitle s-slider-v-centered ' : '';\n classes += this.verticalThumbs ? ' s-slider-vertical ' : ' s-slider-horizontal ';\n classes += this.arrowsCentered ? ' s-slider-v-centered ' : '';\n classes += this.gridThumbs ? ' s-slider-with-grid-thumbs ' : '';\n return (\n <Host class={'s-slider-wrapper ' + classes}>\n\n {/* Slider block Title */}\n {this.blockTitle || this.showControls ?\n <div class=\"s-slider-block__title\">\n {this.blockTitle ?\n <div class=\"s-slider-block__title-right\">\n <h2>{this.blockTitle}</h2>\n {this.blockSubtitle ? <p innerHTML={this.blockSubtitle} /> : ''}\n </div>\n : ''}\n\n <div class=\"s-slider-block__title-left\">\n {this.displayAllUrl ?\n <a href={this.displayAllUrl} class=\"s-slider-block__display-all\">{this.displayAllTitle}</a>\n : ''}\n {this.showControls ?\n <div class=\"s-slider-block__title-nav\" dir=\"rtl\">\n <button aria-label=\"Previous Slide\" class=\"s-slider-prev s-slider-nav-arrow\">\n <span class=\"s-slider-button-icon\" innerHTML={this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon} />\n </button>\n <button aria-label=\"Next Slide\" class=\"s-slider-next s-slider-nav-arrow\">\n <span class=\"s-slider-button-icon\" innerHTML={this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon} />\n </button>\n </div>\n : ''}\n </div>\n </div>\n : ''}\n\n <div class=\"swiper s-slider-container\" ref={el => this.sliderContainer = el as HTMLDivElement} dir={this.vertical ? \"ltr\" : this.direction}>\n <slot />\n <div class=\"swiper-wrapper s-slider-swiper-wrapper\" ref={el => this.sliderWrapper = el as HTMLDivElement}>\n <slot name='items' />\n </div>\n {this.pagination ? <div class=\"swiper-pagination\"></div> : ''}\n </div>\n\n {this.type == 'thumbs' && this.hasThumbSlot ? <div class=\"s-slider-thumbs\">\n <div class=\"swiper s-slider-thumbs-container\" dir={this.verticalThumbs ? \"ltr\" : this.direction} ref={el => this.thumbsSliderContainer = el as HTMLDivElement}>\n <div class={{ \"s-slider-swiper-wrapper swiper-wrapper\": true, \"s-slider-grid-thumbs\": this.gridThumbs }} ref={el => this.thumbsSliderWrapper = el as HTMLDivElement}>\n <slot name=\"thumbs\" />\n </div>\n {this.showThumbsControls ?\n <div class=\"s-slider-thumbs-nav\" dir=\"rtl\">\n <button aria-label=\"Previous Slide\" class=\"s-slider-thumbs-prev s-slider-nav-arrow\">\n <span class=\"s-slider-button-icon\" innerHTML={this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon} />\n </button>\n <button aria-label=\"Next Slide\" class=\"s-slider-thumbs-next s-slider-nav-arrow\">\n <span class=\"s-slider-button-icon\" innerHTML={this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon} />\n </button>\n </div>\n : null}\n </div>\n </div>\n : null}\n </Host>\n );\n }\n\n componentDidLoad() {\n let itemsSlot = this.sliderWrapper.querySelector('div[slot=\"items\"]');\n !!itemsSlot ? itemsSlot.replaceWith(...itemsSlot.children as any) : null;\n if (this.type == 'thumbs' && this.hasThumbSlot) {\n let thumbsSlot = this.thumbsSliderWrapper.querySelector('div[slot=\"thumbs\"]');\n !!thumbsSlot ? thumbsSlot.replaceWith(...thumbsSlot.children as any) : null;\n }\n\n // if swiper is not loaded, lets relay on event\n // @ts-ignore\n if (typeof Swiper === 'undefined') {\n salla.event.once('swiper::loaded', () => this.initSlider())\n } else { // if swiper is loaded lets init our slider\n this.initSlider();\n }\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"salla-slider.js","sourceRoot":"","sources":["../../../src/components/salla-slider/salla-slider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAgB,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGtG,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,aAAa,MAAM,0CAA0C,CAAC;AAErE;;;GAGG;AAKH,MAAM,OAAO,WAAW;EAEtB;IA0WQ,iBAAY,GAAY,KAAK,CAAC;IAE9B,uBAAkB,GAAG;MAC3B,QAAQ,EAAE;QACR,KAAK,EAAE,GAAG;QACV,aAAa,EAAE,MAAM;QACrB,YAAY,EAAE,CAAC;OAChB;MACD,SAAS,EAAE;QACT,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,IAAI;OACf;MACD,UAAU,EAAE;QACV,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,UAAU;QACrB,YAAY,EAAE,KAAK;QACnB,mBAAm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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, State, Prop, h, Event, Host, EventEmitter, Method, Element } from '@stencil/core';\nimport { Swiper as SwiperType } from 'swiper/types';\n\nimport ArrowRightIcon from \"../../assets/svg/keyboard_arrow_right.svg\";\nimport ArrowLeftIcon from \"../../assets/svg/keyboard_arrow_left.svg\";\n\n/**\n * @slot items - Slider items.\n * @slot thumbs - Thumbs slider items.\n */\n@Component({\n tag: 'salla-slider',\n styleUrl: 'salla-slider.scss',\n})\nexport class SallaSlider {\n @Element() host: HTMLElement;\n constructor() {\n this.direction = this.direction || document.documentElement.dir\n }\n\n /**\n * Show/hide slider block title\n */\n @Prop({ reflect: true }) blockTitle: string = '';\n\n /**\n * Enable call a specific slide by index from thumbnails option in `salla-slider-options` component, works only if `data-img-id` and `data-slid-index` attributes are set on each slide\n */\n @Prop({ reflect: true }) listenToThumbnailsOption: boolean = false;\n\n /**\n * Show/hide slider block sub title\n */\n @Prop({ reflect: true }) blockSubtitle: string = '';\n\n /**\n * Show/hide display all button beside arrows\n */\n @Prop({ reflect: true }) displayAllUrl: string = '';\n\n /**\n * Show/hide display all button beside arrows\n */\n @Prop({ reflect: true }) arrowsCentered: boolean = false;\n\n /**\n * Vertical or Horizontal thumbs slider\n */\n @Prop({ reflect: true }) verticalThumbs: boolean = false;\n\n /**\n * Disable thumbs slider and show it as a grid\n */\n @Prop({ reflect: true }) gridThumbs: boolean = false;\n\n /**\n * Vertical or Horizontal main slider\n */\n @Prop({ reflect: true }) vertical: boolean = false;\n\n /**\n * Auto Height slider\n */\n @Prop({ reflect: true }) autoHeight: boolean = false;\n\n /**\n * Show/hide arrows\n */\n @Prop({ reflect: true }) showControls: boolean = true;\n\n /**\n * Show/hide arrows\n */\n @Prop({ reflect: true }) controlsOuter: boolean = false;\n\n /**\n * Show/hide thumbs slider arrows\n */\n @Prop() showThumbsControls: boolean = true;\n\n /**\n * Enable autoplay - working with `type=\"carousel\" only`\n */\n @Prop() autoPlay: boolean = false;\n\n /**\n * slidesPerView\n */\n @Prop() slidesPerView: string = \"auto\";\n\n /**\n * Enable pagination\n */\n @Prop() pagination: boolean = false;\n\n /**\n * Enable center mode - working with `type=\"carousel\" only`\n */\n @Prop() centered: boolean = false;\n\n /**\n * Run slider in loop, Don't use it for slides with custom components inside it, because it may cause re-render issue\n */\n @Prop() loop: boolean = false;\n\n /**\n * Slider direction. Default: document.documentElement.dir\n */\n @Prop({ mutable: true, reflect: true }) direction: string;\n\n /**\n * Set the type of the slider\n * Default: ''\n */\n @Prop() type: 'carousel' | 'fullscreen' | 'thumbs' | 'default' | 'hero' | 'testimonials' | 'blog' | 'fullwidth' | '' = '';\n /**\n * Slider Configs refer to https://swiperjs.com/swiper-api#parameters and pass the entire config object\n * @example\n * let slider = document.querySelector('salla-slider');\n * slider.sliderConfig = {\n * slidesPerView: 1,\n * spaceBetween : 30,\n * lazy: true,\n * }\n *\n */\n @Prop({ reflect: true }) sliderConfig: any;\n /**\n * Thumbs Slider Configs refer to https://swiperjs.com/swiper-api#parameters and pass the entire config object\n * @example\n * let slider = document.querySelector('salla-slider');\n * slider.thumbsConfig = {\n * slidesPerView: 1,\n * spaceBetween : 30,\n * lazy: true,\n * }\n *\n */\n @Prop({ reflect: true }) thumbsConfig: any = {};\n\n // Events\n /**\n * Event will fired right after initialization.\n */\n @Event() afterInit: EventEmitter<any>;\n /**\n * Event will be fired when currently active slide is changed\n */\n @Event() slideChange: EventEmitter<any>;\n\n /**\n * Event will be fired when Swiper reach its beginning (initial position)\n */\n @Event() reachBeginning: EventEmitter<any>;\n\n /**\n * Event will be fired when Swiper reach last slide\n */\n @Event() reachEnd: EventEmitter<any>;\n\n /**\n * Event will be fired after animation to other slide (next or previous).\n */\n @Event() slideChangeTransitionEnd: EventEmitter<any>;\n\n /**\n * Event will be fired in the beginning of animation to other slide (next or previous).\n */\n @Event() slideChangeTransitionStart: EventEmitter<any>;\n\n /**\n * Same as \"slideChangeTransitionEnd\" but for \"forward\" direction only\n */\n @Event() slideNextTransitionEnd: EventEmitter<any>;\n\n /**\n * Same as \"slideChangeTransitionStart\" but for \"forward\" direction only\n */\n @Event() slideNextTransitionStart: EventEmitter<any>;\n\n /**\n * Same as \"slideChangeTransitionEnd\" but for \"backward\" direction only\n */\n @Event() slidePrevTransitionEnd: EventEmitter<any>;\n\n /**\n * Same as \"slideChangeTransitionStart\" but for \"backward\" direction only\n */\n @Event() slidePrevTransitionStart: EventEmitter<any>;\n\n /**\n * Event will be fired when user touch and move finger over Swiper and move it.\n * Receives touchmove event as an arguments.\n */\n @Event() sliderMove: EventEmitter<any>;\n\n /**\n * Event will be fired when user release Swiper. Receives touchend event as an arguments.\n */\n @Event() touchSliderEnd: EventEmitter<any>;\n\n /**\n * Event will be fired when user touch and move finger over Swiper.\n * Receives touchmove event as an arguments.\n */\n @Event() touchSliderMove: EventEmitter<any>;\n\n /**\n * Event will be fired when user touch Swiper. Receives touchstart event as an arguments.\n */\n @Event() touchSliderStart: EventEmitter<any>;\n\n /**\n * Event will be fired after transition.\n */\n @Event() sliderTransitionEnd: EventEmitter<any>;\n\n /**\n * Event will be fired in the beginning of transition.\n */\n @Event() sliderTransitionStart: EventEmitter<any>;\n\n\n // Methods\n\n /**\n * Run transition to the slide with index number equal to 'index' parameter for the duration equal to 'speed' parameter.\n *\n * @param {number} index - Index number of slide.\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideTo(index: number, speed?: number, runCallbacks?: boolean) {\n\n return this.slider.slideTo(index, speed, runCallbacks);\n }\n\n /**\n * Run transition to the next slide.\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideNext(speed?: number, runCallbacks?: boolean) {\n this.slider?.slideNext(speed, runCallbacks);\n }\n\n /**\n * Run transition to the previous slide.\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slidePrev(speed?: number, runCallbacks?: boolean) {\n this.slider?.slidePrev(speed, runCallbacks);\n }\n\n /**\n * Does the same as .slideTo but for the case when used with enabled loop. So this method will slide to slides with realIndex matching to passed index\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideToLoop(index: number, speed?: number, runCallbacks?: boolean) {\n this.slider.slideToLoop(index, speed, runCallbacks);\n }\n\n /**\n * Does the same as .slideNext but for the case when used with enabled loop. So this method will slide to next slide with realIndex matching to next index\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideNextLoop(speed?: number, runCallbacks?: boolean) {\n this.slider.slideNextLoop(speed, runCallbacks);\n }\n\n /**\n * Does the same as .slidePrev but for the case when used with enabled loop. So this method will slide to previous slide with realIndex matching to previous index\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slidePrevLoop(speed?: number, runCallbacks?: boolean) {\n this.slider.slidePrevLoop(speed, runCallbacks);\n }\n\n /**\n * Reset slider position to currently active slide for the duration equal to 'speed' parameter.\n *\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideReset(speed?: number, runCallbacks?: boolean) {\n this.slider.slideReset(speed, runCallbacks);\n }\n\n /**\n * Reset slider position to closest slide/snap point for the duration equal to 'speed' parameter.\n * @param {number} speed - Transition duration (in ms).\n * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.\n * **/\n @Method()\n async slideToClosest(speed?: number, runCallbacks?: boolean) {\n this.slider.slideToClosest(speed, runCallbacks);\n }\n\n /**\n * You should call it after you add/remove slides manually, or after you hide/show it, or do any custom DOM modifications with Swiper This method also includes subcall of the following methods which you can use separately:\n * **/\n @Method()\n async update() {\n this.slider.update();\n }\n\n /**\n * Force slider to update its height (when autoHeight enabled) for the duration equal to 'speed' parameter\n * @param {number} speed - Transition duration (in ms).\n * **/\n @Method()\n async updateAutoHeight(speed?: number) {\n this.slider.updateAutoHeight(speed);\n }\n\n /**\n * recalculate number of slides and their offsets. Useful after you add/remove slides with JavaScript\n * **/\n @Method()\n async updateSlides() {\n this.slider.updateSlides();\n }\n\n /**\n * recalculate slider progress\n * **/\n @Method()\n async updateProgress() {\n this.slider.updateProgress();\n }\n\n /**\n * update active/prev/next classes on slides and bullets\n * **/\n @Method()\n async updateSlidesClasses() {\n this.slider.updateSlidesClasses();\n }\n\n\n /**\n * Get slider slides\n * **/\n @Method()\n async getSlides() {\n return await this.slider?.slides;\n }\n\n\n // States\n @State() currentIndex: number | undefined = undefined;\n @State() isEnd: boolean = false;\n @State() isBeginning: boolean = true;\n @State() swiperScript: any;\n @State() displayAllTitle: string;\n\n private sliderContainer?: HTMLDivElement;\n private sliderWrapper?: HTMLDivElement;\n private thumbsSliderContainer?: HTMLDivElement;\n private thumbsSliderWrapper?: HTMLDivElement;\n private slider: any;\n private thumbsSlider: any;\n private hasThumbSlot: boolean = false;\n\n private pre_defined_config = {\n carousel: {\n speed: 300,\n slidesPerView: 'auto',\n spaceBetween: 0,\n },\n fullwidth: {\n speed: 750,\n parallax: true,\n },\n fullscreen: {\n speed: 1000,\n parallax: true,\n direction: \"vertical\",\n followFinger: false,\n touchReleaseOnEdges: true,\n lazy: true,\n mousewheel: {}\n },\n testimonials: {\n draggable: true,\n slidesPerView: 1,\n breakpoints: { 1024: { slidesPerView: 2 } }\n },\n blog: {\n parallax: true,\n speed: 800,\n loop: true,\n slidesPerView: 1,\n centeredSlides: true,\n spaceBetween: 30,\n breakpoints: {\n 320: { spaceBetween: 10 },\n 768: { spaceBetween: 15 },\n 980: { paceBetween: 30 },\n }\n },\n thumbs: {\n slidesPerView: 1,\n spaceBetween: 30\n }\n }\n\n componentWillLoad() {\n salla.lang.onLoaded(() => {\n this.displayAllTitle = salla.lang.get('blocks.home.display_all');\n })\n this.hasThumbSlot = !!this.host.querySelector('[slot=\"thumbs\"]');\n if (this.listenToThumbnailsOption) {\n salla.event.on('product-options::change', data => {\n if (data.option.type == 'thumbnail') {\n const slideIndex = this.sliderWrapper.querySelector(`[data-img-id=\"${data.detail.option_value}\"]`)?.getAttribute('data-slid-index');\n slideIndex ? this.slideTo(parseInt(slideIndex), 300, false) : '';\n }\n });\n }\n return new Promise((resolve, reject) => {\n // @ts-ignore\n if (typeof Swiper !== 'undefined') {\n return resolve(true);\n }\n\n if (document.getElementById('swiper-script')) {\n let interval = setInterval(() => {\n // @ts-ignore\n if (typeof Swiper !== 'undefined') {\n clearInterval(interval);\n resolve(true);\n }\n }, 5);\n } else {\n // ? There is an issue with stencil bundling it breaks the swiper import, so we need to import it manually by swiperjs rerendered file\n // ! IT'S NOT A GOOD SOLUTION, BUT IT WORKS, WE NEED TO FIND A BETTER SOLUTION\n this.swiperScript = document.createElement('script');\n this.swiperScript.onload = () => {\n resolve(true)\n salla.event.emit('swiper::loaded');\n }\n this.swiperScript.onerror = (error) => {\n salla.logger.warn('failed load swiper bundle', error);\n reject(true)\n }\n this.swiperScript.src = 'https://cdn.salla.network/js/swiper@8.js';\n this.swiperScript.setAttribute('id', 'swiper-script');\n document.body.appendChild(this.swiperScript);\n }\n });\n }\n\n getSwiperConfig() {\n let pre_defined_config = {\n loop: this.loop,\n autoplay: this.type == 'fullwidth' && !!this.autoPlay ? { delay: 5000 } : this.autoPlay,\n centeredSlides: this.centered,\n slidesPerView: this.slidesPerView,\n autoHeight: this.autoHeight,\n lazy: true,\n on: {\n // todo:: find better way for this workaround to show lazyLoad for duplicated slides, because it clones the slide after it's already rendered,\n // then it re appended it as is,in this case the image is loaded but class not added.\n afterInit: (slider: SwiperType) => {\n this.afterInit.emit(slider);\n document.lazyLoadInstance?.update();\n this.loop && slider.slides.map(slide => {\n if (!slide.classList.contains('swiper-slide-duplicate')) {\n return;\n }\n slide.querySelectorAll('img.lazy:not(.loaded)').forEach(img => img.classList.add('loaded'));\n })\n },\n },\n pagination: this.pagination ? {\n el: this.host.id ? `#${this.host.id} .swiper-pagination` : '',\n clickable: true,\n } : false,\n navigation: this.showControls ? {\n nextEl: this.host.id ? `#${this.host.id} .s-slider-next` : '',\n prevEl: this.host.id ? `#${this.host.id} .s-slider-prev` : ''\n } : false,\n breakpoints: {\n 768: {\n direction: this.vertical ? \"vertical\" : \"horizontal\",\n },\n },\n };\n let pre_defined_thumbs_config = {\n freeMode: false,\n watchSlidesProgress: true,\n slidesPerView: 4,\n spaceBetween: 10,\n watchOverflow: true,\n watchSlidesVisibility: true,\n breakpoints: {\n 768: {\n direction: this.verticalThumbs ? \"vertical\" : \"horizontal\",\n spaceBetween: 16,\n },\n },\n navigation: this.showThumbsControls ? {\n nextEl: this.host.id ? `#${this.host.id} .s-slider-thumbs-next` : '',\n prevEl: this.host.id ? `#${this.host.id} .s-slider-thumbs-prev` : ''\n } : false,\n }\n this.pre_defined_config.fullscreen.mousewheel = {\n releaseOnEdges: this.host.querySelectorAll('.swiper-slide').length > 1 ? false : true\n },\n pre_defined_config = {\n ...pre_defined_config,\n ...(this.pre_defined_config[this.type] || {})\n };\n\n if (this.type == 'thumbs' && this.thumbsSliderWrapper) {\n for (const slide of this.thumbsSliderWrapper.children as any) {\n //todo:: use `s-slider-slide`\n slide.classList.add('swiper-slide')\n }\n\n if (this.hasThumbSlot && this.thumbsConfig) {\n try {\n pre_defined_thumbs_config = {\n ...pre_defined_thumbs_config,\n ...JSON.parse(this.thumbsConfig)\n }\n } catch (error) {\n salla.logger.warn('failed to parse thumbs slider config', error);\n }\n }\n // @ts-ignore\n this.thumbsSlider = new Swiper(this.thumbsSliderContainer, pre_defined_thumbs_config);\n \n // @ts-ignore\n pre_defined_config.thumbs = {\n swiper: this.thumbsSlider,\n };\n }\n\n pre_defined_config = {\n ...pre_defined_config,\n };\n if (this.sliderConfig) {\n try {\n pre_defined_config = {\n ...pre_defined_config,\n ...JSON.parse(this.sliderConfig)\n };\n } catch (error) {\n salla.logger.warn('failed to parse slider config', error);\n }\n }\n return pre_defined_config\n }\n\n initSlider() {\n for (const slide of this.sliderWrapper.children as any) {\n slide.classList.add('swiper-slide')\n }\n\n // @ts-ignore\n this.slider = new Swiper(this.sliderContainer, this.getSwiperConfig())\n\n // Expose slider events\n this.slider.on('slideChange', (slider: SwiperType) => {\n //todo:: it doesn't change when loop is active, always will be false\n this.isBeginning = slider.isBeginning;\n this.isEnd = slider.isEnd;\n this.slideChange.emit(slider);\n });\n this.slider.on('reachBeginning', (slider: SwiperType) => this.reachBeginning.emit(slider));\n this.slider.on('reachEnd', (slider: SwiperType) => this.reachEnd.emit(slider));\n this.slider.on('slideChangeTransitionEnd', (slider: SwiperType) => {\n if (this.type == \"fullscreen\") {\n const activeIndex = slider.activeIndex;\n (slider.params.mousewheel as any).releaseOnEdges = activeIndex === 0 || (activeIndex === slider.slides.length - 1);\n }\n this.slideChangeTransitionEnd.emit(slider)\n });\n this.slider.on('slideChangeTransitionStart', (slider: SwiperType) => this.slideChangeTransitionStart.emit(slider));\n this.slider.on('slideNextTransitionEnd', (slider: SwiperType) => this.slideNextTransitionEnd.emit(slider));\n this.slider.on('slideNextTransitionStart', (slider: SwiperType) => this.slideNextTransitionStart.emit(slider));\n this.slider.on('slidePrevTransitionEnd', (slider: SwiperType) => this.slidePrevTransitionEnd.emit(slider));\n this.slider.on('slidePrevTransitionStart', (slider: SwiperType) => this.slidePrevTransitionStart.emit(slider));\n this.slider.on('sliderMove', (slider: SwiperType) => this.sliderMove.emit(slider));\n this.slider.on('touchEnd', (slider: SwiperType) => this.touchSliderEnd.emit(slider));\n this.slider.on('touchMove', (slider: SwiperType) => this.touchSliderMove.emit(slider));\n this.slider.on('touchStart', (slider: SwiperType) => this.touchSliderStart.emit(slider));\n this.slider.on('transitionEnd', (slider: SwiperType) => this.sliderTransitionEnd.emit(slider));\n this.slider.on('transitionStart', (slider: SwiperType) => this.sliderTransitionStart.emit(slider));\n }\n\n render() {\n let classes = this.type ? this.type + '-slider ' : '';\n classes += this.controlsOuter ? ' s-slider-controls-outer ' : '';\n classes += this.blockTitle == '' ? ' s-slider-has-notitle s-slider-v-centered ' : '';\n classes += this.verticalThumbs ? ' s-slider-vertical ' : ' s-slider-horizontal ';\n classes += this.arrowsCentered ? ' s-slider-v-centered ' : '';\n classes += this.gridThumbs ? ' s-slider-with-grid-thumbs ' : '';\n return (\n <Host class={'s-slider-wrapper ' + classes}>\n\n {/* Slider block Title */}\n {this.blockTitle || this.showControls ?\n <div class=\"s-slider-block__title\">\n {this.blockTitle ?\n <div class=\"s-slider-block__title-right\">\n <h2>{this.blockTitle}</h2>\n {this.blockSubtitle ? <p innerHTML={this.blockSubtitle} /> : ''}\n </div>\n : ''}\n\n <div class=\"s-slider-block__title-left\">\n {this.displayAllUrl ?\n <a href={this.displayAllUrl} class=\"s-slider-block__display-all\">{this.displayAllTitle}</a>\n : ''}\n {this.showControls ?\n <div class=\"s-slider-block__title-nav\" dir=\"rtl\">\n <button aria-label=\"Previous Slide\" class=\"s-slider-prev s-slider-nav-arrow\">\n <span class=\"s-slider-button-icon\" innerHTML={this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon} />\n </button>\n <button aria-label=\"Next Slide\" class=\"s-slider-next s-slider-nav-arrow\">\n <span class=\"s-slider-button-icon\" innerHTML={this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon} />\n </button>\n </div>\n : ''}\n </div>\n </div>\n : ''}\n\n <div class=\"swiper s-slider-container\" ref={el => this.sliderContainer = el as HTMLDivElement} dir={this.vertical ? \"ltr\" : this.direction}>\n <slot />\n <div class=\"swiper-wrapper s-slider-swiper-wrapper\" ref={el => this.sliderWrapper = el as HTMLDivElement}>\n <slot name='items' />\n </div>\n {this.pagination ? <div class=\"swiper-pagination\"></div> : ''}\n </div>\n\n {this.type == 'thumbs' && this.hasThumbSlot ? <div class=\"s-slider-thumbs\">\n <div class=\"swiper s-slider-thumbs-container\" dir={this.verticalThumbs ? \"ltr\" : this.direction} ref={el => this.thumbsSliderContainer = el as HTMLDivElement}>\n <div class={{ \"s-slider-swiper-wrapper swiper-wrapper\": true, \"s-slider-grid-thumbs\": this.gridThumbs }} ref={el => this.thumbsSliderWrapper = el as HTMLDivElement}>\n <slot name=\"thumbs\" />\n </div>\n {this.showThumbsControls ?\n <div class=\"s-slider-thumbs-nav\" dir=\"rtl\">\n <button aria-label=\"Previous Slide\" class=\"s-slider-thumbs-prev s-slider-nav-arrow\">\n <span class=\"s-slider-button-icon\" innerHTML={this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon} />\n </button>\n <button aria-label=\"Next Slide\" class=\"s-slider-thumbs-next s-slider-nav-arrow\">\n <span class=\"s-slider-button-icon\" innerHTML={this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon} />\n </button>\n </div>\n : null}\n </div>\n </div>\n : null}\n </Host>\n );\n }\n\n componentDidLoad() {\n let itemsSlot = this.sliderWrapper.querySelector('div[slot=\"items\"]');\n !!itemsSlot ? itemsSlot.replaceWith(...itemsSlot.children as any) : null;\n if (this.type == 'thumbs' && this.hasThumbSlot) {\n let thumbsSlot = this.thumbsSliderWrapper.querySelector('div[slot=\"thumbs\"]');\n !!thumbsSlot ? thumbsSlot.replaceWith(...thumbsSlot.children as any) : null;\n }\n\n // if swiper is not loaded, lets relay on event\n // @ts-ignore\n if (typeof Swiper === 'undefined') {\n salla.event.once('swiper::loaded', () => this.initSlider())\n } else { // if swiper is loaded lets init our slider\n this.initSlider();\n }\n }\n}\n\n"]}
|
|
@@ -47,47 +47,40 @@ export class SallaSocialShare {
|
|
|
47
47
|
* Activate or open the share menu.
|
|
48
48
|
*/
|
|
49
49
|
async open() {
|
|
50
|
-
|
|
51
|
-
if (this.opened) {
|
|
52
|
-
this.shareMenu.classList.add('opened');
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
this.shareMenu.classList.remove('opened');
|
|
56
|
-
}
|
|
57
|
-
new anime.timeline().add({
|
|
50
|
+
const animateList = new anime.timeline().add({
|
|
58
51
|
targets: this.shareMenu,
|
|
59
52
|
translateY: [-50, 0],
|
|
60
53
|
opacity: [0, 1],
|
|
61
54
|
duration: 300,
|
|
62
55
|
podding: '0',
|
|
63
56
|
easing: 'easeInOutSine'
|
|
64
|
-
})
|
|
65
|
-
|
|
57
|
+
});
|
|
58
|
+
animateList.add({
|
|
59
|
+
targets: this.shareMenu.children,
|
|
66
60
|
translateZ: 0,
|
|
67
61
|
translateY: [-30, 0],
|
|
68
62
|
scaleY: [0, 1],
|
|
69
63
|
opacity: [0, 1],
|
|
70
|
-
duration:
|
|
64
|
+
duration: 1400,
|
|
71
65
|
delay: anime.stagger(100)
|
|
72
66
|
}, '-=200');
|
|
67
|
+
this.opened = !this.opened;
|
|
68
|
+
if (this.opened) {
|
|
69
|
+
this.shareMenu.classList.add('opened');
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
animateList.pause();
|
|
73
|
+
animateList.seek(0);
|
|
74
|
+
this.shareMenu.classList.remove('opened');
|
|
75
|
+
}
|
|
73
76
|
}
|
|
74
77
|
async refresh() {
|
|
75
78
|
var _a;
|
|
76
|
-
|
|
77
|
-
(_a = document.getElementById('a2a-script')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
78
|
-
const script = document.createElement('script');
|
|
79
|
-
script.src = 'https://static.addtoany.com/menu/page.js';
|
|
80
|
-
script.setAttribute('id', 'a2a-script');
|
|
81
|
-
script.async = true;
|
|
82
|
-
script.onload = function () {
|
|
83
|
-
window.a2a_config.locale = salla.config.get('user.language_code', salla.lang.getLocale());
|
|
84
|
-
};
|
|
85
|
-
document.body.appendChild(script);
|
|
86
|
-
}
|
|
79
|
+
(_a = window.a2a) === null || _a === void 0 ? void 0 : _a.init('page');
|
|
87
80
|
}
|
|
88
81
|
render() {
|
|
89
82
|
return (h("div", { class: "s-social-share-wrapper" }, h("slot", { name: 'widget' }, h("salla-button", { "aria-label": "Share", onClick: () => this.open(), class: "s-social-share-btn", shape: "icon", fill: "outline", color: "light" }, h("span", { innerHTML: this.opened ? Cancel : ShareAlt }))), h("ul", { ref: el => this.shareMenu = el, class: "s-social-share-list a2a_kit share", "data-a2a-url": this.url ? this.url : window.location.href, "data-a2a-title": this.urlName ? this.urlName : document.title }, this.platforms.split(',').map(platform => {
|
|
90
|
-
return (h("li",
|
|
83
|
+
return (h("li", null, h("a", { class: `a2a_button_${platform}`, "aria-label": `Share Via ${platform}` }, this.platformIcons.map((icon) => {
|
|
91
84
|
if (icon.name === platform) {
|
|
92
85
|
return h("span", { class: "s-social-share-icon", innerHTML: icon.icon });
|
|
93
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"salla-social-share.js","sourceRoot":"","sources":["../../../src/components/salla-social-share/salla-social-share.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"salla-social-share.js","sourceRoot":"","sources":["../../../src/components/salla-social-share/salla-social-share.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,MAAM,2BAA2B,CAAC;AAC9C,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,QAAQ,MAAM,gCAAgC,CAAC;AAEtD;;GAEG;AAMH,MAAM,OAAO,gBAAgB;;kBAIA,KAAK;wBACO,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC;yBACtF,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE;QACnF,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,OAAO,CAAC,QAAQ;OACvB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,EA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,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,oBAAkB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,IACrN,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;QACxC,OAAO,CACL;UACE,SAAG,KAAK,EAAE,cAAc,QAAQ,EAAE,gBAAc,aAAa,QAAQ,EAAE,IAGnE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE;YACnC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;cAC1B,OAAO,YAAM,KAAK,EAAC,qBAAqB,EAAC,SAAS,EAAE,IAAI,CAAC,IAAI,GAAS,CAAA;aACvE;UACH,CAAC,CAAC,CAEF,CACD,CACN,CAAC;MACJ,CAAC,CAAC,CAEC,CACD,CAEP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, State, Method } from '@stencil/core';\nimport anime from 'animejs';\nimport facebook from '../../assets/svg/facebook.svg';\nimport twitter from '../../assets/svg/twitter.svg';\nimport copy_link from '../../assets/svg/link.svg';\nimport email from '../../assets/svg/mail.svg';\nimport whatsapp from '../../assets/svg/whatsapp.svg';\nimport { Socials } from './interfaces';\nimport Cancel from \"../../assets/svg/cancel.svg\";\nimport ShareAlt from \"../../assets/svg/share-alt.svg\";\n\n/**\n * @slot widget - An action that can be used to activete or open the component by calling the `open` method.\n */\n@Component({\n tag: 'salla-social-share',\n styleUrl: 'salla-social-share.scss'\n})\n\nexport class SallaSocialShare {\n\n private shareMenu?: HTMLUListElement;\n\n @State() opened: boolean = false;\n @State() allPlatforms: Array<string> = [Socials.WHATSAPP, Socials.FACEBOOK, Socials.TWITTER, Socials.EMAIL, Socials.COPY_LINK];\n @State() platformIcons: Array<object> = [{ icon: whatsapp, name: Socials.WHATSAPP }, {\n icon: facebook,\n name: Socials.FACEBOOK\n }, { icon: twitter, name: Socials.TWITTER }, { icon: email, name: Socials.EMAIL }, {\n icon: copy_link,\n name: Socials.COPY_LINK\n }];\n @State() convertedPlatforms: Array<string> = [];\n\n /**\n * page url that will be shared custom | current page url\n */\n @Prop({ reflect: true }) url: string = \"\";\n\n /**\n * page url name that will be shared custom | current page url\n */\n @Prop({ reflect: true }) urlName: string = \"\"\n\n /**\n * selected platforms to share | all platforms\n */\n @Prop({ reflect: true }) platforms: string = 'facebook,twitter,whatsapp,email,copy_link';\n\n componentWillLoad() {\n if (document.getElementById('a2a-script')) {\n return;\n }\n\n const script = document.createElement('script');\n script.src = 'https://static.addtoany.com/menu/page.js';\n script.setAttribute('id', 'a2a-script');\n script.async = true;\n script.onload = function () {\n window.a2a_config.locale = salla.config.get('user.language_code', salla.lang.getLocale());\n };\n document.body.appendChild(script);\n }\n\n\n /**\n * Activate or open the share menu.\n */\n @Method()\n async open() {\n const animateList = new (anime as any).timeline().add({\n targets: this.shareMenu,\n translateY: [-50, 0],\n opacity: [0, 1],\n duration: 300,\n podding: '0',\n easing: 'easeInOutSine'\n })\n animateList.add({\n targets: this.shareMenu.children,\n translateZ: 0,\n translateY: [-30, 0],\n scaleY: [0, 1],\n opacity: [0, 1],\n duration: 1400,\n delay: anime.stagger(100)\n }, '-=200');\n\n this.opened = !this.opened;\n \n \n if (this.opened) {\n this.shareMenu.classList.add('opened');\n } else {\n animateList.pause();\n animateList.seek(0);\n this.shareMenu.classList.remove('opened');\n }\n\n }\n @Method()\n async refresh() {\n window.a2a?.init('page');\n }\n\n render() {\n return (\n <div class=\"s-social-share-wrapper\">\n\n <slot name='widget'>\n\n <salla-button aria-label=\"Share\" onClick={() => this.open()} class=\"s-social-share-btn\" shape=\"icon\"\n fill=\"outline\" color=\"light\"\n >\n <span innerHTML={this.opened ? Cancel : ShareAlt}></span>\n </salla-button>\n </slot>\n\n <ul ref={el => this.shareMenu = el as HTMLUListElement} class=\"s-social-share-list a2a_kit share\" data-a2a-url={this.url ? this.url : window.location.href} data-a2a-title={this.urlName ? this.urlName : document.title}>\n {this.platforms.split(',').map(platform => {\n return (\n <li>\n <a class={`a2a_button_${platform}`} aria-label={`Share Via ${platform}`}>\n\n {\n this.platformIcons.map((icon: any) => {\n if (icon.name === platform) {\n return <span class=\"s-social-share-icon\" innerHTML={icon.icon}></span>\n }\n })\n }\n </a>\n </li>\n );\n })\n }\n </ul>\n </div>\n\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"salla-user-menu.js","sourceRoot":"","sources":["../../../src/components/salla-user-menu/salla-user-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AACvE,QAAQ;AACR,OAAO,SAAS,MAAM,0CAA0C,CAAA;AAChE,OAAO,QAAQ,MAAM,gCAAgC,CAAA;AACrD,OAAO,SAAS,MAAM,kCAAkC,CAAA;AACxD,OAAO,iBAAiB,MAAM,2BAA2B,CAAA;AACzD,OAAO,YAAY,MAAM,2BAA2B,CAAA;AACpD,OAAO,WAAW,MAAM,kCAAkC,CAAA;AAC1D,OAAO,UAAU,MAAM,+BAA+B,CAAA;AACtD,OAAO,MAAM,MAAM,6BAA6B,CAAA;AAChD,OAAO,IAAI,MAAM,4BAA4B,CAAC;AAC9C,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAE1D;;;GAGG;AAKH,MAAM,OAAO,aAAa;EACxB;;IAmDQ,UAAK,GAAQ;MACnB,aAAa,EAAE,QAAQ;MACvB,MAAM,EAAE,SAAS;MACjB,cAAc,EAAE,iBAAiB;MACjC,QAAQ,EAAE,YAAY;MACtB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KAAK,EAAC,mCAAmC,EAAC,SAAS,EAAE,MAAM,EAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,GACjC,CACL,CAAC,CAAC,CAAC,EAAE;YACX,UAAI,KAAK,EAAC,2BAA2B,IAClC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACpE,CACD,CACF,CACF,CACD,CACR,CAAC;EACJ,CAAC;EAED,gBAAgB;;IACd,2DAA2D;IAC3D,MAAA,QAAQ,CAAC,gBAAgB,0CAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;EACzE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Host, h, State, Element, Prop} from '@stencil/core';\n// Icons\nimport ArrowDown from \"../../assets/svg/keyboard_arrow_down.svg\"\nimport BellRing from \"../../assets/svg/bell-ring.svg\"\nimport OrderIcon from \"../../assets/svg/box-bankers.svg\"\nimport PendingOrdersIcon from \"../../assets/svg/cart.svg\"\nimport WishListIcon from \"../../assets/svg/star.svg\"\nimport ProfileIcon from \"../../assets/svg/user-circle.svg\"\nimport LogoutIcon from \"../../assets/svg/send-out.svg\"\nimport Cancel from \"../../assets/svg/cancel.svg\"\nimport Rate from \"../../assets/svg/star2.svg\";\nimport UserCircle from \"../../assets/svg/user-circle.svg\";\n\n/**\n * @slot trigger - Replaces trigger widget, has replaceable props `{avatar}`, `{hello}`, `{first_name}`, `{last_name}`, `{icon}`.\n * @slot login-btn - Replaces the login button, it must be used with `salla.event.dispatch('login::open')` to open the login modal.\n */\n@Component({\n tag: 'salla-user-menu',\n styleUrl: 'salla-user-menu.scss',\n})\nexport class SallaUserMenu {\n constructor() {\n\n // salla.auth.event.onLoggedIn(() => {\n // this.is_loggedIn = true\n // })\n\n salla.lang.onLoaded(() => {\n this.notifications = salla.lang.get(\"common.titles.notifications\");\n this.orders = salla.lang.get(\"common.titles.orders\");\n this.pending_orders = salla.lang.get(\"common.titles.pending_orders\");\n this.wishlist = salla.lang.get(\"common.titles.wishlist\");\n this.profile = salla.lang.get(\"common.titles.profile\");\n this.hello = salla.lang.get(\"pages.checkout.hello\");\n this.rating = salla.lang.get(\"common.titles.rating\");\n this.logout = salla.lang.get(\"blocks.header.logout\");\n });\n\n //we need it only in theme-y\n if (this.host.hasAttribute('with-rating')) {\n this.items.rating = Rate;\n }\n //we need it to be the last item\n this.items.logout = LogoutIcon;\n\n this.triggerSlot = this.host.querySelector('[slot=\"trigger\"]')?.innerHTML || '<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>';\n salla.onReady(() => {\n if (salla.config.isGuest()) {\n return;\n }\n\n this.is_loggedIn = true;\n /**\n * Get Fresh Notifications In These Cases:\n * - is notification page, if user already changed the status of his orders (to reset notification badge)\n * - is pending orders page, if user already changed the status of his orders (to reset orders badge)\n * - is profile page, in case user changed his name or avatar, we need to update it\n * - half hour is passed from the last user data fetched\n *\n * //todo:: update the data in the storage in customer pages\n * //todo:: cover two requests in customer pages\n * //todo:: make sure to run this only after token is set\n */\n if (salla.url.is_page('customer.notifications')\n || salla.url.is_page('customer.orders.index.pending')\n || salla.url.is_page('customer.profile')\n || ((Date.now() - (salla.storage.get('user.fetched_at') || 0)) / 1000 / 60) > 30) {\n this.fetchFreshProfile();\n }\n });\n }\n\n private items: any = {\n notifications: BellRing,\n orders: OrderIcon,\n pending_orders: PendingOrdersIcon,\n wishlist: WishListIcon,\n profile: ProfileIcon,\n };\n\n @Element() host: HTMLElement;\n private readonly triggerSlot: string;\n @State() accountLoading: boolean = false;\n @State() opened: boolean = false;\n @State() notifications: string = salla.lang.get(\"common.titles.notifications\");\n @State() orders: string = salla.lang.get(\"common.titles.orders\");\n @State() pending_orders: string = salla.lang.get(\"common.titles.pending_orders\");\n @State() wishlist: string = salla.lang.get(\"common.titles.wishlist\");\n @State() profile: string = salla.lang.get(\"common.titles.profile\");\n @State() rating: string = salla.lang.get(\"common.titles.rating\");\n @State() logout: string = salla.lang.get(\"blocks.header.logout\");\n @State() hello: string = salla.lang.get(\"pages.checkout.hello\");\n @State() first_name: string = salla.storage.get('user.first_name') || '';\n @State() last_name: string = salla.storage.get('user.last_name') || '';\n @State() avatar: string = salla.storage.get('user.avatar') || salla.url.cdn('images/avatar.png');\n @State() is_loggedIn: boolean;\n @State() badges: any = {\n notifications: salla.helpers.number(salla.storage.get('user.notifications') || 0),\n pending_orders: salla.helpers.number(salla.storage.get('user.pending_orders') || 0)\n };\n\n @State() hasBadges: boolean = Number(salla.storage.get('user.pending_orders')) > 0 || Number(salla.storage.get('user.notifications')) > 0;\n /**\n * To display only the list without the dropdown functionality\n */\n @Prop({reflect: true}) inline: boolean = false;\n\n /**\n * To display the trigger as an avatar only\n */\n @Prop({reflect: true}) avatarOnly: boolean = false;\n\n /**\n * To display the dropdown header in mobile sheet\n */\n @Prop({reflect: true}) showHeader: boolean = false;\n\n /**\n * To Make the dropdown menu relative to parent element or not\n */\n @Prop({reflect: true}) relativeDropdown: boolean = false;\n\n private onClickOutside = () => {\n this.opened = false;\n }\n\n @State() OrderUpdate: number = 0;\n\n private fetchFreshProfile() {\n //don't request fetchFreshProfile unless token is injected into the api\n if (!salla.api.token) {\n salla.log('trying to fetchFreshProfile before injected the token!!');\n return;\n }\n salla.profile.api.info()\n .then((res) => {\n this.badges.pending_orders = salla.helpers.number(res.data.pending_orders || 0);\n this.badges.notifications = salla.helpers.number(res.data.notifications || 0);\n this.hasBadges = Number(res.data.pending_orders) > 0 || Number(res.data.notifications) > 0;\n this.first_name = res.data.first_name;\n this.last_name = res.data.last_name;\n this.avatar = res.data.avatar || salla.url.cdn('images/avatar.png');\n });\n }\n\n async open(e) {\n this.opened = !this.opened;\n e.stopPropagation()\n if (this.opened) {\n window.addEventListener('click', this.onClickOutside);\n }\n }\n\n private menuItemClicked(event: Event, item: string[]) {\n if (item[0] !== 'logout') {\n return;\n }\n event.preventDefault();\n salla.auth.logout();\n }\n\n private getTheHeader() {\n return <div class={{\n 's-user-menu-trigger-slot': true,\n 's-user-menu-red-dot': this.hasBadges,\n 's-user-menu-trigger-avatar-only': this.avatarOnly\n }}\n id='trigger-slot' onClick={(e) => this.open(e)} innerHTML={this.triggerSlot\n .replace(/\\{hello\\}/g, this.hello)\n .replace(/\\{first_name\\}/g, this.first_name)\n .replace(/\\{last_name\\}/g, this.last_name)\n .replace(/\\{avatar\\}/g, this.avatar)\n .replace(/\\{icon\\}/g, ArrowDown)}>\n </div>;\n }\n\n private getMenuItem(item: any[], i: number) {\n //todo:: enhancement support slot here\n return <li class={{\n 's-user-menu-dropdown-item': true,\n 's-user-menu-dropdown-item-logout': i + 1 == Object.entries(this.items).length\n }}>\n <a href={salla.url.get(item[0])} onClick={event => this.menuItemClicked(event, item)}>\n <i innerHTML={item[1]}> </i>\n <span class=\"s-user-menu-dropdown-item-title\">{this[item[0]]}</span>\n {!['٠', '0', undefined].includes(this.badges[item[0]])\n ? <span class=\"s-user-menu-dropdown-item-badge\">{this.badges[item[0]]}</span>\n : \"\"}\n </a>\n </li>;\n }\n\n componentShouldUpdate() {\n if (!this.opened) {\n window.removeEventListener('click', this.onClickOutside);\n }\n }\n\n render() {\n if (!this.is_loggedIn) {\n return <Host>\n <slot name='login-btn'>\n <button class=\"s-user-menu-login-btn\" onClick={() => salla.event.dispatch('login::open')}\n innerHTML={UserCircle}>\n </button>\n </slot>\n </Host>\n }\n\n if (this.inline) {\n return <Host>\n <ul class=\"s-user-menu-inline\">\n {Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))}\n </ul>\n </Host>\n }\n\n return (\n <Host>\n <div class={{'s-user-menu-wrapper': true, 's-user-menu-relative-dropdown': this.relativeDropdown}}>\n {this.getTheHeader()}\n <div class={{'s-user-menu-toggler': true, 'opened': this.opened}}>\n <div class=\"s-user-menu-dropdown\" onClick={(e) => e.stopPropagation()}>\n {this.showHeader ? <div class=\"s-user-menu-dropdown-header\">\n <img src={this.avatar} alt={`${this.first_name} ${this.last_name}`}/>\n <div class=\"s-user-menu-dropdown-header-content\">\n <span>{this.hello}</span>\n <p>{this.first_name} {this.last_name}</p>\n </div>\n <button class=\"s-user-menu-dropdown-header-close\" innerHTML={Cancel}\n onClick={() => this.opened = false}>\n </button>\n </div> : ''}\n <ul class=\"s-user-menu-dropdown-list\">\n {Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))}\n </ul>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n //make sure to load the avatar if it's lazy, we use it in Y\n document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"salla-user-menu.js","sourceRoot":"","sources":["../../../src/components/salla-user-menu/salla-user-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AACvE,QAAQ;AACR,OAAO,SAAS,MAAM,0CAA0C,CAAA;AAChE,OAAO,QAAQ,MAAM,gCAAgC,CAAA;AACrD,OAAO,SAAS,MAAM,kCAAkC,CAAA;AACxD,OAAO,iBAAiB,MAAM,2BAA2B,CAAA;AACzD,OAAO,YAAY,MAAM,2BAA2B,CAAA;AACpD,OA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CAAC,CAAC,CAAC,eAAe,EAAE;YAClE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,WAAK,KAAK,EAAC,6BAA6B;cACzD,WAAK,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,EAAE,GAAG;cACrE,WAAK,KAAK,EAAC,qCAAqC;gBAC9C,gBAAO,IAAI,CAAC,KAAK,CAAQ;gBACzB;kBAAI,IAAI,CAAC,UAAU;;kBAAG,IAAI,CAAC,SAAS,CAAK,CACrC;cACN,cAAQ,KAAK,EAAC,mCAAmC,EAAC,SAAS,EAAE,MAAM,EAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,GACjC,CACL,CAAC,CAAC,CAAC,EAAE;YACX,UAAI,KAAK,EAAC,2BAA2B,IAClC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACpE,CACD,CACF,CACF,CACD,CACR,CAAC;EACJ,CAAC;EAED,gBAAgB;;IACd,2DAA2D;IAC3D,MAAA,QAAQ,CAAC,gBAAgB,0CAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;EACzE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Host, h, State, Element, Prop} from '@stencil/core';\n// Icons\nimport ArrowDown from \"../../assets/svg/keyboard_arrow_down.svg\"\nimport BellRing from \"../../assets/svg/bell-ring.svg\"\nimport OrderIcon from \"../../assets/svg/box-bankers.svg\"\nimport PendingOrdersIcon from \"../../assets/svg/cart.svg\"\nimport WishListIcon from \"../../assets/svg/star.svg\"\nimport ProfileIcon from \"../../assets/svg/user-circle.svg\"\nimport LogoutIcon from \"../../assets/svg/send-out.svg\"\nimport Cancel from \"../../assets/svg/cancel.svg\"\nimport Rate from \"../../assets/svg/star2.svg\";\nimport UserCircle from \"../../assets/svg/user-circle.svg\";\n\n/**\n * @slot trigger - Replaces trigger widget, has replaceable props `{avatar}`, `{hello}`, `{first_name}`, `{last_name}`, `{icon}`.\n * @slot login-btn - Replaces the login button, it must be used with `salla.event.dispatch('login::open')` to open the login modal.\n */\n@Component({\n tag: 'salla-user-menu',\n styleUrl: 'salla-user-menu.scss',\n})\nexport class SallaUserMenu {\n constructor() {\n\n // salla.auth.event.onLoggedIn(() => {\n // this.is_loggedIn = true\n // })\n\n salla.lang.onLoaded(() => {\n this.notifications = salla.lang.get(\"common.titles.notifications\");\n this.orders = salla.lang.get(\"common.titles.orders\");\n this.pending_orders = salla.lang.get(\"common.titles.pending_orders\");\n this.wishlist = salla.lang.get(\"common.titles.wishlist\");\n this.profile = salla.lang.get(\"common.titles.profile\");\n this.hello = salla.lang.get(\"pages.checkout.hello\");\n this.rating = salla.lang.get(\"common.titles.rating\");\n this.logout = salla.lang.get(\"blocks.header.logout\");\n });\n\n //we need it only in theme-y\n if (this.host.hasAttribute('with-rating')) {\n this.items.rating = Rate;\n }\n //we need it to be the last item\n this.items.logout = LogoutIcon;\n\n this.triggerSlot = this.host.querySelector('[slot=\"trigger\"]')?.innerHTML || '<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>';\n salla.onReady(() => {\n if (salla.config.isGuest()) {\n return;\n }\n\n this.is_loggedIn = true;\n /**\n * Get Fresh Notifications In These Cases:\n * - is notification page, if user already changed the status of his orders (to reset notification badge)\n * - is pending orders page, if user already changed the status of his orders (to reset orders badge)\n * - is profile page, in case user changed his name or avatar, we need to update it\n * - half hour is passed from the last user data fetched\n *\n * //todo:: update the data in the storage in customer pages\n * //todo:: cover two requests in customer pages\n * //todo:: make sure to run this only after token is set\n */\n if (salla.url.is_page('customer.notifications')\n || salla.url.is_page('customer.orders.index.pending')\n || salla.url.is_page('customer.profile')\n || ((Date.now() - (salla.storage.get('user.fetched_at') || 0)) / 1000 / 60) > 30) {\n this.fetchFreshProfile();\n }\n });\n }\n\n private items: any = {\n notifications: BellRing,\n orders: OrderIcon,\n pending_orders: PendingOrdersIcon,\n wishlist: WishListIcon,\n profile: ProfileIcon,\n };\n\n @Element() host: HTMLElement;\n private readonly triggerSlot: string;\n @State() accountLoading: boolean = false;\n @State() opened: boolean = false;\n @State() notifications: string = salla.lang.get(\"common.titles.notifications\");\n @State() orders: string = salla.lang.get(\"common.titles.orders\");\n @State() pending_orders: string = salla.lang.get(\"common.titles.pending_orders\");\n @State() wishlist: string = salla.lang.get(\"common.titles.wishlist\");\n @State() profile: string = salla.lang.get(\"common.titles.profile\");\n @State() rating: string = salla.lang.get(\"common.titles.rating\");\n @State() logout: string = salla.lang.get(\"blocks.header.logout\");\n @State() hello: string = salla.lang.get(\"pages.checkout.hello\");\n @State() first_name: string = salla.storage.get('user.first_name') || '';\n @State() last_name: string = salla.storage.get('user.last_name') || '';\n @State() avatar: string = salla.storage.get('user.avatar') || salla.url.cdn('images/avatar.png');\n @State() is_loggedIn: boolean;\n @State() badges: any = {\n notifications: salla.helpers.number(salla.storage.get('user.notifications') || 0),\n pending_orders: salla.helpers.number(salla.storage.get('user.pending_orders') || 0)\n };\n\n @State() hasBadges: boolean = Number(salla.storage.get('user.pending_orders')) > 0 || Number(salla.storage.get('user.notifications')) > 0;\n /**\n * To display only the list without the dropdown functionality\n */\n @Prop({reflect: true}) inline: boolean = false;\n\n /**\n * To display the trigger as an avatar only\n */\n @Prop({reflect: true}) avatarOnly: boolean = false;\n\n /**\n * To display the dropdown header in mobile sheet\n */\n @Prop({reflect: true}) showHeader: boolean = false;\n\n /**\n * To Make the dropdown menu relative to parent element or not\n */\n @Prop({reflect: true}) relativeDropdown: boolean = false;\n\n private onClickOutside = () => {\n this.opened = false;\n }\n\n @State() OrderUpdate: number = 0;\n\n private fetchFreshProfile() {\n //don't request fetchFreshProfile unless token is injected into the api\n if (!salla.api.token) {\n salla.log('trying to fetchFreshProfile before injected the token!!');\n return;\n }\n salla.profile.api.info()\n .then((res) => {\n this.badges.pending_orders = salla.helpers.number(res.data.pending_orders || 0);\n this.badges.notifications = salla.helpers.number(res.data.notifications || 0);\n this.hasBadges = Number(res.data.pending_orders) > 0 || Number(res.data.notifications) > 0;\n this.first_name = res.data.first_name;\n this.last_name = res.data.last_name;\n this.avatar = res.data.avatar || salla.url.cdn('images/avatar.png');\n });\n }\n\n async open(e) {\n this.opened = !this.opened;\n e.stopPropagation()\n if (this.opened) {\n window.addEventListener('click', this.onClickOutside);\n }\n }\n\n private menuItemClicked(event: Event, item: string[]) {\n if (item[0] !== 'logout') {\n return;\n }\n event.preventDefault();\n salla.auth.logout('sall-user-menu');\n }\n\n private getTheHeader() {\n return <div class={{\n 's-user-menu-trigger-slot': true,\n 's-user-menu-red-dot': this.hasBadges,\n 's-user-menu-trigger-avatar-only': this.avatarOnly\n }}\n id='trigger-slot' onClick={(e) => this.open(e)} innerHTML={this.triggerSlot\n .replace(/\\{hello\\}/g, this.hello)\n .replace(/\\{first_name\\}/g, this.first_name)\n .replace(/\\{last_name\\}/g, this.last_name)\n .replace(/\\{avatar\\}/g, this.avatar)\n .replace(/\\{icon\\}/g, ArrowDown)}>\n </div>;\n }\n\n private getMenuItem(item: any[], i: number) {\n //todo:: enhancement support slot here\n return <li class={{\n 's-user-menu-dropdown-item': true,\n 's-user-menu-dropdown-item-logout': i + 1 == Object.entries(this.items).length\n }}>\n <a href={salla.url.get(item[0])} onClick={event => this.menuItemClicked(event, item)}>\n <i innerHTML={item[1]}> </i>\n <span class=\"s-user-menu-dropdown-item-title\">{this[item[0]]}</span>\n {!['٠', '0', undefined].includes(this.badges[item[0]])\n ? <span class=\"s-user-menu-dropdown-item-badge\">{this.badges[item[0]]}</span>\n : \"\"}\n </a>\n </li>;\n }\n\n componentShouldUpdate() {\n if (!this.opened) {\n window.removeEventListener('click', this.onClickOutside);\n }\n }\n\n render() {\n if (!this.is_loggedIn) {\n return <Host>\n <slot name='login-btn'>\n <button class=\"s-user-menu-login-btn\" onClick={() => salla.event.dispatch('login::open')}\n innerHTML={UserCircle}>\n </button>\n </slot>\n </Host>\n }\n\n if (this.inline) {\n return <Host>\n <ul class=\"s-user-menu-inline\">\n {Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))}\n </ul>\n </Host>\n }\n\n return (\n <Host>\n <div class={{'s-user-menu-wrapper': true, 's-user-menu-relative-dropdown': this.relativeDropdown}}>\n {this.getTheHeader()}\n <div class={{'s-user-menu-toggler': true, 'opened': this.opened}}>\n <div class=\"s-user-menu-dropdown\" onClick={(e) => e.stopPropagation()}>\n {this.showHeader ? <div class=\"s-user-menu-dropdown-header\">\n <img src={this.avatar} alt={`${this.first_name} ${this.last_name}`}/>\n <div class=\"s-user-menu-dropdown-header-content\">\n <span>{this.hello}</span>\n <p>{this.first_name} {this.last_name}</p>\n </div>\n <button class=\"s-user-menu-dropdown-header-close\" innerHTML={Cancel}\n onClick={() => this.opened = false}>\n </button>\n </div> : ''}\n <ul class=\"s-user-menu-dropdown-list\">\n {Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))}\n </ul>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n //make sure to load the avatar if it's lazy, we use it in Y\n document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));\n }\n}\n"]}
|