efront 3.12.4 → 3.12.5

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.
@@ -19,9 +19,15 @@ var transfromSimpleValue = function (value) {
19
19
  };
20
20
  var transformValue = function (value, k) {
21
21
  if (ratioPropReg.test(k) || !value) return value;
22
- if (/^[\w\s\.]+$/.test(value)) return isFinite(value) ? transfromSimpleValue(value) : String(value).split(/\s/).map(transfromSimpleValue).join(' ');
22
+ if (/^[\w\s\.]+$/.test(value)) return isFinite(value) ? transfromSimpleValue(value) : String(value).split(/\s+/).map(transfromSimpleValue).join(' ');
23
23
  return value;
24
24
  };
25
+ var partifyValue = function (v) {
26
+ return String(v).toLowerCase().split(/['"`]|\s+/).join(" ");
27
+ };
28
+ var isSameValue = function (v1, v2) {
29
+ return partifyValue(v1) === partifyValue(v2);
30
+ };
25
31
  /**
26
32
  * 将中划线转成驼峰式
27
33
  * @param {string} key
@@ -86,7 +92,8 @@ var cssTargetNode = function (targetNode, oStyle, oValue) {
86
92
  var key = transformNodeKey(k);
87
93
  if (key in styleobject) {
88
94
  try {
89
- styleobject[key] = transformValue(oStyle[k], key);
95
+ var value = transformValue(oStyle[k], key);
96
+ if (!isSameValue(value, styleobject[value])) styleobject[key] = transformValue(oStyle[k], key);
90
97
  } catch (e) {
91
98
  console.warn(key, oStyle[k], "无效");
92
99
  }
@@ -95,7 +102,8 @@ var cssTargetNode = function (targetNode, oStyle, oValue) {
95
102
  } else {
96
103
  for (var k in oStyle) {
97
104
  var key = transformNodeKey(k);
98
- if (key in styleobject) styleobject[key] = transformValue(oStyle[k], key);
105
+ var value = transformValue(oStyle[k], key);
106
+ if (key in styleobject && !isSameValue(value, styleobject[key])) styleobject[key] = value;
99
107
  }
100
108
  }
101
109
  }
@@ -153,9 +161,9 @@ function cssTargetStyleSheet(stylesheet, innerCss) {
153
161
  var styleSheet = stylesheet.styleSheet;
154
162
  if (styleSheet) {
155
163
  //IE
156
- styleSheet.cssText = innerCss;
164
+ if (styleSheet.cssText !== innerCss) styleSheet.cssText = innerCss;
157
165
  } else {
158
- stylesheet.innerHTML = innerCss;
166
+ if (stylesheet.innerHTML !== innerCss) stylesheet.innerHTML = innerCss;
159
167
  }
160
168
  }
161
169
 
@@ -895,7 +895,7 @@ var data = {
895
895
  return data;
896
896
  });
897
897
  promise1.catch((e) => {
898
- if (e === outdate) return;
898
+ if (e === outdate || e === aborted) return;
899
899
  this.responseCrash(e, instance);
900
900
  });
901
901
 
@@ -42,12 +42,12 @@ function select(target, list, removeOnSelect, direction) {
42
42
  direction = removeOnSelect;
43
43
  removeOnSelect = arguments[3];
44
44
  }
45
- if (direction === undefined) {
46
- direction = target.getAttribute("direction") || target.direction;
47
- }
48
45
  if (!target) {
49
46
  target = document.createElement("select");
50
47
  }
48
+ if (direction === undefined) {
49
+ direction = target.getAttribute("direction") || target.direction;
50
+ }
51
51
  target.tabIndex = 0;
52
52
  onblur(target, removeByBlur);
53
53
  if (/select/i.test(target.tagName)) {
@@ -122,17 +122,23 @@ function slider(autoplay, circle = true) {
122
122
  };
123
123
  var park = function () {
124
124
  direction = 0;
125
- if (delta_negative_index > 0) {
126
- if (negative_index - floor(negative_index) > 0.3 / (1 + abs(_speed())))
125
+ var singleTarget = getSingleTarget();
126
+ if (singleTarget) {
127
+ negative_index = round(negative_index);
128
+ }
129
+ else if (delta_negative_index > 0) {
130
+ if (negative_index - floor(negative_index) > 0.2 / (1 + 6 * abs(_speed())))
127
131
  negative_index = ceil(negative_index);
128
132
  else
129
133
  negative_index = floor(negative_index);
130
- } else if (delta_negative_index < 0) {
131
- if (ceil(negative_index) - negative_index > 0.3 / (1 + abs(_speed())))
134
+ }
135
+ else if (delta_negative_index < 0) {
136
+ if (ceil(negative_index) - negative_index > 0.2 / (1 + 6 * abs(_speed())))
132
137
  negative_index = floor(negative_index);
133
138
  else
134
139
  negative_index = ceil(negative_index);
135
- } else {
140
+ }
141
+ else {
136
142
  negative_index = round(negative_index);
137
143
  }
138
144
  animate();
@@ -173,9 +179,10 @@ function slider(autoplay, circle = true) {
173
179
  }
174
180
  return enabled;
175
181
  };
182
+ var getSingleTarget = () => (!_imageMain || !_imageHelp) && (_imageMain || _imageHelp);
176
183
  var moveDeltaX = function (deltax, event) {
177
184
  var width = outter.clientWidth;
178
- var singleTarget = (!_imageMain || !_imageHelp) && (_imageMain || _imageHelp);
185
+ var singleTarget = getSingleTarget();
179
186
  if (singleTarget) {
180
187
  var current_Left = singleTarget.offsetLeft;
181
188
  var avail_deltaWidth = round(width >> 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.12.4",
3
+ "version": "3.12.5",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {