mgv-backoffice 1.36.0 → 1.36.1

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.
Files changed (57) hide show
  1. package/README.md +1794 -1719
  2. package/dist/ui-lib.js +35 -18
  3. package/dist/ui-lib.umd.cjs +1 -1
  4. package/dist/utils/specForm.d.ts +1 -1
  5. package/package.json +54 -54
  6. package/src/components/BaseAlert.vue +104 -104
  7. package/src/components/BaseBarDistribution.test.ts +51 -51
  8. package/src/components/BaseBarDistribution.vue +73 -73
  9. package/src/components/BaseChipButton.vue +42 -42
  10. package/src/components/BaseCodeBlock.test.ts +70 -70
  11. package/src/components/BaseCodeBlock.vue +74 -74
  12. package/src/components/BaseCollapsibleSection.vue +113 -113
  13. package/src/components/BaseConfirmModal.vue +114 -114
  14. package/src/components/BaseCredentialsForm.test.ts +108 -108
  15. package/src/components/BaseCredentialsForm.vue +241 -241
  16. package/src/components/BaseDropdown.test.ts +87 -87
  17. package/src/components/BaseDropdown.vue +172 -172
  18. package/src/components/BaseEntityPickerModal.vue +330 -330
  19. package/src/components/BaseFileDropzone.vue +94 -94
  20. package/src/components/BaseFilterChip.test.ts +44 -44
  21. package/src/components/BaseFilterChip.vue +67 -67
  22. package/src/components/BaseModalShell.vue +209 -209
  23. package/src/components/BasePageHeader.vue +120 -120
  24. package/src/components/BasePillPickerModal.test.ts +95 -95
  25. package/src/components/BaseRemoveButton.vue +22 -22
  26. package/src/components/BaseSpecFields.test.ts +39 -0
  27. package/src/components/BaseSpecFields.vue +27 -3
  28. package/src/components/BaseStatBreakdown.test.ts +56 -56
  29. package/src/components/BaseStatBreakdown.vue +49 -49
  30. package/src/components/BaseStatusPill.vue +54 -54
  31. package/src/components/BaseTextInputModal.vue +140 -140
  32. package/src/components/BaseToolbarButton.test.ts +48 -48
  33. package/src/components/BaseToolbarButton.vue +94 -94
  34. package/src/composables/useFieldClasses.test.ts +55 -55
  35. package/src/composables/useFieldClasses.ts +56 -56
  36. package/src/composables/usePolling.test.ts +112 -112
  37. package/src/composables/usePolling.ts +102 -102
  38. package/src/composables/useQueryParamSync.test.ts +56 -56
  39. package/src/composables/useQueryParamSync.ts +42 -42
  40. package/src/composables/useThemeClasses.test.ts +34 -34
  41. package/src/composables/useThemeClasses.ts +137 -137
  42. package/src/index.ts +138 -138
  43. package/src/style.css +32 -32
  44. package/src/types/distribution.ts +7 -7
  45. package/src/types/pillPicker.ts +14 -14
  46. package/src/types/specField.ts +30 -30
  47. package/src/types/statBreakdown.ts +6 -6
  48. package/src/utils/format.test.ts +264 -264
  49. package/src/utils/format.ts +216 -216
  50. package/src/utils/httpColors.test.ts +100 -100
  51. package/src/utils/httpColors.ts +99 -99
  52. package/src/utils/kvRows.test.ts +47 -47
  53. package/src/utils/kvRows.ts +34 -34
  54. package/src/utils/specForm.test.ts +64 -53
  55. package/src/utils/specForm.ts +49 -48
  56. package/src/utils/validate.test.ts +82 -82
  57. package/src/utils/validate.ts +76 -76
package/dist/ui-lib.js CHANGED
@@ -2823,40 +2823,57 @@ var pn = ["aria-label", "aria-expanded"], mn = { class: "flex flex-col h-full" }
2823
2823
  }
2824
2824
  function l(e, t) {
2825
2825
  let n = parseFloat(t);
2826
- r("update", e, Number.isNaN(n) ? t : n);
2826
+ if (Number.isNaN(n)) {
2827
+ r("update", e.key, t);
2828
+ return;
2829
+ }
2830
+ r("update", e.key, e.type === "integer" ? Math.trunc(n) : n);
2831
+ }
2832
+ function u(e) {
2833
+ (e.key === "." || e.key === "," || e.key === "e" || e.key === "E") && e.preventDefault();
2834
+ }
2835
+ function d(e) {
2836
+ let t = e.clipboardData?.getData("text") ?? "";
2837
+ /^-?\d*$/.test(t.trim()) || e.preventDefault();
2827
2838
  }
