efront 3.21.6 → 3.22.4

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.
Files changed (39) hide show
  1. package/apps/pay/alipay-callback.jsp +8 -5
  2. package/apps/pay/alipay-query.jsp +15 -0
  3. package/apps/pay/alipay.jsp +10 -13
  4. package/apps/pay/alipay_test.js +2 -1
  5. package/apps/pivot/auth/login.html +3 -0
  6. package/apps/pivot/auth/login.js +1 -1
  7. package/apps/pivot/auth/login.less +16 -3
  8. package/apps/pivot/log/boot.js +3 -2
  9. package/coms/basic/BigNumber.js +2 -2
  10. package/coms/basic/BigNumber_test.js +5 -0
  11. package/coms/basic/[]map.js +1 -1
  12. package/coms/compile/scanner2.js +12 -1
  13. package/coms/frame/list.less +6 -4
  14. package/coms/frame/payment.js +17 -2
  15. package/coms/layer/glance.js +4 -2
  16. package/coms/reptile/cross.js +5 -3
  17. package/coms/zimoli/autodragchildren.js +46 -35
  18. package/coms/zimoli/drag.js +1 -1
  19. package/coms/zimoli/gallery.js +1 -1
  20. package/coms/zimoli/getGenerator.js +4 -2
  21. package/coms/zimoli/list.js +31 -22
  22. package/coms/zimoli/menu.js +1 -3
  23. package/coms/zimoli/menuList.js +12 -16
  24. package/coms/zimoli/on.js +12 -0
  25. package/coms/zimoli/once.js +9 -7
  26. package/coms/zimoli/pagination.html +1 -1
  27. package/coms/zimoli/pagination.js +9 -24
  28. package/coms/zimoli/pagination.less +34 -19
  29. package/coms/zimoli/render.js +11 -1
  30. package/coms/zimoli/scrollbar.js +5 -5
  31. package/coms/zimoli/table.html +24 -10
  32. package/coms/zimoli/table.js +270 -61
  33. package/coms/zimoli/table.less +76 -34
  34. package/coms/zimoli/table_test.html +32 -0
  35. package/coms/zimoli/table_test.js +1 -8
  36. package/coms/zimoli/vbox.js +25 -17
  37. package/coms/zimoli/vscroll.js +4 -4
  38. package/package.json +1 -1
  39. package/public/efront.js +1 -1
@@ -12,16 +12,15 @@ var moveMargin = function (element, movePixels) {
12
12
  marginRight: movePixels ? -movePixels + "px" : ""
13
13
  });
14
14
  };
