@tak-ps/vue-tabler 3.52.0 → 3.53.0
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 +4 -0
- package/components/Alert.vue +57 -27
- package/components/BreadCrumb.vue +35 -14
- package/components/Bytes.vue +1 -1
- package/components/Delete.vue +60 -32
- package/components/Dropdown.vue +26 -14
- package/components/Epoch.vue +1 -1
- package/components/EpochRange.vue +1 -1
- package/components/Err.vue +27 -11
- package/components/Help.vue +32 -13
- package/components/List.vue +74 -37
- package/components/Loading.vue +34 -19
- package/components/Markdown.vue +1 -1
- package/components/Modal.vue +22 -12
- package/components/None.vue +44 -20
- package/components/Pager.vue +52 -35
- package/components/Progress.vue +6 -6
- package/components/Schema.vue +111 -78
- package/components/input/Colour.vue +43 -20
- package/components/input/Enum.vue +29 -15
- package/components/input/Input.vue +80 -47
- package/components/input/Range.vue +25 -16
- package/components/input/Select.vue +23 -13
- package/components/input/TimeZone.vue +17 -13
- package/components/input/Toggle.vue +24 -12
- package/components/internal/Label.vue +39 -20
- package/package.json +4 -3
package/components/Loading.vue
CHANGED
|
@@ -1,26 +1,41 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<div
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
<div
|
|
3
|
+
:class='{
|
|
4
|
+
"w-full": !inline,
|
|
5
|
+
"d-flex": inline
|
|
6
|
+
}'
|
|
7
|
+
>
|
|
8
|
+
<template v-if='inline'>
|
|
9
|
+
<div class='d-flex'>
|
|
10
|
+
<div
|
|
11
|
+
class='spinner-border'
|
|
12
|
+
role='status'
|
|
13
|
+
/>
|
|
14
|
+
<div
|
|
15
|
+
v-if='desc && desc.length'
|
|
16
|
+
class='mx-3 align-self-center'
|
|
17
|
+
v-text='desc'
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
<template v-else>
|
|
18
22
|
<div class='d-flex justify-content-center my-4'>
|
|
19
|
-
<div
|
|
23
|
+
<div
|
|
24
|
+
class='spinner-border'
|
|
25
|
+
role='status'
|
|
26
|
+
/>
|
|
20
27
|
</div>
|
|
28
|
+
|
|
29
|
+
<template v-if='desc && desc.length'>
|
|
30
|
+
<div class='d-flex justify-content-center my-4'>
|
|
31
|
+
<div
|
|
32
|
+
class=''
|
|
33
|
+
v-text='desc'
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
21
37
|
</template>
|
|
22
|
-
</
|
|
23
|
-
</div>
|
|
38
|
+
</div>
|
|
24
39
|
</template>
|
|
25
40
|
|
|
26
41
|
<script>
|
package/components/Markdown.vue
CHANGED
package/components/Modal.vue
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<div
|
|
3
|
+
class='modal modal-blur fade show'
|
|
4
|
+
tabindex='-1'
|
|
5
|
+
style='display: block;'
|
|
6
|
+
aria-modal='true'
|
|
7
|
+
role='dialog'
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class='modal-dialog modal-dialog-centered'
|
|
11
|
+
role='document'
|
|
12
|
+
:class='{
|
|
13
|
+
"modal-sm": size === "sm",
|
|
14
|
+
"modal-md": size === "md",
|
|
15
|
+
"modal-lg": size === "lg",
|
|
16
|
+
"modal-xl": size === "xl",
|
|
17
|
+
}'
|
|
18
|
+
>
|
|
19
|
+
<div class='modal-content'>
|
|
20
|
+
<slot />
|
|
11
21
|
</div>
|
|
12
|
-
|
|
13
|
-
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
14
24
|
</template>
|
|
15
25
|
|
|
16
26
|
<script>
|
|
@@ -20,7 +30,7 @@ export default {
|
|
|
20
30
|
size: {
|
|
21
31
|
// sm, md, lg, xl
|
|
22
32
|
type: String,
|
|
23
|
-
|
|
33
|
+
default: 'sm'
|
|
24
34
|
}
|
|
25
35
|
}
|
|
26
36
|
}
|
package/components/None.vue
CHANGED
|
@@ -1,24 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class='card-body'>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<div class='card-body'>
|
|
3
|
+
<div
|
|
4
|
+
class='d-flex justify-content-center'
|
|
5
|
+
:class='{
|
|
6
|
+
"mt-4 mb-2": !compact
|
|
7
|
+
}'
|
|
8
|
+
>
|
|
9
|
+
<IconNotesOff
|
|
10
|
+
v-if='compact'
|
|
11
|
+
:size='32'
|
|
12
|
+
:stroke='1'
|
|
13
|
+
/>
|
|
14
|
+
<IconNotesOff
|
|
15
|
+
v-else
|
|
16
|
+
:size='48'
|
|
17
|
+
:stroke='1'
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
9
20
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
<div
|
|
22
|
+
class='text-center'
|
|
23
|
+
:class='{
|
|
24
|
+
"mb-4 mt-2": !compact
|
|
25
|
+
}'
|
|
26
|
+
>
|
|
27
|
+
<div>No <span v-text='label' /></div>
|
|
28
|
+
</div>
|
|
15
29
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
<div
|
|
31
|
+
v-if='create'
|
|
32
|
+
class='d-flex justify-content-center my-4'
|
|
33
|
+
:class='{
|
|
34
|
+
"my-4": !compact
|
|
35
|
+
}'
|
|
36
|
+
@click='$emit("create")'
|
|
37
|
+
>
|
|
38
|
+
<div class='btn btn-primary'>
|
|
39
|
+
<span>Create <span v-text='label' /></span>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
20
42
|
</div>
|
|
21
|
-
</div>
|
|
22
43
|
</template>
|
|
23
44
|
|
|
24
45
|
<script>
|
|
@@ -28,6 +49,9 @@ import {
|
|
|
28
49
|
|
|
29
50
|
export default {
|
|
30
51
|
name: 'TablerNone',
|
|
52
|
+
components: {
|
|
53
|
+
IconNotesOff
|
|
54
|
+
},
|
|
31
55
|
props: {
|
|
32
56
|
label: {
|
|
33
57
|
type: String,
|
|
@@ -42,8 +66,8 @@ export default {
|
|
|
42
66
|
default: true
|
|
43
67
|
},
|
|
44
68
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
69
|
+
emits: [
|
|
70
|
+
'create'
|
|
71
|
+
]
|
|
48
72
|
}
|
|
49
73
|
</script>
|
package/components/Pager.vue
CHANGED
|
@@ -1,44 +1,58 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class='pagination m-0 ms-auto'>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<button @click='changePage(0)' class='btn mx-1' >
|
|
6
|
-
<IconHome :size='32' :stroke='1' class='icon'/>Home
|
|
7
|
-
</button>
|
|
8
|
-
</template>
|
|
9
|
-
<template v-else>
|
|
10
|
-
<button @click='changePage(0)' class='btn mx-1' :class='{ "btn-primary": current === 0 }'>
|
|
11
|
-
<IconHome :size='32' :stroke='1' class='icon'/>Home
|
|
12
|
-
</button>
|
|
13
|
-
|
|
14
|
-
<template v-if='end > 5 && current > 3'>
|
|
15
|
-
<span class=''> ... </span>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<template v-if='parseInt(total) / parseInt(limit) > 2'>
|
|
2
|
+
<div class='pagination m-0 ms-auto'>
|
|
3
|
+
<div>
|
|
4
|
+
<template v-if='parseInt(total) <= parseInt(limit)'>
|
|
19
5
|
<button
|
|
20
|
-
:key=i
|
|
21
|
-
v-for='i in middle'
|
|
22
|
-
@click='changePage(i)'
|
|
23
6
|
class='btn mx-1'
|
|
24
|
-
|
|
25
|
-
:class='{ "btn-primary": current === i }'
|
|
7
|
+
@click='changePage(0)'
|
|
26
8
|
>
|
|
9
|
+
<IconHome
|
|
10
|
+
:size='32'
|
|
11
|
+
:stroke='1'
|
|
12
|
+
class='icon'
|
|
13
|
+
/>Home
|
|
27
14
|
</button>
|
|
28
15
|
</template>
|
|
16
|
+
<template v-else>
|
|
17
|
+
<button
|
|
18
|
+
class='btn mx-1'
|
|
19
|
+
:class='{ "btn-primary": current === 0 }'
|
|
20
|
+
@click='changePage(0)'
|
|
21
|
+
>
|
|
22
|
+
<IconHome
|
|
23
|
+
:size='32'
|
|
24
|
+
:stroke='1'
|
|
25
|
+
class='icon'
|
|
26
|
+
/>Home
|
|
27
|
+
</button>
|
|
28
|
+
|
|
29
|
+
<template v-if='end > 5 && current > 3'>
|
|
30
|
+
<span class=''> ... </span>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<template v-if='parseInt(total) / parseInt(limit) > 2'>
|
|
34
|
+
<button
|
|
35
|
+
v-for='i in middle'
|
|
36
|
+
:key='i'
|
|
37
|
+
class='btn mx-1'
|
|
38
|
+
:class='{ "btn-primary": current === i }'
|
|
39
|
+
@click='changePage(i)'
|
|
40
|
+
v-text='i + 1'
|
|
41
|
+
/>
|
|
42
|
+
</template>
|
|
29
43
|
|
|
30
|
-
|
|
31
|
-
|
|
44
|
+
<template v-if='end > 5 && current < end - spread'>
|
|
45
|
+
<span class=''> ... </span>
|
|
46
|
+
</template>
|
|
47
|
+
<button
|
|
48
|
+
class='btn mx-1'
|
|
49
|
+
:class='{ "btn-primary": current === end - 1 }'
|
|
50
|
+
@click='changePage(end - 1)'
|
|
51
|
+
v-text='end'
|
|
52
|
+
/>
|
|
32
53
|
</template>
|
|
33
|
-
|
|
34
|
-
@click='changePage(end - 1)'
|
|
35
|
-
class='btn mx-1'
|
|
36
|
-
v-text='end'
|
|
37
|
-
:class='{ "btn-primary": current === end - 1 }'
|
|
38
|
-
></button>
|
|
39
|
-
</template>
|
|
54
|
+
</div>
|
|
40
55
|
</div>
|
|
41
|
-
</div>
|
|
42
56
|
</template>
|
|
43
57
|
|
|
44
58
|
<script>
|
|
@@ -48,6 +62,9 @@ import {
|
|
|
48
62
|
|
|
49
63
|
export default {
|
|
50
64
|
name: 'TablerPager',
|
|
65
|
+
components: {
|
|
66
|
+
IconHome
|
|
67
|
+
},
|
|
51
68
|
props: {
|
|
52
69
|
total: {
|
|
53
70
|
type: Number
|
|
@@ -59,6 +76,9 @@ export default {
|
|
|
59
76
|
type: Number
|
|
60
77
|
}
|
|
61
78
|
},
|
|
79
|
+
emits: [
|
|
80
|
+
'page'
|
|
81
|
+
],
|
|
62
82
|
data: function() {
|
|
63
83
|
return this.create();
|
|
64
84
|
},
|
|
@@ -127,9 +147,6 @@ export default {
|
|
|
127
147
|
this.current = page;
|
|
128
148
|
this.$emit('page', this.current);
|
|
129
149
|
}
|
|
130
|
-
},
|
|
131
|
-
components: {
|
|
132
|
-
IconHome
|
|
133
150
|
}
|
|
134
151
|
}
|
|
135
152
|
</script>
|
package/components/Progress.vue
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class=
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</div>
|
|
2
|
+
<div class='progress progress-xs'>
|
|
3
|
+
<div
|
|
4
|
+
class='progress-bar bg-primary'
|
|
5
|
+
:style='`width: ${percent * 100}%;`'
|
|
6
|
+
/>
|
|
7
|
+
</div>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script>
|
package/components/Schema.vue
CHANGED
|
@@ -1,78 +1,108 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class='px-2 py-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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<div :key='i' v-for='(arr, i) of data[key]' class='border rounded my-2 py-2 mx-2 px-2'>
|
|
2
|
+
<div class='px-2 py-2'>
|
|
3
|
+
<TablerLoading v-if='loading' />
|
|
4
|
+
<template v-else>
|
|
5
|
+
<div
|
|
6
|
+
v-for='key in Object.keys(s.properties)'
|
|
7
|
+
:key='key'
|
|
8
|
+
class='py-2 floating-input'
|
|
9
|
+
>
|
|
10
|
+
<template v-if='s.properties[key].enum'>
|
|
11
|
+
<TablerEnum
|
|
12
|
+
v-model='data[key]'
|
|
13
|
+
:label='key'
|
|
14
|
+
:disabled='disabled'
|
|
15
|
+
:required='s.properties[key].required || false'
|
|
16
|
+
:description='s.properties[key].description || ""'
|
|
17
|
+
:options='s.properties[key].enum'
|
|
18
|
+
:default='s.properties[key].default'
|
|
19
|
+
/>
|
|
20
|
+
</template>
|
|
21
|
+
<template v-else-if='s.properties[key].type === "string"'>
|
|
22
|
+
<TablerInput
|
|
23
|
+
v-model='data[key]'
|
|
24
|
+
:label='key'
|
|
25
|
+
:disabled='disabled'
|
|
26
|
+
:required='s.properties[key].required || false'
|
|
27
|
+
:description='s.properties[key].description || ""'
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
<template v-else-if='s.properties[key].type === "number" || s.properties[key].type === "integer"'>
|
|
31
|
+
<TablerInput
|
|
32
|
+
v-model='data[key]'
|
|
33
|
+
:type='s.properties[key].type'
|
|
34
|
+
:label='key'
|
|
35
|
+
:disabled='disabled'
|
|
36
|
+
:required='s.properties[key].required || false'
|
|
37
|
+
:description='s.properties[key].description || ""'
|
|
38
|
+
/>
|
|
39
|
+
</template>
|
|
40
|
+
<template v-else-if='s.properties[key].type === "boolean"'>
|
|
41
|
+
<TablerToggle
|
|
42
|
+
v-model='data[key]'
|
|
43
|
+
:label='key'
|
|
44
|
+
:disabled='disabled'
|
|
45
|
+
:required='s.properties[key].required || false'
|
|
46
|
+
:description='s.properties[key].description || ""'
|
|
47
|
+
/>
|
|
48
|
+
</template>
|
|
49
|
+
<template v-else-if='s.properties[key].type === "array"'>
|
|
54
50
|
<div class='d-flex'>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
<label
|
|
52
|
+
class='form-label'
|
|
53
|
+
v-text='key'
|
|
54
|
+
/>
|
|
55
|
+
<div class='ms-auto'>
|
|
56
|
+
<IconPlus
|
|
57
|
+
v-if='!disabled'
|
|
58
|
+
:size='32'
|
|
59
|
+
:stroke='1'
|
|
60
|
+
class='cursor-pointer'
|
|
61
|
+
@click='push(key)'
|
|
62
|
+
/>
|
|
58
63
|
</div>
|
|
59
64
|
</div>
|
|
60
65
|
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
<div
|
|
67
|
+
v-for='(arr, i) of data[key]'
|
|
68
|
+
:key='i'
|
|
69
|
+
class='border rounded my-2 py-2 mx-2 px-2'
|
|
70
|
+
>
|
|
71
|
+
<div class='d-flex'>
|
|
72
|
+
<div class='mx-2 my-2'>
|
|
73
|
+
Entry <span v-text='i + 1' />
|
|
74
|
+
</div>
|
|
75
|
+
<div class='ms-auto mx-2 my-2'>
|
|
76
|
+
<IconTrash
|
|
77
|
+
v-if='!disabled'
|
|
78
|
+
:size='32'
|
|
79
|
+
:stroke='1'
|
|
80
|
+
class='cursor-pointer'
|
|
81
|
+
@click='data[key].splice(i, 1)'
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<GenericSchema
|
|
87
|
+
v-model='data[key][i]'
|
|
88
|
+
:schema='s.properties[key].items'
|
|
89
|
+
:disabled='disabled'
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
<template v-else>
|
|
94
|
+
<div class='row'>
|
|
95
|
+
<TablerInput
|
|
96
|
+
v-model='data[key]'
|
|
97
|
+
:label='key'
|
|
98
|
+
:rows='3'
|
|
99
|
+
:disabled='disabled'
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
</template>
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
105
|
+
</div>
|
|
76
106
|
</template>
|
|
77
107
|
|
|
78
108
|
<script>
|
|
@@ -87,6 +117,14 @@ import {
|
|
|
87
117
|
|
|
88
118
|
export default {
|
|
89
119
|
name: 'TablerSchema',
|
|
120
|
+
components: {
|
|
121
|
+
IconPlus,
|
|
122
|
+
IconTrash,
|
|
123
|
+
TablerInput,
|
|
124
|
+
TablerToggle,
|
|
125
|
+
TablerEnum,
|
|
126
|
+
TablerLoading
|
|
127
|
+
},
|
|
90
128
|
props: {
|
|
91
129
|
modelValue: {
|
|
92
130
|
type: Object,
|
|
@@ -101,6 +139,9 @@ export default {
|
|
|
101
139
|
default: false
|
|
102
140
|
}
|
|
103
141
|
},
|
|
142
|
+
emits: [
|
|
143
|
+
'update:modelValue'
|
|
144
|
+
],
|
|
104
145
|
data: function() {
|
|
105
146
|
return {
|
|
106
147
|
loading: true,
|
|
@@ -151,14 +192,6 @@ export default {
|
|
|
151
192
|
this.data[key].push('');
|
|
152
193
|
}
|
|
153
194
|
}
|
|
154
|
-
},
|
|
155
|
-
components: {
|
|
156
|
-
IconPlus,
|
|
157
|
-
IconTrash,
|
|
158
|
-
TablerInput,
|
|
159
|
-
TablerToggle,
|
|
160
|
-
TablerEnum,
|
|
161
|
-
TablerLoading
|
|
162
195
|
}
|
|
163
196
|
}
|
|
164
197
|
</script>
|
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class='row'>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
<div class='row'>
|
|
3
|
+
<TablerLabel
|
|
4
|
+
:label='label'
|
|
5
|
+
:description='description'
|
|
6
|
+
:required='required'
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</TablerLabel>
|
|
10
|
+
<div class='col-12 d-flex'>
|
|
11
|
+
<div
|
|
12
|
+
v-for='color in Object.keys(colours)'
|
|
13
|
+
:key='color'
|
|
14
|
+
class='border border-white rounded mx-1'
|
|
15
|
+
style='height: 26px;'
|
|
16
|
+
>
|
|
17
|
+
<label class='form-colorinput'>
|
|
18
|
+
<input
|
|
19
|
+
v-model='current'
|
|
20
|
+
:disabled='disabled'
|
|
21
|
+
:value='color'
|
|
22
|
+
type='radio'
|
|
23
|
+
class='form-colorinput-input'
|
|
24
|
+
>
|
|
25
|
+
<span
|
|
26
|
+
class='form-colorinput-color bg-dark rounded'
|
|
27
|
+
:class='[
|
|
28
|
+
`bg-${color}`
|
|
29
|
+
]'
|
|
30
|
+
/>
|
|
31
|
+
</label>
|
|
32
|
+
</div>
|
|
12
33
|
</div>
|
|
13
34
|
</div>
|
|
14
|
-
</div>
|
|
15
35
|
</template>
|
|
16
36
|
|
|
17
37
|
<script>
|
|
@@ -19,6 +39,9 @@ import TablerLabel from '../internal/Label.vue';
|
|
|
19
39
|
|
|
20
40
|
export default {
|
|
21
41
|
name: 'TablerColour',
|
|
42
|
+
components: {
|
|
43
|
+
TablerLabel
|
|
44
|
+
},
|
|
22
45
|
props: {
|
|
23
46
|
modelValue: {
|
|
24
47
|
type: String,
|
|
@@ -42,6 +65,9 @@ export default {
|
|
|
42
65
|
},
|
|
43
66
|
label: String,
|
|
44
67
|
},
|
|
68
|
+
emits: [
|
|
69
|
+
'update:modelValue'
|
|
70
|
+
],
|
|
45
71
|
data: function() {
|
|
46
72
|
return {
|
|
47
73
|
current: '',
|
|
@@ -73,13 +99,6 @@ export default {
|
|
|
73
99
|
}
|
|
74
100
|
}
|
|
75
101
|
},
|
|
76
|
-
mounted: function() {
|
|
77
|
-
if (!this.modelValue && this.default) {
|
|
78
|
-
this.current = this.invertColours[this.default]
|
|
79
|
-
} else {
|
|
80
|
-
this.current = this.invertColours[this.modelValue];
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
102
|
watch: {
|
|
84
103
|
modelValue: function() {
|
|
85
104
|
this.current = this.invertColours[this.modelValue];
|
|
@@ -89,8 +108,12 @@ export default {
|
|
|
89
108
|
this.$emit('update:modelValue', this.colours[this.current]);
|
|
90
109
|
}
|
|
91
110
|
},
|
|
92
|
-
|
|
93
|
-
|
|
111
|
+
mounted: function() {
|
|
112
|
+
if (!this.modelValue && this.default) {
|
|
113
|
+
this.current = this.invertColours[this.default]
|
|
114
|
+
} else {
|
|
115
|
+
this.current = this.invertColours[this.modelValue];
|
|
116
|
+
}
|
|
94
117
|
}
|
|
95
118
|
}
|
|
96
119
|
</script>
|