data-table-list 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/data-table-list.css +2 -0
- package/dist/data-table-list.js +310 -0
- package/dist/data-table-list.umd.cjs +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/src/component/commons/Avatar.vue.d.ts +10 -0
- package/dist/src/component/commons/DataTableList.vue.d.ts +64 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/model/Models.d.ts +41 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# neuto
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 in Vite.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
[VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
|
8
|
+
|
|
9
|
+
## Recommended Browser Setup
|
|
10
|
+
|
|
11
|
+
- Chromium-based browsers (Chrome, Edge, Brave, etc.):
|
|
12
|
+
- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
|
|
13
|
+
- [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters)
|
|
14
|
+
- Firefox:
|
|
15
|
+
- [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
|
|
16
|
+
- [Turn on Custom Object Formatter in Firefox DevTools](https://fxdx.dev/firefox-devtools-custom-object-formatters/)
|
|
17
|
+
|
|
18
|
+
## Type Support for `.vue` Imports in TS
|
|
19
|
+
|
|
20
|
+
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
|
|
21
|
+
|
|
22
|
+
## Customize configuration
|
|
23
|
+
|
|
24
|
+
See [Vite Configuration Reference](https://vite.dev/config/).
|
|
25
|
+
|
|
26
|
+
## Project Setup
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Compile and Hot-Reload for Development
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm run dev
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Type-Check, Compile and Minify for Production
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npm run build
|
|
42
|
+
```
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
section[data-v-347ab0dc]{float:right;box-sizing:border-box;display:contents}.row[data-v-347ab0dc]{box-sizing:border-box;flex-wrap:wrap;width:100%;margin-left:-15px;margin-right:-15px;display:flex}.col[data-v-347ab0dc]{box-sizing:border-box;flex-grow:1;flex-basis:0;max-width:100%;padding-left:15px;padding-right:15px}.col-md-12[data-v-347ab0dc]{box-sizing:border-box;flex:0 0 100%;max-width:100%;padding-left:15px;padding-right:15px}.mb-3[data-v-347ab0dc]{margin-bottom:1rem!important}.mb-5[data-v-347ab0dc]{margin-bottom:3rem!important}.shadow-none[data-v-347ab0dc]{box-shadow:none!important;border:none!important}.iconNav[data-v-347ab0dc]{width:30px;height:30px;fill:#06c!important}.iconNav[data-v-347ab0dc]:hover{width:30px;height:30px;fill:#21374d!important}.iconView[data-v-347ab0dc],.iconUpdate[data-v-347ab0dc]{border:none;width:22px;height:22px;fill:#06c!important}.iconDelete[data-v-347ab0dc]{color:#dc3545;background:#e3e2e2;border-radius:35px 35px 10px 10px;width:20px;height:24px}.iconOrder[data-v-347ab0dc]{vertical-align:bottom;fill:#a1a1a1;width:22px;height:22px}.icon-primaryOrder[data-v-347ab0dc]{fill:#06c!important}.tablerow[data-v-347ab0dc]{margin-top:0}.navBtn[data-v-347ab0dc]{clip-path:fill-box}.mr10[data-v-347ab0dc]{margin-right:15px}.center[data-v-347ab0dc]{flex-wrap:nowrap;place-content:center;align-self:center;align-items:center;display:flex}.left[data-v-347ab0dc]{flex-wrap:nowrap;place-content:center flex-start;align-self:center;align-items:center;display:flex}.right[data-v-347ab0dc]{flex-wrap:nowrap;place-content:center flex-end;align-self:center;align-items:center;display:flex}.right-box[data-v-347ab0dc]{margin-right:unset;justify-content:flex-end;padding-bottom:40px;padding-right:60px;display:flex}.box-action[data-v-347ab0dc]{float:right;justify-content:flex-end;align-items:center;gap:10px;display:inline-flex}.box-action button[data-v-347ab0dc]{cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:4px;transition:opacity .2s;display:flex}.box-action button[data-v-347ab0dc]:hover{opacity:.8}.table[data-v-347ab0dc]{color:#212529;vertical-align:middle;border-collapse:collapse;box-sizing:border-box;border-color:#dee2e6;width:100%;margin-bottom:1rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.table th[data-v-347ab0dc],.table td[data-v-347ab0dc]{vertical-align:middle;text-align:left;box-sizing:border-box;border-bottom:1px solid #dee2e6;padding:.75rem .3rem}.table-hover tbody tr[data-v-347ab0dc]:hover{background-color:#0000000a}.table thead th[data-v-347ab0dc]{vertical-align:bottom;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}.checkbox-header[data-v-347ab0dc]{width:40px}.action-header[data-v-347ab0dc]{width:120px}.headerTitle[data-v-347ab0dc]{color:#06c;letter-spacing:.05em;font-size:small;font-weight:600}.header-container[data-v-347ab0dc]{justify-content:space-between;align-items:center;width:100%;min-height:24px;display:flex}.header-text[data-v-347ab0dc]{color:#06c;font-size:small;font-weight:600}.sort-arrows[data-v-347ab0dc]{flex-direction:column;justify-content:center;height:32px;margin-left:8px;display:flex}.sort-arrow-up[data-v-347ab0dc],.sort-arrow-down[data-v-347ab0dc]{cursor:pointer;align-items:center;height:16px;display:flex}.sort-arrow-down[data-v-347ab0dc]{margin-top:-4px}.btn[data-v-347ab0dc]{color:#212529;text-align:center;vertical-align:middle;cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;background-color:#0000;border:1px solid #0000;border-radius:.25rem;justify-content:center;align-items:center;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out;display:inline-flex}.btn-outline-default[data-v-347ab0dc]{color:#06c;background-color:#fff;border:1px solid #06c;border-radius:4px;padding:4px 8px}.btn-default[data-v-347ab0dc]{color:#495057;pointer-events:none;background-color:#f8f9fa;border:1px solid #dee2e6;padding:4px 12px;font-weight:600}.navBtn[data-v-347ab0dc]{min-width:38px;height:38px;margin:0 4px}.btn-group[data-v-347ab0dc]{vertical-align:middle;display:inline-flex;position:relative}.form-check[data-v-347ab0dc]{box-sizing:border-box;min-height:1.5rem;margin-bottom:.125rem;padding-left:1.5em;display:block;position:relative}.dtlchek[data-v-347ab0dc]{cursor:pointer;box-sizing:border-box;width:1rem;height:1rem;margin-top:.3rem;margin-left:-1.5rem;position:absolute}.icon[data-v-347ab0dc],.iconNav[data-v-347ab0dc],.iconView[data-v-347ab0dc],.iconUpdate[data-v-347ab0dc],.iconDelete[data-v-347ab0dc],.iconOrder[data-v-347ab0dc]{vertical-align:middle;fill:currentColor;display:inline-block}.iconNav[data-v-347ab0dc]{color:#06c;width:30px;height:30px}.iconView[data-v-347ab0dc],.iconUpdate[data-v-347ab0dc]{color:#06c;width:22px;height:22px}.iconDelete[data-v-347ab0dc]{color:#dc3545;width:22px;height:22px}.iconOrder[data-v-347ab0dc]{color:#a1a1a1}.icon-primaryOrder[data-v-347ab0dc]{color:#06c!important}.avatar[data-v-0ae6bfc5]{color:#333;text-align:center;vertical-align:middle;-webkit-user-select:none;user-select:none;box-sizing:border-box;background-color:#e9ecef;border-radius:50%;justify-content:center;align-items:center;font-weight:600;display:inline-flex;overflow:hidden}.size-xs[data-v-0ae6bfc5]{width:24px;height:24px;font-size:.65rem}.size-sm[data-v-0ae6bfc5]{width:32px;height:32px;font-size:.8rem}.size-lg[data-v-0ae6bfc5]{width:48px;height:48px;font-size:1.1rem}.size-xl[data-v-0ae6bfc5]{width:64px;height:64px;font-size:1.5rem}.size-xxl[data-v-0ae6bfc5]{width:96px;height:96px;font-size:2.2rem}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, normalizeStyle as l, onMounted as u, openBlock as d, ref as f, renderList as p, renderSlot as m, resolveComponent as h, toDisplayString as g, watch as _, withCtx as v } from "vue";
|
|
2
|
+
//#region src/component/commons/DataTableList.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var y = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "col-md-12 right-box"
|
|
6
|
+
}, b = { key: 1 }, x = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "row"
|
|
9
|
+
}, S = {
|
|
10
|
+
class: "btn btn-default navBtn",
|
|
11
|
+
type: "button"
|
|
12
|
+
}, C = { class: "col" }, w = { class: "table table-hover" }, ee = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "checkbox-header"
|
|
15
|
+
}, te = { class: "headerTitle" }, T = { class: "header-container" }, ne = { class: "header-text" }, re = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "sort-arrows"
|
|
18
|
+
}, ie = ["onClick"], ae = ["onClick"], E = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "headerTitle action-header"
|
|
21
|
+
}, D = { key: 0 }, O = { class: "form-check" }, oe = [
|
|
22
|
+
"onChange",
|
|
23
|
+
"id",
|
|
24
|
+
"checked"
|
|
25
|
+
], se = ["for"], ce = { key: 1 }, k = {
|
|
26
|
+
class: "btn-group box-action",
|
|
27
|
+
role: "group",
|
|
28
|
+
"aria-label": "Actions"
|
|
29
|
+
}, A = ["onClick"], j = ["onClick"], M = ["onClick"], N = {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "col-md-12 center"
|
|
32
|
+
}, P = {
|
|
33
|
+
key: 0,
|
|
34
|
+
class: "row mb-5"
|
|
35
|
+
}, F = {
|
|
36
|
+
class: "btn btn-default navBtn",
|
|
37
|
+
type: "button"
|
|
38
|
+
}, I = /* @__PURE__ */ s({
|
|
39
|
+
__name: "DataTableList",
|
|
40
|
+
props: {
|
|
41
|
+
filter: {},
|
|
42
|
+
dataTableConf: {},
|
|
43
|
+
dataItems: {},
|
|
44
|
+
showCheckbox: { type: Boolean }
|
|
45
|
+
},
|
|
46
|
+
emits: [
|
|
47
|
+
"onview",
|
|
48
|
+
"onupdate",
|
|
49
|
+
"ondelete",
|
|
50
|
+
"onavanti",
|
|
51
|
+
"onindietro",
|
|
52
|
+
"ondownload",
|
|
53
|
+
"onchecked"
|
|
54
|
+
],
|
|
55
|
+
setup(s, { emit: I }) {
|
|
56
|
+
let L = f([]), R = f([]), z = f([]), B = s, V = I, H = f(0), U = f(B.dataTableConf.dimensionePagina), W = t(() => (B.dataTableConf.isserver ? L.value = B.dataItems : B.filter ? (H.value = 0, z.value = B.dataItems.filter((e) => {
|
|
57
|
+
let t = !1;
|
|
58
|
+
return B.dataTableConf.columns.forEach((n) => {
|
|
59
|
+
String(e[n.property]).toUpperCase().indexOf(String(B.filter).toUpperCase()) != -1 && (t = !0);
|
|
60
|
+
}), t;
|
|
61
|
+
}), H.value = 0, L.value = z.value.slice(0, U.value)) : (H.value = 0, L.value = B.dataItems.slice(0, U.value)), L)), G = t(() => (H.value < 0 && (H.value = 0), B.dataTableConf.isserver ? B.dataTableConf.serverPaging && H.value >= B.dataTableConf.serverPaging.serverTotalePagine && --H.value : B.filter ? H.value * U.value > z.value.length && --H.value : H.value * U.value > B.dataItems.length && --H.value, H)), K = t(() => {
|
|
62
|
+
if (B.dataTableConf.isserver) return B.dataTableConf.serverPaging?.serverTotalePagine;
|
|
63
|
+
if (B.filter) return Math.ceil(z.value.length / U.value);
|
|
64
|
+
if (B.dataItems.length) return Math.ceil(B.dataItems.length / U.value);
|
|
65
|
+
}), q = () => {
|
|
66
|
+
V("ondownload", W.value.value);
|
|
67
|
+
};
|
|
68
|
+
function le(e, t) {
|
|
69
|
+
J(), t.target.classList.add("icon-primaryOrder"), W.value.value.sort((t, n) => {
|
|
70
|
+
let r = t[e], i = n[e];
|
|
71
|
+
return r < i ? -1 : +(r > i);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function ue(e, t) {
|
|
75
|
+
J(), t.target.classList.add("icon-primaryOrder"), W.value.value.sort((t, n) => {
|
|
76
|
+
let r = t[e], i = n[e];
|
|
77
|
+
return r > i ? -1 : +(r < i);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
let J = () => {
|
|
81
|
+
Array.from(document.getElementsByClassName("icon-primaryOrder")).forEach((e) => {
|
|
82
|
+
e.classList.remove("icon-primaryOrder");
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
_(H, async () => {
|
|
86
|
+
B.dataTableConf.isserver ? L.value = B.dataItems : H.value > 0 ? B.filter ? L.value = z.value.slice(U.value * H.value, U.value * H.value + U.value) : L.value = B.dataItems.slice(U.value * H.value, U.value * H.value + U.value) : (H.value = 0, B.filter ? L.value = z.value.slice(0, U.value) : L.value = B.dataItems.slice(0, U.value));
|
|
87
|
+
}), _(B.dataTableConf, async () => K), _(B.dataItems, async () => {
|
|
88
|
+
B.dataItems.length && B.showCheckbox && B.dataItems.forEach((e, t) => {
|
|
89
|
+
e.checkId = t;
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
let Y = () => {
|
|
93
|
+
H.value += 1, B.dataTableConf.isserver && (B.dataTableConf.serverPaging && H.value >= B.dataTableConf.serverPaging.serverTotalePagine && --H.value, V("onavanti", H.value, U.value)), Q && J(), B.showCheckbox && $();
|
|
94
|
+
}, X = () => {
|
|
95
|
+
Q && J(), H.value > 0 && (--H.value, B.showCheckbox && $()), B.dataTableConf.isserver && V("onindietro", H.value, U.value);
|
|
96
|
+
}, Z = f([]), Q = f(!1);
|
|
97
|
+
u(() => {
|
|
98
|
+
Z.value = B.dataTableConf.columns.filter((e) => !e.hidden), B.showCheckbox && B.dataItems.forEach((e, t) => {
|
|
99
|
+
e.checkId = t;
|
|
100
|
+
}), B.dataTableConf.columns.forEach((e) => {
|
|
101
|
+
e.order && (Q.value = !0);
|
|
102
|
+
}), console.log(B.dataItems), V("onchecked", R.value);
|
|
103
|
+
}), _(B.dataItems, async () => {
|
|
104
|
+
B.dataItems.length && B.showCheckbox && B.dataItems.forEach((e, t) => {
|
|
105
|
+
e.checked && (R.value.push(e), console.log("obj:checked:", e), V("onchecked", R.value));
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
let de = (e) => {
|
|
109
|
+
if (R.value.length) {
|
|
110
|
+
let t = R.value.findIndex((t) => t.checkId == e.checkId);
|
|
111
|
+
t == -1 ? R.value.push(e) : R.value.splice(t, 1);
|
|
112
|
+
} else R.value.push(e);
|
|
113
|
+
console.log(R.value), V("onchecked", R.value);
|
|
114
|
+
}, $ = () => {
|
|
115
|
+
R.value = [], Array.from(document.querySelectorAll(".dtlchek")).forEach((e) => {
|
|
116
|
+
e.checked = !1;
|
|
117
|
+
}), V("onchecked", R.value);
|
|
118
|
+
};
|
|
119
|
+
return (t, u) => {
|
|
120
|
+
let f = h("slolt");
|
|
121
|
+
return d(), r(e, null, [
|
|
122
|
+
B.dataTableConf.viewDownload ? (d(), r("div", y, [m(t.$slots, "download", { ondownload: { oncall: q } }, () => [i("button", {
|
|
123
|
+
type: "button",
|
|
124
|
+
class: "btn btn p-0 shadow-none",
|
|
125
|
+
onClick: q,
|
|
126
|
+
title: "Download"
|
|
127
|
+
}, [...u[0] ||= [i("span", null, [i("svg", {
|
|
128
|
+
class: "icon",
|
|
129
|
+
viewBox: "0 0 24 24"
|
|
130
|
+
}, [i("path", { d: "M12 16l4-5h-3V4h-2v7H8l4 5zm-7 2v2h14v-2H5z" })])], -1)]])], !0)])) : n("", !0),
|
|
131
|
+
B.dataTableConf.paginator ? (d(), r("section", b, [B.dataItems.length && (G.value.value >= 1 || W.value.value.length >= U.value) && B.dataItems.length > B.dataTableConf.dimensionePagina || B.dataItems.length && B.dataTableConf.isserver && B.dataTableConf.serverPaging && B.dataTableConf.serverPaging.serverTotaleElementi > B.dataTableConf.dimensionePagina ? (d(), r("div", x, [B.dataTableConf.paginator && B.dataTableConf.paginatorPosition?.top === !0 ? (d(), r("div", {
|
|
132
|
+
key: 0,
|
|
133
|
+
class: c(B.dataTableConf.paginatorPosition.class + " col-md-12 mb-3")
|
|
134
|
+
}, [
|
|
135
|
+
i("button", {
|
|
136
|
+
class: "btn btn-outline-default navBtn",
|
|
137
|
+
type: "button",
|
|
138
|
+
onClick: X
|
|
139
|
+
}, [o(f, { name: "iconIndietroTop" }, {
|
|
140
|
+
default: v(() => [...u[1] ||= [i("span", null, [i("svg", {
|
|
141
|
+
class: "iconNav",
|
|
142
|
+
viewBox: "0 0 24 24"
|
|
143
|
+
}, [i("path", { d: "M15 18l-6-6 6-6" })])], -1)]]),
|
|
144
|
+
_: 1
|
|
145
|
+
})]),
|
|
146
|
+
i("button", S, g(G.value.value + 1) + " / " + g(K.value), 1),
|
|
147
|
+
i("button", {
|
|
148
|
+
class: "btn btn-outline-default navBtn",
|
|
149
|
+
type: "button",
|
|
150
|
+
onClick: Y
|
|
151
|
+
}, [o(f, { name: "iconAvantiTop" }, {
|
|
152
|
+
default: v(() => [...u[2] ||= [i("span", null, [i("svg", {
|
|
153
|
+
class: "iconNav",
|
|
154
|
+
viewBox: "0 0 24 24"
|
|
155
|
+
}, [i("path", { d: "M9 6l6 6-6 6" })])], -1)]]),
|
|
156
|
+
_: 1
|
|
157
|
+
})])
|
|
158
|
+
], 2)) : n("", !0)])) : n("", !0)])) : n("", !0),
|
|
159
|
+
i("div", { class: c(B.dataTableConf.paginator ? "row tablerow" : "row") }, [i("div", C, [i("table", w, [i("thead", null, [i("tr", null, [
|
|
160
|
+
s.showCheckbox ? (d(), r("th", ee)) : n("", !0),
|
|
161
|
+
(d(!0), r(e, null, p(Z.value, (e) => (d(), r("th", te, [i("div", T, [i("span", ne, g(e.title), 1), e.order ? (d(), r("div", re, [i("span", {
|
|
162
|
+
class: "sort-arrow-up",
|
|
163
|
+
onClick: (t) => le(e.property, t)
|
|
164
|
+
}, [...u[3] ||= [i("svg", {
|
|
165
|
+
class: "iconOrder",
|
|
166
|
+
viewBox: "0 0 24 24"
|
|
167
|
+
}, [i("path", { d: "M7 14l5-5 5 5H7z" })], -1)]], 8, ie), i("span", {
|
|
168
|
+
class: "sort-arrow-down",
|
|
169
|
+
onClick: (t) => ue(e.property, t)
|
|
170
|
+
}, [...u[4] ||= [i("svg", {
|
|
171
|
+
class: "iconOrder",
|
|
172
|
+
viewBox: "0 0 24 24"
|
|
173
|
+
}, [i("path", { d: "M7 10l5 5 5-5H7z" })], -1)]], 8, ae)])) : n("", !0)])]))), 256)),
|
|
174
|
+
B.dataTableConf.viewActions ? (d(), r("th", E)) : n("", !0)
|
|
175
|
+
])]), i("tbody", null, [(d(!0), r(e, null, p(W.value.value, (o, c) => (d(), r("tr", { key: c }, [
|
|
176
|
+
s.showCheckbox ? (d(), r("td", D, [m(t.$slots, "checkbox", { row: o }, () => [i("div", O, [i("input", {
|
|
177
|
+
class: "dtlchek",
|
|
178
|
+
onChange: (e) => de(o),
|
|
179
|
+
id: "chek" + c,
|
|
180
|
+
checked: o.checked,
|
|
181
|
+
type: "checkbox",
|
|
182
|
+
"data-focus-mouse": "false"
|
|
183
|
+
}, null, 40, oe), i("label", {
|
|
184
|
+
style: { color: "aliceblue" },
|
|
185
|
+
for: "chek" + c
|
|
186
|
+
}, "\xA0\xA0", 8, se)])], !0)])) : n("", !0),
|
|
187
|
+
(d(!0), r(e, null, p(Z.value, (e) => (d(), r("td", { style: l(e.style) }, [m(t.$slots, "iconTd", {
|
|
188
|
+
row: o,
|
|
189
|
+
column: e
|
|
190
|
+
}, void 0, !0), m(t.$slots, "columnTd", {
|
|
191
|
+
row: o,
|
|
192
|
+
column: e
|
|
193
|
+
}, () => [a(g(e.callFormatt ? e.callFormatt(o[e.property], o) : o[e.property]), 1)], !0)], 4))), 256)),
|
|
194
|
+
B.dataTableConf.viewActions ? (d(), r("td", ce, [i("div", k, [m(t.$slots, "actions", { row: o }, () => [
|
|
195
|
+
B.dataTableConf.actionsRow?.view ? (d(), r("button", {
|
|
196
|
+
key: 0,
|
|
197
|
+
type: "button",
|
|
198
|
+
class: "btn btn p-0 shadow-none",
|
|
199
|
+
onClick: (e) => V("onview", o)
|
|
200
|
+
}, [m(t.$slots, "iconView", {}, () => [u[5] ||= i("span", null, [i("svg", {
|
|
201
|
+
class: "iconView",
|
|
202
|
+
viewBox: "0 0 24 24"
|
|
203
|
+
}, [i("path", { d: "M12 5c-7 0-10 7-10 7s3 7 10 7 10-7 10-7-3-7-10-7zm0 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10z" })])], -1)], !0)], 8, A)) : n("", !0),
|
|
204
|
+
B.dataTableConf.actionsRow?.update ? (d(), r("button", {
|
|
205
|
+
key: 1,
|
|
206
|
+
type: "button",
|
|
207
|
+
class: "btn btn p-0 shadow-none",
|
|
208
|
+
onClick: (e) => V("onupdate", o)
|
|
209
|
+
}, [m(t.$slots, "iconUpdate", {}, () => [u[6] ||= i("span", null, [i("svg", {
|
|
210
|
+
class: "iconUpdate",
|
|
211
|
+
viewBox: "0 0 24 24"
|
|
212
|
+
}, [i("path", { d: "M3 17.25V21h3.75L20.81 6.94l-3.75-3.75L3 17.25z" })])], -1)], !0)], 8, j)) : n("", !0),
|
|
213
|
+
B.dataTableConf.actionsRow?.delete ? (d(), r("button", {
|
|
214
|
+
key: 2,
|
|
215
|
+
type: "button",
|
|
216
|
+
class: "btn btn p-0 shadow-none",
|
|
217
|
+
onClick: (e) => V("ondelete", o)
|
|
218
|
+
}, [m(t.$slots, "iconDelete", {}, () => [u[7] ||= i("span", null, [i("svg", {
|
|
219
|
+
class: "iconDelete",
|
|
220
|
+
viewBox: "0 0 24 24"
|
|
221
|
+
}, [i("path", { d: "M6 7h12M9 7v12m6-12v12M10 3h4l1 1h5v2H4V4h5l1-1z" })])], -1)], !0)], 8, M)) : n("", !0)
|
|
222
|
+
], !0)])])) : n("", !0)
|
|
223
|
+
]))), 128))])]), B.dataItems.length ? n("", !0) : (d(), r("div", N, [i("span", null, [u[8] ||= i("svg", {
|
|
224
|
+
class: "icon",
|
|
225
|
+
viewBox: "0 0 24 24"
|
|
226
|
+
}, [i("path", { d: "M12 2L2 22h20L12 2zm0 14h-1v-6h2v6zm0 4h-1v-2h2v2z" })], -1), a(" " + g(s.dataTableConf.messageNotRecords), 1)])]))])], 2),
|
|
227
|
+
i("section", null, [B.dataItems.length && (G.value.value >= 1 || W.value.value.length >= U.value) && B.dataItems.length > B.dataTableConf.dimensionePagina || B.dataItems.length && B.dataTableConf.isserver && B.dataTableConf.serverPaging && B.dataTableConf.serverPaging.serverTotaleElementi > B.dataTableConf.dimensionePagina ? (d(), r("div", P, [B.dataTableConf.paginator && B.dataTableConf.paginatorPosition?.bottom === !0 ? (d(), r("div", {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: c(B.dataTableConf.paginatorPosition.class + " col-md-12")
|
|
230
|
+
}, [
|
|
231
|
+
i("button", {
|
|
232
|
+
class: "btn btn-outline-default navBtn",
|
|
233
|
+
type: "button",
|
|
234
|
+
onClick: X
|
|
235
|
+
}, [o(f, { name: "iconIndietroBottom" }, {
|
|
236
|
+
default: v(() => [...u[9] ||= [i("span", null, [i("svg", {
|
|
237
|
+
class: "iconNav",
|
|
238
|
+
viewBox: "0 0 24 24"
|
|
239
|
+
}, [i("path", { d: "M15 18l-6-6 6-6" })])], -1)]]),
|
|
240
|
+
_: 1
|
|
241
|
+
})]),
|
|
242
|
+
i("button", F, g(G.value.value + 1) + " / " + g(K.value), 1),
|
|
243
|
+
i("button", {
|
|
244
|
+
class: "btn btn-outline-default navBtn",
|
|
245
|
+
type: "button",
|
|
246
|
+
onClick: Y
|
|
247
|
+
}, [o(f, { name: "iconAvantiBottom" }, {
|
|
248
|
+
default: v(() => [...u[10] ||= [i("span", null, [i("svg", {
|
|
249
|
+
class: "iconNav",
|
|
250
|
+
viewBox: "0 0 24 24"
|
|
251
|
+
}, [i("path", { d: "M9 6l6 6-6 6" })])], -1)]]),
|
|
252
|
+
_: 1
|
|
253
|
+
})])
|
|
254
|
+
], 2)) : n("", !0)])) : n("", !0)])
|
|
255
|
+
], 64);
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
}), L = (e, t) => {
|
|
259
|
+
let n = e.__vccOpts || e;
|
|
260
|
+
for (let [e, r] of t) n[e] = r;
|
|
261
|
+
return n;
|
|
262
|
+
}, R = /* @__PURE__ */ L(I, [["__scopeId", "data-v-347ab0dc"]]), z = /* @__PURE__ */ L(/* @__PURE__ */ s({
|
|
263
|
+
__name: "Avatar",
|
|
264
|
+
props: {
|
|
265
|
+
label: {},
|
|
266
|
+
class: {},
|
|
267
|
+
backgroundDynamics: { type: Boolean },
|
|
268
|
+
background: {},
|
|
269
|
+
color: {}
|
|
270
|
+
},
|
|
271
|
+
setup(e) {
|
|
272
|
+
let n = e, i = [
|
|
273
|
+
"#f4cccc",
|
|
274
|
+
"#d9ead3",
|
|
275
|
+
"#ffe599",
|
|
276
|
+
"#cfe2f3",
|
|
277
|
+
"#f9cb9c",
|
|
278
|
+
"#d5a6bd",
|
|
279
|
+
"#9fc5e8",
|
|
280
|
+
"#b6d7a8",
|
|
281
|
+
"#ffe6cc",
|
|
282
|
+
"#f6c1a6",
|
|
283
|
+
"#e6ccff",
|
|
284
|
+
"#ffd9b3",
|
|
285
|
+
"#c2f0f7",
|
|
286
|
+
"#ffebd7",
|
|
287
|
+
"#d0e0e3",
|
|
288
|
+
"#f7d9c4",
|
|
289
|
+
"#e0f7e9",
|
|
290
|
+
"#f2f9f9",
|
|
291
|
+
"#fde2e2",
|
|
292
|
+
"#f2f2f2"
|
|
293
|
+
], a = t(() => {
|
|
294
|
+
let e = [];
|
|
295
|
+
return n.background && (e.push("background-color:"), e.push(n.background), e.push("!important;")), n.backgroundDynamics && (e = [], e.push("background-color:"), e.push(o(n.label)), e.push("!important;")), n.color && (e.push("color:"), e.push(n.color), e.push("!important;")), e.join("");
|
|
296
|
+
});
|
|
297
|
+
function o(e) {
|
|
298
|
+
if (e && e.length > 1) {
|
|
299
|
+
let t = e.charCodeAt(0), n = e.charCodeAt(1), r = ((t - 65) * 26 + (n - 65)) % i.length;
|
|
300
|
+
return i[r >= 0 && r < i.length ? r : 0];
|
|
301
|
+
} else return "#d0fbc8";
|
|
302
|
+
}
|
|
303
|
+
return (e, t) => (d(), r("div", {
|
|
304
|
+
style: l(a.value),
|
|
305
|
+
class: c(n.class ? "avatar size-lg " + n.class : "avatar size-lg")
|
|
306
|
+
}, g(n.label), 7));
|
|
307
|
+
}
|
|
308
|
+
}), [["__scopeId", "data-v-0ae6bfc5"]]);
|
|
309
|
+
//#endregion
|
|
310
|
+
export { z as Avatar, R as DataTableList };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DataTableList={},e.Vue))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n={key:0,class:`col-md-12 right-box`},r={key:1},i={key:0,class:`row`},a={class:`btn btn-default navBtn`,type:`button`},o={class:`col`},s={class:`table table-hover`},c={key:0,class:`checkbox-header`},l={class:`headerTitle`},u={class:`header-container`},d={class:`header-text`},f={key:0,class:`sort-arrows`},p=[`onClick`],m=[`onClick`],h={key:1,class:`headerTitle action-header`},g={key:0},_={class:`form-check`},v=[`onChange`,`id`,`checked`],y=[`for`],b={key:1},x={class:`btn-group box-action`,role:`group`,"aria-label":`Actions`},S=[`onClick`],C=[`onClick`],w=[`onClick`],T={key:0,class:`col-md-12 center`},E={key:0,class:`row mb-5`},D={class:`btn btn-default navBtn`,type:`button`},O=(0,t.defineComponent)({__name:`DataTableList`,props:{filter:{},dataTableConf:{},dataItems:{},showCheckbox:{type:Boolean}},emits:[`onview`,`onupdate`,`ondelete`,`onavanti`,`onindietro`,`ondownload`,`onchecked`],setup(e,{emit:O}){let k=(0,t.ref)([]),A=(0,t.ref)([]),j=(0,t.ref)([]),M=e,N=O,P=(0,t.ref)(0),F=(0,t.ref)(M.dataTableConf.dimensionePagina),I=(0,t.computed)(()=>(M.dataTableConf.isserver?k.value=M.dataItems:M.filter?(P.value=0,j.value=M.dataItems.filter(e=>{let t=!1;return M.dataTableConf.columns.forEach(n=>{String(e[n.property]).toUpperCase().indexOf(String(M.filter).toUpperCase())!=-1&&(t=!0)}),t}),P.value=0,k.value=j.value.slice(0,F.value)):(P.value=0,k.value=M.dataItems.slice(0,F.value)),k)),L=(0,t.computed)(()=>(P.value<0&&(P.value=0),M.dataTableConf.isserver?M.dataTableConf.serverPaging&&P.value>=M.dataTableConf.serverPaging.serverTotalePagine&&--P.value:M.filter?P.value*F.value>j.value.length&&--P.value:P.value*F.value>M.dataItems.length&&--P.value,P)),R=(0,t.computed)(()=>{if(M.dataTableConf.isserver)return M.dataTableConf.serverPaging?.serverTotalePagine;if(M.filter)return Math.ceil(j.value.length/F.value);if(M.dataItems.length)return Math.ceil(M.dataItems.length/F.value)}),z=()=>{N(`ondownload`,I.value.value)};function B(e,t){H(),t.target.classList.add(`icon-primaryOrder`),I.value.value.sort((t,n)=>{let r=t[e],i=n[e];return r<i?-1:+(r>i)})}function V(e,t){H(),t.target.classList.add(`icon-primaryOrder`),I.value.value.sort((t,n)=>{let r=t[e],i=n[e];return r>i?-1:+(r<i)})}let H=()=>{Array.from(document.getElementsByClassName(`icon-primaryOrder`)).forEach(e=>{e.classList.remove(`icon-primaryOrder`)})};(0,t.watch)(P,async()=>{M.dataTableConf.isserver?k.value=M.dataItems:P.value>0?M.filter?k.value=j.value.slice(F.value*P.value,F.value*P.value+F.value):k.value=M.dataItems.slice(F.value*P.value,F.value*P.value+F.value):(P.value=0,M.filter?k.value=j.value.slice(0,F.value):k.value=M.dataItems.slice(0,F.value))}),(0,t.watch)(M.dataTableConf,async()=>R),(0,t.watch)(M.dataItems,async()=>{M.dataItems.length&&M.showCheckbox&&M.dataItems.forEach((e,t)=>{e.checkId=t})});let U=()=>{P.value+=1,M.dataTableConf.isserver&&(M.dataTableConf.serverPaging&&P.value>=M.dataTableConf.serverPaging.serverTotalePagine&&--P.value,N(`onavanti`,P.value,F.value)),K&&H(),M.showCheckbox&&J()},W=()=>{K&&H(),P.value>0&&(--P.value,M.showCheckbox&&J()),M.dataTableConf.isserver&&N(`onindietro`,P.value,F.value)},G=(0,t.ref)([]),K=(0,t.ref)(!1);(0,t.onMounted)(()=>{G.value=M.dataTableConf.columns.filter(e=>!e.hidden),M.showCheckbox&&M.dataItems.forEach((e,t)=>{e.checkId=t}),M.dataTableConf.columns.forEach(e=>{e.order&&(K.value=!0)}),console.log(M.dataItems),N(`onchecked`,A.value)}),(0,t.watch)(M.dataItems,async()=>{M.dataItems.length&&M.showCheckbox&&M.dataItems.forEach((e,t)=>{e.checked&&(A.value.push(e),console.log(`obj:checked:`,e),N(`onchecked`,A.value))})});let q=e=>{if(A.value.length){let t=A.value.findIndex(t=>t.checkId==e.checkId);t==-1?A.value.push(e):A.value.splice(t,1)}else A.value.push(e);console.log(A.value),N(`onchecked`,A.value)},J=()=>{A.value=[],Array.from(document.querySelectorAll(`.dtlchek`)).forEach(e=>{e.checked=!1}),N(`onchecked`,A.value)};return(O,k)=>{let A=(0,t.resolveComponent)(`slolt`);return(0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[M.dataTableConf.viewDownload?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,n,[(0,t.renderSlot)(O.$slots,`download`,{ondownload:{oncall:z}},()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:`btn btn p-0 shadow-none`,onClick:z,title:`Download`},[...k[0]||=[(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`svg`,{class:`icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M12 16l4-5h-3V4h-2v7H8l4 5zm-7 2v2h14v-2H5z`})])],-1)]])],!0)])):(0,t.createCommentVNode)(``,!0),M.dataTableConf.paginator?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,r,[M.dataItems.length&&(L.value.value>=1||I.value.value.length>=F.value)&&M.dataItems.length>M.dataTableConf.dimensionePagina||M.dataItems.length&&M.dataTableConf.isserver&&M.dataTableConf.serverPaging&&M.dataTableConf.serverPaging.serverTotaleElementi>M.dataTableConf.dimensionePagina?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,i,[M.dataTableConf.paginator&&M.dataTableConf.paginatorPosition?.top===!0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)(M.dataTableConf.paginatorPosition.class+` col-md-12 mb-3`)},[(0,t.createElementVNode)(`button`,{class:`btn btn-outline-default navBtn`,type:`button`,onClick:W},[(0,t.createVNode)(A,{name:`iconIndietroTop`},{default:(0,t.withCtx)(()=>[...k[1]||=[(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`svg`,{class:`iconNav`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M15 18l-6-6 6-6`})])],-1)]]),_:1})]),(0,t.createElementVNode)(`button`,a,(0,t.toDisplayString)(L.value.value+1)+` / `+(0,t.toDisplayString)(R.value),1),(0,t.createElementVNode)(`button`,{class:`btn btn-outline-default navBtn`,type:`button`,onClick:U},[(0,t.createVNode)(A,{name:`iconAvantiTop`},{default:(0,t.withCtx)(()=>[...k[2]||=[(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`svg`,{class:`iconNav`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M9 6l6 6-6 6`})])],-1)]]),_:1})])],2)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)(M.dataTableConf.paginator?`row tablerow`:`row`)},[(0,t.createElementVNode)(`div`,o,[(0,t.createElementVNode)(`table`,s,[(0,t.createElementVNode)(`thead`,null,[(0,t.createElementVNode)(`tr`,null,[e.showCheckbox?((0,t.openBlock)(),(0,t.createElementBlock)(`th`,c)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(G.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,l,[(0,t.createElementVNode)(`div`,u,[(0,t.createElementVNode)(`span`,d,(0,t.toDisplayString)(e.title),1),e.order?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,f,[(0,t.createElementVNode)(`span`,{class:`sort-arrow-up`,onClick:t=>B(e.property,t)},[...k[3]||=[(0,t.createElementVNode)(`svg`,{class:`iconOrder`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M7 14l5-5 5 5H7z`})],-1)]],8,p),(0,t.createElementVNode)(`span`,{class:`sort-arrow-down`,onClick:t=>V(e.property,t)},[...k[4]||=[(0,t.createElementVNode)(`svg`,{class:`iconOrder`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M7 10l5 5 5-5H7z`})],-1)]],8,m)])):(0,t.createCommentVNode)(``,!0)])]))),256)),M.dataTableConf.viewActions?((0,t.openBlock)(),(0,t.createElementBlock)(`th`,h)):(0,t.createCommentVNode)(``,!0)])]),(0,t.createElementVNode)(`tbody`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(I.value.value,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:r},[e.showCheckbox?((0,t.openBlock)(),(0,t.createElementBlock)(`td`,g,[(0,t.renderSlot)(O.$slots,`checkbox`,{row:n},()=>[(0,t.createElementVNode)(`div`,_,[(0,t.createElementVNode)(`input`,{class:`dtlchek`,onChange:e=>q(n),id:`chek`+r,checked:n.checked,type:`checkbox`,"data-focus-mouse":`false`},null,40,v),(0,t.createElementVNode)(`label`,{style:{color:`aliceblue`},for:`chek`+r},`\xA0\xA0`,8,y)])],!0)])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(G.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{style:(0,t.normalizeStyle)(e.style)},[(0,t.renderSlot)(O.$slots,`iconTd`,{row:n,column:e},void 0,!0),(0,t.renderSlot)(O.$slots,`columnTd`,{row:n,column:e},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.callFormatt?e.callFormatt(n[e.property],n):n[e.property]),1)],!0)],4))),256)),M.dataTableConf.viewActions?((0,t.openBlock)(),(0,t.createElementBlock)(`td`,b,[(0,t.createElementVNode)(`div`,x,[(0,t.renderSlot)(O.$slots,`actions`,{row:n},()=>[M.dataTableConf.actionsRow?.view?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`btn btn p-0 shadow-none`,onClick:e=>N(`onview`,n)},[(0,t.renderSlot)(O.$slots,`iconView`,{},()=>[k[5]||=(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`svg`,{class:`iconView`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M12 5c-7 0-10 7-10 7s3 7 10 7 10-7 10-7-3-7-10-7zm0 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10z`})])],-1)],!0)],8,S)):(0,t.createCommentVNode)(``,!0),M.dataTableConf.actionsRow?.update?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`btn btn p-0 shadow-none`,onClick:e=>N(`onupdate`,n)},[(0,t.renderSlot)(O.$slots,`iconUpdate`,{},()=>[k[6]||=(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`svg`,{class:`iconUpdate`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M3 17.25V21h3.75L20.81 6.94l-3.75-3.75L3 17.25z`})])],-1)],!0)],8,C)):(0,t.createCommentVNode)(``,!0),M.dataTableConf.actionsRow?.delete?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,type:`button`,class:`btn btn p-0 shadow-none`,onClick:e=>N(`ondelete`,n)},[(0,t.renderSlot)(O.$slots,`iconDelete`,{},()=>[k[7]||=(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`svg`,{class:`iconDelete`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M6 7h12M9 7v12m6-12v12M10 3h4l1 1h5v2H4V4h5l1-1z`})])],-1)],!0)],8,w)):(0,t.createCommentVNode)(``,!0)],!0)])])):(0,t.createCommentVNode)(``,!0)]))),128))])]),M.dataItems.length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,T,[(0,t.createElementVNode)(`span`,null,[k[8]||=(0,t.createElementVNode)(`svg`,{class:`icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M12 2L2 22h20L12 2zm0 14h-1v-6h2v6zm0 4h-1v-2h2v2z`})],-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.dataTableConf.messageNotRecords),1)])]))])],2),(0,t.createElementVNode)(`section`,null,[M.dataItems.length&&(L.value.value>=1||I.value.value.length>=F.value)&&M.dataItems.length>M.dataTableConf.dimensionePagina||M.dataItems.length&&M.dataTableConf.isserver&&M.dataTableConf.serverPaging&&M.dataTableConf.serverPaging.serverTotaleElementi>M.dataTableConf.dimensionePagina?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,E,[M.dataTableConf.paginator&&M.dataTableConf.paginatorPosition?.bottom===!0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)(M.dataTableConf.paginatorPosition.class+` col-md-12`)},[(0,t.createElementVNode)(`button`,{class:`btn btn-outline-default navBtn`,type:`button`,onClick:W},[(0,t.createVNode)(A,{name:`iconIndietroBottom`},{default:(0,t.withCtx)(()=>[...k[9]||=[(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`svg`,{class:`iconNav`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M15 18l-6-6 6-6`})])],-1)]]),_:1})]),(0,t.createElementVNode)(`button`,D,(0,t.toDisplayString)(L.value.value+1)+` / `+(0,t.toDisplayString)(R.value),1),(0,t.createElementVNode)(`button`,{class:`btn btn-outline-default navBtn`,type:`button`,onClick:U},[(0,t.createVNode)(A,{name:`iconAvantiBottom`},{default:(0,t.withCtx)(()=>[...k[10]||=[(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`svg`,{class:`iconNav`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M9 6l6 6-6 6`})])],-1)]]),_:1})])],2)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)])],64)}}}),k=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},A=k(O,[[`__scopeId`,`data-v-347ab0dc`]]);e.Avatar=k((0,t.defineComponent)({__name:`Avatar`,props:{label:{},class:{},backgroundDynamics:{type:Boolean},background:{},color:{}},setup(e){let n=e,r=[`#f4cccc`,`#d9ead3`,`#ffe599`,`#cfe2f3`,`#f9cb9c`,`#d5a6bd`,`#9fc5e8`,`#b6d7a8`,`#ffe6cc`,`#f6c1a6`,`#e6ccff`,`#ffd9b3`,`#c2f0f7`,`#ffebd7`,`#d0e0e3`,`#f7d9c4`,`#e0f7e9`,`#f2f9f9`,`#fde2e2`,`#f2f2f2`],i=(0,t.computed)(()=>{let e=[];return n.background&&(e.push(`background-color:`),e.push(n.background),e.push(`!important;`)),n.backgroundDynamics&&(e=[],e.push(`background-color:`),e.push(a(n.label)),e.push(`!important;`)),n.color&&(e.push(`color:`),e.push(n.color),e.push(`!important;`)),e.join(``)});function a(e){if(e&&e.length>1){let t=e.charCodeAt(0),n=e.charCodeAt(1),i=((t-65)*26+(n-65))%r.length;return r[i>=0&&i<r.length?i:0]}else return`#d0fbc8`}return(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{style:(0,t.normalizeStyle)(i.value),class:(0,t.normalizeClass)(n.class?`avatar size-lg `+n.class:`avatar size-lg`)},(0,t.toDisplayString)(n.label),7))}}),[[`__scopeId`,`data-v-0ae6bfc5`]]),e.DataTableList=A});
|
package/dist/favicon.ico
ADDED
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
3
|
+
class?: string | 'size-xs' | 'size-sm' | 'size-lg' | 'size-xl' | 'size-xxl';
|
|
4
|
+
backgroundDynamics?: boolean;
|
|
5
|
+
background?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { DataTableConf } from '../../../model/Models';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
filter?: string;
|
|
4
|
+
dataTableConf: DataTableConf;
|
|
5
|
+
dataItems: any[];
|
|
6
|
+
showCheckbox?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {
|
|
9
|
+
ondownload: {
|
|
10
|
+
oncall: any;
|
|
11
|
+
};
|
|
12
|
+
}, __VLS_15: {
|
|
13
|
+
row: any;
|
|
14
|
+
}, __VLS_17: {
|
|
15
|
+
row: any;
|
|
16
|
+
column: any;
|
|
17
|
+
}, __VLS_19: {
|
|
18
|
+
row: any;
|
|
19
|
+
column: any;
|
|
20
|
+
}, __VLS_21: {
|
|
21
|
+
row: any;
|
|
22
|
+
}, __VLS_23: {}, __VLS_25: {}, __VLS_27: {};
|
|
23
|
+
type __VLS_Slots = {} & {
|
|
24
|
+
download?: (props: typeof __VLS_1) => any;
|
|
25
|
+
} & {
|
|
26
|
+
checkbox?: (props: typeof __VLS_15) => any;
|
|
27
|
+
} & {
|
|
28
|
+
iconTd?: (props: typeof __VLS_17) => any;
|
|
29
|
+
} & {
|
|
30
|
+
columnTd?: (props: typeof __VLS_19) => any;
|
|
31
|
+
} & {
|
|
32
|
+
actions?: (props: typeof __VLS_21) => any;
|
|
33
|
+
} & {
|
|
34
|
+
iconView?: (props: typeof __VLS_23) => any;
|
|
35
|
+
} & {
|
|
36
|
+
iconUpdate?: (props: typeof __VLS_25) => any;
|
|
37
|
+
} & {
|
|
38
|
+
iconDelete?: (props: typeof __VLS_27) => any;
|
|
39
|
+
};
|
|
40
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
41
|
+
onview: (obj: object) => any;
|
|
42
|
+
onupdate: (obj: object) => any;
|
|
43
|
+
ondelete: (obj: object) => any;
|
|
44
|
+
onavanti: (current: number, size: number) => any;
|
|
45
|
+
onindietro: (current: number, size: number) => any;
|
|
46
|
+
ondownload: (call: any[]) => any;
|
|
47
|
+
onchecked: (obj: any[]) => any;
|
|
48
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
49
|
+
onOnview?: ((obj: object) => any) | undefined;
|
|
50
|
+
onOnupdate?: ((obj: object) => any) | undefined;
|
|
51
|
+
onOndelete?: ((obj: object) => any) | undefined;
|
|
52
|
+
onOnavanti?: ((current: number, size: number) => any) | undefined;
|
|
53
|
+
onOnindietro?: ((current: number, size: number) => any) | undefined;
|
|
54
|
+
onOndownload?: ((call: any[]) => any) | undefined;
|
|
55
|
+
onOnchecked?: ((obj: any[]) => any) | undefined;
|
|
56
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
57
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|
|
60
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
61
|
+
new (): {
|
|
62
|
+
$slots: S;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface BreadcrumbConf {
|
|
2
|
+
label: string;
|
|
3
|
+
actionRouter: any;
|
|
4
|
+
}
|
|
5
|
+
export interface DataTableConf {
|
|
6
|
+
columns: ColumnTable[];
|
|
7
|
+
actionsRow?: ActionRow;
|
|
8
|
+
viewActions: boolean;
|
|
9
|
+
viewDownload?: boolean;
|
|
10
|
+
paginator?: boolean;
|
|
11
|
+
paginatorPosition?: PaginatorPosition;
|
|
12
|
+
isserver?: boolean;
|
|
13
|
+
serverPaging?: ServerPaging;
|
|
14
|
+
dimensionePagina: number;
|
|
15
|
+
messageNotRecords?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DataItems<T = any> {
|
|
18
|
+
rows: T[];
|
|
19
|
+
}
|
|
20
|
+
export interface ServerPaging {
|
|
21
|
+
serverTotaleElementi: number;
|
|
22
|
+
serverTotalePagine: number;
|
|
23
|
+
}
|
|
24
|
+
export interface PaginatorPosition {
|
|
25
|
+
top: boolean;
|
|
26
|
+
bottom: boolean;
|
|
27
|
+
class: string | 'center' | 'left' | 'right';
|
|
28
|
+
}
|
|
29
|
+
export interface ColumnTable {
|
|
30
|
+
title: string;
|
|
31
|
+
property: string;
|
|
32
|
+
style?: string | null;
|
|
33
|
+
callFormatt?: Function | null;
|
|
34
|
+
hidden?: boolean;
|
|
35
|
+
order?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface ActionRow {
|
|
38
|
+
view: boolean;
|
|
39
|
+
update: boolean;
|
|
40
|
+
delete: boolean;
|
|
41
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "data-table-list",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/data-table-list.umd.cjs",
|
|
7
|
+
"module": "./dist/data-table-list.js",
|
|
8
|
+
"types": "./dist/src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/src/index.d.ts",
|
|
12
|
+
"import": "./dist/data-table-list.js",
|
|
13
|
+
"require": "./dist/data-table-list.umd.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./dist/data-table-list.css": "./dist/data-table-list.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "vite",
|
|
22
|
+
"build": "run-p type-check \"build-only {@}\" --",
|
|
23
|
+
"preview": "vite preview",
|
|
24
|
+
"build-only": "vite build",
|
|
25
|
+
"type-check": "vue-tsc --build",
|
|
26
|
+
"prepare": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"bootstrap-italia": "^2.18.1",
|
|
30
|
+
"vue": "^3.5.32",
|
|
31
|
+
"vue-router": "^4.6.4"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"bootstrap-italia": "^2.18.1",
|
|
35
|
+
"vue": "^3.5.32",
|
|
36
|
+
"vue-router": "^4.6.4"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@microsoft/api-extractor": "^7.58.7",
|
|
40
|
+
"@tsconfig/node24": "^24.0.4",
|
|
41
|
+
"@types/node": "^24.12.2",
|
|
42
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
43
|
+
"@vue/tsconfig": "^0.9.1",
|
|
44
|
+
"npm-run-all2": "^8.0.4",
|
|
45
|
+
"typescript": "~6.0.0",
|
|
46
|
+
"vite": "^8.0.8",
|
|
47
|
+
"vite-plugin-dts": "^5.0.2",
|
|
48
|
+
"vite-plugin-vue-devtools": "^8.1.1",
|
|
49
|
+
"vue-tsc": "^3.2.6"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
53
|
+
}
|
|
54
|
+
}
|