renusify 1.4.1 → 1.4.3
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/components/chart/worldMap.vue +1110 -0
- package/components/codeEditor/highlightCss.vue +10 -112
- package/components/codeEditor/highlightHtml.vue +17 -162
- package/components/codeEditor/highlightJs.vue +14 -243
- package/components/codeEditor/index.vue +25 -3
- package/components/codeEditor/mixin.js +172 -0
- package/components/cropper/index.vue +2 -1
- package/components/form/json/index.vue +113 -65
- package/components/img/index.vue +5 -4
- package/components/index.js +1 -0
- package/components/modal/index.vue +57 -11
- package/components/modal/style.scss +13 -11
- package/components/searchBox/index.vue +1 -1
- package/components/slider/index.vue +39 -15
- package/components/table/index.vue +13 -13
- package/directive/drag/index.js +5 -5
- package/directive/sortable/index.js +3 -3
- package/directive/title/index.js +2 -3
- package/directive/touch/index.js +2 -4
- package/package.json +1 -1
- package/tools/helper.js +1 -42
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="slider-container"
|
|
3
|
+
:style="{
|
|
4
|
+
width:width+'px',
|
|
5
|
+
height:(width/wPH)+'px'
|
|
6
|
+
}"
|
|
3
7
|
ref="slider"
|
|
4
8
|
v-touch="{
|
|
5
9
|
'left':$r.rtl?prev:next,
|
|
6
10
|
'right':$r.rtl?next:prev
|
|
7
11
|
}">
|
|
8
|
-
|
|
12
|
+
|
|
9
13
|
<r-btn v-if="arrow" icon @click="prev" class="btn-left-arrow">
|
|
10
14
|
<r-icon v-html="$r.icons.chevron_left"></r-icon>
|
|
11
15
|
</r-btn>
|
|
12
16
|
<r-btn v-if="arrow" icon @click="next" class="btn-right-arrow">
|
|
13
17
|
<r-icon v-html="$r.icons.chevron_right"></r-icon>
|
|
14
18
|
</r-btn>
|
|
15
|
-
<transition :
|
|
19
|
+
<transition :appear="appear" :mode="mode" :name="direction">
|
|
16
20
|
<div :key="`slider-${currentIndex}`"
|
|
17
|
-
:class="{'slide-loaded':loaded,'slide-loading':!loaded}"
|
|
18
|
-
class="slider-slides"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}">
|
|
21
|
+
:class="[slidesClass,{'slide-loaded':loaded,'slide-loading':!loaded}]"
|
|
22
|
+
class="slider-slides">
|
|
23
|
+
<r-progress-line v-if="autoplay&&progress" :model-value="remain" class="slider-progress"
|
|
24
|
+
color="color-one"></r-progress-line>
|
|
22
25
|
<slot v-if="width>0" :item="currentSlide" :width="width" :height="width/wPH">
|
|
23
26
|
{{ currentSlide }}
|
|
24
27
|
</slot>
|
|
@@ -58,6 +61,10 @@ export default {
|
|
|
58
61
|
type: Number,
|
|
59
62
|
default: 2
|
|
60
63
|
},
|
|
64
|
+
startIndex: {
|
|
65
|
+
type: Number,
|
|
66
|
+
default: 0
|
|
67
|
+
},
|
|
61
68
|
autoplay: {
|
|
62
69
|
type: Boolean,
|
|
63
70
|
default: false
|
|
@@ -73,14 +80,22 @@ export default {
|
|
|
73
80
|
dots: {
|
|
74
81
|
type: Boolean,
|
|
75
82
|
default: true
|
|
76
|
-
}
|
|
83
|
+
},
|
|
84
|
+
appear: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: true
|
|
87
|
+
},
|
|
88
|
+
slidesClass: [String, Object, Array],
|
|
89
|
+
mode: {type: String, default: 'out-in'},
|
|
90
|
+
transitionRight: {type: String, default: 'slider-right'},
|
|
91
|
+
transitionLeft: {type: String, default: 'slider-left'}
|
|
77
92
|
},
|
|
78
93
|
emits:['index'],
|
|
79
94
|
data() {
|
|
80
95
|
return {
|
|
81
|
-
direction:
|
|
96
|
+
direction: this.transitionRight,
|
|
82
97
|
loaded: false,
|
|
83
|
-
currentIndex:
|
|
98
|
+
currentIndex: this.startIndex,
|
|
84
99
|
loaded_timer: null,
|
|
85
100
|
timer: null,
|
|
86
101
|
width: null,
|
|
@@ -113,7 +128,7 @@ export default {
|
|
|
113
128
|
toggle() {
|
|
114
129
|
clearInterval(this.timer)
|
|
115
130
|
this.loaded = false
|
|
116
|
-
|
|
131
|
+
clearTimeout(this.loaded_timer)
|
|
117
132
|
this.loaded_timer = setTimeout(() => {
|
|
118
133
|
this.loaded = true
|
|
119
134
|
}, 500)
|
|
@@ -128,7 +143,7 @@ export default {
|
|
|
128
143
|
|
|
129
144
|
next: function () {
|
|
130
145
|
this.toggle()
|
|
131
|
-
this.direction =
|
|
146
|
+
this.direction = this.transitionRight
|
|
132
147
|
if (this.currentIndex > this.slides.length - 2) {
|
|
133
148
|
this.currentIndex = 0
|
|
134
149
|
} else {
|
|
@@ -138,7 +153,7 @@ export default {
|
|
|
138
153
|
},
|
|
139
154
|
prev: function () {
|
|
140
155
|
this.toggle()
|
|
141
|
-
this.direction =
|
|
156
|
+
this.direction = this.transitionLeft
|
|
142
157
|
if (this.currentIndex === 0) {
|
|
143
158
|
this.currentIndex = this.slides.length - 1
|
|
144
159
|
} else {
|
|
@@ -149,9 +164,9 @@ export default {
|
|
|
149
164
|
goToSlide(i) {
|
|
150
165
|
this.toggle()
|
|
151
166
|
if (i < this.currentIndex) {
|
|
152
|
-
this.direction =
|
|
167
|
+
this.direction = this.transitionLeft
|
|
153
168
|
} else {
|
|
154
|
-
this.direction =
|
|
169
|
+
this.direction = this.transitionRight
|
|
155
170
|
}
|
|
156
171
|
|
|
157
172
|
this.currentIndex = i
|
|
@@ -165,6 +180,8 @@ export default {
|
|
|
165
180
|
}
|
|
166
181
|
},
|
|
167
182
|
beforeUnmount() {
|
|
183
|
+
clearInterval(this.timer)
|
|
184
|
+
clearTimeout(this.loaded_timer)
|
|
168
185
|
clearInterval(this.remain_id)
|
|
169
186
|
}
|
|
170
187
|
}
|
|
@@ -172,6 +189,13 @@ export default {
|
|
|
172
189
|
<style lang="scss">
|
|
173
190
|
@import '../../style/include';
|
|
174
191
|
|
|
192
|
+
.slider-progress {
|
|
193
|
+
width: 100%;
|
|
194
|
+
position: absolute;
|
|
195
|
+
top: 0;
|
|
196
|
+
z-index: 1;
|
|
197
|
+
}
|
|
198
|
+
|
|
175
199
|
.btn-left-arrow {
|
|
176
200
|
position: absolute;
|
|
177
201
|
top: 50%;
|
|
@@ -104,19 +104,19 @@
|
|
|
104
104
|
</template>
|
|
105
105
|
|
|
106
106
|
<script>
|
|
107
|
-
|
|
107
|
+
import './style.scss'
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
109
|
+
export default {
|
|
110
|
+
name: 'r-table',
|
|
111
|
+
props: {
|
|
112
|
+
transition: {
|
|
113
|
+
type: String,
|
|
114
|
+
default: 'table-row'
|
|
115
|
+
},
|
|
116
|
+
keyItem: [String, Function],
|
|
117
|
+
thin: Boolean,
|
|
118
|
+
responsive: Boolean,
|
|
119
|
+
translate: Boolean,
|
|
120
120
|
editable: Boolean,
|
|
121
121
|
stripped: Boolean,
|
|
122
122
|
borderd: Boolean,
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
if (this.$helper.isArray(this.th) && k === 0) {
|
|
283
283
|
return true
|
|
284
284
|
}
|
|
285
|
-
|
|
285
|
+
const l = Object.keys(this.th)
|
|
286
286
|
return l[0] === k;
|
|
287
287
|
|
|
288
288
|
},
|
package/directive/drag/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ifHas} from '../../tools/helper'
|
|
2
2
|
|
|
3
3
|
let wrapper = {}
|
|
4
4
|
let current=null
|
|
@@ -82,7 +82,7 @@ function mounted(el, binding) {
|
|
|
82
82
|
|
|
83
83
|
el.eventsHandler = createHandlers(el, value,uid)
|
|
84
84
|
|
|
85
|
-
keys(el.eventsHandler).forEach(eventName => {
|
|
85
|
+
Object.keys(el.eventsHandler).forEach(eventName => {
|
|
86
86
|
el.addEventListener(eventName, el.eventsHandler[eventName], options)
|
|
87
87
|
})
|
|
88
88
|
}
|
|
@@ -98,10 +98,10 @@ function unmounted(el, binding) {
|
|
|
98
98
|
if (!el.eventsHandler){
|
|
99
99
|
return
|
|
100
100
|
}
|
|
101
|
-
keys(el.eventsHandler).forEach(eventName => {
|
|
102
|
-
el.removeEventListener(eventName, el.eventsHandler[eventName]),options
|
|
101
|
+
Object.keys(el.eventsHandler).forEach(eventName => {
|
|
102
|
+
el.removeEventListener(eventName, el.eventsHandler[eventName]), options
|
|
103
103
|
})
|
|
104
|
-
wrapper[uid]={}
|
|
104
|
+
wrapper[uid] = {}
|
|
105
105
|
delete el.eventsHandler
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './style.scss'
|
|
2
|
-
import {cleanArray, ifHas
|
|
2
|
+
import {cleanArray, ifHas} from '../../tools/helper'
|
|
3
3
|
|
|
4
4
|
let scopeObj;
|
|
5
5
|
|
|
@@ -153,7 +153,7 @@ function mounted(el, binding) {
|
|
|
153
153
|
c = grab
|
|
154
154
|
}
|
|
155
155
|
c.classList.add("grab");
|
|
156
|
-
keys(el.eventsHandler).forEach(eventName => {
|
|
156
|
+
Object.keys(el.eventsHandler).forEach(eventName => {
|
|
157
157
|
c.addEventListener(eventName, el.eventsHandler[eventName], {
|
|
158
158
|
passive: true
|
|
159
159
|
})
|
|
@@ -188,7 +188,7 @@ function unmounted(el, binding) {
|
|
|
188
188
|
if (!el.eventsHandler) {
|
|
189
189
|
return
|
|
190
190
|
}
|
|
191
|
-
keys(el.eventsHandler).forEach(eventName => {
|
|
191
|
+
Object.keys(el.eventsHandler).forEach(eventName => {
|
|
192
192
|
c.removeEventListener(eventName, el.eventsHandler[eventName], {
|
|
193
193
|
passive: true
|
|
194
194
|
})
|
package/directive/title/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import './style.scss'
|
|
2
|
-
import {keys} from '../../tools/helper'
|
|
3
2
|
|
|
4
3
|
function mousestart(el, binding) {
|
|
5
4
|
let d = 'top'
|
|
@@ -91,7 +90,7 @@ function mounted(el, binding) {
|
|
|
91
90
|
|
|
92
91
|
el.eventsHandler= createHandlers(el, binding)
|
|
93
92
|
|
|
94
|
-
keys(el.eventsHandler).forEach(eventName => {
|
|
93
|
+
Object.keys(el.eventsHandler).forEach(eventName => {
|
|
95
94
|
el.addEventListener(eventName, el.eventsHandler[eventName], options)
|
|
96
95
|
})
|
|
97
96
|
}
|
|
@@ -110,7 +109,7 @@ function unmounted(el, binding) {
|
|
|
110
109
|
if (!el.eventsHandler){
|
|
111
110
|
return
|
|
112
111
|
}
|
|
113
|
-
keys(el.eventsHandler).forEach(eventName => {
|
|
112
|
+
Object.keys(el.eventsHandler).forEach(eventName => {
|
|
114
113
|
el.removeEventListener(eventName, el.eventsHandler[eventName])
|
|
115
114
|
})
|
|
116
115
|
delete el.eventsHandler
|
package/directive/touch/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {keys} from '../../tools/helper'
|
|
2
|
-
|
|
3
1
|
const handleGesture = wrapper => {
|
|
4
2
|
const {
|
|
5
3
|
startX,
|
|
@@ -159,7 +157,7 @@ function mounted(el, binding) {
|
|
|
159
157
|
}
|
|
160
158
|
|
|
161
159
|
el.eventsHandler = createHandlers(value)
|
|
162
|
-
keys(el.eventsHandler).forEach(eventName => {
|
|
160
|
+
Object.keys(el.eventsHandler).forEach(eventName => {
|
|
163
161
|
el.addEventListener(eventName, el.eventsHandler[eventName], options)
|
|
164
162
|
})
|
|
165
163
|
}, 1000)
|
|
@@ -171,7 +169,7 @@ function unmounted(el, binding) {
|
|
|
171
169
|
if (!el.eventsHandler) {
|
|
172
170
|
return
|
|
173
171
|
}
|
|
174
|
-
keys(el.eventsHandler).forEach(eventName => {
|
|
172
|
+
Object.keys(el.eventsHandler).forEach(eventName => {
|
|
175
173
|
el.removeEventListener(eventName, el.eventsHandler[eventName])
|
|
176
174
|
})
|
|
177
175
|
delete el.eventsHandler
|
package/package.json
CHANGED
package/tools/helper.js
CHANGED
|
@@ -121,10 +121,6 @@ export function isArray(input) {
|
|
|
121
121
|
return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
export function keys(o) {
|
|
125
|
-
return Object.keys(o);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
124
|
export function searchArray(arr, key, value) {
|
|
129
125
|
if (!arr) {
|
|
130
126
|
return false
|
|
@@ -186,18 +182,6 @@ export function cleanArray(actual) {
|
|
|
186
182
|
return newArray;
|
|
187
183
|
}
|
|
188
184
|
|
|
189
|
-
export function highlightSetup(text, highlight) {
|
|
190
|
-
if (typeof text !== 'string' || typeof highlight !== 'string') {
|
|
191
|
-
return text;
|
|
192
|
-
}
|
|
193
|
-
highlight = highlight.trim();
|
|
194
|
-
if (highlight.length === 0) {
|
|
195
|
-
return text;
|
|
196
|
-
}
|
|
197
|
-
let keywords = cleanArray(highlight.split(' '));
|
|
198
|
-
keywords = keywords.join('|');
|
|
199
|
-
return text.replace(new RegExp(keywords, 'gi'), '<span class="color-warning-text">$&</span>');
|
|
200
|
-
}
|
|
201
185
|
|
|
202
186
|
export function htmlEncode(str) {
|
|
203
187
|
return str.replace(/[\u00A0-\u9999<>]/gim, function (i) {
|
|
@@ -262,12 +246,7 @@ export function base64decode(str) {
|
|
|
262
246
|
}
|
|
263
247
|
|
|
264
248
|
export function size(obj) {
|
|
265
|
-
|
|
266
|
-
let key;
|
|
267
|
-
for (key in obj) {
|
|
268
|
-
if (hasKey(obj, key)) size++;
|
|
269
|
-
}
|
|
270
|
-
return size;
|
|
249
|
+
return Object.keys(obj).length;
|
|
271
250
|
}
|
|
272
251
|
|
|
273
252
|
export function log(txt, type = 'log', on = 'development') {
|
|
@@ -398,24 +377,4 @@ export function getCookie(cname) {
|
|
|
398
377
|
}
|
|
399
378
|
}
|
|
400
379
|
return "";
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
export function changeColor(vars) {
|
|
404
|
-
let head = document.head || document.getElementsByTagName('head')[0]
|
|
405
|
-
let children = head.querySelectorAll("[c='color']");
|
|
406
|
-
if (children) {
|
|
407
|
-
let childArray = Array.prototype.slice.call(children);
|
|
408
|
-
childArray.forEach(function (child) {
|
|
409
|
-
child.parentNode.removeChild(child);
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
let style = document.createElement('style');
|
|
413
|
-
style.setAttribute("c", "color");
|
|
414
|
-
head.appendChild(style);
|
|
415
|
-
let css = ':root{';
|
|
416
|
-
for (let k in vars) {
|
|
417
|
-
css += k + ':' + vars[k] + ';'
|
|
418
|
-
}
|
|
419
|
-
css += '}'
|
|
420
|
-
style.appendChild(document.createTextNode(css));
|
|
421
380
|
}
|