@vehiclehistory/property-lib 0.0.31 → 0.0.33
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/main.js
CHANGED
|
@@ -612,7 +612,7 @@ const F = {
|
|
|
612
612
|
) }),
|
|
613
613
|
/* @__PURE__ */ g("div", { className: "ml-3", children: [
|
|
614
614
|
/* @__PURE__ */ o("div", { className: m("font-medium text-sm", n), children: a }),
|
|
615
|
-
t.length > 0 ? /* @__PURE__ */ o("div", { className: "mt-2 text-xs", children: /* @__PURE__ */ o("ul", { role: "list", className: "list-disc space-y-1 pl-5", children: t.map((u,
|
|
615
|
+
t.length > 0 ? /* @__PURE__ */ o("div", { className: "mt-2 text-xs", children: /* @__PURE__ */ o("ul", { role: "list", className: "list-disc space-y-1 pl-5", children: t.map((u, V) => /* @__PURE__ */ o("li", { children: u }, V)) }) }) : ""
|
|
616
616
|
] })
|
|
617
617
|
] })
|
|
618
618
|
}
|
|
@@ -630,12 +630,12 @@ const F = {
|
|
|
630
630
|
mobileBackdrop: c = !1,
|
|
631
631
|
showSearchIcon: d = !0,
|
|
632
632
|
options: u = [],
|
|
633
|
-
name:
|
|
633
|
+
name: V = "",
|
|
634
634
|
placeholder: M = "",
|
|
635
635
|
props: A = {},
|
|
636
636
|
size: C = "medium",
|
|
637
637
|
styles: p = null,
|
|
638
|
-
title:
|
|
638
|
+
title: H = ""
|
|
639
639
|
}) => /* @__PURE__ */ g(
|
|
640
640
|
"div",
|
|
641
641
|
{
|
|
@@ -697,7 +697,7 @@ const F = {
|
|
|
697
697
|
value: a,
|
|
698
698
|
placeholder: !M && r ? " " : M,
|
|
699
699
|
type: "search",
|
|
700
|
-
name:
|
|
700
|
+
name: V || "search-input",
|
|
701
701
|
"data-id": "search-input",
|
|
702
702
|
...A
|
|
703
703
|
}
|
|
@@ -761,7 +761,7 @@ const F = {
|
|
|
761
761
|
{
|
|
762
762
|
"data-id": "search-dropdown-body",
|
|
763
763
|
role: "listbox",
|
|
764
|
-
"data-title":
|
|
764
|
+
"data-title": H,
|
|
765
765
|
"aria-labelledby": "Label",
|
|
766
766
|
"aria-activedescendant": "search-item-0",
|
|
767
767
|
children: u.length > 0 ? u.map((w, v) => /* @__PURE__ */ o(
|
|
@@ -815,7 +815,7 @@ const F = {
|
|
|
815
815
|
rightIconProps: c = {},
|
|
816
816
|
rounded: d = !1,
|
|
817
817
|
size: u = "md",
|
|
818
|
-
type:
|
|
818
|
+
type: V = "button",
|
|
819
819
|
uppercase: M = !1,
|
|
820
820
|
variation: A = "primary"
|
|
821
821
|
}) => {
|
|
@@ -823,7 +823,7 @@ const F = {
|
|
|
823
823
|
return /* @__PURE__ */ g(
|
|
824
824
|
C,
|
|
825
825
|
{
|
|
826
|
-
type: C !== "a" ?
|
|
826
|
+
type: C !== "a" ? V : null,
|
|
827
827
|
className: m(
|
|
828
828
|
"Button",
|
|
829
829
|
{
|
|
@@ -894,32 +894,37 @@ const F = {
|
|
|
894
894
|
children: e,
|
|
895
895
|
className: t = "",
|
|
896
896
|
error: a = !1,
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
897
|
+
inputClass: n,
|
|
898
|
+
id: l = "",
|
|
899
|
+
label: r = "",
|
|
900
|
+
name: s = "",
|
|
901
|
+
props: i = {},
|
|
902
|
+
variation: c = "primary",
|
|
903
|
+
value: d = ""
|
|
903
904
|
}) => {
|
|
904
|
-
const
|
|
905
|
+
const u = r ? "div" : "label", V = u === "label" ? { htmlFor: l } : {};
|
|
905
906
|
return /* @__PURE__ */ g(
|
|
906
|
-
|
|
907
|
+
u,
|
|
907
908
|
{
|
|
908
|
-
className: m("checkbox flex items-center",
|
|
909
|
-
...
|
|
909
|
+
className: m("checkbox flex items-center", c, t),
|
|
910
|
+
...V,
|
|
910
911
|
children: [
|
|
911
912
|
/* @__PURE__ */ o(
|
|
912
913
|
"input",
|
|
913
914
|
{
|
|
914
915
|
checked: h,
|
|
915
|
-
className: m(
|
|
916
|
-
"
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
916
|
+
className: m(
|
|
917
|
+
"form-checkbox ",
|
|
918
|
+
{
|
|
919
|
+
"!border-red-500 !bg-red-500 focus:!ring-red-500 focus:!border-red-500": a
|
|
920
|
+
},
|
|
921
|
+
n
|
|
922
|
+
),
|
|
923
|
+
id: l,
|
|
924
|
+
name: s,
|
|
920
925
|
type: "checkbox",
|
|
921
|
-
value:
|
|
922
|
-
...
|
|
926
|
+
value: d,
|
|
927
|
+
...i
|
|
923
928
|
}
|
|
924
929
|
),
|
|
925
930
|
e
|
|
@@ -965,7 +970,7 @@ const F = {
|
|
|
965
970
|
hideClose: c = !1,
|
|
966
971
|
iconSize: d = "medium",
|
|
967
972
|
preventPageScroll: u = !0,
|
|
968
|
-
stickyHeader:
|
|
973
|
+
stickyHeader: V = !1,
|
|
969
974
|
title: M = "",
|
|
970
975
|
titleClass: A = ""
|
|
971
976
|
}) => /* @__PURE__ */ g(z, { children: [
|
|
@@ -991,7 +996,7 @@ const F = {
|
|
|
991
996
|
className: m(
|
|
992
997
|
"dialog-header flex items-center p-4",
|
|
993
998
|
{
|
|
994
|
-
"sticky top-0 bg-white z-10":
|
|
999
|
+
"sticky top-0 bg-white z-10": V,
|
|
995
1000
|
"!pb-0 border-0 justify-end": !M,
|
|
996
1001
|
"justify-between border-b": M
|
|
997
1002
|
},
|
|
@@ -1045,36 +1050,36 @@ const F = {
|
|
|
1045
1050
|
headerClass: c = "",
|
|
1046
1051
|
hideClose: d = !1,
|
|
1047
1052
|
iconSize: u = "medium",
|
|
1048
|
-
isOpen:
|
|
1053
|
+
isOpen: V = !1,
|
|
1049
1054
|
setDialogOpen: M,
|
|
1050
1055
|
stickyHeader: A = !1,
|
|
1051
1056
|
title: C = "",
|
|
1052
1057
|
titleClass: p = ""
|
|
1053
1058
|
}) => {
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1059
|
+
const H = I(null), w = async () => {
|
|
1060
|
+
H.current.classList.add("closing"), await B(H.current), H.current.classList.remove("closing"), l && l(), M(!1);
|
|
1056
1061
|
}, v = async (x) => {
|
|
1057
1062
|
x.key === "Escape" && await w();
|
|
1058
1063
|
}, N = async ({ clientX: x, clientY: S, target: D }) => {
|
|
1059
|
-
const { left: E, right: T, top: $, bottom: O } =
|
|
1060
|
-
(!
|
|
1064
|
+
const { left: E, right: T, top: $, bottom: O } = H.current.getBoundingClientRect() ?? {};
|
|
1065
|
+
(!H.current.contains(D) || x < E || x > T || S < $ || S > O) && await w();
|
|
1061
1066
|
}, B = (x) => Promise.allSettled(
|
|
1062
1067
|
x.getAnimations().map((S) => S.finished)
|
|
1063
1068
|
);
|
|
1064
1069
|
return k(() => {
|
|
1065
|
-
const x =
|
|
1066
|
-
x && (
|
|
1067
|
-
}, [
|
|
1070
|
+
const x = H.current;
|
|
1071
|
+
x && (V ? x.showModal() : typeof x.close == "function" && x.close());
|
|
1072
|
+
}, [V]), /* @__PURE__ */ g(z, { children: [
|
|
1068
1073
|
h && /* @__PURE__ */ o("span", { id: `${e}-dialog-activator`, onClick: () => M(!0), children: h }),
|
|
1069
1074
|
/* @__PURE__ */ g(
|
|
1070
1075
|
"dialog",
|
|
1071
1076
|
{
|
|
1072
|
-
ref:
|
|
1077
|
+
ref: H,
|
|
1073
1078
|
id: `${e}-dialog`,
|
|
1074
1079
|
className: m(
|
|
1075
1080
|
"dialog",
|
|
1076
1081
|
{
|
|
1077
|
-
hidden: !
|
|
1082
|
+
hidden: !V,
|
|
1078
1083
|
"xs-max:h-full xs-max:max-h-full": i
|
|
1079
1084
|
},
|
|
1080
1085
|
a
|
|
@@ -1153,14 +1158,14 @@ const F = {
|
|
|
1153
1158
|
const s = document.querySelector(".loading-bar__inner");
|
|
1154
1159
|
if (!s) return;
|
|
1155
1160
|
let i, c, d = !1;
|
|
1156
|
-
function u(
|
|
1157
|
-
i === void 0 && (i =
|
|
1158
|
-
const M =
|
|
1159
|
-
if (c !==
|
|
1161
|
+
function u(V) {
|
|
1162
|
+
i === void 0 && (i = V);
|
|
1163
|
+
const M = V - i;
|
|
1164
|
+
if (c !== V) {
|
|
1160
1165
|
const A = M / a * 101;
|
|
1161
|
-
s.style.width = `${A}%`, A >= 101 && (r && r(), d = !0, window.cancelAnimationFrame(
|
|
1166
|
+
s.style.width = `${A}%`, A >= 101 && (r && r(), d = !0, window.cancelAnimationFrame(V));
|
|
1162
1167
|
}
|
|
1163
|
-
M < a && (c =
|
|
1168
|
+
M < a && (c = V, d || window.requestAnimationFrame(u));
|
|
1164
1169
|
}
|
|
1165
1170
|
window.requestAnimationFrame(u);
|
|
1166
1171
|
}
|
|
@@ -1257,8 +1262,8 @@ const F = {
|
|
|
1257
1262
|
}) => {
|
|
1258
1263
|
const c = ((d, u) => {
|
|
1259
1264
|
if (d) {
|
|
1260
|
-
const
|
|
1261
|
-
return
|
|
1265
|
+
const V = Number(u) / d;
|
|
1266
|
+
return V > 1 ? 100 : V * 100;
|
|
1262
1267
|
}
|
|
1263
1268
|
return n;
|
|
1264
1269
|
})(l, n);
|
|
@@ -1340,14 +1345,14 @@ const F = {
|
|
|
1340
1345
|
props: c = {},
|
|
1341
1346
|
selectClass: d = "",
|
|
1342
1347
|
styles: u = null,
|
|
1343
|
-
variation:
|
|
1348
|
+
variation: V = "primary",
|
|
1344
1349
|
value: M
|
|
1345
1350
|
}) => {
|
|
1346
1351
|
const A = i ? { defaultValue: "" } : {};
|
|
1347
1352
|
return /* @__PURE__ */ g(
|
|
1348
1353
|
"label",
|
|
1349
1354
|
{
|
|
1350
|
-
className: m("relative select", e,
|
|
1355
|
+
className: m("relative select", e, V),
|
|
1351
1356
|
style: u ? { ...u } : null,
|
|
1352
1357
|
children: [
|
|
1353
1358
|
l,
|
|
@@ -1503,7 +1508,7 @@ const F = {
|
|
|
1503
1508
|
props: c = {},
|
|
1504
1509
|
styles: d = null,
|
|
1505
1510
|
type: u = "text",
|
|
1506
|
-
value:
|
|
1511
|
+
value: V,
|
|
1507
1512
|
variation: M = "primary"
|
|
1508
1513
|
}) => /* @__PURE__ */ g(
|
|
1509
1514
|
"div",
|
|
@@ -1527,7 +1532,7 @@ const F = {
|
|
|
1527
1532
|
id: l,
|
|
1528
1533
|
name: s,
|
|
1529
1534
|
type: u,
|
|
1530
|
-
value:
|
|
1535
|
+
value: V,
|
|
1531
1536
|
autoComplete: "off",
|
|
1532
1537
|
className: m(
|
|
1533
1538
|
"form-input",
|
|
@@ -1774,15 +1779,15 @@ class f {
|
|
|
1774
1779
|
if ((i = window == null ? void 0 : window.options) != null && i.isPdf)
|
|
1775
1780
|
return r;
|
|
1776
1781
|
try {
|
|
1777
|
-
const d = await (await fetch("/api/headers")).json(), u = (d == null ? void 0 : d.token) ?? null,
|
|
1782
|
+
const d = await (await fetch("/api/headers")).json(), u = (d == null ? void 0 : d.token) ?? null, V = (d == null ? void 0 : d.ip) ?? null;
|
|
1778
1783
|
return localStorage.setItem(
|
|
1779
1784
|
"headerTolken",
|
|
1780
1785
|
JSON.stringify({
|
|
1781
1786
|
tolken: u,
|
|
1782
|
-
ip:
|
|
1787
|
+
ip: V,
|
|
1783
1788
|
expire: (/* @__PURE__ */ new Date()).getTime() + e * 1e3
|
|
1784
1789
|
})
|
|
1785
|
-
), { tolken: u, ip:
|
|
1790
|
+
), { tolken: u, ip: V, userAgent: t, platform: l };
|
|
1786
1791
|
} catch (c) {
|
|
1787
1792
|
console.error("getHeaders", c);
|
|
1788
1793
|
}
|
|
@@ -2009,13 +2014,20 @@ class f {
|
|
|
2009
2014
|
onClose: n = null,
|
|
2010
2015
|
disableOutsideClick: l = !1
|
|
2011
2016
|
}) {
|
|
2012
|
-
const r = e ? document.querySelectorAll(e) : [], s = document.getElementById(t + "-dialog"), i = document.querySelectorAll("[data-dialog-close]"), c = [
|
|
2013
|
-
|
|
2017
|
+
const r = e ? document.querySelectorAll(e) : [], s = document.getElementById(t + "-dialog"), i = document.querySelectorAll("[data-dialog-close]"), c = [
|
|
2018
|
+
"closing",
|
|
2019
|
+
"closed",
|
|
2020
|
+
"opening",
|
|
2021
|
+
"opened",
|
|
2022
|
+
"outside",
|
|
2023
|
+
"removed"
|
|
2024
|
+
].reduce(
|
|
2025
|
+
(p, H) => ({
|
|
2014
2026
|
...p,
|
|
2015
|
-
[
|
|
2027
|
+
[H]: new Event(H)
|
|
2016
2028
|
}),
|
|
2017
2029
|
{}
|
|
2018
|
-
), d = new MutationObserver((p,
|
|
2030
|
+
), d = new MutationObserver((p, H) => {
|
|
2019
2031
|
p.forEach(async (w) => {
|
|
2020
2032
|
if (w.attributeName === "open") {
|
|
2021
2033
|
const v = w.target;
|
|
@@ -2023,7 +2035,7 @@ class f {
|
|
|
2023
2035
|
v == null || v.removeAttribute("inert"), v == null || v.dispatchEvent(c.opening), v && await C(v), v == null || v.dispatchEvent(c.opened);
|
|
2024
2036
|
}
|
|
2025
2037
|
});
|
|
2026
|
-
}), u = new MutationObserver((p,
|
|
2038
|
+
}), u = new MutationObserver((p, H) => {
|
|
2027
2039
|
p.forEach((w) => {
|
|
2028
2040
|
w.removedNodes.forEach((v) => {
|
|
2029
2041
|
v.nodeName === "DIALOG" && (v.removeEventListener("click", A), v.removeEventListener("close", M), v.dispatchEvent(c.removed), u == null || u.disconnect(), d == null || d.disconnect());
|
|
@@ -2037,27 +2049,27 @@ class f {
|
|
|
2037
2049
|
subtree: !1,
|
|
2038
2050
|
childList: !0
|
|
2039
2051
|
}));
|
|
2040
|
-
const
|
|
2052
|
+
const V = () => {
|
|
2041
2053
|
s == null || s.showModal();
|
|
2042
2054
|
}, M = async ({ target: p }) => {
|
|
2043
2055
|
p == null || p.classList.add("closing"), p == null || p.setAttribute("inert", ""), p == null || p.dispatchEvent(c.closing), p && await C(p), p == null || p.classList.remove("closing"), p == null || p.dispatchEvent(c.closed);
|
|
2044
2056
|
}, A = async ({ target: p }) => {
|
|
2045
|
-
(p == null ? void 0 : p.nodeName) === "DIALOG" && (s == null || s.close("outside"));
|
|
2057
|
+
(p == null ? void 0 : p.nodeName) === "DIALOG" && (p == null || p.dispatchEvent(c.outside), s == null || s.close("outside"));
|
|
2046
2058
|
}, C = (p) => Promise.allSettled(
|
|
2047
|
-
p == null ? void 0 : p.getAnimations().map((
|
|
2059
|
+
p == null ? void 0 : p.getAnimations().map((H) => H == null ? void 0 : H.finished)
|
|
2048
2060
|
);
|
|
2049
2061
|
return !l && (s == null || s.addEventListener("click", A)), s == null || s.addEventListener("close", M), r == null || r.forEach((p) => {
|
|
2050
|
-
p.addEventListener("click", (
|
|
2051
|
-
|
|
2062
|
+
p.addEventListener("click", (H) => {
|
|
2063
|
+
V(), a && a(H, s);
|
|
2052
2064
|
});
|
|
2053
2065
|
}), i == null || i.forEach((p) => {
|
|
2054
|
-
p.addEventListener("click", async (
|
|
2055
|
-
s == null || s.close("close"), n && n(
|
|
2066
|
+
p.addEventListener("click", async (H) => {
|
|
2067
|
+
s == null || s.close("close"), n && n(H, s);
|
|
2056
2068
|
});
|
|
2057
2069
|
}), {
|
|
2058
2070
|
activators: r,
|
|
2059
2071
|
ref: s,
|
|
2060
|
-
handleOpen:
|
|
2072
|
+
handleOpen: V,
|
|
2061
2073
|
handleClose: M
|
|
2062
2074
|
};
|
|
2063
2075
|
}
|
|
@@ -2212,11 +2224,11 @@ class f {
|
|
|
2212
2224
|
state: c = null,
|
|
2213
2225
|
vin: d = null,
|
|
2214
2226
|
license: u = null,
|
|
2215
|
-
token:
|
|
2227
|
+
token: V = null,
|
|
2216
2228
|
phone: M = null
|
|
2217
2229
|
} = e || {}, A = t && t !== "", C = r && r !== "" && r !== "18", p = s && s !== "" && r !== "99";
|
|
2218
|
-
let
|
|
2219
|
-
return t && t !== "" &&
|
|
2230
|
+
let H = [];
|
|
2231
|
+
return t && t !== "" && H.push("name=" + t), A || (a && a !== "" && H.push("first=" + a), n && n !== "" && H.push("middle=" + n), l && l !== "" && H.push("last=" + l)), C && p ? parseInt(r) > parseInt(s) ? (H.push("min=" + s), H.push("max=" + r)) : (H.push("min=" + r), H.push("max=" + s)) : (C && H.push("min=" + r), p && H.push("max=" + s)), M && M !== "" && H.push("phone=" + M), i && i !== "" && H.push("city=" + i), u && u !== "" && H.push("license=" + u), d && d !== "" && H.push("vin=" + d), c && c !== "" && H.push("state=" + c), V && V !== "" && H.push("token=" + V), H.join("&");
|
|
2220
2232
|
}
|
|
2221
2233
|
static padTo2Digits(e) {
|
|
2222
2234
|
return e.toString().padStart(2, "0");
|
|
@@ -2233,7 +2245,7 @@ class f {
|
|
|
2233
2245
|
useSearch: r = !1,
|
|
2234
2246
|
useLocation: s = !0,
|
|
2235
2247
|
state: i = ""
|
|
2236
|
-
} = t ?? {}, { tolken: c = null, ip: d = null } = await f.getHeaders(),
|
|
2248
|
+
} = t ?? {}, { tolken: c = null, ip: d = null } = await f.getHeaders(), V = [
|
|
2237
2249
|
"query=" + encodeURIComponent(this.cleanupAddress(e)),
|
|
2238
2250
|
"addressesOnly=" + a,
|
|
2239
2251
|
"useSearch=" + r,
|
|
@@ -2241,8 +2253,8 @@ class f {
|
|
|
2241
2253
|
"useCityStateSearch=" + l,
|
|
2242
2254
|
"useLocation=" + s
|
|
2243
2255
|
];
|
|
2244
|
-
i && i !== "" && !l &&
|
|
2245
|
-
const M =
|
|
2256
|
+
i && i !== "" && !l && V.push("state=" + i), c && c !== "" && V.push("tolken=" + c), d && d !== "" && V.push("ip=" + d);
|
|
2257
|
+
const M = V.join("&"), C = (n || l ? "/api/autocomplete-city" : "/api/autocomplete") + "?" + M;
|
|
2246
2258
|
return await f.makeSearchFetchCall(C);
|
|
2247
2259
|
}
|
|
2248
2260
|
static removeElements(e) {
|
package/package.json
CHANGED