@tarojs/components 3.6.0-beta.1 → 3.6.0-beta.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.
@@ -10126,14 +10126,50 @@ const Swiper = class {
10126
10126
  };
10127
10127
  Swiper.style = indexCss;
10128
10128
 
10129
+ function isEqualTag(a, b) {
10130
+ return typeof a.tagName === 'undefined' ? a.nodeType === b.nodeType : a.tagName === b.tagName;
10131
+ }
10132
+ function parseChildNodes(items, targets) {
10133
+ const list = Array.from(targets.values());
10134
+ for (let i = 0, j = 0; i < list.length; i++, j++) {
10135
+ const target = list[i];
10136
+ let item = items.item(j);
10137
+ while (item && !isEqualTag(item, target)) {
10138
+ item.remove();
10139
+ j++;
10140
+ item = items.item(j);
10141
+ }
10142
+ if (item && !item.isEqualNode(target)) {
10143
+ parseChildNodes(item.childNodes, target.childNodes);
10144
+ }
10145
+ while (i === list.length - 1 && j < items.length) {
10146
+ j++;
10147
+ item = items.item(j);
10148
+ item === null || item === void 0 ? void 0 : item.remove();
10149
+ }
10150
+ }
10151
+ }
10129
10152
  const SwiperItem = class {
10130
10153
  constructor(hostRef) {
10131
10154
  index$1.registerInstance(this, hostRef);
10132
10155
  this.itemId = undefined;
10133
10156
  }
10157
+ componentDidRender() {
10158
+ var _a, _b, _c;
10159
+ const el = this.el;
10160
+ if (el.classList.contains('swiper-slide-duplicate')) {
10161
+ const list = Array
10162
+ .from(((_b = (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.childNodes) === null || _b === void 0 ? void 0 : _b.values()) || [])
10163
+ .filter((e) => e.tagName === 'TARO-SWIPER-ITEM-CORE');
10164
+ if (list.length > 0) {
10165
+ parseChildNodes(el.childNodes, (_c = list[list.indexOf(el) === 0 ? list.length - 2 : 1]) === null || _c === void 0 ? void 0 : _c.childNodes);
10166
+ }
10167
+ }
10168
+ }
10134
10169
  render() {
10135
10170
  return (index$1.h(index$1.Host, { class: 'swiper-slide', "item-id": this.itemId }));
10136
10171
  }
10172
+ get el() { return index$1.getElement(this); }
10137
10173
  };
10138
10174
 
10139
10175
  exports.taro_swiper_core = Swiper;