@tinisoftin/tsdatagrid 1.0.0 → 1.0.1
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 +58 -29
- package/dist/components/TSDataGridFilter.vue.d.ts.map +1 -1
- package/dist/components/TSDataGridRow.vue.d.ts.map +1 -1
- package/dist/composables/useDataSource.d.ts.map +1 -1
- package/dist/{index-541cb5f8.js → index-c98abbc1.js} +8342 -8263
- package/dist/{index.es-713282db.js → index.es-7c52041f.js} +1 -1
- package/dist/tsdatagrid.es.js +1 -1
- package/dist/tsdatagrid.umd.js +61 -61
- package/dist/types/core/datasource.d.ts +2 -0
- package/dist/types/core/datasource.d.ts.map +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -123,50 +123,79 @@ import type { ColumnDefinition, DataSourceConfig } from 'tsdatagrid'
|
|
|
123
123
|
import { ColumnType, Alignment, DataSourceType } from 'tsdatagrid'
|
|
124
124
|
|
|
125
125
|
const columns = ref<ColumnDefinition[]>([
|
|
126
|
-
{
|
|
127
|
-
field: 'id',
|
|
128
|
-
title: 'ID',
|
|
129
|
-
type: ColumnType.Number,
|
|
126
|
+
{
|
|
127
|
+
field: 'id',
|
|
128
|
+
title: 'ID',
|
|
129
|
+
type: ColumnType.Number,
|
|
130
130
|
width: 80,
|
|
131
131
|
alignment: Alignment.Right
|
|
132
132
|
},
|
|
133
|
-
{
|
|
134
|
-
field: 'name',
|
|
135
|
-
title: 'Name',
|
|
136
|
-
type: ColumnType.String,
|
|
133
|
+
{
|
|
134
|
+
field: 'name',
|
|
135
|
+
title: 'Name',
|
|
136
|
+
type: ColumnType.String,
|
|
137
137
|
width: 200,
|
|
138
138
|
searchable: true
|
|
139
139
|
},
|
|
140
|
-
{
|
|
141
|
-
field: 'email',
|
|
142
|
-
title: 'Email',
|
|
143
|
-
type: ColumnType.String,
|
|
140
|
+
{
|
|
141
|
+
field: 'email',
|
|
142
|
+
title: 'Email',
|
|
143
|
+
type: ColumnType.String,
|
|
144
144
|
width: 250,
|
|
145
145
|
searchable: true
|
|
146
146
|
},
|
|
147
|
-
{
|
|
148
|
-
field: 'salary',
|
|
149
|
-
title: 'Salary',
|
|
150
|
-
type: ColumnType.Number,
|
|
147
|
+
{
|
|
148
|
+
field: 'salary',
|
|
149
|
+
title: 'Salary',
|
|
150
|
+
type: ColumnType.Number,
|
|
151
151
|
width: 120,
|
|
152
152
|
alignment: Alignment.Right,
|
|
153
153
|
formatter: (value) => `$${Number(value).toLocaleString()}`
|
|
154
154
|
},
|
|
155
|
-
{
|
|
156
|
-
field: 'hireDate',
|
|
157
|
-
title: 'Hire Date',
|
|
158
|
-
type: ColumnType.Date,
|
|
155
|
+
{
|
|
156
|
+
field: 'hireDate',
|
|
157
|
+
title: 'Hire Date',
|
|
158
|
+
type: ColumnType.Date,
|
|
159
159
|
width: 130,
|
|
160
160
|
formatter: (value) => new Date(value).toLocaleDateString()
|
|
161
|
+
},
|
|
162
|
+
// Example: Nested property
|
|
163
|
+
{
|
|
164
|
+
field: 'department.name',
|
|
165
|
+
title: 'Department',
|
|
166
|
+
type: ColumnType.String,
|
|
167
|
+
width: 150,
|
|
168
|
+
searchable: true
|
|
161
169
|
}
|
|
162
170
|
])
|
|
163
171
|
|
|
164
172
|
const dataSource = ref<DataSourceConfig>({
|
|
165
173
|
type: DataSourceType.Local,
|
|
166
174
|
data: [
|
|
167
|
-
{
|
|
168
|
-
|
|
169
|
-
|
|
175
|
+
{
|
|
176
|
+
id: 1,
|
|
177
|
+
name: 'John Doe',
|
|
178
|
+
email: 'john@example.com',
|
|
179
|
+
salary: 75000,
|
|
180
|
+
hireDate: '2020-01-15',
|
|
181
|
+
department: { name: 'Engineering', id: 1 }
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: 2,
|
|
185
|
+
name: 'Jane Smith',
|
|
186
|
+
email: 'jane@example.com',
|
|
187
|
+
salary: 85000,
|
|
188
|
+
hireDate: '2019-03-22',
|
|
189
|
+
department: { name: 'Sales', id: 2 }
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: 3,
|
|
193
|
+
name: 'Bob Johnson',
|
|
194
|
+
email: 'bob@example.com',
|
|
195
|
+
salary: 95000,
|
|
196
|
+
hireDate: '2018-07-10',
|
|
197
|
+
department: { name: 'Marketing', id: 3 }
|
|
198
|
+
}
|
|
170
199
|
]
|
|
171
200
|
})
|
|
172
201
|
</script>
|
|
@@ -180,14 +209,14 @@ const dataSource = ref<DataSourceConfig>({
|
|
|
180
209
|
|
|
181
210
|
```typescript
|
|
182
211
|
interface ColumnDefinition {
|
|
183
|
-
field: string // Field name in data
|
|
212
|
+
field: string // Field name in data (supports nested paths like 'user.name')
|
|
184
213
|
title: string // Column header text
|
|
185
214
|
type?: ColumnType // Column data type
|
|
186
215
|
width?: number | string // Column width
|
|
187
216
|
minWidth?: number // Minimum width
|
|
188
217
|
maxWidth?: number // Maximum width
|
|
189
218
|
alignment?: Alignment // Text alignment
|
|
190
|
-
|
|
219
|
+
|
|
191
220
|
// Features
|
|
192
221
|
sortable?: boolean // Enable sorting (default: true)
|
|
193
222
|
filterable?: boolean // Enable filtering (default: true)
|
|
@@ -196,14 +225,14 @@ interface ColumnDefinition {
|
|
|
196
225
|
resizable?: boolean // Enable resizing (default: true)
|
|
197
226
|
searchable?: boolean // Include in global search
|
|
198
227
|
locked?: boolean // Prevent hiding/reordering
|
|
199
|
-
|
|
228
|
+
|
|
200
229
|
// Display
|
|
201
230
|
visible?: boolean // Show/hide column (default: true)
|
|
202
231
|
cssClass?: string // Custom CSS class
|
|
203
|
-
|
|
232
|
+
|
|
204
233
|
// Custom rendering
|
|
205
234
|
formatter?: (value: any, row: any, column: ColumnDefinition) => string | number
|
|
206
|
-
|
|
235
|
+
|
|
207
236
|
// Editing
|
|
208
237
|
editor?: EditorConfig
|
|
209
238
|
validator?: (value: any) => boolean | string
|
|
@@ -1269,4 +1298,4 @@ This project is licensed under the MIT License - see the LICENSE file for detail
|
|
|
1269
1298
|
Made with ❤️ by the TSDataGrid Team
|
|
1270
1299
|
⭐ Star us on GitHub — it helps!
|
|
1271
1300
|
⬆ back to top
|
|
1272
|
-
</div>
|
|
1301
|
+
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TSDataGridFilter.vue.d.ts","sourceRoot":"","sources":["../../src/components/TSDataGridFilter.vue"],"names":[],"mappings":"AAyHA;AAEA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AAE9F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TSDataGridFilter.vue.d.ts","sourceRoot":"","sources":["../../src/components/TSDataGridFilter.vue"],"names":[],"mappings":"AAyHA;AAEA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AAE9F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;;;;;;;;;;;cAyjCjB,QAAQ,CAAC,gBAAgB,EAAE,CAAC;;;;cAI5B,QAAQ,CAAC,GAAG,EAAE,CAAC;;;;cAId,QAAQ,CAAC,gBAAgB,CAAC;;;;cAI1B,QAAQ,CAAC,eAAe,CAAC;;;;cAIzB,QAAQ,CAAC;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;;;;;;;;;;;;;;;;;;;;cAhBnC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;;;;cAI5B,QAAQ,CAAC,GAAG,EAAE,CAAC;;;;cAId,QAAQ,CAAC,gBAAgB,CAAC;;;;cAI1B,QAAQ,CAAC,eAAe,CAAC;;;;cAIzB,QAAQ,CAAC;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;;;;;;;;;;;;;WAApB,MAAM;WAAK,MAAM;;;;;AA/BnD,wBAoCG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TSDataGridRow.vue.d.ts","sourceRoot":"","sources":["../../src/components/TSDataGridRow.vue"],"names":[],"mappings":"AAwCA;AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"TSDataGridRow.vue.d.ts","sourceRoot":"","sources":["../../src/components/TSDataGridRow.vue"],"names":[],"mappings":"AAwCA;AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAyG3C,iBAAS,cAAc;;;;MA2H+D,GAAG,GAIxF;AA4CD,QAAA,MAAM,eAAe;;cAOD,QAAQ,CAAC,GAAG,CAAC;;;;cAId,QAAQ,CAAC,gBAAgB,EAAE,CAAC;;;;;;;;;;;;cAY3B,QAAQ,CAAC,GAAG,CAAC;;;;cAIb,QAAQ,CAAC,GAAG,CAAC;;;;;;;;;;;cApBb,QAAQ,CAAC,GAAG,CAAC;;;;cAId,QAAQ,CAAC,gBAAgB,EAAE,CAAC;;;;;;;;;;;;cAY3B,QAAQ,CAAC,GAAG,CAAC;;;;cAIb,QAAQ,CAAC,GAAG,CAAC;;;;;;;;;;;;;4EAK/B,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDataSource.d.ts","sourceRoot":"","sources":["../../src/composables/useDataSource.ts"],"names":[],"mappings":"AAAA;;;GAGG;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