plugin-ui-for-kzt 0.0.32 → 0.0.36
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/BaseCalendar/BaseCalendar.vue.d.ts +5 -5
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +2 -2
- package/dist/components/BaseDropdown/BaseDropdown.vue.d.ts +1 -1
- package/dist/components/BaseInput/BaseInput.vue.d.ts +2 -2
- package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +5 -5
- package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +2 -2
- package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +2 -2
- package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +2 -2
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +2 -2
- package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +1 -1
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +2 -2
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +2 -2
- package/dist/components/BaseToggle/BaseToggle.vue.d.ts +2 -2
- package/dist/index.js +1 -1
- package/example/App.vue +7 -1
- package/package.json +1 -1
- package/src/components/BaseInputCalendar/BaseInputCalendar.vue +1 -1
- package/src/components/BaseTag/BaseTag.vue +169 -166
package/example/App.vue
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="demo-page">
|
|
3
3
|
<h1>Plugin UI KZT - Компоненты</h1>
|
|
4
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<base-icon
|
|
6
|
+
name="calendar"
|
|
7
|
+
size="small"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
5
10
|
<section>
|
|
6
11
|
<BaseInputCalendar
|
|
7
12
|
id="input-calendar"
|
|
@@ -30,6 +35,7 @@ import BaseInputCalendar from '../src/components/BaseInputCalendar/BaseInputCale
|
|
|
30
35
|
import BaseInputCurrency from '../src/components/BaseInputCurrency/BaseInputCurrency.vue';
|
|
31
36
|
import BaseButton from '../src/components/BaseButton/BaseButton.vue';
|
|
32
37
|
import MyCustomModal from './MyCustomModal.vue';
|
|
38
|
+
import BaseIcon from "../src/components/BaseIcon/BaseIcon.vue";
|
|
33
39
|
|
|
34
40
|
const { open } = useModal();
|
|
35
41
|
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="base-tag" :class="classList">
|
|
2
|
+
<div class="base-tag" :class="classList">
|
|
3
3
|
<div class="base-tag__wrapper">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
<div class="base-tag__text">{{ text }}</div>
|
|
5
|
+
<div v-if="closable" class="base-tag__icon" @click="handleClose">
|
|
6
|
+
<base-icon name="close" size="custom"/>
|
|
7
|
+
</div>
|
|
8
|
+
<div v-if="addingTag" class="base-tag__icon">
|
|
9
|
+
<base-icon name="add" size="custom" class="base-tag__add-icon" @click="handleAddTag"/>
|
|
10
|
+
</div>
|
|
11
|
+
<div v-if="isHasAddTag" class="base-tag__input-wrapper">
|
|
12
|
+
<input
|
|
13
|
+
class="base-tag__input"
|
|
14
|
+
type="text"
|
|
15
|
+
v-model="inputText"
|
|
16
|
+
@input="handleInput"
|
|
17
|
+
@keypress.enter="handleCreateTag"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
20
|
</div>
|
|
21
|
-
</div>
|
|
21
|
+
</div>
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script setup lang="ts">
|
|
@@ -28,50 +28,50 @@ import type { ICoreTagProps } from '../../types/tag';
|
|
|
28
28
|
import { useKitSize } from '../../composables/kit/size';
|
|
29
29
|
import { useKitColor } from '../../composables/kit/color';
|
|
30
30
|
|
|
31
|
-
const props = withDefaults(defineProps<ICoreTagProps>(), {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
31
|
+
const props = withDefaults( defineProps<ICoreTagProps>(), {
|
|
32
|
+
size: 'medium',
|
|
33
|
+
color: 'primary',
|
|
34
|
+
closable: false,
|
|
35
|
+
isHasAddTag: false,
|
|
36
|
+
addingTag: false,
|
|
37
|
+
text: '',
|
|
38
|
+
} );
|
|
39
39
|
|
|
40
40
|
const emit = defineEmits<{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
updateInput: [value: ICoreTagProps['inputText']];
|
|
42
|
+
close: [];
|
|
43
|
+
addTag: [];
|
|
44
44
|
}>();
|
|
45
45
|
|
|
46
|
-
const inputText = ref<string>(props.inputText || '');
|
|
46
|
+
const inputText = ref<string>( props.inputText || '' );
|
|
47
47
|
|
|
48
|
-
const { sizeClassList } = useKitSize(props);
|
|
49
|
-
const { colorClassList } = useKitColor(props);
|
|
48
|
+
const { sizeClassList } = useKitSize( props );
|
|
49
|
+
const { colorClassList } = useKitColor( props );
|
|
50
50
|
|
|
51
|
-
const classList = computed(() => [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
]);
|
|
51
|
+
const classList = computed( () => [
|
|
52
|
+
sizeClassList.value,
|
|
53
|
+
colorClassList.value,
|
|
54
|
+
{ '--adding-tag': props.addingTag },
|
|
55
|
+
] );
|
|
56
56
|
|
|
57
57
|
const handleClose = () => {
|
|
58
|
-
|
|
58
|
+
emit( 'close' );
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
const handleInput = (event: Event) => {
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const handleInput = ( event: Event ) => {
|
|
62
|
+
const target = event.target as HTMLInputElement;
|
|
63
|
+
emit( 'updateInput', target.value );
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
const handleCreateTag = () => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
if ( inputText.value.trim() ) {
|
|
68
|
+
emit( 'updateInput', inputText.value.trim() );
|
|
69
|
+
inputText.value = '';
|
|
70
|
+
}
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
const handleAddTag = () => {
|
|
74
|
-
|
|
74
|
+
emit( 'addTag' );
|
|
75
75
|
};
|
|
76
76
|
</script>
|
|
77
77
|
|
|
@@ -80,166 +80,169 @@ const handleAddTag = () => {
|
|
|
80
80
|
@import '@/styles/root';
|
|
81
81
|
|
|
82
82
|
.base-tag {
|
|
83
|
-
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
|
|
87
|
+
&__wrapper {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
transition: all var(--transition);
|
|
91
|
+
gap: 7px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__text {
|
|
95
|
+
//white-space: nowrap;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
text-overflow: ellipsis;
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__icon {
|
|
102
|
+
display: flex;
|
|
84
103
|
align-items: center;
|
|
85
|
-
|
|
104
|
+
justify-content: center;
|
|
105
|
+
}
|
|
86
106
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
transition: all var(--transition);
|
|
91
|
-
}
|
|
107
|
+
&__input-wrapper {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
92
110
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
111
|
+
.base-tag__input {
|
|
112
|
+
border: none;
|
|
113
|
+
background: transparent;
|
|
114
|
+
outline: none;
|
|
115
|
+
color: var(--primary-blue);
|
|
97
116
|
}
|
|
117
|
+
}
|
|
98
118
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
margin-left: var(--spacing-xs);
|
|
104
|
-
}
|
|
119
|
+
&.--primary-color {
|
|
120
|
+
.base-tag__wrapper {
|
|
121
|
+
background: var(--primary-black-100);
|
|
122
|
+
color: var(--primary-black-700);
|
|
105
123
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
124
|
+
@include hover {
|
|
125
|
+
background: var(--primary-black-200);
|
|
126
|
+
color: var(--primary-black-900);
|
|
109
127
|
|
|
110
|
-
.base-
|
|
111
|
-
|
|
112
|
-
background: transparent;
|
|
113
|
-
outline: none;
|
|
114
|
-
color: var(--primary-blue);
|
|
128
|
+
.base-tag__icon {
|
|
129
|
+
color: var(--primary-black-900);
|
|
115
130
|
}
|
|
131
|
+
}
|
|
116
132
|
}
|
|
117
133
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
134
|
+
.base-tag__icon {
|
|
135
|
+
color: var(--primary-black-500);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
122
138
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
139
|
+
&.--secondary-color {
|
|
140
|
+
.base-tag__wrapper {
|
|
141
|
+
background: var(--primary-black-white);
|
|
142
|
+
color: var(--primary-black-700); // same
|
|
126
143
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
}
|
|
144
|
+
@include hover {
|
|
145
|
+
background: var(--primary-black-200);
|
|
146
|
+
color: var(--primary-black-900);
|
|
132
147
|
|
|
133
148
|
.base-tag__icon {
|
|
134
|
-
|
|
149
|
+
color: var(--primary-black-900);
|
|
135
150
|
}
|
|
151
|
+
}
|
|
136
152
|
}
|
|
137
153
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
154
|
+
.base-tag__icon {
|
|
155
|
+
color: var(--primary-black-500);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
142
158
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
159
|
+
&.--adding-tag {
|
|
160
|
+
.base-tag__wrapper {
|
|
161
|
+
color: var(--primary-black-500);
|
|
146
162
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
163
|
+
@include hover {
|
|
164
|
+
color: var(--primary-black-900);
|
|
152
165
|
|
|
153
166
|
.base-tag__icon {
|
|
154
|
-
|
|
167
|
+
color: var(--primary-black-900);
|
|
155
168
|
}
|
|
169
|
+
}
|
|
156
170
|
}
|
|
171
|
+
}
|
|
157
172
|
|
|
158
|
-
&.--adding-tag {
|
|
159
|
-
.base-tag__wrapper {
|
|
160
|
-
color: var(--primary-black-500);
|
|
161
173
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
color: var(--primary-black-900);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
174
|
+
&.--extra-small-size {
|
|
175
|
+
.base-tag__text,
|
|
176
|
+
.base-tag__input {
|
|
177
|
+
font: var(--typography-text-xs-medium);
|
|
170
178
|
}
|
|
171
179
|
|
|
180
|
+
.base-tag__wrapper {
|
|
181
|
+
border-radius: var(--corner-radius-xxs);
|
|
182
|
+
padding: var(--spacing-2xs) var(--spacing-s);
|
|
183
|
+
}
|
|
172
184
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
.base-tag__wrapper {
|
|
180
|
-
border-radius: var(--corner-radius-xxs);
|
|
181
|
-
padding: var(--spacing-2xs) var(--spacing-s);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.base-tag__icon,
|
|
185
|
-
.base-tag__add-icon {
|
|
186
|
-
width: 12px;
|
|
187
|
-
height: 12px;
|
|
188
|
-
}
|
|
185
|
+
.base-tag__icon,
|
|
186
|
+
.base-tag__add-icon {
|
|
187
|
+
width: 12px;
|
|
188
|
+
height: 12px;
|
|
189
|
+
margin-top: 4px;
|
|
189
190
|
}
|
|
191
|
+
}
|
|
190
192
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
&.--small-size {
|
|
194
|
+
.base-tag__text,
|
|
195
|
+
.base-tag__input {
|
|
196
|
+
font: var(--typography-text-s-medium);
|
|
197
|
+
}
|
|
196
198
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
.base-tag__wrapper {
|
|
200
|
+
border-radius: var(--corner-radius-xxs);
|
|
201
|
+
padding: var(--spacing-2xs) var(--spacing-s);
|
|
202
|
+
}
|
|
201
203
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
.base-tag__icon,
|
|
205
|
+
.base-tag__add-icon {
|
|
206
|
+
width: 14px;
|
|
207
|
+
height: 14px;
|
|
208
|
+
margin-top: 4px;
|
|
207
209
|
}
|
|
210
|
+
}
|
|
208
211
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
&.--medium-size {
|
|
213
|
+
.base-tag__text,
|
|
214
|
+
.base-tag__input {
|
|
215
|
+
font: var(--typography-text-s-medium);
|
|
216
|
+
}
|
|
214
217
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
.base-tag__wrapper {
|
|
219
|
+
border-radius: var(--corner-radius-2xs);
|
|
220
|
+
padding: var(--spacing-xs) var(--spacing-2m);
|
|
221
|
+
}
|
|
219
222
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
223
|
+
.base-tag__icon,
|
|
224
|
+
.base-tag__add-icon {
|
|
225
|
+
width: 16px;
|
|
226
|
+
height: 16px;
|
|
225
227
|
}
|
|
228
|
+
}
|
|
226
229
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
&.--large-size {
|
|
231
|
+
.base-tag__text,
|
|
232
|
+
.base-tag__input {
|
|
233
|
+
font: var(--typography-text-m-medium);
|
|
234
|
+
}
|
|
232
235
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
236
|
+
.base-tag__wrapper {
|
|
237
|
+
border-radius: var(--corner-radius-2xs);
|
|
238
|
+
padding: var(--spacing-xs) var(--spacing-2m);
|
|
239
|
+
}
|
|
237
240
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
241
|
+
.base-tag__icon,
|
|
242
|
+
.base-tag__add-icon {
|
|
243
|
+
width: 16px;
|
|
244
|
+
height: 16px;
|
|
243
245
|
}
|
|
246
|
+
}
|
|
244
247
|
}
|
|
245
248
|
</style>
|