@pageboard/html 0.11.13 → 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 CHANGED
@@ -116,7 +116,7 @@ exports.api_form = {
116
116
  nullable: true,
117
117
  type: "string",
118
118
  format: "pathname",
119
- $helper: "page" // isn't it pageUrl here ?
119
+ $helper: "page"
120
120
  },
121
121
  parameters: {
122
122
  title: 'Parameters',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.11.13",
3
+ "version": "0.11.14",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -48,21 +48,16 @@ class HTMLElementFieldsetList extends VirtualHTMLElement {
48
48
  this.#initialSize = this.#size;
49
49
  }
50
50
 
51
- #prepare() {
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 = this.ownTpl.content.querySelectorAll('[name]');
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
- if (splits.length && splits.every(list => {
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);
@@ -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: auto;
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
- max-height: 100vh;
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
- left:auto;
107
- right: 0;
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
- element-menu.burger > .popup > .placer > .menu {
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,6 +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
+ if (state.query.develop !== undefined) loc.query.develop = state.query.develop;
7
8
  if (state.sameQuery(loc)) return true;
8
9
  } else {
9
10
  return state.pathname.startsWith(loc.pathname + '/');
@@ -32,7 +33,7 @@ class HTMLElementMenu extends VirtualHTMLElement {
32
33
  const styles = window.getComputedStyle(this);
33
34
  const parentWidth = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight) + this.offsetWidth;
34
35
  const menuWidth = menu.offsetWidth;
35
- this.classList.toggle('burger', parentWidth <= menuWidth);
36
+ this.classList.toggle('burger', menuWidth >= parentWidth);
36
37
  });
37
38
  });
38
39
  this.observer.observe(this.parentNode);
@@ -54,9 +55,9 @@ class HTMLElementMenu extends VirtualHTMLElement {
54
55
  tosser.classList.add('inactive');
55
56
  tosser.blur();
56
57
  } else {
57
- const padding = this.offsetTop + this.offsetHeight;
58
- const menu = tosser.lastElementChild.lastElementChild;
59
- menu.style.maxHeight = `calc(100vh - ${padding}px)`;
58
+ const placer = tosser.lastElementChild;
59
+ const padding = placer.offsetTop;
60
+ placer.lastElementChild.style.maxHeight = `calc(100vh - ${padding}px)`;
60
61
  }
61
62
  } else if (item) {
62
63
  this.active = item != this.active ? item : null;