plugin-ui-for-kzt 0.0.60 → 0.0.62

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 (25) hide show
  1. package/dist/components/BaseButton/BaseButton.vue.d.ts +6 -2
  2. package/dist/components/BaseCalendar/BaseCalendar.vue.d.ts +2 -2
  3. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +7 -3
  4. package/dist/components/BaseDropdown/BaseDropdown.vue.d.ts +6 -2
  5. package/dist/components/BaseField/BaseField.vue.d.ts +3 -3
  6. package/dist/components/BaseInput/BaseInput.vue.d.ts +4 -4
  7. package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +6 -6
  8. package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +6 -6
  9. package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +4 -4
  10. package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +4 -4
  11. package/dist/components/BaseInputWithSelector/BaseInputWithSelector.vue.d.ts +1 -1
  12. package/dist/components/BaseOpenedListItem/BaseOpenedListItem.vue.d.ts +6 -2
  13. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +7 -3
  14. package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +6 -2
  15. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +22 -5
  16. package/dist/components/BaseSiteInput/BaseSiteInput.vue.d.ts +1 -1
  17. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +4 -4
  18. package/dist/components/BaseToggle/BaseToggle.vue.d.ts +7 -3
  19. package/dist/index.js +1 -1
  20. package/dist/store/modal.d.ts +13 -13
  21. package/package.json +1 -1
  22. package/src/components/BaseSelect/BaseSelect.vue +24 -4
  23. package/src/components/BaseSelect/README.md +4 -0
  24. package/src/types/input.d.ts +1 -0
  25. package/.claude/settings.local.json +0 -7
