@tarojs/components 3.7.0-alpha.8 → 3.7.0-beta.1
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/taro-pull-to-refresh.cjs.entry.js +1 -1
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +36 -35
- package/dist/collection/components/pull-to-refresh/style/index.css +0 -1
- package/dist/collection/components/swiper/swiper-item.js +34 -35
- package/dist/collection/components/swiper/swiper.js +2 -0
- package/dist/components/taro-pull-to-refresh.js +1 -1
- package/dist/components/taro-swiper-core.js +2 -0
- package/dist/components/taro-swiper-item-core.js +34 -35
- package/dist/esm/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm/taro-swiper-core_2.entry.js +36 -35
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/taro-components/{p-f07cd1de.entry.js → p-0114a2e4.entry.js} +1 -1
- package/dist/taro-components/{p-a96b4b19.system.entry.js → p-7e998213.system.entry.js} +1 -1
- package/dist/taro-components/p-ba3b2aa5.system.entry.js +1 -0
- package/dist/taro-components/{p-5dda8a67.entry.js → p-ce33f1f3.entry.js} +1 -1
- package/dist/taro-components/p-ed331c06.system.js +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/lib/react/react-component-lib/utils/attachProps.js +20 -1
- package/lib/react/react-component-lib/utils/attachProps.js.map +1 -1
- package/package.json +4 -4
- package/types/Button.d.ts +40 -1
- package/types/Textarea.d.ts +1 -1
- package/dist/taro-components/p-0198411e.system.entry.js +0 -1
|
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
const Taro__default = /*#__PURE__*/_interopDefaultLegacy(Taro);
|
|
12
12
|
|
|
13
|
-
const indexCss = ".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{
|
|
13
|
+
const indexCss = ".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100vh}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{display:inline-block;margin:3px;border-radius:100%;width:6px;height:6px;background-color:grey;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;-webkit-animation-fill-mode:both;animation-fill-mode:both}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";
|
|
14
14
|
|
|
15
15
|
function setTransform(nodeStyle, value) {
|
|
16
16
|
nodeStyle.transform = value;
|
|
@@ -9991,6 +9991,7 @@ const Swiper = class {
|
|
|
9991
9991
|
};
|
|
9992
9992
|
this.el.addEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
9993
9993
|
this.el.addEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
9994
|
+
this.el.addEventListener('MutationObserver', this.handleSwiperSize);
|
|
9994
9995
|
}
|
|
9995
9996
|
watchCircular() {
|
|
9996
9997
|
if (this.swiper) {
|
|
@@ -10034,6 +10035,7 @@ const Swiper = class {
|
|
|
10034
10035
|
var _a, _b, _c, _d, _e, _f;
|
|
10035
10036
|
this.el.removeEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
10036
10037
|
this.el.removeEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
10038
|
+
this.el.removeEventListener('MutationObserver', this.handleSwiperSize);
|
|
10037
10039
|
(_b = (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
10038
10040
|
(_d = (_c = this.observerFirst) === null || _c === void 0 ? void 0 : _c.disconnect) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
10039
10041
|
(_f = (_e = this.observerLast) === null || _e === void 0 ? void 0 : _e.disconnect) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
@@ -10147,35 +10149,41 @@ const Swiper = class {
|
|
|
10147
10149
|
};
|
|
10148
10150
|
Swiper.style = indexCss;
|
|
10149
10151
|
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
continue;
|
|
10166
|
-
}
|
|
10167
|
-
if (target.childNodes.length > 0) {
|
|
10168
|
-
const cleanAll = ['taro-image-core'].includes(target.tagName.toLocaleLowerCase());
|
|
10169
|
-
parseChildNodes(item.childNodes, target.childNodes, cleanAll);
|
|
10152
|
+
const nativeCloneNode = Node.prototype.cloneNode;
|
|
10153
|
+
function cloneNode(node, deep) {
|
|
10154
|
+
const clonedNode = nativeCloneNode.call(node, false);
|
|
10155
|
+
const srcChildNodes = childNodes(node);
|
|
10156
|
+
if (deep) {
|
|
10157
|
+
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
10158
|
+
const srcNode = srcChildNodes[i];
|
|
10159
|
+
let srcDeep = deep;
|
|
10160
|
+
if (srcNode.nodeType !== 2 && srcNode.nodeType !== 8) {
|
|
10161
|
+
// Note: 没有引用节点(s-cr[reference comment])的情况下,不复制子节点避免冗余(例如:Image 组件)
|
|
10162
|
+
if (!srcNode['s-cr']) {
|
|
10163
|
+
srcDeep = false;
|
|
10164
|
+
}
|
|
10165
|
+
const childClone = cloneNode(srcNode, srcDeep);
|
|
10166
|
+
clonedNode.appendChild(childClone);
|
|
10170
10167
|
}
|
|
10171
|
-
break;
|
|
10172
10168
|
}
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10169
|
+
}
|
|
10170
|
+
return clonedNode;
|
|
10171
|
+
}
|
|
10172
|
+
function childNodes(node) {
|
|
10173
|
+
const childNodes = node.childNodes;
|
|
10174
|
+
// check if element is stencil element without shadow dom
|
|
10175
|
+
// and then detect elements that were slotted into the element
|
|
10176
|
+
if (node['s-sc']) {
|
|
10177
|
+
const result = [];
|
|
10178
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
10179
|
+
const slot = childNodes[i]['s-nr'];
|
|
10180
|
+
if (slot) {
|
|
10181
|
+
result.push(slot);
|
|
10182
|
+
}
|
|
10177
10183
|
}
|
|
10184
|
+
return result;
|
|
10178
10185
|
}
|
|
10186
|
+
return Array.from(childNodes);
|
|
10179
10187
|
}
|
|
10180
10188
|
const SwiperItem = class {
|
|
10181
10189
|
constructor(hostRef) {
|
|
@@ -10183,16 +10191,9 @@ const SwiperItem = class {
|
|
|
10183
10191
|
this.itemId = undefined;
|
|
10184
10192
|
}
|
|
10185
10193
|
componentDidRender() {
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
const list = Array
|
|
10190
|
-
.from(((_b = (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.childNodes) === null || _b === void 0 ? void 0 : _b.values()) || [])
|
|
10191
|
-
.filter((e) => e.tagName === 'TARO-SWIPER-ITEM-CORE');
|
|
10192
|
-
if (list.length > 0) {
|
|
10193
|
-
parseChildNodes(el.childNodes, (_c = list[list.indexOf(el) === 0 ? list.length - 2 : 1]) === null || _c === void 0 ? void 0 : _c.childNodes);
|
|
10194
|
-
}
|
|
10195
|
-
}
|
|
10194
|
+
this.el.cloneNode = (deep = false) => {
|
|
10195
|
+
return cloneNode.call(null, this.el, deep);
|
|
10196
|
+
};
|
|
10196
10197
|
}
|
|
10197
10198
|
render() {
|
|
10198
10199
|
return (index$1.h(index$1.Host, { class: 'swiper-slide', "item-id": this.itemId }));
|
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
import { Host, h } from '@stencil/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
if (target.childNodes.length > 0) {
|
|
20
|
-
const cleanAll = ['taro-image-core'].includes(target.tagName.toLocaleLowerCase());
|
|
21
|
-
parseChildNodes(item.childNodes, target.childNodes, cleanAll);
|
|
2
|
+
const nativeCloneNode = Node.prototype.cloneNode;
|
|
3
|
+
function cloneNode(node, deep) {
|
|
4
|
+
const clonedNode = nativeCloneNode.call(node, false);
|
|
5
|
+
const srcChildNodes = childNodes(node);
|
|
6
|
+
if (deep) {
|
|
7
|
+
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
8
|
+
const srcNode = srcChildNodes[i];
|
|
9
|
+
let srcDeep = deep;
|
|
10
|
+
if (srcNode.nodeType !== 2 && srcNode.nodeType !== 8) {
|
|
11
|
+
// Note: 没有引用节点(s-cr[reference comment])的情况下,不复制子节点避免冗余(例如:Image 组件)
|
|
12
|
+
if (!srcNode['s-cr']) {
|
|
13
|
+
srcDeep = false;
|
|
14
|
+
}
|
|
15
|
+
const childClone = cloneNode(srcNode, srcDeep);
|
|
16
|
+
clonedNode.appendChild(childClone);
|
|
22
17
|
}
|
|
23
|
-
break;
|
|
24
18
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
}
|
|
20
|
+
return clonedNode;
|
|
21
|
+
}
|
|
22
|
+
function childNodes(node) {
|
|
23
|
+
const childNodes = node.childNodes;
|
|
24
|
+
// check if element is stencil element without shadow dom
|
|
25
|
+
// and then detect elements that were slotted into the element
|
|
26
|
+
if (node['s-sc']) {
|
|
27
|
+
const result = [];
|
|
28
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
29
|
+
const slot = childNodes[i]['s-nr'];
|
|
30
|
+
if (slot) {
|
|
31
|
+
result.push(slot);
|
|
32
|
+
}
|
|
29
33
|
}
|
|
34
|
+
return result;
|
|
30
35
|
}
|
|
36
|
+
return Array.from(childNodes);
|
|
31
37
|
}
|
|
32
38
|
export class SwiperItem {
|
|
33
39
|
constructor() {
|
|
34
40
|
this.itemId = undefined;
|
|
35
41
|
}
|
|
36
42
|
componentDidRender() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const list = Array
|
|
41
|
-
.from(((_b = (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.childNodes) === null || _b === void 0 ? void 0 : _b.values()) || [])
|
|
42
|
-
.filter((e) => e.tagName === 'TARO-SWIPER-ITEM-CORE');
|
|
43
|
-
if (list.length > 0) {
|
|
44
|
-
parseChildNodes(el.childNodes, (_c = list[list.indexOf(el) === 0 ? list.length - 2 : 1]) === null || _c === void 0 ? void 0 : _c.childNodes);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
43
|
+
this.el.cloneNode = (deep = false) => {
|
|
44
|
+
return cloneNode.call(null, this.el, deep);
|
|
45
|
+
};
|
|
47
46
|
}
|
|
48
47
|
render() {
|
|
49
48
|
return (h(Host, { class: 'swiper-slide', "item-id": this.itemId }));
|
|
@@ -133,6 +133,7 @@ export class Swiper {
|
|
|
133
133
|
};
|
|
134
134
|
this.el.addEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
135
135
|
this.el.addEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
136
|
+
this.el.addEventListener('MutationObserver', this.handleSwiperSize);
|
|
136
137
|
}
|
|
137
138
|
watchCircular() {
|
|
138
139
|
if (this.swiper) {
|
|
@@ -176,6 +177,7 @@ export class Swiper {
|
|
|
176
177
|
var _a, _b, _c, _d, _e, _f;
|
|
177
178
|
this.el.removeEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
178
179
|
this.el.removeEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
180
|
+
this.el.removeEventListener('MutationObserver', this.handleSwiperSize);
|
|
179
181
|
(_b = (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
180
182
|
(_d = (_c = this.observerFirst) === null || _c === void 0 ? void 0 : _c.disconnect) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
181
183
|
(_f = (_e = this.observerLast) === null || _e === void 0 ? void 0 : _e.disconnect) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
3
|
import { c as classnames } from './index2.js';
|
|
4
4
|
|
|
5
|
-
const indexCss = ".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{
|
|
5
|
+
const indexCss = ".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100vh}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{display:inline-block;margin:3px;border-radius:100%;width:6px;height:6px;background-color:grey;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;-webkit-animation-fill-mode:both;animation-fill-mode:both}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";
|
|
6
6
|
|
|
7
7
|
function setTransform(nodeStyle, value) {
|
|
8
8
|
nodeStyle.transform = value;
|
|
@@ -9988,6 +9988,7 @@ const Swiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
9988
9988
|
};
|
|
9989
9989
|
this.el.addEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
9990
9990
|
this.el.addEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
9991
|
+
this.el.addEventListener('MutationObserver', this.handleSwiperSize);
|
|
9991
9992
|
}
|
|
9992
9993
|
watchCircular() {
|
|
9993
9994
|
if (this.swiper) {
|
|
@@ -10031,6 +10032,7 @@ const Swiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
10031
10032
|
var _a, _b, _c, _d, _e, _f;
|
|
10032
10033
|
this.el.removeEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
10033
10034
|
this.el.removeEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
10035
|
+
this.el.removeEventListener('MutationObserver', this.handleSwiperSize);
|
|
10034
10036
|
(_b = (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
10035
10037
|
(_d = (_c = this.observerFirst) === null || _c === void 0 ? void 0 : _c.disconnect) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
10036
10038
|
(_f = (_e = this.observerLast) === null || _e === void 0 ? void 0 : _e.disconnect) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
if (target.childNodes.length > 0) {
|
|
21
|
-
const cleanAll = ['taro-image-core'].includes(target.tagName.toLocaleLowerCase());
|
|
22
|
-
parseChildNodes(item.childNodes, target.childNodes, cleanAll);
|
|
3
|
+
const nativeCloneNode = Node.prototype.cloneNode;
|
|
4
|
+
function cloneNode(node, deep) {
|
|
5
|
+
const clonedNode = nativeCloneNode.call(node, false);
|
|
6
|
+
const srcChildNodes = childNodes(node);
|
|
7
|
+
if (deep) {
|
|
8
|
+
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
9
|
+
const srcNode = srcChildNodes[i];
|
|
10
|
+
let srcDeep = deep;
|
|
11
|
+
if (srcNode.nodeType !== 2 && srcNode.nodeType !== 8) {
|
|
12
|
+
// Note: 没有引用节点(s-cr[reference comment])的情况下,不复制子节点避免冗余(例如:Image 组件)
|
|
13
|
+
if (!srcNode['s-cr']) {
|
|
14
|
+
srcDeep = false;
|
|
15
|
+
}
|
|
16
|
+
const childClone = cloneNode(srcNode, srcDeep);
|
|
17
|
+
clonedNode.appendChild(childClone);
|
|
23
18
|
}
|
|
24
|
-
break;
|
|
25
19
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
}
|
|
21
|
+
return clonedNode;
|
|
22
|
+
}
|
|
23
|
+
function childNodes(node) {
|
|
24
|
+
const childNodes = node.childNodes;
|
|
25
|
+
// check if element is stencil element without shadow dom
|
|
26
|
+
// and then detect elements that were slotted into the element
|
|
27
|
+
if (node['s-sc']) {
|
|
28
|
+
const result = [];
|
|
29
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
30
|
+
const slot = childNodes[i]['s-nr'];
|
|
31
|
+
if (slot) {
|
|
32
|
+
result.push(slot);
|
|
33
|
+
}
|
|
30
34
|
}
|
|
35
|
+
return result;
|
|
31
36
|
}
|
|
37
|
+
return Array.from(childNodes);
|
|
32
38
|
}
|
|
33
39
|
const SwiperItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
34
40
|
constructor() {
|
|
@@ -37,16 +43,9 @@ const SwiperItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
37
43
|
this.itemId = undefined;
|
|
38
44
|
}
|
|
39
45
|
componentDidRender() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const list = Array
|
|
44
|
-
.from(((_b = (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.childNodes) === null || _b === void 0 ? void 0 : _b.values()) || [])
|
|
45
|
-
.filter((e) => e.tagName === 'TARO-SWIPER-ITEM-CORE');
|
|
46
|
-
if (list.length > 0) {
|
|
47
|
-
parseChildNodes(el.childNodes, (_c = list[list.indexOf(el) === 0 ? list.length - 2 : 1]) === null || _c === void 0 ? void 0 : _c.childNodes);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
46
|
+
this.el.cloneNode = (deep = false) => {
|
|
47
|
+
return cloneNode.call(null, this.el, deep);
|
|
48
|
+
};
|
|
50
49
|
}
|
|
51
50
|
render() {
|
|
52
51
|
return (h(Host, { class: 'swiper-slide', "item-id": this.itemId }));
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
3
|
import { c as classnames } from './index-c3e4004b.js';
|
|
4
4
|
|
|
5
|
-
const indexCss = ".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{
|
|
5
|
+
const indexCss = ".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100vh}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{display:inline-block;margin:3px;border-radius:100%;width:6px;height:6px;background-color:grey;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;-webkit-animation-fill-mode:both;animation-fill-mode:both}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";
|
|
6
6
|
|
|
7
7
|
function setTransform(nodeStyle, value) {
|
|
8
8
|
nodeStyle.transform = value;
|
|
@@ -9987,6 +9987,7 @@ const Swiper = class {
|
|
|
9987
9987
|
};
|
|
9988
9988
|
this.el.addEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
9989
9989
|
this.el.addEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
9990
|
+
this.el.addEventListener('MutationObserver', this.handleSwiperSize);
|
|
9990
9991
|
}
|
|
9991
9992
|
watchCircular() {
|
|
9992
9993
|
if (this.swiper) {
|
|
@@ -10030,6 +10031,7 @@ const Swiper = class {
|
|
|
10030
10031
|
var _a, _b, _c, _d, _e, _f;
|
|
10031
10032
|
this.el.removeEventListener('DOMNodeInserted', this.handleSwiperSize);
|
|
10032
10033
|
this.el.removeEventListener('DOMNodeRemoved', this.handleSwiperSize);
|
|
10034
|
+
this.el.removeEventListener('MutationObserver', this.handleSwiperSize);
|
|
10033
10035
|
(_b = (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
10034
10036
|
(_d = (_c = this.observerFirst) === null || _c === void 0 ? void 0 : _c.disconnect) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
10035
10037
|
(_f = (_e = this.observerLast) === null || _e === void 0 ? void 0 : _e.disconnect) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
@@ -10143,35 +10145,41 @@ const Swiper = class {
|
|
|
10143
10145
|
};
|
|
10144
10146
|
Swiper.style = indexCss;
|
|
10145
10147
|
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
continue;
|
|
10162
|
-
}
|
|
10163
|
-
if (target.childNodes.length > 0) {
|
|
10164
|
-
const cleanAll = ['taro-image-core'].includes(target.tagName.toLocaleLowerCase());
|
|
10165
|
-
parseChildNodes(item.childNodes, target.childNodes, cleanAll);
|
|
10148
|
+
const nativeCloneNode = Node.prototype.cloneNode;
|
|
10149
|
+
function cloneNode(node, deep) {
|
|
10150
|
+
const clonedNode = nativeCloneNode.call(node, false);
|
|
10151
|
+
const srcChildNodes = childNodes(node);
|
|
10152
|
+
if (deep) {
|
|
10153
|
+
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
10154
|
+
const srcNode = srcChildNodes[i];
|
|
10155
|
+
let srcDeep = deep;
|
|
10156
|
+
if (srcNode.nodeType !== 2 && srcNode.nodeType !== 8) {
|
|
10157
|
+
// Note: 没有引用节点(s-cr[reference comment])的情况下,不复制子节点避免冗余(例如:Image 组件)
|
|
10158
|
+
if (!srcNode['s-cr']) {
|
|
10159
|
+
srcDeep = false;
|
|
10160
|
+
}
|
|
10161
|
+
const childClone = cloneNode(srcNode, srcDeep);
|
|
10162
|
+
clonedNode.appendChild(childClone);
|
|
10166
10163
|
}
|
|
10167
|
-
break;
|
|
10168
10164
|
}
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10165
|
+
}
|
|
10166
|
+
return clonedNode;
|
|
10167
|
+
}
|
|
10168
|
+
function childNodes(node) {
|
|
10169
|
+
const childNodes = node.childNodes;
|
|
10170
|
+
// check if element is stencil element without shadow dom
|
|
10171
|
+
// and then detect elements that were slotted into the element
|
|
10172
|
+
if (node['s-sc']) {
|
|
10173
|
+
const result = [];
|
|
10174
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
10175
|
+
const slot = childNodes[i]['s-nr'];
|
|
10176
|
+
if (slot) {
|
|
10177
|
+
result.push(slot);
|
|
10178
|
+
}
|
|
10173
10179
|
}
|
|
10180
|
+
return result;
|
|
10174
10181
|
}
|
|
10182
|
+
return Array.from(childNodes);
|
|
10175
10183
|
}
|
|
10176
10184
|
const SwiperItem = class {
|
|
10177
10185
|
constructor(hostRef) {
|
|
@@ -10179,16 +10187,9 @@ const SwiperItem = class {
|
|
|
10179
10187
|
this.itemId = undefined;
|
|
10180
10188
|
}
|
|
10181
10189
|
componentDidRender() {
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
const list = Array
|
|
10186
|
-
.from(((_b = (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.childNodes) === null || _b === void 0 ? void 0 : _b.values()) || [])
|
|
10187
|
-
.filter((e) => e.tagName === 'TARO-SWIPER-ITEM-CORE');
|
|
10188
|
-
if (list.length > 0) {
|
|
10189
|
-
parseChildNodes(el.childNodes, (_c = list[list.indexOf(el) === 0 ? list.length - 2 : 1]) === null || _c === void 0 ? void 0 : _c.childNodes);
|
|
10190
|
-
}
|
|
10191
|
-
}
|
|
10190
|
+
this.el.cloneNode = (deep = false) => {
|
|
10191
|
+
return cloneNode.call(null, this.el, deep);
|
|
10192
|
+
};
|
|
10192
10193
|
}
|
|
10193
10194
|
render() {
|
|
10194
10195
|
return (h(Host, { class: 'swiper-slide', "item-id": this.itemId }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-980f930f.js";import Taro from"@tarojs/taro";import{c as classnames}from"./index-c3e4004b.js";var indexCss=".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-980f930f.js";import Taro from"@tarojs/taro";import{c as classnames}from"./index-c3e4004b.js";var indexCss=".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100vh}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{display:inline-block;margin:3px;border-radius:100%;width:6px;height:6px;background-color:grey;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;-webkit-animation-fill-mode:both;animation-fill-mode:both}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";function setTransform(e,t){e.transform=t;e.webkitTransform=t;e.MozTransform=t}var isWebView=typeof navigator!=="undefined"&&/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);var INDICATOR={activate:"release",deactivate:"pull",release:"loading",finish:"finish"};var supportsPassive=false;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassive=true}});window.addEventListener("cancel",(function(){return{}}),opts)}catch(e){}var willPreventDefault=supportsPassive?{passive:false}:false;var PullToRefresh=function(){function e(e){var t=this;registerInstance(this,e);this.onRefresh=createEvent(this,"refresh",7);this._ScreenY=0;this._startScreenY=0;this._lastScreenY=0;this._isMounted=false;this.triggerPullDownRefresh=function(e){if(!t.dragOnEdge&&t._isMounted){if(e){t._lastScreenY=t.distanceToRefresh+1;t.currSt="release";t.setContentStyle(t._lastScreenY)}else{t.currSt="finish";t.reset()}}};this.init=function(){var e=t.scrollContainer;var r=t.el.querySelector(".rmc-pull-to-refresh-content");t.el.appendChild=r===null||r===void 0?void 0:r.appendChild.bind(r);t.el.insertBefore=r===null||r===void 0?void 0:r.insertBefore.bind(r);t.el.replaceChild=r===null||r===void 0?void 0:r.replaceChild.bind(r);t.el.removeChild=r===null||r===void 0?void 0:r.removeChild.bind(r);t._to={touchstart:t.onTouchStart.bind(t,e),touchmove:t.onTouchMove.bind(t,e),touchend:t.onTouchEnd.bind(t,e),touchcancel:t.onTouchEnd.bind(t,e)};Object.keys(t._to).forEach((function(r){e.addEventListener(r,t._to[r],willPreventDefault)}))};this.destroy=function(){var e=t.scrollContainer;Object.keys(t._to).forEach((function(r){e.removeEventListener(r,t._to[r])}))};this.onTouchStart=function(e,r){t._ScreenY=t._startScreenY=r.touches[0].screenY;t._lastScreenY=t._lastScreenY||0};this.isEdge=function(e){var r=t.scrollContainer;if(r&&r===document.body){var n=document.scrollingElement?document.scrollingElement:document.body;return n.scrollTop<=0}return e.scrollTop<=0};this.damp=function(e){if(Math.abs(t._lastScreenY)>t.damping){return 0}var r=Math.abs(t._ScreenY-t._startScreenY)/window.screen.height;e*=(1-r)*.6;return e};this.onTouchMove=function(e,r){var n=r.touches[0].screenY;if(t._startScreenY>n){return}if(t.isEdge(e)){if(!t.dragOnEdge){t._ScreenY=t._startScreenY=r.touches[0].screenY;t.dragOnEdge=true}if(r.cancelable){r.preventDefault()}var i=Math.round(n-t._ScreenY);t._ScreenY=n;t._lastScreenY+=t.damp(i);t.setContentStyle(t._lastScreenY);if(Math.abs(t._lastScreenY)<t.distanceToRefresh){if(t.currSt!=="deactivate"){t.currSt="deactivate"}}else{if(t.currSt==="deactivate"){t.currSt="activate"}}if(isWebView&&r.changedTouches[0].clientY<0){t.onTouchEnd()}}};this.onTouchEnd=function(){if(t.dragOnEdge){t.dragOnEdge=false}if(t.currSt==="activate"){t.currSt="release";t.onRefresh.emit(t);t._lastScreenY=t.distanceToRefresh+1;t.setContentStyle(t._lastScreenY)}else if(t.currSt==="release"){t._lastScreenY=t.distanceToRefresh+1;t.setContentStyle(t._lastScreenY)}else{t.reset()}};this.reset=function(){t._lastScreenY=0;t.setContentStyle(0)};this.setContentStyle=function(e){if(t.contentRef){if(e){setTransform(t.contentRef.style,"translate3d(0px,".concat(e,"px,0)"))}else{setTransform(t.contentRef.style,"")}}};this.prefixCls="rmc-pull-to-refresh";this.distanceToRefresh=50;this.damping=100;this.indicator=INDICATOR;this.currSt="deactivate";this.dragOnEdge=false}Object.defineProperty(e.prototype,"scrollContainer",{get:function(){return this.el.parentElement||this.el.closest(".taro_page_stationed")||document.querySelector(".taro_page_stationed")||document.querySelector(".taro_page")||document.querySelector(".taro_router")||document.querySelector(".taro-tabbar__panel")||document.body},enumerable:false,configurable:true});e.prototype.statusChange=function(){var e,t,r,n;var i=this.scrollContainer;switch(this.currSt){case"release":(t=(e=i===null||i===void 0?void 0:i.__page)===null||e===void 0?void 0:e.onPullDownRefresh)===null||t===void 0?void 0:t.call(e);break;case"deactivate":(n=(r=i===null||i===void 0?void 0:i.__page)===null||r===void 0?void 0:r.onPullIntercept)===null||n===void 0?void 0:n.call(r)}};e.prototype.disconnectedCallback=function(){this.destroy()};e.prototype.componentDidLoad=function(){var e=this;this.init();this._isMounted=true;Taro.eventCenter.on("__taroStartPullDownRefresh",(function(t){var r=t.successHandler,n=t.errorHandler;try{e.triggerPullDownRefresh(true);r({errMsg:"startPullDownRefresh: ok"})}catch(e){n({errMsg:"startPullDownRefresh: fail"})}}));Taro.eventCenter.on("__taroStopPullDownRefresh",(function(t){var r=t.successHandler,n=t.errorHandler;try{e.triggerPullDownRefresh(false);r({errMsg:"stopPullDownRefresh: ok"})}catch(e){n({errMsg:"stopPullDownRefresh: fail"})}}))};e.prototype.render=function(){var e=this;var t=function(t){var r=e,n=r.currSt,i=r.dragOnEdge,o=r.prefixCls;var s=classnames(t,!i&&"".concat(o,"-transition"));var a=n==="activate"||n==="release";return h("div",{class:"".concat(o,"-content-wrapper")},h("div",{class:s,ref:function(t){e.contentRef=t}},a&&h("div",{class:"".concat(o,"-indicator")},h("div",null),h("div",null),h("div",null)),h("slot",null)))};if(this.scrollContainer){return t("".concat(this.prefixCls,"-content ").concat(this.prefixCls,"-down"))}return h(Host,{class:classnames(this.prefixCls,"".concat(this.prefixCls,"-down"))},t("".concat(this.prefixCls,"-content")))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{currSt:["statusChange"]}},enumerable:false,configurable:true});return e}();PullToRefresh.style=indexCss;export{PullToRefresh as taro_pull_to_refresh};
|