@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,17 +1,28 @@
1
1
  <template>
2
- <div class='row'>
3
- <TablerLabel
4
- v-if='label'
5
- :label='label'
6
- :description='description'
7
- :required='required'
8
- ><slot/></TablerLabel>
9
- <div class='col-12'>
10
- <select v-model='current' :disabled='disabled' class='form-select'>
11
- <option :key='option' v-for='option in options' :value="option" v-text='option'></option>
12
- </select>
2
+ <div class='row'>
3
+ <TablerLabel
4
+ v-if='label'
5
+ :label='label'
6
+ :description='description'
7
+ :required='required'
8
+ >
9
+ <slot />
10
+ </TablerLabel>
11
+ <div class='col-12'>
12
+ <select
13
+ v-model='current'
14
+ :disabled='disabled'
15
+ class='form-select'
16
+ >
17
+ <option
18
+ v-for='option in options'
19
+ :key='option'
20
+ :value='option'
21
+ v-text='option'
22
+ />
23
+ </select>
24
+ </div>
13
25
  </div>
14
- </div>
15
26
  </template>
16
27
 
17
28
  <script>
@@ -19,6 +30,9 @@ import TablerLabel from '../internal/Label.vue';
19
30
 
20
31
  export default {
21
32
  name: 'TablerEnum',
33
+ components: {
34
+ TablerLabel
35
+ },
22
36
  props: {
23
37
  modelValue: {
24
38
  type: String,
@@ -46,6 +60,9 @@ export default {
46
60
  },
47
61
  label: String,
48
62
  },
63
+ emits: [
64
+ 'update:modelValue'
65
+ ],
49
66
  data: function() {
50
67
  const data = {
51
68
  current: ''
@@ -67,9 +84,6 @@ export default {
67
84
  if (this.current === this.modelValue) return;
68
85
  this.$emit('update:modelValue', this.current);
69
86
  }
70
- },
71
- components: {
72
- TablerLabel
73
87
  }
74
88
  }
75
89
  </script>
@@ -1,53 +1,82 @@
1
1
  <template>
2
- <div class='row'>
3
- <TablerLabel
4
- v-if='label'
5
- :label='label'
6
- :description='description'
7
- :required='required'
8
- ><slot/></TablerLabel>
9
- <div class='col-12'>
10
- <template v-if='!rows || rows <= 1'>
11
- <div class='input-icon'>
12
- <span v-if='icon' class="input-icon-addon">
13
- <IconSearch v-if='icon === "search"' :size='20' :stroke='1'/>
14
- <IconLock v-if='icon === "lock"' :size='20' :stroke='1'/>
15
- <IconUser v-if='icon === "user"' :size='20' :stroke='1'/>
16
- </span>
17
- <input
18
- :disabled='disabled'
2
+ <div class='row'>
3
+ <TablerLabel
4
+ v-if='label'
5
+ :label='label'
6
+ :description='description'
7
+ :required='required'
8
+ >
9
+ <slot />
10
+ </TablerLabel>
11
+ <div class='col-12'>
12
+ <template v-if='!rows || rows <= 1'>
13
+ <div class='input-icon'>
14
+ <span
15
+ v-if='icon'
16
+ class='input-icon-addon'
17
+ >
18
+ <IconSearch
19
+ v-if='icon === "search"'
20
+ :size='20'
21
+ :stroke='1'
22
+ />
23
+ <IconLock
24
+ v-if='icon === "lock"'
25
+ :size='20'
26
+ :stroke='1'
27
+ />
28
+ <IconUser
29
+ v-if='icon === "user"'
30
+ :size='20'
31
+ :stroke='1'
32
+ />
33
+ </span>
34
+ <input
35
+ v-model='current'
36
+ :disabled='disabled'
37
+ :autocomplete='autocomplete'
38
+ :type='computed_type'
39
+ :class='{
40
+ "is-invalid": errorstr
41
+ }'
42
+ class='form-control'
43
+ :placeholder='placeholder||label||""'
44
+ @keyup.enter='$emit("submit")'
45
+ >
46
+ <span
47
+ v-if='loading'
48
+ class='input-icon-addon'
49
+ >
50
+ <div
51
+ class='spinner-border spinner-border-sm text-secondary'
52
+ role='status'
53
+ />
54
+ </span>
55
+ </div>
56
+ </template>
57
+ <template v-else>
58
+ <textarea
19
59
  v-model='current'
20
- @keyup.enter='$emit("submit")'
60
+ :disabled='disabled'
61
+ :autocomplete='autocomplete'
62
+ :wrap='wrap'
63
+ :rows='rows'
21
64
  :type='computed_type'
22
65
  :class='{
23
66
  "is-invalid": errorstr
24
67
  }'
