next-flow-design 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/nf-checkbox/nf-checkbox.d.ts +1 -0
- package/dist/components/nf-input-number/nf-input-number.d.ts +29 -17
- package/dist/components/nf-switch/nf-switch.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +532 -477
- package/dist/react/components/nf-input-number/nf-input-number.d.ts +8 -4
- package/dist/react/components/nf-root/nf-root.d.ts +1 -1
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +581 -524
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import
|
|
3
|
-
import { css as
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { createComponent as N } from "@lit/react";
|
|
2
|
+
import T from "react";
|
|
3
|
+
import { css as C, LitElement as W, html as f } from "lit";
|
|
4
|
+
const O = (t) => (e, s) => {
|
|
5
|
+
s !== void 0 ? s.addInitializer(() => {
|
|
6
6
|
customElements.define(t, e);
|
|
7
7
|
}) : customElements.define(t, e);
|
|
8
8
|
};
|
|
9
9
|
const G = globalThis, ie = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, xe = /* @__PURE__ */ Symbol(), ue = /* @__PURE__ */ new WeakMap();
|
|
10
10
|
let Pe = class {
|
|
11
|
-
constructor(e,
|
|
12
|
-
if (this._$cssResult$ = !0,
|
|
13
|
-
this.cssText = e, this.t =
|
|
11
|
+
constructor(e, s, o) {
|
|
12
|
+
if (this._$cssResult$ = !0, o !== xe) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
13
|
+
this.cssText = e, this.t = s;
|
|
14
14
|
}
|
|
15
15
|
get styleSheet() {
|
|
16
16
|
let e = this.o;
|
|
17
|
-
const
|
|
17
|
+
const s = this.t;
|
|
18
18
|
if (ie && e === void 0) {
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const o = s !== void 0 && s.length === 1;
|
|
20
|
+
o && (e = ue.get(s)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), o && ue.set(s, e));
|
|
21
21
|
}
|
|
22
22
|
return e;
|
|
23
23
|
}
|
|
@@ -26,17 +26,17 @@ let Pe = class {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
const De = (t) => new Pe(typeof t == "string" ? t : t + "", void 0, xe), Me = (t, e) => {
|
|
29
|
-
if (ie) t.adoptedStyleSheets = e.map((
|
|
30
|
-
else for (const
|
|
31
|
-
const
|
|
32
|
-
r !== void 0 &&
|
|
29
|
+
if (ie) t.adoptedStyleSheets = e.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
|
|
30
|
+
else for (const s of e) {
|
|
31
|
+
const o = document.createElement("style"), r = G.litNonce;
|
|
32
|
+
r !== void 0 && o.setAttribute("nonce", r), o.textContent = s.cssText, t.appendChild(o);
|
|
33
33
|
}
|
|
34
34
|
}, pe = ie ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
|
|
35
|
-
let
|
|
36
|
-
for (const
|
|
37
|
-
return De(
|
|
35
|
+
let s = "";
|
|
36
|
+
for (const o of e.cssRules) s += o.cssText;
|
|
37
|
+
return De(s);
|
|
38
38
|
})(t) : t;
|
|
39
|
-
const { is:
|
|
39
|
+
const { is: Ne, defineProperty: Te, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Be, getOwnPropertySymbols: Ve, getPrototypeOf: He } = Object, te = globalThis, fe = te.trustedTypes, Ue = fe ? fe.emptyScript : "", Le = te.reactiveElementPolyfillSupport, j = (t, e) => t, J = { toAttribute(t, e) {
|
|
40
40
|
switch (e) {
|
|
41
41
|
case Boolean:
|
|
42
42
|
t = t ? Ue : null;
|
|
@@ -47,86 +47,86 @@ const { is: Oe, defineProperty: Ve, getOwnPropertyDescriptor: Ne, getOwnProperty
|
|
|
47
47
|
}
|
|
48
48
|
return t;
|
|
49
49
|
}, fromAttribute(t, e) {
|
|
50
|
-
let
|
|
50
|
+
let s = t;
|
|
51
51
|
switch (e) {
|
|
52
52
|
case Boolean:
|
|
53
|
-
|
|
53
|
+
s = t !== null;
|
|
54
54
|
break;
|
|
55
55
|
case Number:
|
|
56
|
-
|
|
56
|
+
s = t === null ? null : Number(t);
|
|
57
57
|
break;
|
|
58
58
|
case Object:
|
|
59
59
|
case Array:
|
|
60
60
|
try {
|
|
61
|
-
|
|
61
|
+
s = JSON.parse(t);
|
|
62
62
|
} catch {
|
|
63
|
-
|
|
63
|
+
s = null;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
return
|
|
67
|
-
} }, ne = (t, e) => !
|
|
66
|
+
return s;
|
|
67
|
+
} }, ne = (t, e) => !Ne(t, e), be = { attribute: !0, type: String, converter: J, reflect: !1, useDefault: !1, hasChanged: ne };
|
|
68
68
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), te.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
69
|
-
let
|
|
69
|
+
let V = class extends HTMLElement {
|
|
70
70
|
static addInitializer(e) {
|
|
71
71
|
this._$Ei(), (this.l ??= []).push(e);
|
|
72
72
|
}
|
|
73
73
|
static get observedAttributes() {
|
|
74
74
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
75
75
|
}
|
|
76
|
-
static createProperty(e,
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
r !== void 0 &&
|
|
76
|
+
static createProperty(e, s = be) {
|
|
77
|
+
if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(e, s), !s.noAccessor) {
|
|
78
|
+
const o = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(e, o, s);
|
|
79
|
+
r !== void 0 && Te(this.prototype, e, r);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
static getPropertyDescriptor(e,
|
|
83
|
-
const { get: r, set: i } =
|
|
84
|
-
return this[
|
|
82
|
+
static getPropertyDescriptor(e, s, o) {
|
|
83
|
+
const { get: r, set: i } = Oe(this.prototype, e) ?? { get() {
|
|
84
|
+
return this[s];
|
|
85
85
|
}, set(n) {
|
|
86
|
-
this[
|
|
86
|
+
this[s] = n;
|
|
87
87
|
} };
|
|
88
88
|
return { get: r, set(n) {
|
|
89
89
|
const l = r?.call(this);
|
|
90
|
-
i?.call(this, n), this.requestUpdate(e, l,
|
|
90
|
+
i?.call(this, n), this.requestUpdate(e, l, o);
|
|
91
91
|
}, configurable: !0, enumerable: !0 };
|
|
92
92
|
}
|
|
93
93
|
static getPropertyOptions(e) {
|
|
94
94
|
return this.elementProperties.get(e) ?? be;
|
|
95
95
|
}
|
|
96
96
|
static _$Ei() {
|
|
97
|
-
if (this.hasOwnProperty(
|
|
97
|
+
if (this.hasOwnProperty(j("elementProperties"))) return;
|
|
98
98
|
const e = He(this);
|
|
99
99
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
100
100
|
}
|
|
101
101
|
static finalize() {
|
|
102
|
-
if (this.hasOwnProperty(
|
|
103
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
104
|
-
const
|
|
105
|
-
for (const r of
|
|
102
|
+
if (this.hasOwnProperty(j("finalized"))) return;
|
|
103
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
|
|
104
|
+
const s = this.properties, o = [...Be(s), ...Ve(s)];
|
|
105
|
+
for (const r of o) this.createProperty(r, s[r]);
|
|
106
106
|
}
|
|
107
107
|
const e = this[Symbol.metadata];
|
|
108
108
|
if (e !== null) {
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
109
|
+
const s = litPropertyMetadata.get(e);
|
|
110
|
+
if (s !== void 0) for (const [o, r] of s) this.elementProperties.set(o, r);
|
|
111
111
|
}
|
|
112
112
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
113
|
-
for (const [
|
|
114
|
-
const r = this._$Eu(
|
|
115
|
-
r !== void 0 && this._$Eh.set(r,
|
|
113
|
+
for (const [s, o] of this.elementProperties) {
|
|
114
|
+
const r = this._$Eu(s, o);
|
|
115
|
+
r !== void 0 && this._$Eh.set(r, s);
|
|
116
116
|
}
|
|
117
117
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
118
118
|
}
|
|
119
119
|
static finalizeStyles(e) {
|
|
120
|
-
const
|
|
120
|
+
const s = [];
|
|
121
121
|
if (Array.isArray(e)) {
|
|
122
|
-
const
|
|
123
|
-
for (const r of
|
|
124
|
-
} else e !== void 0 &&
|
|
125
|
-
return
|
|
122
|
+
const o = new Set(e.flat(1 / 0).reverse());
|
|
123
|
+
for (const r of o) s.unshift(pe(r));
|
|
124
|
+
} else e !== void 0 && s.push(pe(e));
|
|
125
|
+
return s;
|
|
126
126
|
}
|
|
127
|
-
static _$Eu(e,
|
|
128
|
-
const
|
|
129
|
-
return
|
|
127
|
+
static _$Eu(e, s) {
|
|
128
|
+
const o = s.attribute;
|
|
129
|
+
return o === !1 ? void 0 : typeof o == "string" ? o : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
130
130
|
}
|
|
131
131
|
constructor() {
|
|
132
132
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -141,8 +141,8 @@ let T = class extends HTMLElement {
|
|
|
141
141
|
this._$EO?.delete(e);
|
|
142
142
|
}
|
|
143
143
|
_$E_() {
|
|
144
|
-
const e = /* @__PURE__ */ new Map(),
|
|
145
|
-
for (const
|
|
144
|
+
const e = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
|
|
145
|
+
for (const o of s.keys()) this.hasOwnProperty(o) && (e.set(o, this[o]), delete this[o]);
|
|
146
146
|
e.size > 0 && (this._$Ep = e);
|
|
147
147
|
}
|
|
148
148
|
createRenderRoot() {
|
|
@@ -157,42 +157,42 @@ let T = class extends HTMLElement {
|
|
|
157
157
|
disconnectedCallback() {
|
|
158
158
|
this._$EO?.forEach((e) => e.hostDisconnected?.());
|
|
159
159
|
}
|
|
160
|
-
attributeChangedCallback(e,
|
|
161
|
-
this._$AK(e,
|
|
160
|
+
attributeChangedCallback(e, s, o) {
|
|
161
|
+
this._$AK(e, o);
|
|
162
162
|
}
|
|
163
|
-
_$ET(e,
|
|
164
|
-
const
|
|
165
|
-
if (r !== void 0 &&
|
|
166
|
-
const i = (
|
|
163
|
+
_$ET(e, s) {
|
|
164
|
+
const o = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, o);
|
|
165
|
+
if (r !== void 0 && o.reflect === !0) {
|
|
166
|
+
const i = (o.converter?.toAttribute !== void 0 ? o.converter : J).toAttribute(s, o.type);
|
|
167
167
|
this._$Em = e, i == null ? this.removeAttribute(r) : this.setAttribute(r, i), this._$Em = null;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
_$AK(e,
|
|
171
|
-
const
|
|
170
|
+
_$AK(e, s) {
|
|
171
|
+
const o = this.constructor, r = o._$Eh.get(e);
|
|
172
172
|
if (r !== void 0 && this._$Em !== r) {
|
|
173
|
-
const i =
|
|
173
|
+
const i = o.getPropertyOptions(r), n = typeof i.converter == "function" ? { fromAttribute: i.converter } : i.converter?.fromAttribute !== void 0 ? i.converter : J;
|
|
174
174
|
this._$Em = r;
|
|
175
|
-
const l = n.fromAttribute(
|
|
175
|
+
const l = n.fromAttribute(s, i.type);
|
|
176
176
|
this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
requestUpdate(e,
|
|
179
|
+
requestUpdate(e, s, o, r = !1, i) {
|
|
180
180
|
if (e !== void 0) {
|
|
181
181
|
const n = this.constructor;
|
|
182
|
-
if (r === !1 && (i = this[e]),
|
|
183
|
-
this.C(e,
|
|
182
|
+
if (r === !1 && (i = this[e]), o ??= n.getPropertyOptions(e), !((o.hasChanged ?? ne)(i, s) || o.useDefault && o.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, o)))) return;
|
|
183
|
+
this.C(e, s, o);
|
|
184
184
|
}
|
|
185
185
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
186
186
|
}
|
|
187
|
-
C(e,
|
|
188
|
-
|
|
187
|
+
C(e, s, { useDefault: o, reflect: r, wrapped: i }, n) {
|
|
188
|
+
o && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? s ?? this[e]), i !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || o || (s = void 0), this._$AL.set(e, s)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
189
189
|
}
|
|
190
190
|
async _$EP() {
|
|
191
191
|
this.isUpdatePending = !0;
|
|
192
192
|
try {
|
|
193
193
|
await this._$ES;
|
|
194
|
-
} catch (
|
|
195
|
-
Promise.reject(
|
|
194
|
+
} catch (s) {
|
|
195
|
+
Promise.reject(s);
|
|
196
196
|
}
|
|
197
197
|
const e = this.scheduleUpdate();
|
|
198
198
|
return e != null && await e, !this.isUpdatePending;
|
|
@@ -207,25 +207,25 @@ let T = class extends HTMLElement {
|
|
|
207
207
|
for (const [r, i] of this._$Ep) this[r] = i;
|
|
208
208
|
this._$Ep = void 0;
|
|
209
209
|
}
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
210
|
+
const o = this.constructor.elementProperties;
|
|
211
|
+
if (o.size > 0) for (const [r, i] of o) {
|
|
212
212
|
const { wrapped: n } = i, l = this[r];
|
|
213
213
|
n !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, i, l);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
let e = !1;
|
|
217
|
-
const
|
|
217
|
+
const s = this._$AL;
|
|
218
218
|
try {
|
|
219
|
-
e = this.shouldUpdate(
|
|
220
|
-
} catch (
|
|
221
|
-
throw e = !1, this._$EM(),
|
|
219
|
+
e = this.shouldUpdate(s), e ? (this.willUpdate(s), this._$EO?.forEach((o) => o.hostUpdate?.()), this.update(s)) : this._$EM();
|
|
220
|
+
} catch (o) {
|
|
221
|
+
throw e = !1, this._$EM(), o;
|
|
222
222
|
}
|
|
223
|
-
e && this._$AE(
|
|
223
|
+
e && this._$AE(s);
|
|
224
224
|
}
|
|
225
225
|
willUpdate(e) {
|
|
226
226
|
}
|
|
227
227
|
_$AE(e) {
|
|
228
|
-
this._$EO?.forEach((
|
|
228
|
+
this._$EO?.forEach((s) => s.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
229
229
|
}
|
|
230
230
|
_$EM() {
|
|
231
231
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -240,19 +240,19 @@ let T = class extends HTMLElement {
|
|
|
240
240
|
return !0;
|
|
241
241
|
}
|
|
242
242
|
update(e) {
|
|
243
|
-
this._$Eq &&= this._$Eq.forEach((
|
|
243
|
+
this._$Eq &&= this._$Eq.forEach((s) => this._$ET(s, this[s])), this._$EM();
|
|
244
244
|
}
|
|
245
245
|
updated(e) {
|
|
246
246
|
}
|
|
247
247
|
firstUpdated(e) {
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
const { kind:
|
|
250
|
+
V.elementStyles = [], V.shadowRootOptions = { mode: "open" }, V[j("elementProperties")] = /* @__PURE__ */ new Map(), V[j("finalized")] = /* @__PURE__ */ new Map(), Le?.({ ReactiveElement: V }), (te.reactiveElementVersions ??= []).push("2.1.2");
|
|
251
|
+
const Fe = { attribute: !0, type: String, converter: J, reflect: !1, hasChanged: ne }, Ie = (t = Fe, e, s) => {
|
|
252
|
+
const { kind: o, metadata: r } = s;
|
|
253
253
|
let i = globalThis.litPropertyMetadata.get(r);
|
|
254
|
-
if (i === void 0 && globalThis.litPropertyMetadata.set(r, i = /* @__PURE__ */ new Map()),
|
|
255
|
-
const { name: n } =
|
|
254
|
+
if (i === void 0 && globalThis.litPropertyMetadata.set(r, i = /* @__PURE__ */ new Map()), o === "setter" && ((t = Object.create(t)).wrapped = !0), i.set(s.name, t), o === "accessor") {
|
|
255
|
+
const { name: n } = s;
|
|
256
256
|
return { set(l) {
|
|
257
257
|
const a = e.get.call(this);
|
|
258
258
|
e.set.call(this, l), this.requestUpdate(n, a, t, !0, l);
|
|
@@ -260,31 +260,31 @@ const Le = { attribute: !0, type: String, converter: J, reflect: !1, hasChanged:
|
|
|
260
260
|
return l !== void 0 && this.C(n, void 0, t, l), l;
|
|
261
261
|
} };
|
|
262
262
|
}
|
|
263
|
-
if (
|
|
264
|
-
const { name: n } =
|
|
263
|
+
if (o === "setter") {
|
|
264
|
+
const { name: n } = s;
|
|
265
265
|
return function(l) {
|
|
266
266
|
const a = this[n];
|
|
267
267
|
e.call(this, l), this.requestUpdate(n, a, t, !0, l);
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
throw Error("Unsupported decorator location: " +
|
|
270
|
+
throw Error("Unsupported decorator location: " + o);
|
|
271
271
|
};
|
|
272
272
|
function h(t) {
|
|
273
|
-
return (e,
|
|
273
|
+
return (e, s) => typeof s == "object" ? Ie(t, e, s) : ((o, r, i) => {
|
|
274
274
|
const n = r.hasOwnProperty(i);
|
|
275
|
-
return r.constructor.createProperty(i,
|
|
276
|
-
})(t, e,
|
|
275
|
+
return r.constructor.createProperty(i, o), n ? Object.getOwnPropertyDescriptor(r, i) : void 0;
|
|
276
|
+
})(t, e, s);
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function w(t) {
|
|
279
279
|
return h({ ...t, state: !0, attribute: !1 });
|
|
280
280
|
}
|
|
281
|
-
const K =
|
|
282
|
-
var
|
|
283
|
-
for (var r =
|
|
284
|
-
(n = t[i]) && (r = (
|
|
285
|
-
return
|
|
281
|
+
const K = C`: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)}`, je = C`:host{width:var(--nf-width);position:relative;display:inline-block}: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}`;
|
|
282
|
+
var ze = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, B = (t, e, s, o) => {
|
|
283
|
+
for (var r = o > 1 ? void 0 : o ? Re(e, s) : e, i = t.length - 1, n; i >= 0; i--)
|
|
284
|
+
(n = t[i]) && (r = (o ? n(e, s, r) : n(r)) || r);
|
|
285
|
+
return o && r && ze(e, s, r), r;
|
|
286
286
|
};
|
|
287
|
-
let
|
|
287
|
+
let $ = class extends W {
|
|
288
288
|
constructor() {
|
|
289
289
|
super(...arguments), this.value = "", this.placeholder = "", this.type = "text", this.disabled = !1, this.showPassword = !1, this.onInput = (t) => {
|
|
290
290
|
t.stopPropagation();
|
|
@@ -330,13 +330,13 @@ let y = class extends q {
|
|
|
330
330
|
}
|
|
331
331
|
render() {
|
|
332
332
|
const t = this.type === "password" && !this.showPassword ? "password" : "text", e = this.type === "password";
|
|
333
|
-
return
|
|
333
|
+
return f`<slot></slot><input class=input type=${t} .value=${this.value} placeholder=${this.placeholder} maxlength=${this.maxLength ?? ""} ?disabled=${this.disabled} @input=${this.onInput} @change=${this.onChange} @keydown=${this.onKeyDown}> ${e ? f`<button class=toggle-password type=button tabindex=-1 @click=${this.togglePasswordVisibility} aria-label=${this.showPassword ? "Hide password" : "Show password"}>${this.showPassword ? this.renderEyeOffIcon() : this.renderEyeIcon()}</button>` : ""}`;
|
|
334
334
|
}
|
|
335
335
|
renderEyeIcon() {
|
|
336
|
-
return
|
|
336
|
+
return f`<svg width=16 height=16 viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx=12 cy=12 r=3 /></svg>`;
|
|
337
337
|
}
|
|
338
338
|
renderEyeOffIcon() {
|
|
339
|
-
return
|
|
339
|
+
return f`<svg width=16 height=16 viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1=1 y1=1 x2=23 y2=23 /></svg>`;
|
|
340
340
|
}
|
|
341
341
|
connectedCallback() {
|
|
342
342
|
this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
|
|
@@ -344,48 +344,48 @@ let y = class extends q {
|
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
};
|
|
347
|
-
|
|
347
|
+
$.styles = [K, je];
|
|
348
348
|
B([
|
|
349
349
|
h({ type: String })
|
|
350
|
-
],
|
|
350
|
+
], $.prototype, "value", 2);
|
|
351
351
|
B([
|
|
352
352
|
h({ type: String })
|
|
353
|
-
],
|
|
353
|
+
], $.prototype, "placeholder", 2);
|
|
354
354
|
B([
|
|
355
355
|
h({ type: String })
|
|
356
|
-
],
|
|
356
|
+
], $.prototype, "type", 2);
|
|
357
357
|
B([
|
|
358
358
|
h({ type: Number })
|
|
359
|
-
],
|
|
359
|
+
], $.prototype, "maxLength", 2);
|
|
360
360
|
B([
|
|
361
361
|
h({ type: Boolean, reflect: !0 })
|
|
362
|
-
],
|
|
362
|
+
], $.prototype, "disabled", 2);
|
|
363
363
|
B([
|
|
364
|
-
|
|
365
|
-
],
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
],
|
|
369
|
-
const
|
|
364
|
+
w()
|
|
365
|
+
], $.prototype, "showPassword", 2);
|
|
366
|
+
$ = B([
|
|
367
|
+
O("nf-input")
|
|
368
|
+
], $);
|
|
369
|
+
const Nt = N({
|
|
370
370
|
tagName: "nf-input",
|
|
371
|
-
elementClass:
|
|
372
|
-
react:
|
|
371
|
+
elementClass: $,
|
|
372
|
+
react: T,
|
|
373
373
|
events: {
|
|
374
374
|
onInput: "input",
|
|
375
375
|
onChange: "change",
|
|
376
376
|
onPressEnter: "pressEnter"
|
|
377
377
|
}
|
|
378
378
|
});
|
|
379
|
-
async function
|
|
379
|
+
async function qe(t) {
|
|
380
380
|
return new Promise((e) => setTimeout(e, t));
|
|
381
381
|
}
|
|
382
|
-
const
|
|
383
|
-
var Ke = Object.defineProperty,
|
|
384
|
-
for (var r =
|
|
385
|
-
(n = t[i]) && (r = (
|
|
386
|
-
return
|
|
382
|
+
const We = C`: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}`;
|
|
383
|
+
var Ke = Object.defineProperty, Ze = Object.getOwnPropertyDescriptor, Z = (t, e, s, o) => {
|
|
384
|
+
for (var r = o > 1 ? void 0 : o ? Ze(e, s) : e, i = t.length - 1, n; i >= 0; i--)
|
|
385
|
+
(n = t[i]) && (r = (o ? n(e, s, r) : n(r)) || r);
|
|
386
|
+
return o && r && Ke(e, s, r), r;
|
|
387
387
|
};
|
|
388
|
-
let
|
|
388
|
+
let E = class extends W {
|
|
389
389
|
constructor() {
|
|
390
390
|
super(...arguments), this.value = "", this.options = [], this.disabled = !1, this.showDropdown = !1, this.jumpCloseFlag = !1, this.timeoutId = null, this.onFocus = () => {
|
|
391
391
|
this.disabled || (this.timeoutId && clearTimeout(this.timeoutId), this.showDropdown = !0, this.jumpCloseFlag = !0);
|
|
@@ -404,13 +404,13 @@ let C = class extends q {
|
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
406
|
async set(t) {
|
|
407
|
-
this.dispatchEvent(new CustomEvent("input", { detail: t, bubbles: !0, composed: !0 })), this.value !== t && this.dispatchEvent(new CustomEvent("change", { detail: t, bubbles: !0, composed: !0 })), await
|
|
407
|
+
this.dispatchEvent(new CustomEvent("input", { detail: t, bubbles: !0, composed: !0 })), this.value !== t && this.dispatchEvent(new CustomEvent("change", { detail: t, bubbles: !0, composed: !0 })), await qe(34), this.blur();
|
|
408
408
|
}
|
|
409
409
|
render() {
|
|
410
|
-
const t = this.options.findIndex((
|
|
411
|
-
return
|
|
412
|
-
(
|
|
413
|
-
)}</div><slot></slot><div class=text>${e}</div><svg class=icon height=24 viewBox="0 0 24 24"
|
|
410
|
+
const t = this.options.findIndex((s) => s.value == this.value), e = t > -1 ? this.options[t]?.label : this.value;
|
|
411
|
+
return f`<div class=dropdown>${(this.showDropdown ? this.options : []).map(
|
|
412
|
+
(s) => f`<div @click=${() => this.set(s.value)} class="item ${this.value == s.value ? "item-selected" : "item-unselected"}">${s.label}</div>`
|
|
413
|
+
)}</div><slot></slot><div class=text>${e}</div><svg class=icon width=24 height=24 viewBox="0 0 24 24"><path d="M17 10l-5 5.5-5-5.5"/></svg>`;
|
|
414
414
|
}
|
|
415
415
|
connectedCallback() {
|
|
416
416
|
this.style.transition = "none", super.connectedCallback(), this.disabled || (this.tabIndex = 0), this.addEventListener("focus", this.onFocus), this.addEventListener("blur", this.onBlur), this.addEventListener("click", this.onClick), requestAnimationFrame(() => {
|
|
@@ -421,11 +421,11 @@ let C = class extends q {
|
|
|
421
421
|
super.disconnectedCallback(), this.removeEventListener("focus", this.onFocus), this.removeEventListener("blur", this.onBlur), this.removeEventListener("click", this.onClick);
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
E.styles = [K, We];
|
|
425
|
+
Z([
|
|
426
426
|
h({ type: String })
|
|
427
|
-
],
|
|
428
|
-
|
|
427
|
+
], E.prototype, "value", 2);
|
|
428
|
+
Z([
|
|
429
429
|
h({
|
|
430
430
|
type: Array,
|
|
431
431
|
converter: (t) => {
|
|
@@ -440,90 +440,90 @@ Y([
|
|
|
440
440
|
return [];
|
|
441
441
|
}
|
|
442
442
|
})
|
|
443
|
-
],
|
|
444
|
-
|
|
443
|
+
], E.prototype, "options", 2);
|
|
444
|
+
Z([
|
|
445
445
|
h({ type: Boolean, reflect: !0 })
|
|
446
|
-
],
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
],
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
],
|
|
453
|
-
const
|
|
446
|
+
], E.prototype, "disabled", 2);
|
|
447
|
+
Z([
|
|
448
|
+
w()
|
|
449
|
+
], E.prototype, "showDropdown", 2);
|
|
450
|
+
E = Z([
|
|
451
|
+
O("nf-select")
|
|
452
|
+
], E);
|
|
453
|
+
const Tt = N({
|
|
454
454
|
tagName: "nf-select",
|
|
455
|
-
elementClass:
|
|
456
|
-
react:
|
|
455
|
+
elementClass: E,
|
|
456
|
+
react: T,
|
|
457
457
|
events: {
|
|
458
458
|
onInput: "input",
|
|
459
459
|
onChange: "change"
|
|
460
460
|
}
|
|
461
461
|
});
|
|
462
|
-
const ae = globalThis, me = (t) => t, Q = ae.trustedTypes, ge = Q ? Q.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, ke = "$lit$",
|
|
463
|
-
\f\r]`,
|
|
464
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
465
|
-
function
|
|
462
|
+
const ae = globalThis, me = (t) => t, Q = ae.trustedTypes, ge = Q ? Q.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, ke = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, Ae = "?" + A, Ye = `<${Ae}>`, D = document, z = () => D.createComment(""), R = (t) => t === null || typeof t != "object" && typeof t != "function", le = Array.isArray, Xe = (t) => le(t) || typeof t?.[Symbol.iterator] == "function", oe = `[
|
|
463
|
+
\f\r]`, I = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ve = /-->/g, _e = />/g, S = RegExp(`>|${oe}(?:([^\\s"'>=/]+)(${oe}*=${oe}*(?:[^
|
|
464
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ye = /'/g, we = /"/g, Ee = /^(?:script|style|textarea|title)$/i, Ge = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), re = Ge(1), M = /* @__PURE__ */ Symbol.for("lit-noChange"), b = /* @__PURE__ */ Symbol.for("lit-nothing"), $e = /* @__PURE__ */ new WeakMap(), P = D.createTreeWalker(D, 129);
|
|
465
|
+
function Ce(t, e) {
|
|
466
466
|
if (!le(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
467
467
|
return ge !== void 0 ? ge.createHTML(e) : e;
|
|
468
468
|
}
|
|
469
469
|
const Je = (t, e) => {
|
|
470
|
-
const
|
|
471
|
-
let r, i = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n =
|
|
472
|
-
for (let l = 0; l <
|
|
470
|
+
const s = t.length - 1, o = [];
|
|
471
|
+
let r, i = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = I;
|
|
472
|
+
for (let l = 0; l < s; l++) {
|
|
473
473
|
const a = t[l];
|
|
474
474
|
let c, u, d = -1, x = 0;
|
|
475
|
-
for (; x < a.length && (n.lastIndex = x, u = n.exec(a), u !== null); ) x = n.lastIndex, n ===
|
|
475
|
+
for (; x < a.length && (n.lastIndex = x, u = n.exec(a), u !== null); ) x = n.lastIndex, n === I ? u[1] === "!--" ? n = ve : u[1] !== void 0 ? n = _e : u[2] !== void 0 ? (Ee.test(u[2]) && (r = RegExp("</" + u[2], "g")), n = S) : u[3] !== void 0 && (n = S) : n === S ? u[0] === ">" ? (n = r ?? I, d = -1) : u[1] === void 0 ? d = -2 : (d = n.lastIndex - u[2].length, c = u[1], n = u[3] === void 0 ? S : u[3] === '"' ? we : ye) : n === we || n === ye ? n = S : n === ve || n === _e ? n = I : (n = S, r = void 0);
|
|
476
476
|
const k = n === S && t[l + 1].startsWith("/>") ? " " : "";
|
|
477
|
-
i += n ===
|
|
477
|
+
i += n === I ? a + Ye : d >= 0 ? (o.push(c), a.slice(0, d) + ke + a.slice(d) + A + k) : a + A + (d === -2 ? l : k);
|
|
478
478
|
}
|
|
479
|
-
return [
|
|
479
|
+
return [Ce(t, i + (t[s] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), o];
|
|
480
480
|
};
|
|
481
|
-
class
|
|
482
|
-
constructor({ strings: e, _$litType$:
|
|
481
|
+
class q {
|
|
482
|
+
constructor({ strings: e, _$litType$: s }, o) {
|
|
483
483
|
let r;
|
|
484
484
|
this.parts = [];
|
|
485
485
|
let i = 0, n = 0;
|
|
486
|
-
const l = e.length - 1, a = this.parts, [c, u] = Je(e,
|
|
487
|
-
if (this.el =
|
|
486
|
+
const l = e.length - 1, a = this.parts, [c, u] = Je(e, s);
|
|
487
|
+
if (this.el = q.createElement(c, o), P.currentNode = this.el.content, s === 2 || s === 3) {
|
|
488
488
|
const d = this.el.content.firstChild;
|
|
489
489
|
d.replaceWith(...d.childNodes);
|
|
490
490
|
}
|
|
491
491
|
for (; (r = P.nextNode()) !== null && a.length < l; ) {
|
|
492
492
|
if (r.nodeType === 1) {
|
|
493
493
|
if (r.hasAttributes()) for (const d of r.getAttributeNames()) if (d.endsWith(ke)) {
|
|
494
|
-
const x = u[n++], k = r.getAttribute(d).split(
|
|
495
|
-
a.push({ type: 1, index: i, name:
|
|
496
|
-
} else d.startsWith(
|
|
497
|
-
if (
|
|
498
|
-
const d = r.textContent.split(
|
|
494
|
+
const x = u[n++], k = r.getAttribute(d).split(A), X = /([.?@])?(.*)/.exec(x);
|
|
495
|
+
a.push({ type: 1, index: i, name: X[2], strings: k, ctor: X[1] === "." ? et : X[1] === "?" ? tt : X[1] === "@" ? st : se }), r.removeAttribute(d);
|
|
496
|
+
} else d.startsWith(A) && (a.push({ type: 6, index: i }), r.removeAttribute(d));
|
|
497
|
+
if (Ee.test(r.tagName)) {
|
|
498
|
+
const d = r.textContent.split(A), x = d.length - 1;
|
|
499
499
|
if (x > 0) {
|
|
500
500
|
r.textContent = Q ? Q.emptyScript : "";
|
|
501
|
-
for (let k = 0; k < x; k++) r.append(d[k],
|
|
502
|
-
r.append(d[x],
|
|
501
|
+
for (let k = 0; k < x; k++) r.append(d[k], z()), P.nextNode(), a.push({ type: 2, index: ++i });
|
|
502
|
+
r.append(d[x], z());
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
505
|
+
} else if (r.nodeType === 8) if (r.data === Ae) a.push({ type: 2, index: i });
|
|
506
506
|
else {
|
|
507
507
|
let d = -1;
|
|
508
|
-
for (; (d = r.data.indexOf(
|
|
508
|
+
for (; (d = r.data.indexOf(A, d + 1)) !== -1; ) a.push({ type: 7, index: i }), d += A.length - 1;
|
|
509
509
|
}
|
|
510
510
|
i++;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
static createElement(e,
|
|
514
|
-
const
|
|
515
|
-
return
|
|
513
|
+
static createElement(e, s) {
|
|
514
|
+
const o = D.createElement("template");
|
|
515
|
+
return o.innerHTML = e, o;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function U(t, e,
|
|
518
|
+
function U(t, e, s = t, o) {
|
|
519
519
|
if (e === M) return e;
|
|
520
|
-
let r =
|
|
520
|
+
let r = o !== void 0 ? s._$Co?.[o] : s._$Cl;
|
|
521
521
|
const i = R(e) ? void 0 : e._$litDirective$;
|
|
522
|
-
return r?.constructor !== i && (r?._$AO?.(!1), i === void 0 ? r = void 0 : (r = new i(t), r._$AT(t,
|
|
522
|
+
return r?.constructor !== i && (r?._$AO?.(!1), i === void 0 ? r = void 0 : (r = new i(t), r._$AT(t, s, o)), o !== void 0 ? (s._$Co ??= [])[o] = r : s._$Cl = r), r !== void 0 && (e = U(t, r._$AS(t, e.values), r, o)), e;
|
|
523
523
|
}
|
|
524
524
|
class Qe {
|
|
525
|
-
constructor(e,
|
|
526
|
-
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM =
|
|
525
|
+
constructor(e, s) {
|
|
526
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = s;
|
|
527
527
|
}
|
|
528
528
|
get parentNode() {
|
|
529
529
|
return this._$AM.parentNode;
|
|
@@ -532,34 +532,34 @@ class Qe {
|
|
|
532
532
|
return this._$AM._$AU;
|
|
533
533
|
}
|
|
534
534
|
u(e) {
|
|
535
|
-
const { el: { content:
|
|
535
|
+
const { el: { content: s }, parts: o } = this._$AD, r = (e?.creationScope ?? D).importNode(s, !0);
|
|
536
536
|
P.currentNode = r;
|
|
537
|
-
let i = P.nextNode(), n = 0, l = 0, a =
|
|
537
|
+
let i = P.nextNode(), n = 0, l = 0, a = o[0];
|
|
538
538
|
for (; a !== void 0; ) {
|
|
539
539
|
if (n === a.index) {
|
|
540
540
|
let c;
|
|
541
|
-
a.type === 2 ? c = new
|
|
541
|
+
a.type === 2 ? c = new Y(i, i.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(i, a.name, a.strings, this, e) : a.type === 6 && (c = new ot(i, this, e)), this._$AV.push(c), a = o[++l];
|
|
542
542
|
}
|
|
543
543
|
n !== a?.index && (i = P.nextNode(), n++);
|
|
544
544
|
}
|
|
545
545
|
return P.currentNode = D, r;
|
|
546
546
|
}
|
|
547
547
|
p(e) {
|
|
548
|
-
let
|
|
549
|
-
for (const
|
|
548
|
+
let s = 0;
|
|
549
|
+
for (const o of this._$AV) o !== void 0 && (o.strings !== void 0 ? (o._$AI(e, o, s), s += o.strings.length - 2) : o._$AI(e[s])), s++;
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
class
|
|
552
|
+
class Y {
|
|
553
553
|
get _$AU() {
|
|
554
554
|
return this._$AM?._$AU ?? this._$Cv;
|
|
555
555
|
}
|
|
556
|
-
constructor(e,
|
|
557
|
-
this.type = 2, this._$AH =
|
|
556
|
+
constructor(e, s, o, r) {
|
|
557
|
+
this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = s, this._$AM = o, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
558
558
|
}
|
|
559
559
|
get parentNode() {
|
|
560
560
|
let e = this._$AA.parentNode;
|
|
561
|
-
const
|
|
562
|
-
return
|
|
561
|
+
const s = this._$AM;
|
|
562
|
+
return s !== void 0 && e?.nodeType === 11 && (e = s.parentNode), e;
|
|
563
563
|
}
|
|
564
564
|
get startNode() {
|
|
565
565
|
return this._$AA;
|
|
@@ -567,8 +567,8 @@ class X {
|
|
|
567
567
|
get endNode() {
|
|
568
568
|
return this._$AB;
|
|
569
569
|
}
|
|
570
|
-
_$AI(e,
|
|
571
|
-
e = U(this, e,
|
|
570
|
+
_$AI(e, s = this) {
|
|
571
|
+
e = U(this, e, s), R(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== M && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Xe(e) ? this.k(e) : this._(e);
|
|
572
572
|
}
|
|
573
573
|
O(e) {
|
|
574
574
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -577,94 +577,94 @@ class X {
|
|
|
577
577
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
578
578
|
}
|
|
579
579
|
_(e) {
|
|
580
|
-
this._$AH !==
|
|
580
|
+
this._$AH !== b && R(this._$AH) ? this._$AA.nextSibling.data = e : this.T(D.createTextNode(e)), this._$AH = e;
|
|
581
581
|
}
|
|
582
582
|
$(e) {
|
|
583
|
-
const { values:
|
|
584
|
-
if (this._$AH?._$AD === r) this._$AH.p(
|
|
583
|
+
const { values: s, _$litType$: o } = e, r = typeof o == "number" ? this._$AC(e) : (o.el === void 0 && (o.el = q.createElement(Ce(o.h, o.h[0]), this.options)), o);
|
|
584
|
+
if (this._$AH?._$AD === r) this._$AH.p(s);
|
|
585
585
|
else {
|
|
586
586
|
const i = new Qe(r, this), n = i.u(this.options);
|
|
587
|
-
i.p(
|
|
587
|
+
i.p(s), this.T(n), this._$AH = i;
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
_$AC(e) {
|
|
591
|
-
let
|
|
592
|
-
return
|
|
591
|
+
let s = $e.get(e.strings);
|
|
592
|
+
return s === void 0 && $e.set(e.strings, s = new q(e)), s;
|
|
593
593
|
}
|
|
594
594
|
k(e) {
|
|
595
595
|
le(this._$AH) || (this._$AH = [], this._$AR());
|
|
596
|
-
const
|
|
597
|
-
let
|
|
598
|
-
for (const i of e) r ===
|
|
599
|
-
r <
|
|
600
|
-
}
|
|
601
|
-
_$AR(e = this._$AA.nextSibling,
|
|
602
|
-
for (this._$AP?.(!1, !0,
|
|
603
|
-
const
|
|
604
|
-
me(e).remove(), e =
|
|
596
|
+
const s = this._$AH;
|
|
597
|
+
let o, r = 0;
|
|
598
|
+
for (const i of e) r === s.length ? s.push(o = new Y(this.O(z()), this.O(z()), this, this.options)) : o = s[r], o._$AI(i), r++;
|
|
599
|
+
r < s.length && (this._$AR(o && o._$AB.nextSibling, r), s.length = r);
|
|
600
|
+
}
|
|
601
|
+
_$AR(e = this._$AA.nextSibling, s) {
|
|
602
|
+
for (this._$AP?.(!1, !0, s); e !== this._$AB; ) {
|
|
603
|
+
const o = me(e).nextSibling;
|
|
604
|
+
me(e).remove(), e = o;
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
setConnected(e) {
|
|
608
608
|
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
class
|
|
611
|
+
class se {
|
|
612
612
|
get tagName() {
|
|
613
613
|
return this.element.tagName;
|
|
614
614
|
}
|
|
615
615
|
get _$AU() {
|
|
616
616
|
return this._$AM._$AU;
|
|
617
617
|
}
|
|
618
|
-
constructor(e,
|
|
619
|
-
this.type = 1, this._$AH =
|
|
618
|
+
constructor(e, s, o, r, i) {
|
|
619
|
+
this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = s, this._$AM = r, this.options = i, o.length > 2 || o[0] !== "" || o[1] !== "" ? (this._$AH = Array(o.length - 1).fill(new String()), this.strings = o) : this._$AH = b;
|
|
620
620
|
}
|
|
621
|
-
_$AI(e,
|
|
621
|
+
_$AI(e, s = this, o, r) {
|
|
622
622
|
const i = this.strings;
|
|
623
623
|
let n = !1;
|
|
624
|
-
if (i === void 0) e = U(this, e,
|
|
624
|
+
if (i === void 0) e = U(this, e, s, 0), n = !R(e) || e !== this._$AH && e !== M, n && (this._$AH = e);
|
|
625
625
|
else {
|
|
626
626
|
const l = e;
|
|
627
627
|
let a, c;
|
|
628
|
-
for (e = i[0], a = 0; a < i.length - 1; a++) c = U(this, l[
|
|
628
|
+
for (e = i[0], a = 0; a < i.length - 1; a++) c = U(this, l[o + a], s, a), c === M && (c = this._$AH[a]), n ||= !R(c) || c !== this._$AH[a], c === b ? e = b : e !== b && (e += (c ?? "") + i[a + 1]), this._$AH[a] = c;
|
|
629
629
|
}
|
|
630
630
|
n && !r && this.j(e);
|
|
631
631
|
}
|
|
632
632
|
j(e) {
|
|
633
|
-
e ===
|
|
633
|
+
e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
class et extends
|
|
636
|
+
class et extends se {
|
|
637
637
|
constructor() {
|
|
638
638
|
super(...arguments), this.type = 3;
|
|
639
639
|
}
|
|
640
640
|
j(e) {
|
|
641
|
-
this.element[this.name] = e ===
|
|
641
|
+
this.element[this.name] = e === b ? void 0 : e;
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
class tt extends
|
|
644
|
+
class tt extends se {
|
|
645
645
|
constructor() {
|
|
646
646
|
super(...arguments), this.type = 4;
|
|
647
647
|
}
|
|
648
648
|
j(e) {
|
|
649
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
649
|
+
this.element.toggleAttribute(this.name, !!e && e !== b);
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
class
|
|
653
|
-
constructor(e,
|
|
654
|
-
super(e,
|
|
652
|
+
class st extends se {
|
|
653
|
+
constructor(e, s, o, r, i) {
|
|
654
|
+
super(e, s, o, r, i), this.type = 5;
|
|
655
655
|
}
|
|
656
|
-
_$AI(e,
|
|
657
|
-
if ((e = U(this, e,
|
|
658
|
-
const
|
|
659
|
-
r && this.element.removeEventListener(this.name, this,
|
|
656
|
+
_$AI(e, s = this) {
|
|
657
|
+
if ((e = U(this, e, s, 0) ?? b) === M) return;
|
|
658
|
+
const o = this._$AH, r = e === b && o !== b || e.capture !== o.capture || e.once !== o.once || e.passive !== o.passive, i = e !== b && (o === b || r);
|
|
659
|
+
r && this.element.removeEventListener(this.name, this, o), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
660
660
|
}
|
|
661
661
|
handleEvent(e) {
|
|
662
662
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
class
|
|
666
|
-
constructor(e,
|
|
667
|
-
this.element = e, this.type = 6, this._$AN = void 0, this._$AM =
|
|
665
|
+
class ot {
|
|
666
|
+
constructor(e, s, o) {
|
|
667
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = o;
|
|
668
668
|
}
|
|
669
669
|
get _$AU() {
|
|
670
670
|
return this._$AM._$AU;
|
|
@@ -674,18 +674,18 @@ class st {
|
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
const rt = ae.litHtmlPolyfillSupport;
|
|
677
|
-
rt?.(
|
|
678
|
-
const it = (t, e,
|
|
679
|
-
const
|
|
680
|
-
let r =
|
|
677
|
+
rt?.(q, Y), (ae.litHtmlVersions ??= []).push("3.3.2");
|
|
678
|
+
const it = (t, e, s) => {
|
|
679
|
+
const o = s?.renderBefore ?? e;
|
|
680
|
+
let r = o._$litPart$;
|
|
681
681
|
if (r === void 0) {
|
|
682
|
-
const i =
|
|
683
|
-
|
|
682
|
+
const i = s?.renderBefore ?? null;
|
|
683
|
+
o._$litPart$ = r = new Y(e.insertBefore(z(), i), i, void 0, s ?? {});
|
|
684
684
|
}
|
|
685
685
|
return r._$AI(t), r;
|
|
686
686
|
};
|
|
687
687
|
const he = globalThis;
|
|
688
|
-
let H = class extends
|
|
688
|
+
let H = class extends V {
|
|
689
689
|
constructor() {
|
|
690
690
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
691
691
|
}
|
|
@@ -694,8 +694,8 @@ let H = class extends T {
|
|
|
694
694
|
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
695
695
|
}
|
|
696
696
|
update(e) {
|
|
697
|
-
const
|
|
698
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = it(
|
|
697
|
+
const s = this.render();
|
|
698
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = it(s, this.renderRoot, this.renderOptions);
|
|
699
699
|
}
|
|
700
700
|
connectedCallback() {
|
|
701
701
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -711,13 +711,13 @@ H._$litElement$ = !0, H.finalized = !0, he.litElementHydrateSupport?.({ LitEleme
|
|
|
711
711
|
const nt = he.litElementPolyfillSupport;
|
|
712
712
|
nt?.({ LitElement: H });
|
|
713
713
|
(he.litElementVersions ??= []).push("4.2.2");
|
|
714
|
-
const at =
|
|
715
|
-
var lt = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, ce = (t, e,
|
|
716
|
-
for (var r =
|
|
717
|
-
(n = t[i]) && (r = (
|
|
718
|
-
return
|
|
714
|
+
const at = C`:host{display:inline-flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;outline:0}: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}`;
|
|
715
|
+
var lt = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, ce = (t, e, s, o) => {
|
|
716
|
+
for (var r = o > 1 ? void 0 : o ? ht(e, s) : e, i = t.length - 1, n; i >= 0; i--)
|
|
717
|
+
(n = t[i]) && (r = (o ? n(e, s, r) : n(r)) || r);
|
|
718
|
+
return o && r && lt(e, s, r), r;
|
|
719
719
|
};
|
|
720
|
-
let
|
|
720
|
+
let L = class extends H {
|
|
721
721
|
constructor() {
|
|
722
722
|
super(...arguments), this.checked = !1, this.disabled = !1, this.rippleElement = null;
|
|
723
723
|
}
|
|
@@ -734,176 +734,218 @@ let I = class extends H {
|
|
|
734
734
|
createRipple(t) {
|
|
735
735
|
const e = this.shadowRoot?.querySelector(".switch-wrapper");
|
|
736
736
|
if (!e) return;
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
e.contains(
|
|
737
|
+
const s = e.querySelector(".ripple");
|
|
738
|
+
s && e.removeChild(s);
|
|
739
|
+
const o = document.createElement("div");
|
|
740
|
+
o.classList.add("ripple"), e.appendChild(o), o.addEventListener("animationend", () => {
|
|
741
|
+
e.contains(o) && e.removeChild(o);
|
|
742
742
|
});
|
|
743
743
|
}
|
|
744
744
|
// 渲染开关组件
|
|
745
745
|
render() {
|
|
746
746
|
return re`<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>`;
|
|
747
747
|
}
|
|
748
|
+
connectedCallback() {
|
|
749
|
+
this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
|
|
750
|
+
this.style.transition = "";
|
|
751
|
+
});
|
|
752
|
+
}
|
|
748
753
|
};
|
|
749
|
-
|
|
754
|
+
L.styles = [at];
|
|
750
755
|
ce([
|
|
751
756
|
h({ type: Boolean, reflect: !0 })
|
|
752
|
-
],
|
|
757
|
+
], L.prototype, "checked", 2);
|
|
753
758
|
ce([
|
|
754
759
|
h({ type: Boolean, reflect: !0 })
|
|
755
|
-
],
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
],
|
|
759
|
-
const
|
|
760
|
+
], L.prototype, "disabled", 2);
|
|
761
|
+
L = ce([
|
|
762
|
+
O("nf-switch")
|
|
763
|
+
], L);
|
|
764
|
+
const Bt = N({
|
|
760
765
|
tagName: "nf-switch",
|
|
761
|
-
elementClass:
|
|
762
|
-
react:
|
|
766
|
+
elementClass: L,
|
|
767
|
+
react: T,
|
|
763
768
|
events: {
|
|
764
769
|
onChange: "change"
|
|
765
770
|
}
|
|
766
|
-
}), ct =
|
|
767
|
-
var dt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor,
|
|
768
|
-
for (var r =
|
|
769
|
-
(n = t[i]) && (r = (
|
|
770
|
-
return
|
|
771
|
+
}), ct = C`:host{width:var(--nf-width);position:relative;display:inline-flex;align-items:center;box-sizing:border-box;padding:0;overflow:hidden}.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-color);font-weight:var(--nf-font-weight);text-align:left}.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-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}.input-number:hover .controls{width:1.5rem}.input-prefix{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding-inline-start:.6125rem;color:var(--nf-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-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}`;
|
|
772
|
+
var dt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, m = (t, e, s, o) => {
|
|
773
|
+
for (var r = o > 1 ? void 0 : o ? ut(e, s) : e, i = t.length - 1, n; i >= 0; i--)
|
|
774
|
+
(n = t[i]) && (r = (o ? n(e, s, r) : n(r)) || r);
|
|
775
|
+
return o && r && dt(e, s, r), r;
|
|
771
776
|
};
|
|
772
|
-
let
|
|
777
|
+
let p = class extends W {
|
|
773
778
|
constructor() {
|
|
774
|
-
super(...arguments), this.value = 0, this.
|
|
775
|
-
t.
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
this.isInputFocused = !1;
|
|
814
|
-
};
|
|
779
|
+
super(...arguments), this.value = 0, this.formatter = (t) => t === null ? "" : String(t), this.parser = (t) => {
|
|
780
|
+
if (t.trim().length == 0 || t.endsWith("."))
|
|
781
|
+
return null;
|
|
782
|
+
const e = Number(t);
|
|
783
|
+
return Number.isNaN(e) ? null : this.clampValue(e);
|
|
784
|
+
}, this.prefix = "", this.suffix = "", this.controls = !0, this.step = 1, this.min = null, this.max = null, this.changeOnWheel = !0, this.disabled = !1, this.noDecimal = !1, this.noZero = !1, this.noNegative = !1, this.text = "", this.isTyping = !1, this.isFocused = !1;
|
|
785
|
+
}
|
|
786
|
+
// 对解析结果进行额外验证
|
|
787
|
+
validateParsed(t) {
|
|
788
|
+
return t === null || this.noDecimal && !Number.isInteger(t) || this.noZero && t === 0 || this.noNegative && t < 0 ? null : t;
|
|
789
|
+
}
|
|
790
|
+
/* ================== 文本设置 ================== */
|
|
791
|
+
// 验证并设置 text,过滤不合规字符
|
|
792
|
+
setText(t) {
|
|
793
|
+
let e = t;
|
|
794
|
+
if (e = e.replace(/[^0-9+.\-]/g, ""), this.noNegative && (e = e.replace(/[+\-]/g, "")), this.noDecimal && e.includes(".")) {
|
|
795
|
+
const s = Number(e);
|
|
796
|
+
Number.isNaN(s) ? e = e.replace(/\./g, "") : e = String(Math.round(s));
|
|
797
|
+
}
|
|
798
|
+
return this.text = e, e === t;
|
|
799
|
+
}
|
|
800
|
+
/* ================== 生命周期 ================== */
|
|
801
|
+
willUpdate(t) {
|
|
802
|
+
t.has("value") && !this.isTyping && this.setText(this.formatter(this.value));
|
|
803
|
+
}
|
|
804
|
+
/* ================== 事件处理 ================== */
|
|
805
|
+
onInput(t) {
|
|
806
|
+
this.isTyping = !0;
|
|
807
|
+
const e = t.target.value;
|
|
808
|
+
this.setText(e) || (t.target.value = this.text);
|
|
809
|
+
}
|
|
810
|
+
onBlur() {
|
|
811
|
+
this.isTyping = !1, this.isFocused = !1;
|
|
812
|
+
const t = this.validateParsed(this.parser(this.text));
|
|
813
|
+
t !== null ? (this.value = t, this.setText(this.formatter(t)), this.dispatchEvent(
|
|
814
|
+
new CustomEvent("change", {
|
|
815
|
+
detail: t
|
|
816
|
+
})
|
|
817
|
+
)) : this.setText(this.formatter(this.value));
|
|
815
818
|
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
819
|
+
onFocus() {
|
|
820
|
+
this.isFocused = !0;
|
|
821
|
+
}
|
|
822
|
+
onWheel(t) {
|
|
823
|
+
if (this.disabled || !this.changeOnWheel || !this.isFocused) return;
|
|
824
|
+
t.preventDefault();
|
|
825
|
+
const e = t.deltaY < 0 ? 1 : -1;
|
|
826
|
+
this.handleStepChange(e);
|
|
822
827
|
}
|
|
823
|
-
|
|
824
|
-
|
|
828
|
+
onKeyDown(t) {
|
|
829
|
+
t.stopPropagation(), t.key === "Enter" && t.target.blur();
|
|
825
830
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
const e = t.replace(this.decimalSeparator, "."), o = parseFloat(e);
|
|
829
|
-
return isNaN(o) ? null : o;
|
|
831
|
+
onKeyUp(t) {
|
|
832
|
+
t.stopPropagation();
|
|
830
833
|
}
|
|
834
|
+
/* ================== 提交逻辑 ================== */
|
|
835
|
+
// 修正浮点误差(保留 12 位有效精度)
|
|
836
|
+
fixFloatingPoint(t) {
|
|
837
|
+
return parseFloat(t.toPrecision(12));
|
|
838
|
+
}
|
|
839
|
+
// 限制值在 min/max 范围内
|
|
831
840
|
clampValue(t) {
|
|
832
841
|
let e = t;
|
|
833
|
-
return this.min !==
|
|
842
|
+
return this.min !== null && (e = Math.max(e, this.min)), this.max !== null && (e = Math.min(e, this.max)), e;
|
|
834
843
|
}
|
|
844
|
+
// 步进按钮处理
|
|
835
845
|
handleStepChange(t) {
|
|
836
846
|
if (this.disabled) return;
|
|
837
|
-
const e = this.
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
), this.dispatchEvent(
|
|
847
|
+
const e = this.validateParsed(this.parser(this.text));
|
|
848
|
+
if (e === null)
|
|
849
|
+
return;
|
|
850
|
+
this.value = e;
|
|
851
|
+
let s = this.fixFloatingPoint(this.value + t * this.step);
|
|
852
|
+
s = this.clampValue(s);
|
|
853
|
+
const o = this.validateParsed(s);
|
|
854
|
+
o !== null && (s = o, s !== this.value && (this.value = s, this.setText(this.formatter(s)), this.dispatchEvent(
|
|
845
855
|
new CustomEvent("change", {
|
|
846
|
-
detail:
|
|
847
|
-
bubbles: !0,
|
|
848
|
-
composed: !0
|
|
856
|
+
detail: s
|
|
849
857
|
})
|
|
850
|
-
));
|
|
858
|
+
)));
|
|
859
|
+
}
|
|
860
|
+
connectedCallback() {
|
|
861
|
+
this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
|
|
862
|
+
this.style.transition = "";
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
/* ================== Render ================== */
|
|
866
|
+
render() {
|
|
867
|
+
return f`<div class=input-prefix>${this.prefix}</div><div class=input-number><div class=input-number-input-wrapper><input 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 ? f`<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 ? f`<div class=input-suffix>${this.suffix}</div>` : ""}`;
|
|
851
868
|
}
|
|
852
869
|
};
|
|
853
|
-
|
|
854
|
-
|
|
870
|
+
p.styles = [K, ct];
|
|
871
|
+
m([
|
|
855
872
|
h({ type: Number })
|
|
856
|
-
],
|
|
857
|
-
|
|
858
|
-
h({
|
|
859
|
-
],
|
|
860
|
-
|
|
861
|
-
h({
|
|
862
|
-
],
|
|
863
|
-
|
|
873
|
+
], p.prototype, "value", 2);
|
|
874
|
+
m([
|
|
875
|
+
h({ attribute: !1 })
|
|
876
|
+
], p.prototype, "formatter", 2);
|
|
877
|
+
m([
|
|
878
|
+
h({ attribute: !1 })
|
|
879
|
+
], p.prototype, "parser", 2);
|
|
880
|
+
m([
|
|
881
|
+
h({ type: String, reflect: !0 })
|
|
882
|
+
], p.prototype, "prefix", 2);
|
|
883
|
+
m([
|
|
884
|
+
h({ type: String, reflect: !0 })
|
|
885
|
+
], p.prototype, "suffix", 2);
|
|
886
|
+
m([
|
|
887
|
+
h({
|
|
888
|
+
type: Boolean,
|
|
889
|
+
converter: {
|
|
890
|
+
fromAttribute: (t) => t !== "false" && t !== null,
|
|
891
|
+
toAttribute: (t) => t ? "" : null
|
|
892
|
+
}
|
|
893
|
+
})
|
|
894
|
+
], p.prototype, "controls", 2);
|
|
895
|
+
m([
|
|
864
896
|
h({ type: Number })
|
|
865
|
-
],
|
|
866
|
-
|
|
897
|
+
], p.prototype, "step", 2);
|
|
898
|
+
m([
|
|
867
899
|
h({ type: Number })
|
|
868
|
-
],
|
|
869
|
-
|
|
900
|
+
], p.prototype, "min", 2);
|
|
901
|
+
m([
|
|
870
902
|
h({ type: Number })
|
|
871
|
-
],
|
|
872
|
-
|
|
873
|
-
h({
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
903
|
+
], p.prototype, "max", 2);
|
|
904
|
+
m([
|
|
905
|
+
h({
|
|
906
|
+
type: Boolean,
|
|
907
|
+
attribute: "change-on-wheel",
|
|
908
|
+
converter: {
|
|
909
|
+
fromAttribute: (t) => t !== "false" && t !== null,
|
|
910
|
+
toAttribute: (t) => t ? "" : null
|
|
911
|
+
}
|
|
912
|
+
})
|
|
913
|
+
], p.prototype, "changeOnWheel", 2);
|
|
914
|
+
m([
|
|
882
915
|
h({ type: Boolean, reflect: !0 })
|
|
883
|
-
],
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
],
|
|
887
|
-
m
|
|
888
|
-
|
|
889
|
-
],
|
|
890
|
-
|
|
916
|
+
], p.prototype, "disabled", 2);
|
|
917
|
+
m([
|
|
918
|
+
h({ type: Boolean, attribute: "no-decimal" })
|
|
919
|
+
], p.prototype, "noDecimal", 2);
|
|
920
|
+
m([
|
|
921
|
+
h({ type: Boolean, attribute: "no-zero" })
|
|
922
|
+
], p.prototype, "noZero", 2);
|
|
923
|
+
m([
|
|
924
|
+
h({ type: Boolean, attribute: "no-negative" })
|
|
925
|
+
], p.prototype, "noNegative", 2);
|
|
926
|
+
m([
|
|
927
|
+
w()
|
|
928
|
+
], p.prototype, "text", 2);
|
|
929
|
+
m([
|
|
930
|
+
w()
|
|
931
|
+
], p.prototype, "isFocused", 2);
|
|
932
|
+
p = m([
|
|
933
|
+
O("nf-input-number")
|
|
934
|
+
], p);
|
|
935
|
+
const pt = N({
|
|
891
936
|
tagName: "nf-input-number",
|
|
892
|
-
elementClass:
|
|
893
|
-
react:
|
|
937
|
+
elementClass: p,
|
|
938
|
+
react: T,
|
|
894
939
|
events: {
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
for (var r = s > 1 ? void 0 : s ? bt(e, o) : e, i = t.length - 1, n; i >= 0; i--)
|
|
903
|
-
(n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
|
|
904
|
-
return s && r && ft(e, o, r), r;
|
|
940
|
+
onChange: "change"
|
|
941
|
+
}
|
|
942
|
+
}), Vt = pt, ft = C`:host{cursor:pointer;-webkit-user-select:none;user-select:none;width:calc(1rem + 2px);height:calc(1rem + 2px)}:host([disabled]){cursor:not-allowed;opacity:.6}.checkbox-container{position:relative;transition:opacity .2s ease}.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}`;
|
|
943
|
+
var bt = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, de = (t, e, s, o) => {
|
|
944
|
+
for (var r = o > 1 ? void 0 : o ? mt(e, s) : e, i = t.length - 1, n; i >= 0; i--)
|
|
945
|
+
(n = t[i]) && (r = (o ? n(e, s, r) : n(r)) || r);
|
|
946
|
+
return o && r && bt(e, s, r), r;
|
|
905
947
|
};
|
|
906
|
-
let
|
|
948
|
+
let F = class extends H {
|
|
907
949
|
constructor() {
|
|
908
950
|
super(...arguments), this.checked = !1, this.disabled = !1;
|
|
909
951
|
}
|
|
@@ -919,75 +961,80 @@ let L = class extends H {
|
|
|
919
961
|
}
|
|
920
962
|
// 渲染复选框组件
|
|
921
963
|
render() {
|
|
922
|
-
return re`<div class=checkbox-container @click=${this.toggleCheckbox} aria-checked=${this.checked} aria-disabled=${this.disabled} role=checkbox><div class=checkbox-box>${this.checked ? re`<div class=checkbox-icon><svg
|
|
964
|
+
return re`<div class=checkbox-container @click=${this.toggleCheckbox} aria-checked=${this.checked} aria-disabled=${this.disabled} role=checkbox><div class=checkbox-box>${this.checked ? re`<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></div>`;
|
|
965
|
+
}
|
|
966
|
+
connectedCallback() {
|
|
967
|
+
this.style.transition = "none", super.connectedCallback(), requestAnimationFrame(() => {
|
|
968
|
+
this.style.transition = "";
|
|
969
|
+
});
|
|
923
970
|
}
|
|
924
971
|
};
|
|
925
|
-
|
|
972
|
+
F.styles = [ft];
|
|
926
973
|
de([
|
|
927
974
|
h({ type: Boolean, reflect: !0 })
|
|
928
|
-
],
|
|
975
|
+
], F.prototype, "checked", 2);
|
|
929
976
|
de([
|
|
930
977
|
h({ type: Boolean, reflect: !0 })
|
|
931
|
-
],
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
],
|
|
935
|
-
const
|
|
978
|
+
], F.prototype, "disabled", 2);
|
|
979
|
+
F = de([
|
|
980
|
+
O("nf-checkbox")
|
|
981
|
+
], F);
|
|
982
|
+
const Ht = N({
|
|
936
983
|
tagName: "nf-checkbox",
|
|
937
|
-
elementClass:
|
|
938
|
-
react:
|
|
984
|
+
elementClass: F,
|
|
985
|
+
react: T,
|
|
939
986
|
events: {
|
|
940
987
|
onChange: "change"
|
|
941
988
|
}
|
|
942
989
|
});
|
|
943
|
-
const
|
|
944
|
-
let
|
|
990
|
+
const gt = { ATTRIBUTE: 1 }, vt = (t) => (...e) => ({ _$litDirective$: t, values: e });
|
|
991
|
+
let _t = class {
|
|
945
992
|
constructor(e) {
|
|
946
993
|
}
|
|
947
994
|
get _$AU() {
|
|
948
995
|
return this._$AM._$AU;
|
|
949
996
|
}
|
|
950
|
-
_$AT(e,
|
|
951
|
-
this._$Ct = e, this._$AM =
|
|
997
|
+
_$AT(e, s, o) {
|
|
998
|
+
this._$Ct = e, this._$AM = s, this._$Ci = o;
|
|
952
999
|
}
|
|
953
|
-
_$AS(e,
|
|
954
|
-
return this.update(e,
|
|
1000
|
+
_$AS(e, s) {
|
|
1001
|
+
return this.update(e, s);
|
|
955
1002
|
}
|
|
956
|
-
update(e,
|
|
957
|
-
return this.render(...
|
|
1003
|
+
update(e, s) {
|
|
1004
|
+
return this.render(...s);
|
|
958
1005
|
}
|
|
959
1006
|
};
|
|
960
|
-
const Se = "important",
|
|
1007
|
+
const Se = "important", yt = " !" + Se, ee = vt(class extends _t {
|
|
961
1008
|
constructor(t) {
|
|
962
|
-
if (super(t), t.type !==
|
|
1009
|
+
if (super(t), t.type !== gt.ATTRIBUTE || t.name !== "style" || t.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
963
1010
|
}
|
|
964
1011
|
render(t) {
|
|
965
|
-
return Object.keys(t).reduce((e,
|
|
966
|
-
const
|
|
967
|
-
return
|
|
1012
|
+
return Object.keys(t).reduce((e, s) => {
|
|
1013
|
+
const o = t[s];
|
|
1014
|
+
return o == null ? e : e + `${s = s.includes("-") ? s : s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${o};`;
|
|
968
1015
|
}, "");
|
|
969
1016
|
}
|
|
970
1017
|
update(t, [e]) {
|
|
971
|
-
const { style:
|
|
1018
|
+
const { style: s } = t.element;
|
|
972
1019
|
if (this.ft === void 0) return this.ft = new Set(Object.keys(e)), this.render(e);
|
|
973
|
-
for (const
|
|
974
|
-
for (const
|
|
975
|
-
const r = e[
|
|
1020
|
+
for (const o of this.ft) e[o] == null && (this.ft.delete(o), o.includes("-") ? s.removeProperty(o) : s[o] = null);
|
|
1021
|
+
for (const o in e) {
|
|
1022
|
+
const r = e[o];
|
|
976
1023
|
if (r != null) {
|
|
977
|
-
this.ft.add(
|
|
978
|
-
const i = typeof r == "string" && r.endsWith(
|
|
979
|
-
|
|
1024
|
+
this.ft.add(o);
|
|
1025
|
+
const i = typeof r == "string" && r.endsWith(yt);
|
|
1026
|
+
o.includes("-") || i ? s.setProperty(o, i ? r.slice(0, -11) : r, i ? Se : "") : s[o] = r;
|
|
980
1027
|
}
|
|
981
1028
|
}
|
|
982
1029
|
return M;
|
|
983
1030
|
}
|
|
984
|
-
}), wt =
|
|
985
|
-
var
|
|
986
|
-
for (var r =
|
|
987
|
-
(n = t[i]) && (r = (
|
|
988
|
-
return
|
|
1031
|
+
}), wt = C`:host{display:inline-block;position:relative}: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}.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}`;
|
|
1032
|
+
var $t = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, _ = (t, e, s, o) => {
|
|
1033
|
+
for (var r = o > 1 ? void 0 : o ? xt(e, s) : e, i = t.length - 1, n; i >= 0; i--)
|
|
1034
|
+
(n = t[i]) && (r = (o ? n(e, s, r) : n(r)) || r);
|
|
1035
|
+
return o && r && $t(e, s, r), r;
|
|
989
1036
|
};
|
|
990
|
-
let
|
|
1037
|
+
let g = class extends W {
|
|
991
1038
|
constructor() {
|
|
992
1039
|
super(...arguments), this.value = "#FF0000", this.disabled = !1, this.disabledAlpha = !1, this.open = !1, this.showText = !0, this.placement = "bottom", this.align = "left", this.autoAdjust = !0, this._panelVisible = !1, this._internalValue = "#FF0000FF", this._hsb = { h: 0, s: 100, b: 100 }, this._panelPosition = { top: 0, left: 0 }, this._handleGlobalClick = (t) => {
|
|
993
1040
|
this._panelVisible && !this.contains(t.target) && this._closePanel();
|
|
@@ -1004,16 +1051,18 @@ let b = class extends q {
|
|
|
1004
1051
|
};
|
|
1005
1052
|
}
|
|
1006
1053
|
connectedCallback() {
|
|
1007
|
-
super.connectedCallback(), document.addEventListener("click", this._handleGlobalClick), document.addEventListener("keydown", this._handleKeyDown)
|
|
1054
|
+
this.style.transition = "none", super.connectedCallback(), document.addEventListener("click", this._handleGlobalClick), document.addEventListener("keydown", this._handleKeyDown), requestAnimationFrame(() => {
|
|
1055
|
+
this.style.transition = "";
|
|
1056
|
+
});
|
|
1008
1057
|
}
|
|
1009
1058
|
disconnectedCallback() {
|
|
1010
1059
|
super.disconnectedCallback(), document.removeEventListener("click", this._handleGlobalClick), document.removeEventListener("keydown", this._handleKeyDown), document.removeEventListener("mousemove", this._handleSBMouseMove), document.removeEventListener("mouseup", this._handleSBMouseUp);
|
|
1011
1060
|
}
|
|
1012
1061
|
firstUpdated() {
|
|
1013
|
-
this._updateInternalValue(this.value), this._updateHSBFromHex(this._internalValue);
|
|
1062
|
+
this._updateInternalValue(this.value), this._updateHSBFromHex(this._internalValue), this.classList.toggle("hide-text", !this.showText);
|
|
1014
1063
|
}
|
|
1015
1064
|
updated(t) {
|
|
1016
|
-
t.has("value") && (this._updateInternalValue(this.value), this._updateHSBFromHex(this._internalValue)), t.has("open") && (this._panelVisible = this.open, this.open && this._updatePanelPosition());
|
|
1065
|
+
t.has("value") && (this._updateInternalValue(this.value), this._updateHSBFromHex(this._internalValue)), t.has("open") && (this._panelVisible = this.open, this.open && this._updatePanelPosition()), t.has("showText") && this.classList.toggle("hide-text", !this.showText);
|
|
1017
1066
|
}
|
|
1018
1067
|
// 更新内部颜色值
|
|
1019
1068
|
_updateInternalValue(t) {
|
|
@@ -1025,34 +1074,34 @@ let b = class extends q {
|
|
|
1025
1074
|
}
|
|
1026
1075
|
// 从HEX颜色值更新HSB值
|
|
1027
1076
|
_updateHSBFromHex(t) {
|
|
1028
|
-
const e = parseInt(t.slice(1, 3), 16) / 255,
|
|
1077
|
+
const e = parseInt(t.slice(1, 3), 16) / 255, s = parseInt(t.slice(3, 5), 16) / 255, o = parseInt(t.slice(5, 7), 16) / 255, r = Math.max(e, s, o), i = Math.min(e, s, o), n = r - i;
|
|
1029
1078
|
let l = 0, a = 0;
|
|
1030
1079
|
const c = r;
|
|
1031
|
-
n !== 0 && (a = n / r, r === e ? l = (
|
|
1080
|
+
n !== 0 && (a = n / r, r === e ? l = (s - o) / n % 6 : r === s ? l = (o - e) / n + 2 : l = (e - s) / n + 4, l *= 60, l < 0 && (l += 360)), this._hsb = {
|
|
1032
1081
|
h: Math.round(l),
|
|
1033
1082
|
s: Math.round(a * 100),
|
|
1034
1083
|
b: Math.round(c * 100)
|
|
1035
1084
|
};
|
|
1036
1085
|
}
|
|
1037
1086
|
// 从HSB值生成HEX颜色值
|
|
1038
|
-
_generateHexFromHSB(t, e,
|
|
1039
|
-
e /= 100,
|
|
1040
|
-
const r =
|
|
1087
|
+
_generateHexFromHSB(t, e, s, o = "FF") {
|
|
1088
|
+
e /= 100, s /= 100;
|
|
1089
|
+
const r = s * e, i = r * (1 - Math.abs(t / 60 % 2 - 1)), n = s - r;
|
|
1041
1090
|
let l = 0, a = 0, c = 0;
|
|
1042
|
-
return 0 <= t && t < 60 ? (l = r, a = i, c = 0) : 60 <= t && t < 120 ? (l = i, a = r, c = 0) : 120 <= t && t < 180 ? (l = 0, a = r, c = i) : 180 <= t && t < 240 ? (l = 0, a = i, c = r) : 240 <= t && t < 300 ? (l = i, a = 0, c = r) : 300 <= t && t < 360 && (l = r, a = 0, c = i), 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") +
|
|
1091
|
+
return 0 <= t && t < 60 ? (l = r, a = i, c = 0) : 60 <= t && t < 120 ? (l = i, a = r, c = 0) : 120 <= t && t < 180 ? (l = 0, a = r, c = i) : 180 <= t && t < 240 ? (l = 0, a = i, c = r) : 240 <= t && t < 300 ? (l = i, a = 0, c = r) : 300 <= t && t < 360 && (l = r, a = 0, c = i), 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") + o;
|
|
1043
1092
|
}
|
|
1044
1093
|
// 计算面板位置
|
|
1045
1094
|
_updatePanelPosition() {
|
|
1046
1095
|
requestAnimationFrame(() => {
|
|
1047
1096
|
const t = this.getBoundingClientRect(), e = this.shadowRoot?.querySelector(".panel");
|
|
1048
1097
|
if (!e) return;
|
|
1049
|
-
const
|
|
1098
|
+
const s = 0.15 * 16, o = 8, r = e.offsetWidth || 240, i = e.offsetHeight || 300;
|
|
1050
1099
|
let n = this.placement, l = this.align;
|
|
1051
|
-
this.autoAdjust && (n === "bottom" ? window.innerHeight - t.bottom -
|
|
1100
|
+
this.autoAdjust && (n === "bottom" ? window.innerHeight - t.bottom - o < i && t.top - o >= i && (n = "top") : t.top - o < i && window.innerHeight - t.bottom - o >= i && (n = "bottom"), l === "right" ? t.right - s < r && t.left + t.width + s + r <= window.innerWidth && (l = "left") : t.left - s + r > window.innerWidth && t.right - s >= r && (l = "right"));
|
|
1052
1101
|
let a;
|
|
1053
|
-
n === "bottom" ? a = t.height +
|
|
1102
|
+
n === "bottom" ? a = t.height + o : a = -i - o;
|
|
1054
1103
|
let c;
|
|
1055
|
-
l === "right" ? c = t.width - r +
|
|
1104
|
+
l === "right" ? c = t.width - r + s : c = -s, this._panelPosition = { top: a, left: c };
|
|
1056
1105
|
});
|
|
1057
1106
|
}
|
|
1058
1107
|
// 打开面板
|
|
@@ -1078,15 +1127,15 @@ let b = class extends q {
|
|
|
1078
1127
|
this._panelVisible ? this._closePanel() : this._openPanel();
|
|
1079
1128
|
}
|
|
1080
1129
|
// 处理HSB颜色变化
|
|
1081
|
-
_handleHSBChange(t, e,
|
|
1082
|
-
this._hsb = { h: t, s: e, b:
|
|
1083
|
-
const
|
|
1130
|
+
_handleHSBChange(t, e, s) {
|
|
1131
|
+
this._hsb = { h: t, s: e, b: s };
|
|
1132
|
+
const o = this._internalValue.slice(7), r = this._generateHexFromHSB(t, e, s, o);
|
|
1084
1133
|
this._handleColorChange(r);
|
|
1085
1134
|
}
|
|
1086
1135
|
// 处理Alpha值变化
|
|
1087
1136
|
_handleAlphaChange(t) {
|
|
1088
|
-
const e = Math.round(t * 255 / 100).toString(16).padStart(2, "0").toUpperCase(),
|
|
1089
|
-
this._handleColorChange(
|
|
1137
|
+
const e = Math.round(t * 255 / 100).toString(16).padStart(2, "0").toUpperCase(), s = "#" + this._internalValue.slice(1, 7) + e;
|
|
1138
|
+
this._handleColorChange(s);
|
|
1090
1139
|
}
|
|
1091
1140
|
// 处理颜色变化
|
|
1092
1141
|
_handleColorChange(t) {
|
|
@@ -1100,25 +1149,25 @@ let b = class extends q {
|
|
|
1100
1149
|
}
|
|
1101
1150
|
// 处理色相选择
|
|
1102
1151
|
_handleHueChange(t) {
|
|
1103
|
-
const e = t.target,
|
|
1104
|
-
this._handleHSBChange(
|
|
1152
|
+
const e = t.target, s = parseInt(e.value);
|
|
1153
|
+
this._handleHSBChange(s, this._hsb.s, this._hsb.b);
|
|
1105
1154
|
}
|
|
1106
1155
|
// 处理饱和度和亮度选择
|
|
1107
1156
|
_handleSBChange(t) {
|
|
1108
1157
|
const e = this.shadowRoot?.querySelector(".color-sb");
|
|
1109
1158
|
if (!e) return;
|
|
1110
|
-
const
|
|
1159
|
+
const s = e.getBoundingClientRect(), o = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, r = t instanceof MouseEvent ? t.clientY : t.touches[0].clientY, i = Math.max(0, Math.min(100, Math.round((o - s.left) / s.width * 100))), n = Math.max(0, Math.min(100, Math.round((1 - (r - s.top) / s.height) * 100)));
|
|
1111
1160
|
this._handleHSBChange(this._hsb.h, i, n);
|
|
1112
1161
|
}
|
|
1113
1162
|
// 处理透明度选择
|
|
1114
1163
|
_handleAlphaChangeInput(t) {
|
|
1115
|
-
const e = t.target,
|
|
1116
|
-
this._handleAlphaChange(
|
|
1164
|
+
const e = t.target, s = parseInt(e.value);
|
|
1165
|
+
this._handleAlphaChange(s);
|
|
1117
1166
|
}
|
|
1118
1167
|
// 渲染触发器
|
|
1119
1168
|
_renderTrigger() {
|
|
1120
1169
|
const t = "#" + this._internalValue.slice(1, 7), e = this._internalValue.slice(7);
|
|
1121
|
-
return
|
|
1170
|
+
return f`
|
|
1122
1171
|
<div
|
|
1123
1172
|
class="trigger"
|
|
1124
1173
|
@click="${this._togglePanel}"
|
|
@@ -1128,14 +1177,14 @@ let b = class extends q {
|
|
|
1128
1177
|
class="color-block"
|
|
1129
1178
|
style="background-color: ${this.disabledAlpha ? t : this._internalValue}"
|
|
1130
1179
|
></div>
|
|
1131
|
-
${this.showText ?
|
|
1180
|
+
${this.showText ? f`<div class="color-text">${this.disabledAlpha || e === "FF" ? t : this._internalValue}</div>` : ""}
|
|
1132
1181
|
</div>
|
|
1133
1182
|
`;
|
|
1134
1183
|
}
|
|
1135
1184
|
// 渲染颜色选择区域
|
|
1136
1185
|
_renderColorSelector() {
|
|
1137
|
-
const t = this._generateHexFromHSB(this._hsb.h, 100, 100, "FF"), e = this._hsb.s / 100 * 100,
|
|
1138
|
-
return
|
|
1186
|
+
const t = this._generateHexFromHSB(this._hsb.h, 100, 100, "FF"), e = this._hsb.s / 100 * 100, s = (1 - this._hsb.b / 100) * 100;
|
|
1187
|
+
return f`
|
|
1139
1188
|
<div class="color-selector">
|
|
1140
1189
|
<div
|
|
1141
1190
|
class="color-sb"
|
|
@@ -1152,7 +1201,7 @@ let b = class extends q {
|
|
|
1152
1201
|
class="selector"
|
|
1153
1202
|
style=${ee({
|
|
1154
1203
|
left: `${e}%`,
|
|
1155
|
-
top: `${
|
|
1204
|
+
top: `${s}%`
|
|
1156
1205
|
})}
|
|
1157
1206
|
></div>
|
|
1158
1207
|
</div>
|
|
@@ -1161,7 +1210,7 @@ let b = class extends q {
|
|
|
1161
1210
|
}
|
|
1162
1211
|
// 渲染色相选择条
|
|
1163
1212
|
_renderHueSlider() {
|
|
1164
|
-
return
|
|
1213
|
+
return f`
|
|
1165
1214
|
<div class="slider-container">
|
|
1166
1215
|
<div class="slider hue-slider">
|
|
1167
1216
|
<input
|
|
@@ -1180,7 +1229,7 @@ let b = class extends q {
|
|
|
1180
1229
|
_renderAlphaSlider() {
|
|
1181
1230
|
if (this.disabledAlpha) return null;
|
|
1182
1231
|
const t = parseInt(this._internalValue.slice(7), 16) / 255 * 100, e = "#" + this._internalValue.slice(1, 7);
|
|
1183
|
-
return
|
|
1232
|
+
return f`
|
|
1184
1233
|
<div class="slider-container">
|
|
1185
1234
|
<div class="slider alpha-slider">
|
|
1186
1235
|
<div
|
|
@@ -1201,7 +1250,7 @@ let b = class extends q {
|
|
|
1201
1250
|
}
|
|
1202
1251
|
// 渲染当前颜色显示
|
|
1203
1252
|
_renderCurrentColor() {
|
|
1204
|
-
return
|
|
1253
|
+
return f`
|
|
1205
1254
|
<div class="current-color-container">
|
|
1206
1255
|
<div
|
|
1207
1256
|
class="current-color"
|
|
@@ -1212,7 +1261,7 @@ let b = class extends q {
|
|
|
1212
1261
|
}
|
|
1213
1262
|
// 渲染颜色面板
|
|
1214
1263
|
_renderPanel() {
|
|
1215
|
-
return this._panelVisible ?
|
|
1264
|
+
return this._panelVisible ? f`
|
|
1216
1265
|
<div
|
|
1217
1266
|
class="panel"
|
|
1218
1267
|
style="top: ${this._panelPosition.top}px; left: ${this._panelPosition.left}px;"
|
|
@@ -1231,41 +1280,42 @@ let b = class extends q {
|
|
|
1231
1280
|
` : null;
|
|
1232
1281
|
}
|
|
1233
1282
|
render() {
|
|
1234
|
-
return
|
|
1283
|
+
return f`
|
|
1235
1284
|
${this._renderTrigger()}
|
|
1236
1285
|
${this._renderPanel()}
|
|
1237
1286
|
`;
|
|
1238
1287
|
}
|
|
1239
1288
|
};
|
|
1240
|
-
|
|
1241
|
-
|
|
1289
|
+
g.styles = [K, wt];
|
|
1290
|
+
_([
|
|
1242
1291
|
h({ type: String })
|
|
1243
|
-
],
|
|
1244
|
-
|
|
1292
|
+
], g.prototype, "value", 2);
|
|
1293
|
+
_([
|
|
1245
1294
|
h({ type: Boolean, reflect: !0 })
|
|
1246
|
-
],
|
|
1247
|
-
|
|
1295
|
+
], g.prototype, "disabled", 2);
|
|
1296
|
+
_([
|
|
1248
1297
|
h({ type: Boolean, reflect: !0, attribute: "disabled-alpha" })
|
|
1249
|
-
],
|
|
1250
|
-
|
|
1298
|
+
], g.prototype, "disabledAlpha", 2);
|
|
1299
|
+
_([
|
|
1251
1300
|
h({ type: Boolean, reflect: !0 })
|
|
1252
|
-
],
|
|
1253
|
-
|
|
1301
|
+
], g.prototype, "open", 2);
|
|
1302
|
+
_([
|
|
1254
1303
|
h({
|
|
1255
1304
|
attribute: "show-text",
|
|
1305
|
+
reflect: !0,
|
|
1256
1306
|
converter: {
|
|
1257
1307
|
fromAttribute: (t) => t !== "false",
|
|
1258
1308
|
toAttribute: (t) => t ? null : "false"
|
|
1259
1309
|
}
|
|
1260
1310
|
})
|
|
1261
|
-
],
|
|
1262
|
-
|
|
1311
|
+
], g.prototype, "showText", 2);
|
|
1312
|
+
_([
|
|
1263
1313
|
h({ type: String })
|
|
1264
|
-
],
|
|
1265
|
-
|
|
1314
|
+
], g.prototype, "placement", 2);
|
|
1315
|
+
_([
|
|
1266
1316
|
h({ type: String })
|
|
1267
|
-
],
|
|
1268
|
-
|
|
1317
|
+
], g.prototype, "align", 2);
|
|
1318
|
+
_([
|
|
1269
1319
|
h({
|
|
1270
1320
|
attribute: "auto-adjust",
|
|
1271
1321
|
converter: {
|
|
@@ -1273,37 +1323,37 @@ v([
|
|
|
1273
1323
|
toAttribute: (t) => t ? null : "false"
|
|
1274
1324
|
}
|
|
1275
1325
|
})
|
|
1276
|
-
],
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
],
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
],
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
],
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
],
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
],
|
|
1292
|
-
const
|
|
1326
|
+
], g.prototype, "autoAdjust", 2);
|
|
1327
|
+
_([
|
|
1328
|
+
w()
|
|
1329
|
+
], g.prototype, "_panelVisible", 2);
|
|
1330
|
+
_([
|
|
1331
|
+
w()
|
|
1332
|
+
], g.prototype, "_internalValue", 2);
|
|
1333
|
+
_([
|
|
1334
|
+
w()
|
|
1335
|
+
], g.prototype, "_hsb", 2);
|
|
1336
|
+
_([
|
|
1337
|
+
w()
|
|
1338
|
+
], g.prototype, "_panelPosition", 2);
|
|
1339
|
+
g = _([
|
|
1340
|
+
O("nf-color-picker")
|
|
1341
|
+
], g);
|
|
1342
|
+
const Lt = N({
|
|
1293
1343
|
tagName: "nf-color-picker",
|
|
1294
|
-
elementClass:
|
|
1295
|
-
react:
|
|
1344
|
+
elementClass: g,
|
|
1345
|
+
react: T,
|
|
1296
1346
|
events: {
|
|
1297
1347
|
onChange: "change",
|
|
1298
1348
|
onOpenChange: "openChange"
|
|
1299
1349
|
}
|
|
1300
|
-
}),
|
|
1301
|
-
var
|
|
1302
|
-
for (var r =
|
|
1303
|
-
(n = t[i]) && (r = (
|
|
1304
|
-
return
|
|
1350
|
+
}), kt = C`: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}`;
|
|
1351
|
+
var At = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, y = (t, e, s, o) => {
|
|
1352
|
+
for (var r = o > 1 ? void 0 : o ? Et(e, s) : e, i = t.length - 1, n; i >= 0; i--)
|
|
1353
|
+
(n = t[i]) && (r = (o ? n(e, s, r) : n(r)) || r);
|
|
1354
|
+
return o && r && At(e, s, r), r;
|
|
1305
1355
|
};
|
|
1306
|
-
let
|
|
1356
|
+
let v = class extends W {
|
|
1307
1357
|
constructor() {
|
|
1308
1358
|
super(...arguments), this.value = 0, this.defaultValue = 0, this.min = 0, this.max = 100, this.step = 1, this.disabled = !1, this.range = !1, this.tooltip = !1, this._currentValue = 0, this._isDragging = !1, this._showTooltip = !1, this._handleHostMouseDown = (t) => {
|
|
1309
1359
|
this.disabled || (t.preventDefault(), this._startDrag(t));
|
|
@@ -1322,7 +1372,9 @@ let g = class extends q {
|
|
|
1322
1372
|
};
|
|
1323
1373
|
}
|
|
1324
1374
|
connectedCallback() {
|
|
1325
|
-
super.connectedCallback(), this._currentValue = this.value || this.defaultValue, this.addEventListener("mousedown", this._handleHostMouseDown), this.addEventListener("touchstart", this._handleHostTouchStart)
|
|
1375
|
+
this.style.transition = "none", super.connectedCallback(), this._currentValue = this.value || this.defaultValue, this.addEventListener("mousedown", this._handleHostMouseDown), this.addEventListener("touchstart", this._handleHostTouchStart), requestAnimationFrame(() => {
|
|
1376
|
+
this.style.transition = "";
|
|
1377
|
+
});
|
|
1326
1378
|
}
|
|
1327
1379
|
disconnectedCallback() {
|
|
1328
1380
|
super.disconnectedCallback(), this.removeEventListener("mousedown", this._handleHostMouseDown), this.removeEventListener("touchstart", this._handleHostTouchStart), document.removeEventListener("mousemove", this._handleDrag), document.removeEventListener("touchmove", this._handleDrag), document.removeEventListener("mouseup", this._stopDrag), document.removeEventListener("touchend", this._stopDrag);
|
|
@@ -1372,7 +1424,7 @@ let g = class extends q {
|
|
|
1372
1424
|
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);
|
|
1373
1425
|
}
|
|
1374
1426
|
_updateValue(t) {
|
|
1375
|
-
const e = this.getBoundingClientRect(),
|
|
1427
|
+
const e = this.getBoundingClientRect(), s = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, o = Math.max(0, Math.min(1, (s - e.left) / e.width)), r = this.max - this.min, i = this.min + o * r, n = Math.round((i - this.min) / this.step), l = this.min + n * this.step;
|
|
1376
1428
|
this._currentValue = Math.min(this.max, Math.max(this.min, l)), this.requestUpdate();
|
|
1377
1429
|
}
|
|
1378
1430
|
_getValuePercentage() {
|
|
@@ -1380,61 +1432,66 @@ let g = class extends q {
|
|
|
1380
1432
|
return t === 0 ? 0 : (this._currentValue - this.min) / t * 100;
|
|
1381
1433
|
}
|
|
1382
1434
|
render() {
|
|
1383
|
-
const t = this._getValuePercentage(), e = `${t}%`,
|
|
1384
|
-
return
|
|
1435
|
+
const t = this._getValuePercentage(), e = `${t}%`, s = `${t}%`, o = `slider-tooltip ${this._showTooltip || this.tooltip ? "visible" : ""}`;
|
|
1436
|
+
return f`<div class=slider-fill style=${ee({ width: s })}></div><div class=slider-handle style=${ee({ left: e })} tabindex=${this.disabled ? -1 : 0} @mousedown=${this._handleMouseDown} @touchstart=${this._handleTouchStart} @keydown=${this._handleKeyDown}><div class=${o}>${this._currentValue}</div></div>`;
|
|
1385
1437
|
}
|
|
1386
1438
|
};
|
|
1387
|
-
|
|
1388
|
-
|
|
1439
|
+
v.styles = [K, kt];
|
|
1440
|
+
y([
|
|
1389
1441
|
h({ type: Number })
|
|
1390
|
-
],
|
|
1391
|
-
|
|
1442
|
+
], v.prototype, "value", 2);
|
|
1443
|
+
y([
|
|
1392
1444
|
h({ type: Number })
|
|
1393
|
-
],
|
|
1394
|
-
|
|
1445
|
+
], v.prototype, "defaultValue", 2);
|
|
1446
|
+
y([
|
|
1395
1447
|
h({ type: Number })
|
|
1396
|
-
],
|
|
1397
|
-
|
|
1448
|
+
], v.prototype, "min", 2);
|
|
1449
|
+
y([
|
|
1398
1450
|
h({ type: Number })
|
|
1399
|
-
],
|
|
1400
|
-
|
|
1451
|
+
], v.prototype, "max", 2);
|
|
1452
|
+
y([
|
|
1401
1453
|
h({ type: Number })
|
|
1402
|
-
],
|
|
1403
|
-
|
|
1454
|
+
], v.prototype, "step", 2);
|
|
1455
|
+
y([
|
|
1404
1456
|
h({ type: Boolean, reflect: !0 })
|
|
1405
|
-
],
|
|
1406
|
-
|
|
1457
|
+
], v.prototype, "disabled", 2);
|
|
1458
|
+
y([
|
|
1407
1459
|
h({ type: Boolean })
|
|
1408
|
-
],
|
|
1409
|
-
|
|
1460
|
+
], v.prototype, "range", 2);
|
|
1461
|
+
y([
|
|
1410
1462
|
h({ type: Boolean })
|
|
1411
|
-
],
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
],
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
],
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
],
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
],
|
|
1424
|
-
const
|
|
1463
|
+
], v.prototype, "tooltip", 2);
|
|
1464
|
+
y([
|
|
1465
|
+
w()
|
|
1466
|
+
], v.prototype, "_currentValue", 2);
|
|
1467
|
+
y([
|
|
1468
|
+
w()
|
|
1469
|
+
], v.prototype, "_isDragging", 2);
|
|
1470
|
+
y([
|
|
1471
|
+
w()
|
|
1472
|
+
], v.prototype, "_showTooltip", 2);
|
|
1473
|
+
v = y([
|
|
1474
|
+
O("nf-slider")
|
|
1475
|
+
], v);
|
|
1476
|
+
const Ft = N({
|
|
1425
1477
|
tagName: "nf-slider",
|
|
1426
|
-
elementClass:
|
|
1427
|
-
react:
|
|
1478
|
+
elementClass: v,
|
|
1479
|
+
react: T,
|
|
1428
1480
|
events: {
|
|
1429
1481
|
onChange: "change"
|
|
1430
1482
|
}
|
|
1431
1483
|
});
|
|
1484
|
+
function It(t) {
|
|
1485
|
+
const { children: e, className: s, ...o } = t;
|
|
1486
|
+
return /* @__PURE__ */ React.createElement("div", { className: "nf-root nf-theme-blue" + (s ? ` ${s}` : ""), ...o }, e);
|
|
1487
|
+
}
|
|
1432
1488
|
export {
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1489
|
+
Ht as NfCheckbox,
|
|
1490
|
+
Lt as NfColorPicker,
|
|
1491
|
+
Nt as NfInput,
|
|
1492
|
+
Vt as NfInputNumber,
|
|
1493
|
+
It as NfRoot,
|
|
1494
|
+
Tt as NfSelect,
|
|
1495
|
+
Ft as NfSlider,
|
|
1496
|
+
Bt as NfSwitch
|
|
1440
1497
|
};
|