dfish-widget 1.0.52 → 1.0.54

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/lib/index.esm.js CHANGED
@@ -696,7 +696,7 @@ const frag = function(s) {
696
696
 
697
697
  const el = function(o) {
698
698
  if (o) {
699
- return o.isWidget ? o.el() : o
699
+ return o.isWidget ? o.el() : (o.$el || o)
700
700
  }
701
701
  };
702
702
  // o -> el, s -> html string/object, r -> where[`after`, `prepend`, `before`, `append`]
@@ -2175,7 +2175,7 @@ var script$1k = {
2175
2175
  if (e = e.join())
2176
2176
  r = $$1.q(d ? `${f}:not(${e})` : e, this.el());
2177
2177
  } else {
2178
- r = $$1.q(f, a ? (a.isWidget ? a.el() : a) : this.el());
2178
+ r = $$1.q(f, a ? $$1.el(a) : this.el());
2179
2179
  }
2180
2180
  return r ? $$1.lodash.map(r.not('[w-form-ignore] :input')) : []
2181
2181
  },
@@ -6243,6 +6243,23 @@ const props = __props;
6243
6243
  return item
6244
6244
  };
6245
6245
 
6246
+ const merge = (newList, oldList) => {
6247
+ if (!Array.isArray(newList)) return
6248
+ const item = newList.find(n => n[propChildren] && n[propChildren].length);
6249
+ if (item) {
6250
+ if (!oldList) oldList = props.children;
6251
+ const old = oldList.find(n => n[propValue] == item[propValue]);
6252
+ if (old) {
6253
+ if (old[propChildren] && old[propChildren].length) {
6254
+ merge(item[propChildren], old[propChildren]);
6255
+ } else {
6256
+ old[propChildren] = item[propChildren];
6257
+ toFlat(old[propChildren], old);
6258
+ }
6259
+ }
6260
+ }
6261
+ };
6262
+
6246
6263
  // 界面可见的数据
6247
6264
  const showList = computed(() => {
6248
6265
  const topCount = Math.floor(scrollTop.value / itemHeight);
@@ -6290,7 +6307,7 @@ const props = __props;
6290
6307
  }
6291
6308
  });
6292
6309
 
6293
- expose({toggle, expandTo, find});
6310
+ expose({toggle, expandTo, find, merge});
6294
6311
 
6295
6312
 
6296
6313
  return (_ctx, _cache) => {