@pageboard/html 0.11.18 → 0.11.19

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.
@@ -49,13 +49,15 @@ exports.input_date_time = {
49
49
  }]
50
50
  },
51
51
  step: {
52
- title: 'Step',
53
- description: 'rounding/increment in seconds',
52
+ title: 'Time steps',
53
+ description: 'Ignored for dates',
54
54
  type: 'integer',
55
- default: 60,
55
+ default: null,
56
56
  anyOf: [{
57
- const: 60,
57
+ const: null,
58
58
  title: '1 minute'
59
+ }, {
60
+ const: 60
59
61
  }, {
60
62
  const: 60 * 5,
61
63
  title: '5 minutes'
package/elements/menu.js CHANGED
@@ -43,6 +43,17 @@ exports.menu_group = {
43
43
  const: "right",
44
44
  title: "Right"
45
45
  }]
46
+ },
47
+ responsive: {
48
+ title: 'Responsive',
49
+ default: 'popup',
50
+ anyOf: [{
51
+ const: null,
52
+ title: 'None'
53
+ }, {
54
+ const: 'popup',
55
+ title: 'Popup'
56
+ }]
46
57
  }
47
58
  },
48
59
  contents: {
@@ -51,7 +62,7 @@ exports.menu_group = {
51
62
  },
52
63
  html: `<element-menu class="[position] menu">
53
64
  <div block-content="items"></div>
54
- <div tabindex="0" class="ui fixed popup item">
65
+ <div tabindex="0" class="ui fixed popup item [responsive|eq:popup|bmagnet:*]">
55
66
  <div class="icon">≡</div>
56
67
  <div class="dropdown placer"><div class="menu"></div></div>
57
68
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.11.18",
3
+ "version": "0.11.19",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,12 +19,12 @@
19
19
  },
20
20
  "homepage": "https://github.com/pageboard/client#readme",
21
21
  "dependencies": {
22
- "postinstall": "^0.7.4",
22
+ "postinstall": "^0.8.0",
23
23
  "semantic-ui-css": "^2.4.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "formdata-polyfill": "^4.0.10",
27
- "nouislider": "^15.6.0",
27
+ "nouislider": "^15.6.1",
28
28
  "object-fit-images": "^3.2.4",
29
29
  "postinstall-bundle": "^0.7.4"
30
30
  },
@@ -62,10 +62,8 @@ class HTMLElementInputDateSlot extends VirtualHTMLElement {
62
62
  patch(state) {
63
63
  const [ start, end ] = this.#inputs();
64
64
  const type = this.type;
65
- let step = this.step;
66
- if (type == "date" && step < 86400) step = 0;
65
+ const step = type == "date" ? 0 : this.step;
67
66
  if (step) {
68
- if (type == "date") step = Math.round(step / 86400);
69
67
  start.setAttribute('step', step);
70
68
  end.setAttribute('step', step);
71
69
  } else {
package/ui/input-date.js CHANGED
@@ -4,6 +4,10 @@ class HTMLElementInputDate extends HTMLInputElement {
4
4
  if (this.init) this.init();
5
5
  }
6
6
 
7
+ patch() {
8
+ if (this.type == "date") this.removeAttribute('step');
9
+ }
10
+
7
11
  setAttribute(name, value) {
8
12
  if (name == "value") {
9
13
  this.value = value;
package/ui/menu.css CHANGED
@@ -102,13 +102,10 @@ element-menu > [block-content="items"] {
102
102
  }
103
103
  element-menu.burger > [block-content="items"] {
104
104
  left:0;
105
- }
106
- element-menu.burger.right > [block-content="items"] {
107
105
  position: absolute;
108
106
  pointer-events: none;
109
107
  height: 0;
110
108
  }
111
-
112
109
  element-menu:not(.burger) > .item {
113
110
  display:none !important;
114
111
  }
package/ui/menu.js CHANGED
@@ -4,7 +4,10 @@ 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
+ if (state.query.develop !== undefined) {
8
+ // kept for backward compatibility
9
+ loc.query.develop = state.query.develop;
10
+ }
8
11
  if (state.sameQuery(loc)) return true;
9
12
  } else {
10
13
  return state.pathname.startsWith(loc.pathname + '/');
@@ -26,6 +29,10 @@ class HTMLElementMenu extends VirtualHTMLElement {
26
29
  if (this.isContentEditable || this.matches('.vertical')) return;
27
30
  const menu = this.firstElementChild;
28
31
  const helper = this.lastElementChild;
32
+ if (helper == menu) {
33
+ // not a popup
34
+ return;
35
+ }
29
36
  helper.lastElementChild.lastElementChild.appendChild(this.toHelper(menu));
30
37
  state.finish(() => {
31
38
  this.observer = new ResizeObserver((entries, observer) => {
@@ -43,10 +50,14 @@ class HTMLElementMenu extends VirtualHTMLElement {
43
50
  if (this.observer) this.observer.disconnect();
44
51
  }
45
52
  handleAllClick(e, state) {
53
+ const tosser = this.lastElementChild;
54
+ if (tosser == this.firstElementChild) {
55
+ // not a popup
56
+ return;
57
+ }
46
58
  if (this.active) {
47
59
  this.active.classList.toggle('active', false);
48
60
  }
49
- const tosser = this.lastElementChild;
50
61
  tosser.classList.remove('inactive');
51
62
  let item = tosser.contains(e.target) && !e.target.closest('a') && e.target.closest('.item');
52
63
  if (item == tosser) {