@opengis/table 0.0.1 → 0.0.11

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/README.md CHANGED
@@ -1,25 +1,25 @@
1
1
  # DataTable Component
2
2
 
3
- Повнофункціональний компонент таблиці для Vue 3 з TypeScript, який підтримує пагінацію, вибір рядків, сортування та кастомні слоти.
3
+ Full-featured table component for Vue 3 with TypeScript, supporting pagination, row selection, sorting, and custom slots.
4
4
 
5
- ## Особливості
5
+ ## Features
6
6
 
7
- - ✅ Пагінація з локальними даними або через API
8
- - ✅ Вибір рядків з чекбоксами
9
- - ✅ Різні розміри таблиці (small, medium, large)
10
- - ✅ Форматування даних (текст, числа, дати, бейджі, масиви)
11
- - ✅ **Кастомні слоти для колонок**
12
- - ✅ Стан завантаження та обробка помилок
13
- - ✅ Темна тема
14
- - ✅ Адаптивний дизайн
7
+ - ✅ Pagination with local data or through API
8
+ - ✅ Row selection with checkboxes
9
+ - ✅ Different table sizes (small, medium, large)
10
+ - ✅ Data formatting (text, numbers, dates, badges, arrays)
11
+ - ✅ **Custom slots for columns**
12
+ - ✅ Loading state and error handling
13
+ - ✅ Dark theme
14
+ - ✅ Adaptive design
15
15
 
16
- ## Кастомні слоти колонок
16
+ ## Custom column slots
17
17
 
18
- Компонент підтримує кастомні слоти для створення власної верстки в колонках. Використовуйте `template #body` в компоненті `Column`:
18
+ The component supports custom slots to create custom table cells. Use `template #body` in the `Column` component:
19
19
 
20
20
  ```vue
21
21
  <DataTable :rows="data" tableClass="w-full" tableStyle="min-width: 50rem">
22
- <Column field="name" header="Назва">
22
+ <Column field="name" header="Name">
23
23
  <template #body="{ data }">
24
24
  <div>
25
25
  <div class="font-medium">{{ data.name.main }}</div>
@@ -27,20 +27,20 @@
27
27
  </div>
28
28
  </template>
29
29
  </Column>
30
- <Column field="status" header="Статус">
30
+ <Column field="status" header="Status">
31
31
  <template #body="{ data }">
32
32
  <span :class="getStatusClass(data.status)" class="px-2 py-1 rounded-full text-xs">
33
33
  {{ data.status }}
34
34
  </span>
35
35
  </template>
36
36
  </Column>
37
- <Column field="actions" header="Дії">
37
+ <Column field="actions" header="Actions">
38
38
  <template #body="{ data }">
39
39
  <div class="flex gap-2">
40
- <button @click="handleView(data)" title="Переглянути">
40
+ <button @click="handleView(data)" title="View">
41
41
  <i class="fas fa-eye"></i>
42
42
  </button>
43
- <button @click="handleEdit(data)" title="Редагувати">
43
+ <button @click="handleEdit(data)" title="Edit">
44
44
  <i class="fas fa-edit"></i>
45
45
  </button>
46
46
  </div>
@@ -49,18 +49,18 @@
49
49
  </DataTable>
50
50
  ```
51
51
 
52
- ### Параметри слоту
52
+ ### Slot parameters
53
53
 
54
- Слот `#body` отримує об'єкт з наступними властивостями:
54
+ The `#body` slot receives an object with the following properties:
55
55
 
56
- - `data` - повний об'єкт рядка даних
57
- - `value` - значення конкретного поля колонки
56
+ - `data` - full row data object
57
+ - `value` - value of the specific column field
58
58
 
59
- ### Приклади використання
59
+ ### Examples
60
60
 
61
- #### 1. Складена назва з підзаголовком
61
+ #### 1. Compound name with subtitle
62
62
  ```vue
63
- <Column field="name" header="Назва">
63
+ <Column field="name" header="Name">
64
64
  <template #body="{ data }">
65
65
  <div>
66
66
  <div class="font-medium">{{ data.name.main }}</div>
@@ -70,11 +70,11 @@
70
70
  </Column>
71
71
  ```
