File tree 4 files changed +74
-1
lines changed
components/hive-multitext
4 files changed +74
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue3-hive-ui-kit" ,
3
3
"private" : false ,
4
- "version" : " 0.7.32 " ,
4
+ "version" : " 0.8.0 " ,
5
5
"type" : " module" ,
6
6
"description" : " UI kit for Vue 3" ,
7
7
"files" : [
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import { computed } from ' vue' ;
3
+ import HiveButton from ' @/components/hive-button/hive-button.vue' ;
4
+ import HiveInput from ' @/components/hive-input/hive-input.vue' ;
5
+
6
+ const props = defineProps <{
7
+ title? : string ;
8
+ modelValue: (string | number )[];
9
+ }>();
10
+
11
+ const emit = defineEmits <{
12
+ (e : ' update:modelValue' , value : (string | number )[]): void ;
13
+ }>();
14
+
15
+ const currentValue = computed ({
16
+ get() {
17
+ return props .modelValue ;
18
+ },
19
+ set(value ) {
20
+ emit (' update:modelValue' , value );
21
+ },
22
+ });
23
+
24
+ const addValue = () => {
25
+ currentValue .value .push (' ' );
26
+ };
27
+ </script >
28
+
29
+ <template >
30
+ <div class =" container" >
31
+ <slot name =" title" >
32
+ <div class =" title" v-if =" title" >{{ title }}</div >
33
+ </slot >
34
+ <div v-for =" (_, i) in currentValue" :key =" i" class =" input" >
35
+ <hive-input style =" width : 100% " v-model =" currentValue[i]!" />
36
+ <hive-button @click =" currentValue.splice(i, 1)" class =" button" >Удалить</hive-button >
37
+ </div >
38
+ <slot name =" button" :add-value =" addValue" >
39
+ <hive-button @click =" addValue" >Добавить значение</hive-button >
40
+ </slot >
41
+ </div >
42
+ </template >
43
+
44
+ <style scoped lang="scss">
45
+ .container {
46
+ display : flex ;
47
+ flex-direction : column ;
48
+ gap : 10px ;
49
+
50
+ .title {
51
+ font-size : 18px ;
52
+ }
53
+
54
+ .input {
55
+ display : flex ;
56
+ gap : 10px ;
57
+
58
+ .button {
59
+ width : 30% ;
60
+ }
61
+ }
62
+ }
63
+ </style >
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import { VueComponent } from '../../common/types/value';
39
39
import hiveContextMenu from ' ../../components/hive-context-menu/hive-context-menu.vue' ;
40
40
import { ContextMenuItems } from ' ../../components/hive-context-menu/types' ;
41
41
import FilterNew from ' ./components/filter-new.vue' ;
42
+ import HiveMultitext from ' @/components/hive-multitext/hive-multitext.vue' ;
42
43
43
44
const text = ref (' text' );
44
45
const num = ref (0 );
@@ -723,6 +724,8 @@ const optionsObject1 = {
723
724
a: ' b' ,
724
725
c: ' d' ,
725
726
};
727
+
728
+ const multitext = ref ([' 1' , ' 2' , ' 3' , ' 4' ]);
726
729
</script >
727
730
728
731
<template >
@@ -961,6 +964,9 @@ const optionsObject1 = {
961
964
<widget-wrapper title =" ContextMenu" style =" height : 500px " >
962
965
<hive-context-menu :items =" contextMenuItems" @context-item-click =" universalLog" />
963
966
</widget-wrapper >
967
+ <widget-wrapper title =" HiveMultiText" >
968
+ <hive-multitext v-model =" multitext" title =" Значения" />
969
+ </widget-wrapper >
964
970
</div >
965
971
</div >
966
972
@@ -979,6 +985,7 @@ const optionsObject1 = {
979
985
980
986
<style scoped lang="scss">
981
987
@import ' @/assets/variables.scss' ;
988
+
982
989
$bg-input : black ;
983
990
.app {
984
991
max-width : 1280px ;
@@ -989,6 +996,7 @@ $bg-input: black;
989
996
line-height : 1.5 ;
990
997
font-weight : 400 ;
991
998
}
999
+
992
1000
.wrapper {
993
1001
display : flex ;
994
1002
flex-direction : column ;
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import HiveTreeView from './components/hive-tree-view/hive-tree-view.vue';
25
25
import HiveTreeViewNode from './components/hive-tree-view/hive-tree-view-node.vue' ;
26
26
import HiveUploadFile from '@/components/hive-upload-file/hive-upload-file.vue' ;
27
27
import Notification from '@/plugins/hive-notification' ;
28
+ import HiveMultitext from '@/components/hive-multitext/hive-multitext.vue' ;
28
29
import { notify , useNotification } from '@/plugins/hive-notification' ;
29
30
30
31
import type { NotificationsOptions , NotificationsPluginOptions , NotificationItem } from '@/plugins/hive-notification' ;
@@ -79,6 +80,7 @@ export {
79
80
FontAwesomeIcon ,
80
81
faSearch ,
81
82
faXmark ,
83
+ HiveMultitext ,
82
84
} ;
83
85
84
86
export type {
You can’t perform that action at this time.
0 commit comments