vuetable-next 1.0.10 → 1.0.12

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 (81) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +419 -39
  3. package/dist/index.js +21 -0
  4. package/dist/portable/components/useVuetableField.d.ts +28 -0
  5. package/dist/portable/components/useVuetableFieldCheckbox.d.ts +19 -0
  6. package/dist/portable/components/useVuetablePagination.d.ts +34 -0
  7. package/dist/portable/components/useVuetablePaginationInfo.d.ts +25 -0
  8. package/dist/portable/helpers/toValue.d.ts +4 -0
  9. package/dist/portable/reactivity.d.ts +7 -0
  10. package/dist/public.d.ts +124 -0
  11. package/dist/selector.cjs +1 -0
  12. package/dist/style.css +3 -1
  13. package/dist/types/components/Vuetable.vue.d.ts +1258 -0
  14. package/dist/types/components/VuetableColGroup.vue.d.ts +33 -0
  15. package/dist/types/components/VuetableColGutter.vue.d.ts +5 -0
  16. package/dist/types/components/VuetableContext.d.ts +21 -0
  17. package/dist/types/components/VuetableCssSemanticUI.d.ts +35 -0
  18. package/dist/types/components/VuetableDetailHost.vue.d.ts +44 -0
  19. package/dist/types/components/VuetableFieldCheckbox.vue.d.ts +64 -0
  20. package/dist/types/components/VuetableFieldCheckboxMixin.vue.d.ts +66 -0
  21. package/dist/types/components/VuetableFieldHandle.vue.d.ts +31 -0
  22. package/dist/types/components/VuetableFieldMixin.vue.d.ts +53 -0
  23. package/dist/types/components/VuetableFieldSequence.vue.d.ts +42 -0
  24. package/dist/types/components/VuetablePagination.vue.d.ts +69 -0
  25. package/dist/types/components/VuetablePaginationDropdown.vue.d.ts +82 -0
  26. package/dist/types/components/VuetablePaginationInfo.vue.d.ts +44 -0
  27. package/dist/types/components/VuetablePaginationInfoMixin.vue.d.ts +47 -0
  28. package/dist/types/components/VuetablePaginationMixin.vue.d.ts +57 -0
  29. package/dist/types/components/VuetableRenderBoundary.d.ts +14 -0
  30. package/dist/types/components/VuetableRowHeader.vue.d.ts +182 -0
  31. package/dist/types/components/createVuetable.d.ts +6 -0
  32. package/dist/types/components/useVuetableField.d.ts +28 -0
  33. package/dist/types/components/useVuetableFieldCheckbox.d.ts +19 -0
  34. package/dist/types/components/useVuetablePagination.d.ts +34 -0
  35. package/dist/types/components/useVuetablePaginationInfo.d.ts +25 -0
  36. package/dist/types/helpers/toValue.d.ts +4 -0
  37. package/dist/types/index.d.ts +30 -0
  38. package/dist/vue2.cjs +18 -0
  39. package/dist/vue2.cjs.map +1 -0
  40. package/dist/vue2.js +1673 -0
  41. package/dist/vue2.js.map +1 -0
  42. package/dist/vue3.cjs +6 -0
  43. package/dist/vue3.cjs.map +1 -0
  44. package/dist/vue3.js +1835 -0
  45. package/dist/vue3.js.map +1 -0
  46. package/package.json +117 -87
  47. package/style.css +3 -0
  48. package/vue2.js +2 -0
  49. package/vue3.js +2 -0
  50. package/auto-imports.d.ts +0 -9
  51. package/dist/vuetable-next.d.ts +0 -728
  52. package/dist/vuetable-next.js +0 -3324
  53. package/dist/vuetable-next.js.map +0 -1
  54. package/dist/vuetable-next.umd.cjs +0 -11
  55. package/dist/vuetable-next.umd.cjs.map +0 -1
  56. package/src/assets/vue.svg +0 -1
  57. package/src/components/Demo.vue +0 -17
  58. package/src/components/Vuetable.vue +0 -1216
  59. package/src/components/VuetableColGroup.vue +0 -66
  60. package/src/components/VuetableColGutter.vue +0 -25
  61. package/src/components/VuetableCssSemanticUI.ts +0 -36
  62. package/src/components/VuetableFieldCheckbox.vue +0 -87
  63. package/src/components/VuetableFieldCheckboxMixin.vue +0 -46
  64. package/src/components/VuetableFieldHandle.vue +0 -41
  65. package/src/components/VuetableFieldMixin.vue +0 -30
  66. package/src/components/VuetableFieldSequence.vue +0 -43
  67. package/src/components/VuetablePagination.vue +0 -119
  68. package/src/components/VuetablePaginationDropdown.vue +0 -88
  69. package/src/components/VuetablePaginationInfo.vue +0 -51
  70. package/src/components/VuetablePaginationInfoMixin.vue +0 -64
  71. package/src/components/VuetablePaginationMixin.vue +0 -107
  72. package/src/components/VuetableRowHeader.vue +0 -195
  73. package/src/components/useVuetablePagination.ts +0 -57
  74. package/src/components/useVuetablePaginationInfo.ts +0 -41
  75. package/src/data/fields.ts +0 -102
  76. package/src/data/lang.ts +0 -4
  77. package/src/helpers/toValue.ts +0 -9
  78. package/src/index.ts +0 -57
  79. package/src/main.ts +0 -398
  80. package/src/style.css +0 -79
  81. package/src/vite-env.d.ts +0 -1
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Artem Alesenko
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Artem Alesenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,52 +1,432 @@
1
- # Vuetable-next
2
- > Simple table for displaying data!
3
- >
4
- > Suitable for data visualization of any complexity with minimal time consumption.
5
- ## 🤸‍♀️Get started in 30 seconds
6
- #### 1. Install vuetable-next from:
7
- ```bash
8
- npm install -D vuetable-next
9
- # or
10
- yarn add -D vuetable-next
11
- # or
12
- pnpm i -D vuetable-next
13
- ```
14
-
15
- #### 2. Initialize to the current project:
16
- ## 👦Vue 3
17
- ### Global Registration
18
- ```ts
19
- import Vuetable from "vuetable-next";
20
- import { createApp } from "vue";
1
+ <p align="center">
2
+ <img src="docs/images/hero.svg" alt="Vuetable Next — one familiar table API for Vue 2.6, Vue 2.7 and Vue 3" width="100%">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <strong>A familiar table API. A smoother path from Vue 2 to Vue 3.</strong><br>
7
+ Data tables, custom fields, selection, pagination and expandable rows — across Vue generations.
8
+ </p>
9
+
10
+ <p align="center">
11
+ <a href="#compatibility"><img src="https://img.shields.io/badge/Vue-2.6%20%7C%202.7%20%7C%203-41b883?style=flat-square" alt="Vue 2.6, Vue 2.7 and Vue 3"></a>
12
+ <a href="https://vuetable.com/guide/"><img src="https://img.shields.io/badge/API-vuetable--2-35495e?style=flat-square" alt="vuetable-2-compatible API"></a>
13
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-438b70?style=flat-square" alt="MIT license"></a>
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="#quick-start">Quick start</a> ·
18
+ <a href="#screenshots">Screenshots</a> ·
19
+ <a href="#live-demos">Live demos</a> ·
20
+ <a href="https://vuetable.com/guide/">Documentation</a> ·
21
+ <a href="CONTRIBUTING.md">Contributing</a>
22
+ </p>
23
+
24
+ ## Why Vuetable Next?
25
+
26
+ `vuetable-next` is a fork of `vuetable-2`, built around `vue-demi` to retain a
27
+ familiar table API while supporting both Vue 2 and Vue 3 applications.
28
+
29
+ | One table API | Framework-aware packaging | Built to extend |
30
+ | --- | --- | --- |
31
+ | 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 |
32
+
33
+ - **Keep familiar concepts.** Use the original Vuetable-2 documentation as the API reference.
34
+ - **Move at your own pace.** Vue 2.6, Vue 2.7 and Vue 3 use the same root import.
35
+ - **Choose your integration.** Local components, global registration, ESM and CommonJS are supported.
36
+ - **Keep dependencies shared.** Vue, `vue-demi` and Axios are external, not private copies embedded in the bundle.
37
+ - **Use TypeScript.** Portable root declarations work across supported Vue generations; the explicit Vue 3 entry provides richer generated types.
38
+
39
+ > **Version 1.0.11:** introduces the Vue 2.6 / Vue 2.7 / Vue 3 packaging,
40
+ > public composables and portable declarations described here. The older
41
+ > `1.0.10` release does not contain these compatibility changes.
42
+
43
+ ## Screenshots
44
+
45
+ ### Vue 3 · selection and expandable details
46
+
47
+ ![Real Vuetable Next component on Vue 3, with a selected row and expanded detail](docs/images/vue3-table.jpg)
48
+
49
+ <details>
50
+ <summary><strong>See the same component on Vue 2.6 and Vue 2.7</strong></summary>
51
+
52
+ #### Vue 2.6 + Composition API
53
+
54
+ ![Real Vuetable Next component on Vue 2.6](docs/images/vue26-table.jpg)
55
+
56
+ #### Vue 2.7 · native Composition API
57
+
58
+ ![Real Vuetable Next component on Vue 2.7](docs/images/vue27-table.jpg)
59
+
60
+ </details>
61
+
62
+ These are real browser captures of the **same packed library** in three isolated
63
+ Vue applications. The surrounding dashboard and green theme are showcase styles,
64
+ not a theme automatically installed by the library. No live customer data is used.
65
+
66
+ ## Compatibility
67
+
68
+ | Application runtime | Declared support | Tested runtime | Composition API plugin |
69
+ | --- | --- | --- | --- |
70
+ | Vue 2.6 | `^2.6.14` | `2.6.14` | Install `@vue/composition-api` |
71
+ | Vue 2.7 | Included in the Vue 2 range | `2.7.16` | Not needed |
72
+ | Vue 3 | `^3.5.3` | `3.5.46` | Not needed |
73
+
74
+ The package contains separately compiled Vue 2 and Vue 3 render functions.
75
+ `vue-demi` selects the correct build for the installed runtime; no application
76
+ alias or manual dependency patch is needed for normal root imports.
77
+
78
+ Checks cover actual rendering, reactive data updates, legacy field mixins, custom
79
+ fields, checkbox selection, events, detail-row parent access, component methods,
80
+ teardown, module resolution and public declarations. Vue 2.6 is also checked with
81
+ a webpack 4 consumer toolchain. This is not a claim that every upstream example
82
+ or every possible consumer integration has been exhaustively tested.
83
+
84
+ ## Quick start
85
+
86
+ ### Install
87
+
88
+ Install the compatibility release:
89
+
90
+ ```sh
91
+ npm install vuetable-next@^1.0.11
92
+ ```
93
+
94
+ For Vue 2.6, also install the Composition API plugin:
21
95
 
22
- const app = createApp({...});
23
- app.use(Vuetable);
96
+ ```sh
97
+ npm install @vue/composition-api
24
98
  ```
25
- ### Local Registration
99
+
100
+ **Developing or testing a local revision?** From a checkout of this repository:
101
+
102
+ ```sh
103
+ npm install --legacy-peer-deps --package-lock=false
104
+ npm pack
105
+ ```
106
+
107
+ Then install the generated archive from your application directory:
108
+
109
+ ```sh
110
+ npm install /absolute/path/to/vuetable-next/vuetable-next-1.0.11.tgz
111
+ ```
112
+
113
+ `npm pack` runs the dual build and package checks through `prepack`. The archive
114
+ uses the version currently declared in `package.json`; it does not publish anything.
115
+
116
+ ### Vue 3
117
+
118
+ Import the table and stylesheet, then pass your fields and rows. This example
119
+ uses local data and does not need a backend.
120
+
121
+ **`App.vue`**
122
+
26
123
  ```vue
