@veritree/ui 0.19.2-1 → 0.19.2-11
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/mixins/form-control-icon.js +53 -0
- package/mixins/form-control.js +67 -0
- package/package.json +3 -3
- package/src/components/Button/VTButton.vue +5 -1
- package/src/components/Dialog/VTDialog.vue +4 -8
- package/src/components/Dialog/VTDialogClose.vue +9 -9
- package/src/components/Dialog/VTDialogContent.vue +9 -9
- package/src/components/Dialog/VTDialogFooter.vue +5 -5
- package/src/components/Dialog/VTDialogHeader.vue +8 -8
- package/src/components/Dialog/VTDialogMain.vue +8 -8
- package/src/components/Dialog/VTDialogOverlay.vue +7 -7
- package/src/components/Dialog/VTDialogTitle.vue +4 -4
- package/src/components/Disclosure/VTDisclosureDetails.vue +1 -1
- package/src/components/Drawer/VTDrawer.vue +14 -16
- package/src/components/Drawer/VTDrawerClose.vue +9 -9
- package/src/components/Drawer/VTDrawerContent.vue +8 -8
- package/src/components/Drawer/VTDrawerFooter.vue +3 -3
- package/src/components/Drawer/VTDrawerHeader.vue +4 -4
- package/src/components/Drawer/VTDrawerMain.vue +5 -5
- package/src/components/Drawer/VTDrawerOverlay.vue +6 -6
- package/src/components/Drawer/VTDrawerTitle.vue +5 -5
- package/src/components/DropdownMenu/VTDropdownMenu.vue +3 -3
- package/src/components/DropdownMenu/VTDropdownMenuContent.vue +10 -10
- package/src/components/DropdownMenu/VTDropdownMenuDivider.vue +3 -3
- package/src/components/DropdownMenu/VTDropdownMenuItem.vue +20 -9
- package/src/components/DropdownMenu/VTDropdownMenuTrigger.vue +27 -37
- package/src/components/Form/VTFormGroup.vue +5 -7
- package/src/components/Form/VTFormLabel.vue +20 -0
- package/src/components/Form/VTInput.vue +40 -0
- package/src/components/Form/VTInputIcon.vue +35 -0
- package/src/components/Form/VTInputPassword.vue +49 -0
- package/src/components/Form/VTTextarea.vue +22 -0
- package/src/components/Listbox/VTListbox.vue +5 -5
- package/src/components/Listbox/VTListboxContent.vue +15 -15
- package/src/components/Listbox/VTListboxItem.vue +13 -13
- package/src/components/Listbox/VTListboxLabel.vue +2 -2
- package/src/components/Listbox/VTListboxList.vue +4 -4
- package/src/components/Listbox/VTListboxSearch.vue +6 -6
- package/src/components/Listbox/VTListboxTrigger.vue +5 -5
- package/src/components/Popover/VTPopover.vue +3 -3
- package/src/components/Popover/VTPopoverContent.vue +13 -13
- package/src/components/Popover/VTPopoverDivider.vue +3 -3
- package/src/components/Popover/VTPopoverItem.vue +8 -4
- package/src/components/Popover/VTPopoverTrigger.vue +21 -16
- package/src/components/Tabs/VTTab.vue +9 -10
- package/src/components/Tabs/VTTabGroup.vue +9 -7
- package/src/components/Tabs/VTTabPanel.vue +3 -4
- package/src/components/Transitions/FadeInOut.vue +2 -2
- package/package-lock.json +0 -13
- package/src/components/Modal/VTModal.vue +0 -69
- package/src/utils/genId.js +0 -13
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export default {
|
|
9
9
|
name: 'VTDrawerFooter',
|
|
10
10
|
|
|
11
|
-
inject: ['
|
|
11
|
+
inject: ['apiDrawer'],
|
|
12
12
|
|
|
13
13
|
props: {
|
|
14
14
|
as: {
|
|
@@ -19,11 +19,11 @@ export default {
|
|
|
19
19
|
|
|
20
20
|
computed: {
|
|
21
21
|
dark() {
|
|
22
|
-
return this.
|
|
22
|
+
return this.apiDrawer().isDark;
|
|
23
23
|
},
|
|
24
24
|
|
|
25
25
|
headless() {
|
|
26
|
-
return this.
|
|
26
|
+
return this.apiDrawer().isHeadless;
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
};
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export default {
|
|
16
16
|
name: 'VTDrawerHeader',
|
|
17
17
|
|
|
18
|
-
inject: ['
|
|
18
|
+
inject: ['apiDrawer'],
|
|
19
19
|
|
|
20
20
|
props: {
|
|
21
21
|
as: {
|
|
@@ -26,15 +26,15 @@ export default {
|
|
|
26
26
|
|
|
27
27
|
computed: {
|
|
28
28
|
dark() {
|
|
29
|
-
return this.
|
|
29
|
+
return this.apiDrawer().isDark;
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
headless() {
|
|
33
|
-
return this.
|
|
33
|
+
return this.apiDrawer().isHeadless;
|
|
34
34
|
},
|
|
35
35
|
|
|
36
36
|
id() {
|
|
37
|
-
return `${this.
|
|
37
|
+
return `${this.apiDrawer().id}-header`;
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
};
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
export default {
|
|
13
13
|
name: 'VTDrawerMain',
|
|
14
14
|
|
|
15
|
-
inject: ['
|
|
15
|
+
inject: ['apiDrawer'],
|
|
16
16
|
|
|
17
17
|
props: {
|
|
18
18
|
as: {
|
|
@@ -23,15 +23,15 @@ export default {
|
|
|
23
23
|
|
|
24
24
|
computed: {
|
|
25
25
|
dark() {
|
|
26
|
-
return this.
|
|
26
|
+
return this.apiDrawer().isDark;
|
|
27
27
|
},
|
|
28
28
|
|
|
29
29
|
headless() {
|
|
30
|
-
return this.
|
|
30
|
+
return this.apiDrawer().isHeadless;
|
|
31
31
|
},
|
|
32
32
|
|
|
33
33
|
id() {
|
|
34
|
-
return `${this.
|
|
34
|
+
return `${this.apiDrawer().id}-desc`;
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
|
|
@@ -42,7 +42,7 @@ export default {
|
|
|
42
42
|
methods: {
|
|
43
43
|
// In here because if there is no body, the dialog will not be described by
|
|
44
44
|
setDialogDescribedby() {
|
|
45
|
-
const dialog = document.getElementById(this.
|
|
45
|
+
const dialog = document.getElementById(this.apiDrawer().id);
|
|
46
46
|
|
|
47
47
|
if (dialog) {
|
|
48
48
|
dialog.setAttribute('aria-describedby', this.id);
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script>
|
|
15
|
-
import FadeInOut from
|
|
15
|
+
import FadeInOut from '../Transitions/FadeInOut.vue';
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
18
|
components: {
|
|
19
19
|
FadeInOut,
|
|
20
20
|
},
|
|
21
21
|
|
|
22
|
-
inject: [
|
|
22
|
+
inject: ['apiDrawer'],
|
|
23
23
|
|
|
24
24
|
data() {
|
|
25
25
|
return {
|
|
@@ -29,21 +29,21 @@ export default {
|
|
|
29
29
|
|
|
30
30
|
computed: {
|
|
31
31
|
dark() {
|
|
32
|
-
return this.
|
|
32
|
+
return this.apiDrawer().isDark;
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
headless() {
|
|
36
|
-
return this.
|
|
36
|
+
return this.apiDrawer().isHeadless;
|
|
37
37
|
},
|
|
38
38
|
|
|
39
39
|
id() {
|
|
40
|
-
return `${this.
|
|
40
|
+
return `${this.apiDrawer().id}-overlay`;
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
|
|
44
44
|
mounted() {
|
|
45
45
|
this.visible = true;
|
|
46
|
-
this.
|
|
46
|
+
this.apiDrawer().registerOverlay(this);
|
|
47
47
|
},
|
|
48
48
|
|
|
49
49
|
methods: {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export default {
|
|
16
16
|
name: 'VTDrawerTitle',
|
|
17
17
|
|
|
18
|
-
inject: ['
|
|
18
|
+
inject: ['apiDrawer'],
|
|
19
19
|
|
|
20
20
|
props: {
|
|
21
21
|
as: {
|
|
@@ -26,15 +26,15 @@ export default {
|
|
|
26
26
|
|
|
27
27
|
computed: {
|
|
28
28
|
dark() {
|
|
29
|
-
return this.
|
|
29
|
+
return this.apiDrawer().isDark;
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
headless() {
|
|
33
|
-
return this.
|
|
33
|
+
return this.apiDrawer().isHeadless;
|
|
34
34
|
},
|
|
35
35
|
|
|
36
36
|
id() {
|
|
37
|
-
return `${this.
|
|
37
|
+
return `${this.apiDrawer().id}-title`;
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
methods: {
|
|
46
46
|
// In here because if there is no header, the dialog will not be labelled by
|
|
47
47
|
setDialogLabelledby() {
|
|
48
|
-
const dialog = document.getElementById(this.
|
|
48
|
+
const dialog = document.getElementById(this.apiDrawer().id);
|
|
49
49
|
|
|
50
50
|
if (dialog) {
|
|
51
51
|
dialog.setAttribute('aria-labelledby', this.id);
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
import { genId } from
|
|
8
|
+
import { genId } from '../../utils/ids';
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
|
-
name:
|
|
11
|
+
name: 'VTDropdownMenu',
|
|
12
12
|
|
|
13
13
|
provide() {
|
|
14
14
|
return {
|
|
15
|
-
|
|
15
|
+
apiDropdownMenu: () => {
|
|
16
16
|
const { dark: isDark, headless: isHeadless, right: isRight } = this;
|
|
17
17
|
const { id, trigger, content, items } = this;
|
|
18
18
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<transition
|
|
3
3
|
enter-active-class="duration-200 ease-out"
|
|
4
|
-
enter-class="translate-y-[15px] opacity-0"
|
|
4
|
+
enter-from-class="translate-y-[15px] opacity-0"
|
|
5
5
|
enter-to-class="translate-y-0 opacity-100"
|
|
6
6
|
leave-active-class="duration-200 ease-in"
|
|
7
|
-
leave-class="translate-y-0 opacity-100"
|
|
7
|
+
leave-from-class="translate-y-0 opacity-100"
|
|
8
8
|
leave-to-class="translate-y-[15px] opacity-0"
|
|
9
9
|
@after-leave="hide"
|
|
10
10
|
>
|
|
@@ -32,7 +32,7 @@ import { genId } from '../../utils/ids';
|
|
|
32
32
|
export default {
|
|
33
33
|
name: 'VTDropdownMenuContent',
|
|
34
34
|
|
|
35
|
-
inject: ['
|
|
35
|
+
inject: ['apiDropdownMenu'],
|
|
36
36
|
|
|
37
37
|
data() {
|
|
38
38
|
return {
|
|
@@ -43,30 +43,30 @@ export default {
|
|
|
43
43
|
|
|
44
44
|
computed: {
|
|
45
45
|
dark() {
|
|
46
|
-
return this.
|
|
46
|
+
return this.apiDropdownMenu().isDark;
|
|
47
47
|
},
|
|
48
48
|
|
|
49
49
|
headless() {
|
|
50
|
-
return this.
|
|
50
|
+
return this.apiDropdownMenu().isHeadless;
|
|
51
51
|
},
|
|
52
52
|
|
|
53
53
|
right() {
|
|
54
|
-
return this.
|
|
54
|
+
return this.apiDropdownMenu().isRight;
|
|
55
55
|
},
|
|
56
56
|
|
|
57
57
|
trigger() {
|
|
58
|
-
return this.
|
|
58
|
+
return this.apiDropdownMenu().trigger;
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
|
|
62
62
|
mounted() {
|
|
63
|
-
this.
|
|
63
|
+
this.apiDropdownMenu().registerContent(this);
|
|
64
64
|
|
|
65
65
|
this.$nextTick(() => {
|
|
66
66
|
if (this.trigger) this.trigger.toggleHasPopup();
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
//
|
|
69
|
+
// T-79 Create a directive or mixin for this
|
|
70
70
|
document.addEventListener('click', (e) => {
|
|
71
71
|
e.stopPropagation();
|
|
72
72
|
if (this.visible && !this.$el.contains(e.target)) this.trigger.onClick();
|
|
@@ -87,7 +87,7 @@ export default {
|
|
|
87
87
|
hide() {
|
|
88
88
|
this.visible = false;
|
|
89
89
|
this.$emit('hidden');
|
|
90
|
-
this.
|
|
90
|
+
this.apiDropdownMenu().unregisterItems();
|
|
91
91
|
},
|
|
92
92
|
},
|
|
93
93
|
};
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
export default {
|
|
14
14
|
name: 'VTDropdownMenuDivider',
|
|
15
15
|
|
|
16
|
-
inject: ['
|
|
16
|
+
inject: ['apiDropdownMenu'],
|
|
17
17
|
|
|
18
18
|
computed: {
|
|
19
19
|
dark() {
|
|
20
|
-
return this.
|
|
20
|
+
return this.apiDropdownMenu().isDark;
|
|
21
21
|
},
|
|
22
22
|
|
|
23
23
|
headless() {
|
|
24
|
-
return this.
|
|
24
|
+
return this.apiDropdownMenu().isHeadless;
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
};
|
|
@@ -33,7 +33,7 @@ import { genId } from '../../utils/ids';
|
|
|
33
33
|
export default {
|
|
34
34
|
name: 'VTDropdownMenuItem',
|
|
35
35
|
|
|
36
|
-
inject: ['
|
|
36
|
+
inject: ['apiDropdownMenu'],
|
|
37
37
|
|
|
38
38
|
props: {
|
|
39
39
|
to: {
|
|
@@ -60,19 +60,23 @@ export default {
|
|
|
60
60
|
|
|
61
61
|
computed: {
|
|
62
62
|
dark() {
|
|
63
|
-
return this.
|
|
63
|
+
return this.apiDropdownMenu().isDark;
|
|
64
64
|
},
|
|
65
65
|
|
|
66
66
|
headless() {
|
|
67
|
-
return this.
|
|
67
|
+
return this.apiDropdownMenu().isHeadless;
|
|
68
68
|
},
|
|
69
69
|
|
|
70
70
|
as() {
|
|
71
|
-
return this.href
|
|
71
|
+
return this.href
|
|
72
|
+
? 'a'
|
|
73
|
+
: this.to
|
|
74
|
+
? resolveComponent('NuxtLink')
|
|
75
|
+
: 'button';
|
|
72
76
|
},
|
|
73
77
|
|
|
74
78
|
items() {
|
|
75
|
-
return this.
|
|
79
|
+
return this.apiDropdownMenu().items;
|
|
76
80
|
},
|
|
77
81
|
|
|
78
82
|
el() {
|
|
@@ -80,11 +84,11 @@ export default {
|
|
|
80
84
|
},
|
|
81
85
|
|
|
82
86
|
trigger() {
|
|
83
|
-
return this.
|
|
87
|
+
return this.apiDropdownMenu().trigger;
|
|
84
88
|
},
|
|
85
89
|
|
|
86
90
|
content() {
|
|
87
|
-
return this.
|
|
91
|
+
return this.apiDropdownMenu().content;
|
|
88
92
|
},
|
|
89
93
|
},
|
|
90
94
|
|
|
@@ -94,7 +98,7 @@ export default {
|
|
|
94
98
|
el: this.el,
|
|
95
99
|
};
|
|
96
100
|
|
|
97
|
-
this.
|
|
101
|
+
this.apiDropdownMenu().registerItem(item);
|
|
98
102
|
|
|
99
103
|
this.index = this.items.length - 1;
|
|
100
104
|
},
|
|
@@ -160,9 +164,16 @@ export default {
|
|
|
160
164
|
this.leaveMenu();
|
|
161
165
|
},
|
|
162
166
|
|
|
163
|
-
onClick() {
|
|
167
|
+
onClick(ev) {
|
|
164
168
|
if (this.disabled) return;
|
|
165
169
|
|
|
170
|
+
// Nuxtlink doesn't understand enter as a click
|
|
171
|
+
// so, we need to force it here
|
|
172
|
+
if (ev.key === 'Enter') {
|
|
173
|
+
ev.target.click();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
166
177
|
this.$emit('click');
|
|
167
178
|
this.$nextTick(() => this.leaveMenu());
|
|
168
179
|
},
|
|
@@ -15,32 +15,25 @@
|
|
|
15
15
|
export default {
|
|
16
16
|
name: 'VTDropdownMenuTrigger',
|
|
17
17
|
|
|
18
|
-
inject: ['
|
|
18
|
+
inject: ['apiDropdownMenu'],
|
|
19
19
|
|
|
20
20
|
data() {
|
|
21
21
|
return {
|
|
22
|
+
trigger: null,
|
|
22
23
|
expanded: false,
|
|
23
|
-
hasPopup: false,
|
|
24
24
|
controls: null,
|
|
25
|
+
hasPopup: false,
|
|
25
26
|
};
|
|
26
27
|
},
|
|
27
28
|
|
|
28
29
|
computed: {
|
|
29
30
|
// gets slot element
|
|
30
|
-
slotElm() {
|
|
31
|
-
return this.$slots.default[0].elm;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
slotLength() {
|
|
35
|
-
return this.$slots.default.length;
|
|
36
|
-
},
|
|
37
|
-
|
|
38
31
|
content() {
|
|
39
|
-
return this.
|
|
32
|
+
return this.apiDropdownMenu().content;
|
|
40
33
|
},
|
|
41
34
|
|
|
42
35
|
items() {
|
|
43
|
-
return this.
|
|
36
|
+
return this.apiDropdownMenu().items;
|
|
44
37
|
},
|
|
45
38
|
|
|
46
39
|
firstMenuItem() {
|
|
@@ -53,35 +46,32 @@ export default {
|
|
|
53
46
|
},
|
|
54
47
|
|
|
55
48
|
mounted() {
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
49
|
+
this.apiDropdownMenu().registerTrigger(this);
|
|
50
|
+
this.setTrigger();
|
|
51
|
+
this.addTriggerEvents();
|
|
58
52
|
},
|
|
59
53
|
|
|
60
54
|
destroyed() {
|
|
61
|
-
this.
|
|
55
|
+
this.trigger.removeEventListener('click', this.onClick());
|
|
62
56
|
},
|
|
63
57
|
|
|
64
58
|
methods: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.slotElm.addEventListener('click', (e) => {
|
|
83
|
-
e.stopImmediatePropagation();
|
|
84
|
-
this.onClick();
|
|
59
|
+
setTrigger() {
|
|
60
|
+
this.trigger = this.$el.querySelector(':first-child');
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
addTriggerEvents() {
|
|
64
|
+
this.trigger.addEventListener('click', (e) => {
|
|
65
|
+
if (this.expanded) {
|
|
66
|
+
this.onClick();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// delay stop propagation to close other visible
|
|
71
|
+
// dropdowns and delay click event to control
|
|
72
|
+
// this dropdown visibility
|
|
73
|
+
setTimeout(() => e.stopImmediatePropagation(), 50);
|
|
74
|
+
setTimeout(() => this.onClick(), 100);
|
|
85
75
|
});
|
|
86
76
|
},
|
|
87
77
|
|
|
@@ -99,9 +89,9 @@ export default {
|
|
|
99
89
|
* Focus slot element if it exists and toggle expanded
|
|
100
90
|
*/
|
|
101
91
|
focus() {
|
|
102
|
-
if (!this.
|
|
92
|
+
if (!this.trigger) return;
|
|
103
93
|
|
|
104
|
-
this.
|
|
94
|
+
this.trigger.focus();
|
|
105
95
|
this.toggleExpanded();
|
|
106
96
|
},
|
|
107
97
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component :is="as" :class="
|
|
2
|
+
<component :is="as" :class="[headless ? 'form-control' : 'mt-3']">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</component>
|
|
5
5
|
</template>
|
|
@@ -11,12 +11,10 @@ export default {
|
|
|
11
11
|
type: String,
|
|
12
12
|
default: 'div',
|
|
13
13
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
classes: {},
|
|
19
|
-
};
|
|
14
|
+
headless: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
20
18
|
},
|
|
21
19
|
};
|
|
22
20
|
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<label
|
|
3
|
+
:class="[
|
|
4
|
+
headless ? 'form-label' : 'font-semibold mb-1 flex justify-between gap-3',
|
|
5
|
+
]"
|
|
6
|
+
>
|
|
7
|
+
<slot />
|
|
8
|
+
</label>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
props: {
|
|
14
|
+
headless: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<input
|
|
3
|
+
:class="classComputed"
|
|
4
|
+
:value="modelValue"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
v-bind="attrsComputed"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { formControlMixin } from '../../../mixins/form-control';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
mixins: [formControlMixin],
|
|
15
|
+
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
name: 'input',
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
/* input[type='date']::-webkit-inner-spin-button,
|
|
26
|
+
input[type='date']::-webkit-calendar-picker-indicator {
|
|
27
|
+
position: absolute;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
} */
|
|
30
|
+
|
|
31
|
+
input[type='number'] {
|
|
32
|
+
appearance: textfield;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
input[type='number']::-webkit-inner-spin-button,
|
|
36
|
+
input[type='number']::-webkit-outer-spin-button {
|
|
37
|
+
appearance: none;
|
|
38
|
+
-webkit-appearance: none;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classComputedWrapper">
|
|
3
|
+
<input
|
|
4
|
+
:class="classComputed"
|
|
5
|
+
:value="value"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
v-bind="attrsComputed"
|
|
8
|
+
/>
|
|
9
|
+
<div :class="classComputedWrapperIcon">
|
|
10
|
+
<component :is="icon" class="h-5 w-5" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import { formControlIconMixin } from '../../../mixins/form-control-icon';
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: 'VTInputIcon',
|
|
20
|
+
|
|
21
|
+
mixins: [formControlIconMixin],
|
|
22
|
+
|
|
23
|
+
props: {
|
|
24
|
+
icon: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: null,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
iconPlacement: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'left',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classComputedWrapper">
|
|
3
|
+
<input
|
|
4
|
+
:class="classComputed"
|
|
5
|
+
:value="modelValue"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
:type="reveal ? 'text' : 'password'"
|
|
8
|
+
v-bind="attrsComputed"
|
|
9
|
+
/>
|
|
10
|
+
<div :class="classComputedWrapperIcon">
|
|
11
|
+
<VTButton
|
|
12
|
+
v-show="modelValue.length"
|
|
13
|
+
variant="icon"
|
|
14
|
+
@click="reveal = !reveal"
|
|
15
|
+
>
|
|
16
|
+
<component :is="iconVisibility" class="h-5 w-5" />
|
|
17
|
+
</VTButton>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import { formControlIconMixin } from '../../../mixins/form-control-icon';
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: 'VTInputPassword',
|
|
27
|
+
|
|
28
|
+
mixins: [formControlIconMixin],
|
|
29
|
+
|
|
30
|
+
props: {
|
|
31
|
+
iconPlacement: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'right',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
reveal: false,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
computed: {
|
|
44
|
+
iconVisibility() {
|
|
45
|
+
return this.reveal ? 'IconVisibilityOn' : 'IconVisibilityOff';
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<textarea
|
|
3
|
+
:class="classComputed"
|
|
4
|
+
:value="value"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
v-bind="attrsComputed"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { formControlMixin } from '../../../mixins/form-control';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
mixins: [formControlMixin],
|
|
15
|
+
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
name: 'textarea',
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
</script>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
import { genId } from
|
|
8
|
+
import { genId } from '../../utils/ids';
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
|
-
name:
|
|
11
|
+
name: 'VTListbox',
|
|
12
12
|
|
|
13
13
|
provide() {
|
|
14
14
|
return {
|
|
15
|
-
|
|
15
|
+
apiListbox: () => {
|
|
16
16
|
const { dark: isDark, right: isRight } = this;
|
|
17
17
|
const { id, listbox, trigger, content, search, list, items } = this;
|
|
18
18
|
|
|
@@ -47,8 +47,8 @@ export default {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const emit = (value) => {
|
|
50
|
-
this.$emit(
|
|
51
|
-
this.$emit(
|
|
50
|
+
this.$emit('input', value);
|
|
51
|
+
this.$emit('change', value);
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
return {
|