pb-sxp-ui 1.9.0 → 1.9.2

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.
Files changed (66) hide show
  1. package/dist/index.cjs +1005 -241
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +72 -4
  4. package/dist/index.js +1005 -241
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +1005 -241
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/ExpandableText.js +1 -1
  15. package/es/core/components/SxpPageRender/Hashtag/index.js +2 -2
  16. package/es/core/components/SxpPageRender/Modal/index.js +45 -7
  17. package/es/core/components/SxpPageRender/PictureGroup/index.js +51 -25
  18. package/es/core/components/SxpPageRender/index.js +3 -3
  19. package/es/core/hooks/useFocusTrap.d.ts +2 -0
  20. package/es/core/hooks/useFocusTrap.js +37 -0
  21. package/es/core/utils/tool.d.ts +2 -1
  22. package/es/core/utils/tool.js +12 -1
  23. package/es/index.d.ts +1 -0
  24. package/es/index.js +1 -0
  25. package/es/materials/sxp/cta/AniLinkPopup/index.js +5 -5
  26. package/es/materials/sxp/popup/CommodityDetail/index.js +38 -14
  27. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +37 -13
  28. package/es/materials/sxp/popup/CommodityList/index.js +32 -28
  29. package/es/materials/sxp/template/Appoint/index.js +1 -1
  30. package/es/materials/sxp/template/Commodity/index.js +4 -4
  31. package/es/materials/sxp/template/CommodityDiro/index.js +4 -4
  32. package/es/materials/sxp/template/CommodityDiroNew/index.js +4 -4
  33. package/es/materials/sxp/template/Link/index.js +1 -1
  34. package/es/materials/sxp/template/MultiCommodity/index.js +23 -42
  35. package/es/materials/sxp/template/MultiCommodityDiro/index.js +24 -42
  36. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +25 -44
  37. package/es/materials/sxp/template/components/EventProvider.d.ts +2 -0
  38. package/es/materials/sxp/template/components/EventProvider.js +22 -11
  39. package/es/materials/sxp/template/components/Scroll.js +1 -1
  40. package/lib/core/components/SxpPageRender/ExpandableText.js +1 -1
  41. package/lib/core/components/SxpPageRender/Hashtag/index.js +2 -2
  42. package/lib/core/components/SxpPageRender/Modal/index.js +45 -7
  43. package/lib/core/components/SxpPageRender/PictureGroup/index.js +49 -23
  44. package/lib/core/components/SxpPageRender/index.js +3 -3
  45. package/lib/core/hooks/useFocusTrap.d.ts +2 -0
  46. package/lib/core/hooks/useFocusTrap.js +39 -0
  47. package/lib/core/utils/tool.d.ts +2 -1
  48. package/lib/core/utils/tool.js +13 -1
  49. package/lib/index.d.ts +1 -0
  50. package/lib/index.js +1 -0
  51. package/lib/materials/sxp/cta/AniLinkPopup/index.js +5 -5
  52. package/lib/materials/sxp/popup/CommodityDetail/index.js +36 -12
  53. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +35 -11
  54. package/lib/materials/sxp/popup/CommodityList/index.js +32 -28
  55. package/lib/materials/sxp/template/Appoint/index.js +1 -1
  56. package/lib/materials/sxp/template/Commodity/index.js +4 -4
  57. package/lib/materials/sxp/template/CommodityDiro/index.js +4 -4
  58. package/lib/materials/sxp/template/CommodityDiroNew/index.js +4 -4
  59. package/lib/materials/sxp/template/Link/index.js +1 -1
  60. package/lib/materials/sxp/template/MultiCommodity/index.js +22 -41
  61. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +23 -41
  62. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +24 -43
  63. package/lib/materials/sxp/template/components/EventProvider.d.ts +2 -0
  64. package/lib/materials/sxp/template/components/EventProvider.js +21 -10
  65. package/lib/materials/sxp/template/components/Scroll.js +1 -1
  66. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -298,6 +298,17 @@ function getCookie(val) {
298
298
  });
299
299
  return value !== null && value !== void 0 ? value : '';
300
300
  }
301
+ function getScreenReader() {
302
+ let userAgent = self.navigator.userAgent;
303
+ if (!userAgent)
304
+ return false;
305
+ return (/TalkBack/i.test(userAgent) ||
306
+ /Funtouch/i.test(userAgent) ||
307
+ /VoiceOver/i.test(userAgent) ||
308
+ /NVDA/i.test(userAgent) ||
309
+ /JAWS/i.test(userAgent) ||
310
+ /ChromeVox/i.test(userAgent));
311
+ }
301
312
 
302
313
  function unzip(b64Data) {
303
314
  const strData = atob(b64Data);
@@ -2579,6 +2590,119 @@ function makeElementsArray(el) {
2579
2590
  return (Array.isArray(el) ? el : [el]).filter(e => !!e);
2580
2591
  }
2581
2592
 
2593
+ /* eslint-disable consistent-return */
2594
+ function Keyboard(_ref) {
2595
+ let {
2596
+ swiper,
2597
+ extendParams,
2598
+ on,
2599
+ emit
2600
+ } = _ref;
2601
+ const document = getDocument();
2602
+ const window = getWindow();
2603
+ swiper.keyboard = {
2604
+ enabled: false
2605
+ };
2606
+ extendParams({
2607
+ keyboard: {
2608
+ enabled: false,
2609
+ onlyInViewport: true,
2610
+ pageUpDown: true
2611
+ }
2612
+ });
2613
+ function handle(event) {
2614
+ if (!swiper.enabled) return;
2615
+ const {
2616
+ rtlTranslate: rtl
2617
+ } = swiper;
2618
+ let e = event;
2619
+ if (e.originalEvent) e = e.originalEvent; // jquery fix
2620
+ const kc = e.keyCode || e.charCode;
2621
+ const pageUpDown = swiper.params.keyboard.pageUpDown;
2622
+ const isPageUp = pageUpDown && kc === 33;
2623
+ const isPageDown = pageUpDown && kc === 34;
2624
+ const isArrowLeft = kc === 37;
2625
+ const isArrowRight = kc === 39;
2626
+ const isArrowUp = kc === 38;
2627
+ const isArrowDown = kc === 40;
2628
+ // Directions locks
2629
+ if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) {
2630
+ return false;
2631
+ }
2632
+ if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) {
2633
+ return false;
2634
+ }
2635
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
2636
+ return undefined;
2637
+ }
2638
+ if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
2639
+ return undefined;
2640
+ }
2641
+ if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
2642
+ let inView = false;
2643
+ // Check that swiper should be inside of visible area of window
2644
+ if (elementParents(swiper.el, `.${swiper.params.slideClass}, swiper-slide`).length > 0 && elementParents(swiper.el, `.${swiper.params.slideActiveClass}`).length === 0) {
2645
+ return undefined;
2646
+ }
2647
+ const el = swiper.el;
2648
+ const swiperWidth = el.clientWidth;
2649
+ const swiperHeight = el.clientHeight;
2650
+ const windowWidth = window.innerWidth;
2651
+ const windowHeight = window.innerHeight;
2652
+ const swiperOffset = elementOffset(el);
2653
+ if (rtl) swiperOffset.left -= el.scrollLeft;
2654
+ const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]];
2655
+ for (let i = 0; i < swiperCoord.length; i += 1) {
2656
+ const point = swiperCoord[i];
2657
+ if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {
2658
+ if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line
2659
+ inView = true;
2660
+ }
2661
+ }
2662
+ if (!inView) return undefined;
2663
+ }
2664
+ if (swiper.isHorizontal()) {
2665
+ if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
2666
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
2667
+ }
2668
+ if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
2669
+ if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
2670
+ } else {
2671
+ if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
2672
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
2673
+ }
2674
+ if (isPageDown || isArrowDown) swiper.slideNext();
2675
+ if (isPageUp || isArrowUp) swiper.slidePrev();
2676
+ }
2677
+ emit('keyPress', kc);
2678
+ return undefined;
2679
+ }
2680
+ function enable() {
2681
+ if (swiper.keyboard.enabled) return;
2682
+ document.addEventListener('keydown', handle);
2683
+ swiper.keyboard.enabled = true;
2684
+ }
2685
+ function disable() {
2686
+ if (!swiper.keyboard.enabled) return;
2687
+ document.removeEventListener('keydown', handle);
2688
+ swiper.keyboard.enabled = false;
2689
+ }
2690
+ on('init', () => {
2691
+ if (swiper.params.keyboard.enabled) {
2692
+ enable();
2693
+ }
2694
+ });
2695
+ on('destroy', () => {
2696
+ if (swiper.keyboard.enabled) {
2697
+ disable();
2698
+ }
2699
+ });
2700
+ Object.assign(swiper.keyboard, {
2701
+ enable,
2702
+ disable
2703
+ });
2704
+ }
2705
+
2582
2706
  /* eslint-disable consistent-return */
