plugin-ui-for-kzt 0.0.25 → 0.0.27

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/example/App.vue CHANGED
@@ -2,210 +2,17 @@
2
2
  <div class="demo-page">
3
3
  <h1>Plugin UI KZT - Компоненты</h1>
4
4
  <section>
5
- <BaseTable
6
- :data="[]"
7
- :columns="columns3"
8
- :actions="actions"
9
- show-row-selection
10
- show-actions
11
- @update:selected="onUpdateSelected"
12
- />
13
- </section>
14
- <section>
15
- <BaseTable
16
- :data="rows"
17
- :columns="columns2"
18
- :actions="actions"
19
- :pagination="{ totalPages: 5 }"
20
- show-row-selection
21
- show-actions
22
- @update:selected="onUpdateSelected"
23
- />
24
- </section>
25
- <section>
26
- <BaseTable
27
- :columns="columns"
28
- :data="people"
29
- :pagination="{ perPage: 5, size: 'small' }"
30
- show-row-selection
31
- checkbox-title="Выбрать"
32
- show-actions
33
- :actions="rowActions"
34
- @update:selected="onRowsSelected"
35
- @sort-change="onSort"
36
- @page-change="onPage"
37
- >
38
- <template #header>
39
- <tr>
40
- <th>
41
- <BaseCheckbox
42
- v-model="selectAll"
43
- id="selectAll"
44
- />
45
- </th>
46
- <th v-for="col in columns" :key="col.key">
47
- <div>
48
- <component v-if="col.icons?.[0]" :is="col.icons[0]" />
49
- <span>{{ col.label }}</span>
50
- <BaseIcon
51
- :name="sortOrder === 'asc' ? 'arrow-up' : 'arrow-down'"
52
- size="extra-small"
53
- />
54
- </div>
55
- </th>
56
-
57
- <th>Действия</th>
58
- </tr>
59
- </template>
60
- <template #cell-country="{ row, value }">
61
- <span>{{ value }}</span>
62
- <BaseIcon v-if="row.country === 'Россия'" name="RU" size="extra-small" />
63
- </template>
64
-
65
- <template #row-menu="{ row }: Row">
66
- <BaseDropdown
67
- v-model="row.dropdownVisible"
68
- parent-width
69
- transition-name="top"
70
- auto-close
71
- >
72
- <template #top>
73
- <BaseButton
74
- color="quaternary"
75
- size="extra-small"
76
- >
77
- <BaseIcon
78
- name="ellipsis"
79
- size="small"
80
- />
81
- </BaseButton>
82
- </template>
83
- <template #dropdown>
84
- <div style="display: flex; flex-direction: column; gap: 8px; padding: 8px; text-align: left;">
85
- <div @click="edit(row)">Редактировать</div>
86
- <div @click="remove(row)">Удалить</div>
87
- </div>
88
- </template>
89
- </BaseDropdown>
90
- </template>
91
-
92
- <template #empty>
93
- <div>Нет записей</div>
94
- </template>
95
-
96
- </BaseTable>
5
+ <base-calendar v-model="testDate" inline />
97
6
  </section>
98
7
  </div>
99
8
  </template>
100
9
  <script setup lang="ts">
101
- import { ref } from 'vue'
102
- import type { Column, Action, Row } from '../src/types/table'
103
-
104
- interface Person {
105
- id: string
106
- name: string
107
- country: string
108
- dropdownVisible: boolean
109
- }
110
-
111
- /* ---------- Данные ---------- */
112
- const people = ref<Person[]>([
113
- { id: '1', name: 'Иван', country: 'Россия', dropdownVisible: false },
114
- { id: '2', name: 'Иван 2', country: 'США', dropdownVisible: false },
115
- { id: '3', name: 'Maria', country: 'Бразилия', dropdownVisible: false },
116
- ])
117
-
118
- const sortOrder = ref('asc')
119
-
120
- /* ---------- Колонки ---------- */
121
- const columns: Column[] = [
122
- { key: 'name', label: 'Имя', sortable: true, dropdownVisible: false },
123
- {
124
- key: 'country',
125
- label: 'Страна',
126
- sortable: true,
127
- dropdownVisible: false,
128
- }
129
- ]
130
-
131
- /* ---------- Действия в колонке "actions" ---------- */
132
- const rowActions: Action[] = [
133
- {
134
- key: 'delete',
135
- icon: 'trash',
136
- handler: (row: Row) => console.log('Удаляем', row)
137
- },
138
- {
139
- key: 'help',
140
- icon: 'help',
141
- handler: (row: Row) => console.log('Редактируем', row)
142
- }
143
- ]
10
+ import { ref, watch } from 'vue'
144
11
 
