@web-utils/component 1.0.7 → 1.0.8
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 +464 -276
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,59 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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", {
|
|
23
28
|
staticClass: "empty-view",
|
|
24
29
|
style: {
|
|
25
|
-
fontSize:
|
|
26
|
-
height:
|
|
30
|
+
fontSize: _vm.fontSize,
|
|
31
|
+
height: _vm.height
|
|
27
32
|
}
|
|
28
|
-
}, [
|
|
29
|
-
return [
|
|
33
|
+
}, [_vm._t("default", function() {
|
|
34
|
+
return [_vm._v(_vm._s(_vm.emptyTips))];
|
|
30
35
|
})], 2);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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);
|
|
46
79
|
};
|
|
47
80
|
} else {
|
|
48
|
-
var
|
|
49
|
-
|
|
81
|
+
var existing = options.beforeCreate;
|
|
82
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
50
83
|
}
|
|
84
|
+
}
|
|
51
85
|
return {
|
|
52
|
-
exports:
|
|
53
|
-
options
|
|
86
|
+
exports: scriptExports,
|
|
87
|
+
options
|
|
54
88
|
};
|
|
55
89
|
}
|
|
56
|
-
const
|
|
90
|
+
const __vue2_script$7 = {
|
|
57
91
|
name: "EmptyView",
|
|
58
92
|
props: {
|
|
59
93
|
emptyTips: {
|
|
@@ -69,31 +103,37 @@ const K = {
|
|
|
69
103
|
default: "100%"
|
|
70
104
|
}
|
|
71
105
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
+
}
|
|
77
113
|
}
|
|
78
|
-
var
|
|
79
|
-
return
|
|
114
|
+
var EmptyView = /* @__PURE__ */ function() {
|
|
115
|
+
return __component__$7.exports;
|
|
80
116
|
}();
|
|
81
|
-
|
|
82
|
-
|
|
117
|
+
EmptyView.install = function(Vue) {
|
|
118
|
+
Vue.component(EmptyView.name, EmptyView);
|
|
83
119
|
};
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
|
|
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", {
|
|
87
125
|
staticClass: "flex-scroller-wrapper"
|
|
88
|
-
}, [
|
|
126
|
+
}, [_c("div", {
|
|
89
127
|
class: ["flex-scroller", {
|
|
90
|
-
"flex-column":
|
|
91
|
-
"flex-row":
|
|
92
|
-
"content-scroll":
|
|
93
|
-
},
|
|
94
|
-
}, [
|
|
95
|
-
}
|
|
96
|
-
|
|
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 = {
|
|
97
137
|
name: "FlexScroller",
|
|
98
138
|
props: {
|
|
99
139
|
flexColumn: Boolean,
|
|
@@ -101,89 +141,124 @@ const ne = {
|
|
|
101
141
|
contentClass: String,
|
|
102
142
|
contentScroll: {
|
|
103
143
|
type: Boolean,
|
|
104
|
-
default:
|
|
144
|
+
default: true
|
|
105
145
|
}
|
|
106
146
|
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
+
}
|
|
112
154
|
}
|
|
113
|
-
var
|
|
114
|
-
return
|
|
155
|
+
var FlexScroller = /* @__PURE__ */ function() {
|
|
156
|
+
return __component__$6.exports;
|
|
115
157
|
}();
|
|
116
|
-
|
|
117
|
-
|
|
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);
|
|
118
166
|
};
|
|
119
|
-
var
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return n("div", {
|
|
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", {
|
|
125
172
|
staticClass: "not-implement"
|
|
126
|
-
}, [
|
|
173
|
+
}, [_c("div", [_c("i", {
|
|
127
174
|
staticClass: "fa fa-wrench"
|
|
128
|
-
}),
|
|
175
|
+
}), _vm._v(" \u5EFA\u8BBE\u4E2D... ")])]);
|
|
129
176
|
}];
|
|
130
|
-
|
|
177
|
+
var NotImplement_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
178
|
+
const __vue2_script$5 = {
|
|
131
179
|
name: "NotImplement"
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
+
}
|
|
137
187
|
}
|
|
138
|
-
var
|
|
139
|
-
return
|
|
188
|
+
var NotImplement = /* @__PURE__ */ function() {
|
|
189
|
+
return __component__$5.exports;
|
|
140
190
|
}();
|
|
141
|
-
|
|
142
|
-
|
|
191
|
+
NotImplement.install = function(Vue) {
|
|
192
|
+
Vue.component(NotImplement.name, NotImplement);
|
|
143
193
|
};
|
|
144
|
-
function
|
|
145
|
-
for (let
|
|
146
|
-
if (
|
|
147
|
-
return
|
|
148
|
-
|
|
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;
|
|
149
201
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
+
}
|
|
162
216
|
}();
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
+
}
|
|
231
|
+
}();
|
|
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`
|
|
176
250
|
});
|
|
177
251
|
});
|
|
178
252
|
}];
|
|
179
|
-
|
|
253
|
+
var Trigger_vue_vue_type_style_index_0_lang = "";
|
|
254
|
+
const __vue2_script$4 = {
|
|
180
255
|
name: "Trigger",
|
|
181
256
|
props: {
|
|
182
257
|
mode: String,
|
|
183
258
|
showIcon: Boolean,
|
|
184
259
|
line: {
|
|
185
260
|
type: Boolean,
|
|
186
|
-
default:
|
|
261
|
+
default: true
|
|
187
262
|
}
|
|
188
263
|
},
|
|
189
264
|
data() {
|
|
@@ -209,79 +284,86 @@ const he = {
|
|
|
209
284
|
];
|
|
210
285
|
}
|
|
211
286
|
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
+
}
|
|
217
294
|
}
|
|
218
|
-
var
|
|
219
|
-
return
|
|
220
|
-
}()
|
|
221
|
-
|
|
222
|
-
|
|
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", {
|
|
223
303
|
ref: "outerWrapper",
|
|
224
|
-
class:
|
|
225
|
-
}, [
|
|
226
|
-
class: `${
|
|
227
|
-
}, [
|
|
228
|
-
class: [`${
|
|
304
|
+
class: _vm.wrapperClasses
|
|
305
|
+
}, [_vm.isHorizontal ? _c("div", {
|
|
306
|
+
class: `${_vm.prefix}-horizontal`
|
|
307
|
+
}, [_c("div", {
|
|
308
|
+
class: [`${_vm.prefix}-pane`, "left-pane"],
|
|
229
309
|
style: {
|
|
230
|
-
right: `${
|
|
310
|
+
right: `${_vm.anotherOffset}%`
|
|
231
311
|
}
|
|
232
|
-
}, [
|
|
233
|
-
class: `${
|
|
312
|
+
}, [_vm._t("left")], 2), _c("div", {
|
|
313
|
+
class: `${_vm.prefix}-trigger-con`,
|
|
234
314
|
style: {
|
|
235
|
-
left: `calc(${
|
|
236
|
-
width: `${
|
|
315
|
+
left: `calc(${_vm.offset}% + ${_vm.triggerSize / 2}px)`,
|
|
316
|
+
width: `${_vm.triggerSize}px`
|
|
237
317
|
},
|
|
238
318
|
on: {
|
|
239
|
-
mousedown:
|
|
319
|
+
"mousedown": _vm.handleMousedown
|
|
240
320
|
}
|
|
241
|
-
}, [
|
|
242
|
-
return [
|
|
321
|
+
}, [_vm._t("trigger", function() {
|
|
322
|
+
return [_c("Trigger", {
|
|
243
323
|
attrs: {
|
|
244
|
-
mode: "vertical"
|
|
324
|
+
"mode": "vertical"
|
|
245
325
|
}
|
|
246
326
|
})];
|
|
247
|
-
})], 2),
|
|
248
|
-
class: [`${
|
|
327
|
+
})], 2), _c("div", {
|
|
328
|
+
class: [`${_vm.prefix}-pane`, "right-pane"],
|
|
249
329
|
style: {
|
|
250
|
-
left: `calc(${
|
|
330
|
+
left: `calc(${_vm.offset}% + ${_vm.triggerSize}px)`
|
|
251
331
|
}
|
|
252
|
-
}, [
|
|
253
|
-
class: `${
|
|
254
|
-
}, [
|
|
255
|
-
class: [`${
|
|
332
|
+
}, [_vm._t("right")], 2)]) : _c("div", {
|
|
333
|
+
class: `${_vm.prefix}-vertical`
|
|
334
|
+
}, [_c("div", {
|
|
335
|
+
class: [`${_vm.prefix}-pane`, "top-pane"],
|
|
256
336
|
style: {
|
|
257
|
-
bottom: `${
|
|
337
|
+
bottom: `${_vm.anotherOffset}%`
|
|
258
338
|
}
|
|
259
|
-
}, [
|
|
260
|
-
class: `${
|
|
339
|
+
}, [_vm._t("top")], 2), _c("div", {
|
|
340
|
+
class: `${_vm.prefix}-trigger-con`,
|
|
261
341
|
style: {
|
|
262
|
-
top: `calc(${
|
|
263
|
-
height: `${
|
|
342
|
+
top: `calc(${_vm.offset}% + ${_vm.triggerSize / 2}px)`,
|
|
343
|
+
height: `${_vm.triggerSize}px`
|
|
264
344
|
},
|
|
265
345
|
on: {
|
|
266
|
-
mousedown:
|
|
346
|
+
"mousedown": _vm.handleMousedown
|
|
267
347
|
}
|
|
268
|
-
}, [
|
|
269
|
-
return [
|
|
348
|
+
}, [_vm._t("trigger", function() {
|
|
349
|
+
return [_c("Trigger", {
|
|
270
350
|
attrs: {
|
|
271
|
-
mode: "horizontal"
|
|
351
|
+
"mode": "horizontal"
|
|
272
352
|
}
|
|
273
353
|
})];
|
|
274
|
-
})], 2),
|
|
275
|
-
class: [`${
|
|
354
|
+
})], 2), _c("div", {
|
|
355
|
+
class: [`${_vm.prefix}-pane`, "bottom-pane"],
|
|
276
356
|
style: {
|
|
277
|
-
top: `calc(${
|
|
357
|
+
top: `calc(${_vm.offset}% + ${_vm.triggerSize}px)`
|
|
278
358
|
}
|
|
279
|
-
}, [
|
|
280
|
-
}
|
|
281
|
-
|
|
359
|
+
}, [_vm._t("bottom")], 2)])]);
|
|
360
|
+
};
|
|
361
|
+
var staticRenderFns = [];
|
|
362
|
+
var SplitPane_vue_vue_type_style_index_0_lang = "";
|
|
363
|
+
const __vue2_script$3 = {
|
|
282
364
|
name: "SplitPane",
|
|
283
365
|
components: {
|
|
284
|
-
Trigger
|
|
366
|
+
Trigger
|
|
285
367
|
},
|
|
286
368
|
props: {
|
|
287
369
|
value: {
|
|
@@ -289,8 +371,8 @@ const $e = {
|
|
|
289
371
|
default: 0.5
|
|
290
372
|
},
|
|
291
373
|
mode: {
|
|
292
|
-
validator(
|
|
293
|
-
return
|
|
374
|
+
validator(value) {
|
|
375
|
+
return oneOf(value, ["horizontal", "vertical"]);
|
|
294
376
|
},
|
|
295
377
|
default: "horizontal"
|
|
296
378
|
},
|
|
@@ -312,7 +394,7 @@ const $e = {
|
|
|
312
394
|
prefix: "egd-split",
|
|
313
395
|
offset: 0,
|
|
314
396
|
oldOffset: 0,
|
|
315
|
-
isMoving:
|
|
397
|
+
isMoving: false
|
|
316
398
|
};
|
|
317
399
|
},
|
|
318
400
|
computed: {
|
|
@@ -329,7 +411,7 @@ const $e = {
|
|
|
329
411
|
return 100 - this.offset;
|
|
330
412
|
},
|
|
331
413
|
valueIsPx() {
|
|
332
|
-
return typeof this.value
|
|
414
|
+
return typeof this.value === "string";
|
|
333
415
|
},
|
|
334
416
|
offsetSize() {
|
|
335
417
|
return this.isHorizontal ? "offsetWidth" : "offsetHeight";
|
|
@@ -352,49 +434,85 @@ const $e = {
|
|
|
352
434
|
});
|
|
353
435
|
},
|
|
354
436
|
methods: {
|
|
355
|
-
px2percent(
|
|
356
|
-
return parseFloat(
|
|
357
|
-
},
|
|
358
|
-
getComputedThresholdValue(
|
|
359
|
-
const
|
|
360
|
-
|
|
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
|
+
}
|
|
361
447
|
},
|
|
362
|
-
getMin(
|
|
363
|
-
|
|
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
|
+
}
|
|
364
454
|
},
|
|
365
|
-
getMax(
|
|
366
|
-
|
|
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
|
+
}
|
|
367
461
|
},
|
|
368
|
-
getAnotherOffset(
|
|
369
|
-
let
|
|
370
|
-
|
|
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;
|
|
371
470
|
},
|
|
372
471
|
handleMove(e) {
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
const
|
|
376
|
-
|
|
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);
|
|
377
485
|
},
|
|
378
486
|
handleUp() {
|
|
379
|
-
this.isMoving =
|
|
487
|
+
this.isMoving = false;
|
|
488
|
+
off(window, "mousemove", this.handleMove);
|
|
489
|
+
off(window, "mouseup", this.handleUp);
|
|
490
|
+
this.$emit("on-move-end");
|
|
380
491
|
},
|
|
381
492
|
handleMousedown(e) {
|
|
382
|
-
this.initOffset = this.isHorizontal ? e.pageX : e.pageY
|
|
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");
|
|
383
499
|
}
|
|
384
500
|
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
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
|
+
}
|
|
390
508
|
}
|
|
391
|
-
var
|
|
392
|
-
return
|
|
509
|
+
var Split = /* @__PURE__ */ function() {
|
|
510
|
+
return __component__$3.exports;
|
|
393
511
|
}();
|
|
394
|
-
|
|
395
|
-
|
|
512
|
+
Split.install = function(Vue) {
|
|
513
|
+
Vue.component(Split.name, Split);
|
|
396
514
|
};
|
|
397
|
-
var
|
|
515
|
+
var JSXComponent = {
|
|
398
516
|
name: "JSXComponent",
|
|
399
517
|
props: {
|
|
400
518
|
msg: {
|
|
@@ -403,148 +521,218 @@ var $ = {
|
|
|
403
521
|
}
|
|
404
522
|
},
|
|
405
523
|
render() {
|
|
406
|
-
|
|
524
|
+
const h = arguments[0];
|
|
525
|
+
return h("div", [this.msg]);
|
|
407
526
|
}
|
|
408
527
|
};
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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 = {
|
|
415
538
|
name: "FlexColumn",
|
|
416
|
-
functional:
|
|
539
|
+
functional: true,
|
|
417
540
|
props: {
|
|
418
541
|
verticalCenter: {
|
|
419
542
|
type: Boolean,
|
|
420
|
-
default:
|
|
543
|
+
default: false
|
|
421
544
|
},
|
|
422
545
|
horizonCenter: {
|
|
423
546
|
type: Boolean,
|
|
424
|
-
default:
|
|
547
|
+
default: false
|
|
425
548
|
},
|
|
426
549
|
center: {
|
|
427
550
|
type: Boolean,
|
|
428
|
-
default:
|
|
551
|
+
default: false
|
|
429
552
|
},
|
|
430
553
|
textCenter: {
|
|
431
554
|
type: Boolean,
|
|
432
|
-
default:
|
|
555
|
+
default: false
|
|
433
556
|
}
|
|
434
557
|
},
|
|
435
|
-
render(
|
|
436
|
-
const
|
|
437
|
-
|
|
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);
|
|
438
575
|
}
|
|
439
576
|
};
|
|
440
|
-
let
|
|
441
|
-
const
|
|
442
|
-
var
|
|
443
|
-
function
|
|
444
|
-
for (let
|
|
445
|
-
this[
|
|
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
|
+
}
|
|
446
584
|
}
|
|
447
|
-
var
|
|
448
|
-
return
|
|
585
|
+
var FlexColumn = /* @__PURE__ */ function() {
|
|
586
|
+
return __component__$2.exports;
|
|
449
587
|
}();
|
|
450
|
-
const
|
|
588
|
+
const __vue2_script$1 = {
|
|
451
589
|
name: "FlexItem",
|
|
452
|
-
functional:
|
|
590
|
+
functional: true,
|
|
453
591
|
props: {
|
|
454
592
|
flexRow: {
|
|
455
593
|
type: Boolean,
|
|
456
|
-
default:
|
|
594
|
+
default: false
|
|
457
595
|
},
|
|
458
596
|
flexColumn: {
|
|
459
597
|
type: Boolean,
|
|
460
|
-
default:
|
|
598
|
+
default: false
|
|
461
599
|
},
|
|
462
600
|
verticalCenter: {
|
|
463
601
|
type: Boolean,
|
|
464
|
-
default:
|
|
602
|
+
default: false
|
|
465
603
|
},
|
|
466
604
|
horizonCenter: {
|
|
467
605
|
type: Boolean,
|
|
468
|
-
default:
|
|
606
|
+
default: false
|
|
469
607
|
},
|
|
470
608
|
center: {
|
|
471
609
|
type: Boolean,
|
|
472
|
-
default:
|
|
610
|
+
default: false
|
|
473
611
|
},
|
|
474
612
|
textCenter: {
|
|
475
613
|
type: Boolean,
|
|
476
|
-
default:
|
|
614
|
+
default: false
|
|
477
615
|
},
|
|
478
616
|
relative: {
|
|
479
617
|
type: Boolean,
|
|
480
|
-
default:
|
|
618
|
+
default: false
|
|
481
619
|
},
|
|
482
620
|
absolute: {
|
|
483
621
|
type: Boolean,
|
|
484
|
-
default:
|
|
622
|
+
default: false
|
|
485
623
|
}
|
|
486
624
|
},
|
|
487
|
-
render(
|
|
488
|
-
const
|
|
489
|
-
|
|
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
|
+
}
|
|
490
655
|
}
|
|
491
656
|
};
|
|
492
|
-
let
|
|
493
|
-
const
|
|
494
|
-
var
|
|
495
|
-
function
|
|
496
|
-
for (let
|
|
497
|
-
this[
|
|
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
|
+
}
|
|
498
664
|
}
|
|
499
|
-
var
|
|
500
|
-
return
|
|
665
|
+
var FlexItem = /* @__PURE__ */ function() {
|
|
666
|
+
return __component__$1.exports;
|
|
501
667
|
}();
|
|
502
|
-
const
|
|
668
|
+
const __vue2_script = {
|
|
503
669
|
name: "FlexRow",
|
|
504
|
-
functional:
|
|
670
|
+
functional: true,
|
|
505
671
|
props: {
|
|
506
672
|
verticalCenter: {
|
|
507
673
|
type: Boolean,
|
|
508
|
-
default:
|
|
674
|
+
default: false
|
|
509
675
|
},
|
|
510
676
|
horizonCenter: {
|
|
511
677
|
type: Boolean,
|
|
512
|
-
default:
|
|
678
|
+
default: false
|
|
513
679
|
},
|
|
514
680
|
center: {
|
|
515
681
|
type: Boolean,
|
|
516
|
-
default:
|
|
682
|
+
default: false
|
|
517
683
|
},
|
|
518
684
|
textCenter: {
|
|
519
685
|
type: Boolean,
|
|
520
|
-
default:
|
|
686
|
+
default: false
|
|
521
687
|
}
|
|
522
688
|
},
|
|
523
|
-
render(
|
|
524
|
-
const
|
|
525
|
-
|
|
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);
|
|
526
706
|
}
|
|
527
707
|
};
|
|
528
|
-
let
|
|
529
|
-
const
|
|
530
|
-
var
|
|
531
|
-
function
|
|
532
|
-
for (let
|
|
533
|
-
this[
|
|
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
|
+
}
|
|
534
715
|
}
|
|
535
|
-
var
|
|
536
|
-
return
|
|
716
|
+
var FlexRow = /* @__PURE__ */ function() {
|
|
717
|
+
return __component__.exports;
|
|
537
718
|
}();
|
|
538
|
-
|
|
539
|
-
|
|
719
|
+
FlexColumn.install = function(Vue) {
|
|
720
|
+
Vue.component(FlexColumn.name, FlexColumn);
|
|
540
721
|
};
|
|
541
|
-
|
|
542
|
-
|
|
722
|
+
FlexItem.install = function(Vue) {
|
|
723
|
+
Vue.component(FlexItem.name, FlexItem);
|
|
543
724
|
};
|
|
544
|
-
|
|
545
|
-
|
|
725
|
+
FlexRow.install = function(Vue) {
|
|
726
|
+
Vue.component(FlexRow.name, FlexRow);
|
|
546
727
|
};
|
|
547
|
-
function
|
|
548
|
-
|
|
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);
|
|
549
737
|
}
|
|
550
|
-
export {
|
|
738
|
+
export { EmptyView, FlexColumn, FlexItem, FlexRow, FlexScroller, JSXComponent, NotImplement, Split as SplitPane, install as default, install, version };
|