eoss-ui 0.4.64 → 0.4.65

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 (51) hide show
  1. package/lib/button-group.js +23 -17
  2. package/lib/button.js +25 -19
  3. package/lib/checkbox-group.js +23 -17
  4. package/lib/data-table-form.js +23 -17
  5. package/lib/data-table.js +23 -17
  6. package/lib/date-picker.js +23 -17
  7. package/lib/dialog.js +26 -20
  8. package/lib/eoss-ui.common.js +412 -379
  9. package/lib/flow-group.js +23 -17
  10. package/lib/flow-list.js +23 -17
  11. package/lib/flow.js +23 -17
  12. package/lib/form.js +25 -20
  13. package/lib/handle-user.js +23 -17
  14. package/lib/handler.js +23 -17
  15. package/lib/index.js +1 -1
  16. package/lib/input-number.js +23 -17
  17. package/lib/input.js +23 -17
  18. package/lib/login.js +23 -17
  19. package/lib/main.js +26 -19
  20. package/lib/nav.js +23 -17
  21. package/lib/page.js +23 -17
  22. package/lib/player.js +23 -17
  23. package/lib/qr-code.js +23 -17
  24. package/lib/radio-group.js +23 -17
  25. package/lib/retrial-auth.js +23 -17
  26. package/lib/select-ganged.js +23 -17
  27. package/lib/select.js +25 -18
  28. package/lib/selector-panel.js +23 -17
  29. package/lib/selector.js +23 -17
  30. package/lib/sizer.js +23 -17
  31. package/lib/steps.js +23 -17
  32. package/lib/switch.js +23 -17
  33. package/lib/table-form.js +23 -17
  34. package/lib/tabs.js +23 -17
  35. package/lib/tips.js +23 -17
  36. package/lib/tree-group.js +26 -20
  37. package/lib/tree.js +23 -17
  38. package/lib/upload.js +374 -342
  39. package/lib/utils/util.js +23 -17
  40. package/lib/wujie.js +23 -17
  41. package/lib/wxlogin.js +23 -17
  42. package/package.json +1 -1
  43. package/packages/button/src/main.vue +2 -2
  44. package/packages/dialog/src/main.vue +1 -1
  45. package/packages/form/src/main.vue +0 -1
  46. package/packages/main/src/main.vue +1 -0
  47. package/packages/select/src/main.vue +2 -1
  48. package/packages/tree-group/src/main.vue +1 -1
  49. package/packages/upload/src/main.vue +10 -1
  50. package/src/index.js +1 -1
  51. package/src/utils/util.js +22 -18
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2284,9 +2281,10 @@ var watermark = function watermark(option) {
2284
2281
  html: '水印示例', // 水印文本内容
2285
2282
  angle: -15, // 旋转角度
2286
2283
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2289
- lineHeight: 20, // 水印行高
2284
+ width: '', // 水印宽度
2285
+ minWidth: 300, // 水印最小宽度
2286
+ height: 120, // 水印高度
2287
+ lineHeight: 120, // 水印行高
2290
2288
  opacity: 0.1, // 水印透明度
2291
2289
  fontSize: 14, // 水印文字字体大小
2292
2290
  fontWeight: 400, // 水印字体粗细
@@ -2295,7 +2293,13 @@ var watermark = function watermark(option) {
2295
2293
  zIndex: 999999 // 水印文字的层级
2296
2294
  };
2297
2295
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2296
+ var wrap = document.getElementById('watermark');
2297
+ if (!wrap) {
2298
+ wrap = document.createElement('div');
2299
+ wrap.id = 'watermark';
2300
+ } else {
2301
+ wrap.innerHTML = '';
2302
+ }
2299
2303
  // 禁止选择和复制
2300
2304
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2305
  return false;
@@ -2306,6 +2310,8 @@ var watermark = function watermark(option) {
2306
2310
  html = options.html,
2307
2311
  angle = options.angle,
2308
2312
  color = options.color,
2313
+ width = options.width,
2314
+ minWidth = options.minWidth,
2309
2315
  height = options.height,
2310
2316
  lineHeight = options.lineHeight,
2311
2317
  opacity = options.opacity,
@@ -2321,7 +2327,7 @@ var watermark = function watermark(option) {
2321
2327
  for (var i = 0; i < num; i++) {
2322
2328
  var item = document.createElement('div');
2323
2329
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2330
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 100 / cols + '%') + ';min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2331
  docFrag.appendChild(item);
2326
2332
  }
2327
2333
  wrap.appendChild(docFrag);
package/lib/input.js CHANGED
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2284,9 +2281,10 @@ var watermark = function watermark(option) {
2284
2281
  html: '水印示例', // 水印文本内容
2285
2282
  angle: -15, // 旋转角度
2286
2283
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2289
- lineHeight: 20, // 水印行高
2284
+ width: '', // 水印宽度
2285
+ minWidth: 300, // 水印最小宽度
2286
+ height: 120, // 水印高度
2287
+ lineHeight: 120, // 水印行高
2290
2288
  opacity: 0.1, // 水印透明度
2291
2289
  fontSize: 14, // 水印文字字体大小
2292
2290
  fontWeight: 400, // 水印字体粗细
@@ -2295,7 +2293,13 @@ var watermark = function watermark(option) {
2295
2293
  zIndex: 999999 // 水印文字的层级
2296
2294
  };
2297
2295
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2296
+ var wrap = document.getElementById('watermark');
2297
+ if (!wrap) {
2298
+ wrap = document.createElement('div');
2299
+ wrap.id = 'watermark';
2300
+ } else {
2301
+ wrap.innerHTML = '';
2302
+ }
2299
2303
  // 禁止选择和复制
2300
2304
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2305
  return false;
@@ -2306,6 +2310,8 @@ var watermark = function watermark(option) {
2306
2310
  html = options.html,
2307
2311
  angle = options.angle,
2308
2312
  color = options.color,
2313
+ width = options.width,
2314
+ minWidth = options.minWidth,
2309
2315
  height = options.height,
2310
2316
  lineHeight = options.lineHeight,
2311
2317
  opacity = options.opacity,
@@ -2321,7 +2327,7 @@ var watermark = function watermark(option) {
2321
2327
  for (var i = 0; i < num; i++) {
2322
2328
  var item = document.createElement('div');
2323
2329
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2330
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 100 / cols + '%') + ';min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2331
  docFrag.appendChild(item);
2326
2332
  }
2327
2333
  wrap.appendChild(docFrag);
package/lib/login.js CHANGED
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2284,9 +2281,10 @@ var watermark = function watermark(option) {
2284
2281
  html: '水印示例', // 水印文本内容
2285
2282
  angle: -15, // 旋转角度
2286
2283
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2289
- lineHeight: 20, // 水印行高
2284
+ width: '', // 水印宽度
2285
+ minWidth: 300, // 水印最小宽度
2286
+ height: 120, // 水印高度
2287
+ lineHeight: 120, // 水印行高
2290
2288
  opacity: 0.1, // 水印透明度
2291
2289
  fontSize: 14, // 水印文字字体大小
2292
2290
  fontWeight: 400, // 水印字体粗细
@@ -2295,7 +2293,13 @@ var watermark = function watermark(option) {
2295
2293
  zIndex: 999999 // 水印文字的层级
2296
2294
  };
2297
2295
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2296
+ var wrap = document.getElementById('watermark');
2297
+ if (!wrap) {
2298
+ wrap = document.createElement('div');
2299
+ wrap.id = 'watermark';
2300
+ } else {
2301
+ wrap.innerHTML = '';
2302
+ }
2299
2303
  // 禁止选择和复制
2300
2304
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2305
  return false;
@@ -2306,6 +2310,8 @@ var watermark = function watermark(option) {
2306
2310
  html = options.html,
2307
2311
  angle = options.angle,
2308
2312
  color = options.color,
2313
+ width = options.width,
2314
+ minWidth = options.minWidth,
2309
2315
  height = options.height,
2310
2316
  lineHeight = options.lineHeight,
2311
2317
  opacity = options.opacity,
@@ -2321,7 +2327,7 @@ var watermark = function watermark(option) {
2321
2327
  for (var i = 0; i < num; i++) {
2322
2328
  var item = document.createElement('div');
2323
2329
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2330
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 100 / cols + '%') + ';min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2331
  docFrag.appendChild(item);
2326
2332
  }
2327
2333
  wrap.appendChild(docFrag);
package/lib/main.js CHANGED
@@ -2086,19 +2086,16 @@ var startWith = function startWith(value, reg) {
2086
2086
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2087
2087
 
2088
2088
  if (Array.isArray(reg)) {
2089
- var flag = true;
2090
- for (var i = 0; i < reg.length; i++) {
2091
- var item = reg[i];
2092
- if (new RegExp('^' + item).test(value)) {
2093
- if (or) {
2094
- flag = true;
2095
- return true;
2096
- }
2097
- } else {
2098
- flag = false;
2099
- }
2089
+ if (!reg.length) {
2090
+ return true;
2100
2091
  }
2101
- return flag;
2092
+ var regs = reg.map(function (item) {
2093
+ return new RegExp('^' + item).test(value);
2094
+ });
2095
+ if (or) {
2096
+ return regs.indexOf(true) > -1;
2097
+ }
2098
+ return regs.indexOf(false) === -1;
2102
2099
  }
2103
2100
  if (new RegExp('^' + reg).test(value)) {
2104
2101
  return true;
@@ -2283,9 +2280,10 @@ var watermark = function watermark(option) {
2283
2280
  html: '水印示例', // 水印文本内容
2284
2281
  angle: -15, // 旋转角度
2285
2282
  color: '#000', // 水印文字颜色
2286
- width: 100, // 水印宽度
2287
- height: 20, // 水印高度
2288
- lineHeight: 20, // 水印行高
2283
+ width: '', // 水印宽度
2284
+ minWidth: 300, // 水印最小宽度
2285
+ height: 120, // 水印高度
2286
+ lineHeight: 120, // 水印行高
2289
2287
  opacity: 0.1, // 水印透明度
2290
2288
  fontSize: 14, // 水印文字字体大小
2291
2289
  fontWeight: 400, // 水印字体粗细
@@ -2294,7 +2292,13 @@ var watermark = function watermark(option) {
2294
2292
  zIndex: 999999 // 水印文字的层级
2295
2293
  };
2296
2294
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2297
- var wrap = document.createElement('div');
2295
+ var wrap = document.getElementById('watermark');
2296
+ if (!wrap) {
2297
+ wrap = document.createElement('div');
2298
+ wrap.id = 'watermark';
2299
+ } else {
2300
+ wrap.innerHTML = '';
2301
+ }
2298
2302
  // 禁止选择和复制
2299
2303
  wrap.onselectstart = wrap.oncontextmenu = function () {
2300
2304
  return false;
@@ -2305,6 +2309,8 @@ var watermark = function watermark(option) {
2305
2309
  html = options.html,
2306
2310
  angle = options.angle,
2307
2311
  color = options.color,
2312
+ width = options.width,
2313
+ minWidth = options.minWidth,
2308
2314
  height = options.height,
2309
2315
  lineHeight = options.lineHeight,
2310
2316
  opacity = options.opacity,
@@ -2320,7 +2326,7 @@ var watermark = function watermark(option) {
2320
2326
  for (var i = 0; i < num; i++) {
2321
2327
  var item = document.createElement('div');
2322
2328
  item.innerHTML = html;
2323
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2329
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 100 / cols + '%') + ';min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2324
2330
  docFrag.appendChild(item);
2325
2331
  }
2326
2332
  wrap.appendChild(docFrag);
@@ -2936,7 +2942,7 @@ module.exports = require("stompjs");
2936
2942
  // ESM COMPAT FLAG
2937
2943
  __webpack_require__.r(__webpack_exports__);
2938
2944
 
2939
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=template&id=1686d4f2&
2945
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=template&id=668e9750&
2940
2946
  var render = function () {
2941
2947
  var _vm = this
2942
2948
  var _h = _vm.$createElement
@@ -3362,7 +3368,7 @@ var staticRenderFns = []
3362
3368
  render._withStripped = true
3363
3369
 
3364
3370
 
3365
- // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=1686d4f2&
3371
+ // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=668e9750&
3366
3372
 
3367
3373
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/userinfo.vue?vue&type=template&id=c2c69d4a&
3368
3374
  var userinfovue_type_template_id_c2c69d4a_render = function () {
@@ -6011,6 +6017,7 @@ var log = util["a" /* default */].getParams('console');
6011
6017
  this.color = unescape(results[i].color).toLowerCase();
6012
6018
  }
6013
6019
  if (i === 'subsystemExtend' && results[i].webPageWatermark) {
6020
+ util["a" /* default */].win.top.webPageWatermark = results[i].webPageWatermark;
6014
6021
  util["a" /* default */].watermark(results[i].webPageWatermark);
6015
6022
  }
6016
6023
  store["a" /* default */].set(i, results[i]);
package/lib/nav.js CHANGED
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2284,9 +2281,10 @@ var watermark = function watermark(option) {
2284
2281
  html: '水印示例', // 水印文本内容
2285
2282
  angle: -15, // 旋转角度
2286
2283
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2289
- lineHeight: 20, // 水印行高
2284
+ width: '', // 水印宽度
2285
+ minWidth: 300, // 水印最小宽度
2286
+ height: 120, // 水印高度
2287
+ lineHeight: 120, // 水印行高
2290
2288
  opacity: 0.1, // 水印透明度
2291
2289
  fontSize: 14, // 水印文字字体大小
2292
2290
  fontWeight: 400, // 水印字体粗细
@@ -2295,7 +2293,13 @@ var watermark = function watermark(option) {
2295
2293
  zIndex: 999999 // 水印文字的层级
2296
2294
  };
2297
2295
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2296
+ var wrap = document.getElementById('watermark');
2297
+ if (!wrap) {
2298
+ wrap = document.createElement('div');
2299
+ wrap.id = 'watermark';
2300
+ } else {
2301
+ wrap.innerHTML = '';
2302
+ }
2299
2303
  // 禁止选择和复制
2300
2304
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2305
  return false;
@@ -2306,6 +2310,8 @@ var watermark = function watermark(option) {
2306
2310
  html = options.html,
2307
2311
  angle = options.angle,
2308
2312
  color = options.color,
2313
+ width = options.width,
2314
+ minWidth = options.minWidth,
2309
2315
  height = options.height,
2310
2316
  lineHeight = options.lineHeight,
2311
2317
  opacity = options.opacity,
@@ -2321,7 +2327,7 @@ var watermark = function watermark(option) {
2321
2327
  for (var i = 0; i < num; i++) {
2322
2328
  var item = document.createElement('div');
2323
2329
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2330
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 100 / cols + '%') + ';min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2331
  docFrag.appendChild(item);
2326
2332
  }
2327
2333
  wrap.appendChild(docFrag);
package/lib/page.js CHANGED
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2284,9 +2281,10 @@ var watermark = function watermark(option) {
2284
2281
  html: '水印示例', // 水印文本内容
2285
2282
  angle: -15, // 旋转角度
2286
2283
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2289
- lineHeight: 20, // 水印行高
2284
+ width: '', // 水印宽度
2285
+ minWidth: 300, // 水印最小宽度
2286
+ height: 120, // 水印高度
2287
+ lineHeight: 120, // 水印行高
2290
2288
  opacity: 0.1, // 水印透明度
2291
2289
  fontSize: 14, // 水印文字字体大小
2292
2290
  fontWeight: 400, // 水印字体粗细
@@ -2295,7 +2293,13 @@ var watermark = function watermark(option) {
2295
2293
  zIndex: 999999 // 水印文字的层级
2296
2294
  };
2297
2295
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2296
+ var wrap = document.getElementById('watermark');
2297
+ if (!wrap) {
2298
+ wrap = document.createElement('div');
2299
+ wrap.id = 'watermark';
2300
+ } else {
2301
+ wrap.innerHTML = '';
2302
+ }
2299
2303
  // 禁止选择和复制
2300
2304
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2305
  return false;
@@ -2306,6 +2310,8 @@ var watermark = function watermark(option) {
2306
2310
  html = options.html,
2307
2311
  angle = options.angle,
2308
2312
  color = options.color,
2313
+ width = options.width,
2314
+ minWidth = options.minWidth,
2309
2315
  height = options.height,
2310
2316
  lineHeight = options.lineHeight,
2311
2317
  opacity = options.opacity,
@@ -2321,7 +2327,7 @@ var watermark = function watermark(option) {
2321
2327
  for (var i = 0; i < num; i++) {
2322
2328
  var item = document.createElement('div');
2323
2329
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2330
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 100 / cols + '%') + ';min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2331
  docFrag.appendChild(item);
2326
2332
  }
2327
2333
  wrap.appendChild(docFrag);
package/lib/player.js CHANGED
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2284,9 +2281,10 @@ var watermark = function watermark(option) {
2284
2281
  html: '水印示例', // 水印文本内容
2285
2282
  angle: -15, // 旋转角度
2286
2283
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2289
- lineHeight: 20, // 水印行高
2284
+ width: '', // 水印宽度
2285
+ minWidth: 300, // 水印最小宽度
2286
+ height: 120, // 水印高度
2287
+ lineHeight: 120, // 水印行高
2290
2288
  opacity: 0.1, // 水印透明度
2291
2289
  fontSize: 14, // 水印文字字体大小
2292
2290
  fontWeight: 400, // 水印字体粗细
@@ -2295,7 +2293,13 @@ var watermark = function watermark(option) {
2295
2293
  zIndex: 999999 // 水印文字的层级
2296
2294
  };
2297
2295
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2296
+ var wrap = document.getElementById('watermark');
2297
+ if (!wrap) {
2298
+ wrap = document.createElement('div');
2299
+ wrap.id = 'watermark';
2300
+ } else {
2301
+ wrap.innerHTML = '';
2302
+ }
2299
2303
  // 禁止选择和复制
2300
2304
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2305
  return false;
@@ -2306,6 +2310,8 @@ var watermark = function watermark(option) {
2306
2310
  html = options.html,
2307
2311
  angle = options.angle,
2308
2312
  color = options.color,
2313
+ width = options.width,
2314
+ minWidth = options.minWidth,
2309
2315
  height = options.height,
2310
2316
  lineHeight = options.lineHeight,
2311
2317
  opacity = options.opacity,
@@ -2321,7 +2327,7 @@ var watermark = function watermark(option) {
2321
2327
  for (var i = 0; i < num; i++) {
2322
2328
  var item = document.createElement('div');
2323
2329
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2330
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 100 / cols + '%') + ';min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2331
  docFrag.appendChild(item);
2326
2332
  }
2327
2333
  wrap.appendChild(docFrag);
package/lib/qr-code.js CHANGED
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2284,9 +2281,10 @@ var watermark = function watermark(option) {
2284
2281
  html: '水印示例', // 水印文本内容
2285
2282
  angle: -15, // 旋转角度
2286
2283
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2289
- lineHeight: 20, // 水印行高
2284
+ width: '', // 水印宽度
2285
+ minWidth: 300, // 水印最小宽度
2286
+ height: 120, // 水印高度
2287
+ lineHeight: 120, // 水印行高
2290
2288
  opacity: 0.1, // 水印透明度
2291
2289
  fontSize: 14, // 水印文字字体大小
2292
2290
  fontWeight: 400, // 水印字体粗细
@@ -2295,7 +2293,13 @@ var watermark = function watermark(option) {
2295
2293
  zIndex: 999999 // 水印文字的层级
2296
2294
  };
2297
2295
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2296
+ var wrap = document.getElementById('watermark');
2297
+ if (!wrap) {
2298
+ wrap = document.createElement('div');
2299
+ wrap.id = 'watermark';
2300
+ } else {
2301
+ wrap.innerHTML = '';
2302
+ }
2299
2303
  // 禁止选择和复制
2300
2304
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2305
  return false;
@@ -2306,6 +2310,8 @@ var watermark = function watermark(option) {
2306
2310
  html = options.html,
2307
2311
  angle = options.angle,
2308
2312
  color = options.color,
2313
+ width = options.width,
2314
+ minWidth = options.minWidth,
2309
2315
  height = options.height,
2310
2316
  lineHeight = options.lineHeight,
2311
2317
  opacity = options.opacity,
@@ -2321,7 +2327,7 @@ var watermark = function watermark(option) {
2321
2327
  for (var i = 0; i < num; i++) {
2322
2328
  var item = document.createElement('div');
2323
2329
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2330
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 100 / cols + '%') + ';min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2331
  docFrag.appendChild(item);
2326
2332
  }
2327
2333
  wrap.appendChild(docFrag);