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
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="color-box"
|
|
4
|
-
:style="{ width: totalWidth + 'px' }"
|
|
5
4
|
>
|
|
6
5
|
<div class="color-set">
|
|
7
6
|
<Saturation
|
|
8
7
|
ref="saturation"
|
|
9
8
|
:hsv="{h:h,s:s,v:v}"
|
|
10
9
|
:color="rgbaString"
|
|
11
|
-
:size="
|
|
10
|
+
:size="200"
|
|
12
11
|
@selectSaturation="selectSaturation"
|
|
13
12
|
/>
|
|
14
13
|
<Hue
|
|
15
14
|
ref="hue"
|
|
16
15
|
:hsv="{h:h,s:s,v:v}"
|
|
17
|
-
:width="
|
|
18
|
-
:height="
|
|
16
|
+
:width="15"
|
|
17
|
+
:height="200"
|
|
19
18
|
@selectHue="selectHue"
|
|
20
19
|
/>
|
|
21
20
|
<Alpha
|
|
22
21
|
ref="alpha"
|
|
23
22
|
:color="rgbaString"
|
|
24
23
|
:rgba="rgba"
|
|
25
|
-
:width="
|
|
26
|
-
:height="
|
|
24
|
+
:width="15"
|
|
25
|
+
:height="200"
|
|
27
26
|
@selectAlpha="selectAlpha"
|
|
28
27
|
/>
|
|
29
28
|
</div>
|
|
30
|
-
<div
|
|
29
|
+
<div class="color-show">
|
|
31
30
|
<Preview
|
|
32
31
|
:color="rgbaString"
|
|
33
|
-
:width="
|
|
34
|
-
:height="
|
|
32
|
+
:width="238"
|
|
33
|
+
:height="28"
|
|
35
34
|
/>
|
|
36
35
|
</div>
|
|
37
|
-
<
|
|
38
|
-
<
|
|
36
|
+
<div class="color-input">
|
|
37
|
+
<span class="name">
|
|
38
|
+
HEX
|
|
39
|
+
</span>
|
|
40
|
+
<input :value="hexString" @input="inputHex" class="value"/>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="color-input">
|
|
43
|
+
<span class="name">
|
|
44
|
+
RGBA
|
|
45
|
+
</span>
|
|
46
|
+
<input :value="rgbaString" @input="inputRgba" class="value"/>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
39
49
|
<slot></slot>
|
|
40
50
|
</div>
|
|
41
51
|
</template>
|
|
@@ -47,29 +57,23 @@ import Saturation from './Saturation.vue'
|
|
|
47
57
|
import Hue from './Hue.vue'
|
|
48
58
|
import Alpha from './Alpha.vue'
|
|
49
59
|
import Preview from './Preview.vue'
|
|
50
|
-
import Box from './Box.vue'
|
|
51
60
|
|
|
52
61
|
export default {
|
|
53
62
|
components: {
|
|
54
63
|
Saturation,
|
|
55
64
|
Hue,
|
|
56
65
|
Alpha,
|
|
57
|
-
Preview
|
|
58
|
-
Box
|
|
66
|
+
Preview
|
|
59
67
|
},
|
|
60
|
-
emits: ['changeColor'],
|
|
61
68
|
mixins: [color],
|
|
62
69
|
props: {
|
|
63
70
|
color: {
|
|
64
71
|
type: String,
|
|
65
|
-
default: '#
|
|
72
|
+
default: '#2F1DCC',
|
|
66
73
|
}
|
|
67
74
|
},
|
|
68
75
|
data() {
|
|
69
76
|
return {
|
|
70
|
-
hueWidth: 15,
|
|
71
|
-
hueHeight: 200,
|
|
72
|
-
previewHeight: 30,
|
|
73
77
|
r: 0,
|
|
74
78
|
g: 0,
|
|
75
79
|
b: 0,
|
|
@@ -80,12 +84,6 @@ export default {
|
|
|
80
84
|
}
|
|
81
85
|
},
|
|
82
86
|
computed: {
|
|
83
|
-
totalWidth() {
|
|
84
|
-
return this.hueHeight + (this.hueWidth + 14) * 2
|
|
85
|
-
},
|
|
86
|
-
previewWidth() {
|
|
87
|
-
return this.totalWidth - 20
|
|
88
|
-
},
|
|
89
87
|
rgba() {
|
|
90
88
|
return {
|
|
91
89
|
r: this.r,
|
|
@@ -133,7 +131,11 @@ export default {
|
|
|
133
131
|
this.a = a
|
|
134
132
|
},
|
|
135
133
|
inputHex(color) {
|
|
136
|
-
|
|
134
|
+
const value = color.target.value
|
|
135
|
+
if (value.length !== 7) {
|
|
136
|
+
return
|
|
137
|
+
}
|
|
138
|
+
this.setColorValue(value)
|
|
137
139
|
this.$nextTick(() => {
|
|
138
140
|
|
|
139
141
|
this.$refs.saturation.renderColor()
|
|
@@ -144,26 +146,16 @@ export default {
|
|
|
144
146
|
})
|
|
145
147
|
},
|
|
146
148
|
inputRgba(color) {
|
|
147
|
-
|
|
148
|
-
this
|
|
149
|
-
this.$refs.saturation.renderColor()
|
|
150
|
-
|
|
151
|
-
this.$refs.saturation.renderSlide()
|
|
152
|
-
|
|
153
|
-
this.$refs.hue.renderSlide()
|
|
154
|
-
})
|
|
155
|
-
},
|
|
156
|
-
selectColor(color) {
|
|
157
|
-
this.setColorValue(color)
|
|
149
|
+
const value = color.target.value
|
|
150
|
+
this.setColorValue(value)
|
|
158
151
|
this.$nextTick(() => {
|
|
159
|
-
|
|
160
152
|
this.$refs.saturation.renderColor()
|
|
161
153
|
|
|
162
154
|
this.$refs.saturation.renderSlide()
|
|
163
155
|
|
|
164
156
|
this.$refs.hue.renderSlide()
|
|
165
157
|
})
|
|
166
|
-
}
|
|
158
|
+
}
|
|
167
159
|
},
|
|
168
160
|
}
|
|
169
161
|
</script>
|
|
@@ -196,5 +188,54 @@ export default {
|
|
|
196
188
|
margin-top: 8px;
|
|
197
189
|
display: flex;
|
|
198
190
|
}
|
|
191
|
+
|
|
192
|
+
.color-input {
|
|
193
|
+
display: flex;
|
|
194
|
+
margin-top: 8px;
|
|
195
|
+
font-size: 12px;
|
|
196
|
+
|
|
197
|
+
.name {
|
|
198
|
+
width: 60px;
|
|
199
|
+
height: 30px;
|
|
200
|
+
float: left;
|
|
201
|
+
display: flex;
|
|
202
|
+
justify-content: center;
|
|
203
|
+
align-items: center;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.value {
|
|
207
|
+
flex: 1;
|
|
208
|
+
height: 30px;
|
|
209
|
+
min-width: 100px;
|
|
210
|
+
padding: 0 12px;
|
|
211
|
+
border: 0;
|
|
212
|
+
box-sizing: border-box;
|
|
213
|
+
text-align: left;
|
|
214
|
+
direction: ltr;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@include light() {
|
|
218
|
+
.name {
|
|
219
|
+
color: #999;
|
|
220
|
+
background: #e7e8e9;
|
|
221
|
+
}
|
|
222
|
+
.value {
|
|
223
|
+
color: #666;
|
|
224
|
+
background: #eceef0;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
@include dark() {
|
|
228
|
+
.name {
|
|
229
|
+
color: #999;
|
|
230
|
+
background: #252930;
|
|
231
|
+
}
|
|
232
|
+
.value {
|
|
233
|
+
color: #fff;
|
|
234
|
+
background: #2e333a;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
199
238
|
}
|
|
239
|
+
|
|
240
|
+
|
|
200
241
|
</style>
|
|
@@ -1,118 +1,136 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
2
|
+
<div :class="`${$r.prefix}group-input`">
|
|
3
|
+
<label>{{ label }}</label>
|
|
4
|
+
<div class="group-holder" v-for="(item,i) in modelValue" :key="i">
|
|
5
|
+
<div class="group-slot">
|
|
6
|
+
<slot :item="item" :index="i" :disableDel="disDel">
|
|
7
|
+
<div class="d-flex flex-wrap pt-5">
|
|
8
|
+
<template v-for="(v,k) in item" :key="i+'-'+k">
|
|
9
|
+
<r-text-input v-if="typeof v==='string'" class="flex-grow-0 me-1" :label="k"
|
|
10
|
+
v-model="item[k]"></r-text-input>
|
|
11
|
+
<r-number v-else-if="typeof v==='number'" class="flex-grow-0 me-1" :label="k"
|
|
12
|
+
v-model="item[k]"></r-number>
|
|
13
|
+
<r-switch v-else-if="typeof v==='boolean'" class="flex-grow-0 me-1" :label="k"
|
|
14
|
+
v-model="item[k]"></r-switch>
|
|
15
|
+
</template>
|
|
16
|
+
</div>
|
|
17
|
+
</slot>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="group-action">
|
|
20
|
+
<r-btn icon text>
|
|
21
|
+
<r-icon v-html="$r.icons.chevron_up" :class="{'icon-disabled':i===0}" @click.prevent="up(i)"></r-icon>
|
|
22
|
+
</r-btn>
|
|
23
|
+
<r-btn icon text>
|
|
24
|
+
<r-icon v-html="$r.icons.chevron_down" :class="{'icon-disabled':i===modelValue.length-1}"
|
|
25
|
+
@click.prevent="down(i)"></r-icon>
|
|
26
|
+
</r-btn>
|
|
27
|
+
<r-btn v-if="!disableItems.includes(item[itemKey])" icon class="color-error-text" text @click.prevent="del(i)">
|
|
28
|
+
<r-icon v-html="$r.icons.delete"></r-icon>
|
|
29
|
+
</r-btn>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="text-center mt-5">
|
|
33
|
+
<transition name="scale">
|
|
34
|
+
<r-btn v-if="show_add" class="color-success" icon @click.prevent="add">
|
|
35
|
+
<r-icon v-html="$r.icons.plus"></r-icon>
|
|
36
|
+
</r-btn>
|
|
37
|
+
</transition>
|
|
39
38
|
</div>
|
|
39
|
+
|
|
40
|
+
</div>
|
|
40
41
|
</template>
|
|
41
42
|
<script>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
43
|
+
export default {
|
|
44
|
+
name: 'rGroupInput',
|
|
45
|
+
props: {
|
|
46
|
+
label: String,
|
|
47
|
+
itemKey: String,
|
|
48
|
+
modelValue: Array,
|
|
49
|
+
size: Number,
|
|
50
|
+
disableAdd: Boolean,
|
|
51
|
+
template: Object
|
|
52
|
+
},
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
disabledDel: {}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
computed: {
|
|
59
|
+
disableItems() {
|
|
60
|
+
return Object.keys(this.disabledDel)
|
|
61
|
+
},
|
|
62
|
+
show_add() {
|
|
63
|
+
if (this.disableAdd) {
|
|
64
|
+
return false
|
|
65
|
+
}
|
|
66
|
+
const l = this.$helper.ifHas(this.modelValue, 0, 'length')
|
|
67
|
+
return !(this.size && l >= this.size);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
methods: {
|
|
71
|
+
disDel(value) {
|
|
72
|
+
this.disabledDel[value] = true
|
|
73
|
+
},
|
|
74
|
+
add() {
|
|
75
|
+
if (this.show_add) {
|
|
76
|
+
let a = this.modelValue || []
|
|
77
|
+
a.push(this.$helper.clearProxy(this.template))
|
|
78
|
+
this.$emit('add', true)
|
|
79
|
+
this.$emit('update:model-value', a)
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
del(i) {
|
|
83
|
+
let a = this.modelValue || []
|
|
84
|
+
a.splice(i, 1)
|
|
85
|
+
this.$emit('delete', i)
|
|
86
|
+
this.$emit('update:model-value', a)
|
|
87
|
+
},
|
|
88
|
+
up(i) {
|
|
89
|
+
if (i === 0) {
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
let a = this.modelValue || []
|
|
93
|
+
a = this.array_move(a, i, i - 1)
|
|
94
|
+
this.$emit('update:model-value', a)
|
|
95
|
+
},
|
|
96
|
+
down(i) {
|
|
97
|
+
if (i === this.modelValue.length - 1) {
|
|
98
|
+
return
|
|
99
|
+
}
|
|
100
|
+
let a = this.modelValue || []
|
|
101
|
+
a = this.array_move(a, i, i + 1)
|
|
102
|
+
this.$emit('update:model-value', a)
|
|
103
|
+
},
|
|
104
|
+
array_move(arr, old_index, new_index) {
|
|
105
|
+
if (new_index >= arr.length) {
|
|
106
|
+
let k = new_index - arr.length + 1;
|
|
107
|
+
while (k--) {
|
|
108
|
+
arr.push(undefined);
|
|
96
109
|
}
|
|
110
|
+
}
|
|
111
|
+
arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
|
|
112
|
+
return arr;
|
|
97
113
|
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
98
116
|
</script>
|
|
99
117
|
<style lang="scss">
|
|
100
|
-
|
|
118
|
+
@import "../../style/include";
|
|
101
119
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
.#{$prefix}group-input {
|
|
121
|
+
.group-holder {
|
|
122
|
+
position: relative;
|
|
105
123
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
}
|
|
124
|
+
.group-action {
|
|
125
|
+
position: absolute;
|
|
126
|
+
top: 0;
|
|
127
|
+
@include ltr() {
|
|
128
|
+
right: 0;
|
|
129
|
+
}
|
|
130
|
+
@include rtl() {
|
|
131
|
+
left: 0;
|
|
132
|
+
}
|
|
117
133
|
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
118
136
|
</style>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
class="iti-flag"></div>
|
|
16
16
|
<div class="list-title">{{item.name}}</div>
|
|
17
17
|
<r-spacer></r-spacer>
|
|
18
|
-
<span>+{{ item.dialCode }}</span>
|
|
18
|
+
<span class="ltr">+{{ item.dialCode }}</span>
|
|
19
19
|
</template>
|
|
20
20
|
</r-list>
|
|
21
21
|
</r-card>
|
|
@@ -26,14 +26,13 @@
|
|
|
26
26
|
<span class="country-code pa-1"> +{{ activeCountry.dialCode }} </span>
|
|
27
27
|
<span class="dropdown-arrow">{{ open ? "▲" : "▼" }}</span>
|
|
28
28
|
</r-btn>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</r-mask-input>
|
|
29
|
+
<r-text-input class="input-phone" :label="label?label:$t('phone','renusify')"
|
|
30
|
+
@update:model-value="emit"
|
|
31
|
+
:tile="tile"
|
|
32
|
+
:rules="[required&&'required']"
|
|
33
|
+
v-model="tel.phone"
|
|
34
|
+
>
|
|
35
|
+
</r-text-input>
|
|
37
36
|
|
|
38
37
|
</div>
|
|
39
38
|
</template>
|
|
@@ -143,7 +142,6 @@
|
|
|
143
142
|
setTimeout(() => {
|
|
144
143
|
this.tel.phone = this.tel.phone.substr(1, this.tel.phone.length)
|
|
145
144
|
this.$emit('update:modelValue', this.tel)
|
|
146
|
-
this.$toast(this.$t('phone_ex', 'renusify'))
|
|
147
145
|
}, 1)
|
|
148
146
|
} else {
|
|
149
147
|
this.$emit('update:modelValue', this.tel)
|
|
@@ -20,20 +20,21 @@
|
|
|
20
20
|
:disableDel="disableDel||template!==undefined"
|
|
21
21
|
:disableEditKey="disableEditKey"
|
|
22
22
|
:keyWidth="keyWidth"
|
|
23
|
+
:valueWidth="valueWidth"
|
|
23
24
|
></r-json>
|
|
24
25
|
</div>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
:tile="tile"
|
|
28
|
-
:model-value="value" @update:model-value="emit(key,$event)"></r-text-input>
|
|
29
|
-
<r-number v-else-if="typeof value==='number'"
|
|
26
|
+
<div v-else class="mb-1" :style="{'max-width': valueWidth}">
|
|
27
|
+
<r-text-input v-if="typeof value==='string'"
|
|
30
28
|
:tile="tile"
|
|
31
|
-
:model-value="value" @update:model-value="emit(key,$event)"></r-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
:model-value="value" @update:model-value="emit(key,$event)"></r-text-input>
|
|
30
|
+
<r-number v-else-if="typeof value==='number'"
|
|
31
|
+
:tile="tile"
|
|
32
|
+
:model-value="value" @update:model-value="emit(key,$event)"></r-number>
|
|
33
|
+
<r-switch v-else-if="typeof value==='boolean'"
|
|
34
|
+
:tile="tile"
|
|
35
|
+
:model-value="value" @update:model-value="emit(key,$event)"></r-switch>
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
</div>
|
|
37
38
|
|
|
38
39
|
</div>
|
|
39
40
|
</template>
|
|
@@ -50,6 +51,9 @@
|
|
|
50
51
|
keyWidth: {
|
|
51
52
|
type: String,
|
|
52
53
|
default: '140px'
|
|
54
|
+
}, valueWidth: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: '300px'
|
|
53
57
|
}
|
|
54
58
|
},
|
|
55
59
|
data() {
|
|
@@ -100,4 +104,4 @@
|
|
|
100
104
|
<style lang="scss">
|
|
101
105
|
@import "../../../style/include";
|
|
102
106
|
|
|
103
|
-
</style>
|
|
107
|
+
</style>
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
:disableDel="disableDel"
|
|
19
19
|
:tile="tile"
|
|
20
20
|
:keyWidth="keyWidth"
|
|
21
|
+
:valueWidth="valueWidth"
|
|
21
22
|
></json-view>
|
|
22
23
|
<div v-if="!show &&!disableAdd" class="text-end mb-3">
|
|
23
24
|
<r-btn
|
|
@@ -33,28 +34,28 @@
|
|
|
33
34
|
v-if="!is_array"
|
|
34
35
|
v-model="info.key"
|
|
35
36
|
:tile="tile"
|
|
36
|
-
class="w-30"
|
|
37
|
-
:label="
|
|
38
|
-
<div class="w-20">
|
|
37
|
+
class="w-30 pe-1"
|
|
38
|
+
:label="keyLabel"></r-text-input>
|
|
39
|
+
<div class="w-20" v-if="!valueType">
|
|
39
40
|
<r-select v-model="info.type"
|
|
40
41
|
:tile="tile"
|
|
41
|
-
class="
|
|
42
|
+
class="me-1"
|
|
42
43
|
:items="['text','number','boolean','json','array']"
|
|
43
44
|
just-value
|
|
44
45
|
@update:model-value="info.value=null"
|
|
45
46
|
firstSelect></r-select>
|
|
46
47
|
</div>
|
|
47
|
-
<r-text-input v-if="
|
|
48
|
+
<r-text-input v-if="val_type==='text'"
|
|
48
49
|
:tile="tile"
|
|
49
|
-
:label="
|
|
50
|
+
:label="valueLabel"
|
|
50
51
|
v-model="info.value"></r-text-input>
|
|
51
|
-
<r-number v-else-if="
|
|
52
|
+
<r-number v-else-if="val_type==='number'"
|
|
52
53
|
:tile="tile"
|
|
53
54
|
:label="$t('value','renusify')" v-model="info.value"></r-number>
|
|
54
|
-
<r-switch v-else-if="
|
|
55
|
+
<r-switch v-else-if="val_type==='boolean'"
|
|
55
56
|
:tile="tile"
|
|
56
57
|
:label="$t('value','renusify')" v-model="info.value"></r-switch>
|
|
57
|
-
<r-btn @click.prevent="add" class="ms-1">{{ $t('add', 'renusify') }}</r-btn>
|
|
58
|
+
<r-btn @click.prevent="add" class="ms-1 color-success" rounded>{{ $t('add', 'renusify') }}</r-btn>
|
|
58
59
|
</div>
|
|
59
60
|
</div>
|
|
60
61
|
<div class="display-5 d-flex v-end pb-2" :style="{'color':color}" :class="{
|
|
@@ -73,6 +74,8 @@ export default {
|
|
|
73
74
|
components: {JsonView},
|
|
74
75
|
props: {
|
|
75
76
|
label: String,
|
|
77
|
+
keyLabel: {type: String, default: 'key'},
|
|
78
|
+
valueLabel: {type: String, default: 'value'},
|
|
76
79
|
modelValue: {
|
|
77
80
|
type: Object, Array
|
|
78
81
|
},
|
|
@@ -80,6 +83,16 @@ export default {
|
|
|
80
83
|
type: String,
|
|
81
84
|
default: '140px'
|
|
82
85
|
},
|
|
86
|
+
valueWidth: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: '300px'
|
|
89
|
+
},
|
|
90
|
+
valueType: {
|
|
91
|
+
type: String,
|
|
92
|
+
validator: function (value) {
|
|
93
|
+
return ['text', 'number', 'boolean'].indexOf(value) !== -1
|
|
94
|
+
}
|
|
95
|
+
},
|
|
83
96
|
template: Object,
|
|
84
97
|
baseArray: Boolean,
|
|
85
98
|
disableAdd: Boolean,
|
|
@@ -95,6 +108,12 @@ export default {
|
|
|
95
108
|
}
|
|
96
109
|
},
|
|
97
110
|
computed: {
|
|
111
|
+
val_type() {
|
|
112
|
+
if (this.valueType) {
|
|
113
|
+
return this.valueType
|
|
114
|
+
}
|
|
115
|
+
return this.info.type
|
|
116
|
+
},
|
|
98
117
|
is_array() {
|
|
99
118
|
if (this.baseArray) {
|
|
100
119
|
return true
|
|
@@ -152,4 +171,4 @@ export default {
|
|
|
152
171
|
}
|
|
153
172
|
}
|
|
154
173
|
}
|
|
155
|
-
</script>
|
|
174
|
+
</script>
|