vuetable-next 1.1.1 → 1.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.
Files changed (45) hide show
  1. package/README.md +296 -605
  2. package/dist/chunks/vue2/createVuetable-GewoatYE.cjs +11 -0
  3. package/dist/chunks/vue2/createVuetable-zwzXUm5x.js +1511 -0
  4. package/dist/chunks/vue3/createVuetable-CE_PTu-W.cjs +5 -0
  5. package/dist/chunks/vue3/createVuetable-wZayTXed.js +1733 -0
  6. package/dist/portable/components/useVuetablePagination.d.ts +1 -0
  7. package/dist/portable/components/useVuetablePaginationInfo.d.ts +1 -0
  8. package/dist/public.d.ts +14 -1
  9. package/dist/structure.css +30 -0
  10. package/dist/style.css +77 -2
  11. package/dist/table.d.ts +13 -0
  12. package/dist/themes/semantic.css +47 -0
  13. package/dist/themes/tailwind.cjs +55 -0
  14. package/dist/themes/tailwind.js +35 -0
  15. package/dist/types/components/Vuetable.vue.d.ts +19 -53
  16. package/dist/types/components/VuetableContext.d.ts +1 -0
  17. package/dist/types/components/VuetableDetailHost.vue.d.ts +1 -1
  18. package/dist/types/components/VuetablePagination.vue.d.ts +13 -16
  19. package/dist/types/components/VuetablePaginationDropdown.vue.d.ts +13 -16
  20. package/dist/types/components/VuetablePaginationInfo.vue.d.ts +13 -1
  21. package/dist/types/components/VuetablePaginationInfoMixin.vue.d.ts +10 -0
  22. package/dist/types/components/VuetablePaginationMixin.vue.d.ts +10 -0
  23. package/dist/types/components/fetchAxios.d.ts +2 -0
  24. package/dist/types/components/resolveVuetableCss.d.ts +2 -0
  25. package/dist/types/components/useVuetableConfig.d.ts +15 -0
  26. package/dist/types/components/useVuetableFixedColumns.d.ts +1 -0
  27. package/dist/types/components/useVuetablePagination.d.ts +1 -0
  28. package/dist/types/components/useVuetablePaginationInfo.d.ts +1 -0
  29. package/dist/types/index.d.ts +3 -2
  30. package/dist/types/table.d.ts +10 -0
  31. package/dist/types/themes/tailwind.d.ts +35 -0
  32. package/dist/vue2-table.cjs +1 -0
  33. package/dist/vue2-table.js +21 -0
  34. package/dist/vue2.cjs +14 -21
  35. package/dist/vue2.js +384 -1805
  36. package/dist/vue3-table.cjs +1 -0
  37. package/dist/vue3-table.js +21 -0
  38. package/dist/vue3.cjs +1 -6
  39. package/dist/vue3.js +442 -2051
  40. package/package.json +23 -4
  41. package/style.css +77 -2
  42. package/dist/vue2.cjs.map +0 -1
  43. package/dist/vue2.js.map +0 -1
  44. package/dist/vue3.cjs.map +0 -1
  45. package/dist/vue3.js.map +0 -1
package/README.md CHANGED
@@ -7,53 +7,51 @@
7
7
  Data tables, custom fields, selection, pagination and expandable rows — across Vue generations.
8
8
 
