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.
- package/dist/index.cjs +1005 -241
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +72 -4
- package/dist/index.js +1005 -241
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +1005 -241
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/ExpandableText.js +1 -1
- package/es/core/components/SxpPageRender/Hashtag/index.js +2 -2
- package/es/core/components/SxpPageRender/Modal/index.js +45 -7
- package/es/core/components/SxpPageRender/PictureGroup/index.js +51 -25
- package/es/core/components/SxpPageRender/index.js +3 -3
- package/es/core/hooks/useFocusTrap.d.ts +2 -0
- package/es/core/hooks/useFocusTrap.js +37 -0
- package/es/core/utils/tool.d.ts +2 -1
- package/es/core/utils/tool.js +12 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/materials/sxp/cta/AniLinkPopup/index.js +5 -5
- package/es/materials/sxp/popup/CommodityDetail/index.js +38 -14
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +37 -13
- package/es/materials/sxp/popup/CommodityList/index.js +32 -28
- package/es/materials/sxp/template/Appoint/index.js +1 -1
- package/es/materials/sxp/template/Commodity/index.js +4 -4
- package/es/materials/sxp/template/CommodityDiro/index.js +4 -4
- package/es/materials/sxp/template/CommodityDiroNew/index.js +4 -4
- package/es/materials/sxp/template/Link/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodity/index.js +23 -42
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +24 -42
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +25 -44
- package/es/materials/sxp/template/components/EventProvider.d.ts +2 -0
- package/es/materials/sxp/template/components/EventProvider.js +22 -11
- package/es/materials/sxp/template/components/Scroll.js +1 -1
- package/lib/core/components/SxpPageRender/ExpandableText.js +1 -1
- package/lib/core/components/SxpPageRender/Hashtag/index.js +2 -2
- package/lib/core/components/SxpPageRender/Modal/index.js +45 -7
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +49 -23
- package/lib/core/components/SxpPageRender/index.js +3 -3
- package/lib/core/hooks/useFocusTrap.d.ts +2 -0
- package/lib/core/hooks/useFocusTrap.js +39 -0
- package/lib/core/utils/tool.d.ts +2 -1
- package/lib/core/utils/tool.js +13 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +5 -5
- package/lib/materials/sxp/popup/CommodityDetail/index.js +36 -12
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +35 -11
- package/lib/materials/sxp/popup/CommodityList/index.js +32 -28
- package/lib/materials/sxp/template/Appoint/index.js +1 -1
- package/lib/materials/sxp/template/Commodity/index.js +4 -4
- package/lib/materials/sxp/template/CommodityDiro/index.js +4 -4
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +4 -4
- package/lib/materials/sxp/template/Link/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodity/index.js +22 -41
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +23 -41
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +24 -43
- package/lib/materials/sxp/template/components/EventProvider.d.ts +2 -0
- package/lib/materials/sxp/template/components/EventProvider.js +21 -10
- package/lib/materials/sxp/template/components/Scroll.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -320,6 +320,17 @@ function getCookie(val) {
|
|
320
320
|
});
|
321
321
|
return value !== null && value !== void 0 ? value : '';
|
322
322
|
}
|
323
|
+
function getScreenReader() {
|
324
|
+
let userAgent = self.navigator.userAgent;
|
325
|
+
if (!userAgent)
|
326
|
+
return false;
|
327
|
+
return (/TalkBack/i.test(userAgent) ||
|
328
|
+
/Funtouch/i.test(userAgent) ||
|
329
|
+
/VoiceOver/i.test(userAgent) ||
|
330
|
+
/NVDA/i.test(userAgent) ||
|
331
|
+
/JAWS/i.test(userAgent) ||
|
332
|
+
/ChromeVox/i.test(userAgent));
|
333
|
+
}
|
323
334
|
|
324
335
|
function unzip(b64Data) {
|
325
336
|
const strData = atob(b64Data);
|
@@ -2601,6 +2612,119 @@ function makeElementsArray(el) {
|
|
2601
2612
|
return (Array.isArray(el) ? el : [el]).filter(e => !!e);
|
2602
2613
|
}
|
2603
2614
|
|
2615
|
+
/* eslint-disable consistent-return */
|
2616
|
+
function Keyboard(_ref) {
|
2617
|
+
let {
|
2618
|
+
swiper,
|
2619
|
+
extendParams,
|
2620
|
+
on,
|
2621
|
+
emit
|
2622
|
+
} = _ref;
|
2623
|
+
const document = getDocument();
|
2624
|
+
const window = getWindow();
|
2625
|
+
swiper.keyboard = {
|
2626
|
+
enabled: false
|
2627
|
+
};
|
2628
|
+
extendParams({
|
2629
|
+
keyboard: {
|
2630
|
+
enabled: false,
|
2631
|
+
onlyInViewport: true,
|
2632
|
+
pageUpDown: true
|
2633
|
+
}
|
2634
|
+
});
|
2635
|
+
function handle(event) {
|
2636
|
+
if (!swiper.enabled) return;
|
2637
|
+
const {
|
2638
|
+
rtlTranslate: rtl
|
2639
|
+
} = swiper;
|
2640
|
+
let e = event;
|
2641
|
+
if (e.originalEvent) e = e.originalEvent; // jquery fix
|
2642
|
+
const kc = e.keyCode || e.charCode;
|
2643
|
+
const pageUpDown = swiper.params.keyboard.pageUpDown;
|
2644
|
+
const isPageUp = pageUpDown && kc === 33;
|
2645
|
+
const isPageDown = pageUpDown && kc === 34;
|
2646
|
+
const isArrowLeft = kc === 37;
|
2647
|
+
const isArrowRight = kc === 39;
|
2648
|
+
const isArrowUp = kc === 38;
|
2649
|
+
const isArrowDown = kc === 40;
|
2650
|
+
// Directions locks
|
2651
|
+
if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) {
|
2652
|
+
return false;
|
2653
|
+
}
|
2654
|
+
if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) {
|
2655
|
+
return false;
|
2656
|
+
}
|
2657
|
+
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
|
2658
|
+
return undefined;
|
2659
|
+
}
|
2660
|
+
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
|
2661
|
+
return undefined;
|
2662
|
+
}
|
2663
|
+
if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
|
2664
|
+
let inView = false;
|
2665
|
+
// Check that swiper should be inside of visible area of window
|
2666
|
+
if (elementParents(swiper.el, `.${swiper.params.slideClass}, swiper-slide`).length > 0 && elementParents(swiper.el, `.${swiper.params.slideActiveClass}`).length === 0) {
|
2667
|
+
return undefined;
|
2668
|
+
}
|
2669
|
+
const el = swiper.el;
|
2670
|
+
const swiperWidth = el.clientWidth;
|
2671
|
+
const swiperHeight = el.clientHeight;
|
2672
|
+
const windowWidth = window.innerWidth;
|
2673
|
+
const windowHeight = window.innerHeight;
|
2674
|
+
const swiperOffset = elementOffset(el);
|
2675
|
+
if (rtl) swiperOffset.left -= el.scrollLeft;
|
2676
|
+
const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]];
|
2677
|
+
for (let i = 0; i < swiperCoord.length; i += 1) {
|
2678
|
+
const point = swiperCoord[i];
|
2679
|
+
if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {
|
2680
|
+
if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line
|
2681
|
+
inView = true;
|
2682
|
+
}
|
2683
|
+
}
|
2684
|
+
if (!inView) return undefined;
|
2685
|
+
}
|
2686
|
+
if (swiper.isHorizontal()) {
|
2687
|
+
if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
|
2688
|
+
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
2689
|
+
}
|
2690
|
+
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
|
2691
|
+
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
|
2692
|
+
} else {
|
2693
|
+
if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
|
2694
|
+
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
2695
|
+
}
|
2696
|
+
if (isPageDown || isArrowDown) swiper.slideNext();
|
2697
|
+
if (isPageUp || isArrowUp) swiper.slidePrev();
|
2698
|
+
}
|
2699
|
+
emit('keyPress', kc);
|
2700
|
+
return undefined;
|
2701
|
+
}
|
2702
|
+
function enable() {
|
2703
|
+
if (swiper.keyboard.enabled) return;
|
2704
|
+
document.addEventListener('keydown', handle);
|
2705
|
+
swiper.keyboard.enabled = true;
|
2706
|
+
}
|
2707
|
+
function disable() {
|
2708
|
+
if (!swiper.keyboard.enabled) return;
|
2709
|
+
document.removeEventListener('keydown', handle);
|
2710
|
+
swiper.keyboard.enabled = false;
|
2711
|
+
}
|
2712
|
+
on('init', () => {
|
2713
|
+
if (swiper.params.keyboard.enabled) {
|
2714
|
+
enable();
|
2715
|
+
}
|
2716
|
+
});
|
2717
|
+
on('destroy', () => {
|
2718
|
+
if (swiper.keyboard.enabled) {
|
2719
|
+
disable();
|
2720
|
+
}
|
2721
|
+
});
|
2722
|
+
Object.assign(swiper.keyboard, {
|
2723
|
+
enable,
|
2724
|
+
disable
|
2725
|
+
});
|
2726
|
+
}
|
2727
|
+
|
2604
2728
|
/* eslint-disable consistent-return */
|
2605
2729
|
function Mousewheel(_ref) {
|
2606
2730
|
let {
|
@@ -3008,6 +3132,202 @@ function createElementIfNotDefined(swiper, originalParams, params, checkProps) {
|
|
3008
3132
|
return params;
|
3009
3133
|
}
|
3010
3134
|
|
3135
|
+
function Navigation(_ref) {
|
3136
|
+
let {
|
3137
|
+
swiper,
|
3138
|
+
extendParams,
|
3139
|
+
on,
|
3140
|
+
emit
|
3141
|
+
} = _ref;
|
3142
|
+
extendParams({
|
3143
|
+
navigation: {
|
3144
|
+
nextEl: null,
|
3145
|
+
prevEl: null,
|
3146
|
+
hideOnClick: false,
|
3147
|
+
disabledClass: 'swiper-button-disabled',
|
3148
|
+
hiddenClass: 'swiper-button-hidden',
|
3149
|
+
lockClass: 'swiper-button-lock',
|
3150
|
+
navigationDisabledClass: 'swiper-navigation-disabled'
|
3151
|
+
}
|
3152
|
+
});
|
3153
|
+
swiper.navigation = {
|
3154
|
+
nextEl: null,
|
3155
|
+
prevEl: null
|
3156
|
+
};
|
3157
|
+
function getEl(el) {
|
3158
|
+
let res;
|
3159
|
+
if (el && typeof el === 'string' && swiper.isElement) {
|
3160
|
+
res = swiper.el.querySelector(el);
|
3161
|
+
if (res) return res;
|
3162
|
+
}
|
3163
|
+
if (el) {
|
3164
|
+
if (typeof el === 'string') res = [...document.querySelectorAll(el)];
|
3165
|
+
if (swiper.params.uniqueNavElements && typeof el === 'string' && res && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
|
3166
|
+
res = swiper.el.querySelector(el);
|
3167
|
+
} else if (res && res.length === 1) {
|
3168
|
+
res = res[0];
|
3169
|
+
}
|
3170
|
+
}
|
3171
|
+
if (el && !res) return el;
|
3172
|
+
// if (Array.isArray(res) && res.length === 1) res = res[0];
|
3173
|
+
return res;
|
3174
|
+
}
|
3175
|
+
function toggleEl(el, disabled) {
|
3176
|
+
const params = swiper.params.navigation;
|
3177
|
+
el = makeElementsArray(el);
|
3178
|
+
el.forEach(subEl => {
|
3179
|
+
if (subEl) {
|
3180
|
+
subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));
|
3181
|
+
if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;
|
3182
|
+
if (swiper.params.watchOverflow && swiper.enabled) {
|
3183
|
+
subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
|
3184
|
+
}
|
3185
|
+
}
|
3186
|
+
});
|
3187
|
+
}
|
3188
|
+
function update() {
|
3189
|
+
// Update Navigation Buttons
|
3190
|
+
const {
|
3191
|
+
nextEl,
|
3192
|
+
prevEl
|
3193
|
+
} = swiper.navigation;
|
3194
|
+
if (swiper.params.loop) {
|
3195
|
+
toggleEl(prevEl, false);
|
3196
|
+
toggleEl(nextEl, false);
|
3197
|
+
return;
|
3198
|
+
}
|
3199
|
+
toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);
|
3200
|
+
toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);
|
3201
|
+
}
|
3202
|
+
function onPrevClick(e) {
|
3203
|
+
e.preventDefault();
|
3204
|
+
if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
|
3205
|
+
swiper.slidePrev();
|
3206
|
+
emit('navigationPrev');
|
3207
|
+
}
|
3208
|
+
function onNextClick(e) {
|
3209
|
+
e.preventDefault();
|
3210
|
+
if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
|
3211
|
+
swiper.slideNext();
|
3212
|
+
emit('navigationNext');
|
3213
|
+
}
|
3214
|
+
function init() {
|
3215
|
+
const params = swiper.params.navigation;
|
3216
|
+
swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
|
3217
|
+
nextEl: 'swiper-button-next',
|
3218
|
+
prevEl: 'swiper-button-prev'
|
3219
|
+
});
|
3220
|
+
if (!(params.nextEl || params.prevEl)) return;
|
3221
|
+
let nextEl = getEl(params.nextEl);
|
3222
|
+
let prevEl = getEl(params.prevEl);
|
3223
|
+
Object.assign(swiper.navigation, {
|
3224
|
+
nextEl,
|
3225
|
+
prevEl
|
3226
|
+
});
|
3227
|
+
nextEl = makeElementsArray(nextEl);
|
3228
|
+
prevEl = makeElementsArray(prevEl);
|
3229
|
+
const initButton = (el, dir) => {
|
3230
|
+
if (el) {
|
3231
|
+
el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
|
3232
|
+
}
|
3233
|
+
if (!swiper.enabled && el) {
|
3234
|
+
el.classList.add(...params.lockClass.split(' '));
|
3235
|
+
}
|
3236
|
+
};
|
3237
|
+
nextEl.forEach(el => initButton(el, 'next'));
|
3238
|
+
prevEl.forEach(el => initButton(el, 'prev'));
|
3239
|
+
}
|
3240
|
+
function destroy() {
|
3241
|
+
let {
|
3242
|
+
nextEl,
|
3243
|
+
prevEl
|
3244
|
+
} = swiper.navigation;
|
3245
|
+
nextEl = makeElementsArray(nextEl);
|
3246
|
+
prevEl = makeElementsArray(prevEl);
|
3247
|
+
const destroyButton = (el, dir) => {
|
3248
|
+
el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
|
3249
|
+
el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));
|
3250
|
+
};
|
3251
|
+
nextEl.forEach(el => destroyButton(el, 'next'));
|
3252
|
+
prevEl.forEach(el => destroyButton(el, 'prev'));
|
3253
|
+
}
|
3254
|
+
on('init', () => {
|
3255
|
+
if (swiper.params.navigation.enabled === false) {
|
3256
|
+
// eslint-disable-next-line
|
3257
|
+
disable();
|
3258
|
+
} else {
|
3259
|
+
init();
|
3260
|
+
update();
|
3261
|
+
}
|
3262
|
+
});
|
3263
|
+
on('toEdge fromEdge lock unlock', () => {
|
3264
|
+
update();
|
3265
|
+
});
|
3266
|
+
on('destroy', () => {
|
3267
|
+
destroy();
|
3268
|
+
});
|
3269
|
+
on('enable disable', () => {
|
3270
|
+
let {
|
3271
|
+
nextEl,
|
3272
|
+
prevEl
|
3273
|
+
} = swiper.navigation;
|
3274
|
+
nextEl = makeElementsArray(nextEl);
|
3275
|
+
prevEl = makeElementsArray(prevEl);
|
3276
|
+
if (swiper.enabled) {
|
3277
|
+
update();
|
3278
|
+
return;
|
3279
|
+
}
|
3280
|
+
[...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.add(swiper.params.navigation.lockClass));
|
3281
|
+
});
|
3282
|
+
on('click', (_s, e) => {
|
3283
|
+
let {
|
3284
|
+
nextEl,
|
3285
|
+
prevEl
|
3286
|
+
} = swiper.navigation;
|
3287
|
+
nextEl = makeElementsArray(nextEl);
|
3288
|
+
prevEl = makeElementsArray(prevEl);
|
3289
|
+
const targetEl = e.target;
|
3290
|
+
let targetIsButton = prevEl.includes(targetEl) || nextEl.includes(targetEl);
|
3291
|
+
if (swiper.isElement && !targetIsButton) {
|
3292
|
+
const path = e.path || e.composedPath && e.composedPath();
|
3293
|
+
if (path) {
|
3294
|
+
targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl));
|
3295
|
+
}
|
3296
|
+
}
|
3297
|
+
if (swiper.params.navigation.hideOnClick && !targetIsButton) {
|
3298
|
+
if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
|
3299
|
+
let isHidden;
|
3300
|
+
if (nextEl.length) {
|
3301
|
+
isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);
|
3302
|
+
} else if (prevEl.length) {
|
3303
|
+
isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);
|
3304
|
+
}
|
3305
|
+
if (isHidden === true) {
|
3306
|
+
emit('navigationShow');
|
3307
|
+
} else {
|
3308
|
+
emit('navigationHide');
|
3309
|
+
}
|
3310
|
+
[...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));
|
3311
|
+
}
|
3312
|
+
});
|
3313
|
+
const enable = () => {
|
3314
|
+
swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));
|
3315
|
+
init();
|
3316
|
+
update();
|
3317
|
+
};
|
3318
|
+
const disable = () => {
|
3319
|
+
swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));
|
3320
|
+
destroy();
|
3321
|
+
};
|
3322
|
+
Object.assign(swiper.navigation, {
|
3323
|
+
enable,
|
3324
|
+
disable,
|
3325
|
+
update,
|
3326
|
+
init,
|
3327
|
+
destroy
|
3328
|
+
});
|
3329
|
+
}
|
3330
|
+
|
3011
3331
|
function classesToSelector(classes) {
|
3012
3332
|
if (classes === void 0) {
|
3013
3333
|
classes = '';
|
@@ -3814,6 +4134,374 @@ function Scrollbar(_ref) {
|
|
3814
4134
|
});
|
3815
4135
|
}
|
3816
4136
|
|
4137
|
+
function A11y(_ref) {
|
4138
|
+
let {
|
4139
|
+
swiper,
|
4140
|
+
extendParams,
|
4141
|
+
on
|
4142
|
+
} = _ref;
|
4143
|
+
extendParams({
|
4144
|
+
a11y: {
|
4145
|
+
enabled: true,
|
4146
|
+
notificationClass: 'swiper-notification',
|
4147
|
+
prevSlideMessage: 'Previous slide',
|
4148
|
+
nextSlideMessage: 'Next slide',
|
4149
|
+
firstSlideMessage: 'This is the first slide',
|
4150
|
+
lastSlideMessage: 'This is the last slide',
|
4151
|
+
paginationBulletMessage: 'Go to slide {{index}}',
|
4152
|
+
slideLabelMessage: '{{index}} / {{slidesLength}}',
|
4153
|
+
containerMessage: null,
|
4154
|
+
containerRoleDescriptionMessage: null,
|
4155
|
+
itemRoleDescriptionMessage: null,
|
4156
|
+
slideRole: 'group',
|
4157
|
+
id: null
|
4158
|
+
}
|
4159
|
+
});
|
4160
|
+
swiper.a11y = {
|
4161
|
+
clicked: false
|
4162
|
+
};
|
4163
|
+
let liveRegion = null;
|
4164
|
+
let preventFocusHandler;
|
4165
|
+
let focusTargetSlideEl;
|
4166
|
+
let visibilityChangedTimestamp = new Date().getTime();
|
4167
|
+
function notify(message) {
|
4168
|
+
const notification = liveRegion;
|
4169
|
+
if (notification.length === 0) return;
|
4170
|
+
notification.innerHTML = '';
|
4171
|
+
notification.innerHTML = message;
|
4172
|
+
}
|
4173
|
+
function getRandomNumber(size) {
|
4174
|
+
if (size === void 0) {
|
4175
|
+
size = 16;
|
4176
|
+
}
|
4177
|
+
const randomChar = () => Math.round(16 * Math.random()).toString(16);
|
4178
|
+
return 'x'.repeat(size).replace(/x/g, randomChar);
|
4179
|
+
}
|
4180
|
+
function makeElFocusable(el) {
|
4181
|
+
el = makeElementsArray(el);
|
4182
|
+
el.forEach(subEl => {
|
4183
|
+
subEl.setAttribute('tabIndex', '0');
|
4184
|
+
});
|
4185
|
+
}
|
4186
|
+
function makeElNotFocusable(el) {
|
4187
|
+
el = makeElementsArray(el);
|
4188
|
+
el.forEach(subEl => {
|
4189
|
+
subEl.setAttribute('tabIndex', '-1');
|
4190
|
+
});
|
4191
|
+
}
|
4192
|
+
function addElRole(el, role) {
|
4193
|
+
el = makeElementsArray(el);
|
4194
|
+
el.forEach(subEl => {
|
4195
|
+
subEl.setAttribute('role', role);
|
4196
|
+
});
|
4197
|
+
}
|
4198
|
+
function addElRoleDescription(el, description) {
|
4199
|
+
el = makeElementsArray(el);
|
4200
|
+
el.forEach(subEl => {
|
4201
|
+
subEl.setAttribute('aria-roledescription', description);
|
4202
|
+
});
|
4203
|
+
}
|
4204
|
+
function addElControls(el, controls) {
|
4205
|
+
el = makeElementsArray(el);
|
4206
|
+
el.forEach(subEl => {
|
4207
|
+
subEl.setAttribute('aria-controls', controls);
|
4208
|
+
});
|
4209
|
+
}
|
4210
|
+
function addElLabel(el, label) {
|
4211
|
+
el = makeElementsArray(el);
|
4212
|
+
el.forEach(subEl => {
|
4213
|
+
subEl.setAttribute('aria-label', label);
|
4214
|
+
});
|
4215
|
+
}
|
4216
|
+
function addElId(el, id) {
|
4217
|
+
el = makeElementsArray(el);
|
4218
|
+
el.forEach(subEl => {
|
4219
|
+
subEl.setAttribute('id', id);
|
4220
|
+
});
|
4221
|
+
}
|
4222
|
+
function addElLive(el, live) {
|
4223
|
+
el = makeElementsArray(el);
|
4224
|
+
el.forEach(subEl => {
|
4225
|
+
subEl.setAttribute('aria-live', live);
|
4226
|
+
});
|
4227
|
+
}
|
4228
|
+
function disableEl(el) {
|
4229
|
+
el = makeElementsArray(el);
|
4230
|
+
el.forEach(subEl => {
|
4231
|
+
subEl.setAttribute('aria-disabled', true);
|
4232
|
+
});
|
4233
|
+
}
|
4234
|
+
function enableEl(el) {
|
4235
|
+
el = makeElementsArray(el);
|
4236
|
+
el.forEach(subEl => {
|
4237
|
+
subEl.setAttribute('aria-disabled', false);
|
4238
|
+
});
|
4239
|
+
}
|
4240
|
+
function onEnterOrSpaceKey(e) {
|
4241
|
+
if (e.keyCode !== 13 && e.keyCode !== 32) return;
|
4242
|
+
const params = swiper.params.a11y;
|
4243
|
+
const targetEl = e.target;
|
4244
|
+
if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
|
4245
|
+
if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
|
4246
|
+
}
|
4247
|
+
if (swiper.navigation && swiper.navigation.prevEl && swiper.navigation.nextEl) {
|
4248
|
+
const prevEls = makeElementsArray(swiper.navigation.prevEl);
|
4249
|
+
const nextEls = makeElementsArray(swiper.navigation.nextEl);
|
4250
|
+
if (nextEls.includes(targetEl)) {
|
4251
|
+
if (!(swiper.isEnd && !swiper.params.loop)) {
|
4252
|
+
swiper.slideNext();
|
4253
|
+
}
|
4254
|
+
if (swiper.isEnd) {
|
4255
|
+
notify(params.lastSlideMessage);
|
4256
|
+
} else {
|
4257
|
+
notify(params.nextSlideMessage);
|
4258
|
+
}
|
4259
|
+
}
|
4260
|
+
if (prevEls.includes(targetEl)) {
|
4261
|
+
if (!(swiper.isBeginning && !swiper.params.loop)) {
|
4262
|
+
swiper.slidePrev();
|
4263
|
+
}
|
4264
|
+
if (swiper.isBeginning) {
|
4265
|
+
notify(params.firstSlideMessage);
|
4266
|
+
} else {
|
4267
|
+
notify(params.prevSlideMessage);
|
4268
|
+
}
|
4269
|
+
}
|
4270
|
+
}
|
4271
|
+
if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
|
4272
|
+
targetEl.click();
|
4273
|
+
}
|
4274
|
+
}
|
4275
|
+
function updateNavigation() {
|
4276
|
+
if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;
|
4277
|
+
const {
|
4278
|
+
nextEl,
|
4279
|
+
prevEl
|
4280
|
+
} = swiper.navigation;
|
4281
|
+
if (prevEl) {
|
4282
|
+
if (swiper.isBeginning) {
|
4283
|
+
disableEl(prevEl);
|
4284
|
+
makeElNotFocusable(prevEl);
|
4285
|
+
} else {
|
4286
|
+
enableEl(prevEl);
|
4287
|
+
makeElFocusable(prevEl);
|
4288
|
+
}
|
4289
|
+
}
|
4290
|
+
if (nextEl) {
|
4291
|
+
if (swiper.isEnd) {
|
4292
|
+
disableEl(nextEl);
|
4293
|
+
makeElNotFocusable(nextEl);
|
4294
|
+
} else {
|
4295
|
+
enableEl(nextEl);
|
4296
|
+
makeElFocusable(nextEl);
|
4297
|
+
}
|
4298
|
+
}
|
4299
|
+
}
|
4300
|
+
function hasPagination() {
|
4301
|
+
return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;
|
4302
|
+
}
|
4303
|
+
function hasClickablePagination() {
|
4304
|
+
return hasPagination() && swiper.params.pagination.clickable;
|
4305
|
+
}
|
4306
|
+
function updatePagination() {
|
4307
|
+
const params = swiper.params.a11y;
|
4308
|
+
if (!hasPagination()) return;
|
4309
|
+
swiper.pagination.bullets.forEach(bulletEl => {
|
4310
|
+
if (swiper.params.pagination.clickable) {
|
4311
|
+
makeElFocusable(bulletEl);
|
4312
|
+
if (!swiper.params.pagination.renderBullet) {
|
4313
|
+
addElRole(bulletEl, 'button');
|
4314
|
+
addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, elementIndex(bulletEl) + 1));
|
4315
|
+
}
|
4316
|
+
}
|
4317
|
+
if (bulletEl.matches(classesToSelector(swiper.params.pagination.bulletActiveClass))) {
|
4318
|
+
bulletEl.setAttribute('aria-current', 'true');
|
4319
|
+
} else {
|
4320
|
+
bulletEl.removeAttribute('aria-current');
|
4321
|
+
}
|
4322
|
+
});
|
4323
|
+
}
|
4324
|
+
const initNavEl = (el, wrapperId, message) => {
|
4325
|
+
makeElFocusable(el);
|
4326
|
+
if (el.tagName !== 'BUTTON') {
|
4327
|
+
addElRole(el, 'button');
|
4328
|
+
el.addEventListener('keydown', onEnterOrSpaceKey);
|
4329
|
+
}
|
4330
|
+
addElLabel(el, message);
|
4331
|
+
addElControls(el, wrapperId);
|
4332
|
+
};
|
4333
|
+
const handlePointerDown = e => {
|
4334
|
+
if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) {
|
4335
|
+
preventFocusHandler = true;
|
4336
|
+
}
|
4337
|
+
swiper.a11y.clicked = true;
|
4338
|
+
};
|
4339
|
+
const handlePointerUp = () => {
|
4340
|
+
preventFocusHandler = false;
|
4341
|
+
requestAnimationFrame(() => {
|
4342
|
+
requestAnimationFrame(() => {
|
4343
|
+
if (!swiper.destroyed) {
|
4344
|
+
swiper.a11y.clicked = false;
|
4345
|
+
}
|
4346
|
+
});
|
4347
|
+
});
|
4348
|
+
};
|
4349
|
+
const onVisibilityChange = e => {
|
4350
|
+
visibilityChangedTimestamp = new Date().getTime();
|
4351
|
+
};
|
4352
|
+
const handleFocus = e => {
|
4353
|
+
if (swiper.a11y.clicked) return;
|
4354
|
+
if (new Date().getTime() - visibilityChangedTimestamp < 100) return;
|
4355
|
+
const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
|
4356
|
+
if (!slideEl || !swiper.slides.includes(slideEl)) return;
|
4357
|
+
focusTargetSlideEl = slideEl;
|
4358
|
+
const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
|
4359
|
+
const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
|
4360
|
+
if (isActive || isVisible) return;
|
4361
|
+
if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return;
|
4362
|
+
if (swiper.isHorizontal()) {
|
4363
|
+
swiper.el.scrollLeft = 0;
|
4364
|
+
} else {
|
4365
|
+
swiper.el.scrollTop = 0;
|
4366
|
+
}
|
4367
|
+
requestAnimationFrame(() => {
|
4368
|
+
if (preventFocusHandler) return;
|
4369
|
+
if (swiper.params.loop) {
|
4370
|
+
swiper.slideToLoop(parseInt(slideEl.getAttribute('data-swiper-slide-index')), 0);
|
4371
|
+
} else {
|
4372
|
+
swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
|
4373
|
+
}
|
4374
|
+
preventFocusHandler = false;
|
4375
|
+
});
|
4376
|
+
};
|
4377
|
+
const initSlides = () => {
|
4378
|
+
const params = swiper.params.a11y;
|
4379
|
+
if (params.itemRoleDescriptionMessage) {
|
4380
|
+
addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage);
|
4381
|
+
}
|
4382
|
+
if (params.slideRole) {
|
4383
|
+
addElRole(swiper.slides, params.slideRole);
|
4384
|
+
}
|
4385
|
+
const slidesLength = swiper.slides.length;
|
4386
|
+
if (params.slideLabelMessage) {
|
4387
|
+
swiper.slides.forEach((slideEl, index) => {
|
4388
|
+
const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index;
|
4389
|
+
const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength);
|
4390
|
+
addElLabel(slideEl, ariaLabelMessage);
|
4391
|
+
});
|
4392
|
+
}
|
4393
|
+
};
|
4394
|
+
const init = () => {
|
4395
|
+
const params = swiper.params.a11y;
|
4396
|
+
swiper.el.append(liveRegion);
|
4397
|
+
|
4398
|
+
// Container
|
4399
|
+
const containerEl = swiper.el;
|
4400
|
+
if (params.containerRoleDescriptionMessage) {
|
4401
|
+
addElRoleDescription(containerEl, params.containerRoleDescriptionMessage);
|
4402
|
+
}
|
4403
|
+
if (params.containerMessage) {
|
4404
|
+
addElLabel(containerEl, params.containerMessage);
|
4405
|
+
}
|
4406
|
+
|
4407
|
+
// Wrapper
|
4408
|
+
const wrapperEl = swiper.wrapperEl;
|
4409
|
+
const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`;
|
4410
|
+
const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';
|
4411
|
+
addElId(wrapperEl, wrapperId);
|
4412
|
+
addElLive(wrapperEl, live);
|
4413
|
+
|
4414
|
+
// Slide
|
4415
|
+
initSlides();
|
4416
|
+
|
4417
|
+
// Navigation
|
4418
|
+
let {
|
4419
|
+
nextEl,
|
4420
|
+
prevEl
|
4421
|
+
} = swiper.navigation ? swiper.navigation : {};
|
4422
|
+
nextEl = makeElementsArray(nextEl);
|
4423
|
+
prevEl = makeElementsArray(prevEl);
|
4424
|
+
if (nextEl) {
|
4425
|
+
nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage));
|
4426
|
+
}
|
4427
|
+
if (prevEl) {
|
4428
|
+
prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage));
|
4429
|
+
}
|
4430
|
+
|
4431
|
+
// Pagination
|
4432
|
+
if (hasClickablePagination()) {
|
4433
|
+
const paginationEl = makeElementsArray(swiper.pagination.el);
|
4434
|
+
paginationEl.forEach(el => {
|
4435
|
+
el.addEventListener('keydown', onEnterOrSpaceKey);
|
4436
|
+
});
|
4437
|
+
}
|
4438
|
+
|
4439
|
+
// Tab focus
|
4440
|
+
const document = getDocument();
|
4441
|
+
document.addEventListener('visibilitychange', onVisibilityChange);
|
4442
|
+
swiper.el.addEventListener('focus', handleFocus, true);
|
4443
|
+
swiper.el.addEventListener('focus', handleFocus, true);
|
4444
|
+
swiper.el.addEventListener('pointerdown', handlePointerDown, true);
|
4445
|
+
swiper.el.addEventListener('pointerup', handlePointerUp, true);
|
4446
|
+
};
|
4447
|
+
function destroy() {
|
4448
|
+
if (liveRegion) liveRegion.remove();
|
4449
|
+
let {
|
4450
|
+
nextEl,
|
4451
|
+
prevEl
|
4452
|
+
} = swiper.navigation ? swiper.navigation : {};
|
4453
|
+
nextEl = makeElementsArray(nextEl);
|
4454
|
+
prevEl = makeElementsArray(prevEl);
|
4455
|
+
if (nextEl) {
|
4456
|
+
nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
|
4457
|
+
}
|
4458
|
+
if (prevEl) {
|
4459
|
+
prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
|
4460
|
+
}
|
4461
|
+
|
4462
|
+
// Pagination
|
4463
|
+
if (hasClickablePagination()) {
|
4464
|
+
const paginationEl = makeElementsArray(swiper.pagination.el);
|
4465
|
+
paginationEl.forEach(el => {
|
4466
|
+
el.removeEventListener('keydown', onEnterOrSpaceKey);
|
4467
|
+
});
|
4468
|
+
}
|
4469
|
+
const document = getDocument();
|
4470
|
+
document.removeEventListener('visibilitychange', onVisibilityChange);
|
4471
|
+
// Tab focus
|
4472
|
+
if (swiper.el && typeof swiper.el !== 'string') {
|
4473
|
+
swiper.el.removeEventListener('focus', handleFocus, true);
|
4474
|
+
swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
|
4475
|
+
swiper.el.removeEventListener('pointerup', handlePointerUp, true);
|
4476
|
+
}
|
4477
|
+
}
|
4478
|
+
on('beforeInit', () => {
|
4479
|
+
liveRegion = createElement('span', swiper.params.a11y.notificationClass);
|
4480
|
+
liveRegion.setAttribute('aria-live', 'assertive');
|
4481
|
+
liveRegion.setAttribute('aria-atomic', 'true');
|
4482
|
+
});
|
4483
|
+
on('afterInit', () => {
|
4484
|
+
if (!swiper.params.a11y.enabled) return;
|
4485
|
+
init();
|
4486
|
+
});
|
4487
|
+
on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => {
|
4488
|
+
if (!swiper.params.a11y.enabled) return;
|
4489
|
+
initSlides();
|
4490
|
+
});
|
4491
|
+
on('fromEdge toEdge afterInit lock unlock', () => {
|
4492
|
+
if (!swiper.params.a11y.enabled) return;
|
4493
|
+
updateNavigation();
|
4494
|
+
});
|
4495
|
+
on('paginationUpdate', () => {
|
4496
|
+
if (!swiper.params.a11y.enabled) return;
|
4497
|
+
updatePagination();
|
4498
|
+
});
|
4499
|
+
on('destroy', () => {
|
4500
|
+
if (!swiper.params.a11y.enabled) return;
|
4501
|
+
destroy();
|
4502
|
+
});
|
4503
|
+
}
|
4504
|
+
|
3817
4505
|
/* eslint no-underscore-dangle: "off" */
|
3818
4506
|
/* eslint no-use-before-define: "off" */
|
3819
4507
|
function Autoplay(_ref) {
|
@@ -8997,17 +9685,18 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8997
9685
|
* @Author: binruan@chatlabs.com
|
8998
9686
|
* @Date: 2023-11-02 18:34:34
|
8999
9687
|
* @LastEditors: binruan@chatlabs.com
|
9000
|
-
* @LastEditTime: 2024-11-
|
9688
|
+
* @LastEditTime: 2024-11-20 18:37:10
|
9001
9689
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
9002
9690
|
*
|
9003
9691
|
*/
|
9004
9692
|
const closeIcon$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
9005
9693
|
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false, openState }) => {
|
9006
|
-
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
|
9694
|
+
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;
|
9007
9695
|
const touchRef = React.useRef(null);
|
9008
9696
|
const fTouchRef = React.useRef(null);
|
9009
9697
|
const touchMoveRef = React.useRef(null);
|
9010
9698
|
const ref = React.useRef(null);
|
9699
|
+
const modalRef = React.useRef(null);
|
9011
9700
|
const MODAL_DEF_TRANS = fullHeight * 0.2;
|
9012
9701
|
const MODAL_DEF_CON_H = isFullScreen ? fullHeight : fullHeight * 0.8;
|
9013
9702
|
const [modalTrans, setModalTrans] = React.useState(MODAL_DEF_TRANS);
|
@@ -9055,6 +9744,46 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9055
9744
|
const child = React.useCallback(() => {
|
9056
9745
|
return children;
|
9057
9746
|
}, [_popup, openState, globalConfig]);
|
9747
|
+
React.useEffect(() => {
|
9748
|
+
const trapFocus = (element) => {
|
9749
|
+
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])');
|
9750
|
+
var firstFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[0];
|
9751
|
+
var lastFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[(focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls.length) - 1];
|
9752
|
+
var KEYCODE_TAB = 9;
|
9753
|
+
element.addEventListener('keydown', function (e) {
|
9754
|
+
if (e.key === 'Escape' || e.key === 'Esc') {
|
9755
|
+
// 在这里执行按下 Esc 键时的操作
|
9756
|
+
handleClose();
|
9757
|
+
e.preventDefault();
|
9758
|
+
}
|
9759
|
+
var isTabPressed = e.key === 'Tab' || e.keyCode === KEYCODE_TAB;
|
9760
|
+
if (!isTabPressed) {
|
9761
|
+
return;
|
9762
|
+
}
|
9763
|
+
if (e.shiftKey) {
|
9764
|
+
/* shift + tab */
|
9765
|
+
if ((document === null || document === void 0 ? void 0 : document.activeElement) === firstFocusableEl) {
|
9766
|
+
lastFocusableEl === null || lastFocusableEl === void 0 ? void 0 : lastFocusableEl.focus();
|
9767
|
+
e.preventDefault();
|
9768
|
+
}
|
9769
|
+
}
|
9770
|
+
else {
|
9771
|
+
/* tab */
|
9772
|
+
if ((document === null || document === void 0 ? void 0 : document.activeElement) === lastFocusableEl) {
|
9773
|
+
firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
|
9774
|
+
e.preventDefault();
|
9775
|
+
}
|
9776
|
+
}
|
9777
|
+
});
|
9778
|
+
firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
|
9779
|
+
};
|
9780
|
+
if (modalRef === null || modalRef === void 0 ? void 0 : modalRef.current)
|
9781
|
+
trapFocus(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current);
|
9782
|
+
return () => {
|
9783
|
+
var _a;
|
9784
|
+
(_a = modalRef === null || modalRef === void 0 ? void 0 : modalRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', trapFocus);
|
9785
|
+
};
|
9786
|
+
}, [modalRef, isShow, _popup]);
|
9058
9787
|
if (!modalEleRef.current)
|
9059
9788
|
return null;
|
9060
9789
|
const handleClose = lodash.debounce(() => {
|
@@ -9119,7 +9848,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9119
9848
|
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)`,
|
9120
9849
|
height: '100%'
|
9121
9850
|
} },
|
9122
|
-
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 && {
|
9851
|
+
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 && {
|
9123
9852
|
transform: `translateY(${modalTrans}px)`
|
9124
9853
|
})), { 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) => {
|
9125
9854
|
e.stopPropagation();
|
@@ -9129,18 +9858,18 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9129
9858
|
onTouchStart: handleTouchStart,
|
9130
9859
|
onTouchEnd: handleTouchEnd
|
9131
9860
|
})),
|
9132
|
-
React.createElement("
|
9133
|
-
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' })),
|
9134
|
-
React.createElement("div", Object.assign({ ref: ref, style: {
|
9861
|
+
React.createElement("div", Object.assign({ id: 'modal-content', ref: ref, style: {
|
9135
9862
|
height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
|
9136
9863
|
overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden',
|
9137
9864
|
zIndex: 1
|
9138
|
-
} }, (((
|
9865
|
+
} }, (((_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) && {
|
9139
9866
|
onScroll: (e) => {
|
9140
9867
|
var _a;
|
9141
9868
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
9142
9869
|
}
|
9143
|
-
})), child())
|
9870
|
+
})), child()),
|
9871
|
+
React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
|
9872
|
+
React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon$1, alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
|
9144
9873
|
};
|
9145
9874
|
var Modal$1 = React.memo(Modal);
|
9146
9875
|
|
@@ -9148,7 +9877,7 @@ var Modal$1 = React.memo(Modal);
|
|
9148
9877
|
* @Author: binruan@chatlabs.com
|
9149
9878
|
* @Date: 2023-12-26 16:11:34
|
9150
9879
|
* @LastEditors: binruan@chatlabs.com
|
9151
|
-
* @LastEditTime: 2024-
|
9880
|
+
* @LastEditTime: 2024-11-07 14:27:18
|
9152
9881
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
|
9153
9882
|
*
|
9154
9883
|
*/
|
@@ -9205,7 +9934,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
9205
9934
|
wordBreak: 'break-word'
|
9206
9935
|
}, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
9207
9936
|
React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
9208
|
-
text && isPost && isShow && (React.createElement("
|
9937
|
+
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: {
|
9209
9938
|
__html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', style)
|
9210
9939
|
} }))));
|
9211
9940
|
};
|
@@ -9258,7 +9987,7 @@ var FormatImage$1 = React.memo(FormatImage);
|
|
9258
9987
|
* @Author: binruan@chatlabs.com
|
9259
9988
|
* @Date: 2024-03-20 10:27:32
|
9260
9989
|
* @LastEditors: binruan@chatlabs.com
|
9261
|
-
* @LastEditTime: 2024-
|
9990
|
+
* @LastEditTime: 2024-11-19 10:29:18
|
9262
9991
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
|
9263
9992
|
*
|
9264
9993
|
*/
|
@@ -9270,7 +9999,7 @@ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }
|
|
9270
9999
|
if (enableSlideActive)
|
9271
10000
|
(_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);
|
9272
10001
|
}, [popupDetailData, enableSlideActive]);
|
9273
|
-
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));
|
10002
|
+
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));
|
9274
10003
|
};
|
9275
10004
|
var Scroll$1 = React.memo(Scroll);
|
9276
10005
|
|
@@ -9407,7 +10136,8 @@ const CommodityDetail$1 = (_a) => {
|
|
9407
10136
|
const [showModal, setShowModal] = React.useState(false);
|
9408
10137
|
const [show3DModal, setShow3DModal] = React.useState(false);
|
9409
10138
|
const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
9410
|
-
const
|
10139
|
+
const swiperRef = React.useRef();
|
10140
|
+
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
9411
10141
|
const data = isPost ? rec : popupDetailData;
|
9412
10142
|
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];
|
9413
10143
|
let cta = isPost
|
@@ -9483,7 +10213,7 @@ const CommodityDetail$1 = (_a) => {
|
|
9483
10213
|
};
|
9484
10214
|
const renderBtn = () => {
|
9485
10215
|
var _a, _b;
|
9486
|
-
return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("
|
10216
|
+
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 },
|
9487
10217
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
9488
10218
|
__html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
|
9489
10219
|
} })))));
|
@@ -9498,9 +10228,9 @@ const CommodityDetail$1 = (_a) => {
|
|
9498
10228
|
popupCurTimeRef.current = new Date();
|
9499
10229
|
setCheckCommodityIndex(index);
|
9500
10230
|
checkCommodityIndexRef.current = index;
|
9501
|
-
if (
|
9502
|
-
|
9503
|
-
|
10231
|
+
if (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) {
|
10232
|
+
swiperRef.current.swiper.slideTo(0);
|
10233
|
+
swiperRef.current.swiper.autoplay.start();
|
9504
10234
|
}
|
9505
10235
|
}, []);
|
9506
10236
|
const renderCommodityGroup = React.useCallback(() => {
|
@@ -9518,17 +10248,40 @@ const CommodityDetail$1 = (_a) => {
|
|
9518
10248
|
return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
|
9519
10249
|
}, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
|
9520
10250
|
const iframeUrl = product === null || product === void 0 ? void 0 : product.remark;
|
10251
|
+
const handleMouseEnter = React.useCallback(() => {
|
10252
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
10253
|
+
swiperRef.current.swiper.autoplay.stop();
|
10254
|
+
}
|
10255
|
+
}, []);
|
10256
|
+
const handleMouseLeave = React.useCallback(() => {
|
10257
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
10258
|
+
swiperRef.current.swiper.autoplay.start();
|
10259
|
+
}
|
10260
|
+
}, []);
|
10261
|
+
const handleSlideChange = React.useCallback((swiper) => {
|
10262
|
+
setSwiperActiveIndex(swiper.activeIndex);
|
10263
|
+
}, []);
|
10264
|
+
const isAlly = React.useMemo(() => getScreenReader(), []);
|
9521
10265
|
return (React.createElement(React.Fragment, null,
|
9522
10266
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
9523
|
-
React.createElement("div", { style: { position: 'relative' } },
|
9524
|
-
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: {
|
10267
|
+
React.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
10268
|
+
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: {
|
9525
10269
|
clickable: true,
|
9526
10270
|
bulletActiveClass: 'swipe-item-active-bullet',
|
9527
10271
|
clickableClass: getDotsAlign,
|
9528
10272
|
bulletElement: 'button'
|
9529
|
-
}
|
10273
|
+
} }, (isAlly
|
10274
|
+
? {
|
10275
|
+
mousewheel: true,
|
10276
|
+
keyboard: true,
|
10277
|
+
navigation: true,
|
10278
|
+
a11y: {
|
10279
|
+
enabled: true
|
10280
|
+
}
|
10281
|
+
}
|
10282
|
+
: {}), { loop: true, autoplay: {
|
9530
10283
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
9531
|
-
}, ref:
|
10284
|
+
}, ref: swiperRef, onSlideChange: handleSlideChange, className: css.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) && {
|
9532
10285
|
'.swiper-pagination-bullet': {
|
9533
10286
|
backgroundColor: swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor,
|
9534
10287
|
opacity: 1
|
@@ -9538,10 +10291,10 @@ const CommodityDetail$1 = (_a) => {
|
|
9538
10291
|
backgroundColor: `${swiper === null || swiper === void 0 ? void 0 : swiper.dotsActiveColor}!important`,
|
9539
10292
|
opacity: 1
|
9540
10293
|
}
|
9541
|
-
}))) },
|
9542
|
-
React.createElement(React.Fragment, null, (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src) => {
|
10294
|
+
}))) }),
|
10295
|
+
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) => {
|
9543
10296
|
var _a;
|
9544
|
-
return (React.createElement(SwiperSlide, { key:
|
10297
|
+
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
9545
10298
|
React.createElement("div", { style: {
|
9546
10299
|
overflow: 'hidden',
|
9547
10300
|
width,
|
@@ -10294,7 +11047,8 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
10294
11047
|
const curTimeRef = React.useRef(null);
|
10295
11048
|
const [show3DModal, setShow3DModal] = React.useState(false);
|
10296
11049
|
const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
10297
|
-
const
|
11050
|
+
const swiperRef = React.useRef();
|
11051
|
+
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
10298
11052
|
const data = isPost ? rec : popupDetailData;
|
10299
11053
|
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];
|
10300
11054
|
let cta = isPost
|
@@ -10414,9 +11168,9 @@ Made in Italy` })));
|
|
10414
11168
|
popupCurTimeRef.current = new Date();
|
10415
11169
|
setCheckCommodityIndex(index);
|
10416
11170
|
checkCommodityIndexRef.current = index;
|
10417
|
-
if (
|
10418
|
-
|
10419
|
-
|
11171
|
+
if (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) {
|
11172
|
+
swiperRef.current.swiper.slideTo(0);
|
11173
|
+
swiperRef.current.swiper.autoplay.start();
|
10420
11174
|
}
|
10421
11175
|
}, []);
|
10422
11176
|
const renderCommodityGroup = React.useCallback(() => {
|
@@ -10434,17 +11188,40 @@ Made in Italy` })));
|
|
10434
11188
|
return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
|
10435
11189
|
}, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
|
10436
11190
|
const iframeUrl = product === null || product === void 0 ? void 0 : product.remark;
|
11191
|
+
const handleMouseEnter = React.useCallback(() => {
|
11192
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
11193
|
+
swiperRef.current.swiper.autoplay.stop();
|
11194
|
+
}
|
11195
|
+
}, []);
|
11196
|
+
const handleMouseLeave = React.useCallback(() => {
|
11197
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
11198
|
+
swiperRef.current.swiper.autoplay.start();
|
11199
|
+
}
|
11200
|
+
}, []);
|
11201
|
+
const handleSlideChange = React.useCallback((swiper) => {
|
11202
|
+
setSwiperActiveIndex(swiper.activeIndex);
|
11203
|
+
}, []);
|
11204
|
+
const isAlly = React.useMemo(() => getScreenReader(), []);
|
10437
11205
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
10438
11206
|
React.createElement("div", Object.assign({ className: css.css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
10439
|
-
React.createElement("div", { style: { position: 'relative' } },
|
10440
|
-
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: {
|
11207
|
+
React.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
11208
|
+
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: {
|
10441
11209
|
clickable: true,
|
10442
11210
|
bulletActiveClass: 'swipe-item-active-bullet',
|
10443
11211
|
clickableClass: getDotsAlign,
|
10444
11212
|
bulletElement: 'button'
|
10445
|
-
}
|
11213
|
+
} }, (isAlly
|
11214
|
+
? {
|
11215
|
+
mousewheel: true,
|
11216
|
+
keyboard: true,
|
11217
|
+
navigation: true,
|
11218
|
+
a11y: {
|
11219
|
+
enabled: true
|
11220
|
+
}
|
11221
|
+
}
|
11222
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, autoplay: {
|
10446
11223
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
10447
|
-
},
|
11224
|
+
}, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
10448
11225
|
bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0,
|
10449
11226
|
fontSize: '14px'
|
10450
11227
|
} }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
|
@@ -10457,9 +11234,9 @@ Made in Italy` })));
|
|
10457
11234
|
backgroundColor: `${swiper === null || swiper === void 0 ? void 0 : swiper.dotsActiveColor}!important`,
|
10458
11235
|
opacity: 1
|
10459
11236
|
}
|
10460
|
-
}))) }, (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src) => {
|
11237
|
+
}))) }), (_y = product === null || product === void 0 ? void 0 : product.homePage) === null || _y === void 0 ? void 0 : _y.map((src, srcKey) => {
|
10461
11238
|
var _a;
|
10462
|
-
return (React.createElement(SwiperSlide, { key:
|
11239
|
+
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
10463
11240
|
React.createElement("div", { style: {
|
10464
11241
|
overflow: 'hidden',
|
10465
11242
|
width,
|
@@ -10510,7 +11287,7 @@ Made in Italy` })));
|
|
10510
11287
|
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: {
|
10511
11288
|
__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)
|
10512
11289
|
} }))),
|
10513
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("
|
11290
|
+
(!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 },
|
10514
11291
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
10515
11292
|
__html: setFontForText((_4 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _4 !== void 0 ? _4 : 'Shop now', buttonStyle)
|
10516
11293
|
} }))),
|
@@ -10988,39 +11765,43 @@ const CommodityList$1 = (_a) => {
|
|
10988
11765
|
eventName: 'PageView'
|
10989
11766
|
});
|
10990
11767
|
}, []);
|
10991
|
-
return (React.createElement("
|
11768
|
+
return (React.createElement("ul", { role: 'list', className: css.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) => {
|
10992
11769
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10993
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("
|
10994
|
-
|
10995
|
-
}), onClick: () => handleClick(item, index) }),
|
10996
|
-
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 }),
|
10997
|
-
React.createElement("div", { style: {
|
10998
|
-
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)`,
|
11770
|
+
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) },
|
11771
|
+
React.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: css.css({
|
10999
11772
|
display: 'flex',
|
11000
|
-
|
11001
|
-
|
11002
|
-
|
11003
|
-
|
11004
|
-
|
11005
|
-
|
11006
|
-
} })
|
11007
|
-
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: {
|
11008
|
-
__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)
|
11009
|
-
} })),
|
11010
|
-
React.createElement("div", { className: css.css({
|
11773
|
+
alignItems: 'normal',
|
11774
|
+
width: '100%',
|
11775
|
+
textAlign: 'left'
|
11776
|
+
}) }, props),
|
11777
|
+
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 }),
|
11778
|
+
React.createElement("div", { style: {
|
11779
|
+
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)`,
|
11011
11780
|
display: 'flex',
|
11012
|
-
|
11013
|
-
justifyContent: 'space-between'
|
11014
|
-
|
11015
|
-
overflow: 'hidden'
|
11016
|
-
}) },
|
11781
|
+
flexDirection: 'column',
|
11782
|
+
justifyContent: 'space-between'
|
11783
|
+
} },
|
11017
11784
|
React.createElement("div", null,
|
11018
|
-
React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.
|
11019
|
-
__html: (
|
11785
|
+
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: {
|
11786
|
+
__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)
|
11787
|
+
} }),
|
11788
|
+
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: {
|
11789
|
+
__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)
|
11020
11790
|
} })),
|
11021
|
-
React.createElement("div", { className:
|
11022
|
-
|
11023
|
-
|
11791
|
+
React.createElement("div", { className: css.css({
|
11792
|
+
display: 'flex',
|
11793
|
+
alignItems: 'flex-end',
|
11794
|
+
justifyContent: 'space-between',
|
11795
|
+
width: '100%',
|
11796
|
+
overflow: 'hidden'
|
11797
|
+
}) },
|
11798
|
+
React.createElement("div", null,
|
11799
|
+
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: {
|
11800
|
+
__html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
|
11801
|
+
} })),
|
11802
|
+
React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
|
11803
|
+
__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)
|
11804
|
+
} }))))))));
|
11024
11805
|
})));
|
11025
11806
|
};
|
11026
11807
|
var CommodityListComponent = React.memo(CommodityList$1);
|
@@ -11490,44 +12271,55 @@ var interactionRender$a = [
|
|
11490
12271
|
];
|
11491
12272
|
|
11492
12273
|
const EventProvider = (_a) => {
|
11493
|
-
var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink"]);
|
12274
|
+
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"]);
|
11494
12275
|
const ref = React.useRef(null);
|
11495
12276
|
const { popup } = useEditor();
|
11496
12277
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
11497
12278
|
const { jumpToWeb } = useEventReport();
|
11498
|
-
const
|
11499
|
-
|
11500
|
-
|
12279
|
+
const [element, setElement] = React.useState(null);
|
12280
|
+
const handleClick = lodash.throttle((event) => {
|
12281
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
12282
|
+
event.preventDefault();
|
12283
|
+
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;
|
11501
12284
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
11502
12285
|
eventSubject: 'clickCta',
|
11503
12286
|
eventDescription: 'User clicked the CTA'
|
11504
12287
|
}, rec, item, index);
|
11505
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(
|
12288
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(multItem && multiCheckIndex
|
12289
|
+
? 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 }));
|
12290
|
+
setElement(ref === null || ref === void 0 ? void 0 : ref.current);
|
11506
12291
|
if (isExternalLink) {
|
11507
|
-
|
11508
|
-
|
11509
|
-
const
|
12292
|
+
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);
|
12293
|
+
if (jumpLink || link) {
|
12294
|
+
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);
|
12295
|
+
const product = ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) || multItem;
|
11510
12296
|
jumpToWeb(rec, product, cta, index);
|
11511
|
-
window.location.href = window.getJointUtmLink(jumpLink ||
|
12297
|
+
window.location.href = window.getJointUtmLink(jumpLink || link || '');
|
11512
12298
|
}
|
11513
12299
|
}
|
11514
12300
|
else {
|
11515
12301
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
11516
12302
|
}
|
11517
12303
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
11518
|
-
|
12304
|
+
React.useEffect(() => {
|
12305
|
+
if (element && !(popup === null || popup === void 0 ? void 0 : popup.id)) {
|
12306
|
+
element === null || element === void 0 ? void 0 : element.focus();
|
12307
|
+
setElement(null);
|
12308
|
+
}
|
12309
|
+
}, [element, popup]);
|
12310
|
+
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));
|
11519
12311
|
};
|
11520
12312
|
var EventProvider$1 = React.memo(EventProvider);
|
11521
12313
|
|
11522
12314
|
var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
11523
12315
|
|
11524
12316
|
const Commodity$1 = (_a) => {
|
11525
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
12317
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
11526
12318
|
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"]);
|
11527
12319
|
const { sxpParameter } = useSxpDataSource();
|
11528
12320
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
11529
12321
|
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;
|
11530
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData,
|
12322
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
|
11531
12323
|
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 }),
|
11532
12324
|
React.createElement("div", { className: css.css({
|
11533
12325
|
color: '#fff',
|
@@ -11540,8 +12332,8 @@ const Commodity$1 = (_a) => {
|
|
11540
12332
|
React.createElement("div", { className: styles$8['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
11541
12333
|
__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)
|
11542
12334
|
} }),
|
11543
|
-
React.createElement("
|
11544
|
-
__html: setFontForText((
|
12335
|
+
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.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: {
|
12336
|
+
__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)
|
11545
12337
|
} }))));
|
11546
12338
|
};
|
11547
12339
|
var CommodityComponent = React.memo(Commodity$1);
|
@@ -11621,7 +12413,7 @@ const Appoint$1 = (_a) => {
|
|
11621
12413
|
const { sxpParameter } = useSxpDataSource();
|
11622
12414
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
11623
12415
|
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;
|
11624
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData,
|
12416
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: Object.assign({ alignItems: 'center' }, style), index: index }, props),
|
11625
12417
|
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 }),
|
11626
12418
|
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
|
11627
12419
|
__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)
|
@@ -11805,7 +12597,7 @@ const Link$1 = (_a) => {
|
|
11805
12597
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
11806
12598
|
(_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
11807
12599
|
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;
|
11808
|
-
return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData,
|
12600
|
+
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 : '' }),
|
11809
12601
|
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 }),
|
11810
12602
|
React.createElement("div", { className: css.css({
|
11811
12603
|
display: 'flex',
|
@@ -11915,12 +12707,12 @@ var interactionRender$7 = [
|
|
11915
12707
|
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
11916
12708
|
|
11917
12709
|
const CommodityDiro$1 = (_a) => {
|
11918
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
12710
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
11919
12711
|
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"]);
|
11920
12712
|
const { sxpParameter } = useSxpDataSource();
|
11921
12713
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
11922
12714
|
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;
|
11923
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData,
|
12715
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
|
11924
12716
|
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 }),
|
11925
12717
|
React.createElement("div", { className: css.css({
|
11926
12718
|
color: '#fff',
|
@@ -11933,8 +12725,8 @@ const CommodityDiro$1 = (_a) => {
|
|
11933
12725
|
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
11934
12726
|
__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)
|
11935
12727
|
} }),
|
11936
|
-
React.createElement("
|
11937
|
-
__html: setFontForText((
|
12728
|
+
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.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: {
|
12729
|
+
__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)
|
11938
12730
|
} }))));
|
11939
12731
|
};
|
11940
12732
|
var CommodityDiroComponent = React.memo(CommodityDiro$1);
|
@@ -12011,12 +12803,12 @@ var interactionRender$6 = [
|
|
12011
12803
|
var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
12012
12804
|
|
12013
12805
|
const CommodityDiroNew$1 = (_a) => {
|
12014
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
12806
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12015
12807
|
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"]);
|
12016
12808
|
const { sxpParameter } = useSxpDataSource();
|
12017
12809
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
12018
12810
|
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;
|
12019
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData,
|
12811
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
|
12020
12812
|
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 }),
|
12021
12813
|
React.createElement("div", { className: css.css({
|
12022
12814
|
color: '#fff',
|
@@ -12029,8 +12821,8 @@ const CommodityDiroNew$1 = (_a) => {
|
|
12029
12821
|
React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
12030
12822
|
__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)
|
12031
12823
|
} }),
|
12032
|
-
React.createElement("
|
12033
|
-
__html: setFontForText((
|
12824
|
+
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.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
|
12825
|
+
__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)
|
12034
12826
|
} }))));
|
12035
12827
|
};
|
12036
12828
|
var CommodityDiroNewComponent = React.memo(CommodityDiroNew$1);
|
@@ -12109,45 +12901,28 @@ var styles$4 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
|
12109
12901
|
|
12110
12902
|
const MultiCommodityDiro$1 = (_a) => {
|
12111
12903
|
var _b, _c;
|
12112
|
-
var { content, style, bgImg, recData,
|
12113
|
-
const {
|
12114
|
-
const
|
12115
|
-
|
12116
|
-
|
12117
|
-
|
12118
|
-
|
12119
|
-
|
12120
|
-
|
12121
|
-
|
12122
|
-
|
12123
|
-
|
12124
|
-
|
12125
|
-
|
12126
|
-
|
12127
|
-
|
12128
|
-
|
12129
|
-
|
12130
|
-
|
12131
|
-
|
12132
|
-
|
12133
|
-
|
12134
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
12135
|
-
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
12136
|
-
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 }),
|
12137
|
-
React.createElement("div", { className: css.css({
|
12138
|
-
color: '#000',
|
12139
|
-
display: 'flex',
|
12140
|
-
flexDirection: 'column',
|
12141
|
-
justifyContent: 'space-between',
|
12142
|
-
width: '100%',
|
12143
|
-
overflow: 'hidden'
|
12144
|
-
}) },
|
12145
|
-
React.createElement("div", { className: styles$4['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
12146
|
-
__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)
|
12147
|
-
} }),
|
12148
|
-
React.createElement("div", { className: css.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: {
|
12149
|
-
__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)
|
12150
|
-
} }))))));
|
12904
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
|
12905
|
+
const { sxpParameter } = useSxpDataSource();
|
12906
|
+
const [products] = React.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]);
|
12907
|
+
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
12908
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
12909
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
12910
|
+
React.createElement(EventProvider$1, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
|
12911
|
+
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 }),
|
12912
|
+
React.createElement("div", { className: css.css({
|
12913
|
+
color: '#000',
|
12914
|
+
display: 'flex',
|
12915
|
+
flexDirection: 'column',
|
12916
|
+
justifyContent: 'space-between',
|
12917
|
+
width: '100%',
|
12918
|
+
overflow: 'hidden'
|
12919
|
+
}) },
|
12920
|
+
React.createElement("div", { className: styles$4['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
12921
|
+
__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)
|
12922
|
+
} }),
|
12923
|
+
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.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: {
|
12924
|
+
__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)
|
12925
|
+
} })))))));
|
12151
12926
|
})));
|
12152
12927
|
};
|
12153
12928
|
var MultiCommodityDiroComponent = React.memo(MultiCommodityDiro$1);
|
@@ -12225,46 +13000,28 @@ var styles$3 = {"two-line-ellipsis":"index-module_two-line-ellipsis__mdzn0"};
|
|
12225
13000
|
|
12226
13001
|
const MultiCommodity$1 = (_a) => {
|
12227
13002
|
var _b, _c;
|
12228
|
-
var { content, style, bgImg, recData,
|
13003
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
|
12229
13004
|
const { sxpParameter } = useSxpDataSource();
|
12230
|
-
const
|
12231
|
-
|
12232
|
-
|
12233
|
-
|
12234
|
-
|
12235
|
-
|
12236
|
-
|
12237
|
-
|
12238
|
-
|
12239
|
-
|
12240
|
-
|
12241
|
-
|
12242
|
-
|
12243
|
-
|
12244
|
-
|
12245
|
-
|
12246
|
-
|
12247
|
-
|
12248
|
-
|
12249
|
-
|
12250
|
-
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
12251
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
12252
|
-
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
12253
|
-
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 }),
|
12254
|
-
React.createElement("div", { className: css.css({
|
12255
|
-
color: '#fff',
|
12256
|
-
display: 'flex',
|
12257
|
-
flexDirection: 'column',
|
12258
|
-
justifyContent: 'space-between',
|
12259
|
-
width: '100%',
|
12260
|
-
overflow: 'hidden'
|
12261
|
-
}) },
|
12262
|
-
React.createElement("div", { className: styles$3['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
12263
|
-
__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)
|
12264
|
-
} }),
|
12265
|
-
React.createElement("div", { className: css.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: {
|
12266
|
-
__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)
|
12267
|
-
} }))))));
|
13005
|
+
const [products] = React.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]);
|
13006
|
+
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
13007
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13008
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
13009
|
+
React.createElement(EventProvider$1, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
|
13010
|
+
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 }),
|
13011
|
+
React.createElement("div", { className: css.css({
|
13012
|
+
color: '#fff',
|
13013
|
+
display: 'flex',
|
13014
|
+
flexDirection: 'column',
|
13015
|
+
justifyContent: 'space-between',
|
13016
|
+
width: '100%',
|
13017
|
+
overflow: 'hidden'
|
13018
|
+
}) },
|
13019
|
+
React.createElement("div", { className: styles$3['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
13020
|
+
__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)
|
13021
|
+
} }),
|
13022
|
+
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.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: {
|
13023
|
+
__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)
|
13024
|
+
} })))))));
|
12268
13025
|
})));
|
12269
13026
|
};
|
12270
13027
|
var MultiCommodityComponent = React.memo(MultiCommodity$1);
|
@@ -12350,47 +13107,29 @@ var styles$2 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__fselR"};
|
|
12350
13107
|
|
12351
13108
|
const MultiCommodityDiroNew$1 = (_a) => {
|
12352
13109
|
var _b, _c;
|
12353
|
-
var { content, style, bgImg, recData,
|
12354
|
-
const {
|
12355
|
-
const
|
12356
|
-
|
12357
|
-
|
12358
|
-
|
12359
|
-
|
12360
|
-
|
12361
|
-
|
12362
|
-
|
12363
|
-
|
12364
|
-
|
12365
|
-
|
12366
|
-
|
12367
|
-
|
12368
|
-
|
12369
|
-
|
12370
|
-
|
12371
|
-
|
12372
|
-
|
12373
|
-
|
12374
|
-
|
12375
|
-
|
12376
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
12377
|
-
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
12378
|
-
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 }),
|
12379
|
-
React.createElement("div", { className: css.css({
|
12380
|
-
color: '#fff',
|
12381
|
-
display: 'flex',
|
12382
|
-
flexDirection: 'column',
|
12383
|
-
justifyContent: 'center',
|
12384
|
-
width: '100%',
|
12385
|
-
overflow: 'hidden',
|
12386
|
-
lineHeight: '20px'
|
12387
|
-
}) },
|
12388
|
-
React.createElement("div", { className: styles$2['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
12389
|
-
__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)
|
12390
|
-
} }),
|
12391
|
-
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
|
12392
|
-
__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)
|
12393
|
-
} }))))));
|
13110
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
|
13111
|
+
const { sxpParameter } = useSxpDataSource();
|
13112
|
+
const [products] = React.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]);
|
13113
|
+
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
13114
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
13115
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
13116
|
+
React.createElement(EventProvider$1, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
|
13117
|
+
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 }),
|
13118
|
+
React.createElement("div", { className: css.css({
|
13119
|
+
color: '#fff',
|
13120
|
+
display: 'flex',
|
13121
|
+
flexDirection: 'column',
|
13122
|
+
justifyContent: 'center',
|
13123
|
+
width: '100%',
|
13124
|
+
overflow: 'hidden',
|
13125
|
+
lineHeight: '20px'
|
13126
|
+
}) },
|
13127
|
+
React.createElement("div", { className: styles$2['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
13128
|
+
__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)
|
13129
|
+
} }),
|
13130
|
+
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.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
|
13131
|
+
__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)
|
13132
|
+
} })))))));
|
12394
13133
|
})));
|
12395
13134
|
};
|
12396
13135
|
var MultiCommodityDiroNewComponent = React.memo(MultiCommodityDiroNew$1);
|
@@ -15403,7 +16142,7 @@ var styles = {"aniLinkPopup":"index-module_aniLinkPopup__YT7kj","animated-fadeIn
|
|
15403
16142
|
|
15404
16143
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
15405
16144
|
const AniLinkPopup$1 = (_a) => {
|
15406
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
|
16145
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
15407
16146
|
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"]);
|
15408
16147
|
style === null || style === void 0 ? true : delete style.transform;
|
15409
16148
|
const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
@@ -15460,12 +16199,12 @@ const AniLinkPopup$1 = (_a) => {
|
|
15460
16199
|
paddingLeft: '6px'
|
15461
16200
|
} }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css.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.css(aniTimStyle)}`, onClick: handleTo }),
|
15462
16201
|
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 } },
|
15463
|
-
React.createElement("img", { src: (
|
15464
|
-
React.createElement(Img$1, { src: src, rec: recData, item: (
|
16202
|
+
React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
|
16203
|
+
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 }),
|
15465
16204
|
(!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: {
|
15466
|
-
__html: setFontForText((
|
16205
|
+
__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)
|
15467
16206
|
} })),
|
15468
|
-
React.createElement("div", { className: styles['one-line-ellipsis'], style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((
|
16207
|
+
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: {
|
15469
16208
|
__html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
15470
16209
|
} })))));
|
15471
16210
|
};
|
@@ -16477,15 +17216,16 @@ const Picture = (props) => {
|
|
16477
17216
|
|
16478
17217
|
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
16479
17218
|
var _a, _b;
|
16480
|
-
const
|
17219
|
+
const swiperRef = React.useRef();
|
16481
17220
|
const { isActive } = useSwiperSlide();
|
16482
17221
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
16483
17222
|
const [isLoad, setIsLoad] = React.useState(false);
|
16484
17223
|
const [imgInfo, setImgInfo] = React.useState();
|
16485
17224
|
const initTime = new Date();
|
17225
|
+
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
16486
17226
|
React.useEffect(() => {
|
16487
17227
|
if (isLoad && isActive) {
|
16488
|
-
(
|
17228
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
16489
17229
|
if (openHashtag) {
|
16490
17230
|
onViewImageEndEvent(rec);
|
16491
17231
|
}
|
@@ -16494,7 +17234,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
16494
17234
|
}
|
16495
17235
|
}
|
16496
17236
|
else {
|
16497
|
-
(
|
17237
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
16498
17238
|
}
|
16499
17239
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
16500
17240
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -16518,27 +17258,51 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
16518
17258
|
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
16519
17259
|
};
|
16520
17260
|
}, [imgInfo]);
|
16521
|
-
|
16522
|
-
|
16523
|
-
|
16524
|
-
|
16525
|
-
|
16526
|
-
|
16527
|
-
|
16528
|
-
|
16529
|
-
|
16530
|
-
|
16531
|
-
|
16532
|
-
|
16533
|
-
|
16534
|
-
|
16535
|
-
|
16536
|
-
|
17261
|
+
const handleMouseEnter = React.useCallback(() => {
|
17262
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
17263
|
+
swiperRef.current.swiper.autoplay.stop();
|
17264
|
+
}
|
17265
|
+
}, []);
|
17266
|
+
const handleMouseLeave = React.useCallback(() => {
|
17267
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
17268
|
+
swiperRef.current.swiper.autoplay.start();
|
17269
|
+
}
|
17270
|
+
}, []);
|
17271
|
+
const handleSlideChange = React.useCallback((swiper) => {
|
17272
|
+
setSwiperActiveIndex(swiper.activeIndex);
|
17273
|
+
}, []);
|
17274
|
+
const isAlly = React.useMemo(() => getScreenReader(), []);
|
17275
|
+
return (React.createElement("div", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
17276
|
+
React.createElement(Swiper, Object.assign({ defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
|
17277
|
+
clickable: true,
|
17278
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
17279
|
+
bulletElement: 'button'
|
17280
|
+
} }, (isAlly
|
17281
|
+
? {
|
17282
|
+
mousewheel: true,
|
17283
|
+
keyboard: true,
|
17284
|
+
navigation: true,
|
17285
|
+
a11y: {
|
17286
|
+
enabled: true
|
17287
|
+
}
|
16537
17288
|
}
|
16538
|
-
|
16539
|
-
|
16540
|
-
|
16541
|
-
|
17289
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
17290
|
+
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
17291
|
+
fontSize: '14px'
|
17292
|
+
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
17293
|
+
'.swiper-pagination-bullet': {
|
17294
|
+
backgroundColor: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor,
|
17295
|
+
opacity: 1
|
17296
|
+
}
|
17297
|
+
})), ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor) && {
|
17298
|
+
'.swipe-item-active-bullet': {
|
17299
|
+
backgroundColor: `${imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor}!important`,
|
17300
|
+
opacity: 1
|
17301
|
+
}
|
17302
|
+
}))), 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) => {
|
17303
|
+
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
17304
|
+
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
17305
|
+
}))));
|
16542
17306
|
};
|
16543
17307
|
var PictureGroup$3 = React.memo(PictureGroup$2);
|
16544
17308
|
|
@@ -16546,7 +17310,7 @@ var PictureGroup$3 = React.memo(PictureGroup$2);
|
|
16546
17310
|
* @Author: binruan@chatlabs.com
|
16547
17311
|
* @Date: 2024-01-15 19:03:09
|
16548
17312
|
* @LastEditors: binruan@chatlabs.com
|
16549
|
-
* @LastEditTime: 2024-
|
17313
|
+
* @LastEditTime: 2024-11-19 10:40:36
|
16550
17314
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
|
16551
17315
|
*
|
16552
17316
|
*/
|
@@ -16587,8 +17351,8 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle, hashTagRigh
|
|
16587
17351
|
marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px`,
|
16588
17352
|
width: hashTagRightMargin
|
16589
17353
|
} },
|
16590
|
-
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: '
|
16591
|
-
React.createElement("
|
17354
|
+
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' },
|
17355
|
+
React.createElement("button", { className: 'clc-sxp-bottom-hashtag-item-button', "aria-label": item, "aria-describedby": item, dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
|
16592
17356
|
};
|
16593
17357
|
var Hashtag$1 = React.memo(Hashtag);
|
16594
17358
|
|
@@ -16804,7 +17568,7 @@ var ConsentPopup = React.memo(Consent);
|
|
16804
17568
|
* @Author: binruan@chatlabs.com
|
16805
17569
|
* @Date: 2024-03-20 10:27:31
|
16806
17570
|
* @LastEditors: binruan@chatlabs.com
|
16807
|
-
* @LastEditTime: 2024-11-
|
17571
|
+
* @LastEditTime: 2024-11-19 09:47:45
|
16808
17572
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16809
17573
|
*
|
16810
17574
|
*/
|
@@ -17292,9 +18056,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
17292
18056
|
alignItems: 'center'
|
17293
18057
|
} },
|
17294
18058
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
|
18059
|
+
renderBottom(rec, index),
|
17295
18060
|
renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
17296
18061
|
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
17297
|
-
renderBottom(rec, index),
|
17298
18062
|
renderContent(rec, index)))))));
|
17299
18063
|
});
|
17300
18064
|
}, [
|
@@ -17361,9 +18125,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
17361
18125
|
}
|
17362
18126
|
}
|
17363
18127
|
}, direction: 'vertical', height: height },
|
18128
|
+
renderView,
|
17364
18129
|
renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
17365
|
-
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
17366
|
-
renderView),
|
18130
|
+
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
|
17367
18131
|
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)),
|
17368
18132
|
React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig })));
|
17369
18133
|
};
|