@pageboard/html 0.16.16 → 0.16.17

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/table.js CHANGED
@@ -125,9 +125,8 @@ exports.table_cell = {
125
125
  properties: {
126
126
  align: {
127
127
  title: 'Align',
128
- default: "",
129
128
  anyOf: [{
130
- const: "",
129
+ const: null,
131
130
  title: "Left",
132
131
  icon: '<i class="icon align left"></i>'
133
132
  }, {
@@ -166,9 +165,11 @@ exports.table_cell = {
166
165
  tag: 'td',
167
166
  parse: function(dom) {
168
167
  const d = {};
169
- if (dom.matches('.center')) d.align = 'center';
170
- else if (dom.matches('.right')) d.align = 'right';
171
- if (dom.matches('.selectable')) d.selectable = true;
168
+ if (dom.classList.contains('center')) d.align = 'center';
169
+ else if (dom.classList.contains('right')) d.align = 'right';
170
+ if (dom.classList.contains('selectable')) d.selectable = true;
171
+ if (dom.rowspan) d.rowspan = dom.rowspan;
172
+ if (dom.colspan) d.colspan = dom.colspan;
172
173
  return d;
173
174
  },
174
175
  html: '<td class="[align|post: aligned] [selectable]" rowspan="[rowspan]" colspan="[colspan]"></td>'
@@ -216,10 +217,21 @@ exports.table_head_cell = {
216
217
  }]
217
218
  }
218
219
  },
220
+ parse: function (dom) {
221
+ const d = {};
222
+ if (dom.classList.contains('center')) d.align = 'center';
223
+ else if (dom.classList.contains('right')) d.align = 'right';
224
+ if (dom.classList.contains('selectable')) d.selectable = true;
225
+ if (dom.rowspan) d.rowspan = dom.rowspan;
226
+ if (dom.colspan) d.colspan = dom.colspan;
227
+ if (dom.scope) d.scope = dom.scope;
228
+ if (dom.dataset.width) d.width = parseInt(dom.dataset.width) || null;
229
+ return d;
230
+ },
219
231
  contents: "block+",
220
232
  tag: 'th',
221
233
  inplace: true,
222
- html: '<th class="[align|post: aligned] [width|as:colnums|post: wide]" rowspan="[rowspan]" colspan="[colspan]" scope="[scope]"></th>',
234
+ html: '<th class="[align|post: aligned] [width|as:colnums|post: wide]" data-width="[width]" rowspan="[rowspan]" colspan="[colspan]" scope="[scope]"></th>',
223
235
  stylesheets: [
224
236
  "../ui/table.css"
225
237
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.16.16",
3
+ "version": "0.16.17",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
package/ui/input-date.js CHANGED
@@ -4,8 +4,6 @@ class HTMLElementInputDate extends Page.create(HTMLInputElement) {
4
4
  if (this.hasAttribute('value')) this.setAttribute('value', this.getAttribute('value'));
5
5
  }
6
6
 
7
- // FIXME: doesn't initialize itself with already set "value" attribute
8
-
9
7
  setAttribute(name, value) {
10
8
  if (name == "value") {
11
9
  this.value = value;