@wsxjs/wsx-base-components 0.0.8 → 0.0.10
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/index.cjs +2 -2
- package/dist/index.js +1882 -935
- package/dist/style.css +1 -0
- package/package.json +4 -4
- package/src/TodoList.css +197 -0
- package/src/TodoList.wsx +264 -0
- package/src/TodoListLight.css +198 -0
- package/src/TodoListLight.wsx +263 -0
- package/src/UserProfile.css +146 -0
- package/src/UserProfile.wsx +247 -0
- package/src/UserProfileLight.css +146 -0
- package/src/UserProfileLight.wsx +256 -0
- package/src/index.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
import { autoRegister as
|
|
2
|
-
const
|
|
3
|
-
var
|
|
4
|
-
let
|
|
5
|
-
function
|
|
6
|
-
return (
|
|
7
|
-
}
|
|
8
|
-
function
|
|
9
|
-
function
|
|
10
|
-
return function(
|
|
11
|
-
return
|
|
1
|
+
import { autoRegister as re, WebComponent as X, jsx as n, createLogger as ne, LightComponent as he } from "@wsxjs/wsx-core";
|
|
2
|
+
const _t = ':host{position:relative;display:inline-flex;padding:.25em .625em;box-sizing:border-box;vertical-align:middle;line-height:1.8;overflow:hidden;align-items:center;justify-content:center;font-size:14px;color:var(--fontColor, #333);border-radius:var(--borderRadius, .25em);background:var(--fontColor, #333);transition:background .3s,box-shadow .3s,border-color .3s,color .3s}:host([size="xxxs"]){padding:.03125em .0625em;font-size:6px;line-height:1;min-width:10px;min-height:8px;border-radius:1px}:host([size="xxs"]){padding:.0625em .125em;font-size:8px;line-height:1.1;min-width:14px;min-height:12px;border-radius:2px}:host([size="xs"]){padding:.125em .25em;font-size:10px;line-height:1.2;min-width:18px;min-height:16px;border-radius:3px}:host([size="sm"]){padding:.25em .5em;font-size:12px;line-height:1.4;min-width:24px;min-height:20px;border-radius:4px}:host([size="md"]){padding:.375em .75em;font-size:14px;line-height:1.5;min-width:32px;min-height:28px;border-radius:6px}:host([size="lg"]){padding:.5em 1em;font-size:14px;line-height:1.6;min-width:40px;min-height:32px;border-radius:6px}:host([size="xl"]){padding:.625em 1.25em;font-size:16px;line-height:1.6;min-width:48px;min-height:40px;border-radius:8px}:host([shape="circle"]){border-radius:50%}:host([disabled]),:host([loading]){pointer-events:none;opacity:.6}:host([block]){display:flex}:host([disabled]:not([variant])){background:#0000001a}:host([disabled]) .btn,:host([loading]) .btn{cursor:not-allowed;pointer-events:all}:host(:not([variant="primary"]):not([variant="danger"]):not([disabled]):hover),:host(:not([variant="primary"]):not([variant="danger"]):focus-within),:host([variant="flat"][focus]){color:var(--themeColor, #42b983);border-color:var(--themeColor, #42b983)}:host(:not([variant="primary"]):not([variant="danger"])) .btn:after{background-image:radial-gradient(circle,var(--themeColor, #42b983) 10%,transparent 10.01%)}:host([variant="primary"]){color:#fff;background:var(--themeBackground, var(--themeColor, #42b983))}:host([variant="danger"]){color:#fff;background:var(--themeBackground, var(--dangerColor, #ff7875))}:host([variant="dashed"]){border-style:dashed}:host([variant="flat"]),:host([variant="primary"]),:host([variant="danger"]){border:0;padding:calc(.25em + 1px) calc(.625em + 1px)}:host([variant="flat"]) .btn:before{content:"";position:absolute;background:var(--themeColor, #42b983);pointer-events:none;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}:host([variant="flat"]:not([disabled]):hover) .btn:before{opacity:.1}:host(:not([disabled]):hover){z-index:1}:host([variant="flat"]:focus-within) .btn:before,:host([variant="flat"][focus]) .btn:before{opacity:.2}.btn{background:none;outline:0;border:0;position:absolute;left:0;top:0;width:100%;height:100%;padding:0;-webkit-user-select:none;user-select:none;cursor:unset}.loading{margin-right:.35em}::-moz-focus-inner{border:0}.btn:before{content:"";display:block;position:absolute;width:100%;height:100%;left:0;top:0;transition:.2s;background:#fff;opacity:0}:host(:not([disabled]):active) .btn:before{opacity:.2}.btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--x, 0);top:var(--y, 0);pointer-events:none;background-image:radial-gradient(circle,#fff 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}.btn:not([disabled]):active:after{transform:translate(-50%,-50%) scale(0);opacity:.3;transition:0s}.icon{margin-right:.35em;transition:none}:host(:empty) .icon{margin:auto}:host(:empty){padding:.65em}:host([type="flat"]:empty),:host([type="primary"]:empty){padding:calc(.65em + 1px)}::slotted(.icon){transition:none}:host([href]){cursor:pointer}';
|
|
3
|
+
var De;
|
|
4
|
+
let $e, Oe;
|
|
5
|
+
function q(t, e, r) {
|
|
6
|
+
return (e = Pe(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
7
|
+
}
|
|
8
|
+
function Et(t, e, r, g, S, A) {
|
|
9
|
+
function T(o, l, u) {
|
|
10
|
+
return function(s, a) {
|
|
11
|
+
return u && u(s), o[l].call(s, a);
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
for (var
|
|
16
|
-
return
|
|
14
|
+
function B(o, l) {
|
|
15
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
16
|
+
return l;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
if (typeof o != "function" && (
|
|
18
|
+
function _(o, l, u, s) {
|
|
19
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
20
20
|
return o;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
function v(
|
|
24
|
-
if (!p(
|
|
22
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
23
|
+
function v(c) {
|
|
24
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
if (!
|
|
28
|
-
|
|
29
|
-
var i = {}, C = [], m =
|
|
30
|
-
y ? (
|
|
26
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
27
|
+
if (!z) {
|
|
28
|
+
u || Array.isArray(x) || (x = [x]);
|
|
29
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
30
|
+
y ? (b || f ? i = { get: ve(function() {
|
|
31
31
|
return k(this);
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
} } : i[m] = k,
|
|
35
|
-
}
|
|
36
|
-
for (var h = o, I = x.length - 1; I >= 0; I -=
|
|
37
|
-
var
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
}).bind(null,
|
|
32
|
+
}, s, "get"), set: function(c) {
|
|
33
|
+
l[4](this, c);
|
|
34
|
+
} } : i[m] = k, b || ve(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
35
|
+
}
|
|
36
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
37
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
38
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
39
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
40
|
+
}).bind(null, J) };
|
|
41
41
|
try {
|
|
42
|
-
if (
|
|
42
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
43
43
|
else {
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
return v(
|
|
47
|
-
} : (
|
|
48
|
-
return
|
|
49
|
-
}, (
|
|
50
|
-
|
|
44
|
+
var $, R;
|
|
45
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
46
|
+
return v(c), i.value;
|
|
47
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
48
|
+
return c[s];
|
|
49
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
50
|
+
c[s] = w;
|
|
51
51
|
}));
|
|
52
|
-
var
|
|
53
|
-
return
|
|
52
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
53
|
+
return s in c;
|
|
54
54
|
} };
|
|
55
|
-
if (
|
|
56
|
-
if (typeof h == "object" && h) (
|
|
55
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
56
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
57
57
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
58
|
-
} else
|
|
58
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
59
59
|
}
|
|
60
60
|
} finally {
|
|
61
|
-
|
|
61
|
+
J.v = !0;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
return (
|
|
65
|
-
for (var
|
|
64
|
+
return (b || f) && E.push(function(c, w) {
|
|
65
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
66
66
|
return w;
|
|
67
|
-
}),
|
|
67
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value:
|
|
69
|
+
function U(o, l) {
|
|
70
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
71
71
|
}
|
|
72
|
-
if (arguments.length >= 6) var
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
return
|
|
76
|
-
},
|
|
72
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
73
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
74
|
+
var a, j, L = [], E = function(m) {
|
|
75
|
+
return At(m) === o;
|
|
76
|
+
}, P = /* @__PURE__ */ new Map();
|
|
77
77
|
function y(m) {
|
|
78
|
-
m &&
|
|
78
|
+
m && L.push(B.bind(null, m));
|
|
79
79
|
}
|
|
80
|
-
for (var
|
|
81
|
-
var f =
|
|
80
|
+
for (var b = 0; b < l.length; b++) {
|
|
81
|
+
var f = l[b];
|
|
82
82
|
if (Array.isArray(f)) {
|
|
83
|
-
var p = f[1], v = f[2],
|
|
84
|
-
if (!
|
|
85
|
-
var C =
|
|
83
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
84
|
+
if (!z && !d) {
|
|
85
|
+
var C = P.get(i);
|
|
86
86
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
87
|
-
|
|
87
|
+
P.set(i, !(p > 2) || p);
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : Pe(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
return y(
|
|
93
|
-
}(
|
|
94
|
-
return r.length ||
|
|
92
|
+
return y(a), y(j), L;
|
|
93
|
+
}(t, e, S, O);
|
|
94
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
95
95
|
var o = [];
|
|
96
|
-
return r.length && [
|
|
96
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
97
97
|
} };
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
var
|
|
101
|
-
return typeof
|
|
99
|
+
function Pe(t) {
|
|
100
|
+
var e = zt(t, "string");
|
|
101
|
+
return typeof e == "symbol" ? e : e + "";
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
if (typeof
|
|
105
|
-
var r =
|
|
103
|
+
function zt(t, e) {
|
|
104
|
+
if (typeof t != "object" || !t) return t;
|
|
105
|
+
var r = t[Symbol.toPrimitive];
|
|
106
106
|
if (r !== void 0) {
|
|
107
|
-
var
|
|
108
|
-
if (typeof
|
|
107
|
+
var g = r.call(t, e);
|
|
108
|
+
if (typeof g != "object") return g;
|
|
109
109
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
110
110
|
}
|
|
111
|
-
return String(
|
|
111
|
+
return String(t);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
typeof
|
|
113
|
+
function ve(t, e, r) {
|
|
114
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
115
115
|
try {
|
|
116
|
-
Object.defineProperty(
|
|
116
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
117
117
|
} catch {
|
|
118
118
|
}
|
|
119
|
-
return
|
|
119
|
+
return t;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
if (Object(
|
|
123
|
-
return
|
|
121
|
+
function At(t) {
|
|
122
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
123
|
+
return t;
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
Oe = [re({
|
|
126
126
|
tagName: "xy-button"
|
|
127
127
|
})];
|
|
128
|
-
let
|
|
129
|
-
class
|
|
128
|
+
let jt;
|
|
129
|
+
class Lt extends X {
|
|
130
130
|
static get observedAttributes() {
|
|
131
131
|
return ["disabled", "icon", "loading", "href", "type", "target", "rel", "download", "toggle", "checked", "variant", "shape", "block", "size"];
|
|
132
132
|
}
|
|
133
|
-
constructor(
|
|
133
|
+
constructor(e = {}) {
|
|
134
134
|
super({
|
|
135
135
|
styleName: "xy-button",
|
|
136
|
-
...
|
|
137
|
-
}),
|
|
136
|
+
...e
|
|
137
|
+
}), q(this, "_autoStyles", _t), q(this, "disabled", !1), q(this, "loading", !1), q(this, "toggle", !1), q(this, "checked", !1), q(this, "icon", null), q(this, "href", null), q(this, "type", null), q(this, "target", "_blank"), q(this, "rel", null), q(this, "download", null), q(this, "variant", "flat"), q(this, "size", "md"), q(this, "btnElement", void 0), q(this, "iconElement", void 0), q(this, "loadingElement", void 0), q(this, "handleMouseDown", (r) => {
|
|
138
138
|
if (this.disabled) return;
|
|
139
|
-
const
|
|
140
|
-
this.style.setProperty("--x", `${
|
|
141
|
-
}),
|
|
139
|
+
const g = this.getBoundingClientRect(), S = r.clientX - g.left, A = r.clientY - g.top;
|
|
140
|
+
this.style.setProperty("--x", `${S}px`), this.style.setProperty("--y", `${A}px`);
|
|
141
|
+
}), q(this, "handleKeyDown", (r) => {
|
|
142
142
|
(r.code === "Enter" || r.code === "Space") && r.stopPropagation();
|
|
143
|
-
}),
|
|
143
|
+
}), q(this, "handleClick", () => {
|
|
144
144
|
this.toggle && !this.disabled && (this.checked = !this.checked, this.checked ? this.setAttr("checked", "") : this.removeAttr("checked"));
|
|
145
|
-
}), this.disabled =
|
|
145
|
+
}), this.disabled = e.disabled || !1, this.loading = e.loading || !1, this.toggle = e.toggle || !1, this.checked = e.checked || !1, this.icon = e.icon || null, this.href = e.href || null, this.type = e.type || null, this.target = e.target || "_blank", this.rel = e.rel || null, this.download = e.download || null, this.variant = e.variant || "flat", this.size = e.size || "md";
|
|
146
146
|
}
|
|
147
147
|
render() {
|
|
148
|
-
const
|
|
149
|
-
this.btnElement =
|
|
150
|
-
} }, this.renderContent()),
|
|
151
|
-
this.btnElement =
|
|
152
|
-
} }, this.renderContent());
|
|
153
|
-
return /* @__PURE__ */
|
|
148
|
+
const e = !!this.href, r = /* @__PURE__ */ n("a", { href: this.href, target: this.target, rel: this.rel || void 0, download: this.download || void 0, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (S) => {
|
|
149
|
+
this.btnElement = S;
|
|
150
|
+
} }, this.renderContent()), g = /* @__PURE__ */ n("button", { type: this.type || "button", disabled: this.disabled, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (S) => {
|
|
151
|
+
this.btnElement = S;
|
|
152
|
+
}, "data-wsx-key": "XyButton-button-text-0" }, this.renderContent());
|
|
153
|
+
return /* @__PURE__ */ n("div", { className: "xy-button-container" }, e ? r : g);
|
|
154
154
|
}
|
|
155
155
|
renderContent() {
|
|
156
|
-
const
|
|
157
|
-
return this.loading &&
|
|
156
|
+
const e = [];
|
|
157
|
+
return this.loading && e.push(/* @__PURE__ */ n("div", { className: "loading", ref: (r) => {
|
|
158
158
|
this.loadingElement = r;
|
|
159
|
-
} }, "Loading...")), !this.loading && this.icon && this.icon !== "null" &&
|
|
159
|
+
} }, "Loading...")), !this.loading && this.icon && this.icon !== "null" && e.push(/* @__PURE__ */ n("div", { className: "icon", "data-icon": this.icon, ref: (r) => {
|
|
160
160
|
this.iconElement = r;
|
|
161
|
-
} }, this.icon)),
|
|
161
|
+
} }, this.icon)), e.push(/* @__PURE__ */ n("slot", null)), e;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* 组件连接到DOM后的初始化
|
|
@@ -175,43 +175,43 @@ class re extends J {
|
|
|
175
175
|
/**
|
|
176
176
|
* 属性变化处理
|
|
177
177
|
*/
|
|
178
|
-
onAttributeChanged(
|
|
179
|
-
switch (
|
|
178
|
+
onAttributeChanged(e, r, g) {
|
|
179
|
+
switch (e) {
|
|
180
180
|
case "disabled":
|
|
181
|
-
this.disabled =
|
|
181
|
+
this.disabled = g !== null, this.updateButtonState();
|
|
182
182
|
break;
|
|
183
183
|
case "loading":
|
|
184
|
-
this.loading =
|
|
184
|
+
this.loading = g !== null, this.updateButtonState(), this.rerender();
|
|
185
185
|
break;
|
|
186
186
|
case "icon":
|
|
187
|
-
this.icon =
|
|
187
|
+
this.icon = g, this.rerender();
|
|
188
188
|
break;
|
|
189
189
|
case "href":
|
|
190
|
-
this.href =
|
|
190
|
+
this.href = g, this.rerender();
|
|
191
191
|
break;
|
|
192
192
|
case "type":
|
|
193
|
-
this.type =
|
|
193
|
+
this.type = g, this.updateButtonState();
|
|
194
194
|
break;
|
|
195
195
|
case "target":
|
|
196
|
-
this.target =
|
|
196
|
+
this.target = g || "_blank";
|
|
197
197
|
break;
|
|
198
198
|
case "rel":
|
|
199
|
-
this.rel =
|
|
199
|
+
this.rel = g;
|
|
200
200
|
break;
|
|
201
201
|
case "download":
|
|
202
|
-
this.download =
|
|
202
|
+
this.download = g;
|
|
203
203
|
break;
|
|
204
204
|
case "toggle":
|
|
205
|
-
this.toggle =
|
|
205
|
+
this.toggle = g !== null;
|
|
206
206
|
break;
|
|
207
207
|
case "checked":
|
|
208
|
-
this.checked =
|
|
208
|
+
this.checked = g !== null;
|
|
209
209
|
break;
|
|
210
210
|
case "variant":
|
|
211
|
-
this.variant =
|
|
211
|
+
this.variant = g || "flat";
|
|
212
212
|
break;
|
|
213
213
|
case "size":
|
|
214
|
-
this.size =
|
|
214
|
+
this.size = g || "md";
|
|
215
215
|
break;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
@@ -225,8 +225,8 @@ class re extends J {
|
|
|
225
225
|
* 公共API:聚焦按钮
|
|
226
226
|
*/
|
|
227
227
|
focus() {
|
|
228
|
-
var
|
|
229
|
-
(
|
|
228
|
+
var e;
|
|
229
|
+
(e = this.btnElement) == null || e.focus();
|
|
230
230
|
}
|
|
231
231
|
/**
|
|
232
232
|
* 公共API:获取/设置属性
|
|
@@ -234,178 +234,178 @@ class re extends J {
|
|
|
234
234
|
get isDisabled() {
|
|
235
235
|
return this.disabled;
|
|
236
236
|
}
|
|
237
|
-
set isDisabled(
|
|
238
|
-
|
|
237
|
+
set isDisabled(e) {
|
|
238
|
+
e ? this.setAttr("disabled", "") : this.removeAttr("disabled");
|
|
239
239
|
}
|
|
240
240
|
get isLoading() {
|
|
241
241
|
return this.loading;
|
|
242
242
|
}
|
|
243
|
-
set isLoading(
|
|
244
|
-
|
|
243
|
+
set isLoading(e) {
|
|
244
|
+
e ? this.setAttr("loading", "") : this.removeAttr("loading");
|
|
245
245
|
}
|
|
246
246
|
get isChecked() {
|
|
247
247
|
return this.checked;
|
|
248
248
|
}
|
|
249
|
-
set isChecked(
|
|
250
|
-
|
|
249
|
+
set isChecked(e) {
|
|
250
|
+
e ? this.setAttr("checked", "") : this.removeAttr("checked");
|
|
251
251
|
}
|
|
252
252
|
get buttonIcon() {
|
|
253
253
|
return this.icon;
|
|
254
254
|
}
|
|
255
|
-
set buttonIcon(
|
|
256
|
-
|
|
255
|
+
set buttonIcon(e) {
|
|
256
|
+
e ? this.setAttr("icon", e) : this.removeAttr("icon");
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
-
|
|
260
|
-
[
|
|
261
|
-
|
|
262
|
-
const
|
|
263
|
-
var
|
|
264
|
-
let
|
|
265
|
-
function
|
|
266
|
-
return (
|
|
259
|
+
De = Lt;
|
|
260
|
+
[jt, $e] = Et(De, [], Oe, 0, void 0, X).c;
|
|
261
|
+
$e();
|
|
262
|
+
const Dt = ':host{display:inline-flex}::slotted(xy-button:not(:first-of-type):not(:last-of-type)){border-radius:0}::slotted(xy-button){margin:0!important}::slotted(xy-button:not(:first-of-type)){margin-left:-1px!important}::slotted(xy-button[type]:not([type="dashed"]):not(:first-of-type)){margin-left:1px!important}::slotted(xy-button:first-of-type){border-top-right-radius:0;border-bottom-right-radius:0}::slotted(xy-button:last-of-type){border-top-left-radius:0;border-bottom-left-radius:0}';
|
|
263
|
+
var Ie;
|
|
264
|
+
let Re, Be;
|
|
265
|
+
function xe(t, e, r) {
|
|
266
|
+
return (e = Ne(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
function
|
|
270
|
-
return function(
|
|
271
|
-
return
|
|
268
|
+
function $t(t, e, r, g, S, A) {
|
|
269
|
+
function T(o, l, u) {
|
|
270
|
+
return function(s, a) {
|
|
271
|
+
return u && u(s), o[l].call(s, a);
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
for (var
|
|
276
|
-
return
|
|
274
|
+
function B(o, l) {
|
|
275
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
276
|
+
return l;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
if (typeof o != "function" && (
|
|
278
|
+
function _(o, l, u, s) {
|
|
279
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
280
280
|
return o;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
function v(
|
|
284
|
-
if (!p(
|
|
282
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
283
|
+
function v(c) {
|
|
284
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
285
285
|
}
|
|
286
|
-
var
|
|
287
|
-
if (!
|
|
288
|
-
|
|
289
|
-
var i = {}, C = [], m =
|
|
290
|
-
y ? (
|
|
286
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
287
|
+
if (!z) {
|
|
288
|
+
u || Array.isArray(x) || (x = [x]);
|
|
289
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
290
|
+
y ? (b || f ? i = { get: ke(function() {
|
|
291
291
|
return k(this);
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
} } : i[m] = k,
|
|
295
|
-
}
|
|
296
|
-
for (var h = o, I = x.length - 1; I >= 0; I -=
|
|
297
|
-
var
|
|
298
|
-
if (
|
|
299
|
-
|
|
300
|
-
}).bind(null,
|
|
292
|
+
}, s, "get"), set: function(c) {
|
|
293
|
+
l[4](this, c);
|
|
294
|
+
} } : i[m] = k, b || ke(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
295
|
+
}
|
|
296
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
297
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
298
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
299
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
300
|
+
}).bind(null, J) };
|
|
301
301
|
try {
|
|
302
|
-
if (
|
|
302
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
303
303
|
else {
|
|
304
|
-
var
|
|
305
|
-
|
|
306
|
-
return v(
|
|
307
|
-
} : (
|
|
308
|
-
return
|
|
309
|
-
}, (
|
|
310
|
-
|
|
304
|
+
var $, R;
|
|
305
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
306
|
+
return v(c), i.value;
|
|
307
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
308
|
+
return c[s];
|
|
309
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
310
|
+
c[s] = w;
|
|
311
311
|
}));
|
|
312
|
-
var
|
|
313
|
-
return
|
|
312
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
313
|
+
return s in c;
|
|
314
314
|
} };
|
|
315
|
-
if (
|
|
316
|
-
if (typeof h == "object" && h) (
|
|
315
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
316
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
317
317
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
318
|
-
} else
|
|
318
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
319
319
|
}
|
|
320
320
|
} finally {
|
|
321
|
-
|
|
321
|
+
J.v = !0;
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
return (
|
|
325
|
-
for (var
|
|
324
|
+
return (b || f) && E.push(function(c, w) {
|
|
325
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
326
326
|
return w;
|
|
327
|
-
}),
|
|
327
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value:
|
|
329
|
+
function U(o, l) {
|
|
330
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
331
331
|
}
|
|
332
|
-
if (arguments.length >= 6) var
|
|
333
|
-
var
|
|
334
|
-
var
|
|
335
|
-
return
|
|
336
|
-
},
|
|
332
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
333
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
334
|
+
var a, j, L = [], E = function(m) {
|
|
335
|
+
return Pt(m) === o;
|
|
336
|
+
}, P = /* @__PURE__ */ new Map();
|
|
337
337
|
function y(m) {
|
|
338
|
-
m &&
|
|
338
|
+
m && L.push(B.bind(null, m));
|
|
339
339
|
}
|
|
340
|
-
for (var
|
|
341
|
-
var f =
|
|
340
|
+
for (var b = 0; b < l.length; b++) {
|
|
341
|
+
var f = l[b];
|
|
342
342
|
if (Array.isArray(f)) {
|
|
343
|
-
var p = f[1], v = f[2],
|
|
344
|
-
if (!
|
|
345
|
-
var C =
|
|
343
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
344
|
+
if (!z && !d) {
|
|
345
|
+
var C = P.get(i);
|
|
346
346
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
347
|
-
|
|
347
|
+
P.set(i, !(p > 2) || p);
|
|
348
348
|
}
|
|
349
|
-
|
|
349
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : Ne(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
return y(
|
|
353
|
-
}(
|
|
354
|
-
return r.length ||
|
|
352
|
+
return y(a), y(j), L;
|
|
353
|
+
}(t, e, S, O);
|
|
354
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
355
355
|
var o = [];
|
|
356
|
-
return r.length && [
|
|
356
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
357
357
|
} };
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
var
|
|
361
|
-
return typeof
|
|
359
|
+
function Ne(t) {
|
|
360
|
+
var e = Ot(t, "string");
|
|
361
|
+
return typeof e == "symbol" ? e : e + "";
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
if (typeof
|
|
365
|
-
var r =
|
|
363
|
+
function Ot(t, e) {
|
|
364
|
+
if (typeof t != "object" || !t) return t;
|
|
365
|
+
var r = t[Symbol.toPrimitive];
|
|
366
366
|
if (r !== void 0) {
|
|
367
|
-
var
|
|
368
|
-
if (typeof
|
|
367
|
+
var g = r.call(t, e);
|
|
368
|
+
if (typeof g != "object") return g;
|
|
369
369
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
370
370
|
}
|
|
371
|
-
return String(
|
|
371
|
+
return String(t);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
typeof
|
|
373
|
+
function ke(t, e, r) {
|
|
374
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
375
375
|
try {
|
|
376
|
-
Object.defineProperty(
|
|
376
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
377
377
|
} catch {
|
|
378
378
|
}
|
|
379
|
-
return
|
|
379
|
+
return t;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
if (Object(
|
|
383
|
-
return
|
|
381
|
+
function Pt(t) {
|
|
382
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
383
|
+
return t;
|
|
384
384
|
}
|
|
385
|
-
|
|
385
|
+
Be = [re({
|
|
386
386
|
tagName: "xy-button-group"
|
|
387
387
|
})];
|
|
388
|
-
let
|
|
389
|
-
class
|
|
388
|
+
let It;
|
|
389
|
+
class Rt extends X {
|
|
390
390
|
static get observedAttributes() {
|
|
391
391
|
return ["disabled"];
|
|
392
392
|
}
|
|
393
|
-
constructor(
|
|
393
|
+
constructor(e = {}) {
|
|
394
394
|
super({
|
|
395
395
|
styleName: "xy-button-group",
|
|
396
|
-
...
|
|
397
|
-
}),
|
|
396
|
+
...e
|
|
397
|
+
}), xe(this, "_autoStyles", Dt), xe(this, "disabled", !1), this.disabled = e.disabled || !1;
|
|
398
398
|
}
|
|
399
399
|
render() {
|
|
400
|
-
return /* @__PURE__ */
|
|
400
|
+
return /* @__PURE__ */ n("div", { class: "button-group-container" }, /* @__PURE__ */ n("slot", null));
|
|
401
401
|
}
|
|
402
402
|
/**
|
|
403
403
|
* 属性变化处理
|
|
404
404
|
*/
|
|
405
|
-
onAttributeChanged(
|
|
406
|
-
switch (
|
|
405
|
+
onAttributeChanged(e, r, g) {
|
|
406
|
+
switch (e) {
|
|
407
407
|
case "disabled":
|
|
408
|
-
this.disabled =
|
|
408
|
+
this.disabled = g !== null, this.updateChildrenDisabledState();
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
@@ -430,8 +430,8 @@ class le extends J {
|
|
|
430
430
|
get isDisabled() {
|
|
431
431
|
return this.disabled;
|
|
432
432
|
}
|
|
433
|
-
set isDisabled(
|
|
434
|
-
|
|
433
|
+
set isDisabled(e) {
|
|
434
|
+
e ? this.setAttr("disabled", "") : this.removeAttr("disabled");
|
|
435
435
|
}
|
|
436
436
|
/**
|
|
437
437
|
* 公共API:获取组内的所有按钮
|
|
@@ -456,201 +456,201 @@ class le extends J {
|
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
|
|
460
|
-
[
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
function
|
|
464
|
-
return
|
|
459
|
+
Ie = Rt;
|
|
460
|
+
[It, Re] = $t(Ie, [], Be, 0, void 0, X).c;
|
|
461
|
+
Re();
|
|
462
|
+
const fe = "editor-js-text-color-cache";
|
|
463
|
+
function Bt(t) {
|
|
464
|
+
return t.startsWith("var(") && t.endsWith(")");
|
|
465
465
|
}
|
|
466
|
-
function
|
|
467
|
-
return
|
|
466
|
+
function Nt(t) {
|
|
467
|
+
return t.slice(4, -1).trim();
|
|
468
468
|
}
|
|
469
|
-
function
|
|
470
|
-
return getComputedStyle(document.documentElement).getPropertyValue(
|
|
469
|
+
function Mt(t) {
|
|
470
|
+
return getComputedStyle(document.documentElement).getPropertyValue(t).trim() || t;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
if (
|
|
474
|
-
const
|
|
475
|
-
return
|
|
472
|
+
function ue(t) {
|
|
473
|
+
if (Bt(t)) {
|
|
474
|
+
const e = Nt(t);
|
|
475
|
+
return Mt(e);
|
|
476
476
|
}
|
|
477
|
-
return
|
|
477
|
+
return t;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
480
|
-
return sessionStorage.setItem(`${
|
|
479
|
+
function Ut(t, e) {
|
|
480
|
+
return sessionStorage.setItem(`${fe}-${e}`, JSON.stringify(t)), t;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
483
|
-
sessionStorage.setItem(`${
|
|
482
|
+
function Ht(t, e) {
|
|
483
|
+
sessionStorage.setItem(`${fe}-${e}-custom`, JSON.stringify(t));
|
|
484
484
|
}
|
|
485
|
-
function
|
|
486
|
-
const
|
|
487
|
-
return
|
|
485
|
+
function Ft(t) {
|
|
486
|
+
const e = sessionStorage.getItem(`${fe}-${t}-custom`);
|
|
487
|
+
return e ? JSON.parse(e) : null;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Kt(t, e) {
|
|
490
490
|
let r = null;
|
|
491
|
-
return (...
|
|
491
|
+
return (...g) => {
|
|
492
492
|
r || (r = setTimeout(() => {
|
|
493
|
-
|
|
494
|
-
},
|
|
493
|
+
t(...g), r = null;
|
|
494
|
+
}, e));
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
const r = sessionStorage.getItem(`${
|
|
499
|
-
return r ? JSON.parse(r) :
|
|
497
|
+
function Qr(t, e) {
|
|
498
|
+
const r = sessionStorage.getItem(`${fe}-${e}`);
|
|
499
|
+
return r ? JSON.parse(r) : t;
|
|
500
500
|
}
|
|
501
|
-
const
|
|
502
|
-
var
|
|
503
|
-
let
|
|
504
|
-
function
|
|
505
|
-
return (
|
|
501
|
+
const Zr = "ce-inline-toolbar__dropdown", Vr = "ce-conversion-toolbar--showed", Jt = '.color-section{display:inline-block;position:relative}.color-popover{display:inline-block;position:relative;overflow:visible}.color-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:1px solid #e1e5e9;border-radius:3px;background:var(--theme-color, #000);color:transparent;cursor:pointer;transition:all .2s ease;box-sizing:border-box}.color-btn:hover:not(.disabled){border-color:#3f51b5;box-shadow:0 2px 8px #3f51b54d}.color-btn.disabled{opacity:.5;cursor:not-allowed}.color-indicator{font-size:12px;line-height:1;-webkit-user-select:none;user-select:none}.color-panel{position:absolute;top:100%;left:0;z-index:10000;background:#fff;border:1px solid #e1e5e9;border-radius:6px;box-shadow:0 4px 20px #00000026;padding:8px;margin-top:4px;box-sizing:border-box;transform-origin:top left;animation:colorPanelShow .2s ease-out}@keyframes colorPanelShow{0%{opacity:0;transform:scale(.9) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.color-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;min-width:160px}.color-cube{width:20px;height:20px;border:1px solid #e1e5e9;border-radius:3px;cursor:pointer;transition:all .2s ease;box-sizing:border-box;background-color:var(--cube-color, #000)}.color-cube:hover{border-color:#3f51b5;transform:scale(1.1);box-shadow:0 2px 8px #3f51b566;z-index:1}.color-cube:active{transform:scale(.95)}.color-cube.custom-picker{background:linear-gradient(45deg,red,#ff8000,#ff0,#80ff00 42%,#0f0 57%,#00ff80,#0ff 85%,#0080ff);position:relative}.color-cube.custom-picker:after{content:"+";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:12px;font-weight:700;text-shadow:0 0 2px rgba(0,0,0,.8);pointer-events:none}:host([disabled]) .color-btn{opacity:.5;cursor:not-allowed}:host([open]) .color-panel{display:block}:host(:not([open])) .color-panel{display:none}@media (max-width: 768px){.color-panel{position:fixed;top:auto;left:50%;bottom:10px;transform:translate(-50%);width:90vw;max-width:300px}.color-grid{grid-template-columns:repeat(8,1fr);gap:6px}.color-cube{width:24px;height:24px}}@media (prefers-color-scheme: dark){.color-panel{background:#2d2d2d;border-color:#404040;color:#fff}.color-btn,.color-cube{border-color:#404040}}';
|
|
502
|
+
var Me;
|
|
503
|
+
let Ue, He;
|
|
504
|
+
function Y(t, e, r) {
|
|
505
|
+
return (e = Fe(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
function
|
|
509
|
-
return function(
|
|
510
|
-
return
|
|
507
|
+
function Wt(t, e, r, g, S, A) {
|
|
508
|
+
function T(o, l, u) {
|
|
509
|
+
return function(s, a) {
|
|
510
|
+
return u && u(s), o[l].call(s, a);
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
for (var
|
|
515
|
-
return
|
|
513
|
+
function B(o, l) {
|
|
514
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
515
|
+
return l;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
if (typeof o != "function" && (
|
|
517
|
+
function _(o, l, u, s) {
|
|
518
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
519
519
|
return o;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
function v(
|
|
523
|
-
if (!p(
|
|
521
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
522
|
+
function v(c) {
|
|
523
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
524
524
|
}
|
|
525
|
-
var
|
|
526
|
-
if (!
|
|
527
|
-
|
|
528
|
-
var i = {}, C = [], m =
|
|
529
|
-
y ? (
|
|
525
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
526
|
+
if (!z) {
|
|
527
|
+
u || Array.isArray(x) || (x = [x]);
|
|
528
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
529
|
+
y ? (b || f ? i = { get: Ce(function() {
|
|
530
530
|
return k(this);
|
|
531
|
-
},
|
|
532
|
-
|
|
533
|
-
} } : i[m] = k,
|
|
534
|
-
}
|
|
535
|
-
for (var h = o, I = x.length - 1; I >= 0; I -=
|
|
536
|
-
var
|
|
537
|
-
if (
|
|
538
|
-
|
|
539
|
-
}).bind(null,
|
|
531
|
+
}, s, "get"), set: function(c) {
|
|
532
|
+
l[4](this, c);
|
|
533
|
+
} } : i[m] = k, b || Ce(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
534
|
+
}
|
|
535
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
536
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
537
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
538
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
539
|
+
}).bind(null, J) };
|
|
540
540
|
try {
|
|
541
|
-
if (
|
|
541
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
542
542
|
else {
|
|
543
|
-
var
|
|
544
|
-
|
|
545
|
-
return v(
|
|
546
|
-
} : (
|
|
547
|
-
return
|
|
548
|
-
}, (
|
|
549
|
-
|
|
543
|
+
var $, R;
|
|
544
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
545
|
+
return v(c), i.value;
|
|
546
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
547
|
+
return c[s];
|
|
548
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
549
|
+
c[s] = w;
|
|
550
550
|
}));
|
|
551
|
-
var
|
|
552
|
-
return
|
|
551
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
552
|
+
return s in c;
|
|
553
553
|
} };
|
|
554
|
-
if (
|
|
555
|
-
if (typeof h == "object" && h) (
|
|
554
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
555
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
556
556
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
557
|
-
} else
|
|
557
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
558
558
|
}
|
|
559
559
|
} finally {
|
|
560
|
-
|
|
560
|
+
J.v = !0;
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
return (
|
|
564
|
-
for (var
|
|
563
|
+
return (b || f) && E.push(function(c, w) {
|
|
564
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
565
565
|
return w;
|
|
566
|
-
}),
|
|
566
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value:
|
|
568
|
+
function U(o, l) {
|
|
569
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
570
570
|
}
|
|
571
|
-
if (arguments.length >= 6) var
|
|
572
|
-
var
|
|
573
|
-
var
|
|
574
|
-
return
|
|
575
|
-
},
|
|
571
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
572
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
573
|
+
var a, j, L = [], E = function(m) {
|
|
574
|
+
return Xt(m) === o;
|
|
575
|
+
}, P = /* @__PURE__ */ new Map();
|
|
576
576
|
function y(m) {
|
|
577
|
-
m &&
|
|
577
|
+
m && L.push(B.bind(null, m));
|
|
578
578
|
}
|
|
579
|
-
for (var
|
|
580
|
-
var f =
|
|
579
|
+
for (var b = 0; b < l.length; b++) {
|
|
580
|
+
var f = l[b];
|
|
581
581
|
if (Array.isArray(f)) {
|
|
582
|
-
var p = f[1], v = f[2],
|
|
583
|
-
if (!
|
|
584
|
-
var C =
|
|
582
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
583
|
+
if (!z && !d) {
|
|
584
|
+
var C = P.get(i);
|
|
585
585
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
586
|
-
|
|
586
|
+
P.set(i, !(p > 2) || p);
|
|
587
587
|
}
|
|
588
|
-
|
|
588
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : Fe(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
return y(
|
|
592
|
-
}(
|
|
593
|
-
return r.length ||
|
|
591
|
+
return y(a), y(j), L;
|
|
592
|
+
}(t, e, S, O);
|
|
593
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
594
594
|
var o = [];
|
|
595
|
-
return r.length && [
|
|
595
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
596
596
|
} };
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
var
|
|
600
|
-
return typeof
|
|
598
|
+
function Fe(t) {
|
|
599
|
+
var e = Gt(t, "string");
|
|
600
|
+
return typeof e == "symbol" ? e : e + "";
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
if (typeof
|
|
604
|
-
var r =
|
|
602
|
+
function Gt(t, e) {
|
|
603
|
+
if (typeof t != "object" || !t) return t;
|
|
604
|
+
var r = t[Symbol.toPrimitive];
|
|
605
605
|
if (r !== void 0) {
|
|
606
|
-
var
|
|
607
|
-
if (typeof
|
|
606
|
+
var g = r.call(t, e);
|
|
607
|
+
if (typeof g != "object") return g;
|
|
608
608
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
609
609
|
}
|
|
610
|
-
return String(
|
|
610
|
+
return String(t);
|
|
611
611
|
}
|
|
612
|
-
function
|
|
613
|
-
typeof
|
|
612
|
+
function Ce(t, e, r) {
|
|
613
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
614
614
|
try {
|
|
615
|
-
Object.defineProperty(
|
|
615
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
616
616
|
} catch {
|
|
617
617
|
}
|
|
618
|
-
return
|
|
618
|
+
return t;
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
if (Object(
|
|
622
|
-
return
|
|
620
|
+
function Xt(t) {
|
|
621
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
622
|
+
return t;
|
|
623
623
|
}
|
|
624
|
-
const
|
|
625
|
-
|
|
624
|
+
const ce = ne("ColorPicker"), qt = ["#ff1300", "#EC7878", "#9C27B0", "#673AB7", "#3F51B5", "#0070FF", "#03A9F4", "#00BCD4", "#4CAF50", "#8BC34A", "#CDDC39", "#FFE500", "#FFBF00", "#FF9800", "#795548", "#9E9E9E", "#5A5A5A", "#FFF"];
|
|
625
|
+
He = [re({
|
|
626
626
|
tagName: "color-picker"
|
|
627
627
|
})];
|
|
628
|
-
let
|
|
629
|
-
class
|
|
628
|
+
let Yt;
|
|
629
|
+
class Qt extends X {
|
|
630
630
|
static get observedAttributes() {
|
|
631
631
|
return ["disabled", "selected-color", "open"];
|
|
632
632
|
}
|
|
633
|
-
constructor(
|
|
633
|
+
constructor(e = {}) {
|
|
634
634
|
super({
|
|
635
635
|
styleName: "base-color-picker",
|
|
636
|
-
...
|
|
637
|
-
}),
|
|
636
|
+
...e
|
|
637
|
+
}), Y(this, "_autoStyles", Jt), Y(this, "colorCollections", void 0), Y(this, "onColorPicked", void 0), Y(this, "hasCustomPicker", void 0), Y(this, "defaultColor", void 0), Y(this, "pluginType", void 0), Y(this, "disabled", void 0), Y(this, "selectedColor", void 0), Y(this, "customColor", void 0), Y(this, "isOpen", void 0), Y(this, "colorBtn", void 0), Y(this, "colorPanel", void 0), Y(this, "handleButtonClick", (r) => {
|
|
638
638
|
r.stopPropagation(), this.togglePanel();
|
|
639
|
-
}),
|
|
639
|
+
}), Y(this, "handlePanelClick", (r) => {
|
|
640
640
|
r.stopPropagation();
|
|
641
|
-
}),
|
|
642
|
-
var
|
|
643
|
-
const
|
|
644
|
-
this.setSelectedColor(
|
|
641
|
+
}), Y(this, "handleColorSelect", (r) => {
|
|
642
|
+
var S;
|
|
643
|
+
const g = ue(r);
|
|
644
|
+
this.setSelectedColor(g), this.closePanel(), Ut(g, this.pluginType), (S = this.onColorPicked) == null || S.call(this, g), this.dispatchEvent(new CustomEvent("colorchange", {
|
|
645
645
|
detail: {
|
|
646
|
-
color:
|
|
646
|
+
color: g
|
|
647
647
|
},
|
|
648
648
|
bubbles: !0,
|
|
649
649
|
composed: !0
|
|
650
|
-
})),
|
|
651
|
-
color:
|
|
650
|
+
})), ce.debug("Color selected", {
|
|
651
|
+
color: g
|
|
652
652
|
});
|
|
653
|
-
}),
|
|
653
|
+
}), Y(this, "handleCustomPickerClick", () => {
|
|
654
654
|
const r = document.createElement("input");
|
|
655
655
|
r.type = "color", r.value = this.customColor, r.style.cssText = `
|
|
656
656
|
position: fixed;
|
|
@@ -658,25 +658,25 @@ class Ce extends J {
|
|
|
658
658
|
opacity: 0;
|
|
659
659
|
pointer-events: none;
|
|
660
660
|
`;
|
|
661
|
-
const
|
|
662
|
-
var
|
|
663
|
-
const
|
|
664
|
-
this.setSelectedColor(
|
|
661
|
+
const g = Kt((S) => {
|
|
662
|
+
var B;
|
|
663
|
+
const A = S.target, T = ue(A.value);
|
|
664
|
+
this.setSelectedColor(T), this.setCustomColor(T), document.body.removeChild(r), (B = this.onColorPicked) == null || B.call(this, T), this.dispatchEvent(new CustomEvent("colorchange", {
|
|
665
665
|
detail: {
|
|
666
|
-
color:
|
|
666
|
+
color: T
|
|
667
667
|
},
|
|
668
668
|
bubbles: !0,
|
|
669
669
|
composed: !0
|
|
670
|
-
})),
|
|
671
|
-
color:
|
|
670
|
+
})), ce.debug("Custom color selected", {
|
|
671
|
+
color: T
|
|
672
672
|
});
|
|
673
673
|
}, 30);
|
|
674
|
-
r.addEventListener("input",
|
|
674
|
+
r.addEventListener("input", g), document.body.appendChild(r), requestAnimationFrame(() => {
|
|
675
675
|
r.focus(), r.click();
|
|
676
676
|
});
|
|
677
|
-
}),
|
|
677
|
+
}), Y(this, "handleDocumentClick", (r) => {
|
|
678
678
|
this.isOpen && !this.contains(r.target) && this.closePanel();
|
|
679
|
-
}), this.colorCollections =
|
|
679
|
+
}), this.colorCollections = e.colorCollections || qt, this.onColorPicked = e.onColorPicked, this.hasCustomPicker = e.hasCustomPicker || !1, this.pluginType = e.pluginType || "text", this.disabled = e.disabled || !1, this.defaultColor = ue(e.defaultColor || this.colorCollections[0]), this.selectedColor = this.defaultColor, this.customColor = Ft(this.pluginType) || "", this.isOpen = !1, ce.debug("ColorPicker initialized", {
|
|
680
680
|
colorCollections: this.colorCollections.length,
|
|
681
681
|
hasCustomPicker: this.hasCustomPicker,
|
|
682
682
|
pluginType: this.pluginType
|
|
@@ -686,30 +686,30 @@ class Ce extends J {
|
|
|
686
686
|
* 实现抽象方法:真正的JSX渲染!🎉
|
|
687
687
|
*/
|
|
688
688
|
render() {
|
|
689
|
-
const
|
|
690
|
-
return /* @__PURE__ */
|
|
689
|
+
const e = this.renderColorButton(), r = this.isOpen ? this.renderColorPanel() : null;
|
|
690
|
+
return /* @__PURE__ */ n("section", { class: "color-section" }, /* @__PURE__ */ n("div", { class: "color-popover" }, e, r));
|
|
691
691
|
}
|
|
692
692
|
/**
|
|
693
693
|
* 渲染颜色按钮 - 真正的JSX!
|
|
694
694
|
*/
|
|
695
695
|
renderColorButton() {
|
|
696
|
-
return /* @__PURE__ */
|
|
697
|
-
this.colorBtn =
|
|
698
|
-
} }, /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ n("xy-button", { type: "button", class: `color-btn ${this.disabled ? "disabled" : ""}`, style: `--theme-color: ${this.selectedColor}`, disabled: this.disabled, onClick: this.handleButtonClick, ref: (e) => {
|
|
697
|
+
this.colorBtn = e;
|
|
698
|
+
} }, /* @__PURE__ */ n("span", { class: "color-indicator" }, "_"));
|
|
699
699
|
}
|
|
700
700
|
/**
|
|
701
701
|
* 渲染颜色面板 - 真正的JSX!
|
|
702
702
|
*/
|
|
703
703
|
renderColorPanel() {
|
|
704
|
-
return /* @__PURE__ */
|
|
705
|
-
this.colorPanel =
|
|
706
|
-
} }, /* @__PURE__ */
|
|
704
|
+
return /* @__PURE__ */ n("div", { class: "color-panel", onClick: this.handlePanelClick, ref: (e) => {
|
|
705
|
+
this.colorPanel = e;
|
|
706
|
+
} }, /* @__PURE__ */ n("div", { class: "color-grid" }, this.hasCustomPicker ? this.renderCustomPicker() : null, this.renderColorButtons()));
|
|
707
707
|
}
|
|
708
708
|
/**
|
|
709
709
|
* 渲染自定义颜色选择器 - 真正的JSX!
|
|
710
710
|
*/
|
|
711
711
|
renderCustomPicker() {
|
|
712
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ n("xy-button", { type: "button", class: "color-cube custom-picker", style: {
|
|
713
713
|
backgroundColor: this.customColor
|
|
714
714
|
}, onClick: this.handleCustomPickerClick, title: "自定义颜色" });
|
|
715
715
|
}
|
|
@@ -717,7 +717,7 @@ class Ce extends J {
|
|
|
717
717
|
* 渲染颜色按钮组 - 真正的JSX!
|
|
718
718
|
*/
|
|
719
719
|
renderColorButtons() {
|
|
720
|
-
return this.colorCollections.map((
|
|
720
|
+
return this.colorCollections.map((e) => /* @__PURE__ */ n("xy-button", { key: e, type: "button", class: "color-cube", style: `background-color: ${e}`, "data-color": e, title: e, onClick: () => this.handleColorSelect(e) }));
|
|
721
721
|
}
|
|
722
722
|
/**
|
|
723
723
|
* 切换面板显示状态
|
|
@@ -734,20 +734,20 @@ class Ce extends J {
|
|
|
734
734
|
/**
|
|
735
735
|
* 设置选中的颜色
|
|
736
736
|
*/
|
|
737
|
-
setSelectedColor(
|
|
738
|
-
this.selectedColor =
|
|
737
|
+
setSelectedColor(e) {
|
|
738
|
+
this.selectedColor = e, this.setAttr("selected-color", e), this.updateColorButton();
|
|
739
739
|
}
|
|
740
740
|
/**
|
|
741
741
|
* 设置自定义颜色
|
|
742
742
|
*/
|
|
743
|
-
setCustomColor(
|
|
744
|
-
this.customColor =
|
|
743
|
+
setCustomColor(e) {
|
|
744
|
+
this.customColor = e, Ht(e, this.pluginType);
|
|
745
745
|
}
|
|
746
746
|
/**
|
|
747
747
|
* 设置面板开关状态
|
|
748
748
|
*/
|
|
749
|
-
setOpen(
|
|
750
|
-
this.isOpen =
|
|
749
|
+
setOpen(e) {
|
|
750
|
+
this.isOpen = e, e ? this.setAttr("open", "") : this.removeAttr("open"), this.rerender();
|
|
751
751
|
}
|
|
752
752
|
/**
|
|
753
753
|
* 更新颜色按钮样式
|
|
@@ -759,27 +759,27 @@ class Ce extends J {
|
|
|
759
759
|
* 组件连接到DOM后的初始化
|
|
760
760
|
*/
|
|
761
761
|
onConnected() {
|
|
762
|
-
document.addEventListener("click", this.handleDocumentClick),
|
|
762
|
+
document.addEventListener("click", this.handleDocumentClick), ce.info("ColorPicker connected to DOM");
|
|
763
763
|
}
|
|
764
764
|
/**
|
|
765
765
|
* 组件从DOM断开时的清理
|
|
766
766
|
*/
|
|
767
767
|
onDisconnected() {
|
|
768
|
-
document.removeEventListener("click", this.handleDocumentClick),
|
|
768
|
+
document.removeEventListener("click", this.handleDocumentClick), ce.info("ColorPicker disconnected from DOM");
|
|
769
769
|
}
|
|
770
770
|
/**
|
|
771
771
|
* 属性变化处理
|
|
772
772
|
*/
|
|
773
|
-
onAttributeChanged(
|
|
774
|
-
switch (
|
|
773
|
+
onAttributeChanged(e, r, g) {
|
|
774
|
+
switch (e) {
|
|
775
775
|
case "disabled":
|
|
776
|
-
this.disabled =
|
|
776
|
+
this.disabled = g !== null, this.rerender();
|
|
777
777
|
break;
|
|
778
778
|
case "selected-color":
|
|
779
|
-
|
|
779
|
+
g && g !== this.selectedColor && (this.selectedColor = g, this.updateColorButton());
|
|
780
780
|
break;
|
|
781
781
|
case "open":
|
|
782
|
-
this.isOpen =
|
|
782
|
+
this.isOpen = g !== null;
|
|
783
783
|
break;
|
|
784
784
|
}
|
|
785
785
|
}
|
|
@@ -792,352 +792,370 @@ class Ce extends J {
|
|
|
792
792
|
/**
|
|
793
793
|
* 公共API:设置颜色
|
|
794
794
|
*/
|
|
795
|
-
setColor(
|
|
796
|
-
this.setSelectedColor(
|
|
795
|
+
setColor(e) {
|
|
796
|
+
this.setSelectedColor(ue(e));
|
|
797
797
|
}
|
|
798
798
|
/**
|
|
799
799
|
* 公共API:聚焦组件
|
|
800
800
|
*/
|
|
801
801
|
focus() {
|
|
802
|
-
var
|
|
803
|
-
(
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
[
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
var
|
|
811
|
-
let
|
|
812
|
-
function
|
|
813
|
-
return (
|
|
814
|
-
}
|
|
815
|
-
function
|
|
816
|
-
function
|
|
817
|
-
return function(
|
|
818
|
-
return
|
|
802
|
+
var e;
|
|
803
|
+
(e = this.colorBtn) == null || e.focus();
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
Me = Qt;
|
|
807
|
+
[Yt, Ue] = Wt(Me, [], He, 0, void 0, X).c;
|
|
808
|
+
Ue();
|
|
809
|
+
const Zt = ".reactive-counter{max-width:500px;margin:20px auto;padding:24px;border-radius:12px;box-shadow:0 4px 12px #0000001a;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;transition:all .3s ease}.theme-light{background:#fff;color:#333;border:1px solid #e1e5e9}.theme-dark{background:#1a1a1a;color:#fff;border:1px solid #333333}.theme-blue{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border:1px solid #5a67d8}.header{text-align:center;margin-bottom:24px}.header h3{margin:0 0 8px;font-size:24px;font-weight:600}.subtitle{margin:0;opacity:.8;font-size:14px}.counter-display{text-align:center;margin-bottom:32px}.count-value{font-size:48px;font-weight:700;line-height:1;margin-bottom:8px;font-variant-numeric:tabular-nums}.step-info{font-size:14px;opacity:.7}.controls{display:flex;gap:12px;justify-content:center;margin-bottom:24px;flex-wrap:wrap}.btn{padding:10px 20px;border:none;border-radius:8px;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s ease;min-width:60px}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:#4299e1;color:#fff}.btn-primary:hover:not(:disabled){background:#3182ce;transform:translateY(-1px)}.btn-secondary{background:#718096;color:#fff}.btn-secondary:hover:not(:disabled){background:#4a5568;transform:translateY(-1px)}.btn-warning{background:#ed8936;color:#fff}.btn-warning:hover:not(:disabled){background:#dd6b20;transform:translateY(-1px)}.btn-success{background:#48bb78;color:#fff}.btn-success:hover:not(:disabled){background:#38a169;transform:translateY(-1px)}.btn-danger{background:#f56565;color:#fff}.btn-danger:hover:not(:disabled){background:#e53e3e;transform:translateY(-1px)}.btn-sm{padding:6px 12px;font-size:14px;min-width:auto}.step-controls,.auto-controls,.theme-controls,.message-controls{margin-bottom:20px;text-align:center}.step-controls label{display:flex;align-items:center;justify-content:center;gap:12px;font-size:14px}.step-controls input[type=range]{flex:0 0 150px}.step-controls span{font-weight:700;min-width:20px}.theme-controls select,.message-controls input{padding:8px 12px;border:1px solid #cbd5e0;border-radius:6px;font-size:14px;margin-left:8px}.theme-dark .theme-controls select,.theme-dark .message-controls input{background:#2d3748;border-color:#4a5568;color:#fff}.theme-blue .theme-controls select,.theme-blue .message-controls input{background:#ffffff1a;border-color:#fff3;color:#fff}.message-controls input{width:250px;max-width:100%}.history{margin-top:24px;padding:16px;background:#0000000d;border-radius:8px}.theme-dark .history{background:#ffffff0d}.theme-blue .history{background:#ffffff1a}.history h4{margin:0 0 12px;font-size:16px}.history-list{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}.history-item{padding:4px 8px;background:#4299e11a;border:1px solid rgba(66,153,225,.2);border-radius:4px;font-size:12px;font-weight:500}.debug-info{margin-top:24px;font-size:12px}.debug-info details{border:1px solid #e2e8f0;border-radius:6px;padding:8px}.theme-dark .debug-info details{border-color:#4a5568}.theme-blue .debug-info details{border-color:#fff3}.debug-info summary{cursor:pointer;font-weight:500;margin-bottom:8px}.debug-info pre{margin:0;padding:8px;background:#0000000d;border-radius:4px;overflow-x:auto;font-size:11px;line-height:1.4}.theme-dark .debug-info pre{background:#ffffff0d}.theme-blue .debug-info pre{background:#ffffff1a}@media (max-width: 600px){.reactive-counter{margin:10px;padding:16px}.count-value{font-size:36px}.controls{flex-direction:column;align-items:center}.btn{width:200px}.step-controls label{flex-direction:column;gap:8px}.message-controls input{width:100%}}";
|
|
810
|
+
var Ke;
|
|
811
|
+
let Je, We;
|
|
812
|
+
function V(t, e, r) {
|
|
813
|
+
return (e = Ge(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
814
|
+
}
|
|
815
|
+
function Vt(t, e, r, g, S, A) {
|
|
816
|
+
function T(o, l, u) {
|
|
817
|
+
return function(s, a) {
|
|
818
|
+
return u && u(s), o[l].call(s, a);
|
|
819
819
|
};
|
|
820
820
|
}
|
|
821
|
-
function
|
|
822
|
-
for (var
|
|
823
|
-
return
|
|
821
|
+
function B(o, l) {
|
|
822
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
823
|
+
return l;
|
|
824
824
|
}
|
|
825
|
-
function
|
|
826
|
-
if (typeof o != "function" && (
|
|
825
|
+
function _(o, l, u, s) {
|
|
826
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
827
827
|
return o;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
function v(
|
|
831
|
-
if (!p(
|
|
829
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
830
|
+
function v(c) {
|
|
831
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
832
832
|
}
|
|
833
|
-
var
|
|
834
|
-
if (!
|
|
835
|
-
|
|
836
|
-
var i = {}, C = [], m =
|
|
837
|
-
y ? (
|
|
833
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
834
|
+
if (!z) {
|
|
835
|
+
u || Array.isArray(x) || (x = [x]);
|
|
836
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
837
|
+
y ? (b || f ? i = { get: we(function() {
|
|
838
838
|
return k(this);
|
|
839
|
-
},
|
|
840
|
-
|
|
841
|
-
} } : i[m] = k,
|
|
842
|
-
}
|
|
843
|
-
for (var h = o, I = x.length - 1; I >= 0; I -=
|
|
844
|
-
var
|
|
845
|
-
if (
|
|
846
|
-
|
|
847
|
-
}).bind(null,
|
|
839
|
+
}, s, "get"), set: function(c) {
|
|
840
|
+
l[4](this, c);
|
|
841
|
+
} } : i[m] = k, b || we(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
842
|
+
}
|
|
843
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
844
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
845
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
846
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
847
|
+
}).bind(null, J) };
|
|
848
848
|
try {
|
|
849
|
-
if (
|
|
849
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
850
850
|
else {
|
|
851
|
-
var
|
|
852
|
-
|
|
853
|
-
return v(
|
|
854
|
-
} : (
|
|
855
|
-
return
|
|
856
|
-
}, (
|
|
857
|
-
|
|
851
|
+
var $, R;
|
|
852
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
853
|
+
return v(c), i.value;
|
|
854
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
855
|
+
return c[s];
|
|
856
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
857
|
+
c[s] = w;
|
|
858
858
|
}));
|
|
859
|
-
var
|
|
860
|
-
return
|
|
859
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
860
|
+
return s in c;
|
|
861
861
|
} };
|
|
862
|
-
if (
|
|
863
|
-
if (typeof h == "object" && h) (
|
|
862
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
863
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
864
864
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
865
|
-
} else
|
|
865
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
866
866
|
}
|
|
867
867
|
} finally {
|
|
868
|
-
|
|
868
|
+
J.v = !0;
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
|
-
return (
|
|
872
|
-
for (var
|
|
871
|
+
return (b || f) && E.push(function(c, w) {
|
|
872
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
873
873
|
return w;
|
|
874
|
-
}),
|
|
874
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
875
875
|
}
|
|
876
|
-
function
|
|
877
|
-
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value:
|
|
876
|
+
function U(o, l) {
|
|
877
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
878
878
|
}
|
|
879
|
-
if (arguments.length >= 6) var
|
|
880
|
-
var
|
|
881
|
-
var
|
|
882
|
-
return
|
|
883
|
-
},
|
|
879
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
880
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
881
|
+
var a, j, L = [], E = function(m) {
|
|
882
|
+
return tr(m) === o;
|
|
883
|
+
}, P = /* @__PURE__ */ new Map();
|
|
884
884
|
function y(m) {
|
|
885
|
-
m &&
|
|
885
|
+
m && L.push(B.bind(null, m));
|
|
886
886
|
}
|
|
887
|
-
for (var
|
|
888
|
-
var f =
|
|
887
|
+
for (var b = 0; b < l.length; b++) {
|
|
888
|
+
var f = l[b];
|
|
889
889
|
if (Array.isArray(f)) {
|
|
890
|
-
var p = f[1], v = f[2],
|
|
891
|
-
if (!
|
|
892
|
-
var C =
|
|
890
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
891
|
+
if (!z && !d) {
|
|
892
|
+
var C = P.get(i);
|
|
893
893
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
894
|
-
|
|
894
|
+
P.set(i, !(p > 2) || p);
|
|
895
895
|
}
|
|
896
|
-
|
|
896
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : Ge(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
|
-
return y(
|
|
900
|
-
}(
|
|
901
|
-
return r.length ||
|
|
899
|
+
return y(a), y(j), L;
|
|
900
|
+
}(t, e, S, O);
|
|
901
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
902
902
|
var o = [];
|
|
903
|
-
return r.length && [
|
|
903
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
904
904
|
} };
|
|
905
905
|
}
|
|
906
|
-
function
|
|
907
|
-
var
|
|
908
|
-
return typeof
|
|
906
|
+
function Ge(t) {
|
|
907
|
+
var e = er(t, "string");
|
|
908
|
+
return typeof e == "symbol" ? e : e + "";
|
|
909
909
|
}
|
|
910
|
-
function
|
|
911
|
-
if (typeof
|
|
912
|
-
var r =
|
|
910
|
+
function er(t, e) {
|
|
911
|
+
if (typeof t != "object" || !t) return t;
|
|
912
|
+
var r = t[Symbol.toPrimitive];
|
|
913
913
|
if (r !== void 0) {
|
|
914
|
-
var
|
|
915
|
-
if (typeof
|
|
914
|
+
var g = r.call(t, e);
|
|
915
|
+
if (typeof g != "object") return g;
|
|
916
916
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
917
917
|
}
|
|
918
|
-
return String(
|
|
918
|
+
return String(t);
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
typeof
|
|
920
|
+
function we(t, e, r) {
|
|
921
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
922
922
|
try {
|
|
923
|
-
Object.defineProperty(
|
|
923
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
924
924
|
} catch {
|
|
925
925
|
}
|
|
926
|
-
return
|
|
926
|
+
return t;
|
|
927
927
|
}
|
|
928
|
-
function
|
|
929
|
-
if (Object(
|
|
930
|
-
return
|
|
928
|
+
function tr(t) {
|
|
929
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
930
|
+
return t;
|
|
931
931
|
}
|
|
932
|
-
const
|
|
933
|
-
|
|
932
|
+
const pe = ne("ReactiveCounter");
|
|
933
|
+
We = [re({
|
|
934
934
|
tagName: "reactive-counter"
|
|
935
935
|
})];
|
|
936
|
-
let
|
|
937
|
-
class
|
|
936
|
+
let rr;
|
|
937
|
+
class or extends X {
|
|
938
938
|
constructor() {
|
|
939
|
-
super(),
|
|
939
|
+
super(), V(this, "_autoStyles", Zt), V(this, "state", void 0), V(this, "theme", void 0), V(this, "history", void 0), V(this, "increment", () => {
|
|
940
940
|
this.state.count += this.state.step, this.addToHistory(this.state.count);
|
|
941
|
-
}),
|
|
941
|
+
}), V(this, "decrement", () => {
|
|
942
942
|
this.state.count -= this.state.step, this.addToHistory(this.state.count);
|
|
943
|
-
}),
|
|
943
|
+
}), V(this, "reset", () => {
|
|
944
944
|
this.state.count = 0, this.addToHistory(0);
|
|
945
|
-
}),
|
|
946
|
-
const
|
|
947
|
-
this.state.step = parseInt(
|
|
948
|
-
}),
|
|
949
|
-
const
|
|
950
|
-
this.theme =
|
|
951
|
-
}),
|
|
952
|
-
const
|
|
953
|
-
this.state.message =
|
|
954
|
-
}),
|
|
945
|
+
}), V(this, "handleStepChange", (A) => {
|
|
946
|
+
const T = A.target;
|
|
947
|
+
this.state.step = parseInt(T.value);
|
|
948
|
+
}), V(this, "handleThemeChange", (A) => {
|
|
949
|
+
const T = A.target;
|
|
950
|
+
this.theme = T.value;
|
|
951
|
+
}), V(this, "handleMessageChange", (A) => {
|
|
952
|
+
const T = A.target;
|
|
953
|
+
this.state.message = T.value;
|
|
954
|
+
}), V(this, "toggleAutoIncrement", () => {
|
|
955
955
|
this.state.isRunning = !this.state.isRunning, this.state.isRunning && this.startAutoIncrement();
|
|
956
|
-
}),
|
|
956
|
+
}), V(this, "clearHistory", () => {
|
|
957
957
|
this.history = [];
|
|
958
|
-
}),
|
|
958
|
+
}), pe.info("ReactiveCounter initialized");
|
|
959
|
+
let e = this.reactive({
|
|
959
960
|
count: 0,
|
|
960
961
|
step: 1,
|
|
961
962
|
message: "Hello WSX Reactive!",
|
|
962
963
|
isRunning: !1
|
|
963
964
|
});
|
|
964
|
-
|
|
965
|
+
Object.defineProperty(this, "state", {
|
|
966
|
+
get: () => e,
|
|
967
|
+
set: (A) => {
|
|
968
|
+
e = A !== null && typeof A < "u" && (Array.isArray(A) || typeof A == "object") ? this.reactive(A) : A, this.scheduleRerender();
|
|
969
|
+
},
|
|
970
|
+
enumerable: !0,
|
|
971
|
+
configurable: !0
|
|
972
|
+
});
|
|
973
|
+
const [r, g] = this.useState("theme", "light");
|
|
965
974
|
Object.defineProperty(this, "theme", {
|
|
966
|
-
get:
|
|
967
|
-
set:
|
|
975
|
+
get: r,
|
|
976
|
+
set: g,
|
|
968
977
|
enumerable: !0,
|
|
969
978
|
configurable: !0
|
|
970
|
-
})
|
|
979
|
+
});
|
|
980
|
+
let S = this.reactive([]);
|
|
981
|
+
Object.defineProperty(this, "history", {
|
|
982
|
+
get: () => S,
|
|
983
|
+
set: (A) => {
|
|
984
|
+
S = A !== null && typeof A < "u" && (Array.isArray(A) || typeof A == "object") ? this.reactive(A) : A, this.scheduleRerender();
|
|
985
|
+
},
|
|
986
|
+
enumerable: !0,
|
|
987
|
+
configurable: !0
|
|
988
|
+
});
|
|
971
989
|
}
|
|
972
990
|
render() {
|
|
973
|
-
return /* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ n("div", { class: `reactive-counter theme-${this.theme}` }, /* @__PURE__ */ n("div", { class: "header" }, /* @__PURE__ */ n("h3", null, "🔄 Reactive Counter"), /* @__PURE__ */ n("p", { class: "subtitle" }, this.state.message)), /* @__PURE__ */ n("div", { class: "counter-display" }, /* @__PURE__ */ n("div", { class: "count-value" }, this.state.count), /* @__PURE__ */ n("div", { class: "step-info" }, "Step: ", this.state.step)), /* @__PURE__ */ n("div", { class: "controls" }, /* @__PURE__ */ n("button", { class: "btn btn-primary", onClick: this.increment, disabled: this.state.isRunning, "data-wsx-key": "ReactiveCounter-button-text-5-1" }, "+", this.state.step), /* @__PURE__ */ n("button", { class: "btn btn-secondary", onClick: this.decrement, disabled: this.state.isRunning, "data-wsx-key": "ReactiveCounter-button-text-5-3" }, "-", this.state.step), /* @__PURE__ */ n("button", { class: "btn btn-warning", onClick: this.reset, disabled: this.state.isRunning, "data-wsx-key": "ReactiveCounter-button-text-5-5" }, "Reset")), /* @__PURE__ */ n("div", { class: "step-controls" }, /* @__PURE__ */ n("label", null, "Step Size:", /* @__PURE__ */ n("input", { type: "range", min: "1", max: "10", value: this.state.step, onInput: this.handleStepChange, "data-wsx-key": "ReactiveCounter-input-range-7-1-1" }), /* @__PURE__ */ n("span", null, this.state.step))), /* @__PURE__ */ n("div", { class: "auto-controls" }, /* @__PURE__ */ n("button", { class: `btn ${this.state.isRunning ? "btn-danger" : "btn-success"}`, onClick: this.toggleAutoIncrement, "data-wsx-key": "ReactiveCounter-button-text-9-1" }, this.state.isRunning ? "Stop" : "Start", " Auto Increment")), /* @__PURE__ */ n("div", { class: "theme-controls" }, /* @__PURE__ */ n("label", null, "Theme:", /* @__PURE__ */ n("select", { value: this.theme, onChange: this.handleThemeChange, "data-wsx-key": "ReactiveCounter-select-text-11-1-1" }, /* @__PURE__ */ n("option", { value: "light" }, "Light"), /* @__PURE__ */ n("option", { value: "dark" }, "Dark"), /* @__PURE__ */ n("option", { value: "blue" }, "Blue")))), /* @__PURE__ */ n("div", { class: "message-controls" }, /* @__PURE__ */ n("input", { type: "text", value: this.state.message, onInput: this.handleMessageChange, placeholder: "Enter a message...", "data-wsx-key": "ReactiveCounter-input-text-13-1" })), this.history.length > 0 && /* @__PURE__ */ n("div", { class: "history" }, /* @__PURE__ */ n("h4", null, "History (last 10):"), /* @__PURE__ */ n("div", { class: "history-list" }, this.history.slice(-10).map((e, r) => /* @__PURE__ */ n("span", { key: r, class: "history-item" }, e))), /* @__PURE__ */ n("button", { class: "btn btn-sm", onClick: this.clearHistory, "data-wsx-key": "ReactiveCounter-button-text-5" }, "Clear History")), /* @__PURE__ */ n("div", { class: "debug-info" }, /* @__PURE__ */ n("details", null, /* @__PURE__ */ n("summary", null, "Debug Info"), /* @__PURE__ */ n("pre", null, JSON.stringify({
|
|
974
992
|
state: this.state,
|
|
975
993
|
theme: this.theme,
|
|
976
994
|
historyLength: this.history.length
|
|
977
995
|
}, null, 2)))));
|
|
978
996
|
}
|
|
979
997
|
startAutoIncrement() {
|
|
980
|
-
const
|
|
998
|
+
const e = setInterval(() => {
|
|
981
999
|
if (!this.state.isRunning) {
|
|
982
|
-
clearInterval(
|
|
1000
|
+
clearInterval(e);
|
|
983
1001
|
return;
|
|
984
1002
|
}
|
|
985
1003
|
this.increment(), this.state.count % 5 === 0 && (this.state.message = `Count reached ${this.state.count}!`);
|
|
986
1004
|
}, 200);
|
|
987
1005
|
}
|
|
988
|
-
addToHistory(
|
|
989
|
-
this.history = [...this.history,
|
|
1006
|
+
addToHistory(e) {
|
|
1007
|
+
this.history = [...this.history, e];
|
|
990
1008
|
}
|
|
991
1009
|
onConnected() {
|
|
992
|
-
|
|
1010
|
+
pe.info("ReactiveCounter connected to DOM"), setTimeout(() => {
|
|
993
1011
|
this.state.message = "Ready to count! 🚀";
|
|
994
1012
|
}, 500);
|
|
995
1013
|
}
|
|
996
1014
|
onDisconnected() {
|
|
997
|
-
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
[
|
|
1002
|
-
|
|
1003
|
-
const
|
|
1004
|
-
var
|
|
1005
|
-
let
|
|
1006
|
-
function
|
|
1007
|
-
return (
|
|
1008
|
-
}
|
|
1009
|
-
function
|
|
1010
|
-
function
|
|
1011
|
-
return function(
|
|
1012
|
-
return
|
|
1015
|
+
pe.info("ReactiveCounter disconnected from DOM"), this.state.isRunning = !1;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
Ke = or;
|
|
1019
|
+
[rr, Je] = Vt(Ke, [], We, 0, void 0, X).c;
|
|
1020
|
+
Je();
|
|
1021
|
+
const ir = ":host{display:block}.theme-switcher-container{position:relative;display:flex;align-items:center}.theme-switcher-btn{width:var(--theme-switcher-width, 2.5rem);height:var(--theme-switcher-height, 2.5rem);padding:var(--theme-switcher-padding, .5rem);border-radius:var(--theme-switcher-border-radius, 8px);background:var(--theme-switcher-bg, #dc2626);border:var(--theme-switcher-border, none);color:var(--theme-switcher-color, white);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--theme-switcher-transition, .3s ease);box-shadow:var(--theme-switcher-shadow, 0 4px 15px rgba(220, 38, 38, .4));font-weight:var(--theme-switcher-font-weight, 600);font-family:var(--theme-switcher-font-family, inherit)}.theme-switcher-btn:hover{background:var(--theme-switcher-hover-bg, #b91c1c);transform:var(--theme-switcher-hover-transform, translateY(-2px));box-shadow:var(--theme-switcher-hover-shadow, 0 8px 25px rgba(220, 38, 38, .5))}.theme-switcher-btn:active{transform:var(--theme-switcher-active-transform, translateY(0))}.theme-switcher-icon{font-size:var(--theme-switcher-icon-size, 1rem);line-height:1;transition:transform var(--theme-switcher-icon-transition, .3s ease)}.theme-switcher-btn:hover .theme-switcher-icon{transform:var(--theme-switcher-icon-hover-transform, rotate(360deg))}.theme-switcher-btn[data-theme=light]{background:var(--theme-switcher-light-bg, #dc2626);color:var(--theme-switcher-light-color, white)}.theme-switcher-btn[data-theme=light]:hover{background:var(--theme-switcher-light-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=dark]{background:var(--theme-switcher-dark-bg, #dc2626);color:var(--theme-switcher-dark-color, white)}.theme-switcher-btn[data-theme=dark]:hover{background:var(--theme-switcher-dark-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=auto]{background:var(--theme-switcher-auto-bg, linear-gradient(135deg, #dc2626, #b91c1c));color:var(--theme-switcher-auto-color, white)}.theme-switcher-btn[data-theme=auto]:hover{background:var(--theme-switcher-auto-hover-bg, linear-gradient(135deg, #b91c1c, #991b1b))}@media (max-width: 768px){.theme-switcher-btn{width:var(--theme-switcher-mobile-width, 2rem);height:var(--theme-switcher-mobile-height, 2rem)}.theme-switcher-icon{font-size:var(--theme-switcher-mobile-icon-size, .9rem)}}";
|
|
1022
|
+
var Xe;
|
|
1023
|
+
let qe, Ye;
|
|
1024
|
+
function me(t, e, r) {
|
|
1025
|
+
return (e = Qe(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1026
|
+
}
|
|
1027
|
+
function nr(t, e, r, g, S, A) {
|
|
1028
|
+
function T(o, l, u) {
|
|
1029
|
+
return function(s, a) {
|
|
1030
|
+
return u && u(s), o[l].call(s, a);
|
|
1013
1031
|
};
|
|
1014
1032
|
}
|
|
1015
|
-
function
|
|
1016
|
-
for (var
|
|
1017
|
-
return
|
|
1033
|
+
function B(o, l) {
|
|
1034
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1035
|
+
return l;
|
|
1018
1036
|
}
|
|
1019
|
-
function
|
|
1020
|
-
if (typeof o != "function" && (
|
|
1037
|
+
function _(o, l, u, s) {
|
|
1038
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
1021
1039
|
return o;
|
|
1022
1040
|
}
|
|
1023
|
-
function
|
|
1024
|
-
function v(
|
|
1025
|
-
if (!p(
|
|
1041
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
1042
|
+
function v(c) {
|
|
1043
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1026
1044
|
}
|
|
1027
|
-
var
|
|
1028
|
-
if (!
|
|
1029
|
-
|
|
1030
|
-
var i = {}, C = [], m =
|
|
1031
|
-
y ? (
|
|
1045
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
1046
|
+
if (!z) {
|
|
1047
|
+
u || Array.isArray(x) || (x = [x]);
|
|
1048
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
1049
|
+
y ? (b || f ? i = { get: Te(function() {
|
|
1032
1050
|
return k(this);
|
|
1033
|
-
},
|
|
1034
|
-
|
|
1035
|
-
} } : i[m] = k,
|
|
1036
|
-
}
|
|
1037
|
-
for (var h = o, I = x.length - 1; I >= 0; I -=
|
|
1038
|
-
var
|
|
1039
|
-
if (
|
|
1040
|
-
|
|
1041
|
-
}).bind(null,
|
|
1051
|
+
}, s, "get"), set: function(c) {
|
|
1052
|
+
l[4](this, c);
|
|
1053
|
+
} } : i[m] = k, b || Te(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
1054
|
+
}
|
|
1055
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1056
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
1057
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1058
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
1059
|
+
}).bind(null, J) };
|
|
1042
1060
|
try {
|
|
1043
|
-
if (
|
|
1061
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1044
1062
|
else {
|
|
1045
|
-
var
|
|
1046
|
-
|
|
1047
|
-
return v(
|
|
1048
|
-
} : (
|
|
1049
|
-
return
|
|
1050
|
-
}, (
|
|
1051
|
-
|
|
1063
|
+
var $, R;
|
|
1064
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
1065
|
+
return v(c), i.value;
|
|
1066
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
1067
|
+
return c[s];
|
|
1068
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
1069
|
+
c[s] = w;
|
|
1052
1070
|
}));
|
|
1053
|
-
var
|
|
1054
|
-
return
|
|
1071
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1072
|
+
return s in c;
|
|
1055
1073
|
} };
|
|
1056
|
-
if (
|
|
1057
|
-
if (typeof h == "object" && h) (
|
|
1074
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1075
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
1058
1076
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1059
|
-
} else
|
|
1077
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
1060
1078
|
}
|
|
1061
1079
|
} finally {
|
|
1062
|
-
|
|
1080
|
+
J.v = !0;
|
|
1063
1081
|
}
|
|
1064
1082
|
}
|
|
1065
|
-
return (
|
|
1066
|
-
for (var
|
|
1083
|
+
return (b || f) && E.push(function(c, w) {
|
|
1084
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
1067
1085
|
return w;
|
|
1068
|
-
}),
|
|
1086
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
1069
1087
|
}
|
|
1070
|
-
function
|
|
1071
|
-
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value:
|
|
1088
|
+
function U(o, l) {
|
|
1089
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1072
1090
|
}
|
|
1073
|
-
if (arguments.length >= 6) var
|
|
1074
|
-
var
|
|
1075
|
-
var
|
|
1076
|
-
return
|
|
1077
|
-
},
|
|
1091
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1092
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
1093
|
+
var a, j, L = [], E = function(m) {
|
|
1094
|
+
return ar(m) === o;
|
|
1095
|
+
}, P = /* @__PURE__ */ new Map();
|
|
1078
1096
|
function y(m) {
|
|
1079
|
-
m &&
|
|
1097
|
+
m && L.push(B.bind(null, m));
|
|
1080
1098
|
}
|
|
1081
|
-
for (var
|
|
1082
|
-
var f =
|
|
1099
|
+
for (var b = 0; b < l.length; b++) {
|
|
1100
|
+
var f = l[b];
|
|
1083
1101
|
if (Array.isArray(f)) {
|
|
1084
|
-
var p = f[1], v = f[2],
|
|
1085
|
-
if (!
|
|
1086
|
-
var C =
|
|
1102
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
1103
|
+
if (!z && !d) {
|
|
1104
|
+
var C = P.get(i);
|
|
1087
1105
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1088
|
-
|
|
1106
|
+
P.set(i, !(p > 2) || p);
|
|
1089
1107
|
}
|
|
1090
|
-
|
|
1108
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : Qe(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
1091
1109
|
}
|
|
1092
1110
|
}
|
|
1093
|
-
return y(
|
|
1094
|
-
}(
|
|
1095
|
-
return r.length ||
|
|
1111
|
+
return y(a), y(j), L;
|
|
1112
|
+
}(t, e, S, O);
|
|
1113
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
1096
1114
|
var o = [];
|
|
1097
|
-
return r.length && [
|
|
1115
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
1098
1116
|
} };
|
|
1099
1117
|
}
|
|
1100
|
-
function
|
|
1101
|
-
var
|
|
1102
|
-
return typeof
|
|
1118
|
+
function Qe(t) {
|
|
1119
|
+
var e = sr(t, "string");
|
|
1120
|
+
return typeof e == "symbol" ? e : e + "";
|
|
1103
1121
|
}
|
|
1104
|
-
function
|
|
1105
|
-
if (typeof
|
|
1106
|
-
var r =
|
|
1122
|
+
function sr(t, e) {
|
|
1123
|
+
if (typeof t != "object" || !t) return t;
|
|
1124
|
+
var r = t[Symbol.toPrimitive];
|
|
1107
1125
|
if (r !== void 0) {
|
|
1108
|
-
var
|
|
1109
|
-
if (typeof
|
|
1126
|
+
var g = r.call(t, e);
|
|
1127
|
+
if (typeof g != "object") return g;
|
|
1110
1128
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1111
1129
|
}
|
|
1112
|
-
return String(
|
|
1130
|
+
return String(t);
|
|
1113
1131
|
}
|
|
1114
|
-
function
|
|
1115
|
-
typeof
|
|
1132
|
+
function Te(t, e, r) {
|
|
1133
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1116
1134
|
try {
|
|
1117
|
-
Object.defineProperty(
|
|
1135
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
1118
1136
|
} catch {
|
|
1119
1137
|
}
|
|
1120
|
-
return
|
|
1138
|
+
return t;
|
|
1121
1139
|
}
|
|
1122
|
-
function
|
|
1123
|
-
if (Object(
|
|
1124
|
-
return
|
|
1140
|
+
function ar(t) {
|
|
1141
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1142
|
+
return t;
|
|
1125
1143
|
}
|
|
1126
|
-
|
|
1144
|
+
Ye = [re({
|
|
1127
1145
|
tagName: "theme-switcher"
|
|
1128
1146
|
})];
|
|
1129
|
-
let
|
|
1130
|
-
class
|
|
1147
|
+
let lr;
|
|
1148
|
+
class cr extends X {
|
|
1131
1149
|
constructor() {
|
|
1132
1150
|
super({
|
|
1133
1151
|
styleName: "theme-switcher"
|
|
1134
|
-
}),
|
|
1135
|
-
const
|
|
1136
|
-
this.setTheme(
|
|
1152
|
+
}), me(this, "_autoStyles", ir), me(this, "currentTheme", "auto"), me(this, "toggleTheme", () => {
|
|
1153
|
+
const e = ["auto", "light", "dark"], g = (e.indexOf(this.currentTheme) + 1) % e.length;
|
|
1154
|
+
this.setTheme(e[g]);
|
|
1137
1155
|
}), this.initTheme();
|
|
1138
1156
|
}
|
|
1139
1157
|
render() {
|
|
1140
|
-
return /* @__PURE__ */
|
|
1158
|
+
return /* @__PURE__ */ n("div", { class: "theme-switcher-container" }, /* @__PURE__ */ n("button", { class: "theme-switcher-btn", "data-theme": this.currentTheme, onClick: this.toggleTheme, title: `当前主题: ${this.getThemeLabel()}`, "data-wsx-key": "ThemeSwitcher-button-text-1" }, /* @__PURE__ */ n("span", { class: "theme-switcher-icon" }, this.getThemeIcon())));
|
|
1141
1159
|
}
|
|
1142
1160
|
getThemeIcon() {
|
|
1143
1161
|
const r = document.documentElement.classList.contains("dark");
|
|
@@ -1150,174 +1168,174 @@ class Ie extends J {
|
|
|
1150
1168
|
auto: "自动"
|
|
1151
1169
|
}[this.currentTheme];
|
|
1152
1170
|
}
|
|
1153
|
-
setTheme(
|
|
1154
|
-
this.currentTheme =
|
|
1171
|
+
setTheme(e) {
|
|
1172
|
+
this.currentTheme = e;
|
|
1155
1173
|
const r = document.documentElement;
|
|
1156
|
-
|
|
1174
|
+
e === "auto" ? (r.removeAttribute("class"), this.checkSystemTheme()) : r.className = e, localStorage.setItem("wsx-theme", e), this.rerender();
|
|
1157
1175
|
}
|
|
1158
1176
|
checkSystemTheme() {
|
|
1159
|
-
const
|
|
1160
|
-
document.documentElement.className =
|
|
1177
|
+
const e = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1178
|
+
document.documentElement.className = e ? "dark" : "";
|
|
1161
1179
|
}
|
|
1162
1180
|
initTheme() {
|
|
1163
|
-
const
|
|
1164
|
-
this.setTheme(
|
|
1181
|
+
const e = localStorage.getItem("wsx-theme") || "auto";
|
|
1182
|
+
this.setTheme(e), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (r) => {
|
|
1165
1183
|
this.currentTheme === "auto" && (document.documentElement.className = r.matches ? "dark" : "");
|
|
1166
1184
|
});
|
|
1167
1185
|
}
|
|
1168
1186
|
}
|
|
1169
|
-
|
|
1170
|
-
[
|
|
1171
|
-
|
|
1172
|
-
var
|
|
1173
|
-
let
|
|
1174
|
-
function
|
|
1175
|
-
return (
|
|
1187
|
+
Xe = cr;
|
|
1188
|
+
[lr, qe] = nr(Xe, [], Ye, 0, void 0, X).c;
|
|
1189
|
+
qe();
|
|
1190
|
+
var Ze;
|
|
1191
|
+
let Ve, et;
|
|
1192
|
+
function ge(t, e, r) {
|
|
1193
|
+
return (e = tt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1176
1194
|
}
|
|
1177
|
-
function
|
|
1178
|
-
function
|
|
1179
|
-
return function(
|
|
1180
|
-
return
|
|
1195
|
+
function ur(t, e, r, g, S, A) {
|
|
1196
|
+
function T(o, l, u) {
|
|
1197
|
+
return function(s, a) {
|
|
1198
|
+
return u && u(s), o[l].call(s, a);
|
|
1181
1199
|
};
|
|
1182
1200
|
}
|
|
1183
|
-
function
|
|
1184
|
-
for (var
|
|
1185
|
-
return
|
|
1201
|
+
function B(o, l) {
|
|
1202
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1203
|
+
return l;
|
|
1186
1204
|
}
|
|
1187
|
-
function
|
|
1188
|
-
if (typeof o != "function" && (
|
|
1205
|
+
function _(o, l, u, s) {
|
|
1206
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
1189
1207
|
return o;
|
|
1190
1208
|
}
|
|
1191
|
-
function
|
|
1192
|
-
function v(
|
|
1193
|
-
if (!p(
|
|
1209
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
1210
|
+
function v(c) {
|
|
1211
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1194
1212
|
}
|
|
1195
|
-
var
|
|
1196
|
-
if (!
|
|
1197
|
-
|
|
1198
|
-
var i = {}, C = [], m =
|
|
1199
|
-
y ? (
|
|
1213
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
1214
|
+
if (!z) {
|
|
1215
|
+
u || Array.isArray(x) || (x = [x]);
|
|
1216
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
1217
|
+
y ? (b || f ? i = { get: Se(function() {
|
|
1200
1218
|
return k(this);
|
|
1201
|
-
},
|
|
1202
|
-
|
|
1203
|
-
} } : i[m] = k,
|
|
1204
|
-
}
|
|
1205
|
-
for (var h = o, I = x.length - 1; I >= 0; I -=
|
|
1206
|
-
var
|
|
1207
|
-
if (
|
|
1208
|
-
|
|
1209
|
-
}).bind(null,
|
|
1219
|
+
}, s, "get"), set: function(c) {
|
|
1220
|
+
l[4](this, c);
|
|
1221
|
+
} } : i[m] = k, b || Se(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
1222
|
+
}
|
|
1223
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1224
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
1225
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1226
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
1227
|
+
}).bind(null, J) };
|
|
1210
1228
|
try {
|
|
1211
|
-
if (
|
|
1229
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1212
1230
|
else {
|
|
1213
|
-
var
|
|
1214
|
-
|
|
1215
|
-
return v(
|
|
1216
|
-
} : (
|
|
1217
|
-
return
|
|
1218
|
-
}, (
|
|
1219
|
-
|
|
1231
|
+
var $, R;
|
|
1232
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
1233
|
+
return v(c), i.value;
|
|
1234
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
1235
|
+
return c[s];
|
|
1236
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
1237
|
+
c[s] = w;
|
|
1220
1238
|
}));
|
|
1221
|
-
var
|
|
1222
|
-
return
|
|
1239
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1240
|
+
return s in c;
|
|
1223
1241
|
} };
|
|
1224
|
-
if (
|
|
1225
|
-
if (typeof h == "object" && h) (
|
|
1242
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1243
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
1226
1244
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1227
|
-
} else
|
|
1245
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
1228
1246
|
}
|
|
1229
1247
|
} finally {
|
|
1230
|
-
|
|
1248
|
+
J.v = !0;
|
|
1231
1249
|
}
|
|
1232
1250
|
}
|
|
1233
|
-
return (
|
|
1234
|
-
for (var
|
|
1251
|
+
return (b || f) && E.push(function(c, w) {
|
|
1252
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
1235
1253
|
return w;
|
|
1236
|
-
}),
|
|
1254
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
1237
1255
|
}
|
|
1238
|
-
function
|
|
1239
|
-
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value:
|
|
1256
|
+
function U(o, l) {
|
|
1257
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1240
1258
|
}
|
|
1241
|
-
if (arguments.length >= 6) var
|
|
1242
|
-
var
|
|
1243
|
-
var
|
|
1244
|
-
return
|
|
1245
|
-
},
|
|
1259
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1260
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
1261
|
+
var a, j, L = [], E = function(m) {
|
|
1262
|
+
return hr(m) === o;
|
|
1263
|
+
}, P = /* @__PURE__ */ new Map();
|
|
1246
1264
|
function y(m) {
|
|
1247
|
-
m &&
|
|
1265
|
+
m && L.push(B.bind(null, m));
|
|
1248
1266
|
}
|
|
1249
|
-
for (var
|
|
1250
|
-
var f =
|
|
1267
|
+
for (var b = 0; b < l.length; b++) {
|
|
1268
|
+
var f = l[b];
|
|
1251
1269
|
if (Array.isArray(f)) {
|
|
1252
|
-
var p = f[1], v = f[2],
|
|
1253
|
-
if (!
|
|
1254
|
-
var C =
|
|
1270
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
1271
|
+
if (!z && !d) {
|
|
1272
|
+
var C = P.get(i);
|
|
1255
1273
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1256
|
-
|
|
1274
|
+
P.set(i, !(p > 2) || p);
|
|
1257
1275
|
}
|
|
1258
|
-
|
|
1276
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : tt(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
1259
1277
|
}
|
|
1260
1278
|
}
|
|
1261
|
-
return y(
|
|
1262
|
-
}(
|
|
1263
|
-
return r.length ||
|
|
1279
|
+
return y(a), y(j), L;
|
|
1280
|
+
}(t, e, S, O);
|
|
1281
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
1264
1282
|
var o = [];
|
|
1265
|
-
return r.length && [
|
|
1283
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
1266
1284
|
} };
|
|
1267
1285
|
}
|
|
1268
|
-
function
|
|
1269
|
-
var
|
|
1270
|
-
return typeof
|
|
1286
|
+
function tt(t) {
|
|
1287
|
+
var e = dr(t, "string");
|
|
1288
|
+
return typeof e == "symbol" ? e : e + "";
|
|
1271
1289
|
}
|
|
1272
|
-
function
|
|
1273
|
-
if (typeof
|
|
1274
|
-
var r =
|
|
1290
|
+
function dr(t, e) {
|
|
1291
|
+
if (typeof t != "object" || !t) return t;
|
|
1292
|
+
var r = t[Symbol.toPrimitive];
|
|
1275
1293
|
if (r !== void 0) {
|
|
1276
|
-
var
|
|
1277
|
-
if (typeof
|
|
1294
|
+
var g = r.call(t, e);
|
|
1295
|
+
if (typeof g != "object") return g;
|
|
1278
1296
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1279
1297
|
}
|
|
1280
|
-
return String(
|
|
1298
|
+
return String(t);
|
|
1281
1299
|
}
|
|
1282
|
-
function
|
|
1283
|
-
typeof
|
|
1300
|
+
function Se(t, e, r) {
|
|
1301
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1284
1302
|
try {
|
|
1285
|
-
Object.defineProperty(
|
|
1303
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
1286
1304
|
} catch {
|
|
1287
1305
|
}
|
|
1288
|
-
return
|
|
1306
|
+
return t;
|
|
1289
1307
|
}
|
|
1290
|
-
function
|
|
1291
|
-
if (Object(
|
|
1292
|
-
return
|
|
1308
|
+
function hr(t) {
|
|
1309
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1310
|
+
return t;
|
|
1293
1311
|
}
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1312
|
+
const be = ne("SvgIcon");
|
|
1313
|
+
et = [re({
|
|
1296
1314
|
tagName: "svg-icon"
|
|
1297
1315
|
})];
|
|
1298
|
-
let
|
|
1299
|
-
class
|
|
1316
|
+
let fr;
|
|
1317
|
+
class pr extends X {
|
|
1300
1318
|
constructor() {
|
|
1301
|
-
super(),
|
|
1302
|
-
|
|
1319
|
+
super(), ge(this, "handleClick", (e) => {
|
|
1320
|
+
be.debug("SVG icon clicked", {
|
|
1303
1321
|
name: this.getAttribute("name")
|
|
1304
1322
|
}), this.dispatchEvent(new CustomEvent("icon-click", {
|
|
1305
1323
|
detail: {
|
|
1306
1324
|
name: this.getAttribute("name"),
|
|
1307
|
-
originalEvent:
|
|
1325
|
+
originalEvent: e
|
|
1308
1326
|
},
|
|
1309
1327
|
bubbles: !0
|
|
1310
1328
|
}));
|
|
1311
|
-
}),
|
|
1312
|
-
const r =
|
|
1329
|
+
}), ge(this, "handleMouseEnter", (e) => {
|
|
1330
|
+
const r = e.target;
|
|
1313
1331
|
r.style.transform = "scale(1.1)";
|
|
1314
|
-
}),
|
|
1315
|
-
const r =
|
|
1332
|
+
}), ge(this, "handleMouseLeave", (e) => {
|
|
1333
|
+
const r = e.target;
|
|
1316
1334
|
r.style.transform = "scale(1)";
|
|
1317
|
-
}),
|
|
1335
|
+
}), be.info("SvgIcon component initialized");
|
|
1318
1336
|
}
|
|
1319
1337
|
render() {
|
|
1320
|
-
const
|
|
1338
|
+
const e = this.getAttribute("size") || "24", r = this.getAttribute("color") || "currentColor", g = this.getAttribute("name") || "star", S = {
|
|
1321
1339
|
star: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",
|
|
1322
1340
|
heart: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",
|
|
1323
1341
|
check: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z",
|
|
@@ -1325,342 +1343,1271 @@ class Le extends J {
|
|
|
1325
1343
|
github: "M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22",
|
|
1326
1344
|
play: "M8 5v14l11-7z",
|
|
1327
1345
|
settings: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
|
|
1328
|
-
},
|
|
1329
|
-
return /* @__PURE__ */
|
|
1346
|
+
}, A = S[g] || S.star;
|
|
1347
|
+
return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: r, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "svg-icon", onClick: this.handleClick, style: "cursor: pointer; transition: transform 0.2s ease; display: inline-block;", onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }, /* @__PURE__ */ n("path", { d: A, fill: r }));
|
|
1330
1348
|
}
|
|
1331
1349
|
static get observedAttributes() {
|
|
1332
1350
|
return ["name", "size", "color"];
|
|
1333
1351
|
}
|
|
1334
|
-
onAttributeChanged(
|
|
1335
|
-
|
|
1352
|
+
onAttributeChanged(e, r, g) {
|
|
1353
|
+
be.debug(`Attribute ${e} changed from ${r} to ${g}`), this.connected && this.rerender();
|
|
1336
1354
|
}
|
|
1337
1355
|
}
|
|
1338
|
-
|
|
1339
|
-
[
|
|
1340
|
-
|
|
1341
|
-
var
|
|
1342
|
-
let
|
|
1343
|
-
function
|
|
1344
|
-
return (
|
|
1356
|
+
Ze = pr;
|
|
1357
|
+
[fr, Ve] = ur(Ze, [], et, 0, void 0, X).c;
|
|
1358
|
+
Ve();
|
|
1359
|
+
var rt;
|
|
1360
|
+
let ot, it;
|
|
1361
|
+
function le(t, e, r) {
|
|
1362
|
+
return (e = nt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1345
1363
|
}
|
|
1346
|
-
function
|
|
1347
|
-
function
|
|
1348
|
-
return function(
|
|
1349
|
-
return
|
|
1364
|
+
function mr(t, e, r, g, S, A) {
|
|
1365
|
+
function T(o, l, u) {
|
|
1366
|
+
return function(s, a) {
|
|
1367
|
+
return u && u(s), o[l].call(s, a);
|
|
1350
1368
|
};
|
|
1351
1369
|
}
|
|
1352
|
-
function
|
|
1353
|
-
for (var
|
|
1354
|
-
return
|
|
1370
|
+
function B(o, l) {
|
|
1371
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1372
|
+
return l;
|
|
1355
1373
|
}
|
|
1356
|
-
function
|
|
1357
|
-
if (typeof o != "function" && (
|
|
1374
|
+
function _(o, l, u, s) {
|
|
1375
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
1358
1376
|
return o;
|
|
1359
1377
|
}
|
|
1360
|
-
function
|
|
1361
|
-
function v(
|
|
1362
|
-
if (!p(
|
|
1378
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
1379
|
+
function v(c) {
|
|
1380
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1363
1381
|
}
|
|
1364
|
-
var
|
|
1365
|
-
if (!
|
|
1366
|
-
|
|
1367
|
-
var i = {}, C = [], m =
|
|
1368
|
-
y ? (
|
|
1382
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
1383
|
+
if (!z) {
|
|
1384
|
+
u || Array.isArray(x) || (x = [x]);
|
|
1385
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
1386
|
+
y ? (b || f ? i = { get: _e(function() {
|
|
1369
1387
|
return k(this);
|
|
1370
|
-
},
|
|
1371
|
-
|
|
1372
|
-
} } : i[m] = k,
|
|
1373
|
-
}
|
|
1374
|
-
for (var h = o, I = x.length - 1; I >= 0; I -=
|
|
1375
|
-
var
|
|
1376
|
-
if (
|
|
1377
|
-
|
|
1378
|
-
}).bind(null,
|
|
1388
|
+
}, s, "get"), set: function(c) {
|
|
1389
|
+
l[4](this, c);
|
|
1390
|
+
} } : i[m] = k, b || _e(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
1391
|
+
}
|
|
1392
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1393
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
1394
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1395
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
1396
|
+
}).bind(null, J) };
|
|
1379
1397
|
try {
|
|
1380
|
-
if (
|
|
1398
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1381
1399
|
else {
|
|
1382
|
-
var
|
|
1383
|
-
|
|
1384
|
-
return v(
|
|
1385
|
-
} : (
|
|
1386
|
-
return
|
|
1387
|
-
}, (
|
|
1388
|
-
|
|
1400
|
+
var $, R;
|
|
1401
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
1402
|
+
return v(c), i.value;
|
|
1403
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
1404
|
+
return c[s];
|
|
1405
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
1406
|
+
c[s] = w;
|
|
1389
1407
|
}));
|
|
1390
|
-
var
|
|
1391
|
-
return
|
|
1408
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1409
|
+
return s in c;
|
|
1392
1410
|
} };
|
|
1393
|
-
if (
|
|
1394
|
-
if (typeof h == "object" && h) (
|
|
1411
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1412
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
1395
1413
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1396
|
-
} else
|
|
1414
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
1397
1415
|
}
|
|
1398
1416
|
} finally {
|
|
1399
|
-
|
|
1417
|
+
J.v = !0;
|
|
1400
1418
|
}
|
|
1401
1419
|
}
|
|
1402
|
-
return (
|
|
1403
|
-
for (var
|
|
1420
|
+
return (b || f) && E.push(function(c, w) {
|
|
1421
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
1404
1422
|
return w;
|
|
1405
|
-
}),
|
|
1423
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
1406
1424
|
}
|
|
1407
|
-
function
|
|
1408
|
-
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value:
|
|
1425
|
+
function U(o, l) {
|
|
1426
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1409
1427
|
}
|
|
1410
|
-
if (arguments.length >= 6) var
|
|
1411
|
-
var
|
|
1412
|
-
var
|
|
1413
|
-
return
|
|
1414
|
-
},
|
|
1428
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1429
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
1430
|
+
var a, j, L = [], E = function(m) {
|
|
1431
|
+
return br(m) === o;
|
|
1432
|
+
}, P = /* @__PURE__ */ new Map();
|
|
1415
1433
|
function y(m) {
|
|
1416
|
-
m &&
|
|
1434
|
+
m && L.push(B.bind(null, m));
|
|
1417
1435
|
}
|
|
1418
|
-
for (var
|
|
1419
|
-
var f =
|
|
1436
|
+
for (var b = 0; b < l.length; b++) {
|
|
1437
|
+
var f = l[b];
|
|
1420
1438
|
if (Array.isArray(f)) {
|
|
1421
|
-
var p = f[1], v = f[2],
|
|
1422
|
-
if (!
|
|
1423
|
-
var C =
|
|
1439
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
1440
|
+
if (!z && !d) {
|
|
1441
|
+
var C = P.get(i);
|
|
1424
1442
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1425
|
-
|
|
1443
|
+
P.set(i, !(p > 2) || p);
|
|
1426
1444
|
}
|
|
1427
|
-
|
|
1445
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : nt(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
1428
1446
|
}
|
|
1429
1447
|
}
|
|
1430
|
-
return y(
|
|
1431
|
-
}(
|
|
1432
|
-
return r.length ||
|
|
1448
|
+
return y(a), y(j), L;
|
|
1449
|
+
}(t, e, S, O);
|
|
1450
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
1433
1451
|
var o = [];
|
|
1434
|
-
return r.length && [
|
|
1452
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
1435
1453
|
} };
|
|
1436
1454
|
}
|
|
1437
|
-
function
|
|
1438
|
-
var
|
|
1439
|
-
return typeof
|
|
1455
|
+
function nt(t) {
|
|
1456
|
+
var e = gr(t, "string");
|
|
1457
|
+
return typeof e == "symbol" ? e : e + "";
|
|
1440
1458
|
}
|
|
1441
|
-
function
|
|
1442
|
-
if (typeof
|
|
1443
|
-
var r =
|
|
1459
|
+
function gr(t, e) {
|
|
1460
|
+
if (typeof t != "object" || !t) return t;
|
|
1461
|
+
var r = t[Symbol.toPrimitive];
|
|
1444
1462
|
if (r !== void 0) {
|
|
1445
|
-
var
|
|
1446
|
-
if (typeof
|
|
1463
|
+
var g = r.call(t, e);
|
|
1464
|
+
if (typeof g != "object") return g;
|
|
1447
1465
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1448
1466
|
}
|
|
1449
|
-
return String(
|
|
1467
|
+
return String(t);
|
|
1450
1468
|
}
|
|
1451
|
-
function
|
|
1452
|
-
typeof
|
|
1469
|
+
function _e(t, e, r) {
|
|
1470
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1453
1471
|
try {
|
|
1454
|
-
Object.defineProperty(
|
|
1472
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
1455
1473
|
} catch {
|
|
1456
1474
|
}
|
|
1457
|
-
return
|
|
1475
|
+
return t;
|
|
1458
1476
|
}
|
|
1459
|
-
function
|
|
1460
|
-
if (Object(
|
|
1461
|
-
return
|
|
1477
|
+
function br(t) {
|
|
1478
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1479
|
+
return t;
|
|
1462
1480
|
}
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1481
|
+
const de = ne("SvgDemo");
|
|
1482
|
+
it = [re({
|
|
1465
1483
|
tagName: "svg-demo"
|
|
1466
1484
|
})];
|
|
1467
|
-
let
|
|
1468
|
-
class
|
|
1485
|
+
let yr;
|
|
1486
|
+
class vr extends X {
|
|
1469
1487
|
constructor() {
|
|
1470
|
-
super(),
|
|
1471
|
-
|
|
1472
|
-
}),
|
|
1473
|
-
|
|
1474
|
-
}),
|
|
1488
|
+
super(), le(this, "animationId", null), le(this, "rotationAngle", 0), le(this, "showTooltip", (e, r) => {
|
|
1489
|
+
e.target.setAttribute("fill", "#e74c3c"), de.debug(`Tooltip value: ${r}`);
|
|
1490
|
+
}), le(this, "hideTooltip", (e) => {
|
|
1491
|
+
e.target.setAttribute("fill", "#3498db");
|
|
1492
|
+
}), le(this, "startAnimation", () => {
|
|
1475
1493
|
if (this.animationId) return;
|
|
1476
|
-
const
|
|
1477
|
-
this.rotationAngle += 2, this.rotationAngle >= 360 && (this.rotationAngle = 0), this.rerender(), this.animationId = requestAnimationFrame(
|
|
1494
|
+
const e = () => {
|
|
1495
|
+
this.rotationAngle += 2, this.rotationAngle >= 360 && (this.rotationAngle = 0), this.rerender(), this.animationId = requestAnimationFrame(e);
|
|
1478
1496
|
};
|
|
1479
|
-
this.animationId = requestAnimationFrame(
|
|
1480
|
-
}),
|
|
1497
|
+
this.animationId = requestAnimationFrame(e);
|
|
1498
|
+
}), le(this, "stopAnimation", () => {
|
|
1481
1499
|
this.animationId && (cancelAnimationFrame(this.animationId), this.animationId = null);
|
|
1482
|
-
}),
|
|
1500
|
+
}), de.info("SvgDemo component initialized");
|
|
1483
1501
|
}
|
|
1484
1502
|
render() {
|
|
1485
|
-
return /* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ n("div", { style: "padding: 20px; background: #f5f5f5; border-radius: 8px; margin: 10px 0;" }, /* @__PURE__ */ n("h3", { style: "margin-top: 0; color: #333;" }, "SVG Showcase"), /* @__PURE__ */ n("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Basic Shapes"), /* @__PURE__ */ n("svg", { width: "300", height: "100", style: "border: 1px solid #ddd; background: white;" }, /* @__PURE__ */ n("circle", { cx: "50", cy: "50", r: "30", fill: "#e74c3c", stroke: "#c0392b", strokeWidth: "2" }), /* @__PURE__ */ n("rect", { x: "100", y: "20", width: "60", height: "60", fill: "#3498db", stroke: "#2980b9", strokeWidth: "2", rx: "5" }), /* @__PURE__ */ n("polygon", { points: "200,20 230,80 170,80", fill: "#2ecc71", stroke: "#27ae60", strokeWidth: "2" }), /* @__PURE__ */ n("line", { x1: "250", y1: "20", x2: "290", y2: "80", stroke: "#9b59b6", strokeWidth: "3", strokeLinecap: "round" }))), /* @__PURE__ */ n("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Gradients & Effects"), /* @__PURE__ */ n("svg", { width: "300", height: "100", style: "border: 1px solid #ddd; background: white;" }, /* @__PURE__ */ n("defs", null, /* @__PURE__ */ n("linearGradient", { id: "blueGradient", x1: "0%", y1: "0%", x2: "100%", y2: "0%" }, /* @__PURE__ */ n("stop", { offset: "0%", stopColor: "#3498db" }), /* @__PURE__ */ n("stop", { offset: "100%", stopColor: "#9b59b6" })), /* @__PURE__ */ n("radialGradient", { id: "redGradient", cx: "50%", cy: "50%", r: "50%" }, /* @__PURE__ */ n("stop", { offset: "0%", stopColor: "#e74c3c" }), /* @__PURE__ */ n("stop", { offset: "100%", stopColor: "#c0392b" }))), /* @__PURE__ */ n("rect", { x: "20", y: "20", width: "120", height: "60", fill: "url(#blueGradient)", rx: "10" }), /* @__PURE__ */ n("circle", { cx: "200", cy: "50", r: "35", fill: "url(#redGradient)" }))), /* @__PURE__ */ n("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Animation"), /* @__PURE__ */ n("svg", { width: "300", height: "100", style: "border: 1px solid #ddd; background: white;" }, /* @__PURE__ */ n("g", { transform: `translate(150, 50) rotate(${this.rotationAngle})` }, /* @__PURE__ */ n("polygon", { points: "-30,0 0,-40 30,0 0,40", fill: "#f39c12", stroke: "#e67e22", strokeWidth: "2" }), /* @__PURE__ */ n("circle", { cx: "0", cy: "0", r: "8", fill: "#2c3e50" }))), /* @__PURE__ */ n("div", { style: "margin-top: 10px;" }, /* @__PURE__ */ n("button", { onClick: this.startAnimation, style: "margin-right: 10px; padding: 5px 10px;", "data-wsx-key": "SvgDemo-button-text-13-5-1" }, "Start Animation"), /* @__PURE__ */ n("button", { onClick: this.stopAnimation, style: "padding: 5px 10px;", "data-wsx-key": "SvgDemo-button-text-13-5-3" }, "Stop Animation"))), /* @__PURE__ */ n("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Interactive Chart"), this.renderChart()), /* @__PURE__ */ n("div", null, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Icon Components"), /* @__PURE__ */ n("div", { style: "display: flex; gap: 15px; align-items: center;" }, /* @__PURE__ */ n("svg-icon", { name: "star", size: "32", color: "#f39c12" }), /* @__PURE__ */ n("svg-icon", { name: "heart", size: "32", color: "#e74c3c" }), /* @__PURE__ */ n("svg-icon", { name: "check", size: "32", color: "#27ae60" }), /* @__PURE__ */ n("svg-icon", { name: "github", size: "32", color: "#333" }), /* @__PURE__ */ n("svg-icon", { name: "play", size: "32", color: "#3498db" }), /* @__PURE__ */ n("svg-icon", { name: "settings", size: "32", color: "#9b59b6" }))));
|
|
1486
1504
|
}
|
|
1487
1505
|
renderChart() {
|
|
1488
|
-
const
|
|
1489
|
-
return /* @__PURE__ */
|
|
1490
|
-
const
|
|
1491
|
-
return /* @__PURE__ */
|
|
1506
|
+
const e = [30, 80, 45, 60, 20, 90, 55], r = Math.max(...e), g = 30, S = 40, A = 120, T = e.length * S + 40;
|
|
1507
|
+
return /* @__PURE__ */ n("svg", { width: T, height: A + 40, style: "border: 1px solid #ddd; background: white;" }, e.map((B, _) => {
|
|
1508
|
+
const M = B / r * A, U = _ * S + 20, H = A - M + 20;
|
|
1509
|
+
return /* @__PURE__ */ n("g", { key: _ }, /* @__PURE__ */ n("rect", { x: U, y: H, width: g, height: M, fill: "#3498db", stroke: "#2980b9", strokeWidth: "1", onMouseEnter: (O) => this.showTooltip(O, B), onMouseLeave: this.hideTooltip, style: "cursor: pointer; transition: fill 0.2s;" }), /* @__PURE__ */ n("text", { x: U + g / 2, y: A + 35, textAnchor: "middle", fontSize: "12", fill: "#666" }, _ + 1));
|
|
1492
1510
|
}));
|
|
1493
1511
|
}
|
|
1494
1512
|
onConnected() {
|
|
1495
|
-
|
|
1513
|
+
de.info("SvgDemo connected to DOM");
|
|
1496
1514
|
}
|
|
1497
1515
|
onDisconnected() {
|
|
1498
|
-
|
|
1516
|
+
de.info("SvgDemo disconnected from DOM"), this.stopAnimation();
|
|
1499
1517
|
}
|
|
1500
1518
|
}
|
|
1501
|
-
|
|
1502
|
-
[
|
|
1503
|
-
|
|
1504
|
-
var
|
|
1505
|
-
let
|
|
1506
|
-
function
|
|
1507
|
-
return (
|
|
1519
|
+
rt = vr;
|
|
1520
|
+
[yr, ot] = mr(rt, [], it, 0, void 0, X).c;
|
|
1521
|
+
ot();
|
|
1522
|
+
var st;
|
|
1523
|
+
let at, lt;
|
|
1524
|
+
function ye(t, e, r) {
|
|
1525
|
+
return (e = ct(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1508
1526
|
}
|
|
1509
|
-
function
|
|
1510
|
-
function
|
|
1511
|
-
return function(
|
|
1512
|
-
return
|
|
1527
|
+
function xr(t, e, r, g, S, A) {
|
|
1528
|
+
function T(o, l, u) {
|
|
1529
|
+
return function(s, a) {
|
|
1530
|
+
return u && u(s), o[l].call(s, a);
|
|
1513
1531
|
};
|
|
1514
1532
|
}
|
|
1515
|
-
function
|
|
1516
|
-
for (var
|
|
1517
|
-
return
|
|
1533
|
+
function B(o, l) {
|
|
1534
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1535
|
+
return l;
|
|
1518
1536
|
}
|
|
1519
|
-
function
|
|
1520
|
-
if (typeof o != "function" && (
|
|
1537
|
+
function _(o, l, u, s) {
|
|
1538
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
1521
1539
|
return o;
|
|
1522
1540
|
}
|
|
1523
|
-
function
|
|
1524
|
-
function v(
|
|
1525
|
-
if (!p(
|
|
1541
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
1542
|
+
function v(c) {
|
|
1543
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1526
1544
|
}
|
|
1527
|
-
var
|
|
1528
|
-
if (!
|
|
1529
|
-
|
|
1530
|
-
var i = {}, C = [], m =
|
|
1531
|
-
y ? (
|
|
1545
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
1546
|
+
if (!z) {
|
|
1547
|
+
u || Array.isArray(x) || (x = [x]);
|
|
1548
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
1549
|
+
y ? (b || f ? i = { get: Ee(function() {
|
|
1532
1550
|
return k(this);
|
|
1533
|
-
},
|
|
1534
|
-
|
|
1535
|
-
} } : i[m] = k,
|
|
1536
|
-
}
|
|
1537
|
-
for (var h = o, I = x.length - 1; I >= 0; I -=
|
|
1538
|
-
var
|
|
1539
|
-
if (
|
|
1540
|
-
|
|
1541
|
-
}).bind(null,
|
|
1551
|
+
}, s, "get"), set: function(c) {
|
|
1552
|
+
l[4](this, c);
|
|
1553
|
+
} } : i[m] = k, b || Ee(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
1554
|
+
}
|
|
1555
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1556
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
1557
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1558
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
1559
|
+
}).bind(null, J) };
|
|
1542
1560
|
try {
|
|
1543
|
-
if (
|
|
1561
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1544
1562
|
else {
|
|
1545
|
-
var
|
|
1546
|
-
|
|
1547
|
-
return v(
|
|
1548
|
-
} : (
|
|
1549
|
-
return
|
|
1550
|
-
}, (
|
|
1551
|
-
|
|
1563
|
+
var $, R;
|
|
1564
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
1565
|
+
return v(c), i.value;
|
|
1566
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
1567
|
+
return c[s];
|
|
1568
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
1569
|
+
c[s] = w;
|
|
1552
1570
|
}));
|
|
1553
|
-
var
|
|
1554
|
-
return
|
|
1571
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1572
|
+
return s in c;
|
|
1555
1573
|
} };
|
|
1556
|
-
if (
|
|
1557
|
-
if (typeof h == "object" && h) (
|
|
1574
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1575
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
1558
1576
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1559
|
-
} else
|
|
1577
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
1560
1578
|
}
|
|
1561
1579
|
} finally {
|
|
1562
|
-
|
|
1580
|
+
J.v = !0;
|
|
1563
1581
|
}
|
|
1564
1582
|
}
|
|
1565
|
-
return (
|
|
1566
|
-
for (var
|
|
1583
|
+
return (b || f) && E.push(function(c, w) {
|
|
1584
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
1567
1585
|
return w;
|
|
1568
|
-
}),
|
|
1586
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
1569
1587
|
}
|
|
1570
|
-
function
|
|
1571
|
-
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value:
|
|
1588
|
+
function U(o, l) {
|
|
1589
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1572
1590
|
}
|
|
1573
|
-
if (arguments.length >= 6) var
|
|
1574
|
-
var
|
|
1575
|
-
var
|
|
1576
|
-
return
|
|
1577
|
-
},
|
|
1591
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1592
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
1593
|
+
var a, j, L = [], E = function(m) {
|
|
1594
|
+
return Cr(m) === o;
|
|
1595
|
+
}, P = /* @__PURE__ */ new Map();
|
|
1578
1596
|
function y(m) {
|
|
1579
|
-
m &&
|
|
1597
|
+
m && L.push(B.bind(null, m));
|
|
1580
1598
|
}
|
|
1581
|
-
for (var
|
|
1582
|
-
var f =
|
|
1599
|
+
for (var b = 0; b < l.length; b++) {
|
|
1600
|
+
var f = l[b];
|
|
1583
1601
|
if (Array.isArray(f)) {
|
|
1584
|
-
var p = f[1], v = f[2],
|
|
1585
|
-
if (!
|
|
1586
|
-
var C =
|
|
1602
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
1603
|
+
if (!z && !d) {
|
|
1604
|
+
var C = P.get(i);
|
|
1587
1605
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1588
|
-
|
|
1606
|
+
P.set(i, !(p > 2) || p);
|
|
1589
1607
|
}
|
|
1590
|
-
|
|
1608
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : ct(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
1591
1609
|
}
|
|
1592
1610
|
}
|
|
1593
|
-
return y(
|
|
1594
|
-
}(
|
|
1595
|
-
return r.length ||
|
|
1611
|
+
return y(a), y(j), L;
|
|
1612
|
+
}(t, e, S, O);
|
|
1613
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
1596
1614
|
var o = [];
|
|
1597
|
-
return r.length && [
|
|
1615
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
1598
1616
|
} };
|
|
1599
1617
|
}
|
|
1600
|
-
function
|
|
1601
|
-
var
|
|
1602
|
-
return typeof
|
|
1618
|
+
function ct(t) {
|
|
1619
|
+
var e = kr(t, "string");
|
|
1620
|
+
return typeof e == "symbol" ? e : e + "";
|
|
1603
1621
|
}
|
|
1604
|
-
function
|
|
1605
|
-
if (typeof
|
|
1606
|
-
var r =
|
|
1622
|
+
function kr(t, e) {
|
|
1623
|
+
if (typeof t != "object" || !t) return t;
|
|
1624
|
+
var r = t[Symbol.toPrimitive];
|
|
1607
1625
|
if (r !== void 0) {
|
|
1608
|
-
var
|
|
1609
|
-
if (typeof
|
|
1626
|
+
var g = r.call(t, e);
|
|
1627
|
+
if (typeof g != "object") return g;
|
|
1610
1628
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1611
1629
|
}
|
|
1612
|
-
return String(
|
|
1630
|
+
return String(t);
|
|
1613
1631
|
}
|
|
1614
|
-
function
|
|
1615
|
-
typeof
|
|
1632
|
+
function Ee(t, e, r) {
|
|
1633
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1616
1634
|
try {
|
|
1617
|
-
Object.defineProperty(
|
|
1635
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
1618
1636
|
} catch {
|
|
1619
1637
|
}
|
|
1620
|
-
return
|
|
1638
|
+
return t;
|
|
1621
1639
|
}
|
|
1622
|
-
function
|
|
1623
|
-
if (Object(
|
|
1624
|
-
return
|
|
1640
|
+
function Cr(t) {
|
|
1641
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1642
|
+
return t;
|
|
1625
1643
|
}
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1644
|
+
const wr = ne("SimpleReactiveDemo");
|
|
1645
|
+
lt = [re({
|
|
1628
1646
|
tagName: "simple-reactive-demo"
|
|
1629
1647
|
})];
|
|
1630
|
-
let
|
|
1631
|
-
class
|
|
1648
|
+
let Tr;
|
|
1649
|
+
class Sr extends X {
|
|
1632
1650
|
constructor() {
|
|
1633
|
-
super(),
|
|
1651
|
+
super(), ye(this, "state", void 0), ye(this, "increment", () => {
|
|
1634
1652
|
this.state.count++, this.state.message = `Clicked ${this.state.count} time${this.state.count === 1 ? "" : "s"}!`;
|
|
1635
|
-
}),
|
|
1653
|
+
}), ye(this, "reset", () => {
|
|
1636
1654
|
this.state.count = 0, this.state.message = "Reset! Click again!";
|
|
1637
|
-
}),
|
|
1655
|
+
}), wr.info("SimpleReactiveDemo initialized");
|
|
1656
|
+
let e = this.reactive({
|
|
1638
1657
|
count: 0,
|
|
1639
1658
|
message: "Click the button!"
|
|
1640
1659
|
});
|
|
1660
|
+
Object.defineProperty(this, "state", {
|
|
1661
|
+
get: () => e,
|
|
1662
|
+
set: (r) => {
|
|
1663
|
+
e = r !== null && typeof r < "u" && (Array.isArray(r) || typeof r == "object") ? this.reactive(r) : r, this.scheduleRerender();
|
|
1664
|
+
},
|
|
1665
|
+
enumerable: !0,
|
|
1666
|
+
configurable: !0
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
render() {
|
|
1670
|
+
return /* @__PURE__ */ n("div", { style: "padding: 20px; border: 1px solid #ccc; border-radius: 8px; margin: 20px;" }, /* @__PURE__ */ n("h3", null, "📱 Simple Reactive Demo"), /* @__PURE__ */ n("p", null, this.state.message), /* @__PURE__ */ n("div", { style: "font-size: 24px; margin: 16px 0;" }, "Count: ", /* @__PURE__ */ n("strong", null, this.state.count)), /* @__PURE__ */ n("div", null, /* @__PURE__ */ n("button", { onClick: this.increment, style: "margin-right: 8px; padding: 8px 16px;", "data-wsx-key": "SimpleReactiveDemo-button-text-7-1" }, "+ Increment"), /* @__PURE__ */ n("button", { onClick: this.reset, style: "padding: 8px 16px;", "data-wsx-key": "SimpleReactiveDemo-button-text-7-3" }, "🔄 Reset")), /* @__PURE__ */ n("div", { style: "margin-top: 16px; font-size: 12px; color: #666;" }, "💡 State changes automatically trigger re-renders!"));
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
st = Sr;
|
|
1674
|
+
[Tr, at] = xr(st, [], lt, 0, void 0, X).c;
|
|
1675
|
+
at();
|
|
1676
|
+
const _r = ".todo-list{padding:1.5rem;max-width:600px;margin:0 auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.todo-header{margin-bottom:1.5rem;text-align:center}.todo-header h2{margin:0 0 .5rem;color:#333;font-size:1.75rem}.subtitle{margin:0;color:#666;font-size:.9rem}.todo-input-section{display:flex;gap:.5rem;margin-bottom:1rem}.todo-input{flex:1;padding:.75rem;border:2px solid #ddd;border-radius:4px;font-size:1rem;transition:border-color .2s}.todo-input:focus{outline:none;border-color:#4caf50}.todo-filters{display:flex;gap:.5rem;margin-bottom:1rem;justify-content:center}.filter-btn{padding:.5rem 1rem;border:2px solid #ddd;background:#fff;border-radius:4px;cursor:pointer;transition:all .2s;font-size:.9rem}.filter-btn:hover{background:#f5f5f5}.filter-btn.active{background:#4caf50;color:#fff;border-color:#4caf50}.todo-list-container{min-height:200px;margin-bottom:1rem}.empty-state{text-align:center;padding:3rem 1rem;color:#999;font-style:italic}.todo-items{list-style:none;padding:0;margin:0}.todo-item{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.5rem;background:#f9f9f9;border-radius:4px;transition:background .2s}.todo-item:hover{background:#f0f0f0}.todo-item.completed{opacity:.6}.todo-checkbox{width:1.25rem;height:1.25rem;cursor:pointer}.todo-text{flex:1;font-size:1rem}.todo-item.completed .todo-text{text-decoration:line-through;color:#999}.todo-actions{display:flex;gap:.5rem;justify-content:center;margin-top:1rem}.btn{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;transition:all .2s}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:#4caf50;color:#fff}.btn-primary:hover:not(:disabled){background:#45a049}.btn-warning{background:#ff9800;color:#fff}.btn-warning:hover{background:#e68900}.btn-danger{background:#f44336;color:#fff}.btn-danger:hover{background:#da190b}.btn-sm{padding:.25rem .5rem;font-size:.8rem}.debug-info{margin-top:2rem;padding-top:1rem;border-top:1px solid #ddd}.debug-info summary{cursor:pointer;color:#666;font-size:.9rem}.debug-info pre{background:#f5f5f5;padding:1rem;border-radius:4px;overflow-x:auto;font-size:.85rem;margin-top:.5rem}";
|
|
1677
|
+
var ut;
|
|
1678
|
+
let dt, ht;
|
|
1679
|
+
function ee(t, e, r) {
|
|
1680
|
+
return (e = ft(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1681
|
+
}
|
|
1682
|
+
function Er(t, e, r, g, S, A) {
|
|
1683
|
+
function T(o, l, u) {
|
|
1684
|
+
return function(s, a) {
|
|
1685
|
+
return u && u(s), o[l].call(s, a);
|
|
1686
|
+
};
|
|
1687
|
+
}
|
|
1688
|
+
function B(o, l) {
|
|
1689
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1690
|
+
return l;
|
|
1691
|
+
}
|
|
1692
|
+
function _(o, l, u, s) {
|
|
1693
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
1694
|
+
return o;
|
|
1695
|
+
}
|
|
1696
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
1697
|
+
function v(c) {
|
|
1698
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1699
|
+
}
|
|
1700
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
1701
|
+
if (!z) {
|
|
1702
|
+
u || Array.isArray(x) || (x = [x]);
|
|
1703
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
1704
|
+
y ? (b || f ? i = { get: ze(function() {
|
|
1705
|
+
return k(this);
|
|
1706
|
+
}, s, "get"), set: function(c) {
|
|
1707
|
+
l[4](this, c);
|
|
1708
|
+
} } : i[m] = k, b || ze(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
1709
|
+
}
|
|
1710
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1711
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
1712
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1713
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
1714
|
+
}).bind(null, J) };
|
|
1715
|
+
try {
|
|
1716
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1717
|
+
else {
|
|
1718
|
+
var $, R;
|
|
1719
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
1720
|
+
return v(c), i.value;
|
|
1721
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
1722
|
+
return c[s];
|
|
1723
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
1724
|
+
c[s] = w;
|
|
1725
|
+
}));
|
|
1726
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1727
|
+
return s in c;
|
|
1728
|
+
} };
|
|
1729
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1730
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
1731
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1732
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
1733
|
+
}
|
|
1734
|
+
} finally {
|
|
1735
|
+
J.v = !0;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
return (b || f) && E.push(function(c, w) {
|
|
1739
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
1740
|
+
return w;
|
|
1741
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
1742
|
+
}
|
|
1743
|
+
function U(o, l) {
|
|
1744
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1745
|
+
}
|
|
1746
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1747
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
1748
|
+
var a, j, L = [], E = function(m) {
|
|
1749
|
+
return Ar(m) === o;
|
|
1750
|
+
}, P = /* @__PURE__ */ new Map();
|
|
1751
|
+
function y(m) {
|
|
1752
|
+
m && L.push(B.bind(null, m));
|
|
1753
|
+
}
|
|
1754
|
+
for (var b = 0; b < l.length; b++) {
|
|
1755
|
+
var f = l[b];
|
|
1756
|
+
if (Array.isArray(f)) {
|
|
1757
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
1758
|
+
if (!z && !d) {
|
|
1759
|
+
var C = P.get(i);
|
|
1760
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1761
|
+
P.set(i, !(p > 2) || p);
|
|
1762
|
+
}
|
|
1763
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : ft(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
return y(a), y(j), L;
|
|
1767
|
+
}(t, e, S, O);
|
|
1768
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
1769
|
+
var o = [];
|
|
1770
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
1771
|
+
} };
|
|
1772
|
+
}
|
|
1773
|
+
function ft(t) {
|
|
1774
|
+
var e = zr(t, "string");
|
|
1775
|
+
return typeof e == "symbol" ? e : e + "";
|
|
1776
|
+
}
|
|
1777
|
+
function zr(t, e) {
|
|
1778
|
+
if (typeof t != "object" || !t) return t;
|
|
1779
|
+
var r = t[Symbol.toPrimitive];
|
|
1780
|
+
if (r !== void 0) {
|
|
1781
|
+
var g = r.call(t, e);
|
|
1782
|
+
if (typeof g != "object") return g;
|
|
1783
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1784
|
+
}
|
|
1785
|
+
return String(t);
|
|
1786
|
+
}
|
|
1787
|
+
function ze(t, e, r) {
|
|
1788
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1789
|
+
try {
|
|
1790
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
1791
|
+
} catch {
|
|
1792
|
+
}
|
|
1793
|
+
return t;
|
|
1794
|
+
}
|
|
1795
|
+
function Ar(t) {
|
|
1796
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1797
|
+
return t;
|
|
1798
|
+
}
|
|
1799
|
+
const se = ne("TodoList");
|
|
1800
|
+
ht = [re({
|
|
1801
|
+
tagName: "todo-list"
|
|
1802
|
+
})];
|
|
1803
|
+
let jr;
|
|
1804
|
+
class Lr extends X {
|
|
1805
|
+
constructor() {
|
|
1806
|
+
super(), ee(this, "_autoStyles", _r), ee(this, "todos", void 0), ee(this, "_newTodoText", ""), ee(this, "filter", void 0), ee(this, "nextId", 1), ee(this, "handleInputChange", (S) => {
|
|
1807
|
+
var B;
|
|
1808
|
+
const A = S.target;
|
|
1809
|
+
this._newTodoText = A.value;
|
|
1810
|
+
const T = (B = this.shadowRoot) == null ? void 0 : B.querySelector(".todo-input-section .btn-primary");
|
|
1811
|
+
T && (T.disabled = !this._newTodoText.trim());
|
|
1812
|
+
}), ee(this, "handleKeyDown", (S) => {
|
|
1813
|
+
S.key === "Enter" && this._newTodoText.trim() && this.addTodo();
|
|
1814
|
+
}), ee(this, "addTodo", () => {
|
|
1815
|
+
var T, B;
|
|
1816
|
+
const S = (T = this.shadowRoot) == null ? void 0 : T.querySelector(".todo-input"), A = (S == null ? void 0 : S.value.trim()) || this._newTodoText.trim();
|
|
1817
|
+
if (A) {
|
|
1818
|
+
if (this.todos = [...this.todos, {
|
|
1819
|
+
id: this.nextId++,
|
|
1820
|
+
text: A,
|
|
1821
|
+
completed: !1,
|
|
1822
|
+
createdAt: Date.now()
|
|
1823
|
+
}], this._newTodoText = "", S) {
|
|
1824
|
+
S.value = "";
|
|
1825
|
+
const _ = (B = this.shadowRoot) == null ? void 0 : B.querySelector(".todo-input-section .btn-primary");
|
|
1826
|
+
_ && (_.disabled = !0);
|
|
1827
|
+
}
|
|
1828
|
+
se.debug("Todo added", {
|
|
1829
|
+
count: this.todos.length
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
}), ee(this, "removeTodo", (S) => {
|
|
1833
|
+
this.todos = this.todos.filter((A) => A.id !== S), se.debug("Todo removed", {
|
|
1834
|
+
id: S,
|
|
1835
|
+
remaining: this.todos.length
|
|
1836
|
+
});
|
|
1837
|
+
}), ee(this, "toggleTodo", (S) => {
|
|
1838
|
+
this.todos = this.todos.map((A) => A.id === S ? {
|
|
1839
|
+
...A,
|
|
1840
|
+
completed: !A.completed
|
|
1841
|
+
} : A), se.debug("Todo toggled", {
|
|
1842
|
+
id: S
|
|
1843
|
+
});
|
|
1844
|
+
}), ee(this, "clearCompleted", () => {
|
|
1845
|
+
this.todos = this.todos.filter((S) => !S.completed), se.debug("Completed todos cleared");
|
|
1846
|
+
}), ee(this, "clearAll", () => {
|
|
1847
|
+
this.todos = [], se.debug("All todos cleared");
|
|
1848
|
+
}), se.info("TodoList initialized");
|
|
1849
|
+
let e = this.reactive([]);
|
|
1850
|
+
Object.defineProperty(this, "todos", {
|
|
1851
|
+
get: () => e,
|
|
1852
|
+
set: (S) => {
|
|
1853
|
+
e = S !== null && typeof S < "u" && (Array.isArray(S) || typeof S == "object") ? this.reactive(S) : S, this.scheduleRerender();
|
|
1854
|
+
},
|
|
1855
|
+
enumerable: !0,
|
|
1856
|
+
configurable: !0
|
|
1857
|
+
});
|
|
1858
|
+
const [r, g] = this.useState("filter", "all");
|
|
1859
|
+
Object.defineProperty(this, "filter", {
|
|
1860
|
+
get: r,
|
|
1861
|
+
set: g,
|
|
1862
|
+
enumerable: !0,
|
|
1863
|
+
configurable: !0
|
|
1864
|
+
});
|
|
1865
|
+
}
|
|
1866
|
+
render() {
|
|
1867
|
+
const e = this.getFilteredTodos();
|
|
1868
|
+
return /* @__PURE__ */ n("div", { class: "todo-list" }, /* @__PURE__ */ n("div", { class: "todo-header" }, /* @__PURE__ */ n("h2", null, "📝 Todo List (WebComponent)"), /* @__PURE__ */ n("p", { class: "subtitle" }, this.todos.length, " total, ", this.getActiveCount(), " active,", " ", this.getCompletedCount(), " completed")), /* @__PURE__ */ n("div", { class: "todo-input-section" }, /* @__PURE__ */ n("input", { type: "text", class: "todo-input", placeholder: "Add a new todo...", value: this._newTodoText, onInput: this.handleInputChange, onKeyDown: this.handleKeyDown, "data-wsx-key": "TodoList-input-text-3-1" }), /* @__PURE__ */ n("button", { class: "btn btn-primary", onClick: this.addTodo, disabled: !this._newTodoText.trim(), "data-wsx-key": "TodoList-button-text-3-3" }, "Add")), /* @__PURE__ */ n("div", { class: "todo-filters" }, /* @__PURE__ */ n("button", { class: `filter-btn ${this.filter === "all" ? "active" : ""}`, onClick: () => this.filter = "all", "data-wsx-key": "TodoList-button-text-5-1" }, "All (", this.todos.length, ")"), /* @__PURE__ */ n("button", { class: `filter-btn ${this.filter === "active" ? "active" : ""}`, onClick: () => this.filter = "active", "data-wsx-key": "TodoList-button-text-5-3" }, "Active (", this.getActiveCount(), ")"), /* @__PURE__ */ n("button", { class: `filter-btn ${this.filter === "completed" ? "active" : ""}`, onClick: () => this.filter = "completed", "data-wsx-key": "TodoList-button-text-5-5" }, "Completed (", this.getCompletedCount(), ")")), /* @__PURE__ */ n("div", { class: "todo-list-container" }, e.length === 0 ? /* @__PURE__ */ n("div", { class: "empty-state" }, this.filter === "all" ? "No todos yet. Add one above! 🎉" : `No ${this.filter} todos.`) : /* @__PURE__ */ n("ul", { class: "todo-items" }, e.map((r) => /* @__PURE__ */ n("li", { key: r.id, class: `todo-item ${r.completed ? "completed" : ""}` }, /* @__PURE__ */ n("input", { type: "checkbox", checked: r.completed, onChange: () => this.toggleTodo(r.id), class: "todo-checkbox", "data-wsx-key": "TodoList-input-checkbox-7-1" }), /* @__PURE__ */ n("span", { class: "todo-text" }, r.text), /* @__PURE__ */ n("button", { class: "btn btn-sm btn-danger", onClick: () => this.removeTodo(r.id), "data-wsx-key": "TodoList-button-text-7-5" }, "Delete"))))), this.todos.length > 0 && /* @__PURE__ */ n("div", { class: "todo-actions" }, /* @__PURE__ */ n("button", { class: "btn btn-warning", onClick: this.clearCompleted, "data-wsx-key": "TodoList-button-text-1" }, "Clear Completed"), /* @__PURE__ */ n("button", { class: "btn btn-danger", onClick: this.clearAll, "data-wsx-key": "TodoList-button-text-3" }, "Clear All")), /* @__PURE__ */ n("div", { class: "debug-info" }, /* @__PURE__ */ n("details", null, /* @__PURE__ */ n("summary", null, "Debug Info"), /* @__PURE__ */ n("pre", null, JSON.stringify({
|
|
1869
|
+
todosCount: this.todos.length,
|
|
1870
|
+
filter: this.filter,
|
|
1871
|
+
newTodoText: this._newTodoText,
|
|
1872
|
+
todos: this.todos
|
|
1873
|
+
}, null, 2)))));
|
|
1874
|
+
}
|
|
1875
|
+
getFilteredTodos() {
|
|
1876
|
+
switch (this.filter) {
|
|
1877
|
+
case "active":
|
|
1878
|
+
return this.todos.filter((e) => !e.completed);
|
|
1879
|
+
case "completed":
|
|
1880
|
+
return this.todos.filter((e) => e.completed);
|
|
1881
|
+
default:
|
|
1882
|
+
return this.todos;
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
getActiveCount() {
|
|
1886
|
+
return this.todos.filter((e) => !e.completed).length;
|
|
1887
|
+
}
|
|
1888
|
+
getCompletedCount() {
|
|
1889
|
+
return this.todos.filter((e) => e.completed).length;
|
|
1890
|
+
}
|
|
1891
|
+
onConnected() {
|
|
1892
|
+
se.info("TodoList connected to DOM");
|
|
1893
|
+
}
|
|
1894
|
+
onDisconnected() {
|
|
1895
|
+
se.info("TodoList disconnected from DOM");
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
ut = Lr;
|
|
1899
|
+
[jr, dt] = Er(ut, [], ht, 0, void 0, X).c;
|
|
1900
|
+
dt();
|
|
1901
|
+
const Dr = ".todo-list-light{padding:1.5rem;max-width:600px;margin:0 auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.todo-header{margin-bottom:1.5rem;text-align:center}.todo-header h2{margin:0 0 .5rem;color:#2196f3;font-size:1.75rem}.subtitle{margin:0;color:#666;font-size:.9rem}.todo-input-section{display:flex;gap:.5rem;margin-bottom:1rem}.todo-input{flex:1;padding:.75rem;border:2px solid #ddd;border-radius:4px;font-size:1rem;transition:border-color .2s}.todo-input:focus{outline:none;border-color:#2196f3}.todo-filters{display:flex;gap:.5rem;margin-bottom:1rem;justify-content:center}.filter-btn{padding:.5rem 1rem;border:2px solid #ddd;background:#fff;border-radius:4px;cursor:pointer;transition:all .2s;font-size:.9rem}.filter-btn:hover{background:#f5f5f5}.filter-btn.active{background:#2196f3;color:#fff;border-color:#2196f3}.todo-list-container{min-height:200px;margin-bottom:1rem}.empty-state{text-align:center;padding:3rem 1rem;color:#999;font-style:italic}.todo-items{list-style:none;padding:0;margin:0}.todo-item{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.5rem;background:#f0f7ff;border-radius:4px;transition:background .2s}.todo-item:hover{background:#e3f2fd}.todo-item.completed{opacity:.6}.todo-checkbox{width:1.25rem;height:1.25rem;cursor:pointer}.todo-text{flex:1;font-size:1rem}.todo-item.completed .todo-text{text-decoration:line-through;color:#999}.todo-actions{display:flex;gap:.5rem;justify-content:center;margin-top:1rem}.btn{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;transition:all .2s}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:#2196f3;color:#fff}.btn-primary:hover:not(:disabled){background:#1976d2}.btn-warning{background:#ff9800;color:#fff}.btn-warning:hover{background:#e68900}.btn-danger{background:#f44336;color:#fff}.btn-danger:hover{background:#da190b}.btn-sm{padding:.25rem .5rem;font-size:.8rem}.debug-info{margin-top:2rem;padding-top:1rem;border-top:1px solid #ddd}.debug-info summary{cursor:pointer;color:#666;font-size:.9rem}.debug-info pre{background:#f5f5f5;padding:1rem;border-radius:4px;overflow-x:auto;font-size:.85rem;margin-top:.5rem}";
|
|
1902
|
+
var pt;
|
|
1903
|
+
let mt, gt;
|
|
1904
|
+
function te(t, e, r) {
|
|
1905
|
+
return (e = bt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1906
|
+
}
|
|
1907
|
+
function $r(t, e, r, g, S, A) {
|
|
1908
|
+
function T(o, l, u) {
|
|
1909
|
+
return function(s, a) {
|
|
1910
|
+
return u && u(s), o[l].call(s, a);
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
function B(o, l) {
|
|
1914
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1915
|
+
return l;
|
|
1916
|
+
}
|
|
1917
|
+
function _(o, l, u, s) {
|
|
1918
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
1919
|
+
return o;
|
|
1920
|
+
}
|
|
1921
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
1922
|
+
function v(c) {
|
|
1923
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1924
|
+
}
|
|
1925
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
1926
|
+
if (!z) {
|
|
1927
|
+
u || Array.isArray(x) || (x = [x]);
|
|
1928
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
1929
|
+
y ? (b || f ? i = { get: Ae(function() {
|
|
1930
|
+
return k(this);
|
|
1931
|
+
}, s, "get"), set: function(c) {
|
|
1932
|
+
l[4](this, c);
|
|
1933
|
+
} } : i[m] = k, b || Ae(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
1934
|
+
}
|
|
1935
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1936
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
1937
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1938
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
1939
|
+
}).bind(null, J) };
|
|
1940
|
+
try {
|
|
1941
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1942
|
+
else {
|
|
1943
|
+
var $, R;
|
|
1944
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
1945
|
+
return v(c), i.value;
|
|
1946
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
1947
|
+
return c[s];
|
|
1948
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
1949
|
+
c[s] = w;
|
|
1950
|
+
}));
|
|
1951
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1952
|
+
return s in c;
|
|
1953
|
+
} };
|
|
1954
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1955
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
1956
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1957
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
1958
|
+
}
|
|
1959
|
+
} finally {
|
|
1960
|
+
J.v = !0;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
return (b || f) && E.push(function(c, w) {
|
|
1964
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
1965
|
+
return w;
|
|
1966
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
1967
|
+
}
|
|
1968
|
+
function U(o, l) {
|
|
1969
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1970
|
+
}
|
|
1971
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1972
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
1973
|
+
var a, j, L = [], E = function(m) {
|
|
1974
|
+
return Pr(m) === o;
|
|
1975
|
+
}, P = /* @__PURE__ */ new Map();
|
|
1976
|
+
function y(m) {
|
|
1977
|
+
m && L.push(B.bind(null, m));
|
|
1978
|
+
}
|
|
1979
|
+
for (var b = 0; b < l.length; b++) {
|
|
1980
|
+
var f = l[b];
|
|
1981
|
+
if (Array.isArray(f)) {
|
|
1982
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
1983
|
+
if (!z && !d) {
|
|
1984
|
+
var C = P.get(i);
|
|
1985
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1986
|
+
P.set(i, !(p > 2) || p);
|
|
1987
|
+
}
|
|
1988
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : bt(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
return y(a), y(j), L;
|
|
1992
|
+
}(t, e, S, O);
|
|
1993
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
1994
|
+
var o = [];
|
|
1995
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
1996
|
+
} };
|
|
1997
|
+
}
|
|
1998
|
+
function bt(t) {
|
|
1999
|
+
var e = Or(t, "string");
|
|
2000
|
+
return typeof e == "symbol" ? e : e + "";
|
|
2001
|
+
}
|
|
2002
|
+
function Or(t, e) {
|
|
2003
|
+
if (typeof t != "object" || !t) return t;
|
|
2004
|
+
var r = t[Symbol.toPrimitive];
|
|
2005
|
+
if (r !== void 0) {
|
|
2006
|
+
var g = r.call(t, e);
|
|
2007
|
+
if (typeof g != "object") return g;
|
|
2008
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2009
|
+
}
|
|
2010
|
+
return String(t);
|
|
2011
|
+
}
|
|
2012
|
+
function Ae(t, e, r) {
|
|
2013
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
2014
|
+
try {
|
|
2015
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
2016
|
+
} catch {
|
|
2017
|
+
}
|
|
2018
|
+
return t;
|
|
2019
|
+
}
|
|
2020
|
+
function Pr(t) {
|
|
2021
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
2022
|
+
return t;
|
|
2023
|
+
}
|
|
2024
|
+
const ae = ne("TodoListLight");
|
|
2025
|
+
gt = [re({
|
|
2026
|
+
tagName: "todo-list-light"
|
|
2027
|
+
})];
|
|
2028
|
+
let Ir;
|
|
2029
|
+
class Rr extends he {
|
|
2030
|
+
constructor() {
|
|
2031
|
+
super(), te(this, "_autoStyles", Dr), te(this, "todos", void 0), te(this, "_newTodoText", ""), te(this, "filter", void 0), te(this, "nextId", 1), te(this, "handleInputChange", (S) => {
|
|
2032
|
+
const A = S.target;
|
|
2033
|
+
this._newTodoText = A.value;
|
|
2034
|
+
const T = this.querySelector(".todo-input-section .btn-primary");
|
|
2035
|
+
T && (T.disabled = !this._newTodoText.trim());
|
|
2036
|
+
}), te(this, "handleKeyDown", (S) => {
|
|
2037
|
+
S.key === "Enter" && this._newTodoText.trim() && this.addTodo();
|
|
2038
|
+
}), te(this, "addTodo", () => {
|
|
2039
|
+
const S = this.querySelector(".todo-input"), A = (S == null ? void 0 : S.value.trim()) || this._newTodoText.trim();
|
|
2040
|
+
if (A) {
|
|
2041
|
+
if (this.todos = [...this.todos, {
|
|
2042
|
+
id: this.nextId++,
|
|
2043
|
+
text: A,
|
|
2044
|
+
completed: !1,
|
|
2045
|
+
createdAt: Date.now()
|
|
2046
|
+
}], this._newTodoText = "", S) {
|
|
2047
|
+
S.value = "";
|
|
2048
|
+
const T = this.querySelector(".todo-input-section .btn-primary");
|
|
2049
|
+
T && (T.disabled = !0);
|
|
2050
|
+
}
|
|
2051
|
+
ae.debug("Todo added", {
|
|
2052
|
+
count: this.todos.length
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2055
|
+
}), te(this, "removeTodo", (S) => {
|
|
2056
|
+
this.todos = this.todos.filter((A) => A.id !== S), ae.debug("Todo removed", {
|
|
2057
|
+
id: S,
|
|
2058
|
+
remaining: this.todos.length
|
|
2059
|
+
});
|
|
2060
|
+
}), te(this, "toggleTodo", (S) => {
|
|
2061
|
+
this.todos = this.todos.map((A) => A.id === S ? {
|
|
2062
|
+
...A,
|
|
2063
|
+
completed: !A.completed
|
|
2064
|
+
} : A), ae.debug("Todo toggled", {
|
|
2065
|
+
id: S
|
|
2066
|
+
});
|
|
2067
|
+
}), te(this, "clearCompleted", () => {
|
|
2068
|
+
this.todos = this.todos.filter((S) => !S.completed), ae.debug("Completed todos cleared");
|
|
2069
|
+
}), te(this, "clearAll", () => {
|
|
2070
|
+
this.todos = [], ae.debug("All todos cleared");
|
|
2071
|
+
}), ae.info("TodoListLight initialized");
|
|
2072
|
+
let e = this.reactive([]);
|
|
2073
|
+
Object.defineProperty(this, "todos", {
|
|
2074
|
+
get: () => e,
|
|
2075
|
+
set: (S) => {
|
|
2076
|
+
e = S !== null && typeof S < "u" && (Array.isArray(S) || typeof S == "object") ? this.reactive(S) : S, this.scheduleRerender();
|
|
2077
|
+
},
|
|
2078
|
+
enumerable: !0,
|
|
2079
|
+
configurable: !0
|
|
2080
|
+
});
|
|
2081
|
+
const [r, g] = this.useState("filter", "all");
|
|
2082
|
+
Object.defineProperty(this, "filter", {
|
|
2083
|
+
get: r,
|
|
2084
|
+
set: g,
|
|
2085
|
+
enumerable: !0,
|
|
2086
|
+
configurable: !0
|
|
2087
|
+
});
|
|
2088
|
+
}
|
|
2089
|
+
render() {
|
|
2090
|
+
const e = this.getFilteredTodos();
|
|
2091
|
+
return /* @__PURE__ */ n("div", { class: "todo-list-light" }, /* @__PURE__ */ n("div", { class: "todo-header" }, /* @__PURE__ */ n("h2", null, "📝 Todo List (LightComponent)"), /* @__PURE__ */ n("p", { class: "subtitle" }, this.todos.length, " total, ", this.getActiveCount(), " active,", " ", this.getCompletedCount(), " completed")), /* @__PURE__ */ n("div", { class: "todo-input-section" }, /* @__PURE__ */ n("input", { type: "text", class: "todo-input", placeholder: "Add a new todo...", value: this._newTodoText, onInput: this.handleInputChange, onKeyDown: this.handleKeyDown, "data-wsx-key": "TodoListLight-input-text-3-1" }), /* @__PURE__ */ n("button", { class: "btn btn-primary", onClick: this.addTodo, disabled: !this._newTodoText.trim(), "data-wsx-key": "TodoListLight-button-text-3-3" }, "Add")), /* @__PURE__ */ n("div", { class: "todo-filters" }, /* @__PURE__ */ n("button", { class: `filter-btn ${this.filter === "all" ? "active" : ""}`, onClick: () => this.filter = "all", "data-wsx-key": "TodoListLight-button-text-5-1" }, "All (", this.todos.length, ")"), /* @__PURE__ */ n("button", { class: `filter-btn ${this.filter === "active" ? "active" : ""}`, onClick: () => this.filter = "active", "data-wsx-key": "TodoListLight-button-text-5-3" }, "Active (", this.getActiveCount(), ")"), /* @__PURE__ */ n("button", { class: `filter-btn ${this.filter === "completed" ? "active" : ""}`, onClick: () => this.filter = "completed", "data-wsx-key": "TodoListLight-button-text-5-5" }, "Completed (", this.getCompletedCount(), ")")), /* @__PURE__ */ n("div", { class: "todo-list-container" }, e.length === 0 ? /* @__PURE__ */ n("div", { class: "empty-state" }, this.filter === "all" ? "No todos yet. Add one above! 🎉" : `No ${this.filter} todos.`) : /* @__PURE__ */ n("ul", { class: "todo-items" }, e.map((r) => /* @__PURE__ */ n("li", { key: r.id, class: `todo-item ${r.completed ? "completed" : ""}` }, /* @__PURE__ */ n("input", { type: "checkbox", checked: r.completed, onChange: () => this.toggleTodo(r.id), class: "todo-checkbox", "data-wsx-key": "TodoListLight-input-checkbox-7-1" }), /* @__PURE__ */ n("span", { class: "todo-text" }, r.text), /* @__PURE__ */ n("button", { class: "btn btn-sm btn-danger", onClick: () => this.removeTodo(r.id), "data-wsx-key": "TodoListLight-button-text-7-5" }, "Delete"))))), this.todos.length > 0 && /* @__PURE__ */ n("div", { class: "todo-actions" }, /* @__PURE__ */ n("button", { class: "btn btn-warning", onClick: this.clearCompleted, "data-wsx-key": "TodoListLight-button-text-1" }, "Clear Completed"), /* @__PURE__ */ n("button", { class: "btn btn-danger", onClick: this.clearAll, "data-wsx-key": "TodoListLight-button-text-3" }, "Clear All")), /* @__PURE__ */ n("div", { class: "debug-info" }, /* @__PURE__ */ n("details", null, /* @__PURE__ */ n("summary", null, "Debug Info"), /* @__PURE__ */ n("pre", null, JSON.stringify({
|
|
2092
|
+
todosCount: this.todos.length,
|
|
2093
|
+
filter: this.filter,
|
|
2094
|
+
newTodoText: this._newTodoText,
|
|
2095
|
+
todos: this.todos
|
|
2096
|
+
}, null, 2)))));
|
|
2097
|
+
}
|
|
2098
|
+
getFilteredTodos() {
|
|
2099
|
+
switch (this.filter) {
|
|
2100
|
+
case "active":
|
|
2101
|
+
return this.todos.filter((e) => !e.completed);
|
|
2102
|
+
case "completed":
|
|
2103
|
+
return this.todos.filter((e) => e.completed);
|
|
2104
|
+
default:
|
|
2105
|
+
return this.todos;
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
getActiveCount() {
|
|
2109
|
+
return this.todos.filter((e) => !e.completed).length;
|
|
2110
|
+
}
|
|
2111
|
+
getCompletedCount() {
|
|
2112
|
+
return this.todos.filter((e) => e.completed).length;
|
|
2113
|
+
}
|
|
2114
|
+
onConnected() {
|
|
2115
|
+
ae.info("TodoListLight connected to DOM");
|
|
2116
|
+
}
|
|
2117
|
+
onDisconnected() {
|
|
2118
|
+
ae.info("TodoListLight disconnected from DOM");
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
pt = Rr;
|
|
2122
|
+
[Ir, mt] = $r(pt, [], gt, 0, void 0, he).c;
|
|
2123
|
+
mt();
|
|
2124
|
+
const Br = ".user-profile{padding:1.5rem;max-width:800px;margin:0 auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.profile-header{margin-bottom:2rem;text-align:center}.profile-header h2{margin:0 0 .5rem;color:#333;font-size:1.75rem}.profile-header .subtitle{color:#666;font-size:.9rem;margin:0}.profile-content{display:flex;flex-direction:column;gap:2rem}.profile-section{background:#f8f9fa;padding:1.5rem;border-radius:8px;border:1px solid #e0e0e0}.profile-section h3{margin:0 0 1rem;color:#333;font-size:1.25rem;border-bottom:2px solid #007bff;padding-bottom:.5rem}.form-group{margin-bottom:1rem}.form-group label{display:block;margin-bottom:.5rem;color:#555;font-weight:500;font-size:.9rem}.form-group input[type=checkbox]{margin-right:.5rem}.input-field{width:100%;padding:.75rem;border:1px solid #ddd;border-radius:4px;font-size:1rem;transition:border-color .2s;box-sizing:border-box}.input-field:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 3px #007bff1a}.profile-actions{display:flex;gap:1rem;flex-wrap:wrap}.btn{padding:.75rem 1.5rem;border:none;border-radius:4px;font-size:1rem;cursor:pointer;transition:all .2s;font-weight:500}.btn-primary{background:#007bff;color:#fff}.btn-primary:hover{background:#0056b3}.btn-secondary{background:#6c757d;color:#fff}.btn-secondary:hover{background:#545b62}.btn-warning{background:#ffc107;color:#212529}.btn-warning:hover{background:#e0a800}.profile-display{background:#f8f9fa;padding:1.5rem;border-radius:8px;border:1px solid #e0e0e0}.profile-display h3{margin:0 0 1rem;color:#333;font-size:1.25rem}.json-display{background:#2d2d2d;color:#f8f8f2;padding:1rem;border-radius:4px;overflow-x:auto;font-family:Courier New,monospace;font-size:.875rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word}";
|
|
2125
|
+
var yt;
|
|
2126
|
+
let vt, xt;
|
|
2127
|
+
function Q(t, e, r) {
|
|
2128
|
+
return (e = kt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
2129
|
+
}
|
|
2130
|
+
function Nr(t, e, r, g, S, A) {
|
|
2131
|
+
function T(o, l, u) {
|
|
2132
|
+
return function(s, a) {
|
|
2133
|
+
return u && u(s), o[l].call(s, a);
|
|
2134
|
+
};
|
|
2135
|
+
}
|
|
2136
|
+
function B(o, l) {
|
|
2137
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
2138
|
+
return l;
|
|
2139
|
+
}
|
|
2140
|
+
function _(o, l, u, s) {
|
|
2141
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
2142
|
+
return o;
|
|
2143
|
+
}
|
|
2144
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
2145
|
+
function v(c) {
|
|
2146
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
2147
|
+
}
|
|
2148
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
2149
|
+
if (!z) {
|
|
2150
|
+
u || Array.isArray(x) || (x = [x]);
|
|
2151
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
2152
|
+
y ? (b || f ? i = { get: je(function() {
|
|
2153
|
+
return k(this);
|
|
2154
|
+
}, s, "get"), set: function(c) {
|
|
2155
|
+
l[4](this, c);
|
|
2156
|
+
} } : i[m] = k, b || je(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
2157
|
+
}
|
|
2158
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
2159
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
2160
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
2161
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
2162
|
+
}).bind(null, J) };
|
|
2163
|
+
try {
|
|
2164
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
2165
|
+
else {
|
|
2166
|
+
var $, R;
|
|
2167
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
2168
|
+
return v(c), i.value;
|
|
2169
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
2170
|
+
return c[s];
|
|
2171
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
2172
|
+
c[s] = w;
|
|
2173
|
+
}));
|
|
2174
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
2175
|
+
return s in c;
|
|
2176
|
+
} };
|
|
2177
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
2178
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
2179
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
2180
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
2181
|
+
}
|
|
2182
|
+
} finally {
|
|
2183
|
+
J.v = !0;
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
return (b || f) && E.push(function(c, w) {
|
|
2187
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
2188
|
+
return w;
|
|
2189
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
2190
|
+
}
|
|
2191
|
+
function U(o, l) {
|
|
2192
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
2193
|
+
}
|
|
2194
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
2195
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
2196
|
+
var a, j, L = [], E = function(m) {
|
|
2197
|
+
return Ur(m) === o;
|
|
2198
|
+
}, P = /* @__PURE__ */ new Map();
|
|
2199
|
+
function y(m) {
|
|
2200
|
+
m && L.push(B.bind(null, m));
|
|
2201
|
+
}
|
|
2202
|
+
for (var b = 0; b < l.length; b++) {
|
|
2203
|
+
var f = l[b];
|
|
2204
|
+
if (Array.isArray(f)) {
|
|
2205
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
2206
|
+
if (!z && !d) {
|
|
2207
|
+
var C = P.get(i);
|
|
2208
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
2209
|
+
P.set(i, !(p > 2) || p);
|
|
2210
|
+
}
|
|
2211
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : kt(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
return y(a), y(j), L;
|
|
2215
|
+
}(t, e, S, O);
|
|
2216
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
2217
|
+
var o = [];
|
|
2218
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
2219
|
+
} };
|
|
2220
|
+
}
|
|
2221
|
+
function kt(t) {
|
|
2222
|
+
var e = Mr(t, "string");
|
|
2223
|
+
return typeof e == "symbol" ? e : e + "";
|
|
2224
|
+
}
|
|
2225
|
+
function Mr(t, e) {
|
|
2226
|
+
if (typeof t != "object" || !t) return t;
|
|
2227
|
+
var r = t[Symbol.toPrimitive];
|
|
2228
|
+
if (r !== void 0) {
|
|
2229
|
+
var g = r.call(t, e);
|
|
2230
|
+
if (typeof g != "object") return g;
|
|
2231
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2232
|
+
}
|
|
2233
|
+
return String(t);
|
|
2234
|
+
}
|
|
2235
|
+
function je(t, e, r) {
|
|
2236
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
2237
|
+
try {
|
|
2238
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
2239
|
+
} catch {
|
|
2240
|
+
}
|
|
2241
|
+
return t;
|
|
2242
|
+
}
|
|
2243
|
+
function Ur(t) {
|
|
2244
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
2245
|
+
return t;
|
|
2246
|
+
}
|
|
2247
|
+
const oe = ne("UserProfile");
|
|
2248
|
+
xt = [re({
|
|
2249
|
+
tagName: "user-profile"
|
|
2250
|
+
})];
|
|
2251
|
+
let Hr;
|
|
2252
|
+
class Fr extends X {
|
|
2253
|
+
constructor() {
|
|
2254
|
+
super(), Q(this, "_autoStyles", Br), Q(this, "profile", void 0), Q(this, "handleNameChange", (r) => {
|
|
2255
|
+
const g = r.target;
|
|
2256
|
+
this.profile.name = g.value;
|
|
2257
|
+
}), Q(this, "handleNameBlur", () => {
|
|
2258
|
+
this.profile = {
|
|
2259
|
+
...this.profile,
|
|
2260
|
+
name: this.profile.name
|
|
2261
|
+
}, oe.debug("Name updated", {
|
|
2262
|
+
name: this.profile.name
|
|
2263
|
+
});
|
|
2264
|
+
}), Q(this, "handleEmailChange", (r) => {
|
|
2265
|
+
const g = r.target;
|
|
2266
|
+
this.profile.email = g.value;
|
|
2267
|
+
}), Q(this, "handleEmailBlur", () => {
|
|
2268
|
+
this.profile = {
|
|
2269
|
+
...this.profile,
|
|
2270
|
+
email: this.profile.email
|
|
2271
|
+
}, oe.debug("Email updated", {
|
|
2272
|
+
email: this.profile.email
|
|
2273
|
+
});
|
|
2274
|
+
}), Q(this, "handleAgeChange", (r) => {
|
|
2275
|
+
const g = r.target;
|
|
2276
|
+
this.profile.age = parseInt(g.value, 10) || 0;
|
|
2277
|
+
}), Q(this, "handleAgeBlur", () => {
|
|
2278
|
+
this.profile = {
|
|
2279
|
+
...this.profile,
|
|
2280
|
+
age: this.profile.age
|
|
2281
|
+
}, oe.debug("Age updated", {
|
|
2282
|
+
age: this.profile.age
|
|
2283
|
+
});
|
|
2284
|
+
}), Q(this, "handleThemeChange", (r) => {
|
|
2285
|
+
const g = r.target;
|
|
2286
|
+
this.profile.preferences.theme = g.value, oe.debug("Theme updated", {
|
|
2287
|
+
theme: g.value
|
|
2288
|
+
});
|
|
2289
|
+
}), Q(this, "handleLanguageChange", (r) => {
|
|
2290
|
+
const g = r.target;
|
|
2291
|
+
this.profile.preferences.language = g.value, oe.debug("Language updated", {
|
|
2292
|
+
language: g.value
|
|
2293
|
+
});
|
|
2294
|
+
}), Q(this, "handleNotificationsChange", (r) => {
|
|
2295
|
+
const g = r.target;
|
|
2296
|
+
this.profile.preferences.notifications = g.checked, oe.debug("Notifications updated", {
|
|
2297
|
+
notifications: g.checked
|
|
2298
|
+
});
|
|
2299
|
+
}), Q(this, "resetProfile", () => {
|
|
2300
|
+
this.profile = {
|
|
2301
|
+
name: "John Doe",
|
|
2302
|
+
email: "john@example.com",
|
|
2303
|
+
age: 30,
|
|
2304
|
+
preferences: {
|
|
2305
|
+
theme: "light",
|
|
2306
|
+
language: "en",
|
|
2307
|
+
notifications: !0
|
|
2308
|
+
},
|
|
2309
|
+
lastLogin: Date.now()
|
|
2310
|
+
}, oe.debug("Profile reset to default");
|
|
2311
|
+
}), Q(this, "updateLastLogin", () => {
|
|
2312
|
+
this.profile = {
|
|
2313
|
+
...this.profile,
|
|
2314
|
+
lastLogin: Date.now()
|
|
2315
|
+
}, oe.debug("Last login updated", {
|
|
2316
|
+
lastLogin: this.profile.lastLogin
|
|
2317
|
+
});
|
|
2318
|
+
}), Q(this, "replaceEntireProfile", () => {
|
|
2319
|
+
this.profile = {
|
|
2320
|
+
name: "Jane Smith",
|
|
2321
|
+
email: "jane@example.com",
|
|
2322
|
+
age: 25,
|
|
2323
|
+
preferences: {
|
|
2324
|
+
theme: "dark",
|
|
2325
|
+
language: "zh",
|
|
2326
|
+
notifications: !1
|
|
2327
|
+
},
|
|
2328
|
+
lastLogin: Date.now()
|
|
2329
|
+
}, oe.debug("Entire profile replaced");
|
|
2330
|
+
}), oe.info("UserProfile initialized");
|
|
2331
|
+
let e = this.reactive({
|
|
2332
|
+
name: "John Doe",
|
|
2333
|
+
email: "john@example.com",
|
|
2334
|
+
age: 30,
|
|
2335
|
+
preferences: {
|
|
2336
|
+
theme: "light",
|
|
2337
|
+
language: "en",
|
|
2338
|
+
notifications: !0
|
|
2339
|
+
},
|
|
2340
|
+
lastLogin: Date.now()
|
|
2341
|
+
});
|
|
2342
|
+
Object.defineProperty(this, "profile", {
|
|
2343
|
+
get: () => e,
|
|
2344
|
+
set: (r) => {
|
|
2345
|
+
e = r !== null && typeof r < "u" && (Array.isArray(r) || typeof r == "object") ? this.reactive(r) : r, this.scheduleRerender();
|
|
2346
|
+
},
|
|
2347
|
+
enumerable: !0,
|
|
2348
|
+
configurable: !0
|
|
2349
|
+
});
|
|
2350
|
+
}
|
|
2351
|
+
render() {
|
|
2352
|
+
return /* @__PURE__ */ n("div", { class: "user-profile" }, /* @__PURE__ */ n("div", { class: "profile-header" }, /* @__PURE__ */ n("h2", null, "👤 User Profile (WebComponent)"), /* @__PURE__ */ n("p", { class: "subtitle" }, "Demonstrates @state decorator with objects")), /* @__PURE__ */ n("div", { class: "profile-content" }, /* @__PURE__ */ n("div", { class: "profile-section" }, /* @__PURE__ */ n("h3", null, "Basic Information"), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Name:"), /* @__PURE__ */ n("input", { type: "text", value: this.profile.name, onInput: this.handleNameChange, onBlur: this.handleNameBlur, class: "input-field", "data-wsx-key": "UserProfile-input-text-3-1-3-3" })), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Email:"), /* @__PURE__ */ n("input", { type: "email", value: this.profile.email, onInput: this.handleEmailChange, onBlur: this.handleEmailBlur, class: "input-field", "data-wsx-key": "UserProfile-input-email-3-1-5-3" })), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Age:"), /* @__PURE__ */ n("input", { type: "number", value: this.profile.age.toString(), onInput: this.handleAgeChange, onBlur: this.handleAgeBlur, class: "input-field", "data-wsx-key": "UserProfile-input-number-3-1-7-3" }))), /* @__PURE__ */ n("div", { class: "profile-section" }, /* @__PURE__ */ n("h3", null, "Preferences"), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Theme:"), /* @__PURE__ */ n("select", { value: this.profile.preferences.theme, onChange: this.handleThemeChange, class: "input-field", "data-wsx-key": "UserProfile-select-text-3-3-3-3" }, /* @__PURE__ */ n("option", { value: "light" }, "Light"), /* @__PURE__ */ n("option", { value: "dark" }, "Dark"))), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Language:"), /* @__PURE__ */ n("select", { value: this.profile.preferences.language, onChange: this.handleLanguageChange, class: "input-field", "data-wsx-key": "UserProfile-select-text-3-3-5-3" }, /* @__PURE__ */ n("option", { value: "en" }, "English"), /* @__PURE__ */ n("option", { value: "zh" }, "中文"), /* @__PURE__ */ n("option", { value: "es" }, "Español"), /* @__PURE__ */ n("option", { value: "fr" }, "Français"))), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, /* @__PURE__ */ n("input", { type: "checkbox", checked: this.profile.preferences.notifications, onChange: this.handleNotificationsChange, "data-wsx-key": "UserProfile-input-checkbox-3-3-7-1-1" }), "Enable Notifications"))), /* @__PURE__ */ n("div", { class: "profile-actions" }, /* @__PURE__ */ n("button", { class: "btn btn-primary", onClick: this.resetProfile, "data-wsx-key": "UserProfile-button-text-3-5-1" }, "Reset to Default"), /* @__PURE__ */ n("button", { class: "btn btn-secondary", onClick: this.updateLastLogin, "data-wsx-key": "UserProfile-button-text-3-5-3" }, "Update Last Login"), /* @__PURE__ */ n("button", { class: "btn btn-warning", onClick: this.replaceEntireProfile, "data-wsx-key": "UserProfile-button-text-3-5-5" }, "Replace Entire Profile")), /* @__PURE__ */ n("div", { class: "profile-display" }, /* @__PURE__ */ n("h3", null, "Current Profile Data"), /* @__PURE__ */ n("pre", { class: "json-display" }, JSON.stringify(this.profile, null, 2)))));
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
yt = Fr;
|
|
2356
|
+
[Hr, vt] = Nr(yt, [], xt, 0, void 0, X).c;
|
|
2357
|
+
vt();
|
|
2358
|
+
const Kr = ".user-profile{padding:1.5rem;max-width:800px;margin:0 auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.profile-header{margin-bottom:2rem;text-align:center}.profile-header h2{margin:0 0 .5rem;color:#333;font-size:1.75rem}.profile-header .subtitle{color:#666;font-size:.9rem;margin:0}.profile-content{display:flex;flex-direction:column;gap:2rem}.profile-section{background:#f8f9fa;padding:1.5rem;border-radius:8px;border:1px solid #e0e0e0}.profile-section h3{margin:0 0 1rem;color:#333;font-size:1.25rem;border-bottom:2px solid #007bff;padding-bottom:.5rem}.form-group{margin-bottom:1rem}.form-group label{display:block;margin-bottom:.5rem;color:#555;font-weight:500;font-size:.9rem}.form-group input[type=checkbox]{margin-right:.5rem}.input-field{width:100%;padding:.75rem;border:1px solid #ddd;border-radius:4px;font-size:1rem;transition:border-color .2s;box-sizing:border-box}.input-field:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 3px #007bff1a}.profile-actions{display:flex;gap:1rem;flex-wrap:wrap}.btn{padding:.75rem 1.5rem;border:none;border-radius:4px;font-size:1rem;cursor:pointer;transition:all .2s;font-weight:500}.btn-primary{background:#007bff;color:#fff}.btn-primary:hover{background:#0056b3}.btn-secondary{background:#6c757d;color:#fff}.btn-secondary:hover{background:#545b62}.btn-warning{background:#ffc107;color:#212529}.btn-warning:hover{background:#e0a800}.profile-display{background:#f8f9fa;padding:1.5rem;border-radius:8px;border:1px solid #e0e0e0}.profile-display h3{margin:0 0 1rem;color:#333;font-size:1.25rem}.json-display{background:#2d2d2d;color:#f8f8f2;padding:1rem;border-radius:4px;overflow-x:auto;font-family:Courier New,monospace;font-size:.875rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word}";
|
|
2359
|
+
var Ct;
|
|
2360
|
+
let wt, Tt;
|
|
2361
|
+
function Z(t, e, r) {
|
|
2362
|
+
return (e = St(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
2363
|
+
}
|
|
2364
|
+
function Jr(t, e, r, g, S, A) {
|
|
2365
|
+
function T(o, l, u) {
|
|
2366
|
+
return function(s, a) {
|
|
2367
|
+
return u && u(s), o[l].call(s, a);
|
|
2368
|
+
};
|
|
2369
|
+
}
|
|
2370
|
+
function B(o, l) {
|
|
2371
|
+
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
2372
|
+
return l;
|
|
2373
|
+
}
|
|
2374
|
+
function _(o, l, u, s) {
|
|
2375
|
+
if (typeof o != "function" && (s || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (s ? "" : " or undefined"));
|
|
2376
|
+
return o;
|
|
2377
|
+
}
|
|
2378
|
+
function M(o, l, u, s, a, j, L, E, P, y, b, f, p) {
|
|
2379
|
+
function v(c) {
|
|
2380
|
+
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
2381
|
+
}
|
|
2382
|
+
var d, x = l[0], k = l[3], z = !E;
|
|
2383
|
+
if (!z) {
|
|
2384
|
+
u || Array.isArray(x) || (x = [x]);
|
|
2385
|
+
var i = {}, C = [], m = a === 3 ? "get" : a === 4 || f ? "set" : "value";
|
|
2386
|
+
y ? (b || f ? i = { get: Le(function() {
|
|
2387
|
+
return k(this);
|
|
2388
|
+
}, s, "get"), set: function(c) {
|
|
2389
|
+
l[4](this, c);
|
|
2390
|
+
} } : i[m] = k, b || Le(i[m], s, a === 2 ? "" : m)) : b || (i = Object.getOwnPropertyDescriptor(o, s));
|
|
2391
|
+
}
|
|
2392
|
+
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
2393
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: s, metadata: j, addInitializer: (function(c, w) {
|
|
2394
|
+
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
2395
|
+
_(w, "An initializer", "be", !0), L.push(w);
|
|
2396
|
+
}).bind(null, J) };
|
|
2397
|
+
try {
|
|
2398
|
+
if (z) (d = _(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
2399
|
+
else {
|
|
2400
|
+
var $, R;
|
|
2401
|
+
D.static = P, D.private = y, y ? a === 2 ? $ = function(c) {
|
|
2402
|
+
return v(c), i.value;
|
|
2403
|
+
} : (a < 4 && ($ = T(i, "get", v)), a !== 3 && (R = T(i, "set", v))) : ($ = function(c) {
|
|
2404
|
+
return c[s];
|
|
2405
|
+
}, (a < 2 || a === 4) && (R = function(c, w) {
|
|
2406
|
+
c[s] = w;
|
|
2407
|
+
}));
|
|
2408
|
+
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
2409
|
+
return s in c;
|
|
2410
|
+
} };
|
|
2411
|
+
if ($ && (W.get = $), R && (W.set = R), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
2412
|
+
if (typeof h == "object" && h) (d = _(h.get, "accessor.get")) && (i.get = d), (d = _(h.set, "accessor.set")) && (i.set = d), (d = _(h.init, "accessor.init")) && C.push(d);
|
|
2413
|
+
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
2414
|
+
} else _(h, (b ? "field" : "method") + " decorators", "return") && (b ? C.push(h) : i[m] = h);
|
|
2415
|
+
}
|
|
2416
|
+
} finally {
|
|
2417
|
+
J.v = !0;
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
return (b || f) && E.push(function(c, w) {
|
|
2421
|
+
for (var N = C.length - 1; N >= 0; N--) w = C[N].call(c, w);
|
|
2422
|
+
return w;
|
|
2423
|
+
}), b || z || (y ? f ? E.push(T(i, "get"), T(i, "set")) : E.push(a === 2 ? i[m] : T.call.bind(i[m])) : Object.defineProperty(o, s, i)), h;
|
|
2424
|
+
}
|
|
2425
|
+
function U(o, l) {
|
|
2426
|
+
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
2427
|
+
}
|
|
2428
|
+
if (arguments.length >= 6) var H = A[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
2429
|
+
var O = Object.create(H ?? null), G = function(o, l, u, s) {
|
|
2430
|
+
var a, j, L = [], E = function(m) {
|
|
2431
|
+
return Gr(m) === o;
|
|
2432
|
+
}, P = /* @__PURE__ */ new Map();
|
|
2433
|
+
function y(m) {
|
|
2434
|
+
m && L.push(B.bind(null, m));
|
|
2435
|
+
}
|
|
2436
|
+
for (var b = 0; b < l.length; b++) {
|
|
2437
|
+
var f = l[b];
|
|
2438
|
+
if (Array.isArray(f)) {
|
|
2439
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), z = (p &= 7) == 0, i = v + "/" + k;
|
|
2440
|
+
if (!z && !d) {
|
|
2441
|
+
var C = P.get(i);
|
|
2442
|
+
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
2443
|
+
P.set(i, !(p > 2) || p);
|
|
2444
|
+
}
|
|
2445
|
+
M(k ? o : o.prototype, f, x, d ? "#" + v : St(v), p, s, k ? j = j || [] : a = a || [], L, k, d, z, p === 1, k && d ? E : u);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
return y(a), y(j), L;
|
|
2449
|
+
}(t, e, S, O);
|
|
2450
|
+
return r.length || U(t, O), { e: G, get c() {
|
|
2451
|
+
var o = [];
|
|
2452
|
+
return r.length && [U(M(t, [r], g, t.name, 5, O, o), O), B.bind(null, o, t)];
|
|
2453
|
+
} };
|
|
2454
|
+
}
|
|
2455
|
+
function St(t) {
|
|
2456
|
+
var e = Wr(t, "string");
|
|
2457
|
+
return typeof e == "symbol" ? e : e + "";
|
|
2458
|
+
}
|
|
2459
|
+
function Wr(t, e) {
|
|
2460
|
+
if (typeof t != "object" || !t) return t;
|
|
2461
|
+
var r = t[Symbol.toPrimitive];
|
|
2462
|
+
if (r !== void 0) {
|
|
2463
|
+
var g = r.call(t, e);
|
|
2464
|
+
if (typeof g != "object") return g;
|
|
2465
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2466
|
+
}
|
|
2467
|
+
return String(t);
|
|
2468
|
+
}
|
|
2469
|
+
function Le(t, e, r) {
|
|
2470
|
+
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
2471
|
+
try {
|
|
2472
|
+
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
2473
|
+
} catch {
|
|
2474
|
+
}
|
|
2475
|
+
return t;
|
|
2476
|
+
}
|
|
2477
|
+
function Gr(t) {
|
|
2478
|
+
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
2479
|
+
return t;
|
|
2480
|
+
}
|
|
2481
|
+
const ie = ne("UserProfileLight");
|
|
2482
|
+
Tt = [re({
|
|
2483
|
+
tagName: "user-profile-light"
|
|
2484
|
+
})];
|
|
2485
|
+
let Xr;
|
|
2486
|
+
class qr extends he {
|
|
2487
|
+
constructor() {
|
|
2488
|
+
super(), Z(this, "_autoStyles", Kr), Z(this, "profile", void 0), Z(this, "handleNameChange", (r) => {
|
|
2489
|
+
const g = r.target;
|
|
2490
|
+
this.profile.name = g.value;
|
|
2491
|
+
}), Z(this, "handleNameBlur", () => {
|
|
2492
|
+
this.profile = {
|
|
2493
|
+
...this.profile,
|
|
2494
|
+
name: this.profile.name
|
|
2495
|
+
}, ie.debug("Name updated", {
|
|
2496
|
+
name: this.profile.name
|
|
2497
|
+
});
|
|
2498
|
+
}), Z(this, "handleEmailChange", (r) => {
|
|
2499
|
+
const g = r.target;
|
|
2500
|
+
this.profile.email = g.value;
|
|
2501
|
+
}), Z(this, "handleEmailBlur", () => {
|
|
2502
|
+
this.profile = {
|
|
2503
|
+
...this.profile,
|
|
2504
|
+
email: this.profile.email
|
|
2505
|
+
}, ie.debug("Email updated", {
|
|
2506
|
+
email: this.profile.email
|
|
2507
|
+
});
|
|
2508
|
+
}), Z(this, "handleAgeChange", (r) => {
|
|
2509
|
+
const g = r.target;
|
|
2510
|
+
this.profile.age = parseInt(g.value, 10) || 0;
|
|
2511
|
+
}), Z(this, "handleAgeBlur", () => {
|
|
2512
|
+
this.profile = {
|
|
2513
|
+
...this.profile,
|
|
2514
|
+
age: this.profile.age
|
|
2515
|
+
}, ie.debug("Age updated", {
|
|
2516
|
+
age: this.profile.age
|
|
2517
|
+
});
|
|
2518
|
+
}), Z(this, "handleThemeChange", (r) => {
|
|
2519
|
+
const g = r.target;
|
|
2520
|
+
this.profile.preferences.theme = g.value, ie.debug("Theme updated", {
|
|
2521
|
+
theme: g.value
|
|
2522
|
+
});
|
|
2523
|
+
}), Z(this, "handleLanguageChange", (r) => {
|
|
2524
|
+
const g = r.target;
|
|
2525
|
+
this.profile.preferences.language = g.value, ie.debug("Language updated", {
|
|
2526
|
+
language: g.value
|
|
2527
|
+
});
|
|
2528
|
+
}), Z(this, "handleNotificationsChange", (r) => {
|
|
2529
|
+
const g = r.target;
|
|
2530
|
+
this.profile.preferences.notifications = g.checked, ie.debug("Notifications updated", {
|
|
2531
|
+
notifications: g.checked
|
|
2532
|
+
});
|
|
2533
|
+
}), Z(this, "resetProfile", () => {
|
|
2534
|
+
this.profile = {
|
|
2535
|
+
name: "John Doe",
|
|
2536
|
+
email: "john@example.com",
|
|
2537
|
+
age: 30,
|
|
2538
|
+
preferences: {
|
|
2539
|
+
theme: "light",
|
|
2540
|
+
language: "en",
|
|
2541
|
+
notifications: !0
|
|
2542
|
+
},
|
|
2543
|
+
lastLogin: Date.now()
|
|
2544
|
+
}, this._name = "John Doe", this._email = "john@example.com", this._age = 30, ie.debug("Profile reset to default");
|
|
2545
|
+
}), Z(this, "updateLastLogin", () => {
|
|
2546
|
+
this.profile = {
|
|
2547
|
+
...this.profile,
|
|
2548
|
+
lastLogin: Date.now()
|
|
2549
|
+
}, ie.debug("Last login updated", {
|
|
2550
|
+
lastLogin: this.profile.lastLogin
|
|
2551
|
+
});
|
|
2552
|
+
}), Z(this, "replaceEntireProfile", () => {
|
|
2553
|
+
this.profile = {
|
|
2554
|
+
name: "Jane Smith",
|
|
2555
|
+
email: "jane@example.com",
|
|
2556
|
+
age: 25,
|
|
2557
|
+
preferences: {
|
|
2558
|
+
theme: "dark",
|
|
2559
|
+
language: "zh",
|
|
2560
|
+
notifications: !1
|
|
2561
|
+
},
|
|
2562
|
+
lastLogin: Date.now()
|
|
2563
|
+
}, this._name = "Jane Smith", this._email = "jane@example.com", this._age = 25, ie.debug("Entire profile replaced");
|
|
2564
|
+
}), ie.info("UserProfileLight initialized");
|
|
2565
|
+
let e = this.reactive({
|
|
2566
|
+
name: "John Doe",
|
|
2567
|
+
email: "john@example.com",
|
|
2568
|
+
age: 30,
|
|
2569
|
+
preferences: {
|
|
2570
|
+
theme: "light",
|
|
2571
|
+
language: "en",
|
|
2572
|
+
notifications: !0
|
|
2573
|
+
},
|
|
2574
|
+
lastLogin: Date.now()
|
|
2575
|
+
});
|
|
2576
|
+
Object.defineProperty(this, "profile", {
|
|
2577
|
+
get: () => e,
|
|
2578
|
+
set: (r) => {
|
|
2579
|
+
e = r !== null && typeof r < "u" && (Array.isArray(r) || typeof r == "object") ? this.reactive(r) : r, this.scheduleRerender();
|
|
2580
|
+
},
|
|
2581
|
+
enumerable: !0,
|
|
2582
|
+
configurable: !0
|
|
2583
|
+
});
|
|
1641
2584
|
}
|
|
1642
2585
|
render() {
|
|
1643
|
-
return /* @__PURE__ */
|
|
2586
|
+
return /* @__PURE__ */ n("div", { class: "user-profile" }, /* @__PURE__ */ n("div", { class: "profile-header" }, /* @__PURE__ */ n("h2", null, "👤 User Profile (LightComponent)"), /* @__PURE__ */ n("p", { class: "subtitle" }, "Demonstrates @state decorator with objects")), /* @__PURE__ */ n("div", { class: "profile-content" }, /* @__PURE__ */ n("div", { class: "profile-section" }, /* @__PURE__ */ n("h3", null, "Basic Information"), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Name:"), /* @__PURE__ */ n("input", { type: "text", value: this.profile.name, onInput: this.handleNameChange, onBlur: this.handleNameBlur, class: "input-field", "data-wsx-key": "UserProfileLight-input-text-3-1-3-3" })), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Email:"), /* @__PURE__ */ n("input", { type: "email", value: this.profile.email, onInput: this.handleEmailChange, onBlur: this.handleEmailBlur, class: "input-field", "data-wsx-key": "UserProfileLight-input-email-3-1-5-3" })), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Age:"), /* @__PURE__ */ n("input", { type: "number", value: this.profile.age.toString(), onInput: this.handleAgeChange, onBlur: this.handleAgeBlur, class: "input-field", "data-wsx-key": "UserProfileLight-input-number-3-1-7-3" }))), /* @__PURE__ */ n("div", { class: "profile-section" }, /* @__PURE__ */ n("h3", null, "Preferences"), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Theme:"), /* @__PURE__ */ n("select", { value: this.profile.preferences.theme, onChange: this.handleThemeChange, class: "input-field", "data-wsx-key": "UserProfileLight-select-text-3-3-3-3" }, /* @__PURE__ */ n("option", { value: "light" }, "Light"), /* @__PURE__ */ n("option", { value: "dark" }, "Dark"))), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Language:"), /* @__PURE__ */ n("select", { value: this.profile.preferences.language, onChange: this.handleLanguageChange, class: "input-field", "data-wsx-key": "UserProfileLight-select-text-3-3-5-3" }, /* @__PURE__ */ n("option", { value: "en" }, "English"), /* @__PURE__ */ n("option", { value: "zh" }, "中文"), /* @__PURE__ */ n("option", { value: "es" }, "Español"), /* @__PURE__ */ n("option", { value: "fr" }, "Français"))), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, /* @__PURE__ */ n("input", { type: "checkbox", checked: this.profile.preferences.notifications, onChange: this.handleNotificationsChange, "data-wsx-key": "UserProfileLight-input-checkbox-3-3-7-1-1" }), "Enable Notifications"))), /* @__PURE__ */ n("div", { class: "profile-actions" }, /* @__PURE__ */ n("button", { class: "btn btn-primary", onClick: this.resetProfile, "data-wsx-key": "UserProfileLight-button-text-3-5-1" }, "Reset to Default"), /* @__PURE__ */ n("button", { class: "btn btn-secondary", onClick: this.updateLastLogin, "data-wsx-key": "UserProfileLight-button-text-3-5-3" }, "Update Last Login"), /* @__PURE__ */ n("button", { class: "btn btn-warning", onClick: this.replaceEntireProfile, "data-wsx-key": "UserProfileLight-button-text-3-5-5" }, "Replace Entire Profile")), /* @__PURE__ */ n("div", { class: "profile-display" }, /* @__PURE__ */ n("h3", null, "Current Profile Data"), /* @__PURE__ */ n("pre", { class: "json-display" }, JSON.stringify(this.profile, null, 2)))));
|
|
1644
2587
|
}
|
|
1645
2588
|
}
|
|
1646
|
-
|
|
1647
|
-
[
|
|
1648
|
-
|
|
2589
|
+
Ct = qr;
|
|
2590
|
+
[Xr, wt] = Jr(Ct, [], Tt, 0, void 0, he).c;
|
|
2591
|
+
wt();
|
|
1649
2592
|
export {
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
2593
|
+
Zr as CONVERTER_BTN,
|
|
2594
|
+
Vr as CONVERTER_PANEL,
|
|
2595
|
+
Yt as ColorPicker,
|
|
2596
|
+
rr as ReactiveCounter,
|
|
2597
|
+
Tr as SimpleReactiveDemo,
|
|
2598
|
+
yr as SvgDemo,
|
|
2599
|
+
fr as SvgIcon,
|
|
2600
|
+
lr as ThemeSwitcher,
|
|
2601
|
+
jr as TodoList,
|
|
2602
|
+
Ir as TodoListLight,
|
|
2603
|
+
Hr as UserProfile,
|
|
2604
|
+
Xr as UserProfileLight,
|
|
2605
|
+
jt as XyButton,
|
|
2606
|
+
It as XyButtonGroup,
|
|
2607
|
+
Ft as getCustomColorCache,
|
|
2608
|
+
Qr as getDefaultColorCache,
|
|
2609
|
+
ue as handleCSSVariables,
|
|
2610
|
+
Ht as setCustomColorCache,
|
|
2611
|
+
Ut as setDefaultColorCache,
|
|
2612
|
+
Kt as throttle
|
|
1666
2613
|
};
|