Skip to content

Commit adbf94f

Browse files
committed
Added hive-multitext
1 parent 74925b4 commit adbf94f

File tree

4 files changed

+74
-1
lines changed

4 files changed

+74
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue3-hive-ui-kit",
33
"private": false,
4-
"version": "0.7.32",
4+
"version": "0.8.0",
55
"type": "module",
66
"description": "UI kit for Vue 3",
77
"files": [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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>

src/examples/components/all-widgets.vue

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { VueComponent } from '../../common/types/value';
3939
import hiveContextMenu from '../../components/hive-context-menu/hive-context-menu.vue';
4040
import { ContextMenuItems } from '../../components/hive-context-menu/types';
4141
import FilterNew from './components/filter-new.vue';
42+
import HiveMultitext from '@/components/hive-multitext/hive-multitext.vue';
4243
4344
const text = ref('text');
4445
const num = ref(0);
@@ -723,6 +724,8 @@ const optionsObject1 = {
723724
a: 'b',
724725
c: 'd',
725726
};
727+
728+
const multitext = ref(['1', '2', '3', '4']);
726729
</script>
727730

728731
<template>
@@ -961,6 +964,9 @@ const optionsObject1 = {
961964
<widget-wrapper title="ContextMenu" style="height: 500px">
962965
<hive-context-menu :items="contextMenuItems" @context-item-click="universalLog" />
963966
</widget-wrapper>
967+
<widget-wrapper title="HiveMultiText">
968+
<hive-multitext v-model="multitext" title="Значения" />
969+
</widget-wrapper>
964970
</div>
965971
</div>
966972

@@ -979,6 +985,7 @@ const optionsObject1 = {
979985

980986
<style scoped lang="scss">
981987
@import '@/assets/variables.scss';
988+
982989
$bg-input: black;
983990
.app {
984991
max-width: 1280px;
@@ -989,6 +996,7 @@ $bg-input: black;
989996
line-height: 1.5;
990997
font-weight: 400;
991998
}
999+
9921000
.wrapper {
9931001
display: flex;
9941002
flex-direction: column;

src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import HiveTreeView from './components/hive-tree-view/hive-tree-view.vue';
2525
import HiveTreeViewNode from './components/hive-tree-view/hive-tree-view-node.vue';
2626
import HiveUploadFile from '@/components/hive-upload-file/hive-upload-file.vue';
2727
import Notification from '@/plugins/hive-notification';
28+
import HiveMultitext from '@/components/hive-multitext/hive-multitext.vue';
2829
import { notify, useNotification } from '@/plugins/hive-notification';
2930

3031
import type { NotificationsOptions, NotificationsPluginOptions, NotificationItem } from '@/plugins/hive-notification';
@@ -79,6 +80,7 @@ export {
7980
FontAwesomeIcon,
8081
faSearch,
8182
faXmark,
83+
HiveMultitext,
8284
};
8385

8486
export type {

0 commit comments

Comments
 (0)