renusify 1.3.1 → 1.3.2
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.
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<r-btn v-if="!disableDel" icon class="color-error-text" text @click="del(key)">
|
|
7
7
|
<r-icon v-html="$r.icons.delete"></r-icon>
|
|
8
8
|
</r-btn>
|
|
9
|
-
<div v-if="typeof value==='object'">{{ key }}</div>
|
|
9
|
+
<div v-if="typeof value==='object'">{{ t(key) }}</div>
|
|
10
10
|
</div>
|
|
11
11
|
<div v-if="typeof value==='object'" class="flex-grow-1 w-full ps-10">
|
|
12
12
|
<r-json-input :tile="tile"
|
|
@@ -14,21 +14,22 @@
|
|
|
14
14
|
@update:model-value="emit(key,$event)"
|
|
15
15
|
:disableAdd="disableAdd||template!==undefined"
|
|
16
16
|
:disableDel="disableDel||template!==undefined"
|
|
17
|
+
:translate="translate"
|
|
17
18
|
disableEditKey
|
|
18
19
|
></r-json-input>
|
|
19
20
|
</div>
|
|
20
21
|
<div v-else class="mb-1 flex-grow-1">
|
|
21
22
|
<r-text-input v-if="typeof value==='string'"
|
|
22
23
|
:tile="tile"
|
|
23
|
-
:label="!is_array?key:''"
|
|
24
|
+
:label="!is_array?t(key):''"
|
|
24
25
|
:model-value="value" @update:model-value="emit(key,$event)"></r-text-input>
|
|
25
26
|
<r-number-input v-else-if="typeof value==='number'"
|
|
26
27
|
:tile="tile"
|
|
27
|
-
:label="!is_array?key:''"
|
|
28
|
+
:label="!is_array?t(key):''"
|
|
28
29
|
:model-value="value" @update:model-value="emit(key,$event)"></r-number-input>
|
|
29
30
|
<r-switch-input v-else-if="typeof value==='boolean'"
|
|
30
31
|
:tile="tile"
|
|
31
|
-
:label="!is_array?key:''"
|
|
32
|
+
:label="!is_array?t(key):''"
|
|
32
33
|
:model-value="value" @update:model-value="emit(key,$event)"></r-switch-input>
|
|
33
34
|
|
|
34
35
|
</div>
|
|
@@ -43,7 +44,8 @@ export default {
|
|
|
43
44
|
template: Object,
|
|
44
45
|
disableAdd: Boolean,
|
|
45
46
|
disableDel: Boolean,
|
|
46
|
-
tile: Boolean
|
|
47
|
+
tile: Boolean,
|
|
48
|
+
translate:Boolean
|
|
47
49
|
},
|
|
48
50
|
emits: ['update:modelValue'],
|
|
49
51
|
data() {
|
|
@@ -57,6 +59,12 @@ export default {
|
|
|
57
59
|
}
|
|
58
60
|
},
|
|
59
61
|
methods: {
|
|
62
|
+
t(key){
|
|
63
|
+
if(this.translate){
|
|
64
|
+
return this.$t(key)
|
|
65
|
+
}
|
|
66
|
+
return key
|
|
67
|
+
},
|
|
60
68
|
del(key) {
|
|
61
69
|
let o = this.modelValue
|
|
62
70
|
if (this.is_array) {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
:template="template"
|
|
11
11
|
:disableAdd="disableAdd"
|
|
12
12
|
:disableDel="disableDel"
|
|
13
|
+
:translate="translate"
|
|
13
14
|
:tile="tile"
|
|
14
15
|
></json-view>
|
|
15
16
|
<r-btn
|
|
@@ -24,27 +25,28 @@
|
|
|
24
25
|
<r-text-input
|
|
25
26
|
v-if="!is_array"
|
|
26
27
|
v-model="info.key"
|
|
27
|
-
:label="
|
|
28
|
+
:label="$t('key','renusify')"
|
|
28
29
|
:tile="tile"
|
|
29
30
|
class="w-30 pe-1"></r-text-input>
|
|
30
|
-
<div class="w-20"
|
|
31
|
+
<div class="w-20" >
|
|
31
32
|
<r-select-input v-model="info.type"
|
|
32
33
|
:tile="tile"
|
|
33
34
|
class="me-1"
|
|
34
35
|
:items="['text','number','boolean','json','array']"
|
|
35
36
|
just-value
|
|
36
37
|
disableSearch
|
|
38
|
+
:translate="translate"
|
|
37
39
|
@update:model-value="info.value=null"
|
|
38
40
|
firstSelect></r-select-input>
|
|
39
41
|
</div>
|
|
40
|
-
<r-text-input v-if="
|
|
42
|
+
<r-text-input v-if="info.type==='text'"
|
|
41
43
|
:tile="tile"
|
|
42
|
-
:label="
|
|
44
|
+
:label="$t('value','renusify')"
|
|
43
45
|
v-model="info.value"></r-text-input>
|
|
44
|
-
<r-number-input v-else-if="
|
|
46
|
+
<r-number-input v-else-if="info.type==='number'"
|
|
45
47
|
:tile="tile"
|
|
46
48
|
:label="$t('value','renusify')" v-model="info.value"></r-number-input>
|
|
47
|
-
<r-switch-input v-else-if="
|
|
49
|
+
<r-switch-input v-else-if="info.type==='boolean'"
|
|
48
50
|
:tile="tile"
|
|
49
51
|
:label="$t('value','renusify')" v-model="info.value"></r-switch-input>
|
|
50
52
|
<r-btn @click.prevent="add" class="ms-1 color-success" rounded>{{ $t('add', 'renusify') }}</r-btn>
|
|
@@ -69,23 +71,16 @@ export default {
|
|
|
69
71
|
components: {JsonView},
|
|
70
72
|
props: {
|
|
71
73
|
label: String,
|
|
72
|
-
keyLabel: {type: String, default: 'key'},
|
|
73
|
-
valueLabel: {type: String, default: 'value'},
|
|
74
74
|
modelValue: {
|
|
75
75
|
type: Object, Array
|
|
76
76
|
},
|
|
77
|
-
valueType: {
|
|
78
|
-
type: String,
|
|
79
|
-
validator: function (value) {
|
|
80
|
-
return ['text', 'number', 'boolean'].indexOf(value) !== -1
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
77
|
template: Object,
|
|
84
78
|
baseArray: Boolean,
|
|
85
79
|
disableAdd: Boolean,
|
|
86
80
|
tile: Boolean,
|
|
87
81
|
disableEditKey: Boolean,
|
|
88
|
-
disableDel: Boolean
|
|
82
|
+
disableDel: Boolean,
|
|
83
|
+
translate: Boolean
|
|
89
84
|
},
|
|
90
85
|
emits: ['update:modelValue'],
|
|
91
86
|
data() {
|
|
@@ -98,12 +93,6 @@ export default {
|
|
|
98
93
|
}
|
|
99
94
|
},
|
|
100
95
|
computed: {
|
|
101
|
-
val_type() {
|
|
102
|
-
if (this.valueType) {
|
|
103
|
-
return this.valueType
|
|
104
|
-
}
|
|
105
|
-
return this.info.type
|
|
106
|
-
},
|
|
107
96
|
is_array() {
|
|
108
97
|
if (this.baseArray) {
|
|
109
98
|
return true
|