@pageboard/html 0.10.12 → 0.10.15
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/elements/form.js +0 -1
- package/lib/nouislider.js +31 -31
- package/package.json +2 -2
- package/ui/card.css +49 -49
- package/ui/form.css +3 -12
- package/ui/form.js +56 -38
- package/ui/input-file.css +6 -6
- package/ui/input-file.js +19 -15
- package/ui/input-range.js +8 -6
- package/ui/item.css +30 -30
- package/ui/layout.css +1 -1
- package/ui/loading.css +7 -7
- package/ui/menu.css +1 -1
- package/ui/menu.js +9 -7
- package/ui/query-tags.js +4 -3
- package/ui/rating.css +7 -7
- package/ui/site.css +25 -35
- package/ui/tab.css +1 -4
- package/ui/transition.css +8 -8
package/ui/form.js
CHANGED
|
@@ -33,27 +33,26 @@ class HTMLCustomFormElement extends HTMLFormElement {
|
|
|
33
33
|
delete state.query.submit;
|
|
34
34
|
state.finish(() => {
|
|
35
35
|
if (state.status != 200) return;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
this.dispatchEvent(new Event('submit', {
|
|
37
|
+
bubbles: true,
|
|
38
|
+
cancelable: true
|
|
39
|
+
}));
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
|
-
read(withDefaults) {
|
|
42
|
+
read(withDefaults = false) {
|
|
42
43
|
const fd = new FormData(this);
|
|
43
44
|
const query = {};
|
|
44
45
|
fd.forEach((val, key) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
val = undefined;
|
|
49
|
-
} else {
|
|
50
|
-
val = null;
|
|
51
|
-
}
|
|
46
|
+
const cur = this.querySelectorAll(`[name="${key}"]`).slice(-1).pop();
|
|
47
|
+
if (cur.type == "file") {
|
|
48
|
+
val = cur.value;
|
|
52
49
|
}
|
|
50
|
+
if (val == "") val = null;
|
|
51
|
+
// build array-like values
|
|
53
52
|
const old = query[key];
|
|
54
53
|
if (old !== undefined) {
|
|
55
54
|
if (!Array.isArray(old)) {
|
|
56
|
-
query[key] = [old];
|
|
55
|
+
query[key] = old == null ? [] : [old];
|
|
57
56
|
}
|
|
58
57
|
if (val !== undefined) query[key].push(val);
|
|
59
58
|
} else {
|
|
@@ -61,37 +60,48 @@ class HTMLCustomFormElement extends HTMLFormElement {
|
|
|
61
60
|
}
|
|
62
61
|
});
|
|
63
62
|
|
|
63
|
+
// withDefaults: keep value if equals to its default
|
|
64
|
+
// else unset value
|
|
64
65
|
for (const node of this.elements) {
|
|
65
|
-
|
|
66
|
+
const { name, type } = node;
|
|
67
|
+
if (name == null || name == "" || type == "button") {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
66
70
|
let val = node.value;
|
|
67
71
|
if (val == "") val = null;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
72
|
+
let defVal = node.defaultValue;
|
|
73
|
+
if (defVal == "") defVal = null;
|
|
74
|
+
|
|
75
|
+
switch (type) {
|
|
76
|
+
case "radio":
|
|
77
|
+
if (!withDefaults && node.checked == node.defaultChecked) {
|
|
78
|
+
if (query[name] == val) {
|
|
79
|
+
query[name] = undefined;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
case "checkbox":
|
|
84
|
+
if (!withDefaults) {
|
|
85
|
+
if (!(name in query)) {
|
|
86
|
+
query[name] = undefined;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
case "hidden":
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
if (withDefaults) {
|
|
94
|
+
if (query[name] === undefined) {
|
|
95
|
+
query[name] = defVal;
|
|
96
|
+
}
|
|
97
|
+
} else if (val === defVal) {
|
|
98
|
+
query[name] = node.required ? null : undefined;
|
|
99
|
+
}
|
|
90
100
|
}
|
|
91
101
|
}
|
|
102
|
+
// FIXME use e.submitter polyfill when available
|
|
103
|
+
// https://github.com/Financial-Times/polyfill-library/issues/1111
|
|
92
104
|
const btn = document.activeElement;
|
|
93
|
-
// FIXME https://github.com/whatwg/html/issues/3195 use e.submitter polyfill
|
|
94
|
-
// https://github.com/whatwg/xhr/issues/262 it's a mess
|
|
95
105
|
if (btn && btn.type == "submit" && btn.name && btn.value) {
|
|
96
106
|
query[btn.name] = btn.value;
|
|
97
107
|
}
|
|
@@ -344,6 +354,9 @@ HTMLInputElement.prototype.fill = function (val) {
|
|
|
344
354
|
if (val == null) val = "";
|
|
345
355
|
if (this.type == "radio" || this.type == "checkbox") {
|
|
346
356
|
this.checked = val;
|
|
357
|
+
} else if (this.type == "file") {
|
|
358
|
+
if (val == '' || val == null) this.removeAttribute('value');
|
|
359
|
+
else this.setAttribute('value', val);
|
|
347
360
|
} else {
|
|
348
361
|
this.value = val;
|
|
349
362
|
}
|
|
@@ -360,6 +373,8 @@ HTMLInputElement.prototype.reset = function () {
|
|
|
360
373
|
HTMLInputElement.prototype.save = function () {
|
|
361
374
|
if (this.type == "radio" || this.type == "checkbox") {
|
|
362
375
|
this.defaultChecked = this.checked;
|
|
376
|
+
} else if (this.type == "file") {
|
|
377
|
+
this.defaultValue = this.getAttribute('value') || '';
|
|
363
378
|
} else {
|
|
364
379
|
this.defaultValue = this.value;
|
|
365
380
|
}
|
|
@@ -377,11 +392,13 @@ Object.defineProperty(HTMLInputElement.prototype, 'defaultValue', {
|
|
|
377
392
|
configurable: true,
|
|
378
393
|
enumerable: true,
|
|
379
394
|
get: function () {
|
|
395
|
+
// FIXME might not be needed anymore
|
|
380
396
|
if (this.form?.method == "get") return '';
|
|
381
397
|
else return this.getAttribute('value');
|
|
382
398
|
},
|
|
383
399
|
set: function (val) {
|
|
384
|
-
this.
|
|
400
|
+
if (val == '' || val == null) this.removeAttribute('value');
|
|
401
|
+
else this.setAttribute('value', val);
|
|
385
402
|
}
|
|
386
403
|
});
|
|
387
404
|
|
|
@@ -464,6 +481,7 @@ Page.ready((state) => {
|
|
|
464
481
|
// new way
|
|
465
482
|
}
|
|
466
483
|
HTMLCustomFormElement.prototype.fill.call(form, linearizeValues(values), state.scope);
|
|
484
|
+
HTMLCustomFormElement.prototype.save.call(form);
|
|
467
485
|
}
|
|
468
486
|
} else if (action == "read") {
|
|
469
487
|
const obj = {};
|
package/ui/input-file.css
CHANGED
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
.form .field > input[type="file"]:focus,
|
|
15
15
|
.form .field > input[type="file"]:hover {
|
|
16
16
|
position:relative;
|
|
17
|
-
color:
|
|
17
|
+
color: transparent !important;
|
|
18
18
|
}
|
|
19
|
-
.form .field > input[type="file"][
|
|
20
|
-
content:attr(
|
|
19
|
+
.form .field > input[type="file"][value]::after {
|
|
20
|
+
content:attr(value);
|
|
21
21
|
color: black;
|
|
22
22
|
text-align: left;
|
|
23
23
|
position: absolute;
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
padding-left: inherit;
|
|
27
27
|
padding-right: inherit;
|
|
28
28
|
}
|
|
29
|
-
.form .field.error > input[type="file"][
|
|
29
|
+
.form .field.error > input[type="file"][value]::after {
|
|
30
30
|
color:inherit;
|
|
31
31
|
}
|
|
32
32
|
.form .field > input[type="file"]::after,
|
|
33
|
-
.form .field > input[type="file"]:not([
|
|
33
|
+
.form .field > input[type="file"]:not([value])::after {
|
|
34
34
|
content:attr(placeholder);
|
|
35
35
|
color: rgba(0 0 0 / 50%);
|
|
36
36
|
float: left;
|
|
@@ -53,6 +53,6 @@ input[type="file"]::file-selector-button {
|
|
|
53
53
|
z-index: 1;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
input[type="file"][
|
|
56
|
+
input[type="file"][value]::file-selector-button {
|
|
57
57
|
background-image: url('data:image/svg+xml,<svg width="64" height="64" xmlns="http://www.w3.org/2000/svg"><path d="m40.9 31.9 21-21a6.4 6.4 0 1 0-9-9l-21 21-21-21a6.4 6.4 0 1 0-9 9l21 21-21 21a6.4 6.4 0 0 0 0 9C3 63 4.6 63.8 6.2 63.8s3.3-.7 4.5-2l21-21 21 21c1.2 1.3 2.8 2 4.5 2s3.2-.7 4.5-2a6.4 6.4 0 0 0 0-9z"/></svg>');
|
|
58
58
|
}
|
package/ui/input-file.js
CHANGED
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
class HTMLElementInputFile extends HTMLInputElement {
|
|
2
2
|
#xhr;
|
|
3
3
|
#promise;
|
|
4
|
-
#
|
|
4
|
+
#defaultValue;
|
|
5
|
+
|
|
6
|
+
/* Since input[type=file] does not allow setting "value" property,
|
|
7
|
+
* it is stored in the "value" attribute,
|
|
8
|
+
* forcing defaultValue to be handled with a private field.
|
|
9
|
+
* The "filename" attribute is used to display both selected value property,
|
|
10
|
+
* and filled value attribute.
|
|
11
|
+
*/
|
|
5
12
|
|
|
6
13
|
constructor() {
|
|
7
14
|
super();
|
|
8
15
|
if (this.init) this.init();
|
|
9
16
|
this.save();
|
|
10
17
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return this.getAttribute('value');
|
|
18
|
+
get defaultValue() {
|
|
19
|
+
return this.#defaultValue;
|
|
14
20
|
}
|
|
15
|
-
|
|
16
|
-
this.#
|
|
21
|
+
set defaultValue(str) {
|
|
22
|
+
this.#defaultValue = str;
|
|
17
23
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
else this.removeAttribute('value');
|
|
21
|
-
this.value = this.#value;
|
|
24
|
+
get value() {
|
|
25
|
+
return this.getAttribute('value');
|
|
22
26
|
}
|
|
23
27
|
set value(str) {
|
|
24
|
-
if (str
|
|
25
|
-
this.setAttribute('
|
|
28
|
+
if (str) {
|
|
29
|
+
this.setAttribute('value', str);
|
|
26
30
|
} else {
|
|
27
|
-
this.removeAttribute('
|
|
31
|
+
this.removeAttribute('value');
|
|
28
32
|
super.value = "";
|
|
29
33
|
}
|
|
30
34
|
}
|
|
31
35
|
captureClick(e, state) {
|
|
32
|
-
if (
|
|
36
|
+
if (this.value) {
|
|
33
37
|
e.preventDefault();
|
|
34
38
|
if (this.#xhr) {
|
|
35
39
|
this.#xhr.abort();
|
|
@@ -72,7 +76,7 @@ class HTMLElementInputFile extends HTMLInputElement {
|
|
|
72
76
|
const pass = (obj) => {
|
|
73
77
|
if (!obj.items || obj.items.length == 0) return fail(new Error("File rejected"));
|
|
74
78
|
const val = obj.items[0];
|
|
75
|
-
this.
|
|
79
|
+
this.value = val;
|
|
76
80
|
field.classList.add('success');
|
|
77
81
|
field.classList.remove('loading');
|
|
78
82
|
this.#xhr = null;
|
package/ui/input-range.js
CHANGED
|
@@ -81,9 +81,10 @@ class HTMLElementInputRange extends HTMLInputElement {
|
|
|
81
81
|
helper.classList.remove('indeterminate');
|
|
82
82
|
if (isInt) values = values.map((n) => parseInt(n));
|
|
83
83
|
this.rangeValue = values;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
this.dispatchEvent(new Event('change', {
|
|
85
|
+
bubbles: true,
|
|
86
|
+
cancelable: true
|
|
87
|
+
}));
|
|
87
88
|
});
|
|
88
89
|
helper.addEventListener('keydown', this, true);
|
|
89
90
|
helper.addEventListener('dblclick', this, true);
|
|
@@ -92,9 +93,10 @@ class HTMLElementInputRange extends HTMLInputElement {
|
|
|
92
93
|
handleEvent(e) {
|
|
93
94
|
if (e.type == "dblclick" || e.keyCode == 8 || e.keyCode == 46) {
|
|
94
95
|
this.fill();
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
this.dispatchEvent(new Event('change', {
|
|
97
|
+
bubbles: true,
|
|
98
|
+
cancelable: true
|
|
99
|
+
}));
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
|
package/ui/item.css
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
border-radius: 0rem;
|
|
24
24
|
box-shadow: none;
|
|
25
25
|
transition: box-shadow 0.1s ease;
|
|
26
|
-
z-index:
|
|
26
|
+
z-index: "";
|
|
27
27
|
font-size: 1em;
|
|
28
28
|
}
|
|
29
29
|
.ui.items > .ui a {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
.ui.items > .ui::after {
|
|
52
52
|
display: block;
|
|
53
|
-
content:
|
|
53
|
+
content: " ";
|
|
54
54
|
height: 0px;
|
|
55
55
|
clear: both;
|
|
56
56
|
overflow: hidden;
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
float: none;
|
|
75
75
|
margin: 0em;
|
|
76
76
|
padding: 0em;
|
|
77
|
-
max-height:
|
|
77
|
+
max-height: "";
|
|
78
78
|
align-self: top;
|
|
79
79
|
width:175px;
|
|
80
80
|
}
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
.ui.items > .ui > .content::after {
|
|
108
108
|
display: block;
|
|
109
|
-
content:
|
|
109
|
+
content: " ";
|
|
110
110
|
height: 0px;
|
|
111
111
|
clear: both;
|
|
112
112
|
overflow: hidden;
|
|
@@ -122,15 +122,15 @@
|
|
|
122
122
|
}
|
|
123
123
|
.ui.items > .ui > .content > .header {
|
|
124
124
|
display: inline-block;
|
|
125
|
-
margin: -0.
|
|
126
|
-
font-family:
|
|
125
|
+
margin: -0.2142em 0em 0em;
|
|
126
|
+
font-family: Lato, "Helvetica Neue", Arial, Helvetica, sans-serif;
|
|
127
127
|
font-weight: bold;
|
|
128
|
-
color:
|
|
128
|
+
color: rgb(0 0 0 / 85%);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/* Default Header Size */
|
|
132
132
|
.ui.items > .ui > .content > .header:not(.ui) {
|
|
133
|
-
font-size: 1.
|
|
133
|
+
font-size: 1.2857em;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/*--------------
|
|
@@ -150,12 +150,12 @@
|
|
|
150
150
|
|
|
151
151
|
.ui.items > .ui .content img {
|
|
152
152
|
align-self: middle;
|
|
153
|
-
width:
|
|
153
|
+
width: "";
|
|
154
154
|
}
|
|
155
155
|
.ui.items > .ui img.avatar,
|
|
156
156
|
.ui.items > .ui .avatar img {
|
|
157
|
-
width:
|
|
158
|
-
height:
|
|
157
|
+
width: "";
|
|
158
|
+
height: "";
|
|
159
159
|
border-radius: 500rem;
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
max-width: auto;
|
|
169
169
|
font-size: 1em;
|
|
170
170
|
line-height: 1.4285em;
|
|
171
|
-
color:
|
|
171
|
+
color: rgb(0 0 0 / 87%);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
/*--------------
|
|
@@ -187,10 +187,10 @@
|
|
|
187
187
|
---------------*/
|
|
188
188
|
|
|
189
189
|
.ui.items > .ui .meta {
|
|
190
|
-
margin: 0.5em 0em
|
|
190
|
+
margin: 0.5em 0em;
|
|
191
191
|
font-size: 1em;
|
|
192
192
|
line-height: 1em;
|
|
193
|
-
color:
|
|
193
|
+
color: rgb(0 0 0 / 60%);
|
|
194
194
|
}
|
|
195
195
|
.ui.items > .ui .meta * {
|
|
196
196
|
margin-right: 0.3em;
|
|
@@ -210,16 +210,16 @@
|
|
|
210
210
|
|
|
211
211
|
/* Generic */
|
|
212
212
|
.ui.items > .ui > .content a:not(.ui) {
|
|
213
|
-
color:
|
|
213
|
+
color: "";
|
|
214
214
|
transition: color 0.1s ease;
|
|
215
215
|
}
|
|
216
216
|
.ui.items > .ui > .content a:not(.ui):hover {
|
|
217
|
-
color:
|
|
217
|
+
color: "";
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
/* Header */
|
|
221
221
|
.ui.items > .ui > .content > a.header {
|
|
222
|
-
color:
|
|
222
|
+
color: rgb(0 0 0 / 85%);
|
|
223
223
|
}
|
|
224
224
|
.ui.items > .ui > .content > a.header:hover {
|
|
225
225
|
color: #1e70bf;
|
|
@@ -227,10 +227,10 @@
|
|
|
227
227
|
|
|
228
228
|
/* Meta */
|
|
229
229
|
.ui.items > .ui .meta > a:not(.ui) {
|
|
230
|
-
color:
|
|
230
|
+
color: rgb(0 0 0 / 40%);
|
|
231
231
|
}
|
|
232
232
|
.ui.items > .ui .meta > a:not(.ui):hover {
|
|
233
|
-
color:
|
|
233
|
+
color: rgb(0 0 0 / 87%);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
/*--------------
|
|
@@ -244,11 +244,11 @@
|
|
|
244
244
|
/* Icon */
|
|
245
245
|
.ui.items > .ui > .content .favorite.icon {
|
|
246
246
|
cursor: pointer;
|
|
247
|
-
opacity:
|
|
247
|
+
opacity: 75%;
|
|
248
248
|
transition: color 0.1s ease;
|
|
249
249
|
}
|
|
250
250
|
.ui.items > .ui > .content .favorite.icon:hover {
|
|
251
|
-
opacity:
|
|
251
|
+
opacity: 100%;
|
|
252
252
|
color: #FFB70A;
|
|
253
253
|
}
|
|
254
254
|
.ui.items > .ui > .content .active.favorite.icon {
|
|
@@ -261,11 +261,11 @@
|
|
|
261
261
|
/* Icon */
|
|
262
262
|
.ui.items > .ui > .content .like.icon {
|
|
263
263
|
cursor: pointer;
|
|
264
|
-
opacity:
|
|
264
|
+
opacity: 75%;
|
|
265
265
|
transition: color 0.1s ease;
|
|
266
266
|
}
|
|
267
267
|
.ui.items > .ui > .content .like.icon:hover {
|
|
268
|
-
opacity:
|
|
268
|
+
opacity: 100%;
|
|
269
269
|
color: #FF2733;
|
|
270
270
|
}
|
|
271
271
|
.ui.items > .ui > .content .active.like.icon {
|
|
@@ -282,10 +282,10 @@
|
|
|
282
282
|
background: none;
|
|
283
283
|
margin: 0.5rem 0em 0em;
|
|
284
284
|
width: 100%;
|
|
285
|
-
padding: 0em
|
|
285
|
+
padding: 0em;
|
|
286
286
|
top: 0em;
|
|
287
287
|
left: 0em;
|
|
288
|
-
color:
|
|
288
|
+
color: rgb(0 0 0 / 40%);
|
|
289
289
|
box-shadow: none;
|
|
290
290
|
transition: color 0.1s ease;
|
|
291
291
|
border-top: none;
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
}
|
|
299
299
|
.ui.items > .ui .extra::after {
|
|
300
300
|
display: block;
|
|
301
|
-
content:
|
|
301
|
+
content: " ";
|
|
302
302
|
height: 0px;
|
|
303
303
|
clear: both;
|
|
304
304
|
overflow: hidden;
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
margin-right: 1em;
|
|
320
320
|
}
|
|
321
321
|
.ui.three.items > .ui > .image {
|
|
322
|
-
width: calc(33.
|
|
322
|
+
width: calc(33.3333% - 1em);
|
|
323
323
|
margin-right: 1em;
|
|
324
324
|
}
|
|
325
325
|
.ui.four.items > .ui > .image {
|
|
@@ -331,11 +331,11 @@
|
|
|
331
331
|
margin-right: 0.75em;
|
|
332
332
|
}
|
|
333
333
|
.ui.six.items > .ui > .image {
|
|
334
|
-
width: calc(16.
|
|
334
|
+
width: calc(16.6667% - 0.75em);
|
|
335
335
|
margin-right: 0.75em;
|
|
336
336
|
}
|
|
337
337
|
.ui.seven.items > .ui > .image {
|
|
338
|
-
width: calc(14.
|
|
338
|
+
width: calc(14.2857% - 0.5em);
|
|
339
339
|
margin-right: 0.5em;
|
|
340
340
|
}
|
|
341
341
|
|
|
@@ -409,7 +409,7 @@
|
|
|
409
409
|
--------------------*/
|
|
410
410
|
|
|
411
411
|
.ui.divided.items > .ui {
|
|
412
|
-
border-top: 1px solid
|
|
412
|
+
border-top: 1px solid rgb(34 36 38 / 15%);
|
|
413
413
|
margin: 0em;
|
|
414
414
|
padding: 1em 0em;
|
|
415
415
|
}
|
package/ui/layout.css
CHANGED
package/ui/loading.css
CHANGED
|
@@ -21,24 +21,24 @@
|
|
|
21
21
|
0% {
|
|
22
22
|
width:0%;
|
|
23
23
|
margin-left:0px;
|
|
24
|
-
opacity:
|
|
24
|
+
opacity:30%;
|
|
25
25
|
}
|
|
26
26
|
50% {
|
|
27
27
|
width:20px;
|
|
28
28
|
margin-left:-10px;
|
|
29
|
-
opacity:
|
|
29
|
+
opacity:100%;
|
|
30
30
|
}
|
|
31
31
|
100% {
|
|
32
32
|
width:0%;
|
|
33
33
|
margin-left:0px;
|
|
34
|
-
opacity:
|
|
34
|
+
opacity:30%;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.loading[data-src]::after {
|
|
39
39
|
display: block;
|
|
40
40
|
animation: scanner 6s steps(3, end) infinite;
|
|
41
|
-
content:
|
|
41
|
+
content: "";
|
|
42
42
|
width: 20px;
|
|
43
43
|
height: 0;
|
|
44
44
|
border-top: 4px dotted #aaa;
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
|
|
49
49
|
.error[data-src]::after {
|
|
50
50
|
display: block;
|
|
51
|
-
content:
|
|
51
|
+
content: "∅";
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.waiting[data-src]::after {
|
|
55
55
|
display:block;
|
|
56
|
-
content:
|
|
56
|
+
content: "?";
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.denied[data-src]::after {
|
|
60
60
|
display:block;
|
|
61
|
-
content:
|
|
61
|
+
content: "🛇";
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.error[data-src],
|
package/ui/menu.css
CHANGED
package/ui/menu.js
CHANGED
|
@@ -27,15 +27,17 @@ class HTMLElementMenu extends VirtualHTMLElement {
|
|
|
27
27
|
const menu = this.firstElementChild;
|
|
28
28
|
const helper = this.lastElementChild;
|
|
29
29
|
helper.lastElementChild.lastElementChild.appendChild(this.toHelper(menu));
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
state.finish(() => {
|
|
31
|
+
this.observer = new ResizeObserver((entries, observer) => {
|
|
32
|
+
window.requestAnimationFrame(() => {
|
|
33
|
+
const styles = window.getComputedStyle(this);
|
|
34
|
+
const parentWidth = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight) + this.offsetWidth;
|
|
35
|
+
const menuWidth = menu.offsetWidth;
|
|
36
|
+
this.classList.toggle('burger', parentWidth <= menuWidth);
|
|
37
|
+
});
|
|
36
38
|
});
|
|
39
|
+
this.observer.observe(this.parentNode);
|
|
37
40
|
});
|
|
38
|
-
this.observer.observe(this.parentNode);
|
|
39
41
|
}
|
|
40
42
|
close(state) {
|
|
41
43
|
if (this.observer) this.observer.disconnect();
|
package/ui/query-tags.js
CHANGED
|
@@ -90,9 +90,10 @@ class HTMLElementQueryTags extends VirtualHTMLElement {
|
|
|
90
90
|
else if (control.selected) control.selected = false;
|
|
91
91
|
else if (control.reset) control.reset();
|
|
92
92
|
else if (control.value) control.value = "";
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
control.form.dispatchEvent(new Event('submit', {
|
|
94
|
+
bubbles: true,
|
|
95
|
+
cancelable: true
|
|
96
|
+
}));
|
|
96
97
|
}
|
|
97
98
|
label.remove();
|
|
98
99
|
}
|
package/ui/rating.css
CHANGED
|
@@ -24,7 +24,7 @@ element-rating .icon {
|
|
|
24
24
|
height: auto;
|
|
25
25
|
transition: opacity 0.1s ease, background 0.1s ease, text-shadow 0.1s ease, color 0.1s ease;
|
|
26
26
|
backface-visibility: hidden;
|
|
27
|
-
color:
|
|
27
|
+
color: rgb(0 0 0 / 15%);
|
|
28
28
|
}
|
|
29
29
|
element-rating .icon:last-child {
|
|
30
30
|
padding-right:0;
|
|
@@ -40,20 +40,20 @@ element-rating .icon::before {
|
|
|
40
40
|
|
|
41
41
|
/* Active Icon */
|
|
42
42
|
element-rating .active.icon {
|
|
43
|
-
color:
|
|
43
|
+
color: rgb(0 0 0 / 85%);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/* Selected Icon */
|
|
47
47
|
element-rating .icon.selected,
|
|
48
48
|
element-rating .icon.selected.active {
|
|
49
|
-
color:
|
|
49
|
+
color: rgb(0 0 0 / 87%);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/* Star */
|
|
53
53
|
|
|
54
54
|
/* Inactive */
|
|
55
55
|
element-rating.star .icon {
|
|
56
|
-
color:
|
|
56
|
+
color: rgb(0 0 0 / 15%);
|
|
57
57
|
text-shadow: none;
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -73,7 +73,7 @@ element-rating.star .icon.selected.active {
|
|
|
73
73
|
/* Heart */
|
|
74
74
|
|
|
75
75
|
element-rating.heart .icon {
|
|
76
|
-
color:
|
|
76
|
+
color: rgb(0 0 0 / 15%);
|
|
77
77
|
text-shadow: none !important;
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -101,10 +101,10 @@ element-rating.disabled .icon {
|
|
|
101
101
|
|
|
102
102
|
/* Selected Rating */
|
|
103
103
|
element-rating.selected .active.icon {
|
|
104
|
-
opacity:
|
|
104
|
+
opacity: 100%;
|
|
105
105
|
}
|
|
106
106
|
element-rating .icon.selected,
|
|
107
107
|
element-rating.selected .icon.selected {
|
|
108
|
-
opacity:
|
|
108
|
+
opacity: 100%;
|
|
109
109
|
}
|
|
110
110
|
|