plugin-ui-for-kzt 0.0.31 → 0.0.32
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 +3 -3
- package/dist/components/BaseCalendar/BaseCalendar.vue.d.ts +44 -0
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +4 -4
- package/dist/components/BaseDropdown/BaseDropdown.vue.d.ts +3 -3
- package/dist/components/BaseField/BaseField.vue.d.ts +2 -2
- package/dist/components/BaseInput/BaseInput.vue.d.ts +6 -6
- package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +20 -11
- package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +13 -6
- package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +5 -5
- package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +5 -5
- package/dist/components/BaseOpenedListItem/BaseOpenedListItem.vue.d.ts +2 -2
- package/dist/components/BasePagination/BasePagination.vue.d.ts +1 -1
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +4 -4
- package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +3 -3
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +4 -4
- package/dist/components/BaseTag/BaseTag.vue.d.ts +1 -1
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +5 -5
- package/dist/components/BaseToast/BaseToast.vue.d.ts +1 -1
- package/dist/components/BaseToggle/BaseToggle.vue.d.ts +4 -4
- package/dist/index.js +1 -1
- package/example/App.vue +63 -4
- package/example/MyCustomModal.vue +1 -0
- package/package.json +1 -1
- package/src/assets/icons/calendar.svg +2 -2
- package/src/components/BaseCalendar/BaseCalendar.vue +28 -3
- package/src/components/BaseIcon/BaseIcon.vue +1 -1
- package/src/components/BaseInputCalendar/BaseInputCalendar.vue +40 -5
- package/src/components/BaseInputCurrency/BaseInputCurrency.vue +21 -10
- package/src/components/BaseSelect/BaseSelect.vue +33 -6
- package/src/components/BaseSwiper/BaseSwiper.vue +9 -4
- package/src/components/BaseTextarea/BaseTextarea.vue +1 -0
- package/src/types/calendar.d.ts +5 -2
- package/src/types/input.d.ts +2 -2
- package/webpack.config.js +4 -0
package/example/App.vue
CHANGED
|
@@ -3,14 +3,73 @@
|
|
|
3
3
|
<h1>Plugin UI KZT - Компоненты</h1>
|
|
4
4
|
|
|
5
5
|
<section>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
<BaseInputCalendar
|
|
7
|
+
id="input-calendar"
|
|
8
|
+
v-model="demoValues.calendar"
|
|
9
|
+
placeholder="Доступно"
|
|
10
|
+
:min-date="new Date('2025-11-23')"
|
|
11
|
+
:max-date="new Date()"
|
|
12
|
+
/>
|
|
13
|
+
|
|
14
|
+
<BaseTextarea
|
|
15
|
+
id="textarea"
|
|
16
|
+
v-model="demoValues.textarea"
|
|
17
|
+
placeholder="Введите текст..."
|
|
18
|
+
label="Текстовое поле"
|
|
19
|
+
readonly
|
|
20
|
+
/>
|
|
9
21
|
</section>
|
|
10
22
|
</div>
|
|
11
23
|
</template>
|
|
12
24
|
<script setup lang="ts">
|
|
13
|
-
import
|
|
25
|
+
import { ref } from 'vue';
|
|
26
|
+
import { useModal } from '../src/composables/useModal';
|
|
27
|
+
import BaseTextarea from '../src/components/BaseTextarea/BaseTextarea.vue';
|
|
28
|
+
import BaseSwiper from '../src/components/BaseSwiper/BaseSwiper.vue';
|
|
29
|
+
import BaseInputCalendar from '../src/components/BaseInputCalendar/BaseInputCalendar.vue';
|
|
30
|
+
import BaseInputCurrency from '../src/components/BaseInputCurrency/BaseInputCurrency.vue';
|
|
31
|
+
import BaseButton from '../src/components/BaseButton/BaseButton.vue';
|
|
32
|
+
import MyCustomModal from './MyCustomModal.vue';
|
|
33
|
+
|
|
34
|
+
const { open } = useModal();
|
|
35
|
+
|
|
36
|
+
const openModal = () => {
|
|
37
|
+
open('modal-example', {
|
|
38
|
+
closable: true,
|
|
39
|
+
}, MyCustomModal);
|
|
40
|
+
};
|
|
41
|
+
const currencyOptions = [
|
|
42
|
+
{ id: '1', name: 'USD', value: 'USD' as const, mask: '# #### ### 0.##', symbol: '$' },
|
|
43
|
+
{ id: '2', name: 'RUB', value: 'RUB' as const, mask: '# ##0.##', symbol: '₽' },
|
|
44
|
+
{ id: '3', name: 'KGS', value: 'KGS' as const, mask: '# ##0.##', symbol: '⃀' },
|
|
45
|
+
{ id: '4', name: 'UZS', value: 'UZS' as const, mask: '# ##0.##', symbol: 'сў' },
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const iconOptions = [
|
|
49
|
+
{ id: 1, name: 'Пользователь', icon: 'email-sms' },
|
|
50
|
+
{ id: 2, name: 'Настройки', icon: 'document-text' },
|
|
51
|
+
{ id: 3, name: 'Файлы', icon: 'gallery' },
|
|
52
|
+
{ id: 4, name: 'Сообщения', icon: 'email-sms' },
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
const demoValues = ref({
|
|
56
|
+
icons: iconOptions[0].id,
|
|
57
|
+
textarea: 'Тестовый текст',
|
|
58
|
+
calendar: new Date(),
|
|
59
|
+
calendarDisabled: new Date(),
|
|
60
|
+
calendarReadonly: new Date(),
|
|
61
|
+
currency: '0.00',
|
|
62
|
+
currency2: '0.00',
|
|
63
|
+
phone: '0777777777',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const images = ref<string[]>([
|
|
69
|
+
'https://picsum.photos/seed/1/800/400',
|
|
70
|
+
'https://picsum.photos/seed/2/800/400',
|
|
71
|
+
'https://picsum.photos/seed/3/800/400',
|
|
72
|
+
]);
|
|
14
73
|
</script>
|
|
15
74
|
|
|
16
75
|
<style lang="scss" scoped>
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg viewBox="0 0 24 24" fill="none"
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
2
2
|
<path d="M8 2V5" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
3
|
<path d="M16 2V5" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
4
|
<path d="M3.5 9.08984H20.5" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
<path d="M11.9955 16.7002H12.0045" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
10
10
|
<path d="M8.29431 13.7002H8.30329" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
11
11
|
<path d="M8.29431 16.7002H8.30329" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
12
|
-
</svg>
|
|
12
|
+
</svg>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="base-calendar" :class="classList">
|
|
3
|
-
|
|
3
|
+
<vue-date-picker
|
|
4
|
+
:disabled="disabled || readonly"
|
|
4
5
|
v-model="computedModelValue"
|
|
5
6
|
:range="range"
|
|
6
7
|
locale="ru"
|
|
@@ -8,7 +9,8 @@
|
|
|
8
9
|
:inline="inline"
|
|
9
10
|
:text-input="textInputOptions"
|
|
10
11
|
:hide-navigation="['time']"
|
|
11
|
-
:min-date="
|
|
12
|
+
:min-date="minDateComputed"
|
|
13
|
+
:max-date="maxDateComputed"
|
|
12
14
|
:enable-time-picker="false"
|
|
13
15
|
:format="format"
|
|
14
16
|
month-name-format="long"
|
|
@@ -29,6 +31,7 @@ import VueDatePicker from '@vuepic/vue-datepicker';
|
|
|
29
31
|
import '@vuepic/vue-datepicker/dist/main.css';
|
|
30
32
|
import type { DateRange, TCoreCalendarProps } from '../../types/calendar';
|
|
31
33
|
import { useKitSize } from '../../composables/kit/size'
|
|
34
|
+
import { useKitState } from '../../composables/kit/state'
|
|
32
35
|
|
|
33
36
|
interface DpInputSlotProps {
|
|
34
37
|
value: string
|
|
@@ -37,8 +40,10 @@ interface DpInputSlotProps {
|
|
|
37
40
|
const props = withDefaults(defineProps<TCoreCalendarProps>(), {
|
|
38
41
|
range: false,
|
|
39
42
|
minDate: null,
|
|
43
|
+
maxDate: null,
|
|
40
44
|
size: 'medium',
|
|
41
45
|
inline: false,
|
|
46
|
+
disabled: false,
|
|
42
47
|
});
|
|
43
48
|
|
|
44
49
|
const emit: (event: 'update:modelValue', value: DateRange) => void = defineEmits();
|
|
@@ -46,8 +51,8 @@ const emit: (event: 'update:modelValue', value: DateRange) => void = defineEmits
|
|
|
46
51
|
const computedModelValue = computed<DateRange>({
|
|
47
52
|
get: () => props.modelValue ?? null,
|
|
48
53
|
set: (value: DateRange) => {
|
|
54
|
+
if (props.disabled || props.readonly) return;
|
|
49
55
|
emit('update:modelValue', value);
|
|
50
|
-
console.log(value);
|
|
51
56
|
},
|
|
52
57
|
});
|
|
53
58
|
|
|
@@ -58,14 +63,19 @@ const textInputOptions: { format: string } = {
|
|
|
58
63
|
const dayNames: string[] = ['П', 'В', 'С', 'Ч', 'П', 'С', 'В'];
|
|
59
64
|
|
|
60
65
|
const { sizeClassList } = useKitSize(props);
|
|
66
|
+
const { stateClassList } = useKitState(props);
|
|
61
67
|
|
|
62
68
|
const classList = computed(() => [
|
|
63
69
|
sizeClassList.value,
|
|
70
|
+
stateClassList.value,
|
|
64
71
|
{
|
|
65
72
|
'--is-readonly': props.readonly,
|
|
66
73
|
},
|
|
67
74
|
]);
|
|
68
75
|
|
|
76
|
+
const minDateComputed = computed(() => props.minDate || undefined);
|
|
77
|
+
const maxDateComputed = computed(() => props.maxDate || undefined);
|
|
78
|
+
|
|
69
79
|
function format(date: Date | string | (Date | string)[] | null): string {
|
|
70
80
|
if (!date) return '';
|
|
71
81
|
|
|
@@ -230,5 +240,20 @@ function getDayClass(date: Date): string {
|
|
|
230
240
|
color: var(--error-red);
|
|
231
241
|
}
|
|
232
242
|
}
|
|
243
|
+
|
|
244
|
+
&.--is-disabled,
|
|
245
|
+
&.--is-readonly {
|
|
246
|
+
pointer-events: none;
|
|
247
|
+
opacity: 0.6;
|
|
248
|
+
|
|
249
|
+
:deep(.dp__input) {
|
|
250
|
+
pointer-events: none;
|
|
251
|
+
cursor: not-allowed;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
:deep(.dp--menu-wrapper) {
|
|
255
|
+
pointer-events: none;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
233
258
|
}
|
|
234
259
|
</style>
|
|
@@ -6,16 +6,20 @@
|
|
|
6
6
|
:range="range"
|
|
7
7
|
:size="size"
|
|
8
8
|
:min-date="minDate"
|
|
9
|
+
:max-date="maxDate"
|
|
9
10
|
:id="id"
|
|
11
|
+
:disabled="disabled"
|
|
12
|
+
:readonly="readonly"
|
|
10
13
|
>
|
|
11
14
|
<base-input
|
|
12
15
|
v-bind="{ ...$props }"
|
|
13
16
|
:model-value="formattedValue"
|
|
17
|
+
:disabled="disabled"
|
|
14
18
|
@update:model-value="handleInputUpdate"
|
|
15
19
|
>
|
|
16
|
-
<template #
|
|
20
|
+
<template #left-icon>
|
|
17
21
|
<base-icon
|
|
18
|
-
name="calendar"
|
|
22
|
+
name="calendar-icon"
|
|
19
23
|
:size="size"
|
|
20
24
|
class="base-input-calendar__icon"
|
|
21
25
|
/>
|
|
@@ -30,6 +34,7 @@
|
|
|
30
34
|
import { computed, ref, watch } from 'vue';
|
|
31
35
|
import BaseInput from '../BaseInput/BaseInput.vue';
|
|
32
36
|
import BaseCalendar from '../BaseCalendar/BaseCalendar.vue';
|
|
37
|
+
import BaseIcon from '../BaseIcon/BaseIcon.vue';
|
|
33
38
|
import type { DateRange, TCoreInputCalendarProps } from '../../types/calendar';
|
|
34
39
|
|
|
35
40
|
const props = withDefaults(defineProps<TCoreInputCalendarProps>(), {
|
|
@@ -39,6 +44,8 @@ const props = withDefaults(defineProps<TCoreInputCalendarProps>(), {
|
|
|
39
44
|
placeholder: '',
|
|
40
45
|
range: false,
|
|
41
46
|
minDate: null,
|
|
47
|
+
maxDate: null,
|
|
48
|
+
disabled: false,
|
|
42
49
|
});
|
|
43
50
|
|
|
44
51
|
const emit = defineEmits<{
|
|
@@ -50,8 +57,18 @@ const inputValue = ref<string>('');
|
|
|
50
57
|
|
|
51
58
|
watch(
|
|
52
59
|
() => props.modelValue,
|
|
53
|
-
(newValue) => {
|
|
54
|
-
|
|
60
|
+
(newValue: string | DateRange | undefined) => {
|
|
61
|
+
if (typeof newValue === 'string') {
|
|
62
|
+
inputValue.value = newValue;
|
|
63
|
+
} else if (newValue instanceof Date) {
|
|
64
|
+
const formatted = formatDateRange(newValue);
|
|
65
|
+
inputValue.value = formatted;
|
|
66
|
+
} else if (Array.isArray(newValue) && newValue.length === 2) {
|
|
67
|
+
const formatted = formatDateRange(newValue);
|
|
68
|
+
inputValue.value = formatted;
|
|
69
|
+
} else {
|
|
70
|
+
inputValue.value = '';
|
|
71
|
+
}
|
|
55
72
|
},
|
|
56
73
|
{ immediate: true },
|
|
57
74
|
);
|
|
@@ -144,9 +161,23 @@ function formatDateRange(value: DateRange | (string | Date)[]): string {
|
|
|
144
161
|
|
|
145
162
|
const calendarModelValue = computed<DateRange>({
|
|
146
163
|
get: () => {
|
|
147
|
-
|
|
164
|
+
const value = props.modelValue;
|
|
165
|
+
if (typeof value === 'string') {
|
|
166
|
+
return parseDateString(value);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (value instanceof Date) {
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
172
|
+
if (Array.isArray(value) && value.length === 2) {
|
|
173
|
+
return value as [Date, Date];
|
|
174
|
+
}
|
|
175
|
+
return null;
|
|
148
176
|
},
|
|
149
177
|
set: (value: DateRange) => {
|
|
178
|
+
if (props.disabled || props.readonly) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
150
181
|
const formatted = formatDateRange(value);
|
|
151
182
|
inputValue.value = formatted;
|
|
152
183
|
emit('update:modelValue', formatted);
|
|
@@ -158,6 +189,10 @@ const formattedValue = computed<string>(() => {
|
|
|
158
189
|
});
|
|
159
190
|
|
|
160
191
|
function handleInputUpdate(value: string) {
|
|
192
|
+
if (props.disabled || props.readonly) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
161
196
|
let filteredValue = value.replace(/[^0-9.\s-]/g, '');
|
|
162
197
|
|
|
163
198
|
if (props.range) {
|
|
@@ -39,33 +39,44 @@ import { useKitState } from '../../composables/kit/state';
|
|
|
39
39
|
import { useKitSize } from '../../composables/kit/size';
|
|
40
40
|
import type { ICoreInputProps, IOptionsCurrency } from '../../types/input';
|
|
41
41
|
|
|
42
|
-
const props = withDefaults(defineProps<ICoreInputProps
|
|
42
|
+
const props = withDefaults(defineProps<ICoreInputProps & {
|
|
43
|
+
options?: IOptionsCurrency[];
|
|
44
|
+
}>(), {
|
|
43
45
|
size: 'medium',
|
|
44
46
|
type: 'text',
|
|
45
47
|
modelValue: '',
|
|
46
48
|
placeholder: '0.00',
|
|
47
49
|
error: '',
|
|
50
|
+
options: undefined,
|
|
48
51
|
});
|
|
49
52
|
|
|
50
53
|
const emit: (event: 'update:modelValue', value: string) => void = defineEmits();
|
|
51
54
|
|
|
52
|
-
const
|
|
55
|
+
const defaultOptions: IOptionsCurrency[] = [
|
|
53
56
|
{ id: '1', name: 'KZT', value: 'KZT', mask: '# ##0.##', symbol: '₸' },
|
|
54
57
|
{ id: '2', name: 'RUB', value: 'RUB', mask: '# ##0.##', symbol: '₽' },
|
|
55
58
|
{ id: '3', name: 'KGS', value: 'KGS', mask: '# ##0.##', symbol: '⃀' },
|
|
56
59
|
{ id: '4', name: 'UZS', value: 'UZS', mask: '# ##0.##', symbol: 'сў' },
|
|
57
|
-
]
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
const optionsCurrency = computed<IOptionsCurrency[]>(() => {
|
|
63
|
+
return props.options || defaultOptions;
|
|
64
|
+
});
|
|
58
65
|
|
|
59
|
-
const selectedOption =
|
|
66
|
+
const selectedOption = computed<IOptionsCurrency>(() => {
|
|
67
|
+
const option = optionsCurrency.value.find(opt => opt.id === selectedOptionId.value);
|
|
68
|
+
return option || optionsCurrency.value[0];
|
|
69
|
+
});
|
|
60
70
|
|
|
61
|
-
const selectedOptionId = ref<IOptionsCurrency['id']>(
|
|
71
|
+
const selectedOptionId = ref<IOptionsCurrency['id']>(optionsCurrency.value[0]?.id || '');
|
|
62
72
|
|
|
63
|
-
watch(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
watch(optionsCurrency, (newOptions) => {
|
|
74
|
+
if (newOptions.length > 0) {
|
|
75
|
+
if (!newOptions.find(opt => opt.id === selectedOptionId.value)) {
|
|
76
|
+
selectedOptionId.value = newOptions[0].id;
|
|
77
|
+
}
|
|
67
78
|
}
|
|
68
|
-
});
|
|
79
|
+
}, { immediate: true });
|
|
69
80
|
|
|
70
81
|
const { stateClassList, stateAttrs } = useKitState(props);
|
|
71
82
|
const { sizeClassList } = useKitSize(props);
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
:disabled="actualDisabled"
|
|
9
9
|
>
|
|
10
10
|
<template #top>
|
|
11
|
-
<!-- Старый header для дефолтного поведения -->
|
|
12
11
|
<div
|
|
13
12
|
v-if="!searchable"
|
|
14
13
|
:data-error="Boolean(error)"
|
|
@@ -19,7 +18,16 @@
|
|
|
19
18
|
name="header"
|
|
20
19
|
:value="actualOption ? [actualOption] : undefined"
|
|
21
20
|
>
|
|
22
|
-
<div
|
|
21
|
+
<div
|
|
22
|
+
v-if="actualOption?.icon && $slots.iconItem"
|
|
23
|
+
class="base-select__header_prefix_icon"
|
|
24
|
+
>
|
|
25
|
+
<slot name="iconItem" :item="actualOption" />
|
|
26
|
+
</div>
|
|
27
|
+
<div
|
|
28
|
+
v-else-if="$slots.headerIcon"
|
|
29
|
+
class="base-select__header_prefix_icon"
|
|
30
|
+
>
|
|
23
31
|
<slot name="headerIcon" />
|
|
24
32
|
</div>
|
|
25
33
|
|
|
@@ -100,7 +108,7 @@
|
|
|
100
108
|
<div class="base-select__item-wrapper">
|
|
101
109
|
<base-opened-list-item
|
|
102
110
|
v-bind="listItemAttrs(item)"
|
|
103
|
-
:key="item.id"
|
|
111
|
+
:key="String(item.id ?? '')"
|
|
104
112
|
:size="size"
|
|
105
113
|
>
|
|
106
114
|
<template #icon>
|
|
@@ -168,10 +176,17 @@ const displayValue = computed(() => {
|
|
|
168
176
|
});
|
|
169
177
|
|
|
170
178
|
watch(() => props.modelValue, (val) => {
|
|
171
|
-
|
|
179
|
+
if (val && typeof val === 'object' && 'id' in val) {
|
|
180
|
+
actualValue.value = (val as ICoreSelectOption).id as TSelectValue;
|
|
181
|
+
} else {
|
|
182
|
+
actualValue.value = val ?? '';
|
|
183
|
+
}
|
|
172
184
|
}, { immediate: true });
|
|
173
185
|
|
|
174
186
|
function handleInput(value: TSelectValue) {
|
|
187
|
+
if (props.readonly || props.disabled) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
175
190
|
actualValue.value = value;
|
|
176
191
|
emit('update:modelValue', value);
|
|
177
192
|
emit('change', value);
|
|
@@ -180,6 +195,9 @@ function handleInput(value: TSelectValue) {
|
|
|
180
195
|
}
|
|
181
196
|
|
|
182
197
|
function handleInputChange(event: Event) {
|
|
198
|
+
if (props.readonly || props.disabled) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
183
201
|
const target = event.target as HTMLInputElement;
|
|
184
202
|
const inputValue = target.value;
|
|
185
203
|
searchQuery.value = inputValue;
|
|
@@ -203,6 +221,9 @@ function handleInputChange(event: Event) {
|
|
|
203
221
|
}
|
|
204
222
|
|
|
205
223
|
function handleIconClick(event: Event) {
|
|
224
|
+
if (props.readonly || props.disabled) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
206
227
|
event.stopPropagation();
|
|
207
228
|
if (actualOption.value) {
|
|
208
229
|
handleInput('');
|
|
@@ -245,7 +266,7 @@ const { sizeClassList } = useKitSize(props);
|
|
|
245
266
|
const { stateClassList } = useKitState(props);
|
|
246
267
|
const { styleClassList } = useKitStyle(props);
|
|
247
268
|
|
|
248
|
-
const listItemAttrs = computed(() => (item:
|
|
269
|
+
const listItemAttrs = computed(() => (item: ICoreSelectOption) => ({
|
|
249
270
|
icon: item.icon,
|
|
250
271
|
active: actualValue.value === item.id,
|
|
251
272
|
title: item.name || '',
|
|
@@ -267,7 +288,7 @@ const classList = computed(() => [
|
|
|
267
288
|
|
|
268
289
|
defineSlots<{
|
|
269
290
|
default(props: ISelectSlotProps): any;
|
|
270
|
-
iconItem(props: { item:
|
|
291
|
+
iconItem(props: { item: ICoreSelectOption }): any;
|
|
271
292
|
header(props: { value: ICoreSelectProps['options'] }): any;
|
|
272
293
|
headerIcon(): any;
|
|
273
294
|
empty(): any;
|
|
@@ -485,10 +506,16 @@ defineSlots<{
|
|
|
485
506
|
#{$select} {
|
|
486
507
|
&__header {
|
|
487
508
|
pointer-events: none;
|
|
509
|
+
cursor: default;
|
|
488
510
|
}
|
|
489
511
|
|
|
490
512
|
&__input {
|
|
491
513
|
pointer-events: none;
|
|
514
|
+
cursor: default;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
&__arrow-wrapper {
|
|
518
|
+
display: none;
|
|
492
519
|
}
|
|
493
520
|
}
|
|
494
521
|
}
|
|
@@ -100,15 +100,20 @@ const nextSlide = () => {
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
+
const nextSlideCyclic = () => {
|
|
104
|
+
if (currentSlide.value >= props.images.length - 1) {
|
|
105
|
+
currentSlide.value = 0;
|
|
106
|
+
} else {
|
|
107
|
+
currentSlide.value += 1;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
103
111
|
let autoplayIntervalId: ReturnType<typeof setInterval> | null = null;
|
|
104
112
|
|
|
105
113
|
const startAutoplay = () => {
|
|
106
114
|
if (props.autoplay && !autoplayIntervalId) {
|
|
107
115
|
autoplayIntervalId = setInterval(() => {
|
|
108
|
-
|
|
109
|
-
if (currentSlide.value >= props.images.length - 1) {
|
|
110
|
-
currentSlide.value = 0; // Возвращаемся к первому слайду
|
|
111
|
-
}
|
|
116
|
+
nextSlideCyclic();
|
|
112
117
|
}, props.autoplayInterval);
|
|
113
118
|
}
|
|
114
119
|
};
|
package/src/types/calendar.d.ts
CHANGED
|
@@ -9,11 +9,14 @@ export interface IBaseCalendarProps {
|
|
|
9
9
|
modelValue?: DateRange
|
|
10
10
|
range?: boolean | RangeConfig | undefined
|
|
11
11
|
minDate?: Date | null
|
|
12
|
+
maxDate?: Date | null
|
|
12
13
|
readonly?: boolean
|
|
13
14
|
error?: string | boolean
|
|
14
15
|
inline?: boolean;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
export type TCoreCalendarProps = IBaseCalendarProps & ICoreSize;
|
|
18
|
+
export type TCoreCalendarProps = IBaseCalendarProps & ICoreSize & ICoreState;
|
|
18
19
|
|
|
19
|
-
export type TCoreInputCalendarProps = InputProps & ICoreSize & ICoreState & IBaseCalendarProps
|
|
20
|
+
export type TCoreInputCalendarProps = Omit<InputProps, 'modelValue'> & ICoreSize & ICoreState & IBaseCalendarProps & {
|
|
21
|
+
modelValue?: string | DateRange;
|
|
22
|
+
};
|
package/src/types/input.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type ICoreTextareaProps = ICoreState & TTextareaProps & ICoreSize;
|
|
|
26
26
|
export type TSelectValue = Nullable<string | number | boolean>;
|
|
27
27
|
|
|
28
28
|
type TOptionPhoneCountry = 'KZ' | 'RU' | 'KG' | 'UZ';
|
|
29
|
-
type TOptionCurrency = 'KZT' | 'RUB' | 'KGS' | 'UZS';
|
|
29
|
+
type TOptionCurrency = 'KZT' | 'RUB' | 'KGS' | 'UZS' | string;
|
|
30
30
|
export interface IOptionsSelect<T extends string> {
|
|
31
31
|
id: string;
|
|
32
32
|
name: string;
|
|
@@ -67,7 +67,7 @@ export interface ICoreSelectBaseProps {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export interface ISelectSlotProps {
|
|
70
|
-
item:
|
|
70
|
+
item: ICoreSelectOption;
|
|
71
71
|
index: number;
|
|
72
72
|
active: boolean;
|
|
73
73
|
}
|
package/webpack.config.js
CHANGED