next-flow-design 1.6.5 → 1.6.6
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/components/nf-checkbox/nf-checkbox.d.ts +1 -0
- package/dist/index.js +244 -241
- package/dist/react/index.js +82 -79
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { css as E, LitElement as B, html as u } from "lit";
|
|
2
|
-
const J = globalThis,
|
|
2
|
+
const J = globalThis, ne = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ee = /* @__PURE__ */ Symbol(), pe = /* @__PURE__ */ new WeakMap();
|
|
3
3
|
let Me = class {
|
|
4
|
-
constructor(e, o,
|
|
5
|
-
if (this._$cssResult$ = !0,
|
|
4
|
+
constructor(e, o, i) {
|
|
5
|
+
if (this._$cssResult$ = !0, i !== Ee) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
6
6
|
this.cssText = e, this.t = o;
|
|
7
7
|
}
|
|
8
8
|
get styleSheet() {
|
|
9
9
|
let e = this.o;
|
|
10
10
|
const o = this.t;
|
|
11
|
-
if (
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
if (ne && e === void 0) {
|
|
12
|
+
const i = o !== void 0 && o.length === 1;
|
|
13
|
+
i && (e = pe.get(o)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && pe.set(o, e));
|
|
14
14
|
}
|
|
15
15
|
return e;
|
|
16
16
|
}
|
|
@@ -19,17 +19,17 @@ let Me = class {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
const He = (t) => new Me(typeof t == "string" ? t : t + "", void 0, Ee), Oe = (t, e) => {
|
|
22
|
-
if (
|
|
22
|
+
if (ne) t.adoptedStyleSheets = e.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
|
|
23
23
|
else for (const o of e) {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const i = document.createElement("style"), r = J.litNonce;
|
|
25
|
+
r !== void 0 && i.setAttribute("nonce", r), i.textContent = o.cssText, t.appendChild(i);
|
|
26
26
|
}
|
|
27
|
-
}, fe =
|
|
27
|
+
}, fe = ne ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
|
|
28
28
|
let o = "";
|
|
29
|
-
for (const
|
|
29
|
+
for (const i of e.cssRules) o += i.cssText;
|
|
30
30
|
return He(o);
|
|
31
31
|
})(t) : t;
|
|
32
|
-
const { is: Te, defineProperty: ze, getOwnPropertyDescriptor: Be, getOwnPropertyNames: Ve, getOwnPropertySymbols: Ne, getPrototypeOf: Fe } = Object,
|
|
32
|
+
const { is: Te, defineProperty: ze, getOwnPropertyDescriptor: Be, getOwnPropertyNames: Ve, getOwnPropertySymbols: Ne, getPrototypeOf: Fe } = Object, oe = globalThis, be = oe.trustedTypes, Le = be ? be.emptyScript : "", Ue = oe.reactiveElementPolyfillSupport, I = (t, e) => t, ee = { toAttribute(t, e) {
|
|
33
33
|
switch (e) {
|
|
34
34
|
case Boolean:
|
|
35
35
|
t = t ? Le : null;
|
|
@@ -57,8 +57,8 @@ const { is: Te, defineProperty: ze, getOwnPropertyDescriptor: Be, getOwnProperty
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
return o;
|
|
60
|
-
} },
|
|
61
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
60
|
+
} }, ae = (t, e) => !Te(t, e), me = { attribute: !0, type: String, converter: ee, reflect: !1, useDefault: !1, hasChanged: ae };
|
|
61
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), oe.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
62
62
|
let N = class extends HTMLElement {
|
|
63
63
|
static addInitializer(e) {
|
|
64
64
|
this._$Ei(), (this.l ??= []).push(e);
|
|
@@ -68,58 +68,58 @@ let N = class extends HTMLElement {
|
|
|
68
68
|
}
|
|
69
69
|
static createProperty(e, o = me) {
|
|
70
70
|
if (o.state && (o.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((o = Object.create(o)).wrapped = !0), this.elementProperties.set(e, o), !o.noAccessor) {
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const i = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(e, i, o);
|
|
72
|
+
r !== void 0 && ze(this.prototype, e, r);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
static getPropertyDescriptor(e, o,
|
|
76
|
-
const { get:
|
|
75
|
+
static getPropertyDescriptor(e, o, i) {
|
|
76
|
+
const { get: r, set: s } = Be(this.prototype, e) ?? { get() {
|
|
77
77
|
return this[o];
|
|
78
78
|
}, set(n) {
|
|
79
79
|
this[o] = n;
|
|
80
80
|
} };
|
|
81
|
-
return { get:
|
|
82
|
-
const l =
|
|
83
|
-
s?.call(this, n), this.requestUpdate(e, l,
|
|
81
|
+
return { get: r, set(n) {
|
|
82
|
+
const l = r?.call(this);
|
|
83
|
+
s?.call(this, n), this.requestUpdate(e, l, i);
|
|
84
84
|
}, configurable: !0, enumerable: !0 };
|
|
85
85
|
}
|
|
86
86
|
static getPropertyOptions(e) {
|
|
87
87
|
return this.elementProperties.get(e) ?? me;
|
|
88
88
|
}
|
|
89
89
|
static _$Ei() {
|
|
90
|
-
if (this.hasOwnProperty(
|
|
90
|
+
if (this.hasOwnProperty(I("elementProperties"))) return;
|
|
91
91
|
const e = Fe(this);
|
|
92
92
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
93
93
|
}
|
|
94
94
|
static finalize() {
|
|
95
|
-
if (this.hasOwnProperty(
|
|
96
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
97
|
-
const o = this.properties,
|
|
98
|
-
for (const
|
|
95
|
+
if (this.hasOwnProperty(I("finalized"))) return;
|
|
96
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(I("properties"))) {
|
|
97
|
+
const o = this.properties, i = [...Ve(o), ...Ne(o)];
|
|
98
|
+
for (const r of i) this.createProperty(r, o[r]);
|
|
99
99
|
}
|
|
100
100
|
const e = this[Symbol.metadata];
|
|
101
101
|
if (e !== null) {
|
|
102
102
|
const o = litPropertyMetadata.get(e);
|
|
103
|
-
if (o !== void 0) for (const [
|
|
103
|
+
if (o !== void 0) for (const [i, r] of o) this.elementProperties.set(i, r);
|
|
104
104
|
}
|
|
105
105
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
106
|
-
for (const [o,
|
|
107
|
-
const
|
|
108
|
-
|
|
106
|
+
for (const [o, i] of this.elementProperties) {
|
|
107
|
+
const r = this._$Eu(o, i);
|
|
108
|
+
r !== void 0 && this._$Eh.set(r, o);
|
|
109
109
|
}
|
|
110
110
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
111
111
|
}
|
|
112
112
|
static finalizeStyles(e) {
|
|
113
113
|
const o = [];
|
|
114
114
|
if (Array.isArray(e)) {
|
|
115
|
-
const
|
|
116
|
-
for (const
|
|
115
|
+
const i = new Set(e.flat(1 / 0).reverse());
|
|
116
|
+
for (const r of i) o.unshift(fe(r));
|
|
117
117
|
} else e !== void 0 && o.push(fe(e));
|
|
118
118
|
return o;
|
|
119
119
|
}
|
|
120
120
|
static _$Eu(e, o) {
|
|
121
|
-
const
|
|
122
|
-
return
|
|
121
|
+
const i = o.attribute;
|
|
122
|
+
return i === !1 ? void 0 : typeof i == "string" ? i : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
123
123
|
}
|
|
124
124
|
constructor() {
|
|
125
125
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -135,7 +135,7 @@ let N = class extends HTMLElement {
|
|
|
135
135
|
}
|
|
136
136
|
_$E_() {
|
|
137
137
|
const e = /* @__PURE__ */ new Map(), o = this.constructor.elementProperties;
|
|
138
|
-
for (const
|
|
138
|
+
for (const i of o.keys()) this.hasOwnProperty(i) && (e.set(i, this[i]), delete this[i]);
|
|
139
139
|
e.size > 0 && (this._$Ep = e);
|
|
140
140
|
}
|
|
141
141
|
createRenderRoot() {
|
|
@@ -150,35 +150,35 @@ let N = class extends HTMLElement {
|
|
|
150
150
|
disconnectedCallback() {
|
|
151
151
|
this._$EO?.forEach((e) => e.hostDisconnected?.());
|
|
152
152
|
}
|
|
153
|
-
attributeChangedCallback(e, o,
|
|
154
|
-
this._$AK(e,
|
|
153
|
+
attributeChangedCallback(e, o, i) {
|
|
154
|
+
this._$AK(e, i);
|
|
155
155
|
}
|
|
156
156
|
_$ET(e, o) {
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
159
|
-
const s = (
|
|
160
|
-
this._$Em = e, s == null ? this.removeAttribute(
|
|
157
|
+
const i = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, i);
|
|
158
|
+
if (r !== void 0 && i.reflect === !0) {
|
|
159
|
+
const s = (i.converter?.toAttribute !== void 0 ? i.converter : ee).toAttribute(o, i.type);
|
|
160
|
+
this._$Em = e, s == null ? this.removeAttribute(r) : this.setAttribute(r, s), this._$Em = null;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
_$AK(e, o) {
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
166
|
-
const s =
|
|
167
|
-
this._$Em =
|
|
164
|
+
const i = this.constructor, r = i._$Eh.get(e);
|
|
165
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
166
|
+
const s = i.getPropertyOptions(r), n = typeof s.converter == "function" ? { fromAttribute: s.converter } : s.converter?.fromAttribute !== void 0 ? s.converter : ee;
|
|
167
|
+
this._$Em = r;
|
|
168
168
|
const l = n.fromAttribute(o, s.type);
|
|
169
|
-
this[
|
|
169
|
+
this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
requestUpdate(e, o,
|
|
172
|
+
requestUpdate(e, o, i, r = !1, s) {
|
|
173
173
|
if (e !== void 0) {
|
|
174
174
|
const n = this.constructor;
|
|
175
|
-
if (
|
|
176
|
-
this.C(e, o,
|
|
175
|
+
if (r === !1 && (s = this[e]), i ??= n.getPropertyOptions(e), !((i.hasChanged ?? ae)(s, o) || i.useDefault && i.reflect && s === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, i)))) return;
|
|
176
|
+
this.C(e, o, i);
|
|
177
177
|
}
|
|
178
178
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
179
179
|
}
|
|
180
|
-
C(e, o, { useDefault:
|
|
181
|
-
|
|
180
|
+
C(e, o, { useDefault: i, reflect: r, wrapped: s }, n) {
|
|
181
|
+
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? o ?? this[e]), s !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || i || (o = void 0), this._$AL.set(e, o)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
182
182
|
}
|
|
183
183
|
async _$EP() {
|
|
184
184
|
this.isUpdatePending = !0;
|
|
@@ -197,21 +197,21 @@ let N = class extends HTMLElement {
|
|
|
197
197
|
if (!this.isUpdatePending) return;
|
|
198
198
|
if (!this.hasUpdated) {
|
|
199
199
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
200
|
-
for (const [
|
|
200
|
+
for (const [r, s] of this._$Ep) this[r] = s;
|
|
201
201
|
this._$Ep = void 0;
|
|
202
202
|
}
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
const { wrapped: n } = s, l = this[
|
|
206
|
-
n !== !0 || this._$AL.has(
|
|
203
|
+
const i = this.constructor.elementProperties;
|
|
204
|
+
if (i.size > 0) for (const [r, s] of i) {
|
|
205
|
+
const { wrapped: n } = s, l = this[r];
|
|
206
|
+
n !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, s, l);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
let e = !1;
|
|
210
210
|
const o = this._$AL;
|
|
211
211
|
try {
|
|
212
|
-
e = this.shouldUpdate(o), e ? (this.willUpdate(o), this._$EO?.forEach((
|
|
213
|
-
} catch (
|
|
214
|
-
throw e = !1, this._$EM(),
|
|
212
|
+
e = this.shouldUpdate(o), e ? (this.willUpdate(o), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(o)) : this._$EM();
|
|
213
|
+
} catch (i) {
|
|
214
|
+
throw e = !1, this._$EM(), i;
|
|
215
215
|
}
|
|
216
216
|
e && this._$AE(o);
|
|
217
217
|
}
|
|
@@ -240,11 +240,11 @@ let N = class extends HTMLElement {
|
|
|
240
240
|
firstUpdated(e) {
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
|
-
N.elementStyles = [], N.shadowRootOptions = { mode: "open" }, N[
|
|
244
|
-
const Re = { attribute: !0, type: String, converter:
|
|
245
|
-
const { kind:
|
|
246
|
-
let s = globalThis.litPropertyMetadata.get(
|
|
247
|
-
if (s === void 0 && globalThis.litPropertyMetadata.set(
|
|
243
|
+
N.elementStyles = [], N.shadowRootOptions = { mode: "open" }, N[I("elementProperties")] = /* @__PURE__ */ new Map(), N[I("finalized")] = /* @__PURE__ */ new Map(), Ue?.({ ReactiveElement: N }), (oe.reactiveElementVersions ??= []).push("2.1.2");
|
|
244
|
+
const Re = { attribute: !0, type: String, converter: ee, reflect: !1, hasChanged: ae }, je = (t = Re, e, o) => {
|
|
245
|
+
const { kind: i, metadata: r } = o;
|
|
246
|
+
let s = globalThis.litPropertyMetadata.get(r);
|
|
247
|
+
if (s === void 0 && globalThis.litPropertyMetadata.set(r, s = /* @__PURE__ */ new Map()), i === "setter" && ((t = Object.create(t)).wrapped = !0), s.set(o.name, t), i === "accessor") {
|
|
248
248
|
const { name: n } = o;
|
|
249
249
|
return { set(l) {
|
|
250
250
|
const a = e.get.call(this);
|
|
@@ -253,85 +253,85 @@ const Re = { attribute: !0, type: String, converter: Q, reflect: !1, hasChanged:
|
|
|
253
253
|
return l !== void 0 && this.C(n, void 0, t, l), l;
|
|
254
254
|
} };
|
|
255
255
|
}
|
|
256
|
-
if (
|
|
256
|
+
if (i === "setter") {
|
|
257
257
|
const { name: n } = o;
|
|
258
258
|
return function(l) {
|
|
259
259
|
const a = this[n];
|
|
260
260
|
e.call(this, l), this.requestUpdate(n, a, t, !0, l);
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
|
-
throw Error("Unsupported decorator location: " +
|
|
263
|
+
throw Error("Unsupported decorator location: " + i);
|
|
264
264
|
};
|
|
265
265
|
function h(t) {
|
|
266
|
-
return (e, o) => typeof o == "object" ? je(t, e, o) : ((
|
|
267
|
-
const n =
|
|
268
|
-
return
|
|
266
|
+
return (e, o) => typeof o == "object" ? je(t, e, o) : ((i, r, s) => {
|
|
267
|
+
const n = r.hasOwnProperty(s);
|
|
268
|
+
return r.constructor.createProperty(s, i), n ? Object.getOwnPropertyDescriptor(r, s) : void 0;
|
|
269
269
|
})(t, e, o);
|
|
270
270
|
}
|
|
271
271
|
function _(t) {
|
|
272
272
|
return h({ ...t, state: !0, attribute: !1 });
|
|
273
273
|
}
|
|
274
|
-
const
|
|
275
|
-
\f\r]`,
|
|
276
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), _e = /'/g, $e = /"/g, Ce = /^(?:script|style|textarea|title)$/i, We = (t) => (e, ...o) => ({ _$litType$: t, strings: e, values: o }),
|
|
274
|
+
const le = globalThis, ge = (t) => t, te = le.trustedTypes, ve = te ? te.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Se = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, Ae = "?" + D, Ie = `<${Ae}>`, O = document, q = () => O.createComment(""), W = (t) => t === null || typeof t != "object" && typeof t != "function", he = Array.isArray, qe = (t) => he(t) || typeof t?.[Symbol.iterator] == "function", se = `[
|
|
275
|
+
\f\r]`, j = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ye = /-->/g, we = />/g, M = RegExp(`>|${se}(?:([^\\s"'>=/]+)(${se}*=${se}*(?:[^
|
|
276
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), _e = /'/g, $e = /"/g, Ce = /^(?:script|style|textarea|title)$/i, We = (t) => (e, ...o) => ({ _$litType$: t, strings: e, values: o }), Q = We(1), T = /* @__PURE__ */ Symbol.for("lit-noChange"), b = /* @__PURE__ */ Symbol.for("lit-nothing"), xe = /* @__PURE__ */ new WeakMap(), H = O.createTreeWalker(O, 129);
|
|
277
277
|
function Pe(t, e) {
|
|
278
|
-
if (!
|
|
278
|
+
if (!he(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
279
279
|
return ve !== void 0 ? ve.createHTML(e) : e;
|
|
280
280
|
}
|
|
281
281
|
const Ke = (t, e) => {
|
|
282
|
-
const o = t.length - 1,
|
|
283
|
-
let
|
|
282
|
+
const o = t.length - 1, i = [];
|
|
283
|
+
let r, s = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = j;
|
|
284
284
|
for (let l = 0; l < o; l++) {
|
|
285
285
|
const a = t[l];
|
|
286
286
|
let c, p, d = -1, w = 0;
|
|
287
|
-
for (; w < a.length && (n.lastIndex = w, p = n.exec(a), p !== null); ) w = n.lastIndex, n ===
|
|
287
|
+
for (; w < a.length && (n.lastIndex = w, p = n.exec(a), p !== null); ) w = n.lastIndex, n === j ? p[1] === "!--" ? n = ye : p[1] !== void 0 ? n = we : p[2] !== void 0 ? (Ce.test(p[2]) && (r = RegExp("</" + p[2], "g")), n = M) : p[3] !== void 0 && (n = M) : n === M ? p[0] === ">" ? (n = r ?? j, d = -1) : p[1] === void 0 ? d = -2 : (d = n.lastIndex - p[2].length, c = p[1], n = p[3] === void 0 ? M : p[3] === '"' ? $e : _e) : n === $e || n === _e ? n = M : n === ye || n === we ? n = j : (n = M, r = void 0);
|
|
288
288
|
const k = n === M && t[l + 1].startsWith("/>") ? " " : "";
|
|
289
|
-
s += n ===
|
|
289
|
+
s += n === j ? a + Ie : d >= 0 ? (i.push(c), a.slice(0, d) + Se + a.slice(d) + D + k) : a + D + (d === -2 ? l : k);
|
|
290
290
|
}
|
|
291
|
-
return [Pe(t, s + (t[o] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")),
|
|
291
|
+
return [Pe(t, s + (t[o] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
292
292
|
};
|
|
293
|
-
class
|
|
294
|
-
constructor({ strings: e, _$litType$: o },
|
|
295
|
-
let
|
|
293
|
+
class K {
|
|
294
|
+
constructor({ strings: e, _$litType$: o }, i) {
|
|
295
|
+
let r;
|
|
296
296
|
this.parts = [];
|
|
297
297
|
let s = 0, n = 0;
|
|
298
298
|
const l = e.length - 1, a = this.parts, [c, p] = Ke(e, o);
|
|
299
|
-
if (this.el =
|
|
299
|
+
if (this.el = K.createElement(c, i), H.currentNode = this.el.content, o === 2 || o === 3) {
|
|
300
300
|
const d = this.el.content.firstChild;
|
|
301
301
|
d.replaceWith(...d.childNodes);
|
|
302
302
|
}
|
|
303
|
-
for (; (
|
|
304
|
-
if (
|
|
305
|
-
if (
|
|
306
|
-
const w = p[n++], k =
|
|
307
|
-
a.push({ type: 1, index: s, name: S[2], strings: k, ctor: S[1] === "." ? Ze : S[1] === "?" ? Xe : S[1] === "@" ? Ge :
|
|
308
|
-
} else d.startsWith(D) && (a.push({ type: 6, index: s }),
|
|
309
|
-
if (Ce.test(
|
|
310
|
-
const d =
|
|
303
|
+
for (; (r = H.nextNode()) !== null && a.length < l; ) {
|
|
304
|
+
if (r.nodeType === 1) {
|
|
305
|
+
if (r.hasAttributes()) for (const d of r.getAttributeNames()) if (d.endsWith(Se)) {
|
|
306
|
+
const w = p[n++], k = r.getAttribute(d).split(D), S = /([.?@])?(.*)/.exec(w);
|
|
307
|
+
a.push({ type: 1, index: s, name: S[2], strings: k, ctor: S[1] === "." ? Ze : S[1] === "?" ? Xe : S[1] === "@" ? Ge : ie }), r.removeAttribute(d);
|
|
308
|
+
} else d.startsWith(D) && (a.push({ type: 6, index: s }), r.removeAttribute(d));
|
|
309
|
+
if (Ce.test(r.tagName)) {
|
|
310
|
+
const d = r.textContent.split(D), w = d.length - 1;
|
|
311
311
|
if (w > 0) {
|
|
312
|
-
|
|
313
|
-
for (let k = 0; k < w; k++)
|
|
314
|
-
|
|
312
|
+
r.textContent = te ? te.emptyScript : "";
|
|
313
|
+
for (let k = 0; k < w; k++) r.append(d[k], q()), H.nextNode(), a.push({ type: 2, index: ++s });
|
|
314
|
+
r.append(d[w], q());
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
} else if (
|
|
317
|
+
} else if (r.nodeType === 8) if (r.data === Ae) a.push({ type: 2, index: s });
|
|
318
318
|
else {
|
|
319
319
|
let d = -1;
|
|
320
|
-
for (; (d =
|
|
320
|
+
for (; (d = r.data.indexOf(D, d + 1)) !== -1; ) a.push({ type: 7, index: s }), d += D.length - 1;
|
|
321
321
|
}
|
|
322
322
|
s++;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
static createElement(e, o) {
|
|
326
|
-
const
|
|
327
|
-
return
|
|
326
|
+
const i = O.createElement("template");
|
|
327
|
+
return i.innerHTML = e, i;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
function L(t, e, o = t,
|
|
330
|
+
function L(t, e, o = t, i) {
|
|
331
331
|
if (e === T) return e;
|
|
332
|
-
let
|
|
333
|
-
const s =
|
|
334
|
-
return
|
|
332
|
+
let r = i !== void 0 ? o._$Co?.[i] : o._$Cl;
|
|
333
|
+
const s = W(e) ? void 0 : e._$litDirective$;
|
|
334
|
+
return r?.constructor !== s && (r?._$AO?.(!1), s === void 0 ? r = void 0 : (r = new s(t), r._$AT(t, o, i)), i !== void 0 ? (o._$Co ??= [])[i] = r : o._$Cl = r), r !== void 0 && (e = L(t, r._$AS(t, e.values), r, i)), e;
|
|
335
335
|
}
|
|
336
336
|
class Ye {
|
|
337
337
|
constructor(e, o) {
|
|
@@ -344,29 +344,29 @@ class Ye {
|
|
|
344
344
|
return this._$AM._$AU;
|
|
345
345
|
}
|
|
346
346
|
u(e) {
|
|
347
|
-
const { el: { content: o }, parts:
|
|
348
|
-
H.currentNode =
|
|
349
|
-
let s = H.nextNode(), n = 0, l = 0, a =
|
|
347
|
+
const { el: { content: o }, parts: i } = this._$AD, r = (e?.creationScope ?? O).importNode(o, !0);
|
|
348
|
+
H.currentNode = r;
|
|
349
|
+
let s = H.nextNode(), n = 0, l = 0, a = i[0];
|
|
350
350
|
for (; a !== void 0; ) {
|
|
351
351
|
if (n === a.index) {
|
|
352
352
|
let c;
|
|
353
|
-
a.type === 2 ? c = new X(s, s.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(s, a.name, a.strings, this, e) : a.type === 6 && (c = new Je(s, this, e)), this._$AV.push(c), a =
|
|
353
|
+
a.type === 2 ? c = new X(s, s.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(s, a.name, a.strings, this, e) : a.type === 6 && (c = new Je(s, this, e)), this._$AV.push(c), a = i[++l];
|
|
354
354
|
}
|
|
355
355
|
n !== a?.index && (s = H.nextNode(), n++);
|
|
356
356
|
}
|
|
357
|
-
return H.currentNode = O,
|
|
357
|
+
return H.currentNode = O, r;
|
|
358
358
|
}
|
|
359
359
|
p(e) {
|
|
360
360
|
let o = 0;
|
|
361
|
-
for (const
|
|
361
|
+
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, o), o += i.strings.length - 2) : i._$AI(e[o])), o++;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
class X {
|
|
365
365
|
get _$AU() {
|
|
366
366
|
return this._$AM?._$AU ?? this._$Cv;
|
|
367
367
|
}
|
|
368
|
-
constructor(e, o,
|
|
369
|
-
this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = o, this._$AM =
|
|
368
|
+
constructor(e, o, i, r) {
|
|
369
|
+
this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = o, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
370
370
|
}
|
|
371
371
|
get parentNode() {
|
|
372
372
|
let e = this._$AA.parentNode;
|
|
@@ -380,7 +380,7 @@ class X {
|
|
|
380
380
|
return this._$AB;
|
|
381
381
|
}
|
|
382
382
|
_$AI(e, o = this) {
|
|
383
|
-
e = L(this, e, o),
|
|
383
|
+
e = L(this, e, o), W(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== T && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : qe(e) ? this.k(e) : this._(e);
|
|
384
384
|
}
|
|
385
385
|
O(e) {
|
|
386
386
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -389,63 +389,63 @@ class X {
|
|
|
389
389
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
390
390
|
}
|
|
391
391
|
_(e) {
|
|
392
|
-
this._$AH !== b &&
|
|
392
|
+
this._$AH !== b && W(this._$AH) ? this._$AA.nextSibling.data = e : this.T(O.createTextNode(e)), this._$AH = e;
|
|
393
393
|
}
|
|
394
394
|
$(e) {
|
|
395
|
-
const { values: o, _$litType$:
|
|
396
|
-
if (this._$AH?._$AD ===
|
|
395
|
+
const { values: o, _$litType$: i } = e, r = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = K.createElement(Pe(i.h, i.h[0]), this.options)), i);
|
|
396
|
+
if (this._$AH?._$AD === r) this._$AH.p(o);
|
|
397
397
|
else {
|
|
398
|
-
const s = new Ye(
|
|
398
|
+
const s = new Ye(r, this), n = s.u(this.options);
|
|
399
399
|
s.p(o), this.T(n), this._$AH = s;
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
_$AC(e) {
|
|
403
403
|
let o = xe.get(e.strings);
|
|
404
|
-
return o === void 0 && xe.set(e.strings, o = new
|
|
404
|
+
return o === void 0 && xe.set(e.strings, o = new K(e)), o;
|
|
405
405
|
}
|
|
406
406
|
k(e) {
|
|
407
|
-
|
|
407
|
+
he(this._$AH) || (this._$AH = [], this._$AR());
|
|
408
408
|
const o = this._$AH;
|
|
409
|
-
let
|
|
410
|
-
for (const s of e)
|
|
411
|
-
|
|
409
|
+
let i, r = 0;
|
|
410
|
+
for (const s of e) r === o.length ? o.push(i = new X(this.O(q()), this.O(q()), this, this.options)) : i = o[r], i._$AI(s), r++;
|
|
411
|
+
r < o.length && (this._$AR(i && i._$AB.nextSibling, r), o.length = r);
|
|
412
412
|
}
|
|
413
413
|
_$AR(e = this._$AA.nextSibling, o) {
|
|
414
414
|
for (this._$AP?.(!1, !0, o); e !== this._$AB; ) {
|
|
415
|
-
const
|
|
416
|
-
ge(e).remove(), e =
|
|
415
|
+
const i = ge(e).nextSibling;
|
|
416
|
+
ge(e).remove(), e = i;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
setConnected(e) {
|
|
420
420
|
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
class
|
|
423
|
+
class ie {
|
|
424
424
|
get tagName() {
|
|
425
425
|
return this.element.tagName;
|
|
426
426
|
}
|
|
427
427
|
get _$AU() {
|
|
428
428
|
return this._$AM._$AU;
|
|
429
429
|
}
|
|
430
|
-
constructor(e, o,
|
|
431
|
-
this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = o, this._$AM =
|
|
430
|
+
constructor(e, o, i, r, s) {
|
|
431
|
+
this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = o, this._$AM = r, this.options = s, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = b;
|
|
432
432
|
}
|
|
433
|
-
_$AI(e, o = this,
|
|
433
|
+
_$AI(e, o = this, i, r) {
|
|
434
434
|
const s = this.strings;
|
|
435
435
|
let n = !1;
|
|
436
|
-
if (s === void 0) e = L(this, e, o, 0), n = !
|
|
436
|
+
if (s === void 0) e = L(this, e, o, 0), n = !W(e) || e !== this._$AH && e !== T, n && (this._$AH = e);
|
|
437
437
|
else {
|
|
438
438
|
const l = e;
|
|
439
439
|
let a, c;
|
|
440
|
-
for (e = s[0], a = 0; a < s.length - 1; a++) c = L(this, l[
|
|
440
|
+
for (e = s[0], a = 0; a < s.length - 1; a++) c = L(this, l[i + a], o, a), c === T && (c = this._$AH[a]), n ||= !W(c) || c !== this._$AH[a], c === b ? e = b : e !== b && (e += (c ?? "") + s[a + 1]), this._$AH[a] = c;
|
|
441
441
|
}
|
|
442
|
-
n && !
|
|
442
|
+
n && !r && this.j(e);
|
|
443
443
|
}
|
|
444
444
|
j(e) {
|
|
445
445
|
e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
class Ze extends
|
|
448
|
+
class Ze extends ie {
|
|
449
449
|
constructor() {
|
|
450
450
|
super(...arguments), this.type = 3;
|
|
451
451
|
}
|
|
@@ -453,7 +453,7 @@ class Ze extends oe {
|
|
|
453
453
|
this.element[this.name] = e === b ? void 0 : e;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
class Xe extends
|
|
456
|
+
class Xe extends ie {
|
|
457
457
|
constructor() {
|
|
458
458
|
super(...arguments), this.type = 4;
|
|
459
459
|
}
|
|
@@ -461,22 +461,22 @@ class Xe extends oe {
|
|
|
461
461
|
this.element.toggleAttribute(this.name, !!e && e !== b);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
class Ge extends
|
|
465
|
-
constructor(e, o,
|
|
466
|
-
super(e, o,
|
|
464
|
+
class Ge extends ie {
|
|
465
|
+
constructor(e, o, i, r, s) {
|
|
466
|
+
super(e, o, i, r, s), this.type = 5;
|
|
467
467
|
}
|
|
468
468
|
_$AI(e, o = this) {
|
|
469
469
|
if ((e = L(this, e, o, 0) ?? b) === T) return;
|
|
470
|
-
const
|
|
471
|
-
|
|
470
|
+
const i = this._$AH, r = e === b && i !== b || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, s = e !== b && (i === b || r);
|
|
471
|
+
r && this.element.removeEventListener(this.name, this, i), s && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
472
472
|
}
|
|
473
473
|
handleEvent(e) {
|
|
474
474
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
class Je {
|
|
478
|
-
constructor(e, o,
|
|
479
|
-
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = o, this.options =
|
|
478
|
+
constructor(e, o, i) {
|
|
479
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = i;
|
|
480
480
|
}
|
|
481
481
|
get _$AU() {
|
|
482
482
|
return this._$AM._$AU;
|
|
@@ -485,18 +485,18 @@ class Je {
|
|
|
485
485
|
L(this, e);
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
const Qe =
|
|
489
|
-
Qe?.(
|
|
488
|
+
const Qe = le.litHtmlPolyfillSupport;
|
|
489
|
+
Qe?.(K, X), (le.litHtmlVersions ??= []).push("3.3.2");
|
|
490
490
|
const et = (t, e, o) => {
|
|
491
|
-
const
|
|
492
|
-
let
|
|
493
|
-
if (
|
|
491
|
+
const i = o?.renderBefore ?? e;
|
|
492
|
+
let r = i._$litPart$;
|
|
493
|
+
if (r === void 0) {
|
|
494
494
|
const s = o?.renderBefore ?? null;
|
|
495
|
-
|
|
495
|
+
i._$litPart$ = r = new X(e.insertBefore(q(), s), s, void 0, o ?? {});
|
|
496
496
|
}
|
|
497
|
-
return
|
|
497
|
+
return r._$AI(t), r;
|
|
498
498
|
};
|
|
499
|
-
const
|
|
499
|
+
const ce = globalThis;
|
|
500
500
|
let F = class extends N {
|
|
501
501
|
constructor() {
|
|
502
502
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -519,19 +519,19 @@ let F = class extends N {
|
|
|
519
519
|
return T;
|
|
520
520
|
}
|
|
521
521
|
};
|
|
522
|
-
F._$litElement$ = !0, F.finalized = !0,
|
|
523
|
-
const tt =
|
|
522
|
+
F._$litElement$ = !0, F.finalized = !0, ce.litElementHydrateSupport?.({ LitElement: F });
|
|
523
|
+
const tt = ce.litElementPolyfillSupport;
|
|
524
524
|
tt?.({ LitElement: F });
|
|
525
|
-
(
|
|
526
|
-
const ot = E`:host{cursor:pointer;-webkit-user-select:none;user-select:none;width:
|
|
527
|
-
var
|
|
528
|
-
for (var
|
|
529
|
-
(n = t[s]) && (
|
|
530
|
-
return
|
|
525
|
+
(ce.litElementVersions ??= []).push("4.2.2");
|
|
526
|
+
const ot = E`:host{cursor:pointer;-webkit-user-select:none;user-select:none;display:inline-flex;width:fit-content;height:fit-content}:host([disabled]){cursor:not-allowed;opacity:.6}.checkbox-container{position:relative;transition:opacity .2s ease;display:flex;align-items:center;gap:.5rem}.checkbox-box{width:1rem;height:1rem;border-radius:.25rem;background-color:var(--nf-background-color);border:1px solid var(--nf-border-color);display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,border-color .2s ease}:host(:hover:not([checked]):not([disabled])) .checkbox-box{border-color:var(--nf-primary-color,var(--nf-primary-color))}:host([checked]) .checkbox-box{background-color:var(--nf-primary-color,var(--nf-primary-color));border-color:var(--nf-primary-color,var(--nf-primary-color))}:host([disabled]) .checkbox-box{border-color:#fffc;background:#fffc;cursor:not-allowed;pointer-events:none}:host([disabled][checked]) .checkbox-box{background-color:#fffc;border-color:#fffc}.checkbox-icon{color:#fff;font-size:.75rem;line-height:1;font-weight:700;transition:transform .2s ease;display:flex;align-items:center}:host([checked]) .checkbox-icon{transform:scale(1)}:host(:focus) .checkbox-container{outline:.125rem solid var(--nf-primary-color,var(--nf-primary-color));outline-offset:.125rem}.checkbox-text{font-size:.875rem;line-height:1.5;color:var(--nf-text-color);white-space:nowrap}`, C = (t) => (e) => (typeof window > "u" || customElements.get(t) || customElements.define(t, e), e);
|
|
527
|
+
var it = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, re = (t, e, o, i) => {
|
|
528
|
+
for (var r = i > 1 ? void 0 : i ? rt(e, o) : e, s = t.length - 1, n; s >= 0; s--)
|
|
529
|
+
(n = t[s]) && (r = (i ? n(e, o, r) : n(r)) || r);
|
|
530
|
+
return i && r && it(e, o, r), r;
|
|
531
531
|
};
|
|
532
|
-
let
|
|
532
|
+
let U = class extends F {
|
|
533
533
|
constructor() {
|
|
534
|
-
super(...arguments), this.checked = !1, this.disabled = !1;
|
|
534
|
+
super(...arguments), this.checked = !1, this.disabled = !1, this.text = "";
|
|
535
535
|
}
|
|
536
536
|
// 切换复选框状态
|
|
537
537
|
toggleCheckbox(t) {
|
|
@@ -545,7 +545,7 @@ let K = class extends F {
|
|
|
545
545
|
}
|
|
546
546
|
// 渲染复选框组件
|
|
547
547
|
render() {
|
|
548
|
-
return
|
|
548
|
+
return Q`<div class=checkbox-container @click=${this.toggleCheckbox} aria-checked=${this.checked} aria-disabled=${this.disabled} role=checkbox><div class=checkbox-box>${this.checked ? Q`<div class=checkbox-icon><svg viewBox="64 64 896 896"focusable=false data-icon=check width=0.625rem height=0.625rem fill=currentColor aria-hidden=true><path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"></path></svg></div>` : ""}</div>${this.text ? Q`<span class=checkbox-text>${this.text}</span>` : ""}<slot></slot></div>`;
|
|
549
549
|
}
|
|
550
550
|
connectedCallback() {
|
|
551
551
|
this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
|
|
@@ -553,21 +553,24 @@ let K = class extends F {
|
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
|
-
|
|
557
|
-
|
|
556
|
+
U.styles = [ot];
|
|
557
|
+
re([
|
|
558
558
|
h({ type: Boolean, reflect: !0 })
|
|
559
|
-
],
|
|
560
|
-
|
|
559
|
+
], U.prototype, "checked", 2);
|
|
560
|
+
re([
|
|
561
561
|
h({ type: Boolean, reflect: !0 })
|
|
562
|
-
],
|
|
563
|
-
|
|
562
|
+
], U.prototype, "disabled", 2);
|
|
563
|
+
re([
|
|
564
|
+
h({ type: String })
|
|
565
|
+
], U.prototype, "text", 2);
|
|
566
|
+
U = re([
|
|
564
567
|
C("nf-checkbox")
|
|
565
|
-
],
|
|
566
|
-
const
|
|
567
|
-
var nt = Object.defineProperty, at = Object.getOwnPropertyDescriptor, y = (t, e, o,
|
|
568
|
-
for (var
|
|
569
|
-
(n = t[s]) && (
|
|
570
|
-
return
|
|
568
|
+
], U);
|
|
569
|
+
const R = E`:host{display:inline-flex;align-items:center;position:relative;width:var(--nf-width);height:var(--nf-height);padding:var(--nf-padding);margin:var(--nf-margin);font-size:var(--nf-text-font-size);font-weight:var(--nf-font-weight);color:var(--nf-color);background:var(--nf-background-color);border-radius:var(--nf-border-radius);border:1px solid var(--nf-border-color);outline:0;background-clip:padding-box;box-shadow:0 0 0 .15rem var(--nf-box-shadow-color);transition:color var(--nf-transition) ease-in-out,background-color var(--nf-transition) ease-in-out,border-color var(--nf-transition) ease-in-out,box-shadow var(--nf-transition) ease-in-out}:host(:focus){border-color:var(--nf-border-color-hover);box-shadow:0 0 0 .15rem var(--nf-box-shadow-color-focus);background:var(--nf-background-color-hover)}:host(:hover:not([disabled])){border-color:var(--nf-border-color-hover);background:var(--nf-background-color-hover)}:host([disabled]){cursor:not-allowed;opacity:.6;pointer-events:auto}:host([disabled]:hover){border-color:var(--nf-border-color);background:var(--nf-background-color)}`, st = E`:host{display:inline-block;position:relative;width:calc(.9rem + (var(--nf-height) - 1.25rem)/ 2 + 7ch)}:host(:not([disabled-alpha])){width:calc(.9rem + (var(--nf-height) - 1.25rem)/ 2 + 9ch)}:host([disabled]){cursor:not-allowed;opacity:.6}:host([disabled]:hover){border-color:var(--nf-border-color);background:var(--nf-background-color)}:host([open]){border-color:var(--nf-border-color-hover);box-shadow:0 0 0 .15rem var(--nf-box-shadow-color-focus)}.trigger{width:calc(100% + 1.5rem + 2px);height:calc(100% + 2px);margin:-1px -.75rem;padding:1px .75rem;box-sizing:border-box;display:flex;align-items:center;cursor:pointer;transition:all .2s;font-size:.875rem;position:relative}:host(:not([disabled])) .trigger:hover{border-color:var(--nf-color-primary)}.trigger[disabled]{cursor:not-allowed;opacity:.6}:host([disabled]) .trigger{cursor:not-allowed;color:var(--nf-color-disabled)}.color-block{width:1.25rem;height:1.25rem;border-radius:.125rem;margin-left:calc((var(--nf-height) - 1.25rem)/ 2 - .75rem);margin-right:.4rem}:host(.hide-text) .color-block{margin-right:calc((var(--nf-height) - 1.25rem)/ 2 - .75rem)}.color-text{flex:1;text-align:center;text-transform:uppercase}.panel{position:absolute;z-index:1000;background:var(--nf-color-picker-card-background,var(--nf-dropdown-background));-webkit-backdrop-filter:blur(64px);backdrop-filter:blur(64px);border-radius:var(--nf-border-radius);box-shadow:0 6px 16px 0 var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow)),0 3px 6px -4px var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow)),0 9px 28px 8px var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow));-webkit-user-select:none;user-select:none}.panel-content{padding:.75rem;width:15rem}.color-selector{height:9.375rem;position:relative;margin-bottom:.75rem;border-radius:var(--nf-border-radius);overflow:hidden}.color-sb{width:100%;height:100%;position:relative;cursor:pointer}.sb-white{position:absolute;inset:0;background:linear-gradient(to right,#fff,#fff0)}.sb-black{position:absolute;inset:0;background:linear-gradient(to top,#000,#0000)}.selector{position:absolute;width:.625rem;height:.625rem;border:.125rem solid #fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 .125rem #00000080;pointer-events:none}.slider-container{margin-bottom:.5rem}.slider-container:last-child{margin-bottom:0}.sliders-row{display:flex;align-items:center;gap:.75rem}.sliders{flex:1}.slider{position:relative;height:.75rem;border-radius:.375rem}.hue-slider{background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.alpha-slider{position:relative;background-image:linear-gradient(45deg,var(--nf-color-picker-card-checker,#ccc) 25%,transparent 25%),linear-gradient(-45deg,var(--nf-color-picker-card-checker,#ccc) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--nf-color-picker-card-checker,#ccc) 75%),linear-gradient(-45deg,transparent 75%,var(--nf-color-picker-card-checker,#ccc) 75%);background-size:.375rem .375rem;background-position:0 0,0 .1875rem,.1875rem -.1875rem,-.1875rem 0;background-color:var(--nf-color-picker-card-checker-bg,#fff);border-radius:.375rem}.alpha-slider-input{position:relative;z-index:2}.alpha-gradient{position:absolute;inset:0;border-radius:.375rem}input[type=range]{-webkit-appearance:none;width:100%;height:100%;background:0 0;outline:0;position:absolute;top:0;left:0;margin:0;padding:0}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080;position:relative;z-index:1}input[type=range]::-moz-range-thumb{width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080}.current-color-container{display:flex}.current-color{width:2rem;height:2rem;border-radius:var(--nf-border-radius);border:.0625rem solid var(--nf-color-border)}:host(:not([disabled-alpha])) .current-color{width:2.5rem;height:2.5rem}`;
|
|
570
|
+
var nt = Object.defineProperty, at = Object.getOwnPropertyDescriptor, y = (t, e, o, i) => {
|
|
571
|
+
for (var r = i > 1 ? void 0 : i ? at(e, o) : e, s = t.length - 1, n; s >= 0; s--)
|
|
572
|
+
(n = t[s]) && (r = (i ? n(e, o, r) : n(r)) || r);
|
|
573
|
+
return i && r && nt(e, o, r), r;
|
|
571
574
|
};
|
|
572
575
|
let g = class extends B {
|
|
573
576
|
constructor() {
|
|
@@ -609,34 +612,34 @@ let g = class extends B {
|
|
|
609
612
|
}
|
|
610
613
|
// 从HEX颜色值更新HSB值
|
|
611
614
|
_updateHSBFromHex(t) {
|
|
612
|
-
const e = parseInt(t.slice(1, 3), 16) / 255, o = parseInt(t.slice(3, 5), 16) / 255,
|
|
615
|
+
const e = parseInt(t.slice(1, 3), 16) / 255, o = parseInt(t.slice(3, 5), 16) / 255, i = parseInt(t.slice(5, 7), 16) / 255, r = Math.max(e, o, i), s = Math.min(e, o, i), n = r - s;
|
|
613
616
|
let l = 0, a = 0;
|
|
614
|
-
const c =
|
|
615
|
-
n !== 0 && (a = n /
|
|
617
|
+
const c = r;
|
|
618
|
+
n !== 0 && (a = n / r, r === e ? l = (o - i) / n % 6 : r === o ? l = (i - e) / n + 2 : l = (e - o) / n + 4, l *= 60, l < 0 && (l += 360)), this._hsb = {
|
|
616
619
|
h: Math.round(l),
|
|
617
620
|
s: Math.round(a * 100),
|
|
618
621
|
b: Math.round(c * 100)
|
|
619
622
|
};
|
|
620
623
|
}
|
|
621
624
|
// 从HSB值生成HEX颜色值
|
|
622
|
-
_generateHexFromHSB(t, e, o,
|
|
625
|
+
_generateHexFromHSB(t, e, o, i = "FF") {
|
|
623
626
|
e /= 100, o /= 100;
|
|
624
|
-
const
|
|
627
|
+
const r = o * e, s = r * (1 - Math.abs(t / 60 % 2 - 1)), n = o - r;
|
|
625
628
|
let l = 0, a = 0, c = 0;
|
|
626
|
-
return 0 <= t && t < 60 ? (l =
|
|
629
|
+
return 0 <= t && t < 60 ? (l = r, a = s, c = 0) : 60 <= t && t < 120 ? (l = s, a = r, c = 0) : 120 <= t && t < 180 ? (l = 0, a = r, c = s) : 180 <= t && t < 240 ? (l = 0, a = s, c = r) : 240 <= t && t < 300 ? (l = s, a = 0, c = r) : 300 <= t && t < 360 && (l = r, a = 0, c = s), l = Math.round((l + n) * 255), a = Math.round((a + n) * 255), c = Math.round((c + n) * 255), "#" + l.toString(16).padStart(2, "0") + a.toString(16).padStart(2, "0") + c.toString(16).padStart(2, "0") + i;
|
|
627
630
|
}
|
|
628
631
|
// 计算面板位置
|
|
629
632
|
_updatePanelPosition() {
|
|
630
633
|
requestAnimationFrame(() => {
|
|
631
634
|
const t = this.getBoundingClientRect(), e = this.shadowRoot?.querySelector(".panel");
|
|
632
635
|
if (!e) return;
|
|
633
|
-
const o = 0.15 * 16,
|
|
636
|
+
const o = 0.15 * 16, i = 8, r = e.offsetWidth || 240, s = e.offsetHeight || 300;
|
|
634
637
|
let n = this.placement, l = this.align;
|
|
635
|
-
this.autoAdjust && (n === "bottom" ? window.innerHeight - t.bottom -
|
|
638
|
+
this.autoAdjust && (n === "bottom" ? window.innerHeight - t.bottom - i < s && t.top - i >= s && (n = "top") : t.top - i < s && window.innerHeight - t.bottom - i >= s && (n = "bottom"), l === "right" ? t.right - o < r && t.left + t.width + o + r <= window.innerWidth && (l = "left") : t.left - o + r > window.innerWidth && t.right - o >= r && (l = "right"));
|
|
636
639
|
let a;
|
|
637
|
-
n === "bottom" ? a = t.height +
|
|
640
|
+
n === "bottom" ? a = t.height + i : a = -s - i;
|
|
638
641
|
let c;
|
|
639
|
-
l === "right" ? c = t.width -
|
|
642
|
+
l === "right" ? c = t.width - r + o : c = -o, this._panelPosition = { top: a, left: c };
|
|
640
643
|
});
|
|
641
644
|
}
|
|
642
645
|
// 打开面板
|
|
@@ -664,8 +667,8 @@ let g = class extends B {
|
|
|
664
667
|
// 处理HSB颜色变化
|
|
665
668
|
_handleHSBChange(t, e, o) {
|
|
666
669
|
this._hsb = { h: t, s: e, b: o };
|
|
667
|
-
const
|
|
668
|
-
this._handleColorChange(
|
|
670
|
+
const i = this._internalValue.slice(7), r = this._generateHexFromHSB(t, e, o, i);
|
|
671
|
+
this._handleColorChange(r);
|
|
669
672
|
}
|
|
670
673
|
// 处理Alpha值变化
|
|
671
674
|
_handleAlphaChange(t) {
|
|
@@ -691,7 +694,7 @@ let g = class extends B {
|
|
|
691
694
|
_handleSBChange(t) {
|
|
692
695
|
const e = this.shadowRoot?.querySelector(".color-sb");
|
|
693
696
|
if (!e) return;
|
|
694
|
-
const o = e.getBoundingClientRect(),
|
|
697
|
+
const o = e.getBoundingClientRect(), i = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, r = t instanceof MouseEvent ? t.clientY : t.touches[0].clientY, s = Math.max(0, Math.min(100, Math.round((i - o.left) / o.width * 100))), n = Math.max(0, Math.min(100, Math.round((1 - (r - o.top) / o.height) * 100)));
|
|
695
698
|
this._handleHSBChange(this._hsb.h, s, n);
|
|
696
699
|
}
|
|
697
700
|
// 处理透明度选择
|
|
@@ -816,7 +819,7 @@ let g = class extends B {
|
|
|
816
819
|
`;
|
|
817
820
|
}
|
|
818
821
|
};
|
|
819
|
-
g.styles = [
|
|
822
|
+
g.styles = [R, st];
|
|
820
823
|
y([
|
|
821
824
|
h({ type: String })
|
|
822
825
|
], g.prototype, "value", 2);
|
|
@@ -870,10 +873,10 @@ g = y([
|
|
|
870
873
|
C("nf-color-picker")
|
|
871
874
|
], g);
|
|
872
875
|
const lt = E`:host{display:inline-block;--nf-empty-image-background:var(--nf-background-color);--nf-empty-image-color:color-mix(in srgb, var(--nf-color), #000000 30%);--nf-empty-description-color:var(--nf-color)}.empty-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1rem;text-align:center}.empty-image{margin-bottom:.5rem;display:flex;align-items:center;justify-content:center}.empty-image img{max-width:100%;height:auto}.empty-image svg{display:block}.empty-description{margin-top:.5rem;color:var(--nf-empty-description-color);font-size:.875rem;line-height:1.5715}.empty-description:empty{display:none}.empty-footer{margin-top:1rem}.empty-footer:empty{display:none}`;
|
|
873
|
-
var ht = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, de = (t, e, o,
|
|
874
|
-
for (var
|
|
875
|
-
(n = t[s]) && (
|
|
876
|
-
return
|
|
876
|
+
var ht = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, de = (t, e, o, i) => {
|
|
877
|
+
for (var r = i > 1 ? void 0 : i ? ct(e, o) : e, s = t.length - 1, n; s >= 0; s--)
|
|
878
|
+
(n = t[s]) && (r = (i ? n(e, o, r) : n(r)) || r);
|
|
879
|
+
return i && r && ht(e, o, r), r;
|
|
877
880
|
};
|
|
878
881
|
let Y = class extends B {
|
|
879
882
|
constructor() {
|
|
@@ -905,10 +908,10 @@ Y = de([
|
|
|
905
908
|
C("nf-empty")
|
|
906
909
|
], Y);
|
|
907
910
|
const dt = E`:host{width:var(--nf-width);position:relative;display:inline-block;--nf-input-padding:0 .75rem}:host([disabled]) .input{cursor:not-allowed;color:var(--nf-color-disabled)}:host([disabled]) .toggle-password{cursor:not-allowed;pointer-events:none;opacity:.5}::slotted(*){position:absolute;top:50%;left:.75rem;transform:translateY(-50%);color:var(--nf-color)}:host([disabled]) ::slotted(*){color:var(--nf-color-disabled)}.input{position:absolute;inset:0;padding:var(--nf-input-padding);outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif}.input:has(.toggle-password){padding-right:2.5rem}.input .toggle-password{position:absolute;top:50%;right:.5rem;transform:translateY(-50%);background:0 0;border:none;cursor:pointer;padding:.25rem;display:flex;align-items:center;justify-content:center;color:var(--nf-select-icon-color);transition:color var(--nf-transition-fast) ease;outline:0}.input .toggle-password:hover{color:var(--nf-icon-color-hover)}.input .toggle-password:active{color:var(--nf-icon-color-active)}.input .toggle-password svg{display:block}`;
|
|
908
|
-
var ut = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, V = (t, e, o,
|
|
909
|
-
for (var
|
|
910
|
-
(n = t[s]) && (
|
|
911
|
-
return
|
|
911
|
+
var ut = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, V = (t, e, o, i) => {
|
|
912
|
+
for (var r = i > 1 ? void 0 : i ? pt(e, o) : e, s = t.length - 1, n; s >= 0; s--)
|
|
913
|
+
(n = t[s]) && (r = (i ? n(e, o, r) : n(r)) || r);
|
|
914
|
+
return i && r && ut(e, o, r), r;
|
|
912
915
|
};
|
|
913
916
|
let A = class extends B {
|
|
914
917
|
constructor() {
|
|
@@ -970,7 +973,7 @@ let A = class extends B {
|
|
|
970
973
|
});
|
|
971
974
|
}
|
|
972
975
|
};
|
|
973
|
-
A.styles = [
|
|
976
|
+
A.styles = [R, dt];
|
|
974
977
|
V([
|
|
975
978
|
h({ type: String })
|
|
976
979
|
], A.prototype, "value", 2);
|
|
@@ -993,10 +996,10 @@ A = V([
|
|
|
993
996
|
C("nf-input")
|
|
994
997
|
], A);
|
|
995
998
|
const ft = E`:host{width:10rem;position:relative;display:inline-flex;align-items:center;box-sizing:border-box;padding:0;overflow:hidden;--nf-input-number-color:var(--nf-color);--nf-input-number-prefix-color:color-mix(in srgb, var(--nf-color), transparent 20%);--nf-input-number-surfix-color:color-mix(in srgb, var(--nf-color), transparent 20%)}.input-number{position:relative;padding-right:.6125rem;flex:1;height:100%;outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-input-number-color);font-weight:var(--nf-font-weight);text-align:left;transition:padding-right var(--nf-transition-fast) ease}.input-number .input-number-input-wrapper{height:100%}.input-number .input-number-input-wrapper .input-number-input{background:0 0;width:100%;height:100%;text-align:start;border:0;outline:0;padding:0;box-sizing:border-box;color:var(--nf-input-number-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif}.input-number::-webkit-inner-spin-button,.input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input-number[type=number]{appearance:textfield}:host([controls]) .input-number:hover{padding-right:1.5rem}:host([controls]) .input-number:hover .controls{width:1.5rem}:host([center]) .input-number{padding-left:1.5rem!important;padding-right:1.5rem!important}:host([center]) .input-number .input-number-input{text-align:center}:host([center]) .input-number:hover{padding-left:1.5rem!important;padding-right:1.5rem!important}:host([center]) .input-prefix{position:absolute;left:0;top:0;bottom:0;z-index:1;pointer-events:none}:host([center]) .input-suffix{position:absolute;right:0;top:0;bottom:0;z-index:1;pointer-events:none}:host([center]) .input-number{flex:1;width:100%}.input-prefix{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding-inline-start:.6125rem;color:var(--nf-input-number-prefix-color);font-size:var(--nf-font-size);pointer-events:none;-webkit-user-select:none;user-select:none}.input-prefix:not(:empty){padding-inline-end:.25rem}.input-suffix{display:flex;align-items:center;justify-content:center;color:var(--nf-input-number-surfix-color);font-size:var(--nf-font-size);pointer-events:none;-webkit-user-select:none;user-select:none}.input-suffix:not(:empty){padding-inline-end:.6125rem;padding-inline-start:.5rem}.controls{position:absolute;top:0;right:0;height:100%;width:0;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;transition:width var(--nf-transition-fast) ease}.controls:before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:.67px;background-color:var(--nf-control-divider-color)}:host([suffix]) .controls:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:.67px;background-color:var(--nf-control-divider-color)}.control-btn{flex:1;display:flex;align-items:center;justify-content:center;background:0 0;border:none;cursor:pointer;transition:background-color var(--nf-transition-fast) ease;outline:0;-webkit-user-select:none;user-select:none}.control-btn:hover{background-color:var(--nf-control-btn-background-hover)}.control-btn:active{background-color:var(--nf-control-btn-background-active)}.control-btn:focus-visible{background-color:var(--nf-control-btn-background-hover)}.control-btn svg{display:block;pointer-events:none;fill:none;stroke:var(--nf-select-icon-color);stroke-width:1;stroke-linecap:round}.control-btn-up{border-bottom:.67px solid var(--nf-control-divider-color)}:host(:not([suffix])) .control-btn-up{border-top-right-radius:var(--nf-border-radius)}:host(:not([suffix])) .control-btn-down{border-bottom-right-radius:var(--nf-border-radius)}:host([disabled]) .input-number-input{cursor:not-allowed;color:var(--nf-color-disabled)}:host([disabled]) .input-prefix,:host([disabled]) .input-suffix{color:var(--nf-color-disabled)}:host([disabled]) .controls{display:none}:host([disabled]) .control-btn{cursor:not-allowed;pointer-events:none;opacity:.5}`;
|
|
996
|
-
var bt = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, m = (t, e, o,
|
|
997
|
-
for (var
|
|
998
|
-
(n = t[s]) && (
|
|
999
|
-
return
|
|
999
|
+
var bt = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, m = (t, e, o, i) => {
|
|
1000
|
+
for (var r = i > 1 ? void 0 : i ? mt(e, o) : e, s = t.length - 1, n; s >= 0; s--)
|
|
1001
|
+
(n = t[s]) && (r = (i ? n(e, o, r) : n(r)) || r);
|
|
1002
|
+
return i && r && bt(e, o, r), r;
|
|
1000
1003
|
};
|
|
1001
1004
|
let f = class extends B {
|
|
1002
1005
|
constructor() {
|
|
@@ -1086,8 +1089,8 @@ let f = class extends B {
|
|
|
1086
1089
|
this.value = e;
|
|
1087
1090
|
let o = this.fixFloatingPoint(this.value + t * this.step);
|
|
1088
1091
|
o = this.clampValue(o);
|
|
1089
|
-
const
|
|
1090
|
-
|
|
1092
|
+
const i = this.validateParsed(o);
|
|
1093
|
+
i !== null && (o = i, o !== this.value && (this.value = o, this.setText(this.formatter(o)), this.dispatchEvent(
|
|
1091
1094
|
new CustomEvent("change", {
|
|
1092
1095
|
detail: o
|
|
1093
1096
|
})
|
|
@@ -1103,7 +1106,7 @@ let f = class extends B {
|
|
|
1103
1106
|
return u`<div class=input-prefix>${this.prefix}</div><div class=input-number><div class=input-number-input-wrapper><input inputmode=decimal class=input-number-input .value=${this.text} ?disabled=${this.disabled} @blur=${this.onBlur} @focus=${this.onFocus} @input=${this.onInput} @keydown=${this.onKeyDown} @wheel=${this.onWheel} @keyup=${this.onKeyUp}></div>${this.controls ? u`<div class=controls><button class="control-btn control-btn-up"type=button ?disabled=${this.disabled} @click=${() => this.handleStepChange(1)} aria-label="Increase value"><svg width=12 height=12 viewBox="0 0 24 24"><path d="M6 14.6l6-6.6 6 6.6"/></svg></button><button class="control-btn control-btn-down"type=button ?disabled=${this.disabled} @click=${() => this.handleStepChange(-1)} aria-label="Decrease value"><svg width=12 height=12 viewBox="0 0 24 24"><path d="M18 9.4l-6 6.6-6-6.6"/></svg></button></div>` : ""}</div>${this.suffix ? u`<div class=input-suffix>${this.suffix}</div>` : ""}`;
|
|
1104
1107
|
}
|
|
1105
1108
|
};
|
|
1106
|
-
f.styles = [
|
|
1109
|
+
f.styles = [R, ft];
|
|
1107
1110
|
m([
|
|
1108
1111
|
h({ type: Number })
|
|
1109
1112
|
], f.prototype, "value", 2);
|
|
@@ -1176,10 +1179,10 @@ async function gt(t) {
|
|
|
1176
1179
|
return new Promise((e) => setTimeout(e, t));
|
|
1177
1180
|
}
|
|
1178
1181
|
const vt = E`:host{width:var(--nf-width);-webkit-user-select:none;user-select:none;cursor:pointer}:host .text{flex-grow:1;display:inline-block;outline:0;white-space:nowrap}:host .icon{width:1.5rem;height:1.5rem;display:inline-block;fill:none;stroke:var(--nf-select-icon-color);stroke-width:1;stroke-linecap:round;margin:0 -.3rem 0 .5rem}:host .dropdown{position:absolute;top:2rem;right:0;left:0;padding:.3rem;background:var(--nf-dropdown-background);-webkit-backdrop-filter:blur(32px);backdrop-filter:blur(32px);border-radius:.5rem;opacity:0;pointer-events:none;color:var(--nf-color);box-shadow:0 0 1rem 0 var(--nf-dropdown-shadow);z-index:1000;transition:opacity var(--nf-transition) ease-out,transform var(--nf-transition) ease-out}:host .dropdown .item{white-space:nowrap;padding:.4rem .7rem;overflow:hidden;text-overflow:ellipsis;border-radius:.3rem;cursor:pointer}:host .dropdown .item-unselected:hover{background:var(--nf-item-background-hover);transition:background-color var(--nf-transition) ease-in-out}:host .dropdown .item-unselected:active{background:var(--nf-item-background-active)}:host .dropdown .item-selected{background-color:color-mix(in srgb,var(--nf-primary-color) 30%,transparent)}:host([disabled]){cursor:not-allowed}:host([disabled]) .text{color:var(--nf-color-disabled)}:host([disabled]) .icon{stroke:var(--nf-color-disabled)}:host([disabled]) .dropdown{display:none}:host(:focus:not([disabled])){color:var(--nf-focus-text-color)}:host(:focus:not([disabled])) .dropdown{transform:translateY(.5rem);opacity:1;pointer-events:auto}:host(:focus:not([disabled])) .cover{pointer-events:auto}`;
|
|
1179
|
-
var yt = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, G = (t, e, o,
|
|
1180
|
-
for (var
|
|
1181
|
-
(n = t[s]) && (
|
|
1182
|
-
return
|
|
1182
|
+
var yt = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, G = (t, e, o, i) => {
|
|
1183
|
+
for (var r = i > 1 ? void 0 : i ? wt(e, o) : e, s = t.length - 1, n; s >= 0; s--)
|
|
1184
|
+
(n = t[s]) && (r = (i ? n(e, o, r) : n(r)) || r);
|
|
1185
|
+
return i && r && yt(e, o, r), r;
|
|
1183
1186
|
};
|
|
1184
1187
|
let z = class extends B {
|
|
1185
1188
|
constructor() {
|
|
@@ -1217,7 +1220,7 @@ let z = class extends B {
|
|
|
1217
1220
|
super.disconnectedCallback(), this.removeEventListener("focus", this.onFocus), this.removeEventListener("blur", this.onBlur), this.removeEventListener("click", this.onClick);
|
|
1218
1221
|
}
|
|
1219
1222
|
};
|
|
1220
|
-
z.styles = [
|
|
1223
|
+
z.styles = [R, vt];
|
|
1221
1224
|
G([
|
|
1222
1225
|
h({ type: String })
|
|
1223
1226
|
], z.prototype, "value", 2);
|
|
@@ -1247,10 +1250,10 @@ z = G([
|
|
|
1247
1250
|
C("nf-select")
|
|
1248
1251
|
], z);
|
|
1249
1252
|
const _t = E`:host{display:inline-flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;outline:0;--nf-switch-padding:.1rem}:host[disabled]{cursor:not-allowed;opacity:.6}.switch-wrapper{position:relative;display:inline-block}.switch-container{position:relative;z-index:1;width:3.1rem;height:1.5rem;background-color:var(--nf-background-color);border-radius:.75rem;transition:background-color .2s ease;overflow:hidden}:host(:not([disabled]):not([checked])) .switch-container:hover{background:var(--nf-background-color-hover)}:host([checked]) .switch-container{background-color:var(--nf-primary-color,var(--nf-primary-color))}:host([disabled]) .switch-container{opacity:.5}.ripple{position:absolute;border-radius:.875rem;inset:-.2rem;background-color:#6464641a;animation:ripple-animation 1s ease-out forwards;pointer-events:none;opacity:1}@keyframes ripple-animation{0%{opacity:0}20%{opacity:1}to{opacity:0}}.switch-thumb{position:absolute;top:.125rem;left:0;width:1.25rem;height:1.25rem;transition:transform .2s ease-in-out}.switch-thumb:before{content:\"\";position:absolute;top:0;left:0;width:1.25rem;height:1.25rem;background-color:#fff;border-radius:.625rem;box-shadow:0 .125rem .25rem #0003;transition:width .2s ease-in-out,transform .2s ease-in-out}:host(:not([checked])) .switch-thumb{transform:translate(.125rem)}:host(:not([checked])) .switch-container:active .switch-thumb:before{width:1.625rem;border-radius:.625rem}:host([checked]) .switch-thumb{transform:translate(1.725rem)}:host([checked]) .switch-container:active .switch-thumb:before{width:1.625rem;border-radius:.625rem;transform:translate(-.375rem)}:host(:focus) .switch-container{outline:.125rem solid var(--nf-primary-color,var(--nf-primary-color));outline-offset:.125rem}`;
|
|
1250
|
-
var $t = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, ue = (t, e, o,
|
|
1251
|
-
for (var
|
|
1252
|
-
(n = t[s]) && (
|
|
1253
|
-
return
|
|
1253
|
+
var $t = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, ue = (t, e, o, i) => {
|
|
1254
|
+
for (var r = i > 1 ? void 0 : i ? xt(e, o) : e, s = t.length - 1, n; s >= 0; s--)
|
|
1255
|
+
(n = t[s]) && (r = (i ? n(e, o, r) : n(r)) || r);
|
|
1256
|
+
return i && r && $t(e, o, r), r;
|
|
1254
1257
|
};
|
|
1255
1258
|
let Z = class extends F {
|
|
1256
1259
|
constructor() {
|
|
@@ -1271,14 +1274,14 @@ let Z = class extends F {
|
|
|
1271
1274
|
if (!e) return;
|
|
1272
1275
|
const o = e.querySelector(".ripple");
|
|
1273
1276
|
o && e.removeChild(o);
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1276
|
-
e.contains(
|
|
1277
|
+
const i = document.createElement("div");
|
|
1278
|
+
i.classList.add("ripple"), e.appendChild(i), i.addEventListener("animationend", () => {
|
|
1279
|
+
e.contains(i) && e.removeChild(i);
|
|
1277
1280
|
});
|
|
1278
1281
|
}
|
|
1279
1282
|
// 渲染开关组件
|
|
1280
1283
|
render() {
|
|
1281
|
-
return
|
|
1284
|
+
return Q`<div class=switch-wrapper><div class=switch-container @click=${this.toggleSwitch} aria-checked=${this.checked} aria-disabled=${this.disabled} role=switch><div class=switch-thumb></div></div></div>`;
|
|
1282
1285
|
}
|
|
1283
1286
|
connectedCallback() {
|
|
1284
1287
|
this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
|
|
@@ -1303,8 +1306,8 @@ let St = class {
|
|
|
1303
1306
|
get _$AU() {
|
|
1304
1307
|
return this._$AM._$AU;
|
|
1305
1308
|
}
|
|
1306
|
-
_$AT(e, o,
|
|
1307
|
-
this._$Ct = e, this._$AM = o, this._$Ci =
|
|
1309
|
+
_$AT(e, o, i) {
|
|
1310
|
+
this._$Ct = e, this._$AM = o, this._$Ci = i;
|
|
1308
1311
|
}
|
|
1309
1312
|
_$AS(e, o) {
|
|
1310
1313
|
return this.update(e, o);
|
|
@@ -1319,29 +1322,29 @@ const De = "important", At = " !" + De, ke = Et(class extends St {
|
|
|
1319
1322
|
}
|
|
1320
1323
|
render(t) {
|
|
1321
1324
|
return Object.keys(t).reduce((e, o) => {
|
|
1322
|
-
const
|
|
1323
|
-
return
|
|
1325
|
+
const i = t[o];
|
|
1326
|
+
return i == null ? e : e + `${o = o.includes("-") ? o : o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${i};`;
|
|
1324
1327
|
}, "");
|
|
1325
1328
|
}
|
|
1326
1329
|
update(t, [e]) {
|
|
1327
1330
|
const { style: o } = t.element;
|
|
1328
1331
|
if (this.ft === void 0) return this.ft = new Set(Object.keys(e)), this.render(e);
|
|
1329
|
-
for (const
|
|
1330
|
-
for (const
|
|
1331
|
-
const
|
|
1332
|
-
if (
|
|
1333
|
-
this.ft.add(
|
|
1334
|
-
const s = typeof
|
|
1335
|
-
|
|
1332
|
+
for (const i of this.ft) e[i] == null && (this.ft.delete(i), i.includes("-") ? o.removeProperty(i) : o[i] = null);
|
|
1333
|
+
for (const i in e) {
|
|
1334
|
+
const r = e[i];
|
|
1335
|
+
if (r != null) {
|
|
1336
|
+
this.ft.add(i);
|
|
1337
|
+
const s = typeof r == "string" && r.endsWith(At);
|
|
1338
|
+
i.includes("-") || s ? o.setProperty(i, s ? r.slice(0, -11) : r, s ? De : "") : o[i] = r;
|
|
1336
1339
|
}
|
|
1337
1340
|
}
|
|
1338
1341
|
return T;
|
|
1339
1342
|
}
|
|
1340
1343
|
}), Ct = E`:host{display:inline-flex;align-items:center;position:relative;width:100%;height:1.25rem;background-color:var(--nf-border-color,#e0e0e0);border-radius:.625rem;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;box-shadow:none;padding:0}:host:hover{background-color:var(--nf-border-color,#e0e0e0);border:none}:host:focus{box-shadow:none;outline:0}:host([disabled]){cursor:not-allowed;opacity:.6}.slider-fill{position:absolute;left:0;top:0;height:100%;background-color:var(--nf-primary-color,#5e72f9);border-radius:.625rem 0 0 .625rem;pointer-events:none}.slider-handle{position:absolute;width:1.25rem;height:1.25rem;background-color:#fff;border-radius:50%;top:50%;transform:translate(-50%,-50%);cursor:grab;outline:0;box-shadow:0 1px 3px #0000004d;transition:transform .15s ease,box-shadow .15s ease;z-index:1}:host([disabled]) .slider-handle{cursor:not-allowed}:host(:not([disabled])) .slider-handle:hover{transform:translate(-50%,-50%) scale(1.05)}:host(:not([disabled])) .slider-handle:active{cursor:grabbing;transform:translate(-50%,-50%) scale(1.15);box-shadow:0 3px 8px #0006}.slider-handle:focus{box-shadow:0 0 0 3px #5e72f94d}.slider-tooltip{position:absolute;bottom:calc(100% + .5rem);left:50%;transform:translate(-50%);background-color:var(--nf-slider-tooltip-background);color:var(--nf-color);padding:.25rem .5rem;border-radius:.25rem;font-size:.75rem;white-space:nowrap;opacity:0;transition:opacity .2s ease;pointer-events:none;box-shadow:0 0 .4rem .1rem #0000001a}.slider-tooltip.visible{opacity:1}`;
|
|
1341
|
-
var Pt = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, $ = (t, e, o,
|
|
1342
|
-
for (var
|
|
1343
|
-
(n = t[s]) && (
|
|
1344
|
-
return
|
|
1344
|
+
var Pt = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, $ = (t, e, o, i) => {
|
|
1345
|
+
for (var r = i > 1 ? void 0 : i ? Dt(e, o) : e, s = t.length - 1, n; s >= 0; s--)
|
|
1346
|
+
(n = t[s]) && (r = (i ? n(e, o, r) : n(r)) || r);
|
|
1347
|
+
return i && r && Pt(e, o, r), r;
|
|
1345
1348
|
};
|
|
1346
1349
|
let v = class extends B {
|
|
1347
1350
|
constructor() {
|
|
@@ -1414,7 +1417,7 @@ let v = class extends B {
|
|
|
1414
1417
|
this._isDragging = !0, this._showTooltip = !0, this._updateValue(t), document.addEventListener("mousemove", this._handleDrag), document.addEventListener("touchmove", this._handleDrag, { passive: !1 }), document.addEventListener("mouseup", this._stopDrag), document.addEventListener("touchend", this._stopDrag);
|
|
1415
1418
|
}
|
|
1416
1419
|
_updateValue(t) {
|
|
1417
|
-
const e = this.getBoundingClientRect(), o = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX,
|
|
1420
|
+
const e = this.getBoundingClientRect(), o = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, i = Math.max(0, Math.min(1, (o - e.left) / e.width)), r = this.max - this.min, s = this.min + i * r, n = Math.round((s - this.min) / this.step), l = this.min + n * this.step;
|
|
1418
1421
|
this._currentValue = Math.min(this.max, Math.max(this.min, l)), this.requestUpdate();
|
|
1419
1422
|
}
|
|
1420
1423
|
_getValuePercentage() {
|
|
@@ -1422,11 +1425,11 @@ let v = class extends B {
|
|
|
1422
1425
|
return t === 0 ? 0 : (this._currentValue - this.min) / t * 100;
|
|
1423
1426
|
}
|
|
1424
1427
|
render() {
|
|
1425
|
-
const t = this._getValuePercentage(), e = `${t}%`, o = `${t}%`,
|
|
1426
|
-
return u`<div class=slider-fill style=${ke({ width: o })}></div><div class=slider-handle style=${ke({ left: e })} tabindex=${this.disabled ? -1 : 0} @mousedown=${this._handleMouseDown} @touchstart=${this._handleTouchStart} @keydown=${this._handleKeyDown}><div class=${
|
|
1428
|
+
const t = this._getValuePercentage(), e = `${t}%`, o = `${t}%`, i = `slider-tooltip ${this._showTooltip || this.tooltip ? "visible" : ""}`;
|
|
1429
|
+
return u`<div class=slider-fill style=${ke({ width: o })}></div><div class=slider-handle style=${ke({ left: e })} tabindex=${this.disabled ? -1 : 0} @mousedown=${this._handleMouseDown} @touchstart=${this._handleTouchStart} @keydown=${this._handleKeyDown}><div class=${i}>${this._currentValue}</div></div>`;
|
|
1427
1430
|
}
|
|
1428
1431
|
};
|
|
1429
|
-
v.styles = [
|
|
1432
|
+
v.styles = [R, Ct];
|
|
1430
1433
|
$([
|
|
1431
1434
|
h({ type: Number })
|
|
1432
1435
|
], v.prototype, "value", 2);
|
|
@@ -1464,10 +1467,10 @@ v = $([
|
|
|
1464
1467
|
C("nf-slider")
|
|
1465
1468
|
], v);
|
|
1466
1469
|
const Mt = E`:host{width:var(--nf-width);position:relative;display:inline-block;--nf-textarea-padding:.4rem .75rem}:host([disabled]) .textarea{cursor:not-allowed;color:var(--nf-color-disabled)}::slotted(*){position:absolute;top:.75rem;left:.75rem;color:var(--nf-color)}:host([disabled]) ::slotted(*){color:var(--nf-color-disabled)}.textarea{position:absolute;inset:0;padding:var(--nf-textarea-padding);outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif;resize:none;line-height:1.5715;overflow-y:auto;overflow-x:hidden}.textarea::-webkit-scrollbar{width:6px}.textarea::-webkit-scrollbar-track{background:0 0}.textarea::-webkit-scrollbar-thumb{background:var(--nf-scrollbar-thumb-color,rgba(0,0,0,.2));border-radius:3px}.textarea::-webkit-scrollbar-thumb:hover{background:var(--nf-scrollbar-thumb-hover-color,rgba(0,0,0,.3))}.counter{position:absolute;bottom:.5rem;right:.75rem;font-size:.75rem;color:var(--nf-color-secondary,rgba(0,0,0,.45));pointer-events:none;-webkit-user-select:none;user-select:none}`;
|
|
1467
|
-
var Ht = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, P = (t, e, o,
|
|
1468
|
-
for (var
|
|
1469
|
-
(n = t[s]) && (
|
|
1470
|
-
return
|
|
1470
|
+
var Ht = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, P = (t, e, o, i) => {
|
|
1471
|
+
for (var r = i > 1 ? void 0 : i ? Ot(e, o) : e, s = t.length - 1, n; s >= 0; s--)
|
|
1472
|
+
(n = t[s]) && (r = (i ? n(e, o, r) : n(r)) || r);
|
|
1473
|
+
return i && r && Ht(e, o, r), r;
|
|
1471
1474
|
};
|
|
1472
1475
|
let x = class extends B {
|
|
1473
1476
|
constructor() {
|
|
@@ -1519,15 +1522,15 @@ let x = class extends B {
|
|
|
1519
1522
|
if (!this.textareaRef || !this.autoSize) return;
|
|
1520
1523
|
const t = this.textareaRef;
|
|
1521
1524
|
t.style.height = "0", t.style.overflowY = "hidden";
|
|
1522
|
-
const e = t.scrollHeight, o = getComputedStyle(t),
|
|
1525
|
+
const e = t.scrollHeight, o = getComputedStyle(t), i = parseFloat(o.lineHeight), r = parseFloat(o.paddingTop), s = parseFloat(o.paddingBottom);
|
|
1523
1526
|
let n = e, l = !1;
|
|
1524
1527
|
const a = typeof this.autoSize == "object" ? this.autoSize : {}, c = a.minRows, p = a.maxRows;
|
|
1525
1528
|
if (c !== void 0) {
|
|
1526
|
-
const S =
|
|
1529
|
+
const S = i * c + r + s;
|
|
1527
1530
|
n = Math.max(n, S);
|
|
1528
1531
|
}
|
|
1529
1532
|
if (p !== void 0) {
|
|
1530
|
-
const S =
|
|
1533
|
+
const S = i * p + r + s;
|
|
1531
1534
|
e > S && (l = !0), n = Math.min(n, S);
|
|
1532
1535
|
}
|
|
1533
1536
|
const d = parseFloat(getComputedStyle(document.documentElement).fontSize), w = n / d, k = 0.125;
|
|
@@ -1546,8 +1549,8 @@ let x = class extends B {
|
|
|
1546
1549
|
this.style.height = `${n}rem`;
|
|
1547
1550
|
}
|
|
1548
1551
|
} else {
|
|
1549
|
-
const
|
|
1550
|
-
this.style.height = `${
|
|
1552
|
+
const r = 1.3750624999999999 * this.rows + 0.8 + 0.125;
|
|
1553
|
+
this.style.height = `${r}rem`;
|
|
1551
1554
|
}
|
|
1552
1555
|
}
|
|
1553
1556
|
connectedCallback() {
|
|
@@ -1556,7 +1559,7 @@ let x = class extends B {
|
|
|
1556
1559
|
});
|
|
1557
1560
|
}
|
|
1558
1561
|
};
|
|
1559
|
-
x.styles = [
|
|
1562
|
+
x.styles = [R, Mt];
|
|
1560
1563
|
P([
|
|
1561
1564
|
h({ type: String })
|
|
1562
1565
|
], x.prototype, "value", 2);
|
|
@@ -1585,7 +1588,7 @@ x = P([
|
|
|
1585
1588
|
C("nf-textarea")
|
|
1586
1589
|
], x);
|
|
1587
1590
|
export {
|
|
1588
|
-
|
|
1591
|
+
U as NfCheckboxElement,
|
|
1589
1592
|
g as NfColorPickerElement,
|
|
1590
1593
|
Y as NfEmptyElement,
|
|
1591
1594
|
A as NfInputElement,
|