145
- interface UserRow {
146
- id: string
147
- name: string
148
- age: number
149
- disabled?: boolean
150
- }
151
-
152
- /* Данные */
153
- const rows: UserRow[] = [
154
- { id: '1', name: 'Иван', age: 30, disabled: true },
155
- { id: '2', name: 'Мария', age: 25 },
156
- { id: '3', name: 'Мария 2', age: 21 },
157
- { id: '4', name: 'Иван 1', age: 30 },
158
- { id: '5', name: 'Мария 3', age: 25 },
159
- { id: '6', name: 'Мария 4', age: 21 },
160
- { id: '7', name: 'Иван 2', age: 30 },
161
- { id: '8', name: 'Мария 5', age: 25 },
162
- { id: '9', name: 'Мария 6', age: 21 },
163
- ]
164
-
165
- /* Колонки. icons может быть пустым массивом – теперь тип валиден */
166
- const columns2 = [
167
- { key: 'name', label: 'Имя', icons: [] },
168
- { key: 'age', label: 'Возраст', sortable: true, icons: [] },
169
- ]
170
- const columns3 = [
171
- { key: 'name', label: 'Имя', icons: [] },
172
- { key: 'age', label: 'Возраст', sortable: true, icons: [] },
173
- ]
174
-
175
- /* Действия */
176
- const actions = [
177
- {
178
- key: 'edit-table',
179
- icon: 'edit-table',
180
- handler: (row: UserRow) => console.log('Edit', row),
181
- },
182
- ]
183
-
184
- function onUpdateSelected(selected: UserRow[]) {
185
- console.log('Выбрано строк:', selected)
186
- }
187
-
188
- /* ---------- События ---------- */
189
- function onRowsSelected(selected: Person[]) {
190
- console.log('Выбрано строк:', selected)
191
- }
192
- function onSort(payload: { key: keyof Person; order: 'asc' | 'desc' }) {
193
- console.log('Сортировка', payload)
194
- }
195
- function onPage(page: number) {
196
- console.log('Переходим на страницу', page)
197
- }
198
-
199
- /* ---------- Управление чек‑боксом "select all" (если понадобится) ---------- */
200
- const selectAll = ref(false);
201
-
202
- const edit = (row: Row) => {
203
- console.log('click edit', row)
204
- }
205
-
206
- const remove = (row: Row) => {
207
- console.log('click remove', row)
208
- }
12
+ const testDate = ref(new Date())
13
+ watch(()=> testDate.value,
14
+ ()=> console.log('test Date', testDate.value)
15
+ )
209
16
  </script>
210
17
 
211
18
  <style lang="scss" scoped>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugin-ui-for-kzt",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "plugin-ui for kazaktelekom",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -5,6 +5,7 @@
5
5
  :range="range"
6
6
  locale="ru"
7
7
  auto-apply
8
+ :inline="inline"
8
9
  :text-input="textInputOptions"
9
10
  :hide-navigation="['time']"
10
11
  :min-date="minDate || undefined"
@@ -37,6 +38,7 @@ const props = withDefaults(defineProps<TCoreCalendarProps>(), {
37
38
  range: false,
38
39
  minDate: null,
39
40
  size: 'medium',
41
+ inline: false,
40
42
  });
41
43
 
42
44
  const emit: (event: 'update:modelValue', value: DateRange) => void = defineEmits();
@@ -98,6 +98,7 @@ import 'vue-virtual-scroller/dist/vue-virtual-scroller.css';
98
98
  import { DynamicScroller, DynamicScrollerItem } from 'vue-virtual-scroller';
99
99
  import type { ICoreSelectProps, TSelectValue, ICoreSelectBaseProps, ICoreSelectOption, ISelectSlotProps } from '../../types/input';
100
100
  import BaseDropdown from '../BaseDropdown/BaseDropdown.vue';
101
+ import BaseIcon from '../BaseIcon/BaseIcon.vue';
101
102
  import BaseOpenedListItem from '../BaseOpenedListItem/BaseOpenedListItem.vue';
102
103
  import { useKitSize } from '../../composables/kit/size';
103
104
  import { useKitState } from '../../composables/kit/state';
@@ -11,6 +11,7 @@ export interface IBaseCalendarProps {
11
11
  minDate?: Date | null
12
12
  readonly?: boolean
13
13
  error?: string | boolean
14
+ inline?: boolean;
14
15
  }
15
16
 
16
17
  export type TCoreCalendarProps = IBaseCalendarProps & ICoreSize;