2583
2707
  function Mousewheel(_ref) {
2584
2708
  let {
@@ -2986,6 +3110,202 @@ function createElementIfNotDefined(swiper, originalParams, params, checkProps) {
2986
3110
  return params;
2987
3111
  }
2988
3112
 
3113
+ function Navigation(_ref) {
3114
+ let {
3115
+ swiper,
3116
+ extendParams,
3117
+ on,
3118
+ emit
3119
+ } = _ref;
3120
+ extendParams({
3121
+ navigation: {
3122
+ nextEl: null,
3123
+ prevEl: null,
3124
+ hideOnClick: false,
3125
+ disabledClass: 'swiper-button-disabled',
3126
+ hiddenClass: 'swiper-button-hidden',
3127
+ lockClass: 'swiper-button-lock',
3128
+ navigationDisabledClass: 'swiper-navigation-disabled'
3129
+ }
3130
+ });
3131
+ swiper.navigation = {
3132
+ nextEl: null,
3133
+ prevEl: null
3134
+ };
3135
+ function getEl(el) {
3136
+ let res;
3137
+ if (el && typeof el === 'string' && swiper.isElement) {
3138
+ res = swiper.el.querySelector(el);
3139
+ if (res) return res;
3140
+ }
3141
+ if (el) {
3142
+ if (typeof el === 'string') res = [...document.querySelectorAll(el)];
3143
+ if (swiper.params.uniqueNavElements && typeof el === 'string' && res && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
3144
+ res = swiper.el.querySelector(el);
3145
+ } else if (res && res.length === 1) {
3146
+ res = res[0];
3147
+ }
3148
+ }
3149
+ if (el && !res) return el;
3150
+ // if (Array.isArray(res) && res.length === 1) res = res[0];
3151
+ return res;
3152
+ }
3153
+ function toggleEl(el, disabled) {
3154
+ const params = swiper.params.navigation;
3155
+ el = makeElementsArray(el);
3156
+ el.forEach(subEl => {
3157
+ if (subEl) {
3158
+ subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));
3159
+ if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;
3160
+ if (swiper.params.watchOverflow && swiper.enabled) {
3161
+ subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
3162
+ }
3163
+ }
3164
+ });
3165
+ }
3166
+ function update() {
3167
+ // Update Navigation Buttons
3168
+ const {
3169
+ nextEl,
3170
+ prevEl
3171
+ } = swiper.navigation;
3172
+ if (swiper.params.loop) {
3173
+ toggleEl(prevEl, false);
3174
+ toggleEl(nextEl, false);
3175
+ return;
3176
+ }
3177
+ toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);
3178
+ toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);
3179
+ }
3180
+ function onPrevClick(e) {
3181
+ e.preventDefault();
3182
+ if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
3183
+ swiper.slidePrev();
3184
+ emit('navigationPrev');
3185
+ }
3186
+ function onNextClick(e) {
3187
+ e.preventDefault();
3188
+ if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
3189
+ swiper.slideNext();
3190
+ emit('navigationNext');
3191
+ }
3192
+ function init() {
3193
+ const params = swiper.params.navigation;
3194
+ swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
3195
+ nextEl: 'swiper-button-next',
3196
+ prevEl: 'swiper-button-prev'
3197
+ });
3198
+ if (!(params.nextEl || params.prevEl)) return;
3199
+ let nextEl = getEl(params.nextEl);
3200
+ let prevEl = getEl(params.prevEl);
3201
+ Object.assign(swiper.navigation, {
3202
+ nextEl,
3203
+ prevEl
3204
+ });
3205
+ nextEl = makeElementsArray(nextEl);
3206
+ prevEl = makeElementsArray(prevEl);
3207
+ const initButton = (el, dir) => {
3208
+ if (el) {
3209
+ el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
3210
+ }
3211
+ if (!swiper.enabled && el) {
3212
+ el.classList.add(...params.lockClass.split(' '));
3213
+ }
3214
+ };
3215
+ nextEl.forEach(el => initButton(el, 'next'));
3216
+ prevEl.forEach(el => initButton(el, 'prev'));
3217
+ }
3218
+ function destroy() {
3219
+ let {
3220
+ nextEl,
3221
+ prevEl
3222
+ } = swiper.navigation;
3223
+ nextEl = makeElementsArray(nextEl);
3224
+ prevEl = makeElementsArray(prevEl);
3225
+ const destroyButton = (el, dir) => {
3226
+ el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
3227
+ el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));
3228
+ };
3229
+ nextEl.forEach(el => destroyButton(el, 'next'));
3230
+ prevEl.forEach(el => destroyButton(el, 'prev'));
3231
+ }
3232
+ on('init', () => {
3233
+ if (swiper.params.navigation.enabled === false) {
3234
+ // eslint-disable-next-line
3235
+ disable();
3236
+ } else {
3237
+ init();
3238
+ update();
3239
+ }
3240
+ });
3241
+ on('toEdge fromEdge lock unlock', () => {
3242
+ update();
3243
+ });
3244
+ on('destroy', () => {
3245
+ destroy();
3246
+ });
3247
+ on('enable disable', () => {
3248
+ let {
3249
+ nextEl,
3250
+ prevEl
3251
+ } = swiper.navigation;
3252
+ nextEl = makeElementsArray(nextEl);
3253
+ prevEl = makeElementsArray(prevEl);
3254
+ if (swiper.enabled) {
3255
+ update();
3256
+ return;
3257
+ }
3258
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.add(swiper.params.navigation.lockClass));
3259
+ });
3260
+ on('click', (_s, e) => {
3261
+ let {
3262
+ nextEl,
3263
+ prevEl
3264
+ } = swiper.navigation;
3265
+ nextEl = makeElementsArray(nextEl);
3266
+ prevEl = makeElementsArray(prevEl);
3267
+ const targetEl = e.target;
3268
+ let targetIsButton = prevEl.includes(targetEl) || nextEl.includes(targetEl);
3269
+ if (swiper.isElement && !targetIsButton) {
3270
+ const path = e.path || e.composedPath && e.composedPath();
3271
+ if (path) {
3272
+ targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl));
3273
+ }
3274
+ }
3275
+ if (swiper.params.navigation.hideOnClick && !targetIsButton) {
3276
+ if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
3277
+ let isHidden;
3278
+ if (nextEl.length) {
3279
+ isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);
3280
+ } else if (prevEl.length) {
3281
+ isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);
3282
+ }
3283
+ if (isHidden === true) {
3284
+ emit('navigationShow');
3285
+ } else {
3286
+ emit('navigationHide');
3287
+ }
3288
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));
3289
+ }
3290
+ });
3291
+ const enable = () => {
3292
+ swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));
3293
+ init();
3294
+ update();
3295
+ };
3296
+ const disable = () => {
3297
+ swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));
3298
+ destroy();
3299
+ };
3300
+ Object.assign(swiper.navigation, {
3301
+ enable,
3302
+ disable,
3303
+ update,
3304
+ init,
3305
+ destroy
3306
+ });
3307
+ }
3308
+
2989
3309
  function classesToSelector(classes) {
2990
3310
  if (classes === void 0) {
2991
3311
  classes = '';
@@ -3792,6 +4112,374 @@ function Scrollbar(_ref) {
3792
4112
  });
3793
4113
  }
3794
4114
 
4115
+ function A11y(_ref) {
4116
+ let {
4117
+ swiper,
4118
+ extendParams,
4119
+ on
4120
+ } = _ref;
4121
+ extendParams({
4122
+ a11y: {
4123
+ enabled: true,
4124
+ notificationClass: 'swiper-notification',
4125
+ prevSlideMessage: 'Previous slide',
4126
+ nextSlideMessage: 'Next slide',
4127
+ firstSlideMessage: 'This is the first slide',
4128
+ lastSlideMessage: 'This is the last slide',
4129
+ paginationBulletMessage: 'Go to slide {{index}}',
4130
+ slideLabelMessage: '{{index}} / {{slidesLength}}',
4131
+ containerMessage: null,
4132
+ containerRoleDescriptionMessage: null,
4133
+ itemRoleDescriptionMessage: null,
4134
+ slideRole: 'group',
4135
+ id: null
4136
+ }
4137
+ });
4138
+ swiper.a11y = {
4139
+ clicked: false
4140
+ };
4141
+ let liveRegion = null;
4142
+ let preventFocusHandler;
4143
+ let focusTargetSlideEl;
4144
+ let visibilityChangedTimestamp = new Date().getTime();
4145
+ function notify(message) {
4146
+ const notification = liveRegion;
4147
+ if (notification.length === 0) return;
4148
+ notification.innerHTML = '';
4149
+ notification.innerHTML = message;
4150
+ }
4151
+ function getRandomNumber(size) {
4152
+ if (size === void 0) {
4153
+ size = 16;
4154
+ }
4155
+ const randomChar = () => Math.round(16 * Math.random()).toString(16);
4156
+ return 'x'.repeat(size).replace(/x/g, randomChar);
4157
+ }
4158
+ function makeElFocusable(el) {
4159
+ el = makeElementsArray(el);
4160
+ el.forEach(subEl => {
4161
+ subEl.setAttribute('tabIndex', '0');
4162
+ });
4163
+ }
4164
+ function makeElNotFocusable(el) {
4165
+ el = makeElementsArray(el);
4166
+ el.forEach(subEl => {
4167
+ subEl.setAttribute('tabIndex', '-1');
4168
+ });
4169
+ }
4170
+ function addElRole(el, role) {
4171
+ el = makeElementsArray(el);
4172
+ el.forEach(subEl => {
4173
+ subEl.setAttribute('role', role);
4174
+ });
4175
+ }
4176
+ function addElRoleDescription(el, description) {
4177
+ el = makeElementsArray(el);
4178
+ el.forEach(subEl => {
4179
+ subEl.setAttribute('aria-roledescription', description);
4180
+ });
4181
+ }
4182
+ function addElControls(el, controls) {
4183
+ el = makeElementsArray(el);
4184
+ el.forEach(subEl => {
4185
+ subEl.setAttribute('aria-controls', controls);
4186
+ });
4187
+ }
4188
+ function addElLabel(el, label) {
4189
+ el = makeElementsArray(el);
4190
+ el.forEach(subEl => {
4191
+ subEl.setAttribute('aria-label', label);
4192
+ });
4193
+ }
4194
+ function addElId(el, id) {
4195
+ el = makeElementsArray(el);
4196
+ el.forEach(subEl => {
4197
+ subEl.setAttribute('id', id);
4198
+ });
4199
+ }
4200
+ function addElLive(el, live) {
4201
+ el = makeElementsArray(el);
4202
+ el.forEach(subEl => {
4203
+ subEl.setAttribute('aria-live', live);
4204
+ });
4205
+ }
4206
+ function disableEl(el) {
4207
+ el = makeElementsArray(el);
4208
+ el.forEach(subEl => {
4209
+ subEl.setAttribute('aria-disabled', true);
4210
+ });
4211
+ }
4212
+ function enableEl(el) {
4213
+ el = makeElementsArray(el);
4214
+ el.forEach(subEl => {
4215
+ subEl.setAttribute('aria-disabled', false);
4216
+ });
4217
+ }
4218
+ function onEnterOrSpaceKey(e) {
4219
+ if (e.keyCode !== 13 && e.keyCode !== 32) return;
4220
+ const params = swiper.params.a11y;
4221
+ const targetEl = e.target;
4222
+ if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
4223
+ if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
4224
+ }
4225
+ if (swiper.navigation && swiper.navigation.prevEl && swiper.navigation.nextEl) {
4226
+ const prevEls = makeElementsArray(swiper.navigation.prevEl);
4227
+ const nextEls = makeElementsArray(swiper.navigation.nextEl);
4228
+ if (nextEls.includes(targetEl)) {
4229
+ if (!(swiper.isEnd && !swiper.params.loop)) {
4230
+ swiper.slideNext();
4231
+ }
4232
+ if (swiper.isEnd) {
4233
+ notify(params.lastSlideMessage);
4234
+ } else {
4235
+ notify(params.nextSlideMessage);
4236
+ }
4237
+ }
4238
+ if (prevEls.includes(targetEl)) {
4239
+ if (!(swiper.isBeginning && !swiper.params.loop)) {
4240
+ swiper.slidePrev();
4241
+ }
4242
+ if (swiper.isBeginning) {
4243
+ notify(params.firstSlideMessage);
4244
+ } else {
4245
+ notify(params.prevSlideMessage);
4246
+ }
4247
+ }
4248
+ }
4249
+ if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
4250
+ targetEl.click();
4251
+ }
4252
+ }
4253
+ function updateNavigation() {
4254
+ if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;
4255
+ const {
4256
+ nextEl,
4257
+ prevEl
4258
+ } = swiper.navigation;
4259
+ if (prevEl) {
4260
+ if (swiper.isBeginning) {
4261
+ disableEl(prevEl);
4262
+ makeElNotFocusable(prevEl);
4263
+ } else {
4264
+ enableEl(prevEl);
4265
+ makeElFocusable(prevEl);
4266
+ }
4267
+ }
4268
+ if (nextEl) {
4269
+ if (swiper.isEnd) {
4270
+ disableEl(nextEl);
4271
+ makeElNotFocusable(nextEl);
4272
+ } else {
4273
+ enableEl(nextEl);
4274
+ makeElFocusable(nextEl);
4275
+ }
4276
+ }
4277
+ }
4278
+ function hasPagination() {
4279
+ return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;
4280
+ }
4281
+ function hasClickablePagination() {
4282
+ return hasPagination() && swiper.params.pagination.clickable;
4283
+ }
4284
+ function updatePagination() {
4285
+ const params = swiper.params.a11y;
4286
+ if (!hasPagination()) return;
4287
+ swiper.pagination.bullets.forEach(bulletEl => {
4288
+ if (swiper.params.pagination.clickable) {
4289
+ makeElFocusable(bulletEl);
4290
+ if (!swiper.params.pagination.renderBullet) {
4291
+ addElRole(bulletEl, 'button');
4292
+ addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, elementIndex(bulletEl) + 1));
4293
+ }
4294
+ }
4295
+ if (bulletEl.matches(classesToSelector(swiper.params.pagination.bulletActiveClass))) {
4296
+ bulletEl.setAttribute('aria-current', 'true');
4297
+ } else {
4298
+ bulletEl.removeAttribute('aria-current');
4299
+ }
4300
+ });
4301
+ }
4302
+ const initNavEl = (el, wrapperId, message) => {
4303
+ makeElFocusable(el);
4304
+ if (el.tagName !== 'BUTTON') {
4305
+ addElRole(el, 'button');
4306
+ el.addEventListener('keydown', onEnterOrSpaceKey);
4307
+ }
4308
+ addElLabel(el, message);
4309
+ addElControls(el, wrapperId);
4310
+ };
4311
+ const handlePointerDown = e => {
4312
+ if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) {
4313
+ preventFocusHandler = true;
4314
+ }
4315
+ swiper.a11y.clicked = true;
4316
+ };
4317
+ const handlePointerUp = () => {
4318
+ preventFocusHandler = false;
4319
+ requestAnimationFrame(() => {
4320
+ requestAnimationFrame(() => {
4321
+ if (!swiper.destroyed) {
4322
+ swiper.a11y.clicked = false;
4323
+ }
4324
+ });
4325
+ });
4326
+ };
4327
+ const onVisibilityChange = e => {
4328
+ visibilityChangedTimestamp = new Date().getTime();
4329
+ };
4330
+ const handleFocus = e => {
4331
+ if (swiper.a11y.clicked) return;
4332
+ if (new Date().getTime() - visibilityChangedTimestamp < 100) return;
4333
+ const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
4334
+ if (!slideEl || !swiper.slides.includes(slideEl)) return;
4335
+ focusTargetSlideEl = slideEl;
4336
+ const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
4337
+ const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
4338
+ if (isActive || isVisible) return;
4339
+ if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return;
4340
+ if (swiper.isHorizontal()) {
4341
+ swiper.el.scrollLeft = 0;
4342
+ } else {
4343
+ swiper.el.scrollTop = 0;
4344
+ }
4345
+ requestAnimationFrame(() => {
4346
+ if (preventFocusHandler) return;
4347
+ if (swiper.params.loop) {
4348
+ swiper.slideToLoop(parseInt(slideEl.getAttribute('data-swiper-slide-index')), 0);
4349
+ } else {
4350
+ swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
4351
+ }
4352
+ preventFocusHandler = false;
4353
+ });
4354
+ };
4355
+ const initSlides = () => {
4356
+ const params = swiper.params.a11y;
4357
+ if (params.itemRoleDescriptionMessage) {
4358
+ addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage);
4359
+ }
4360
+ if (params.slideRole) {
4361
+ addElRole(swiper.slides, params.slideRole);
4362
+ }
4363
+ const slidesLength = swiper.slides.length;
4364
+ if (params.slideLabelMessage) {
4365
+ swiper.slides.forEach((slideEl, index) => {
4366
+ const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index;
4367
+ const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength);
4368
+ addElLabel(slideEl, ariaLabelMessage);
4369
+ });
4370
+ }
4371
+ };
4372
+ const init = () => {
4373
+ const params = swiper.params.a11y;
4374
+ swiper.el.append(liveRegion);
4375
+
4376
+ // Container
4377
+ const containerEl = swiper.el;
4378
+ if (params.containerRoleDescriptionMessage) {
4379
+ addElRoleDescription(containerEl, params.containerRoleDescriptionMessage);
4380
+ }
4381
+ if (params.containerMessage) {
4382
+ addElLabel(containerEl, params.containerMessage);
4383
+ }
4384
+
4385
+ // Wrapper
4386
+ const wrapperEl = swiper.wrapperEl;
4387
+ const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`;
4388
+ const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';
4389
+ addElId(wrapperEl, wrapperId);
4390
+ addElLive(wrapperEl, live);
4391
+
4392
+ // Slide
4393
+ initSlides();
4394
+
4395
+ // Navigation
4396
+ let {
4397
+ nextEl,
4398
+ prevEl
4399
+ } = swiper.navigation ? swiper.navigation : {};
4400
+ nextEl = makeElementsArray(nextEl);
4401
+ prevEl = makeElementsArray(prevEl);
4402
+ if (nextEl) {
4403
+ nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage));
4404
+ }
4405
+ if (prevEl) {
4406
+ prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage));
4407
+ }
4408
+
4409
+ // Pagination
4410
+ if (hasClickablePagination()) {
4411
+ const paginationEl = makeElementsArray(swiper.pagination.el);
4412
+ paginationEl.forEach(el => {
4413
+ el.addEventListener('keydown', onEnterOrSpaceKey);
4414
+ });
4415
+ }
4416
+
4417
+ // Tab focus
4418
+ const document = getDocument();
4419
+ document.addEventListener('visibilitychange', onVisibilityChange);
4420
+ swiper.el.addEventListener('focus', handleFocus, true);
4421
+ swiper.el.addEventListener('focus', handleFocus, true);
4422
+ swiper.el.addEventListener('pointerdown', handlePointerDown, true);
4423
+ swiper.el.addEventListener('pointerup', handlePointerUp, true);
4424
+ };
4425
+ function destroy() {
4426
+ if (liveRegion) liveRegion.remove();
4427
+ let {
4428
+ nextEl,
4429
+ prevEl
4430
+ } = swiper.navigation ? swiper.navigation : {};
4431
+ nextEl = makeElementsArray(nextEl);
4432
+ prevEl = makeElementsArray(prevEl);
4433
+ if (nextEl) {
4434
+ nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
4435
+ }
4436
+ if (prevEl) {
4437
+ prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
4438
+ }
4439
+
4440
+ // Pagination
4441
+ if (hasClickablePagination()) {
4442
+ const paginationEl = makeElementsArray(swiper.pagination.el);
4443
+ paginationEl.forEach(el => {
4444
+ el.removeEventListener('keydown', onEnterOrSpaceKey);
4445
+ });
4446
+ }
4447
+ const document = getDocument();
4448
+ document.removeEventListener('visibilitychange', onVisibilityChange);
4449
+ // Tab focus
4450
+ if (swiper.el && typeof swiper.el !== 'string') {
4451
+ swiper.el.removeEventListener('focus', handleFocus, true);
4452
+ swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
4453
+ swiper.el.removeEventListener('pointerup', handlePointerUp, true);
4454
+ }
4455
+ }
4456
+ on('beforeInit', () => {
4457
+ liveRegion = createElement('span', swiper.params.a11y.notificationClass);
4458
+ liveRegion.setAttribute('aria-live', 'assertive');
4459
+ liveRegion.setAttribute('aria-atomic', 'true');
4460
+ });
4461
+ on('afterInit', () => {
4462
+ if (!swiper.params.a11y.enabled) return;
4463
+ init();
4464
+ });
4465
+ on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => {
4466
+ if (!swiper.params.a11y.enabled) return;
4467
+ initSlides();
4468
+ });
4469
+ on('fromEdge toEdge afterInit lock unlock', () => {
4470
+ if (!swiper.params.a11y.enabled) return;
4471
+ updateNavigation();
4472
+ });
4473
+ on('paginationUpdate', () => {
4474
+ if (!swiper.params.a11y.enabled) return;
4475
+ updatePagination();
4476
+ });
4477
+ on('destroy', () => {
4478
+ if (!swiper.params.a11y.enabled) return;
4479
+ destroy();
4480
+ });
4481
+ }
4482
+
3795
4483
  /* eslint no-underscore-dangle: "off" */
3796
4484
  /* eslint no-use-before-define: "off" */
3797
4485
  function Autoplay(_ref) {
@@ -8975,17 +9663,18 @@ SwiperSlide.displayName = 'SwiperSlide';
8975
9663
  * @Author: binruan@chatlabs.com
8976
9664
  * @Date: 2023-11-02 18:34:34
8977
9665
  * @LastEditors: binruan@chatlabs.com
8978
- * @LastEditTime: 2024-11-06 17:27:45
9666
+ * @LastEditTime: 2024-11-20 18:37:10
8979
9667
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8980
9668
  *
8981
9669
  */
8982
9670
  const closeIcon$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
8983
9671
  const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false, openState }) => {
8984
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
9672
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
8985
9673
  const touchRef = useRef(null);
8986
9674
  const fTouchRef = useRef(null);
8987
9675
  const touchMoveRef = useRef(null);
8988
9676
  const ref = useRef(null);
9677
+ const modalRef = useRef(null);
8989
9678
  const MODAL_DEF_TRANS = fullHeight * 0.2;
8990
9679
  const MODAL_DEF_CON_H = isFullScreen ? fullHeight : fullHeight * 0.8;
8991
9680
  const [modalTrans, setModalTrans] = useState(MODAL_DEF_TRANS);
@@ -9033,6 +9722,46 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9033
9722
  const child = useCallback(() => {
9034
9723
  return children;
9035
9724
  }, [_popup, openState, globalConfig]);
9725
+ useEffect(() => {
9726
+ const trapFocus = (element) => {
9727
+ var focusableEls = element === null || element === void 0 ? void 0 : element.querySelectorAll('[role="button"],a, a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
9728
+ var firstFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[0];
9729
+ var lastFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[(focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls.length) - 1];
9730
+ var KEYCODE_TAB = 9;
9731
+ element.addEventListener('keydown', function (e) {
9732
+ if (e.key === 'Escape' || e.key === 'Esc') {
9733
+ // 在这里执行按下 Esc 键时的操作
9734
+ handleClose();
9735
+ e.preventDefault();
9736
+ }
9737
+ var isTabPressed = e.key === 'Tab' || e.keyCode === KEYCODE_TAB;
9738
+ if (!isTabPressed) {
9739
+ return;
9740
+ }
9741
+ if (e.shiftKey) {
9742
+ /* shift + tab */
9743
+ if ((document === null || document === void 0 ? void 0 : document.activeElement) === firstFocusableEl) {
9744
+ lastFocusableEl === null || lastFocusableEl === void 0 ? void 0 : lastFocusableEl.focus();
9745
+ e.preventDefault();
9746
+ }
9747
+ }
9748
+ else {
9749
+ /* tab */
9750
+ if ((document === null || document === void 0 ? void 0 : document.activeElement) === lastFocusableEl) {
9751
+ firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
9752
+ e.preventDefault();
9753
+ }
9754
+ }
9755
+ });
9756
+ firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
9757
+ };
9758
+ if (modalRef === null || modalRef === void 0 ? void 0 : modalRef.current)
9759
+ trapFocus(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current);
9760
+ return () => {
9761
+ var _a;
9762
+ (_a = modalRef === null || modalRef === void 0 ? void 0 : modalRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', trapFocus);
9763
+ };
9764
+ }, [modalRef, isShow, _popup]);
9036
9765
  if (!modalEleRef.current)
9037
9766
  return null;
9038
9767
  const handleClose = debounce(() => {
@@ -9097,7 +9826,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9097
9826
  width: `calc(100% - ${((_r = (_q = (_p = (_o = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _o === void 0 ? void 0 : _o.props) === null || _p === void 0 ? void 0 : _p.popupBg) === null || _q === void 0 ? void 0 : _q.horizontalMargin) !== null && _r !== void 0 ? _r : 0) * 2}px)`,
9098
9827
  height: '100%'
9099
9828
  } },
9100
- React.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, role: 'dialog', "aria-label": (_s = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _s === void 0 ? void 0 : _s.displayName, "aria-modal": true, style: Object.assign(Object.assign({ padding, animationDuration: ((_t = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _t !== void 0 ? _t : 0) / 1000 + 's' }, (isScrollFullScreen && {
9829
+ React.createElement("div", Object.assign({ ref: modalRef, className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, role: 'dialog', "aria-label": (_s = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _s === void 0 ? void 0 : _s.displayName, "aria-modal": true, "aria-labelledby": 'modal-content', style: Object.assign(Object.assign({ padding, animationDuration: ((_t = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _t !== void 0 ? _t : 0) / 1000 + 's' }, (isScrollFullScreen && {
9101
9830
  transform: `translateY(${modalTrans}px)`
9102
9831
  })), { overflow: 'hidden', borderRadius: `${(_x = (_w = (_v = (_u = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _u === void 0 ? void 0 : _u.props) === null || _v === void 0 ? void 0 : _v.popupBg) === null || _w === void 0 ? void 0 : _w.borderRadius) !== null && _x !== void 0 ? _x : 0}px`, zIndex: 9 }), onClick: (e) => {
9103
9832
  e.stopPropagation();
@@ -9107,18 +9836,18 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9107
9836
  onTouchStart: handleTouchStart,
9108
9837
  onTouchEnd: handleTouchEnd
9109
9838
  })),
9110
- React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
9111
- React.createElement("img", { src: (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _y !== void 0 ? _y : closeIcon$1, alt: 'close button', className: 'modal-icon' })),
9112
- React.createElement("div", Object.assign({ ref: ref, style: {
9839
+ React.createElement("div", Object.assign({ id: 'modal-content', ref: ref, style: {
9113
9840
  height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
9114
9841
  overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden',
9115
9842
  zIndex: 1
9116
- } }, (((_0 = (_z = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _z === void 0 ? void 0 : _z.props) === null || _0 === void 0 ? void 0 : _0.enableFixedCloseButton) && {
9843
+ } }, (((_z = (_y = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _y === void 0 ? void 0 : _y.props) === null || _z === void 0 ? void 0 : _z.enableFixedCloseButton) && {
9117
9844
  onScroll: (e) => {
9118
9845
  var _a;
9119
9846
  setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
9120
9847
  }
9121
- })), child())))))), modalEleRef.current);
9848
+ })), child()),
9849
+ React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
9850
+ React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon$1, alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
9122
9851
  };
9123
9852
  var Modal$1 = memo(Modal);
9124
9853
 
@@ -9126,7 +9855,7 @@ var Modal$1 = memo(Modal);
9126
9855
  * @Author: binruan@chatlabs.com
9127
9856
  * @Date: 2023-12-26 16:11:34
9128
9857
  * @LastEditors: binruan@chatlabs.com
9129
- * @LastEditTime: 2024-10-18 14:52:42
9858
+ * @LastEditTime: 2024-11-07 14:27:18
9130
9859
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
9131
9860
  *
9132
9861
  */
@@ -9183,7 +9912,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
9183
9912
  wordBreak: 'break-word'
9184
9913
  }, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
9185
9914
  React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
9186
- text && isPost && isShow && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
9915
+ text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
9187
9916
  __html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', style)
9188
9917
  } }))));
9189
9918
  };
@@ -9236,7 +9965,7 @@ var FormatImage$1 = memo(FormatImage);
9236
9965
  * @Author: binruan@chatlabs.com
9237
9966
  * @Date: 2024-03-20 10:27:32
9238
9967
  * @LastEditors: binruan@chatlabs.com
9239
- * @LastEditTime: 2024-10-17 18:02:56
9968
+ * @LastEditTime: 2024-11-19 10:29:18
9240
9969
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
9241
9970
  *
9242
9971
  */
@@ -9248,7 +9977,7 @@ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }
9248
9977
  if (enableSlideActive)
9249
9978
  (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
9250
9979
  }, [popupDetailData, enableSlideActive]);
9251
- return (React.createElement(Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
9980
+ return (React.createElement(Swiper, { role: 'list', tag: 'ul', ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
9252
9981
  };
9253
9982
  var Scroll$1 = memo(Scroll);
9254
9983
 
@@ -9385,7 +10114,8 @@ const CommodityDetail$1 = (_a) => {
9385
10114
  const [showModal, setShowModal] = useState(false);
9386
10115
  const [show3DModal, setShow3DModal] = useState(false);
9387
10116
  const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
9388
- const ref = useRef();
10117
+ const swiperRef = useRef();
10118
+ const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
9389
10119
  const data = isPost ? rec : popupDetailData;
9390
10120
  let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
9391
10121
  let cta = isPost
@@ -9461,7 +10191,7 @@ const CommodityDetail$1 = (_a) => {
9461
10191
  };
9462
10192
  const renderBtn = () => {
9463
10193
  var _a, _b;
9464
- return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
10194
+ return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
9465
10195
  React.createElement("span", { dangerouslySetInnerHTML: {
9466
10196
  __html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
9467
10197
  } })))));
@@ -9476,9 +10206,9 @@ const CommodityDetail$1 = (_a) => {
9476
10206
  popupCurTimeRef.current = new Date();
9477
10207
  setCheckCommodityIndex(index);
9478
10208
  checkCommodityIndexRef.current = index;
9479
- if (ref === null || ref === void 0 ? void 0 : ref.current) {
9480
- ref.current.swiper.slideTo(0);
9481
- ref.current.swiper.autoplay.start();
10209
+ if (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) {
10210
+ swiperRef.current.swiper.slideTo(0);
10211
+ swiperRef.current.swiper.autoplay.start();
9482
10212
  }
9483
10213
  }, []);
9484
10214
  const renderCommodityGroup = useCallback(() => {
@@ -9496,17 +10226,40 @@ const CommodityDetail$1 = (_a) => {
9496
10226
  return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
9497
10227
  }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
9498
10228
  const iframeUrl = product === null || product === void 0 ? void 0 : product.remark;
10229
+ const handleMouseEnter = useCallback(() => {
10230
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
10231
+ swiperRef.current.swiper.autoplay.stop();
10232
+ }
10233
+ }, []);
10234
+ const handleMouseLeave = useCallback(() => {
10235
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
10236
+ swiperRef.current.swiper.autoplay.start();
10237
+ }
10238
+ }, []);
10239
+ const handleSlideChange = useCallback((swiper) => {
10240
+ setSwiperActiveIndex(swiper.activeIndex);
10241
+ }, []);
10242
+ const isAlly = useMemo(() => getScreenReader(), []);
9499
10243
  return (React.createElement(React.Fragment, null,
9500
10244
  React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
9501
- React.createElement("div", { style: { position: 'relative' } },
9502
- product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
10245
+ React.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
10246
+ product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, Object.assign({ height: height, modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
9503
10247
  clickable: true,
9504
10248
  bulletActiveClass: 'swipe-item-active-bullet',
9505
10249
  clickableClass: getDotsAlign,
9506
10250
  bulletElement: 'button'
9507
- }, loop: true, autoplay: {
10251
+ } }, (isAlly
10252
+ ? {
10253
+ mousewheel: true,
10254
+ keyboard: true,
10255
+ navigation: true,
10256
+ a11y: {
10257
+ enabled: true
10258
+ }
10259
+ }
10260
+ : {}), { loop: true, autoplay: {
9508
10261
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
9509
- }, ref: ref, className: css(Object.assign(Object.assign({ '.swiper-pagination': { bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0, fontSize: '14px' } }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
10262
+ }, ref: swiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': { bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0, fontSize: '14px' } }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
9510
10263
  '.swiper-pagination-bullet': {
9511
10264
  backgroundColor: swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor,
9512
10265
  opacity: 1
@@ -9516,10 +10269,10 @@ const CommodityDetail$1 = (_a) => {
9516
10269
  backgroundColor: `${swiper === null || swiper === void 0 ? void 0 : swiper.dotsActiveColor}!important`,
9517
10270
  opacity: 1
9518
10271
  }
9519
- }))) },
9520
- React.createElement(React.Fragment, null, (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src) => {
10272
+ }))) }),
10273
+ React.createElement(React.Fragment, null, (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src, srcKey) => {
9521
10274
  var _a;
9522
- return (React.createElement(SwiperSlide, { key: src },
10275
+ return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
9523
10276
  React.createElement("div", { style: {
9524
10277
  overflow: 'hidden',
9525
10278
  width,
@@ -10272,7 +11025,8 @@ const CommodityDetailDiroNew$1 = (_a) => {
10272
11025
  const curTimeRef = useRef(null);
10273
11026
  const [show3DModal, setShow3DModal] = useState(false);
10274
11027
  const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
10275
- const ref = useRef();
11028
+ const swiperRef = useRef();
11029
+ const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
10276
11030
  const data = isPost ? rec : popupDetailData;
10277
11031
  let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
10278
11032
  let cta = isPost
@@ -10392,9 +11146,9 @@ Made in Italy` })));
10392
11146
  popupCurTimeRef.current = new Date();
10393
11147
  setCheckCommodityIndex(index);
10394
11148
  checkCommodityIndexRef.current = index;
10395
- if (ref === null || ref === void 0 ? void 0 : ref.current) {
10396
- ref.current.swiper.slideTo(0);
10397
- ref.current.swiper.autoplay.start();
11149
+ if (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) {
11150
+ swiperRef.current.swiper.slideTo(0);
11151
+ swiperRef.current.swiper.autoplay.start();
10398
11152
  }
10399
11153
  }, []);
10400
11154
  const renderCommodityGroup = useCallback(() => {
@@ -10412,17 +11166,40 @@ Made in Italy` })));
10412
11166
  return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
10413
11167
  }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
10414
11168
  const iframeUrl = product === null || product === void 0 ? void 0 : product.remark;
11169
+ const handleMouseEnter = useCallback(() => {
11170
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
11171
+ swiperRef.current.swiper.autoplay.stop();
11172
+ }
11173
+ }, []);
11174
+ const handleMouseLeave = useCallback(() => {
11175
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
11176
+ swiperRef.current.swiper.autoplay.start();
11177
+ }
11178
+ }, []);
11179
+ const handleSlideChange = useCallback((swiper) => {
11180
+ setSwiperActiveIndex(swiper.activeIndex);
11181
+ }, []);
11182
+ const isAlly = useMemo(() => getScreenReader(), []);
10415
11183
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
10416
11184
  React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
10417
- React.createElement("div", { style: { position: 'relative' } },
10418
- product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
11185
+ React.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
11186
+ product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, Object.assign({ height: height, modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
10419
11187
  clickable: true,
10420
11188
  bulletActiveClass: 'swipe-item-active-bullet',
10421
11189
  clickableClass: getDotsAlign,
10422
11190
  bulletElement: 'button'
10423
- }, loop: true, autoplay: {
11191
+ } }, (isAlly
11192
+ ? {
11193
+ mousewheel: true,
11194
+ keyboard: true,
11195
+ navigation: true,
11196
+ a11y: {
11197
+ enabled: true
11198
+ }
11199
+ }
11200
+ : {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, autoplay: {
10424
11201
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
10425
- }, ref: ref, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
11202
+ }, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
10426
11203
  bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0,
10427
11204
  fontSize: '14px'
10428
11205
  } }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
@@ -10435,9 +11212,9 @@ Made in Italy` })));
10435
11212
  backgroundColor: `${swiper === null || swiper === void 0 ? void 0 : swiper.dotsActiveColor}!important`,
