@pageboard/html 0.11.12 → 0.11.14
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 +1 -1
- package/package.json +1 -1
- package/ui/fieldset-list.js +19 -8
- package/ui/input-date-slot.js +2 -1
- package/ui/menu.css +19 -12
- package/ui/menu.js +5 -5
package/elements/form.js
CHANGED
package/package.json
CHANGED
package/ui/fieldset-list.js
CHANGED
|
@@ -48,21 +48,16 @@ class HTMLElementFieldsetList extends VirtualHTMLElement {
|
|
|
48
48
|
this.#initialSize = this.#size;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
#
|
|
52
|
-
this.ownTpl.prerender();
|
|
53
|
-
if (this.isContentEditable) return;
|
|
54
|
-
for (const node of this.ownTpl.content.querySelectorAll('[block-id]')) {
|
|
55
|
-
node.removeAttribute('block-id');
|
|
56
|
-
}
|
|
51
|
+
#modelize(tpl) {
|
|
57
52
|
const keys = new Set();
|
|
58
|
-
const inputs =
|
|
53
|
+
const inputs = tpl.querySelectorAll('[name]');
|
|
59
54
|
for (const node of inputs) {
|
|
60
55
|
keys.add(node.name);
|
|
61
56
|
}
|
|
62
57
|
const splits = Array.from(keys).map(name => name.split('.'));
|
|
63
58
|
const coms = [];
|
|
64
59
|
let pos = 0, com = null;
|
|
65
|
-
|
|
60
|
+
while (splits.length && splits.every(list => {
|
|
66
61
|
if (com == null) {
|
|
67
62
|
if (pos < list.length) {
|
|
68
63
|
com = list[pos];
|
|
@@ -88,6 +83,19 @@ class HTMLElementFieldsetList extends VirtualHTMLElement {
|
|
|
88
83
|
this.#model = model;
|
|
89
84
|
}
|
|
90
85
|
|
|
86
|
+
#prepare() {
|
|
87
|
+
const tpl = this.ownTpl;
|
|
88
|
+
tpl.prerender();
|
|
89
|
+
if (this.isContentEditable) {
|
|
90
|
+
this.#modelize(tpl);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.#modelize(tpl.content);
|
|
94
|
+
for (const node of tpl.content.querySelectorAll('[block-id]')) {
|
|
95
|
+
node.removeAttribute('block-id');
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
91
99
|
patch(state) {
|
|
92
100
|
this.#prepare();
|
|
93
101
|
if (!this.#size) this.#resize(0, state.scope);
|
|
@@ -250,6 +258,9 @@ class HTMLElementFieldsetList extends VirtualHTMLElement {
|
|
|
250
258
|
get ownView() {
|
|
251
259
|
return this.children.find(node => node.matches('.view'));
|
|
252
260
|
}
|
|
261
|
+
get prefix() {
|
|
262
|
+
return this.#prefix;
|
|
263
|
+
}
|
|
253
264
|
}
|
|
254
265
|
|
|
255
266
|
VirtualHTMLElement.define('element-fieldset-list', HTMLElementFieldsetList);
|
package/ui/input-date-slot.js
CHANGED
|
@@ -6,7 +6,7 @@ class HTMLElementInputDateSlot extends VirtualHTMLElement {
|
|
|
6
6
|
get type() {
|
|
7
7
|
const type = this.getAttribute('type');
|
|
8
8
|
const step = this.step;
|
|
9
|
-
if (step) {
|
|
9
|
+
if (step && !type) {
|
|
10
10
|
if (step >= 86400) return "date";
|
|
11
11
|
else if (type == "date") return "datetime-local";
|
|
12
12
|
}
|
|
@@ -63,6 +63,7 @@ class HTMLElementInputDateSlot extends VirtualHTMLElement {
|
|
|
63
63
|
const [ start, end ] = this.#inputs();
|
|
64
64
|
const type = this.type;
|
|
65
65
|
let step = this.step;
|
|
66
|
+
if (type == "date" && step < 86400) step = 0;
|
|
66
67
|
if (step) {
|
|
67
68
|
if (type == "date") step = Math.round(step / 86400);
|
|
68
69
|
start.setAttribute('step', step);
|
package/ui/menu.css
CHANGED
|
@@ -46,16 +46,19 @@
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
}
|
|
48
48
|
.right.burger .popup.item > .placer {
|
|
49
|
-
left:
|
|
49
|
+
left: 0;
|
|
50
50
|
right:0;
|
|
51
51
|
}
|
|
52
52
|
.right.popup.item > .placer > div {
|
|
53
53
|
left:auto;
|
|
54
54
|
right:0;
|
|
55
55
|
}
|
|
56
|
+
.fixed.popup.item {
|
|
57
|
+
position:static !important;
|
|
58
|
+
}
|
|
56
59
|
.fixed.popup.item > .placer > div {
|
|
57
60
|
max-width: 100vw;
|
|
58
|
-
|
|
61
|
+
margin-top: -1rem;
|
|
59
62
|
}
|
|
60
63
|
.center.popup.item > .placer > div {
|
|
61
64
|
transform: translateX(-50%);
|
|
@@ -82,7 +85,6 @@
|
|
|
82
85
|
|
|
83
86
|
/* menu_group */
|
|
84
87
|
element-menu {
|
|
85
|
-
position: relative;
|
|
86
88
|
flex-shrink: 1;
|
|
87
89
|
}
|
|
88
90
|
.ui.menu:not(.vertical) > element-menu {
|
|
@@ -99,12 +101,12 @@ element-menu > [block-content="items"] {
|
|
|
99
101
|
display:flex;
|
|
100
102
|
}
|
|
101
103
|
element-menu.burger > [block-content="items"] {
|
|
102
|
-
position: fixed;
|
|
103
104
|
left:0;
|
|
104
105
|
}
|
|
105
106
|
element-menu.burger.right > [block-content="items"] {
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
position: absolute;
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
height: 0;
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
element-menu:not(.burger) > .item {
|
|
@@ -117,6 +119,9 @@ element-menu.burger .placer .title {
|
|
|
117
119
|
element-menu.burger > .item .popup.item {
|
|
118
120
|
display:block;
|
|
119
121
|
}
|
|
122
|
+
.ui.menu [block-type="menu_item_popup"] {
|
|
123
|
+
position:initial !important;
|
|
124
|
+
}
|
|
120
125
|
element-menu.burger .placer .popup.active .title {
|
|
121
126
|
margin-bottom:0.5em;
|
|
122
127
|
}
|
|
@@ -126,6 +131,10 @@ element-menu.burger > [block-content="items"] > * {
|
|
|
126
131
|
element-menu.burger .popup.item.active > .placer > div {
|
|
127
132
|
display:block;
|
|
128
133
|
}
|
|
134
|
+
element-menu.burger .popup.item > .placer > div {
|
|
135
|
+
left: 0 !important;
|
|
136
|
+
right: 0 !important;
|
|
137
|
+
}
|
|
129
138
|
element-menu.burger > .item .dropdown.item:hover > .menu,
|
|
130
139
|
element-menu.burger > .item .popup.item:hover > .placer > div {
|
|
131
140
|
display:none !important;
|
|
@@ -138,8 +147,8 @@ element-menu.burger > .item .dropdown.item.active > .menu {
|
|
|
138
147
|
}
|
|
139
148
|
|
|
140
149
|
element-menu.burger > .item .popup.item.active > .placer > div {
|
|
141
|
-
display:block !important;
|
|
142
|
-
position:relative;
|
|
150
|
+
display: block !important;
|
|
151
|
+
position: relative;
|
|
143
152
|
}
|
|
144
153
|
element-menu.burger > .item:hover > .popup.item {
|
|
145
154
|
display:block;
|
|
@@ -150,7 +159,7 @@ element-menu.burger > .item .placer .menu .ui.dropdown {
|
|
|
150
159
|
}
|
|
151
160
|
|
|
152
161
|
element-menu.burger > .item .popup.item > .placer {
|
|
153
|
-
position:relative;
|
|
162
|
+
position: relative;
|
|
154
163
|
}
|
|
155
164
|
element-menu.burger > .item .popup.item > .placer > div > .grid {
|
|
156
165
|
border:0 !important;
|
|
@@ -162,9 +171,7 @@ element-menu.burger > .popup > .icon {
|
|
|
162
171
|
font-weight: bold;
|
|
163
172
|
font-family: sans-serif;
|
|
164
173
|
}
|
|
165
|
-
|
|
166
|
-
right:auto; /* disables the right:0 given by .popup > .placer > div */
|
|
167
|
-
}
|
|
174
|
+
|
|
168
175
|
|
|
169
176
|
@media screen and (max-width: 768px) {
|
|
170
177
|
.ui.menu [block-type="menu_item_text"] {
|
package/ui/menu.js
CHANGED
|
@@ -4,7 +4,7 @@ Page.patch((state) => {
|
|
|
4
4
|
return false;
|
|
5
5
|
} else if (state.samePathname(loc)) {
|
|
6
6
|
if (loc.sameQuery({query:{}})) return true;
|
|
7
|
-
loc.query.develop = state.query.develop;
|
|
7
|
+
if (state.query.develop !== undefined) loc.query.develop = state.query.develop;
|
|
8
8
|
if (state.sameQuery(loc)) return true;
|
|
9
9
|
} else {
|
|
10
10
|
return state.pathname.startsWith(loc.pathname + '/');
|
|
@@ -33,7 +33,7 @@ class HTMLElementMenu extends VirtualHTMLElement {
|
|
|
33
33
|
const styles = window.getComputedStyle(this);
|
|
34
34
|
const parentWidth = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight) + this.offsetWidth;
|
|
35
35
|
const menuWidth = menu.offsetWidth;
|
|
36
|
-
this.classList.toggle('burger',
|
|
36
|
+
this.classList.toggle('burger', menuWidth >= parentWidth);
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
this.observer.observe(this.parentNode);
|
|
@@ -55,9 +55,9 @@ class HTMLElementMenu extends VirtualHTMLElement {
|
|
|
55
55
|
tosser.classList.add('inactive');
|
|
56
56
|
tosser.blur();
|
|
57
57
|
} else {
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
58
|
+
const placer = tosser.lastElementChild;
|
|
59
|
+
const padding = placer.offsetTop;
|
|
60
|
+
placer.lastElementChild.style.maxHeight = `calc(100vh - ${padding}px)`;
|
|
61
61
|
}
|
|
62
62
|
} else if (item) {
|
|
63
63
|
this.active = item != this.active ? item : null;
|