@tak-ps/vue-tabler 3.6.0 → 3.7.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,10 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v3.7.0
14
+
15
+ - :rocket: Include `description` and `required` to `TablerSchema` and sub components
16
+
13
17
  ### v3.6.0
14
18
 
15
19
  - :rocket: Add `TablerPager` component for iterating over a list
@@ -1,17 +1,24 @@
1
1
  <template>
2
- <div>
3
- <label
4
- v-if='label'
5
- class="form-label"
6
- :class='{
7
- "required": required
8
- }'
9
- v-text='label'
10
- ></label>
11
-
12
- <select v-model='current' :disabled='disabled' class='form-select'>
13
- <option v-for='option in options' :value="option" v-text='option'></option>
14
- </select>
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
 
@@ -31,6 +38,10 @@ export default {
31
38
  type: Boolean,
32
39
  required: false
33
40
  },
41
+ description: {
42
+ type: String,
43
+ required: false
44
+ },
34
45
  options: {
35
46
  type: Array,
36
47
  required: true
@@ -5,16 +5,30 @@
5
5
  <TablerEnum
6
6
  :label='key'
7
7
  :disabled='disabled'
8
+ :required='schema.properties[key].required'
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 :label='key' :disabled='disabled' v-model='data[key]'/>
16
+ <TablerInput
17
+ :label='key'
18
+ :disabled='disabled'
19
+ :required='schema.properties[key].required'
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 :label='key' :disabled='disabled' v-model='data[key]'/>
25
+ <TablerToggle
26
+ :label='key'
27
+ :disabled='disabled'
28
+ :required='schema.properties[key].required'
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 :label='key' :rows='3' :disabled='disabled' v-model='data[key]'/>
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>
@@ -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'
@@ -32,6 +36,10 @@ export default {
32
36
  type: Boolean,
33
37
  default: false
34
38
  },
39
+ description: {
40
+ type: String,
41
+ default: false
42
+ },
35
43
  label: {
36
44
  type: String,
37
45
  default: ''
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "3.6.0",
4
+ "version": "3.7.0",
5
5
  "lib": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",