vuetable-next 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-imports.d.ts +52 -0
- package/demo/vue2/index.ts +6 -0
- package/demo/vue2/index.vue +17 -0
- package/demo/vue3/index.ts +4 -0
- package/demo/vue3/index.vue +12 -0
- package/dist/vuetable-next.d.ts +1 -0
- package/dist/vuetable-next.js +1459 -1467
- package/dist/vuetable-next.js.map +1 -1
- package/dist/vuetable-next.umd.cjs +16 -16
- package/dist/vuetable-next.umd.cjs.map +1 -1
- package/index.html +2 -77
- package/package.json +6 -2
- package/src/index.ts +13 -13
- package/src/main.ts +3 -1
- package/vite.config.ts +23 -3
package/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
|
-
<title>
|
|
6
|
+
<title>{{ NAME }} (Vue {{ VUE_VERSION }})</title>
|
|
7
7
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css" media="screen" title="no title" charset="utf-8">
|
|
8
8
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
|
|
9
9
|
<style type="text/css">
|
|
@@ -72,82 +72,6 @@
|
|
|
72
72
|
<div class="ui container">
|
|
73
73
|
|
|
74
74
|
<div id="app" class="ui vertical stripe segment">
|
|
75
|
-
|
|
76
|
-
<div id="content" class="ui basic segment">
|
|
77
|
-
|
|
78
|
-
<h3 class="ui header">List of Users</h3>
|
|
79
|
-
|
|
80
|
-
<div class="ui grid">
|
|
81
|
-
<div class="ui left aligned nine wide column">
|
|
82
|
-
<div class="ui labeled icon input">
|
|
83
|
-
<div class="ui label">Search:</div>
|
|
84
|
-
<input v-model="searchFor" class="ui input" @keyup.enter="setFilter">
|
|
85
|
-
<i class="search icon"></i>
|
|
86
|
-
</div>
|
|
87
|
-
<button class="ui button primary" @click="setFilter">Go</button>
|
|
88
|
-
<button class="ui button" @click="resetFilter">Reset</button>
|
|
89
|
-
</div>
|
|
90
|
-
<div class="ui right aligned seven wide column">
|
|
91
|
-
<button class="ui basic button" id="settingsBtn" @click="showSettingsModal">
|
|
92
|
-
<i class="setting icon"></i>
|
|
93
|
-
Settings
|
|
94
|
-
</button>
|
|
95
|
-
</div>
|
|
96
|
-
</div><!-- ui grid -->
|
|
97
|
-
|
|
98
|
-
<div :class="[{'vuetable-wrapper ui basic segment': true}, loading]">
|
|
99
|
-
|
|
100
|
-
<vuetable ref="vuetable"
|
|
101
|
-
api-url="http://vuetable.ratiw.net/api/users"
|
|
102
|
-
:fields="fields"
|
|
103
|
-
:table-height="tableHeight"
|
|
104
|
-
:transform="transform"
|
|
105
|
-
pagination-path="pagination"
|
|
106
|
-
:sort-order="sortOrder"
|
|
107
|
-
:multi-sort="multiSort"
|
|
108
|
-
:per-page="perPage"
|
|
109
|
-
:append-params="moreParams"
|
|
110
|
-
detail-row-component="my-detail-row"
|
|
111
|
-
detail-row-transition="expand"
|
|
112
|
-
:row-class="rowClassCB"
|
|
113
|
-
@vuetable:pagination-data="onPaginationData"
|
|
114
|
-
@vuetable:load-success="onLoadSuccess"
|
|
115
|
-
@vuetable:loading="showLoader"
|
|
116
|
-
@vuetable:loaded="hideLoader"
|
|
117
|
-
@vuetable:cell-clicked="onCellClicked"
|
|
118
|
-
@vuetable:cell-dblclicked="onCellDoubleClicked"
|
|
119
|
-
@vuetable:cell-rightclicked="onCellRightClicked"
|
|
120
|
-
@vuetable:initialized="onInitialized"
|
|
121
|
-
@vuetable:data-reset="onDataReset"
|
|
122
|
-
@vuetable:field-event="onFieldEvent"
|
|
123
|
-
@vuetable:header-event="onHeaderEvent"
|
|
124
|
-
>
|
|
125
|
-
<template v-slot:slot-actions="props">
|
|
126
|
-
<div slot="slot-actions">
|
|
127
|
-
<button class="ui red button" @click="onActionClicked('view-item', props.rowData)"><i class="zoom icon"></i></button>
|
|
128
|
-
<button class="ui blue button" @click="onActionClicked('edit-item', props.rowData)"><i class="edit icon"></i></button>
|
|
129
|
-
<button class="ui green button" @click="onActionClicked('delete-item', props.rowData)"><i class="delete icon"></i></button>
|
|
130
|
-
</div>
|
|
131
|
-
</template>
|
|
132
|
-
</vuetable>
|
|
133
|
-
<div class="vuetable-pagination ui bottom attached segment grid">
|
|
134
|
-
<vuetable-pagination-info ref="paginationInfo"
|
|
135
|
-
:info-template="paginationInfoTemplate"
|
|
136
|
-
></vuetable-pagination-info>
|
|
137
|
-
<component :is="paginationComponent" ref="pagination"
|
|
138
|
-
@vuetable-pagination:change-page="onChangePage"
|
|
139
|
-
></component>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
</div><!-- vuetable-wrapper -->
|
|
143
|
-
|
|
144
|
-
<settings-modal ref="settingsModal"
|
|
145
|
-
:vuetable-fields="vuetableFields"
|
|
146
|
-
:field-prefix="fieldPrefix"
|
|
147
|
-
></settings-modal>
|
|
148
|
-
|
|
149
|
-
</div><!-- content -->
|
|
150
|
-
|
|
151
75
|
</div><!-- app -->
|
|
152
76
|
</div><!-- ui container -->
|
|
153
77
|
|
|
@@ -157,5 +81,6 @@
|
|
|
157
81
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.js" charset="utf-8"></script>
|
|
158
82
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
|
|
159
83
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script>
|
|
84
|
+
<script type="module" src="/demo/vue{{ VUE_VERSION }}/index.ts"></script>
|
|
160
85
|
</body>
|
|
161
86
|
</html>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuetable-next",
|
|
3
3
|
"description": "Simple table for displaying data.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"author": "Artem Alesenko",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"private": false,
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"url": "git+https://github.com/Artles777/vuetable-next.git"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
|
-
"dev": "vite",
|
|
40
|
+
"dev:2": "vue-demi-switch 2 && vite",
|
|
41
|
+
"dev:3": "vue-demi-switch 3 && vite",
|
|
41
42
|
"build": "vite build",
|
|
42
43
|
"preview": "vite preview",
|
|
43
44
|
"test": "vitest"
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"@eslint/js": "^8.57.0",
|
|
63
64
|
"@types/jquery": "^3.5.30",
|
|
65
|
+
"@types/semver": "^7.5.8",
|
|
64
66
|
"@vitejs/plugin-vue": "^5.1.3",
|
|
65
67
|
"@vue/test-utils": "^2.4.6",
|
|
66
68
|
"axios-mock-adapter": "^2.0.0",
|
|
@@ -69,10 +71,12 @@
|
|
|
69
71
|
"globals": "^15.8.0",
|
|
70
72
|
"jsdom": "^25.0.0",
|
|
71
73
|
"promise-polyfill": "^8.3.0",
|
|
74
|
+
"semver": "^7.6.3",
|
|
72
75
|
"typescript": "^5.5.4",
|
|
73
76
|
"typescript-eslint": "^7.17.0",
|
|
74
77
|
"unplugin-auto-import": "^0.18.2",
|
|
75
78
|
"vite": "^5.3.4",
|
|
79
|
+
"vite-plugin-dts": "^4.2.1",
|
|
76
80
|
"vitest": "^2.0.5",
|
|
77
81
|
"vue": "^3.5.3",
|
|
78
82
|
"vue-tsc": "^2.0.24"
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { App } from "vue-demi";
|
|
2
2
|
import Vuetable from "./components/Vuetable.vue";
|
|
3
3
|
import VuetableColGutter from "./components/VuetableColGutter.vue";
|
|
4
4
|
import VuetableFieldCheckbox from "./components/VuetableFieldCheckbox.vue";
|
|
@@ -22,19 +22,19 @@ if (!rootVariable!.Promise) {
|
|
|
22
22
|
rootVariable!.Promise = Promise;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
function install (Vue: App) {
|
|
26
|
+
Vue.component("vuetable", Vuetable);
|
|
27
|
+
Vue.component("vuetable-col-gutter", VuetableColGutter);
|
|
28
|
+
Vue.component("vuetable-field-checkbox", VuetableFieldCheckbox);
|
|
29
|
+
Vue.component("vuetable-field-handle", VuetableFieldHandle);
|
|
30
|
+
Vue.component("vuetable-field-sequence", VuetableFieldSequence);
|
|
31
|
+
Vue.component("vuetable-pagination", VuetablePagination);
|
|
32
|
+
Vue.component("vuetable-pagination-dropdown", VuetablePaginationDropdown);
|
|
33
|
+
Vue.component("vuetable-pagination-info", VuetablePaginationInfo);
|
|
34
|
+
Vue.component("vuetable-row-header", VuetableRowHeader);
|
|
35
|
+
}
|
|
36
36
|
|
|
37
|
-
install
|
|
37
|
+
Vuetable.install = install;
|
|
38
38
|
|
|
39
39
|
export {
|
|
40
40
|
Vuetable,
|
package/src/main.ts
CHANGED
|
@@ -393,4 +393,6 @@ app.component("settings-modal", {
|
|
|
393
393
|
|
|
394
394
|
app.component("vuetable-field-checkbox", VuetableFieldCheckbox);
|
|
395
395
|
app.component("vuetable-field-handle", VuetableFieldHandle);
|
|
396
|
-
app.component("vuetable-field-sequence", VuetableFieldSequence);
|
|
396
|
+
app.component("vuetable-field-sequence", VuetableFieldSequence);
|
|
397
|
+
|
|
398
|
+
app.mount("#app");
|
package/vite.config.ts
CHANGED
|
@@ -2,12 +2,31 @@ import { defineConfig } from "vite";
|
|
|
2
2
|
import vue from "@vitejs/plugin-vue";
|
|
3
3
|
import AutoImport from "unplugin-auto-import/vite";
|
|
4
4
|
import { name, PascalCasedName } from "./package.json";
|
|
5
|
+
import { version } from "vue";
|
|
6
|
+
import type { SemVer } from "semver";
|
|
7
|
+
import { parse } from "semver";
|
|
8
|
+
import dts from "vite-plugin-dts";
|
|
9
|
+
|
|
10
|
+
const { major, minor } = parse(version) as SemVer;
|
|
5
11
|
|
|
6
12
|
// https://vitejs.dev/config/
|
|
7
13
|
export default defineConfig({
|
|
8
|
-
plugins: [
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
plugins: [
|
|
15
|
+
{
|
|
16
|
+
name: "html-transform",
|
|
17
|
+
transformIndexHtml (html: string) {
|
|
18
|
+
return html.replace(/\{\{ NAME \}\}/, name).replace(/\{\{ VUE_VERSION \}\}/g, String(major === 3 ? major : `${major}.${minor}`));
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
vue(),
|
|
22
|
+
dts({
|
|
23
|
+
insertTypesEntry: true,
|
|
24
|
+
rollupTypes: true
|
|
25
|
+
}),
|
|
26
|
+
AutoImport({
|
|
27
|
+
viteOptimizeDeps: true
|
|
28
|
+
})
|
|
29
|
+
],
|
|
11
30
|
optimizeDeps: {
|
|
12
31
|
exclude: ["vue-demi"]
|
|
13
32
|
},
|
|
@@ -23,6 +42,7 @@ export default defineConfig({
|
|
|
23
42
|
globals: {
|
|
24
43
|
[name]: PascalCasedName,
|
|
25
44
|
},
|
|
45
|
+
exports: "named"
|
|
26
46
|
}
|
|
27
47
|
}
|
|
28
48
|
}
|