72
72
 
73
- #### 2. Бейдж з кольором
73
+ #### 2. Badge with color
74
74
  ```vue
75
- <Column field="role" header="Роль">
75
+ <Column field="role" header="Role">
76
76
  <template #body="{ data }">
77
- <span :class="data.role === 'Заявник' ? 'bg-blue-100 text-blue-800' : 'bg-green-100 text-green-800'"
77
+ <span :class="data.role === 'admin' ? 'bg-blue-100 text-blue-800' : 'bg-green-100 text-green-800'"
78
78
  class="px-2 py-1 rounded-full text-xs font-medium">
79
79
  {{ data.role }}
80
80
  </span>
@@ -82,9 +82,9 @@
82
82
  </Column>
83
83
  ```
84
84
 
85
- #### 3. Статус з іконкою
85
+ #### 3. Status with icon
86
86
  ```vue
87
- <Column field="status" header="Статус">
87
+ <Column field="status" header="Status">
88
88
  <template #body="{ data }">
89
89
  <div class="flex items-center gap-2">
90
90
  <span :class="getStatusIconClass(data.status)" class="text-lg">
@@ -96,15 +96,15 @@
96
96
  </Column>
97
97
  ```
98
98
 
99
- #### 4. Кнопки дій
99
+ #### 4. Action buttons
100
100
  ```vue
101
- <Column field="actions" header="Дії">
101
+ <Column field="actions" header="Actions">
102
102
  <template #body="{ data }">
103
103
  <div class="flex gap-2">
104
- <button @click.stop="handleView(data)" title="Переглянути">
104
+ <button @click.stop="handleView(data)" title="View">
105
105
  <i class="fas fa-eye"></i>
106
106
  </button>
107
- <button @click.stop="handleDownload(data)" title="Завантажити">
107
+ <button @click.stop="handleDownload(data)" title="Download">
108
108
  <i class="fas fa-download"></i>
109
109
  </button>
110
110
  </div>
@@ -112,15 +112,15 @@
112
112
  </Column>
113
113
  ```
114
114
 
115
- **Важливо:** Використовуйте `@click.stop` для кнопок в слотах, щоб уникнути спрацьовування кліку по рядку таблиці.
115
+ **Important:** Use `@click.stop` for buttons in slots to prevent row click triggering.
116
116
 
117
- ## Встановлення
117
+ ## Installation
118
118
 
119
119
  ```bash
120
- npm install @your-org/datatable
120
+ npm install @opengis/table
121
121
  ```
122
122
 
123
- ## Використання
123
+ ## Usage
124
124
 
125
125
  ```vue
126
126
  <template>
@@ -133,7 +133,7 @@ npm install @your-org/datatable
133
133
  </template>
134
134
 
135
135
  <script setup>
136
- import { DataTable, Column } from '@your-org/datatable';
136
+ import { DataTable, Column } from '@opengis/table';
137
137
 
138
138
  const data = ref([
139
139
  { id: 1, name: 'Product A', category: 'Electronics' },
@@ -148,19 +148,12 @@ const columns = ref([
148
148
  </script>
149
149
  ```
150
150
 
151
- ## Пропси
151
+ ## Theme options
152
152
 
153
- | Пропс | Тип | За замовчуванням | Опис |
153
+ | Prop | Type | Default | Description |
154
154
  |-------|-----|------------------|------|
155
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'light'` | Тема таблиці |
155
+ | `theme` | `'light' \| 'dark' \| 'auto'` | `'light'` | Table theme |
156
156
 
157
- ## Встановлення
158
-
159
- ```bash
160
- npm install
161
- npm run dev
162
- ```
163
-
164
- ## Ліцензія
157
+ ## License
165
158
 
166
159
  MIT
package/index.css ADDED
@@ -0,0 +1 @@
1
+ .badge[data-v-aaab5e06]{transition:all .2s ease-in-out}.badge[data-v-aaab5e06]:hover{transform:scale(1.05)}