monobill-mintui 0.6.704 → 0.6.705
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/form/Form.d.ts +1 -0
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/form/browser.js +18 -3
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +18 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +18 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9152,8 +9152,8 @@ var Vn = class extends HTMLElement {
|
|
|
9152
9152
|
if (r.length > 0 && r.length === e.length) return r.filter((e) => e.checked === void 0 ? e.hasAttribute("checked") : e.checked).map((e) => e.getAttribute("value") || "on");
|
|
9153
9153
|
}
|
|
9154
9154
|
let n = e[0];
|
|
9155
|
-
if (n instanceof HTMLInputElement) return n.type === "file" ? n.files : n.type === "checkbox" || n.type === "radio" ? n.checked ? n.value || "on" : "" : n.value;
|
|
9156
|
-
if (n instanceof HTMLTextAreaElement) return n.value;
|
|
9155
|
+
if (n instanceof HTMLInputElement) return n.type === "file" ? n.files : n.type === "checkbox" || n.type === "radio" ? n.checked ? n.value || "on" : "" : this._normalizeInputValue(n.value, n.type);
|
|
9156
|
+
if (n instanceof HTMLTextAreaElement) return String(n.value);
|
|
9157
9157
|
if (n.tagName === "MINT-SELECT") {
|
|
9158
9158
|
let e = n.querySelector("select");
|
|
9159
9159
|
if (e) return e.multiple ? Array.from(e.selectedOptions).map((e) => e.value) : e.value;
|
|
@@ -9168,7 +9168,22 @@ var Vn = class extends HTMLElement {
|
|
|
9168
9168
|
let e = null;
|
|
9169
9169
|
return n.tags === void 0 ? typeof n.getTags == "function" && (e = n.getTags()) : e = n.tags, Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : e?.value || e?.label || "").filter((e) => e.trim() !== "") : [];
|
|
9170
9170
|
}
|
|
9171
|
-
|
|
9171
|
+
if (n.tagName === "MINT-CHECKBOX" || n.tagName === "MINT-SWITCH") return !!(n.checked === void 0 ? n.hasAttribute("checked") : n.checked);
|
|
9172
|
+
if (n.tagName === "MINT-CHOICE") return (typeof n.getValue == "function" ? n.getValue() : "") || "";
|
|
9173
|
+
if (n.tagName === "MINT-INPUT") {
|
|
9174
|
+
let e = typeof n.getType == "function" ? n.getType() : n.getAttribute("type") || "text", t = typeof n.getValue == "function" ? n.getValue() : n.value;
|
|
9175
|
+
return this._normalizeInputValue(t, e);
|
|
9176
|
+
}
|
|
9177
|
+
return n.value === void 0 ? n.getAttribute("value") || "" : n.value;
|
|
9178
|
+
}
|
|
9179
|
+
_normalizeInputValue(e, t) {
|
|
9180
|
+
if (e == null) return "";
|
|
9181
|
+
if (t === "number" || t === "range") {
|
|
9182
|
+
if (e === "") return "";
|
|
9183
|
+
let t = typeof e == "number" ? e : Number(e);
|
|
9184
|
+
return Number.isFinite(t) ? t : "";
|
|
9185
|
+
}
|
|
9186
|
+
return String(e);
|
|
9172
9187
|
}
|
|
9173
9188
|
_flagFieldError(e, t) {
|
|
9174
9189
|
e.length !== 0 && e.forEach((e) => {
|