@@ -36,7 +36,7 @@ export declare const useModalStore: import("pinia").StoreDefinition<"modal", {
36
36
  template?: string | object | undefined;
37
37
  render?: Function | undefined;
38
38
  components?: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>> | undefined;
39
- directives?: Record<string, import("vue").Directive<any, any, string, string>> | undefined;
39
+ directives?: Record<string, import("vue").Directive<any, any, string, any>> | undefined;
40
40
  inheritAttrs?: boolean | undefined;
41
41
  emits?: any;
42
42
  slots?: {} | undefined;
@@ -113,18 +113,18 @@ export declare const useModalStore: import("pinia").StoreDefinition<"modal", {
113
113
  filters?: Record<string, Function> | undefined;
114
114
  mixins?: any[] | undefined;
115
115
  extends?: any;
116
- beforeCreate?: (() => void) | undefined;
117
- created?: (() => void) | undefined;
118
- beforeMount?: (() => void) | undefined;
119
- mounted?: (() => void) | undefined;
120
- beforeUpdate?: (() => void) | undefined;
121
- updated?: (() => void) | undefined;
122
- activated?: (() => void) | undefined;
123
- deactivated?: (() => void) | undefined;
124
- beforeDestroy?: (() => void) | undefined;
125
- beforeUnmount?: (() => void) | undefined;
126
- destroyed?: (() => void) | undefined;
127
- unmounted?: (() => void) | undefined;
116
+ beforeCreate?: (() => any) | undefined;
117
+ created?: (() => any) | undefined;
118
+ beforeMount?: (() => any) | undefined;
119
+ mounted?: (() => any) | undefined;
120
+ beforeUpdate?: (() => any) | undefined;
121
+ updated?: (() => any) | undefined;
122
+ activated?: (() => any) | undefined;
123
+ deactivated?: (() => any) | undefined;
124
+ beforeDestroy?: (() => any) | undefined;
125
+ beforeUnmount?: (() => any) | undefined;
126
+ destroyed?: (() => any) | undefined;
127
+ unmounted?: (() => any) | undefined;
128
128
  renderTracked?: ((e: import("vue").DebuggerEvent) => void) | undefined;
129
129
  renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | undefined;
130
130
  errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugin-ui-for-kzt",
3
- "version": "0.0.60",
3
+ "version": "0.0.62",
4
4
  "description": "plugin-ui for kazaktelekom",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -71,7 +71,20 @@
71
71
  @input="handleInputChange"
72
72
  >
73
73
  <template #left-icon>
74
+ <div
75
+ v-if="actualOption?.icon && $slots.iconItem"
76
+ class="base-select__header_prefix_icon"
77
+ >
78
+ <slot name="iconItem" :item="actualOption"/>
79
+ </div>
80
+ <div
81
+ v-else-if="$slots.headerIcon"
82
+ class="base-select__header_prefix_icon"
83
+ >
84
+ <slot name="headerIcon"/>
85
+ </div>
74
86
  <base-icon
87
+ v-else
75
88
  name="search"
76
89
  :size="size"
77
90
  />
@@ -153,6 +166,7 @@ const props = withDefaults( defineProps<ICoreSelectProps & {
153
166
  options: () => [] as ICoreSelectOption[],
154
167
  size: 'medium',
155
168
  searchable: false,
169
+ clearOnSelect: false,
156
170
  } );
157
171
 
158
172
  const emit = defineEmits<{
@@ -186,13 +200,19 @@ watch( () => props.modelValue, ( val ) => {
186
200
  }
187
201
  }, { immediate: true } );
188
202
 
189
- function handleInput( value: TSelectValue ) {
203
+ function handleInput( value: TSelectValue, isOptionSelection = false ) {
190
204
  if ( props.readonly || props.disabled ) {
191
205
  return;
192
206
  }
193
207
  actualValue.value = value;
194
208
  emit( 'update:modelValue', value );
195
209
  emit( 'change', value );
210
+
211
+ if ( props.clearOnSelect && isOptionSelection ) {
212
+ actualValue.value = '';
213
+ emit( 'update:modelValue', '' );
214
+ }
215
+
196
216
  dropdownVisible.value = false;
197
217
  searchQuery.value = '';
198
218
  }
@@ -213,7 +233,7 @@ function handleInputChange( event: Event ) {
213
233
  );
214
234
 
215
235
  if ( exactMatch ) {
216
- handleInput( exactMatch.id );
236
+ handleInput( exactMatch.id, true );
217
237
  return;
218
238
  }
219
239
 
@@ -282,7 +302,7 @@ const listItemAttrs = computed( () => ( item: ICoreSelectOption ) => ({
282
302
  style: item.style,
283
303
  disabled: item.disabled,
284
304
  class: 'base-select__item',
285
- onClick: () => handleInput( item.id ),
305
+ onClick: () => handleInput( item.id, true ),
286
306
  }) );
287
307
 
288
308
  const classList = computed( () => [
@@ -565,4 +585,4 @@ defineSlots<{
565
585
  }
566
586
  }
567
587
  }
568
- </style>
588
+ </style>
@@ -30,6 +30,7 @@
30
30
  v-model="selectedEmployee"
31
31
  :options="employeeOptions"
32
32
  searchable
33
+ clear-on-select
33
34
  placeholder="Найти сотрудника..."
34
35
  label="Выберите сотрудника"
35
36
  :error="employeeError"
@@ -158,6 +159,9 @@ const handleSearchError = () => {
158
159
  - `searchable?: boolean`
159
160
  **Включает режим поиска. При `true` заменяет обычный заголовок на поле ввода для поиска. Идеально подходит для server-side поиска больших наборов данных.
160
161
 
162
+ - `clearOnSelect?: boolean`
163
+ Очищает текущее значение после выбора опции. При этом событие `change` получает выбранный `id`, а `v-model` возвращается в пустое значение.
164
+
161
165
  - `multiple?: boolean`
162
166
  Поддержка множественного выбора (не реализовано в текущем компоненте, зарезервировано).
163
167
 
@@ -65,6 +65,7 @@ export interface ICoreSelectBaseProps {
65
65
  label?: string
66
66
  hint?: string
67
67
  searchable?: boolean
68
+ clearOnSelect?: boolean
68
69
  variant?: 'variant-blue'
69
70
  }
70
71
 
@@ -1,7 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(npm run build:*)"
5
- ]
6
- }
7
- }