9
9
  [![Vue 2.6, Vue 2.7 and Vue 3](https://img.shields.io/badge/Vue-2.6%20%7C%202.7%20%7C%203-41b883?style=flat-square)](#compatibility)
10
- [![vuetable-2-compatible API](https://img.shields.io/badge/API-vuetable--2-35495e?style=flat-square)](https://vuetable.com/guide/)
11
10
  [![MIT license](https://img.shields.io/badge/license-MIT-438b70?style=flat-square)](https://github.com/Artles777/vuetable-next/blob/main/LICENSE)
12
11
 
12
+ **[Documentation on GitHub](https://github.com/Artles777/vuetable-next/blob/main/docs/README.md)** ·
13
+ [Installation guide](https://github.com/Artles777/vuetable-next/blob/main/docs/getting-started.md) ·
14
+ [Table basics](https://github.com/Artles777/vuetable-next/blob/main/docs/table-basics.md) ·
15
+ [Changelog](https://github.com/Artles777/vuetable-next/blob/main/CHANGELOG.md)
16
+
17
+ Documentation describes the current source checkout; npm availability follows [changelog](https://github.com/Artles777/vuetable-next/blob/main/CHANGELOG.md).
18
+
13
19
  ## Contents
14
20
 
15
21
  - [Why Vuetable Next?](#why-vuetable-next)
16
22
  - [Quick start](#quick-start): [install](#install) · [Vue 3](#vue-3) · [Vue 2.6](#vue-26) · [Vue 2.7](#vue-27)
17
- - [Compatibility](#compatibility)
18
- - [Features in 1.1.0](#features-in-110): [declarative columns](#declarative-columns-opt-in) · [grouped headers and slots](#grouped-headers-and-extra-rows-opt-in) · [fixed columns](#fixed-columns-opt-in)
19
- - [Documentation and migration](#documentation-and-migration): [upstream API](#familiar-vuetable-2-documentation) · [performance](#vue-3-automatic-row-render-optimization) · [migration](#moving-an-existing-table) · [API request ordering](#overlapping-api-requests) · [initial page](#initial-page-in-api-mode) · [checkbox events](#checkbox-events-and-row-data) · [row identity](#row-identity-and-custom-field-loading) · [row order](#row-order-and-drag-handles) · [mixins and composables](#mixins-or-composables) · [TypeScript](#explicit-framework-entries-and-types)
20
- - [Semantic UI and Vuetify styles](#semantic-ui-and-vuetify-styles)
21
- - [Live demos](#live-demos) · [screenshots](#screenshots)
22
- - [Development and checks](#development-and-checks) · [contributing](#contributing)
23
- - [Limitations and security](#limitations-and-security) · [license and credits](#license-and-credits)
24
-
25
- **First time here?** Start with your Vue version in [Quick start](#quick-start).
26
- For task-oriented guides and complete API examples, open the [documentation index](https://github.com/Artles777/vuetable-next/blob/main/docs/README.md).
27
- For release history, see the [changelog](https://github.com/Artles777/vuetable-next/blob/main/CHANGELOG.md).
28
-
29
- ---
23
+ - [Styling](#styling) · [Data and HTTP](#data-and-http) · [Axios usage](#axios-usage)
24
+ - [Table features](#table-features): [columns](#declarative-columns) · [groups and extra rows](#grouped-headers-and-extra-rows) · [fixed columns](#fixed-columns) · [selection and pagination](#custom-fields-selection-and-pagination)
25
+ - [TypeScript](#typescript) · [Demos](#demos) · [Development](#development)
26
+ - [Compatibility](#compatibility) · [Limitations and security](#limitations-and-security) · [License and credits](#license-and-credits)
30
27
 
31
28
  ## Why Vuetable Next?
32
29
 
33
- `vuetable-next` is a fork of `vuetable-2`, built around `vue-demi` to retain a
34
- familiar table API while supporting both Vue 2 and Vue 3 applications.
35
-
36
- | One table API | Framework-aware packaging | Built to extend |
37
- | --- | --- | --- |
38
- | Local or remote data, field definitions, events and instance methods | One package with automatic Vue 2 / Vue 3 build selection | Custom fields, legacy mixins, detail rows and pagination components |
39
-
40
- - **Keep familiar concepts.** Use the original Vuetable-2 documentation as the API reference.
41
- - **Move at your own pace.** Vue 2.6, Vue 2.7 and Vue 3 use the same root import.
42
- - **Choose your integration.** Local components, global registration, ESM and CommonJS are supported.
43
- - **Keep dependencies shared.** Vue, `vue-demi` and Axios are external, not private copies embedded in the bundle.
44
- - **Use TypeScript.** Portable root declarations work across supported Vue generations; the explicit Vue 3 entry provides richer generated types.
45
-
46
- > **Compatibility note:** releases from `1.0.11` onward include the Vue 2.6 / Vue 2.7 / Vue 3 packaging,
47
- > public composables and portable declarations described here. The older
48
- > `1.0.10` release does not contain these compatibility changes.
49
-
50
- ---
30
+ A `vuetable-2` fork built around `vue-demi`: one familiar table API with separately
31
+ compiled Vue 2 and Vue 3 builds, local/global registration, ESM and CommonJS.
32
+ Keep familiar fields, selection, events, detail rows, pagination and methods;
33
+ choose opt-in features without rewriting existing tables. Vue, `vue-demi` and
34
+ Axios stay external dependencies rather than private copies embedded in the library.
35
+ TypeScript declarations need no separate `@types` package.
36
+
37
+ - **Local or remote rows:** field definitions, sorting state, pagination and API requests.
38
+ - **Custom presentation:** cell/header templates, expandable details, groups, subheaders and totals.
39
+ - **Pinned columns:** left/right edges, automatic or explicit order, and dynamic visibility.
40
+ - **Your styling:** existing Semantic UI classes, opt-in unstyled mode or a Tailwind preset.
41
+ - **Your Vue version:** Vue 2.6 with Composition API, Vue 2.7 or Vue 3; mixins and composables remain available.
42
+ - **Your bundle:** compatible root imports or explicit framework/component-only entries, with deferred default Axios loading.
43
+
44
+ Read the [documentation home](https://github.com/Artles777/vuetable-next/blob/main/docs/README.md)
45
+ for setup, styling, data and table APIs. All guides live in this repository;
46
+ no separate documentation website is required. Start with
47
+ [table basics](https://github.com/Artles777/vuetable-next/blob/main/docs/table-basics.md)
48
+ or the [Vuetable-2 migration guide](https://github.com/Artles777/vuetable-next/blob/main/docs/migration.md).
51
49
 
52
50
  ## Quick start
53
51
 
54
52
  ### Install
55
53
 
56
- Install the latest stable release:
54
+ Install from npm:
57
55
 
58
56
  ```sh
59
57
  npm install vuetable-next@latest
@@ -68,23 +66,6 @@ For Vue 2.6, also install the Composition API plugin:
68
66
  npm install @vue/composition-api
69
67
  ```
70
68
 
71
- **Developing or testing a local revision?** From a checkout of this repository:
72
-
73
- ```sh
74
- npm install --legacy-peer-deps --package-lock=false
75
- npm pack
76
- ```
77
-
78
- Then install the generated archive from your application directory, replacing
79
- `VERSION` with the version in the filename printed by `npm pack`:
80
-
81
- ```sh
82
- npm install /absolute/path/to/vuetable-next/vuetable-next-VERSION.tgz
83
- ```
84
-
85
- `npm pack` runs the dual build and package checks through `prepack`. The archive
86
- uses the version currently declared in `package.json`; it does not publish anything.
87
-
88
69
  ### Vue 3
89
70
 
90
71
  Import the table and stylesheet, then pass your fields and rows. This example
@@ -193,554 +174,250 @@ new Vue({ render: createElement => createElement(App) }).$mount("#app");
193
174
  For global registration on either Vue 2 version, import `Vuetable` in your
194
175
  entry point and call `Vue.use(Vuetable)` before creating the root instance.
195
176
 
196
- ---
177
+ ## Styling
197
178
 
198
- ## Compatibility
179
+ Choose the appearance independently of how you define columns or load data:
199
180
 
200
- | Application runtime | Declared support | Tested runtime | Composition API plugin |
201
- | --- | --- | --- | --- |
202
- | Vue 2.6 | `^2.6.14` | `2.6.14` | Install `@vue/composition-api` |
203
- | Vue 2.7 | Included in the Vue 2 range | `2.7.16` | Not needed |
204
- | Vue 3 | `^3.5.3` | `3.5.46` | Not needed |
205
-
206
- The package contains separately compiled Vue 2 and Vue 3 render functions.
207
- `vue-demi` selects the correct build for the installed runtime; no application
208
- alias or manual dependency patch is needed for normal root imports.
209
-
210
- Checks cover actual rendering, reactive data updates, legacy field mixins, custom
211
- fields, checkbox selection, events, detail-row parent access, component methods,
212
- teardown, module resolution and public declarations. Vue 2.6 is also checked with
213
- a webpack 4 consumer toolchain. This is not a claim that every upstream example
214
- or every possible consumer integration has been exhaustively tested.
215
-
216
- ---
217
-
218
- ## Features in 1.1.0
219
-
220
- The new column, layout and pinning APIs are additive. Existing `fields` tables
221
- keep working without migration. See [1.1.0 release notes](https://github.com/Artles777/vuetable-next/blob/main/CHANGELOG.md#110---2026-12-02).
222
-
223
- ### Declarative columns (opt-in)
181
+ | Mode | Setup | Who owns the appearance? |
182
+ | --- | --- | --- |
183
+ | Existing/default theme | Semantic UI CSS + `vuetable-next/style.css` | Your existing theme, with the familiar default classes |
184
+ | Your own CSS | `unstyled` + optional `structure.css` | Your application; no library decorative defaults |
185
+ | Tailwind | `unstyled`, `tailwind.table` and generated utility CSS | Your Tailwind configuration and optional preset |
224
186
 
225
- For left/right column pinning, dynamic group headers and custom totals, see
226
- [fixed columns](https://github.com/Artles777/vuetable-next/blob/main/docs/fixed-columns.md) and [table layout](https://github.com/Artles777/vuetable-next/blob/main/docs/table-layout.md).
187
+ The default class names target Semantic UI. Include your Semantic UI theme and
188
+ import `vuetable-next/style.css` once, as in the quick starts. Existing default
189
+ themes and imports remain supported. For framework CSS interaction, see
190
+ [default theme and Vuetify](https://github.com/Artles777/vuetable-next/blob/main/docs/theming.md#default-theme-and-vuetify).
227
191
 
228
- Alongside the existing `fields` API, declarations can provide column metadata and
229
- scoped templates. Import `Vuetable, { VuetableColumn }` from `vuetable-next`:
192
+ For application-owned CSS, opt into `unstyled`; add the optional Tailwind preset:
230
193
 
231
194
  ```vue
232
- <Vuetable :data="rows" :api-mode="false">
233
- <VuetableColumn field="name" label="Customer" sortable width="180px">
234
- <template #default="{ row }"><strong>{{ row.name }}</strong></template>
235
- </VuetableColumn>
236
- </Vuetable>
237
- ```
238
-
239
- See the [declarative columns guide](https://github.com/Artles777/vuetable-next/blob/main/docs/declarative-columns.md) for all three
240
- runtime setups, both APIs, precedence and migration limits. This is additive,
241
- not full Buefy compatibility; existing `fields` tables need no migration.
242
- The [shared showcase](https://github.com/Artles777/vuetable-next/blob/main/demo/README.md#declarative-columns) has interactive controls.
243
-
244
- ### Grouped headers and extra rows (opt-in)
245
-
246
- Keep the standard sortable header and add subheaders or totals with
247
- `beforeHeader`, `afterHeader`, `beforeFooter` and `afterFooter`. Enable
248
- `group-by="headerName"` for field objects or `group-by="group"` for declarative
249
- columns. Visible groups calculate their own spans and expose semantic boundary
250
- classes when columns are hidden or reordered.
251
-
252
- See [table layout and grouped headers](https://github.com/Artles777/vuetable-next/blob/main/docs/table-layout.md) for slot scope,
253
- precedence, gutter alignment and migration examples. Available starting with `1.1.0`.
254
-
255
- ### Fixed columns (opt-in)
256
-
257
- Pin multiple columns on either side with `fixed: "left"` or `fixed: "right"`.
258
- Pinned columns move to their edge by default; `fixedOrder` sets their rank from
259
- that edge, and automatic ranks follow pin activation order. Choose
260
- `fixed-mode="in-place"` to keep the original column positions.
261
-
262
-
263
- For example, with object fields:
195
+ <script setup>
196
+ import Vuetable from "vuetable-next/vue3/table";
197
+ import { tailwind } from "vuetable-next/themes/tailwind";
198
+ import "vuetable-next/structure.css";
199
+ const fields = ["name"];
200
+ const rows = [{ id: 1, name: "Campaign" }];
201
+ </script>
264
202
 
265
- ```js
266
- const fields = [
267
- { name: "customer", title: "Customer", fixed: "left", width: "180px" },
268
- { name: "campaign", title: "Campaign", width: "320px" },
269
- { name: "revenue", title: "Revenue", fixed: "right", fixedOrder: 1, width: "130px" }
270
- ];
203
+ <template>
204
+ <Vuetable unstyled :css="tailwind.table" :api-mode="false" :fields="fields" :data="rows" />
205
+ </template>
271
206
  ```
272
207
 
273
- The same metadata works on `VuetableColumn`. Generated headers, grouped headers,
274
- custom subheaders and totals can share pinning styles through the public slot
275
- helpers. See the [fixed columns guide](https://github.com/Artles777/vuetable-next/blob/main/docs/fixed-columns.md) for ordering,
276
- custom rows, theme variables and viewport limits, then try the
277
- [scrolling playground](https://github.com/Artles777/vuetable-next/blob/main/demo/README.md#pinned-columns-playground).
278
-
279
- ---
280
-
281
- ## Documentation and migration
208
+ Use `/vue2/table` for Vue 2.6 / 2.7; omit the preset for your own CSS.
209
+ **The Tailwind preset supplies class names, not generated CSS.** Configure your
210
+ Tailwind build to scan it and import your application's generated stylesheet;
211
+ see the [Tailwind setup](https://github.com/Artles777/vuetable-next/blob/main/docs/theming.md#tailwind-css).
212
+ Dark mode follows your application's Tailwind variant and theme switch.
213
+ An ordinary unstyled table can omit library CSS; `structure.css` is needed for
214
+ library-managed scrolling, fixed headers and pinned columns.
215
+ Global installation accepts `{ unstyled: true }` with per-table overrides.
216
+ See [theming](https://github.com/Artles777/vuetable-next/blob/main/docs/theming.md) for utilities, pagination and pinned backgrounds,
217
+ and [bundle size](https://github.com/Artles777/vuetable-next/blob/main/docs/bundle-size.md) for optional lean imports.
282
218
 
283
- ### Familiar Vuetable-2 documentation
219
+ ## Data and HTTP
284
220
 
285
- Start with the original [Vuetable-2 guide](https://vuetable.com/guide/) and
286
- [API reference](https://vuetable.com/api/) for fields, API mode, sorting,
287
- pagination, events, methods, custom fields and detail rows.
221
+ Use `:api-mode="false"` with `:data="rows"` for local data (see quick start).
222
+ For remote rows, enable API mode (the default) and supply your endpoint:
288
223
 
289
- The table API is intended to stay familiar on Vue 2 and Vue 3. Framework-level
290
- differences still apply: use Vue 3 slot/render-function conventions in your own
291
- components, and follow the setup instructions for your installed Vue version.
292
-
293
- ### Vue 3: automatic row-render optimization
294
-
295
- The standard `Vuetable` avoids rebuilding unchanged rows when parent updates
296
- only replace event listeners, including inline callbacks. No factory, special
297
- registration or application-side listener caching is required. The outer
298
- component can still update to keep listeners and root attributes current.
299
- Reactive rows, fields and values read by formatters continue to update normally.
300
- External slots are updated conservatively so their content cannot become stale;
301
- this is not a promise to skip renders when table content actually changes.
302
-
303
- `createVuetable()` remains optional for declaring a fixed component-event
304
- contract. It is not required for the standard listener-only optimization.
305
-
306
- ```ts
307
- import { createVuetable } from "vuetable-next";
308
-
309
- const AuditTable = createVuetable({
310
- eventPrefix: "audit:",
311
- events: ["custom-action"]
312
- });
224
+ ```vue
225
+ <Vuetable api-url="/api/articles" :fields="fields" />
226
+ <Vuetable api-url="/api/articles/search" http-method="post" :fields="fields" />
313
227
  ```
314
228
 
315
- Define the component once at module scope, outside `render()` and `setup()`, then
316
- register it locally or use it directly in `<script setup>`. Keep existing table
317
- props, slots and refs; listen with `@audit:row-clicked` or `@audit:custom-action`.
318
- `events` contains **additional unprefixed** names passed to `fireEvent()`; the
319
- default prefix is `vuetable:`. Vue handles latest listeners, `.once`, errors and
320
- native DOM listeners normally. With an empty prefix, declaring `click` makes
321
- `@click` a component event only, not a root DOM click listener.
322
-
323
- The prefix is fixed for each factory component: overriding its `eventPrefix`
324
- prop is unsupported and warns in development. Undeclared factory events also
325
- warn in development. Create another factory for a different prefix or event set.
326
- Factory results are local components, not plugins (`app.use()` is unsupported).
327
- For the generic component, single-word listeners such as `onCustom` are ambiguous:
328
- they fall through to the root DOM element as well as receiving component events.
329
- Use the factory with `events: ["custom"]` when a listener must be component-only.
330
- Explicit Vue DOM listeners such as `on:custom-event` remain DOM listeners.
331
- The generic `Vuetable` remains fully dynamic and warning-free for arbitrary
332
- prefixes/custom events. Vue 2 users keep the generic component:
333
- importing the factory is safe, but calling it throws a Vue-3-only error.
334
-
335
- For sorting state, inspect the live table ref’s `sortOrder` or `order`.
336
- `clearSortOrder()` detaches the table’s local order and leaves the owner’s input
337
- array unchanged. For legacy compatibility, when the parent explicitly supplies
338
- `sortOrder`, its next update restores that input; replacing or extending the
339
- input array also resynchronizes the table. Without a supplied `sortOrder`, local
340
- sorting remains local. This behavior applies to Vue 2.6, Vue 2.7 and Vue 3 without
341
- prop-mutation warnings.
342
-
343
- ### Moving an existing table
344
-
345
- 1. Replace the `vuetable-2` dependency with the verified `vuetable-next` release or archive.
346
- 2. Change root imports to `vuetable-next` and import `vuetable-next/style.css` once.
347
- 3. Replace imports from `vuetable-2/src/...` with the named public exports below.
348
- 4. Keep existing field definitions, table props and event handlers, then verify your application-specific scenarios.
349
- 5. When migrating the application to Vue 3, adapt its own Vue-specific syntax as needed; the package chooses its Vue 3 build automatically.
229
+ ### Axios usage
350
230
 
351
- ```ts
352
- import Vuetable, {
353
- VuetableRowHeader,
354
- VuetablePagination,
355
- VuetablePaginationDropdown,
356
- VuetablePaginationInfo,
357
- VuetableFieldMixin,
358
- VuetableFieldCheckboxMixin,
359
- VuetablePaginationMixin,
360
- VuetablePaginationInfoMixin
361
- } from "vuetable-next";
362
- ```
231
+ The default HTTP transport automatically lazy-imports Axios on the first API
232
+ request: **no manual Axios import is needed**. npm installs Axios normally as a
233
+ dependency. Local data mode and a custom `http-fetch` do not load default Axios.
234
+ With API mode configured, `load-on-start` defaults to `true`, so that first
235
+ request normally starts on mount; `:load-on-start="false"` defers it until
236
+ `reload()` or another API-loading trigger.
237
+ Code splitting requires an explicit ESM entry and a suitable bundler; compatible
238
+ root/CommonJS packaging may bundle Axios eagerly.
363
239
 
364
- Built-in field components `VuetableFieldCheckbox`, `VuetableFieldHandle` and
365
- `VuetableFieldSequence`, plus `VuetableColGutter`, are also named exports.
366
- Internal `.vue` source paths are not public package entry points.
240
+ GET sends generated parameters through Axios `params`; POST sends them as the
241
+ body with the remaining HTTP options. Responses (including custom transports)
242
+ are Axios-shaped: `response.data` is the body, optionally transformed, with rows
243
+ at `data` and pagination at `links.pagination` by default.
244
+ See [data and requests](https://github.com/Artles777/vuetable-next/blob/main/docs/data-and-requests.md) for response examples,
245
+ custom adapters, latest-started request ordering, initial/zero-based pages,
246
+ checkbox payloads, record identity and row ordering.
367
247
 
368
- ### Semantic UI and Vuetify styles
248
+ ## Table features
369
249
 
370
- The built-in class defaults target Semantic UI. Include your Semantic UI theme
371
- and import the library stylesheet once:
250
+ Existing `fields` tables remain the default; these additional APIs are opt-in.
372
251
 
373
- ```js
374
- import "vuetable-next/style.css";
375
- ```
252
+ | You want to… | Start here |
253
+ | --- | --- |
254
+ | Put column metadata and custom templates together | [Declarative columns](#declarative-columns) |
255
+ | Add grouped headings, subheaders, totals and separators | [Grouped headers and extra rows](#grouped-headers-and-extra-rows) |
256
+ | Pin columns on either side and choose their order | [Fixed columns](#fixed-columns) |
257
+ | Extend cells, selection, details or pagination | [Custom fields, selection and pagination](#custom-fields-selection-and-pagination) |
258
+ | Render from a plain TypeScript file | [Render-function examples](https://github.com/Artles777/vuetable-next/blob/main/docs/migration.md#typescript-render-functions-without-sfcs) |
376
259
 
377
- Vuetify 2 uses generic `blue` and `grey` utility classes that can otherwise
378
- paint the table and sorting/drag icons with solid backgrounds
379
- ([upstream vuetable-2 #691](https://github.com/ratiw/vuetable-2/issues/691)).
380
- Inside Vuetify's `.v-application` container, the library protects its built-in
381
- defaults: the table stays white with the standard Semantic UI blue top border,
382
- and the icons keep transparent backgrounds. This also covers the separate
383
- header/body tables used by fixed headers. Outside Vuetify, the existing theme
384
- classes and styling are unchanged.
260
+ ### Declarative columns
385
261
 
386
- Explicit `css` entries remain application-owned and are not rewritten. For a
387
- custom theme, supply its table and icon classes through the existing `css` prop:
262
+ Import `Vuetable, { VuetableColumn }` from `vuetable-next`:
388
263
 
389
264
  ```vue
390
- <Vuetable
391
- :fields="fields"
392
- :css="{ tableClass: 'my-table', sortableIcon: 'my-sort-icon' }"
393
- />
265
+ <Vuetable :data="rows" :api-mode="false">
266
+ <VuetableColumn field="name" label="Customer" sortable width="180px">
267
+ <template #default="{ row }"><strong>{{ row.name }}</strong></template>
268
+ </VuetableColumn>
269
+ </Vuetable>
394
270
  ```
395
271
 
396
- An explicitly supplied `tableClass` containing `blue` still opts into that
397
- class's framework styles; remove conflicting utilities from your custom theme
398
- or resolve their cascade in application CSS. The compatibility correction is
399
- not a replacement for a full Vuetify table theme.
400
-
401
- ### Overlapping API requests
272
+ See [declarative columns](https://github.com/Artles777/vuetable-next/blob/main/docs/declarative-columns.md) for all runtime setups,
273
+ metadata, precedence and migration limits. This is additive, not full Buefy compatibility.
402
274
 
403
- API tables apply results from the **most recently started load**, not whichever
404
- response happens to arrive last. This applies to Vue 2.6, Vue 2.7 and Vue 3,
405
- including `createVuetable()` and custom `http-fetch` transports.
275
+ ### Grouped headers and extra rows
406
276
 
407
- For example, searching `Ju` and then `Junaid` can produce two overlapping
408
- requests. If the `Junaid` response is empty, a slower `Ju` response must not bring
409
- the previous rows back. This fixes the request-ordering scenario reported in
410
- [upstream vuetable-2 #618](https://github.com/ratiw/vuetable-2/issues/618).
277
+ Add subheaders/totals via `beforeHeader`, `afterHeader`, `beforeFooter` and
278
+ `afterFooter` while keeping the sortable header. Use `group-by="headerName"`
279
+ for object fields or `group-by="group"` for declarations. Visible groups adjust
280
+ spans and boundary classes when columns hide/reorder.
281
+ See [table layout](https://github.com/Artles777/vuetable-next/blob/main/docs/table-layout.md) for scope, precedence and gutter alignment.
411
282
 
412
- ```js
413
- methods: {
414
- async searchChanged(value) {
415
- this.filters.search = value
416
- await this.$nextTick()
417
- await this.$refs.table.refresh()
418
- }
419
- }
420
- ```
283
+ For a scrolling body with a fixed header, set `table-height="300px"` and load
284
+ `style.css` or `structure.css`. Header widths follow the visible body columns;
285
+ custom layout rows should use the guide's slot helpers for spans and gutters.
421
286
 
422
- Bind `filters` with `:append-params="filters"`. `refresh()` resets to `first-page`;
423
- `reload()` keeps the current page. No debounce or cancellation setup is required
424
- for correct response ordering. Debouncing remains an optional application-level
425
- way to reduce network traffic.
426
-
427
- - Obsolete responses do not replace rows or pagination, invoke the response
428
- transform/custom completion callbacks, or emit new success/error/completion
429
- events. Already-emitted events are not undone.
430
- - Starting another load inside a loading/completion handler also supersedes the
431
- older operation. Its remaining work and queued pagination/loaded events are
432
- skipped; an old response cannot finish a newer load's spinner.
433
- - Unmounting, `resetData()` or an explicit non-null `setData()` invalidates pending
434
- responses. Overlapping asynchronous data-manager results follow the same rule.
435
- - Each request receives its own top-level options and query parameters; POST
436
- requests do not remove `params` from the supplied `http-options` object.
437
- - Requests are **not automatically cancelled** on the server. `instanceFetch`
438
- remains the raw transport promise; it can still settle even when the table
439
- ignores that request's result. The promise returned by `reload()` / `loadData()`
440
- still waits for its own request. Arbitrary async side effects inside your own
441
- callbacks remain your application's responsibility.
442
-
443
- This is response-order protection, not server-side filtering: the API must still
444
- return the correct records and pagination for the requested filter.
445
-
446
- ### Initial page in API mode
447
-
448
- Use a numeric binding to start the first API request on another page:
449
-
450
- ```vue
451
- <Vuetable
452
- ref="table"
453
- api-url="/api/articles"
454
- :fields="fields"
455
- :initial-page="3"
456
- />
457
- ```
458
-
459
- The first request sends `page=3`, not an initial page-one request followed by
460
- page three. This works with GET, POST, custom `queryParams` mappings/callbacks,
461
- and all three supported Vue runtimes. Your server must honor the page parameter
462
- and return matching rows and pagination metadata.
463
-
464
- - `initial-page` defaults to `1` and initializes the table when it is created;
465
- it is not a controlled current-page prop. Changing it later does not navigate.
466
- - `reload()` loads the current page. With `:load-on-start="false"`, calling
467
- `reload()` for the first time still uses `initial-page`.
468
- - `refresh()` intentionally resets to `first-page` (default `1`). Sorting and a
469
- changed `api-url` with `reactive-api-url` enabled also reset the page.
470
- - If a saved page number or URL arrives asynchronously, use `v-if` to create the
471
- table only after both are ready. Otherwise an initial value of `1` can already
472
- have been read, or a later URL change can trigger a reset.
473
- - A `queryParams` callback owns the generated parameters; forward its `page`
474
- argument. Avoid a conflicting page key in `append-params`, whose values
475
- override generated query parameters.
476
-
477
- [Upstream vuetable-2 #727 — initial-page not working](https://github.com/ratiw/vuetable-2/issues/727)
478
- reports page one being requested despite an initial page of three. This symptom
479
- does **not** reproduce in this fork's current implementation. Regression tests
480
- verify the first request, rendered rows and pagination event across Vue 2.6,
481
- Vue 2.7 and Vue 3; no runtime behavior was changed for this issue.
482
-
483
- #### Zero-based API pagination
484
-
485
- For an API whose first page index is `0`, configure the table and the separate
486
- pagination component consistently:
487
-
488
- ```vue
489
- <Vuetable
490
- ref="table"
491
- api-url="/api/articles"
492
- :fields="fields"
493
- pagination-path="pagination"
494
- :initial-page="0"
495
- :first-page="0"
496
- @vuetable:pagination-data="onPaginationData"
497
- />
498
- <VuetablePagination
499
- ref="pagination"
500
- :first-page="0"
501
- @vuetable-pagination:change-page="onChangePage"
502
- />
503
- ```
287
+ ### Fixed columns
504
288
 
505
289
  ```js
506
- onPaginationData(data) {
507
- this.$refs.pagination.setPaginationData(data);
508
- },
509
- onChangePage(page) {
510
- this.$refs.table.changePage(page);
511
- }
290
+ const fields = [
291
+ { name: "customer", title: "Customer", fixed: "left", width: "180px" },
292
+ { name: "campaign", title: "Campaign", width: "320px" },
293
+ { name: "revenue", title: "Revenue", fixed: "right", fixedOrder: 1, width: "130px" }
294
+ ];
512
295
  ```
513
296
 
514
- The handlers belong in the application's `methods`. `initial-page` controls the
515
- first request; the table's `first-page` controls reset/navigation boundaries;
516
- the paginator's `first-page` controls emitted page indices. Setting only the
517
- table's `first-page` does not replace its default `initial-page="1"` behavior.
518
- `VuetablePaginationDropdown` accepts the same numeric `first-page` setting.
519
-
520
- API pagination metadata must use the same zero-based convention: for three
521
- pages, return `current_page` in `0..2` and `last_page: 2`, not `3`. Visible page
522
- labels remain human-readable `1`, `2`, `3`; their request indices are `0`, `1`,
523
- `2`. Forward `vuetable:pagination-data` explicitly; a separate paginator is not
524
- automatically connected to the table.
297
+ Pin multiple columns on either edge. `fixedOrder` ranks from that edge; automatic
298
+ ranks follow activation order. `fixed-mode="in-place"` retains original positions.
299
+ The same metadata works on `VuetableColumn`; public slot helpers align custom rows.
300
+ See [fixed columns](https://github.com/Artles777/vuetable-next/blob/main/docs/fixed-columns.md) for themes and viewport limits.
525
301
 
526
- [Upstream #627](https://github.com/ratiw/vuetable-2/issues/627) reports confusion
527
- about this configuration. The configured API flow works in the current package;
528
- the behavior is covered by regression tests rather than a runtime correction.
302
+ ### Custom fields, selection and pagination
529
303
 
530
- ### Checkbox events and row data
304
+ #### Selection and identity
531
305
 
532
- The built-in `__checkbox` field emits `vuetable:checkbox-toggled` when an
533
- individual row is checked or unchecked. The handler receives three arguments:
534
-
535
- ```js
536
- function onCheckboxToggled(checked, fieldName, rowData) {
537
- console.log(checked, fieldName, rowData.id);
538
- }
539
- ```
306
+ Add `"__checkbox"` to `fields` for row selection. `track-by` defaults to `id`, so
307
+ you can omit the prop when your rows already have stable, unique `id` values:
540
308
 
541
309
  ```vue
542
310
  <Vuetable
543
311
  :fields="['__checkbox', 'name']"
544
312
  :data="rows"
545
313
  :api-mode="false"
546
- @vuetable:checkbox-toggled="onCheckboxToggled"
314
+ @vuetable:checkbox-toggled="onSelection"
547
315
  />
548
316
  ```
549
317
 
550
- The same signature applies on Vue 2.6, Vue 2.7 and Vue 3:
551
-
552
- - `checked` is the new boolean state.
553
- - `fieldName` is the normalized checkbox field name, not the record or its ID.
554
- - `rowData` is the complete current-row object, using your configured `track-by`
555
- identifier. It is supplied on both selection and deselection, after the
556
- table's selected IDs have been updated.
557
-
558
- Existing handlers taking only `(checked, fieldName)` can continue to ignore the
559
- third argument. Do not treat the first argument (`$event` in an inline listener)
560
- as the row: it is the boolean. A custom `event-prefix` changes the event name,
561
- not the argument order.
562
-
563
- `vuetable:checkbox-toggled-all` remains a separate bulk event with only the
564
- `checked` boolean; there is no single row associated with select-all.
565
-
566
- This corrects the missing row payload described in
567
- [upstream vuetable-2 #716](https://github.com/ratiw/vuetable-2/issues/716). Earlier
568
- builds passed the row into the table's checkbox handler but dropped it when
569
- emitting the outward event. The correction is included in [1.1.1](CHANGELOG.md#111---2026-12-02).
570
-
571
- ### Row identity and custom-field loading
318
+ ```js
319
+ function onSelection (checked, fieldName, rowData) {
320
+ console.log(checked, fieldName, rowData.id);
321
+ }
322
+ ```
572
323
 
573
- **`track-by` selects the identifier; `rowKeys` is the internal render identity.**
574
- `track-by` is an existing public prop naming the record property used for
575
- identity. It defaults to `"id"` and is also used by row selection and expanded
576
- details. The internal computed `rowKeys` derives Vue render keys from those
577
- values; it is not another prop you need to supply. Neither mechanism searches
578
- the API or generates a business ID for your records.
324
+ Use `track-by="uuid"` for another record-key field. Stable IDs keep selection,
325
+ detail rows and stateful custom cells associated with the record, not its array
326
+ position. `__handle` supplies an icon; it does not install drag-and-drop.
579
327
 
580
- #### Can I omit track-by?
328
+ #### Pagination wiring
581
329
 
582
- Yes, if your records already contain stable, unique `id` values. These two
583
- declarations are equivalent on Vue 2.6, Vue 2.7 and Vue 3:
330
+ Companion pagination components are connected explicitly. A Vue 3 remote table:
584
331
 
585
332
  ```vue
586
- <!-- rows: [{ id: 101, name: "Ada" }, { id: 102, name: "Sam" }] -->
587
- <Vuetable :fields="fields" :data="rows" :api-mode="false" />
588
- <Vuetable :fields="fields" :data="rows" :api-mode="false" track-by="id" />
589
- ```
590
-
591
- If the identifier has another name, specify it explicitly:
333
+ <script setup>
334
+ import { ref } from "vue";
335
+ import Vuetable, { VuetablePagination } from "vuetable-next";
336
+ import "vuetable-next/style.css";
592
337
 
593
- ```vue
594
- <!-- rows: [{ articleId: "article-101", title: "First article" }] -->
595
- <Vuetable
596
- :fields="fields"
597
- :data="rows"
598
- :api-mode="false"
599
- track-by="articleId"
600
- />
601
- ```
338
+ const table = ref(null);
339
+ const pagination = ref(null);
340
+ const fields = [{ name: "name", title: "Customer", sortField: "name" }];
602
341
 
603
- The lookup is the direct property `row[trackBy]`, not a nested path. For example,
604
- `track-by="article.id"` refers to a literal property named `"article.id"`; it
605
- does not read `row.article.id`. Normalize nested API identifiers to a top-level
606
- property when needed.
607
-
608
- #### Can I omit the identifier itself?
609
-
610
- Ordinary cells can still render without IDs, but that is not equivalent to
611
- having reliable record identity. Give every record a stable, unique identifier:
612
- it must be unique across pages, not a row number starting again on each page.
613
- Use string or finite-number IDs (`0` and the empty string are supported). Rows
614
- with missing, unsupported or duplicated IDs retain positional fallback behavior;
615
- they cannot reliably preserve record-specific component state across pages.
616
- Selection and expanded details also need unique IDs; positional render fallback
617
- does not provide them. Do not generate a fresh random ID on every refresh or use
618
- the array index as a substitute for a persistent record ID.
619
-
620
- #### Why not just use the row index?
621
-
622
- Vue uses keys to decide which rendered component belongs to which item; see
623
- [maintaining state with key](https://vuejs.org/guide/essentials/list.html#maintaining-state-with-key).
624
- An index identifies a position, not a record: row zero on page two is usually a
625
- different record from row zero on page one. Reusing the positional component can
626
- therefore reuse its old local state as well.
627
-
628
- The internal key calculation separates numeric and string IDs, keeps fallback
629
- keys separate from real IDs, and handles every duplicate consistently. It uses
630
- two linear passes, cached in a computed value. Replacing it with
631
- `row[trackBy] || index` would lose valid `0`/empty-string IDs and reintroduce key
632
- collisions; the extra handling is deliberate, not extra configuration for users.
633
-
634
- #### Pagination fix: upstream issue #737
635
-
636
- The symptom reported in
637
- [vuetable-2 #737 — calling api in component field error with pagination](https://github.com/ratiw/vuetable-2/issues/737)
638
- was that a custom field fetching data in `mounted` kept showing the first page's
639
- result after moving to the second page. We reproduced the same symptom in this
640
- fork and corrected its positional row keys. This fix is recorded under
641
- [1.1.1](CHANGELOG.md#111---2026-12-02); it does not change the upstream repository.
642
-
643
- Stateful cells follow their record when rows reorder. Changing pages to different
644
- record IDs creates new cell instances, so a custom field that loads data in
645
- `mounted` loads it for the new record instead of retaining the previous page's
646
- result. Refreshing the same ID preserves its component state.
647
- Expanded details also receive record-specific keys so they cannot display another
648
- record's cached content. Vue 2 may recreate expanded detail components when rows
649
- reorder; do not rely on their local state surviving a reorder.
650
-
651
- If the loaded data also depends on a property that can change **without changing
652
- the record ID**, watch that property in your custom component and reload there.
653
- `mounted` runs once per component instance, not on every data refresh. Cancel or
654
- ignore stale asynchronous requests when their component is unmounted or their
655
- input changes.
656
-
657
- ### Row order and drag handles
658
-
659
- **Programmatic row reordering is supported; built-in drag-and-drop is not.**
660
- In local data mode, the table displays rows in the order supplied through `data`.
661
- Replace that array with a reordered copy to move records. Use unique, stable
662
- `track-by` values, not array positions, so selection and record identity keep
663
- following the same records.
342
+ function onPagination (data) {
343
+ pagination.value?.setPaginationData(data);
344
+ }
345
+ function onPage (page) {
346
+ table.value?.changePage(page);
347
+ }
348
+ </script>
664
349
 
665
- ```vue
666
350
  <template>
667
- <div>
668
- <button type="button" @click="moveRow(0, 1)">Move first row down</button>
669
- <Vuetable :fields="fields" :data="rows" :api-mode="false" track-by="id" />
670
- </div>
351
+ <Vuetable
352
+ ref="table"
353
+ api-url="/api/customers"
354
+ :fields="fields"
355
+ @vuetable:pagination-data="onPagination"
356
+ />
357
+ <VuetablePagination ref="pagination" @vuetable-pagination:change-page="onPage" />
671
358
  </template>
359
+ ```
672
360
 
673
- <script>
674
- import Vuetable from "vuetable-next"
361
+ The endpoint returns an Axios response body such as:
675
362
 
676
- export default {
677
- components: { Vuetable },
678
- data() {
679
- return {
680
- fields: ["name"],
681
- rows: [{ id: 1, name: "Alice" }, { id: 2, name: "Bob" }]
682
- }
683
- },
684
- methods: {
685
- moveRow(fromIndex, toIndex) {
686
- if (!Number.isInteger(fromIndex) || !Number.isInteger(toIndex) ||
687
- fromIndex < 0 || toIndex < 0 ||
688
- fromIndex >= this.rows.length || toIndex >= this.rows.length) return
689
- const reordered = [...this.rows]
690
- const [record] = reordered.splice(fromIndex, 1)
691
- reordered.splice(toIndex, 0, record)
692
- this.rows = reordered
363
+ ```json
364
+ {
365
+ "data": [{ "id": 1, "name": "Alex Morgan" }],
366
+ "links": {
367
+ "pagination": {
368
+ "total": 1, "per_page": 10, "current_page": 1,
369
+ "last_page": 1, "from": 1, "to": 1
693
370
  }
694
371
  }
695
372
  }
696
- </script>
697
373
  ```
698
374
 
699
- This Options API example works on Vue 2.6, Vue 2.7 and Vue 3 with the appropriate
700
- [runtime bootstrap](#quick-start). Vue 3 `createVuetable()` tables use the same
701
- data-order behavior. Expanded detail components have the Vue 2 lifecycle
702
- limitation described in [row identity](#row-identity-and-custom-field-loading).
703
-
704
- The legacy `__handle` field renders a handle icon with the `.handle-icon` class.
705
- It does **not** initialize SortableJS, attach drag listeners, update the data array
706
- or save a new order. The question in
707
- [upstream vuetable-2 #612](https://github.com/ratiw/vuetable-2/issues/612) concerns
708
- this distinction. External drag integrations must synchronize application data,
709
- not only move DOM elements, and must account for expanded detail and empty rows.
710
- No ready-made SortableJS adapter is shipped or documented as supported.
375
+ `initial-page` controls the first API page; `per-page` controls the requested page
376
+ size. A sortable field sends sort state to the server. With local arrays, your
377
+ application owns sorting and pagination, for example through `data-manager`;
378
+ clicking a sortable header alone does not reorder the array.
711
379
 
712
- In API mode the server controls returned order. Persisting a move, handling
713
- pagination/filtering/sorting conflicts and retaining that order after a reload
714
- are application/server responsibilities. An opt-in drag-and-drop feature is
715
- planned for a future feature release, not included in the current bugfix release.
380
+ #### Extend existing components
716
381
 
717
- ### Mixins or composables?
718
-
719
- Keep legacy mixins for existing Options API components, or choose a composable
720
- for new `setup()` components. Both styles are supported on all three runtimes.
721
-
722
- | Existing mixin | Composable alternative |
382
+ | Existing helper | Composition API equivalent |
723
383
  | --- | --- |
724
384
  | `VuetableFieldMixin` | `useVuetableField` |
725
385
  | `VuetableFieldCheckboxMixin` | `useVuetableFieldCheckbox` |
726
386
  | `VuetablePaginationMixin` | `useVuetablePagination` |
727
387
  | `VuetablePaginationInfoMixin` | `useVuetablePaginationInfo` |
728
388
 
729
- ```js
730
- import {
731
- useVuetableField,
732
- useVuetableFieldCheckbox,
733
- useVuetablePagination,
734
- useVuetablePaginationInfo
735
- } from "vuetable-next";
736
- ```
737
-
738
- See [Mixins and composables](https://github.com/Artles777/vuetable-next/blob/main/docs/mixins-and-composables.md) for paired component
739
- examples, props, event wiring, pagination data, and complete Vue 2.6 / Vue 2.7 /
740
- Vue 3 startup examples. Vue 2.6 registers `@vue/composition-api` once; Vue 2.7 and
741
- Vue 3 do not need that plugin. Existing mixins remain public — no forced migration.
742
-
743
- ### Explicit framework entries and types
389
+ All are named public exports. Both approaches work on all supported runtimes;
390
+ Vue 2.6 needs the plugin shown in the quick start. Set `detail-row-component`
391
+ for expandable content and call `table.toggleDetailRow(recordId)` on the table
392
+ instance to toggle it.
393
+
394
+ Keep legacy mixins or use composables in `setup()` on all three runtimes:
395
+ [paired examples and event wiring](https://github.com/Artles777/vuetable-next/blob/main/docs/mixins-and-composables.md).
396
+ For [checkbox events](https://github.com/Artles777/vuetable-next/blob/main/docs/data-and-requests.md#checkbox-events-and-row-data),
397
+ handlers receive `(checked, fieldName, rowData)`; select-all has only `checked`.
398
+ Use stable record IDs for [stateful cells and details](https://github.com/Artles777/vuetable-next/blob/main/docs/data-and-requests.md#row-identity-and-custom-field-loading).
399
+ [Programmatic row order](https://github.com/Artles777/vuetable-next/blob/main/docs/data-and-requests.md#row-order-and-drag-handles)
400
+ follows the supplied array; `__handle` is an icon, not built-in drag-and-drop.
401
+ Vue 3 skips unchanged row renders for listener-only updates automatically;
402
+ the optional `createVuetable()` factory specializes event configuration, not the
403
+ ability to use render functions. It is not required for this optimization.
404
+ For `h()` components in plain JavaScript/TypeScript, import the normal table and
405
+ return `h(Vuetable, props)` from your Vue 3 render/setup function.
406
+
407
+ #### Migrating an existing table
408
+
409
+ 1. Replace the dependency and root imports with `vuetable-next`.
410
+ 2. Keep your field objects, default theme, events, pagination wiring and methods.
411
+ 3. Replace private `vuetable-2/src/...` imports with this package's public named exports.
412
+ 4. Apply only the bootstrap required by your Vue version; when moving the whole
413
+ application to Vue 3, migrate your own custom components and Vue-specific syntax.
414
+
415
+ Unstyled, Tailwind, declarative columns and lean imports are optional; existing
416
+ tables do not need to adopt them. Detailed examples, edge cases and the optional
417
+ [factory event contract](https://github.com/Artles777/vuetable-next/blob/main/docs/migration.md#vue-3-automatic-row-render-optimization)
418
+ are in the extended guides, not prerequisites for this README's examples.
419
+
420
+ ## TypeScript
744
421
 
745
422
  Usually the root import is all you need. If your bundler needs an explicit target:
746
423
 
@@ -758,78 +435,86 @@ For native Vue 3 branded `Ref`/`ComputedRef` types or direct-ref `watch()`
758
435
  inference, import from `/vue3`; with the root entry, watch a getter instead.
759
436
  See the [typing examples](https://github.com/Artles777/vuetable-next/blob/main/docs/mixins-and-composables.md#typescript-ref-interop).
760
437
 
761
- ---
762
-
763
- ## Live demos
438
+ Public types can be imported without adding runtime code:
764
439
 
765
- From a checkout, using Node.js 22:
766
-
767
- ```sh
768
- npm install --legacy-peer-deps --package-lock=false
769
- npm run demo
770
- ```
771
-
772
- Wait until the terminal prints **three verified applications**, then open the
773
- printed HTTP address. Keep this terminal running while using the demo. Do not
774
- open `index.html` or `demo/showcase.html` as a local file: they are build inputs,
775
- not standalone demo pages. These are local development URLs, not a hosted demo;
776
- another developer runs the same commands on their own computer.
440
+ ```ts
441
+ import type {
442
+ VuetableField,
443
+ VuetableProps,
444
+ VuetableInstance,
445
+ VuetableColumnCellScope,
446
+ VuetablePaginationData
447
+ } from "vuetable-next";
777
448
 
778
- If the default port is already in use, choose one explicitly with
779
- `npm run demo -- --port 8001`. The command never stops an existing server.
449
+ interface Campaign {
450
+ id: number;
451
+ name: string;
452
+ }
780
453
 
781
- The demo command packs the library, checks that same archive in isolated Vue
782
- 2.6, Vue 2.7 and Vue 3 consumers, and serves their interactive showcases. Open
783
- the local URL printed by the command and choose a runtime. Initial setup needs
784
- network access to install the temporary consumers.
454
+ const fields: VuetableField[] = [{ name: "name", title: "Campaign" }];
455
+ const tableProps: VuetableProps = { fields, apiMode: false };
785
456
 
786
- Try selecting and clearing rows, replacing data, opening details, and reloading.
787
- The live state panel shows the runtime version, selected IDs, emitted custom
788
- events and any captured runtime errors.
457
+ function campaignLabel(scope: VuetableColumnCellScope<Campaign>): string {
458
+ return scope.row.name;
459
+ }
460
+ ```
789
461
 
790
- On the Vue 3 page, choose **Factory playground** (`/vue-3/factory/`) for the
791
- interactive `createVuetable()` demo: sortable and paginated orders, checkboxes,
792
- details, custom row actions, and measured generic-versus-factory listener updates
793
- (both avoid rebuilding unchanged rows in the listener-only scenario).
794
- It uses the same freshly packed archive; Vue 2 pages keep the generic component.
462
+ For Vue 3-native column, slot and composable types, use `import type` from
463
+ `"vuetable-next/vue3"`. Type-only imports are erased by TypeScript; they do not
464
+ load a second table build or Axios. The package supplies declarations, not a
465
+ claim of exhaustive strict typing: legacy extension points and some row/event
466
+ APIs intentionally retain `any` for compatibility. Your API responses still
467
+ need application-owned types and validation where appropriate.
795
468
 
796
- For source-level Vue 3 development, `npm run dev` starts the Vite demo. The legacy
797
- `dev:2` source demo is not the cross-version compatibility gate; use the packed
798
- demo and consumer matrix for Vue 2 verification.
469
+ No SFC required: [TypeScript `h()` / render examples](https://github.com/Artles777/vuetable-next/blob/main/docs/migration.md#typescript-render-functions-without-sfcs)
470
+ use the ordinary table; `createVuetable()` is optional, not a renderer builder.
799
471
 
800
- ---
472
+ ## Demos
801
473
 
802
- ## Screenshots
474
+ From a checkout, using Node.js 22:
803
475
 
804
- ### Vue 3 · selection and expandable details
476
+ ```sh
477
+ npm install --legacy-peer-deps --package-lock=false
478
+ npm run demo
479
+ ```
805
480
 
806
- ![Real Vuetable Next component on Vue 3, with a selected row and expanded detail](https://raw.githubusercontent.com/Artles777/vuetable-next/main/docs/images/vue3-table.jpg)
481
+ Wait for **three verified applications**, then open the printed HTTP URL and keep
482
+ the terminal running. The command packs one archive, checks isolated Vue 2.6,
483
+ Vue 2.7 and Vue 3 consumers, then serves their showcases; initial setup needs
484
+ network access. Do not open the HTML build inputs as local files.
485
+ Use `npm run demo -- --port 8001` if needed; it never stops an existing server.
486
+
487
+ Try selection, replacement, details and reload; inspect IDs, events and errors
488
+ in the live state panel. See the [demo guide](https://github.com/Artles777/vuetable-next/blob/main/demo/README.md) for
489
+ [declarative columns](https://github.com/Artles777/vuetable-next/blob/main/demo/README.md#declarative-columns),
490
+ [grouped layout](https://github.com/Artles777/vuetable-next/blob/main/demo/README.md#grouped-layout-playground),
491
+ [pinned columns](https://github.com/Artles777/vuetable-next/blob/main/demo/README.md#pinned-columns-playground) and
492
+ [Vue 3 factory controls](https://github.com/Artles777/vuetable-next/blob/main/demo/README.md#factory-playground).
493
+ The theme playground also demonstrates unstyled, mixed-theme and Tailwind tables.
494
+ **Vue runtime** selects the application version; **Feature demos** opens a
495
+ separate example in the same browser tab. On the theme page, **All tables**
496
+ controls fixed headers and row count; the raw-style and dark-mode switches sit
497
+ beside the individual previews they affect. The Vite source playground is a
498
+ separate development workflow, not another runtime in the packed demo.
499
+
500
+ ![Vue 3 selection and expandable details](https://raw.githubusercontent.com/Artles777/vuetable-next/main/docs/images/vue3-table.jpg)
807
501
 
808
502
  <details>
809
- <summary><strong>See the same component on Vue 2.6 and Vue 2.7</strong></summary>
810
-
811
- #### Vue 2.6 + Composition API
812
-
813
- ![Real Vuetable Next component on Vue 2.6](https://raw.githubusercontent.com/Artles777/vuetable-next/main/docs/images/vue26-table.jpg)
503
+ <summary>Same packed component on Vue 2.6 and Vue 2.7</summary>
814
504
 
815
- #### Vue 2.7 · native Composition API
816
-
817
- ![Real Vuetable Next component on Vue 2.7](https://raw.githubusercontent.com/Artles777/vuetable-next/main/docs/images/vue27-table.jpg)
505
+ ![Vue 2.6 + Composition API](https://raw.githubusercontent.com/Artles777/vuetable-next/main/docs/images/vue26-table.jpg)
506
+ ![Vue 2.7 native Composition API](https://raw.githubusercontent.com/Artles777/vuetable-next/main/docs/images/vue27-table.jpg)
818
507
 
819
508
  </details>
820
509
 
821
- These are real browser captures of the **same packed library** in three isolated
822
- Vue applications. The surrounding dashboard and green theme are showcase styles,
823
- not a theme automatically installed by the library. No live customer data is used.
824
-
825
- ---
510
+ Screenshots are real browser captures with showcase-owned dashboard/theme styling,
511
+ not an automatically installed dashboard. No live customer data is used.
826
512
 
827
- ## Development and checks
513
+ ## Development
828
514
 
829
- Use Node.js 22 for the documented development workflow. See
830
- [CONTRIBUTING.md](https://github.com/Artles777/vuetable-next/blob/main/CONTRIBUTING.md) for complete setup, fork/collaborator Git
831
- commands, linting, regression tests, package validation, the three-runtime matrix,
832
- type checks, browser verification and pull request requirements.
515
+ Read [CONTRIBUTING](https://github.com/Artles777/vuetable-next/blob/main/CONTRIBUTING.md) for setup, runtime/type/browser checks and PRs
516
+ against `main`. Include reproductions and actual validation results using the
517
+ [pull request template](https://github.com/Artles777/vuetable-next/blob/main/.github/pull_request_template.md).
833
518
 
834
519
  ```sh
835
520
  npm run test -- --run
@@ -839,37 +524,43 @@ npm run build
839
524
  npm run check:package
840
525
  ```
841
526
 
842
- Do not use a successful source test run as a substitute for checking the packed
843
- package on each supported framework. The build produces framework-specific
844
- render artifacts from shared component sources; generated files are not edited
845
- by hand.
846
-
847
- ---
527
+ `npm run dev` starts source-level Vue 3 development. `dev:2` is not the Vue 2
528
+ compatibility gate: verify the packed package in each supported runtime.
529
+ Do not edit generated framework render artifacts by hand.
530
+ For a local archive, run `npm pack` (its `prepack` hook builds and checks), then
531
+ install the printed filename in your app, e.g.
532
+ `npm install /absolute/path/to/vuetable-next/vuetable-next-VERSION.tgz`.
533
+ This uses the checkout's package version and does not publish anything.
848
534
 
849
- ## Contributing
535
+ ## Compatibility
850
536
 
851
- Bug reports, focused fixes and documentation improvements are welcome. Both fork
852
- contributors and repository collaborators should use feature branches and open
853
- pull requests against **`main`**.
537
+ | Application runtime | Declared support | Tested runtime | Composition API plugin |
538
+ | --- | --- | --- | --- |
539
+ | Vue 2.6 | `^2.6.14` | `2.6.14` | Install `@vue/composition-api` |
540
+ | Vue 2.7 | Included in the Vue 2 range | `2.7.16` | Not needed |
541
+ | Vue 3 | `^3.5.3` | `3.5.46` | Not needed |
854
542
 
855
- Read the [contribution guide](https://github.com/Artles777/vuetable-next/blob/main/CONTRIBUTING.md), include a reproduction and actual
856
- validation results, and use the [pull request template](https://github.com/Artles777/vuetable-next/blob/main/.github/pull_request_template.md).
543
+ Normal Vuetable-2 usage needs no rewrite of tables, default theme, fields, events,
544
+ methods or pagination: change package/import paths and Vue-specific bootstrap.
545
+ New features are opt-in; lean imports are optional payload optimization, not
546
+ required migration. Your custom Vue 3 components, slots and render functions
547
+ still need Vue's own migration; third-party extensions need application testing.
548
+ See [migration and public exports](https://github.com/Artles777/vuetable-next/blob/main/docs/migration.md).
857
549
 
858
- ---
550
+ `vue-demi` selects separately compiled builds without aliases or dependency
551
+ patches. Consumer checks cover rendering, reactive data, custom fields/mixins,
552
+ selection, events, details, methods, teardown, resolution and declarations;
553
+ Vue 2.6 also has a webpack 4 consumer check. This is not exhaustive certification
554
+ of every upstream example or application integration.
859
555
 
860
556
  ## Limitations and security
861
557
 
862
- - Vue 2.6 needs Composition API; Vue 2.7 and Vue 3 do not.
863
- - The package has no standalone UMD/CDN script build. Use a supported bundler or module environment.
864
- - Showcase screenshots use custom example styling. The default table does not include the surrounding dashboard.
865
- - Vue 2 has a known low-severity framework advisory, [GHSA-5j4c-8p2g-v4jx](https://github.com/advisories/GHSA-5j4c-8p2g-v4jx). Compatibility support does not make an end-of-life runtime security-supported.
866
- - Consumer verification is not a blanket guarantee for every upstream example or application integration. Test your own custom renderers, API contracts and migration scenarios.
867
-
868
- ---
558
+ - Vue 2.6 requires Composition API; Vue 2.7 and Vue 3 do not.
559
+ - No standalone UMD/CDN script build: use a supported bundler or module environment.
560
+ - Vue 2 has a known low-severity [framework advisory](https://github.com/advisories/GHSA-5j4c-8p2g-v4jx); compatibility does not make an end-of-life runtime security-supported.
561
+ - Validate application API responses and custom integrations; declarations intentionally retain some legacy `any` boundaries.
869
562
 
870
563
  ## License and credits
871
564
 
872
565
  [MIT](https://github.com/Artles777/vuetable-next/blob/main/LICENSE) · Maintained by Artem Alesenko.
873
-
874
- Based on [Vuetable-2](https://github.com/ratiw/vuetable-2). Thanks to its original
875
- authors and contributors for the table API and documentation that this fork builds on.
566
+ Based on [Vuetable-2](https://github.com/ratiw/vuetable-2); thanks to its original authors and contributors.