adverich-kun-ui 0.1.361 → 0.1.365
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
import { getNestedValue as
|
|
4
|
-
import
|
|
5
|
-
const $ = { class: "w-full h-full overflow-hidden" },
|
|
1
|
+
import { createElementBlock as f, openBlock as g, createElementVNode as d, normalizeStyle as S, toDisplayString as x, Fragment as R, renderList as k, unref as V, createVNode as A, withCtx as T } from "vue";
|
|
2
|
+
import I from "../../../KunCheckbox/src/components/KunCheckbox.vue.js";
|
|
3
|
+
import { getNestedValue as h } from "../../../../utils/tableFormatters.js";
|
|
4
|
+
import L from "../../../KunVirtualScroller/src/components/KunVirtualScroller.vue.js";
|
|
5
|
+
const $ = { class: "w-full h-full overflow-hidden" }, j = { class: "w-full h-full" }, z = { class: "px-2 py-1 font-bold border-b" }, B = { class: "h-full pb-9" }, C = { class: "px-2 py-1 border-b font-medium text-lg" }, H = {
|
|
6
6
|
__name: "KunRelationMatrix",
|
|
7
7
|
props: {
|
|
8
8
|
relationTitle: { type: String, default: "Relaciones" },
|
|
@@ -19,7 +19,8 @@ const $ = { class: "w-full h-full overflow-hidden" }, z = { class: "w-full h-ful
|
|
|
19
19
|
validator: (l) => ["column", "row"].includes(l)
|
|
20
20
|
},
|
|
21
21
|
getRelatedEntities: Function,
|
|
22
|
-
onToggleRelation: Function
|
|
22
|
+
onToggleRelation: Function,
|
|
23
|
+
returnObject: { type: Boolean, default: !1 }
|
|
23
24
|
},
|
|
24
25
|
setup(l) {
|
|
25
26
|
const n = l;
|
|
@@ -32,68 +33,68 @@ const $ = { class: "w-full h-full overflow-hidden" }, z = { class: "w-full h-ful
|
|
|
32
33
|
function v(e, t) {
|
|
33
34
|
return n.relationDirection === "column" ? e == null ? void 0 : e[n.rowKey] : t == null ? void 0 : t[n.columnKey];
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function p(e, t) {
|
|
36
37
|
var o;
|
|
37
|
-
const
|
|
38
|
-
return (Array.isArray(u) ? u : []).some((c) => (c == null ? void 0 : c.id) ===
|
|
38
|
+
const a = b(e, t), s = v(e, t), u = ((o = n.getRelatedEntities) == null ? void 0 : o.call(n, e, t)) ?? h(a, n.relationKey);
|
|
39
|
+
return (Array.isArray(u) ? u : []).some((c) => (c == null ? void 0 : c.id) === s);
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
var c,
|
|
42
|
-
const
|
|
43
|
-
let o =
|
|
41
|
+
function E(e, t, a) {
|
|
42
|
+
var c, K;
|
|
43
|
+
const s = b(e, t), u = D(e, t), m = v(e, t);
|
|
44
|
+
let o = h(s, n.relationKey);
|
|
44
45
|
if (!Array.isArray(o)) {
|
|
45
46
|
o = [];
|
|
46
|
-
const
|
|
47
|
-
let
|
|
48
|
-
for (let
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
const i = n.relationKey.split(".");
|
|
48
|
+
let r = s;
|
|
49
|
+
for (let y = 0; y < i.length - 1; y++)
|
|
50
|
+
r[c = i[y]] ?? (r[c] = {}), r = r[i[y]];
|
|
51
|
+
r[i[i.length - 1]] = o;
|
|
51
52
|
}
|
|
52
|
-
if (
|
|
53
|
-
o.
|
|
53
|
+
if (a)
|
|
54
|
+
o.some((r) => (r == null ? void 0 : r.id) === m) || (n.returnObject ? o.push(u) : o.push({ id: m }));
|
|
54
55
|
else {
|
|
55
|
-
const
|
|
56
|
-
|
|
56
|
+
const i = o.findIndex((r) => r.id === m);
|
|
57
|
+
i !== -1 && o.splice(i, 1);
|
|
57
58
|
}
|
|
58
|
-
(
|
|
59
|
+
(K = n.onToggleRelation) == null || K.call(n, {
|
|
59
60
|
row: e,
|
|
60
61
|
column: t,
|
|
61
|
-
hasRelation:
|
|
62
|
-
existingRelationData: o.find((
|
|
62
|
+
hasRelation: a,
|
|
63
|
+
existingRelationData: o.find((i) => (i == null ? void 0 : i.id) === m)
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
return (e, t) => (
|
|
66
|
-
d("div",
|
|
66
|
+
return (e, t) => (g(), f("div", $, [
|
|
67
|
+
d("div", j, [
|
|
67
68
|
d("div", {
|
|
68
69
|
class: "grid sticky top-0 z-10",
|
|
69
70
|
style: S(`grid-template-columns: repeat(${l.columns.length + 1}, minmax(120px, 1fr))`)
|
|
70
71
|
}, [
|
|
71
|
-
d("div",
|
|
72
|
-
(
|
|
73
|
-
key:
|
|
72
|
+
d("div", z, x(l.relationTitle), 1),
|
|
73
|
+
(g(!0), f(R, null, k(l.columns, (a) => (g(), f("div", {
|
|
74
|
+
key: a[l.columnKey],
|
|
74
75
|
class: "px-2 py-1 font-bold text-center border-b"
|
|
75
|
-
}, x(V(
|
|
76
|
+
}, x(V(h)(a, l.columnLabel)), 1))), 128))
|
|
76
77
|
], 4),
|
|
77
|
-
d("div",
|
|
78
|
-
A(
|
|
78
|
+
d("div", B, [
|
|
79
|
+
A(L, {
|
|
79
80
|
items: l.rows,
|
|
80
81
|
estimatedItemHeight: 36,
|
|
81
82
|
class: "w-full"
|
|
82
83
|
}, {
|
|
83
|
-
default:
|
|
84
|
+
default: T(({ item: a }) => [
|
|
84
85
|
d("div", {
|
|
85
86
|
class: "grid items-center hover:bg-slate-200 dark:hover:bg-slate-800",
|
|
86
87
|
style: S(`grid-template-columns: repeat(${l.columns.length + 1}, minmax(120px, 1fr))`)
|
|
87
88
|
}, [
|
|
88
|
-
d("div",
|
|
89
|
-
(
|
|
90
|
-
key:
|
|
89
|
+
d("div", C, x(V(h)(a, l.rowLabel)), 1),
|
|
90
|
+
(g(!0), f(R, null, k(l.columns, (s) => (g(), f("div", {
|
|
91
|
+
key: s[l.columnKey],
|
|
91
92
|
class: "flex justify-center items-center px-2 py-1 border-b h-full"
|
|
92
93
|
}, [
|
|
93
|
-
A(
|
|
94
|
-
modelValue:
|
|
95
|
-
color:
|
|
96
|
-
"onUpdate:modelValue": (u) =>
|
|
94
|
+
A(I, {
|
|
95
|
+
modelValue: p(a, s),
|
|
96
|
+
color: p(a, s) ? "text-green-600 dark:text-green-400" : "",
|
|
97
|
+
"onUpdate:modelValue": (u) => E(a, s, u),
|
|
97
98
|
size: "lg",
|
|
98
99
|
label: ""
|
|
99
100
|
}, null, 8, ["modelValue", "color", "onUpdate:modelValue"])
|
|
@@ -108,5 +109,5 @@ const $ = { class: "w-full h-full overflow-hidden" }, z = { class: "w-full h-ful
|
|
|
108
109
|
}
|
|
109
110
|
};
|
|
110
111
|
export {
|
|
111
|
-
|
|
112
|
+
H as default
|
|
112
113
|
};
|
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "adverich-kun-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Una librería de componentes Vue.js con Tailwind CSS",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"module": "dist/index.js",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"dev": "vite",
|
|
13
|
-
"build": "vite build",
|
|
14
|
-
"preview": "vite preview"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@tailwindcss/vite": "^4.1.10",
|
|
18
|
-
"@vitejs/plugin-vue": "^5.2.4",
|
|
19
|
-
"autoprefixer": "^10.4.21",
|
|
20
|
-
"prettier": "^3.6.1",
|
|
21
|
-
"vite": "^6.3.5",
|
|
22
|
-
"vite-plugin-vue-devtools": "^7.7.7"
|
|
23
|
-
},
|
|
24
|
-
"peerDependencies": {
|
|
25
|
-
"tailwindcss": "^4.1.8",
|
|
26
|
-
"vue": "^3.5.13",
|
|
27
|
-
"vue-router": "^4.0.0"
|
|
28
|
-
},
|
|
29
|
-
"keywords": [
|
|
30
|
-
"vue",
|
|
31
|
-
"components",
|
|
32
|
-
"tailwindcss"
|
|
33
|
-
],
|
|
34
|
-
"author": "Adverich",
|
|
35
|
-
"license": "MIT",
|
|
36
|
-
"repository": {
|
|
37
|
-
"type": "git",
|
|
38
|
-
"url": "https://github.com/adverich/KunUi.git"
|
|
39
|
-
},
|
|
40
|
-
"exports": {
|
|
41
|
-
".": {
|
|
42
|
-
"import": "./dist/index.js",
|
|
43
|
-
"require": "./dist/index.js"
|
|
44
|
-
},
|
|
45
|
-
"./dist/adverich-kun-ui.css": "./dist/adverich-kun-ui.css",
|
|
46
|
-
"./components/*": "./dist/components/*",
|
|
47
|
-
"./components": "./dist/components/index.js"
|
|
48
|
-
},
|
|
49
|
-
"engines": {
|
|
50
|
-
"node": ">=18.0.0"
|
|
51
|
-
},
|
|
52
|
-
"sideEffects": [
|
|
53
|
-
"*.css"
|
|
54
|
-
],
|
|
55
|
-
"dependencies": {
|
|
56
|
-
"vue-router": "^4.5.1"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "adverich-kun-ui",
|
|
3
|
+
"version": "0.1.365",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Una librería de componentes Vue.js con Tailwind CSS",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "vite",
|
|
13
|
+
"build": "vite build",
|
|
14
|
+
"preview": "vite preview"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@tailwindcss/vite": "^4.1.10",
|
|
18
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
19
|
+
"autoprefixer": "^10.4.21",
|
|
20
|
+
"prettier": "^3.6.1",
|
|
21
|
+
"vite": "^6.3.5",
|
|
22
|
+
"vite-plugin-vue-devtools": "^7.7.7"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"tailwindcss": "^4.1.8",
|
|
26
|
+
"vue": "^3.5.13",
|
|
27
|
+
"vue-router": "^4.0.0"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"vue",
|
|
31
|
+
"components",
|
|
32
|
+
"tailwindcss"
|
|
33
|
+
],
|
|
34
|
+
"author": "Adverich",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/adverich/KunUi.git"
|
|
39
|
+
},
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"import": "./dist/index.js",
|
|
43
|
+
"require": "./dist/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./dist/adverich-kun-ui.css": "./dist/adverich-kun-ui.css",
|
|
46
|
+
"./components/*": "./dist/components/*",
|
|
47
|
+
"./components": "./dist/components/index.js"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"sideEffects": [
|
|
53
|
+
"*.css"
|
|
54
|
+
],
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"vue-router": "^4.5.1"
|
|
57
|
+
}
|
|
58
|
+
}
|