@tarojs/components 4.0.0-beta.61 → 4.0.0-beta.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-draggable-sheet-core.cjs.entry.js +21 -0
- package/dist/cjs/taro-grid-builder-core.cjs.entry.js +21 -0
- package/dist/cjs/taro-list-builder-core.cjs.entry.js +21 -0
- package/dist/cjs/taro-movable-area-core_2.cjs.entry.js +3 -1
- package/dist/cjs/taro-nested-scroll-body-core.cjs.entry.js +21 -0
- package/dist/cjs/taro-nested-scroll-header-core.cjs.entry.js +21 -0
- package/dist/cjs/taro-open-container-core.cjs.entry.js +21 -0
- package/dist/cjs/taro-span-core.cjs.entry.js +21 -0
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +35 -3
- package/dist/cjs/taro-tabbar.cjs.entry.js +1 -1
- package/dist/cjs/taro-video-control_3.cjs.entry.js +12 -3
- package/dist/collection/collection-manifest.json +7 -0
- package/dist/collection/components/draggable-sheet/draggable-sheet.js +11 -0
- package/dist/collection/components/grid-builder/grid-builder.js +11 -0
- package/dist/collection/components/list-builder/list-builder.js +11 -0
- package/dist/collection/components/movable-area/movable-view.js +3 -1
- package/dist/collection/components/nested-scroll-body/nested-scroll-body.js +11 -0
- package/dist/collection/components/nested-scroll-header/nested-scroll-header.js +11 -0
- package/dist/collection/components/open-container/open-container.js +11 -0
- package/dist/collection/components/span/span.js +11 -0
- package/dist/collection/components/swiper/swiper.js +55 -3
- package/dist/collection/components/tabbar/style/index.css +1 -1
- package/dist/collection/components/video/video.js +8 -3
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +7 -0
- package/dist/components/taro-draggable-sheet-core.d.ts +11 -0
- package/dist/components/taro-draggable-sheet-core.js +33 -0
- package/dist/components/taro-grid-builder-core.d.ts +11 -0
- package/dist/components/taro-grid-builder-core.js +33 -0
- package/dist/components/taro-list-builder-core.d.ts +11 -0
- package/dist/components/taro-list-builder-core.js +33 -0
- package/dist/components/taro-movable-view-core.js +3 -1
- package/dist/components/taro-nested-scroll-body-core.d.ts +11 -0
- package/dist/components/taro-nested-scroll-body-core.js +33 -0
- package/dist/components/taro-nested-scroll-header-core.d.ts +11 -0
- package/dist/components/taro-nested-scroll-header-core.js +33 -0
- package/dist/components/taro-open-container-core.d.ts +11 -0
- package/dist/components/taro-open-container-core.js +33 -0
- package/dist/components/taro-span-core.d.ts +11 -0
- package/dist/components/taro-span-core.js +33 -0
- package/dist/components/taro-swiper-core.js +36 -3
- package/dist/components/taro-tabbar.js +1 -1
- package/dist/components/taro-video-core.js +8 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-draggable-sheet-core.entry.js +17 -0
- package/dist/esm/taro-grid-builder-core.entry.js +17 -0
- package/dist/esm/taro-list-builder-core.entry.js +17 -0
- package/dist/esm/taro-movable-area-core_2.entry.js +3 -1
- package/dist/esm/taro-nested-scroll-body-core.entry.js +17 -0
- package/dist/esm/taro-nested-scroll-header-core.entry.js +17 -0
- package/dist/esm/taro-open-container-core.entry.js +17 -0
- package/dist/esm/taro-span-core.entry.js +17 -0
- package/dist/esm/taro-swiper-core_2.entry.js +35 -3
- package/dist/esm/taro-tabbar.entry.js +1 -1
- package/dist/esm/taro-video-control_3.entry.js +8 -3
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-draggable-sheet-core.entry.js +1 -0
- package/dist/esm-es5/taro-grid-builder-core.entry.js +1 -0
- package/dist/esm-es5/taro-list-builder-core.entry.js +1 -0
- package/dist/esm-es5/taro-movable-area-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-nested-scroll-body-core.entry.js +1 -0
- package/dist/esm-es5/taro-nested-scroll-header-core.entry.js +1 -0
- package/dist/esm-es5/taro-open-container-core.entry.js +1 -0
- package/dist/esm-es5/taro-span-core.entry.js +1 -0
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
- package/dist/hydrate/index.js +194 -8
- package/dist/taro-components/p-111fadd7.system.entry.js +1 -0
- package/dist/taro-components/{p-e8753c5c.entry.js → p-1acf7537.entry.js} +1 -1
- package/dist/taro-components/p-1d102ddb.system.entry.js +1 -0
- package/dist/taro-components/p-34ba9330.system.entry.js +1 -0
- package/dist/taro-components/p-3e4b5391.system.entry.js +1 -0
- package/dist/taro-components/p-4621b303.system.entry.js +1 -0
- package/dist/taro-components/p-477f8fbd.system.js +1 -1
- package/dist/taro-components/p-4c30ea10.entry.js +1 -0
- package/dist/taro-components/p-5186ab96.system.entry.js +1 -0
- package/dist/taro-components/p-55e54f2a.system.entry.js +1 -0
- package/dist/taro-components/p-6dd357b9.entry.js +1 -0
- package/dist/taro-components/{p-7615d8a6.system.entry.js → p-6ffc9bda.system.entry.js} +1 -1
- package/dist/taro-components/p-751d42cb.entry.js +1 -0
- package/dist/taro-components/p-76c0f443.entry.js +1 -0
- package/dist/taro-components/p-7bc6aa36.entry.js +1 -0
- package/dist/taro-components/p-87b0d22f.entry.js +1 -0
- package/dist/taro-components/p-895982a4.entry.js +1 -0
- package/dist/taro-components/p-9f1b0ae1.entry.js +1 -0
- package/dist/taro-components/{p-be68ae6e.system.entry.js → p-b0f12e64.system.entry.js} +1 -1
- package/dist/taro-components/{p-1b1034dc.entry.js → p-b4047b11.entry.js} +1 -1
- package/dist/taro-components/p-cc993977.system.entry.js +1 -0
- package/dist/taro-components/p-d6bd1a5b.entry.js +1 -0
- package/dist/taro-components/p-fa9dbb6f.system.entry.js +1 -0
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/draggable-sheet/draggable-sheet.d.ts +5 -0
- package/dist/types/components/grid-builder/grid-builder.d.ts +5 -0
- package/dist/types/components/list-builder/list-builder.d.ts +5 -0
- package/dist/types/components/nested-scroll-body/nested-scroll-body.d.ts +5 -0
- package/dist/types/components/nested-scroll-header/nested-scroll-header.d.ts +5 -0
- package/dist/types/components/open-container/open-container.d.ts +5 -0
- package/dist/types/components/span/span.d.ts +5 -0
- package/dist/types/components/swiper/swiper.d.ts +5 -0
- package/dist/types/components.d.ts +99 -0
- package/lib/react/components.d.ts +8 -1
- package/lib/react/components.js +9 -2
- package/lib/react/components.js.map +1 -1
- package/lib/react/index.js +1 -1
- package/lib/vue2/components.d.ts +9 -1
- package/lib/vue2/components.js +24 -2
- package/lib/vue2/components.js.map +1 -1
- package/lib/vue2/index.js +1 -1
- package/lib/vue3/components.d.ts +8 -1
- package/lib/vue3/components.js +10 -2
- package/lib/vue3/components.js.map +1 -1
- package/lib/vue3/index.js +1 -1
- package/package.json +3 -3
- package/types/DraggableSheet.d.ts +47 -0
- package/types/GridBuilder.d.ts +72 -0
- package/types/GridView.d.ts +18 -4
- package/types/ListBuilder.d.ts +55 -0
- package/types/ListView.d.ts +8 -1
- package/types/NestedScrollBody.d.ts +15 -0
- package/types/NestedScrollHeader.d.ts +15 -0
- package/types/OpenContainer.d.ts +74 -0
- package/types/Script.d.ts +37 -0
- package/types/ScrollView.d.ts +7 -1
- package/types/Snapshot.d.ts +12 -3
- package/types/Span.d.ts +14 -0
- package/types/StickyHeader.d.ts +14 -1
- package/types/StickySection.d.ts +6 -0
- package/types/Swiper.d.ts +1 -1
- package/types/Text.d.ts +16 -0
- package/types/index.d.ts +8 -0
- package/types/index.vue3.d.ts +4 -0
- package/dist/taro-components/p-22f6316e.entry.js +0 -1
- package/dist/taro-components/p-54b24e2f.system.entry.js +0 -1
- package/dist/taro-components/p-c2da52a5.entry.js +0 -1
- package/dist/taro-components/p-dbeadc04.system.entry.js +0 -1
|
@@ -72,6 +72,7 @@ export class Swiper {
|
|
|
72
72
|
this.indicatorActiveColor = '#000000';
|
|
73
73
|
this.autoplay = false;
|
|
74
74
|
this.current = 0;
|
|
75
|
+
this.currentItemId = '';
|
|
75
76
|
this.interval = 5000;
|
|
76
77
|
this.duration = 500;
|
|
77
78
|
this.circular = false;
|
|
@@ -86,7 +87,7 @@ export class Swiper {
|
|
|
86
87
|
this.observerLast = undefined;
|
|
87
88
|
}
|
|
88
89
|
watchCurrent(newVal) {
|
|
89
|
-
if (!this.isWillLoadCalled)
|
|
90
|
+
if (this.currentItemId || !this.isWillLoadCalled)
|
|
90
91
|
return;
|
|
91
92
|
const n = parseInt(newVal, 10);
|
|
92
93
|
if (isNaN(n))
|
|
@@ -100,6 +101,25 @@ export class Swiper {
|
|
|
100
101
|
this.swiper.slideTo(n); // 更新下标
|
|
101
102
|
}
|
|
102
103
|
}
|
|
104
|
+
watchCurrentItemId(newVal) {
|
|
105
|
+
var _a;
|
|
106
|
+
const wrapper = (_a = this.swiper.$wrapperEl) === null || _a === void 0 ? void 0 : _a[0];
|
|
107
|
+
let itemIdIndex = 0;
|
|
108
|
+
wrapper.querySelectorAll('taro-swiper-item-core:not(.swiper-slide-duplicate)').forEach((swiperItem, index) => {
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
if (swiperItem.itemId && swiperItem.itemId === newVal) {
|
|
111
|
+
itemIdIndex = index;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
if (this.circular) {
|
|
115
|
+
if (!this.swiper.isBeginning && !this.swiper.isEnd) {
|
|
116
|
+
this.swiper.slideToLoop(itemIdIndex); // 更新下标
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this.swiper.slideTo(itemIdIndex); // 更新下标
|
|
121
|
+
}
|
|
122
|
+
}
|
|
103
123
|
watchAutoplay(newVal) {
|
|
104
124
|
if (!this.isWillLoadCalled || !this.swiper)
|
|
105
125
|
return;
|
|
@@ -204,7 +224,18 @@ export class Swiper {
|
|
|
204
224
|
(_f = (_e = this.observerLast) === null || _e === void 0 ? void 0 : _e.disconnect) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
205
225
|
}
|
|
206
226
|
handleInit() {
|
|
207
|
-
const { autoplay, circular, current, displayMultipleItems, duration, interval, vertical } = this;
|
|
227
|
+
const { autoplay, circular, current, currentItemId, displayMultipleItems, duration, interval, vertical } = this;
|
|
228
|
+
let initialSlide = circular ? current + 1 : current;
|
|
229
|
+
if (currentItemId) {
|
|
230
|
+
let itemIdIndex = 0;
|
|
231
|
+
this.el.querySelectorAll('taro-swiper-item-core:not(.swiper-slide-duplicate)').forEach((swiperItem, index) => {
|
|
232
|
+
// @ts-ignore
|
|
233
|
+
if (swiperItem.itemId && swiperItem.itemId === currentItemId) {
|
|
234
|
+
itemIdIndex = index;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
initialSlide = circular ? itemIdIndex + 1 : itemIdIndex;
|
|
238
|
+
}
|
|
208
239
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
209
240
|
const that = this;
|
|
210
241
|
const options = {
|
|
@@ -212,7 +243,7 @@ export class Swiper {
|
|
|
212
243
|
direction: vertical ? 'vertical' : 'horizontal',
|
|
213
244
|
loop: circular,
|
|
214
245
|
slidesPerView: displayMultipleItems,
|
|
215
|
-
initialSlide:
|
|
246
|
+
initialSlide: initialSlide,
|
|
216
247
|
speed: duration,
|
|
217
248
|
observer: true,
|
|
218
249
|
observeParents: true,
|
|
@@ -411,6 +442,24 @@ export class Swiper {
|
|
|
411
442
|
"reflect": false,
|
|
412
443
|
"defaultValue": "0"
|
|
413
444
|
},
|
|
445
|
+
"currentItemId": {
|
|
446
|
+
"type": "string",
|
|
447
|
+
"mutable": false,
|
|
448
|
+
"complexType": {
|
|
449
|
+
"original": "string",
|
|
450
|
+
"resolved": "string",
|
|
451
|
+
"references": {}
|
|
452
|
+
},
|
|
453
|
+
"required": false,
|
|
454
|
+
"optional": false,
|
|
455
|
+
"docs": {
|
|
456
|
+
"tags": [],
|
|
457
|
+
"text": "\u5F53\u524D\u6240\u5728\u6ED1\u5757\u7684 item-id"
|
|
458
|
+
},
|
|
459
|
+
"attribute": "current-item-id",
|
|
460
|
+
"reflect": false,
|
|
461
|
+
"defaultValue": "''"
|
|
462
|
+
},
|
|
414
463
|
"interval": {
|
|
415
464
|
"type": "number",
|
|
416
465
|
"mutable": false,
|
|
@@ -623,6 +672,9 @@ export class Swiper {
|
|
|
623
672
|
return [{
|
|
624
673
|
"propName": "current",
|
|
625
674
|
"methodName": "watchCurrent"
|
|
675
|
+
}, {
|
|
676
|
+
"propName": "currentItemId",
|
|
677
|
+
"methodName": "watchCurrentItemId"
|
|
626
678
|
}, {
|
|
627
679
|
"propName": "autoplay",
|
|
628
680
|
"methodName": "watchAutoplay"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.weui-tabbar{z-index:500;background-color:#f7f7fa;width:100%;display:flex;position:absolute;bottom:0}.weui-tabbar:before{content:" ";color:#c0bfc4;transform-origin:0 0;border-top:1px solid #c0bfc4;height:1px;position:absolute;top:0;left:0;right:0;transform:scaleY(.5)}.weui-tabbar__item{padding:5px 0;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);color:#999;text-align:center;-webkit-tap-highlight-color:transparent;flex:1;font-size:0;display:block}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#09bb07}.weui-tabbar__icon{width:27px;height:27px;display:inline-block}.weui-tabbar__icon img{width:100%;height:100%}i.weui-tabbar__icon,.weui-tabbar__icon>i{color:#999;font-size:24px}.weui-tabbar__label{text-align:center;color:#999;font-size:10px;line-height:1.8}.weui-badge{color:#fff;text-align:center;vertical-align:middle;background-color:#f43530;border-radius:18px;min-width:8px;padding:.15em .4em;font-size:12px;line-height:1.2;display:inline-block}.weui-badge_dot{min-width:0;padding:.4em}html,body{height:100%}:root{--taro-tabbar-height
|
|
1
|
+
.weui-tabbar{z-index:500;background-color:#f7f7fa;align-items:center;width:100%;display:flex;position:absolute;bottom:0}.weui-tabbar:before{content:" ";color:#c0bfc4;transform-origin:0 0;border-top:1px solid #c0bfc4;height:1px;position:absolute;top:0;left:0;right:0;transform:scaleY(.5)}.weui-tabbar__item{padding:5px 0;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);color:#999;text-align:center;-webkit-tap-highlight-color:transparent;flex:1;font-size:0;display:block}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#09bb07}.weui-tabbar__icon{width:27px;height:27px;display:inline-block}.weui-tabbar__icon img{width:100%;height:100%}i.weui-tabbar__icon,.weui-tabbar__icon>i{color:#999;font-size:24px}.weui-tabbar__label{text-align:center;color:#999;font-size:10px;line-height:1.8}.weui-badge{color:#fff;text-align:center;vertical-align:middle;background-color:#f43530;border-radius:18px;min-width:8px;padding:.15em .4em;font-size:12px;line-height:1.2;display:inline-block}.weui-badge_dot{min-width:0;padding:.4em}html,body{height:100%}:root{--taro-tabbar-height:50px}#app{height:100%}.taro-tabbar__border-white:before{border-top-color:#fff!important}.taro-tabbar__container{flex-direction:column;height:100%;display:flex;overflow:hidden}.taro-tabbar__panel{-webkit-overflow-scrolling:auto;flex:1;position:relative;overflow:auto}.taro-tabbar__tabbar{height:var(--taro-tabbar-height);width:100%;transition:bottom .2s,top .2s;position:relative}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{margin-bottom:constant(safe-area-inset-bottom);margin-bottom:env(safe-area-inset-bottom);bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{flex:0 0;top:-52px}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
|
+
import Taro from '@tarojs/taro';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import { throttle } from '../../utils';
|
|
4
5
|
import { formatTime, calcDist, normalizeNumber, screenFn, isHls, scene } from './utils';
|
|
@@ -213,11 +214,15 @@ export class Video {
|
|
|
213
214
|
if (this.isFullScreen && !document[screenFn.fullscreenElement]) {
|
|
214
215
|
setTimeout(() => {
|
|
215
216
|
this.videoRef[screenFn.requestFullscreen]({ navigationUI: 'auto' });
|
|
217
|
+
Taro.eventCenter.trigger('__taroEnterFullScreen', {});
|
|
216
218
|
}, 0);
|
|
217
219
|
}
|
|
218
|
-
else
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
else {
|
|
221
|
+
if (!fromBrowser) {
|
|
222
|
+
// Note: 全屏后,"退出全屏"是浏览器按钮是浏览器内部按钮,非html按钮,点击"退出全屏"按钮是浏览器内部实现功能。此时再次调用exitFullscreen反而会报错,因此不再调用
|
|
223
|
+
document[screenFn.exitFullscreen]();
|
|
224
|
+
}
|
|
225
|
+
Taro.eventCenter.trigger('__taroExitFullScreen', {});
|
|
221
226
|
}
|
|
222
227
|
};
|
|
223
228
|
this.toggleMute = (e) => {
|
|
@@ -20,10 +20,12 @@ export { ContactButton as TaroContactButtonCore } from '../types/components/cont
|
|
|
20
20
|
export { CoverImage as TaroCoverImageCore } from '../types/components/cover-image/cover-image';
|
|
21
21
|
export { CoverView as TaroCoverViewCore } from '../types/components/cover-view/cover-view';
|
|
22
22
|
export { CustomWrapper as TaroCustomWrapperCore } from '../types/components/custom-wrapper/custom-wrapper';
|
|
23
|
+
export { DraggableSheet as TaroDraggableSheetCore } from '../types/components/draggable-sheet/draggable-sheet';
|
|
23
24
|
export { Editor as TaroEditorCore } from '../types/components/editor/editor';
|
|
24
25
|
export { FollowSwan as TaroFollowSwanCore } from '../types/components/follow-swan/follow-swan';
|
|
25
26
|
export { Form as TaroFormCore } from '../types/components/form/form';
|
|
26
27
|
export { FunctionalPageNavigator as TaroFunctionalPageNavigatorCore } from '../types/components/functional-page-navigator/functional-page-navigator';
|
|
28
|
+
export { GridBuilder as TaroGridBuilderCore } from '../types/components/grid-builder/grid-builder';
|
|
27
29
|
export { GridView as TaroGridViewCore } from '../types/components/grid-view/grid-view';
|
|
28
30
|
export { Icon as TaroIconCore } from '../types/components/icon/icon';
|
|
29
31
|
export { Image as TaroImageCore } from '../types/components/image/image';
|
|
@@ -33,6 +35,7 @@ export { KeyboardAccessory as TaroKeyboardAccessoryCore } from '../types/compone
|
|
|
33
35
|
export { Label as TaroLabelCore } from '../types/components/label/label';
|
|
34
36
|
export { Lifestyle as TaroLifestyleCore } from '../types/components/lifestyle/lifestyle';
|
|
35
37
|
export { Like as TaroLikeCore } from '../types/components/like/like';
|
|
38
|
+
export { ListBuilder as TaroListBuilderCore } from '../types/components/list-builder/list-builder';
|
|
36
39
|
export { ListView as TaroListViewCore } from '../types/components/list-view/list-view';
|
|
37
40
|
export { LivePlayer as TaroLivePlayerCore } from '../types/components/live-player/live-player';
|
|
38
41
|
export { LivePusher as TaroLivePusherCore } from '../types/components/live-pusher/live-pusher';
|
|
@@ -45,7 +48,10 @@ export { MovableView as TaroMovableViewCore } from '../types/components/movable-
|
|
|
45
48
|
export { NativeSlot as TaroNativeSlotCore } from '../types/components/slot/native-slot';
|
|
46
49
|
export { NavigationBar as TaroNavigationBarCore } from '../types/components/navigation-bar/navigation-bar';
|
|
47
50
|
export { Navigator as TaroNavigatorCore } from '../types/components/navigator/navigator';
|
|
51
|
+
export { NestedScrollBody as TaroNestedScrollBodyCore } from '../types/components/nested-scroll-body/nested-scroll-body';
|
|
52
|
+
export { NestedScrollHeader as TaroNestedScrollHeaderCore } from '../types/components/nested-scroll-header/nested-scroll-header';
|
|
48
53
|
export { OfficialAccount as TaroOfficialAccountCore } from '../types/components/official-account/official-account';
|
|
54
|
+
export { OpenContainer as TaroOpenContainerCore } from '../types/components/open-container/open-container';
|
|
49
55
|
export { OpenData as TaroOpenDataCore } from '../types/components/open-data/open-data';
|
|
50
56
|
export { PageContainer as TaroPageContainerCore } from '../types/components/page-container/page-container';
|
|
51
57
|
export { PageMeta as TaroPageMetaCore } from '../types/components/page-meta/page-meta';
|
|
@@ -66,6 +72,7 @@ export { ShareElement as TaroShareElementCore } from '../types/components/share-
|
|
|
66
72
|
export { Slider as TaroSliderCore } from '../types/components/slider/slider';
|
|
67
73
|
export { Slot as TaroSlotCore } from '../types/components/slot/slot';
|
|
68
74
|
export { Snapshot as TaroSnapshotCore } from '../types/components/snapshot/snapshot';
|
|
75
|
+
export { Span as TaroSpanCore } from '../types/components/span/span';
|
|
69
76
|
export { StickyHeader as TaroStickyHeaderCore } from '../types/components/sticky-header/sticky-header';
|
|
70
77
|
export { StickySection as TaroStickySectionCore } from '../types/components/sticky-section/sticky-section';
|
|
71
78
|
export { Swiper as TaroSwiperCore } from '../types/components/swiper/swiper';
|
package/dist/components/index.js
CHANGED
|
@@ -20,10 +20,12 @@ export { TaroContactButtonCore, defineCustomElement as defineCustomElementTaroCo
|
|
|
20
20
|
export { TaroCoverImageCore, defineCustomElement as defineCustomElementTaroCoverImageCore } from './taro-cover-image-core.js';
|
|
21
21
|
export { TaroCoverViewCore, defineCustomElement as defineCustomElementTaroCoverViewCore } from './taro-cover-view-core.js';
|
|
22
22
|
export { TaroCustomWrapperCore, defineCustomElement as defineCustomElementTaroCustomWrapperCore } from './taro-custom-wrapper-core.js';
|
|
23
|
+
export { TaroDraggableSheetCore, defineCustomElement as defineCustomElementTaroDraggableSheetCore } from './taro-draggable-sheet-core.js';
|
|
23
24
|
export { TaroEditorCore, defineCustomElement as defineCustomElementTaroEditorCore } from './taro-editor-core.js';
|
|
24
25
|
export { TaroFollowSwanCore, defineCustomElement as defineCustomElementTaroFollowSwanCore } from './taro-follow-swan-core.js';
|
|
25
26
|
export { TaroFormCore, defineCustomElement as defineCustomElementTaroFormCore } from './taro-form-core.js';
|
|
26
27
|
export { TaroFunctionalPageNavigatorCore, defineCustomElement as defineCustomElementTaroFunctionalPageNavigatorCore } from './taro-functional-page-navigator-core.js';
|
|
28
|
+
export { TaroGridBuilderCore, defineCustomElement as defineCustomElementTaroGridBuilderCore } from './taro-grid-builder-core.js';
|
|
27
29
|
export { TaroGridViewCore, defineCustomElement as defineCustomElementTaroGridViewCore } from './taro-grid-view-core.js';
|
|
28
30
|
export { TaroIconCore, defineCustomElement as defineCustomElementTaroIconCore } from './taro-icon-core.js';
|
|
29
31
|
export { TaroImageCore, defineCustomElement as defineCustomElementTaroImageCore } from './taro-image-core.js';
|
|
@@ -33,6 +35,7 @@ export { TaroKeyboardAccessoryCore, defineCustomElement as defineCustomElementTa
|
|
|
33
35
|
export { TaroLabelCore, defineCustomElement as defineCustomElementTaroLabelCore } from './taro-label-core.js';
|
|
34
36
|
export { TaroLifestyleCore, defineCustomElement as defineCustomElementTaroLifestyleCore } from './taro-lifestyle-core.js';
|
|
35
37
|
export { TaroLikeCore, defineCustomElement as defineCustomElementTaroLikeCore } from './taro-like-core.js';
|
|
38
|
+
export { TaroListBuilderCore, defineCustomElement as defineCustomElementTaroListBuilderCore } from './taro-list-builder-core.js';
|
|
36
39
|
export { TaroListViewCore, defineCustomElement as defineCustomElementTaroListViewCore } from './taro-list-view-core.js';
|
|
37
40
|
export { TaroLivePlayerCore, defineCustomElement as defineCustomElementTaroLivePlayerCore } from './taro-live-player-core.js';
|
|
38
41
|
export { TaroLivePusherCore, defineCustomElement as defineCustomElementTaroLivePusherCore } from './taro-live-pusher-core.js';
|
|
@@ -45,7 +48,10 @@ export { TaroMovableViewCore, defineCustomElement as defineCustomElementTaroMova
|
|
|
45
48
|
export { TaroNativeSlotCore, defineCustomElement as defineCustomElementTaroNativeSlotCore } from './taro-native-slot-core.js';
|
|
46
49
|
export { TaroNavigationBarCore, defineCustomElement as defineCustomElementTaroNavigationBarCore } from './taro-navigation-bar-core.js';
|
|
47
50
|
export { TaroNavigatorCore, defineCustomElement as defineCustomElementTaroNavigatorCore } from './taro-navigator-core.js';
|
|
51
|
+
export { TaroNestedScrollBodyCore, defineCustomElement as defineCustomElementTaroNestedScrollBodyCore } from './taro-nested-scroll-body-core.js';
|
|
52
|
+
export { TaroNestedScrollHeaderCore, defineCustomElement as defineCustomElementTaroNestedScrollHeaderCore } from './taro-nested-scroll-header-core.js';
|
|
48
53
|
export { TaroOfficialAccountCore, defineCustomElement as defineCustomElementTaroOfficialAccountCore } from './taro-official-account-core.js';
|
|
54
|
+
export { TaroOpenContainerCore, defineCustomElement as defineCustomElementTaroOpenContainerCore } from './taro-open-container-core.js';
|
|
49
55
|
export { TaroOpenDataCore, defineCustomElement as defineCustomElementTaroOpenDataCore } from './taro-open-data-core.js';
|
|
50
56
|
export { TaroPageContainerCore, defineCustomElement as defineCustomElementTaroPageContainerCore } from './taro-page-container-core.js';
|
|
51
57
|
export { TaroPageMetaCore, defineCustomElement as defineCustomElementTaroPageMetaCore } from './taro-page-meta-core.js';
|
|
@@ -66,6 +72,7 @@ export { TaroShareElementCore, defineCustomElement as defineCustomElementTaroSha
|
|
|
66
72
|
export { TaroSliderCore, defineCustomElement as defineCustomElementTaroSliderCore } from './taro-slider-core.js';
|
|
67
73
|
export { TaroSlotCore, defineCustomElement as defineCustomElementTaroSlotCore } from './taro-slot-core.js';
|
|
68
74
|
export { TaroSnapshotCore, defineCustomElement as defineCustomElementTaroSnapshotCore } from './taro-snapshot-core.js';
|
|
75
|
+
export { TaroSpanCore, defineCustomElement as defineCustomElementTaroSpanCore } from './taro-span-core.js';
|
|
69
76
|
export { TaroStickyHeaderCore, defineCustomElement as defineCustomElementTaroStickyHeaderCore } from './taro-sticky-header-core.js';
|
|
70
77
|
export { TaroStickySectionCore, defineCustomElement as defineCustomElementTaroStickySectionCore } from './taro-sticky-section-core.js';
|
|
71
78
|
export { TaroSwiperCore, defineCustomElement as defineCustomElementTaroSwiperCore } from './taro-swiper-core.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TaroDraggableSheetCore extends Components.TaroDraggableSheetCore, HTMLElement {}
|
|
4
|
+
export const TaroDraggableSheetCore: {
|
|
5
|
+
prototype: TaroDraggableSheetCore;
|
|
6
|
+
new (): TaroDraggableSheetCore;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { n as notSupport } from './helper.js';
|
|
3
|
+
|
|
4
|
+
const DraggableSheet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.__registerHost();
|
|
8
|
+
}
|
|
9
|
+
componentDidLoad() {
|
|
10
|
+
notSupport('DraggableSheet', this);
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return (h(Host, null));
|
|
14
|
+
}
|
|
15
|
+
}, [0, "taro-draggable-sheet-core"]);
|
|
16
|
+
function defineCustomElement$1() {
|
|
17
|
+
if (typeof customElements === "undefined") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const components = ["taro-draggable-sheet-core"];
|
|
21
|
+
components.forEach(tagName => { switch (tagName) {
|
|
22
|
+
case "taro-draggable-sheet-core":
|
|
23
|
+
if (!customElements.get(tagName)) {
|
|
24
|
+
customElements.define(tagName, DraggableSheet);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const TaroDraggableSheetCore = DraggableSheet;
|
|
31
|
+
const defineCustomElement = defineCustomElement$1;
|
|
32
|
+
|
|
33
|
+
export { TaroDraggableSheetCore, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TaroGridBuilderCore extends Components.TaroGridBuilderCore, HTMLElement {}
|
|
4
|
+
export const TaroGridBuilderCore: {
|
|
5
|
+
prototype: TaroGridBuilderCore;
|
|
6
|
+
new (): TaroGridBuilderCore;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { n as notSupport } from './helper.js';
|
|
3
|
+
|
|
4
|
+
const GridBuilder = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.__registerHost();
|
|
8
|
+
}
|
|
9
|
+
componentDidLoad() {
|
|
10
|
+
notSupport('GridBuilder', this);
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return (h(Host, null));
|
|
14
|
+
}
|
|
15
|
+
}, [0, "taro-grid-builder-core"]);
|
|
16
|
+
function defineCustomElement$1() {
|
|
17
|
+
if (typeof customElements === "undefined") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const components = ["taro-grid-builder-core"];
|
|
21
|
+
components.forEach(tagName => { switch (tagName) {
|
|
22
|
+
case "taro-grid-builder-core":
|
|
23
|
+
if (!customElements.get(tagName)) {
|
|
24
|
+
customElements.define(tagName, GridBuilder);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const TaroGridBuilderCore = GridBuilder;
|
|
31
|
+
const defineCustomElement = defineCustomElement$1;
|
|
32
|
+
|
|
33
|
+
export { TaroGridBuilderCore, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TaroListBuilderCore extends Components.TaroListBuilderCore, HTMLElement {}
|
|
4
|
+
export const TaroListBuilderCore: {
|
|
5
|
+
prototype: TaroListBuilderCore;
|
|
6
|
+
new (): TaroListBuilderCore;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { n as notSupport } from './helper.js';
|
|
3
|
+
|
|
4
|
+
const ListBuilder = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.__registerHost();
|
|
8
|
+
}
|
|
9
|
+
componentDidLoad() {
|
|
10
|
+
notSupport('ListBuilder', this);
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return (h(Host, null));
|
|
14
|
+
}
|
|
15
|
+
}, [0, "taro-list-builder-core"]);
|
|
16
|
+
function defineCustomElement$1() {
|
|
17
|
+
if (typeof customElements === "undefined") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const components = ["taro-list-builder-core"];
|
|
21
|
+
components.forEach(tagName => { switch (tagName) {
|
|
22
|
+
case "taro-list-builder-core":
|
|
23
|
+
if (!customElements.get(tagName)) {
|
|
24
|
+
customElements.define(tagName, ListBuilder);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const TaroListBuilderCore = ListBuilder;
|
|
31
|
+
const defineCustomElement = defineCustomElement$1;
|
|
32
|
+
|
|
33
|
+
export { TaroListBuilderCore, defineCustomElement };
|
|
@@ -166,7 +166,9 @@ const MovableView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
166
166
|
if (this.disabled || !this.element || this.scaling || !this.touching || touches.length > 1) {
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
if (this.direction !== "horizontal") {
|
|
170
|
+
e.preventDefault();
|
|
171
|
+
}
|
|
170
172
|
const touch = touches[0];
|
|
171
173
|
const x = touch.screenX - this.origin.x;
|
|
172
174
|
const y = touch.screenY - this.origin.y;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TaroNestedScrollBodyCore extends Components.TaroNestedScrollBodyCore, HTMLElement {}
|
|
4
|
+
export const TaroNestedScrollBodyCore: {
|
|
5
|
+
prototype: TaroNestedScrollBodyCore;
|
|
6
|
+
new (): TaroNestedScrollBodyCore;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { n as notSupport } from './helper.js';
|
|
3
|
+
|
|
4
|
+
const NestedScrollBody = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.__registerHost();
|
|
8
|
+
}
|
|
9
|
+
componentDidLoad() {
|
|
10
|
+
notSupport('NestedScrollBody', this);
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return (h(Host, null));
|
|
14
|
+
}
|
|
15
|
+
}, [0, "taro-nested-scroll-body-core"]);
|
|
16
|
+
function defineCustomElement$1() {
|
|
17
|
+
if (typeof customElements === "undefined") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const components = ["taro-nested-scroll-body-core"];
|
|
21
|
+
components.forEach(tagName => { switch (tagName) {
|
|
22
|
+
case "taro-nested-scroll-body-core":
|
|
23
|
+
if (!customElements.get(tagName)) {
|
|
24
|
+
customElements.define(tagName, NestedScrollBody);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const TaroNestedScrollBodyCore = NestedScrollBody;
|
|
31
|
+
const defineCustomElement = defineCustomElement$1;
|
|
32
|
+
|
|
33
|
+
export { TaroNestedScrollBodyCore, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TaroNestedScrollHeaderCore extends Components.TaroNestedScrollHeaderCore, HTMLElement {}
|
|
4
|
+
export const TaroNestedScrollHeaderCore: {
|
|
5
|
+
prototype: TaroNestedScrollHeaderCore;
|
|
6
|
+
new (): TaroNestedScrollHeaderCore;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { n as notSupport } from './helper.js';
|
|
3
|
+
|
|
4
|
+
const NestedScrollHeader = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.__registerHost();
|
|
8
|
+
}
|
|
9
|
+
componentDidLoad() {
|
|
10
|
+
notSupport('NestedScrollHeader', this);
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return (h(Host, null));
|
|
14
|
+
}
|
|
15
|
+
}, [0, "taro-nested-scroll-header-core"]);
|
|
16
|
+
function defineCustomElement$1() {
|
|
17
|
+
if (typeof customElements === "undefined") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const components = ["taro-nested-scroll-header-core"];
|
|
21
|
+
components.forEach(tagName => { switch (tagName) {
|
|
22
|
+
case "taro-nested-scroll-header-core":
|
|
23
|
+
if (!customElements.get(tagName)) {
|
|
24
|
+
customElements.define(tagName, NestedScrollHeader);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const TaroNestedScrollHeaderCore = NestedScrollHeader;
|
|
31
|
+
const defineCustomElement = defineCustomElement$1;
|
|
32
|
+
|
|
33
|
+
export { TaroNestedScrollHeaderCore, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TaroOpenContainerCore extends Components.TaroOpenContainerCore, HTMLElement {}
|
|
4
|
+
export const TaroOpenContainerCore: {
|
|
5
|
+
prototype: TaroOpenContainerCore;
|
|
6
|
+
new (): TaroOpenContainerCore;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { n as notSupport } from './helper.js';
|
|
3
|
+
|
|
4
|
+
const OpenContainer = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.__registerHost();
|
|
8
|
+
}
|
|
9
|
+
componentDidLoad() {
|
|
10
|
+
notSupport('OpenContainer', this);
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return (h(Host, null));
|
|
14
|
+
}
|
|
15
|
+
}, [0, "taro-open-container-core"]);
|
|
16
|
+
function defineCustomElement$1() {
|
|
17
|
+
if (typeof customElements === "undefined") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const components = ["taro-open-container-core"];
|
|
21
|
+
components.forEach(tagName => { switch (tagName) {
|
|
22
|
+
case "taro-open-container-core":
|
|
23
|
+
if (!customElements.get(tagName)) {
|
|
24
|
+
customElements.define(tagName, OpenContainer);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const TaroOpenContainerCore = OpenContainer;
|
|
31
|
+
const defineCustomElement = defineCustomElement$1;
|
|
32
|
+
|
|
33
|
+
export { TaroOpenContainerCore, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TaroSpanCore extends Components.TaroSpanCore, HTMLElement {}
|
|
4
|
+
export const TaroSpanCore: {
|
|
5
|
+
prototype: TaroSpanCore;
|
|
6
|
+
new (): TaroSpanCore;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { n as notSupport } from './helper.js';
|
|
3
|
+
|
|
4
|
+
const Span = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.__registerHost();
|
|
8
|
+
}
|
|
9
|
+
componentDidLoad() {
|
|
10
|
+
notSupport('Span', this);
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return h(Host, null);
|
|
14
|
+
}
|
|
15
|
+
}, [0, "taro-span-core"]);
|
|
16
|
+
function defineCustomElement$1() {
|
|
17
|
+
if (typeof customElements === "undefined") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const components = ["taro-span-core"];
|
|
21
|
+
components.forEach(tagName => { switch (tagName) {
|
|
22
|
+
case "taro-span-core":
|
|
23
|
+
if (!customElements.get(tagName)) {
|
|
24
|
+
customElements.define(tagName, Span);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const TaroSpanCore = Span;
|
|
31
|
+
const defineCustomElement = defineCustomElement$1;
|
|
32
|
+
|
|
33
|
+
export { TaroSpanCore, defineCustomElement };
|
|
@@ -79,6 +79,7 @@ const Swiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
79
79
|
this.indicatorActiveColor = '#000000';
|
|
80
80
|
this.autoplay = false;
|
|
81
81
|
this.current = 0;
|
|
82
|
+
this.currentItemId = '';
|
|
82
83
|
this.interval = 5000;
|
|
83
84
|
this.duration = 500;
|
|
84
85
|
this.circular = false;
|
|
@@ -93,7 +94,7 @@ const Swiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
93
94
|
this.observerLast = undefined;
|
|
94
95
|
}
|
|
95
96
|
watchCurrent(newVal) {
|
|
96
|
-
if (!this.isWillLoadCalled)
|
|
97
|
+
if (this.currentItemId || !this.isWillLoadCalled)
|
|
97
98
|
return;
|
|
98
99
|
const n = parseInt(newVal, 10);
|
|
99
100
|
if (isNaN(n))
|
|
@@ -107,6 +108,25 @@ const Swiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
107
108
|
this.swiper.slideTo(n); // 更新下标
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
watchCurrentItemId(newVal) {
|
|
112
|
+
var _a;
|
|
113
|
+
const wrapper = (_a = this.swiper.$wrapperEl) === null || _a === void 0 ? void 0 : _a[0];
|
|
114
|
+
let itemIdIndex = 0;
|
|
115
|
+
wrapper.querySelectorAll('taro-swiper-item-core:not(.swiper-slide-duplicate)').forEach((swiperItem, index) => {
|
|
116
|
+
// @ts-ignore
|
|
117
|
+
if (swiperItem.itemId && swiperItem.itemId === newVal) {
|
|
118
|
+
itemIdIndex = index;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
if (this.circular) {
|
|
122
|
+
if (!this.swiper.isBeginning && !this.swiper.isEnd) {
|
|
123
|
+
this.swiper.slideToLoop(itemIdIndex); // 更新下标
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this.swiper.slideTo(itemIdIndex); // 更新下标
|
|
128
|
+
}
|
|
129
|
+
}
|
|
110
130
|
watchAutoplay(newVal) {
|
|
111
131
|
if (!this.isWillLoadCalled || !this.swiper)
|
|
112
132
|
return;
|
|
@@ -211,7 +231,18 @@ const Swiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
211
231
|
(_f = (_e = this.observerLast) === null || _e === void 0 ? void 0 : _e.disconnect) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
212
232
|
}
|
|
213
233
|
handleInit() {
|
|
214
|
-
const { autoplay, circular, current, displayMultipleItems, duration, interval, vertical } = this;
|
|
234
|
+
const { autoplay, circular, current, currentItemId, displayMultipleItems, duration, interval, vertical } = this;
|
|
235
|
+
let initialSlide = circular ? current + 1 : current;
|
|
236
|
+
if (currentItemId) {
|
|
237
|
+
let itemIdIndex = 0;
|
|
238
|
+
this.el.querySelectorAll('taro-swiper-item-core:not(.swiper-slide-duplicate)').forEach((swiperItem, index) => {
|
|
239
|
+
// @ts-ignore
|
|
240
|
+
if (swiperItem.itemId && swiperItem.itemId === currentItemId) {
|
|
241
|
+
itemIdIndex = index;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
initialSlide = circular ? itemIdIndex + 1 : itemIdIndex;
|
|
245
|
+
}
|
|
215
246
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
216
247
|
const that = this;
|
|
217
248
|
const options = {
|
|
@@ -219,7 +250,7 @@ const Swiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
219
250
|
direction: vertical ? 'vertical' : 'horizontal',
|
|
220
251
|
loop: circular,
|
|
221
252
|
slidesPerView: displayMultipleItems,
|
|
222
|
-
initialSlide:
|
|
253
|
+
initialSlide: initialSlide,
|
|
223
254
|
speed: duration,
|
|
224
255
|
observer: true,
|
|
225
256
|
observeParents: true,
|
|
@@ -318,6 +349,7 @@ const Swiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
318
349
|
get el() { return this; }
|
|
319
350
|
static get watchers() { return {
|
|
320
351
|
"current": ["watchCurrent"],
|
|
352
|
+
"currentItemId": ["watchCurrentItemId"],
|
|
321
353
|
"autoplay": ["watchAutoplay"],
|
|
322
354
|
"duration": ["watchDuration"],
|
|
323
355
|
"interval": ["watchInterval"],
|
|
@@ -332,6 +364,7 @@ const Swiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
332
364
|
"indicatorActiveColor": [1, "indicator-active-color"],
|
|
333
365
|
"autoplay": [4],
|
|
334
366
|
"current": [2],
|
|
367
|
+
"currentItemId": [1, "current-item-id"],
|
|
335
368
|
"interval": [2],
|
|
336
369
|
"duration": [2],
|
|
337
370
|
"circular": [4],
|