@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.
@@ -1,26 +1,41 @@
1
1
  <template>
2
- <div :class='{
3
- "w-full": !inline,
4
- "d-flex": inline
5
- }'>
6
- <template v-if='inline'>
7
- <div class='d-flex'>
8
- <div class="spinner-border" role="status"></div>
9
- <div v-if='desc && desc.length' class='mx-3 align-self-center' v-text='desc'></div>
10
- </div>
11
- </template>
12
- <template v-else>
13
- <div class='d-flex justify-content-center my-4'>
14
- <div class="spinner-border" role="status"></div>
15
- </div>
16
-
17
- <template v-if='desc && desc.length'>
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 class='' v-text='desc'></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
- </template>
23
- </div>
38
+ </div>
24
39
  </template>
25
40
 
26
41
  <script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div v-html='html'></div>
2
+ <div v-html='html' />
3
3
  </template>
4
4
 
5
5
  <script>
@@ -1,16 +1,26 @@
1
1
  <template>
2
- <div class="modal modal-blur fade show" tabindex="-1" style="display: block;" aria-modal="true" role="dialog">
3
- <div class="modal-dialog modal-dialog-centered" role="document" :class='{
4
- "modal-sm": size === "sm",
5
- "modal-md": size === "md",
6
- "modal-lg": size === "lg",
7
- "modal-xl": size === "xl",
8
- }'>
9
- <div class="modal-content">
10
- <slot/>
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
- </div>
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
- defaut: 'sm'
33
+ default: 'sm'
24
34
  }
25
35
  }
26
36
  }
@@ -1,24 +1,45 @@
1
1
  <template>
2
- <div class='card-body'>
3
- <div class='d-flex justify-content-center' :class='{
4
- "mt-4 mb-2": !compact
5
- }'>
6
- <IconNotesOff v-if='compact' :size='32' :stroke='1' />
7
- <IconNotesOff v-else :size='48' :stroke='1'/>
8
- </div>
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
- <div class='text-center' :class='{
11
- "mb-4 mt-2": !compact
12
- }'>
13
- <div>No <span v-text='label'/></div>
14
- </div>
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
- <div v-if='create' @click='$emit("create")' class='d-flex justify-content-center my-4' :class='{
17
- "my-4": !compact
18
- }'>
19
- <div class='btn btn-primary'><span>Create <span v-text='label'/></span></div>
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
- components: {
46
- IconNotesOff
47
- }
69
+ emits: [
70
+ 'create'
71
+ ]
48
72
  }
49
73
  </script>
@@ -1,44 +1,58 @@
1
1
  <template>
2
- <div class='pagination m-0 ms-auto'>
3
- <div>
4
- <template v-if='parseInt(total) <= parseInt(limit)'>
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
- v-text='i + 1'
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
- <template v-if='end > 5 && current < end - spread'>
31
- <span class=''> ... </span>
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
- <button
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>
@@ -1,10 +1,10 @@
1
1
  <template>
2
- <div class="progress progress-xs">
3
- <div
4
- class="progress-bar bg-primary"
5
- :style='`width: ${percent * 100}%;`'
6
- ></div>
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>
@@ -1,78 +1,108 @@
1
1
  <template>
2
- <div class='px-2 py-2'>
3
- <TablerLoading v-if='loading'/>
4
- <template v-else>
5
- <div :key='key' v-for='key in Object.keys(s.properties)' class='py-2 floating-input'>
6
- <template v-if='s.properties[key].enum'>
7
- <TablerEnum
8
- :label='key'
9
- :disabled='disabled'
10
- :required='s.properties[key].required || false'
11
- :description='s.properties[key].description || ""'
12
- v-model='data[key]'
13
- :options='s.properties[key].enum'
14
- :default='s.properties[key].default'
15
- />
16
- </template>
17
- <template v-else-if='s.properties[key].type === "string"'>
18
- <TablerInput
19
- :label='key'
20
- :disabled='disabled'
21
- :required='s.properties[key].required || false'
22
- :description='s.properties[key].description || ""'
23
- v-model='data[key]'
24
- />
25
- </template>
26
- <template v-else-if='s.properties[key].type === "number" || s.properties[key].type === "integer"'>
27
- <TablerInput
28
- :type='s.properties[key].type'
29
- :label='key'
30
- :disabled='disabled'
31
- :required='s.properties[key].required || false'
32
- :description='s.properties[key].description || ""'
33
- v-model='data[key]'
34
- />
35
- </template>
36
- <template v-else-if='s.properties[key].type === "boolean"'>
37
- <TablerToggle
38
- :label='key'
39
- :disabled='disabled'
40
- :required='s.properties[key].required || false'
41
- :description='s.properties[key].description || ""'
42
- v-model='data[key]'
43
- />
44
- </template>
45
- <template v-else-if='s.properties[key].type === "array"'>
46
- <div class='d-flex'>
47
- <label class='form-label' v-text='key'/>
48
- <div class='ms-auto'>
49
- <IconPlus v-if='!disabled' @click='push(key)' :size='32' :stroke='1' class='cursor-pointer'/>
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
- <div class='mx-2 my-2'>Entry <span v-text='i + 1'/></div>
56
- <div class='ms-auto mx-2 my-2'>
57
- <IconTrash v-if='!disabled' @click='data[key].splice(i, 1)' :size='32' :stroke='1' class='cursor-pointer'/>
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
- <GenericSchema :schema='s.properties[key].items' :disabled='disabled' v-model='data[key][i]' />
62
- </div>
63
- </template>
64
- <template v-else>
65
- <div class='row'>
66
- <TablerInput
67
- :label='key'
68
- :rows='3'
69
- :disabled='disabled'
70
- v-model='data[key]'/>
71
- </div>
72
- </template>
73
- </div>
74
- </template>
75
- </div>
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
- <TablerLabel :label='label' :description='description' :required='required'><slot/></TablerLabel>
4
- <div class='col-12 d-flex'>
5
- <div :key='color' v-for='color in Object.keys(colours)' class='border border-white rounded mx-1' style='height: 26px;'>
6
- <label class="form-colorinput">
7
- <input :disabled='disabled' v-model='current' :value='color' type="radio" class="form-colorinput-input">
8
- <span class="form-colorinput-color bg-dark rounded" :class='[
9
- `bg-${color}`
10
- ]'></span>
11
- </label>
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
- components: {
93
- TablerLabel
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>