15
-
16
15
  var markRowTds = function (tr, deltas, colstart, colend) {
17
16
  var inc = 0;
18
17
  var collections = [];
19
- [].map.call(tr.children, function (td) {
18
+ Array.prototype.forEach.call(tr.children, function (td) {
20
19
  while (deltas[inc] > 0) {
21
20
  deltas[inc++]--;
22
21
  }
23
- var colspan = +td.getAttribute("colspan") || 1;
24
- var rowspan = +td.getAttribute("rowspan") || 1;
22
+ var colspan = getColspan(td);
23
+ var rowspan = getRowspan(td);
25
24
  rowspan = rowspan > 1 ? rowspan - 1 : 0;
26
25
  colspan = colspan > 1 ? colspan - 1 : 0;
27
26
  for (var cx = inc, dx = colspan + inc; cx <= dx; cx++) {
@@ -40,39 +39,121 @@ var markRowTds = function (tr, deltas, colstart, colend) {
40
39
  });
41
40
  return collections;
42
41
  };
43
- var getRowsOfTdsByCol = function (table, start, end) {
44
- var savedRowDeltas = [];
45
- var savedCollections = [];
46
- [].map.call(table.children, function (tr) {
47
- if (trElementReg.test(tr.tagName)) {
48
- var collections = markRowTds(tr, savedRowDeltas, start, end);
49
- savedCollections.push(collections);
42
+ var forEachRow = function (tbody, call) {
43
+ for (var tr of tbody.children) {
44
+ if (isTableRow(tr)) {
45
+ call(tr);
50
46
  }
51
47
  else {
52
- var collections = getRowsOfTdsByCol(tr, start, end);
53
- savedCollections.push.apply(savedCollections, collections);
48
+ for (var c of tr.children) if (isTableRow(c)) call(c);
54
49
  }
50
+ }
51
+ }
52
+ var getRowsOfTdsByCol = function (table, start, end) {
53
+ var savedCollections = [];
54
+ var thead = getThead(table);
55
+ var tbody = getTbody(table);
56
+ var savedRowDeltas;
57
+ if (thead) savedRowDeltas = [], forEachRow(thead, function (tr) {
58
+ var collections = markRowTds(tr, savedRowDeltas, start, end);
59
+ savedCollections.push(collections);
60
+ });
61
+ if (tbody) savedRowDeltas = [], forEachRow(tbody, function (tr) {
62
+ var collections = markRowTds(tr, savedRowDeltas, start, end);
63
+ savedCollections.push(collections);
55
64
  });
56
65
  return savedCollections;
57
66
  }
58
67
  var getTdsByCol = function (table, start, end) {
59
68
  return [].concat.apply([], getRowsOfTdsByCol(table, start, end));
60
69
  };
70
+ var resizeT = function (t, w) {
71
+ if (!w) {
72
+ var w = 0;
73
+ for (var cx = 0, dx = t.children.length; cx < dx; cx++) {
74
+ w += t.children[cx].offsetWidth;
75
+ }
76
+ }
77
+ css(t, { width: w });
78
+ }
79
+ var getThead = function (table) {
80
+ for (var c of table.children) {
81
+ if (/^thead$/i.test(c.tagName) || c.hasAttribute('thead')) return c;
82
+ }
83
+ };
84
+ var getTbody = function (table) {
85
+ for (var c of table.children) {
86
+ if (/^tbody$/i.test(c.tagName) || c.hasAttribute("tbody")) return c;
87
+ }
88
+ };
89
+ var getTfoot = function (table) {
90
+ for (var c of table.children) {
91
+ if (/^tfoot$/i.test(c.tagName) || c.hasAttribute("tfoot")) return c;
92
+ }
93
+ };
94
+ var isTableRow = function (e) {
95
+ return trElementReg.test(e.tagName);
96
+ };
97
+ var getRowspan = function (e) {
98
+ return +e.getAttribute('rowspan') || 1;
99
+ };
100
+ var getColspan = function (e) {
101
+ return +e.getAttribute('colspan') || 1;
102
+ }
103
+ var resizeColumn = function (target, targetW) {
104
+ var deltaW = targetW - target.offsetWidth;
105
+ forEachRow(this, function (tr) {
106
+ resizeT(tr, tr.offsetWidth + deltaW);
107
+ });
108
+ for (var c of this.children) {
109
+ if (!isTableRow(c)) {
110
+ var tr = c.querySelector('tr');
111
+ if (!tr) continue;
112
+ c.style.width = tr.style.width;
113
+ }
114
+ }
115
+ var { colstart, colend } = target;
116
+ if (isEmpty(colstart) || isEmpty(colend)) return;
117
+ var ts = getRowsOfTdsByCol(this, colstart, colend);
118
+ for (var cs of ts) {
119
+ var c = cs[cs.length - 1];
120
+ var w = 0;
121
+ for (var c of cs) {
122
+ w += c.offsetWidth;
123
+ }
124
+ if (!cs.length) continue;
125
+ w = targetW - w;
126
+ while (w !== 0) {
127
+ var c = cs.pop();
128
+ var w0 = c.offsetWidth + w;
129
+ if (w0 < 0) {
130
+ w = -w0;
131
+ w0 = w;
132
+ }
133
+ else {
134
+ w = 0;
135
+ }
136
+ if (targetW !== w) css(c, { width: w0 });
137
+ }
138
+ }
139
+ };
61
140
  var resizeTarget = function (event) {
62
141
  var { resizing } = this;
63
142
  if (!resizing) return;
64
143
  event.moveLocked = true;
65
144
  var { restX, target } = resizing;
66
- var targetX = event.clientX - restX;
67
- target.style.width = targetX + "px";
145
+ var targetW = event.clientX - restX;
146
+ if (targetW < 20) targetW = 20;
147
+ resizeColumn.call(this, target, targetW);
68
148
  resizing.clientX = event.clientX;
149
+ setFixedColumn.call(this);
69
150
  };
70
151
  var getFirstSingleColCell = function (table, col) {
71
152
  var tds = getTdsByCol(table, col, col);
72
153
  while (tds.length) {
73
154
  var td = tds.shift();
74
- var colspan = td.getAttribute("colspan") || 1;
75
- if (1 === +colspan) return td;
155
+ var colspan = getColspan(td);
156
+ if (1 === colspan) return td;
76
157
  }
77
158
  }
78
159
  var adaptTarget = function (event) {
@@ -122,7 +203,7 @@ function enrichField(f) {
122
203
  }
123
204
  else switch (f.type) {
124
205
  case "text":
125
- width = 30;
206
+ width = 200;
126
207
  break;
127
208
  case "input":
128
209
  width = 200;
@@ -144,92 +225,214 @@ function enrichField(f) {
144
225
  }
145
226
  if (width > 600) width = 600;
146
227
  f.width = width + 60;
228
+ if (!f.key && f.options && isEmpty(f.fixed)) {
229
+ f.fixed = true;
230
+ }
147
231
  }
232
+ var tbodyHeight = function (tbody) {
233
+ return { 'max-height': ((innerHeight - getScreenPosition(tbody).top - 8) / 36 | 0) * 36 }
234
+ };
148
235
 
236
+ var setFixed = function (children, scrolled, left, borderRight) {
237
+ var setBorderRight = function (fixedLeft) {
238
+ var end = fixedLeft[fixedLeft.length - 1];
239
+ if (end && end.style[left]) css(end, {
240
+ [borderRight]: '1px solid #0006'
241
+ });
242
+ };
243
+ var fixedElements = [];
244
+ var offset = 0;
245
+ var fixedWidth = 0;
246
+ for (var c of children) {
247
+ var pc = getScreenPosition(c);
248
+ var isfixed = c.hasAttribute('fixed');
249
+ if (fixedWidth + scrolled > offset && fixedWidth + pc.width < this.clientWidth / 3) {
250
+ if (isfixed) {
251
+ css(c, { [left]: scrolled - offset + fixedWidth, [borderRight]: '' });
252
+ fixedElements.push(c);
253
+ fixedWidth += pc.width;
254
+ }
255
+ }
256
+ else {
257
+ setBorderRight(fixedElements);
258
+ if (isfixed && c.style[left]) {
259
+ css(c, { [left]: '', [borderRight]: '' })
260
+ fixedElements.push(c);
261
+ }
262
+ }
263
+ offset += pc.width;
264
+ }
265
+ setBorderRight(fixedElements);
266
+ for (var f of fixedElements) {
267
+ var cols = getRowsOfTdsByCol(this, f.colstart, f.colend);
268
+ for (var c of cols) css(c[0], {
269
+ [left]: f.style[left],
270
+ [borderRight]: f.style[borderRight]
271
+ });
272
+ }
273
+
274
+ };
275
+
276
+
277
+ var setFixedColumn = function () {
278
+ var thead = getThead(this);
279
+ if (!thead) return;
280
+ if (!isTableRow(thead)) thead = thead.querySelector('tr');
281
+ var children = Array.prototype.slice.call(thead.children);
282
+ var lastChild = children[children.length - 1];
283
+ if (!lastChild) return;
284
+ var deltaW = thead.scrollWidth - lastChild.offsetWidth;
285
+ if (this.clientWidth > deltaW + 200) {
286
+ css(lastChild, { width: this.clientWidth - deltaW });
287
+ css(thead, { width: this.clientWidth });
288
+ resizeColumn.call(this, lastChild, this.clientWidth - deltaW);
289
+ }
290
+ setFixed.call(this, children, this.scrollLeft, 'left', 'borderRight');
291
+ setFixed.call(this, children.reverse(), this.scrollWidth - this.clientWidth - this.scrollLeft, 'right', 'borderLeft');
292
+ var tfoot = getTfoot(this);
293
+ if (tfoot) {
294
+ css(tfoot, { left: this.scrollLeft });
295
+ }
296
+ };
297
+ var setClass = function (tds, cls, old) {
298
+ tds.forEach(td => td[cls] = true);
299
+ old.forEach(td => { if (!td[cls]) removeClass(td, cls) });
300
+ tds.forEach(td => { addClass(td, cls); delete td[cls] });
301
+ };
302
+ var getTdsOfSameRow = function (td) {
303
+ var tds = [td];
304
+ var tmp = td;
305
+ var rowspan = getRowspan(td);
306
+ var { colstart, colend } = td;
307
+ while (tmp) {
308
+ tmp = tmp.previousElementSibling;
309
+ if (!tmp) break;
310
+ if (colstart - tmp.colend > 1) break;
311
+ if (getRowspan(tmp) > rowspan) break;
312
+ tds.push(tmp);
313
+ colstart = tmp.colstart;
314
+ };
315
+ tmp = td;
316
+ while (tmp) {
317
+ tmp = tmp.nextElementSibling;
318
+ if (!tmp) break;
319
+ if (tmp.colstart - colend > 1) break;
320
+ if (getRowspan(tmp) > rowspan) break;
321
+ tds.push(tmp);
322
+ colend = tmp.colend;
323
+ }
324
+ var tr = td.parentNode;
325
+ while (rowspan > 1) {
326
+ tr = tr.nextElementSibling;
327
+ if (!tr) break;
328
+ for (var c of tr.children) {
329
+ if (c.colstart >= colstart && c.colend <= colend) {
330
+ if (getRowspan(c) <= rowspan) {
331
+ tds.push(c);
332
+ }
333
+ }
334
+ }
335
+ rowspan--;
336
+ }
337
+ return tds;
338
+ };
149
339
  function table(elem) {
150
340
  var tableElement = isElement(elem) ? elem : document.createElement("table");
151
341
  var activeCols = [];
152
- var adaptCursor = adaptTarget.bind(tableElement);
153
- var off;
154
- tableElement.init = function () {
155
- off = on("mousemove")(window, adaptCursor);
156
- };
157
- tableElement.dispose = tableElement.destroy = function () {
158
- off();
159
- };
160
- on("append")(tableElement, tableElement.init);
161
- on("remove")(tableElement, tableElement.destroy);
162
- if (isMounted(tableElement)) tableElement.init();
163
-
342
+ bind('mousemove')(tableElement, adaptTarget);
164
343
  moveupon(tableElement, {
165
344
  start(event) {
166
345
  if (this.resizing) event.preventDefault();
167
346
  },
168
347
  move: resizeTarget,
169
348
  });
349
+ var activeRows = [];
170
350
  onmousemove(tableElement, function (event) {
351
+ if (table.resizing) return;
352
+ var tbody = getTbody(table);
353
+ a: if (tbody) {
354
+ var tr = getTargetIn(tbody, event.target, false);
355
+ if (!tr) break a;
356
+ var td = getTargetIn(tr, event.target, false);
357
+ if (!td) break a;
358
+ var tds = getTdsOfSameRow(td);
359
+ setClass(tds, 'x-ing', activeRows);
360
+ activeRows = tds;
361
+ return;
362
+ }
171
363
  if (!thead) {
172
- [thead] = table.getElementsByTagName("thead");
173
- if (!thead) thead = table.querySelector('[thead]');
364
+ thead = getThead(table);
174
365
  }
175
366
  if (!getTargetIn(thead, event.target)) return;
176
-
177
367
  var tds = getTargetIn(cellMatchManager, event.target);
178
- if (!isArray(tds)) tds = [];
179
- tds.map(function (td) {
180
- td.ying = true;
181
- });
182
- activeCols.map(function (td) {
183
- if (!td.ying) removeClass(td, "y-ing");
184
- });
185
- activeCols = tds.map(function (td) {
186
- addClass(td, "y-ing");
187
- delete td.ying;
188
- return td;
189
- });
368
+ setClass(tds, 'y-ing', activeCols);
369
+ activeCols = tds;
190
370
  });
191
371
  onmouseleave(tableElement, function () {
192
- activeCols.map(function (td) {
372
+ activeCols.forEach(function (td) {
193
373
  removeClass(td, "y-ing");
194
374
  });
375
+ activeRows.forEach(function (td) {
376
+ removeClass(td, 'x-ing');
377
+ });
195
378
  });
196
379
  var table = tableElement;
197
380
  var thead;
381
+ var markedRows = false;
198
382
  var cellMatchManager = function (element) {
199
- if (!thead) {
200
- [thead] = table.getElementsByTagName("thead");
201
- if (!thead) thead = table.querySelector('[thead]');
202
- }
203
- if (table.resizing) return false;
383
+ if (!thead) thead = getThead(table);
204
384
  if (!getTargetIn(thead, element)) return false;
205
385
  if (!tdElementReg.test(element.tagName)) return false;
206
- var savedRowDeltas = [];
207
- [].map.call(thead.children, function (tr) {
208
- markRowTds(tr, savedRowDeltas);
209
- });
386
+ if (!markedRows) {
387
+ var savedRowDeltas = [];
388
+ Array.prototype.forEach.call(thead.children, function (tr) {
389
+ markRowTds(tr, savedRowDeltas);
390
+ });
391
+ markedRows = true;
392
+ }
210
393
  var { colstart, colend } = element;
211
394
  return getTdsByCol(table, colstart, colend);
212
395
  };
213
- table.dragbox = function () {
214
- return thead;
396
+
397
+ table.useIncrease = false;
398
+ var _vbox = function () {
399
+ table.$Left = function (x) {
400
+ if (isFinite(x)) this.scrollLeft = x;
401
+ setFixedColumn.call(this);
402
+ return this.scrollLeft;
403
+ };
404
+ vbox(table, 'x');
215
405
  };
216
- var tbodyHeight = e => ({ 'max-height': ((innerHeight - getScreenPosition(table).top - 46) / 32 | 0) * 32 + 36 });
217
406
  care(table, function ([fields, data]) {
407
+ if (_vbox) _vbox(), _vbox = null;
218
408
  thead = null;
219
409
  fields.forEach(enrichField);
220
410
  remove(this.children);
221
411
  this.innerHTML = template;
222
-
412
+ markedRows = false;
413
+ this.style.display = 'block';
223
414
  render(this, {
224
415
  fields,
225
- tbody() {
416
+ isEmpty,
417
+ tbody(e) {
226
418
  var e = list.apply(null, arguments);
227
- css(e, tbodyHeight());
419
+ css(e, tbodyHeight(e));
420
+ css(e, { width: this.adapter.offsetWidth, display: 'block' });
228
421
  return e;
229
422
  },
423
+ thead(t) {
424
+ var tr = document.createElement('thead');
425
+ tr.renders = [function () {
426
+ resizeT(this.firstChild)
427
+ }];
428
+ css(tr, { display: 'block' });
429
+ appendChild(tr, Array.prototype.slice.call(t.children));
430
+ return tr;
431
+ },
230
432
  tbodyHeight,
231
433
  data,
232
434
  adapter: null,
435
+ resizeT,
233
436
  model,
234
437
  sort(f) {
235
438
  f.sign = f.sign > 0 ? -1 : 1;
@@ -245,6 +448,8 @@ function table(elem) {
245
448
  css(target, { width: f.width });
246
449
  },
247
450
  a: button,
451
+ setFixedColumn,
452
+ pagination
248
453
  }, this.$parentScopes.concat(this.$scope));
249
454
  })
250
455
  autodragchildren(
@@ -257,6 +462,7 @@ function table(elem) {
257
462
  var [f] = fields.splice(src - 1, 1);
258
463
  fields.splice(dst - 1, 0, f);
259
464
  }
465
+ markedRows = false;
260
466
  var children = parentNode.children;
261
467
  var srcElement = children[src];
262
468
  var dstElement = children[rel];
@@ -290,5 +496,8 @@ function table(elem) {
290
496
  }
291
497
  }
292
498
  );
499
+ resizingList.set(table);
500
+ on("resize")(table, setFixedColumn);
501
+ on("scroll")(table, setFixedColumn);
293
502
  return table;
294
503
  }
@@ -7,12 +7,11 @@
7
7
 
8
8
  >th,
9
9
  >td {
10
- box-shadow: 1px 0 0 0 #00000033, -1px 0 0 0 #00000033;
10
+ &:not(.y-ing) {
11
+ box-shadow: 1px 0 0 0 #00000033, -1px 0 0 0 #00000033;
12
+ }
11
13
  }
12
14
 
13
- &:insert {
14
- background: #999;
15
- }
16
15
  }
17
16
  }
18
17
 
@@ -32,12 +31,22 @@ table,
32
31
  vertical-align: top;
33
32
  }
34
33
 
35
- & {
36
- outline: 1px solid #0006;
34
+
35
+ tr {
36
+ position: relative;
37
+ white-space: nowrap;
38
+ width: 100%;
37
39
  }
38
40
 
41
+ th,
42
+ td {
43
+ white-space: normal;
44
+ height: 100%;
45
+ padding: 2px 10px;
46
+ }
39
47
 
40
- .y-ing {
48
+ .y-ing,
49
+ .x-ing {
41
50
  &:before {
42
51
  content: "";
43
52
  position: absolute;
@@ -45,7 +54,7 @@ table,
45
54
  top: 0;
46
55
  bottom: 0;
47
56
  right: 0;
48
- background-color: rgba(0, 0, 0, .06);
57
+ background-color: rgba(0, 60, 69, .06);
49
58
  }
50
59
 
51
60
  >* {
@@ -53,28 +62,70 @@ table,
53
62
  }
54
63
  }
55
64
 
56
- @cell-padding: 0 10px;
57
65
 
58
66
  & {
59
67
  // text-align: center;
68
+ outline: 1px solid #0006;
69
+ max-width: 100%;
60
70
  border-collapse: collapse;
61
71
  table-layout: fixed;
62
72
  white-space: nowrap;
73
+ height: auto;
74
+ border-radius: 3px;
75
+ }
76
+
77
+ [row-index] {
78
+ user-select: none;
79
+ width: 56px;
80
+ padding-right: 10px;
81
+ text-align: right;
82
+ }
83
+
84
+ >tbody {
85
+ [row-index] {
86
+ background: #fff;
87
+ }
88
+ }
89
+
90
+ [fixed] {
91
+ z-index: 2;
92
+ border-left: 1px solid transparent;
93
+ border-right: 1px solid transparent;
94
+ }
95
+
96
+ >tfoot {
97
+ width: 100%;
98
+ display: block;
99
+ position: relative;
100
+ color: #bbb;
101
+
102
+ >tr {
103
+ width: 100%;
104
+ display: block;
105
+
106
+ >td {
107
+ display: block;
108
+ width: 100%;
109
+ }
110
+ }
63
111
 
112
+ pagination {
113
+ width: 100%;
114
+ }
64
115
  }
65
116
 
66
117
  >thead {
67
118
  user-select: none;
68
119
  line-height: 36px;
120
+ min-width: 100%;
69
121
 
70
122
  >tr {
71
123
 
72
124
  >td,
73
125
  >th {
74
- padding: @cell-padding;
75
126
  position: relative;
76
127
  color: #fff;
77
- background-color: #999;
128
+ background-color: #395268;
78
129
  }
79
130
  }
80
131
  }
@@ -83,40 +134,36 @@ table,
83
134
  line-height: 32px;
84
135
  height: 100%;
85
136
  min-height: 30px;
86
- border-top: 4px solid #6669;
87
-
88
-
89
-
90
137
  user-select: auto;
91
138
 
92
139
  >tr {
93
140
 
94
141
  >td,
95
142
  >th {
96
- padding: @cell-padding;
97
143
  position: relative;
98
144
  overflow: hidden;
99
145
  }
100
146
 
101
147
  &:nth-of-type(odd) {
102
- background-color: #eee;
103
- }
104
148
 
105
- &:nth-of-type(even) {
106
- background-color: #fff;
149
+ >td,
150
+ >th {
151
+ background-color: #fff;
152
+ }
107
153
  }
108
154
 
109
-
110
- &:hover {
155
+ &:nth-of-type(even) {
111
156
 
112
157
  >td,
113
- >th {
114
- background: #dddddd;
158
+ th {
159
+ background-color: #f8fbfd;
115
160
  }
116
161
  }
162
+
163
+
117
164
  }
118
165
 
119
- >tr[insert] {
166
+ >tr[thead] {
120
167
  position: sticky;
121
168
  top: 0;
122
169
  z-index: 1;
@@ -131,18 +178,13 @@ table,
131
178
  }
132
179
 
133
180
 
134
- tr {
181
+ [inline-block] {
135
182
 
136
183
  >th,
137
184
  >td {
138
- background: inherit;
139
-
140
- &[row-index] {
141
- user-select: none;
142
- // pointer-events: none;
143
- background: #fff;
144
- text-align: right;
145
- }
185
+ white-space: nowrap;
186
+ overflow: hidden;
187
+ display: inline-block;
146
188
  }
147
189
  }
148
190
 
@@ -0,0 +1,32 @@
1
+ <thead>
2
+ <tr>
3
+ <td colspan=2><span>1</span></td>
4
+ <td rowspan=2><span>th1</span></td>
5
+ <td>th3</td>
6
+ <td>th4</td>
7
+ </tr>
8
+ <tr>
9
+ <td>th3</td>
10
+ <td>th4</td>
11
+ </tr>
12
+ </thead>
13
+ <tbody>
14
+ <tr>
15
+ <td rowspan=2>td1</td>
16
+ <td>td2</td>
17
+ <td>td3</td>
18
+ <td>td4</td>
19
+ </tr>
20
+ <tr>
21
+ <td>td2</td>
22
+ <td>td3</td>
23
+ <td>td4</td>
24
+ </tr>
25
+ <tr>
26
+ <td rowspan=2>td1</td>
27
+ <td>td2</td>
28
+ </tr>
29
+ <tr>
30
+ <td>&nbsp;</td>
31
+ </tr>
32
+ </tbody>
@@ -1,12 +1,5 @@
1
1
  function table_test() {
2
- var data = new Array(100).fill(0).map(function () {
3
- return {
4
- name: random(random$name),
5
- tel: random(random$phone)
6
- };
7
- });
8
2
  var datatable = table();
9
- datatable.innerHTML = `<thead><tr><td colspan=2><span>1</span></td><td rowspan=2><span>th1</span></td><td>th3</td><td>th4</td></tr><tr><td>th3</td><td>th4</td></tr></thead><tbody><tr><td rowspan=2>td1</td><td>td2</td><td>td3</td><td>td4</td></tr><tr><td rowspan=2>td1</td><td>td2</td></tr></tbody>`;
10
- console.log(datatable);
3
+ datatable.innerHTML = template;
11
4
  return datatable;
12
5
  }