25
- class="form-control"
68
+ class='form-control'
26
69
  :placeholder='placeholder||label||""'
70
+ @keyup.enter='$emit("submit")'
27
71
  />
28
- <span v-if='loading' class="input-icon-addon">
29
- <div class="spinner-border spinner-border-sm text-secondary" role="status"></div>
30
- </span>
31
- </div>
32
- </template>
33
- <template v-else>
34
- <textarea
35
- :disabled='disabled'
36
- :wrap='wrap'
37
- :rows='rows'
38
- v-model='current'
39
- @keyup.enter='$emit("submit")'
40
- :type='computed_type'
41
- :class='{
42
- "is-invalid": errorstr
43
- }'
44
- class="form-control"
45
- :placeholder='placeholder||label||""'
72
+ </template>
73
+ <div
74
+ v-if='errorstr'
75
+ class='invalid-feedback'
76
+ v-text='errorstr'
46
77
  />
47
- </template>
48
- <div v-if='errorstr' v-text='errorstr' class="invalid-feedback"></div>
78
+ </div>
49
79
  </div>
50
- </div>
51
80
  </template>
52
81
 
53
82
  <script>
@@ -60,12 +89,21 @@ import {
60
89
 
61
90
  export default {
62
91
  name: 'TablerInput',
63
- emits: ['submit', 'update:modelValue'],
92
+ components: {
93
+ IconUser,
94
+ IconLock,
95
+ IconSearch,
96
+ TablerLabel
97
+ },
64
98
  props: {
65
99
  modelValue: {
66
100
  type: [String, Number],
67
101
  required: true
68
102
  },
103
+ autocomplete: {
104
+ type: String,
105
+ default: 'on'
106
+ },
69
107
  icon: {
70
108
  type: String,
71
109
  },
@@ -101,6 +139,7 @@ export default {
101
139
  placeholder: String,
102
140
  error: String,
103
141
  },
142
+ emits: ['submit', 'update:modelValue'],
104
143
  data: function() {
105
144
  return {
106
145
  help: false,
@@ -155,12 +194,6 @@ export default {
155
194
  this.$emit('update:modelValue', this.current);
156
195
  }
157
196
  }
158
- },
159
- components: {
160
- IconUser,
161
- IconLock,
162
- IconSearch,
163
- TablerLabel
164
197
  }
165
198
  }
166
199
  </script>
@@ -1,19 +1,25 @@
1
1
  <template>
2
- <div class='row'>
3
- <TablerLabel :label='label' :description='description' :required='required'><slot/></TablerLabel>
4
- <div class='col-12'>
5
- <input
6
- :disabled='disabled'
7
- :value='modelValue'
8
- @input='event => current = event.target.value'
9
- type='range'
10
- class='form-range'
11
- :min='min'
12
- :max='max'
13
- :step='step'
2
+ <div class='row'>
3
+ <TablerLabel
4
+ :label='label'
5
+ :description='description'
6
+ :required='required'
14
7
  >
8
+ <slot />
9
+ </TablerLabel>
10
+ <div class='col-12'>
11
+ <input
12
+ :disabled='disabled'
13
+ :value='modelValue'
14
+ type='range'
15
+ class='form-range'
16
+ :min='min'
17
+ :max='max'
18
+ :step='step'
19
+ @input='event => current = event.target.value'
20
+ >
21
+ </div>
15
22
  </div>
16
- </div>
17
23
  </template>
18
24
 
19
25
  <script>
@@ -21,6 +27,9 @@ import TablerLabel from '../internal/Label.vue';
21
27
 
22
28
  export default {
23
29
  name: 'TablerRange',
30
+ components: {
31
+ TablerLabel
32
+ },
24
33
  props: {
25
34
  modelValue: {
26
35
  type: Number,
@@ -52,6 +61,9 @@ export default {
52
61
  },
53
62
  label: String,
54
63
  },
64
+ emits: [
65
+ 'update:modelValue'
66
+ ],
55
67
  data: function() {
56
68
  return {
57
69
  help: false,
@@ -63,9 +75,6 @@ export default {
63
75
  if (this.current === this.modelValue) return;
64
76
  this.$emit('update:modelValue', Number(this.current));
65
77
  }
66
- },
67
- components: {
68
- TablerLabel
69
78
  }
70
79
  }
71
80
  </script>
@@ -1,19 +1,26 @@
1
1
  <template>
2
- <div class="dropdown">
3
- <a class="dropdown-toggle text-muted" href="#" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-text='current'></a>
4
- <div class="dropdown-menu dropdown-menu-end">
2
+ <div class='dropdown'>
5
3
  <a
6
- :key='option'
7
- v-for='option in options'
8
- @click='current = option'
9
- class="dropdown-item"
10
- :class='{
11
- active: option === current
12
- }'
13
- v-text='option'
14
- ></a>
4
+ class='dropdown-toggle text-muted'
5
+ href='#'
6
+ data-bs-toggle='dropdown'
7
+ aria-haspopup='true'
8
+ aria-expanded='false'
9
+ v-text='current'
10
+ />
11
+ <div class='dropdown-menu dropdown-menu-end'>
12
+ <a
13
+ v-for='option in options'
14
+ :key='option'
15
+ class='dropdown-item'
16
+ :class='{
17
+ active: option === current
18
+ }'
19
+ @click='current = option'
20
+ v-text='option'
21
+ />
22
+ </div>
15
23
  </div>
16
- </div>
17
24
  </template>
18
25
 
19
26
  <script>
@@ -33,6 +40,9 @@ export default {
33
40
  required: true
34
41
  },
35
42
  },
43
+ emits: [
44
+ 'update:modelValue'
45
+ ],
36
46
  data: function() {
37
47
  return {
38
48
  current: ''
@@ -1,13 +1,13 @@
1
1
  <template>
2
- <TablerEnum
3
- :label='label'
4
- :options='Array.from(timezones)'
5
- :description='description'
6
- :disabled='disabled'
7
- :required='required'
8
- :default='inverse.has(modelValue) ? inverse.get(modelValue) : "No TimeZone"'
9
- v-on:change='$emit("update:modelValue", map.get($event.target.value).tzCode)'
10
- />
2
+ <TablerEnum
3
+ :label='label'
4
+ :options='Array.from(timezones)'
5
+ :description='description'
6
+ :disabled='disabled'
7
+ :required='required'
8
+ :default='inverse.has(modelValue) ? inverse.get(modelValue) : "No TimeZone"'
9
+ @change='$emit("update:modelValue", map.get($event.target.value).tzCode)'
10
+ />
11
11
  </template>
12
12
 
13
13
  <script>
@@ -442,13 +442,17 @@ const tzs = [
442
442
 
443
443
  export default {
444
444
  name: 'TablerTimeZone',
445
+ components: {
446
+ TablerEnum
447
+ },
445
448
  props: {
446
449
  modelValue: {
447
450
  type: String,
448
451
  required: true
449
452
  },
450
453
  description: {
451
- type: String
454
+ type: String,
455
+ default: ''
452
456
  },
453
457
  required: {
454
458
  type: Boolean
@@ -462,6 +466,9 @@ export default {
462
466
  default: 'Default Timezone'
463
467
  },
464
468
  },
469
+ emits: [
470
+ 'update:modelValue'
471
+ ],
465
472
  data: function() {
466
473
  const map = new Map();
467
474
  const inverse = new Map();
@@ -478,9 +485,6 @@ export default {
478
485
  internal: this.modelValue,
479
486
  timezones: ['No TimeZone'].concat(tzs.map((tz) => tz.label))
480
487
  }
481
- },
482
- components: {
483
- TablerEnum
484
488
  }
485
489
  }
486
490
  </script>
@@ -1,11 +1,20 @@
1
1
  <template>
2
- <div>
3
- <TablerLabel :label='label' :required='required' :description='description'>
4
- <label class='form-switch'>
5
- <input v-model='current' :disabled='disabled' class="form-check-input" type="checkbox">
6
- </label>
7
- </TablerLabel>
8
- </div>
2
+ <div>
3
+ <TablerLabel
4
+ :label='label'
5
+ :required='required'
6
+ :description='description'
7
+ >
8
+ <label class='form-switch'>
9
+ <input
10
+ v-model='current'
11
+ :disabled='disabled'
12
+ class='form-check-input'
13
+ type='checkbox'
14
+ >
15
+ </label>
16
+ </TablerLabel>
17
+ </div>
9
18
  </template>
10
19
 
11
20
  <script>
@@ -13,6 +22,9 @@ import TablerLabel from '../internal/Label.vue';
13
22
 
14
23
  export default {
15
24
  name: 'TablerToggle',
25
+ components: {
26
+ TablerLabel
27
+ },
16
28
  props: {
17
29
  modelValue: {
18
30
  type: Boolean,
@@ -35,14 +47,14 @@ export default {
35
47
  default: ''
36
48
  }
37
49
  },
50
+ emits: [
51
+ 'update:modelValue'
52
+ ],
38
53
  data: function() {
39
54
  return {
40
55
  current: this.modelValue
41
56
  }
42
57
  },
43
- mounted: function() {
44
- this.current = this.modelValue;
45
- },
46
58
  watch: {
47
59
  modelValue: function() {
48
60
  this.current = this.modelValue;
@@ -52,8 +64,8 @@ export default {
52
64
  this.$emit('update:modelValue', this.current);
53
65
  }
54
66
  },
55
- components: {
56
- TablerLabel
67
+ mounted: function() {
68
+ this.current = this.modelValue;
57
69
  }
58
70
  }
59
71
  </script>
@@ -1,22 +1,38 @@
1
1
  <template>
2
- <div class='col-12 d-flex my-1'>
3
- <span v-if='description' class='align-self-center'>
4
- <IconInfoSquare @click='help = true' :size='20' :stroke='1' class='cursor-pointer'/>
5
- <Help v-if='help' @click='help = false' :label='label || placeholder' :description='description'/>
6
- </span>
7
- <div class='align-self-center'>
8
- <div
9
- v-if='label'
10
- class="px-2"
2
+ <div class='col-12 d-flex my-1'>
3
+ <span
4
+ v-if='description'
5
+ class='align-self-center'
11
6
  >
12
- <span v-text='label'/>
13
- <span v-if='required' class='text-red mx-1'>*</span>
7
+ <IconInfoSquare
8
+ :size='20'
9
+ :stroke='1'
10
+ class='cursor-pointer'
11
+ @click='help = true'
12
+ />
13
+ <Help
14
+ v-if='help'
15
+ :label='label || placeholder'
16
+ :description='description'
17
+ @click='help = false'
18
+ />
19
+ </span>
20
+ <div class='align-self-center'>
21
+ <div
22
+ v-if='label'
23
+ class='px-2'
24
+ >
25
+ <span v-text='label' />
26
+ <span
27
+ v-if='required'
28
+ class='text-red mx-1'
29
+ >*</span>
30
+ </div>
31
+ </div>
32
+ <div class='ms-auto align-self-center'>
33
+ <slot />
14
34
  </div>
15
35
  </div>
16
- <div class='ms-auto align-self-center'>
17
- <slot/>
18
- </div>
19
- </div>
20
36
  </template>
21
37
 
22
38
  <script>
@@ -27,6 +43,10 @@ import Help from '../Help.vue';
27
43
 
28
44
  export default {
29
45
  name: 'TablerInternalLabel',
46
+ components: {
47
+ Help,
48
+ IconInfoSquare
49
+ },
30
50
  props: {
31
51
  required: {
32
52
  type: Boolean,
@@ -36,16 +56,15 @@ export default {
36
56
  type: String,
37
57
  default: '',
38
58
  },
39
- label: String,
59
+ label: {
60
+ type: String,
61
+ required: true
62
+ }
40
63
  },
41
64
  data: function() {
42
65
  return {
43
66
  help: false,
44
67
  }
45
- },
46
- components: {
47
- Help,
48
- IconInfoSquare
49
68
  }
50
69
  }
51
70
  </script>
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "3.52.0",
4
+ "version": "3.53.0",
5
5
  "lib": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",
8
8
  "scripts": {
9
9
  "test": "echo \"Error: no test specified\" && exit 1",
10
- "lint": "eslint lib.js components/*.vue components/**/*.vue"
10
+ "lint": "eslint lib.js components/"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
@@ -25,8 +25,9 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@babel/eslint-parser": "^7.22.15",
28
+ "@typescript-eslint/parser": "^8.8.1",
28
29
  "@vue/cli-plugin-babel": "^5.0.8",
29
- "eslint": "^8.50.0",
30
+ "eslint": "^9.12.0",
30
31
  "eslint-plugin-vue": "^9.17.0"
31
32
  }
32
33
  }