27
124
  <script setup lang="ts">
125
+ import { ref } from "vue";
28
126
  import Vuetable from "vuetable-next";
127
+ import "vuetable-next/style.css";
128
+
129
+ const fields = ["__checkbox", "name", "email"];
130
+ const rows = ref([
131
+ { id: 1, name: "Alex Morgan", email: "alex@example.com" },
132
+ { id: 2, name: "Sam Rivera", email: "sam@example.com" }
133
+ ]);
29
134
  </script>
30
135
 
31
136
  <template>
32
- <Vuetable
33
- ref="table"
34
- v-bind="{/* local props & attrs */}">
35
- </Vuetable>
137
+ <Vuetable
138
+ :fields="fields"
139
+ :data="rows"
140
+ :api-mode="false"
141
+ track-by="id"
142
+ />
143
+ </template>
144
+ ```
145
+
146
+ **`main.ts`**
147
+
148
+ ```ts
149
+ import { createApp } from "vue";
150
+ import App from "./App.vue";
151
+
152
+ createApp(App).mount("#app");
153
+ ```
154
+
155
+ Prefer global registration? Import `Vuetable` in your entry point and call
156
+ `createApp(App).use(Vuetable).mount("#app")` instead. The plugin registers the
157
+ table and its companion components.
158
+
159
+ ### Vue 2.6
160
+
161
+ Register Composition API **before mounting the application**.
162
+
163
+ **`main.js`**
164
+
165
+ ```js
166
+ import Vue from "vue";
167
+ import VueCompositionAPI from "@vue/composition-api";
168
+ import App from "./App.vue";
169
+ import "vuetable-next/style.css";
170
+
171
+ Vue.use(VueCompositionAPI);
172
+
173
+ new Vue({ render: createElement => createElement(App) }).$mount("#app");
174
+ ```
175
+
176
+ **`App.vue`**
177
+
178
+ ```vue
36
179
  <template>
