element-assits 0.0.22 → 0.0.23

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.js CHANGED
@@ -418,24 +418,24 @@ function Si(t, e) {
418
418
  var n = this.__data__, r = de(n, t);
419
419
  return r < 0 ? (++this.size, n.push([t, e])) : n[r][1] = e, this;
420
420
  }
421
- function E(t) {
421
+ function P(t) {
422
422
  var e = -1, n = t == null ? 0 : t.length;
423
423
  for (this.clear(); ++e < n; ) {
424
424
  var r = t[e];
425
425
  this.set(r[0], r[1]);
426
426
  }
427
427
  }
428
- E.prototype.clear = vi;
429
- E.prototype.delete = xi;
430
- E.prototype.get = Ti;
431
- E.prototype.has = Ci;
432
- E.prototype.set = Si;
428
+ P.prototype.clear = vi;
429
+ P.prototype.delete = xi;
430
+ P.prototype.get = Ti;
431
+ P.prototype.has = Ci;
432
+ P.prototype.set = Si;
433
433
  var Oi = D(O, "Map");
434
434
  const K = Oi;
435
435
  function Ei() {
436
436
  this.size = 0, this.__data__ = {
437
437
  hash: new j(),
438
- map: new (K || E)(),
438
+ map: new (K || P)(),
439
439
  string: new j()
440
440
  };
441
441
  }
@@ -461,18 +461,18 @@ function Fi(t, e) {
461
461
  var n = fe(this, t), r = n.size;
462
462
  return n.set(t, e), this.size += n.size == r ? 0 : 1, this;
463
463
  }
464
- function P(t) {
464
+ function A(t) {
465
465
  var e = -1, n = t == null ? 0 : t.length;
466
466
  for (this.clear(); ++e < n; ) {
467
467
  var r = t[e];
468
468
  this.set(r[0], r[1]);
469
469
  }
470
470
  }
471
- P.prototype.clear = Ei;
472
- P.prototype.delete = Ai;
473
- P.prototype.get = Li;
474
- P.prototype.has = Ri;
475
- P.prototype.set = Fi;
471
+ A.prototype.clear = Ei;
472
+ A.prototype.delete = Ai;
473
+ A.prototype.get = Li;
474
+ A.prototype.has = Ri;
475
+ A.prototype.set = Fi;
476
476
  var Mi = "Expected a function";
477
477
  function Ne(t, e) {
478
478
  if (typeof t != "function" || e != null && typeof e != "function")
@@ -484,9 +484,9 @@ function Ne(t, e) {
484
484
  var o = t.apply(this, r);
485
485
  return n.cache = s.set(i, o) || s, o;
486
486
  };
487
- return n.cache = new (Ne.Cache || P)(), n;
487
+ return n.cache = new (Ne.Cache || A)(), n;
488
488
  }
489
- Ne.Cache = P;
489
+ Ne.Cache = A;
490
490
  var ji = 500;
491
491
  function Ii(t) {
492
492
  var e = Ne(t, function(r) {
@@ -568,7 +568,7 @@ function Qi(t, e, n) {
568
568
  return s;
569
569
  }
570
570
  function Vi() {
571
- this.__data__ = new E(), this.size = 0;
571
+ this.__data__ = new P(), this.size = 0;
572
572
  }
573
573
  function es(t) {
574
574
  var e = this.__data__, n = e.delete(t);
@@ -583,16 +583,16 @@ function ns(t) {
583
583
  var rs = 200;
584
584
  function is(t, e) {
585
585
  var n = this.__data__;
586
- if (n instanceof E) {
586
+ if (n instanceof P) {
587
587
  var r = n.__data__;
588
588
  if (!K || r.length < rs - 1)
589
589
  return r.push([t, e]), this.size = ++n.size, this;
590
- n = this.__data__ = new P(r);
590
+ n = this.__data__ = new A(r);
591
591
  }
592
592
  return n.set(t, e), this.size = n.size, this;
593
593
  }
594
594
  function C(t) {
595
- var e = this.__data__ = new E(t);
595
+ var e = this.__data__ = new P(t);
596
596
  this.size = e.size;
597
597
  }
598
598
  C.prototype.clear = Vi;
@@ -794,7 +794,7 @@ function U(t, e, n, r, i, s) {
794
794
  }), o;
795
795
  }
796
796
  var No = 1, Do = 4;
797
- function L(t) {
797
+ function E(t) {
798
798
  return U(t, No | Do);
799
799
  }
800
800
  var ko = "__lodash_hash_undefined__";
@@ -806,7 +806,7 @@ function Wo(t) {
806
806
  }
807
807
  function Z(t) {
808
808
  var e = -1, n = t == null ? 0 : t.length;
809
- for (this.__data__ = new P(); ++e < n; )
809
+ for (this.__data__ = new A(); ++e < n; )
810
810
  this.add(t[e]);
811
811
  }
812
812
  Z.prototype.add = Z.prototype.push = Bo;
@@ -1228,7 +1228,9 @@ const Ya = {
1228
1228
  asyncData: { type: Function, default: void 0 },
1229
1229
  props: { type: Object, default: void 0 },
1230
1230
  itemMaxWidth: { type: [Number, Array], default: 150 },
1231
- popperClass: { type: String, default: void 0 }
1231
+ popperClass: { type: String, default: void 0 },
1232
+ noDataText: { type: String, default: "\u65E0\u6570\u636E" },
1233
+ noMatchText: { type: String, default: "\u65E0\u5339\u914D\u6570\u636E" }
1232
1234
  },
1233
1235
  data() {
1234
1236
  return {
@@ -1251,7 +1253,7 @@ const Ya = {
1251
1253
  data: {
1252
1254
  immediate: !0,
1253
1255
  handler(t) {
1254
- this.options = t, this.originalOptions = L(t);
1256
+ this.options = t, this.originalOptions = E(t);
1255
1257
  }
1256
1258
  },
1257
1259
  asyncParams: {
@@ -1259,6 +1261,9 @@ const Ya = {
1259
1261
  handler(t, e) {
1260
1262
  this.init(t, e);
1261
1263
  }
1264
+ },
1265
+ "options.length"(t) {
1266
+ t === 0 && (this.cachedOptions = []);
1262
1267
  }
1263
1268
  },
1264
1269
  mounted() {
@@ -1266,14 +1271,18 @@ const Ya = {
1266
1271
  },
1267
1272
  methods: {
1268
1273
  init(t, e) {
1269
- w(this.asyncData) && (this.loading = !0, this.asyncData(t, e).then((n) => {
1270
- this.options = n, this.originalOptions = L(n);
1271
- }).finally(() => {
1272
- this.loading = !1;
1273
- }));
1274
+ if (w(this.asyncData)) {
1275
+ this.loading = !0;
1276
+ let n = this.asyncData(t, e);
1277
+ Array.isArray(n) && (n = Promise.resolve(n)), n.then((r) => {
1278
+ this.options = r, this.originalOptions = E(r);
1279
+ }).finally(() => {
1280
+ this.loading = !1;
1281
+ });
1282
+ }
1274
1283
  },
1275
1284
  filterMethod(t) {
1276
- this.options = L(this.originalOptions).filter((e) => e.label.indexOf(t) > -1);
1285
+ this.options = E(this.originalOptions).filter((e) => e.label.indexOf(t) > -1);
1277
1286
  },
1278
1287
  cacheCurrent() {
1279
1288
  const t = this.options.find((n) => n[this.endProps.value] === this.value), e = this.cachedOptions.find((n) => n[this.endProps.value] === this.value);
@@ -1288,13 +1297,15 @@ const Ya = {
1288
1297
  }
1289
1298
  },
1290
1299
  handleVisibleChange(t) {
1291
- this.$emit("visible-change", t), this.$refs.vs && this.$refs.vs.$emit("visible-change", t);
1300
+ this.$emit("visible-change", t), this.$refs.vs && this.$refs.vs.$emit("visible-change", t), t === !1 && setTimeout(() => {
1301
+ this.options = E(this.originalOptions);
1302
+ }, 280);
1292
1303
  }
1293
1304
  }
1294
1305
  };
1295
1306
  var Za = function() {
1296
1307
  var e = this, n = e._self._c;
1297
- return n("div", { staticClass: "ea-select" }, [n("el-select", e._g(e._b({ ref: "sel", attrs: { value: e.value, loading: e.loading, "filter-method": e.filterMethod, "popper-class": "ea-select-popover" + (e.popperClass ? " " + e.popperClass : "") } }, "el-select", e.$attrs, !1), { ...e.$listeners, input: e.handleInput, "visible-change": e.handleVisibleChange }), [e._l(e.cachedOptions, function(r) {
1308
+ return n("div", { staticClass: "ea-select" }, [n("el-select", e._g(e._b({ ref: "sel", attrs: { value: e.value, loading: e.loading, "filter-method": e.filterMethod, "popper-class": "ea-select-popover" + (e.popperClass ? " " + e.popperClass : ""), "no-data-text": e.originalOptions.length ? e.noMatchText : e.noDataText } }, "el-select", e.$attrs, !1), { ...e.$listeners, input: e.handleInput, "visible-change": e.handleVisibleChange }), [e._l(e.cachedOptions, function(r) {
1298
1309
  return n("el-option", { key: r[e.endProps.value], staticStyle: { display: "none" }, attrs: { label: r[e.endProps.label], value: r[e.endProps.value] } });
1299
1310
  }), n("VirtualScroll", { ref: "vs", attrs: { options: e.options, "item-size": 34 }, scopedSlots: e._u([{ key: "item", fn: function({ item: r }) {
1300
1311
  return [n("el-option", { key: r[e.endProps.value], attrs: { label: r[e.endProps.label], value: r[e.endProps.value] } }, [e.endProps.desc ? [n("span", { staticClass: "select-item-value", style: { maxWidth: e.endItemMaxWidth[0] + "px" }, attrs: { title: r[e.endProps.label] } }, [e._v(" " + e._s(r[e.endProps.label]) + " ")]), n("span", { staticClass: "select-item-desc", style: { maxWidth: e.endItemMaxWidth[1] + "px" }, attrs: { title: r[e.endProps.desc] } }, [e._v(" " + e._s(r[e.endProps.desc]) + " ")])] : e._e()], 2)];
@@ -1498,7 +1509,7 @@ const cl = {
1498
1509
  se(t[e]) || (this.model[e] = t[e]);
1499
1510
  },
1500
1511
  setValue(t) {
1501
- const e = this.model[t.prop], n = L(t.defaultValue), r = e === void 0 ? n : e;
1512
+ const e = this.model[t.prop], n = E(t.defaultValue), r = e === void 0 ? n : e;
1502
1513
  this.$set(this.model, t.prop, r);
1503
1514
  },
1504
1515
  dealtItem(t, e) {
@@ -1604,7 +1615,7 @@ const en = hl.exports, pl = {
1604
1615
  immediate: !0,
1605
1616
  deep: !0,
1606
1617
  handler(t) {
1607
- const e = L(t);
1618
+ const e = E(t);
1608
1619
  e.forEach((n) => {
1609
1620
  n.style = n.style || {}, n.style.width = "180px", n.style.marginRight = "10px";
1610
1621
  }), this.allColumn = e, this.init();
@@ -1697,7 +1708,7 @@ const bl = {
1697
1708
  }
1698
1709
  },
1699
1710
  data() {
1700
- const t = L(this.options);
1711
+ const t = E(this.options);
1701
1712
  t.forEach((n) => n.show = !1);
1702
1713
  const { size: e } = this.$ELEMENT || { size: "small" };
1703
1714
  return {
@@ -1897,7 +1908,7 @@ const Ol = {
1897
1908
  total: 0
1898
1909
  };
1899
1910
  let e = [];
1900
- return this.pageRequest ? this.data.splice(0) : (e = L(this.data), this.data.splice(t.pageSize), t.total = e.length), {
1911
+ return this.pageRequest ? this.data.splice(0) : (e = E(this.data), this.data.splice(t.pageSize), t.total = e.length), {
1901
1912
  uuid: x,
1902
1913
  rawColumn: [],
1903
1914
  columnMenu: Tl,
@@ -1958,7 +1969,7 @@ const Ol = {
1958
1969
  columnWatcher(t) {
1959
1970
  if (!y(t))
1960
1971
  return;
1961
- const e = L(t);
1972
+ const e = E(t);
1962
1973
  e.forEach((n, r) => {
1963
1974
  n.show === void 0 && this.$set(n, "show", !0), n.key === void 0 && this.$set(n, "key", x()), n.sort === void 0 && (n.sort = r), n.bind = n.bind || {}, n.bind.render = n.bind.render || n.render, this.columnControl && (n.bind.renderHeader = this.middleRender(n.bind.renderHeader));
1964
1975
  }), this.rawColumn = e;
@@ -2175,18 +2186,18 @@ function Il(t) {
2175
2186
  }
2176
2187
  function Nl(t) {
2177
2188
  const e = t.querySelector(".el-dialog"), n = [
2178
- A(e, "left"),
2179
- A(e, "right"),
2180
- A(e, "top"),
2181
- A(e, "bottom"),
2182
- A(e, "top-left"),
2183
- A(e, "top-right"),
2184
- A(e, "bottom-left"),
2185
- A(e, "bottom-right")
2189
+ L(e, "left"),
2190
+ L(e, "right"),
2191
+ L(e, "top"),
2192
+ L(e, "bottom"),
2193
+ L(e, "top-left"),
2194
+ L(e, "top-right"),
2195
+ L(e, "bottom-left"),
2196
+ L(e, "bottom-right")
2186
2197
  ];
2187
2198
  return () => n.forEach((r) => r());
2188
2199
  }
2189
- function A(t, e) {
2200
+ function L(t, e) {
2190
2201
  const n = document.createElement("div");
2191
2202
  n.style.position = "absolute", Dl(n, e), t.style.userSelect = "none", t.appendChild(n);
2192
2203
  let r = t.offsetLeft, i = t.offsetTop, s = t.offsetWidth, o = t.offsetHeight, a = !1, l, u;
package/lib/style.scss CHANGED
@@ -158,6 +158,24 @@ $--color-border-extralight: #F2F6FC !default;
158
158
  transform: scaleY(0);
159
159
  }
160
160
 
161
+ .el-dialog.ea-modal {
162
+ &.is-closing {
163
+ margin: 0 !important;
164
+ }
165
+ &.is-fullscreen {
166
+ border-radius: 0;
167
+ margin: 0;
168
+ }
169
+ .el-dialog__header {
170
+ color: #555;
171
+ font-size: 18px;
172
+ .el-dialog__title {
173
+ color: inherit;
174
+ font-size: inherit;
175
+ }
176
+ }
177
+ }
178
+
161
179
  .ea-button-tooltip + .ea-button-tooltip {
162
180
  margin-left: 10px;
163
181
  }
@@ -223,24 +241,6 @@ td {
223
241
  }
224
242
  }
225
243
 
226
- .el-dialog.ea-modal {
227
- &.is-closing {
228
- margin: 0 !important;
229
- }
230
- &.is-fullscreen {
231
- border-radius: 0;
232
- margin: 0;
233
- }
234
- .el-dialog__header {
235
- color: #555;
236
- font-size: 18px;
237
- .el-dialog__title {
238
- color: inherit;
239
- font-size: inherit;
240
- }
241
- }
242
- }
243
-
244
244
  .ea-split-container {
245
245
  display: flex;
246
246
  &.is-down {
@@ -278,14 +278,6 @@ td {
278
278
  }
279
279
  }
280
280
 
281
- .ea-list {
282
- .loading-text {
283
- color: $--color-secondary-text;
284
- text-align: center;
285
- font-size: inherit;
286
- }
287
- }
288
-
289
281
  .ea-tree {
290
282
  .ea-tree-real {
291
283
  .el-tree-node > .el-tree-node__content{
@@ -298,6 +290,18 @@ td {
298
290
  }
299
291
  }
300
292
 
293
+ .ea-number .el-input__inner {
294
+ text-align: left;
295
+ }
296
+
297
+ .ea-list {
298
+ .loading-text {
299
+ color: $--color-secondary-text;
300
+ text-align: center;
301
+ font-size: inherit;
302
+ }
303
+ }
304
+
301
305
  .ea-desc {
302
306
  font-size: 14px;
303
307
  &__title {
@@ -341,10 +345,6 @@ td {
341
345
  }
342
346
  }
343
347
 
344
- .ea-number .el-input__inner {
345
- text-align: left;
346
- }
347
-
348
348
  .file-upload-dialog {
349
349
  // 拖拽区域铺满
350
350
  .el-upload,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-assits",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "element-ui 的扩展组件库",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",