@televet/kibble-ui 4.0.0-beta.110 → 4.0.0-beta.112
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/chunks/alert.types-CEvBY7aM.js +2 -0
- package/dist/chunks/alert.types-CEvBY7aM.js.map +1 -0
- package/dist/chunks/alert.types-D7zIiGeb.js +139 -0
- package/dist/chunks/alert.types-D7zIiGeb.js.map +1 -0
- package/dist/chunks/{datePicker.component-DCtuIpuZ.js → datePicker.component--6-jJXIm.js} +3 -3
- package/dist/chunks/{datePicker.component-DCtuIpuZ.js.map → datePicker.component--6-jJXIm.js.map} +1 -1
- package/dist/chunks/{datePicker.component-DPTXomfM.js → datePicker.component-B6RVRikg.js} +3 -3
- package/dist/chunks/{datePicker.component-DPTXomfM.js.map → datePicker.component-B6RVRikg.js.map} +1 -1
- package/dist/chunks/{grid-item-BV4dwEBP.js → grid-item-BBt_-NiB.js} +18 -17
- package/dist/chunks/grid-item-BBt_-NiB.js.map +1 -0
- package/dist/chunks/grid-item-BfAkrDSq.js +2 -0
- package/dist/chunks/grid-item-BfAkrDSq.js.map +1 -0
- package/dist/chunks/{index-CYHDITxm.js → index-BXFjoQqm.js} +275 -275
- package/dist/chunks/{index-CYHDITxm.js.map → index-BXFjoQqm.js.map} +1 -1
- package/dist/chunks/{index-ClcMgyeA.js → index-DLX5_Po7.js} +3 -3
- package/dist/chunks/{index-ClcMgyeA.js.map → index-DLX5_Po7.js.map} +1 -1
- package/dist/chunks/{theme.provider-CQpr47CB.js → theme.provider-Bg1iY5Ff.js} +2 -2
- package/dist/chunks/{theme.provider-CQpr47CB.js.map → theme.provider-Bg1iY5Ff.js.map} +1 -1
- package/dist/chunks/{theme.provider-DODDzvWC.js → theme.provider-C0rvywmv.js} +2 -2
- package/dist/chunks/{theme.provider-DODDzvWC.js.map → theme.provider-C0rvywmv.js.map} +1 -1
- package/dist/cjs/chakra/index.cjs +1 -1
- package/dist/cjs/chakra/index.cjs.map +1 -1
- package/dist/cjs/components/Alert/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/index.cjs +1 -1
- package/dist/esm/chakra/index.js +1754 -1754
- package/dist/esm/chakra/index.js.map +1 -1
- package/dist/esm/components/Alert/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +1 -1
- package/dist/esm/components/index.js +2 -2
- package/dist/esm/index.js +3 -3
- package/dist/esm/theme/index.js +1 -1
- package/dist/types/components/Alert/alert.types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/alert.types-BGRyfYMy.js +0 -139
- package/dist/chunks/alert.types-BGRyfYMy.js.map +0 -1
- package/dist/chunks/alert.types-BVJZGZh-.js +0 -2
- package/dist/chunks/alert.types-BVJZGZh-.js.map +0 -1
- package/dist/chunks/grid-item-BV4dwEBP.js.map +0 -1
- package/dist/chunks/grid-item-CR-sXrjU.js +0 -2
- package/dist/chunks/grid-item-CR-sXrjU.js.map +0 -1
|
@@ -1544,122 +1544,8 @@ function To(e) {
|
|
|
1544
1544
|
t.set(n.name, { value: o, variable: r.ref });
|
|
1545
1545
|
}), t;
|
|
1546
1546
|
}
|
|
1547
|
-
var wo = (
|
|
1548
|
-
|
|
1549
|
-
const r = wo(n);
|
|
1550
|
-
if (!r) return null;
|
|
1551
|
-
if (Or(r) && t)
|
|
1552
|
-
return kr(r.createReader(), `${r.name}`);
|
|
1553
|
-
if (Tr(r))
|
|
1554
|
-
return new Promise((a) => {
|
|
1555
|
-
r.file((i) => {
|
|
1556
|
-
a(wr(i, ""));
|
|
1557
|
-
});
|
|
1558
|
-
});
|
|
1559
|
-
}).filter((n) => n)
|
|
1560
|
-
), kr = (e, t = "") => new Promise((n) => {
|
|
1561
|
-
const r = [], a = () => {
|
|
1562
|
-
e.readEntries((i) => {
|
|
1563
|
-
if (i.length === 0) {
|
|
1564
|
-
n(Promise.all(r).then((s) => s.flat()));
|
|
1565
|
-
return;
|
|
1566
|
-
}
|
|
1567
|
-
const o = i.map((s) => {
|
|
1568
|
-
if (!s) return null;
|
|
1569
|
-
if (Or(s))
|
|
1570
|
-
return kr(s.createReader(), `${t}${s.name}`);
|
|
1571
|
-
if (Tr(s))
|
|
1572
|
-
return new Promise((l) => {
|
|
1573
|
-
s.file((f) => {
|
|
1574
|
-
l(wr(f, t));
|
|
1575
|
-
});
|
|
1576
|
-
});
|
|
1577
|
-
}).filter((s) => s);
|
|
1578
|
-
r.push(Promise.all(o)), a();
|
|
1579
|
-
});
|
|
1580
|
-
};
|
|
1581
|
-
a();
|
|
1582
|
-
});
|
|
1583
|
-
function Ao(e) {
|
|
1584
|
-
return !!(e.navigator && e.navigator.msSaveOrOpenBlob);
|
|
1585
|
-
}
|
|
1586
|
-
function Xc(e) {
|
|
1587
|
-
const { file: t, win: n, type: r, name: a } = e, i = n.document, o = typeof t == "string" ? new Blob([t], { type: r }) : t, s = t instanceof File ? a || t.name : a;
|
|
1588
|
-
if (Ao(n)) {
|
|
1589
|
-
n.navigator.msSaveOrOpenBlob(o, s || "file-download");
|
|
1590
|
-
return;
|
|
1591
|
-
}
|
|
1592
|
-
const l = n.URL.createObjectURL(o), f = i.createElement("a");
|
|
1593
|
-
f.style.display = "none", f.href = l, f.rel = "noopener", f.download = s || "file-download", i.documentElement.appendChild(f), f.click(), setTimeout(() => {
|
|
1594
|
-
n.URL.revokeObjectURL(l), f.remove();
|
|
1595
|
-
}, 0);
|
|
1596
|
-
}
|
|
1597
|
-
function Vo(e) {
|
|
1598
|
-
return e === "audio/*" || e === "video/*" || e === "image/*" || e === "text/*" || /\w+\/[-+.\w]+/g.test(e);
|
|
1599
|
-
}
|
|
1600
|
-
function xo(e) {
|
|
1601
|
-
return /^.*\.[\w]+$/.test(e);
|
|
1602
|
-
}
|
|
1603
|
-
var Cn = (e) => Vo(e) || xo(e);
|
|
1604
|
-
function No(e) {
|
|
1605
|
-
if (e != null)
|
|
1606
|
-
return typeof e == "string" ? e : Array.isArray(e) ? e.filter(Cn).join(",") : Object.entries(e).reduce((t, [n, r]) => [...t, n, ...r], []).filter(Cn).join(",");
|
|
1607
|
-
}
|
|
1608
|
-
var Sn = (e, t) => e.name === t.name && e.size === t.size && e.type === t.type, Se = (e) => e != null;
|
|
1609
|
-
function Fo(e, t, n) {
|
|
1610
|
-
if (Se(e.size))
|
|
1611
|
-
if (Se(t) && Se(n)) {
|
|
1612
|
-
if (e.size > n) return [!1, "FILE_TOO_LARGE"];
|
|
1613
|
-
if (e.size < t) return [!1, "FILE_TOO_SMALL"];
|
|
1614
|
-
} else {
|
|
1615
|
-
if (Se(t) && e.size < t)
|
|
1616
|
-
return [!1, "FILE_TOO_SMALL"];
|
|
1617
|
-
if (Se(n) && e.size > n)
|
|
1618
|
-
return [!1, "FILE_TOO_LARGE"];
|
|
1619
|
-
}
|
|
1620
|
-
return [!0, null];
|
|
1621
|
-
}
|
|
1622
|
-
function $o(e, t) {
|
|
1623
|
-
if (e && t) {
|
|
1624
|
-
const n = Array.isArray(t) ? t : typeof t == "string" ? t.split(",") : [];
|
|
1625
|
-
if (n.length === 0) return !0;
|
|
1626
|
-
const r = e.name || "", a = (e.type || "").toLowerCase(), i = a.replace(/\/.*$/, "");
|
|
1627
|
-
return n.some((o) => {
|
|
1628
|
-
const s = o.trim().toLowerCase();
|
|
1629
|
-
return s.charAt(0) === "." ? r.toLowerCase().endsWith(s) : s.endsWith("/*") ? i === s.replace(/\/.*$/, "") : a === s;
|
|
1630
|
-
});
|
|
1631
|
-
}
|
|
1632
|
-
return !0;
|
|
1633
|
-
}
|
|
1634
|
-
function Do(e, t) {
|
|
1635
|
-
const n = e.type === "application/x-moz-file" || $o(e, t);
|
|
1636
|
-
return [n, n ? null : "FILE_INVALID_TYPE"];
|
|
1637
|
-
}
|
|
1638
|
-
function Lo(e) {
|
|
1639
|
-
const t = /* @__PURE__ */ new Map();
|
|
1640
|
-
return function(r, a) {
|
|
1641
|
-
const i = r + (a ? Object.entries(a).sort((s, l) => s[0] < l[0] ? -1 : 1).join() : "");
|
|
1642
|
-
if (t.has(i))
|
|
1643
|
-
return t.get(i);
|
|
1644
|
-
let o = new e(r, a);
|
|
1645
|
-
return t.set(i, o), o;
|
|
1646
|
-
};
|
|
1647
|
-
}
|
|
1648
|
-
var Mo = Lo(Intl.NumberFormat);
|
|
1649
|
-
function Bo(e, t, n = {}) {
|
|
1650
|
-
return Mo(t, n).format(e);
|
|
1651
|
-
}
|
|
1652
|
-
var _o = ["", "kilo", "mega", "giga", "tera"], Uo = ["", "kilo", "mega", "giga", "tera", "peta"], Wo = (e, t = "en-US", n = {}) => {
|
|
1653
|
-
if (isNaN(e)) return "";
|
|
1654
|
-
if (e === 0) return "0 B";
|
|
1655
|
-
const { unit: r = "byte", unitDisplay: a = "short" } = n, i = r === "bit" ? _o : Uo, o = Math.max(0, Math.min(Math.floor(Math.log10(e) / 3), i.length - 1)), s = i[o] + r, l = a || "short", f = parseFloat((e / Math.pow(1e3, o)).toPrecision(3));
|
|
1656
|
-
return Bo(f, t, {
|
|
1657
|
-
style: "unit",
|
|
1658
|
-
unit: s,
|
|
1659
|
-
unitDisplay: l
|
|
1660
|
-
});
|
|
1661
|
-
}, Ho = J("collapsible").parts("root", "trigger", "content", "indicator"), _e = Ho.build(), jo = (e) => e.ids?.root ?? `collapsible:${e.id}`, Ot = (e) => e.ids?.content ?? `collapsible:${e.id}:content`, Go = (e) => e.ids?.trigger ?? `collapsible:${e.id}:trigger`, Ue = (e) => e.getById(Ot(e));
|
|
1662
|
-
function Yc(e, t) {
|
|
1547
|
+
var wo = J("collapsible").parts("root", "trigger", "content", "indicator"), _e = wo.build(), ko = (e) => e.ids?.root ?? `collapsible:${e.id}`, Ot = (e) => e.ids?.content ?? `collapsible:${e.id}:content`, Ao = (e) => e.ids?.trigger ?? `collapsible:${e.id}:trigger`, Ue = (e) => e.getById(Ot(e));
|
|
1548
|
+
function Xc(e, t) {
|
|
1663
1549
|
const { state: n, send: r, context: a, scope: i, prop: o } = e, s = n.matches("open") || n.matches("closing"), l = n.matches("open"), { width: f, height: d } = a.get("size"), p = !!o("disabled"), c = !a.get("initial") && l, u = "ltr";
|
|
1664
1550
|
return {
|
|
1665
1551
|
disabled: p,
|
|
@@ -1676,7 +1562,7 @@ function Yc(e, t) {
|
|
|
1676
1562
|
..._e.root.attrs,
|
|
1677
1563
|
"data-state": l ? "open" : "closed",
|
|
1678
1564
|
dir: u,
|
|
1679
|
-
id:
|
|
1565
|
+
id: ko(i)
|
|
1680
1566
|
});
|
|
1681
1567
|
},
|
|
1682
1568
|
getContentProps() {
|
|
@@ -1696,7 +1582,7 @@ function Yc(e, t) {
|
|
|
1696
1582
|
getTriggerProps() {
|
|
1697
1583
|
return t.element({
|
|
1698
1584
|
..._e.trigger.attrs,
|
|
1699
|
-
id:
|
|
1585
|
+
id: Ao(i),
|
|
1700
1586
|
dir: u,
|
|
1701
1587
|
type: "button",
|
|
1702
1588
|
"data-state": l ? "open" : "closed",
|
|
@@ -1718,7 +1604,7 @@ function Yc(e, t) {
|
|
|
1718
1604
|
}
|
|
1719
1605
|
};
|
|
1720
1606
|
}
|
|
1721
|
-
var
|
|
1607
|
+
var Yc = oe({
|
|
1722
1608
|
initialState({ prop: e }) {
|
|
1723
1609
|
return e("open") || e("defaultOpen") ? "open" : "closed";
|
|
1724
1610
|
},
|
|
@@ -1930,7 +1816,7 @@ U()([
|
|
|
1930
1816
|
"defaultOpen",
|
|
1931
1817
|
"open"
|
|
1932
1818
|
]);
|
|
1933
|
-
var
|
|
1819
|
+
var Vo = Object.defineProperty, xo = (e, t, n) => t in e ? Vo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, jt = (e, t, n) => xo(e, t + "", n), No = (e, t, n) => {
|
|
1934
1820
|
const r = `linear-gradient(to ${e[+!t]}, transparent, #000)`;
|
|
1935
1821
|
return {
|
|
1936
1822
|
areaStyles: {
|
|
@@ -1942,7 +1828,7 @@ var zo = Object.defineProperty, Ko = (e, t, n) => t in e ? zo(e, t, { enumerable
|
|
|
1942
1828
|
maskImage: r
|
|
1943
1829
|
}
|
|
1944
1830
|
};
|
|
1945
|
-
},
|
|
1831
|
+
}, Fo = (e, t, n) => {
|
|
1946
1832
|
const r = `linear-gradient(to ${e[+!t]}, transparent, #000)`;
|
|
1947
1833
|
return {
|
|
1948
1834
|
areaStyles: {
|
|
@@ -1954,7 +1840,7 @@ var zo = Object.defineProperty, Ko = (e, t, n) => t in e ? zo(e, t, { enumerable
|
|
|
1954
1840
|
maskImage: r
|
|
1955
1841
|
}
|
|
1956
1842
|
};
|
|
1957
|
-
},
|
|
1843
|
+
}, $o = (e, t, n) => {
|
|
1958
1844
|
const r = `linear-gradient(to ${e[+!t]}, transparent, #000)`;
|
|
1959
1845
|
return {
|
|
1960
1846
|
areaStyles: {
|
|
@@ -1966,7 +1852,7 @@ var zo = Object.defineProperty, Ko = (e, t, n) => t in e ? zo(e, t, { enumerable
|
|
|
1966
1852
|
maskImage: r
|
|
1967
1853
|
}
|
|
1968
1854
|
};
|
|
1969
|
-
},
|
|
1855
|
+
}, Do = (e, t, n) => ({
|
|
1970
1856
|
areaStyles: {},
|
|
1971
1857
|
areaGradientStyles: {
|
|
1972
1858
|
background: [
|
|
@@ -1975,7 +1861,7 @@ var zo = Object.defineProperty, Ko = (e, t, n) => t in e ? zo(e, t, { enumerable
|
|
|
1975
1861
|
`hsl(${n}, 100%, 50%)`
|
|
1976
1862
|
].join(",")
|
|
1977
1863
|
}
|
|
1978
|
-
}),
|
|
1864
|
+
}), Lo = (e, t, n) => ({
|
|
1979
1865
|
areaStyles: {},
|
|
1980
1866
|
areaGradientStyles: {
|
|
1981
1867
|
background: [
|
|
@@ -1984,7 +1870,7 @@ var zo = Object.defineProperty, Ko = (e, t, n) => t in e ? zo(e, t, { enumerable
|
|
|
1984
1870
|
"hsl(0, 0%, 50%)"
|
|
1985
1871
|
].join(",")
|
|
1986
1872
|
}
|
|
1987
|
-
}),
|
|
1873
|
+
}), Mo = (e, t, n) => ({
|
|
1988
1874
|
areaStyles: {},
|
|
1989
1875
|
areaGradientStyles: {
|
|
1990
1876
|
backgroundImage: [
|
|
@@ -1992,7 +1878,7 @@ var zo = Object.defineProperty, Ko = (e, t, n) => t in e ? zo(e, t, { enumerable
|
|
|
1992
1878
|
`linear-gradient(to ${e[Number(t)]},hsl(0,100%,${n}%),hsl(60,100%,${n}%),hsl(120,100%,${n}%),hsl(180,100%,${n}%),hsl(240,100%,${n}%),hsl(300,100%,${n}%),hsl(360,100%,${n}%))`
|
|
1993
1879
|
].join(",")
|
|
1994
1880
|
}
|
|
1995
|
-
}),
|
|
1881
|
+
}), Bo = (e, t, n) => ({
|
|
1996
1882
|
areaStyles: {},
|
|
1997
1883
|
areaGradientStyles: {
|
|
1998
1884
|
background: [
|
|
@@ -2001,7 +1887,7 @@ var zo = Object.defineProperty, Ko = (e, t, n) => t in e ? zo(e, t, { enumerable
|
|
|
2001
1887
|
`hsl(${n}, 100%, 50%)`
|
|
2002
1888
|
].join(",")
|
|
2003
1889
|
}
|
|
2004
|
-
}),
|
|
1890
|
+
}), _o = (e, t, n) => ({
|
|
2005
1891
|
areaStyles: {},
|
|
2006
1892
|
areaGradientStyles: {
|
|
2007
1893
|
background: [
|
|
@@ -2010,7 +1896,7 @@ var zo = Object.defineProperty, Ko = (e, t, n) => t in e ? zo(e, t, { enumerable
|
|
|
2010
1896
|
`linear-gradient(to ${e[+!t]},hsl(0,0%,0%),hsl(0,0%,100%))`
|
|
2011
1897
|
].join(",")
|
|
2012
1898
|
}
|
|
2013
|
-
}),
|
|
1899
|
+
}), Uo = (e, t, n) => ({
|
|
2014
1900
|
areaStyles: {},
|
|
2015
1901
|
areaGradientStyles: {
|
|
2016
1902
|
background: [
|
|
@@ -2020,42 +1906,42 @@ var zo = Object.defineProperty, Ko = (e, t, n) => t in e ? zo(e, t, { enumerable
|
|
|
2020
1906
|
].join(",")
|
|
2021
1907
|
}
|
|
2022
1908
|
});
|
|
2023
|
-
function
|
|
1909
|
+
function Cn(e, t) {
|
|
2024
1910
|
const { xChannel: n, yChannel: r, dir: a = "ltr" } = t, { zChannel: i } = e.getColorAxes({ xChannel: n, yChannel: r }), o = e.getChannelValue(i), { minValue: s, maxValue: l } = e.getChannelRange(i), f = ["top", a === "rtl" ? "left" : "right"];
|
|
2025
1911
|
let d = !1, p = { areaStyles: {}, areaGradientStyles: {} }, c = (o - s) / (l - s), u = e.getFormat() === "hsla";
|
|
2026
1912
|
switch (i) {
|
|
2027
1913
|
case "red": {
|
|
2028
|
-
d = n === "green", p =
|
|
1914
|
+
d = n === "green", p = No(f, d, o);
|
|
2029
1915
|
break;
|
|
2030
1916
|
}
|
|
2031
1917
|
case "green": {
|
|
2032
|
-
d = n === "red", p =
|
|
1918
|
+
d = n === "red", p = Fo(f, d, o);
|
|
2033
1919
|
break;
|
|
2034
1920
|
}
|
|
2035
1921
|
case "blue": {
|
|
2036
|
-
d = n === "red", p =
|
|
1922
|
+
d = n === "red", p = $o(f, d, o);
|
|
2037
1923
|
break;
|
|
2038
1924
|
}
|
|
2039
1925
|
case "hue": {
|
|
2040
|
-
d = n !== "saturation", u ? p =
|
|
1926
|
+
d = n !== "saturation", u ? p = Do(f, d, o) : p = Bo(f, d, o);
|
|
2041
1927
|
break;
|
|
2042
1928
|
}
|
|
2043
1929
|
case "saturation": {
|
|
2044
|
-
d = n === "hue", u ? p =
|
|
1930
|
+
d = n === "hue", u ? p = Lo(f, d, c) : p = _o(f, d, c);
|
|
2045
1931
|
break;
|
|
2046
1932
|
}
|
|
2047
1933
|
case "brightness": {
|
|
2048
|
-
d = n === "hue", p =
|
|
1934
|
+
d = n === "hue", p = Uo(f, d, c);
|
|
2049
1935
|
break;
|
|
2050
1936
|
}
|
|
2051
1937
|
case "lightness": {
|
|
2052
|
-
d = n === "hue", p =
|
|
1938
|
+
d = n === "hue", p = Mo(f, d, o);
|
|
2053
1939
|
break;
|
|
2054
1940
|
}
|
|
2055
1941
|
}
|
|
2056
1942
|
return p;
|
|
2057
1943
|
}
|
|
2058
|
-
var
|
|
1944
|
+
var Wo = (e, t) => {
|
|
2059
1945
|
if (Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
2060
1946
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
2061
1947
|
return !0;
|
|
@@ -2100,9 +1986,9 @@ var rs = (e, t) => {
|
|
|
2100
1986
|
return this.incrementChannel(e, -t);
|
|
2101
1987
|
}
|
|
2102
1988
|
isEqual(e) {
|
|
2103
|
-
return
|
|
1989
|
+
return Wo(this.toJSON(), e.toJSON()) && this.getChannelValue("alpha") === e.getChannelValue("alpha");
|
|
2104
1990
|
}
|
|
2105
|
-
},
|
|
1991
|
+
}, Or = class Ke extends Gt {
|
|
2106
1992
|
constructor(t, n, r, a) {
|
|
2107
1993
|
super(), this.red = t, this.green = n, this.blue = r, this.alpha = a;
|
|
2108
1994
|
}
|
|
@@ -2252,14 +2138,14 @@ var rs = (e, t) => {
|
|
|
2252
2138
|
return Ke.colorChannels;
|
|
2253
2139
|
}
|
|
2254
2140
|
};
|
|
2255
|
-
jt(
|
|
2256
|
-
var zt =
|
|
2141
|
+
jt(Or, "colorChannels", ["red", "green", "blue"]);
|
|
2142
|
+
var zt = Or, Ho = /hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/, Tr = class qe extends Gt {
|
|
2257
2143
|
constructor(t, n, r, a) {
|
|
2258
2144
|
super(), this.hue = t, this.saturation = n, this.lightness = r, this.alpha = a;
|
|
2259
2145
|
}
|
|
2260
2146
|
static parse(t) {
|
|
2261
2147
|
let n;
|
|
2262
|
-
if (n = t.match(
|
|
2148
|
+
if (n = t.match(Ho)) {
|
|
2263
2149
|
const [r, a, i, o] = (n[1] ?? n[2]).split(",").map((s) => Number(s.trim().replace("%", "")));
|
|
2264
2150
|
return new qe(Xn(r, 360), j(a, 0, 100), j(i, 0, 100), j(o ?? 1, 0, 1));
|
|
2265
2151
|
}
|
|
@@ -2365,14 +2251,14 @@ var zt = Ar, as = /hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\
|
|
|
2365
2251
|
return qe.colorChannels;
|
|
2366
2252
|
}
|
|
2367
2253
|
};
|
|
2368
|
-
jt(
|
|
2369
|
-
var Kt =
|
|
2254
|
+
jt(Tr, "colorChannels", ["hue", "saturation", "lightness"]);
|
|
2255
|
+
var Kt = Tr, jo = /hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/, wr = class Xe extends Gt {
|
|
2370
2256
|
constructor(t, n, r, a) {
|
|
2371
2257
|
super(), this.hue = t, this.saturation = n, this.brightness = r, this.alpha = a;
|
|
2372
2258
|
}
|
|
2373
2259
|
static parse(t) {
|
|
2374
2260
|
let n;
|
|
2375
|
-
if (n = t.match(
|
|
2261
|
+
if (n = t.match(jo)) {
|
|
2376
2262
|
const [r, a, i, o] = (n[1] ?? n[2]).split(",").map((s) => Number(s.trim().replace("%", "")));
|
|
2377
2263
|
return new Xe(Xn(r, 360), j(a, 0, 100), j(i, 0, 100), j(o ?? 1, 0, 1));
|
|
2378
2264
|
}
|
|
@@ -2479,24 +2365,24 @@ var Kt = Vr, is = /hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\
|
|
|
2479
2365
|
return Xe.colorChannels;
|
|
2480
2366
|
}
|
|
2481
2367
|
};
|
|
2482
|
-
jt(
|
|
2483
|
-
var qt =
|
|
2368
|
+
jt(wr, "colorChannels", ["hue", "saturation", "brightness"]);
|
|
2369
|
+
var qt = wr, Go = "aliceblue:f0f8ff,antiquewhite:faebd7,aqua:00ffff,aquamarine:7fffd4,azure:f0ffff,beige:f5f5dc,bisque:ffe4c4,black:000000,blanchedalmond:ffebcd,blue:0000ff,blueviolet:8a2be2,brown:a52a2a,burlywood:deb887,cadetblue:5f9ea0,chartreuse:7fff00,chocolate:d2691e,coral:ff7f50,cornflowerblue:6495ed,cornsilk:fff8dc,crimson:dc143c,cyan:00ffff,darkblue:00008b,darkcyan:008b8b,darkgoldenrod:b8860b,darkgray:a9a9a9,darkgreen:006400,darkkhaki:bdb76b,darkmagenta:8b008b,darkolivegreen:556b2f,darkorange:ff8c00,darkorchid:9932cc,darkred:8b0000,darksalmon:e9967a,darkseagreen:8fbc8f,darkslateblue:483d8b,darkslategray:2f4f4f,darkturquoise:00ced1,darkviolet:9400d3,deeppink:ff1493,deepskyblue:00bfff,dimgray:696969,dodgerblue:1e90ff,firebrick:b22222,floralwhite:fffaf0,forestgreen:228b22,fuchsia:ff00ff,gainsboro:dcdcdc,ghostwhite:f8f8ff,gold:ffd700,goldenrod:daa520,gray:808080,green:008000,greenyellow:adff2f,honeydew:f0fff0,hotpink:ff69b4,indianred:cd5c5c,indigo:4b0082,ivory:fffff0,khaki:f0e68c,lavender:e6e6fa,lavenderblush:fff0f5,lawngreen:7cfc00,lemonchiffon:fffacd,lightblue:add8e6,lightcoral:f08080,lightcyan:e0ffff,lightgoldenrodyellow:fafad2,lightgrey:d3d3d3,lightgreen:90ee90,lightpink:ffb6c1,lightsalmon:ffa07a,lightseagreen:20b2aa,lightskyblue:87cefa,lightslategray:778899,lightsteelblue:b0c4de,lightyellow:ffffe0,lime:00ff00,limegreen:32cd32,linen:faf0e6,magenta:ff00ff,maroon:800000,mediumaquamarine:66cdaa,mediumblue:0000cd,mediumorchid:ba55d3,mediumpurple:9370d8,mediumseagreen:3cb371,mediumslateblue:7b68ee,mediumspringgreen:00fa9a,mediumturquoise:48d1cc,mediumvioletred:c71585,midnightblue:191970,mintcream:f5fffa,mistyrose:ffe4e1,moccasin:ffe4b5,navajowhite:ffdead,navy:000080,oldlace:fdf5e6,olive:808000,olivedrab:6b8e23,orange:ffa500,orangered:ff4500,orchid:da70d6,palegoldenrod:eee8aa,palegreen:98fb98,paleturquoise:afeeee,palevioletred:d87093,papayawhip:ffefd5,peachpuff:ffdab9,peru:cd853f,pink:ffc0cb,plum:dda0dd,powderblue:b0e0e6,purple:800080,rebeccapurple:663399,red:ff0000,rosybrown:bc8f8f,royalblue:4169e1,saddlebrown:8b4513,salmon:fa8072,sandybrown:f4a460,seagreen:2e8b57,seashell:fff5ee,sienna:a0522d,silver:c0c0c0,skyblue:87ceeb,slateblue:6a5acd,slategray:708090,snow:fffafa,springgreen:00ff7f,steelblue:4682b4,tan:d2b48c,teal:008080,thistle:d8bfd8,tomato:ff6347,turquoise:40e0d0,violet:ee82ee,wheat:f5deb3,white:ffffff,whitesmoke:f5f5f5,yellow:ffff00,yellowgreen:9acd32", zo = (e) => {
|
|
2484
2370
|
const t = /* @__PURE__ */ new Map(), n = e.split(",");
|
|
2485
2371
|
for (let r = 0; r < n.length; r++) {
|
|
2486
2372
|
const [a, i] = n[r].split(":");
|
|
2487
2373
|
t.set(a, `#${i}`), a.includes("gray") && t.set(a.replace("gray", "grey"), `#${i}`);
|
|
2488
2374
|
}
|
|
2489
2375
|
return t;
|
|
2490
|
-
},
|
|
2491
|
-
if (
|
|
2492
|
-
return de(
|
|
2376
|
+
}, Sn = zo(Go), de = (e) => {
|
|
2377
|
+
if (Sn.has(e))
|
|
2378
|
+
return de(Sn.get(e));
|
|
2493
2379
|
const t = zt.parse(e) || qt.parse(e) || Kt.parse(e);
|
|
2494
2380
|
if (!t) {
|
|
2495
2381
|
const n = new Error("Invalid color value: " + e);
|
|
2496
2382
|
throw Error.captureStackTrace?.(n, de), n;
|
|
2497
2383
|
}
|
|
2498
2384
|
return t;
|
|
2499
|
-
},
|
|
2385
|
+
}, In = (e) => typeof e == "string" ? de(e) : e, kr = J("color-picker", [
|
|
2500
2386
|
"root",
|
|
2501
2387
|
"label",
|
|
2502
2388
|
"control",
|
|
@@ -2521,21 +2407,21 @@ var qt = xr, os = "aliceblue:f0f8ff,antiquewhite:faebd7,aqua:00ffff,aquamarine:7
|
|
|
2521
2407
|
"eyeDropperTrigger",
|
|
2522
2408
|
"formatTrigger",
|
|
2523
2409
|
"formatSelect"
|
|
2524
|
-
]), M =
|
|
2525
|
-
const n =
|
|
2410
|
+
]), M = kr.build(), Ko = (e) => e.ids?.root ?? `color-picker:${e.id}`, Pn = (e) => e.ids?.label ?? `color-picker:${e.id}:label`, Tt = (e) => e.ids?.hiddenInput ?? `color-picker:${e.id}:hidden-input`, Ar = (e) => e.ids?.control ?? `color-picker:${e.id}:control`, Vr = (e) => e.ids?.trigger ?? `color-picker:${e.id}:trigger`, wt = (e) => e.ids?.content ?? `color-picker:${e.id}:content`, xr = (e) => e.ids?.positioner ?? `color-picker:${e.id}:positioner`, qo = (e) => e.ids?.formatSelect ?? `color-picker:${e.id}:format-select`, Nr = (e) => e.ids?.area ?? `color-picker:${e.id}:area`, Xo = (e) => e.ids?.areaGradient ?? `color-picker:${e.id}:area-gradient`, Fr = (e) => e.ids?.areaThumb ?? `color-picker:${e.id}:area-thumb`, $r = (e, t) => e.ids?.channelSliderTrack?.(t) ?? `color-picker:${e.id}:slider-track:${t}`, kt = (e, t) => e.ids?.channelSliderThumb?.(t) ?? `color-picker:${e.id}:slider-thumb:${t}`, Ye = (e) => e.getById(wt(e)), Yo = (e) => e.getById(Fr(e)), Zo = (e, t) => e.getById(kt(e, t)), Jo = (e) => e.getById(qo(e)), Rn = (e) => e.getById(Tt(e)), Qo = (e) => e.getById(Nr(e)), es = (e, t) => {
|
|
2411
|
+
const n = Qo(e);
|
|
2526
2412
|
if (!n) return;
|
|
2527
2413
|
const { percent: r } = dt(t, n);
|
|
2528
2414
|
return r;
|
|
2529
|
-
},
|
|
2530
|
-
const r =
|
|
2415
|
+
}, Dr = (e) => e.getById(Ar(e)), bt = (e) => e.getById(Vr(e)), ts = (e) => e.getById(xr(e)), ns = (e, t) => e.getById($r(e, t)), rs = (e, t, n) => {
|
|
2416
|
+
const r = ns(e, n);
|
|
2531
2417
|
if (!r) return;
|
|
2532
2418
|
const { percent: a } = dt(t, r);
|
|
2533
2419
|
return a;
|
|
2534
|
-
},
|
|
2420
|
+
}, as = (e) => [
|
|
2535
2421
|
...nt(Ye(e), "input[data-channel]"),
|
|
2536
|
-
...nt(
|
|
2422
|
+
...nt(Dr(e), "input[data-channel]")
|
|
2537
2423
|
];
|
|
2538
|
-
function
|
|
2424
|
+
function is(e, t) {
|
|
2539
2425
|
switch (t) {
|
|
2540
2426
|
case "hue":
|
|
2541
2427
|
return de(`hsl(${e.getChannelValue("hue")}, 100%, 50%)`);
|
|
@@ -2578,7 +2464,7 @@ function At(e, t) {
|
|
|
2578
2464
|
return e.getChannelValue(t).toString();
|
|
2579
2465
|
}
|
|
2580
2466
|
}
|
|
2581
|
-
function
|
|
2467
|
+
function os(e, t) {
|
|
2582
2468
|
switch (t) {
|
|
2583
2469
|
case "hex":
|
|
2584
2470
|
const n = de("#000000"), r = de("#FFFFFF");
|
|
@@ -2604,11 +2490,11 @@ function Cs(e, t) {
|
|
|
2604
2490
|
return e.getChannelRange(t);
|
|
2605
2491
|
}
|
|
2606
2492
|
}
|
|
2607
|
-
function
|
|
2493
|
+
function ss(e, t) {
|
|
2608
2494
|
return e === "vertical" ? "top" : t === "ltr" ? "right" : "left";
|
|
2609
2495
|
}
|
|
2610
|
-
var
|
|
2611
|
-
const { channel: t, value: n, dir: r, orientation: a } = e, i =
|
|
2496
|
+
var ls = (e) => {
|
|
2497
|
+
const { channel: t, value: n, dir: r, orientation: a } = e, i = ss(a, r), { minValue: o, maxValue: s } = n.getChannelRange(t);
|
|
2612
2498
|
switch (t) {
|
|
2613
2499
|
case "hue":
|
|
2614
2500
|
return `linear-gradient(to ${i}, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)`;
|
|
@@ -2629,7 +2515,7 @@ var Is = (e) => {
|
|
|
2629
2515
|
throw new Error("Unknown color channel: " + t);
|
|
2630
2516
|
}
|
|
2631
2517
|
};
|
|
2632
|
-
function
|
|
2518
|
+
function Zc(e, t) {
|
|
2633
2519
|
const { context: n, send: r, prop: a, computed: i, state: o, scope: s } = e, l = n.get("value"), f = n.get("format"), d = i("areaValue"), p = i("valueAsString"), c = i("disabled"), u = i("interactive"), g = o.hasTag("dragging"), h = o.hasTag("open"), y = o.hasTag("focused"), w = (b) => {
|
|
2634
2520
|
const v = d.getChannels();
|
|
2635
2521
|
return {
|
|
@@ -2641,7 +2527,7 @@ function Jc(e, t) {
|
|
|
2641
2527
|
placement: E
|
|
2642
2528
|
});
|
|
2643
2529
|
function k(b) {
|
|
2644
|
-
const v =
|
|
2530
|
+
const v = In(b.value).toFormat(n.get("format"));
|
|
2645
2531
|
return {
|
|
2646
2532
|
value: v,
|
|
2647
2533
|
valueAsString: v.toString("hex"),
|
|
@@ -2658,7 +2544,7 @@ function Jc(e, t) {
|
|
|
2658
2544
|
o.hasTag("open") !== b && r({ type: b ? "OPEN" : "CLOSE" });
|
|
2659
2545
|
},
|
|
2660
2546
|
setValue(b) {
|
|
2661
|
-
r({ type: "VALUE.SET", value:
|
|
2547
|
+
r({ type: "VALUE.SET", value: In(b), src: "set-color" });
|
|
2662
2548
|
},
|
|
2663
2549
|
getChannelValue(b) {
|
|
2664
2550
|
return At(l, b);
|
|
@@ -2684,7 +2570,7 @@ function Jc(e, t) {
|
|
|
2684
2570
|
return t.element({
|
|
2685
2571
|
...M.root.attrs,
|
|
2686
2572
|
dir: a("dir"),
|
|
2687
|
-
id:
|
|
2573
|
+
id: Ko(s),
|
|
2688
2574
|
"data-disabled": m(c),
|
|
2689
2575
|
"data-readonly": m(a("readOnly")),
|
|
2690
2576
|
"data-invalid": m(a("invalid")),
|
|
@@ -2697,21 +2583,21 @@ function Jc(e, t) {
|
|
|
2697
2583
|
return t.element({
|
|
2698
2584
|
...M.label.attrs,
|
|
2699
2585
|
dir: a("dir"),
|
|
2700
|
-
id:
|
|
2586
|
+
id: Pn(s),
|
|
2701
2587
|
htmlFor: Tt(s),
|
|
2702
2588
|
"data-disabled": m(c),
|
|
2703
2589
|
"data-readonly": m(a("readOnly")),
|
|
2704
2590
|
"data-invalid": m(a("invalid")),
|
|
2705
2591
|
"data-focus": m(y),
|
|
2706
2592
|
onClick(b) {
|
|
2707
|
-
b.preventDefault(), Qn(
|
|
2593
|
+
b.preventDefault(), Qn(Dr(s), "[data-channel=hex]")?.focus({ preventScroll: !0 });
|
|
2708
2594
|
}
|
|
2709
2595
|
});
|
|
2710
2596
|
},
|
|
2711
2597
|
getControlProps() {
|
|
2712
2598
|
return t.element({
|
|
2713
2599
|
...M.control.attrs,
|
|
2714
|
-
id:
|
|
2600
|
+
id: Ar(s),
|
|
2715
2601
|
dir: a("dir"),
|
|
2716
2602
|
"data-disabled": m(c),
|
|
2717
2603
|
"data-readonly": m(a("readOnly")),
|
|
@@ -2723,12 +2609,12 @@ function Jc(e, t) {
|
|
|
2723
2609
|
getTriggerProps() {
|
|
2724
2610
|
return t.button({
|
|
2725
2611
|
...M.trigger.attrs,
|
|
2726
|
-
id:
|
|
2612
|
+
id: Vr(s),
|
|
2727
2613
|
dir: a("dir"),
|
|
2728
2614
|
disabled: c,
|
|
2729
2615
|
"aria-label": `select color. current color is ${p}`,
|
|
2730
2616
|
"aria-controls": wt(s),
|
|
2731
|
-
"aria-labelledby":
|
|
2617
|
+
"aria-labelledby": Pn(s),
|
|
2732
2618
|
"data-disabled": m(c),
|
|
2733
2619
|
"data-readonly": m(a("readOnly")),
|
|
2734
2620
|
"data-invalid": m(a("invalid")),
|
|
@@ -2751,7 +2637,7 @@ function Jc(e, t) {
|
|
|
2751
2637
|
getPositionerProps() {
|
|
2752
2638
|
return t.element({
|
|
2753
2639
|
...M.positioner.attrs,
|
|
2754
|
-
id:
|
|
2640
|
+
id: xr(s),
|
|
2755
2641
|
dir: a("dir"),
|
|
2756
2642
|
style: T.floating
|
|
2757
2643
|
});
|
|
@@ -2776,14 +2662,14 @@ function Jc(e, t) {
|
|
|
2776
2662
|
});
|
|
2777
2663
|
},
|
|
2778
2664
|
getAreaProps(b = {}) {
|
|
2779
|
-
const { xChannel: v, yChannel: I } = w(b), { areaStyles: P } =
|
|
2665
|
+
const { xChannel: v, yChannel: I } = w(b), { areaStyles: P } = Cn(d, {
|
|
2780
2666
|
xChannel: v,
|
|
2781
2667
|
yChannel: I,
|
|
2782
2668
|
dir: a("dir")
|
|
2783
2669
|
});
|
|
2784
2670
|
return t.element({
|
|
2785
2671
|
...M.area.attrs,
|
|
2786
|
-
id:
|
|
2672
|
+
id: Nr(s),
|
|
2787
2673
|
role: "group",
|
|
2788
2674
|
"data-invalid": m(a("invalid")),
|
|
2789
2675
|
"data-disabled": m(c),
|
|
@@ -2802,14 +2688,14 @@ function Jc(e, t) {
|
|
|
2802
2688
|
});
|
|
2803
2689
|
},
|
|
2804
2690
|
getAreaBackgroundProps(b = {}) {
|
|
2805
|
-
const { xChannel: v, yChannel: I } = w(b), { areaGradientStyles: P } =
|
|
2691
|
+
const { xChannel: v, yChannel: I } = w(b), { areaGradientStyles: P } = Cn(d, {
|
|
2806
2692
|
xChannel: v,
|
|
2807
2693
|
yChannel: I,
|
|
2808
2694
|
dir: a("dir")
|
|
2809
2695
|
});
|
|
2810
2696
|
return t.element({
|
|
2811
2697
|
...M.areaBackground.attrs,
|
|
2812
|
-
id:
|
|
2698
|
+
id: Xo(s),
|
|
2813
2699
|
"data-invalid": m(a("invalid")),
|
|
2814
2700
|
"data-disabled": m(c),
|
|
2815
2701
|
"data-readonly": m(a("readOnly")),
|
|
@@ -2825,7 +2711,7 @@ function Jc(e, t) {
|
|
|
2825
2711
|
const { xChannel: v, yChannel: I } = w(b), P = { xChannel: v, yChannel: I }, C = d.getChannelValuePercent(v), O = 1 - d.getChannelValuePercent(I), V = d.getChannelValue(v), N = d.getChannelValue(I), $ = d.withChannelValue("alpha", 1).toString("css");
|
|
2826
2712
|
return t.element({
|
|
2827
2713
|
...M.areaThumb.attrs,
|
|
2828
|
-
id:
|
|
2714
|
+
id: Fr(s),
|
|
2829
2715
|
dir: a("dir"),
|
|
2830
2716
|
tabIndex: c ? void 0 : 0,
|
|
2831
2717
|
"data-disabled": m(c),
|
|
@@ -2922,14 +2808,14 @@ function Jc(e, t) {
|
|
|
2922
2808
|
const { orientation: v = "horizontal", channel: I, format: P } = b, C = P ? l.toFormat(P) : d;
|
|
2923
2809
|
return t.element({
|
|
2924
2810
|
...M.channelSliderTrack.attrs,
|
|
2925
|
-
id:
|
|
2811
|
+
id: $r(s, I),
|
|
2926
2812
|
role: "group",
|
|
2927
2813
|
"data-channel": I,
|
|
2928
2814
|
"data-orientation": v,
|
|
2929
2815
|
style: {
|
|
2930
2816
|
position: "relative",
|
|
2931
2817
|
forcedColorAdjust: "none",
|
|
2932
|
-
backgroundImage:
|
|
2818
|
+
backgroundImage: ls({
|
|
2933
2819
|
orientation: v,
|
|
2934
2820
|
channel: I,
|
|
2935
2821
|
dir: a("dir"),
|
|
@@ -2981,7 +2867,7 @@ function Jc(e, t) {
|
|
|
2981
2867
|
style: {
|
|
2982
2868
|
forcedColorAdjust: "none",
|
|
2983
2869
|
position: "absolute",
|
|
2984
|
-
background:
|
|
2870
|
+
background: is(d, I).toString("css"),
|
|
2985
2871
|
...$
|
|
2986
2872
|
},
|
|
2987
2873
|
onFocus() {
|
|
@@ -3025,7 +2911,7 @@ function Jc(e, t) {
|
|
|
3025
2911
|
});
|
|
3026
2912
|
},
|
|
3027
2913
|
getChannelInputProps(b) {
|
|
3028
|
-
const { channel: v } = b, I = v === "hex" || v === "css", P =
|
|
2914
|
+
const { channel: v } = b, I = v === "hex" || v === "css", P = os(l, v);
|
|
3029
2915
|
return t.input({
|
|
3030
2916
|
...M.channelInput.attrs,
|
|
3031
2917
|
dir: a("dir"),
|
|
@@ -3150,10 +3036,10 @@ function Jc(e, t) {
|
|
|
3150
3036
|
...M.formatTrigger.attrs,
|
|
3151
3037
|
dir: a("dir"),
|
|
3152
3038
|
type: "button",
|
|
3153
|
-
"aria-label": `change color format to ${
|
|
3039
|
+
"aria-label": `change color format to ${On(f)}`,
|
|
3154
3040
|
onClick(b) {
|
|
3155
3041
|
if (b.currentTarget.disabled) return;
|
|
3156
|
-
const v =
|
|
3042
|
+
const v = On(f);
|
|
3157
3043
|
r({ type: "FORMAT.SET", format: v, src: "format-trigger" });
|
|
3158
3044
|
}
|
|
3159
3045
|
});
|
|
@@ -3166,27 +3052,27 @@ function Jc(e, t) {
|
|
|
3166
3052
|
defaultValue: a("format"),
|
|
3167
3053
|
disabled: c,
|
|
3168
3054
|
onChange(b) {
|
|
3169
|
-
const v =
|
|
3055
|
+
const v = us(b.currentTarget.value);
|
|
3170
3056
|
r({ type: "FORMAT.SET", format: v, src: "format-select" });
|
|
3171
3057
|
}
|
|
3172
3058
|
});
|
|
3173
3059
|
}
|
|
3174
3060
|
};
|
|
3175
3061
|
}
|
|
3176
|
-
var Ze = ["hsba", "hsla", "rgba"],
|
|
3177
|
-
function
|
|
3062
|
+
var Ze = ["hsba", "hsla", "rgba"], cs = new RegExp(`^(${Ze.join("|")})$`);
|
|
3063
|
+
function On(e) {
|
|
3178
3064
|
const t = Ze.indexOf(e);
|
|
3179
3065
|
return Ze[t + 1] ?? Ze[0];
|
|
3180
3066
|
}
|
|
3181
|
-
function
|
|
3182
|
-
if (
|
|
3067
|
+
function us(e) {
|
|
3068
|
+
if (cs.test(e)) return e;
|
|
3183
3069
|
throw new Error(`Unsupported color format: ${e}`);
|
|
3184
3070
|
}
|
|
3185
|
-
var
|
|
3071
|
+
var Tn = (e) => de(e), { and: ds } = Yn(), Jc = oe({
|
|
3186
3072
|
props({ props: e }) {
|
|
3187
3073
|
return {
|
|
3188
3074
|
dir: "ltr",
|
|
3189
|
-
defaultValue:
|
|
3075
|
+
defaultValue: Tn("#000000"),
|
|
3190
3076
|
defaultFormat: "rgba",
|
|
3191
3077
|
openAutoFocus: !0,
|
|
3192
3078
|
...e,
|
|
@@ -3452,7 +3338,7 @@ var kn = (e) => de(e), { and: Os } = Yn(), Qc = oe({
|
|
|
3452
3338
|
],
|
|
3453
3339
|
"SWATCH_TRIGGER.CLICK": [
|
|
3454
3340
|
{
|
|
3455
|
-
guard:
|
|
3341
|
+
guard: ds("isOpenControlled", "closeOnSelect"),
|
|
3456
3342
|
actions: ["setValue", "invokeOnClose"]
|
|
3457
3343
|
},
|
|
3458
3344
|
{
|
|
@@ -3533,7 +3419,7 @@ var kn = (e) => de(e), { and: Os } = Yn(), Qc = oe({
|
|
|
3533
3419
|
trackPositioning({ context: e, prop: t, scope: n }) {
|
|
3534
3420
|
e.get("currentPlacement") || e.set("currentPlacement", t("positioning")?.placement);
|
|
3535
3421
|
const r = bt(n);
|
|
3536
|
-
return si(r, () =>
|
|
3422
|
+
return si(r, () => ts(n), {
|
|
3537
3423
|
...t("positioning"),
|
|
3538
3424
|
defer: !0,
|
|
3539
3425
|
onComplete(i) {
|
|
@@ -3556,7 +3442,7 @@ var kn = (e) => de(e), { and: Os } = Yn(), Qc = oe({
|
|
|
3556
3442
|
});
|
|
3557
3443
|
},
|
|
3558
3444
|
trackFormControl({ context: e, scope: t, send: n }) {
|
|
3559
|
-
const r =
|
|
3445
|
+
const r = Rn(t);
|
|
3560
3446
|
return ut(r, {
|
|
3561
3447
|
onFieldsetDisabledChange(a) {
|
|
3562
3448
|
e.set("fieldsetDisabled", a);
|
|
@@ -3602,13 +3488,13 @@ var kn = (e) => de(e), { and: Os } = Yn(), Qc = oe({
|
|
|
3602
3488
|
e.set("activeChannel", null), e.set("activeId", null), e.set("activeOrientation", null);
|
|
3603
3489
|
},
|
|
3604
3490
|
setAreaColorFromPoint({ context: e, event: t, computed: n, scope: r }) {
|
|
3605
|
-
const a = t.format ? e.get("value").toFormat(t.format) : n("areaValue"), { xChannel: i, yChannel: o } = t.channel || e.get("activeChannel"), s =
|
|
3491
|
+
const a = t.format ? e.get("value").toFormat(t.format) : n("areaValue"), { xChannel: i, yChannel: o } = t.channel || e.get("activeChannel"), s = es(r, t.point);
|
|
3606
3492
|
if (!s) return;
|
|
3607
3493
|
const l = a.getChannelPercentValue(i, s.x), f = a.getChannelPercentValue(o, 1 - s.y), d = a.withChannelValue(i, l).withChannelValue(o, f);
|
|
3608
3494
|
e.set("value", d);
|
|
3609
3495
|
},
|
|
3610
3496
|
setChannelColorFromPoint({ context: e, event: t, computed: n, scope: r }) {
|
|
3611
|
-
const a = t.channel || e.get("activeId"), i = t.format ? e.get("value").toFormat(t.format) : n("areaValue"), o =
|
|
3497
|
+
const a = t.channel || e.get("activeId"), i = t.format ? e.get("value").toFormat(t.format) : n("areaValue"), o = rs(r, t.point, a);
|
|
3612
3498
|
if (!o) return;
|
|
3613
3499
|
const l = (e.get("activeOrientation") || "horizontal") === "horizontal" ? o.x : o.y, f = i.getChannelPercentValue(a, l), d = i.withChannelValue(a, f);
|
|
3614
3500
|
e.set("value", d);
|
|
@@ -3620,10 +3506,10 @@ var kn = (e) => de(e), { and: Os } = Yn(), Qc = oe({
|
|
|
3620
3506
|
e.set("format", t.format);
|
|
3621
3507
|
},
|
|
3622
3508
|
dispatchChangeEvent({ scope: e, computed: t }) {
|
|
3623
|
-
Ut(
|
|
3509
|
+
Ut(Rn(e), { value: t("valueAsString") });
|
|
3624
3510
|
},
|
|
3625
3511
|
syncInputElements({ context: e, scope: t }) {
|
|
3626
|
-
|
|
3512
|
+
wn(t, e.get("value"));
|
|
3627
3513
|
},
|
|
3628
3514
|
invokeOnChangeEnd({ context: e, prop: t, computed: n }) {
|
|
3629
3515
|
t("onValueChangeEnd")?.({
|
|
@@ -3639,14 +3525,14 @@ var kn = (e) => de(e), { and: Os } = Yn(), Qc = oe({
|
|
|
3639
3525
|
l = Number.isNaN(l) ? o : l, s = e.get("value").withChannelValue("alpha", l);
|
|
3640
3526
|
} else if (a)
|
|
3641
3527
|
s = Na(
|
|
3642
|
-
() =>
|
|
3528
|
+
() => Tn(i).withChannelValue("alpha", o),
|
|
3643
3529
|
() => e.get("value")
|
|
3644
3530
|
);
|
|
3645
3531
|
else {
|
|
3646
3532
|
const l = e.get("value").toFormat(e.get("format")), f = Number.isNaN(i) ? l.getChannelValue(r) : i;
|
|
3647
3533
|
s = l.withChannelValue(r, f);
|
|
3648
3534
|
}
|
|
3649
|
-
|
|
3535
|
+
wn(n, e.get("value"), s), e.set("value", s);
|
|
3650
3536
|
},
|
|
3651
3537
|
incrementChannel({ context: e, event: t }) {
|
|
3652
3538
|
const n = e.get("value").incrementChannel(t.channel, t.step);
|
|
@@ -3682,12 +3568,12 @@ var kn = (e) => de(e), { and: Os } = Yn(), Qc = oe({
|
|
|
3682
3568
|
},
|
|
3683
3569
|
focusAreaThumb({ scope: e }) {
|
|
3684
3570
|
G(() => {
|
|
3685
|
-
|
|
3571
|
+
Yo(e)?.focus({ preventScroll: !0 });
|
|
3686
3572
|
});
|
|
3687
3573
|
},
|
|
3688
3574
|
focusChannelThumb({ event: e, scope: t }) {
|
|
3689
3575
|
G(() => {
|
|
3690
|
-
|
|
3576
|
+
Zo(t, e.channel)?.focus({ preventScroll: !0 });
|
|
3691
3577
|
});
|
|
3692
3578
|
},
|
|
3693
3579
|
setInitialFocus({ prop: e, scope: t }) {
|
|
@@ -3704,7 +3590,7 @@ var kn = (e) => de(e), { and: Os } = Yn(), Qc = oe({
|
|
|
3704
3590
|
});
|
|
3705
3591
|
},
|
|
3706
3592
|
syncFormatSelectElement({ context: e, scope: t }) {
|
|
3707
|
-
|
|
3593
|
+
fs(t, e.get("format"));
|
|
3708
3594
|
},
|
|
3709
3595
|
invokeOnOpen({ prop: e }) {
|
|
3710
3596
|
e("onOpenChange")?.({ open: !0 });
|
|
@@ -3718,8 +3604,8 @@ var kn = (e) => de(e), { and: Os } = Yn(), Qc = oe({
|
|
|
3718
3604
|
}
|
|
3719
3605
|
}
|
|
3720
3606
|
});
|
|
3721
|
-
function
|
|
3722
|
-
const r =
|
|
3607
|
+
function wn(e, t, n) {
|
|
3608
|
+
const r = as(e);
|
|
3723
3609
|
G(() => {
|
|
3724
3610
|
r.forEach((a) => {
|
|
3725
3611
|
const i = a.dataset.channel;
|
|
@@ -3727,8 +3613,8 @@ function An(e, t, n) {
|
|
|
3727
3613
|
});
|
|
3728
3614
|
});
|
|
3729
3615
|
}
|
|
3730
|
-
function
|
|
3731
|
-
const n =
|
|
3616
|
+
function fs(e, t) {
|
|
3617
|
+
const n = Jo(e);
|
|
3732
3618
|
n && G(() => Le(n, t));
|
|
3733
3619
|
}
|
|
3734
3620
|
U()([
|
|
@@ -3765,11 +3651,11 @@ U()(["channel", "orientation"]);
|
|
|
3765
3651
|
U()(["value", "disabled"]);
|
|
3766
3652
|
U()(["value", "respectAlpha"]);
|
|
3767
3653
|
U()(["size"]);
|
|
3768
|
-
var
|
|
3654
|
+
var gs = J("accordion").parts("root", "item", "itemTrigger", "itemContent", "itemIndicator"), Se = gs.build(), ot = (e) => e.ids?.root ?? `accordion:${e.id}`, hs = (e, t) => e.ids?.item?.(t) ?? `accordion:${e.id}:item:${t}`, kn = (e, t) => e.ids?.itemContent?.(t) ?? `accordion:${e.id}:content:${t}`, st = (e, t) => e.ids?.itemTrigger?.(t) ?? `accordion:${e.id}:trigger:${t}`, ps = (e) => e.getById(ot(e)), gt = (e) => {
|
|
3769
3655
|
const n = `[aria-controls][data-ownedby='${CSS.escape(ot(e))}']:not([disabled])`;
|
|
3770
|
-
return nt(
|
|
3771
|
-
},
|
|
3772
|
-
function
|
|
3656
|
+
return nt(ps(e), n);
|
|
3657
|
+
}, ms = (e) => tr(gt(e)), bs = (e) => er(gt(e)), vs = (e, t) => Ba(gt(e), st(e, t)), ys = (e, t) => Ma(gt(e), st(e, t));
|
|
3658
|
+
function Qc(e, t) {
|
|
3773
3659
|
const { send: n, context: r, prop: a, scope: i, computed: o } = e, s = r.get("focusedValue"), l = r.get("value"), f = a("multiple");
|
|
3774
3660
|
function d(c) {
|
|
3775
3661
|
let u = c;
|
|
@@ -3789,7 +3675,7 @@ function eu(e, t) {
|
|
|
3789
3675
|
getItemState: p,
|
|
3790
3676
|
getRootProps() {
|
|
3791
3677
|
return t.element({
|
|
3792
|
-
...
|
|
3678
|
+
...Se.root.attrs,
|
|
3793
3679
|
dir: a("dir"),
|
|
3794
3680
|
id: ot(i),
|
|
3795
3681
|
"data-orientation": a("orientation")
|
|
@@ -3798,9 +3684,9 @@ function eu(e, t) {
|
|
|
3798
3684
|
getItemProps(c) {
|
|
3799
3685
|
const u = p(c);
|
|
3800
3686
|
return t.element({
|
|
3801
|
-
...
|
|
3687
|
+
...Se.item.attrs,
|
|
3802
3688
|
dir: a("dir"),
|
|
3803
|
-
id:
|
|
3689
|
+
id: hs(i, c.value),
|
|
3804
3690
|
"data-state": u.expanded ? "open" : "closed",
|
|
3805
3691
|
"data-focus": m(u.focused),
|
|
3806
3692
|
"data-disabled": m(u.disabled),
|
|
@@ -3810,10 +3696,10 @@ function eu(e, t) {
|
|
|
3810
3696
|
getItemContentProps(c) {
|
|
3811
3697
|
const u = p(c);
|
|
3812
3698
|
return t.element({
|
|
3813
|
-
...
|
|
3699
|
+
...Se.itemContent.attrs,
|
|
3814
3700
|
dir: a("dir"),
|
|
3815
3701
|
role: "region",
|
|
3816
|
-
id:
|
|
3702
|
+
id: kn(i, c.value),
|
|
3817
3703
|
"aria-labelledby": st(i, c.value),
|
|
3818
3704
|
hidden: !u.expanded,
|
|
3819
3705
|
"data-state": u.expanded ? "open" : "closed",
|
|
@@ -3825,7 +3711,7 @@ function eu(e, t) {
|
|
|
3825
3711
|
getItemIndicatorProps(c) {
|
|
3826
3712
|
const u = p(c);
|
|
3827
3713
|
return t.element({
|
|
3828
|
-
...
|
|
3714
|
+
...Se.itemIndicator.attrs,
|
|
3829
3715
|
dir: a("dir"),
|
|
3830
3716
|
"aria-hidden": !0,
|
|
3831
3717
|
"data-state": u.expanded ? "open" : "closed",
|
|
@@ -3837,11 +3723,11 @@ function eu(e, t) {
|
|
|
3837
3723
|
getItemTriggerProps(c) {
|
|
3838
3724
|
const { value: u } = c, g = p(c);
|
|
3839
3725
|
return t.button({
|
|
3840
|
-
...
|
|
3726
|
+
...Se.itemTrigger.attrs,
|
|
3841
3727
|
type: "button",
|
|
3842
3728
|
dir: a("dir"),
|
|
3843
3729
|
id: st(i, u),
|
|
3844
|
-
"aria-controls":
|
|
3730
|
+
"aria-controls": kn(i, u),
|
|
3845
3731
|
"aria-expanded": g.expanded,
|
|
3846
3732
|
disabled: g.disabled,
|
|
3847
3733
|
"data-orientation": a("orientation"),
|
|
@@ -3888,7 +3774,7 @@ function eu(e, t) {
|
|
|
3888
3774
|
}
|
|
3889
3775
|
};
|
|
3890
3776
|
}
|
|
3891
|
-
var { and:
|
|
3777
|
+
var { and: Es, not: Cs } = Yn(), eu = oe({
|
|
3892
3778
|
props({ props: e }) {
|
|
3893
3779
|
return {
|
|
3894
3780
|
collapsible: !1,
|
|
@@ -3946,11 +3832,11 @@ var { and: $s, not: Ds } = Yn(), tu = oe({
|
|
|
3946
3832
|
},
|
|
3947
3833
|
"TRIGGER.CLICK": [
|
|
3948
3834
|
{
|
|
3949
|
-
guard:
|
|
3835
|
+
guard: Es("isExpanded", "canToggle"),
|
|
3950
3836
|
actions: ["collapse"]
|
|
3951
3837
|
},
|
|
3952
3838
|
{
|
|
3953
|
-
guard:
|
|
3839
|
+
guard: Cs("isExpanded"),
|
|
3954
3840
|
actions: ["expand"]
|
|
3955
3841
|
}
|
|
3956
3842
|
],
|
|
@@ -3982,20 +3868,20 @@ var { and: $s, not: Ds } = Yn(), tu = oe({
|
|
|
3982
3868
|
e.set("value", r);
|
|
3983
3869
|
},
|
|
3984
3870
|
focusFirstTrigger({ scope: e }) {
|
|
3985
|
-
|
|
3871
|
+
ms(e)?.focus();
|
|
3986
3872
|
},
|
|
3987
3873
|
focusLastTrigger({ scope: e }) {
|
|
3988
|
-
|
|
3874
|
+
bs(e)?.focus();
|
|
3989
3875
|
},
|
|
3990
3876
|
focusNextTrigger({ context: e, scope: t }) {
|
|
3991
3877
|
const n = e.get("focusedValue");
|
|
3992
3878
|
if (!n) return;
|
|
3993
|
-
|
|
3879
|
+
vs(t, n)?.focus();
|
|
3994
3880
|
},
|
|
3995
3881
|
focusPrevTrigger({ context: e, scope: t }) {
|
|
3996
3882
|
const n = e.get("focusedValue");
|
|
3997
3883
|
if (!n) return;
|
|
3998
|
-
|
|
3884
|
+
ys(t, n)?.focus();
|
|
3999
3885
|
},
|
|
4000
3886
|
setFocusedValue({ context: e, event: t }) {
|
|
4001
3887
|
e.set("focusedValue", t.value);
|
|
@@ -4027,8 +3913,8 @@ U()([
|
|
|
4027
3913
|
"defaultValue"
|
|
4028
3914
|
]);
|
|
4029
3915
|
U()(["value", "disabled"]);
|
|
4030
|
-
const
|
|
4031
|
-
var
|
|
3916
|
+
const tu = kr.extendWith("view");
|
|
3917
|
+
var Ss = J("editable").parts(
|
|
4032
3918
|
"root",
|
|
4033
3919
|
"area",
|
|
4034
3920
|
"label",
|
|
@@ -4038,8 +3924,8 @@ var Ls = J("editable").parts(
|
|
|
4038
3924
|
"submitTrigger",
|
|
4039
3925
|
"cancelTrigger",
|
|
4040
3926
|
"control"
|
|
4041
|
-
), te =
|
|
4042
|
-
function
|
|
3927
|
+
), te = Ss.build(), Is = (e) => e.ids?.root ?? `editable:${e.id}`, Ps = (e) => e.ids?.area ?? `editable:${e.id}:area`, Rs = (e) => e.ids?.label ?? `editable:${e.id}:label`, Lr = (e) => e.ids?.preview ?? `editable:${e.id}:preview`, Vt = (e) => e.ids?.input ?? `editable:${e.id}:input`, Os = (e) => e.ids?.control ?? `editable:${e.id}:control`, Mr = (e) => e.ids?.submitTrigger ?? `editable:${e.id}:submit`, Br = (e) => e.ids?.cancelTrigger ?? `editable:${e.id}:cancel`, _r = (e) => e.ids?.editTrigger ?? `editable:${e.id}:edit`, We = (e) => e.getById(Vt(e)), Ts = (e) => e.getById(Lr(e)), ws = (e) => e.getById(Mr(e)), ks = (e) => e.getById(Br(e)), As = (e) => e.getById(_r(e));
|
|
3928
|
+
function nu(e, t) {
|
|
4043
3929
|
const { state: n, context: r, send: a, prop: i, scope: o, computed: s } = e, l = i("disabled"), f = s("isInteractive"), d = i("readOnly"), p = i("invalid"), c = i("autoResize"), u = i("translations"), g = n.matches("edit"), h = i("placeholder"), y = typeof h == "string" ? { edit: h, preview: h } : h, w = r.get("value"), E = w.trim() === "", T = E ? y?.preview ?? "" : w;
|
|
4044
3930
|
return {
|
|
4045
3931
|
editing: g,
|
|
@@ -4064,14 +3950,14 @@ function ru(e, t) {
|
|
|
4064
3950
|
getRootProps() {
|
|
4065
3951
|
return t.element({
|
|
4066
3952
|
...te.root.attrs,
|
|
4067
|
-
id:
|
|
3953
|
+
id: Is(o),
|
|
4068
3954
|
dir: i("dir")
|
|
4069
3955
|
});
|
|
4070
3956
|
},
|
|
4071
3957
|
getAreaProps() {
|
|
4072
3958
|
return t.element({
|
|
4073
3959
|
...te.area.attrs,
|
|
4074
|
-
id:
|
|
3960
|
+
id: Ps(o),
|
|
4075
3961
|
dir: i("dir"),
|
|
4076
3962
|
style: c ? { display: "inline-grid" } : void 0,
|
|
4077
3963
|
"data-focus": m(g),
|
|
@@ -4082,14 +3968,14 @@ function ru(e, t) {
|
|
|
4082
3968
|
getLabelProps() {
|
|
4083
3969
|
return t.label({
|
|
4084
3970
|
...te.label.attrs,
|
|
4085
|
-
id:
|
|
3971
|
+
id: Rs(o),
|
|
4086
3972
|
dir: i("dir"),
|
|
4087
3973
|
htmlFor: Vt(o),
|
|
4088
3974
|
"data-focus": m(g),
|
|
4089
3975
|
"data-invalid": m(p),
|
|
4090
3976
|
onClick() {
|
|
4091
3977
|
if (g) return;
|
|
4092
|
-
|
|
3978
|
+
Ts(o)?.focus({ preventScroll: !0 });
|
|
4093
3979
|
}
|
|
4094
3980
|
});
|
|
4095
3981
|
},
|
|
@@ -4148,7 +4034,7 @@ function ru(e, t) {
|
|
|
4148
4034
|
},
|
|
4149
4035
|
getPreviewProps() {
|
|
4150
4036
|
return t.element({
|
|
4151
|
-
id:
|
|
4037
|
+
id: Lr(o),
|
|
4152
4038
|
...te.preview.attrs,
|
|
4153
4039
|
dir: i("dir"),
|
|
4154
4040
|
"data-placeholder-shown": m(E),
|
|
@@ -4186,7 +4072,7 @@ function ru(e, t) {
|
|
|
4186
4072
|
getEditTriggerProps() {
|
|
4187
4073
|
return t.button({
|
|
4188
4074
|
...te.editTrigger.attrs,
|
|
4189
|
-
id:
|
|
4075
|
+
id: _r(o),
|
|
4190
4076
|
dir: i("dir"),
|
|
4191
4077
|
"aria-label": u?.edit,
|
|
4192
4078
|
hidden: g,
|
|
@@ -4199,7 +4085,7 @@ function ru(e, t) {
|
|
|
4199
4085
|
},
|
|
4200
4086
|
getControlProps() {
|
|
4201
4087
|
return t.element({
|
|
4202
|
-
id:
|
|
4088
|
+
id: Os(o),
|
|
4203
4089
|
...te.control.attrs,
|
|
4204
4090
|
dir: i("dir")
|
|
4205
4091
|
});
|
|
@@ -4208,7 +4094,7 @@ function ru(e, t) {
|
|
|
4208
4094
|
return t.button({
|
|
4209
4095
|
...te.submitTrigger.attrs,
|
|
4210
4096
|
dir: i("dir"),
|
|
4211
|
-
id:
|
|
4097
|
+
id: Mr(o),
|
|
4212
4098
|
"aria-label": u?.submit,
|
|
4213
4099
|
hidden: !g,
|
|
4214
4100
|
disabled: l,
|
|
@@ -4223,7 +4109,7 @@ function ru(e, t) {
|
|
|
4223
4109
|
...te.cancelTrigger.attrs,
|
|
4224
4110
|
dir: i("dir"),
|
|
4225
4111
|
"aria-label": u?.cancel,
|
|
4226
|
-
id:
|
|
4112
|
+
id: Br(o),
|
|
4227
4113
|
hidden: !g,
|
|
4228
4114
|
type: "button",
|
|
4229
4115
|
disabled: l,
|
|
@@ -4234,7 +4120,7 @@ function ru(e, t) {
|
|
|
4234
4120
|
}
|
|
4235
4121
|
};
|
|
4236
4122
|
}
|
|
4237
|
-
var
|
|
4123
|
+
var ru = oe({
|
|
4238
4124
|
props({ props: e }) {
|
|
4239
4125
|
return {
|
|
4240
4126
|
activationMode: "focus",
|
|
@@ -4356,7 +4242,7 @@ var au = oe({
|
|
|
4356
4242
|
trackInteractOutside({ send: e, scope: t, prop: n, computed: r }) {
|
|
4357
4243
|
return Wa(We(t), {
|
|
4358
4244
|
exclude(a) {
|
|
4359
|
-
return [
|
|
4245
|
+
return [ks(t), ws(t)].some((o) => rt(o, a));
|
|
4360
4246
|
},
|
|
4361
4247
|
onFocusOutside: n("onFocusOutside"),
|
|
4362
4248
|
onPointerDownOutside: n("onPointerDownOutside"),
|
|
@@ -4375,7 +4261,7 @@ var au = oe({
|
|
|
4375
4261
|
actions: {
|
|
4376
4262
|
restoreFocus({ event: e, scope: t, prop: n }) {
|
|
4377
4263
|
e.focusable || G(() => {
|
|
4378
|
-
(n("finalFocusEl")?.() ??
|
|
4264
|
+
(n("finalFocusEl")?.() ?? As(t))?.focus({ preventScroll: !0 });
|
|
4379
4265
|
});
|
|
4380
4266
|
},
|
|
4381
4267
|
clearValue({ context: e }) {
|
|
@@ -4462,7 +4348,121 @@ U()([
|
|
|
4462
4348
|
"defaultValue",
|
|
4463
4349
|
"value"
|
|
4464
4350
|
]);
|
|
4465
|
-
var
|
|
4351
|
+
var Vs = (e) => typeof e.getAsEntry == "function" ? e.getAsEntry() : typeof e.webkitGetAsEntry == "function" ? e.webkitGetAsEntry() : null, Ur = (e) => e.isDirectory, Wr = (e) => e.isFile, Hr = (e, t) => (Object.defineProperty(e, "relativePath", { value: t ? `${t}/${e.name}` : e.name }), e), xs = (e, t) => Promise.all(
|
|
4352
|
+
Array.from(e).filter((n) => n.kind === "file").map((n) => {
|
|
4353
|
+
const r = Vs(n);
|
|
4354
|
+
if (!r) return null;
|
|
4355
|
+
if (Ur(r) && t)
|
|
4356
|
+
return jr(r.createReader(), `${r.name}`);
|
|
4357
|
+
if (Wr(r))
|
|
4358
|
+
return new Promise((a) => {
|
|
4359
|
+
r.file((i) => {
|
|
4360
|
+
a(Hr(i, ""));
|
|
4361
|
+
});
|
|
4362
|
+
});
|
|
4363
|
+
}).filter((n) => n)
|
|
4364
|
+
), jr = (e, t = "") => new Promise((n) => {
|
|
4365
|
+
const r = [], a = () => {
|
|
4366
|
+
e.readEntries((i) => {
|
|
4367
|
+
if (i.length === 0) {
|
|
4368
|
+
n(Promise.all(r).then((s) => s.flat()));
|
|
4369
|
+
return;
|
|
4370
|
+
}
|
|
4371
|
+
const o = i.map((s) => {
|
|
4372
|
+
if (!s) return null;
|
|
4373
|
+
if (Ur(s))
|
|
4374
|
+
return jr(s.createReader(), `${t}${s.name}`);
|
|
4375
|
+
if (Wr(s))
|
|
4376
|
+
return new Promise((l) => {
|
|
4377
|
+
s.file((f) => {
|
|
4378
|
+
l(Hr(f, t));
|
|
4379
|
+
});
|
|
4380
|
+
});
|
|
4381
|
+
}).filter((s) => s);
|
|
4382
|
+
r.push(Promise.all(o)), a();
|
|
4383
|
+
});
|
|
4384
|
+
};
|
|
4385
|
+
a();
|
|
4386
|
+
});
|
|
4387
|
+
function Ns(e) {
|
|
4388
|
+
return !!(e.navigator && e.navigator.msSaveOrOpenBlob);
|
|
4389
|
+
}
|
|
4390
|
+
function au(e) {
|
|
4391
|
+
const { file: t, win: n, type: r, name: a } = e, i = n.document, o = typeof t == "string" ? new Blob([t], { type: r }) : t, s = t instanceof File ? a || t.name : a;
|
|
4392
|
+
if (Ns(n)) {
|
|
4393
|
+
n.navigator.msSaveOrOpenBlob(o, s || "file-download");
|
|
4394
|
+
return;
|
|
4395
|
+
}
|
|
4396
|
+
const l = n.URL.createObjectURL(o), f = i.createElement("a");
|
|
4397
|
+
f.style.display = "none", f.href = l, f.rel = "noopener", f.download = s || "file-download", i.documentElement.appendChild(f), f.click(), setTimeout(() => {
|
|
4398
|
+
n.URL.revokeObjectURL(l), f.remove();
|
|
4399
|
+
}, 0);
|
|
4400
|
+
}
|
|
4401
|
+
function Fs(e) {
|
|
4402
|
+
return e === "audio/*" || e === "video/*" || e === "image/*" || e === "text/*" || /\w+\/[-+.\w]+/g.test(e);
|
|
4403
|
+
}
|
|
4404
|
+
function $s(e) {
|
|
4405
|
+
return /^.*\.[\w]+$/.test(e);
|
|
4406
|
+
}
|
|
4407
|
+
var An = (e) => Fs(e) || $s(e);
|
|
4408
|
+
function Ds(e) {
|
|
4409
|
+
if (e != null)
|
|
4410
|
+
return typeof e == "string" ? e : Array.isArray(e) ? e.filter(An).join(",") : Object.entries(e).reduce((t, [n, r]) => [...t, n, ...r], []).filter(An).join(",");
|
|
4411
|
+
}
|
|
4412
|
+
var Vn = (e, t) => e.name === t.name && e.size === t.size && e.type === t.type, Ie = (e) => e != null;
|
|
4413
|
+
function Ls(e, t, n) {
|
|
4414
|
+
if (Ie(e.size))
|
|
4415
|
+
if (Ie(t) && Ie(n)) {
|
|
4416
|
+
if (e.size > n) return [!1, "FILE_TOO_LARGE"];
|
|
4417
|
+
if (e.size < t) return [!1, "FILE_TOO_SMALL"];
|
|
4418
|
+
} else {
|
|
4419
|
+
if (Ie(t) && e.size < t)
|
|
4420
|
+
return [!1, "FILE_TOO_SMALL"];
|
|
4421
|
+
if (Ie(n) && e.size > n)
|
|
4422
|
+
return [!1, "FILE_TOO_LARGE"];
|
|
4423
|
+
}
|
|
4424
|
+
return [!0, null];
|
|
4425
|
+
}
|
|
4426
|
+
function Ms(e, t) {
|
|
4427
|
+
if (e && t) {
|
|
4428
|
+
const n = Array.isArray(t) ? t : typeof t == "string" ? t.split(",") : [];
|
|
4429
|
+
if (n.length === 0) return !0;
|
|
4430
|
+
const r = e.name || "", a = (e.type || "").toLowerCase(), i = a.replace(/\/.*$/, "");
|
|
4431
|
+
return n.some((o) => {
|
|
4432
|
+
const s = o.trim().toLowerCase();
|
|
4433
|
+
return s.charAt(0) === "." ? r.toLowerCase().endsWith(s) : s.endsWith("/*") ? i === s.replace(/\/.*$/, "") : a === s;
|
|
4434
|
+
});
|
|
4435
|
+
}
|
|
4436
|
+
return !0;
|
|
4437
|
+
}
|
|
4438
|
+
function Bs(e, t) {
|
|
4439
|
+
const n = e.type === "application/x-moz-file" || Ms(e, t);
|
|
4440
|
+
return [n, n ? null : "FILE_INVALID_TYPE"];
|
|
4441
|
+
}
|
|
4442
|
+
function _s(e) {
|
|
4443
|
+
const t = /* @__PURE__ */ new Map();
|
|
4444
|
+
return function(r, a) {
|
|
4445
|
+
const i = r + (a ? Object.entries(a).sort((s, l) => s[0] < l[0] ? -1 : 1).join() : "");
|
|
4446
|
+
if (t.has(i))
|
|
4447
|
+
return t.get(i);
|
|
4448
|
+
let o = new e(r, a);
|
|
4449
|
+
return t.set(i, o), o;
|
|
4450
|
+
};
|
|
4451
|
+
}
|
|
4452
|
+
var Us = _s(Intl.NumberFormat);
|
|
4453
|
+
function Ws(e, t, n = {}) {
|
|
4454
|
+
return Us(t, n).format(e);
|
|
4455
|
+
}
|
|
4456
|
+
var Hs = ["", "kilo", "mega", "giga", "tera"], js = ["", "kilo", "mega", "giga", "tera", "peta"], Gs = (e, t = "en-US", n = {}) => {
|
|
4457
|
+
if (isNaN(e)) return "";
|
|
4458
|
+
if (e === 0) return "0 B";
|
|
4459
|
+
const { unit: r = "byte", unitDisplay: a = "short" } = n, i = r === "bit" ? Hs : js, o = Math.max(0, Math.min(Math.floor(Math.log10(e) / 3), i.length - 1)), s = i[o] + r, l = a || "short", f = parseFloat((e / Math.pow(1e3, o)).toPrecision(3));
|
|
4460
|
+
return Ws(f, t, {
|
|
4461
|
+
style: "unit",
|
|
4462
|
+
unit: s,
|
|
4463
|
+
unitDisplay: l
|
|
4464
|
+
});
|
|
4465
|
+
}, zs = J("file-upload").parts(
|
|
4466
4466
|
"root",
|
|
4467
4467
|
"dropzone",
|
|
4468
4468
|
"item",
|
|
@@ -4487,7 +4487,7 @@ function tl(e, t) {
|
|
|
4487
4487
|
function nl(e, t) {
|
|
4488
4488
|
const { context: n, prop: r, computed: a } = e, i = [], o = [];
|
|
4489
4489
|
return t.forEach((s) => {
|
|
4490
|
-
const [l, f] =
|
|
4490
|
+
const [l, f] = Bs(s, a("acceptAttr")), [d, p] = Ls(s, r("minFileSize"), r("maxFileSize")), c = r("validate")?.(s, {
|
|
4491
4491
|
acceptedFiles: n.get("acceptedFiles"),
|
|
4492
4492
|
rejectedFiles: n.get("rejectedFiles")
|
|
4493
4493
|
}), u = c ? c.length === 0 : !0;
|
|
@@ -4541,7 +4541,7 @@ function iu(e, t) {
|
|
|
4541
4541
|
r({ type: "FILES.CLEAR" });
|
|
4542
4542
|
},
|
|
4543
4543
|
getFileSize(u) {
|
|
4544
|
-
return
|
|
4544
|
+
return Gs(u.size, a("locale"));
|
|
4545
4545
|
},
|
|
4546
4546
|
createFileUrl(u, g) {
|
|
4547
4547
|
const h = o.getWin(), y = h.URL.createObjectURL(u);
|
|
@@ -4601,7 +4601,7 @@ function iu(e, t) {
|
|
|
4601
4601
|
if (l) return;
|
|
4602
4602
|
f && (g.preventDefault(), g.stopPropagation());
|
|
4603
4603
|
const h = Nn(g);
|
|
4604
|
-
l || !h ||
|
|
4604
|
+
l || !h || xs(g.dataTransfer.items, a("directory")).then((y) => {
|
|
4605
4605
|
r({ type: "DROPZONE.DROP", files: ja(y) });
|
|
4606
4606
|
});
|
|
4607
4607
|
},
|
|
@@ -4766,7 +4766,7 @@ var ou = oe({
|
|
|
4766
4766
|
return {
|
|
4767
4767
|
acceptedFiles: t(() => ({
|
|
4768
4768
|
defaultValue: [],
|
|
4769
|
-
isEqual: (r, a) => r.length === a?.length && r.every((i, o) =>
|
|
4769
|
+
isEqual: (r, a) => r.length === a?.length && r.every((i, o) => Vn(i, a[o])),
|
|
4770
4770
|
hash(r) {
|
|
4771
4771
|
return r.map((a) => `${a.name}-${a.size}`).join(",");
|
|
4772
4772
|
},
|
|
@@ -4777,7 +4777,7 @@ var ou = oe({
|
|
|
4777
4777
|
})),
|
|
4778
4778
|
rejectedFiles: t(() => ({
|
|
4779
4779
|
defaultValue: [],
|
|
4780
|
-
isEqual: (r, a) => r.length === a?.length && r.every((i, o) =>
|
|
4780
|
+
isEqual: (r, a) => r.length === a?.length && r.every((i, o) => Vn(i.file, a[o].file)),
|
|
4781
4781
|
onChange(r) {
|
|
4782
4782
|
const a = n();
|
|
4783
4783
|
e("onFileReject")?.({ files: r }), e("onFileChange")?.({ acceptedFiles: a.get("acceptedFiles"), rejectedFiles: r });
|
|
@@ -4786,7 +4786,7 @@ var ou = oe({
|
|
|
4786
4786
|
};
|
|
4787
4787
|
},
|
|
4788
4788
|
computed: {
|
|
4789
|
-
acceptAttr: ({ prop: e }) =>
|
|
4789
|
+
acceptAttr: ({ prop: e }) => Ds(e("accept")),
|
|
4790
4790
|
multiple: ({ prop: e }) => e("maxFiles") > 1
|
|
4791
4791
|
},
|
|
4792
4792
|
watch({ track: e, context: t, action: n }) {
|
|
@@ -7819,41 +7819,41 @@ U()([
|
|
|
7819
7819
|
]);
|
|
7820
7820
|
U()(["index", "name"]);
|
|
7821
7821
|
export {
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7822
|
+
cu as A,
|
|
7823
|
+
fu as B,
|
|
7824
|
+
du as C,
|
|
7825
|
+
hu as D,
|
|
7826
|
+
gu as E,
|
|
7827
|
+
mu as F,
|
|
7828
|
+
pu as G,
|
|
7829
|
+
au as H,
|
|
7830
|
+
Gs as I,
|
|
7831
|
+
Ws as J,
|
|
7832
7832
|
no as a,
|
|
7833
|
-
|
|
7833
|
+
tu as b,
|
|
7834
7834
|
Kc as c,
|
|
7835
7835
|
mc as d,
|
|
7836
7836
|
fc as e,
|
|
7837
7837
|
zs as f,
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7838
|
+
Ss as g,
|
|
7839
|
+
gs as h,
|
|
7840
|
+
wo as i,
|
|
7841
7841
|
fl as j,
|
|
7842
7842
|
Vl as k,
|
|
7843
7843
|
uc as l,
|
|
7844
7844
|
qc as m,
|
|
7845
7845
|
Xc as n,
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7846
|
+
Yc as o,
|
|
7847
|
+
eu as p,
|
|
7848
|
+
Qc as q,
|
|
7849
|
+
Jc as r,
|
|
7850
|
+
Zc as s,
|
|
7851
|
+
ru as t,
|
|
7852
|
+
nu as u,
|
|
7853
|
+
ou as v,
|
|
7854
|
+
iu as w,
|
|
7855
|
+
lu as x,
|
|
7856
|
+
su as y,
|
|
7857
|
+
uu as z
|
|
7858
7858
|
};
|
|
7859
|
-
//# sourceMappingURL=index-
|
|
7859
|
+
//# sourceMappingURL=index-BXFjoQqm.js.map
|