@inandu-solutions/grid-vue 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +196 -3
- package/dist/components/DataRow.vue.d.ts +34 -0
- package/dist/components/EditCell.vue.d.ts +16 -0
- package/dist/components/FilterControl.vue.d.ts +16 -0
- package/dist/components/InanduGrid.vue.d.ts +231 -0
- package/dist/components/internal.d.ts +60 -0
- package/dist/components/types.d.ts +6 -0
- package/dist/composables/useInanduGrid.d.ts +260 -0
- package/dist/composables/useInanduGridServer.d.ts +53 -0
- package/dist/core/aggregate.d.ts +5 -0
- package/dist/core/columns.d.ts +11 -0
- package/dist/core/constants.d.ts +14 -0
- package/dist/core/dom.d.ts +8 -0
- package/dist/core/export/csv.d.ts +2 -0
- package/dist/core/export/download.d.ts +2 -0
- package/dist/core/export/markup.d.ts +2 -0
- package/dist/core/export/pdf.d.ts +3 -0
- package/dist/core/filter.d.ts +26 -0
- package/dist/core/format.d.ts +24 -0
- package/dist/core/i18n/en.d.ts +46 -0
- package/dist/core/i18n/es.d.ts +46 -0
- package/dist/core/i18n/fr.d.ts +46 -0
- package/dist/core/i18n/index.d.ts +8 -0
- package/dist/core/i18n/it.d.ts +46 -0
- package/dist/core/i18n/zh.d.ts +46 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/parse.d.ts +14 -0
- package/dist/core/sort.d.ts +1 -0
- package/dist/core/tree.d.ts +28 -0
- package/dist/core/types.d.ts +46 -0
- package/dist/inandu-grid-vue.cjs +3 -0
- package/dist/inandu-grid-vue.js +1973 -0
- package/dist/index.d.ts +13 -0
- package/dist/style.css +358 -0
- package/dist/utils/exporters.d.ts +29 -0
- package/dist/utils/measureColumn.d.ts +15 -0
- package/dist/utils/translate.d.ts +10 -0
- package/package.json +92 -6
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { default as InanduGrid } from './components/InanduGrid.vue';
|
|
2
|
+
export type { InanduGridCellRangeSelection } from './components/types';
|
|
3
|
+
export { useInanduGrid } from './composables/useInanduGrid';
|
|
4
|
+
export { useInanduGridServer, buildInanduGridQuery } from './composables/useInanduGridServer';
|
|
5
|
+
export type { InanduGridServerOptions, InanduGridServerResult, InanduGridQueryOptions, } from './composables/useInanduGridServer';
|
|
6
|
+
export type { InanduGridServerQuery, InanduGridApi, InanduGridCellPaste, InanduGridColumn, InanduGridGroup, InanduGridRowSave, InanduGridSort, UseInanduGridOptions, InanduCellRenderContext, InanduHeaderRenderContext, InanduEditRenderContext, } from './composables/useInanduGrid';
|
|
7
|
+
export type { InanduColumnType, InanduColumnStickySide, InanduColumnAggregate, InanduGridRow, InanduGridColumnFilterValue, ColumnConfig, NumberFormatter, TreeVisibleRow, } from './core';
|
|
8
|
+
export { compareCellValues, formatCellValue, matchesColumnFilter, computeGroupAggregates, AGGREGATE_SYMBOLS } from './core';
|
|
9
|
+
export { en, es, fr, it, zh, INANDU_GRID_TRANSLATIONS } from './core';
|
|
10
|
+
export { createTranslator, interpolate } from './utils/translate';
|
|
11
|
+
export type { InanduGridMessageKey } from './utils/translate';
|
|
12
|
+
export { exportCsv, exportExcel, exportPdf, printTable, buildCsv, buildExcelXml } from './utils/exporters';
|
|
13
|
+
export { measureColumnContentWidth } from './utils/measureColumn';
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional default styling for <InanduGrid>. Every selector below targets a className the
|
|
3
|
+
* component already renders (see InanduGrid.vue) — nothing here is required for the grid to
|
|
4
|
+
* function; skip this file entirely and bring your own CSS if you'd rather start from a blank
|
|
5
|
+
* table. Import once, anywhere in your app:
|
|
6
|
+
*
|
|
7
|
+
* import '@inandu-solutions/grid-vue/style.css';
|
|
8
|
+
*
|
|
9
|
+
* Colors/spacing are CSS custom properties on .inandu-grid-vue, so overriding the look is just
|
|
10
|
+
* redeclaring them on your own selector — no !important, no rebuilding the package.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
.inandu-grid-vue {
|
|
14
|
+
--ig-accent: #1a8fae;
|
|
15
|
+
--ig-accent-ink: #ffffff;
|
|
16
|
+
--ig-ink: #1b1f24;
|
|
17
|
+
--ig-muted: #5c6470;
|
|
18
|
+
--ig-border: #e2e5e9;
|
|
19
|
+
--ig-header-bg: #f6f7f8;
|
|
20
|
+
--ig-row-bg: #ffffff;
|
|
21
|
+
--ig-row-alt-bg: #fafbfc;
|
|
22
|
+
--ig-row-hover-bg: #eef6f8;
|
|
23
|
+
--ig-row-selected-bg: #e3f2f6;
|
|
24
|
+
--ig-focus-ring: #1a8fae;
|
|
25
|
+
--ig-danger: #c0392b;
|
|
26
|
+
--ig-radius: 6px;
|
|
27
|
+
--ig-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
28
|
+
|
|
29
|
+
font-family: var(--ig-font);
|
|
30
|
+
color: var(--ig-ink);
|
|
31
|
+
font-size: 0.92rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.inandu-grid-vue * {
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.inandu-grid-vue button {
|
|
39
|
+
font-family: inherit;
|
|
40
|
+
font-size: 0.85rem;
|
|
41
|
+
color: var(--ig-ink);
|
|
42
|
+
background: #fff;
|
|
43
|
+
border: 1px solid var(--ig-border);
|
|
44
|
+
border-radius: var(--ig-radius);
|
|
45
|
+
padding: 0.35rem 0.7rem;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.inandu-grid-vue button:hover:not(:disabled) {
|
|
50
|
+
border-color: var(--ig-accent);
|
|
51
|
+
color: var(--ig-accent);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.inandu-grid-vue button:disabled {
|
|
55
|
+
color: var(--ig-muted);
|
|
56
|
+
cursor: default;
|
|
57
|
+
opacity: 0.6;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.inandu-grid-vue input[type='text'],
|
|
61
|
+
.inandu-grid-vue input[type='number'],
|
|
62
|
+
.inandu-grid-vue input[type='date'],
|
|
63
|
+
.inandu-grid-vue select {
|
|
64
|
+
font-family: inherit;
|
|
65
|
+
font-size: 0.85rem;
|
|
66
|
+
color: var(--ig-ink);
|
|
67
|
+
background: #fff;
|
|
68
|
+
border: 1px solid var(--ig-border);
|
|
69
|
+
border-radius: var(--ig-radius);
|
|
70
|
+
padding: 0.3rem 0.5rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.inandu-grid-vue input:focus-visible,
|
|
74
|
+
.inandu-grid-vue select:focus-visible,
|
|
75
|
+
.inandu-grid-vue button:focus-visible {
|
|
76
|
+
outline: 2px solid var(--ig-focus-ring);
|
|
77
|
+
outline-offset: 1px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* ── search + toolbar ────────────────────────────────────────────────── */
|
|
81
|
+
|
|
82
|
+
.inandu-grid-search {
|
|
83
|
+
margin-bottom: 0.6rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.inandu-grid-search input {
|
|
87
|
+
width: 100%;
|
|
88
|
+
max-width: 320px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.inandu-grid-toolbar {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-wrap: wrap;
|
|
94
|
+
align-items: center;
|
|
95
|
+
gap: 0.5rem;
|
|
96
|
+
margin-bottom: 0.6rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.inandu-grid-column-toggle {
|
|
100
|
+
position: relative;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.inandu-grid-column-toggle summary {
|
|
104
|
+
list-style: none;
|
|
105
|
+
font-size: 0.85rem;
|
|
106
|
+
color: var(--ig-ink);
|
|
107
|
+
background: #fff;
|
|
108
|
+
border: 1px solid var(--ig-border);
|
|
109
|
+
border-radius: var(--ig-radius);
|
|
110
|
+
padding: 0.35rem 0.7rem;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.inandu-grid-column-toggle summary::-webkit-details-marker {
|
|
115
|
+
display: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.inandu-grid-column-toggle[open] summary {
|
|
119
|
+
border-color: var(--ig-accent);
|
|
120
|
+
color: var(--ig-accent);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.inandu-grid-column-toggle ul {
|
|
124
|
+
position: absolute;
|
|
125
|
+
z-index: 20;
|
|
126
|
+
list-style: none;
|
|
127
|
+
margin: 0.25rem 0 0;
|
|
128
|
+
padding: 0.4rem;
|
|
129
|
+
min-width: 12rem;
|
|
130
|
+
background: #fff;
|
|
131
|
+
border: 1px solid var(--ig-border);
|
|
132
|
+
border-radius: var(--ig-radius);
|
|
133
|
+
box-shadow: 0 8px 24px -12px rgba(27, 31, 36, 0.3);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.inandu-grid-column-toggle li {
|
|
137
|
+
padding: 0.2rem 0.3rem;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.inandu-grid-column-toggle label {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
gap: 0.4rem;
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.inandu-grid-group-by {
|
|
148
|
+
margin-bottom: 0.6rem;
|
|
149
|
+
color: var(--ig-muted);
|
|
150
|
+
font-size: 0.85rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* ── the table itself ────────────────────────────────────────────────── */
|
|
154
|
+
|
|
155
|
+
.inandu-grid-viewport {
|
|
156
|
+
border: 1px solid var(--ig-border);
|
|
157
|
+
border-radius: var(--ig-radius);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.inandu-grid {
|
|
161
|
+
width: 100%;
|
|
162
|
+
border-collapse: collapse;
|
|
163
|
+
border: 1px solid var(--ig-border);
|
|
164
|
+
border-radius: var(--ig-radius);
|
|
165
|
+
overflow: hidden;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.inandu-grid th,
|
|
169
|
+
.inandu-grid td {
|
|
170
|
+
padding: 0.5rem 0.65rem;
|
|
171
|
+
border-bottom: 1px solid var(--ig-border);
|
|
172
|
+
text-align: left;
|
|
173
|
+
vertical-align: middle;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.inandu-grid thead th {
|
|
177
|
+
background: var(--ig-header-bg);
|
|
178
|
+
font-weight: 600;
|
|
179
|
+
position: relative;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
user-select: none;
|
|
182
|
+
white-space: nowrap;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.inandu-grid thead th.inandu-drag-over {
|
|
186
|
+
background: var(--ig-row-selected-bg);
|
|
187
|
+
box-shadow: inset 2px 0 0 var(--ig-accent);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.inandu-grid-sort-priority {
|
|
191
|
+
margin-inline-start: 0.15rem;
|
|
192
|
+
font-size: 0.65rem;
|
|
193
|
+
color: var(--ig-accent);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.inandu-grid-resize-handle {
|
|
197
|
+
position: absolute;
|
|
198
|
+
top: 0;
|
|
199
|
+
right: 0;
|
|
200
|
+
bottom: 0;
|
|
201
|
+
width: 6px;
|
|
202
|
+
cursor: col-resize;
|
|
203
|
+
touch-action: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.inandu-grid-resize-handle:hover {
|
|
207
|
+
background: var(--ig-accent);
|
|
208
|
+
opacity: 0.35;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.inandu-grid-filter-row th {
|
|
212
|
+
background: var(--ig-row-alt-bg);
|
|
213
|
+
padding: 0.35rem 0.5rem;
|
|
214
|
+
cursor: default;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.inandu-grid-filter-row input,
|
|
218
|
+
.inandu-grid-filter-row select {
|
|
219
|
+
width: 100%;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.inandu-grid-filter-range {
|
|
223
|
+
display: flex;
|
|
224
|
+
gap: 0.25rem;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.inandu-grid-filter-range input {
|
|
228
|
+
min-width: 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.inandu-grid tbody tr {
|
|
232
|
+
background: var(--ig-row-bg);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.inandu-grid tbody tr:nth-child(even) {
|
|
236
|
+
background: var(--ig-row-alt-bg);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.inandu-grid tbody tr:hover {
|
|
240
|
+
background: var(--ig-row-hover-bg);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.inandu-grid tbody tr[aria-selected='true'] {
|
|
244
|
+
background: var(--ig-row-selected-bg);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.inandu-grid-totals-row td {
|
|
248
|
+
font-weight: 600;
|
|
249
|
+
border-top: 2px solid var(--ig-border);
|
|
250
|
+
background: var(--ig-header-bg);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* ── row actions / drag / detail ─────────────────────────────────────── */
|
|
254
|
+
|
|
255
|
+
.inandu-grid-row-actions {
|
|
256
|
+
white-space: nowrap;
|
|
257
|
+
text-align: right;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.inandu-grid-row-actions button {
|
|
261
|
+
margin-inline-start: 0.3rem;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.inandu-grid-row-drag-handle,
|
|
265
|
+
.inandu-grid-detail-toggle {
|
|
266
|
+
background: none;
|
|
267
|
+
border: none;
|
|
268
|
+
padding: 0.1rem 0.3rem;
|
|
269
|
+
cursor: grab;
|
|
270
|
+
color: var(--ig-muted);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.inandu-grid-detail-toggle {
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.inandu-grid-detail-row td {
|
|
278
|
+
background: var(--ig-row-alt-bg);
|
|
279
|
+
padding: 0.75rem 1rem;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.inandu-grid-new-row td {
|
|
283
|
+
background: var(--ig-row-selected-bg);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/* ── grouping ────────────────────────────────────────────────────────── */
|
|
287
|
+
|
|
288
|
+
.inandu-grid-group-row td {
|
|
289
|
+
background: var(--ig-header-bg);
|
|
290
|
+
font-weight: 600;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.inandu-grid-group-aggregates {
|
|
294
|
+
margin-inline-start: 0.6rem;
|
|
295
|
+
font-weight: 400;
|
|
296
|
+
color: var(--ig-muted);
|
|
297
|
+
font-size: 0.85rem;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* ── tree data ───────────────────────────────────────────────────────── */
|
|
301
|
+
|
|
302
|
+
.inandu-grid-tree-cell {
|
|
303
|
+
display: flex;
|
|
304
|
+
align-items: center;
|
|
305
|
+
gap: 0.3rem;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.inandu-grid-tree-toggle {
|
|
309
|
+
background: none;
|
|
310
|
+
border: none;
|
|
311
|
+
padding: 0;
|
|
312
|
+
width: 1.1rem;
|
|
313
|
+
cursor: pointer;
|
|
314
|
+
color: var(--ig-muted);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.inandu-grid-tree-toggle-spacer {
|
|
318
|
+
display: inline-block;
|
|
319
|
+
width: 1.1rem;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* ── inline editing ──────────────────────────────────────────────────── */
|
|
323
|
+
|
|
324
|
+
.inandu-grid-edit-cell {
|
|
325
|
+
display: flex;
|
|
326
|
+
flex-direction: column;
|
|
327
|
+
gap: 0.15rem;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.inandu-grid-edit-cell input,
|
|
331
|
+
.inandu-grid-edit-cell select {
|
|
332
|
+
width: 100%;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.inandu-grid-field-error {
|
|
336
|
+
font-size: 0.75rem;
|
|
337
|
+
color: var(--ig-danger);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* ── cell range selection ────────────────────────────────────────────── */
|
|
341
|
+
|
|
342
|
+
.inandu-cell-range-selected {
|
|
343
|
+
background: color-mix(in srgb, var(--ig-accent) 16%, transparent);
|
|
344
|
+
outline: 1px solid var(--ig-accent);
|
|
345
|
+
outline-offset: -1px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* ── pagination ──────────────────────────────────────────────────────── */
|
|
349
|
+
|
|
350
|
+
.inandu-grid-pagination {
|
|
351
|
+
display: flex;
|
|
352
|
+
align-items: center;
|
|
353
|
+
justify-content: center;
|
|
354
|
+
gap: 0.75rem;
|
|
355
|
+
margin-top: 0.6rem;
|
|
356
|
+
color: var(--ig-muted);
|
|
357
|
+
font-size: 0.85rem;
|
|
358
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InanduGridRow } from '../core';
|
|
2
|
+
import { InanduGridColumn } from '../composables/useInanduGrid';
|
|
3
|
+
/**
|
|
4
|
+
* Ported from grid-angular's `exportCsv()` — same column/row source, same formatted-value rule,
|
|
5
|
+
* same UTF-8 BOM (so Excel opens accented text as UTF-8 instead of Latin-1).
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildCsv(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string): string;
|
|
8
|
+
export declare function exportCsv(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string, filenameBase?: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Ported from grid-angular's `exportExcel()` — dependency-free SpreadsheetML XML that Excel 2003+,
|
|
11
|
+
* LibreOffice and Google Sheets all open natively. A numeric column stays genuinely numeric-typed
|
|
12
|
+
* in the sheet; everything else is a formatted string. A real binary `.xlsx` is a grid-pro feature.
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildExcelXml(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string): string;
|
|
15
|
+
export declare function exportExcel(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string, filenameBase?: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Ported from grid-angular's `exportPdf()` — one simple table drawn with jsPDF's low-level
|
|
18
|
+
* text/line primitives (not the `autotable` plugin), single-line cells truncated with an ellipsis,
|
|
19
|
+
* header redrawn on every new page. Columns split the page width evenly (grid-angular instead
|
|
20
|
+
* weights by each column's live pixel width — not meaningful yet here, no column-resize feature).
|
|
21
|
+
* `jspdf` is dynamically imported so a grid that never exports to PDF never pays to load it.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Ported from grid-angular's `printTable()` — opens a new tab with a plain, print-styled `<table>`
|
|
25
|
+
* of `rows` and triggers the browser's print dialog on it, rather than printing the live page
|
|
26
|
+
* (which would include the toolbar, pager, and any surrounding app chrome).
|
|
27
|
+
*/
|
|
28
|
+
export declare function printTable(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string, title?: string): void;
|
|
29
|
+
export declare function exportPdf(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string, filenameBase?: string): Promise<void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widest rendered value in a column (its header and every currently-rendered data cell), measured
|
|
3
|
+
* against that column's own computed font, plus the cell's horizontal padding. Reads only what's
|
|
4
|
+
* in the DOM right now — one page, or the virtual window — so it's O(visible rows). Returns `0` if
|
|
5
|
+
* the column has no rendered cell to measure. Ported verbatim from grid-angular's
|
|
6
|
+
* `measureColumnContentWidth()` (`onResizeHandleDblClick`'s autosize).
|
|
7
|
+
*
|
|
8
|
+
* Genuinely needs a real layout engine to return anything meaningful — `offsetWidth`/
|
|
9
|
+
* `getComputedStyle` are always `0`/defaults in jsdom, so this can't be *end-to-end* verified in a
|
|
10
|
+
* unit test the way the rest of the port is. What test coverage there is stubs `offsetWidth`
|
|
11
|
+
* itself and checks the surrounding logic (which cells get measured, the padding/reserved-space
|
|
12
|
+
* math, the `0` "nothing to measure" case) — the measurement call itself is trusted to work in a
|
|
13
|
+
* real browser, same as any other `getBoundingClientRect()`-dependent code would be.
|
|
14
|
+
*/
|
|
15
|
+
export declare function measureColumnContentWidth(host: HTMLElement, field: string, headerText: string): number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { en } from '../core';
|
|
2
|
+
export type InanduGridMessageKey = keyof typeof en;
|
|
3
|
+
/** Replaces `{{name}}` tokens in `template` with `params[name]`, same mini-syntax the built-in dictionaries use (ngx-translate's, on the Angular side). Leaves an unmatched token as-is. */
|
|
4
|
+
export declare function interpolate(template: string, params?: Record<string, string | number>): string;
|
|
5
|
+
/**
|
|
6
|
+
* Resolves `lang` (a full BCP-47 tag like `'en-US'` or just `'en'`) to one of the built-in
|
|
7
|
+
* dictionaries by primary subtag, falling back to English for an unrecognized one — same fallback
|
|
8
|
+
* behavior `INANDU_GRID_TRANSLATIONS` documents for the Angular side.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createTranslator(lang: string): (key: InanduGridMessageKey, params?: Record<string, string | number>) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,92 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@inandu-solutions/grid-vue",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@inandu-solutions/grid-vue",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Standalone Vue 3 data grid: sorting, free-text and per-column filtering, grouping, pagination, CSV/Excel (.xls)/PDF export and print, i18n (5 languages) and theming, with a deliberately small dependency footprint. The Vue port of @inandu-solutions/grid-angular.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"vue",
|
|
7
|
+
"vue3",
|
|
8
|
+
"vue-grid",
|
|
9
|
+
"vue-datagrid",
|
|
10
|
+
"vue-table",
|
|
11
|
+
"vue-component",
|
|
12
|
+
"composable",
|
|
13
|
+
"data-grid",
|
|
14
|
+
"datagrid",
|
|
15
|
+
"grid",
|
|
16
|
+
"table",
|
|
17
|
+
"data-table",
|
|
18
|
+
"virtual-scroll",
|
|
19
|
+
"pagination",
|
|
20
|
+
"grouping",
|
|
21
|
+
"inline-editing",
|
|
22
|
+
"csv-export",
|
|
23
|
+
"excel-export",
|
|
24
|
+
"i18n",
|
|
25
|
+
"headless"
|
|
26
|
+
],
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"author": {
|
|
29
|
+
"name": "Inandu SAS",
|
|
30
|
+
"url": "https://www.inandu.com/"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/inandusolutions/inandu-grid-vue#readme",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/inandusolutions/inandu-grid-vue.git"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/inandusolutions/inandu-grid-vue/issues"
|
|
39
|
+
},
|
|
40
|
+
"type": "module",
|
|
41
|
+
"main": "./dist/inandu-grid-vue.cjs",
|
|
42
|
+
"module": "./dist/inandu-grid-vue.js",
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"import": "./dist/inandu-grid-vue.js",
|
|
48
|
+
"require": "./dist/inandu-grid-vue.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./style.css": {
|
|
51
|
+
"default": "./dist/style.css"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"dist"
|
|
56
|
+
],
|
|
57
|
+
"sideEffects": [
|
|
58
|
+
"*.css"
|
|
59
|
+
],
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
65
|
+
"npm": ">=10.0.0"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "vite build && node -e \"require('fs').copyFileSync('src/styles/inandu-grid.css','dist/style.css')\"",
|
|
69
|
+
"typecheck": "vue-tsc --noEmit",
|
|
70
|
+
"test": "vitest run",
|
|
71
|
+
"test:watch": "vitest"
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"vue": "^3.4.0"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"jspdf": "^4.2.1"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
81
|
+
"@testing-library/vue": "^8.1.0",
|
|
82
|
+
"@vitejs/plugin-vue": "^6.0.9",
|
|
83
|
+
"@vue/test-utils": "^2.5.1",
|
|
84
|
+
"jsdom": "^30.1.1",
|
|
85
|
+
"typescript": "~5.9.3",
|
|
86
|
+
"vite": "^8.3.3",
|
|
87
|
+
"vite-plugin-dts": "^5.1.2",
|
|
88
|
+
"vitest": "^5.0.3",
|
|
89
|
+
"vue": "^3.5.43",
|
|
90
|
+
"vue-tsc": "^3.3.12"
|
|
91
|
+
}
|
|
92
|
+
}
|