next-flow-design 1.5.3 → 1.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
- type Formatter = (value?: number) => string;
2
+ type Formatter = (value: number | null) => string;
3
3
  type Parser = (text: string) => number | null;
4
4
  export declare class NfInputNumberElement extends LitElement {
5
5
  static styles: CSSStyleSheet[];
@@ -18,6 +18,7 @@ export declare class NfInputNumberElement extends LitElement {
18
18
  noDecimal: boolean;
19
19
  noZero: boolean;
20
20
  noNegative: boolean;
21
+ center: boolean;
21
22
  private text;
22
23
  private setText;
23
24
  private isTyping;
package/dist/index.js CHANGED
@@ -241,7 +241,7 @@ let B = class extends HTMLElement {
241
241
  }
242
242
  };
243
243
  B.elementStyles = [], B.shadowRootOptions = { mode: "open" }, B[U("elementProperties")] = /* @__PURE__ */ new Map(), B[U("finalized")] = /* @__PURE__ */ new Map(), Ne?.({ ReactiveElement: B }), (Q.reactiveElementVersions ??= []).push("2.1.2");
244
- const Ue = { attribute: !0, type: String, converter: X, reflect: !1, hasChanged: re }, Le = (t = Ue, e, o) => {
244
+ const Ue = { attribute: !0, type: String, converter: X, reflect: !1, hasChanged: re }, Fe = (t = Ue, e, o) => {
245
245
  const { kind: s, metadata: r } = o;
246
246
  let i = globalThis.litPropertyMetadata.get(r);
247
247
  if (i === void 0 && globalThis.litPropertyMetadata.set(r, i = /* @__PURE__ */ new Map()), s === "setter" && ((t = Object.create(t)).wrapped = !0), i.set(o.name, t), s === "accessor") {
@@ -263,7 +263,7 @@ const Ue = { attribute: !0, type: String, converter: X, reflect: !1, hasChanged:
263
263
  throw Error("Unsupported decorator location: " + s);
264
264
  };
265
265
  function h(t) {
266
- return (e, o) => typeof o == "object" ? Le(t, e, o) : ((s, r, i) => {
266
+ return (e, o) => typeof o == "object" ? Fe(t, e, o) : ((s, r, i) => {
267
267
  const n = r.hasOwnProperty(i);
268
268
  return r.constructor.createProperty(i, s), n ? Object.getOwnPropertyDescriptor(r, i) : void 0;
269
269
  })(t, e, o);
@@ -271,9 +271,9 @@ function h(t) {
271
271
  function w(t) {
272
272
  return h({ ...t, state: !0, attribute: !1 });
273
273
  }
274
- const ie = globalThis, fe = (t) => t, G = ie.trustedTypes, be = G ? G.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, $e = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, xe = "?" + A, Fe = `<${xe}>`, P = document, L = () => P.createComment(""), F = (t) => t === null || typeof t != "object" && typeof t != "function", ne = Array.isArray, je = (t) => ne(t) || typeof t?.[Symbol.iterator] == "function", te = `[
274
+ const ie = globalThis, fe = (t) => t, G = ie.trustedTypes, be = G ? G.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, $e = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, xe = "?" + A, Le = `<${xe}>`, P = document, F = () => P.createComment(""), L = (t) => t === null || typeof t != "object" && typeof t != "function", ne = Array.isArray, ze = (t) => ne(t) || typeof t?.[Symbol.iterator] == "function", te = `[
275
275
  \f\r]`, N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, me = /-->/g, ge = />/g, S = RegExp(`>|${te}(?:([^\\s"'>=/]+)(${te}*=${te}*(?:[^
276
- \f\r"'\`<>=]|("|')|))|$)`, "g"), ve = /'/g, _e = /"/g, ke = /^(?:script|style|textarea|title)$/i, ze = (t) => (e, ...o) => ({ _$litType$: t, strings: e, values: o }), oe = ze(1), M = /* @__PURE__ */ Symbol.for("lit-noChange"), b = /* @__PURE__ */ Symbol.for("lit-nothing"), ye = /* @__PURE__ */ new WeakMap(), C = P.createTreeWalker(P, 129);
276
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), ve = /'/g, _e = /"/g, ke = /^(?:script|style|textarea|title)$/i, je = (t) => (e, ...o) => ({ _$litType$: t, strings: e, values: o }), oe = je(1), M = /* @__PURE__ */ Symbol.for("lit-noChange"), b = /* @__PURE__ */ Symbol.for("lit-nothing"), ye = /* @__PURE__ */ new WeakMap(), C = P.createTreeWalker(P, 129);
277
277
  function Ae(t, e) {
278
278
  if (!ne(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
279
279
  return be !== void 0 ? be.createHTML(e) : e;
@@ -286,17 +286,17 @@ const Ie = (t, e) => {
286
286
  let c, u, d = -1, $ = 0;
287
287
  for (; $ < a.length && (n.lastIndex = $, u = n.exec(a), u !== null); ) $ = n.lastIndex, n === N ? u[1] === "!--" ? n = me : u[1] !== void 0 ? n = ge : u[2] !== void 0 ? (ke.test(u[2]) && (r = RegExp("</" + u[2], "g")), n = S) : u[3] !== void 0 && (n = S) : n === S ? u[0] === ">" ? (n = r ?? N, 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] === '"' ? _e : ve) : n === _e || n === ve ? n = S : n === me || n === ge ? n = N : (n = S, r = void 0);
288
288
  const k = n === S && t[l + 1].startsWith("/>") ? " " : "";
289
- i += n === N ? a + Fe : d >= 0 ? (s.push(c), a.slice(0, d) + $e + a.slice(d) + A + k) : a + A + (d === -2 ? l : k);
289
+ i += n === N ? a + Le : d >= 0 ? (s.push(c), a.slice(0, d) + $e + a.slice(d) + A + k) : a + A + (d === -2 ? l : k);
290
290
  }
291
291
  return [Ae(t, i + (t[o] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
292
292
  };
293
- class j {
293
+ class z {
294
294
  constructor({ strings: e, _$litType$: o }, s) {
295
295
  let r;
296
296
  this.parts = [];
297
297
  let i = 0, n = 0;
298
298
  const l = e.length - 1, a = this.parts, [c, u] = Ie(e, o);
299
- if (this.el = j.createElement(c, s), C.currentNode = this.el.content, o === 2 || o === 3) {
299
+ if (this.el = z.createElement(c, s), C.currentNode = this.el.content, o === 2 || o === 3) {
300
300
  const d = this.el.content.firstChild;
301
301
  d.replaceWith(...d.childNodes);
302
302
  }
@@ -310,8 +310,8 @@ class j {
310
310
  const d = r.textContent.split(A), $ = d.length - 1;
311
311
  if ($ > 0) {
312
312
  r.textContent = G ? G.emptyScript : "";
313
- for (let k = 0; k < $; k++) r.append(d[k], L()), C.nextNode(), a.push({ type: 2, index: ++i });
314
- r.append(d[$], L());
313
+ for (let k = 0; k < $; k++) r.append(d[k], F()), C.nextNode(), a.push({ type: 2, index: ++i });
314
+ r.append(d[$], F());
315
315
  }
316
316
  }
317
317
  } else if (r.nodeType === 8) if (r.data === xe) a.push({ type: 2, index: i });
@@ -330,7 +330,7 @@ class j {
330
330
  function H(t, e, o = t, s) {
331
331
  if (e === M) return e;
332
332
  let r = s !== void 0 ? o._$Co?.[s] : o._$Cl;
333
- const i = F(e) ? void 0 : e._$litDirective$;
333
+ const i = L(e) ? void 0 : e._$litDirective$;
334
334
  return r?.constructor !== i && (r?._$AO?.(!1), i === void 0 ? r = void 0 : (r = new i(t), r._$AT(t, o, s)), s !== void 0 ? (o._$Co ??= [])[s] = r : o._$Cl = r), r !== void 0 && (e = H(t, r._$AS(t, e.values), r, s)), e;
335
335
  }
336
336
  class Re {
@@ -380,7 +380,7 @@ class q {
380
380
  return this._$AB;
381
381
  }
382
382
  _$AI(e, o = this) {
383
- e = H(this, e, o), F(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) : je(e) ? this.k(e) : this._(e);
383
+ e = H(this, e, o), L(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) : ze(e) ? this.k(e) : this._(e);
384
384
  }
385
385
  O(e) {
386
386
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -389,10 +389,10 @@ class q {
389
389
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
390
390
  }
391
391
  _(e) {
392
- this._$AH !== b && F(this._$AH) ? this._$AA.nextSibling.data = e : this.T(P.createTextNode(e)), this._$AH = e;
392
+ this._$AH !== b && L(this._$AH) ? this._$AA.nextSibling.data = e : this.T(P.createTextNode(e)), this._$AH = e;
393
393
  }
394
394
  $(e) {
395
- const { values: o, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = j.createElement(Ae(s.h, s.h[0]), this.options)), s);
395
+ const { values: o, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = z.createElement(Ae(s.h, s.h[0]), this.options)), s);
396
396
  if (this._$AH?._$AD === r) this._$AH.p(o);
397
397
  else {
398
398
  const i = new Re(r, this), n = i.u(this.options);
@@ -401,13 +401,13 @@ class q {
401
401
  }
402
402
  _$AC(e) {
403
403
  let o = ye.get(e.strings);
404
- return o === void 0 && ye.set(e.strings, o = new j(e)), o;
404
+ return o === void 0 && ye.set(e.strings, o = new z(e)), o;
405
405
  }
406
406
  k(e) {
407
407
  ne(this._$AH) || (this._$AH = [], this._$AR());
408
408
  const o = this._$AH;
409
409
  let s, r = 0;
410
- for (const i of e) r === o.length ? o.push(s = new q(this.O(L()), this.O(L()), this, this.options)) : s = o[r], s._$AI(i), r++;
410
+ for (const i of e) r === o.length ? o.push(s = new q(this.O(F()), this.O(F()), this, this.options)) : s = o[r], s._$AI(i), r++;
411
411
  r < o.length && (this._$AR(s && s._$AB.nextSibling, r), o.length = r);
412
412
  }
413
413
  _$AR(e = this._$AA.nextSibling, o) {
@@ -433,11 +433,11 @@ class ee {
433
433
  _$AI(e, o = this, s, r) {
434
434
  const i = this.strings;
435
435
  let n = !1;
436
- if (i === void 0) e = H(this, e, o, 0), n = !F(e) || e !== this._$AH && e !== M, n && (this._$AH = e);
436
+ if (i === void 0) e = H(this, e, o, 0), n = !L(e) || e !== this._$AH && e !== M, n && (this._$AH = e);
437
437
  else {
438
438
  const l = e;
439
439
  let a, c;
440
- for (e = i[0], a = 0; a < i.length - 1; a++) c = H(this, l[s + a], o, a), c === M && (c = this._$AH[a]), n ||= !F(c) || c !== this._$AH[a], c === b ? e = b : e !== b && (e += (c ?? "") + i[a + 1]), this._$AH[a] = c;
440
+ for (e = i[0], a = 0; a < i.length - 1; a++) c = H(this, l[s + a], o, a), c === M && (c = this._$AH[a]), n ||= !L(c) || c !== this._$AH[a], c === b ? e = b : e !== b && (e += (c ?? "") + i[a + 1]), this._$AH[a] = c;
441
441
  }
442
442
  n && !r && this.j(e);
443
443
  }
@@ -486,13 +486,13 @@ class Ze {
486
486
  }
487
487
  }
488
488
  const Ye = ie.litHtmlPolyfillSupport;
489
- Ye?.(j, q), (ie.litHtmlVersions ??= []).push("3.3.2");
489
+ Ye?.(z, q), (ie.litHtmlVersions ??= []).push("3.3.2");
490
490
  const Xe = (t, e, o) => {
491
491
  const s = o?.renderBefore ?? e;
492
492
  let r = s._$litPart$;
493
493
  if (r === void 0) {
494
494
  const i = o?.renderBefore ?? null;
495
- s._$litPart$ = r = new q(e.insertBefore(L(), i), i, void 0, o ?? {});
495
+ s._$litPart$ = r = new q(e.insertBefore(F(), i), i, void 0, o ?? {});
496
496
  }
497
497
  return r._$AI(t), r;
498
498
  };
@@ -529,7 +529,7 @@ var Qe = Object.defineProperty, et = Object.getOwnPropertyDescriptor, le = (t, e
529
529
  (n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
530
530
  return s && r && Qe(e, o, r), r;
531
531
  };
532
- let z = class extends V {
532
+ let j = class extends V {
533
533
  constructor() {
534
534
  super(...arguments), this.checked = !1, this.disabled = !1;
535
535
  }
@@ -553,16 +553,16 @@ let z = class extends V {
553
553
  });
554
554
  }
555
555
  };
556
- z.styles = [Je];
556
+ j.styles = [Je];
557
557
  le([
558
558
  h({ type: Boolean, reflect: !0 })
559
- ], z.prototype, "checked", 2);
559
+ ], j.prototype, "checked", 2);
560
560
  le([
561
561
  h({ type: Boolean, reflect: !0 })
562
- ], z.prototype, "disabled", 2);
563
- z = le([
562
+ ], j.prototype, "disabled", 2);
563
+ j = le([
564
564
  T("nf-checkbox")
565
- ], z);
565
+ ], j);
566
566
  const tt = { ATTRIBUTE: 1 }, ot = (t) => (...e) => ({ _$litDirective$: t, values: e });
567
567
  let st = class {
568
568
  constructor(e) {
@@ -1003,7 +1003,7 @@ O([
1003
1003
  x = O([
1004
1004
  T("nf-input")
1005
1005
  ], x);
1006
- const dt = E`: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}`;
1006
+ const dt = E`:host{width:10rem;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;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-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-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}`;
1007
1007
  var ut = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, m = (t, e, o, s) => {
1008
1008
  for (var r = s > 1 ? void 0 : s ? pt(e, o) : e, i = t.length - 1, n; i >= 0; i--)
1009
1009
  (n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
@@ -1011,12 +1011,20 @@ var ut = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, m = (t, e,
1011
1011
  };
1012
1012
  let p = class extends R {
1013
1013
  constructor() {
1014
- super(...arguments), this.value = 0, this.formatter = (t) => t === null ? "" : String(t), this.parser = (t) => {
1014
+ super(...arguments), this.value = 0, this.formatter = (t) => {
1015
+ if (t === null) return "";
1016
+ const e = String(t);
1017
+ return e.includes("e") ? t.toLocaleString("en", {
1018
+ useGrouping: !1,
1019
+ maximumFractionDigits: 20,
1020
+ minimumFractionDigits: 0
1021
+ }) : e;
1022
+ }, this.parser = (t) => {
1015
1023
  if (t.trim().length == 0 || t.endsWith("."))
1016
1024
  return null;
1017
1025
  const e = Number(t);
1018
1026
  return Number.isNaN(e) ? null : this.clampValue(e);
1019
- }, 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;
1027
+ }, 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.center = !1, this.text = "", this.isTyping = !1, this.isFocused = !1;
1020
1028
  }
1021
1029
  // 对解析结果进行额外验证
1022
1030
  validateParsed(t) {
@@ -1034,6 +1042,10 @@ let p = class extends R {
1034
1042
  }
1035
1043
  /* ================== 生命周期 ================== */
1036
1044
  willUpdate(t) {
1045
+ if (this.center && this.suffix && this.controls)
1046
+ throw new Error(
1047
+ "[nf-input-number] center 模式下不允许同时开启 suffix 和 controls,请关闭其中一个。"
1048
+ );
1037
1049
  t.has("value") && !this.isTyping && this.setText(this.formatter(this.value));
1038
1050
  }
1039
1051
  /* ================== 事件处理 ================== */
@@ -1099,7 +1111,7 @@ let p = class extends R {
1099
1111
  }
1100
1112
  /* ================== Render ================== */
1101
1113
  render() {
1102
- 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>` : ""}`;
1114
+ return f`<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 ? 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>` : ""}`;
1103
1115
  }
1104
1116
  };
1105
1117
  p.styles = [W, dt];
@@ -1121,6 +1133,7 @@ m([
1121
1133
  m([
1122
1134
  h({
1123
1135
  type: Boolean,
1136
+ reflect: !0,
1124
1137
  converter: {
1125
1138
  fromAttribute: (t) => t !== "false" && t !== null,
1126
1139
  toAttribute: (t) => t ? "" : null
@@ -1158,6 +1171,9 @@ m([
1158
1171
  m([
1159
1172
  h({ type: Boolean, attribute: "no-negative" })
1160
1173
  ], p.prototype, "noNegative", 2);
1174
+ m([
1175
+ h({ type: Boolean, reflect: !0 })
1176
+ ], p.prototype, "center", 2);
1161
1177
  m([
1162
1178
  w()
1163
1179
  ], p.prototype, "text", 2);
@@ -1418,7 +1434,7 @@ v = y([
1418
1434
  T("nf-slider")
1419
1435
  ], v);
1420
1436
  export {
1421
- z as NfCheckboxElement,
1437
+ j as NfCheckboxElement,
1422
1438
  g as NfColorPickerElement,
1423
1439
  x as NfInputElement,
1424
1440
  p as NfInputNumberElement,