@tak-ps/vue-tabler 3.1.2 → 3.2.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 CHANGED
@@ -10,6 +10,15 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v3.2.0
14
+
15
+ - :rocket: Add `required` Property to labelled components
16
+
17
+ ### v3.1.3
18
+
19
+ - :bug: `Toggle`: Fix modelValue watch state
20
+ - :bug: `Enum`: Fix modelValue watch state
21
+
13
22
  ### v3.1.2
14
23
 
15
24
  - :rocket: `Toggle`: Increase padding between label and toggle
@@ -1,6 +1,13 @@
1
1
  <template>
2
2
  <div>
3
- <label v-if='label' class="form-label" v-text='label'></label>
3
+ <label
4
+ v-if='label'
5
+ class="form-label"
6
+ :class='{
7
+ "required": required
8
+ }'
9
+ v-text='label'
10
+ ></label>
4
11
 
5
12
  <select v-model='current' :disabled='disabled' class='form-select'>
6
13
  <option v-for='option in options' :value="option" v-text='option'></option>
@@ -10,7 +17,7 @@
10
17
 
11
18
  <script>
12
19
  export default {
13
- name: 'TablerInput',
20
+ name: 'TablerEnum',
14
21
  props: {
15
22
  modelValue: {
16
23
  type: String,
@@ -20,6 +27,10 @@ export default {
20
27
  type: String,
21
28
  required: false
22
29
  },
30
+ required: {
31
+ type: Boolean,
32
+ required: false
33
+ },
23
34
  options: {
24
35
  type: Array,
25
36
  required: true
@@ -40,6 +51,9 @@ export default {
40
51
  else this.current = this.modelValue;
41
52
  },
42
53
  watch: {
54
+ modelValue: function() {
55
+ this.current = this.modelValue;
56
+ },
43
57
  current: function() {
44
58
  if (this.current === this.modelValue) return;
45
59
  this.$emit('update:modelValue', this.current);
@@ -6,6 +6,7 @@
6
6
  <AlertCircleIcon/>
7
7
  <h3>Website Error</h3>
8
8
  <div class="text-muted" v-text='err.message'></div>
9
+ <pre v-if='err.body' v-text='err.body'></pre>
9
10
  </div>
10
11
  <div class="modal-footer">
11
12
  <div class="w-100">
@@ -1,6 +1,13 @@
1
1
  <template>
2
2
  <div>
3
- <label v-if='label' class="form-label" v-text='label'></label>
3
+ <label
4
+ v-if='label'
5
+ class="form-label"
6
+ v-text='label'
7
+ :class='{
8
+ "required": required
9
+ }'
10
+ ></label>
4
11
 
5
12
  <template v-if='!rows || rows <= 1'>
6
13
  <input :disabled='disabled' :value='modelValue' @input='event => current = event.target.value' :type='type' :class='{
@@ -24,6 +31,10 @@ export default {
24
31
  type: [String, Number],
25
32
  required: true
26
33
  },
34
+ required: {
35
+ type: Boolean,
36
+ default: false,
37
+ },
27
38
  disabled: {
28
39
  type: Boolean,
29
40
  default: false,
@@ -1,6 +1,13 @@
1
1
  <template>
2
2
  <div class="dropdown">
3
- <label class='form-label' v-text='label'></label>
3
+ <label
4
+ v-if='label'
5
+ class='form-label'
6
+ :class='{
7
+ "required": required
8
+ }'
9
+ v-text='label'
10
+ ></label>
4
11
  <div type="button" ref='button' id="list-menu-button" data-bs-toggle="dropdown" aria-expanded="false" class='border rounded' style='height: 36px;'>
5
12
  <div class='d-flex mx-2'>
6
13
  <span v-if='ele' style='padding-top: 6px;' v-text='ele[namekey]'/>
@@ -41,6 +48,10 @@ export default {
41
48
  type: String,
42
49
  default: ''
43
50
  },
51
+ required: {
52
+ type: Boolean,
53
+ default: false
54
+ },
44
55
  disabled: {
45
56
  type: Boolean,
46
57
  default: false
@@ -1,7 +1,14 @@
1
1
  <template>
2
2
  <div>
3
3
  <div class='d-flex align-items-center'>
4
- <label class='form-label my-1 mx-2' v-text='label'/>
4
+ <label
5
+ v-if='label'
6
+ class='form-label my-1 mx-2'
7
+ :class='{
8
+ "required": required
9
+ }'
10
+ v-text='label'
11
+ />
5
12
  <label class="ms-auto form-check form-switch pt-2">
6
13
  <input v-model='current' :disabled='disabled' class="form-check-input" type="checkbox">
7
14
  </label>
@@ -21,7 +28,14 @@ export default {
21
28
  type: Boolean,
22
29
  default: false
23
30
  },
24
- label: String
31
+ required: {
32
+ type: Boolean,
33
+ default: false
34
+ },
35
+ label: {
36
+ type: String,
37
+ default: ''
38
+ }
25
39
  },
26
40
  data: function() {
27
41
  return {
@@ -32,6 +46,9 @@ export default {
32
46
  this.current = this.modelValue;
33
47
  },
34
48
  watch: {
49
+ modelValue: function() {
50
+ this.current = this.modelValue;
51
+ },
35
52
  current: function() {
36
53
  if (this.current === this.modelValue) return;
37
54
  this.$emit('update:modelValue', this.current);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "3.1.2",
4
+ "version": "3.2.0",
5
5
  "lib": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",