@codbex/harmonia 1.6.1 → 1.7.1
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 +1 -1
- package/dist/harmonia.esm.js +757 -92
- package/dist/harmonia.esm.min.js +2 -2
- package/dist/harmonia.esm.min.js.map +4 -4
- package/dist/harmonia.js +757 -93
- package/dist/harmonia.min.js +2 -2
- package/dist/harmonia.min.js.map +4 -4
- package/package.json +3 -4
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");
|
|
@@ -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");
|
|
@@ -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"));
|
|
@@ -4481,6 +4865,293 @@
|
|
|
4481
4865
|
});
|
|
4482
4866
|
}
|
|
4483
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
|
+
|
|
4484
5155
|
// src/components/pagination.js
|
|
4485
5156
|
function pagination_default(Alpine) {
|
|
4486
5157
|
Alpine.directive("h-pagination", (el) => {
|
|
@@ -4566,7 +5237,7 @@
|
|
|
4566
5237
|
Alpine.directive("h-popover-trigger", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
4567
5238
|
el._popover = Alpine2.reactive({
|
|
4568
5239
|
id: void 0,
|
|
4569
|
-
controls: `hpc${
|
|
5240
|
+
controls: `hpc${uuid_default()}`,
|
|
4570
5241
|
auto: expression ? false : true,
|
|
4571
5242
|
expanded: expression ? evaluate2(expression) : false
|
|
4572
5243
|
});
|
|
@@ -4586,7 +5257,7 @@
|
|
|
4586
5257
|
if (el.hasAttribute("id")) {
|
|
4587
5258
|
el._popover.id = el.getAttribute("id");
|
|
4588
5259
|
} else {
|
|
4589
|
-
el._popover.id = `hp${
|
|
5260
|
+
el._popover.id = `hp${uuid_default()}`;
|
|
4590
5261
|
el.setAttribute("id", el._popover.id);
|
|
4591
5262
|
}
|
|
4592
5263
|
el.setAttribute("aria-controls", el._popover.controls);
|
|
@@ -4623,7 +5294,7 @@
|
|
|
4623
5294
|
});
|
|
4624
5295
|
}
|
|
4625
5296
|
});
|
|
4626
|
-
Alpine.directive("h-popover", (el, { original: original2, modifiers }, { effect }) => {
|
|
5297
|
+
Alpine.directive("h-popover", (el, { original: original2, modifiers }, { effect, cleanup }) => {
|
|
4627
5298
|
const popover = (() => {
|
|
4628
5299
|
let sibling = el.previousElementSibling;
|
|
4629
5300
|
while (sibling && !sibling.hasOwnProperty("_popover")) {
|
|
@@ -4646,6 +5317,12 @@
|
|
|
4646
5317
|
el.classList.remove("overflow-scroll");
|
|
4647
5318
|
el.classList.add("overflow-none");
|
|
4648
5319
|
}
|
|
5320
|
+
const stopPropagation = (event) => {
|
|
5321
|
+
event.stopPropagation();
|
|
5322
|
+
};
|
|
5323
|
+
if (el.getAttribute("data-innerclicks") === "true") {
|
|
5324
|
+
el.addEventListener("click", stopPropagation);
|
|
5325
|
+
}
|
|
4649
5326
|
let autoUpdateCleanup;
|
|
4650
5327
|
function updatePosition() {
|
|
4651
5328
|
computePosition2(popover, el, {
|
|
@@ -4682,6 +5359,9 @@
|
|
|
4682
5359
|
});
|
|
4683
5360
|
}
|
|
4684
5361
|
});
|
|
5362
|
+
cleanup(() => {
|
|
5363
|
+
el.removeEventListener("click", stopPropagation);
|
|
5364
|
+
});
|
|
4685
5365
|
});
|
|
4686
5366
|
}
|
|
4687
5367
|
|
|
@@ -6648,7 +7328,7 @@
|
|
|
6648
7328
|
el._h_select = Alpine2.reactive({
|
|
6649
7329
|
fieldLabelId: void 0,
|
|
6650
7330
|
trigger: void 0,
|
|
6651
|
-
controls: `hsc${
|
|
7331
|
+
controls: `hsc${uuid_default()}`,
|
|
6652
7332
|
expanded: false,
|
|
6653
7333
|
multiple: false,
|
|
6654
7334
|
label: [],
|
|
@@ -6750,7 +7430,7 @@
|
|
|
6750
7430
|
let labelObserver;
|
|
6751
7431
|
if (label) {
|
|
6752
7432
|
if (!label.hasAttribute("id")) {
|
|
6753
|
-
label.setAttribute("id", `hsil${
|
|
7433
|
+
label.setAttribute("id", `hsil${uuid_default()}`);
|
|
6754
7434
|
}
|
|
6755
7435
|
select._h_select.fieldLabelId = label.getAttribute("id");
|
|
6756
7436
|
fakeTrigger.setAttribute("aria-labelledby", label.getAttribute("id"));
|
|
@@ -7092,7 +7772,7 @@
|
|
|
7092
7772
|
el.setAttribute("data-slot", "select-label");
|
|
7093
7773
|
const selectGroup = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_selectGroup"));
|
|
7094
7774
|
if (selectGroup) {
|
|
7095
|
-
const id = `hsl${
|
|
7775
|
+
const id = `hsl${uuid_default()}`;
|
|
7096
7776
|
el.setAttribute("id", id);
|
|
7097
7777
|
selectGroup._h_selectGroup.labelledby = id;
|
|
7098
7778
|
}
|
|
@@ -7134,7 +7814,7 @@
|
|
|
7134
7814
|
);
|
|
7135
7815
|
el.setAttribute("data-slot", "select-option");
|
|
7136
7816
|
el.setAttribute("tabindex", "-1");
|
|
7137
|
-
const id = `hso${
|
|
7817
|
+
const id = `hso${uuid_default()}`;
|
|
7138
7818
|
el.setAttribute("role", "option");
|
|
7139
7819
|
el.setAttribute("aria-labelledby", id);
|
|
7140
7820
|
const indicatorEl = document.createElement("span");
|
|
@@ -7383,10 +8063,10 @@
|
|
|
7383
8063
|
if (el.hasAttribute("id")) {
|
|
7384
8064
|
group._h_sidebar_group.controlId = el.getAttribute("id");
|
|
7385
8065
|
} else {
|
|
7386
|
-
group._h_sidebar_group.controlId = `sgl${
|
|
8066
|
+
group._h_sidebar_group.controlId = `sgl${uuid_default()}`;
|
|
7387
8067
|
el.setAttribute("id", group._h_sidebar_group.controlId);
|
|
7388
8068
|
}
|
|
7389
|
-
group._h_sidebar_group.controls = `sgc${
|
|
8069
|
+
group._h_sidebar_group.controls = `sgc${uuid_default()}`;
|
|
7390
8070
|
el.setAttribute("aria-controls", group._h_sidebar_group.controls);
|
|
7391
8071
|
el.setAttribute("aria-expanded", !group._h_sidebar_group.state.collapsed);
|
|
7392
8072
|
const handler = () => {
|
|
@@ -7574,10 +8254,10 @@
|
|
|
7574
8254
|
if (el.hasAttribute("id")) {
|
|
7575
8255
|
menuItem._h_sidebar_menu_item.controlId = el.getAttribute("id");
|
|
7576
8256
|
} else {
|
|
7577
|
-
menuItem._h_sidebar_menu_item.controlId = `sgl${
|
|
8257
|
+
menuItem._h_sidebar_menu_item.controlId = `sgl${uuid_default()}`;
|
|
7578
8258
|
el.setAttribute("id", menuItem._h_sidebar_menu_item.controlId);
|
|
7579
8259
|
}
|
|
7580
|
-
menuItem._h_sidebar_menu_item.controls = `sgc${
|
|
8260
|
+
menuItem._h_sidebar_menu_item.controls = `sgc${uuid_default()}`;
|
|
7581
8261
|
el.setAttribute("aria-controls", menuItem._h_sidebar_menu_item.controls);
|
|
7582
8262
|
el.setAttribute("aria-expanded", !menuItem._h_sidebar_menu_item.state.collapsed);
|
|
7583
8263
|
const handler = () => {
|
|
@@ -8851,7 +9531,7 @@
|
|
|
8851
9531
|
Alpine.directive("h-time-picker", (el, { expression, modifiers }, { evaluateLater, cleanup, effect, Alpine: Alpine2 }) => {
|
|
8852
9532
|
el._h_timepicker = Alpine2.reactive({
|
|
8853
9533
|
id: void 0,
|
|
8854
|
-
controls: `htpc${
|
|
9534
|
+
controls: `htpc${uuid_default()}`,
|
|
8855
9535
|
model: void 0,
|
|
8856
9536
|
expanded: false,
|
|
8857
9537
|
is12Hour: false,
|
|
@@ -9009,7 +9689,7 @@
|
|
|
9009
9689
|
if (el.hasAttribute("id")) {
|
|
9010
9690
|
timepicker._h_timepicker.id = el.getAttribute("id");
|
|
9011
9691
|
} else {
|
|
9012
|
-
timepicker._h_timepicker.id = `htp${
|
|
9692
|
+
timepicker._h_timepicker.id = `htp${uuid_default()}`;
|
|
9013
9693
|
el.setAttribute("id", timepicker._h_timepicker.id);
|
|
9014
9694
|
}
|
|
9015
9695
|
el.classList.add(
|
|
@@ -9620,13 +10300,13 @@
|
|
|
9620
10300
|
Alpine.directive("h-tooltip-trigger", (el, _, { Alpine: Alpine2, cleanup }) => {
|
|
9621
10301
|
el._tooltip = Alpine2.reactive({
|
|
9622
10302
|
id: void 0,
|
|
9623
|
-
controls: `hpc${
|
|
10303
|
+
controls: `hpc${uuid_default()}`,
|
|
9624
10304
|
shown: false
|
|
9625
10305
|
});
|
|
9626
10306
|
if (el.hasAttribute("id")) {
|
|
9627
10307
|
el._tooltip.id = el.getAttribute("id");
|
|
9628
10308
|
} else {
|
|
9629
|
-
el._tooltip.id = `hp${
|
|
10309
|
+
el._tooltip.id = `hp${uuid_default()}`;
|
|
9630
10310
|
el.setAttribute("id", el._tooltip.id);
|
|
9631
10311
|
}
|
|
9632
10312
|
el.setAttribute("aria-describedby", el._tooltip.controls);
|
|
@@ -9996,23 +10676,6 @@
|
|
|
9996
10676
|
};
|
|
9997
10677
|
initColorScheme();
|
|
9998
10678
|
|
|
9999
|
-
// src/utils/breakpoint-listener.js
|
|
10000
|
-
function getBreakpointListener(handler, breakpoint = 768) {
|
|
10001
|
-
const mql = top.matchMedia(`(width <= ${breakpoint}px)`);
|
|
10002
|
-
const onWidthChange = (event) => {
|
|
10003
|
-
handler(event.matches);
|
|
10004
|
-
};
|
|
10005
|
-
mql.addEventListener("change", onWidthChange);
|
|
10006
|
-
handler(mql.matches);
|
|
10007
|
-
return {
|
|
10008
|
-
_mql: mql,
|
|
10009
|
-
_onWidthChange: onWidthChange,
|
|
10010
|
-
remove() {
|
|
10011
|
-
this._mql.removeEventListener("change", this._onWidthChange);
|
|
10012
|
-
}
|
|
10013
|
-
};
|
|
10014
|
-
}
|
|
10015
|
-
|
|
10016
10679
|
// src/utils/template.js
|
|
10017
10680
|
function template_default(Alpine) {
|
|
10018
10681
|
Alpine.directive("h-template", (el, { original: original2, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
|
|
@@ -10122,7 +10785,7 @@
|
|
|
10122
10785
|
}
|
|
10123
10786
|
|
|
10124
10787
|
// package.json
|
|
10125
|
-
var version = "1.
|
|
10788
|
+
var version = "1.7.1";
|
|
10126
10789
|
|
|
10127
10790
|
// src/index.js
|
|
10128
10791
|
window.Harmonia = { getBreakpointListener, addColorSchemeListener, getColorScheme, removeColorSchemeListener, setColorScheme, getSystemColorScheme, version };
|
|
@@ -10145,6 +10808,7 @@
|
|
|
10145
10808
|
window.Alpine.plugin(label_default);
|
|
10146
10809
|
window.Alpine.plugin(list_default);
|
|
10147
10810
|
window.Alpine.plugin(menu_default);
|
|
10811
|
+
window.Alpine.plugin(notifications_default);
|
|
10148
10812
|
window.Alpine.plugin(pagination_default);
|
|
10149
10813
|
window.Alpine.plugin(popover_default);
|
|
10150
10814
|
window.Alpine.plugin(progress_default);
|