renusify 1.0.3 → 1.0.5
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/LICENSE +1 -1
- package/components/app/index.vue +14 -14
- package/components/{notify → app/notify}/index.vue +1 -1
- package/components/{notify → app/notify}/notification.vue +0 -0
- package/components/{notify → app/notify}/notify.js +0 -0
- package/components/app/style.scss +0 -1
- package/components/{toast → app/toast}/index.vue +0 -0
- package/components/{toast → app/toast}/style.scss +1 -1
- package/components/{toast → app/toast}/toast.js +0 -0
- package/components/{toast → app/toast}/toast.vue +0 -0
- package/components/breadcrumb/bredcrumbItem.vue +11 -11
- package/components/breadcrumb/index.vue +6 -5
- package/components/button/buttonGroup.vue +0 -4
- package/components/button/index.vue +0 -2
- package/components/card/index.vue +0 -2
- package/components/chart/chart.vue +3 -0
- package/components/chat/MessageList.vue +0 -2
- package/components/chat/chatInput.vue +139 -135
- package/components/chat/chatMsg.vue +4 -4
- package/components/codeEditor/index.vue +412 -443
- package/components/codeEditor/run.vue +76 -80
- package/components/content/style.scss +0 -1
- package/components/form/address.vue +109 -109
- package/components/form/address_ir.vue +106 -0
- package/components/form/colorPicker/Alpha.vue +29 -45
- package/components/form/colorPicker/Hue.vue +32 -51
- package/components/form/colorPicker/Preview.vue +24 -28
- package/components/form/colorPicker/Saturation.vue +49 -69
- package/components/form/colorPicker/index.vue +53 -38
- package/components/form/colorPicker/mixin.js +6 -1
- package/components/form/colorPicker/picker.vue +80 -39
- package/components/form/group-input.vue +124 -106
- package/components/form/inputTel/index.vue +8 -10
- package/components/form/json/JsonView.vue +15 -11
- package/components/form/json/index.vue +29 -10
- package/components/form/mask-input.vue +0 -5
- package/components/form/number.vue +1 -1
- package/components/form/range.vue +0 -2
- package/components/form/select.vue +14 -14
- package/components/iframe/index.vue +60 -38
- package/components/index.js +189 -93
- package/components/infinite/div.vue +2 -3
- package/components/infinite/index.vue +0 -2
- package/components/infinite/page.vue +2 -3
- package/components/list/index.vue +0 -2
- package/components/menu/index.vue +160 -131
- package/components/modal/index.vue +85 -90
- package/components/modal/style.scss +0 -1
- package/components/searchBox/index.vue +0 -4
- package/components/slider/index.vue +0 -4
- package/components/swiper/index.vue +0 -4
- package/components/table/crud/index.vue +12 -13
- package/components/table/index.vue +0 -4
- package/directive/clickOutSide/index.js +2 -3
- package/directive/drag/index.js +1 -2
- package/directive/index.js +18 -19
- package/directive/intersect/index.js +3 -3
- package/directive/resize/index.js +3 -4
- package/directive/ripple/index.js +4 -6
- package/directive/scroll/index.js +3 -4
- package/directive/sortable/index.js +1 -2
- package/directive/title/index.js +2 -3
- package/directive/touch/index.js +32 -20
- package/index.js +11 -5
- package/package.json +1 -1
- package/plugins/trans/Translate.js +9 -14
- package/tools/helper.js +23 -0
- package/components/form/colorPicker/Box.vue +0 -85
|
@@ -230,10 +230,8 @@ function update (el, binding) {
|
|
|
230
230
|
updateRipple(el, binding, wasEnabled)
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
export
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
233
|
+
export default {
|
|
234
|
+
mounted,
|
|
235
|
+
unmounted,
|
|
236
|
+
update
|
|
237
237
|
}
|
|
238
|
-
export default Index
|
|
239
|
-
// # sourceMappingURL=index.js.map
|
package/directive/title/index.js
CHANGED
package/directive/touch/index.js
CHANGED
|
@@ -30,11 +30,12 @@ function touchstart(event, wrapper) {
|
|
|
30
30
|
wrapper.startY = touch.clientY
|
|
31
31
|
wrapper.moveX = touch.clientX
|
|
32
32
|
wrapper.moveY = touch.clientY
|
|
33
|
+
wrapper.current = {x: touch.clientX - wrapper.clientRect['left'], y: touch.clientY - wrapper.clientRect['top']}
|
|
33
34
|
event['touch'] = wrapper
|
|
34
35
|
wrapper.start && wrapper.start(wrapper)
|
|
35
36
|
|
|
36
|
-
document.ontouchmove= e => touchmove(e, wrapper)
|
|
37
|
-
document.ontouchend= e => touchend(
|
|
37
|
+
document.ontouchmove = e => touchmove(e, wrapper)
|
|
38
|
+
document.ontouchend = e => touchend(e, wrapper)
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
function mousestart(event, wrapper) {
|
|
@@ -44,10 +45,11 @@ function mousestart(event, wrapper) {
|
|
|
44
45
|
wrapper.startY = touch.clientY
|
|
45
46
|
wrapper.moveX = touch.clientX
|
|
46
47
|
wrapper.moveY = touch.clientY
|
|
48
|
+
wrapper.current = {x: touch.clientX - wrapper.clientRect['left'], y: touch.clientY - wrapper.clientRect['top']}
|
|
47
49
|
event['touch'] = wrapper
|
|
48
50
|
wrapper.start && wrapper.start(wrapper)
|
|
49
|
-
document.onmousemove= e => mousemove(e, wrapper)
|
|
50
|
-
document.onmouseup= e => mouseend(
|
|
51
|
+
document.onmousemove = e => mousemove(e, wrapper)
|
|
52
|
+
document.onmouseup = e => mouseend(e, wrapper)
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
function touchend(event, wrapper) {
|
|
@@ -55,6 +57,8 @@ function touchend(event, wrapper) {
|
|
|
55
57
|
return null
|
|
56
58
|
}
|
|
57
59
|
wrapper.selected = false
|
|
60
|
+
const touch = event.changedTouches[0]
|
|
61
|
+
wrapper.current = {x: touch.clientX - wrapper.clientRect['left'], y: touch.clientY - wrapper.clientRect['top']}
|
|
58
62
|
event['touch'] = wrapper
|
|
59
63
|
wrapper.end && wrapper.end(wrapper)
|
|
60
64
|
handleGesture(wrapper)
|
|
@@ -63,8 +67,8 @@ function touchend(event, wrapper) {
|
|
|
63
67
|
wrapper.moveX = 0
|
|
64
68
|
wrapper.moveY = 0
|
|
65
69
|
|
|
66
|
-
document.ontouchmove=null
|
|
67
|
-
document.ontouchend=null
|
|
70
|
+
document.ontouchmove = null
|
|
71
|
+
document.ontouchend = null
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
function mouseend(event, wrapper) {
|
|
@@ -73,6 +77,7 @@ function mouseend(event, wrapper) {
|
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
wrapper.selected = false
|
|
80
|
+
wrapper.current = {x: event.clientX - wrapper.clientRect['left'], y: event.clientY - wrapper.clientRect['top']}
|
|
76
81
|
event['touch'] = wrapper
|
|
77
82
|
wrapper.end && wrapper.end(wrapper)
|
|
78
83
|
handleGesture(wrapper)
|
|
@@ -82,8 +87,8 @@ function mouseend(event, wrapper) {
|
|
|
82
87
|
wrapper.moveX = 0
|
|
83
88
|
wrapper.moveY = 0
|
|
84
89
|
|
|
85
|
-
document.onmousemove=null
|
|
86
|
-
document.onmouseup=null
|
|
90
|
+
document.onmousemove = null
|
|
91
|
+
document.onmouseup = null
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
function touchmove(event, wrapper) {
|
|
@@ -93,6 +98,7 @@ function touchmove(event, wrapper) {
|
|
|
93
98
|
return null
|
|
94
99
|
}
|
|
95
100
|
const touch = event.changedTouches[0]
|
|
101
|
+
wrapper.current = {x: touch.clientX - wrapper.clientRect['left'], y: touch.clientY - wrapper.clientRect['top']}
|
|
96
102
|
wrapper.moveX = touch.clientX
|
|
97
103
|
wrapper.moveY = touch.clientY
|
|
98
104
|
event['touch'] = wrapper
|
|
@@ -109,6 +115,7 @@ function mousemove(event, wrapper) {
|
|
|
109
115
|
return null
|
|
110
116
|
}
|
|
111
117
|
const touch = event
|
|
118
|
+
wrapper.current = {x: event.clientX - wrapper.clientRect['left'], y: event.clientY - wrapper.clientRect['top']}
|
|
112
119
|
wrapper.moveX = touch.clientX
|
|
113
120
|
wrapper.moveY = touch.clientY
|
|
114
121
|
event['touch'] = wrapper
|
|
@@ -121,6 +128,8 @@ function mousemove(event, wrapper) {
|
|
|
121
128
|
function createHandlers(value) {
|
|
122
129
|
const wrapper = {
|
|
123
130
|
selected: false,
|
|
131
|
+
clientRect: value['clientRect'],
|
|
132
|
+
current: {x: 0, y: 0},
|
|
124
133
|
startX: 0,
|
|
125
134
|
startY: 0,
|
|
126
135
|
goX: 0,
|
|
@@ -143,29 +152,32 @@ function createHandlers(value) {
|
|
|
143
152
|
|
|
144
153
|
function mounted(el, binding) {
|
|
145
154
|
const value = binding.value
|
|
155
|
+
el.timeout_touch = setTimeout(() => {
|
|
156
|
+
value['clientRect'] = el.getBoundingClientRect()
|
|
157
|
+
const options = value.options || {
|
|
158
|
+
passive: true
|
|
159
|
+
}
|
|
146
160
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
161
|
+
el.eventsHandler = createHandlers(value)
|
|
162
|
+
keys(el.eventsHandler).forEach(eventName => {
|
|
163
|
+
el.addEventListener(eventName, el.eventsHandler[eventName], options)
|
|
164
|
+
})
|
|
165
|
+
}, 1000)
|
|
150
166
|
|
|
151
|
-
el.eventsHandler= createHandlers(value)
|
|
152
|
-
keys(el.eventsHandler).forEach(eventName => {
|
|
153
|
-
el.addEventListener(eventName, el.eventsHandler[eventName], options)
|
|
154
|
-
})
|
|
155
167
|
}
|
|
156
168
|
|
|
157
169
|
function unmounted(el, binding) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
170
|
+
clearTimeout(el.timeout_touch)
|
|
171
|
+
if (!el.eventsHandler) {
|
|
172
|
+
return
|
|
173
|
+
}
|
|
161
174
|
keys(el.eventsHandler).forEach(eventName => {
|
|
162
175
|
el.removeEventListener(eventName, el.eventsHandler[eventName])
|
|
163
176
|
})
|
|
164
177
|
delete el.eventsHandler
|
|
165
178
|
}
|
|
166
179
|
|
|
167
|
-
export
|
|
180
|
+
export default {
|
|
168
181
|
mounted,
|
|
169
182
|
unmounted
|
|
170
183
|
}
|
|
171
|
-
export default Touch
|
package/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import Translate from './plugins/trans/Translate';
|
|
|
4
4
|
import Storage from './plugins/storage/index';
|
|
5
5
|
import DateTime from './plugins/trans/DateTime';
|
|
6
6
|
import Currency from './plugins/trans/Currency';
|
|
7
|
-
import Notify from './components/notify/notify.js';
|
|
7
|
+
import Notify from './components/app/notify/notify.js';
|
|
8
8
|
import valid from './plugins/validation/Validate';
|
|
9
|
-
import Toast from './components/toast/toast.js';
|
|
9
|
+
import Toast from './components/app/toast/toast.js';
|
|
10
10
|
import event from './plugins/event';
|
|
11
11
|
import {register} from './components';
|
|
12
12
|
import {registers} from './directive';
|
|
@@ -114,10 +114,16 @@ export default {
|
|
|
114
114
|
app.config.globalProperties.$v = (names) => valid.checkType(names)
|
|
115
115
|
|
|
116
116
|
// install components
|
|
117
|
-
register(app, options['components'] || []);
|
|
118
|
-
|
|
117
|
+
let required_directive = register(app, options['components'] || []);
|
|
118
|
+
if (options['directives']) {
|
|
119
|
+
options['directives'].forEach((i) => {
|
|
120
|
+
if (!required_directive.includes(i)) {
|
|
121
|
+
required_directive.push(i)
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
}
|
|
119
125
|
// install directives
|
|
120
|
-
registers(app,
|
|
126
|
+
registers(app, required_directive);
|
|
121
127
|
|
|
122
128
|
// renusify storage
|
|
123
129
|
app.config.globalProperties.$storage = Storage
|
package/package.json
CHANGED
|
@@ -53,17 +53,19 @@ class Translate {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
if(package_name&&typeof package_name!=='string'){
|
|
56
|
+
if (package_name && typeof package_name !== 'string') {
|
|
57
57
|
console.error(
|
|
58
|
-
'package name must be string. key:'+key+' package_name:'+package_name
|
|
58
|
+
'package name must be string. key:' + key + ' package_name:' + package_name
|
|
59
59
|
)
|
|
60
60
|
return key
|
|
61
61
|
}
|
|
62
|
+
if (typeof key !== 'string') {
|
|
63
|
+
return key
|
|
64
|
+
}
|
|
65
|
+
key = key.toLowerCase()
|
|
62
66
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const local = lang!==null?lang : this._local
|
|
66
|
-
const pack = package_name !==null?package_name: this._package
|
|
67
|
+
const local = lang !== null ? lang : this._local
|
|
68
|
+
const pack = package_name !== null ? package_name : this._package
|
|
67
69
|
if (!local) {
|
|
68
70
|
return key;
|
|
69
71
|
}
|
|
@@ -80,7 +82,7 @@ class Translate {
|
|
|
80
82
|
return key;
|
|
81
83
|
}
|
|
82
84
|
return val;
|
|
83
|
-
} else if (window.app.$r.autoAddTranslate && pack && this._count < 100 && /^([a-z_.])*$/.test(key)) {
|
|
85
|
+
} else if (window.app.$r && window.app.$r.autoAddTranslate && pack && this._count < 100 && /^([a-z_.])*$/.test(key)) {
|
|
84
86
|
if (!this._store.includes(key)) {
|
|
85
87
|
let url = '/translate/' + pack + '/' + key + '?v=';
|
|
86
88
|
const lng = variable.length
|
|
@@ -120,12 +122,6 @@ class Translate {
|
|
|
120
122
|
if (window.app.$storage.get("lang")) {
|
|
121
123
|
locale = window.app.$storage.get("lang");
|
|
122
124
|
}
|
|
123
|
-
if (window.app.$storage.get(`msg-${pack}`)) {
|
|
124
|
-
const msg = window.app.$storage.get(`msg-${pack}`);
|
|
125
|
-
this.local = locale;
|
|
126
|
-
this.setMessages(msg);
|
|
127
|
-
window.app.$r.store['langs_loaded'][pack] = true;
|
|
128
|
-
}
|
|
129
125
|
Axios.get(`/translate/${pack}/${locale}`).then(
|
|
130
126
|
res => {
|
|
131
127
|
if (res.data.length !== 0) {
|
|
@@ -134,7 +130,6 @@ class Translate {
|
|
|
134
130
|
for (let i = 0; i < lng; i++) {
|
|
135
131
|
lang[res.data[i].key] = res.data[i][locale];
|
|
136
132
|
}
|
|
137
|
-
window.app.$storage.set(`msg-${pack}`, lang);
|
|
138
133
|
this.local = locale;
|
|
139
134
|
this.setMessages(lang);
|
|
140
135
|
} else {
|
package/tools/helper.js
CHANGED
|
@@ -363,4 +363,27 @@ export function download(url, fileName = 'download') {
|
|
|
363
363
|
tag.remove()
|
|
364
364
|
};
|
|
365
365
|
xhr.send();
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export function setCookie(cname, cvalue, exsec) {
|
|
369
|
+
const d = new Date();
|
|
370
|
+
d.setTime(d.getTime() + (exsec * 1000));
|
|
371
|
+
let expires = "expires=" + d.toUTCString();
|
|
372
|
+
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export function getCookie(cname) {
|
|
376
|
+
let name = cname + "=";
|
|
377
|
+
let decodedCookie = decodeURIComponent(document.cookie);
|
|
378
|
+
let ca = decodedCookie.split(';');
|
|
379
|
+
for (let i = 0; i < ca.length; i++) {
|
|
380
|
+
let c = ca[i];
|
|
381
|
+
while (c.charAt(0) === ' ') {
|
|
382
|
+
c = c.substring(1);
|
|
383
|
+
}
|
|
384
|
+
if (c.indexOf(name) === 0) {
|
|
385
|
+
return c.substring(name.length, c.length);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return "";
|
|
366
389
|
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="color-type">
|
|
3
|
-
<span class="name">
|
|
4
|
-
{{ name }}
|
|
5
|
-
</span>
|
|
6
|
-
<input v-model="modelColor" class="value" />
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script >
|
|
11
|
-
import { computed } from 'vue'
|
|
12
|
-
|
|
13
|
-
export default
|
|
14
|
-
{
|
|
15
|
-
props: {
|
|
16
|
-
name: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: '',
|
|
19
|
-
},
|
|
20
|
-
color: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: '',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
emits: ['inputColor'],
|
|
26
|
-
setup(props, { emit }) {
|
|
27
|
-
const modelColor = computed({
|
|
28
|
-
get() {
|
|
29
|
-
return props.color || ''
|
|
30
|
-
},
|
|
31
|
-
set(val) {
|
|
32
|
-
emit('inputColor', val)
|
|
33
|
-
},
|
|
34
|
-
})
|
|
35
|
-
return {
|
|
36
|
-
modelColor,
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
}
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<style lang="scss">
|
|
43
|
-
@import "../../../style/include";
|
|
44
|
-
.color-type {
|
|
45
|
-
display: flex;
|
|
46
|
-
margin-top: 8px;
|
|
47
|
-
font-size: 12px;
|
|
48
|
-
.name {
|
|
49
|
-
width: 60px;
|
|
50
|
-
height: 30px;
|
|
51
|
-
float: left;
|
|
52
|
-
display: flex;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
align-items: center;
|
|
55
|
-
}
|
|
56
|
-
.value {
|
|
57
|
-
flex: 1;
|
|
58
|
-
height: 30px;
|
|
59
|
-
min-width: 100px;
|
|
60
|
-
padding: 0 12px;
|
|
61
|
-
border: 0;
|
|
62
|
-
box-sizing: border-box;
|
|
63
|
-
}
|
|
64
|
-
@include light(){
|
|
65
|
-
.name {
|
|
66
|
-
color: #999;
|
|
67
|
-
background: #e7e8e9;
|
|
68
|
-
}
|
|
69
|
-
.value {
|
|
70
|
-
color: #666;
|
|
71
|
-
background: #eceef0;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
@include dark(){
|
|
75
|
-
.name {
|
|
76
|
-
color: #999;
|
|
77
|
-
background: #252930;
|
|
78
|
-
}
|
|
79
|
-
.value {
|
|
80
|
-
color: #fff;
|
|
81
|
-
background: #2e333a;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
</style>
|