efront 4.0.53 → 4.0.55

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.
@@ -340,6 +340,17 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
340
340
  offdragend();
341
341
  };
342
342
  var offdragstart = on('dragstart')(targetChild, function () {
343
+ var c = drag.shadow;
344
+ var zIndex = c.style.zIndex - 1;
345
+ var copyZIndex = function (e) {
346
+ e.style.zIndex = zIndex;
347
+ var z = zIndex - 1;
348
+ if (e.with) for (var w of e.with) w.style.zIndex = z;
349
+ };
350
+ if (zIndex > 2) {
351
+ previousElements.forEach(copyZIndex);
352
+ followedElements.forEach(copyZIndex);
353
+ }
343
354
  setOpacity(targetBox, draggingSourceOpacity);
344
355
  });
345
356
  var offdragend = on("dragend")(targetChild, function () {
@@ -350,6 +361,8 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
350
361
  remove(followedElements);
351
362
  previousElements.map(recover);
352
363
  followedElements.map(recover);
364
+ previousElements.splice(0, previousElements.length);
365
+ followedElements.splice(0, followedElements.length);
353
366
  });
354
367
  var offdragmove = on("dragmove")(targetChild, dragmove);
355
368
  }
@@ -88,7 +88,6 @@
88
88
 
89
89
  &>.track {
90
90
  border-radius: inherit;
91
- transition: box-shadow .1s, background-color .2s;
92
91
  width: 100%;
93
92
  height: 100%;
94
93
  position: absolute;
@@ -1,4 +1,4 @@
1
- var cloneProperties = "fontWeight,fontSize,fontFamily,color,textShadow,opacity,writingMode,blockSize,wordSpacing,letterSpacing,whiteSpace,lineHeight".split(",");// text-node
1
+ var cloneProperties = "fontWeight,fontSize,fontFamily,color,textShadow,opacity,writingMode,blockSize,wordSpacing,letterSpacing,whiteSpace".split(",");// text-node
2
2
  var cloneProperties2 = "position,backdropFilter,filter,float,clear,margin,color,verticalAlign,textAlign,textShadow,opacity,boxShadow,overflow,textOverflow,wordBreak,webkitLineClamp,webkitBoxOrient,writingMode,blockSize,wordSpacing,letterSpacing,textIndent,lineHeight,display,appearance,webkitAppearance,MozAppearance".split(",");// element
3
3
  var pushProperty = function (key, props) {
4
4
  props.split(",").forEach(k => {
@@ -1,4 +1,5 @@
1
1
  & {
2
2
  cursor: default;
3
3
  outline: none;
4
+ max-height: 50%;
4
5
  }
@@ -76,6 +76,7 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
76
76
  extraTargets = [];
77
77
  if (target.style) css(target, { zIndex: z });
78
78
  }
79
+ drag.shadow = clone;
79
80
  var [clone_left, clone_top] = getOffset(clone);
80
81
  extraClones = extraTargets.map(toCloneTarget);
81
82
  extraClones.forEach(addZIndex);
@@ -7,9 +7,14 @@
7
7
  background-position: 0 0, @background-size/2 @background-size/2;
8
8
  height: 200px;
9
9
  }
10
-
10
+ menu{
11
+ left: 0;
12
+ width: 100%;
13
+ appearance: none;
14
+ display: block;
15
+ }
11
16
  canvas {
12
17
  width: 100%;
13
- height: 100%;
18
+ height: 300px;
14
19
  background-color: #035;
15
20
  }
@@ -257,7 +257,7 @@ function main(elem) {
257
257
  elem.innerHTML = '<span ng-bind=get()></span>';
258
258
  render(elem, {
259
259
  get() {
260
- if (!field.key) return;
260
+ if (isEmpty(field.key)) return;
261
261
  var value = seek(data, field.key);
262
262
  if (field.options) {
263
263
  if (!field.optionsMap) {
@@ -13,9 +13,9 @@
13
13
  <td fixed row-index -bind="i+1" :style="adapter.firstChild.getAttribute('style')">
14
14
  </td>
15
15
  <td fixed:="f.fixed" -repeat="(f,i) in fields" :style="adapter.children[i+1].getAttribute('style')">
16
- <model -if="f.key&&!isEmpty(d[f.key])" :field=f :data=d readonly></model>
16
+ <model -if="!isEmpty(f.key)&&!isEmpty(d[f.key])" :field=f :data=d readonly></model>
17
17
  <template -else>&nbsp;</template>
18
- <a on-click="o.do(d)" -if="!f.key&&f.options&&(!o.when||o.when(d))"
18
+ <a on-click="o.do(d)" -if="isEmpty(f.key)&&f.options&&(!o.when||o.when(d))"
19
19
  _type="o.type instanceof Function?o.type(d):o.type" -repeat="o in f.options">
20
20
  <span -text="o.name instanceof Function?o.name(d):o.name"></span>
21
21
  </a>
@@ -371,28 +371,23 @@ var getTdsOfSameRow = function (td) {
371
371
  return tds;
372
372
  };
373
373
  function setContextMenu(thead) {
374
- var fields = this.fields.slice();
375
- var scope = this;
376
- var menuItems = fields.map(f => {
377
- return {
378
- name: f.name || "&nbsp;",
379
- checked: !f.hidden,
380
- width: f.width,
381
- do() {
382
- this.checked = !this.checked;
383
- f.hidden = !this.checked;
384
- scope.fields = fields.filter(f => !f.hidden);
385
- var width = thead.scrollWidth / scope.fields.length;
386
- if (!width || width < 200) width = 200;
387
- forEachRow(thead, function (tr) {
388
- for (var td of tr.children) {
389
- if (td.offsetWidth > width) css(td, { width });
390
- }
391
- });
392
- setLazyFixedColumn.call(thead.parentNode, true)
374
+ var fields = this.originFields.slice();
375
+ var _do = function () {
376
+ this.checked = !this.checked;
377
+ var f = fields[this.index];
378
+ f.hidden = !this.checked;
379
+ scope.fields = fields.filter(f => !f.hidden);
380
+ var width = thead.scrollWidth / scope.fields.length;
381
+ if (!width || width < 200) width = 200;
382
+ forEachRow(thead, function (tr) {
383
+ for (var td of tr.children) {
384
+ if (td.offsetWidth > width) css(td, { width });
393
385
  }
394
- }
395
- });
386
+ });
387
+ setLazyFixedColumn.call(thead.parentNode, true)
388
+ };
389
+ var menuItems = fields.map((f, i) => ({ name: f.name || "&nbsp", index: i, width: f.width, key: f.key, checked: !f.hidden, do: _do }));
390
+ var scope = this;
396
391
  contextmenu(thead, menuItems);
397
392
  }
398
393
  function table(elem) {
@@ -468,11 +463,19 @@ function table(elem) {
468
463
  };
469
464
  vbox(table, 'x');
470
465
  };
471
- care(table, async function ([fields, data]) {
466
+ care(table, async function (src) {
467
+ if (src instanceof Table) {
468
+ data = src;
469
+ fields = data.fields;
470
+ }
471
+ else if (src instanceof Array) {
472
+ var [fields, data] = src;
473
+ }
474
+ else throw new Error("table组件源数据错误!");
472
475
  if (_vbox) _vbox(), _vbox = null;
473
476
  watch(table, {
474
477
  find(text) {
475
- if ($scope.data.constructor === Table){
478
+ if ($scope.data.constructor === Table) {
476
479
  $scope.data.searchText = text;
477
480
  $scope.data.update();
478
481
  }
@@ -485,7 +488,8 @@ function table(elem) {
485
488
  markedRows = false;
486
489
  this.style.display = 'block';
487
490
  var $scope = {
488
- fields,
491
+ originFields: fields,
492
+ fields: fields.filter(f => !f.hidden),
489
493
  isEmpty,
490
494
  hasFoot: true,
491
495
  setContextMenu,
package/docs/main.xht CHANGED
@@ -42,7 +42,7 @@
42
42
  content: "样";
43
43
  }
44
44
 
45
- menu {
45
+ :root>menu {
46
46
  margin: 0;
47
47
  width: var(--leftwidth);
48
48
  margin-left: -var(--leftwidth);
package/docs/mark.xht CHANGED
@@ -2,8 +2,52 @@
2
2
  :scope {
3
3
  line-height: 1.8;
4
4
  display: block;
5
- padding: 0 20px;
6
5
  font-family: Times, "宋体", sans-serif;
6
+
7
+ @media screen and (max-width:830px) {
8
+ padding: 20px 40px;
9
+ }
10
+
11
+ @media screen and (min-width:1160px) {
12
+ margin: 20px auto;
13
+ }
14
+
15
+ @media screen and (min-width:830px) {
16
+ max-width: 890px;
17
+ border: 1px solid #000;
18
+ padding: 60px 80px;
19
+ box-shadow: 0 0 20px -6px #0006;
20
+ }
21
+ }
22
+
23
+ code {
24
+ width: 100%;
25
+ }
26
+
27
+ table {
28
+ margin-top: 12px;
29
+ }
30
+
31
+ thead {
32
+ font-weight: 900;
33
+ text-align: center;
34
+
35
+ td {
36
+ border-bottom: 1px solid #000;
37
+ }
38
+ }
39
+
40
+ ol,
41
+ ul {
42
+ padding-left: 20px;
43
+ }
44
+
45
+ h1,
46
+ h2,
47
+ h3,
48
+ h4,
49
+ h5 {
50
+ border-bottom: 1px solid #000;
7
51
  }
8
52
 
9
53
  [type="xml"] stamp,
@@ -54,7 +98,6 @@
54
98
  border-collapse: collapse;
55
99
  border: 1.2px solid #0007;
56
100
  }
57
-
58
101
  </style>
59
102
  <script>
60
103
  var history = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.0.53",
3
+ "version": "4.0.55",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {