@codbex/harmonia 1.6.0 → 1.7.0
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/harmonia.css +2 -2
- package/dist/harmonia.esm.js +873 -163
- package/dist/harmonia.esm.min.js +2 -2
- package/dist/harmonia.esm.min.js.map +4 -4
- package/dist/harmonia.js +877 -166
- package/dist/harmonia.min.js +2 -2
- package/dist/harmonia.min.js.map +4 -4
- package/package.json +7 -8
package/dist/harmonia.esm.js
CHANGED
|
@@ -1905,49 +1905,18 @@ var require_nouislider = __commonJS({
|
|
|
1905
1905
|
}
|
|
1906
1906
|
});
|
|
1907
1907
|
|
|
1908
|
-
//
|
|
1909
|
-
var
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
function
|
|
1914
|
-
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
// node_modules/uuid/dist/rng.js
|
|
1918
|
-
var rnds8 = new Uint8Array(16);
|
|
1919
|
-
function rng() {
|
|
1920
|
-
return crypto.getRandomValues(rnds8);
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
// node_modules/uuid/dist/v4.js
|
|
1924
|
-
function v4(options, buf, offset3) {
|
|
1925
|
-
if (!buf && !options && crypto.randomUUID) {
|
|
1926
|
-
return crypto.randomUUID();
|
|
1927
|
-
}
|
|
1928
|
-
return _v4(options, buf, offset3);
|
|
1929
|
-
}
|
|
1930
|
-
function _v4(options, buf, offset3) {
|
|
1931
|
-
options = options || {};
|
|
1932
|
-
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
1933
|
-
if (rnds.length < 16) {
|
|
1934
|
-
throw new Error("Random bytes length must be >= 16");
|
|
1935
|
-
}
|
|
1936
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
1937
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
1938
|
-
if (buf) {
|
|
1939
|
-
offset3 = offset3 || 0;
|
|
1940
|
-
if (offset3 < 0 || offset3 + 16 > buf.length) {
|
|
1941
|
-
throw new RangeError(`UUID byte range ${offset3}:${offset3 + 15} is out of buffer bounds`);
|
|
1942
|
-
}
|
|
1943
|
-
for (let i = 0; i < 16; ++i) {
|
|
1944
|
-
buf[offset3 + i] = rnds[i];
|
|
1945
|
-
}
|
|
1946
|
-
return buf;
|
|
1908
|
+
// src/utils/uuid.js
|
|
1909
|
+
var uuidv4 = self?.crypto?.randomUUID ? function() {
|
|
1910
|
+
return self.crypto.randomUUID();
|
|
1911
|
+
} : function() {
|
|
1912
|
+
console.warn("UUIDv4: Running in a non-secure context!");
|
|
1913
|
+
function _p8(s) {
|
|
1914
|
+
const p = (Math.random().toString(16) + "000000000").substring(2, 10);
|
|
1915
|
+
return s ? `-${p.substring(0, 4)}-${p.substring(4, 8)}` : p;
|
|
1947
1916
|
}
|
|
1948
|
-
return
|
|
1949
|
-
}
|
|
1950
|
-
var
|
|
1917
|
+
return _p8() + _p8(true) + _p8(true) + _p8();
|
|
1918
|
+
};
|
|
1919
|
+
var uuid_default = uuidv4;
|
|
1951
1920
|
|
|
1952
1921
|
// src/common/icons.js
|
|
1953
1922
|
var Calendar = 0;
|
|
@@ -1962,6 +1931,23 @@ var Search = 8;
|
|
|
1962
1931
|
var Ellipsis = 9;
|
|
1963
1932
|
var Minus = 10;
|
|
1964
1933
|
var Plus = 11;
|
|
1934
|
+
var Close = 12;
|
|
1935
|
+
var Bell = 13;
|
|
1936
|
+
var Trash = 14;
|
|
1937
|
+
var Mail = 15;
|
|
1938
|
+
var Send = 16;
|
|
1939
|
+
var Export = 17;
|
|
1940
|
+
var Import = 18;
|
|
1941
|
+
var Edit = 19;
|
|
1942
|
+
var Menu = 20;
|
|
1943
|
+
var Reply = 21;
|
|
1944
|
+
var Refresh = 22;
|
|
1945
|
+
var CircleInfo = 23;
|
|
1946
|
+
var CircleWarning = 24;
|
|
1947
|
+
var CircleError = 25;
|
|
1948
|
+
var CircleSuccess = 26;
|
|
1949
|
+
var CircleUnknown = 27;
|
|
1950
|
+
var CircleUser = 28;
|
|
1965
1951
|
function setCalendarContent(svg) {
|
|
1966
1952
|
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1967
1953
|
path.setAttributeNS(
|
|
@@ -2088,6 +2074,222 @@ function setPlusContent(svg) {
|
|
|
2088
2074
|
);
|
|
2089
2075
|
svg.appendChild(path);
|
|
2090
2076
|
}
|
|
2077
|
+
function setCloseContent(svg) {
|
|
2078
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2079
|
+
path1.setAttributeNS(
|
|
2080
|
+
null,
|
|
2081
|
+
"d",
|
|
2082
|
+
"m12.95 3.0503c-0.2938-0.2938-0.76686-0.2938-1.0607 0l-3.8891 3.8891-3.8891-3.8891c-0.2938-0.2938-0.76686-0.2938-1.0607 0-0.2938 0.2938-0.2938 0.76686 0 1.0607l3.8891 3.8891-3.8891 3.8891c-0.2938 0.2938-0.2938 0.76686 0 1.0607 0.2938 0.2938 0.76686 0.2938 1.0607 0l3.8891-3.8891 3.8891 3.8891c0.2938 0.2938 0.76686 0.2938 1.0607 0 0.2938-0.2938 0.2938-0.76686 0-1.0607l-3.8891-3.8891 3.8891-3.8891c0.2938-0.2938 0.2938-0.76686 0-1.0607z"
|
|
2083
|
+
);
|
|
2084
|
+
svg.appendChild(path1);
|
|
2085
|
+
}
|
|
2086
|
+
function setBellContent(svg) {
|
|
2087
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2088
|
+
path1.setAttributeNS(null, "d", "m6.7206 13.171c-0.65794 0-0.78791 0.50739-0.53794 0.92414 0.72424 1.2064 2.9155 1.2064 3.6397 0 0.25-0.41678 0.11804-0.92414-0.53794-0.92414z");
|
|
2089
|
+
svg.appendChild(path1);
|
|
2090
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2091
|
+
path2.setAttributeNS(
|
|
2092
|
+
null,
|
|
2093
|
+
"d",
|
|
2094
|
+
"m8.0017 1.0011c-1.4533-0.029274-2.9825 0.51861-3.8425 1.7418-1.0308 1.3944-1.1644 3.1887-1.131 4.8636-0.019737 1.2007-0.5306 2.3761-1.3316 3.2619-0.32199 0.50537 0.16335 1.2079 0.74794 1.108 3.7645-0.0022 7.5293 0.0045 11.294-0.0034 0.60962-0.02615 0.89718-0.87008 0.45127-1.2798-0.84568-0.96782-1.2957-2.2626-1.2151-3.5465 0.026492-1.7605-0.29402-3.6931-1.625-4.9635-0.88559-0.8583-2.141-1.1911-3.3478-1.182zm0 1.2923c1.1918-0.059451 2.4095 0.52351 3.006 1.5756 0.73891 1.2564 0.62867 2.7544 0.66947 4.1572 0.05518 0.93177 0.35347 1.8382 0.78938 2.6591h-8.9282c0.60148-1.0838 0.86112-2.3294 0.80315-3.5635-9.659e-4 -1.4009 0.15123-2.9948 1.2579-3.9921 0.64424-0.60975 1.5307-0.85343 2.4026-0.83627z"
|
|
2095
|
+
);
|
|
2096
|
+
svg.appendChild(path2);
|
|
2097
|
+
}
|
|
2098
|
+
function setTrashContent(svg) {
|
|
2099
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2100
|
+
path1.setAttributeNS(
|
|
2101
|
+
null,
|
|
2102
|
+
"d",
|
|
2103
|
+
"m6.5156 6.9909c-0.36016 0-0.65232 0.29024-0.65234 0.65039l2e-3 1.1074v1.4844l-2e-3 1.1074c2.1e-5 0.36015 0.29218 0.65039 0.65234 0.65039 0.18009 0 0.34336-0.07187 0.46094-0.18945 0.11758-0.11758 0.18945-0.28085 0.18945-0.46094v-3.6992c0-0.18009-0.07187-0.34336-0.18945-0.46094-0.11758-0.11758-0.28085-0.18945-0.46094-0.18945z"
|
|
2104
|
+
);
|
|
2105
|
+
svg.appendChild(path1);
|
|
2106
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2107
|
+
path2.setAttributeNS(
|
|
2108
|
+
null,
|
|
2109
|
+
"d",
|
|
2110
|
+
"m6.4082 1c-1.0468 0-1.9082 0.86333-1.9082 1.9102v1.0703h-2.2285a0.63636 0.63636 0 0 0-0.63477 0.63672 0.63636 0.63636 0 0 0 0.63477 0.63672h0.63672v7.8379c0 1.0468 0.86333 1.9082 1.9102 1.9082h6.3633c1.0468 0 1.9082-0.86138 1.9082-1.9082v-7.8379h0.63672a0.63636 0.63636 0 0 0 0.63672-0.63672 0.63636 0.63636 0 0 0-0.63672-0.63672h-2.2266v-1.0703c-1e-6 -1.0468-0.86138-1.9102-1.9082-1.9102zm0 1.2734h3.1836c0.35899 0 0.63477 0.27773 0.63477 0.63672v1.0703h-4.4531v-1.0703c0-0.35899 0.27577-0.63672 0.63476-0.63672zm-2.2266 2.9805h7.6367v7.8379c0 0.35899-0.27773 0.63672-0.63672 0.63672h-6.3633c-0.35899 0-0.63672-0.27773-0.63672-0.63672z"
|
|
2111
|
+
);
|
|
2112
|
+
svg.appendChild(path2);
|
|
2113
|
+
const path3 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2114
|
+
path3.setAttributeNS(
|
|
2115
|
+
null,
|
|
2116
|
+
"d",
|
|
2117
|
+
"m9.4853 6.9909c-0.36016 0-0.65232 0.29024-0.65234 0.65039l2e-3 1.1074v1.4844l-2e-3 1.1074c2.1e-5 0.36015 0.29218 0.65039 0.65234 0.65039 0.18009 0 0.34336-0.07187 0.46094-0.18945 0.11758-0.11758 0.18945-0.28085 0.18945-0.46094v-3.6992c0-0.18009-0.07187-0.34336-0.18945-0.46094-0.11758-0.11758-0.28085-0.18945-0.46094-0.18945z"
|
|
2118
|
+
);
|
|
2119
|
+
svg.appendChild(path3);
|
|
2120
|
+
}
|
|
2121
|
+
function setMailContent(svg) {
|
|
2122
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2123
|
+
path1.setAttributeNS(
|
|
2124
|
+
null,
|
|
2125
|
+
"d",
|
|
2126
|
+
"m3 2.2725c-1.108 0-2 0.892-2 2v7.4551c0 1.108 0.892 2 2 2h10c1.108 0 2-0.892 2-2v-7.4551c0-1.108-0.892-2-2-2zm0.30078 1.2988h9.3984c0.554 0 1 0.446 1 1l-4.2031 2.7207c-0.46835 0.30545-0.96668 0.57394-1.4961 0.57422-0.52942-2.795e-4 -1.0277-0.26876-1.4961-0.57422l-4.2031-2.7207c0-0.554 0.446-1 1-1zm-1 2.5195 4.2031 2.7227c0.46835 0.30546 0.96668 0.45687 1.4961 0.45703 0.52942-1.57e-4 1.0277-0.15158 1.4961-0.45703l4.2031-2.7227v5.3379c0 0.554-0.446 1-1 1h-9.3984c-0.554 0-1-0.446-1-1z"
|
|
2127
|
+
);
|
|
2128
|
+
svg.appendChild(path1);
|
|
2129
|
+
}
|
|
2130
|
+
function setSendContent(svg) {
|
|
2131
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2132
|
+
path1.setAttributeNS(
|
|
2133
|
+
null,
|
|
2134
|
+
"d",
|
|
2135
|
+
"m14.072 1.0638-12.641 4.7555c-0.56634 0.21308-0.56955 1.0125-0.04008 1.2365l5.2444 2.2184 2.2084 5.2144 2e-3 0.0061c0.16229 0.59685 0.99893 0.674 1.2545 0.09819l4.8416-12.619c0.25524-0.64396-0.38635-1.1184-0.86973-0.90981zm-2.4308 2.3427-4.6272 4.5771-3.5491-1.501zm0.96993 0.91983-3.1483 8.2023-1.517-3.5851z"
|
|
2136
|
+
);
|
|
2137
|
+
svg.appendChild(path1);
|
|
2138
|
+
}
|
|
2139
|
+
function setExportContent(svg) {
|
|
2140
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2141
|
+
path1.setAttributeNS(
|
|
2142
|
+
null,
|
|
2143
|
+
"d",
|
|
2144
|
+
"m1.6367 8.873a0.6355 0.6355 0 0 0-0.63672 0.63477v3.1816c0 1.0469 0.8614 1.9102 1.9082 1.9102h10.184c1.0468 0 1.9082-0.86329 1.9082-1.9102v-3.1816a0.6355 0.6355 0 0 0-0.63672-0.63477 0.6355 0.6355 0 0 0-0.63476 0.63477v3.1816c0 0.35899-0.27773 0.63672-0.63672 0.63672h-10.184c-0.35899 1e-6 -0.63672-0.27773-0.63672-0.63672v-3.1816a0.6355 0.6355 0 0 0-0.63477-0.63477z"
|
|
2145
|
+
);
|
|
2146
|
+
svg.appendChild(path1);
|
|
2147
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2148
|
+
path2.setAttributeNS(
|
|
2149
|
+
null,
|
|
2150
|
+
"d",
|
|
2151
|
+
"m8 1.4004c-0.36016 0-0.65232 0.29024-0.65234 0.65039v6.123l-2.457-2.457c-0.25556-0.25556-0.66436-0.25556-0.91992 0-0.25467 0.25467-0.25658 0.6672-0.00195 0.92188l3.5703 3.5703c0.25408 0.25408 0.66556 0.2542 0.91992 0l3.5703-3.5703c0.25556-0.25556 0.25556-0.66436 0-0.91992-0.25467-0.25467-0.6672-0.25659-0.92188-0.00195l-2.457 2.459v-6.125c0-0.36142-0.28897-0.65039-0.65039-0.65039z"
|
|
2152
|
+
);
|
|
2153
|
+
svg.appendChild(path2);
|
|
2154
|
+
}
|
|
2155
|
+
function setImportContent(svg) {
|
|
2156
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2157
|
+
path1.setAttributeNS(
|
|
2158
|
+
null,
|
|
2159
|
+
"d",
|
|
2160
|
+
"m1.6367 8.873a0.6355 0.6355 0 0 0-0.63672 0.63477v3.1816c0 1.0469 0.8614 1.9102 1.9082 1.9102h10.184c1.0468 0 1.9082-0.86329 1.9082-1.9102v-3.1816a0.6355 0.6355 0 0 0-0.63672-0.63477 0.6355 0.6355 0 0 0-0.63476 0.63477v3.1816c0 0.35899-0.27773 0.63672-0.63672 0.63672h-10.184c-0.35899 1e-6 -0.63672-0.27773-0.63672-0.63672v-3.1816a0.6355 0.6355 0 0 0-0.63477-0.63477z"
|
|
2161
|
+
);
|
|
2162
|
+
svg.appendChild(path1);
|
|
2163
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2164
|
+
path2.setAttributeNS(
|
|
2165
|
+
null,
|
|
2166
|
+
"d",
|
|
2167
|
+
"m8 10.4c-0.36016 0-0.65232-0.29024-0.65234-0.65039v-6.123l-2.457 2.457c-0.25556 0.25556-0.66436 0.25556-0.91992 0-0.25467-0.25467-0.25658-0.6672-0.00195-0.92187l3.5703-3.5703c0.25408-0.25408 0.66556-0.2542 0.91992 0l3.5703 3.5703c0.25556 0.25556 0.25556 0.66436 0 0.91992-0.25467 0.25467-0.6672 0.25659-0.92188 0.00195l-2.457-2.459v6.125c0 0.36142-0.28897 0.65039-0.65039 0.65039z"
|
|
2168
|
+
);
|
|
2169
|
+
svg.appendChild(path2);
|
|
2170
|
+
}
|
|
2171
|
+
function setEditContent(svg) {
|
|
2172
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2173
|
+
path1.setAttributeNS(
|
|
2174
|
+
null,
|
|
2175
|
+
"d",
|
|
2176
|
+
"m13.713 1.5513c-0.73596-0.73596-1.9485-0.73464-2.6845 0.00137l-9.84 9.84c-0.11663 0.11665-0.1879 0.27904-0.18812 0.45726l-1e-7 2.5019c-6.96e-6 0.17354 0.070916 0.33848 0.1895 0.45863 0.12014 0.1186 0.2851 0.1895 0.45863 0.1895h2.5019c0.17854-1e-5 0.34044-0.07132 0.45726-0.18812l9.84-9.84c0.73601-0.73601 0.73733-1.9486 0.0014-2.6845zm-0.8953 0.8953 0.73601 0.73601c0.25239 0.25239 0.25102 0.64153-0.0014 0.89392l-0.75247 0.75249-1.6286-1.6286 0.75249-0.75249c0.25239-0.25239 0.64154-0.25376 0.89393-0.00137zm-2.5417 1.6492 1.6286 1.6286-7.9808 7.9808-1.6286-1.6286z"
|
|
2177
|
+
);
|
|
2178
|
+
svg.appendChild(path1);
|
|
2179
|
+
}
|
|
2180
|
+
function setMenuContent(svg) {
|
|
2181
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2182
|
+
path1.setAttributeNS(null, "d", "m2.75 2.6667h10.5c0.4155 0 0.75 0.3345 0.75 0.75s-0.3345 0.75-0.75 0.75h-10.5c-0.4155 0-0.75-0.3345-0.75-0.75s0.3345-0.75 0.75-0.75z");
|
|
2183
|
+
svg.appendChild(path1);
|
|
2184
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2185
|
+
path2.setAttributeNS(null, "d", "m2.75 7.25h10.5c0.4155 0 0.75 0.3345 0.75 0.75s-0.3345 0.75-0.75 0.75h-10.5c-0.4155 0-0.75-0.3345-0.75-0.75s0.3345-0.75 0.75-0.75z");
|
|
2186
|
+
svg.appendChild(path2);
|
|
2187
|
+
const path3 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2188
|
+
path3.setAttributeNS(null, "d", "m2.75 11.833h10.5c0.4155 0 0.75 0.3345 0.75 0.75s-0.3345 0.75-0.75 0.75h-10.5c-0.4155 0-0.75-0.3345-0.75-0.75s0.3345-0.75 0.75-0.75z");
|
|
2189
|
+
svg.appendChild(path3);
|
|
2190
|
+
}
|
|
2191
|
+
function setReplyContent(svg) {
|
|
2192
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2193
|
+
path1.setAttributeNS(
|
|
2194
|
+
null,
|
|
2195
|
+
"d",
|
|
2196
|
+
"m7.1956 2.0915c-0.17362 0-0.33638 0.0536-0.4883 0.16212l-5.6331 4.3948c-0.21703 0.17363-0.32423 0.38999-0.32423 0.65042-1e-6 0.26044 0.1072 0.47874 0.32423 0.65238l5.6331 4.3948c0.15192 0.10852 0.31468 0.16212 0.4883 0.16212 0.23874 0 0.43882-0.08138 0.60159-0.24415 0.16278-0.16277 0.24415-0.36285 0.24415-0.60159v-1.3575h0.94536c2.2661 0 3.3516 1.6295 4.3674 3.3888 0.11666 0.20206 0.30215 0.21485 0.48245 0.21485 0.21839 0 0.47762-0.15346 0.65628-0.46291 0.33483-0.5924 0.55854-1.215 0.668-1.8653 0.10946-0.65035 0.1175-1.2995 0.02734-1.9435-0.09014-0.64391-0.28195-1.2659-0.57816-1.8712-0.29619-0.60528-0.69702-1.1599-1.1993-1.6622-0.60528-0.60528-1.2885-1.0607-2.0548-1.3634-0.76626-0.30264-1.5493-0.45315-2.3478-0.45315h-0.96684v-1.3497c0-0.23874-0.08138-0.43882-0.24415-0.60159-0.16277-0.16278-0.36285-0.24415-0.60159-0.24415zm-0.4551 1.9825v0.71488h2e-3c-1.91e-4 0.4412 0.35755 0.79894 0.79887 0.79887h1.4669c1.0795 0 2.5837 0.5738 3.4201 1.4102 0.61816 0.61816 1.0403 1.3452 1.2657 2.1759 0.22537 0.83065 0.21539 1.8427-0.0293 2.6798-0.97733-1.6928-2.5629-2.8498-4.678-2.8498h-1.4454c-0.44132-7.2e-5 -0.79906 0.35767-0.79887 0.79887h-2e-3v0.72074l-4.1701-3.2228z"
|
|
2197
|
+
);
|
|
2198
|
+
svg.appendChild(path1);
|
|
2199
|
+
}
|
|
2200
|
+
function setRefreshContent(svg) {
|
|
2201
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2202
|
+
path1.setAttributeNS(
|
|
2203
|
+
null,
|
|
2204
|
+
"d",
|
|
2205
|
+
"m7.9707 0.75c-1.0016 0-1.9388 0.18895-2.8164 0.56641-0.87885 0.37799-1.6436 0.8916-2.2949 1.543-0.65124 0.65124-1.1649 1.4202-1.543 2.3086-0.37757 0.88727-0.56641 1.8304-0.56641 2.832s0.18888 1.9448 0.56641 2.832c0.37802 0.88836 0.89173 1.6574 1.543 2.3086 0.65124 0.65124 1.4202 1.1649 2.3086 1.543 0.88727 0.37757 1.8304 0.56641 2.832 0.56641 0.8314 0 1.6239-0.13224 2.3789-0.39648 0.75572-0.26451 1.4452-0.63563 2.0684-1.1172 0.62353-0.48181 1.1617-1.0492 1.6152-1.7012 0.45251-0.65049 0.77222-1.3715 0.96094-2.1641l2e-3 -2e-3 0.04297-0.13281c0.0065-0.0195 0.01172-0.04408 0.01172-0.07617 0-0.1934-0.06474-0.34794-0.19531-0.47852-0.13058-0.13057-0.28317-0.19336-0.47656-0.19336-0.13605 0-0.26917 0.04492-0.40234 0.14258-0.13208 0.09684-0.21022 0.20993-0.24414 0.3457-0.17355 0.65565-0.44381 1.2604-0.81055 1.8105-0.36657 0.54985-0.80651 1.018-1.3184 1.4043-0.51116 0.38578-1.0746 0.69046-1.6914 0.91211-0.61812 0.22216-1.2662 0.33208-1.9415 0.33208-0.8289 0-1.6015-0.15376-2.3164-0.46289-0.71353-0.30856-1.3406-0.73315-1.8809-1.2734-0.54029-0.5403-0.96684-1.1693-1.2754-1.8828-0.30913-0.71489-0.46289-1.4875-0.46289-2.3164-1e-7 -0.8289 0.15389-1.6058 0.46289-2.3301 0.30846-0.72294 0.72874-1.3518 1.2598-1.8828 0.53103-0.53103 1.1599-0.95131 1.8828-1.2598 0.72402-0.30891 1.4907-0.46289 2.3008-0.46289 1.0797 0 2.0859 0.26648 3.0117 0.79688 0.92594 0.53049 1.651 1.2595 2.1719 2.1855l0.06055 0.10742h-3.0117c-0.19448 1e-6 -0.35029 0.06014-0.48047 0.18164-0.12927 0.12065-0.19141 0.26754-0.19141 0.46094 0 0.19339 0.062788 0.34794 0.19336 0.47852 0.13057 0.13057 0.28512 0.19336 0.47852 0.19336h4.375c0.1934 0 0.34794-0.06279 0.47852-0.19336 0.13057-0.13057 0.19336-0.28512 0.19336-0.47852v-4.375c0-0.1934-0.06279-0.34794-0.19336-0.47852-0.13057-0.13057-0.28512-0.19336-0.47852-0.19336-0.19339 0-0.34029 0.06214-0.46094 0.19141-0.12151 0.13018-0.18164 0.28598-0.18164 0.48047v2.3613l-0.12891-0.17383c-0.67984-0.90645-1.533-1.6088-2.5625-2.1094-1.0298-0.50071-2.1207-0.75-3.2734-0.75z"
|
|
2206
|
+
);
|
|
2207
|
+
svg.appendChild(path1);
|
|
2208
|
+
}
|
|
2209
|
+
var circlePath = "M 8,0.75000006 A 7.25,7.25 0 0 0 0.75,8 7.25,7.25 0 0 0 8,15.25 7.25,7.25 0 0 0 15.25,8 7.25,7.25 0 0 0 8,0.75000006 Z M 8,2.0508 A 5.95,5.95 0 0 1 13.9492,8 5.95,5.95 0 0 1 8,13.9512 5.95,5.95 0 0 1 2.0508,8 5.95,5.95 0 0 1 8,2.0508 Z";
|
|
2210
|
+
function setCircleInfoContent(svg) {
|
|
2211
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2212
|
+
path1.setAttributeNS(null, "d", "m8 7.207c-0.36016 0-0.6505 0.29034-0.6505 0.6505v2.8306c0 0.36016 0.29034 0.6505 0.6505 0.6505 0.36016 0 0.6505-0.29034 0.6505-0.6505v-2.8306c0-0.36016-0.29034-0.6505-0.6505-0.6505z");
|
|
2213
|
+
svg.appendChild(path1);
|
|
2214
|
+
const circle1 = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
2215
|
+
circle1.setAttributeNS(null, "cx", "8.0032");
|
|
2216
|
+
circle1.setAttributeNS(null, "cy", "5.4545");
|
|
2217
|
+
circle1.setAttributeNS(null, "r", ".6505");
|
|
2218
|
+
svg.appendChild(circle1);
|
|
2219
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2220
|
+
path2.setAttributeNS(null, "d", circlePath);
|
|
2221
|
+
svg.appendChild(path2);
|
|
2222
|
+
}
|
|
2223
|
+
function setCircleWarningContent(svg) {
|
|
2224
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2225
|
+
path1.setAttributeNS(null, "d", "m8.0016 4.7327c-0.36016 0-0.6505 0.29034-0.6505 0.6505v2.8306c0 0.36016 0.29034 0.6505 0.6505 0.6505s0.6505-0.29034 0.6505-0.6505v-2.8306c0-0.36016-0.29034-0.6505-0.6505-0.6505z");
|
|
2226
|
+
svg.appendChild(path1);
|
|
2227
|
+
const circle1 = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
2228
|
+
circle1.setAttributeNS(null, "cx", "7.9984");
|
|
2229
|
+
circle1.setAttributeNS(null, "cy", "10.617");
|
|
2230
|
+
circle1.setAttributeNS(null, "r", ".6505");
|
|
2231
|
+
svg.appendChild(circle1);
|
|
2232
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2233
|
+
path2.setAttributeNS(null, "d", circlePath);
|
|
2234
|
+
svg.appendChild(path2);
|
|
2235
|
+
}
|
|
2236
|
+
function setCircleErrorContent(svg) {
|
|
2237
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2238
|
+
path1.setAttributeNS(null, "d", circlePath);
|
|
2239
|
+
svg.appendChild(path1);
|
|
2240
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2241
|
+
path2.setAttributeNS(
|
|
2242
|
+
null,
|
|
2243
|
+
"d",
|
|
2244
|
+
"m6.0166 5.3645c-0.16628 0-0.3336 0.06407-0.46094 0.19141-0.25467 0.25467-0.25465 0.6672 0 0.92188l1.5234 1.5215-1.5234 1.5234c-0.25467 0.25467-0.25469 0.6672 0 0.92187 0.25467 0.25467 0.66525 0.25467 0.91992 0l1.5234-1.5234 1.5234 1.5234c0.25467 0.25467 0.6672 0.25469 0.92187 0 0.25467-0.25467 0.25467-0.66525 0-0.91992l-1.5234-1.5234 1.5234-1.5234c0.25467-0.25467 0.25467-0.66525 0-0.91992-0.25467-0.25467-0.6672-0.2566-0.92187-2e-3l-1.5234 1.5234-1.5234-1.5234c-0.12734-0.12734-0.2927-0.19141-0.45898-0.19141z"
|
|
2245
|
+
);
|
|
2246
|
+
svg.appendChild(path2);
|
|
2247
|
+
}
|
|
2248
|
+
function setCircleSuccessContent(svg) {
|
|
2249
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2250
|
+
path1.setAttributeNS(null, "d", circlePath);
|
|
2251
|
+
svg.appendChild(path1);
|
|
2252
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2253
|
+
path2.setAttributeNS(
|
|
2254
|
+
null,
|
|
2255
|
+
"d",
|
|
2256
|
+
"m10.524 5.757c-0.16628 1e-6 -0.3336 0.06407-0.46094 0.19141l-2.7207 2.7227-1.1309-1.1328c-0.25467-0.25467-0.66525-0.25467-0.91992 0-0.25467 0.25467-0.25658 0.6672-0.00195 0.92188l1.5918 1.5918c0.25467 0.25467 0.66525 0.25463 0.91992 0l3.1836-3.1836c0.25465-0.25467 0.25274-0.66525-2e-3 -0.91992-0.12734-0.12734-0.2927-0.19141-0.45898-0.19141z"
|
|
2257
|
+
);
|
|
2258
|
+
svg.appendChild(path2);
|
|
2259
|
+
}
|
|
2260
|
+
function setCircleUnknownContent(svg) {
|
|
2261
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2262
|
+
path1.setAttributeNS(null, "d", circlePath);
|
|
2263
|
+
svg.appendChild(path1);
|
|
2264
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2265
|
+
path2.setAttributeNS(
|
|
2266
|
+
null,
|
|
2267
|
+
"d",
|
|
2268
|
+
"m8.0273 4.6844c-1.0807 0-1.8911 0.80753-1.8911 1.8654 0 0.2914 0.26536 0.55114 0.5572 0.55114 0.29183 0 0.55265-0.26874 0.55265-0.55114 0-0.25055 0.077134-0.43674 0.20289-0.56477 0.12576-0.12802 0.30885-0.21046 0.57839-0.21046 0.47844 0 0.72678 0.28654 0.72678 0.6541 0 0.27054-0.069541 0.42451-0.19381 0.58748-0.12338 0.16181-0.31514 0.32247-0.52843 0.52843-0.38485 0.36029-0.59051 0.86593-0.59051 1.3218 0 0.29183 0.25827 0.56628 0.55871 0.56628 0.30044 0 0.55871-0.27445 0.55871-0.56628 0-0.18611 0.052582-0.44507 0.24226-0.61625l0.00151-0.0015h0.00151c0.25623-0.23652 0.51176-0.45141 0.71618-0.72981 0.20442-0.27839 0.3437-0.62946 0.3437-1.0629 0-1.0019-0.8073-1.7715-1.8366-1.7715z"
|
|
2269
|
+
);
|
|
2270
|
+
svg.appendChild(path2);
|
|
2271
|
+
const circle1 = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
2272
|
+
circle1.setAttributeNS(null, "cx", "8");
|
|
2273
|
+
circle1.setAttributeNS(null, "cy", "10.665");
|
|
2274
|
+
circle1.setAttributeNS(null, "r", ".6505");
|
|
2275
|
+
svg.appendChild(circle1);
|
|
2276
|
+
}
|
|
2277
|
+
function setCircleUserContent(svg) {
|
|
2278
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2279
|
+
path1.setAttributeNS(
|
|
2280
|
+
null,
|
|
2281
|
+
"d",
|
|
2282
|
+
"m8 0.75a7.25 7.25 0 0 0-7.25 7.25 7.25 7.25 0 0 0 7.25 7.25 7.25 7.25 0 0 0 7.25-7.25 7.25 7.25 0 0 0-7.25-7.25zm0 1.3008a5.95 5.95 0 0 1 5.9492 5.9492 5.95 5.95 0 0 1-1.3965 3.832c-0.32045-0.54275-0.75894-0.96968-1.3125-1.2793-0.55697-0.31152-1.1549-0.4668-1.7969-0.4668h-2.8867c-0.64193 0-1.2399 0.15527-1.7969 0.4668-0.55356 0.30962-0.99205 0.73654-1.3125 1.2793a5.95 5.95 0 0 1-1.3965-3.832 5.95 5.95 0 0 1 5.9492-5.9492zm-1.4453 9.334h2.8906c0.45252 2.79e-4 0.86077 0.12397 1.2285 0.36914 0.23059 0.15372 0.52694 0.36032 0.82812 1.0566a5.95 5.95 0 0 1-3.502 1.1406 5.95 5.95 0 0 1-3.502-1.1406c0.30119-0.69632 0.59754-0.90292 0.82812-1.0566 0.36775-0.24517 0.776-0.36886 1.2285-0.36914z"
|
|
2283
|
+
);
|
|
2284
|
+
svg.appendChild(path1);
|
|
2285
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2286
|
+
path2.setAttributeNS(
|
|
2287
|
+
null,
|
|
2288
|
+
"d",
|
|
2289
|
+
"m8 3.555a2.719 2.719 0 0 0-2.7188 2.7188 2.719 2.719 0 0 0 2.7188 2.7188 2.719 2.719 0 0 0 2.7188-2.7188 2.719 2.719 0 0 0-2.7188-2.7188zm0 1.3008a1.4182 1.4182 0 0 1 1.418 1.418 1.4182 1.4182 0 0 1-1.418 1.418 1.4182 1.4182 0 0 1-1.418-1.418 1.4182 1.4182 0 0 1 1.418-1.418z"
|
|
2290
|
+
);
|
|
2291
|
+
svg.appendChild(path2);
|
|
2292
|
+
}
|
|
2091
2293
|
function createSvg({ icon, classes = "size-4", attrs } = {}) {
|
|
2092
2294
|
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2093
2295
|
svg.setAttributeNS(null, "width", "16");
|
|
@@ -2137,6 +2339,57 @@ function createSvg({ icon, classes = "size-4", attrs } = {}) {
|
|
|
2137
2339
|
case Plus:
|
|
2138
2340
|
setPlusContent(svg);
|
|
2139
2341
|
break;
|
|
2342
|
+
case Close:
|
|
2343
|
+
setCloseContent(svg);
|
|
2344
|
+
break;
|
|
2345
|
+
case Bell:
|
|
2346
|
+
setBellContent(svg);
|
|
2347
|
+
break;
|
|
2348
|
+
case Trash:
|
|
2349
|
+
setTrashContent(svg);
|
|
2350
|
+
break;
|
|
2351
|
+
case Mail:
|
|
2352
|
+
setMailContent(svg);
|
|
2353
|
+
break;
|
|
2354
|
+
case Send:
|
|
2355
|
+
setSendContent(svg);
|
|
2356
|
+
break;
|
|
2357
|
+
case Export:
|
|
2358
|
+
setExportContent(svg);
|
|
2359
|
+
break;
|
|
2360
|
+
case Import:
|
|
2361
|
+
setImportContent(svg);
|
|
2362
|
+
break;
|
|
2363
|
+
case Edit:
|
|
2364
|
+
setEditContent(svg);
|
|
2365
|
+
break;
|
|
2366
|
+
case Menu:
|
|
2367
|
+
setMenuContent(svg);
|
|
2368
|
+
break;
|
|
2369
|
+
case Reply:
|
|
2370
|
+
setReplyContent(svg);
|
|
2371
|
+
break;
|
|
2372
|
+
case Refresh:
|
|
2373
|
+
setRefreshContent(svg);
|
|
2374
|
+
break;
|
|
2375
|
+
case CircleInfo:
|
|
2376
|
+
setCircleInfoContent(svg);
|
|
2377
|
+
break;
|
|
2378
|
+
case CircleWarning:
|
|
2379
|
+
setCircleWarningContent(svg);
|
|
2380
|
+
break;
|
|
2381
|
+
case CircleError:
|
|
2382
|
+
setCircleErrorContent(svg);
|
|
2383
|
+
break;
|
|
2384
|
+
case CircleSuccess:
|
|
2385
|
+
setCircleSuccessContent(svg);
|
|
2386
|
+
break;
|
|
2387
|
+
case CircleUnknown:
|
|
2388
|
+
setCircleUnknownContent(svg);
|
|
2389
|
+
break;
|
|
2390
|
+
case CircleUser:
|
|
2391
|
+
setCircleUserContent(svg);
|
|
2392
|
+
break;
|
|
2140
2393
|
default:
|
|
2141
2394
|
break;
|
|
2142
2395
|
}
|
|
@@ -2144,8 +2397,8 @@ function createSvg({ icon, classes = "size-4", attrs } = {}) {
|
|
|
2144
2397
|
}
|
|
2145
2398
|
function setSvgContent(svg, icon) {
|
|
2146
2399
|
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
2147
|
-
svg.setAttribute("width", "
|
|
2148
|
-
svg.setAttribute("height", "
|
|
2400
|
+
svg.setAttribute("width", "100%");
|
|
2401
|
+
svg.setAttribute("height", "100%");
|
|
2149
2402
|
svg.setAttribute("viewBox", "0 0 16 16");
|
|
2150
2403
|
svg.setAttribute("fill", "currentColor");
|
|
2151
2404
|
switch (icon) {
|
|
@@ -2185,6 +2438,57 @@ function setSvgContent(svg, icon) {
|
|
|
2185
2438
|
case "plus":
|
|
2186
2439
|
setPlusContent(svg);
|
|
2187
2440
|
break;
|
|
2441
|
+
case "close":
|
|
2442
|
+
setCloseContent(svg);
|
|
2443
|
+
break;
|
|
2444
|
+
case "bell":
|
|
2445
|
+
setBellContent(svg);
|
|
2446
|
+
break;
|
|
2447
|
+
case "trash":
|
|
2448
|
+
setTrashContent(svg);
|
|
2449
|
+
break;
|
|
2450
|
+
case "mail":
|
|
2451
|
+
setMailContent(svg);
|
|
2452
|
+
break;
|
|
2453
|
+
case "send":
|
|
2454
|
+
setSendContent(svg);
|
|
2455
|
+
break;
|
|
2456
|
+
case "export":
|
|
2457
|
+
setExportContent(svg);
|
|
2458
|
+
break;
|
|
2459
|
+
case "import":
|
|
2460
|
+
setImportContent(svg);
|
|
2461
|
+
break;
|
|
2462
|
+
case "edit":
|
|
2463
|
+
setEditContent(svg);
|
|
2464
|
+
break;
|
|
2465
|
+
case "menu":
|
|
2466
|
+
setMenuContent(svg);
|
|
2467
|
+
break;
|
|
2468
|
+
case "reply":
|
|
2469
|
+
setReplyContent(svg);
|
|
2470
|
+
break;
|
|
2471
|
+
case "refresh":
|
|
2472
|
+
setRefreshContent(svg);
|
|
2473
|
+
break;
|
|
2474
|
+
case "circle-info":
|
|
2475
|
+
setCircleInfoContent(svg);
|
|
2476
|
+
break;
|
|
2477
|
+
case "circle-warning":
|
|
2478
|
+
setCircleWarningContent(svg);
|
|
2479
|
+
break;
|
|
2480
|
+
case "circle-error":
|
|
2481
|
+
setCircleErrorContent(svg);
|
|
2482
|
+
break;
|
|
2483
|
+
case "circle-success":
|
|
2484
|
+
setCircleSuccessContent(svg);
|
|
2485
|
+
break;
|
|
2486
|
+
case "circle-unknown":
|
|
2487
|
+
setCircleUnknownContent(svg);
|
|
2488
|
+
break;
|
|
2489
|
+
case "circle-user":
|
|
2490
|
+
setCircleUserContent(svg);
|
|
2491
|
+
break;
|
|
2188
2492
|
default:
|
|
2189
2493
|
break;
|
|
2190
2494
|
}
|
|
@@ -2206,7 +2510,7 @@ function accordion_default(Alpine) {
|
|
|
2206
2510
|
}
|
|
2207
2511
|
el.classList.add("border-b", "last:border-b-0", "[[data-variant=header]_&]:data-[state=closed]:border-b-0");
|
|
2208
2512
|
el.setAttribute("data-slot", "accordion-item");
|
|
2209
|
-
const itemId = expression ?? `ha${
|
|
2513
|
+
const itemId = expression ?? `ha${uuid_default()}`;
|
|
2210
2514
|
function getIsExpanded() {
|
|
2211
2515
|
if (accordion._h_accordion.single) {
|
|
2212
2516
|
if (accordion._h_accordion.expandedId !== "") {
|
|
@@ -2221,7 +2525,7 @@ function accordion_default(Alpine) {
|
|
|
2221
2525
|
}
|
|
2222
2526
|
el._h_accordionItem = Alpine2.reactive({
|
|
2223
2527
|
id: itemId,
|
|
2224
|
-
controls: `ha${
|
|
2528
|
+
controls: `ha${uuid_default()}`,
|
|
2225
2529
|
expanded: getIsExpanded()
|
|
2226
2530
|
});
|
|
2227
2531
|
const setAttributes = () => {
|
|
@@ -2393,22 +2697,49 @@ function alert_default(Alpine) {
|
|
|
2393
2697
|
});
|
|
2394
2698
|
}
|
|
2395
2699
|
|
|
2700
|
+
// src/common/class-list.js
|
|
2701
|
+
function classListStartsWith(classList, term) {
|
|
2702
|
+
for (let i = 0; i < classList.length; i++) {
|
|
2703
|
+
if (classList.item(i).startsWith(term)) {
|
|
2704
|
+
return true;
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
return false;
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2396
2710
|
// src/components/avatar.js
|
|
2397
2711
|
function avatar_default(Alpine) {
|
|
2398
2712
|
Alpine.directive("h-avatar", (el, _, { Alpine: Alpine2 }) => {
|
|
2713
|
+
if (!classListStartsWith(el.classList, "rounded")) {
|
|
2714
|
+
el.classList.add("rounded-full");
|
|
2715
|
+
}
|
|
2399
2716
|
el.classList.add(
|
|
2400
2717
|
"relative",
|
|
2401
2718
|
"bg-secondary",
|
|
2402
2719
|
"text-secondary-foreground",
|
|
2403
2720
|
"fill-secondary-foreground",
|
|
2404
|
-
"[[data-slot=toolbar]:not([data-variant=transparent])
|
|
2721
|
+
"[[data-slot=toolbar]:not([data-variant=transparent])>&]:border",
|
|
2722
|
+
'data-[variant="information"]:bg-information/10',
|
|
2723
|
+
'data-[variant="information"]:text-information',
|
|
2724
|
+
'data-[variant="information"]:border-information',
|
|
2725
|
+
'[&[data-variant="information"]>svg]:fill-information',
|
|
2726
|
+
'data-[variant="warning"]:bg-warning/10',
|
|
2727
|
+
'data-[variant="warning"]:text-warning',
|
|
2728
|
+
'data-[variant="warning"]:border-warning',
|
|
2729
|
+
'[&[data-variant="warning"]>svg]:fill-warning',
|
|
2730
|
+
'data-[variant="positive"]:bg-positive/10',
|
|
2731
|
+
'data-[variant="positive"]:text-positive',
|
|
2732
|
+
'data-[variant="positive"]:border-positive',
|
|
2733
|
+
'[&[data-variant="positive"]>svg]:fill-positive',
|
|
2734
|
+
'data-[variant="negative"]:bg-negative/10',
|
|
2735
|
+
'data-[variant="negative"]:text-negative',
|
|
2736
|
+
'data-[variant="negative"]:border-negative',
|
|
2737
|
+
'[&[data-variant="negative"]>svg]:fill-negative',
|
|
2405
2738
|
"has-[img]:border-0",
|
|
2406
2739
|
"flex",
|
|
2407
2740
|
"size-8",
|
|
2408
2741
|
"aspect-square",
|
|
2409
2742
|
"shrink-0",
|
|
2410
|
-
"overflow-hidden",
|
|
2411
|
-
"rounded-full",
|
|
2412
2743
|
"items-center",
|
|
2413
2744
|
"justify-center",
|
|
2414
2745
|
"text-sm",
|
|
@@ -2427,7 +2758,7 @@ function avatar_default(Alpine) {
|
|
|
2427
2758
|
if (!avatar) {
|
|
2428
2759
|
throw new Error(`${original2} must be inside an avatar element`);
|
|
2429
2760
|
}
|
|
2430
|
-
el.classList.add("aspect-square", "size-full");
|
|
2761
|
+
el.classList.add("aspect-square", "size-full", "rounded-[inherit]");
|
|
2431
2762
|
el.setAttribute("data-slot", "avatar-image");
|
|
2432
2763
|
el.setAttribute("role", "img");
|
|
2433
2764
|
let interval;
|
|
@@ -2461,7 +2792,7 @@ function avatar_default(Alpine) {
|
|
|
2461
2792
|
if (!avatar) {
|
|
2462
2793
|
throw new Error(`${original2} must be inside an avatar element`);
|
|
2463
2794
|
}
|
|
2464
|
-
el.classList.add("hidden", "bg-muted", "flex", "size-full", "items-center", "justify-center");
|
|
2795
|
+
el.classList.add("hidden", "bg-muted", "flex", "size-full", "items-center", "justify-center", "rounded-[inherit]");
|
|
2465
2796
|
el.setAttribute("data-slot", "avatar-fallback");
|
|
2466
2797
|
effect(() => {
|
|
2467
2798
|
if (avatar._h_avatar.fallback) el.classList.remove("hidden");
|
|
@@ -2521,6 +2852,59 @@ function badge_default(Alpine) {
|
|
|
2521
2852
|
observer.disconnect();
|
|
2522
2853
|
});
|
|
2523
2854
|
});
|
|
2855
|
+
Alpine.directive("h-badge-indicator", (el, _, { cleanup }) => {
|
|
2856
|
+
el.classList.add(
|
|
2857
|
+
"absolute",
|
|
2858
|
+
"-end-1",
|
|
2859
|
+
"-top-1",
|
|
2860
|
+
"[.rounded-full>&]:end-0",
|
|
2861
|
+
"[.rounded-full>&]:top-0",
|
|
2862
|
+
"inline-flex",
|
|
2863
|
+
"h-4",
|
|
2864
|
+
"min-w-4",
|
|
2865
|
+
"items-center",
|
|
2866
|
+
"justify-center",
|
|
2867
|
+
"rounded-full",
|
|
2868
|
+
"py-0.5",
|
|
2869
|
+
"px-1",
|
|
2870
|
+
"text-xs",
|
|
2871
|
+
"font-bold",
|
|
2872
|
+
"leading-none",
|
|
2873
|
+
"transform-gpu",
|
|
2874
|
+
"data-[dot=true]:p-0",
|
|
2875
|
+
"data-[dot=true]:min-w-3",
|
|
2876
|
+
"data-[dot=true]:h-3",
|
|
2877
|
+
"data-[ping=true]:before:absolute",
|
|
2878
|
+
"data-[ping=true]:before:inline-flex",
|
|
2879
|
+
"data-[ping=true]:before:w-full",
|
|
2880
|
+
"data-[ping=true]:before:h-full",
|
|
2881
|
+
"data-[ping=true]:before:rounded-full",
|
|
2882
|
+
"data-[ping=true]:before:opacity-75",
|
|
2883
|
+
"data-[ping=true]:before:animate-ping"
|
|
2884
|
+
);
|
|
2885
|
+
el.setAttribute("data-slot", "badge-indicator");
|
|
2886
|
+
const variants = {
|
|
2887
|
+
primary: ["bg-primary", "text-primary-foreground", "data-[ping=true]:before:bg-primary"],
|
|
2888
|
+
positive: ["bg-positive", "text-positive-foreground", "data-[ping=true]:before:bg-positive"],
|
|
2889
|
+
negative: ["bg-negative", "text-negative-foreground", "data-[ping=true]:before:bg-negative"],
|
|
2890
|
+
warning: ["bg-warning", "text-warning-foreground", "data-[ping=true]:before:bg-warning"],
|
|
2891
|
+
information: ["bg-information", "text-information-foreground", "data-[ping=true]:before:bg-information"]
|
|
2892
|
+
};
|
|
2893
|
+
function setVariant(variant) {
|
|
2894
|
+
for (const [_2, value] of Object.entries(variants)) {
|
|
2895
|
+
el.classList.remove(...value);
|
|
2896
|
+
}
|
|
2897
|
+
if (variants.hasOwnProperty(variant)) el.classList.add(...variants[variant]);
|
|
2898
|
+
}
|
|
2899
|
+
setVariant(el.getAttribute("data-variant") ?? "primary");
|
|
2900
|
+
const observer = new MutationObserver(() => {
|
|
2901
|
+
setVariant(el.getAttribute("data-variant") ?? "primary");
|
|
2902
|
+
});
|
|
2903
|
+
observer.observe(el, { attributes: true, attributeFilter: ["data-variant"] });
|
|
2904
|
+
cleanup(() => {
|
|
2905
|
+
observer.disconnect();
|
|
2906
|
+
});
|
|
2907
|
+
});
|
|
2524
2908
|
}
|
|
2525
2909
|
|
|
2526
2910
|
// src/components/button.js
|
|
@@ -4403,7 +4787,7 @@ function calendar_default(Alpine) {
|
|
|
4403
4787
|
header.appendChild(previousMonthBtn);
|
|
4404
4788
|
const headerLabel = document.createElement("h2");
|
|
4405
4789
|
headerLabel.classList.add("min-w-[8rem]", "text-center");
|
|
4406
|
-
headerLabel.setAttribute("id", `hdpl${
|
|
4790
|
+
headerLabel.setAttribute("id", `hdpl${uuid_default()}`);
|
|
4407
4791
|
headerLabel.setAttribute("aria-live", "polite");
|
|
4408
4792
|
header.appendChild(headerLabel);
|
|
4409
4793
|
const nextMonthBtn = document.createElement("button");
|
|
@@ -4446,7 +4830,7 @@ function calendar_default(Alpine) {
|
|
|
4446
4830
|
header.appendChild(nextYearBtn);
|
|
4447
4831
|
el.appendChild(header);
|
|
4448
4832
|
const datesTable = document.createElement("table");
|
|
4449
|
-
if (datepicker) datesTable.setAttribute("aria-labelledby", `hdpl${
|
|
4833
|
+
if (datepicker) datesTable.setAttribute("aria-labelledby", `hdpl${uuid_default()}`);
|
|
4450
4834
|
datesTable.classList.add("table-fixed", "border-separate", "border-spacing-1");
|
|
4451
4835
|
if (!datepicker) datesTable.classList.add("w-full");
|
|
4452
4836
|
const thead = document.createElement("thead");
|
|
@@ -4768,11 +5152,11 @@ function checkbox_default(Alpine) {
|
|
|
4768
5152
|
"bg-input-inner",
|
|
4769
5153
|
"border",
|
|
4770
5154
|
"border-input",
|
|
4771
|
-
"dark:has-[aria-invalid=true]:ring-negative/40",
|
|
5155
|
+
"dark:has-[input[aria-invalid=true]]:ring-negative/40",
|
|
4772
5156
|
"dark:has-[input:invalid]:ring-negative/40",
|
|
4773
5157
|
"duration-200",
|
|
4774
|
-
"has-[aria-invalid=true]:border-negative",
|
|
4775
|
-
"has-[aria-invalid=true]:ring-negative/20",
|
|
5158
|
+
"has-[input[aria-invalid=true]]:border-negative",
|
|
5159
|
+
"has-[input[aria-invalid=true]]:ring-negative/20",
|
|
4776
5160
|
"has-[input:checked]:bg-primary",
|
|
4777
5161
|
"has-[input:checked]:border-primary",
|
|
4778
5162
|
"has-[input:disabled]:cursor-not-allowed",
|
|
@@ -4871,7 +5255,7 @@ function datepicker_default(Alpine) {
|
|
|
4871
5255
|
});
|
|
4872
5256
|
el._h_datepicker = {
|
|
4873
5257
|
id: void 0,
|
|
4874
|
-
controls: `hdpc${
|
|
5258
|
+
controls: `hdpc${uuid_default()}`,
|
|
4875
5259
|
input: void 0,
|
|
4876
5260
|
state,
|
|
4877
5261
|
inTable: modifiers.includes("table")
|
|
@@ -4882,7 +5266,7 @@ function datepicker_default(Alpine) {
|
|
|
4882
5266
|
} else if (el._h_datepicker.input.hasAttribute("id")) {
|
|
4883
5267
|
el._h_datepicker.id = el._h_datepicker.input.getAttribute("id");
|
|
4884
5268
|
} else {
|
|
4885
|
-
const id = `hdp${
|
|
5269
|
+
const id = `hdp${uuid_default()}`;
|
|
4886
5270
|
el._h_datepicker.input.setAttribute("id", id);
|
|
4887
5271
|
el._h_datepicker.id = id;
|
|
4888
5272
|
}
|
|
@@ -5106,7 +5490,7 @@ function dialog_default(Alpine) {
|
|
|
5106
5490
|
const dialog = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "dialog");
|
|
5107
5491
|
if (dialog && (!dialog.hasAttribute("aria-labelledby") || !dialog.hasAttribute("aria-label"))) {
|
|
5108
5492
|
if (!el.hasAttribute("id")) {
|
|
5109
|
-
const id = `dht${
|
|
5493
|
+
const id = `dht${uuid_default()}`;
|
|
5110
5494
|
el.setAttribute("id", id);
|
|
5111
5495
|
}
|
|
5112
5496
|
dialog.setAttribute("aria-labelledby", el.getAttribute("id"));
|
|
@@ -5138,7 +5522,7 @@ function dialog_default(Alpine) {
|
|
|
5138
5522
|
const dialog = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "dialog");
|
|
5139
5523
|
if (dialog && (!dialog.hasAttribute("aria-describedby") || !dialog.hasAttribute("aria-description"))) {
|
|
5140
5524
|
if (!el.hasAttribute("id")) {
|
|
5141
|
-
const id = `dhd${
|
|
5525
|
+
const id = `dhd${uuid_default()}`;
|
|
5142
5526
|
el.setAttribute("id", id);
|
|
5143
5527
|
}
|
|
5144
5528
|
dialog.setAttribute("aria-describedby", el.getAttribute("id"));
|
|
@@ -5508,7 +5892,7 @@ function input_default(Alpine) {
|
|
|
5508
5892
|
input.setAttribute("aria-roledescription", "Number field");
|
|
5509
5893
|
}
|
|
5510
5894
|
if (!input.hasAttribute("id")) {
|
|
5511
|
-
input.setAttribute("id", `in${
|
|
5895
|
+
input.setAttribute("id", `in${uuid_default()}`);
|
|
5512
5896
|
}
|
|
5513
5897
|
input.setAttribute("tabindex", "0");
|
|
5514
5898
|
input.setAttribute("autocomplete", "off");
|
|
@@ -5731,14 +6115,14 @@ function list_default(Alpine) {
|
|
|
5731
6115
|
break;
|
|
5732
6116
|
}
|
|
5733
6117
|
}
|
|
5734
|
-
function
|
|
6118
|
+
function onClick(event) {
|
|
5735
6119
|
if (event.target.getAttribute("data-slot") === "list-item") selectOption(event.target);
|
|
5736
6120
|
}
|
|
5737
|
-
el.addEventListener("click",
|
|
6121
|
+
el.addEventListener("click", onClick);
|
|
5738
6122
|
el.addEventListener("keydown", onKeyDown);
|
|
5739
6123
|
cleanup(() => {
|
|
5740
6124
|
el.removeEventListener("keydown", onKeyDown);
|
|
5741
|
-
el.removeEventListener("click",
|
|
6125
|
+
el.removeEventListener("click", onClick);
|
|
5742
6126
|
});
|
|
5743
6127
|
});
|
|
5744
6128
|
Alpine.directive("h-list", (el) => {
|
|
@@ -5755,7 +6139,7 @@ function list_default(Alpine) {
|
|
|
5755
6139
|
throw new Error(`${original2} must be placed inside a list element`);
|
|
5756
6140
|
}
|
|
5757
6141
|
if (!el.hasAttribute("id")) {
|
|
5758
|
-
const id = `lbh${
|
|
6142
|
+
const id = `lbh${uuid_default()}`;
|
|
5759
6143
|
el.setAttribute("id", id);
|
|
5760
6144
|
}
|
|
5761
6145
|
list.setAttribute("aria-labelledby", el.getAttribute("id"));
|
|
@@ -5823,6 +6207,9 @@ function menu_default(Alpine) {
|
|
|
5823
6207
|
while (sibling && !sibling.hasOwnProperty("_menu_trigger")) {
|
|
5824
6208
|
sibling = sibling.previousElementSibling;
|
|
5825
6209
|
}
|
|
6210
|
+
if (!sibling.hasOwnProperty("_menu_trigger")) {
|
|
6211
|
+
throw new Error(`${original2} must be placed after the menu trigger`);
|
|
6212
|
+
}
|
|
5826
6213
|
return sibling;
|
|
5827
6214
|
})();
|
|
5828
6215
|
if (!isSubmenu && !menuTrigger) {
|
|
@@ -5846,8 +6233,8 @@ function menu_default(Alpine) {
|
|
|
5846
6233
|
left: "0px",
|
|
5847
6234
|
top: "0px"
|
|
5848
6235
|
});
|
|
5849
|
-
top.removeEventListener("contextmenu",
|
|
5850
|
-
top.removeEventListener("click",
|
|
6236
|
+
top.removeEventListener("contextmenu", onClick);
|
|
6237
|
+
top.removeEventListener("click", onClick);
|
|
5851
6238
|
el.removeEventListener("keydown", onKeyDown);
|
|
5852
6239
|
if (isSubmenu) {
|
|
5853
6240
|
if (closeParent) {
|
|
@@ -5879,7 +6266,7 @@ function menu_default(Alpine) {
|
|
|
5879
6266
|
}
|
|
5880
6267
|
return false;
|
|
5881
6268
|
}
|
|
5882
|
-
function
|
|
6269
|
+
function onClick(event) {
|
|
5883
6270
|
if (event.type === "contextmenu") event.preventDefault();
|
|
5884
6271
|
close(isSubmenu);
|
|
5885
6272
|
}
|
|
@@ -5997,8 +6384,8 @@ function menu_default(Alpine) {
|
|
|
5997
6384
|
listenForTrigger(false);
|
|
5998
6385
|
}
|
|
5999
6386
|
Alpine2.nextTick(() => {
|
|
6000
|
-
top.addEventListener("contextmenu",
|
|
6001
|
-
top.addEventListener("click",
|
|
6387
|
+
top.addEventListener("contextmenu", onClick);
|
|
6388
|
+
top.addEventListener("click", onClick);
|
|
6002
6389
|
el.addEventListener("keydown", onKeyDown);
|
|
6003
6390
|
});
|
|
6004
6391
|
Object.assign(el.style, {
|
|
@@ -6039,9 +6426,9 @@ function menu_default(Alpine) {
|
|
|
6039
6426
|
listenForTrigger(true);
|
|
6040
6427
|
}
|
|
6041
6428
|
cleanup(() => {
|
|
6042
|
-
listenForTrigger(false);
|
|
6043
|
-
top.removeEventListener("click",
|
|
6044
|
-
top.removeEventListener("contextmenu",
|
|
6429
|
+
if (menuTrigger) listenForTrigger(false);
|
|
6430
|
+
top.removeEventListener("click", onClick);
|
|
6431
|
+
top.removeEventListener("contextmenu", onClick);
|
|
6045
6432
|
el.removeEventListener("keydown", onKeyDown);
|
|
6046
6433
|
});
|
|
6047
6434
|
});
|
|
@@ -6384,6 +6771,293 @@ function menu_default(Alpine) {
|
|
|
6384
6771
|
});
|
|
6385
6772
|
}
|
|
6386
6773
|
|
|
6774
|
+
// src/utils/breakpoint-listener.js
|
|
6775
|
+
function getBreakpointListener(handler, breakpoint = 768, frame = false) {
|
|
6776
|
+
let bps = Number.isFinite(breakpoint) ? `${breakpoint}px` : breakpoint;
|
|
6777
|
+
const mql = frame ? window.matchMedia(`(width <= ${bps})`) : top.matchMedia(`(width <= ${bps})`);
|
|
6778
|
+
const onWidthChange = (event) => {
|
|
6779
|
+
handler(event.matches);
|
|
6780
|
+
};
|
|
6781
|
+
mql.addEventListener("change", onWidthChange);
|
|
6782
|
+
handler(mql.matches);
|
|
6783
|
+
return {
|
|
6784
|
+
_mql: mql,
|
|
6785
|
+
_onWidthChange: onWidthChange,
|
|
6786
|
+
remove() {
|
|
6787
|
+
this._mql.removeEventListener("change", this._onWidthChange);
|
|
6788
|
+
}
|
|
6789
|
+
};
|
|
6790
|
+
}
|
|
6791
|
+
|
|
6792
|
+
// src/components/notifications.js
|
|
6793
|
+
function notifications_default(Alpine) {
|
|
6794
|
+
Alpine.store("_h_notifications", {
|
|
6795
|
+
items: [],
|
|
6796
|
+
listeners: [],
|
|
6797
|
+
push(id = `hn${uuid_default()}`, template, position = "top-right", timeout = 5e3, data = {}) {
|
|
6798
|
+
if (!template) {
|
|
6799
|
+
throw new Error("Notification must have a template ID");
|
|
6800
|
+
}
|
|
6801
|
+
const item = {
|
|
6802
|
+
id,
|
|
6803
|
+
template,
|
|
6804
|
+
position,
|
|
6805
|
+
timeout,
|
|
6806
|
+
data: Alpine.reactive(data)
|
|
6807
|
+
};
|
|
6808
|
+
this.items.push(item);
|
|
6809
|
+
this.listeners.forEach((listener) => {
|
|
6810
|
+
if (listener.hasOwnProperty("added")) listener.added(item);
|
|
6811
|
+
});
|
|
6812
|
+
},
|
|
6813
|
+
update(id, data) {
|
|
6814
|
+
if (!id) {
|
|
6815
|
+
throw new Error("Cannot update a notification if an ID is not provided");
|
|
6816
|
+
}
|
|
6817
|
+
const index = this.items.findIndex((item) => item.id === id);
|
|
6818
|
+
if (index > -1) {
|
|
6819
|
+
for (const [key, value] of Object.entries(data)) {
|
|
6820
|
+
this.items[index].data[key] = value;
|
|
6821
|
+
}
|
|
6822
|
+
this.listeners.forEach((listener) => {
|
|
6823
|
+
if (listener.hasOwnProperty("updated")) listener.updated(id, data);
|
|
6824
|
+
});
|
|
6825
|
+
} else {
|
|
6826
|
+
console.error(`Notification with id "${id}" does not exist`);
|
|
6827
|
+
}
|
|
6828
|
+
},
|
|
6829
|
+
remove(id) {
|
|
6830
|
+
if (!id) {
|
|
6831
|
+
throw new Error("Cannot remove a notification if an ID is not provided");
|
|
6832
|
+
}
|
|
6833
|
+
this.listeners.forEach((listener) => {
|
|
6834
|
+
if (listener.hasOwnProperty("removed")) listener.removed(id);
|
|
6835
|
+
});
|
|
6836
|
+
this.items = this.items.filter((n) => n.id !== id);
|
|
6837
|
+
}
|
|
6838
|
+
});
|
|
6839
|
+
Alpine.magic("notifications", () => {
|
|
6840
|
+
return {
|
|
6841
|
+
add({ id, template, position, timeout, data } = {}) {
|
|
6842
|
+
Alpine.store("_h_notifications").push(id, template, position, timeout, data);
|
|
6843
|
+
},
|
|
6844
|
+
update({ id, data } = {}) {
|
|
6845
|
+
Alpine.store("_h_notifications").update(id, data);
|
|
6846
|
+
},
|
|
6847
|
+
remove(id) {
|
|
6848
|
+
Alpine.store("_h_notifications").remove(id);
|
|
6849
|
+
},
|
|
6850
|
+
addListener(listener) {
|
|
6851
|
+
Alpine.store("_h_notifications").listeners.push(listener);
|
|
6852
|
+
return Alpine.store("_h_notifications").listeners[Alpine.store("_h_notifications").listeners.length - 1];
|
|
6853
|
+
},
|
|
6854
|
+
removeListener(listener) {
|
|
6855
|
+
Alpine.store("_h_notifications").listeners = Alpine.store("_h_notifications").listeners.filter((item) => item !== listener);
|
|
6856
|
+
}
|
|
6857
|
+
};
|
|
6858
|
+
});
|
|
6859
|
+
Alpine.directive("h-notification-overlay", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
6860
|
+
if (el.tagName !== "SECTION") {
|
|
6861
|
+
throw new Error(`${original2} must be a button`);
|
|
6862
|
+
}
|
|
6863
|
+
const notificationTemplates = {};
|
|
6864
|
+
el.querySelectorAll("template").forEach((template) => {
|
|
6865
|
+
if (!template.hasAttribute("id")) {
|
|
6866
|
+
throw new Error("Notification templates must have an ID");
|
|
6867
|
+
}
|
|
6868
|
+
notificationTemplates[template.getAttribute("id")] = template;
|
|
6869
|
+
});
|
|
6870
|
+
el.classList.add("fixed", "w", "inset-0", "z-60", "pointer-events-none", "grid", "grid-rows-2", "grid-cols-1", "lg:grid-cols-2", "xl:grid-cols-3");
|
|
6871
|
+
el.setAttribute("tabindex", "-1");
|
|
6872
|
+
el.setAttribute("aria-live", "polite");
|
|
6873
|
+
el.setAttribute("aria-atomic", "false");
|
|
6874
|
+
el.setAttribute("data-slot", "notification-overlay");
|
|
6875
|
+
const commonListClasses = ["flex", "flex-col", "py-4", "p-10", "gap-4", "overflow-visible", "size-full"];
|
|
6876
|
+
const commonTopClasses = ["[mask-image:linear-gradient(to_bottom,black_80%,transparent)]", "row-1"];
|
|
6877
|
+
const commonBottomClasses = ["[mask-image:linear-gradient(to_top,black_80%,transparent)]", "row-2"];
|
|
6878
|
+
const olTopLeft = document.createElement("ol");
|
|
6879
|
+
olTopLeft.classList.add(...commonListClasses, ...commonTopClasses, "max-lg:hidden", "items-start");
|
|
6880
|
+
olTopLeft.setAttribute("tabindex", "-1");
|
|
6881
|
+
el.appendChild(olTopLeft);
|
|
6882
|
+
const olTopCenter = document.createElement("ol");
|
|
6883
|
+
olTopCenter.classList.add(...commonListClasses, ...commonTopClasses, "lg:col-2", "items-center");
|
|
6884
|
+
olTopCenter.setAttribute("tabindex", "-1");
|
|
6885
|
+
el.appendChild(olTopCenter);
|
|
6886
|
+
const olTopRight = document.createElement("ol");
|
|
6887
|
+
olTopRight.classList.add(...commonListClasses, ...commonTopClasses, "max-lg:hidden", "lg:col-2", "xl:col-3", "items-end");
|
|
6888
|
+
olTopRight.setAttribute("tabindex", "-1");
|
|
6889
|
+
el.appendChild(olTopRight);
|
|
6890
|
+
const olBottomLeft = document.createElement("ol");
|
|
6891
|
+
olBottomLeft.classList.add(...commonListClasses, ...commonBottomClasses, "max-lg:hidden", "items-start", "justify-end");
|
|
6892
|
+
olBottomLeft.setAttribute("tabindex", "-1");
|
|
6893
|
+
el.appendChild(olBottomLeft);
|
|
6894
|
+
const olBottomCenter = document.createElement("ol");
|
|
6895
|
+
olBottomCenter.classList.add(...commonListClasses, ...commonBottomClasses, "lg:col-2", "items-center", "justify-end");
|
|
6896
|
+
olBottomCenter.setAttribute("tabindex", "-1");
|
|
6897
|
+
el.appendChild(olBottomCenter);
|
|
6898
|
+
const olBottomRight = document.createElement("ol");
|
|
6899
|
+
olBottomRight.classList.add(...commonListClasses, ...commonBottomClasses, "max-lg:hidden", "lg:col-2", "xl:col-3", "items-end", "justify-end");
|
|
6900
|
+
olBottomRight.setAttribute("tabindex", "-1");
|
|
6901
|
+
el.appendChild(olBottomRight);
|
|
6902
|
+
let isLarge = true;
|
|
6903
|
+
let isExtraLarge = true;
|
|
6904
|
+
const lgBreakpointListener = getBreakpointListener((matches) => {
|
|
6905
|
+
isLarge = !matches;
|
|
6906
|
+
}, getComputedStyle(el).getPropertyValue("--breakpoint-lg").trim());
|
|
6907
|
+
const xlBreakpointListener = getBreakpointListener((matches) => {
|
|
6908
|
+
isExtraLarge = !matches;
|
|
6909
|
+
}, getComputedStyle(el).getPropertyValue("--breakpoint-xl").trim());
|
|
6910
|
+
const listener = {
|
|
6911
|
+
added(item) {
|
|
6912
|
+
const clone = notificationTemplates[item.template].content.firstElementChild.cloneNode(true);
|
|
6913
|
+
clone.classList.add("transform", "transition-all", "duration-300", "ease-out", "opacity-0");
|
|
6914
|
+
clone.setAttribute("id", item.id);
|
|
6915
|
+
Alpine2.addScopeToNode(clone, item.data);
|
|
6916
|
+
if (!isExtraLarge && !isLarge) {
|
|
6917
|
+
if (item.position.startsWith("top-")) {
|
|
6918
|
+
item.position = "top-center";
|
|
6919
|
+
} else {
|
|
6920
|
+
item.position = "bottom-center";
|
|
6921
|
+
}
|
|
6922
|
+
} else if (!isExtraLarge) {
|
|
6923
|
+
if (item.position === "top-center") {
|
|
6924
|
+
item.position = "top-right";
|
|
6925
|
+
} else if (item.position === "bottom-center") {
|
|
6926
|
+
item.position = "bottom-right";
|
|
6927
|
+
}
|
|
6928
|
+
}
|
|
6929
|
+
if (item.position === "top-left") {
|
|
6930
|
+
clone._h_animation_class = "-translate-x-full";
|
|
6931
|
+
clone.classList.add(clone._h_animation_class);
|
|
6932
|
+
olTopLeft.appendChild(clone);
|
|
6933
|
+
} else if (item.position === "top-center") {
|
|
6934
|
+
clone._h_animation_class = "-translate-y-full";
|
|
6935
|
+
clone.classList.add(clone._h_animation_class);
|
|
6936
|
+
olTopCenter.appendChild(clone);
|
|
6937
|
+
} else if (item.position === "top-right") {
|
|
6938
|
+
clone._h_animation_class = "translate-x-full";
|
|
6939
|
+
clone.classList.add(clone._h_animation_class);
|
|
6940
|
+
olTopRight.appendChild(clone);
|
|
6941
|
+
} else if (item.position === "bottom-left") {
|
|
6942
|
+
clone._h_animation_class = "-translate-x-full";
|
|
6943
|
+
clone.classList.add(clone._h_animation_class);
|
|
6944
|
+
olBottomLeft.appendChild(clone);
|
|
6945
|
+
} else if (item.position === "bottom-center") {
|
|
6946
|
+
clone._h_animation_class = "translate-y-full";
|
|
6947
|
+
clone.classList.add(clone._h_animation_class);
|
|
6948
|
+
olBottomCenter.appendChild(clone);
|
|
6949
|
+
} else {
|
|
6950
|
+
clone._h_animation_class = "translate-x-full";
|
|
6951
|
+
clone.classList.add(clone._h_animation_class);
|
|
6952
|
+
olBottomRight.appendChild(clone);
|
|
6953
|
+
}
|
|
6954
|
+
Alpine2.initTree(clone);
|
|
6955
|
+
Alpine2.nextTick(() => {
|
|
6956
|
+
clone.offsetHeight;
|
|
6957
|
+
clone.classList.remove(clone._h_animation_class, "opacity-0");
|
|
6958
|
+
});
|
|
6959
|
+
if (item.timeout > 0) {
|
|
6960
|
+
setTimeout(() => {
|
|
6961
|
+
Alpine2.store("_h_notifications").remove(item.id);
|
|
6962
|
+
}, item.timeout);
|
|
6963
|
+
}
|
|
6964
|
+
},
|
|
6965
|
+
removed(id) {
|
|
6966
|
+
const element = el.querySelector(`#${id}`);
|
|
6967
|
+
if (element) {
|
|
6968
|
+
element.addEventListener(
|
|
6969
|
+
"transitionend",
|
|
6970
|
+
() => {
|
|
6971
|
+
Alpine2.destroyTree(element);
|
|
6972
|
+
element.remove();
|
|
6973
|
+
},
|
|
6974
|
+
{ once: true }
|
|
6975
|
+
);
|
|
6976
|
+
element.classList.add(element._h_animation_class, "opacity-0");
|
|
6977
|
+
}
|
|
6978
|
+
}
|
|
6979
|
+
};
|
|
6980
|
+
Alpine2.store("_h_notifications").listeners.push(listener);
|
|
6981
|
+
if (Alpine2.store("_h_notifications").items.length) {
|
|
6982
|
+
Alpine2.store("_h_notifications").items.forEach((item) => {
|
|
6983
|
+
listener.added(item);
|
|
6984
|
+
});
|
|
6985
|
+
}
|
|
6986
|
+
cleanup(() => {
|
|
6987
|
+
lgBreakpointListener.remove();
|
|
6988
|
+
xlBreakpointListener.remove();
|
|
6989
|
+
});
|
|
6990
|
+
});
|
|
6991
|
+
Alpine.directive("h-notification-list", (el, { original: original2 }) => {
|
|
6992
|
+
if (el.tagName !== "OL" && el.tagName !== "UL") {
|
|
6993
|
+
throw new Error(`${original2} must be a list element`);
|
|
6994
|
+
}
|
|
6995
|
+
el.classList.add("flex", "flex-col", "divide-solid", "divide-y");
|
|
6996
|
+
el.setAttribute("data-slot", "notification-list");
|
|
6997
|
+
el.setAttribute("role", "group");
|
|
6998
|
+
});
|
|
6999
|
+
Alpine.directive("h-notification", (el, { original: original2, modifiers }) => {
|
|
7000
|
+
if (el.tagName !== "LI") {
|
|
7001
|
+
throw new Error(`${original2} must be a list item element`);
|
|
7002
|
+
}
|
|
7003
|
+
el.classList.add("pointer-events-auto", "p-3", "flex", "gap-2");
|
|
7004
|
+
if (modifiers.includes("floating")) {
|
|
7005
|
+
el.classList.add("rounded-lg", "data-[variant=toast]:rounded-full", "data-[variant=toast]:py-2", "border", "shadow-lg", "bg-popover", "text-popover-foreground");
|
|
7006
|
+
} else {
|
|
7007
|
+
el.classList.add("data-[unread=true]:border-l-warning", "data-[unread=true]:border-l-3");
|
|
7008
|
+
}
|
|
7009
|
+
el.setAttribute("data-slot", "notification");
|
|
7010
|
+
el.setAttribute("role", "alert");
|
|
7011
|
+
});
|
|
7012
|
+
Alpine.directive("h-notification-media", (el) => {
|
|
7013
|
+
if (!classListStartsWith(el.classList, "items-")) {
|
|
7014
|
+
el.classList.add("items-center");
|
|
7015
|
+
}
|
|
7016
|
+
if (!classListStartsWith(el.classList, "justify-")) {
|
|
7017
|
+
el.classList.add("justify-center");
|
|
7018
|
+
}
|
|
7019
|
+
el.classList.add("flex", "flex-col", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4", "[&>svg]:text-current");
|
|
7020
|
+
el.setAttribute("data-slot", "notification-media");
|
|
7021
|
+
});
|
|
7022
|
+
Alpine.directive("h-notification-title", (el) => {
|
|
7023
|
+
el.classList.add("line-clamp-1", "text-sm", "font-medium", "tracking-tight");
|
|
7024
|
+
el.setAttribute("data-slot", "notification-title");
|
|
7025
|
+
});
|
|
7026
|
+
Alpine.directive("h-notification-description", (el) => {
|
|
7027
|
+
el.classList.add("text-muted-foreground", "text-sm", "font-medium", "[&_p]:leading-relaxed");
|
|
7028
|
+
el.setAttribute("data-slot", "notification-description");
|
|
7029
|
+
});
|
|
7030
|
+
Alpine.directive("h-notification-actions", (el) => {
|
|
7031
|
+
if (!classListStartsWith(el.classList, "justify-")) {
|
|
7032
|
+
el.classList.add("[&[data-orientation=vertical]]:justify-center");
|
|
7033
|
+
}
|
|
7034
|
+
el.classList.add("flex", "gap-2", "data-[orientation=vertical]:flex-col");
|
|
7035
|
+
el.setAttribute("data-slot", "notification-actions");
|
|
7036
|
+
});
|
|
7037
|
+
Alpine.directive("h-notification-close", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
7038
|
+
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "notification-close");
|
|
7039
|
+
let nId;
|
|
7040
|
+
function close() {
|
|
7041
|
+
Alpine2.store("_h_notifications").remove(nId);
|
|
7042
|
+
}
|
|
7043
|
+
Alpine2.findClosest(el.parentElement, (parent) => {
|
|
7044
|
+
if (parent.getAttribute("data-slot") === "notification") {
|
|
7045
|
+
nId = parent.id;
|
|
7046
|
+
return true;
|
|
7047
|
+
}
|
|
7048
|
+
return false;
|
|
7049
|
+
});
|
|
7050
|
+
if (nId) {
|
|
7051
|
+
el.addEventListener("click", close);
|
|
7052
|
+
cleanup(() => {
|
|
7053
|
+
el.removeEventListener("click", close);
|
|
7054
|
+
});
|
|
7055
|
+
} else {
|
|
7056
|
+
console.error(`${original2} must be inside a notification with an id`);
|
|
7057
|
+
}
|
|
7058
|
+
});
|
|
7059
|
+
}
|
|
7060
|
+
|
|
6387
7061
|
// src/components/pagination.js
|
|
6388
7062
|
function pagination_default(Alpine) {
|
|
6389
7063
|
Alpine.directive("h-pagination", (el) => {
|
|
@@ -6469,7 +7143,7 @@ function popover_default(Alpine) {
|
|
|
6469
7143
|
Alpine.directive("h-popover-trigger", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
6470
7144
|
el._popover = Alpine2.reactive({
|
|
6471
7145
|
id: void 0,
|
|
6472
|
-
controls: `hpc${
|
|
7146
|
+
controls: `hpc${uuid_default()}`,
|
|
6473
7147
|
auto: expression ? false : true,
|
|
6474
7148
|
expanded: expression ? evaluate2(expression) : false
|
|
6475
7149
|
});
|
|
@@ -6489,7 +7163,7 @@ function popover_default(Alpine) {
|
|
|
6489
7163
|
if (el.hasAttribute("id")) {
|
|
6490
7164
|
el._popover.id = el.getAttribute("id");
|
|
6491
7165
|
} else {
|
|
6492
|
-
el._popover.id = `hp${
|
|
7166
|
+
el._popover.id = `hp${uuid_default()}`;
|
|
6493
7167
|
el.setAttribute("id", el._popover.id);
|
|
6494
7168
|
}
|
|
6495
7169
|
el.setAttribute("aria-controls", el._popover.controls);
|
|
@@ -6526,7 +7200,7 @@ function popover_default(Alpine) {
|
|
|
6526
7200
|
});
|
|
6527
7201
|
}
|
|
6528
7202
|
});
|
|
6529
|
-
Alpine.directive("h-popover", (el, { original: original2, modifiers }, { effect }) => {
|
|
7203
|
+
Alpine.directive("h-popover", (el, { original: original2, modifiers }, { effect, cleanup }) => {
|
|
6530
7204
|
const popover = (() => {
|
|
6531
7205
|
let sibling = el.previousElementSibling;
|
|
6532
7206
|
while (sibling && !sibling.hasOwnProperty("_popover")) {
|
|
@@ -6549,6 +7223,12 @@ function popover_default(Alpine) {
|
|
|
6549
7223
|
el.classList.remove("overflow-scroll");
|
|
6550
7224
|
el.classList.add("overflow-none");
|
|
6551
7225
|
}
|
|
7226
|
+
const stopPropagation = (event) => {
|
|
7227
|
+
event.stopPropagation();
|
|
7228
|
+
};
|
|
7229
|
+
if (el.getAttribute("data-innerclicks") === "true") {
|
|
7230
|
+
el.addEventListener("click", stopPropagation);
|
|
7231
|
+
}
|
|
6552
7232
|
let autoUpdateCleanup;
|
|
6553
7233
|
function updatePosition() {
|
|
6554
7234
|
computePosition2(popover, el, {
|
|
@@ -6585,6 +7265,9 @@ function popover_default(Alpine) {
|
|
|
6585
7265
|
});
|
|
6586
7266
|
}
|
|
6587
7267
|
});
|
|
7268
|
+
cleanup(() => {
|
|
7269
|
+
el.removeEventListener("click", stopPropagation);
|
|
7270
|
+
});
|
|
6588
7271
|
});
|
|
6589
7272
|
}
|
|
6590
7273
|
|
|
@@ -6641,10 +7324,10 @@ function radio_default(Alpine) {
|
|
|
6641
7324
|
"bg-input-inner",
|
|
6642
7325
|
"border",
|
|
6643
7326
|
"border-input",
|
|
6644
|
-
"dark:has-[aria-invalid=true]:ring-negative/40",
|
|
7327
|
+
"dark:has-[input[aria-invalid=true]]:ring-negative/40",
|
|
6645
7328
|
"dark:has-[input:invalid]:ring-negative/40",
|
|
6646
|
-
"has-[aria-invalid=true]:border-negative",
|
|
6647
|
-
"has-[aria-invalid=true]:ring-negative/20",
|
|
7329
|
+
"has-[input[aria-invalid=true]]:border-negative",
|
|
7330
|
+
"has-[input[aria-invalid=true]]:ring-negative/20",
|
|
6648
7331
|
"has-[input:checked]:before:visible",
|
|
6649
7332
|
"has-[input:disabled]:cursor-not-allowed",
|
|
6650
7333
|
"has-[input:disabled]:opacity-50",
|
|
@@ -6692,7 +7375,7 @@ function select_default(Alpine) {
|
|
|
6692
7375
|
el._h_select = Alpine2.reactive({
|
|
6693
7376
|
fieldLabelId: void 0,
|
|
6694
7377
|
trigger: void 0,
|
|
6695
|
-
controls: `hsc${
|
|
7378
|
+
controls: `hsc${uuid_default()}`,
|
|
6696
7379
|
expanded: false,
|
|
6697
7380
|
multiple: false,
|
|
6698
7381
|
label: [],
|
|
@@ -6716,10 +7399,10 @@ function select_default(Alpine) {
|
|
|
6716
7399
|
"has-focus-visible:border-ring",
|
|
6717
7400
|
"has-focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
6718
7401
|
"has-focus-visible:ring-ring/50",
|
|
6719
|
-
"dark:has-[aria-invalid=true]:ring-negative/40",
|
|
7402
|
+
"dark:has-[input[aria-invalid=true]]:ring-negative/40",
|
|
6720
7403
|
"dark:has-[input:invalid]:ring-negative/40",
|
|
6721
|
-
"has-[aria-invalid=true]:border-negative",
|
|
6722
|
-
"has-[aria-invalid=true]:ring-negative/20",
|
|
7404
|
+
"has-[input[aria-invalid=true]]:border-negative",
|
|
7405
|
+
"has-[input[aria-invalid=true]]:ring-negative/20",
|
|
6723
7406
|
"has-[input:invalid]:border-negative",
|
|
6724
7407
|
"has-[input:invalid]:ring-negative/20",
|
|
6725
7408
|
"hover:bg-secondary-hover",
|
|
@@ -6794,7 +7477,7 @@ function select_default(Alpine) {
|
|
|
6794
7477
|
let labelObserver;
|
|
6795
7478
|
if (label) {
|
|
6796
7479
|
if (!label.hasAttribute("id")) {
|
|
6797
|
-
label.setAttribute("id", `hsil${
|
|
7480
|
+
label.setAttribute("id", `hsil${uuid_default()}`);
|
|
6798
7481
|
}
|
|
6799
7482
|
select._h_select.fieldLabelId = label.getAttribute("id");
|
|
6800
7483
|
fakeTrigger.setAttribute("aria-labelledby", label.getAttribute("id"));
|
|
@@ -6950,7 +7633,7 @@ function select_default(Alpine) {
|
|
|
6950
7633
|
}
|
|
6951
7634
|
}
|
|
6952
7635
|
};
|
|
6953
|
-
const
|
|
7636
|
+
const onClick = () => {
|
|
6954
7637
|
select._h_select.expanded = !select._h_select.expanded;
|
|
6955
7638
|
if (select._h_select.expanded) {
|
|
6956
7639
|
if (!content) content = select.querySelector(`#${select._h_select.controls}`);
|
|
@@ -6971,14 +7654,14 @@ function select_default(Alpine) {
|
|
|
6971
7654
|
if (event.key === "Escape" && select._h_select.expanded) close(true);
|
|
6972
7655
|
else if (event.key === "Enter") {
|
|
6973
7656
|
event.preventDefault();
|
|
6974
|
-
|
|
7657
|
+
onClick();
|
|
6975
7658
|
} else if (event.key === " ") {
|
|
6976
7659
|
event.preventDefault();
|
|
6977
|
-
setTimeout(() =>
|
|
7660
|
+
setTimeout(() => onClick(), 0);
|
|
6978
7661
|
}
|
|
6979
7662
|
};
|
|
6980
7663
|
fakeTrigger.addEventListener("keydown", onPress);
|
|
6981
|
-
fakeTrigger.addEventListener("click",
|
|
7664
|
+
fakeTrigger.addEventListener("click", onClick);
|
|
6982
7665
|
const chevronDown = createSvg({
|
|
6983
7666
|
icon: ChevronDown,
|
|
6984
7667
|
classes: "opacity-70 text-foreground size-4 shrink-0 pointer-events-none transition-transform duration-200",
|
|
@@ -7001,7 +7684,7 @@ function select_default(Alpine) {
|
|
|
7001
7684
|
select._h_select.refreshLabel = onInputChange;
|
|
7002
7685
|
el.addEventListener("change", onInputChange);
|
|
7003
7686
|
cleanup(() => {
|
|
7004
|
-
fakeTrigger.removeEventListener("click",
|
|
7687
|
+
fakeTrigger.removeEventListener("click", onClick);
|
|
7005
7688
|
fakeTrigger.removeEventListener("keydown", onPress);
|
|
7006
7689
|
el.parentElement.removeEventListener("keydown", onKeyDown);
|
|
7007
7690
|
top.removeEventListener("click", close);
|
|
@@ -7098,11 +7781,11 @@ function select_default(Alpine) {
|
|
|
7098
7781
|
}
|
|
7099
7782
|
el.addEventListener("click", onActivate);
|
|
7100
7783
|
el.addEventListener("keydown", onActivate);
|
|
7784
|
+
function onInput() {
|
|
7785
|
+
select._h_select.search = searchInput.value.toLowerCase();
|
|
7786
|
+
}
|
|
7101
7787
|
if (select._h_select.filterType !== FilterType.none) {
|
|
7102
|
-
|
|
7103
|
-
select._h_select.search = searchInput.value.toLowerCase();
|
|
7104
|
-
};
|
|
7105
|
-
searchInput.addEventListener("keyup", onInput2);
|
|
7788
|
+
searchInput.addEventListener("keyup", onInput);
|
|
7106
7789
|
}
|
|
7107
7790
|
effect(() => {
|
|
7108
7791
|
if (select._h_select.expanded) searchInput.focus({ preventScroll: true });
|
|
@@ -7136,7 +7819,7 @@ function select_default(Alpine) {
|
|
|
7136
7819
|
el.setAttribute("data-slot", "select-label");
|
|
7137
7820
|
const selectGroup = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_selectGroup"));
|
|
7138
7821
|
if (selectGroup) {
|
|
7139
|
-
const id = `hsl${
|
|
7822
|
+
const id = `hsl${uuid_default()}`;
|
|
7140
7823
|
el.setAttribute("id", id);
|
|
7141
7824
|
selectGroup._h_selectGroup.labelledby = id;
|
|
7142
7825
|
}
|
|
@@ -7178,7 +7861,7 @@ function select_default(Alpine) {
|
|
|
7178
7861
|
);
|
|
7179
7862
|
el.setAttribute("data-slot", "select-option");
|
|
7180
7863
|
el.setAttribute("tabindex", "-1");
|
|
7181
|
-
const id = `hso${
|
|
7864
|
+
const id = `hso${uuid_default()}`;
|
|
7182
7865
|
el.setAttribute("role", "option");
|
|
7183
7866
|
el.setAttribute("aria-labelledby", id);
|
|
7184
7867
|
const indicatorEl = document.createElement("span");
|
|
@@ -7301,14 +7984,14 @@ function sheet_default(Alpine) {
|
|
|
7301
7984
|
el.setAttribute("data-open", isOpen);
|
|
7302
7985
|
});
|
|
7303
7986
|
});
|
|
7304
|
-
const
|
|
7987
|
+
const onClick = (event) => {
|
|
7305
7988
|
if (event.target.getAttribute("data-slot") === "sheet-overlay") {
|
|
7306
7989
|
evaluate2(`${expression} = false`);
|
|
7307
7990
|
}
|
|
7308
7991
|
};
|
|
7309
|
-
el.addEventListener("click",
|
|
7992
|
+
el.addEventListener("click", onClick);
|
|
7310
7993
|
cleanup(() => {
|
|
7311
|
-
el.removeEventListener("click",
|
|
7994
|
+
el.removeEventListener("click", onClick);
|
|
7312
7995
|
});
|
|
7313
7996
|
});
|
|
7314
7997
|
Alpine.directive("h-sheet", (el, _, { cleanup }) => {
|
|
@@ -7427,10 +8110,10 @@ function sidebar_default(Alpine) {
|
|
|
7427
8110
|
if (el.hasAttribute("id")) {
|
|
7428
8111
|
group._h_sidebar_group.controlId = el.getAttribute("id");
|
|
7429
8112
|
} else {
|
|
7430
|
-
group._h_sidebar_group.controlId = `sgl${
|
|
8113
|
+
group._h_sidebar_group.controlId = `sgl${uuid_default()}`;
|
|
7431
8114
|
el.setAttribute("id", group._h_sidebar_group.controlId);
|
|
7432
8115
|
}
|
|
7433
|
-
group._h_sidebar_group.controls = `sgc${
|
|
8116
|
+
group._h_sidebar_group.controls = `sgc${uuid_default()}`;
|
|
7434
8117
|
el.setAttribute("aria-controls", group._h_sidebar_group.controls);
|
|
7435
8118
|
el.setAttribute("aria-expanded", !group._h_sidebar_group.state.collapsed);
|
|
7436
8119
|
const handler = () => {
|
|
@@ -7618,10 +8301,10 @@ function sidebar_default(Alpine) {
|
|
|
7618
8301
|
if (el.hasAttribute("id")) {
|
|
7619
8302
|
menuItem._h_sidebar_menu_item.controlId = el.getAttribute("id");
|
|
7620
8303
|
} else {
|
|
7621
|
-
menuItem._h_sidebar_menu_item.controlId = `sgl${
|
|
8304
|
+
menuItem._h_sidebar_menu_item.controlId = `sgl${uuid_default()}`;
|
|
7622
8305
|
el.setAttribute("id", menuItem._h_sidebar_menu_item.controlId);
|
|
7623
8306
|
}
|
|
7624
|
-
menuItem._h_sidebar_menu_item.controls = `sgc${
|
|
8307
|
+
menuItem._h_sidebar_menu_item.controls = `sgc${uuid_default()}`;
|
|
7625
8308
|
el.setAttribute("aria-controls", menuItem._h_sidebar_menu_item.controls);
|
|
7626
8309
|
el.setAttribute("aria-expanded", !menuItem._h_sidebar_menu_item.state.collapsed);
|
|
7627
8310
|
const handler = () => {
|
|
@@ -7787,6 +8470,7 @@ function spinner_default(Alpine) {
|
|
|
7787
8470
|
"rounded-full",
|
|
7788
8471
|
"animate-spin"
|
|
7789
8472
|
);
|
|
8473
|
+
if (el.tagName === "SPAN") el.classList.add("inline-block");
|
|
7790
8474
|
el.setAttribute("role", "status");
|
|
7791
8475
|
el.setAttribute("data-slot", "spinner");
|
|
7792
8476
|
if (!el.hasAttribute("aria-label")) el.setAttribute("aria-label", "Loading");
|
|
@@ -7930,7 +8614,8 @@ function split_default(Alpine) {
|
|
|
7930
8614
|
});
|
|
7931
8615
|
};
|
|
7932
8616
|
const refreshGutters = () => {
|
|
7933
|
-
|
|
8617
|
+
const lastPanelIndex = panels.length - 1;
|
|
8618
|
+
panels.forEach((p, i) => p.setGutter(i === lastPanelIndex));
|
|
7934
8619
|
};
|
|
7935
8620
|
el._h_split = {
|
|
7936
8621
|
state,
|
|
@@ -7995,7 +8680,19 @@ function split_default(Alpine) {
|
|
|
7995
8680
|
if (!split) {
|
|
7996
8681
|
throw new Error(`${original2} must be inside an split element`);
|
|
7997
8682
|
}
|
|
7998
|
-
el.classList.add(
|
|
8683
|
+
el.classList.add(
|
|
8684
|
+
"flex",
|
|
8685
|
+
"shrink",
|
|
8686
|
+
"grow-0",
|
|
8687
|
+
"box-border",
|
|
8688
|
+
"overflow-visible",
|
|
8689
|
+
"[[data-orientation=horizontal]_&]:min-w-(--h-split-panel-min)",
|
|
8690
|
+
"[[data-orientation=horizontal]_&]:max-w-(--h-split-panel-max)",
|
|
8691
|
+
"[[data-orientation=horizontal]_&]:min-h-0",
|
|
8692
|
+
"[[data-orientation=vertical]_&]:min-h-(--h-split-panel-min)",
|
|
8693
|
+
"[[data-orientation=vertical]_&]:max-h-(--h-split-panel-max)",
|
|
8694
|
+
"[[data-orientation=vertical]_&]:min-w-0"
|
|
8695
|
+
);
|
|
7999
8696
|
el.setAttribute("tabindex", "-1");
|
|
8000
8697
|
el.setAttribute("data-slot", "split-panel");
|
|
8001
8698
|
let gutterless = el.getAttribute("data-gutterless") === "true";
|
|
@@ -8102,6 +8799,7 @@ function split_default(Alpine) {
|
|
|
8102
8799
|
effect(setVariant);
|
|
8103
8800
|
const initialSize = split._h_split.normalize(el.getAttribute("data-size"));
|
|
8104
8801
|
let handleSize = 0;
|
|
8802
|
+
let layoutFrame = null;
|
|
8105
8803
|
const panel = {
|
|
8106
8804
|
el,
|
|
8107
8805
|
gutter,
|
|
@@ -8122,9 +8820,13 @@ function split_default(Alpine) {
|
|
|
8122
8820
|
setGutter(last) {
|
|
8123
8821
|
if (this.hidden || gutterless || last) {
|
|
8124
8822
|
gutter.remove();
|
|
8125
|
-
} else
|
|
8126
|
-
|
|
8127
|
-
|
|
8823
|
+
} else {
|
|
8824
|
+
if (layoutFrame) cancelAnimationFrame(layoutFrame);
|
|
8825
|
+
layoutFrame = requestAnimationFrame(() => {
|
|
8826
|
+
el.after(gutter);
|
|
8827
|
+
handleSize = this.getHandleSize();
|
|
8828
|
+
layoutFrame = null;
|
|
8829
|
+
});
|
|
8128
8830
|
}
|
|
8129
8831
|
},
|
|
8130
8832
|
setHandleOffset() {
|
|
@@ -8150,6 +8852,7 @@ function split_default(Alpine) {
|
|
|
8150
8852
|
},
|
|
8151
8853
|
setLocked(locked = false) {
|
|
8152
8854
|
const panelLocked = el.getAttribute("data-locked") === "true";
|
|
8855
|
+
gutter.setAttribute("aria-disabled", locked || panelLocked);
|
|
8153
8856
|
if (locked) {
|
|
8154
8857
|
gutter.classList.add("pointer-events-none");
|
|
8155
8858
|
} else if (panelLocked) {
|
|
@@ -8159,6 +8862,10 @@ function split_default(Alpine) {
|
|
|
8159
8862
|
}
|
|
8160
8863
|
}
|
|
8161
8864
|
};
|
|
8865
|
+
el.style.setProperty("--h-split-panel-min", `${panel.min}px`);
|
|
8866
|
+
if (panel.max < Infinity) {
|
|
8867
|
+
el.style.setProperty("--h-split-panel-max", `${panel.max}px`);
|
|
8868
|
+
}
|
|
8162
8869
|
split._h_split.addPanel(panel);
|
|
8163
8870
|
const drag = (e) => {
|
|
8164
8871
|
e.preventDefault();
|
|
@@ -8871,7 +9578,7 @@ function timepicker_default(Alpine) {
|
|
|
8871
9578
|
Alpine.directive("h-time-picker", (el, { expression, modifiers }, { evaluateLater, cleanup, effect, Alpine: Alpine2 }) => {
|
|
8872
9579
|
el._h_timepicker = Alpine2.reactive({
|
|
8873
9580
|
id: void 0,
|
|
8874
|
-
controls: `htpc${
|
|
9581
|
+
controls: `htpc${uuid_default()}`,
|
|
8875
9582
|
model: void 0,
|
|
8876
9583
|
expanded: false,
|
|
8877
9584
|
is12Hour: false,
|
|
@@ -9029,7 +9736,7 @@ function timepicker_default(Alpine) {
|
|
|
9029
9736
|
if (el.hasAttribute("id")) {
|
|
9030
9737
|
timepicker._h_timepicker.id = el.getAttribute("id");
|
|
9031
9738
|
} else {
|
|
9032
|
-
timepicker._h_timepicker.id = `htp${
|
|
9739
|
+
timepicker._h_timepicker.id = `htp${uuid_default()}`;
|
|
9033
9740
|
el.setAttribute("id", timepicker._h_timepicker.id);
|
|
9034
9741
|
}
|
|
9035
9742
|
el.classList.add(
|
|
@@ -9519,10 +10226,10 @@ function timepicker_default(Alpine) {
|
|
|
9519
10226
|
periodList.classList.add("hidden");
|
|
9520
10227
|
}
|
|
9521
10228
|
}
|
|
9522
|
-
const
|
|
10229
|
+
const onClick = (event) => {
|
|
9523
10230
|
event.stopPropagation();
|
|
9524
10231
|
};
|
|
9525
|
-
el.addEventListener("click",
|
|
10232
|
+
el.addEventListener("click", onClick);
|
|
9526
10233
|
let autoUpdateCleanup;
|
|
9527
10234
|
let focusFirstItem = true;
|
|
9528
10235
|
function updatePosition() {
|
|
@@ -9565,20 +10272,10 @@ function timepicker_default(Alpine) {
|
|
|
9565
10272
|
});
|
|
9566
10273
|
cleanup(() => {
|
|
9567
10274
|
el.removeEventListener("keydown", onKeyDown);
|
|
9568
|
-
el.removeEventListener("click",
|
|
10275
|
+
el.removeEventListener("click", onClick);
|
|
9569
10276
|
okButton.removeEventListener("click", timepicker._h_timepicker.close);
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
}
|
|
9573
|
-
for (let m = 0; m < minutesList.children.length; m++) {
|
|
9574
|
-
minutesList.children[m].removeEventListener("click", setMinute);
|
|
9575
|
-
}
|
|
9576
|
-
for (let s = 0; s < secondsList.children.length; s++) {
|
|
9577
|
-
secondsList.children[s].removeEventListener("click", setSecond);
|
|
9578
|
-
}
|
|
9579
|
-
for (let p = 0; p < periodList.children.length; p++) {
|
|
9580
|
-
periodList.children[p].removeEventListener("click", setPeriod);
|
|
9581
|
-
}
|
|
10277
|
+
nowButton.removeEventListener("click", getCurrentTime);
|
|
10278
|
+
timeContainer.removeEventListener("click", setTime);
|
|
9582
10279
|
});
|
|
9583
10280
|
});
|
|
9584
10281
|
}
|
|
@@ -9650,13 +10347,13 @@ function tooltip_default(Alpine) {
|
|
|
9650
10347
|
Alpine.directive("h-tooltip-trigger", (el, _, { Alpine: Alpine2, cleanup }) => {
|
|
9651
10348
|
el._tooltip = Alpine2.reactive({
|
|
9652
10349
|
id: void 0,
|
|
9653
|
-
controls: `hpc${
|
|
10350
|
+
controls: `hpc${uuid_default()}`,
|
|
9654
10351
|
shown: false
|
|
9655
10352
|
});
|
|
9656
10353
|
if (el.hasAttribute("id")) {
|
|
9657
10354
|
el._tooltip.id = el.getAttribute("id");
|
|
9658
10355
|
} else {
|
|
9659
|
-
el._tooltip.id = `hp${
|
|
10356
|
+
el._tooltip.id = `hp${uuid_default()}`;
|
|
9660
10357
|
el.setAttribute("id", el._tooltip.id);
|
|
9661
10358
|
}
|
|
9662
10359
|
el.setAttribute("aria-describedby", el._tooltip.controls);
|
|
@@ -9823,7 +10520,7 @@ function tree_default(Alpine) {
|
|
|
9823
10520
|
el.setAttribute("role", "tree");
|
|
9824
10521
|
el.addEventListener("keydown", onKeyDown);
|
|
9825
10522
|
cleanup(() => {
|
|
9826
|
-
el.removeEventListener("keydown",
|
|
10523
|
+
el.removeEventListener("keydown", onKeyDown);
|
|
9827
10524
|
});
|
|
9828
10525
|
}
|
|
9829
10526
|
});
|
|
@@ -9853,7 +10550,7 @@ function tree_default(Alpine) {
|
|
|
9853
10550
|
effect(() => {
|
|
9854
10551
|
if (!el.closest('[role="tree"]')) return;
|
|
9855
10552
|
});
|
|
9856
|
-
const
|
|
10553
|
+
const onClick = (event) => {
|
|
9857
10554
|
if (event.target === el || event.target.parentElement === el) {
|
|
9858
10555
|
if (el._h_tree_item.hasSubtree) {
|
|
9859
10556
|
if (expression === "false" || expression === "true") {
|
|
@@ -9868,9 +10565,9 @@ function tree_default(Alpine) {
|
|
|
9868
10565
|
el.setAttribute("tabindex", "0");
|
|
9869
10566
|
}
|
|
9870
10567
|
};
|
|
9871
|
-
el.addEventListener("click",
|
|
10568
|
+
el.addEventListener("click", onClick);
|
|
9872
10569
|
cleanup(() => {
|
|
9873
|
-
el.removeEventListener("click",
|
|
10570
|
+
el.removeEventListener("click", onClick);
|
|
9874
10571
|
});
|
|
9875
10572
|
if (el._h_tree_item.hasSubtree) {
|
|
9876
10573
|
const setExpanded = (expanded) => {
|
|
@@ -9950,24 +10647,7 @@ function tree_default(Alpine) {
|
|
|
9950
10647
|
}
|
|
9951
10648
|
|
|
9952
10649
|
// package.json
|
|
9953
|
-
var version = "1.
|
|
9954
|
-
|
|
9955
|
-
// src/utils/breakpoint-listener.js
|
|
9956
|
-
function getBreakpointListener(handler, breakpoint = 768) {
|
|
9957
|
-
const mql = top.matchMedia(`(width <= ${breakpoint}px)`);
|
|
9958
|
-
const onWidthChange = (event) => {
|
|
9959
|
-
handler(event.matches);
|
|
9960
|
-
};
|
|
9961
|
-
mql.addEventListener("change", onWidthChange);
|
|
9962
|
-
handler(mql.matches);
|
|
9963
|
-
return {
|
|
9964
|
-
_mql: mql,
|
|
9965
|
-
_onWidthChange: onWidthChange,
|
|
9966
|
-
remove() {
|
|
9967
|
-
this._mql.removeEventListener("change", this._onWidthChange);
|
|
9968
|
-
}
|
|
9969
|
-
};
|
|
9970
|
-
}
|
|
10650
|
+
var version = "1.7.0";
|
|
9971
10651
|
|
|
9972
10652
|
// src/utils/theme.js
|
|
9973
10653
|
var colorSchemeKey = "codbex.harmonia.colorMode";
|
|
@@ -10025,10 +10705,7 @@ var setColorScheme = (mode) => {
|
|
|
10025
10705
|
var getColorScheme = () => {
|
|
10026
10706
|
const theme = localStorage.getItem(colorSchemeKey);
|
|
10027
10707
|
if (theme) return theme;
|
|
10028
|
-
|
|
10029
|
-
return "dark";
|
|
10030
|
-
}
|
|
10031
|
-
return "light";
|
|
10708
|
+
return "auto";
|
|
10032
10709
|
};
|
|
10033
10710
|
var getSystemColorScheme = () => {
|
|
10034
10711
|
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
@@ -10063,32 +10740,59 @@ function focus_default(Alpine) {
|
|
|
10063
10740
|
|
|
10064
10741
|
// src/utils/include.js
|
|
10065
10742
|
function include_default(Alpine) {
|
|
10066
|
-
Alpine.directive("h-include", (el, { modifiers, expression }, { evaluateLater, effect }) => {
|
|
10743
|
+
Alpine.directive("h-include", (el, { modifiers, expression }, { evaluateLater, effect, cleanup, Alpine: Alpine2 }) => {
|
|
10067
10744
|
const getUrl = evaluateLater(expression);
|
|
10745
|
+
function executeScript(oldScript) {
|
|
10746
|
+
return new Promise((resolve, reject) => {
|
|
10747
|
+
const newScript = document.createElement("script");
|
|
10748
|
+
for (const attr of oldScript.attributes) {
|
|
10749
|
+
newScript.setAttribute(attr.name, attr.value);
|
|
10750
|
+
}
|
|
10751
|
+
if (oldScript.src) {
|
|
10752
|
+
newScript.src = oldScript.src;
|
|
10753
|
+
newScript.onload = resolve;
|
|
10754
|
+
newScript.onerror = reject;
|
|
10755
|
+
} else {
|
|
10756
|
+
newScript.textContent = oldScript.textContent;
|
|
10757
|
+
resolve();
|
|
10758
|
+
}
|
|
10759
|
+
el.appendChild(newScript);
|
|
10760
|
+
});
|
|
10761
|
+
}
|
|
10762
|
+
function initTree() {
|
|
10763
|
+
for (let i = 0; i < el.children.length; i++) {
|
|
10764
|
+
if (el.children[i].tagName !== "SCRIPT") Alpine2.initTree(el.children[i]);
|
|
10765
|
+
}
|
|
10766
|
+
}
|
|
10767
|
+
function destroyTree() {
|
|
10768
|
+
if (el.children.length) {
|
|
10769
|
+
for (let i = 0; i < el.children.length; i++) {
|
|
10770
|
+
if (el.children[i].tagName !== "SCRIPT") Alpine2.initTree(el.children[i]);
|
|
10771
|
+
}
|
|
10772
|
+
}
|
|
10773
|
+
}
|
|
10068
10774
|
function getHtml(url) {
|
|
10069
10775
|
const parsed = new URL(url, window.location.origin);
|
|
10070
10776
|
if (parsed.origin === window.location.origin) {
|
|
10071
10777
|
fetch(url).then((response) => {
|
|
10072
10778
|
if (response.status === 200) return response.text();
|
|
10073
10779
|
throw response;
|
|
10074
|
-
}).then((content) => {
|
|
10780
|
+
}).then(async (content) => {
|
|
10075
10781
|
if (modifiers.includes("js")) {
|
|
10076
10782
|
const container = document.createElement("div");
|
|
10077
10783
|
container.innerHTML = content;
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
for (let a = 0; a < staticScript.attributes.length; a++) {
|
|
10081
|
-
script.setAttribute(staticScript.attributes[a].name, staticScript.attributes[a].value);
|
|
10082
|
-
}
|
|
10083
|
-
script.appendChild(document.createTextNode(staticScript.innerHTML));
|
|
10084
|
-
staticScript.remove();
|
|
10784
|
+
const scripts = [...container.querySelectorAll("script")];
|
|
10785
|
+
scripts.forEach((script) => script.remove());
|
|
10085
10786
|
while (container.childNodes.length > 0) {
|
|
10086
10787
|
el.appendChild(container.childNodes[0]);
|
|
10087
10788
|
}
|
|
10088
|
-
|
|
10789
|
+
for (const oldScript of scripts) {
|
|
10790
|
+
await executeScript(oldScript);
|
|
10791
|
+
}
|
|
10089
10792
|
} else {
|
|
10090
10793
|
el.innerHTML = content;
|
|
10091
10794
|
}
|
|
10795
|
+
initTree();
|
|
10092
10796
|
}).catch((response) => {
|
|
10093
10797
|
console.error(response);
|
|
10094
10798
|
});
|
|
@@ -10098,10 +10802,14 @@ function include_default(Alpine) {
|
|
|
10098
10802
|
}
|
|
10099
10803
|
effect(() => {
|
|
10100
10804
|
getUrl((url) => {
|
|
10805
|
+
destroyTree();
|
|
10806
|
+
el.innerHTML = "";
|
|
10101
10807
|
if (url) getHtml(url);
|
|
10102
|
-
else el.innerHTML = "";
|
|
10103
10808
|
});
|
|
10104
10809
|
});
|
|
10810
|
+
cleanup(() => {
|
|
10811
|
+
destroyTree();
|
|
10812
|
+
});
|
|
10105
10813
|
}).before("bind");
|
|
10106
10814
|
}
|
|
10107
10815
|
|
|
@@ -10148,6 +10856,7 @@ var registerComponents = (registerPlugin) => {
|
|
|
10148
10856
|
registerPlugin(label_default);
|
|
10149
10857
|
registerPlugin(list_default);
|
|
10150
10858
|
registerPlugin(menu_default);
|
|
10859
|
+
registerPlugin(notifications_default);
|
|
10151
10860
|
registerPlugin(pagination_default);
|
|
10152
10861
|
registerPlugin(popover_default);
|
|
10153
10862
|
registerPlugin(progress_default);
|
|
@@ -10195,6 +10904,7 @@ export {
|
|
|
10195
10904
|
label_default as Label,
|
|
10196
10905
|
list_default as List,
|
|
10197
10906
|
menu_default as Menu,
|
|
10907
|
+
notifications_default as Notifications,
|
|
10198
10908
|
pagination_default as Pagination,
|
|
10199
10909
|
popover_default as Popover,
|
|
10200
10910
|
progress_default as Progress,
|