2828
- return (n, u) => (x(), o("div", Jr, [(x(!0), o(e, null, T(t.specs, (u) => (x(), o("div", { key: u.key }, [
2829
- u.type === "boolean" ? a("", !0) : (x(), o("label", Yr, k(u.label), 1)),
2830
- u.type === "select" ? (x(), i(Mr, {
2839
+ return (n, f) => (x(), o("div", Jr, [(x(!0), o(e, null, T(t.specs, (f) => (x(), o("div", { key: f.key }, [
2840
+ f.type === "boolean" ? a("", !0) : (x(), o("label", Yr, k(f.label), 1)),
2841
+ f.type === "select" ? (x(), i(Mr, {
2831
2842
  key: 1,
2832
- modelValue: String(t.params[u.key] ?? ""),
2833
- "onUpdate:modelValue": (e) => r("update", u.key, e)
2843
+ modelValue: String(t.params[f.key] ?? ""),
2844
+ "onUpdate:modelValue": (e) => r("update", f.key, e)
2834
2845
  }, {
2835
- default: F(() => [(x(!0), o(e, null, T(u.options ?? [], (e) => (x(), o("option", {
2846
+ default: F(() => [(x(!0), o(e, null, T(f.options ?? [], (e) => (x(), o("option", {
2836
2847
  key: e,
2837
2848
  value: e
2838
2849
  }, k(e), 9, Xr))), 128))]),
2839
2850
  _: 2
2840
- }, 1032, ["modelValue", "onUpdate:modelValue"])) : u.type === "boolean" ? (x(), o("label", Zr, [s("input", {
2841
- checked: !!t.params[u.key],
2851
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : f.type === "boolean" ? (x(), o("label", Zr, [s("input", {
2852
+ checked: !!t.params[f.key],
2842
2853
  type: "checkbox",
2843
2854
  class: "h-4 w-4",
2844
- onChange: (e) => c(u.key, e)
2845
- }, null, 40, Qr), s("span", $r, k(u.label), 1)])) : (x(), i(Q, {
2855
+ onChange: (e) => c(f.key, e)
2856
+ }, null, 40, Qr), s("span", $r, k(f.label), 1)])) : (x(), i(Q, {
2846
2857
  key: 3,
2847
- modelValue: t.params[u.key],
2858
+ modelValue: t.params[f.key],
2848
2859
  type: "number",
2849
- step: u.step ?? (u.type === "integer" ? 1 : .01),
2850
- min: u.min ?? void 0,
2851
- "onUpdate:modelValue": (e) => l(u.key, e)
2860
+ step: f.step ?? (f.type === "integer" ? 1 : .01),
2861
+ min: f.min ?? void 0,
2862
+ inputmode: f.type === "integer" ? "numeric" : void 0,
2863
+ onKeydown: (e) => f.type === "integer" && u(e),
2864
+ onPaste: (e) => f.type === "integer" && d(e),
2865
+ "onUpdate:modelValue": (e) => l(f, e)
2852
2866
  }, null, 8, [
2853
2867
  "modelValue",
2854
2868
  "step",
2855
2869
  "min",
2870
+ "inputmode",
2871
+ "onKeydown",
2872
+ "onPaste",
2856
2873
  "onUpdate:modelValue"
2857
2874
  ])),
2858
- u.help ? (x(), o("p", ei, k(u.help), 1)) : a("", !0),
2859
- E(n.$slots, "after", { spec: u })
2875
+ f.help ? (x(), o("p", ei, k(f.help), 1)) : a("", !0),
2876
+ E(n.$slots, "after", { spec: f })
2860
2877
  ]))), 128))]));
2861
2878
  }
2862
2879
  }), ni = { class: "mt-1.5 space-y-0.5 px-1" }, ri = { class: "text-slate-400 dark:text-slate-500" }, ii = /* @__PURE__ */ f({
@@ -3631,7 +3648,7 @@ function ka(e, t) {
3631
3648
  for (let n of e) if (n.type === "decimal" || n.type === "integer") {
3632
3649
  let e = t[n.key], r = e === "" || e == null;
3633
3650
  if (n.default === null && r) continue;
3634
- if (typeof e != "number" || Number.isNaN(e)) return n.label;
3651
+ if (typeof e != "number" || Number.isNaN(e) || n.type === "integer" && !Number.isInteger(e)) return n.label;
3635
3652
  }
3636
3653
  return null;
3637
3654
  }