plugin-ui-for-kzt 0.0.37 → 0.0.38
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/BaseBadge/BaseBadge.vue.d.ts +1 -1
- package/dist/components/BaseButton/BaseButton.vue.d.ts +1 -1
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +1 -1
- package/dist/components/BaseInput/BaseInput.vue.d.ts +3 -3
- package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +3 -3
- package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +4 -4
- package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +2 -2
- package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +2 -2
- package/dist/components/BasePagination/BasePagination.vue.d.ts +1 -1
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +1 -1
- package/dist/components/BaseSiteInput/BaseSiteInput.vue.d.ts +1 -1
- package/dist/components/BaseTag/BaseTag.vue.d.ts +1 -1
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +2 -2
- package/dist/components/BaseToast/BaseToast.vue.d.ts +1 -1
- package/dist/components/BaseToggle/BaseToggle.vue.d.ts +1 -1
- package/dist/components/BaseTooltip/BaseTooltip.vue.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/BaseDropdown/BaseDropdown.vue +2 -0
- package/src/components/BaseField/BaseField.vue +126 -124
- package/src/components/BaseSelect/BaseSelect.vue +2 -1
package/package.json
CHANGED
|
@@ -126,6 +126,7 @@ const classList = computed(() => [
|
|
|
126
126
|
@import '../../styles/root';
|
|
127
127
|
|
|
128
128
|
.dropdown {
|
|
129
|
+
height: 100%;
|
|
129
130
|
&__wrapper {
|
|
130
131
|
position: relative;
|
|
131
132
|
width: 100%;
|
|
@@ -135,6 +136,7 @@ const classList = computed(() => [
|
|
|
135
136
|
&__top {
|
|
136
137
|
cursor: pointer;
|
|
137
138
|
outline: none;
|
|
139
|
+
height: 100%;
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
&__dropdown {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
<div class="base-field" :class="classList">
|
|
3
|
+
<label class="base-field__label" :for="id">
|
|
4
|
+
<span v-if="label" class="base-field__label-text">{{ label }}</span>
|
|
5
|
+
<div class="base-field__wrapper" :class="{ 'base-field__wrapper--focusable': focusable}" :tabindex="tabIndex">
|
|
6
|
+
<slot :data="componentAttrs"/>
|
|
7
|
+
</div>
|
|
8
|
+
<transition name="error">
|
|
9
|
+
<div
|
|
10
|
+
v-if="(error && typeof error === 'string') || hint"
|
|
11
|
+
class="base-field__hint"
|
|
12
|
+
aria-live="polite"
|
|
13
|
+
>
|
|
14
|
+
{{ error || hint }}
|
|
15
|
+
</div>
|
|
16
|
+
</transition>
|
|
17
|
+
</label>
|
|
18
|
+
</div>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script setup lang="ts">
|
|
@@ -26,43 +26,43 @@ import { useKitState } from '../../composables/kit/state';
|
|
|
26
26
|
import type { TFieldProps } from '../../types/field';
|
|
27
27
|
|
|
28
28
|
interface IDefaultSlotProps {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
id: string;
|
|
30
|
+
error?: string;
|
|
31
|
+
size?: string;
|
|
32
|
+
focusable?: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const props = withDefaults(defineProps<TFieldProps>(), {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
35
|
+
const props = withDefaults( defineProps<TFieldProps>(), {
|
|
36
|
+
size: 'medium',
|
|
37
|
+
id: '',
|
|
38
|
+
label: '',
|
|
39
|
+
hint: '',
|
|
40
|
+
error: '',
|
|
41
|
+
focusable: true,
|
|
42
|
+
tabIndex: 0,
|
|
43
|
+
} );
|
|
44
44
|
|
|
45
45
|
defineEmits<{
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
( event: 'update:modelValue', value: string ): void;
|
|
47
|
+
( event: 'error', value: string ): void;
|
|
48
48
|
}>();
|
|
49
49
|
|
|
50
50
|
const attrs = useAttrs();
|
|
51
|
-
const { stateAttrs } = useKitState(props);
|
|
52
|
-
const { sizeClassList } = useKitSize(props);
|
|
53
|
-
|
|
54
|
-
const componentAttrs = computed<IDefaultSlotProps>(() => ({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}));
|
|
61
|
-
|
|
62
|
-
const classList = computed(() => [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
]);
|
|
51
|
+
const { stateAttrs } = useKitState( props );
|
|
52
|
+
const { sizeClassList } = useKitSize( props );
|
|
53
|
+
|
|
54
|
+
const componentAttrs = computed<IDefaultSlotProps>( () => ({
|
|
55
|
+
...(attrs || {}),
|
|
56
|
+
...(stateAttrs.value || {}),
|
|
57
|
+
id: props.id,
|
|
58
|
+
error: props.error,
|
|
59
|
+
size: props.size,
|
|
60
|
+
}) );
|
|
61
|
+
|
|
62
|
+
const classList = computed( () => [
|
|
63
|
+
...sizeClassList.value,
|
|
64
|
+
{ '--is-error': props.error && typeof props.error === 'string' },
|
|
65
|
+
] );
|
|
66
66
|
</script>
|
|
67
67
|
|
|
68
68
|
<style scoped lang="scss">
|
|
@@ -70,115 +70,117 @@ const classList = computed(() => [
|
|
|
70
70
|
@import '../../styles/root';
|
|
71
71
|
|
|
72
72
|
.base-field {
|
|
73
|
+
width: 100%;
|
|
74
|
+
|
|
75
|
+
&__wrapper {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
width: 100%;
|
|
79
|
+
position: relative;
|
|
80
|
+
transition: all var(--transition);
|
|
81
|
+
|
|
82
|
+
&--focusable {
|
|
83
|
+
@include focused {
|
|
84
|
+
border: 1px solid var(--primary-blue-500);
|
|
85
|
+
outline: 4px solid var(--effects-primary-focus);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&__label {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
gap: 6px;
|
|
73
94
|
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
}
|
|
74
97
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
98
|
+
&__label-text {
|
|
99
|
+
color: var(--primary-text-primary);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__hint {
|
|
103
|
+
color: var(--primary-text-secondary);
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
max-height: 100px;
|
|
106
|
+
transition: all 0.3s ease;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&.--is-error {
|
|
110
|
+
.base-field__wrapper {
|
|
111
|
+
&--focusable {
|
|
112
|
+
@include focused {
|
|
113
|
+
border: none;
|
|
114
|
+
outline: 4px solid var(--effects-error-focus);
|
|
87
115
|
}
|
|
116
|
+
}
|
|
88
117
|
}
|
|
89
118
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
flex-direction: column;
|
|
93
|
-
gap: 6px;
|
|
94
|
-
width: 100%;
|
|
119
|
+
.base-field__hint {
|
|
120
|
+
color: var(--error-red);
|
|
95
121
|
}
|
|
122
|
+
}
|
|
96
123
|
|
|
97
|
-
|
|
98
|
-
|
|
124
|
+
&.--small-size {
|
|
125
|
+
.base-field__wrapper {
|
|
126
|
+
border-radius: 10px;
|
|
99
127
|
}
|
|
100
128
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
overflow: hidden;
|
|
104
|
-
max-height: 100px;
|
|
105
|
-
transition: all 0.3s ease;
|
|
129
|
+
.base-field__label-text {
|
|
130
|
+
font: var(--typography-text-s-medium);
|
|
106
131
|
}
|
|
107
132
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
&--focusable {
|
|
111
|
-
@include focused {
|
|
112
|
-
border: none;
|
|
113
|
-
outline: 4px solid var(--effects-error-focus);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.base-field__hint {
|
|
119
|
-
color: var(--error-red);
|
|
120
|
-
}
|
|
133
|
+
.base-field__hint {
|
|
134
|
+
font: var(--typography-text-s-regular);
|
|
121
135
|
}
|
|
136
|
+
}
|
|
122
137
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
.base-field__label-text {
|
|
129
|
-
font: var(--typography-text-s-medium);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.base-field__hint {
|
|
133
|
-
font: var(--typography-text-s-regular);
|
|
134
|
-
}
|
|
138
|
+
&.--medium-size {
|
|
139
|
+
.base-field__wrapper {
|
|
140
|
+
border-radius: 12px;
|
|
141
|
+
height: 100%;
|
|
135
142
|
}
|
|
136
143
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.base-field__label-text {
|
|
143
|
-
font: var(--typography-text-s-medium);
|
|
144
|
-
}
|
|
144
|
+
.base-field__label-text {
|
|
145
|
+
font: var(--typography-text-s-medium);
|
|
146
|
+
}
|
|
145
147
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
148
|
+
.base-field__hint {
|
|
149
|
+
font: var(--typography-text-s-regular);
|
|
149
150
|
}
|
|
151
|
+
}
|
|
150
152
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
&.--large-size {
|
|
154
|
+
.base-field__wrapper {
|
|
155
|
+
border-radius: 12px;
|
|
156
|
+
}
|
|
155
157
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
.base-field__label-text {
|
|
159
|
+
font: var(--typography-text-m-medium);
|
|
160
|
+
}
|
|
159
161
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
162
|
+
.base-field__hint {
|
|
163
|
+
font: var(--typography-text-m-regular);
|
|
163
164
|
}
|
|
165
|
+
}
|
|
164
166
|
}
|
|
165
167
|
|
|
166
168
|
.error-enter-active,
|
|
167
169
|
.error-leave-active {
|
|
168
|
-
|
|
170
|
+
transition: opacity 0.3s ease, max-height 0.3s ease, transform 0.3s ease;
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
.error-enter-from,
|
|
172
174
|
.error-leave-to {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
opacity: 0;
|
|
176
|
+
transform: translateY(10px);
|
|
177
|
+
max-height: 0;
|
|
176
178
|
}
|
|
177
179
|
|
|
178
180
|
.error-enter-to,
|
|
179
181
|
.error-leave-from {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
opacity: 1;
|
|
183
|
+
transform: translateY(0);
|
|
184
|
+
max-height: 100px;
|
|
183
185
|
}
|
|
184
186
|
</style>
|
|
@@ -303,7 +303,7 @@ defineSlots<{
|
|
|
303
303
|
$select: &;
|
|
304
304
|
|
|
305
305
|
min-width: 320px;
|
|
306
|
-
|
|
306
|
+
height: 100%;
|
|
307
307
|
.dropdown {
|
|
308
308
|
&.--is-opened {
|
|
309
309
|
#{$select} {
|
|
@@ -450,6 +450,7 @@ defineSlots<{
|
|
|
450
450
|
|
|
451
451
|
&__input {
|
|
452
452
|
border-radius: var(--corner-radius-m);
|
|
453
|
+
height: 100%;
|
|
453
454
|
}
|
|
454
455
|
|
|
455
456
|
&__header {
|