10436
11213
  opacity: 1
10437
11214
  }
10438
- }))) }, (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src) => {
11215
+ }))) }), (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src, srcKey) => {
10439
11216
  var _a;
10440
- return (React.createElement(SwiperSlide, { key: src },
11217
+ return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
10441
11218
  React.createElement("div", { style: {
10442
11219
  overflow: 'hidden',
10443
11220
  width,
@@ -10488,7 +11265,7 @@ Made in Italy` })));
10488
11265
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
10489
11266
  __html: setFontForText((_2 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _2 !== void 0 ? _2 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
10490
11267
  } }))),
10491
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_3 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _3 !== void 0 ? _3 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
11268
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("a", { "aria-label": (_3 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _3 !== void 0 ? _3 : 'Shop now', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
10492
11269
  React.createElement("span", { dangerouslySetInnerHTML: {
10493
11270
  __html: setFontForText((_4 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _4 !== void 0 ? _4 : 'Shop now', buttonStyle)
10494
11271
  } }))),
@@ -10966,39 +11743,43 @@ const CommodityList$1 = (_a) => {
10966
11743
  eventName: 'PageView'
10967
11744
  });
10968
11745
  }, []);
10969
- return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
11746
+ return (React.createElement("ul", { role: 'list', className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
10970
11747
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10971
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css({
10972
- display: 'flex'
10973
- }), onClick: () => handleClick(item, index) }),
10974
- React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
10975
- React.createElement("div", { style: {
10976
- width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px)`,
11748
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("li", { role: 'listitem', key: index, onClick: () => handleClick(item, index) },
11749
+ React.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: css({
10977
11750
  display: 'flex',
10978
- flexDirection: 'column',
10979
- justifyContent: 'space-between'
10980
- } },
10981
- React.createElement("div", null,
10982
- React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
10983
- __html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
10984
- } }),
10985
- React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
10986
- __html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
10987
- } })),
10988
- React.createElement("div", { className: css({
11751
+ alignItems: 'normal',
11752
+ width: '100%',
11753
+ textAlign: 'left'
11754
+ }) }, props),
11755
+ React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
11756
+ React.createElement("div", { style: {
11757
+ width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px)`,
10989
11758
  display: 'flex',
10990
- alignItems: 'flex-end',
10991
- justifyContent: 'space-between',
10992
- width: '100%',
10993
- overflow: 'hidden'
10994
- }) },
11759
+ flexDirection: 'column',
11760
+ justifyContent: 'space-between'
11761
+ } },
10995
11762
  React.createElement("div", null,
10996
- React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
10997
- __html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
11763
+ React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
11764
+ __html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
11765
+ } }),
11766
+ React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
11767
+ __html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
10998
11768
  } })),
10999
- React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
11000
- __html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
11001
- } })))))));
11769
+ React.createElement("div", { className: css({
11770
+ display: 'flex',
11771
+ alignItems: 'flex-end',
11772
+ justifyContent: 'space-between',
11773
+ width: '100%',
11774
+ overflow: 'hidden'
11775
+ }) },
11776
+ React.createElement("div", null,
11777
+ React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
11778
+ __html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
11779
+ } })),
11780
+ React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
11781
+ __html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
11782
+ } }))))))));
11002
11783
  })));
11003
11784
  };
11004
11785
  var CommodityListComponent = memo(CommodityList$1);
@@ -11468,44 +12249,55 @@ var interactionRender$a = [
11468
12249
  ];
11469
12250
 
11470
12251
  const EventProvider = (_a) => {
11471
- var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink"]);
12252
+ var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink, multItem, multiCheckIndex } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink", "multItem", "multiCheckIndex"]);
11472
12253
  const ref = useRef(null);
11473
12254
  const { popup } = useEditor();
11474
12255
  const { setPopupDetailData, ctaEvent } = useSxpDataSource();
11475
12256
  const { jumpToWeb } = useEventReport();
11476
- const handleClick = throttle(() => {
11477
- var _a, _b, _c, _d, _e, _f, _g, _h;
11478
- const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
12257
+ const [element, setElement] = useState(null);
12258
+ const handleClick = throttle((event) => {
12259
+ var _a, _b, _c, _d, _e, _f, _g;
12260
+ event.preventDefault();
12261
+ const item = (_c = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video) !== null && _c !== void 0 ? _c : multItem;
11479
12262
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11480
12263
  eventSubject: 'clickCta',
11481
12264
  eventDescription: 'User clicked the CTA'
11482
12265
  }, rec, item, index);
11483
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
12266
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(multItem && multiCheckIndex
12267
+ ? Object.assign(Object.assign({}, rec), { video: Object.assign(Object.assign({}, rec === null || rec === void 0 ? void 0 : rec.video), { bindProduct: multItem }), index, multiCheckIndex }) : Object.assign(Object.assign({}, rec), { index }));
12268
+ setElement(ref === null || ref === void 0 ? void 0 : ref.current);
11484
12269
  if (isExternalLink) {
11485
- if (jumpLink || ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link)) {
11486
- const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
11487
- const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
12270
+ const link = ((_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link);
12271
+ if (jumpLink || link) {
12272
+ const cta = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
12273
+ const product = ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) || multItem;
11488
12274
  jumpToWeb(rec, product, cta, index);
11489
- window.location.href = window.getJointUtmLink(jumpLink || ((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link) || '');
12275
+ window.location.href = window.getJointUtmLink(jumpLink || link || '');
11490
12276
  }
11491
12277
  }
11492
12278
  else {
11493
12279
  onClick === null || onClick === void 0 ? void 0 : onClick();
11494
12280
  }
11495
12281
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
11496
- return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
12282
+ useEffect(() => {
12283
+ if (element && !(popup === null || popup === void 0 ? void 0 : popup.id)) {
12284
+ element === null || element === void 0 ? void 0 : element.focus();
12285
+ setElement(null);
12286
+ }
12287
+ }, [element, popup]);
12288
+ return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
11497
12289
  };
11498
12290
  var EventProvider$1 = memo(EventProvider);
11499
12291
 
11500
12292
  var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
11501
12293
 
11502
12294
  const Commodity$1 = (_a) => {
11503
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
12295
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
11504
12296
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
11505
12297
  const { sxpParameter } = useSxpDataSource();
11506
12298
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
11507
12299
  const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
11508
- return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
12300
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
11509
12301
  React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
11510
12302
  React.createElement("div", { className: css({
11511
12303
  color: '#fff',
@@ -11518,8 +12310,8 @@ const Commodity$1 = (_a) => {
11518
12310
  React.createElement("div", { className: styles$8['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
11519
12311
  __html: setFontForText((_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
11520
12312
  } }),
11521
- React.createElement("div", { className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_k = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _k === void 0 ? void 0 : _k.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
11522
- __html: setFontForText((_m = (_l = product === null || product === void 0 ? void 0 : product.bindCta) === null || _l === void 0 ? void 0 : _l.enTitle) !== null && _m !== void 0 ? _m : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12313
+ React.createElement("button", { "aria-label": (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_m = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _m === void 0 ? void 0 : _m.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12314
+ __html: setFontForText((_p = (_o = product === null || product === void 0 ? void 0 : product.bindCta) === null || _o === void 0 ? void 0 : _o.enTitle) !== null && _p !== void 0 ? _p : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
11523
12315
  } }))));
11524
12316
  };
11525
12317
  var CommodityComponent = memo(Commodity$1);
@@ -11599,7 +12391,7 @@ const Appoint$1 = (_a) => {
11599
12391
  const { sxpParameter } = useSxpDataSource();
11600
12392
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
11601
12393
  const src = (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image;
11602
- return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' }, index: index }, props),
12394
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: Object.assign({ alignItems: 'center' }, style), index: index }, props),
11603
12395
  React.createElement(Img$1, { src: src, rec: recData, item: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) !== null && _f !== void 0 ? _f : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
11604
12396
  React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
11605
12397
  __html: setFontForText((_g = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _g !== void 0 ? _g : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
@@ -11783,7 +12575,7 @@ const Link$1 = (_a) => {
11783
12575
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
11784
12576
  (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
11785
12577
  const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
11786
- return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
12578
+ return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, style: Object.assign({ alignItems: 'center' }, style) }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
11787
12579
  React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
11788
12580
  React.createElement("div", { className: css({
11789
12581
  display: 'flex',
@@ -11893,12 +12685,12 @@ var interactionRender$7 = [
11893
12685
  var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
11894
12686
 
11895
12687
  const CommodityDiro$1 = (_a) => {
11896
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
12688
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
11897
12689
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
11898
12690
  const { sxpParameter } = useSxpDataSource();
11899
12691
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
11900
12692
  const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
11901
- return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
12693
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
11902
12694
  React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
11903
12695
  React.createElement("div", { className: css({
11904
12696
  color: '#fff',
@@ -11911,8 +12703,8 @@ const CommodityDiro$1 = (_a) => {
11911
12703
  React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
11912
12704
  __html: setFontForText((_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
11913
12705
  } }),
11914
- React.createElement("div", { className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_k = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _k === void 0 ? void 0 : _k.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
11915
- __html: setFontForText((_m = (_l = product === null || product === void 0 ? void 0 : product.bindCta) === null || _l === void 0 ? void 0 : _l.enTitle) !== null && _m !== void 0 ? _m : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12706
+ React.createElement("button", { "aria-label": (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_m = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _m === void 0 ? void 0 : _m.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12707
+ __html: setFontForText((_p = (_o = product === null || product === void 0 ? void 0 : product.bindCta) === null || _o === void 0 ? void 0 : _o.enTitle) !== null && _p !== void 0 ? _p : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
11916
12708
  } }))));
11917
12709
  };
11918
12710
  var CommodityDiroComponent = memo(CommodityDiro$1);
@@ -11989,12 +12781,12 @@ var interactionRender$6 = [
11989
12781
  var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
11990
12782
 
11991
12783
  const CommodityDiroNew$1 = (_a) => {
11992
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12784
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
11993
12785
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
11994
12786
  const { sxpParameter } = useSxpDataSource();
11995
12787
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
11996
12788
  const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
11997
- return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
12789
+ return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
11998
12790
  React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
11999
12791
  React.createElement("div", { className: css({
12000
12792
  color: '#fff',
@@ -12007,8 +12799,8 @@ const CommodityDiroNew$1 = (_a) => {
12007
12799
  React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12008
12800
  __html: setFontForText((_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12009
12801
  } }),
12010
- React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12011
- __html: setFontForText((_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12802
+ React.createElement("button", { "aria-label": (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12803
+ __html: setFontForText((_o = (_m = product === null || product === void 0 ? void 0 : product.bindCta) === null || _m === void 0 ? void 0 : _m.enTitle) !== null && _o !== void 0 ? _o : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12012
12804
  } }))));
12013
12805
  };
12014
12806
  var CommodityDiroNewComponent = memo(CommodityDiroNew$1);
@@ -12087,45 +12879,28 @@ var styles$4 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
12087
12879
 
12088
12880
  const MultiCommodityDiro$1 = (_a) => {
12089
12881
  var _b, _c;
12090
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
12091
- const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
12092
- const { popup } = useEditor();
12093
- const { jumpToWeb } = useEventReport();
12094
- const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12095
- const handleClick = throttle((item, multiCheckIndex) => {
12096
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12097
- eventSubject: 'clickCta',
12098
- eventDescription: 'User clicked the CTA'
12099
- }, recData, item, index);
12100
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
12101
- if (isExternalLink) {
12102
- if (item === null || item === void 0 ? void 0 : item.link) {
12103
- jumpToWeb(recData, item, item.bindCta, index);
12104
- window.location.href = window.getJointUtmLink(item.link);
12105
- }
12106
- }
12107
- else {
12108
- onClick === null || onClick === void 0 ? void 0 : onClick();
12109
- }
12110
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
12111
- return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
12112
- var _a, _b, _c, _d, _e, _f, _g, _h;
12113
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
12114
- React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12115
- React.createElement("div", { className: css({
12116
- color: '#000',
12117
- display: 'flex',
12118
- flexDirection: 'column',
12119
- justifyContent: 'space-between',
12120
- width: '100%',
12121
- overflow: 'hidden'
12122
- }) },
12123
- React.createElement("div", { className: styles$4['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12124
- __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12125
- } }),
12126
- React.createElement("div", { className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_f = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _f === void 0 ? void 0 : _f.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12127
- __html: setFontForText((_h = (_g = item === null || item === void 0 ? void 0 : item.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12128
- } }))))));
12882
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
12883
+ const { sxpParameter } = useSxpDataSource();
12884
+ const [products] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12885
+ return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
12886
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
12887
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
12888
+ React.createElement(EventProvider$1, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
12889
+ React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12890
+ React.createElement("div", { className: css({
12891
+ color: '#000',
12892
+ display: 'flex',
12893
+ flexDirection: 'column',
12894
+ justifyContent: 'space-between',
12895
+ width: '100%',
12896
+ overflow: 'hidden'
12897
+ }) },
12898
+ React.createElement("div", { className: styles$4['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12899
+ __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12900
+ } }),
12901
+ React.createElement("button", { "aria-label": (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now', className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_h = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _h === void 0 ? void 0 : _h.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12902
+ __html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12903
+ } })))))));
12129
12904
  })));
12130
12905
  };
12131
12906
  var MultiCommodityDiroComponent = memo(MultiCommodityDiro$1);
@@ -12203,46 +12978,28 @@ var styles$3 = {"two-line-ellipsis":"index-module_two-line-ellipsis__mdzn0"};
12203
12978
 
12204
12979
  const MultiCommodity$1 = (_a) => {
12205
12980
  var _b, _c;
12206
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
12981
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
12207
12982
  const { sxpParameter } = useSxpDataSource();
12208
- const { ctaEvent, setPopupDetailData } = useSxpDataSource();
12209
- const { popup } = useEditor();
12210
- const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12211
- const { jumpToWeb } = useEventReport();
12212
- const handleClick = throttle((item, multiCheckIndex) => {
12213
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12214
- eventSubject: 'clickCta',
12215
- eventDescription: 'User clicked the CTA'
12216
- }, recData, item, index);
12217
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
12218
- if (isExternalLink) {
12219
- if (item === null || item === void 0 ? void 0 : item.link) {
12220
- jumpToWeb(recData, item, item.bindCta, index);
12221
- window.location.href = window.getJointUtmLink(item.link);
12222
- }
12223
- }
12224
- else {
12225
- onClick === null || onClick === void 0 ? void 0 : onClick();
12226
- }
12227
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
12228
- return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
12229
- var _a, _b, _c, _d, _e, _f, _g, _h;
12230
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
12231
- React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12232
- React.createElement("div", { className: css({
12233
- color: '#fff',
12234
- display: 'flex',
12235
- flexDirection: 'column',
12236
- justifyContent: 'space-between',
12237
- width: '100%',
12238
- overflow: 'hidden'
12239
- }) },
12240
- React.createElement("div", { className: styles$3['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12241
- __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12242
- } }),
12243
- React.createElement("div", { className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_f = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _f === void 0 ? void 0 : _f.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12244
- __html: setFontForText((_h = (_g = item === null || item === void 0 ? void 0 : item.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12245
- } }))))));
12983
+ const [products] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12984
+ return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
12985
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
12986
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
12987
+ React.createElement(EventProvider$1, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
12988
+ React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12989
+ React.createElement("div", { className: css({
12990
+ color: '#fff',
12991
+ display: 'flex',
12992
+ flexDirection: 'column',
12993
+ justifyContent: 'space-between',
12994
+ width: '100%',
12995
+ overflow: 'hidden'
12996
+ }) },
12997
+ React.createElement("div", { className: styles$3['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12998
+ __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12999
+ } }),
13000
+ React.createElement("button", { "aria-label": (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now', className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_h = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _h === void 0 ? void 0 : _h.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
13001
+ __html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
13002
+ } })))))));
12246
13003
  })));
12247
13004
  };
12248
13005
  var MultiCommodityComponent = memo(MultiCommodity$1);
@@ -12328,47 +13085,29 @@ var styles$2 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__fselR"};
12328
13085
 
12329
13086
  const MultiCommodityDiroNew$1 = (_a) => {
12330
13087
  var _b, _c;
12331
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
12332
- const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
12333
- const { popup } = useEditor();
12334
- const { jumpToWeb } = useEventReport();
12335
- const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
12336
- const handleClick = throttle((item, multiCheckIndex) => {
12337
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12338
- eventSubject: 'clickCta',
12339
- eventDescription: 'User clicked the CTA'
12340
- }, recData, item, index);
12341
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index,
12342
- multiCheckIndex }));
12343
- if (isExternalLink) {
12344
- if (item === null || item === void 0 ? void 0 : item.link) {
12345
- jumpToWeb(recData, item, item.bindCta, index);
12346
- window.location.href = window.getJointUtmLink(item.link);
12347
- }
12348
- }
12349
- else {
12350
- onClick === null || onClick === void 0 ? void 0 : onClick();
12351
- }
12352
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
12353
- return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
12354
- var _a, _b, _c, _d, _e, _f, _g;
12355
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
12356
- React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
12357
- React.createElement("div", { className: css({
12358
- color: '#fff',
12359
- display: 'flex',
12360
- flexDirection: 'column',
12361
- justifyContent: 'center',
12362
- width: '100%',
12363
- overflow: 'hidden',
12364
- lineHeight: '20px'
12365
- }) },
12366
- React.createElement("div", { className: styles$2['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
12367
- __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
12368
- } }),
12369
- React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
12370
- __html: setFontForText((_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
12371
- } }))))));
13088
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
13089
+ const { sxpParameter } = useSxpDataSource();
13090
+ const [products] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
13091
+ return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
13092
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13093
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
13094
+ React.createElement(EventProvider$1, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
13095
+ React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
13096
+ React.createElement("div", { className: css({
13097
+ color: '#fff',
13098
+ display: 'flex',
13099
+ flexDirection: 'column',
13100
+ justifyContent: 'center',
13101
+ width: '100%',
13102
+ overflow: 'hidden',
13103
+ lineHeight: '20px'
13104
+ }) },
13105
+ React.createElement("div", { className: styles$2['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
13106
+ __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
13107
+ } }),
13108
+ React.createElement("button", { "aria-label": (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now', className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
13109
+ __html: setFontForText((_j = (_h = item === null || item === void 0 ? void 0 : item.bindCta) === null || _h === void 0 ? void 0 : _h.enTitle) !== null && _j !== void 0 ? _j : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
13110
+ } })))))));
12372
13111
  })));
12373
13112
  };
12374
13113
  var MultiCommodityDiroNewComponent = memo(MultiCommodityDiroNew$1);
@@ -15381,7 +16120,7 @@ var styles = {"aniLinkPopup":"index-module_aniLinkPopup__YT7kj","animated-fadeIn
15381
16120
 
15382
16121
  const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
15383
16122
  const AniLinkPopup$1 = (_a) => {
15384
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
16123
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
15385
16124
  var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink", "isActive"]);
15386
16125
  style === null || style === void 0 ? true : delete style.transform;
15387
16126
  const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
@@ -15438,12 +16177,12 @@ const AniLinkPopup$1 = (_a) => {
15438
16177
  paddingLeft: '6px'
15439
16178
  } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css(aniTimStyle)}`, onClick: handleTo }),
15440
16179
  React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
15441
- React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
15442
- React.createElement(Img$1, { src: src, rec: recData, item: (_y = (_w = (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) !== null && _w !== void 0 ? _w : (_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.bindProduct) !== null && _y !== void 0 ? _y : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
16180
+ React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
16181
+ React.createElement(Img$1, { src: src, rec: recData, item: (_x = (_v = (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) !== null && _v !== void 0 ? _v : (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.bindProduct) !== null && _x !== void 0 ? _x : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
15443
16182
  (!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
15444
- __html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.title) !== null && _z !== void 0 ? _z : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
16183
+ __html: setFontForText((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
15445
16184
  } })),
15446
- React.createElement("div", { className: styles['one-line-ellipsis'], style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((_0 = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _0 === void 0 ? void 0 : _0.height) + 'px' }), dangerouslySetInnerHTML: {
16185
+ React.createElement("div", { className: styles['one-line-ellipsis'], style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((_z = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _z === void 0 ? void 0 : _z.height) + 'px' }), dangerouslySetInnerHTML: {
15447
16186
  __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
15448
16187
  } })))));
15449
16188
  };
@@ -16455,15 +17194,16 @@ const Picture = (props) => {
16455
17194
 
16456
17195
  const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
16457
17196
  var _a, _b;
16458
- const ref = useRef();
17197
+ const swiperRef = useRef();
16459
17198
  const { isActive } = useSwiperSlide();
16460
17199
  const { sxpParameter, openHashtag } = useSxpDataSource();
16461
17200
  const [isLoad, setIsLoad] = useState(false);
16462
17201
  const [imgInfo, setImgInfo] = useState();
16463
17202
  const initTime = new Date();
17203
+ const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
16464
17204
  useEffect(() => {
16465
17205
  if (isLoad && isActive) {
16466
- (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
17206
+ (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
16467
17207
  if (openHashtag) {
16468
17208
  onViewImageEndEvent(rec);
16469
17209
  }
@@ -16472,7 +17212,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
16472
17212
  }
16473
17213
  }
16474
17214
  else {
16475
- (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
17215
+ (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
16476
17216
  }
16477
17217
  }, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
16478
17218
  const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
@@ -16496,27 +17236,51 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
16496
17236
  SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
16497
17237
  };
16498
17238
  }, [imgInfo]);
16499
- return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
16500
- clickable: true,
16501
- bulletActiveClass: 'swipe-item-active-bullet',
16502
- bulletElement: 'button'
16503
- }, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
16504
- bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
16505
- fontSize: '14px'
16506
- } }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
16507
- '.swiper-pagination-bullet': {
16508
- backgroundColor: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor,
16509
- opacity: 1
16510
- }
16511
- })), ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor) && {
16512
- '.swipe-item-active-bullet': {
16513
- backgroundColor: `${imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor}!important`,
16514
- opacity: 1
17239
+ const handleMouseEnter = useCallback(() => {
17240
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
17241
+ swiperRef.current.swiper.autoplay.stop();
17242
+ }
17243
+ }, []);
17244
+ const handleMouseLeave = useCallback(() => {
17245
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
17246
+ swiperRef.current.swiper.autoplay.start();
17247
+ }
17248
+ }, []);
17249
+ const handleSlideChange = useCallback((swiper) => {
17250
+ setSwiperActiveIndex(swiper.activeIndex);
17251
+ }, []);
17252
+ const isAlly = useMemo(() => getScreenReader(), []);
17253
+ return (React.createElement("div", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
17254
+ React.createElement(Swiper, Object.assign({ defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
17255
+ clickable: true,
17256
+ bulletActiveClass: 'swipe-item-active-bullet',
17257
+ bulletElement: 'button'
17258
+ } }, (isAlly
17259
+ ? {
17260
+ mousewheel: true,
17261
+ keyboard: true,
17262
+ navigation: true,
17263
+ a11y: {
17264
+ enabled: true
17265
+ }
16515
17266
  }
16516
- }))), height: height, loop: true, autoplay: { delay: ((_b = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.delay) !== null && _b !== void 0 ? _b : 3) * 1000 } }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url, index) => {
16517
- return (React.createElement(SwiperSlide, { key: index },
16518
- React.createElement(Picture, { src: !isLoad && index > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
16519
- })));
17267
+ : {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
17268
+ bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
17269
+ fontSize: '14px'
17270
+ } }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
17271
+ '.swiper-pagination-bullet': {
17272
+ backgroundColor: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor,
17273
+ opacity: 1
17274
+ }
17275
+ })), ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor) && {
17276
+ '.swipe-item-active-bullet': {
17277
+ backgroundColor: `${imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor}!important`,
17278
+ opacity: 1
17279
+ }
17280
+ }))), height: height, autoplay: { delay: ((_b = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.delay) !== null && _b !== void 0 ? _b : 3) * 1000 } }), imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url, srcKey) => {
17281
+ return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
17282
+ React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
17283
+ }))));
16520
17284
  };