180
+ <Vuetable
181
+ :fields="fields"
182
+ :data="rows"
183
+ :api-mode="false"
184
+ track-by="id"
185
+ />
186
+ </template>
187
+
188
+ <script>
189
+ import Vuetable from "vuetable-next";
190
+
191
+ export default {
192
+ components: { Vuetable },
193
+ data () {
194
+ return {
195
+ fields: ["__checkbox", "name", "email"],
196
+ rows: [
197
+ { id: 1, name: "Alex Morgan", email: "alex@example.com" },
198
+ { id: 2, name: "Sam Rivera", email: "sam@example.com" }
199
+ ]
200
+ };
201
+ }
202
+ };
203
+ </script>
204
+ ```
205
+
206
+ ### Vue 2.7
207
+
208
+ Use the same `App.vue` as Vue 2.6, but **do not install or register
209
+ `@vue/composition-api`**: Vue 2.7 provides the API natively.
210
+
211
+ **`main.js`**
212
+
213
+ ```js
214
+ import Vue from "vue";
215
+ import App from "./App.vue";
216
+ import "vuetable-next/style.css";
217
+
218
+ new Vue({ render: createElement => createElement(App) }).$mount("#app");
219
+ ```
220
+
221
+ For global registration on either Vue 2 version, import `Vuetable` in your
222
+ entry point and call `Vue.use(Vuetable)` before creating the root instance.
223
+
224
+ ## Documentation and migration
225
+
226
+ ### Familiar Vuetable-2 documentation
227
+
228
+ Start with the original [Vuetable-2 guide](https://vuetable.com/guide/) and
229
+ [API reference](https://vuetable.com/api/) for fields, API mode, sorting,
230
+ pagination, events, methods, custom fields and detail rows.
231
+
232
+ The table API is intended to stay familiar on Vue 2 and Vue 3. Framework-level
233
+ differences still apply: use Vue 3 slot/render-function conventions in your own
234
+ components, and follow the setup instructions for your installed Vue version.
235
+
236
+ ### Vue 3: automatic row-render optimization
237
+
238
+ The standard `Vuetable` avoids rebuilding unchanged rows when parent updates
239
+ only replace event listeners, including inline callbacks. No factory, special
240
+ registration or application-side listener caching is required. The outer
241
+ component can still update to keep listeners and root attributes current.
242
+ Reactive rows, fields and values read by formatters continue to update normally.
243
+ External slots are updated conservatively so their content cannot become stale;
244
+ this is not a promise to skip renders when table content actually changes.
245
+
246
+ `createVuetable()` remains optional for declaring a fixed component-event
247
+ contract. It is not required for the standard listener-only optimization.
248
+
249
+ ```ts
250
+ import { createVuetable } from "vuetable-next";
251
+
252
+ const AuditTable = createVuetable({
253
+ eventPrefix: "audit:",
254
+ events: ["custom-action"]
255
+ });
256
+ ```
257
+
258
+ Define the component once at module scope, outside `render()` and `setup()`, then
259
+ register it locally or use it directly in `<script setup>`. Keep existing table
260
+ props, slots and refs; listen with `@audit:row-clicked` or `@audit:custom-action`.
261
+ `events` contains **additional unprefixed** names passed to `fireEvent()`; the
262
+ default prefix is `vuetable:`. Vue handles latest listeners, `.once`, errors and
263
+ native DOM listeners normally. With an empty prefix, declaring `click` makes
264
+ `@click` a component event only, not a root DOM click listener.
265
+
266
+ The prefix is fixed for each factory component: overriding its `eventPrefix`
267
+ prop is unsupported and warns in development. Undeclared factory events also
268
+ warn in development. Create another factory for a different prefix or event set.
269
+ Factory results are local components, not plugins (`app.use()` is unsupported).
270
+ For the generic component, single-word listeners such as `onCustom` are ambiguous:
271
+ they fall through to the root DOM element as well as receiving component events.
272
+ Use the factory with `events: ["custom"]` when a listener must be component-only.
273
+ Explicit Vue DOM listeners such as `on:custom-event` remain DOM listeners.
274
+ The generic `Vuetable` remains fully dynamic and warning-free for arbitrary
275
+ prefixes/custom events. Vue 2 users keep the generic component:
276
+ importing the factory is safe, but calling it throws a Vue-3-only error.
277
+
278
+ For sorting state, inspect the live table ref’s `order`. `clearSortOrder()`
279
+ detaches the table’s local order and leaves the owner’s `sortOrder` input
280
+ unchanged; do not rely on Vue 2 prop-mutation quirks or treat that input as the
281
+ live order after clearing. Replacing the owner’s `sortOrder` array resynchronizes
282
+ the table with the new input.
283
+
284
+ ### Moving an existing table
285
+
286
+ 1. Replace the `vuetable-2` dependency with the verified `vuetable-next` release or archive.
287
+ 2. Change root imports to `vuetable-next` and import `vuetable-next/style.css` once.
288
+ 3. Replace imports from `vuetable-2/src/...` with the named public exports below.
289
+ 4. Keep existing field definitions, table props and event handlers, then verify your application-specific scenarios.
290
+ 5. When migrating the application to Vue 3, adapt its own Vue-specific syntax as needed; the package chooses its Vue 3 build automatically.
291
+
292
+ ```ts
293
+ import Vuetable, {
294
+ VuetableRowHeader,
295
+ VuetablePagination,
296
+ VuetablePaginationDropdown,
297
+ VuetablePaginationInfo,
298
+ VuetableFieldMixin,
299
+ VuetableFieldCheckboxMixin,
300
+ VuetablePaginationMixin,
301
+ VuetablePaginationInfoMixin
302
+ } from "vuetable-next";
303
+ ```
304
+
305
+ Built-in field components `VuetableFieldCheckbox`, `VuetableFieldHandle` and
306
+ `VuetableFieldSequence`, plus `VuetableColGutter`, are also named exports.
307
+ Internal `.vue` source paths are not public package entry points.
308
+
309
+ ### Mixins or composables?
310
+
311
+ Keep legacy mixins for existing Options API components, or choose a composable
312
+ for new `setup()` components. Both styles are supported on all three runtimes.
313
+
314
+ | Existing mixin | Composable alternative |
315
+ | --- | --- |
316
+ | `VuetableFieldMixin` | `useVuetableField` |
317
+ | `VuetableFieldCheckboxMixin` | `useVuetableFieldCheckbox` |
318
+ | `VuetablePaginationMixin` | `useVuetablePagination` |
319
+ | `VuetablePaginationInfoMixin` | `useVuetablePaginationInfo` |
320
+
321
+ ```js
322
+ import {
323
+ useVuetableField,
324
+ useVuetableFieldCheckbox,
325
+ useVuetablePagination,
326
+ useVuetablePaginationInfo
327
+ } from "vuetable-next";
328
+ ```
329
+
330
+ See [Mixins and composables](docs/mixins-and-composables.md) for paired component
331
+ examples, props, event wiring, pagination data, and complete Vue 2.6 / Vue 2.7 /
332
+ Vue 3 startup examples. Vue 2.6 registers `@vue/composition-api` once; Vue 2.7 and
333
+ Vue 3 do not need that plugin. Existing mixins remain public — no forced migration.
334
+
335
+ ### Explicit framework entries and types
336
+
337
+ Usually the root import is all you need. If your bundler needs an explicit target:
338
+
339
+ ```ts
340
+ import VuetableForVue2 from "vuetable-next/vue2";
341
+ import VuetableForVue3 from "vuetable-next/vue3";
342
+ import type { VuetableInstance } from "vuetable-next";
37
343
  ```
38
- ### ⏳<span style="color:red">Vue 2.6 & 2.7 is temporarily not supported</span>
39
- > We're working on it. We will add support in a future release.
40
344
 
41
- Also you have the ability to access certain components if you need them:
42
- ```javascript
43
- Vuetable: Vuetable.default/Vuetable.Vuetable,
44
- VuetablePagination: Vuetable.VuetablePagination,
45
- VuetablePaginationInfo: Vuetable.VuetablePaginationInfo,
46
- VuetablePaginationDropdown: Vuetable.VuetablePaginationDropdown
345
+ Choose **only the entry matching your application**, not both. Both entries
346
+ provide default and named exports in ESM and CommonJS formats. Root and `/vue2`
347
+ declarations are portable; `/vue3` exposes the richer generated Vue 3 types.
348
+ Portable composable refs support `.value`, reactive inputs and template usage.
349
+ For native Vue 3 branded `Ref`/`ComputedRef` types or direct-ref `watch()`
350
+ inference, import from `/vue3`; with the root entry, watch a getter instead.
351
+ See the [typing examples](docs/mixins-and-composables.md#typescript-ref-interop).
352
+
353
+ ## Live demos
354
+
355
+ From a checkout, using Node.js 22:
356
+
357
+ ```sh
358
+ npm install --legacy-peer-deps --package-lock=false
359
+ npm run demo
47
360
  ```
48
- # Contributions
49
- Any contribution to the code must be done to the `next` branch.
50
361
 
51
- # License
52
- Vuetable is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
362
+ Wait until the terminal prints **three verified applications**, then open the
363
+ printed HTTP address. Keep this terminal running while using the demo. Do not
364
+ open `index.html` or `demo/showcase.html` as a local file: they are build inputs,
365
+ not standalone demo pages. These are local development URLs, not a hosted demo;
366
+ another developer runs the same commands on their own computer.
367
+
368
+ If the default port is already in use, choose one explicitly with
369
+ `npm run demo -- --port 8001`. The command never stops an existing server.
370
+
371
+ The demo command packs the library, checks that same archive in isolated Vue
372
+ 2.6, Vue 2.7 and Vue 3 consumers, and serves their interactive showcases. Open
373
+ the local URL printed by the command and choose a runtime. Initial setup needs
374
+ network access to install the temporary consumers.
375
+
376
+ Try selecting and clearing rows, replacing data, opening details, and reloading.
377
+ The live state panel shows the runtime version, selected IDs, emitted custom
378
+ events and any captured runtime errors.
379
+
380
+ On the Vue 3 page, choose **Factory playground** (`/vue-3/factory/`) for the
381
+ interactive `createVuetable()` demo: sortable and paginated orders, checkboxes,
382
+ details, custom row actions, and measured generic-versus-factory listener updates
383
+ (both avoid rebuilding unchanged rows in the listener-only scenario).
384
+ It uses the same freshly packed archive; Vue 2 pages keep the generic component.
385
+
386
+ For source-level Vue 3 development, `npm run dev` starts the Vite demo. The legacy
387
+ `dev:2` source demo is not the cross-version compatibility gate; use the packed
388
+ demo and consumer matrix for Vue 2 verification.
389
+
390
+ ## Development and checks
391
+
392
+ Use Node.js 22 for the documented development workflow. See
393
+ [CONTRIBUTING.md](CONTRIBUTING.md) for complete setup, fork/collaborator Git
394
+ commands, linting, regression tests, package validation, the three-runtime matrix,
395
+ type checks, browser verification and pull request requirements.
396
+
397
+ ```sh
398
+ npm run test -- --run
399
+ npm run test:demo
400
+ npm run lint
401
+ npm run build
402
+ npm run check:package
403
+ ```
404
+
405
+ Do not use a successful source test run as a substitute for checking the packed
406
+ package on each supported framework. The build produces framework-specific
407
+ render artifacts from shared component sources; generated files are not edited
408
+ by hand.
409
+
410
+ ## Limitations and security
411
+
412
+ - Vue 2.6 needs Composition API; Vue 2.7 and Vue 3 do not.
413
+ - The package has no standalone UMD/CDN script build. Use a supported bundler or module environment.
414
+ - Showcase screenshots use custom example styling. The default table does not include the surrounding dashboard.
415
+ - 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.
416
+ - Consumer verification is not a blanket guarantee for every upstream example or application integration. Test your own custom renderers, API contracts and migration scenarios.
417
+
418
+ ## Contributing
419
+
420
+ Bug reports, focused fixes and documentation improvements are welcome. Both fork
421
+ contributors and repository collaborators should use feature branches and open
422
+ pull requests against **`main`**.
423
+
424
+ Read the [contribution guide](CONTRIBUTING.md), include a reproduction and actual
425
+ validation results, and use the [pull request template](.github/pull_request_template.md).
426
+
427
+ ## License and credits
428
+
429
+ [MIT](LICENSE) · Maintained by Artem Alesenko.
430
+
431
+ Based on [Vuetable-2](https://github.com/ratiw/vuetable-2). Thanks to its original
432
+ authors and contributors for the table API and documentation that this fork builds on.
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ import selected from "./selector.cjs";
2
+ export const Vuetable = selected.Vuetable;
3
+ export const VuetableFieldMixin = selected.VuetableFieldMixin;
4
+ export const VuetableFieldCheckboxMixin = selected.VuetableFieldCheckboxMixin;
5
+ export const VuetablePaginationInfoMixin = selected.VuetablePaginationInfoMixin;
6
+ export const VuetablePaginationMixin = selected.VuetablePaginationMixin;
7
+ export const VuetableColGutter = selected.VuetableColGutter;
8
+ export const VuetableFieldCheckbox = selected.VuetableFieldCheckbox;
9
+ export const VuetableFieldHandle = selected.VuetableFieldHandle;
10
+ export const VuetableFieldSequence = selected.VuetableFieldSequence;
11
+ export const VuetablePagination = selected.VuetablePagination;
12
+ export const VuetablePaginationDropdown = selected.VuetablePaginationDropdown;
13
+ export const VuetablePaginationInfo = selected.VuetablePaginationInfo;
14
+ export const VuetableRowHeader = selected.VuetableRowHeader;
15
+ export const install = selected.install;
16
+ export const useVuetableField = selected.useVuetableField;
17
+ export const useVuetableFieldCheckbox = selected.useVuetableFieldCheckbox;
18
+ export const useVuetablePagination = selected.useVuetablePagination;
19
+ export const useVuetablePaginationInfo = selected.useVuetablePaginationInfo;
20
+ export const createVuetable = selected.createVuetable;
21
+ export default selected.default;
@@ -0,0 +1,28 @@
1
+ import { ComputedRef } from "../reactivity.js";
2
+ export type VuetableFieldRow = Record<string, any>;
3
+ export interface VuetableFieldDefinition {
4
+ name?: string | object;
5
+ [key: string]: any;
6
+ }
7
+ export interface VuetableFieldContext {
8
+ trackBy?: string;
9
+ tableData?: readonly VuetableFieldRow[] | null;
10
+ [key: string]: any;
11
+ }
12
+ export interface VuetableFieldProps<TableContext extends VuetableFieldContext = VuetableFieldContext> {
13
+ rowData?: VuetableFieldRow | null;
14
+ rowIndex?: number;
15
+ rowField?: VuetableFieldDefinition | null;
16
+ isHeader?: boolean;
17
+ title?: string;
18
+ vuetable?: TableContext | null;
19
+ }
20
+ export interface VuetableFieldResult<TableContext extends VuetableFieldContext = VuetableFieldContext> {
21
+ rowData: ComputedRef<VuetableFieldRow | null>;
22
+ rowIndex: ComputedRef<number | undefined>;
23
+ rowField: ComputedRef<VuetableFieldDefinition | null | undefined>;
24
+ isHeader: ComputedRef<boolean>;
25
+ title: ComputedRef<string>;
26
+ vuetable: ComputedRef<TableContext | null>;
27
+ }
28
+ export declare function useVuetableField<TableContext extends VuetableFieldContext = VuetableFieldContext>(props: Readonly<VuetableFieldProps<TableContext>>): VuetableFieldResult<TableContext>;
@@ -0,0 +1,19 @@
1
+ import { ComputedRef, Ref } from "../reactivity.js";
2
+ import { VuetableFieldContext, VuetableFieldDefinition, VuetableFieldProps, VuetableFieldResult, VuetableFieldRow } from './useVuetableField.js';
3
+ export interface VuetableFieldCheckboxContext extends VuetableFieldContext {
4
+ trackBy: string;
5
+ isSelectedRow(identifier: any): boolean;
6
+ onCheckboxToggled(checked: boolean, fieldName: VuetableFieldDefinition["name"], row: VuetableFieldRow): void;
7
+ onCheckboxToggledAll(checked: boolean): void;
8
+ }
9
+ export type VuetableFieldCheckboxProps = VuetableFieldProps<VuetableFieldCheckboxContext>;
10
+ export interface VuetableFieldCheckboxResult extends VuetableFieldResult<VuetableFieldCheckboxContext> {
11
+ checkbox: Ref<HTMLInputElement | null>;
12
+ selectedCount: ComputedRef<number>;
13
+ isIndeterminate: ComputedRef<boolean>;
14
+ toggleCheckbox(row: VuetableFieldRow | null | undefined, event: Event): void;
15
+ toggleAllCheckbox(event: Event): void;
16
+ isSelected(row: VuetableFieldRow | null | undefined): boolean;
17
+ isAllItemsInCurrentPageSelected(): boolean | undefined;
18
+ }
19
+ export declare function useVuetableFieldCheckbox(props: Readonly<VuetableFieldCheckboxProps>): VuetableFieldCheckboxResult;
@@ -0,0 +1,34 @@
1
+ import { ComputedRef, Ref } from "../reactivity.js";
2
+ import { MaybeRefOrGetter } from '../helpers/toValue.js';
3
+ export interface TablePagination {
4
+ last_page: number;
5
+ current_page: number;
6
+ from?: number;
7
+ to?: number;
8
+ total?: number;
9
+ }
10
+ export interface VuetablePaginationOptions {
11
+ onEachSide?: MaybeRefOrGetter<number>;
12
+ firstPage?: MaybeRefOrGetter<number>;
13
+ css?: MaybeRefOrGetter<Record<string, any>>;
14
+ emit?: (event: "vuetable-pagination:change-page", page: number | string) => void;
15
+ }
16
+ export interface VuetablePaginationResult {
17
+ tablePagination: Ref<TablePagination | null>;
18
+ customCss: Ref<Record<string, any>>;
19
+ eventPrefix: Ref<string>;
20
+ lastPage: ComputedRef<number>;
21
+ isOnFirstPage: ComputedRef<boolean>;
22
+ isOnLastPage: ComputedRef<boolean>;
23
+ notEnoughPages: ComputedRef<boolean>;
24
+ windowSize: ComputedRef<number>;
25
+ windowStart: ComputedRef<number>;
26
+ totalPage: ComputedRef<number>;
27
+ setPaginationData: (value: TablePagination | null) => void;
28
+ resetData: () => void;
29
+ isCurrentPage: (page: number) => boolean;
30
+ mergeCss: () => void;
31
+ loadPage: (page: number | string) => void;
32
+ }
33
+ export declare function useVuetablePagination(options?: VuetablePaginationOptions): VuetablePaginationResult;
34
+ export declare function useVuetablePagination(onEachSide?: MaybeRefOrGetter<number>, firstPage?: MaybeRefOrGetter<number>): VuetablePaginationResult;
@@ -0,0 +1,25 @@
1
+ import { ComputedRef, Ref } from "../reactivity.js";
2
+ import { MaybeRefOrGetter } from '../helpers/toValue.js';
3
+ export interface TablePagination {
4
+ last_page?: number;
5
+ current_page?: number;
6
+ from: number;
7
+ to: number;
8
+ total: number;
9
+ }
10
+ export interface VuetablePaginationInfoOptions {
11
+ noDataTemplate?: MaybeRefOrGetter<string>;
12
+ infoTemplate?: MaybeRefOrGetter<string>;
13
+ css?: MaybeRefOrGetter<Record<string, any>>;
14
+ }
15
+ export interface VuetablePaginationInfoResult {
16
+ tablePagination: Ref<TablePagination | null>;
17
+ customCss: Ref<Record<string, any>>;
18
+ paginationInfo: ComputedRef<string>;
19
+ setPaginationData: (value: TablePagination | null) => void;
20
+ resetData: () => void;
21
+ isCurrentPage: (page: number) => boolean;
22
+ mergeCss: () => void;
23
+ }
24
+ export declare function useVuetablePaginationInfo(options?: VuetablePaginationInfoOptions): VuetablePaginationInfoResult;
25
+ export declare function useVuetablePaginationInfo(noDataTemplate?: MaybeRefOrGetter<string>, infoTemplate?: MaybeRefOrGetter<string>): VuetablePaginationInfoResult;
@@ -0,0 +1,4 @@
1
+ import { Ref, ComputedRef } from "../reactivity.js";
2
+ export type MaybeRef<T = any> = T | Ref<T>;
3
+ export type MaybeRefOrGetter<T = any> = MaybeRef<T> | (() => T);
4
+ export declare function toValue<T>(source: MaybeRefOrGetter<T> | ComputedRef<T>): T;
@@ -0,0 +1,7 @@
1
+ export interface Ref<T> {
2
+ value: T;
3
+ }
4
+
5
+ export interface ComputedRef<T> extends Readonly<Ref<T>> {}
6
+
7
+ export type ComputedGetter<T> = () => T;