@web-utils/component 1.0.7 → 1.0.10

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/index.js CHANGED
@@ -1,23 +1,17 @@
1
- /*!
2
- * @web-utils/component
3
- * (c) 2022-2022 Simple
4
- * Released under the MIT License.
5
- */
6
- var H = Object.defineProperty, V = Object.defineProperties;
7
- var X = Object.getOwnPropertyDescriptors;
8
- var z = Object.getOwnPropertySymbols;
9
- var U = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
10
- var w = (e, t, n) => t in e ? H(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
1
+ var A = Object.defineProperty, H = Object.defineProperties;
2
+ var V = Object.getOwnPropertyDescriptors;
3
+ var S = Object.getOwnPropertySymbols;
4
+ var X = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
5
+ var w = (e, t, n) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, u = (e, t) => {
11
6
  for (var n in t || (t = {}))
12
- U.call(t, n) && w(e, n, t[n]);
13
- if (z)
14
- for (var n of z(t))
15
- k.call(t, n) && w(e, n, t[n]);
7
+ X.call(t, n) && w(e, n, t[n]);
8
+ if (S)
9
+ for (var n of S(t))
10
+ U.call(t, n) && w(e, n, t[n]);
16
11
  return e;
17
- }, c = (e, t) => V(e, X(t));
18
- import { isPlainObject as L, isString as J, isArray as Y } from "@web-utils/core";
19
- const q = "1.0.7";
20
- var D = function() {
12
+ }, c = (e, t) => H(e, V(t));
13
+ import { isPlainObject as k, isString as L, isArray as J } from "@web-utils/core";
14
+ var Y = function() {
21
15
  var e = this, t = e.$createElement, n = e._self._c || t;
22
16
  return n("div", {
23
17
  staticClass: "empty-view",
@@ -28,21 +22,21 @@ var D = function() {
28
22
  }, [e._t("default", function() {
29
23
  return [e._v(e._s(e.emptyTips))];
30
24
  })], 2);
31
- }, G = [];
32
- function a(e, t, n, s, r, u, C, W) {
25
+ }, q = [];
26
+ function a(e, t, n, s, r, f, C, N) {
33
27
  var i = typeof e == "function" ? e.options : e;
34
- t && (i.render = t, i.staticRenderFns = n, i._compiled = !0), s && (i.functional = !0), u && (i._scopeId = "data-v-" + u);
28
+ t && (i.render = t, i.staticRenderFns = n, i._compiled = !0), s && (i.functional = !0), f && (i._scopeId = "data-v-" + f);
35
29
  var l;
36
30
  if (C ? (l = function(o) {
37
31
  o = o || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !o && typeof __VUE_SSR_CONTEXT__ != "undefined" && (o = __VUE_SSR_CONTEXT__), r && r.call(this, o), o && o._registeredComponents && o._registeredComponents.add(C);
38
- }, i._ssrRegister = l) : r && (l = W ? function() {
32
+ }, i._ssrRegister = l) : r && (l = N ? function() {
39
33
  r.call(this, (i.functional ? this.parent : this).$root.$options.shadowRoot);
40
34
  } : r), l)
41
35
  if (i.functional) {
42
36
  i._injectStyles = l;
43
- var j = i.render;
44
- i.render = function(A, S) {
45
- return l.call(S), j(A, S);
37
+ var W = i.render;
38
+ i.render = function(j, z) {
39
+ return l.call(z), W(j, z);
46
40
  };
47
41
  } else {
48
42
  var y = i.beforeCreate;
@@ -53,7 +47,7 @@ function a(e, t, n, s, r, u, C, W) {
53
47
  options: i
54
48
  };
55
49
  }
56
- const K = {
50
+ const D = {
57
51
  name: "EmptyView",
58
52
  props: {
59
53
  emptyTips: {
@@ -70,18 +64,14 @@ const K = {
70
64
  }
71
65
  }
72
66
  }, M = {};
73
- var Q = /* @__PURE__ */ a(K, D, G, !1, Z, null, null, null);
74
- function Z(e) {
67
+ var G = /* @__PURE__ */ a(D, Y, q, !1, K, null, null, null);
68
+ function K(e) {
75
69
  for (let t in M)
76
70
  this[t] = M[t];
77
71
  }
78
72
  var _ = /* @__PURE__ */ function() {
79
- return Q.exports;
80
- }();
81
- _.install = function(e) {
82
- e.component(_.name, _);
83
- };
84
- var ee = function() {
73
+ return G.exports;
74
+ }(), Q = function() {
85
75
  var e = this, t = e.$createElement, n = e._self._c || t;
86
76
  return n("div", {
87
77
  staticClass: "flex-scroller-wrapper"
@@ -92,8 +82,8 @@ var ee = function() {
92
82
  "content-scroll": e.contentScroll
93
83
  }, e.contentClass]
94
84
  }, [e._t("default")], 2)]);
95
- }, te = [];
96
- const ne = {
85
+ }, Z = [];
86
+ const ee = {
97
87
  name: "FlexScroller",
98
88
  props: {
99
89
  flexColumn: Boolean,
@@ -105,21 +95,17 @@ const ne = {
105
95
  }
106
96
  }
107
97
  }, F = {};
108
- var re = /* @__PURE__ */ a(ne, ee, te, !1, se, null, null, null);
109
- function se(e) {
98
+ var te = /* @__PURE__ */ a(ee, Q, Z, !1, ne, null, null, null);
99
+ function ne(e) {
110
100
  for (let t in F)
111
101
  this[t] = F[t];
112
102
  }
113
103
  var h = /* @__PURE__ */ function() {
114
- return re.exports;
115
- }();
116
- h.install = function(e) {
117
- e.component(h.name, h);
118
- };
119
- var ie = function() {
104
+ return te.exports;
105
+ }(), re = function() {
120
106
  var e = this, t = e.$createElement;
121
107
  return e._self._c, e._m(0);
122
- }, oe = [function() {
108
+ }, se = [function() {
123
109
  var e = this, t = e.$createElement, n = e._self._c || t;
124
110
  return n("div", {
125
111
  staticClass: "not-implement"
@@ -127,21 +113,18 @@ var ie = function() {
127
113
  staticClass: "fa fa-wrench"
128
114
  }), e._v(" \u5EFA\u8BBE\u4E2D... ")])]);
129
115
  }];
130
- const le = {
116
+ const ie = {
131
117
  name: "NotImplement"
132
118
  }, B = {};
133
- var ae = /* @__PURE__ */ a(le, ie, oe, !1, ue, "f91d5e80", null, null);
134
- function ue(e) {
119
+ var oe = /* @__PURE__ */ a(ie, re, se, !1, le, "f91d5e80", null, null);
120
+ function le(e) {
135
121
  for (let t in B)
136
122
  this[t] = B[t];
137
123
  }
138
124
  var p = /* @__PURE__ */ function() {
139
- return ae.exports;
125
+ return oe.exports;
140
126
  }();
141
- p.install = function(e) {
142
- e.component(p.name, p);
143
- };
144
- function fe(e, t) {
127
+ function ae(e, t) {
145
128
  for (let n = 0; n < t.length; n++)
146
129
  if (e === t[n])
147
130
  return !0;
@@ -160,14 +143,14 @@ const O = function() {
160
143
  e && t && e.detachEvent(`on${t}`, n);
161
144
  };
162
145
  }();
163
- var ce = function() {
146
+ var fe = function() {
164
147
  var e = this, t = e.$createElement, n = e._self._c || t;
165
148
  return n("div", {
166
149
  class: e.classes
167
150
  }, [e.showIcon ? n("div", {
168
151
  class: e.barConClasses
169
152
  }, e._m(0), 0) : e._e()]);
170
- }, _e = [function() {
153
+ }, ue = [function() {
171
154
  var e = this, t = e.$createElement, n = e._self._c || t;
172
155
  return e._l(8, function(s) {
173
156
  return n("i", {
@@ -176,7 +159,7 @@ var ce = function() {
176
159
  });
177
160
  });
178
161
  }];
179
- const he = {
162
+ const ce = {
180
163
  name: "Trigger",
181
164
  props: {
182
165
  mode: String,
@@ -210,14 +193,14 @@ const he = {
210
193
  }
211
194
  }
212
195
  }, b = {};
213
- var pe = /* @__PURE__ */ a(he, ce, _e, !1, ve, null, null, null);
214
- function ve(e) {
196
+ var _e = /* @__PURE__ */ a(ce, fe, ue, !1, he, null, null, null);
197
+ function he(e) {
215
198
  for (let t in b)
216
199
  this[t] = b[t];
217
200
  }
218
- var de = /* @__PURE__ */ function() {
219
- return pe.exports;
220
- }(), me = function() {
201
+ var pe = /* @__PURE__ */ function() {
202
+ return _e.exports;
203
+ }(), ve = function() {
221
204
  var e = this, t = e.$createElement, n = e._self._c || t;
222
205
  return n("div", {
223
206
  ref: "outerWrapper",
@@ -277,11 +260,11 @@ var de = /* @__PURE__ */ function() {
277
260
  top: `calc(${e.offset}% + ${e.triggerSize}px)`
278
261
  }
279
262
  }, [e._t("bottom")], 2)])]);
280
- }, xe = [];
281
- const $e = {
263
+ }, de = [];
264
+ const me = {
282
265
  name: "SplitPane",
283
266
  components: {
284
- Trigger: de
267
+ Trigger: pe
285
268
  },
286
269
  props: {
287
270
  value: {
@@ -290,7 +273,7 @@ const $e = {
290
273
  },
291
274
  mode: {
292
275
  validator(e) {
293
- return fe(e, ["horizontal", "vertical"]);
276
+ return ae(e, ["horizontal", "vertical"]);
294
277
  },
295
278
  default: "horizontal"
296
279
  },
@@ -372,8 +355,8 @@ const $e = {
372
355
  handleMove(e) {
373
356
  const n = (this.isHorizontal ? e.pageX : e.pageY) - this.initOffset, s = this.$refs.outerWrapper[this.offsetSize];
374
357
  let r = this.valueIsPx ? `${parseFloat(this.oldOffset) + n}px` : this.px2percent(s * this.oldOffset + n, s);
375
- const u = this.getAnotherOffset(r);
376
- parseFloat(r) <= parseFloat(this.computedMin) && (r = this.getMax(r, this.computedMin)), parseFloat(u) <= parseFloat(this.computedMax) && (r = this.getAnotherOffset(this.getMax(u, this.computedMax))), e.atMin = this.value === this.computedMin, e.atMax = this.valueIsPx ? this.getAnotherOffset(this.value) === this.computedMax : this.getAnotherOffset(this.value).toFixed(5) === this.computedMax.toFixed(5), this.$emit("input", r), this.$emit("on-moving", e);
358
+ const f = this.getAnotherOffset(r);
359
+ parseFloat(r) <= parseFloat(this.computedMin) && (r = this.getMax(r, this.computedMin)), parseFloat(f) <= parseFloat(this.computedMax) && (r = this.getAnotherOffset(this.getMax(f, this.computedMax))), e.atMin = this.value === this.computedMin, e.atMax = this.valueIsPx ? this.getAnotherOffset(this.value) === this.computedMax : this.getAnotherOffset(this.value).toFixed(5) === this.computedMax.toFixed(5), this.$emit("input", r), this.$emit("on-moving", e);
377
360
  },
378
361
  handleUp() {
379
362
  this.isMoving = !1, R(window, "mousemove", this.handleMove), R(window, "mouseup", this.handleUp), this.$emit("on-move-end");
@@ -383,18 +366,14 @@ const $e = {
383
366
  }
384
367
  }
385
368
  }, I = {};
386
- var ge = /* @__PURE__ */ a($e, me, xe, !1, Ce, null, null, null);
387
- function Ce(e) {
369
+ var xe = /* @__PURE__ */ a(me, ve, de, !1, $e, null, null, null);
370
+ function $e(e) {
388
371
  for (let t in I)
389
372
  this[t] = I[t];
390
373
  }
391
374
  var v = /* @__PURE__ */ function() {
392
- return ge.exports;
393
- }();
394
- v.install = function(e) {
395
- e.component(v.name, v);
396
- };
397
- var $ = {
375
+ return xe.exports;
376
+ }(), d = {
398
377
  name: "JSXComponent",
399
378
  props: {
400
379
  msg: {
@@ -406,12 +385,7 @@ var $ = {
406
385
  return arguments[0]("div", [this.msg]);
407
386
  }
408
387
  };
409
- /*!
410
- * @web-utils/component
411
- * (c) 2022-2022 Simple
412
- * Released under the MIT License.
413
- */
414
- const g = (e, t) => L(e) || J(e) ? [t, e] : Y(e) ? [t, ...e] : [t], ye = {
388
+ const g = (e, t) => k(e) || L(e) ? [t, e] : J(e) ? [t, ...e] : [t], ge = {
415
389
  name: "FlexColumn",
416
390
  functional: !0,
417
391
  props: {
@@ -434,20 +408,20 @@ const g = (e, t) => L(e) || J(e) ? [t, e] : Y(e) ? [t, ...e] : [t], ye = {
434
408
  },
435
409
  render(e, { data: t, children: n, props: s }) {
436
410
  const r = g(t.class, "flex-column");
437
- return s.center || s.horizonCenter && s.verticalCenter ? (r.push("horizon-center"), r.push("vertical-center")) : (s.horizonCenter && r.push("horizon-center"), s.verticalCenter && r.push("vertical-center")), s.textCenter && r.push("text-center"), e("div", c(f({}, t), { class: r }), n);
411
+ return s.center || s.horizonCenter && s.verticalCenter ? (r.push("horizon-center"), r.push("vertical-center")) : (s.horizonCenter && r.push("horizon-center"), s.verticalCenter && r.push("vertical-center")), s.textCenter && r.push("text-center"), e("div", c(u({}, t), { class: r }), n);
438
412
  }
439
413
  };
440
- let Se, ze;
414
+ let Ce, ye;
441
415
  const E = {};
442
- var we = /* @__PURE__ */ a(ye, Se, ze, !1, Me, null, null, null);
443
- function Me(e) {
416
+ var ze = /* @__PURE__ */ a(ge, Ce, ye, !1, Se, null, null, null);
417
+ function Se(e) {
444
418
  for (let t in E)
445
419
  this[t] = E[t];
446
420
  }
447
- var d = /* @__PURE__ */ function() {
448
- return we.exports;
421
+ var m = /* @__PURE__ */ function() {
422
+ return ze.exports;
449
423
  }();
450
- const Fe = {
424
+ const we = {
451
425
  name: "FlexItem",
452
426
  functional: !0,
453
427
  props: {
@@ -486,20 +460,20 @@ const Fe = {
486
460
  },
487
461
  render(e, { children: t, data: n, props: s }) {
488
462
  const r = g(n.class, s.relative ? "flex-item-relative" : "flex-item");
489
- return s.absolute && !s.relative && r.push("flex-item-relative"), s.center || s.horizonCenter && s.verticalCenter ? (r.push("horizon-center"), r.push("vertical-center")) : (s.horizonCenter && r.push("horizon-center"), s.verticalCenter && r.push("vertical-center")), s.textCenter && r.push("text-center"), s.flexColumn && r.push("flex-column"), s.flexRow && r.push("flex-row"), s.absolute ? e("div", c(f({}, n), { class: r }), [e("div", { class: "absolute", style: "overflow:auto" }, t)]) : e("div", c(f({}, n), { class: r }), t);
463
+ return s.absolute && !s.relative && r.push("flex-item-relative"), s.center || s.horizonCenter && s.verticalCenter ? (r.push("horizon-center"), r.push("vertical-center")) : (s.horizonCenter && r.push("horizon-center"), s.verticalCenter && r.push("vertical-center")), s.textCenter && r.push("text-center"), s.flexColumn && r.push("flex-column"), s.flexRow && r.push("flex-row"), s.absolute ? e("div", c(u({}, n), { class: r }), [e("div", { class: "absolute", style: "overflow:auto" }, t)]) : e("div", c(u({}, n), { class: r }), t);
490
464
  }
491
465
  };
492
- let Be, Oe;
466
+ let Me, Fe;
493
467
  const T = {};
494
- var Re = /* @__PURE__ */ a(Fe, Be, Oe, !1, be, null, null, null);
495
- function be(e) {
468
+ var Be = /* @__PURE__ */ a(we, Me, Fe, !1, Oe, null, null, null);
469
+ function Oe(e) {
496
470
  for (let t in T)
497
471
  this[t] = T[t];
498
472
  }
499
- var m = /* @__PURE__ */ function() {
500
- return Re.exports;
473
+ var x = /* @__PURE__ */ function() {
474
+ return Be.exports;
501
475
  }();
502
- const Ie = {
476
+ const Re = {
503
477
  name: "FlexRow",
504
478
  functional: !0,
505
479
  props: {
@@ -522,29 +496,21 @@ const Ie = {
522
496
  },
523
497
  render(e, { data: t, children: n, props: s }) {
524
498
  const r = g(t.class, "flex-row");
525
- return s.center || s.horizonCenter && s.verticalCenter ? (r.push("horizon-center"), r.push("vertical-center")) : (s.horizonCenter && r.push("horizon-center"), s.verticalCenter && r.push("vertical-center")), s.textCenter && r.push("text-center"), e("div", c(f({}, t), { class: r }), n);
499
+ return s.center || s.horizonCenter && s.verticalCenter ? (r.push("horizon-center"), r.push("vertical-center")) : (s.horizonCenter && r.push("horizon-center"), s.verticalCenter && r.push("vertical-center")), s.textCenter && r.push("text-center"), e("div", c(u({}, t), { class: r }), n);
526
500
  }
527
501
  };
528
- let Ee, Te;
502
+ let be, Ie;
529
503
  const P = {};
530
- var Pe = /* @__PURE__ */ a(Ie, Ee, Te, !1, Ne, null, null, null);
531
- function Ne(e) {
504
+ var Ee = /* @__PURE__ */ a(Re, be, Ie, !1, Te, null, null, null);
505
+ function Te(e) {
532
506
  for (let t in P)
533
507
  this[t] = P[t];
534
508
  }
535
- var x = /* @__PURE__ */ function() {
536
- return Pe.exports;
509
+ var $ = /* @__PURE__ */ function() {
510
+ return Ee.exports;
537
511
  }();
538
- d.install = function(e) {
539
- e.component(d.name, d);
540
- };
541
- m.install = function(e) {
542
- e.component(m.name, m);
543
- };
544
- x.install = function(e) {
545
- e.component(x.name, x);
546
- };
547
- function N(e) {
548
- e.use(_), e.use(h), e.use(p), e.use(v), e.use(d), e.use(m), e.use(x), e.component($.name, $);
512
+ const Pe = "1.0.10";
513
+ function Ne(e) {
514
+ e.component(_.name, _), e.component(h.name, h), e.component(p.name, p), e.component(v.name, v), e.component(m.name, m), e.component(x.name, x), e.component($.name, $), e.component(d.name, d);
549
515
  }
550
- export { _ as EmptyView, d as FlexColumn, m as FlexItem, x as FlexRow, h as FlexScroller, $ as JSXComponent, p as NotImplement, v as SplitPane, N as default, N as install, q as version };
516
+ export { _ as EmptyView, m as FlexColumn, x as FlexItem, $ as FlexRow, h as FlexScroller, d as JSXComponent, p as NotImplement, v as SplitPane, Ne as default, Pe as version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web-utils/component",
3
- "version": "1.0.7",
3
+ "version": "1.0.10",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
package/web-types.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "framework": "vue",
4
4
  "name": "@web-utils/component",
5
- "version": "1.0.2",
5
+ "version": "1.0.9",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "tags": [
@@ -75,6 +75,21 @@
75
75
  "name": "default"
76
76
  }
77
77
  ]
78
+ },
79
+ {
80
+ "name": "FlexRow"
81
+ },
82
+ {
83
+ "name": "FlexItem"
84
+ },
85
+ {
86
+ "name": "NotImplement"
87
+ },
88
+ {
89
+ "name": "FlexColumn"
90
+ },
91
+ {
92
+ "name": "JSXComponent"
78
93
  }
79
94
  ]
80
95
  }