16521
17285
  var PictureGroup$3 = memo(PictureGroup$2);
16522
17286
 
@@ -16524,7 +17288,7 @@ var PictureGroup$3 = memo(PictureGroup$2);
16524
17288
  * @Author: binruan@chatlabs.com
16525
17289
  * @Date: 2024-01-15 19:03:09
16526
17290
  * @LastEditors: binruan@chatlabs.com
16527
- * @LastEditTime: 2024-10-17 18:02:31
17291
+ * @LastEditTime: 2024-11-19 10:40:36
16528
17292
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
16529
17293
  *
16530
17294
  */
@@ -16565,8 +17329,8 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle, hashTagRigh
16565
17329
  marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px`,
16566
17330
  width: hashTagRightMargin
16567
17331
  } },
16568
- React.createElement(Scroll$1, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item), tag: 'button', "aria-label": item },
16569
- React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
17332
+ React.createElement(Scroll$1, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item), tag: 'li', role: 'listitem' },
17333
+ React.createElement("button", { className: 'clc-sxp-bottom-hashtag-item-button', "aria-label": item, "aria-describedby": item, dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
16570
17334
  };
16571
17335
  var Hashtag$1 = memo(Hashtag);
16572
17336
 
@@ -16782,7 +17546,7 @@ var ConsentPopup = memo(Consent);
16782
17546
  * @Author: binruan@chatlabs.com
16783
17547
  * @Date: 2024-03-20 10:27:31
16784
17548
  * @LastEditors: binruan@chatlabs.com
16785
- * @LastEditTime: 2024-11-05 18:13:15
17549
+ * @LastEditTime: 2024-11-19 09:47:45
16786
17550
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16787
17551
  *
16788
17552
  */
@@ -17270,9 +18034,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
17270
18034
  alignItems: 'center'
17271
18035
  } },
17272
18036
  React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
18037
+ renderBottom(rec, index),
17273
18038
  renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
17274
18039
  renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
17275
- renderBottom(rec, index),
17276
18040
  renderContent(rec, index)))))));
17277
18041
  });
17278
18042
  }, [
@@ -17339,9 +18103,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
17339
18103
  }
17340
18104
  }
17341
18105
  }, direction: 'vertical', height: height },
18106
+ renderView,
17342
18107
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
17343
- renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
17344
- renderView),
18108
+ renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
17345
18109
  React.createElement(WaterFall$1, Object.assign({}, (_w = (_v = (_u = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.item) === null || _w === void 0 ? void 0 : _w.props)),
17346
18110
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig })));
17347
18111
  };