plugin-ui-for-kzt 0.0.25 → 0.0.28
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/dist/components/BaseButton/BaseButton.vue.d.ts +9 -0
- package/dist/components/BaseCalendar/BaseCalendar.vue.d.ts +10 -1
- package/dist/components/BaseInput/BaseInput.vue.d.ts +1 -1
- package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +10 -3
- package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +1 -1
- package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +1 -1
- package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +1 -1
- package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +8 -1
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +3 -3
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +1 -1
- package/dist/components/BaseTooltip/BaseTooltip.vue.d.ts +2 -2
- package/dist/index.js +1 -1
- package/example/App.vue +14 -199
- package/package.json +1 -1
- package/src/components/BaseButton/BaseButton.vue +30 -1
- package/src/components/BaseCalendar/BaseCalendar.vue +2 -0
- package/src/components/BaseDefaultPages/BaseDefaultPages.vue +9 -1
- package/src/components/BaseSelect/BaseSelect.vue +1 -0
- package/src/images.d.ts +24 -0
- package/src/types/button.d.ts +1 -1
- package/src/types/calendar.d.ts +1 -0
package/example/App.vue
CHANGED
|
@@ -2,210 +2,18 @@
|
|
|
2
2
|
<div class="demo-page">
|
|
3
3
|
<h1>Plugin UI KZT - Компоненты</h1>
|
|
4
4
|
<section>
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@update:selected="onUpdateSelected"
|
|
12
|
-
/>
|
|
13
|
-
</section>
|
|
14
|
-
<section>
|
|
15
|
-
<BaseTable
|
|
16
|
-
:data="rows"
|
|
17
|
-
:columns="columns2"
|
|
18
|
-
:actions="actions"
|
|
19
|
-
:pagination="{ totalPages: 5 }"
|
|
20
|
-
show-row-selection
|
|
21
|
-
show-actions
|
|
22
|
-
@update:selected="onUpdateSelected"
|
|
23
|
-
/>
|
|
24
|
-
</section>
|
|
25
|
-
<section>
|
|
26
|
-
<BaseTable
|
|
27
|
-
:columns="columns"
|
|
28
|
-
:data="people"
|
|
29
|
-
:pagination="{ perPage: 5, size: 'small' }"
|
|
30
|
-
show-row-selection
|
|
31
|
-
checkbox-title="Выбрать"
|
|
32
|
-
show-actions
|
|
33
|
-
:actions="rowActions"
|
|
34
|
-
@update:selected="onRowsSelected"
|
|
35
|
-
@sort-change="onSort"
|
|
36
|
-
@page-change="onPage"
|
|
37
|
-
>
|
|
38
|
-
<template #header>
|
|
39
|
-
<tr>
|
|
40
|
-
<th>
|
|
41
|
-
<BaseCheckbox
|
|
42
|
-
v-model="selectAll"
|
|
43
|
-
id="selectAll"
|
|
44
|
-
/>
|
|
45
|
-
</th>
|
|
46
|
-
<th v-for="col in columns" :key="col.key">
|
|
47
|
-
<div>
|
|
48
|
-
<component v-if="col.icons?.[0]" :is="col.icons[0]" />
|
|
49
|
-
<span>{{ col.label }}</span>
|
|
50
|
-
<BaseIcon
|
|
51
|
-
:name="sortOrder === 'asc' ? 'arrow-up' : 'arrow-down'"
|
|
52
|
-
size="extra-small"
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
</th>
|
|
56
|
-
|
|
57
|
-
<th>Действия</th>
|
|
58
|
-
</tr>
|
|
59
|
-
</template>
|
|
60
|
-
<template #cell-country="{ row, value }">
|
|
61
|
-
<span>{{ value }}</span>
|
|
62
|
-
<BaseIcon v-if="row.country === 'Россия'" name="RU" size="extra-small" />
|
|
63
|
-
</template>
|
|
64
|
-
|
|
65
|
-
<template #row-menu="{ row }: Row">
|
|
66
|
-
<BaseDropdown
|
|
67
|
-
v-model="row.dropdownVisible"
|
|
68
|
-
parent-width
|
|
69
|
-
transition-name="top"
|
|
70
|
-
auto-close
|
|
71
|
-
>
|
|
72
|
-
<template #top>
|
|
73
|
-
<BaseButton
|
|
74
|
-
color="quaternary"
|
|
75
|
-
size="extra-small"
|
|
76
|
-
>
|
|
77
|
-
<BaseIcon
|
|
78
|
-
name="ellipsis"
|
|
79
|
-
size="small"
|
|
80
|
-
/>
|
|
81
|
-
</BaseButton>
|
|
82
|
-
</template>
|
|
83
|
-
<template #dropdown>
|
|
84
|
-
<div style="display: flex; flex-direction: column; gap: 8px; padding: 8px; text-align: left;">
|
|
85
|
-
<div @click="edit(row)">Редактировать</div>
|
|
86
|
-
<div @click="remove(row)">Удалить</div>
|
|
87
|
-
</div>
|
|
88
|
-
</template>
|
|
89
|
-
</BaseDropdown>
|
|
90
|
-
</template>
|
|
91
|
-
|
|
92
|
-
<template #empty>
|
|
93
|
-
<div>Нет записей</div>
|
|
94
|
-
</template>
|
|
95
|
-
|
|
96
|
-
</BaseTable>
|
|
5
|
+
<BaseDefaultPages
|
|
6
|
+
title="TUIELT"
|
|
7
|
+
description="DEGASG"
|
|
8
|
+
buttonText="Butootn"
|
|
9
|
+
type="tech-work"
|
|
10
|
+
/>
|
|
97
11
|
</section>
|
|
98
12
|
</div>
|
|
99
13
|
</template>
|
|
100
14
|
<script setup lang="ts">
|
|
101
|
-
import { ref } from 'vue'
|
|
102
|
-
import type { Column, Action, Row } from '../src/types/table'
|
|
15
|
+
import { ref, watch, computed } from 'vue'
|
|
103
16
|
|
|
104
|
-
interface Person {
|
|
105
|
-
id: string
|
|
106
|
-
name: string
|
|
107
|
-
country: string
|
|
108
|
-
dropdownVisible: boolean
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/* ---------- Данные ---------- */
|
|
112
|
-
const people = ref<Person[]>([
|
|
113
|
-
{ id: '1', name: 'Иван', country: 'Россия', dropdownVisible: false },
|
|
114
|
-
{ id: '2', name: 'Иван 2', country: 'США', dropdownVisible: false },
|
|
115
|
-
{ id: '3', name: 'Maria', country: 'Бразилия', dropdownVisible: false },
|
|
116
|
-
])
|
|
117
|
-
|
|
118
|
-
const sortOrder = ref('asc')
|
|
119
|
-
|
|
120
|
-
/* ---------- Колонки ---------- */
|
|
121
|
-
const columns: Column[] = [
|
|
122
|
-
{ key: 'name', label: 'Имя', sortable: true, dropdownVisible: false },
|
|
123
|
-
{
|
|
124
|
-
key: 'country',
|
|
125
|
-
label: 'Страна',
|
|
126
|
-
sortable: true,
|
|
127
|
-
dropdownVisible: false,
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
|
|
131
|
-
/* ---------- Действия в колонке "actions" ---------- */
|
|
132
|
-
const rowActions: Action[] = [
|
|
133
|
-
{
|
|
134
|
-
key: 'delete',
|
|
135
|
-
icon: 'trash',
|
|
136
|
-
handler: (row: Row) => console.log('Удаляем', row)
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
key: 'help',
|
|
140
|
-
icon: 'help',
|
|
141
|
-
handler: (row: Row) => console.log('Редактируем', row)
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
|
|
145
|
-
interface UserRow {
|
|
146
|
-
id: string
|
|
147
|
-
name: string
|
|
148
|
-
age: number
|
|
149
|
-
disabled?: boolean
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/* Данные */
|
|
153
|
-
const rows: UserRow[] = [
|
|
154
|
-
{ id: '1', name: 'Иван', age: 30, disabled: true },
|
|
155
|
-
{ id: '2', name: 'Мария', age: 25 },
|
|
156
|
-
{ id: '3', name: 'Мария 2', age: 21 },
|
|
157
|
-
{ id: '4', name: 'Иван 1', age: 30 },
|
|
158
|
-
{ id: '5', name: 'Мария 3', age: 25 },
|
|
159
|
-
{ id: '6', name: 'Мария 4', age: 21 },
|
|
160
|
-
{ id: '7', name: 'Иван 2', age: 30 },
|
|
161
|
-
{ id: '8', name: 'Мария 5', age: 25 },
|
|
162
|
-
{ id: '9', name: 'Мария 6', age: 21 },
|
|
163
|
-
]
|
|
164
|
-
|
|
165
|
-
/* Колонки. icons может быть пустым массивом – теперь тип валиден */
|
|
166
|
-
const columns2 = [
|
|
167
|
-
{ key: 'name', label: 'Имя', icons: [] },
|
|
168
|
-
{ key: 'age', label: 'Возраст', sortable: true, icons: [] },
|
|
169
|
-
]
|
|
170
|
-
const columns3 = [
|
|
171
|
-
{ key: 'name', label: 'Имя', icons: [] },
|
|
172
|
-
{ key: 'age', label: 'Возраст', sortable: true, icons: [] },
|
|
173
|
-
]
|
|
174
|
-
|
|
175
|
-
/* Действия */
|
|
176
|
-
const actions = [
|
|
177
|
-
{
|
|
178
|
-
key: 'edit-table',
|
|
179
|
-
icon: 'edit-table',
|
|
180
|
-
handler: (row: UserRow) => console.log('Edit', row),
|
|
181
|
-
},
|
|
182
|
-
]
|
|
183
|
-
|
|
184
|
-
function onUpdateSelected(selected: UserRow[]) {
|
|
185
|
-
console.log('Выбрано строк:', selected)
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/* ---------- События ---------- */
|
|
189
|
-
function onRowsSelected(selected: Person[]) {
|
|
190
|
-
console.log('Выбрано строк:', selected)
|
|
191
|
-
}
|
|
192
|
-
function onSort(payload: { key: keyof Person; order: 'asc' | 'desc' }) {
|
|
193
|
-
console.log('Сортировка', payload)
|
|
194
|
-
}
|
|
195
|
-
function onPage(page: number) {
|
|
196
|
-
console.log('Переходим на страницу', page)
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/* ---------- Управление чек‑боксом "select all" (если понадобится) ---------- */
|
|
200
|
-
const selectAll = ref(false);
|
|
201
|
-
|
|
202
|
-
const edit = (row: Row) => {
|
|
203
|
-
console.log('click edit', row)
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const remove = (row: Row) => {
|
|
207
|
-
console.log('click remove', row)
|
|
208
|
-
}
|
|
209
17
|
</script>
|
|
210
18
|
|
|
211
19
|
<style lang="scss" scoped>
|
|
@@ -245,4 +53,11 @@ const remove = (row: Row) => {
|
|
|
245
53
|
overflow-x: auto;
|
|
246
54
|
}
|
|
247
55
|
}
|
|
56
|
+
|
|
57
|
+
.table-data__cell-actions {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: var(--spacing-xs);
|
|
61
|
+
justify-content: flex-end;
|
|
62
|
+
}
|
|
248
63
|
</style>
|
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ const props = withDefaults(defineProps<ICoreButtonProps>(), {
|
|
|
30
30
|
tag: 'button',
|
|
31
31
|
color: 'primary',
|
|
32
32
|
size: 'medium',
|
|
33
|
+
onlyIcon: false,
|
|
33
34
|
});
|
|
34
35
|
|
|
35
36
|
const { componentTag, interactiveClassList } = useKitInteractive(props);
|
|
@@ -64,6 +65,7 @@ const classList = computed(() => [
|
|
|
64
65
|
colorClassList.value,
|
|
65
66
|
stateClassList.value,
|
|
66
67
|
styleClassList.value,
|
|
68
|
+
{ 'base-button--only-icon': props.onlyIcon }
|
|
67
69
|
]);
|
|
68
70
|
</script>
|
|
69
71
|
|
|
@@ -72,6 +74,8 @@ const classList = computed(() => [
|
|
|
72
74
|
@import '@/styles/root';
|
|
73
75
|
|
|
74
76
|
.base-button {
|
|
77
|
+
$button: &;
|
|
78
|
+
|
|
75
79
|
@include reset-button;
|
|
76
80
|
@include is-disabled-state;
|
|
77
81
|
|
|
@@ -83,7 +87,12 @@ const classList = computed(() => [
|
|
|
83
87
|
appearance: none;
|
|
84
88
|
cursor: pointer;
|
|
85
89
|
user-select: none;
|
|
86
|
-
transition:
|
|
90
|
+
transition:
|
|
91
|
+
background-color var(--transition),
|
|
92
|
+
color var(--transition),
|
|
93
|
+
border-color var(--transition),
|
|
94
|
+
box-shadow var(--transition),
|
|
95
|
+
opacity var(--transition);
|
|
87
96
|
|
|
88
97
|
|
|
89
98
|
&.--is-loading {
|
|
@@ -105,6 +114,11 @@ const classList = computed(() => [
|
|
|
105
114
|
font: var(--typography-text-s-medium);
|
|
106
115
|
border-radius: var(--corner-radius-xs);
|
|
107
116
|
|
|
117
|
+
#{$button}--only-icon {
|
|
118
|
+
padding: 0;
|
|
119
|
+
width: 32px;
|
|
120
|
+
}
|
|
121
|
+
|
|
108
122
|
.loader__circle-icon {
|
|
109
123
|
width: 20px;
|
|
110
124
|
height: 20px;
|
|
@@ -118,6 +132,11 @@ const classList = computed(() => [
|
|
|
118
132
|
font: var(--typography-text-m-medium);
|
|
119
133
|
border-radius: var(--corner-radius-s);
|
|
120
134
|
|
|
135
|
+
#{$button}--only-icon {
|
|
136
|
+
padding: 0;
|
|
137
|
+
width: 40px;
|
|
138
|
+
}
|
|
139
|
+
|
|
121
140
|
.loader__circle-icon {
|
|
122
141
|
width: 20px;
|
|
123
142
|
height: 20px;
|
|
@@ -131,6 +150,11 @@ const classList = computed(() => [
|
|
|
131
150
|
font: var(--typography-text-l-medium);
|
|
132
151
|
border-radius: var(--corner-radius-m);
|
|
133
152
|
|
|
153
|
+
#{$button}--only-icon {
|
|
154
|
+
padding: 0;
|
|
155
|
+
width: 48px;
|
|
156
|
+
}
|
|
157
|
+
|
|
134
158
|
.loader__circle-icon {
|
|
135
159
|
width: 24px;
|
|
136
160
|
height: 24px;
|
|
@@ -144,6 +168,11 @@ const classList = computed(() => [
|
|
|
144
168
|
font: var(--typography-text-l-medium);
|
|
145
169
|
border-radius: var(--corner-radius-m);
|
|
146
170
|
|
|
171
|
+
#{$button}--only-icon {
|
|
172
|
+
padding: 0;
|
|
173
|
+
width: 56px;
|
|
174
|
+
}
|
|
175
|
+
|
|
147
176
|
.loader__circle-icon {
|
|
148
177
|
width: 32px;
|
|
149
178
|
height: 32px;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:range="range"
|
|
6
6
|
locale="ru"
|
|
7
7
|
auto-apply
|
|
8
|
+
:inline="inline"
|
|
8
9
|
:text-input="textInputOptions"
|
|
9
10
|
:hide-navigation="['time']"
|
|
10
11
|
:min-date="minDate || undefined"
|
|
@@ -37,6 +38,7 @@ const props = withDefaults(defineProps<TCoreCalendarProps>(), {
|
|
|
37
38
|
range: false,
|
|
38
39
|
minDate: null,
|
|
39
40
|
size: 'medium',
|
|
41
|
+
inline: false,
|
|
40
42
|
});
|
|
41
43
|
|
|
42
44
|
const emit: (event: 'update:modelValue', value: DateRange) => void = defineEmits();
|
|
@@ -33,10 +33,18 @@
|
|
|
33
33
|
import { computed } from 'vue';
|
|
34
34
|
import BaseButton from '../BaseButton/BaseButton.vue';
|
|
35
35
|
import type { IDefaultPagesProps } from '../../types/default-pages';
|
|
36
|
+
import techWorkImage from '../../assets/tech-work.png';
|
|
37
|
+
import error404Image from '../../assets/404.png';
|
|
36
38
|
|
|
37
39
|
const props = defineProps<IDefaultPagesProps>();
|
|
38
40
|
|
|
39
|
-
const imagePath = computed(()=>
|
|
41
|
+
const imagePath = computed(() => {
|
|
42
|
+
const images:Record<string, any> = {
|
|
43
|
+
'tech-work': techWorkImage,
|
|
44
|
+
'404': error404Image
|
|
45
|
+
};
|
|
46
|
+
return images[props.type] || '';
|
|
47
|
+
});
|
|
40
48
|
const imageContainer = computed<string[]>(()=> [
|
|
41
49
|
`base-default-pages__image-container--${props.type}`
|
|
42
50
|
])
|
|
@@ -98,6 +98,7 @@ import 'vue-virtual-scroller/dist/vue-virtual-scroller.css';
|
|
|
98
98
|
import { DynamicScroller, DynamicScrollerItem } from 'vue-virtual-scroller';
|
|
99
99
|
import type { ICoreSelectProps, TSelectValue, ICoreSelectBaseProps, ICoreSelectOption, ISelectSlotProps } from '../../types/input';
|
|
100
100
|
import BaseDropdown from '../BaseDropdown/BaseDropdown.vue';
|
|
101
|
+
import BaseIcon from '../BaseIcon/BaseIcon.vue';
|
|
101
102
|
import BaseOpenedListItem from '../BaseOpenedListItem/BaseOpenedListItem.vue';
|
|
102
103
|
import { useKitSize } from '../../composables/kit/size';
|
|
103
104
|
import { useKitState } from '../../composables/kit/state';
|
package/src/images.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: string;
|
|
3
|
+
export default value;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module '*.jpg' {
|
|
7
|
+
const value: string;
|
|
8
|
+
export default value;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module '*.jpeg' {
|
|
12
|
+
const value: string;
|
|
13
|
+
export default value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '*.gif' {
|
|
17
|
+
const value: string;
|
|
18
|
+
export default value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module '*.webp' {
|
|
22
|
+
const value: string;
|
|
23
|
+
export default value;
|
|
24
|
+
}
|
package/src/types/button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ICoreColor, ICoreInteractive, ICoreSize, ICoreState, ICoreStyle } from './utils';
|
|
2
2
|
|
|
3
|
-
export type ICoreButtonProps = ICoreSize & ICoreColor & ICoreInteractive & ICoreState & ICoreStyle;
|
|
3
|
+
export type ICoreButtonProps = ICoreSize & ICoreColor & ICoreInteractive & ICoreState & ICoreStyle & { onlyIcon?: boolean };
|
|
4
4
|
|
|
5
5
|
interface IOptionButtonSegment {
|
|
6
6
|
label: string;
|