@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.js
CHANGED
|
@@ -1,47 +1,16 @@
|
|
|
1
1
|
(() => {
|
|
2
|
-
//
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return crypto.getRandomValues(rnds8);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// node_modules/uuid/dist/v4.js
|
|
18
|
-
function v4(options, buf, offset4) {
|
|
19
|
-
if (!buf && !options && crypto.randomUUID) {
|
|
20
|
-
return crypto.randomUUID();
|
|
21
|
-
}
|
|
22
|
-
return _v4(options, buf, offset4);
|
|
23
|
-
}
|
|
24
|
-
function _v4(options, buf, offset4) {
|
|
25
|
-
options = options || {};
|
|
26
|
-
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
27
|
-
if (rnds.length < 16) {
|
|
28
|
-
throw new Error("Random bytes length must be >= 16");
|
|
29
|
-
}
|
|
30
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
31
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
32
|
-
if (buf) {
|
|
33
|
-
offset4 = offset4 || 0;
|
|
34
|
-
if (offset4 < 0 || offset4 + 16 > buf.length) {
|
|
35
|
-
throw new RangeError(`UUID byte range ${offset4}:${offset4 + 15} is out of buffer bounds`);
|
|
36
|
-
}
|
|
37
|
-
for (let i = 0; i < 16; ++i) {
|
|
38
|
-
buf[offset4 + i] = rnds[i];
|
|
39
|
-
}
|
|
40
|
-
return buf;
|
|
41
|
-
}
|
|
42
|
-
return unsafeStringify(rnds);
|
|
43
|
-
}
|
|
44
|
-
var v4_default = v4;
|
|
2
|
+
// src/utils/uuid.js
|
|
3
|
+
var uuidv4 = self?.crypto?.randomUUID ? function() {
|
|
4
|
+
return self.crypto.randomUUID();
|
|
5
|
+
} : function() {
|
|
6
|
+
console.warn("UUIDv4: Running in a non-secure context!");
|
|
7
|
+
function _p8(s) {
|
|
8
|
+
const p = (Math.random().toString(16) + "000000000").substring(2, 10);
|
|
9
|
+
return s ? `-${p.substring(0, 4)}-${p.substring(4, 8)}` : p;
|
|
10
|
+
}
|
|
11
|
+
return _p8() + _p8(true) + _p8(true) + _p8();
|
|
12
|
+
};
|
|
13
|
+
var uuid_default = uuidv4;
|
|
45
14
|
|
|
46
15
|
// src/common/icons.js
|
|
47
16
|
var Calendar = 0;
|
|
@@ -56,6 +25,23 @@
|
|
|
56
25
|
var Ellipsis = 9;
|
|
57
26
|
var Minus = 10;
|
|
58
27
|
var Plus = 11;
|
|
28
|
+
var Close = 12;
|
|
29
|
+
var Bell = 13;
|
|
30
|
+
var Trash = 14;
|
|
31
|
+
var Mail = 15;
|
|
32
|
+
var Send = 16;
|
|
33
|
+
var Export = 17;
|
|
34
|
+
var Import = 18;
|
|
35
|
+
var Edit = 19;
|
|
36
|
+
var Menu = 20;
|
|
37
|
+
var Reply = 21;
|
|
38
|
+
var Refresh = 22;
|
|
39
|
+
var CircleInfo = 23;
|
|
40
|
+
var CircleWarning = 24;
|
|
41
|
+
var CircleError = 25;
|
|
42
|
+
var CircleSuccess = 26;
|
|
43
|
+
var CircleUnknown = 27;
|
|
44
|
+
var CircleUser = 28;
|
|
59
45
|
function setCalendarContent(svg) {
|
|
60
46
|
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
61
47
|
path.setAttributeNS(
|
|
@@ -182,6 +168,222 @@
|
|
|
182
168
|
);
|
|
183
169
|
svg.appendChild(path);
|
|
184
170
|
}
|
|
171
|
+
function setCloseContent(svg) {
|
|
172
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
173
|
+
path1.setAttributeNS(
|
|
174
|
+
null,
|
|
175
|
+
"d",
|
|
176
|
+
"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"
|
|
177
|
+
);
|
|
178
|
+
svg.appendChild(path1);
|
|
179
|
+
}
|
|
180
|
+
function setBellContent(svg) {
|
|
181
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
182
|
+
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");
|
|
183
|
+
svg.appendChild(path1);
|
|
184
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
185
|
+
path2.setAttributeNS(
|
|
186
|
+
null,
|
|
187
|
+
"d",
|
|
188
|
+
"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"
|
|
189
|
+
);
|
|
190
|
+
svg.appendChild(path2);
|
|
191
|
+
}
|
|
192
|
+
function setTrashContent(svg) {
|
|
193
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
194
|
+
path1.setAttributeNS(
|
|
195
|
+
null,
|
|
196
|
+
"d",
|
|
197
|
+
"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"
|
|
198
|
+
);
|
|
199
|
+
svg.appendChild(path1);
|
|
200
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
201
|
+
path2.setAttributeNS(
|
|
202
|
+
null,
|
|
203
|
+
"d",
|
|
204
|
+
"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"
|
|
205
|
+
);
|
|
206
|
+
svg.appendChild(path2);
|
|
207
|
+
const path3 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
208
|
+
path3.setAttributeNS(
|
|
209
|
+
null,
|
|
210
|
+
"d",
|
|
211
|
+
"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"
|
|
212
|
+
);
|
|
213
|
+
svg.appendChild(path3);
|
|
214
|
+
}
|
|
215
|
+
function setMailContent(svg) {
|
|
216
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
217
|
+
path1.setAttributeNS(
|
|
218
|
+
null,
|
|
219
|
+
"d",
|
|
220
|
+
"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"
|
|
221
|
+
);
|
|
222
|
+
svg.appendChild(path1);
|
|
223
|
+
}
|
|
224
|
+
function setSendContent(svg) {
|
|
225
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
226
|
+
path1.setAttributeNS(
|
|
227
|
+
null,
|
|
228
|
+
"d",
|
|
229
|
+
"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"
|
|
230
|
+
);
|
|
231
|
+
svg.appendChild(path1);
|
|
232
|
+
}
|
|
233
|
+
function setExportContent(svg) {
|
|
234
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
235
|
+
path1.setAttributeNS(
|
|
236
|
+
null,
|
|
237
|
+
"d",
|
|
238
|
+
"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"
|
|
239
|
+
);
|
|
240
|
+
svg.appendChild(path1);
|
|
241
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
242
|
+
path2.setAttributeNS(
|
|
243
|
+
null,
|
|
244
|
+
"d",
|
|
245
|
+
"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"
|
|
246
|
+
);
|
|
247
|
+
svg.appendChild(path2);
|
|
248
|
+
}
|
|
249
|
+
function setImportContent(svg) {
|
|
250
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
251
|
+
path1.setAttributeNS(
|
|
252
|
+
null,
|
|
253
|
+
"d",
|
|
254
|
+
"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"
|
|
255
|
+
);
|
|
256
|
+
svg.appendChild(path1);
|
|
257
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
258
|
+
path2.setAttributeNS(
|
|
259
|
+
null,
|
|
260
|
+
"d",
|
|
261
|
+
"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"
|
|
262
|
+
);
|
|
263
|
+
svg.appendChild(path2);
|
|
264
|
+
}
|
|
265
|
+
function setEditContent(svg) {
|
|
266
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
267
|
+
path1.setAttributeNS(
|
|
268
|
+
null,
|
|
269
|
+
"d",
|
|
270
|
+
"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"
|
|
271
|
+
);
|
|
272
|
+
svg.appendChild(path1);
|
|
273
|
+
}
|
|
274
|
+
function setMenuContent(svg) {
|
|
275
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
276
|
+
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");
|
|
277
|
+
svg.appendChild(path1);
|
|
278
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
279
|
+
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");
|
|
280
|
+
svg.appendChild(path2);
|
|
281
|
+
const path3 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
282
|
+
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");
|
|
283
|
+
svg.appendChild(path3);
|
|
284
|
+
}
|
|
285
|
+
function setReplyContent(svg) {
|
|
286
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
287
|
+
path1.setAttributeNS(
|
|
288
|
+
null,
|
|
289
|
+
"d",
|
|
290
|
+
"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"
|
|
291
|
+
);
|
|
292
|
+
svg.appendChild(path1);
|
|
293
|
+
}
|
|
294
|
+
function setRefreshContent(svg) {
|
|
295
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
296
|
+
path1.setAttributeNS(
|
|
297
|
+
null,
|
|
298
|
+
"d",
|
|
299
|
+
"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"
|
|
300
|
+
);
|
|
301
|
+
svg.appendChild(path1);
|
|
302
|
+
}
|
|
303
|
+
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";
|
|
304
|
+
function setCircleInfoContent(svg) {
|
|
305
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
306
|
+
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");
|
|
307
|
+
svg.appendChild(path1);
|
|
308
|
+
const circle1 = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
309
|
+
circle1.setAttributeNS(null, "cx", "8.0032");
|
|
310
|
+
circle1.setAttributeNS(null, "cy", "5.4545");
|
|
311
|
+
circle1.setAttributeNS(null, "r", ".6505");
|
|
312
|
+
svg.appendChild(circle1);
|
|
313
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
314
|
+
path2.setAttributeNS(null, "d", circlePath);
|
|
315
|
+
svg.appendChild(path2);
|
|
316
|
+
}
|
|
317
|
+
function setCircleWarningContent(svg) {
|
|
318
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
319
|
+
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");
|
|
320
|
+
svg.appendChild(path1);
|
|
321
|
+
const circle1 = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
322
|
+
circle1.setAttributeNS(null, "cx", "7.9984");
|
|
323
|
+
circle1.setAttributeNS(null, "cy", "10.617");
|
|
324
|
+
circle1.setAttributeNS(null, "r", ".6505");
|
|
325
|
+
svg.appendChild(circle1);
|
|
326
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
327
|
+
path2.setAttributeNS(null, "d", circlePath);
|
|
328
|
+
svg.appendChild(path2);
|
|
329
|
+
}
|
|
330
|
+
function setCircleErrorContent(svg) {
|
|
331
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
332
|
+
path1.setAttributeNS(null, "d", circlePath);
|
|
333
|
+
svg.appendChild(path1);
|
|
334
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
335
|
+
path2.setAttributeNS(
|
|
336
|
+
null,
|
|
337
|
+
"d",
|
|
338
|
+
"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"
|
|
339
|
+
);
|
|
340
|
+
svg.appendChild(path2);
|
|
341
|
+
}
|
|
342
|
+
function setCircleSuccessContent(svg) {
|
|
343
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
344
|
+
path1.setAttributeNS(null, "d", circlePath);
|
|
345
|
+
svg.appendChild(path1);
|
|
346
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
347
|
+
path2.setAttributeNS(
|
|
348
|
+
null,
|
|
349
|
+
"d",
|
|
350
|
+
"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"
|
|
351
|
+
);
|
|
352
|
+
svg.appendChild(path2);
|
|
353
|
+
}
|
|
354
|
+
function setCircleUnknownContent(svg) {
|
|
355
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
356
|
+
path1.setAttributeNS(null, "d", circlePath);
|
|
357
|
+
svg.appendChild(path1);
|
|
358
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
359
|
+
path2.setAttributeNS(
|
|
360
|
+
null,
|
|
361
|
+
"d",
|
|
362
|
+
"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"
|
|
363
|
+
);
|
|
364
|
+
svg.appendChild(path2);
|
|
365
|
+
const circle1 = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
366
|
+
circle1.setAttributeNS(null, "cx", "8");
|
|
367
|
+
circle1.setAttributeNS(null, "cy", "10.665");
|
|
368
|
+
circle1.setAttributeNS(null, "r", ".6505");
|
|
369
|
+
svg.appendChild(circle1);
|
|
370
|
+
}
|
|
371
|
+
function setCircleUserContent(svg) {
|
|
372
|
+
const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
373
|
+
path1.setAttributeNS(
|
|
374
|
+
null,
|
|
375
|
+
"d",
|
|
376
|
+
"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"
|
|
377
|
+
);
|
|
378
|
+
svg.appendChild(path1);
|
|
379
|
+
const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
380
|
+
path2.setAttributeNS(
|
|
381
|
+
null,
|
|
382
|
+
"d",
|
|
383
|
+
"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"
|
|
384
|
+
);
|
|
385
|
+
svg.appendChild(path2);
|
|
386
|
+
}
|
|
185
387
|
function createSvg({ icon, classes = "size-4", attrs } = {}) {
|
|
186
388
|
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
187
389
|
svg.setAttributeNS(null, "width", "16");
|
|
@@ -231,6 +433,57 @@
|
|
|
231
433
|
case Plus:
|
|
232
434
|
setPlusContent(svg);
|
|
233
435
|
break;
|
|
436
|
+
case Close:
|
|
437
|
+
setCloseContent(svg);
|
|
438
|
+
break;
|
|
439
|
+
case Bell:
|
|
440
|
+
setBellContent(svg);
|
|
441
|
+
break;
|
|
442
|
+
case Trash:
|
|
443
|
+
setTrashContent(svg);
|
|
444
|
+
break;
|
|
445
|
+
case Mail:
|
|
446
|
+
setMailContent(svg);
|
|
447
|
+
break;
|
|
448
|
+
case Send:
|
|
449
|
+
setSendContent(svg);
|
|
450
|
+
break;
|
|
451
|
+
case Export:
|
|
452
|
+
setExportContent(svg);
|
|
453
|
+
break;
|
|
454
|
+
case Import:
|
|
455
|
+
setImportContent(svg);
|
|
456
|
+
break;
|
|
457
|
+
case Edit:
|
|
458
|
+
setEditContent(svg);
|
|
459
|
+
break;
|
|
460
|
+
case Menu:
|
|
461
|
+
setMenuContent(svg);
|
|
462
|
+
break;
|
|
463
|
+
case Reply:
|
|
464
|
+
setReplyContent(svg);
|
|
465
|
+
break;
|
|
466
|
+
case Refresh:
|
|
467
|
+
setRefreshContent(svg);
|
|
468
|
+
break;
|
|
469
|
+
case CircleInfo:
|
|
470
|
+
setCircleInfoContent(svg);
|
|
471
|
+
break;
|
|
472
|
+
case CircleWarning:
|
|
473
|
+
setCircleWarningContent(svg);
|
|
474
|
+
break;
|
|
475
|
+
case CircleError:
|
|
476
|
+
setCircleErrorContent(svg);
|
|
477
|
+
break;
|
|
478
|
+
case CircleSuccess:
|
|
479
|
+
setCircleSuccessContent(svg);
|
|
480
|
+
break;
|
|
481
|
+
case CircleUnknown:
|
|
482
|
+
setCircleUnknownContent(svg);
|
|
483
|
+
break;
|
|
484
|
+
case CircleUser:
|
|
485
|
+
setCircleUserContent(svg);
|
|
486
|
+
break;
|
|
234
487
|
default:
|
|
235
488
|
break;
|
|
236
489
|
}
|
|
@@ -238,8 +491,8 @@
|
|
|
238
491
|
}
|
|
239
492
|
function setSvgContent(svg, icon) {
|
|
240
493
|
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
241
|
-
svg.setAttribute("width", "
|
|
242
|
-
svg.setAttribute("height", "
|
|
494
|
+
svg.setAttribute("width", "100%");
|
|
495
|
+
svg.setAttribute("height", "100%");
|
|
243
496
|
svg.setAttribute("viewBox", "0 0 16 16");
|
|
244
497
|
svg.setAttribute("fill", "currentColor");
|
|
245
498
|
switch (icon) {
|
|
@@ -279,6 +532,57 @@
|
|
|
279
532
|
case "plus":
|
|
280
533
|
setPlusContent(svg);
|
|
281
534
|
break;
|
|
535
|
+
case "close":
|
|
536
|
+
setCloseContent(svg);
|
|
537
|
+
break;
|
|
538
|
+
case "bell":
|
|
539
|
+
setBellContent(svg);
|
|
540
|
+
break;
|
|
541
|
+
case "trash":
|
|
542
|
+
setTrashContent(svg);
|
|
543
|
+
break;
|
|
544
|
+
case "mail":
|
|
545
|
+
setMailContent(svg);
|
|
546
|
+
break;
|
|
547
|
+
case "send":
|
|
548
|
+
setSendContent(svg);
|
|
549
|
+
break;
|
|
550
|
+
case "export":
|
|
551
|
+
setExportContent(svg);
|
|
552
|
+
break;
|
|
553
|
+
case "import":
|
|
554
|
+
setImportContent(svg);
|
|
555
|
+
break;
|
|
556
|
+
case "edit":
|
|
557
|
+
setEditContent(svg);
|
|
558
|
+
break;
|
|
559
|
+
case "menu":
|
|
560
|
+
setMenuContent(svg);
|
|
561
|
+
break;
|
|
562
|
+
case "reply":
|
|
563
|
+
setReplyContent(svg);
|
|
564
|
+
break;
|
|
565
|
+
case "refresh":
|
|
566
|
+
setRefreshContent(svg);
|
|
567
|
+
break;
|
|
568
|
+
case "circle-info":
|
|
569
|
+
setCircleInfoContent(svg);
|
|
570
|
+
break;
|
|
571
|
+
case "circle-warning":
|
|
572
|
+
setCircleWarningContent(svg);
|
|
573
|
+
break;
|
|
574
|
+
case "circle-error":
|
|
575
|
+
setCircleErrorContent(svg);
|
|
576
|
+
break;
|
|
577
|
+
case "circle-success":
|
|
578
|
+
setCircleSuccessContent(svg);
|
|
579
|
+
break;
|
|
580
|
+
case "circle-unknown":
|
|
581
|
+
setCircleUnknownContent(svg);
|
|
582
|
+
break;
|
|
583
|
+
case "circle-user":
|
|
584
|
+
setCircleUserContent(svg);
|
|
585
|
+
break;
|
|
282
586
|
default:
|
|
283
587
|
break;
|
|
284
588
|
}
|
|
@@ -300,7 +604,7 @@
|
|
|
300
604
|
}
|
|
301
605
|
el.classList.add("border-b", "last:border-b-0", "[[data-variant=header]_&]:data-[state=closed]:border-b-0");
|
|
302
606
|
el.setAttribute("data-slot", "accordion-item");
|
|
303
|
-
const itemId = expression ?? `ha${
|
|
607
|
+
const itemId = expression ?? `ha${uuid_default()}`;
|
|
304
608
|
function getIsExpanded() {
|
|
305
609
|
if (accordion._h_accordion.single) {
|
|
306
610
|
if (accordion._h_accordion.expandedId !== "") {
|
|
@@ -315,7 +619,7 @@
|
|
|
315
619
|
}
|
|
316
620
|
el._h_accordionItem = Alpine2.reactive({
|
|
317
621
|
id: itemId,
|
|
318
|
-
controls: `ha${
|
|
622
|
+
controls: `ha${uuid_default()}`,
|
|
319
623
|
expanded: getIsExpanded()
|
|
320
624
|
});
|
|
321
625
|
const setAttributes = () => {
|
|
@@ -487,22 +791,49 @@
|
|
|
487
791
|
});
|
|
488
792
|
}
|
|
489
793
|
|
|
794
|
+
// src/common/class-list.js
|
|
795
|
+
function classListStartsWith(classList, term) {
|
|
796
|
+
for (let i = 0; i < classList.length; i++) {
|
|
797
|
+
if (classList.item(i).startsWith(term)) {
|
|
798
|
+
return true;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
return false;
|
|
802
|
+
}
|
|
803
|
+
|
|
490
804
|
// src/components/avatar.js
|
|
491
805
|
function avatar_default(Alpine) {
|
|
492
806
|
Alpine.directive("h-avatar", (el, _, { Alpine: Alpine2 }) => {
|
|
807
|
+
if (!classListStartsWith(el.classList, "rounded")) {
|
|
808
|
+
el.classList.add("rounded-full");
|
|
809
|
+
}
|
|
493
810
|
el.classList.add(
|
|
494
811
|
"relative",
|
|
495
812
|
"bg-secondary",
|
|
496
813
|
"text-secondary-foreground",
|
|
497
814
|
"fill-secondary-foreground",
|
|
498
|
-
"[[data-slot=toolbar]:not([data-variant=transparent])
|
|
815
|
+
"[[data-slot=toolbar]:not([data-variant=transparent])>&]:border",
|
|
816
|
+
'data-[variant="information"]:bg-information/10',
|
|
817
|
+
'data-[variant="information"]:text-information',
|
|
818
|
+
'data-[variant="information"]:border-information',
|
|
819
|
+
'[&[data-variant="information"]>svg]:fill-information',
|
|
820
|
+
'data-[variant="warning"]:bg-warning/10',
|
|
821
|
+
'data-[variant="warning"]:text-warning',
|
|
822
|
+
'data-[variant="warning"]:border-warning',
|
|
823
|
+
'[&[data-variant="warning"]>svg]:fill-warning',
|
|
824
|
+
'data-[variant="positive"]:bg-positive/10',
|
|
825
|
+
'data-[variant="positive"]:text-positive',
|
|
826
|
+
'data-[variant="positive"]:border-positive',
|
|
827
|
+
'[&[data-variant="positive"]>svg]:fill-positive',
|
|
828
|
+
'data-[variant="negative"]:bg-negative/10',
|
|
829
|
+
'data-[variant="negative"]:text-negative',
|
|
830
|
+
'data-[variant="negative"]:border-negative',
|
|
831
|
+
'[&[data-variant="negative"]>svg]:fill-negative',
|
|
499
832
|
"has-[img]:border-0",
|
|
500
833
|
"flex",
|
|
501
834
|
"size-8",
|
|
502
835
|
"aspect-square",
|
|
503
836
|
"shrink-0",
|
|
504
|
-
"overflow-hidden",
|
|
505
|
-
"rounded-full",
|
|
506
837
|
"items-center",
|
|
507
838
|
"justify-center",
|
|
508
839
|
"text-sm",
|
|
@@ -521,7 +852,7 @@
|
|
|
521
852
|
if (!avatar) {
|
|
522
853
|
throw new Error(`${original2} must be inside an avatar element`);
|
|
523
854
|
}
|
|
524
|
-
el.classList.add("aspect-square", "size-full");
|
|
855
|
+
el.classList.add("aspect-square", "size-full", "rounded-[inherit]");
|
|
525
856
|
el.setAttribute("data-slot", "avatar-image");
|
|
526
857
|
el.setAttribute("role", "img");
|
|
527
858
|
let interval;
|
|
@@ -555,7 +886,7 @@
|
|
|
555
886
|
if (!avatar) {
|
|
556
887
|
throw new Error(`${original2} must be inside an avatar element`);
|
|
557
888
|
}
|
|
558
|
-
el.classList.add("hidden", "bg-muted", "flex", "size-full", "items-center", "justify-center");
|
|
889
|
+
el.classList.add("hidden", "bg-muted", "flex", "size-full", "items-center", "justify-center", "rounded-[inherit]");
|
|
559
890
|
el.setAttribute("data-slot", "avatar-fallback");
|
|
560
891
|
effect(() => {
|
|
561
892
|
if (avatar._h_avatar.fallback) el.classList.remove("hidden");
|
|
@@ -615,6 +946,59 @@
|
|
|
615
946
|
observer.disconnect();
|
|
616
947
|
});
|
|
617
948
|
});
|
|
949
|
+
Alpine.directive("h-badge-indicator", (el, _, { cleanup }) => {
|
|
950
|
+
el.classList.add(
|
|
951
|
+
"absolute",
|
|
952
|
+
"-end-1",
|
|
953
|
+
"-top-1",
|
|
954
|
+
"[.rounded-full>&]:end-0",
|
|
955
|
+
"[.rounded-full>&]:top-0",
|
|
956
|
+
"inline-flex",
|
|
957
|
+
"h-4",
|
|
958
|
+
"min-w-4",
|
|
959
|
+
"items-center",
|
|
960
|
+
"justify-center",
|
|
961
|
+
"rounded-full",
|
|
962
|
+
"py-0.5",
|
|
963
|
+
"px-1",
|
|
964
|
+
"text-xs",
|
|
965
|
+
"font-bold",
|
|
966
|
+
"leading-none",
|
|
967
|
+
"transform-gpu",
|
|
968
|
+
"data-[dot=true]:p-0",
|
|
969
|
+
"data-[dot=true]:min-w-3",
|
|
970
|
+
"data-[dot=true]:h-3",
|
|
971
|
+
"data-[ping=true]:before:absolute",
|
|
972
|
+
"data-[ping=true]:before:inline-flex",
|
|
973
|
+
"data-[ping=true]:before:w-full",
|
|
974
|
+
"data-[ping=true]:before:h-full",
|
|
975
|
+
"data-[ping=true]:before:rounded-full",
|
|
976
|
+
"data-[ping=true]:before:opacity-75",
|
|
977
|
+
"data-[ping=true]:before:animate-ping"
|
|
978
|
+
);
|
|
979
|
+
el.setAttribute("data-slot", "badge-indicator");
|
|
980
|
+
const variants = {
|
|
981
|
+
primary: ["bg-primary", "text-primary-foreground", "data-[ping=true]:before:bg-primary"],
|
|
982
|
+
positive: ["bg-positive", "text-positive-foreground", "data-[ping=true]:before:bg-positive"],
|
|
983
|
+
negative: ["bg-negative", "text-negative-foreground", "data-[ping=true]:before:bg-negative"],
|
|
984
|
+
warning: ["bg-warning", "text-warning-foreground", "data-[ping=true]:before:bg-warning"],
|
|
985
|
+
information: ["bg-information", "text-information-foreground", "data-[ping=true]:before:bg-information"]
|
|
986
|
+
};
|
|
987
|
+
function setVariant(variant) {
|
|
988
|
+
for (const [_2, value] of Object.entries(variants)) {
|
|
989
|
+
el.classList.remove(...value);
|
|
990
|
+
}
|
|
991
|
+
if (variants.hasOwnProperty(variant)) el.classList.add(...variants[variant]);
|
|
992
|
+
}
|
|
993
|
+
setVariant(el.getAttribute("data-variant") ?? "primary");
|
|
994
|
+
const observer = new MutationObserver(() => {
|
|
995
|
+
setVariant(el.getAttribute("data-variant") ?? "primary");
|
|
996
|
+
});
|
|
997
|
+
observer.observe(el, { attributes: true, attributeFilter: ["data-variant"] });
|
|
998
|
+
cleanup(() => {
|
|
999
|
+
observer.disconnect();
|
|
1000
|
+
});
|
|
1001
|
+
});
|
|
618
1002
|
}
|
|
619
1003
|
|
|
620
1004
|
// src/components/button.js
|
|
@@ -2497,7 +2881,7 @@
|
|
|
2497
2881
|
header.appendChild(previousMonthBtn);
|
|
2498
2882
|
const headerLabel = document.createElement("h2");
|
|
2499
2883
|
headerLabel.classList.add("min-w-[8rem]", "text-center");
|
|
2500
|
-
headerLabel.setAttribute("id", `hdpl${
|
|
2884
|
+
headerLabel.setAttribute("id", `hdpl${uuid_default()}`);
|
|
2501
2885
|
headerLabel.setAttribute("aria-live", "polite");
|
|
2502
2886
|
header.appendChild(headerLabel);
|
|
2503
2887
|
const nextMonthBtn = document.createElement("button");
|
|
@@ -2540,7 +2924,7 @@
|
|
|
2540
2924
|
header.appendChild(nextYearBtn);
|
|
2541
2925
|
el.appendChild(header);
|
|
2542
2926
|
const datesTable = document.createElement("table");
|
|
2543
|
-
if (datepicker) datesTable.setAttribute("aria-labelledby", `hdpl${
|
|
2927
|
+
if (datepicker) datesTable.setAttribute("aria-labelledby", `hdpl${uuid_default()}`);
|
|
2544
2928
|
datesTable.classList.add("table-fixed", "border-separate", "border-spacing-1");
|
|
2545
2929
|
if (!datepicker) datesTable.classList.add("w-full");
|
|
2546
2930
|
const thead = document.createElement("thead");
|
|
@@ -2862,11 +3246,11 @@
|
|
|
2862
3246
|
"bg-input-inner",
|
|
2863
3247
|
"border",
|
|
2864
3248
|
"border-input",
|
|
2865
|
-
"dark:has-[aria-invalid=true]:ring-negative/40",
|
|
3249
|
+
"dark:has-[input[aria-invalid=true]]:ring-negative/40",
|
|
2866
3250
|
"dark:has-[input:invalid]:ring-negative/40",
|
|
2867
3251
|
"duration-200",
|
|
2868
|
-
"has-[aria-invalid=true]:border-negative",
|
|
2869
|
-
"has-[aria-invalid=true]:ring-negative/20",
|
|
3252
|
+
"has-[input[aria-invalid=true]]:border-negative",
|
|
3253
|
+
"has-[input[aria-invalid=true]]:ring-negative/20",
|
|
2870
3254
|
"has-[input:checked]:bg-primary",
|
|
2871
3255
|
"has-[input:checked]:border-primary",
|
|
2872
3256
|
"has-[input:disabled]:cursor-not-allowed",
|
|
@@ -2965,7 +3349,7 @@
|
|
|
2965
3349
|
});
|
|
2966
3350
|
el._h_datepicker = {
|
|
2967
3351
|
id: void 0,
|
|
2968
|
-
controls: `hdpc${
|
|
3352
|
+
controls: `hdpc${uuid_default()}`,
|
|
2969
3353
|
input: void 0,
|
|
2970
3354
|
state,
|
|
2971
3355
|
inTable: modifiers.includes("table")
|
|
@@ -2976,7 +3360,7 @@
|
|
|
2976
3360
|
} else if (el._h_datepicker.input.hasAttribute("id")) {
|
|
2977
3361
|
el._h_datepicker.id = el._h_datepicker.input.getAttribute("id");
|
|
2978
3362
|
} else {
|
|
2979
|
-
const id = `hdp${
|
|
3363
|
+
const id = `hdp${uuid_default()}`;
|
|
2980
3364
|
el._h_datepicker.input.setAttribute("id", id);
|
|
2981
3365
|
el._h_datepicker.id = id;
|
|
2982
3366
|
}
|
|
@@ -3200,7 +3584,7 @@
|
|
|
3200
3584
|
const dialog = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "dialog");
|
|
3201
3585
|
if (dialog && (!dialog.hasAttribute("aria-labelledby") || !dialog.hasAttribute("aria-label"))) {
|
|
3202
3586
|
if (!el.hasAttribute("id")) {
|
|
3203
|
-
const id = `dht${
|
|
3587
|
+
const id = `dht${uuid_default()}`;
|
|
3204
3588
|
el.setAttribute("id", id);
|
|
3205
3589
|
}
|
|
3206
3590
|
dialog.setAttribute("aria-labelledby", el.getAttribute("id"));
|
|
@@ -3232,7 +3616,7 @@
|
|
|
3232
3616
|
const dialog = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "dialog");
|
|
3233
3617
|
if (dialog && (!dialog.hasAttribute("aria-describedby") || !dialog.hasAttribute("aria-description"))) {
|
|
3234
3618
|
if (!el.hasAttribute("id")) {
|
|
3235
|
-
const id = `dhd${
|
|
3619
|
+
const id = `dhd${uuid_default()}`;
|
|
3236
3620
|
el.setAttribute("id", id);
|
|
3237
3621
|
}
|
|
3238
3622
|
dialog.setAttribute("aria-describedby", el.getAttribute("id"));
|
|
@@ -3602,7 +3986,7 @@
|
|
|
3602
3986
|
input.setAttribute("aria-roledescription", "Number field");
|
|
3603
3987
|
}
|
|
3604
3988
|
if (!input.hasAttribute("id")) {
|
|
3605
|
-
input.setAttribute("id", `in${
|
|
3989
|
+
input.setAttribute("id", `in${uuid_default()}`);
|
|
3606
3990
|
}
|
|
3607
3991
|
input.setAttribute("tabindex", "0");
|
|
3608
3992
|
input.setAttribute("autocomplete", "off");
|
|
@@ -3825,14 +4209,14 @@
|
|
|
3825
4209
|
break;
|
|
3826
4210
|
}
|
|
3827
4211
|
}
|
|
3828
|
-
function
|
|
4212
|
+
function onClick(event) {
|
|
3829
4213
|
if (event.target.getAttribute("data-slot") === "list-item") selectOption(event.target);
|
|
3830
4214
|
}
|
|
3831
|
-
el.addEventListener("click",
|
|
4215
|
+
el.addEventListener("click", onClick);
|
|
3832
4216
|
el.addEventListener("keydown", onKeyDown);
|
|
3833
4217
|
cleanup(() => {
|
|
3834
4218
|
el.removeEventListener("keydown", onKeyDown);
|
|
3835
|
-
el.removeEventListener("click",
|
|
4219
|
+
el.removeEventListener("click", onClick);
|
|
3836
4220
|
});
|
|
3837
4221
|
});
|
|
3838
4222
|
Alpine.directive("h-list", (el) => {
|
|
@@ -3849,7 +4233,7 @@
|
|
|
3849
4233
|
throw new Error(`${original2} must be placed inside a list element`);
|
|
3850
4234
|
}
|
|
3851
4235
|
if (!el.hasAttribute("id")) {
|
|
3852
|
-
const id = `lbh${
|
|
4236
|
+
const id = `lbh${uuid_default()}`;
|
|
3853
4237
|
el.setAttribute("id", id);
|
|
3854
4238
|
}
|
|
3855
4239
|
list.setAttribute("aria-labelledby", el.getAttribute("id"));
|
|
@@ -3917,6 +4301,9 @@
|
|
|
3917
4301
|
while (sibling && !sibling.hasOwnProperty("_menu_trigger")) {
|
|
3918
4302
|
sibling = sibling.previousElementSibling;
|
|
3919
4303
|
}
|
|
4304
|
+
if (!sibling.hasOwnProperty("_menu_trigger")) {
|
|
4305
|
+
throw new Error(`${original2} must be placed after the menu trigger`);
|
|
4306
|
+
}
|
|
3920
4307
|
return sibling;
|
|
3921
4308
|
})();
|
|
3922
4309
|
if (!isSubmenu && !menuTrigger) {
|
|
@@ -3940,8 +4327,8 @@
|
|
|
3940
4327
|
left: "0px",
|
|
3941
4328
|
top: "0px"
|
|
3942
4329
|
});
|
|
3943
|
-
top.removeEventListener("contextmenu",
|
|
3944
|
-
top.removeEventListener("click",
|
|
4330
|
+
top.removeEventListener("contextmenu", onClick);
|
|
4331
|
+
top.removeEventListener("click", onClick);
|
|
3945
4332
|
el.removeEventListener("keydown", onKeyDown);
|
|
3946
4333
|
if (isSubmenu) {
|
|
3947
4334
|
if (closeParent) {
|
|
@@ -3973,7 +4360,7 @@
|
|
|
3973
4360
|
}
|
|
3974
4361
|
return false;
|
|
3975
4362
|
}
|
|
3976
|
-
function
|
|
4363
|
+
function onClick(event) {
|
|
3977
4364
|
if (event.type === "contextmenu") event.preventDefault();
|
|
3978
4365
|
close(isSubmenu);
|
|
3979
4366
|
}
|
|
@@ -4091,8 +4478,8 @@
|
|
|
4091
4478
|
listenForTrigger(false);
|
|
4092
4479
|
}
|
|
4093
4480
|
Alpine2.nextTick(() => {
|
|
4094
|
-
top.addEventListener("contextmenu",
|
|
4095
|
-
top.addEventListener("click",
|
|
4481
|
+
top.addEventListener("contextmenu", onClick);
|
|
4482
|
+
top.addEventListener("click", onClick);
|
|
4096
4483
|
el.addEventListener("keydown", onKeyDown);
|
|
4097
4484
|
});
|
|
4098
4485
|
Object.assign(el.style, {
|
|
@@ -4133,9 +4520,9 @@
|
|
|
4133
4520
|
listenForTrigger(true);
|
|
4134
4521
|
}
|
|
4135
4522
|
cleanup(() => {
|
|
4136
|
-
listenForTrigger(false);
|
|
4137
|
-
top.removeEventListener("click",
|
|
4138
|
-
top.removeEventListener("contextmenu",
|
|
4523
|
+
if (menuTrigger) listenForTrigger(false);
|
|
4524
|
+
top.removeEventListener("click", onClick);
|
|
4525
|
+
top.removeEventListener("contextmenu", onClick);
|
|
4139
4526
|
el.removeEventListener("keydown", onKeyDown);
|
|
4140
4527
|
});
|
|
4141
4528
|
});
|
|
@@ -4478,6 +4865,293 @@
|
|
|
4478
4865
|
});
|
|
4479
4866
|
}
|
|
4480
4867
|
|
|
4868
|
+
// src/utils/breakpoint-listener.js
|
|
4869
|
+
function getBreakpointListener(handler, breakpoint = 768, frame = false) {
|
|
4870
|
+
let bps = Number.isFinite(breakpoint) ? `${breakpoint}px` : breakpoint;
|
|
4871
|
+
const mql = frame ? window.matchMedia(`(width <= ${bps})`) : top.matchMedia(`(width <= ${bps})`);
|
|
4872
|
+
const onWidthChange = (event) => {
|
|
4873
|
+
handler(event.matches);
|
|
4874
|
+
};
|
|
4875
|
+
mql.addEventListener("change", onWidthChange);
|
|
4876
|
+
handler(mql.matches);
|
|
4877
|
+
return {
|
|
4878
|
+
_mql: mql,
|
|
4879
|
+
_onWidthChange: onWidthChange,
|
|
4880
|
+
remove() {
|
|
4881
|
+
this._mql.removeEventListener("change", this._onWidthChange);
|
|
4882
|
+
}
|
|
4883
|
+
};
|
|
4884
|
+
}
|
|
4885
|
+
|
|
4886
|
+
// src/components/notifications.js
|
|
4887
|
+
function notifications_default(Alpine) {
|
|
4888
|
+
Alpine.store("_h_notifications", {
|
|
4889
|
+
items: [],
|
|
4890
|
+
listeners: [],
|
|
4891
|
+
push(id = `hn${uuid_default()}`, template, position = "top-right", timeout = 5e3, data = {}) {
|
|
4892
|
+
if (!template) {
|
|
4893
|
+
throw new Error("Notification must have a template ID");
|
|
4894
|
+
}
|
|
4895
|
+
const item = {
|
|
4896
|
+
id,
|
|
4897
|
+
template,
|
|
4898
|
+
position,
|
|
4899
|
+
timeout,
|
|
4900
|
+
data: Alpine.reactive(data)
|
|
4901
|
+
};
|
|
4902
|
+
this.items.push(item);
|
|
4903
|
+
this.listeners.forEach((listener) => {
|
|
4904
|
+
if (listener.hasOwnProperty("added")) listener.added(item);
|
|
4905
|
+
});
|
|
4906
|
+
},
|
|
4907
|
+
update(id, data) {
|
|
4908
|
+
if (!id) {
|
|
4909
|
+
throw new Error("Cannot update a notification if an ID is not provided");
|
|
4910
|
+
}
|
|
4911
|
+
const index = this.items.findIndex((item) => item.id === id);
|
|
4912
|
+
if (index > -1) {
|
|
4913
|
+
for (const [key, value] of Object.entries(data)) {
|
|
4914
|
+
this.items[index].data[key] = value;
|
|
4915
|
+
}
|
|
4916
|
+
this.listeners.forEach((listener) => {
|
|
4917
|
+
if (listener.hasOwnProperty("updated")) listener.updated(id, data);
|
|
4918
|
+
});
|
|
4919
|
+
} else {
|
|
4920
|
+
console.error(`Notification with id "${id}" does not exist`);
|
|
4921
|
+
}
|
|
4922
|
+
},
|
|
4923
|
+
remove(id) {
|
|
4924
|
+
if (!id) {
|
|
4925
|
+
throw new Error("Cannot remove a notification if an ID is not provided");
|
|
4926
|
+
}
|
|
4927
|
+
this.listeners.forEach((listener) => {
|
|
4928
|
+
if (listener.hasOwnProperty("removed")) listener.removed(id);
|
|
4929
|
+
});
|
|
4930
|
+
this.items = this.items.filter((n) => n.id !== id);
|
|
4931
|
+
}
|
|
4932
|
+
});
|
|
4933
|
+
Alpine.magic("notifications", () => {
|
|
4934
|
+
return {
|
|
4935
|
+
add({ id, template, position, timeout, data } = {}) {
|
|
4936
|
+
Alpine.store("_h_notifications").push(id, template, position, timeout, data);
|
|
4937
|
+
},
|
|
4938
|
+
update({ id, data } = {}) {
|
|
4939
|
+
Alpine.store("_h_notifications").update(id, data);
|
|
4940
|
+
},
|
|
4941
|
+
remove(id) {
|
|
4942
|
+
Alpine.store("_h_notifications").remove(id);
|
|
4943
|
+
},
|
|
4944
|
+
addListener(listener) {
|
|
4945
|
+
Alpine.store("_h_notifications").listeners.push(listener);
|
|
4946
|
+
return Alpine.store("_h_notifications").listeners[Alpine.store("_h_notifications").listeners.length - 1];
|
|
4947
|
+
},
|
|
4948
|
+
removeListener(listener) {
|
|
4949
|
+
Alpine.store("_h_notifications").listeners = Alpine.store("_h_notifications").listeners.filter((item) => item !== listener);
|
|
4950
|
+
}
|
|
4951
|
+
};
|
|
4952
|
+
});
|
|
4953
|
+
Alpine.directive("h-notification-overlay", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
4954
|
+
if (el.tagName !== "SECTION") {
|
|
4955
|
+
throw new Error(`${original2} must be a button`);
|
|
4956
|
+
}
|
|
4957
|
+
const notificationTemplates = {};
|
|
4958
|
+
el.querySelectorAll("template").forEach((template) => {
|
|
4959
|
+
if (!template.hasAttribute("id")) {
|
|
4960
|
+
throw new Error("Notification templates must have an ID");
|
|
4961
|
+
}
|
|
4962
|
+
notificationTemplates[template.getAttribute("id")] = template;
|
|
4963
|
+
});
|
|
4964
|
+
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");
|
|
4965
|
+
el.setAttribute("tabindex", "-1");
|
|
4966
|
+
el.setAttribute("aria-live", "polite");
|
|
4967
|
+
el.setAttribute("aria-atomic", "false");
|
|
4968
|
+
el.setAttribute("data-slot", "notification-overlay");
|
|
4969
|
+
const commonListClasses = ["flex", "flex-col", "py-4", "p-10", "gap-4", "overflow-visible", "size-full"];
|
|
4970
|
+
const commonTopClasses = ["[mask-image:linear-gradient(to_bottom,black_80%,transparent)]", "row-1"];
|
|
4971
|
+
const commonBottomClasses = ["[mask-image:linear-gradient(to_top,black_80%,transparent)]", "row-2"];
|
|
4972
|
+
const olTopLeft = document.createElement("ol");
|
|
4973
|
+
olTopLeft.classList.add(...commonListClasses, ...commonTopClasses, "max-lg:hidden", "items-start");
|
|
4974
|
+
olTopLeft.setAttribute("tabindex", "-1");
|
|
4975
|
+
el.appendChild(olTopLeft);
|
|
4976
|
+
const olTopCenter = document.createElement("ol");
|
|
4977
|
+
olTopCenter.classList.add(...commonListClasses, ...commonTopClasses, "lg:col-2", "items-center");
|
|
4978
|
+
olTopCenter.setAttribute("tabindex", "-1");
|
|
4979
|
+
el.appendChild(olTopCenter);
|
|
4980
|
+
const olTopRight = document.createElement("ol");
|
|
4981
|
+
olTopRight.classList.add(...commonListClasses, ...commonTopClasses, "max-lg:hidden", "lg:col-2", "xl:col-3", "items-end");
|
|
4982
|
+
olTopRight.setAttribute("tabindex", "-1");
|
|
4983
|
+
el.appendChild(olTopRight);
|
|
4984
|
+
const olBottomLeft = document.createElement("ol");
|
|
4985
|
+
olBottomLeft.classList.add(...commonListClasses, ...commonBottomClasses, "max-lg:hidden", "items-start", "justify-end");
|
|
4986
|
+
olBottomLeft.setAttribute("tabindex", "-1");
|
|
4987
|
+
el.appendChild(olBottomLeft);
|
|
4988
|
+
const olBottomCenter = document.createElement("ol");
|
|
4989
|
+
olBottomCenter.classList.add(...commonListClasses, ...commonBottomClasses, "lg:col-2", "items-center", "justify-end");
|
|
4990
|
+
olBottomCenter.setAttribute("tabindex", "-1");
|
|
4991
|
+
el.appendChild(olBottomCenter);
|
|
4992
|
+
const olBottomRight = document.createElement("ol");
|
|
4993
|
+
olBottomRight.classList.add(...commonListClasses, ...commonBottomClasses, "max-lg:hidden", "lg:col-2", "xl:col-3", "items-end", "justify-end");
|
|
4994
|
+
olBottomRight.setAttribute("tabindex", "-1");
|
|
4995
|
+
el.appendChild(olBottomRight);
|
|
4996
|
+
let isLarge = true;
|
|
4997
|
+
let isExtraLarge = true;
|
|
4998
|
+
const lgBreakpointListener = getBreakpointListener((matches) => {
|
|
4999
|
+
isLarge = !matches;
|
|
5000
|
+
}, getComputedStyle(el).getPropertyValue("--breakpoint-lg").trim());
|
|
5001
|
+
const xlBreakpointListener = getBreakpointListener((matches) => {
|
|
5002
|
+
isExtraLarge = !matches;
|
|
5003
|
+
}, getComputedStyle(el).getPropertyValue("--breakpoint-xl").trim());
|
|
5004
|
+
const listener = {
|
|
5005
|
+
added(item) {
|
|
5006
|
+
const clone = notificationTemplates[item.template].content.firstElementChild.cloneNode(true);
|
|
5007
|
+
clone.classList.add("transform", "transition-all", "duration-300", "ease-out", "opacity-0");
|
|
5008
|
+
clone.setAttribute("id", item.id);
|
|
5009
|
+
Alpine2.addScopeToNode(clone, item.data);
|
|
5010
|
+
if (!isExtraLarge && !isLarge) {
|
|
5011
|
+
if (item.position.startsWith("top-")) {
|
|
5012
|
+
item.position = "top-center";
|
|
5013
|
+
} else {
|
|
5014
|
+
item.position = "bottom-center";
|
|
5015
|
+
}
|
|
5016
|
+
} else if (!isExtraLarge) {
|
|
5017
|
+
if (item.position === "top-center") {
|
|
5018
|
+
item.position = "top-right";
|
|
5019
|
+
} else if (item.position === "bottom-center") {
|
|
5020
|
+
item.position = "bottom-right";
|
|
5021
|
+
}
|
|
5022
|
+
}
|
|
5023
|
+
if (item.position === "top-left") {
|
|
5024
|
+
clone._h_animation_class = "-translate-x-full";
|
|
5025
|
+
clone.classList.add(clone._h_animation_class);
|
|
5026
|
+
olTopLeft.appendChild(clone);
|
|
5027
|
+
} else if (item.position === "top-center") {
|
|
5028
|
+
clone._h_animation_class = "-translate-y-full";
|
|
5029
|
+
clone.classList.add(clone._h_animation_class);
|
|
5030
|
+
olTopCenter.appendChild(clone);
|
|
5031
|
+
} else if (item.position === "top-right") {
|
|
5032
|
+
clone._h_animation_class = "translate-x-full";
|
|
5033
|
+
clone.classList.add(clone._h_animation_class);
|
|
5034
|
+
olTopRight.appendChild(clone);
|
|
5035
|
+
} else if (item.position === "bottom-left") {
|
|
5036
|
+
clone._h_animation_class = "-translate-x-full";
|
|
5037
|
+
clone.classList.add(clone._h_animation_class);
|
|
5038
|
+
olBottomLeft.appendChild(clone);
|
|
5039
|
+
} else if (item.position === "bottom-center") {
|
|
5040
|
+
clone._h_animation_class = "translate-y-full";
|
|
5041
|
+
clone.classList.add(clone._h_animation_class);
|
|
5042
|
+
olBottomCenter.appendChild(clone);
|
|
5043
|
+
} else {
|
|
5044
|
+
clone._h_animation_class = "translate-x-full";
|
|
5045
|
+
clone.classList.add(clone._h_animation_class);
|
|
5046
|
+
olBottomRight.appendChild(clone);
|
|
5047
|
+
}
|
|
5048
|
+
Alpine2.initTree(clone);
|
|
5049
|
+
Alpine2.nextTick(() => {
|
|
5050
|
+
clone.offsetHeight;
|
|
5051
|
+
clone.classList.remove(clone._h_animation_class, "opacity-0");
|
|
5052
|
+
});
|
|
5053
|
+
if (item.timeout > 0) {
|
|
5054
|
+
setTimeout(() => {
|
|
5055
|
+
Alpine2.store("_h_notifications").remove(item.id);
|
|
5056
|
+
}, item.timeout);
|
|
5057
|
+
}
|
|
5058
|
+
},
|
|
5059
|
+
removed(id) {
|
|
5060
|
+
const element = el.querySelector(`#${id}`);
|
|
5061
|
+
if (element) {
|
|
5062
|
+
element.addEventListener(
|
|
5063
|
+
"transitionend",
|
|
5064
|
+
() => {
|
|
5065
|
+
Alpine2.destroyTree(element);
|
|
5066
|
+
element.remove();
|
|
5067
|
+
},
|
|
5068
|
+
{ once: true }
|
|
5069
|
+
);
|
|
5070
|
+
element.classList.add(element._h_animation_class, "opacity-0");
|
|
5071
|
+
}
|
|
5072
|
+
}
|
|
5073
|
+
};
|
|
5074
|
+
Alpine2.store("_h_notifications").listeners.push(listener);
|
|
5075
|
+
if (Alpine2.store("_h_notifications").items.length) {
|
|
5076
|
+
Alpine2.store("_h_notifications").items.forEach((item) => {
|
|
5077
|
+
listener.added(item);
|
|
5078
|
+
});
|
|
5079
|
+
}
|
|
5080
|
+
cleanup(() => {
|
|
5081
|
+
lgBreakpointListener.remove();
|
|
5082
|
+
xlBreakpointListener.remove();
|
|
5083
|
+
});
|
|
5084
|
+
});
|
|
5085
|
+
Alpine.directive("h-notification-list", (el, { original: original2 }) => {
|
|
5086
|
+
if (el.tagName !== "OL" && el.tagName !== "UL") {
|
|
5087
|
+
throw new Error(`${original2} must be a list element`);
|
|
5088
|
+
}
|
|
5089
|
+
el.classList.add("flex", "flex-col", "divide-solid", "divide-y");
|
|
5090
|
+
el.setAttribute("data-slot", "notification-list");
|
|
5091
|
+
el.setAttribute("role", "group");
|
|
5092
|
+
});
|
|
5093
|
+
Alpine.directive("h-notification", (el, { original: original2, modifiers }) => {
|
|
5094
|
+
if (el.tagName !== "LI") {
|
|
5095
|
+
throw new Error(`${original2} must be a list item element`);
|
|
5096
|
+
}
|
|
5097
|
+
el.classList.add("pointer-events-auto", "p-3", "flex", "gap-2");
|
|
5098
|
+
if (modifiers.includes("floating")) {
|
|
5099
|
+
el.classList.add("rounded-lg", "data-[variant=toast]:rounded-full", "data-[variant=toast]:py-2", "border", "shadow-lg", "bg-popover", "text-popover-foreground");
|
|
5100
|
+
} else {
|
|
5101
|
+
el.classList.add("data-[unread=true]:border-l-warning", "data-[unread=true]:border-l-3");
|
|
5102
|
+
}
|
|
5103
|
+
el.setAttribute("data-slot", "notification");
|
|
5104
|
+
el.setAttribute("role", "alert");
|
|
5105
|
+
});
|
|
5106
|
+
Alpine.directive("h-notification-media", (el) => {
|
|
5107
|
+
if (!classListStartsWith(el.classList, "items-")) {
|
|
5108
|
+
el.classList.add("items-center");
|
|
5109
|
+
}
|
|
5110
|
+
if (!classListStartsWith(el.classList, "justify-")) {
|
|
5111
|
+
el.classList.add("justify-center");
|
|
5112
|
+
}
|
|
5113
|
+
el.classList.add("flex", "flex-col", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4", "[&>svg]:text-current");
|
|
5114
|
+
el.setAttribute("data-slot", "notification-media");
|
|
5115
|
+
});
|
|
5116
|
+
Alpine.directive("h-notification-title", (el) => {
|
|
5117
|
+
el.classList.add("line-clamp-1", "text-sm", "font-medium", "tracking-tight");
|
|
5118
|
+
el.setAttribute("data-slot", "notification-title");
|
|
5119
|
+
});
|
|
5120
|
+
Alpine.directive("h-notification-description", (el) => {
|
|
5121
|
+
el.classList.add("text-muted-foreground", "text-sm", "font-medium", "[&_p]:leading-relaxed");
|
|
5122
|
+
el.setAttribute("data-slot", "notification-description");
|
|
5123
|
+
});
|
|
5124
|
+
Alpine.directive("h-notification-actions", (el) => {
|
|
5125
|
+
if (!classListStartsWith(el.classList, "justify-")) {
|
|
5126
|
+
el.classList.add("[&[data-orientation=vertical]]:justify-center");
|
|
5127
|
+
}
|
|
5128
|
+
el.classList.add("flex", "gap-2", "data-[orientation=vertical]:flex-col");
|
|
5129
|
+
el.setAttribute("data-slot", "notification-actions");
|
|
5130
|
+
});
|
|
5131
|
+
Alpine.directive("h-notification-close", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
5132
|
+
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "notification-close");
|
|
5133
|
+
let nId;
|
|
5134
|
+
function close() {
|
|
5135
|
+
Alpine2.store("_h_notifications").remove(nId);
|
|
5136
|
+
}
|
|
5137
|
+
Alpine2.findClosest(el.parentElement, (parent) => {
|
|
5138
|
+
if (parent.getAttribute("data-slot") === "notification") {
|
|
5139
|
+
nId = parent.id;
|
|
5140
|
+
return true;
|
|
5141
|
+
}
|
|
5142
|
+
return false;
|
|
5143
|
+
});
|
|
5144
|
+
if (nId) {
|
|
5145
|
+
el.addEventListener("click", close);
|
|
5146
|
+
cleanup(() => {
|
|
5147
|
+
el.removeEventListener("click", close);
|
|
5148
|
+
});
|
|
5149
|
+
} else {
|
|
5150
|
+
console.error(`${original2} must be inside a notification with an id`);
|
|
5151
|
+
}
|
|
5152
|
+
});
|
|
5153
|
+
}
|
|
5154
|
+
|
|
4481
5155
|
// src/components/pagination.js
|
|
4482
5156
|
function pagination_default(Alpine) {
|
|
4483
5157
|
Alpine.directive("h-pagination", (el) => {
|
|
@@ -4563,7 +5237,7 @@
|
|
|
4563
5237
|
Alpine.directive("h-popover-trigger", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
4564
5238
|
el._popover = Alpine2.reactive({
|
|
4565
5239
|
id: void 0,
|
|
4566
|
-
controls: `hpc${
|
|
5240
|
+
controls: `hpc${uuid_default()}`,
|
|
4567
5241
|
auto: expression ? false : true,
|
|
4568
5242
|
expanded: expression ? evaluate2(expression) : false
|
|
4569
5243
|
});
|
|
@@ -4583,7 +5257,7 @@
|
|
|
4583
5257
|
if (el.hasAttribute("id")) {
|
|
4584
5258
|
el._popover.id = el.getAttribute("id");
|
|
4585
5259
|
} else {
|
|
4586
|
-
el._popover.id = `hp${
|
|
5260
|
+
el._popover.id = `hp${uuid_default()}`;
|
|
4587
5261
|
el.setAttribute("id", el._popover.id);
|
|
4588
5262
|
}
|
|
4589
5263
|
el.setAttribute("aria-controls", el._popover.controls);
|
|
@@ -4620,7 +5294,7 @@
|
|
|
4620
5294
|
});
|
|
4621
5295
|
}
|
|
4622
5296
|
});
|
|
4623
|
-
Alpine.directive("h-popover", (el, { original: original2, modifiers }, { effect }) => {
|
|
5297
|
+
Alpine.directive("h-popover", (el, { original: original2, modifiers }, { effect, cleanup }) => {
|
|
4624
5298
|
const popover = (() => {
|
|
4625
5299
|
let sibling = el.previousElementSibling;
|
|
4626
5300
|
while (sibling && !sibling.hasOwnProperty("_popover")) {
|
|
@@ -4643,6 +5317,12 @@
|
|
|
4643
5317
|
el.classList.remove("overflow-scroll");
|
|
4644
5318
|
el.classList.add("overflow-none");
|
|
4645
5319
|
}
|
|
5320
|
+
const stopPropagation = (event) => {
|
|
5321
|
+
event.stopPropagation();
|
|
5322
|
+
};
|
|
5323
|
+
if (el.getAttribute("data-innerclicks") === "true") {
|
|
5324
|
+
el.addEventListener("click", stopPropagation);
|
|
5325
|
+
}
|
|
4646
5326
|
let autoUpdateCleanup;
|
|
4647
5327
|
function updatePosition() {
|
|
4648
5328
|
computePosition2(popover, el, {
|
|
@@ -4679,6 +5359,9 @@
|
|
|
4679
5359
|
});
|
|
4680
5360
|
}
|
|
4681
5361
|
});
|
|
5362
|
+
cleanup(() => {
|
|
5363
|
+
el.removeEventListener("click", stopPropagation);
|
|
5364
|
+
});
|
|
4682
5365
|
});
|
|
4683
5366
|
}
|
|
4684
5367
|
|
|
@@ -4735,10 +5418,10 @@
|
|
|
4735
5418
|
"bg-input-inner",
|
|
4736
5419
|
"border",
|
|
4737
5420
|
"border-input",
|
|
4738
|
-
"dark:has-[aria-invalid=true]:ring-negative/40",
|
|
5421
|
+
"dark:has-[input[aria-invalid=true]]:ring-negative/40",
|
|
4739
5422
|
"dark:has-[input:invalid]:ring-negative/40",
|
|
4740
|
-
"has-[aria-invalid=true]:border-negative",
|
|
4741
|
-
"has-[aria-invalid=true]:ring-negative/20",
|
|
5423
|
+
"has-[input[aria-invalid=true]]:border-negative",
|
|
5424
|
+
"has-[input[aria-invalid=true]]:ring-negative/20",
|
|
4742
5425
|
"has-[input:checked]:before:visible",
|
|
4743
5426
|
"has-[input:disabled]:cursor-not-allowed",
|
|
4744
5427
|
"has-[input:disabled]:opacity-50",
|
|
@@ -6645,7 +7328,7 @@
|
|
|
6645
7328
|
el._h_select = Alpine2.reactive({
|
|
6646
7329
|
fieldLabelId: void 0,
|
|
6647
7330
|
trigger: void 0,
|
|
6648
|
-
controls: `hsc${
|
|
7331
|
+
controls: `hsc${uuid_default()}`,
|
|
6649
7332
|
expanded: false,
|
|
6650
7333
|
multiple: false,
|
|
6651
7334
|
label: [],
|
|
@@ -6669,10 +7352,10 @@
|
|
|
6669
7352
|
"has-focus-visible:border-ring",
|
|
6670
7353
|
"has-focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
6671
7354
|
"has-focus-visible:ring-ring/50",
|
|
6672
|
-
"dark:has-[aria-invalid=true]:ring-negative/40",
|
|
7355
|
+
"dark:has-[input[aria-invalid=true]]:ring-negative/40",
|
|
6673
7356
|
"dark:has-[input:invalid]:ring-negative/40",
|
|
6674
|
-
"has-[aria-invalid=true]:border-negative",
|
|
6675
|
-
"has-[aria-invalid=true]:ring-negative/20",
|
|
7357
|
+
"has-[input[aria-invalid=true]]:border-negative",
|
|
7358
|
+
"has-[input[aria-invalid=true]]:ring-negative/20",
|
|
6676
7359
|
"has-[input:invalid]:border-negative",
|
|
6677
7360
|
"has-[input:invalid]:ring-negative/20",
|
|
6678
7361
|
"hover:bg-secondary-hover",
|
|
@@ -6747,7 +7430,7 @@
|
|
|
6747
7430
|
let labelObserver;
|
|
6748
7431
|
if (label) {
|
|
6749
7432
|
if (!label.hasAttribute("id")) {
|
|
6750
|
-
label.setAttribute("id", `hsil${
|
|
7433
|
+
label.setAttribute("id", `hsil${uuid_default()}`);
|
|
6751
7434
|
}
|
|
6752
7435
|
select._h_select.fieldLabelId = label.getAttribute("id");
|
|
6753
7436
|
fakeTrigger.setAttribute("aria-labelledby", label.getAttribute("id"));
|
|
@@ -6903,7 +7586,7 @@
|
|
|
6903
7586
|
}
|
|
6904
7587
|
}
|
|
6905
7588
|
};
|
|
6906
|
-
const
|
|
7589
|
+
const onClick = () => {
|
|
6907
7590
|
select._h_select.expanded = !select._h_select.expanded;
|
|
6908
7591
|
if (select._h_select.expanded) {
|
|
6909
7592
|
if (!content) content = select.querySelector(`#${select._h_select.controls}`);
|
|
@@ -6924,14 +7607,14 @@
|
|
|
6924
7607
|
if (event.key === "Escape" && select._h_select.expanded) close(true);
|
|
6925
7608
|
else if (event.key === "Enter") {
|
|
6926
7609
|
event.preventDefault();
|
|
6927
|
-
|
|
7610
|
+
onClick();
|
|
6928
7611
|
} else if (event.key === " ") {
|
|
6929
7612
|
event.preventDefault();
|
|
6930
|
-
setTimeout(() =>
|
|
7613
|
+
setTimeout(() => onClick(), 0);
|
|
6931
7614
|
}
|
|
6932
7615
|
};
|
|
6933
7616
|
fakeTrigger.addEventListener("keydown", onPress);
|
|
6934
|
-
fakeTrigger.addEventListener("click",
|
|
7617
|
+
fakeTrigger.addEventListener("click", onClick);
|
|
6935
7618
|
const chevronDown = createSvg({
|
|
6936
7619
|
icon: ChevronDown,
|
|
6937
7620
|
classes: "opacity-70 text-foreground size-4 shrink-0 pointer-events-none transition-transform duration-200",
|
|
@@ -6954,7 +7637,7 @@
|
|
|
6954
7637
|
select._h_select.refreshLabel = onInputChange;
|
|
6955
7638
|
el.addEventListener("change", onInputChange);
|
|
6956
7639
|
cleanup(() => {
|
|
6957
|
-
fakeTrigger.removeEventListener("click",
|
|
7640
|
+
fakeTrigger.removeEventListener("click", onClick);
|
|
6958
7641
|
fakeTrigger.removeEventListener("keydown", onPress);
|
|
6959
7642
|
el.parentElement.removeEventListener("keydown", onKeyDown);
|
|
6960
7643
|
top.removeEventListener("click", close);
|
|
@@ -7051,11 +7734,11 @@
|
|
|
7051
7734
|
}
|
|
7052
7735
|
el.addEventListener("click", onActivate);
|
|
7053
7736
|
el.addEventListener("keydown", onActivate);
|
|
7737
|
+
function onInput() {
|
|
7738
|
+
select._h_select.search = searchInput.value.toLowerCase();
|
|
7739
|
+
}
|
|
7054
7740
|
if (select._h_select.filterType !== FilterType.none) {
|
|
7055
|
-
|
|
7056
|
-
select._h_select.search = searchInput.value.toLowerCase();
|
|
7057
|
-
};
|
|
7058
|
-
searchInput.addEventListener("keyup", onInput2);
|
|
7741
|
+
searchInput.addEventListener("keyup", onInput);
|
|
7059
7742
|
}
|
|
7060
7743
|
effect(() => {
|
|
7061
7744
|
if (select._h_select.expanded) searchInput.focus({ preventScroll: true });
|
|
@@ -7089,7 +7772,7 @@
|
|
|
7089
7772
|
el.setAttribute("data-slot", "select-label");
|
|
7090
7773
|
const selectGroup = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_selectGroup"));
|
|
7091
7774
|
if (selectGroup) {
|
|
7092
|
-
const id = `hsl${
|
|
7775
|
+
const id = `hsl${uuid_default()}`;
|
|
7093
7776
|
el.setAttribute("id", id);
|
|
7094
7777
|
selectGroup._h_selectGroup.labelledby = id;
|
|
7095
7778
|
}
|
|
@@ -7131,7 +7814,7 @@
|
|
|
7131
7814
|
);
|
|
7132
7815
|
el.setAttribute("data-slot", "select-option");
|
|
7133
7816
|
el.setAttribute("tabindex", "-1");
|
|
7134
|
-
const id = `hso${
|
|
7817
|
+
const id = `hso${uuid_default()}`;
|
|
7135
7818
|
el.setAttribute("role", "option");
|
|
7136
7819
|
el.setAttribute("aria-labelledby", id);
|
|
7137
7820
|
const indicatorEl = document.createElement("span");
|
|
@@ -7254,14 +7937,14 @@
|
|
|
7254
7937
|
el.setAttribute("data-open", isOpen);
|
|
7255
7938
|
});
|
|
7256
7939
|
});
|
|
7257
|
-
const
|
|
7940
|
+
const onClick = (event) => {
|
|
7258
7941
|
if (event.target.getAttribute("data-slot") === "sheet-overlay") {
|
|
7259
7942
|
evaluate2(`${expression} = false`);
|
|
7260
7943
|
}
|
|
7261
7944
|
};
|
|
7262
|
-
el.addEventListener("click",
|
|
7945
|
+
el.addEventListener("click", onClick);
|
|
7263
7946
|
cleanup(() => {
|
|
7264
|
-
el.removeEventListener("click",
|
|
7947
|
+
el.removeEventListener("click", onClick);
|
|
7265
7948
|
});
|
|
7266
7949
|
});
|
|
7267
7950
|
Alpine.directive("h-sheet", (el, _, { cleanup }) => {
|
|
@@ -7380,10 +8063,10 @@
|
|
|
7380
8063
|
if (el.hasAttribute("id")) {
|
|
7381
8064
|
group._h_sidebar_group.controlId = el.getAttribute("id");
|
|
7382
8065
|
} else {
|
|
7383
|
-
group._h_sidebar_group.controlId = `sgl${
|
|
8066
|
+
group._h_sidebar_group.controlId = `sgl${uuid_default()}`;
|
|
7384
8067
|
el.setAttribute("id", group._h_sidebar_group.controlId);
|
|
7385
8068
|
}
|
|
7386
|
-
group._h_sidebar_group.controls = `sgc${
|
|
8069
|
+
group._h_sidebar_group.controls = `sgc${uuid_default()}`;
|
|
7387
8070
|
el.setAttribute("aria-controls", group._h_sidebar_group.controls);
|
|
7388
8071
|
el.setAttribute("aria-expanded", !group._h_sidebar_group.state.collapsed);
|
|
7389
8072
|
const handler = () => {
|
|
@@ -7571,10 +8254,10 @@
|
|
|
7571
8254
|
if (el.hasAttribute("id")) {
|
|
7572
8255
|
menuItem._h_sidebar_menu_item.controlId = el.getAttribute("id");
|
|
7573
8256
|
} else {
|
|
7574
|
-
menuItem._h_sidebar_menu_item.controlId = `sgl${
|
|
8257
|
+
menuItem._h_sidebar_menu_item.controlId = `sgl${uuid_default()}`;
|
|
7575
8258
|
el.setAttribute("id", menuItem._h_sidebar_menu_item.controlId);
|
|
7576
8259
|
}
|
|
7577
|
-
menuItem._h_sidebar_menu_item.controls = `sgc${
|
|
8260
|
+
menuItem._h_sidebar_menu_item.controls = `sgc${uuid_default()}`;
|
|
7578
8261
|
el.setAttribute("aria-controls", menuItem._h_sidebar_menu_item.controls);
|
|
7579
8262
|
el.setAttribute("aria-expanded", !menuItem._h_sidebar_menu_item.state.collapsed);
|
|
7580
8263
|
const handler = () => {
|
|
@@ -7740,6 +8423,7 @@
|
|
|
7740
8423
|
"rounded-full",
|
|
7741
8424
|
"animate-spin"
|
|
7742
8425
|
);
|
|
8426
|
+
if (el.tagName === "SPAN") el.classList.add("inline-block");
|
|
7743
8427
|
el.setAttribute("role", "status");
|
|
7744
8428
|
el.setAttribute("data-slot", "spinner");
|
|
7745
8429
|
if (!el.hasAttribute("aria-label")) el.setAttribute("aria-label", "Loading");
|
|
@@ -7883,7 +8567,8 @@
|
|
|
7883
8567
|
});
|
|
7884
8568
|
};
|
|
7885
8569
|
const refreshGutters = () => {
|
|
7886
|
-
|
|
8570
|
+
const lastPanelIndex = panels.length - 1;
|
|
8571
|
+
panels.forEach((p, i) => p.setGutter(i === lastPanelIndex));
|
|
7887
8572
|
};
|
|
7888
8573
|
el._h_split = {
|
|
7889
8574
|
state,
|
|
@@ -7948,7 +8633,19 @@
|
|
|
7948
8633
|
if (!split) {
|
|
7949
8634
|
throw new Error(`${original2} must be inside an split element`);
|
|
7950
8635
|
}
|
|
7951
|
-
el.classList.add(
|
|
8636
|
+
el.classList.add(
|
|
8637
|
+
"flex",
|
|
8638
|
+
"shrink",
|
|
8639
|
+
"grow-0",
|
|
8640
|
+
"box-border",
|
|
8641
|
+
"overflow-visible",
|
|
8642
|
+
"[[data-orientation=horizontal]_&]:min-w-(--h-split-panel-min)",
|
|
8643
|
+
"[[data-orientation=horizontal]_&]:max-w-(--h-split-panel-max)",
|
|
8644
|
+
"[[data-orientation=horizontal]_&]:min-h-0",
|
|
8645
|
+
"[[data-orientation=vertical]_&]:min-h-(--h-split-panel-min)",
|
|
8646
|
+
"[[data-orientation=vertical]_&]:max-h-(--h-split-panel-max)",
|
|
8647
|
+
"[[data-orientation=vertical]_&]:min-w-0"
|
|
8648
|
+
);
|
|
7952
8649
|
el.setAttribute("tabindex", "-1");
|
|
7953
8650
|
el.setAttribute("data-slot", "split-panel");
|
|
7954
8651
|
let gutterless = el.getAttribute("data-gutterless") === "true";
|
|
@@ -8055,6 +8752,7 @@
|
|
|
8055
8752
|
effect(setVariant);
|
|
8056
8753
|
const initialSize = split._h_split.normalize(el.getAttribute("data-size"));
|
|
8057
8754
|
let handleSize = 0;
|
|
8755
|
+
let layoutFrame = null;
|
|
8058
8756
|
const panel = {
|
|
8059
8757
|
el,
|
|
8060
8758
|
gutter,
|
|
@@ -8075,9 +8773,13 @@
|
|
|
8075
8773
|
setGutter(last) {
|
|
8076
8774
|
if (this.hidden || gutterless || last) {
|
|
8077
8775
|
gutter.remove();
|
|
8078
|
-
} else
|
|
8079
|
-
|
|
8080
|
-
|
|
8776
|
+
} else {
|
|
8777
|
+
if (layoutFrame) cancelAnimationFrame(layoutFrame);
|
|
8778
|
+
layoutFrame = requestAnimationFrame(() => {
|
|
8779
|
+
el.after(gutter);
|
|
8780
|
+
handleSize = this.getHandleSize();
|
|
8781
|
+
layoutFrame = null;
|
|
8782
|
+
});
|
|
8081
8783
|
}
|
|
8082
8784
|
},
|
|
8083
8785
|
setHandleOffset() {
|
|
@@ -8103,6 +8805,7 @@
|
|
|
8103
8805
|
},
|
|
8104
8806
|
setLocked(locked = false) {
|
|
8105
8807
|
const panelLocked = el.getAttribute("data-locked") === "true";
|
|
8808
|
+
gutter.setAttribute("aria-disabled", locked || panelLocked);
|
|
8106
8809
|
if (locked) {
|
|
8107
8810
|
gutter.classList.add("pointer-events-none");
|
|
8108
8811
|
} else if (panelLocked) {
|
|
@@ -8112,6 +8815,10 @@
|
|
|
8112
8815
|
}
|
|
8113
8816
|
}
|
|
8114
8817
|
};
|
|
8818
|
+
el.style.setProperty("--h-split-panel-min", `${panel.min}px`);
|
|
8819
|
+
if (panel.max < Infinity) {
|
|
8820
|
+
el.style.setProperty("--h-split-panel-max", `${panel.max}px`);
|
|
8821
|
+
}
|
|
8115
8822
|
split._h_split.addPanel(panel);
|
|
8116
8823
|
const drag = (e) => {
|
|
8117
8824
|
e.preventDefault();
|
|
@@ -8824,7 +9531,7 @@
|
|
|
8824
9531
|
Alpine.directive("h-time-picker", (el, { expression, modifiers }, { evaluateLater, cleanup, effect, Alpine: Alpine2 }) => {
|
|
8825
9532
|
el._h_timepicker = Alpine2.reactive({
|
|
8826
9533
|
id: void 0,
|
|
8827
|
-
controls: `htpc${
|
|
9534
|
+
controls: `htpc${uuid_default()}`,
|
|
8828
9535
|
model: void 0,
|
|
8829
9536
|
expanded: false,
|
|
8830
9537
|
is12Hour: false,
|
|
@@ -8982,7 +9689,7 @@
|
|
|
8982
9689
|
if (el.hasAttribute("id")) {
|
|
8983
9690
|
timepicker._h_timepicker.id = el.getAttribute("id");
|
|
8984
9691
|
} else {
|
|
8985
|
-
timepicker._h_timepicker.id = `htp${
|
|
9692
|
+
timepicker._h_timepicker.id = `htp${uuid_default()}`;
|
|
8986
9693
|
el.setAttribute("id", timepicker._h_timepicker.id);
|
|
8987
9694
|
}
|
|
8988
9695
|
el.classList.add(
|
|
@@ -9472,10 +10179,10 @@
|
|
|
9472
10179
|
periodList.classList.add("hidden");
|
|
9473
10180
|
}
|
|
9474
10181
|
}
|
|
9475
|
-
const
|
|
10182
|
+
const onClick = (event) => {
|
|
9476
10183
|
event.stopPropagation();
|
|
9477
10184
|
};
|
|
9478
|
-
el.addEventListener("click",
|
|
10185
|
+
el.addEventListener("click", onClick);
|
|
9479
10186
|
let autoUpdateCleanup;
|
|
9480
10187
|
let focusFirstItem = true;
|
|
9481
10188
|
function updatePosition() {
|
|
@@ -9518,20 +10225,10 @@
|
|
|
9518
10225
|
});
|
|
9519
10226
|
cleanup(() => {
|
|
9520
10227
|
el.removeEventListener("keydown", onKeyDown);
|
|
9521
|
-
el.removeEventListener("click",
|
|
10228
|
+
el.removeEventListener("click", onClick);
|
|
9522
10229
|
okButton.removeEventListener("click", timepicker._h_timepicker.close);
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
}
|
|
9526
|
-
for (let m = 0; m < minutesList.children.length; m++) {
|
|
9527
|
-
minutesList.children[m].removeEventListener("click", setMinute);
|
|
9528
|
-
}
|
|
9529
|
-
for (let s = 0; s < secondsList.children.length; s++) {
|
|
9530
|
-
secondsList.children[s].removeEventListener("click", setSecond);
|
|
9531
|
-
}
|
|
9532
|
-
for (let p = 0; p < periodList.children.length; p++) {
|
|
9533
|
-
periodList.children[p].removeEventListener("click", setPeriod);
|
|
9534
|
-
}
|
|
10230
|
+
nowButton.removeEventListener("click", getCurrentTime);
|
|
10231
|
+
timeContainer.removeEventListener("click", setTime);
|
|
9535
10232
|
});
|
|
9536
10233
|
});
|
|
9537
10234
|
}
|
|
@@ -9603,13 +10300,13 @@
|
|
|
9603
10300
|
Alpine.directive("h-tooltip-trigger", (el, _, { Alpine: Alpine2, cleanup }) => {
|
|
9604
10301
|
el._tooltip = Alpine2.reactive({
|
|
9605
10302
|
id: void 0,
|
|
9606
|
-
controls: `hpc${
|
|
10303
|
+
controls: `hpc${uuid_default()}`,
|
|
9607
10304
|
shown: false
|
|
9608
10305
|
});
|
|
9609
10306
|
if (el.hasAttribute("id")) {
|
|
9610
10307
|
el._tooltip.id = el.getAttribute("id");
|
|
9611
10308
|
} else {
|
|
9612
|
-
el._tooltip.id = `hp${
|
|
10309
|
+
el._tooltip.id = `hp${uuid_default()}`;
|
|
9613
10310
|
el.setAttribute("id", el._tooltip.id);
|
|
9614
10311
|
}
|
|
9615
10312
|
el.setAttribute("aria-describedby", el._tooltip.controls);
|
|
@@ -9776,7 +10473,7 @@
|
|
|
9776
10473
|
el.setAttribute("role", "tree");
|
|
9777
10474
|
el.addEventListener("keydown", onKeyDown);
|
|
9778
10475
|
cleanup(() => {
|
|
9779
|
-
el.removeEventListener("keydown",
|
|
10476
|
+
el.removeEventListener("keydown", onKeyDown);
|
|
9780
10477
|
});
|
|
9781
10478
|
}
|
|
9782
10479
|
});
|
|
@@ -9806,7 +10503,7 @@
|
|
|
9806
10503
|
effect(() => {
|
|
9807
10504
|
if (!el.closest('[role="tree"]')) return;
|
|
9808
10505
|
});
|
|
9809
|
-
const
|
|
10506
|
+
const onClick = (event) => {
|
|
9810
10507
|
if (event.target === el || event.target.parentElement === el) {
|
|
9811
10508
|
if (el._h_tree_item.hasSubtree) {
|
|
9812
10509
|
if (expression === "false" || expression === "true") {
|
|
@@ -9821,9 +10518,9 @@
|
|
|
9821
10518
|
el.setAttribute("tabindex", "0");
|
|
9822
10519
|
}
|
|
9823
10520
|
};
|
|
9824
|
-
el.addEventListener("click",
|
|
10521
|
+
el.addEventListener("click", onClick);
|
|
9825
10522
|
cleanup(() => {
|
|
9826
|
-
el.removeEventListener("click",
|
|
10523
|
+
el.removeEventListener("click", onClick);
|
|
9827
10524
|
});
|
|
9828
10525
|
if (el._h_tree_item.hasSubtree) {
|
|
9829
10526
|
const setExpanded = (expanded) => {
|
|
@@ -9958,10 +10655,7 @@
|
|
|
9958
10655
|
var getColorScheme = () => {
|
|
9959
10656
|
const theme = localStorage.getItem(colorSchemeKey);
|
|
9960
10657
|
if (theme) return theme;
|
|
9961
|
-
|
|
9962
|
-
return "dark";
|
|
9963
|
-
}
|
|
9964
|
-
return "light";
|
|
10658
|
+
return "auto";
|
|
9965
10659
|
};
|
|
9966
10660
|
var getSystemColorScheme = () => {
|
|
9967
10661
|
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
@@ -9982,23 +10676,6 @@
|
|
|
9982
10676
|
};
|
|
9983
10677
|
initColorScheme();
|
|
9984
10678
|
|
|
9985
|
-
// src/utils/breakpoint-listener.js
|
|
9986
|
-
function getBreakpointListener(handler, breakpoint = 768) {
|
|
9987
|
-
const mql = top.matchMedia(`(width <= ${breakpoint}px)`);
|
|
9988
|
-
const onWidthChange = (event) => {
|
|
9989
|
-
handler(event.matches);
|
|
9990
|
-
};
|
|
9991
|
-
mql.addEventListener("change", onWidthChange);
|
|
9992
|
-
handler(mql.matches);
|
|
9993
|
-
return {
|
|
9994
|
-
_mql: mql,
|
|
9995
|
-
_onWidthChange: onWidthChange,
|
|
9996
|
-
remove() {
|
|
9997
|
-
this._mql.removeEventListener("change", this._onWidthChange);
|
|
9998
|
-
}
|
|
9999
|
-
};
|
|
10000
|
-
}
|
|
10001
|
-
|
|
10002
10679
|
// src/utils/template.js
|
|
10003
10680
|
function template_default(Alpine) {
|
|
10004
10681
|
Alpine.directive("h-template", (el, { original: original2, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
|
|
@@ -10022,32 +10699,59 @@
|
|
|
10022
10699
|
|
|
10023
10700
|
// src/utils/include.js
|
|
10024
10701
|
function include_default(Alpine) {
|
|
10025
|
-
Alpine.directive("h-include", (el, { modifiers, expression }, { evaluateLater, effect }) => {
|
|
10702
|
+
Alpine.directive("h-include", (el, { modifiers, expression }, { evaluateLater, effect, cleanup, Alpine: Alpine2 }) => {
|
|
10026
10703
|
const getUrl = evaluateLater(expression);
|
|
10704
|
+
function executeScript(oldScript) {
|
|
10705
|
+
return new Promise((resolve, reject) => {
|
|
10706
|
+
const newScript = document.createElement("script");
|
|
10707
|
+
for (const attr of oldScript.attributes) {
|
|
10708
|
+
newScript.setAttribute(attr.name, attr.value);
|
|
10709
|
+
}
|
|
10710
|
+
if (oldScript.src) {
|
|
10711
|
+
newScript.src = oldScript.src;
|
|
10712
|
+
newScript.onload = resolve;
|
|
10713
|
+
newScript.onerror = reject;
|
|
10714
|
+
} else {
|
|
10715
|
+
newScript.textContent = oldScript.textContent;
|
|
10716
|
+
resolve();
|
|
10717
|
+
}
|
|
10718
|
+
el.appendChild(newScript);
|
|
10719
|
+
});
|
|
10720
|
+
}
|
|
10721
|
+
function initTree() {
|
|
10722
|
+
for (let i = 0; i < el.children.length; i++) {
|
|
10723
|
+
if (el.children[i].tagName !== "SCRIPT") Alpine2.initTree(el.children[i]);
|
|
10724
|
+
}
|
|
10725
|
+
}
|
|
10726
|
+
function destroyTree() {
|
|
10727
|
+
if (el.children.length) {
|
|
10728
|
+
for (let i = 0; i < el.children.length; i++) {
|
|
10729
|
+
if (el.children[i].tagName !== "SCRIPT") Alpine2.initTree(el.children[i]);
|
|
10730
|
+
}
|
|
10731
|
+
}
|
|
10732
|
+
}
|
|
10027
10733
|
function getHtml(url) {
|
|
10028
10734
|
const parsed = new URL(url, window.location.origin);
|
|
10029
10735
|
if (parsed.origin === window.location.origin) {
|
|
10030
10736
|
fetch(url).then((response) => {
|
|
10031
10737
|
if (response.status === 200) return response.text();
|
|
10032
10738
|
throw response;
|
|
10033
|
-
}).then((content) => {
|
|
10739
|
+
}).then(async (content) => {
|
|
10034
10740
|
if (modifiers.includes("js")) {
|
|
10035
10741
|
const container = document.createElement("div");
|
|
10036
10742
|
container.innerHTML = content;
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
for (let a = 0; a < staticScript.attributes.length; a++) {
|
|
10040
|
-
script.setAttribute(staticScript.attributes[a].name, staticScript.attributes[a].value);
|
|
10041
|
-
}
|
|
10042
|
-
script.appendChild(document.createTextNode(staticScript.innerHTML));
|
|
10043
|
-
staticScript.remove();
|
|
10743
|
+
const scripts = [...container.querySelectorAll("script")];
|
|
10744
|
+
scripts.forEach((script) => script.remove());
|
|
10044
10745
|
while (container.childNodes.length > 0) {
|
|
10045
10746
|
el.appendChild(container.childNodes[0]);
|
|
10046
10747
|
}
|
|
10047
|
-
|
|
10748
|
+
for (const oldScript of scripts) {
|
|
10749
|
+
await executeScript(oldScript);
|
|
10750
|
+
}
|
|
10048
10751
|
} else {
|
|
10049
10752
|
el.innerHTML = content;
|
|
10050
10753
|
}
|
|
10754
|
+
initTree();
|
|
10051
10755
|
}).catch((response) => {
|
|
10052
10756
|
console.error(response);
|
|
10053
10757
|
});
|
|
@@ -10057,10 +10761,14 @@
|
|
|
10057
10761
|
}
|
|
10058
10762
|
effect(() => {
|
|
10059
10763
|
getUrl((url) => {
|
|
10764
|
+
destroyTree();
|
|
10765
|
+
el.innerHTML = "";
|
|
10060
10766
|
if (url) getHtml(url);
|
|
10061
|
-
else el.innerHTML = "";
|
|
10062
10767
|
});
|
|
10063
10768
|
});
|
|
10769
|
+
cleanup(() => {
|
|
10770
|
+
destroyTree();
|
|
10771
|
+
});
|
|
10064
10772
|
}).before("bind");
|
|
10065
10773
|
}
|
|
10066
10774
|
|
|
@@ -10077,11 +10785,11 @@
|
|
|
10077
10785
|
}
|
|
10078
10786
|
|
|
10079
10787
|
// package.json
|
|
10080
|
-
var version = "1.
|
|
10788
|
+
var version = "1.7.0";
|
|
10081
10789
|
|
|
10082
10790
|
// src/index.js
|
|
10083
10791
|
window.Harmonia = { getBreakpointListener, addColorSchemeListener, getColorScheme, removeColorSchemeListener, setColorScheme, getSystemColorScheme, version };
|
|
10084
|
-
|
|
10792
|
+
function registerPlugins() {
|
|
10085
10793
|
window.Alpine.plugin(accordion_default);
|
|
10086
10794
|
window.Alpine.plugin(alert_default);
|
|
10087
10795
|
window.Alpine.plugin(avatar_default);
|
|
@@ -10100,6 +10808,7 @@
|
|
|
10100
10808
|
window.Alpine.plugin(label_default);
|
|
10101
10809
|
window.Alpine.plugin(list_default);
|
|
10102
10810
|
window.Alpine.plugin(menu_default);
|
|
10811
|
+
window.Alpine.plugin(notifications_default);
|
|
10103
10812
|
window.Alpine.plugin(pagination_default);
|
|
10104
10813
|
window.Alpine.plugin(popover_default);
|
|
10105
10814
|
window.Alpine.plugin(progress_default);
|
|
@@ -10126,5 +10835,7 @@
|
|
|
10126
10835
|
window.Alpine.plugin(focus_default);
|
|
10127
10836
|
window.Alpine.plugin(template_default);
|
|
10128
10837
|
window.Alpine.plugin(include_default);
|
|
10129
|
-
}
|
|
10838
|
+
}
|
|
10839
|
+
if (window.Alpine) registerPlugins();
|
|
10840
|
+
else document.addEventListener("alpine:init", registerPlugins, { once: true });
|
|
10130
10841
|
})();
|