@tak-ps/vue-tabler 3.6.0 → 3.7.1
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/CHANGELOG.md +10 -0
- package/components/Enum.vue +33 -13
- package/components/Schema.vue +21 -3
- package/components/Toggle.vue +17 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
## Version History
|
|
12
12
|
|
|
13
|
+
### v3.7.1
|
|
14
|
+
|
|
15
|
+
- :bug: Include missing components in `Enum` & `Toggle` comps
|
|
16
|
+
- :rocket: `TablerSchema`: Default to empty string for description prop
|
|
17
|
+
- :rocket: `TablerSchema`: Default to false for required prop
|
|
18
|
+
|
|
19
|
+
### v3.7.0
|
|
20
|
+
|
|
21
|
+
- :rocket: Include `description` and `required` to `TablerSchema` and sub components
|
|
22
|
+
|
|
13
23
|
### v3.6.0
|
|
14
24
|
|
|
15
25
|
- :rocket: Add `TablerPager` component for iterating over a list
|
package/components/Enum.vue
CHANGED
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<
|
|
4
|
-
v-if='
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
<div class='row'>
|
|
3
|
+
<div class='col-12 d-flex'>
|
|
4
|
+
<span v-if='description' style='margin-right: 4px;'>
|
|
5
|
+
<InfoSquareIcon @click='help = true' size='20' class='cursor-pointer'/>
|
|
6
|
+
<Help v-if='help' @click='help = false' :label='label || placeholder' :description='description'/>
|
|
7
|
+
</span>
|
|
8
|
+
<label
|
|
9
|
+
v-if='label'
|
|
10
|
+
class="form-label"
|
|
11
|
+
v-text='label'
|
|
12
|
+
:class='{
|
|
13
|
+
"required": required
|
|
14
|
+
}'
|
|
15
|
+
></label>
|
|
16
|
+
</div>
|
|
17
|
+
<div class='col-12'>
|
|
18
|
+
<select v-model='current' :disabled='disabled' class='form-select'>
|
|
19
|
+
<option v-for='option in options' :value="option" v-text='option'></option>
|
|
20
|
+
</select>
|
|
21
|
+
</div>
|
|
15
22
|
</div>
|
|
16
23
|
</template>
|
|
17
24
|
|
|
18
25
|
<script>
|
|
26
|
+
import {
|
|
27
|
+
InfoSquareIcon
|
|
28
|
+
} from 'vue-tabler-icons';
|
|
29
|
+
import Help from './Help.vue';
|
|
30
|
+
|
|
19
31
|
export default {
|
|
20
32
|
name: 'TablerEnum',
|
|
21
33
|
props: {
|
|
@@ -31,6 +43,10 @@ export default {
|
|
|
31
43
|
type: Boolean,
|
|
32
44
|
required: false
|
|
33
45
|
},
|
|
46
|
+
description: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: false
|
|
49
|
+
},
|
|
34
50
|
options: {
|
|
35
51
|
type: Array,
|
|
36
52
|
required: true
|
|
@@ -58,6 +74,10 @@ export default {
|
|
|
58
74
|
if (this.current === this.modelValue) return;
|
|
59
75
|
this.$emit('update:modelValue', this.current);
|
|
60
76
|
}
|
|
77
|
+
},
|
|
78
|
+
components: {
|
|
79
|
+
InfoSquareIcon,
|
|
80
|
+
Help
|
|
61
81
|
}
|
|
62
82
|
}
|
|
63
83
|
</script>
|
package/components/Schema.vue
CHANGED
|
@@ -5,16 +5,30 @@
|
|
|
5
5
|
<TablerEnum
|
|
6
6
|
:label='key'
|
|
7
7
|
:disabled='disabled'
|
|
8
|
+
:required='schema.properties[key].required || false'
|
|
9
|
+
:description='schema.properties[key].description || ""'
|
|
8
10
|
v-model='data[key]'
|
|
9
11
|
:options='schema.properties[key].enum'
|
|
10
12
|
:default='schema.properties[key].default'
|
|
11
13
|
/>
|
|
12
14
|
</template>
|
|
13
15
|
<template v-else-if='schema.properties[key].type === "string"'>
|
|
14
|
-
<TablerInput
|
|
16
|
+
<TablerInput
|
|
17
|
+
:label='key'
|
|
18
|
+
:disabled='disabled'
|
|
19
|
+
:required='schema.properties[key].required || false'
|
|
20
|
+
:description='schema.properties[key].description || ""'
|
|
21
|
+
v-model='data[key]'
|
|
22
|
+
/>
|
|
15
23
|
</template>
|
|
16
24
|
<template v-else-if='schema.properties[key].type === "boolean"'>
|
|
17
|
-
<TablerToggle
|
|
25
|
+
<TablerToggle
|
|
26
|
+
:label='key'
|
|
27
|
+
:disabled='disabled'
|
|
28
|
+
:required='schema.properties[key].required || false'
|
|
29
|
+
:description='schema.properties[key].description || ""'
|
|
30
|
+
v-model='data[key]'
|
|
31
|
+
/>
|
|
18
32
|
</template>
|
|
19
33
|
<template v-else-if='schema.properties[key].type === "array"'>
|
|
20
34
|
<div class='d-flex'>
|
|
@@ -37,7 +51,11 @@
|
|
|
37
51
|
</template>
|
|
38
52
|
<template v-else>
|
|
39
53
|
<div class='row'>
|
|
40
|
-
<TablerInput
|
|
54
|
+
<TablerInput
|
|
55
|
+
:label='key'
|
|
56
|
+
:rows='3'
|
|
57
|
+
:disabled='disabled'
|
|
58
|
+
v-model='data[key]'/>
|
|
41
59
|
</div>
|
|
42
60
|
</template>
|
|
43
61
|
</div>
|
package/components/Toggle.vue
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div class='d-flex align-items-center'>
|
|
4
|
+
<span v-if='description' style='margin-right: 4px;'>
|
|
5
|
+
<InfoSquareIcon @click='help = true' size='20' class='cursor-pointer'/>
|
|
6
|
+
<Help v-if='help' @click='help = false' :label='label || placeholder' :description='description'/>
|
|
7
|
+
</span>
|
|
4
8
|
<label
|
|
5
9
|
v-if='label'
|
|
6
10
|
class='form-label my-1 mx-2'
|
|
@@ -17,6 +21,11 @@
|
|
|
17
21
|
</template>
|
|
18
22
|
|
|
19
23
|
<script>
|
|
24
|
+
import {
|
|
25
|
+
InfoSquareIcon
|
|
26
|
+
} from 'vue-tabler-icons';
|
|
27
|
+
import Help from './Help.vue';
|
|
28
|
+
|
|
20
29
|
export default {
|
|
21
30
|
name: 'TablerToggle',
|
|
22
31
|
props: {
|
|
@@ -32,6 +41,10 @@ export default {
|
|
|
32
41
|
type: Boolean,
|
|
33
42
|
default: false
|
|
34
43
|
},
|
|
44
|
+
description: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
35
48
|
label: {
|
|
36
49
|
type: String,
|
|
37
50
|
default: ''
|
|
@@ -54,5 +67,9 @@ export default {
|
|
|
54
67
|
this.$emit('update:modelValue', this.current);
|
|
55
68
|
}
|
|
56
69
|
},
|
|
70
|
+
components: {
|
|
71
|
+
InfoSquareIcon,
|
|
72
|
+
Help
|
|
73
|
+
}
|
|
57
74
|
}
|
|
58
75
|
</script>
|