@web-utils/component 1.0.8 → 1.0.9

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.
Files changed (2) hide show
  1. package/dist/index.js +252 -474
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,93 +1,54 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { isPlainObject, isString, isArray } from "@web-utils/core";
21
- var util = "";
22
- const version = "1.0.8";
23
- var render$4 = function() {
24
- var _vm = this;
25
- var _h = _vm.$createElement;
26
- var _c = _vm._self._c || _h;
27
- return _c("div", {
1
+ var A = Object.defineProperty, H = Object.defineProperties;
2
+ var V = Object.getOwnPropertyDescriptors;
3
+ var m = Object.getOwnPropertySymbols;
4
+ var X = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
5
+ var x = (e, t, n) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ X.call(t, n) && x(e, n, t[n]);
8
+ if (m)
9
+ for (var n of m(t))
10
+ U.call(t, n) && x(e, n, t[n]);
11
+ return e;
12
+ }, c = (e, t) => H(e, V(t));
13
+ import { isPlainObject as k, isString as L, isArray as J } from "@web-utils/core";
14
+ const Y = "1.0.9";
15
+ var q = function() {
16
+ var e = this, t = e.$createElement, n = e._self._c || t;
17
+ return n("div", {
28
18
  staticClass: "empty-view",
29
19
  style: {
30
- fontSize: _vm.fontSize,
31
- height: _vm.height
20
+ fontSize: e.fontSize,
21
+ height: e.height
32
22
  }
33
- }, [_vm._t("default", function() {
34
- return [_vm._v(_vm._s(_vm.emptyTips))];
23
+ }, [e._t("default", function() {
24
+ return [e._v(e._s(e.emptyTips))];
35
25
  })], 2);
36
- };
37
- var staticRenderFns$4 = [];
38
- var EmptyView_vue_vue_type_style_index_0_lang = "";
39
- function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
40
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
41
- if (render2) {
42
- options.render = render2;
43
- options.staticRenderFns = staticRenderFns2;
44
- options._compiled = true;
45
- }
46
- if (functionalTemplate) {
47
- options.functional = true;
48
- }
49
- if (scopeId) {
50
- options._scopeId = "data-v-" + scopeId;
51
- }
52
- var hook;
53
- if (moduleIdentifier) {
54
- hook = function(context) {
55
- context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
56
- if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
57
- context = __VUE_SSR_CONTEXT__;
58
- }
59
- if (injectStyles) {
60
- injectStyles.call(this, context);
61
- }
62
- if (context && context._registeredComponents) {
63
- context._registeredComponents.add(moduleIdentifier);
64
- }
65
- };
66
- options._ssrRegister = hook;
67
- } else if (injectStyles) {
68
- hook = shadowMode ? function() {
69
- injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
70
- } : injectStyles;
71
- }
72
- if (hook) {
73
- if (options.functional) {
74
- options._injectStyles = hook;
75
- var originalRender = options.render;
76
- options.render = function renderWithStyleInjection(h, context) {
77
- hook.call(context);
78
- return originalRender(h, context);
26
+ }, D = [];
27
+ function a(e, t, n, s, r, u, v, N) {
28
+ var i = typeof e == "function" ? e.options : e;
29
+ t && (i.render = t, i.staticRenderFns = n, i._compiled = !0), s && (i.functional = !0), u && (i._scopeId = "data-v-" + u);
30
+ var l;
31
+ if (v ? (l = function(o) {
32
+ 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(v);
33
+ }, i._ssrRegister = l) : r && (l = N ? function() {
34
+ r.call(this, (i.functional ? this.parent : this).$root.$options.shadowRoot);
35
+ } : r), l)
36
+ if (i.functional) {
37
+ i._injectStyles = l;
38
+ var W = i.render;
39
+ i.render = function(j, d) {
40
+ return l.call(d), W(j, d);
79
41
  };
80
42
  } else {
81
- var existing = options.beforeCreate;
82
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
43
+ var p = i.beforeCreate;
44
+ i.beforeCreate = p ? [].concat(p, l) : [l];
83
45
  }
84
- }
85
46
  return {
86
- exports: scriptExports,
87
- options
47
+ exports: e,
48
+ options: i
88
49
  };
89
50
  }
90
- const __vue2_script$7 = {
51
+ const G = {
91
52
  name: "EmptyView",
92
53
  props: {
93
54
  emptyTips: {
@@ -103,37 +64,27 @@ const __vue2_script$7 = {
103
64
  default: "100%"
104
65
  }
105
66
  }
106
- };
107
- const __cssModules$7 = {};
108
- var __component__$7 = /* @__PURE__ */ normalizeComponent(__vue2_script$7, render$4, staticRenderFns$4, false, __vue2_injectStyles$7, null, null, null);
109
- function __vue2_injectStyles$7(context) {
110
- for (let o in __cssModules$7) {
111
- this[o] = __cssModules$7[o];
112
- }
67
+ }, $ = {};
68
+ var K = /* @__PURE__ */ a(G, q, D, !1, Q, null, null, null);
69
+ function Q(e) {
70
+ for (let t in $)
71
+ this[t] = $[t];
113
72
  }
114
- var EmptyView = /* @__PURE__ */ function() {
115
- return __component__$7.exports;
116
- }();
117
- EmptyView.install = function(Vue) {
118
- Vue.component(EmptyView.name, EmptyView);
119
- };
120
- var render$3 = function() {
121
- var _vm = this;
122
- var _h = _vm.$createElement;
123
- var _c = _vm._self._c || _h;
124
- return _c("div", {
73
+ var O = /* @__PURE__ */ function() {
74
+ return K.exports;
75
+ }(), Z = function() {
76
+ var e = this, t = e.$createElement, n = e._self._c || t;
77
+ return n("div", {
125
78
  staticClass: "flex-scroller-wrapper"
126
- }, [_c("div", {
79
+ }, [n("div", {
127
80
  class: ["flex-scroller", {
128
- "flex-column": _vm.flexColumn,
129
- "flex-row": _vm.flexRow,
130
- "content-scroll": _vm.contentScroll
131
- }, _vm.contentClass]
132
- }, [_vm._t("default")], 2)]);
133
- };
134
- var staticRenderFns$3 = [];
135
- var FlexScroller_vue_vue_type_style_index_0_lang = "";
136
- const __vue2_script$6 = {
81
+ "flex-column": e.flexColumn,
82
+ "flex-row": e.flexRow,
83
+ "content-scroll": e.contentScroll
84
+ }, e.contentClass]
85
+ }, [e._t("default")], 2)]);
86
+ }, ee = [];
87
+ const te = {
137
88
  name: "FlexScroller",
138
89
  props: {
139
90
  flexColumn: Boolean,
@@ -141,124 +92,82 @@ const __vue2_script$6 = {
141
92
  contentClass: String,
142
93
  contentScroll: {
143
94
  type: Boolean,
144
- default: true
95
+ default: !0
145
96
  }
146
97
  }
147
- };
148
- const __cssModules$6 = {};
149
- var __component__$6 = /* @__PURE__ */ normalizeComponent(__vue2_script$6, render$3, staticRenderFns$3, false, __vue2_injectStyles$6, null, null, null);
150
- function __vue2_injectStyles$6(context) {
151
- for (let o in __cssModules$6) {
152
- this[o] = __cssModules$6[o];
153
- }
98
+ }, g = {};
99
+ var ne = /* @__PURE__ */ a(te, Z, ee, !1, re, null, null, null);
100
+ function re(e) {
101
+ for (let t in g)
102
+ this[t] = g[t];
154
103
  }
155
- var FlexScroller = /* @__PURE__ */ function() {
156
- return __component__$6.exports;
157
- }();
158
- FlexScroller.install = function(Vue) {
159
- Vue.component(FlexScroller.name, FlexScroller);
160
- };
161
- var render$2 = function() {
162
- var _vm = this;
163
- var _h = _vm.$createElement;
164
- _vm._self._c || _h;
165
- return _vm._m(0);
166
- };
167
- var staticRenderFns$2 = [function() {
168
- var _vm = this;
169
- var _h = _vm.$createElement;
170
- var _c = _vm._self._c || _h;
171
- return _c("div", {
104
+ var R = /* @__PURE__ */ function() {
105
+ return ne.exports;
106
+ }(), se = function() {
107
+ var e = this, t = e.$createElement;
108
+ return e._self._c, e._m(0);
109
+ }, ie = [function() {
110
+ var e = this, t = e.$createElement, n = e._self._c || t;
111
+ return n("div", {
172
112
  staticClass: "not-implement"
173
- }, [_c("div", [_c("i", {
113
+ }, [n("div", [n("i", {
174
114
  staticClass: "fa fa-wrench"
175
- }), _vm._v(" \u5EFA\u8BBE\u4E2D... ")])]);
115
+ }), e._v(" \u5EFA\u8BBE\u4E2D... ")])]);
176
116
  }];
177
- var NotImplement_vue_vue_type_style_index_0_scoped_true_lang = "";
178
- const __vue2_script$5 = {
117
+ const oe = {
179
118
  name: "NotImplement"
180
- };
181
- const __cssModules$5 = {};
182
- var __component__$5 = /* @__PURE__ */ normalizeComponent(__vue2_script$5, render$2, staticRenderFns$2, false, __vue2_injectStyles$5, "f91d5e80", null, null);
183
- function __vue2_injectStyles$5(context) {
184
- for (let o in __cssModules$5) {
185
- this[o] = __cssModules$5[o];
186
- }
119
+ }, C = {};
120
+ var le = /* @__PURE__ */ a(oe, se, ie, !1, ae, "f91d5e80", null, null);
121
+ function ae(e) {
122
+ for (let t in C)
123
+ this[t] = C[t];
187
124
  }
188
- var NotImplement = /* @__PURE__ */ function() {
189
- return __component__$5.exports;
125
+ var b = /* @__PURE__ */ function() {
126
+ return le.exports;
190
127
  }();
191
- NotImplement.install = function(Vue) {
192
- Vue.component(NotImplement.name, NotImplement);
193
- };
194
- function oneOf(value, validList) {
195
- for (let i = 0; i < validList.length; i++) {
196
- if (value === validList[i]) {
197
- return true;
198
- }
199
- }
200
- return false;
128
+ function ue(e, t) {
129
+ for (let n = 0; n < t.length; n++)
130
+ if (e === t[n])
131
+ return !0;
132
+ return !1;
201
133
  }
202
- const on = function() {
203
- if (document.addEventListener) {
204
- return function(element, event, handler) {
205
- if (element && event && handler) {
206
- element.addEventListener(event, handler, false);
207
- }
208
- };
209
- } else {
210
- return function(element, event, handler) {
211
- if (element && event && handler) {
212
- element.attachEvent(`on${event}`, handler);
213
- }
214
- };
215
- }
216
- }();
217
- const off = function() {
218
- if (document.removeEventListener) {
219
- return function(element, event, handler) {
220
- if (element && event) {
221
- element.removeEventListener(event, handler, false);
222
- }
223
- };
224
- } else {
225
- return function(element, event, handler) {
226
- if (element && event) {
227
- element.detachEvent(`on${event}`, handler);
228
- }
229
- };
230
- }
134
+ const y = function() {
135
+ return document.addEventListener ? function(e, t, n) {
136
+ e && t && n && e.addEventListener(t, n, !1);
137
+ } : function(e, t, n) {
138
+ e && t && n && e.attachEvent(`on${t}`, n);
139
+ };
140
+ }(), z = function() {
141
+ return document.removeEventListener ? function(e, t, n) {
142
+ e && t && e.removeEventListener(t, n, !1);
143
+ } : function(e, t, n) {
144
+ e && t && e.detachEvent(`on${t}`, n);
145
+ };
231
146
  }();
232
- var render$1 = function() {
233
- var _vm = this;
234
- var _h = _vm.$createElement;
235
- var _c = _vm._self._c || _h;
236
- return _c("div", {
237
- class: _vm.classes
238
- }, [_vm.showIcon ? _c("div", {
239
- class: _vm.barConClasses
240
- }, _vm._m(0), 0) : _vm._e()]);
241
- };
242
- var staticRenderFns$1 = [function() {
243
- var _vm = this;
244
- var _h = _vm.$createElement;
245
- var _c = _vm._self._c || _h;
246
- return _vm._l(8, function(i) {
247
- return _c("i", {
248
- key: `trigger-${i}`,
249
- class: `${_vm.prefix}-bar`
147
+ var fe = function() {
148
+ var e = this, t = e.$createElement, n = e._self._c || t;
149
+ return n("div", {
150
+ class: e.classes
151
+ }, [e.showIcon ? n("div", {
152
+ class: e.barConClasses
153
+ }, e._m(0), 0) : e._e()]);
154
+ }, ce = [function() {
155
+ var e = this, t = e.$createElement, n = e._self._c || t;
156
+ return e._l(8, function(s) {
157
+ return n("i", {
158
+ key: `trigger-${s}`,
159
+ class: `${e.prefix}-bar`
250
160
  });
251
161
  });
252
162
  }];
253
- var Trigger_vue_vue_type_style_index_0_lang = "";
254
- const __vue2_script$4 = {
163
+ const _e = {
255
164
  name: "Trigger",
256
165
  props: {
257
166
  mode: String,
258
167
  showIcon: Boolean,
259
168
  line: {
260
169
  type: Boolean,
261
- default: true
170
+ default: !0
262
171
  }
263
172
  },
264
173
  data() {
@@ -284,86 +193,79 @@ const __vue2_script$4 = {
284
193
  ];
285
194
  }
286
195
  }
287
- };
288
- const __cssModules$4 = {};
289
- var __component__$4 = /* @__PURE__ */ normalizeComponent(__vue2_script$4, render$1, staticRenderFns$1, false, __vue2_injectStyles$4, null, null, null);
290
- function __vue2_injectStyles$4(context) {
291
- for (let o in __cssModules$4) {
292
- this[o] = __cssModules$4[o];
293
- }
196
+ }, S = {};
197
+ var he = /* @__PURE__ */ a(_e, fe, ce, !1, ve, null, null, null);
198
+ function ve(e) {
199
+ for (let t in S)
200
+ this[t] = S[t];
294
201
  }
295
- var Trigger = /* @__PURE__ */ function() {
296
- return __component__$4.exports;
297
- }();
298
- var render = function() {
299
- var _vm = this;
300
- var _h = _vm.$createElement;
301
- var _c = _vm._self._c || _h;
302
- return _c("div", {
202
+ var pe = /* @__PURE__ */ function() {
203
+ return he.exports;
204
+ }(), de = function() {
205
+ var e = this, t = e.$createElement, n = e._self._c || t;
206
+ return n("div", {
303
207
  ref: "outerWrapper",
304
- class: _vm.wrapperClasses
305
- }, [_vm.isHorizontal ? _c("div", {
306
- class: `${_vm.prefix}-horizontal`
307
- }, [_c("div", {
308
- class: [`${_vm.prefix}-pane`, "left-pane"],
208
+ class: e.wrapperClasses
209
+ }, [e.isHorizontal ? n("div", {
210
+ class: `${e.prefix}-horizontal`
211
+ }, [n("div", {
212
+ class: [`${e.prefix}-pane`, "left-pane"],
309
213
  style: {
310
- right: `${_vm.anotherOffset}%`
214
+ right: `${e.anotherOffset}%`
311
215
  }
312
- }, [_vm._t("left")], 2), _c("div", {
313
- class: `${_vm.prefix}-trigger-con`,
216
+ }, [e._t("left")], 2), n("div", {
217
+ class: `${e.prefix}-trigger-con`,
314
218
  style: {
315
- left: `calc(${_vm.offset}% + ${_vm.triggerSize / 2}px)`,
316
- width: `${_vm.triggerSize}px`
219
+ left: `calc(${e.offset}% + ${e.triggerSize / 2}px)`,
220
+ width: `${e.triggerSize}px`
317
221
  },
318
222
  on: {
319
- "mousedown": _vm.handleMousedown
223
+ mousedown: e.handleMousedown
320
224
  }
321
- }, [_vm._t("trigger", function() {
322
- return [_c("Trigger", {
225
+ }, [e._t("trigger", function() {
226
+ return [n("Trigger", {
323
227
  attrs: {
324
- "mode": "vertical"
228
+ mode: "vertical"
325
229
  }
326
230
  })];
327
- })], 2), _c("div", {
328
- class: [`${_vm.prefix}-pane`, "right-pane"],
231
+ })], 2), n("div", {
232
+ class: [`${e.prefix}-pane`, "right-pane"],
329
233
  style: {
330
- left: `calc(${_vm.offset}% + ${_vm.triggerSize}px)`
234
+ left: `calc(${e.offset}% + ${e.triggerSize}px)`
331
235
  }
332
- }, [_vm._t("right")], 2)]) : _c("div", {
333
- class: `${_vm.prefix}-vertical`
334
- }, [_c("div", {
335
- class: [`${_vm.prefix}-pane`, "top-pane"],
236
+ }, [e._t("right")], 2)]) : n("div", {
237
+ class: `${e.prefix}-vertical`
238
+ }, [n("div", {
239
+ class: [`${e.prefix}-pane`, "top-pane"],
336
240
  style: {
337
- bottom: `${_vm.anotherOffset}%`
241
+ bottom: `${e.anotherOffset}%`
338
242
  }
339
- }, [_vm._t("top")], 2), _c("div", {
340
- class: `${_vm.prefix}-trigger-con`,
243
+ }, [e._t("top")], 2), n("div", {
244
+ class: `${e.prefix}-trigger-con`,
341
245
  style: {
342
- top: `calc(${_vm.offset}% + ${_vm.triggerSize / 2}px)`,
343
- height: `${_vm.triggerSize}px`
246
+ top: `calc(${e.offset}% + ${e.triggerSize / 2}px)`,
247
+ height: `${e.triggerSize}px`
344
248
  },
345
249
  on: {
346
- "mousedown": _vm.handleMousedown
250
+ mousedown: e.handleMousedown
347
251
  }
348
- }, [_vm._t("trigger", function() {
349
- return [_c("Trigger", {
252
+ }, [e._t("trigger", function() {
253
+ return [n("Trigger", {
350
254
  attrs: {
351
- "mode": "horizontal"
255
+ mode: "horizontal"
352
256
  }
353
257
  })];
354
- })], 2), _c("div", {
355
- class: [`${_vm.prefix}-pane`, "bottom-pane"],
258
+ })], 2), n("div", {
259
+ class: [`${e.prefix}-pane`, "bottom-pane"],
356
260
  style: {
357
- top: `calc(${_vm.offset}% + ${_vm.triggerSize}px)`
261
+ top: `calc(${e.offset}% + ${e.triggerSize}px)`
358
262
  }
359
- }, [_vm._t("bottom")], 2)])]);
360
- };
361
- var staticRenderFns = [];
362
- var SplitPane_vue_vue_type_style_index_0_lang = "";
363
- const __vue2_script$3 = {
263
+ }, [e._t("bottom")], 2)])]);
264
+ }, me = [];
265
+ const xe = {
364
266
  name: "SplitPane",
365
267
  components: {
366
- Trigger
268
+ Trigger: pe
367
269
  },
368
270
  props: {
369
271
  value: {
@@ -371,8 +273,8 @@ const __vue2_script$3 = {
371
273
  default: 0.5
372
274
  },
373
275
  mode: {
374
- validator(value) {
375
- return oneOf(value, ["horizontal", "vertical"]);
276
+ validator(e) {
277
+ return ue(e, ["horizontal", "vertical"]);
376
278
  },
377
279
  default: "horizontal"
378
280
  },
@@ -394,7 +296,7 @@ const __vue2_script$3 = {
394
296
  prefix: "egd-split",
395
297
  offset: 0,
396
298
  oldOffset: 0,
397
- isMoving: false
299
+ isMoving: !1
398
300
  };
399
301
  },
400
302
  computed: {
@@ -411,7 +313,7 @@ const __vue2_script$3 = {
411
313
  return 100 - this.offset;
412
314
  },
413
315
  valueIsPx() {
414
- return typeof this.value === "string";
316
+ return typeof this.value == "string";
415
317
  },
416
318
  offsetSize() {
417
319
  return this.isHorizontal ? "offsetWidth" : "offsetHeight";
@@ -434,85 +336,45 @@ const __vue2_script$3 = {
434
336
  });
435
337
  },
436
338
  methods: {
437
- px2percent(numerator, denominator) {
438
- return parseFloat(numerator) / parseFloat(denominator);
439
- },
440
- getComputedThresholdValue(type) {
441
- const size = this.$refs.outerWrapper[this.offsetSize];
442
- if (this.valueIsPx) {
443
- return typeof this[type] === "string" ? this[type] : size * this[type];
444
- } else {
445
- return typeof this[type] === "string" ? this.px2percent(this[type], size) : this[type];
446
- }
339
+ px2percent(e, t) {
340
+ return parseFloat(e) / parseFloat(t);
447
341
  },
448
- getMin(value1, value2) {
449
- if (this.valueIsPx) {
450
- return `${Math.min(parseFloat(value1), parseFloat(value2))}px`;
451
- } else {
452
- return Math.min(value1, value2);
453
- }
342
+ getComputedThresholdValue(e) {
343
+ const t = this.$refs.outerWrapper[this.offsetSize];
344
+ return this.valueIsPx ? typeof this[e] == "string" ? this[e] : t * this[e] : typeof this[e] == "string" ? this.px2percent(this[e], t) : this[e];
454
345
  },
455
- getMax(value1, value2) {
456
- if (this.valueIsPx) {
457
- return `${Math.max(parseFloat(value1), parseFloat(value2))}px`;
458
- } else {
459
- return Math.max(value1, value2);
460
- }
346
+ getMin(e, t) {
347
+ return this.valueIsPx ? `${Math.min(parseFloat(e), parseFloat(t))}px` : Math.min(e, t);
461
348
  },
462
- getAnotherOffset(value) {
463
- let res = 0;
464
- if (this.valueIsPx) {
465
- res = `${this.$refs.outerWrapper[this.offsetSize] - parseFloat(value)}px`;
466
- } else {
467
- res = 1 - value;
468
- }
469
- return res;
349
+ getMax(e, t) {
350
+ return this.valueIsPx ? `${Math.max(parseFloat(e), parseFloat(t))}px` : Math.max(e, t);
351
+ },
352
+ getAnotherOffset(e) {
353
+ let t = 0;
354
+ return this.valueIsPx ? t = `${this.$refs.outerWrapper[this.offsetSize] - parseFloat(e)}px` : t = 1 - e, t;
470
355
  },
471
356
  handleMove(e) {
472
- const pageOffset = this.isHorizontal ? e.pageX : e.pageY;
473
- const offset = pageOffset - this.initOffset;
474
- const outerWidth = this.$refs.outerWrapper[this.offsetSize];
475
- let value = this.valueIsPx ? `${parseFloat(this.oldOffset) + offset}px` : this.px2percent(outerWidth * this.oldOffset + offset, outerWidth);
476
- const anotherValue = this.getAnotherOffset(value);
477
- if (parseFloat(value) <= parseFloat(this.computedMin))
478
- value = this.getMax(value, this.computedMin);
479
- if (parseFloat(anotherValue) <= parseFloat(this.computedMax))
480
- value = this.getAnotherOffset(this.getMax(anotherValue, this.computedMax));
481
- e.atMin = this.value === this.computedMin;
482
- e.atMax = this.valueIsPx ? this.getAnotherOffset(this.value) === this.computedMax : this.getAnotherOffset(this.value).toFixed(5) === this.computedMax.toFixed(5);
483
- this.$emit("input", value);
484
- this.$emit("on-moving", e);
357
+ const n = (this.isHorizontal ? e.pageX : e.pageY) - this.initOffset, s = this.$refs.outerWrapper[this.offsetSize];
358
+ let r = this.valueIsPx ? `${parseFloat(this.oldOffset) + n}px` : this.px2percent(s * this.oldOffset + n, s);
359
+ const u = this.getAnotherOffset(r);
360
+ 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);
485
361
  },
486
362
  handleUp() {
487
- this.isMoving = false;
488
- off(window, "mousemove", this.handleMove);
489
- off(window, "mouseup", this.handleUp);
490
- this.$emit("on-move-end");
363
+ this.isMoving = !1, z(window, "mousemove", this.handleMove), z(window, "mouseup", this.handleUp), this.$emit("on-move-end");
491
364
  },
492
365
  handleMousedown(e) {
493
- this.initOffset = this.isHorizontal ? e.pageX : e.pageY;
494
- this.oldOffset = this.value;
495
- this.isMoving = true;
496
- on(window, "mousemove", this.handleMove);
497
- on(window, "mouseup", this.handleUp);
498
- this.$emit("on-move-start");
366
+ this.initOffset = this.isHorizontal ? e.pageX : e.pageY, this.oldOffset = this.value, this.isMoving = !0, y(window, "mousemove", this.handleMove), y(window, "mouseup", this.handleUp), this.$emit("on-move-start");
499
367
  }
500
368
  }
501
- };
502
- const __cssModules$3 = {};
503
- var __component__$3 = /* @__PURE__ */ normalizeComponent(__vue2_script$3, render, staticRenderFns, false, __vue2_injectStyles$3, null, null, null);
504
- function __vue2_injectStyles$3(context) {
505
- for (let o in __cssModules$3) {
506
- this[o] = __cssModules$3[o];
507
- }
369
+ }, w = {};
370
+ var $e = /* @__PURE__ */ a(xe, de, me, !1, ge, null, null, null);
371
+ function ge(e) {
372
+ for (let t in w)
373
+ this[t] = w[t];
508
374
  }
509
- var Split = /* @__PURE__ */ function() {
510
- return __component__$3.exports;
511
- }();
512
- Split.install = function(Vue) {
513
- Vue.component(Split.name, Split);
514
- };
515
- var JSXComponent = {
375
+ var I = /* @__PURE__ */ function() {
376
+ return $e.exports;
377
+ }(), _ = {
516
378
  name: "JSXComponent",
517
379
  props: {
518
380
  msg: {
@@ -521,218 +383,134 @@ var JSXComponent = {
521
383
  }
522
384
  },
523
385
  render() {
524
- const h = arguments[0];
525
- return h("div", [this.msg]);
386
+ return arguments[0]("div", [this.msg]);
526
387
  }
527
388
  };
528
- const getClass = (customClass, fixedClass) => {
529
- if (isPlainObject(customClass) || isString(customClass)) {
530
- return [fixedClass, customClass];
531
- } else if (isArray(customClass)) {
532
- return [fixedClass, ...customClass];
533
- } else {
534
- return [fixedClass];
535
- }
536
- };
537
- const __vue2_script$2 = {
389
+ const h = (e, t) => k(e) || L(e) ? [t, e] : J(e) ? [t, ...e] : [t], Ce = {
538
390
  name: "FlexColumn",
539
- functional: true,
391
+ functional: !0,
540
392
  props: {
541
393
  verticalCenter: {
542
394
  type: Boolean,
543
- default: false
395
+ default: !1
544
396
  },
545
397
  horizonCenter: {
546
398
  type: Boolean,
547
- default: false
399
+ default: !1
548
400
  },
549
401
  center: {
550
402
  type: Boolean,
551
- default: false
403
+ default: !1
552
404
  },
553
405
  textCenter: {
554
406
  type: Boolean,
555
- default: false
407
+ default: !1
556
408
  }
557
409
  },
558
- render(createElement, { data, children, props }) {
559
- const viewClass = getClass(data.class, "flex-column");
560
- if (props.center || props.horizonCenter && props.verticalCenter) {
561
- viewClass.push("horizon-center");
562
- viewClass.push("vertical-center");
563
- } else {
564
- if (props.horizonCenter) {
565
- viewClass.push("horizon-center");
566
- }
567
- if (props.verticalCenter) {
568
- viewClass.push("vertical-center");
569
- }
570
- }
571
- if (props.textCenter) {
572
- viewClass.push("text-center");
573
- }
574
- return createElement("div", __spreadProps(__spreadValues({}, data), { class: viewClass }), children);
410
+ render(e, { data: t, children: n, props: s }) {
411
+ const r = h(t.class, "flex-column");
412
+ 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);
575
413
  }
576
414
  };
577
- let __vue2_render$2, __vue2_staticRenderFns$2;
578
- const __cssModules$2 = {};
579
- var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, __vue2_render$2, __vue2_staticRenderFns$2, false, __vue2_injectStyles$2, null, null, null);
580
- function __vue2_injectStyles$2(context) {
581
- for (let o in __cssModules$2) {
582
- this[o] = __cssModules$2[o];
583
- }
415
+ let ye, ze;
416
+ const M = {};
417
+ var Se = /* @__PURE__ */ a(Ce, ye, ze, !1, we, null, null, null);
418
+ function we(e) {
419
+ for (let t in M)
420
+ this[t] = M[t];
584
421
  }
585
- var FlexColumn = /* @__PURE__ */ function() {
586
- return __component__$2.exports;
422
+ var E = /* @__PURE__ */ function() {
423
+ return Se.exports;
587
424
  }();
588
- const __vue2_script$1 = {
425
+ const Me = {
589
426
  name: "FlexItem",
590
- functional: true,
427
+ functional: !0,
591
428
  props: {
592
429
  flexRow: {
593
430
  type: Boolean,
594
- default: false
431
+ default: !1
595
432
  },
596
433
  flexColumn: {
597
434
  type: Boolean,
598
- default: false
435
+ default: !1
599
436
  },
600
437
  verticalCenter: {
601
438
  type: Boolean,
602
- default: false
439
+ default: !1
603
440
  },
604
441
  horizonCenter: {
605
442
  type: Boolean,
606
- default: false
443
+ default: !1
607
444
  },
608
445
  center: {
609
446
  type: Boolean,
610
- default: false
447
+ default: !1
611
448
  },
612
449
  textCenter: {
613
450
  type: Boolean,
614
- default: false
451
+ default: !1
615
452
  },
616
453
  relative: {
617
454
  type: Boolean,
618
- default: false
455
+ default: !1
619
456
  },
620
457
  absolute: {
621
458
  type: Boolean,
622
- default: false
459
+ default: !1
623
460
  }
624
461
  },
625
- render(createElement, { children, data, props }) {
626
- const viewClass = getClass(data.class, props.relative ? "flex-item-relative" : "flex-item");
627
- if (props.absolute && !props.relative) {
628
- viewClass.push("flex-item-relative");
629
- }
630
- if (props.center || props.horizonCenter && props.verticalCenter) {
631
- viewClass.push("horizon-center");
632
- viewClass.push("vertical-center");
633
- } else {
634
- if (props.horizonCenter) {
635
- viewClass.push("horizon-center");
636
- }
637
- if (props.verticalCenter) {
638
- viewClass.push("vertical-center");
639
- }
640
- }
641
- if (props.textCenter) {
642
- viewClass.push("text-center");
643
- }
644
- if (props.flexColumn) {
645
- viewClass.push("flex-column");
646
- }
647
- if (props.flexRow) {
648
- viewClass.push("flex-row");
649
- }
650
- if (props.absolute) {
651
- return createElement("div", __spreadProps(__spreadValues({}, data), { class: viewClass }), [createElement("div", { class: "absolute", style: "overflow:auto" }, children)]);
652
- } else {
653
- return createElement("div", __spreadProps(__spreadValues({}, data), { class: viewClass }), children);
654
- }
462
+ render(e, { children: t, data: n, props: s }) {
463
+ const r = h(n.class, s.relative ? "flex-item-relative" : "flex-item");
464
+ 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);
655
465
  }
656
466
  };
657
- let __vue2_render$1, __vue2_staticRenderFns$1;
658
- const __cssModules$1 = {};
659
- var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, __vue2_render$1, __vue2_staticRenderFns$1, false, __vue2_injectStyles$1, null, null, null);
660
- function __vue2_injectStyles$1(context) {
661
- for (let o in __cssModules$1) {
662
- this[o] = __cssModules$1[o];
663
- }
467
+ let Fe, Be;
468
+ const F = {};
469
+ var Oe = /* @__PURE__ */ a(Me, Fe, Be, !1, Re, null, null, null);
470
+ function Re(e) {
471
+ for (let t in F)
472
+ this[t] = F[t];
664
473
  }
665
- var FlexItem = /* @__PURE__ */ function() {
666
- return __component__$1.exports;
474
+ var T = /* @__PURE__ */ function() {
475
+ return Oe.exports;
667
476
  }();
668
- const __vue2_script = {
477
+ const be = {
669
478
  name: "FlexRow",
670
- functional: true,
479
+ functional: !0,
671
480
  props: {
672
481
  verticalCenter: {
673
482
  type: Boolean,
674
- default: false
483
+ default: !1
675
484
  },
676
485
  horizonCenter: {
677
486
  type: Boolean,
678
- default: false
487
+ default: !1
679
488
  },
680
489
  center: {
681
490
  type: Boolean,
682
- default: false
491
+ default: !1
683
492
  },
684
493
  textCenter: {
685
494
  type: Boolean,
686
- default: false
495
+ default: !1
687
496
  }
688
497
  },
689
- render(createElement, { data, children, props }) {
690
- const viewClass = getClass(data.class, "flex-row");
691
- if (props.center || props.horizonCenter && props.verticalCenter) {
692
- viewClass.push("horizon-center");
693
- viewClass.push("vertical-center");
694
- } else {
695
- if (props.horizonCenter) {
696
- viewClass.push("horizon-center");
697
- }
698
- if (props.verticalCenter) {
699
- viewClass.push("vertical-center");
700
- }
701
- }
702
- if (props.textCenter) {
703
- viewClass.push("text-center");
704
- }
705
- return createElement("div", __spreadProps(__spreadValues({}, data), { class: viewClass }), children);
498
+ render(e, { data: t, children: n, props: s }) {
499
+ const r = h(t.class, "flex-row");
500
+ 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);
706
501
  }
707
502
  };
708
- let __vue2_render, __vue2_staticRenderFns;
709
- const __cssModules = {};
710
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, __vue2_render, __vue2_staticRenderFns, false, __vue2_injectStyles, null, null, null);
711
- function __vue2_injectStyles(context) {
712
- for (let o in __cssModules) {
713
- this[o] = __cssModules[o];
714
- }
503
+ let Ie, Ee;
504
+ const B = {};
505
+ var Te = /* @__PURE__ */ a(be, Ie, Ee, !1, Pe, null, null, null);
506
+ function Pe(e) {
507
+ for (let t in B)
508
+ this[t] = B[t];
715
509
  }
716
- var FlexRow = /* @__PURE__ */ function() {
717
- return __component__.exports;
510
+ var P = /* @__PURE__ */ function() {
511
+ return Te.exports;
718
512
  }();
719
- FlexColumn.install = function(Vue) {
720
- Vue.component(FlexColumn.name, FlexColumn);
721
- };
722
- FlexItem.install = function(Vue) {
723
- Vue.component(FlexItem.name, FlexItem);
724
- };
725
- FlexRow.install = function(Vue) {
726
- Vue.component(FlexRow.name, FlexRow);
727
- };
728
- function install(Vue) {
729
- Vue.use(EmptyView);
730
- Vue.use(FlexScroller);
731
- Vue.use(NotImplement);
732
- Vue.use(Split);
733
- Vue.use(FlexColumn);
734
- Vue.use(FlexItem);
735
- Vue.use(FlexRow);
736
- Vue.component(JSXComponent.name, JSXComponent);
513
+ function Ne(e) {
514
+ e.use(O), e.use(R), e.use(b), e.use(I), e.use(E), e.use(T), e.use(P), e.component(_.name, _);
737
515
  }
738
- export { EmptyView, FlexColumn, FlexItem, FlexRow, FlexScroller, JSXComponent, NotImplement, Split as SplitPane, install as default, install, version };
516
+ export { O as EmptyView, E as FlexColumn, T as FlexItem, P as FlexRow, R as FlexScroller, _ as JSXComponent, b as NotImplement, I as SplitPane, Ne as default, Y as version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web-utils/component",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",