@vpuska/vx-components 0.0.1 → 0.0.2
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/dist/browser/vx-components.js +2 -2
- package/dist/library/chunks/{components-CpfyYVMT.js → components-DcQT86Uf.js} +11 -11
- package/dist/library/chunks/{svg-YrZ3m-FZ.js → lib-58XTUR_n.js} +43 -21
- package/dist/library/components/index.js +1 -1
- package/dist/library/index.js +2 -3
- package/dist/library/lib/index.js +1 -2
- package/dist/library/types/lib/index.d.ts +1 -0
- package/package.json +4 -2
- package/dist/library/chunks/lib-DrxW6cQY.js +0 -24
|
@@ -115,7 +115,7 @@ var VXComponents=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:
|
|
|
115
115
|
<!--Boxicons v3.0.8 https://boxicons.com | License https://docs.boxicons.com/free-->
|
|
116
116
|
<path d="M17 7c-1.18 0-2.29.41-3.19 1.15-.69-.42-1.48-.65-2.31-.65-1.19 0-2.31.48-3.13 1.28A3.999 3.999 0 0 0 2 12a3.999 3.999 0 0 0 6.37 3.22c.83.81 1.95 1.28 3.13 1.28.83 0 1.63-.23 2.31-.65A5.002 5.002 0 0 0 22 12c0-2.76-2.24-5-5-5M6 14c-1.1 0-2-.9-2-2s.9-2 2-2c.47 0 .92.17 1.27.46l-.03.12c-.06.17-.1.34-.14.51-.01.07-.03.13-.04.2-.04.23-.06.47-.06.71s.03.48.06.71c.01.06.02.13.04.19.04.18.08.36.14.53.01.04.02.08.03.11-.35.29-.8.46-1.27.46m5.5.5c-.89 0-1.73-.49-2.18-1.29C9.11 12.85 9 12.43 9 12s.11-.85.33-1.23c.44-.78 1.28-1.27 2.17-1.27.37 0 .73.08 1.05.23-.09.19-.18.38-.25.57l-.03.1c-.07.21-.13.42-.17.64-.01.07-.03.13-.04.2-.04.25-.07.5-.07.76a5 5 0 0 0 .11.96c.04.22.1.44.17.65l.03.09c.07.2.15.39.25.58-.32.15-.68.23-1.05.23Zm5.5.5c-.9 0-1.75-.4-2.32-1.1a3.01 3.01 0 0 1-.01-3.8A3.005 3.005 0 0 1 20 12c0 1.65-1.35 3-3 3"></path>
|
|
117
117
|
</svg>
|
|
118
|
-
`},Q,$=class extends I{static{Q=this}constructor(...e){super(...e),this.library=null,this.name=``,this.button=!1}static{ut(`$system`,ft)}static{this.styles=l`
|
|
118
|
+
`};(class e{static{this.functions=new Map}static init(){e.loadTheme(),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.loadTheme()}),window.addEventListener(`storage`,t=>{(t.key===`theme`||t.key===`themeColor`)&&e.loadTheme()})}static loadTheme(){let e=document.documentElement,t=localStorage.getItem(`vx-theme`)||`system`;t===`system`&&(t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`),t===`dark`?(e.classList.add(`vx-theme-dark`),e.classList.remove(`vx-theme-light`)):(e.classList.add(`vx-theme-light`),e.classList.remove(`vx-theme-dark`))}static registerFunction(t,n){e.functions.set(t,n)}static getFunction(t){return e.functions.get(t)}}).init();var Q,$=class extends I{static{Q=this}constructor(...e){super(...e),this.library=null,this.name=``,this.button=!1}static{ut(`$system`,ft)}static{this.styles=l`
|
|
119
119
|
:host {
|
|
120
120
|
display: inline-block;
|
|
121
121
|
justify-content: center;
|
|
@@ -134,4 +134,4 @@ var VXComponents=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:
|
|
|
134
134
|
<path d="M4.978.855a.5.5 0 1 0-.956.29l.41 1.352A5 5 0 0 0 3 6h10a5 5 0 0 0-1.432-3.503l.41-1.352a.5.5 0 1 0-.956-.29l-.291.956A5 5 0 0 0 8 1a5 5 0 0 0-2.731.811l-.29-.956z"/>
|
|
135
135
|
<path d="M13 6v1H8.5v8.975A5 5 0 0 0 13 11h.5a.5.5 0 0 1 .5.5v.5a.5.5 0 1 0 1 0v-.5a1.5 1.5 0 0 0-1.5-1.5H13V9h1.5a.5.5 0 0 0 0-1H13V7h.5A1.5 1.5 0 0 0 15 5.5V5a.5.5 0 0 0-1 0v.5a.5.5 0 0 1-.5.5zm-5.5 9.975V7H3V6h-.5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 0-1 0v.5A1.5 1.5 0 0 0 2.5 7H3v1H1.5a.5.5 0 0 0 0 1H3v1h-.5A1.5 1.5 0 0 0 1 11.5v.5a.5.5 0 1 0 1 0v-.5a.5.5 0 0 1 .5-.5H3a5 5 0 0 0 4.5 4.975"/>
|
|
136
136
|
</svg>
|
|
137
|
-
`}render(){let e=this.name.split(`.`);if(e.length===1&&e.unshift(`default`),e.length===2){let[t,n]=e;if(this.library&&(t=this.library),Z(t)){let e=X(t);if(n in e)return e[n]}}return Q.notFoundIcon}};return z([R({type:String})],$.prototype,`library`,void 0),z([R({type:String})],$.prototype,`name`,void 0),z([R({type:Boolean})],$.prototype,`button`,void 0),$=Q=z([L(`vx-svg`)],$),
|
|
137
|
+
`}render(){let e=this.name.split(`.`);if(e.length===1&&e.unshift(`default`),e.length===2){let[t,n]=e;if(this.library&&(t=this.library),Z(t)){let e=X(t);if(n in e)return e[n]}}return Q.notFoundIcon}};return z([R({type:String})],$.prototype,`library`,void 0),z([R({type:String})],$.prototype,`name`,void 0),z([R({type:Boolean})],$.prototype,`button`,void 0),$=Q=z([L(`vx-svg`)],$),window.VXComponents=n({composedParent:()=>ct,composedPath:()=>J,getSvgLibrary:()=>X,hasSvgLibrary:()=>Z,html:()=>D,registerSvgLibrary:()=>ut,svg:()=>dt,systemIcons:()=>ft}),e.composedParent=ct,e.composedPath=J,e.getSvgLibrary=X,e.hasSvgLibrary=Z,e.html=D,e.registerSvgLibrary=ut,e.svg=dt,e.systemIcons=ft,e})({});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e, c as t, i as n, n as r, r as i } from "./lib-58XTUR_n.js";
|
|
2
2
|
import { LitElement as a, css as o, html as s, nothing as c } from "lit";
|
|
3
3
|
import { customElement as l, property as u, queryAssignedElements as d, queryAssignedNodes as f, state as p } from "lit/decorators.js";
|
|
4
4
|
import { classMap as m } from "lit/directives/class-map.js";
|
|
@@ -189,16 +189,16 @@ var x = class extends a {
|
|
|
189
189
|
this.currentURL = new URL(e.destination.url), e.canIntercept && (e.intercept(), this.activateMatchingRoute());
|
|
190
190
|
}
|
|
191
191
|
activateMatchingRoute() {
|
|
192
|
-
if (!
|
|
192
|
+
if (!t(this).filter((e) => e instanceof b).map((e) => e.active).concat(!0)[0]) {
|
|
193
193
|
this.routes.forEach((e) => {
|
|
194
194
|
e.active = !1;
|
|
195
195
|
});
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
|
-
let e =
|
|
199
|
-
|
|
200
|
-
let
|
|
201
|
-
for (let e of
|
|
198
|
+
let e = t(this).filter((e) => e instanceof b).map((e) => e.path).reverse().join(""), n = this.currentURL.pathname + (this.currentURL.hash || "");
|
|
199
|
+
n.startsWith(e) && (n = n.substring(e.length));
|
|
200
|
+
let r = this.reversed ? this.routes.toReversed() : this.routes, i = !1;
|
|
201
|
+
for (let e of r) i ? e.active = !1 : i = e.activateIfMatches(n);
|
|
202
202
|
}
|
|
203
203
|
render() {
|
|
204
204
|
return s`<slot></slot>`;
|
|
@@ -215,7 +215,7 @@ var S, C = class extends a {
|
|
|
215
215
|
super(...e), this.library = null, this.name = "", this.button = !1;
|
|
216
216
|
}
|
|
217
217
|
static {
|
|
218
|
-
e("$system",
|
|
218
|
+
e("$system", r);
|
|
219
219
|
}
|
|
220
220
|
static {
|
|
221
221
|
this.styles = o`
|
|
@@ -245,10 +245,10 @@ var S, C = class extends a {
|
|
|
245
245
|
render() {
|
|
246
246
|
let e = this.name.split(".");
|
|
247
247
|
if (e.length === 1 && e.unshift("default"), e.length === 2) {
|
|
248
|
-
let [
|
|
249
|
-
if (this.library && (
|
|
250
|
-
let e = t
|
|
251
|
-
if (
|
|
248
|
+
let [t, r] = e;
|
|
249
|
+
if (this.library && (t = this.library), n(t)) {
|
|
250
|
+
let e = i(t);
|
|
251
|
+
if (r in e) return e[r];
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
return S.notFoundIcon;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { html as e,
|
|
1
|
+
import { html as e, html as t, nothing as n } from "lit";
|
|
2
2
|
//#region src/lib/dom.ts
|
|
3
|
-
function
|
|
3
|
+
function r(e) {
|
|
4
4
|
if (!e) return null;
|
|
5
5
|
if (e.assignedSlot) return e.assignedSlot;
|
|
6
6
|
if (e.parentNode) return e.parentNode;
|
|
7
7
|
let t = e.getRootNode();
|
|
8
8
|
return t instanceof ShadowRoot ? t.host : null;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
let t = [],
|
|
12
|
-
for (;
|
|
10
|
+
function i(e) {
|
|
11
|
+
let t = [], n = e;
|
|
12
|
+
for (; n;) t.push(n), n = r(n);
|
|
13
13
|
return t;
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/lib/svg/svg-register.ts
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
function o(e) {
|
|
22
|
-
return i.get(e);
|
|
17
|
+
var a = /* @__PURE__ */ new Map();
|
|
18
|
+
function o(e, t) {
|
|
19
|
+
a.set(e, t);
|
|
23
20
|
}
|
|
24
21
|
function s(e) {
|
|
25
|
-
return
|
|
22
|
+
return a.get(e);
|
|
26
23
|
}
|
|
27
24
|
function c(e) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
return a.has(e);
|
|
26
|
+
}
|
|
27
|
+
function l(e) {
|
|
28
|
+
let t = e.split(".");
|
|
29
|
+
if (t.length === 1 && t.unshift("default"), t.length === 2) {
|
|
30
|
+
let [e, n] = t;
|
|
31
|
+
if (c(e)) {
|
|
32
|
+
let t = s(e);
|
|
33
|
+
if (n in t) return t[n];
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return n;
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/lib/svg/system-icons.ts
|
|
40
|
-
var
|
|
40
|
+
var u = {
|
|
41
41
|
favicon: e`
|
|
42
42
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
|
|
43
43
|
<rect width="512" height="512" style="fill: rgba(71, 87, 91, 0.300);"/>
|
|
@@ -78,5 +78,27 @@ var l = {
|
|
|
78
78
|
</svg>
|
|
79
79
|
`
|
|
80
80
|
};
|
|
81
|
+
(class e {
|
|
82
|
+
static {
|
|
83
|
+
this.functions = /* @__PURE__ */ new Map();
|
|
84
|
+
}
|
|
85
|
+
static init() {
|
|
86
|
+
e.loadTheme(), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
87
|
+
e.loadTheme();
|
|
88
|
+
}), window.addEventListener("storage", (t) => {
|
|
89
|
+
(t.key === "theme" || t.key === "themeColor") && e.loadTheme();
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
static loadTheme() {
|
|
93
|
+
let e = document.documentElement, t = localStorage.getItem("vx-theme") || "system";
|
|
94
|
+
t === "system" && (t = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), t === "dark" ? (e.classList.add("vx-theme-dark"), e.classList.remove("vx-theme-light")) : (e.classList.add("vx-theme-light"), e.classList.remove("vx-theme-dark"));
|
|
95
|
+
}
|
|
96
|
+
static registerFunction(t, n) {
|
|
97
|
+
e.functions.set(t, n);
|
|
98
|
+
}
|
|
99
|
+
static getFunction(t) {
|
|
100
|
+
return e.functions.get(t);
|
|
101
|
+
}
|
|
102
|
+
}).init();
|
|
81
103
|
//#endregion
|
|
82
|
-
export {
|
|
104
|
+
export { o as a, i as c, c as i, u as n, l as o, s as r, r as s, t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import "../chunks/components-
|
|
1
|
+
import "../chunks/components-DcQT86Uf.js";
|
package/dist/library/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import "./chunks/components-
|
|
2
|
-
export {
|
|
3
|
-
import "./chunks/lib-DrxW6cQY.js";
|
|
1
|
+
import "./chunks/components-DcQT86Uf.js";
|
|
2
|
+
export { s as composedParent, c as composedPath, r as getSvgLibrary, i as hasSvgLibrary, t as html, a as registerSvgLibrary, o as svg, n as systemIcons } from "./chunks/lib-58XTUR_n.js";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import "../chunks/lib-DrxW6cQY.js";
|
|
1
|
+
export { s as composedParent, c as composedPath, r as getSvgLibrary, i as hasSvgLibrary, t as html, a as registerSvgLibrary, o as svg, n as systemIcons } from "../chunks/lib-58XTUR_n.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpuska/vx-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/library/index.js",
|
|
6
6
|
"module": "./dist/library/index.js",
|
|
@@ -53,7 +53,9 @@
|
|
|
53
53
|
"version": "0.0.1",
|
|
54
54
|
"framework": "lit",
|
|
55
55
|
"description-markup": "markdown",
|
|
56
|
-
"formats": [
|
|
56
|
+
"formats": [
|
|
57
|
+
"es"
|
|
58
|
+
]
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import "./svg-YrZ3m-FZ.js";
|
|
2
|
-
(class e {
|
|
3
|
-
static {
|
|
4
|
-
this.functions = /* @__PURE__ */ new Map();
|
|
5
|
-
}
|
|
6
|
-
static init() {
|
|
7
|
-
e.loadTheme(), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
8
|
-
e.loadTheme();
|
|
9
|
-
}), window.addEventListener("storage", (t) => {
|
|
10
|
-
(t.key === "theme" || t.key === "themeColor") && e.loadTheme();
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
static loadTheme() {
|
|
14
|
-
let e = document.documentElement, t = localStorage.getItem("vx-theme") || "system";
|
|
15
|
-
t === "system" && (t = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), t === "dark" ? (e.classList.add("vx-theme-dark"), e.classList.remove("vx-theme-light")) : (e.classList.add("vx-theme-light"), e.classList.remove("vx-theme-dark"));
|
|
16
|
-
}
|
|
17
|
-
static registerFunction(t, n) {
|
|
18
|
-
e.functions.set(t, n);
|
|
19
|
-
}
|
|
20
|
-
static getFunction(t) {
|
|
21
|
-
return e.functions.get(t);
|
|
22
|
-
}
|
|
23
|
-
}).init();
|
|
24
|
-
//#endregion
|