@nebularstreams/libmui 2.5.108 → 2.5.110

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nebularstreams/libmui",
3
3
  "description": "Micro UI based on Mithril",
4
- "version": "2.5.108",
4
+ "version": "2.5.110",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
@@ -196,6 +196,12 @@ const
196
196
  }
197
197
  }
198
198
  },
199
+ onbeforeinput: (e) => {
200
+ if (attrs.subtype === "number" && e.data && !/^[0-9.]$/.test(e.data)) {
201
+ e.preventDefault(); // nothing but 0-9 or “.” gets through
202
+ }
203
+ },
204
+ inputmode: attrs.subtype === "number" ? "decimal" : undefined, // nicer mobile keyboard
199
205
  onkeypress: (event) => {
200
206
  if (!state.showInput && event.key === "Enter") {
201
207
  attrs.onenter && attrs.onenter(event.target.value, event);
@@ -589,6 +589,7 @@ const
589
589
  label: metaDef.label,
590
590
  hint: isObj ? metaDef.hint : metaDef,
591
591
  title: metaDef.title,
592
+ subtype: "number",
592
593
  ...metaDef.final && {
593
594
  oninput: () => {
594
595
  }
@@ -629,7 +630,7 @@ const
629
630
  global,
630
631
  value: rawValue, // metaDef.values ? metaDef.values[parameters[metaKey].id] : parameters[metaKey],
631
632
  confirm: metaDef.confirm,
632
- class: "grows font-125 " + (metaDef.containerClass || "scaff scaff-b1"),
633
+ class: "grows " + (metaDef.containerClass || "scaff scaff-b1"),
633
634
  buttonClass: (metaDef.buttonClass || "unitheight scaff-left"),
634
635
  readonly: metaDef.readOnly,
635
636
  closeClass: metaDef.closeClass,
@@ -777,7 +778,7 @@ const
777
778
  class: "grows " + (metaDef.class || "accentbutton unitheight"),
778
779
  text: metaDef.label === ""
779
780
  ? null
780
- : metaDef.label || metaDef.text || metaKey,
781
+ : metaDef.parse ? metaDef.parse(targetParameters, auxParameters) : metaDef.label || metaDef.text || metaKey,
781
782
  icon: metaDef.icon,
782
783
  title: metaDef.title || metaDef.hint,
783
784
  onClick: (e) => {