plugin-ui-for-kzt 0.0.30 → 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.
Files changed (38) hide show
  1. package/dist/components/BaseBadge/BaseBadge.vue.d.ts +1 -1
  2. package/dist/components/BaseCalendar/BaseCalendar.vue.d.ts +45 -1
  3. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +2 -2
  4. package/dist/components/BaseDefaultPages/BaseDefaultPages.vue.d.ts +2 -0
  5. package/dist/components/BaseDropdown/BaseDropdown.vue.d.ts +1 -1
  6. package/dist/components/BaseInput/BaseInput.vue.d.ts +2 -2
  7. package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +17 -8
  8. package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +9 -2
  9. package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +2 -2
  10. package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +2 -2
  11. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +2 -2
  12. package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +1 -1
  13. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +3 -3
  14. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +2 -2
  15. package/dist/components/BaseToggle/BaseToggle.vue.d.ts +2 -2
  16. package/dist/index.js +1 -1
  17. package/example/App.vue +62 -270
  18. package/example/MyCustomModal.vue +1 -0
  19. package/package.json +1 -1
  20. package/src/assets/icons/calendar.svg +2 -2
  21. package/src/components/BaseCalendar/BaseCalendar.vue +28 -3
  22. package/src/components/BaseDefaultPages/BaseDefaultPages.vue +0 -9
  23. package/src/components/BaseIcon/BaseIcon.vue +1 -1
  24. package/src/components/BaseInputCalendar/BaseInputCalendar.vue +40 -5
  25. package/src/components/BaseInputCurrency/BaseInputCurrency.vue +21 -10
  26. package/src/components/BaseInputPhone/BaseInputPhone.vue +3 -3
  27. package/src/components/BaseModal/BaseModal.vue +1 -3
  28. package/src/components/BaseSelect/BaseSelect.vue +33 -6
  29. package/src/components/BaseSwiper/BaseSwiper.vue +9 -4
  30. package/src/components/BaseTextarea/BaseTextarea.vue +1 -0
  31. package/src/types/calendar.d.ts +5 -2
  32. package/src/types/default-pages.d.ts +1 -0
  33. package/src/types/input.d.ts +2 -2
  34. package/webpack.config.js +4 -0
  35. package/dist/assets/0e28e37419c99ac65b12.png +0 -0
  36. package/dist/assets/264165b2b0e8a6840eb0.png +0 -0
  37. /package/{src/assets → example}/404.png +0 -0
  38. /package/{src/assets → example}/tech-work.png +0 -0
@@ -137,7 +137,7 @@ const handleInput = (value: string) => {
137
137
  &.--small-size {
138
138
  #{$input} {
139
139
  :deep(.base-select) {
140
- width: 71px;
140
+ width: auto;
141
141
  }
142
142
  }
143
143
  }
@@ -145,7 +145,7 @@ const handleInput = (value: string) => {
145
145
  &.--medium-size {
146
146
  #{$input} {
147
147
  &__select {
148
- width: 75px;
148
+ width: auto;
149
149
  }
150
150
  }
151
151
  }
@@ -153,7 +153,7 @@ const handleInput = (value: string) => {
153
153
  &.--large-size {
154
154
  #{$input} {
155
155
  &__select {
156
- width: 87px;
156
+ width: auto;
157
157
  }
158
158
  }
159
159
  }
@@ -67,7 +67,6 @@ const handleOverlayClick = (id: string) => {
67
67
  .base-modal {
68
68
  background: var(--primary-black-white);
69
69
  border-radius: var(--corner-radius-m);
70
- overflow: hidden;
71
70
  min-width: 335px;
72
71
  transform: scale(0.7);
73
72
  animation: slideIn 0.3s ease forwards;
@@ -130,8 +129,7 @@ const handleOverlayClick = (id: string) => {
130
129
  }
131
130
 
132
131
  &__content {
133
- max-height: 70vh;
134
- overflow-y: auto;
132
+ max-height: 80vh;
135
133
  color: var(--primary-text-tertiary);
136
134
  font: var(--typography-text-s-regular);
137
135
 
@@ -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 v-if="$slots.headerIcon" class="base-select__header_prefix_icon">
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
- actualValue.value = val ?? '';
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: ICoreSelectBaseProps) => ({
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: ICoreSelectBaseProps }): any;
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
- nextSlide();
109
- if (currentSlide.value >= props.images.length - 1) {
110
- currentSlide.value = 0; // Возвращаемся к первому слайду
111
- }
116
+ nextSlideCyclic();
112
117
  }, props.autoplayInterval);
113
118
  }
114
119
  };
@@ -8,6 +8,7 @@
8
8
  v-bind="stateAttrs"
9
9
  :placeholder="placeholder || ''"
10
10
  :maxlength="maxLength"
11
+ :readonly="readonly"
11
12
  class="base-textarea__field"
12
13
  @input="handleInput"
13
14
  />
@@ -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
+ };
@@ -3,4 +3,5 @@ export interface IDefaultPagesProps {
3
3
  description: string;
4
4
  buttonText: string;
5
5
  type: 'tech-work' | '404'
6
+ imagePath: string;
6
7
  }
@@ -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: ICoreSelectBaseProps;
70
+ item: ICoreSelectOption;
71
71
  index: number;
72
72
  active: boolean;
73
73
  }
package/webpack.config.js CHANGED
@@ -61,6 +61,10 @@ module.exports = (env, argv) => {
61
61
  extract: true,
62
62
  spriteFilename: "sprite.svg",
63
63
  publicPath: isProduction ? "./" : "/",
64
+ symbolId: (filePath) => {
65
+ const fileName = path.basename(filePath, ".svg");
66
+ return fileName;
67
+ },
64
68
  },
65
69
  },
66
70
  {
File without changes
File without changes