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.
- package/README.md +1794 -1719
- package/dist/ui-lib.js +35 -18
- package/dist/ui-lib.umd.cjs +1 -1
- package/dist/utils/specForm.d.ts +1 -1
- package/package.json +54 -54
- package/src/components/BaseAlert.vue +104 -104
- package/src/components/BaseBarDistribution.test.ts +51 -51
- package/src/components/BaseBarDistribution.vue +73 -73
- package/src/components/BaseChipButton.vue +42 -42
- package/src/components/BaseCodeBlock.test.ts +70 -70
- package/src/components/BaseCodeBlock.vue +74 -74
- package/src/components/BaseCollapsibleSection.vue +113 -113
- package/src/components/BaseConfirmModal.vue +114 -114
- package/src/components/BaseCredentialsForm.test.ts +108 -108
- package/src/components/BaseCredentialsForm.vue +241 -241
- package/src/components/BaseDropdown.test.ts +87 -87
- package/src/components/BaseDropdown.vue +172 -172
- package/src/components/BaseEntityPickerModal.vue +330 -330
- package/src/components/BaseFileDropzone.vue +94 -94
- package/src/components/BaseFilterChip.test.ts +44 -44
- package/src/components/BaseFilterChip.vue +67 -67
- package/src/components/BaseModalShell.vue +209 -209
- package/src/components/BasePageHeader.vue +120 -120
- package/src/components/BasePillPickerModal.test.ts +95 -95
- package/src/components/BaseRemoveButton.vue +22 -22
- package/src/components/BaseSpecFields.test.ts +39 -0
- package/src/components/BaseSpecFields.vue +27 -3
- package/src/components/BaseStatBreakdown.test.ts +56 -56
- package/src/components/BaseStatBreakdown.vue +49 -49
- package/src/components/BaseStatusPill.vue +54 -54
- package/src/components/BaseTextInputModal.vue +140 -140
- package/src/components/BaseToolbarButton.test.ts +48 -48
- package/src/components/BaseToolbarButton.vue +94 -94
- package/src/composables/useFieldClasses.test.ts +55 -55
- package/src/composables/useFieldClasses.ts +56 -56
- package/src/composables/usePolling.test.ts +112 -112
- package/src/composables/usePolling.ts +102 -102
- package/src/composables/useQueryParamSync.test.ts +56 -56
- package/src/composables/useQueryParamSync.ts +42 -42
- package/src/composables/useThemeClasses.test.ts +34 -34
- package/src/composables/useThemeClasses.ts +137 -137
- package/src/index.ts +138 -138
- package/src/style.css +32 -32
- package/src/types/distribution.ts +7 -7
- package/src/types/pillPicker.ts +14 -14
- package/src/types/specField.ts +30 -30
- package/src/types/statBreakdown.ts +6 -6
- package/src/utils/format.test.ts +264 -264
- package/src/utils/format.ts +216 -216
- package/src/utils/httpColors.test.ts +100 -100
- package/src/utils/httpColors.ts +99 -99
- package/src/utils/kvRows.test.ts +47 -47
- package/src/utils/kvRows.ts +34 -34
- package/src/utils/specForm.test.ts +64 -53
- package/src/utils/specForm.ts +49 -48
- package/src/utils/validate.test.ts +82 -82
- 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
|
-
|
|
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,
|
|
2829
|
-
|
|
2830
|
-
|
|
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[
|
|
2833
|
-
"onUpdate:modelValue": (e) => r("update",
|
|
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(
|
|
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"])) :
|
|
2841
|
-
checked: !!t.params[
|
|
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(
|
|
2845
|
-
}, null, 40, Qr), s("span", $r, k(
|
|
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[
|
|
2858
|
+
modelValue: t.params[f.key],
|
|
2848
2859
|
type: "number",
|
|
2849
|
-
step:
|
|
2850
|
-
min:
|
|
2851
|
-
|
|
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
|
-
|
|
2859
|
-
E(n.$slots, "after", { spec:
|
|
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
|
}
|