@pageboard/html 0.13.5 → 0.13.7
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/inputs.js +17 -2
- package/package.json +1 -1
- package/ui/image.js +9 -2
- package/ui/layout.js +2 -2
package/elements/inputs.js
CHANGED
|
@@ -67,14 +67,29 @@ exports.input_fields = {
|
|
|
67
67
|
type: 'boolean',
|
|
68
68
|
default: false
|
|
69
69
|
},
|
|
70
|
+
grouped: {
|
|
71
|
+
title: "Grouped",
|
|
72
|
+
type: 'boolean',
|
|
73
|
+
default: false
|
|
74
|
+
},
|
|
70
75
|
full: {
|
|
71
76
|
title: 'Full width',
|
|
72
77
|
type: 'boolean',
|
|
73
78
|
default: false
|
|
74
79
|
}
|
|
75
80
|
},
|
|
76
|
-
contents: "input_field*",
|
|
77
|
-
html: `<div class="[inline] [full|alt:fluid:] fields"></div>`
|
|
81
|
+
contents: "(input_label|input_field)*",
|
|
82
|
+
html: `<div class="[inline] [grouped] [full|alt:fluid:] fields"></div>`
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
exports.input_label = {
|
|
86
|
+
title: 'Input Label',
|
|
87
|
+
icon: '<i class="icons"><i class="text cursor icon"></i><i class="corner tag icon"></i></i>',
|
|
88
|
+
menu: "form",
|
|
89
|
+
group: "block",
|
|
90
|
+
context: "input_fields//",
|
|
91
|
+
contents: "inline*",
|
|
92
|
+
html: `<label></label>`
|
|
78
93
|
};
|
|
79
94
|
|
|
80
95
|
exports.input_text = {
|
package/package.json
CHANGED
package/ui/image.js
CHANGED
|
@@ -162,7 +162,7 @@ const HTMLElementImageConstructor = Superclass => class extends Superclass {
|
|
|
162
162
|
const curSrc = loc.toString();
|
|
163
163
|
if (curSrc != this.currentSrc) {
|
|
164
164
|
this.classList.add('loading');
|
|
165
|
-
this.#defer?.
|
|
165
|
+
this.#defer?.reject();
|
|
166
166
|
this.#defer = new Deferred();
|
|
167
167
|
img.setAttribute('src', curSrc);
|
|
168
168
|
return this.#defer;
|
|
@@ -174,7 +174,7 @@ const HTMLElementImageConstructor = Superclass => class extends Superclass {
|
|
|
174
174
|
this.fix(this.image);
|
|
175
175
|
}
|
|
176
176
|
captureError() {
|
|
177
|
-
this.#defer.
|
|
177
|
+
this.#defer.reject();
|
|
178
178
|
this.classList.remove('loading');
|
|
179
179
|
this.classList.add('error');
|
|
180
180
|
this.placeholder(true);
|
|
@@ -213,6 +213,13 @@ class HTMLElementInlineImage extends HTMLElementImageConstructor(Page.create(HTM
|
|
|
213
213
|
if (!cur && this.image.src?.startsWith('data:')) return this.src;
|
|
214
214
|
else return cur;
|
|
215
215
|
}
|
|
216
|
+
|
|
217
|
+
captureLoad() {
|
|
218
|
+
super.captureLoad();
|
|
219
|
+
}
|
|
220
|
+
captureError() {
|
|
221
|
+
super.captureError();
|
|
222
|
+
}
|
|
216
223
|
}
|
|
217
224
|
|
|
218
225
|
Page.define('element-image', HTMLElementImage);
|
package/ui/layout.js
CHANGED
|
@@ -56,11 +56,11 @@ class HTMLElementLayout extends Page.create(HTMLDivElement) {
|
|
|
56
56
|
} catch(e) {
|
|
57
57
|
// pass
|
|
58
58
|
}
|
|
59
|
-
this.#defer?.
|
|
59
|
+
this.#defer?.reject();
|
|
60
60
|
this.#defer = new Deferred();
|
|
61
61
|
const img = new Image();
|
|
62
62
|
img.addEventListener('load', this.#defer.resolve);
|
|
63
|
-
img.addEventListener('error', this.#defer.
|
|
63
|
+
img.addEventListener('error', this.#defer.reject);
|
|
64
64
|
img.src = curSrc;
|
|
65
65
|
this.style.backgroundImage = `url("${curSrc}")`;
|
|
66
66
|
return this.#defer;
|