vuetable-next 1.1.0 → 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 +311 -270
  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 +20 -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 +15 -22
  35. package/dist/vue2.js +381 -1737
  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 +454 -1995
  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,52 +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) · [mixins and composables](#mixins-or-composables) · [TypeScript](#explicit-framework-entries-and-types)
20
- - [Live demos](#live-demos) · [screenshots](#screenshots)
21
- - [Development and checks](#development-and-checks) · [contributing](#contributing)
22
- - [Limitations and security](#limitations-and-security) · [license and credits](#license-and-credits)
23
-
24
- **First time here?** Start with your Vue version in [Quick start](#quick-start).
25
- For task-oriented guides and complete API examples, open the [documentation index](https://github.com/Artles777/vuetable-next/blob/main/docs/README.md).
26
- For release history, see the [changelog](https://github.com/Artles777/vuetable-next/blob/main/CHANGELOG.md).
27
-
28
- ---
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)
29
27
 
30
28
  ## Why Vuetable Next?
31
29
 
32
- `vuetable-next` is a fork of `vuetable-2`, built around `vue-demi` to retain a
33
- familiar table API while supporting both Vue 2 and Vue 3 applications.
34
-
35
- | One table API | Framework-aware packaging | Built to extend |
36
- | --- | --- | --- |
37
- | 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 |
38
-
39
- - **Keep familiar concepts.** Use the original Vuetable-2 documentation as the API reference.
40
- - **Move at your own pace.** Vue 2.6, Vue 2.7 and Vue 3 use the same root import.
41
- - **Choose your integration.** Local components, global registration, ESM and CommonJS are supported.
42
- - **Keep dependencies shared.** Vue, `vue-demi` and Axios are external, not private copies embedded in the bundle.
43
- - **Use TypeScript.** Portable root declarations work across supported Vue generations; the explicit Vue 3 entry provides richer generated types.
44
-
45
- > **Compatibility note:** releases from `1.0.11` onward include the Vue 2.6 / Vue 2.7 / Vue 3 packaging,
46
- > public composables and portable declarations described here. The older
47
- > `1.0.10` release does not contain these compatibility changes.
48
-
49
- ---
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).
50
49
 
51
50
  ## Quick start
52
51
 
53
52
  ### Install
54
53
 
55
- Install the latest stable release:
54
+ Install from npm:
56
55
 
57
56
  ```sh
58
57
  npm install vuetable-next@latest
@@ -67,23 +66,6 @@ For Vue 2.6, also install the Composition API plugin:
67
66
  npm install @vue/composition-api
68
67
  ```
69
68
 
70
- **Developing or testing a local revision?** From a checkout of this repository:
71
-
72
- ```sh
73
- npm install --legacy-peer-deps --package-lock=false
74
- npm pack
75
- ```
76
-
77
- Then install the generated archive from your application directory, replacing
78
- `VERSION` with the version in the filename printed by `npm pack`:
79
-
80
- ```sh
81
- npm install /absolute/path/to/vuetable-next/vuetable-next-VERSION.tgz
82
- ```
83
-
84
- `npm pack` runs the dual build and package checks through `prepack`. The archive
85
- uses the version currently declared in `package.json`; it does not publish anything.
86
-
87
69
  ### Vue 3
88
70
 
89
71
  Import the table and stylesheet, then pass your fields and rows. This example
@@ -192,40 +174,92 @@ new Vue({ render: createElement => createElement(App) }).$mount("#app");
192
174
  For global registration on either Vue 2 version, import `Vuetable` in your
193
175
  entry point and call `Vue.use(Vuetable)` before creating the root instance.
194
176
 
195
- ---
177
+ ## Styling
196
178
 
197
- ## Compatibility
179
+ Choose the appearance independently of how you define columns or load data:
198
180
 
199
- | Application runtime | Declared support | Tested runtime | Composition API plugin |
200
- | --- | --- | --- | --- |
201
- | Vue 2.6 | `^2.6.14` | `2.6.14` | Install `@vue/composition-api` |
202
- | Vue 2.7 | Included in the Vue 2 range | `2.7.16` | Not needed |
203
- | Vue 3 | `^3.5.3` | `3.5.46` | Not needed |
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 |
186
+
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).
204
191
 
205
- The package contains separately compiled Vue 2 and Vue 3 render functions.
206
- `vue-demi` selects the correct build for the installed runtime; no application
207
- alias or manual dependency patch is needed for normal root imports.
192
+ For application-owned CSS, opt into `unstyled`; add the optional Tailwind preset:
208
193
 
209
- Checks cover actual rendering, reactive data updates, legacy field mixins, custom
210
- fields, checkbox selection, events, detail-row parent access, component methods,
211
- teardown, module resolution and public declarations. Vue 2.6 is also checked with
212
- a webpack 4 consumer toolchain. This is not a claim that every upstream example
213
- or every possible consumer integration has been exhaustively tested.
194
+ ```vue
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>
214
202
 
215
- ---
203
+ <template>
204
+ <Vuetable unstyled :css="tailwind.table" :api-mode="false" :fields="fields" :data="rows" />
205
+ </template>
206
+ ```
207
+
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.
218
+
219
+ ## Data and HTTP
220
+
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:
223
+
224
+ ```vue
225
+ <Vuetable api-url="/api/articles" :fields="fields" />
226
+ <Vuetable api-url="/api/articles/search" http-method="post" :fields="fields" />
227
+ ```
216
228
 
217
- ## Features in 1.1.0
229
+ ### Axios usage
218
230
 
219
- The new column, layout and pinning APIs are additive. Existing `fields` tables
220
- keep working without migration. See [1.1.0 release notes](https://github.com/Artles777/vuetable-next/blob/main/CHANGELOG.md#110---2026-12-02).
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.
221
239
 
222
- ### Declarative columns (opt-in)
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.
223
247
 
224
- For left/right column pinning, dynamic group headers and custom totals, see
225
- [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).
248
+ ## Table features
226
249
 
227
- Alongside the existing `fields` API, declarations can provide column metadata and
228
- scoped templates. Import `Vuetable, { VuetableColumn }` from `vuetable-next`:
250
+ Existing `fields` tables remain the default; these additional APIs are opt-in.
251
+
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) |
259
+
260
+ ### Declarative columns
261
+
262
+ Import `Vuetable, { VuetableColumn }` from `vuetable-next`:
229
263
 
230
264
  ```vue
231
265
  <Vuetable :data="rows" :api-mode="false">
@@ -235,31 +269,22 @@ scoped templates. Import `Vuetable, { VuetableColumn }` from `vuetable-next`:
235
269
  </Vuetable>
236
270
  ```
237
271
 
238
- See the [declarative columns guide](https://github.com/Artles777/vuetable-next/blob/main/docs/declarative-columns.md) for all three
239
- runtime setups, both APIs, precedence and migration limits. This is additive,
240
- not full Buefy compatibility; existing `fields` tables need no migration.
241
- The [shared showcase](https://github.com/Artles777/vuetable-next/blob/main/demo/README.md#declarative-columns) has interactive controls.
242
-
243
- ### Grouped headers and extra rows (opt-in)
244
-
245
- Keep the standard sortable header and add subheaders or totals with
246
- `beforeHeader`, `afterHeader`, `beforeFooter` and `afterFooter`. Enable
247
- `group-by="headerName"` for field objects or `group-by="group"` for declarative
248
- columns. Visible groups calculate their own spans and expose semantic boundary
249
- classes when columns are hidden or reordered.
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.
250
274
 
251
- See [table layout and grouped headers](https://github.com/Artles777/vuetable-next/blob/main/docs/table-layout.md) for slot scope,
252
- precedence, gutter alignment and migration examples. Available starting with `1.1.0`.
275
+ ### Grouped headers and extra rows
253
276
 
254
- ### Fixed columns (opt-in)
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.
255
282
 
256
- Pin multiple columns on either side with `fixed: "left"` or `fixed: "right"`.
257
- Pinned columns move to their edge by default; `fixedOrder` sets their rank from
258
- that edge, and automatic ranks follow pin activation order. Choose
259
- `fixed-mode="in-place"` to keep the original column positions.
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.
260
286
 
261
-
262
- For example, with object fields:
287
+ ### Fixed columns
263
288
 
264
289
  ```js
265
290
  const fields = [
@@ -269,128 +294,130 @@ const fields = [
269
294
  ];
270
295
  ```
271
296
 
272
- The same metadata works on `VuetableColumn`. Generated headers, grouped headers,
273
- custom subheaders and totals can share pinning styles through the public slot
274
- helpers. See the [fixed columns guide](https://github.com/Artles777/vuetable-next/blob/main/docs/fixed-columns.md) for ordering,
275
- custom rows, theme variables and viewport limits, then try the
276
- [scrolling playground](https://github.com/Artles777/vuetable-next/blob/main/demo/README.md#pinned-columns-playground).
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.
277
301
 
278
- ---
302
+ ### Custom fields, selection and pagination
279
303
 
280
- ## Documentation and migration
304
+ #### Selection and identity
281
305
 
282
- ### Familiar Vuetable-2 documentation
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:
283
308
 
284
- Start with the original [Vuetable-2 guide](https://vuetable.com/guide/) and
285
- [API reference](https://vuetable.com/api/) for fields, API mode, sorting,
286
- pagination, events, methods, custom fields and detail rows.
309
+ ```vue
310
+ <Vuetable
311
+ :fields="['__checkbox', 'name']"
312
+ :data="rows"
313
+ :api-mode="false"
314
+ @vuetable:checkbox-toggled="onSelection"
315
+ />
316
+ ```
287
317
 
288
- The table API is intended to stay familiar on Vue 2 and Vue 3. Framework-level
289
- differences still apply: use Vue 3 slot/render-function conventions in your own
290
- components, and follow the setup instructions for your installed Vue version.
318
+ ```js
319
+ function onSelection (checked, fieldName, rowData) {
320
+ console.log(checked, fieldName, rowData.id);
321
+ }
322
+ ```
291
323
 
292
- ### Vue 3: automatic row-render optimization
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.
293
327
 
294
- The standard `Vuetable` avoids rebuilding unchanged rows when parent updates
295
- only replace event listeners, including inline callbacks. No factory, special
296
- registration or application-side listener caching is required. The outer
297
- component can still update to keep listeners and root attributes current.
298
- Reactive rows, fields and values read by formatters continue to update normally.
299
- External slots are updated conservatively so their content cannot become stale;
300
- this is not a promise to skip renders when table content actually changes.
328
+ #### Pagination wiring
301
329
 
302
- `createVuetable()` remains optional for declaring a fixed component-event
303
- contract. It is not required for the standard listener-only optimization.
330
+ Companion pagination components are connected explicitly. A Vue 3 remote table:
304
331
 
305
- ```ts
306
- import { createVuetable } from "vuetable-next";
332
+ ```vue
333
+ <script setup>
334
+ import { ref } from "vue";
335
+ import Vuetable, { VuetablePagination } from "vuetable-next";
336
+ import "vuetable-next/style.css";
307
337
 
308
- const AuditTable = createVuetable({
309
- eventPrefix: "audit:",
310
- events: ["custom-action"]
311
- });
312
- ```
338
+ const table = ref(null);
339
+ const pagination = ref(null);
340
+ const fields = [{ name: "name", title: "Customer", sortField: "name" }];
313
341
 
314
- Define the component once at module scope, outside `render()` and `setup()`, then
315
- register it locally or use it directly in `<script setup>`. Keep existing table
316
- props, slots and refs; listen with `@audit:row-clicked` or `@audit:custom-action`.
317
- `events` contains **additional unprefixed** names passed to `fireEvent()`; the
318
- default prefix is `vuetable:`. Vue handles latest listeners, `.once`, errors and
319
- native DOM listeners normally. With an empty prefix, declaring `click` makes
320
- `@click` a component event only, not a root DOM click listener.
321
-
322
- The prefix is fixed for each factory component: overriding its `eventPrefix`
323
- prop is unsupported and warns in development. Undeclared factory events also
324
- warn in development. Create another factory for a different prefix or event set.
325
- Factory results are local components, not plugins (`app.use()` is unsupported).
326
- For the generic component, single-word listeners such as `onCustom` are ambiguous:
327
- they fall through to the root DOM element as well as receiving component events.
328
- Use the factory with `events: ["custom"]` when a listener must be component-only.
329
- Explicit Vue DOM listeners such as `on:custom-event` remain DOM listeners.
330
- The generic `Vuetable` remains fully dynamic and warning-free for arbitrary
331
- prefixes/custom events. Vue 2 users keep the generic component:
332
- importing the factory is safe, but calling it throws a Vue-3-only error.
333
-
334
- For sorting state, inspect the live table ref’s `sortOrder` or `order`.
335
- `clearSortOrder()` detaches the table’s local order and leaves the owner’s input
336
- array unchanged. For legacy compatibility, when the parent explicitly supplies
337
- `sortOrder`, its next update restores that input; replacing or extending the
338
- input array also resynchronizes the table. Without a supplied `sortOrder`, local
339
- sorting remains local. This behavior applies to Vue 2.6, Vue 2.7 and Vue 3 without
340
- prop-mutation warnings.
341
-
342
- ### Moving an existing table
343
-
344
- 1. Replace the `vuetable-2` dependency with the verified `vuetable-next` release or archive.
345
- 2. Change root imports to `vuetable-next` and import `vuetable-next/style.css` once.
346
- 3. Replace imports from `vuetable-2/src/...` with the named public exports below.
347
- 4. Keep existing field definitions, table props and event handlers, then verify your application-specific scenarios.
348
- 5. When migrating the application to Vue 3, adapt its own Vue-specific syntax as needed; the package chooses its Vue 3 build automatically.
342
+ function onPagination (data) {
343
+ pagination.value?.setPaginationData(data);
344
+ }
345
+ function onPage (page) {
346
+ table.value?.changePage(page);
347
+ }
348
+ </script>
349
349
 
350
- ```ts
351
- import Vuetable, {
352
- VuetableRowHeader,
353
- VuetablePagination,
354
- VuetablePaginationDropdown,
355
- VuetablePaginationInfo,
356
- VuetableFieldMixin,
357
- VuetableFieldCheckboxMixin,
358
- VuetablePaginationMixin,
359
- VuetablePaginationInfoMixin
360
- } from "vuetable-next";
350
+ <template>
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" />
358
+ </template>
361
359
  ```
362
360
 
363
- Built-in field components `VuetableFieldCheckbox`, `VuetableFieldHandle` and
364
- `VuetableFieldSequence`, plus `VuetableColGutter`, are also named exports.
365
- Internal `.vue` source paths are not public package entry points.
361
+ The endpoint returns an Axios response body such as:
366
362
 
367
- ### Mixins or composables?
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
370
+ }
371
+ }
372
+ }
373
+ ```
374
+
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.
368
379
 
369
- Keep legacy mixins for existing Options API components, or choose a composable
370
- for new `setup()` components. Both styles are supported on all three runtimes.
380
+ #### Extend existing components
371
381
 
372
- | Existing mixin | Composable alternative |
382
+ | Existing helper | Composition API equivalent |
373
383
  | --- | --- |
374
384
  | `VuetableFieldMixin` | `useVuetableField` |
375
385
  | `VuetableFieldCheckboxMixin` | `useVuetableFieldCheckbox` |
376
386
  | `VuetablePaginationMixin` | `useVuetablePagination` |
377
387
  | `VuetablePaginationInfoMixin` | `useVuetablePaginationInfo` |
378
388
 
379
- ```js
380
- import {
381
- useVuetableField,
382
- useVuetableFieldCheckbox,
383
- useVuetablePagination,
384
- useVuetablePaginationInfo
385
- } from "vuetable-next";
386
- ```
387
-
388
- See [Mixins and composables](https://github.com/Artles777/vuetable-next/blob/main/docs/mixins-and-composables.md) for paired component
389
- examples, props, event wiring, pagination data, and complete Vue 2.6 / Vue 2.7 /
390
- Vue 3 startup examples. Vue 2.6 registers `@vue/composition-api` once; Vue 2.7 and
391
- Vue 3 do not need that plugin. Existing mixins remain public — no forced migration.
392
-
393
- ### 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
394
421
 
395
422
  Usually the root import is all you need. If your bundler needs an explicit target:
396
423
 
@@ -408,78 +435,86 @@ For native Vue 3 branded `Ref`/`ComputedRef` types or direct-ref `watch()`
408
435
  inference, import from `/vue3`; with the root entry, watch a getter instead.
409
436
  See the [typing examples](https://github.com/Artles777/vuetable-next/blob/main/docs/mixins-and-composables.md#typescript-ref-interop).
410
437
 
411
- ---
412
-
413
- ## Live demos
414
-
415
- From a checkout, using Node.js 22:
438
+ Public types can be imported without adding runtime code:
416
439
 
417
- ```sh
418
- npm install --legacy-peer-deps --package-lock=false
419
- npm run demo
420
- ```
421
-
422
- Wait until the terminal prints **three verified applications**, then open the
423
- printed HTTP address. Keep this terminal running while using the demo. Do not
424
- open `index.html` or `demo/showcase.html` as a local file: they are build inputs,
425
- not standalone demo pages. These are local development URLs, not a hosted demo;
426
- 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";
427
448
 
428
- If the default port is already in use, choose one explicitly with
429
- `npm run demo -- --port 8001`. The command never stops an existing server.
449
+ interface Campaign {
450
+ id: number;
451
+ name: string;
452
+ }
430
453
 
431
- The demo command packs the library, checks that same archive in isolated Vue
432
- 2.6, Vue 2.7 and Vue 3 consumers, and serves their interactive showcases. Open
433
- the local URL printed by the command and choose a runtime. Initial setup needs
434
- network access to install the temporary consumers.
454
+ const fields: VuetableField[] = [{ name: "name", title: "Campaign" }];
455
+ const tableProps: VuetableProps = { fields, apiMode: false };
435
456
 
436
- Try selecting and clearing rows, replacing data, opening details, and reloading.
437
- The live state panel shows the runtime version, selected IDs, emitted custom
438
- events and any captured runtime errors.
457
+ function campaignLabel(scope: VuetableColumnCellScope<Campaign>): string {
458
+ return scope.row.name;
459
+ }
460
+ ```
439
461
 
440
- On the Vue 3 page, choose **Factory playground** (`/vue-3/factory/`) for the
441
- interactive `createVuetable()` demo: sortable and paginated orders, checkboxes,
442
- details, custom row actions, and measured generic-versus-factory listener updates
443
- (both avoid rebuilding unchanged rows in the listener-only scenario).
444
- 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.
445
468
 
446
- For source-level Vue 3 development, `npm run dev` starts the Vite demo. The legacy
447
- `dev:2` source demo is not the cross-version compatibility gate; use the packed
448
- 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.
449
471
 
450
- ---
472
+ ## Demos
451
473
 
452
- ## Screenshots
474
+ From a checkout, using Node.js 22:
453
475
 
454
- ### Vue 3 · selection and expandable details
476
+ ```sh
477
+ npm install --legacy-peer-deps --package-lock=false
478
+ npm run demo
479
+ ```
455
480
 
456
- ![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)
457
501
 
458
502
  <details>
459
- <summary><strong>See the same component on Vue 2.6 and Vue 2.7</strong></summary>
460
-
461
- #### Vue 2.6 + Composition API
503
+ <summary>Same packed component on Vue 2.6 and Vue 2.7</summary>
462
504
 
463
- ![Real Vuetable Next component on Vue 2.6](https://raw.githubusercontent.com/Artles777/vuetable-next/main/docs/images/vue26-table.jpg)
464
-
465
- #### Vue 2.7 · native Composition API
466
-
467
- ![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)
468
507
 
469
508
  </details>
470
509
 
471
- These are real browser captures of the **same packed library** in three isolated
472
- Vue applications. The surrounding dashboard and green theme are showcase styles,
473
- not a theme automatically installed by the library. No live customer data is used.
474
-
475
- ---
510
+ Screenshots are real browser captures with showcase-owned dashboard/theme styling,
511
+ not an automatically installed dashboard. No live customer data is used.
476
512
 
477
- ## Development and checks
513
+ ## Development
478
514
 
479
- Use Node.js 22 for the documented development workflow. See
480
- [CONTRIBUTING.md](https://github.com/Artles777/vuetable-next/blob/main/CONTRIBUTING.md) for complete setup, fork/collaborator Git
481
- commands, linting, regression tests, package validation, the three-runtime matrix,
482
- 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).
483
518
 
484
519
  ```sh
485
520
  npm run test -- --run
@@ -489,37 +524,43 @@ npm run build
489
524
  npm run check:package
490
525
  ```
491
526
 
492
- Do not use a successful source test run as a substitute for checking the packed
493
- package on each supported framework. The build produces framework-specific
494
- render artifacts from shared component sources; generated files are not edited
495
- by hand.
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.
496
534
 
497
- ---
498
-
499
- ## Contributing
535
+ ## Compatibility
500
536
 
501
- Bug reports, focused fixes and documentation improvements are welcome. Both fork
502
- contributors and repository collaborators should use feature branches and open
503
- 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 |
504
542
 
505
- Read the [contribution guide](https://github.com/Artles777/vuetable-next/blob/main/CONTRIBUTING.md), include a reproduction and actual
506
- 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).
507
549
 
508
- ---
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.
509
555
 
510
556
  ## Limitations and security
511
557
 
512
- - Vue 2.6 needs Composition API; Vue 2.7 and Vue 3 do not.
513
- - The package has no standalone UMD/CDN script build. Use a supported bundler or module environment.
514
- - Showcase screenshots use custom example styling. The default table does not include the surrounding dashboard.
515
- - 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.
516
- - Consumer verification is not a blanket guarantee for every upstream example or application integration. Test your own custom renderers, API contracts and migration scenarios.
517
-
518
- ---
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.
519
562
 
520
563
  ## License and credits
521
564
 
522
565
  [MIT](https://github.com/Artles777/vuetable-next/blob/main/LICENSE) · Maintained by Artem Alesenko.
523
-
524
- Based on [Vuetable-2](https://github.com/ratiw/vuetable-2). Thanks to its original
525
- 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.