eoss-ui 0.4.64 → 0.4.66
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/lib/button-group.js +33 -18
- package/lib/button.js +35 -20
- package/lib/checkbox-group.js +33 -18
- package/lib/data-table-form.js +33 -18
- package/lib/data-table.js +33 -18
- package/lib/date-picker.js +33 -18
- package/lib/dialog.js +36 -21
- package/lib/eoss-ui.common.js +7036 -6505
- package/lib/flow-group.js +33 -18
- package/lib/flow-list.js +33 -18
- package/lib/flow.js +38 -22
- package/lib/form.js +8659 -8284
- package/lib/handle-user.js +33 -18
- package/lib/handler.js +33 -18
- package/lib/index.js +1 -1
- package/lib/input-number.js +33 -18
- package/lib/input.js +53 -25
- package/lib/login.js +38 -25
- package/lib/main.js +95 -70
- package/lib/nav.js +36 -21
- package/lib/page.js +33 -18
- package/lib/player.js +33 -18
- package/lib/qr-code.js +33 -18
- package/lib/radio-group.js +33 -18
- package/lib/retrial-auth.js +33 -18
- package/lib/select-ganged.js +33 -18
- package/lib/select.js +35 -19
- package/lib/selector-panel.js +33 -18
- package/lib/selector.js +33 -18
- package/lib/sizer.js +33 -18
- package/lib/steps.js +33 -18
- package/lib/switch.js +33 -18
- package/lib/table-form.js +1336 -1214
- package/lib/tabs.js +33 -18
- package/lib/tips.js +33 -18
- package/lib/tree-group.js +36 -21
- package/lib/tree.js +33 -18
- package/lib/upload.js +384 -343
- package/lib/utils/util.js +33 -18
- package/lib/wujie.js +33 -18
- package/lib/wxlogin.js +33 -18
- package/package.json +2 -2
- package/packages/button/src/main.vue +2 -2
- package/packages/dialog/src/main.vue +1 -1
- package/packages/flow/src/main.vue +6 -5
- package/packages/form/src/main.vue +1435 -1314
- package/packages/form/src/table.vue +375 -318
- package/packages/input/src/main.vue +20 -7
- package/packages/login/src/main.vue +3 -5
- package/packages/main/src/main.vue +61 -54
- package/packages/nav/src/main.vue +1 -1
- package/packages/select/src/main.vue +2 -1
- package/packages/tree-group/src/main.vue +1 -1
- package/packages/upload/src/main.vue +10 -1
- package/src/index.js +1 -1
- package/src/utils/util.js +33 -19
package/lib/button-group.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
|
-
|
|
2091
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -2278,14 +2275,18 @@ var uuid = function uuid(len) {
|
|
|
2278
2275
|
**/
|
|
2279
2276
|
var watermark = function watermark(option) {
|
|
2280
2277
|
// 默认设置
|
|
2278
|
+
var _width = parseInt(option.width || 480, 10);
|
|
2279
|
+
var _height = parseInt(option.width || 180, 10);
|
|
2280
|
+
var _rows = Math.round(document.body.clientHeight / _height);
|
|
2281
|
+
var _cols = Math.round(document.body.clientWidth / _width);
|
|
2281
2282
|
var config = {
|
|
2282
|
-
rows:
|
|
2283
|
-
cols:
|
|
2283
|
+
rows: _rows, // 水印行数
|
|
2284
|
+
cols: _cols,
|
|
2284
2285
|
html: '水印示例', // 水印文本内容
|
|
2285
2286
|
angle: -15, // 旋转角度
|
|
2286
2287
|
color: '#000', // 水印文字颜色
|
|
2287
|
-
|
|
2288
|
-
height:
|
|
2288
|
+
minWidth: _width, // 水印最小宽度
|
|
2289
|
+
height: _height, // 水印高度
|
|
2289
2290
|
lineHeight: 20, // 水印行高
|
|
2290
2291
|
opacity: 0.1, // 水印透明度
|
|
2291
2292
|
fontSize: 14, // 水印文字字体大小
|
|
@@ -2295,7 +2296,13 @@ var watermark = function watermark(option) {
|
|
|
2295
2296
|
zIndex: 999999 // 水印文字的层级
|
|
2296
2297
|
};
|
|
2297
2298
|
var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
|
|
2298
|
-
var wrap = document.
|
|
2299
|
+
var wrap = document.getElementById('watermark');
|
|
2300
|
+
if (!wrap) {
|
|
2301
|
+
wrap = document.createElement('div');
|
|
2302
|
+
wrap.id = 'watermark';
|
|
2303
|
+
} else {
|
|
2304
|
+
wrap.innerHTML = '';
|
|
2305
|
+
}
|
|
2299
2306
|
// 禁止选择和复制
|
|
2300
2307
|
wrap.onselectstart = wrap.oncontextmenu = function () {
|
|
2301
2308
|
return false;
|
|
@@ -2306,6 +2313,7 @@ var watermark = function watermark(option) {
|
|
|
2306
2313
|
html = options.html,
|
|
2307
2314
|
angle = options.angle,
|
|
2308
2315
|
color = options.color,
|
|
2316
|
+
minWidth = options.minWidth,
|
|
2309
2317
|
height = options.height,
|
|
2310
2318
|
lineHeight = options.lineHeight,
|
|
2311
2319
|
opacity = options.opacity,
|
|
@@ -2321,11 +2329,18 @@ var watermark = function watermark(option) {
|
|
|
2321
2329
|
for (var i = 0; i < num; i++) {
|
|
2322
2330
|
var item = document.createElement('div');
|
|
2323
2331
|
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 + ';';
|
|
2332
|
+
item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 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
2333
|
docFrag.appendChild(item);
|
|
2326
2334
|
}
|
|
2327
2335
|
wrap.appendChild(docFrag);
|
|
2328
2336
|
document.body.appendChild(wrap);
|
|
2337
|
+
var _timeout = void 0;
|
|
2338
|
+
window.onresize = function () {
|
|
2339
|
+
clearTimeout(_timeout);
|
|
2340
|
+
_timeout = setTimeout(function () {
|
|
2341
|
+
watermark(options);
|
|
2342
|
+
}, 1000);
|
|
2343
|
+
};
|
|
2329
2344
|
};
|
|
2330
2345
|
|
|
2331
2346
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
package/lib/button.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
|
-
|
|
2091
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -2278,14 +2275,18 @@ var uuid = function uuid(len) {
|
|
|
2278
2275
|
**/
|
|
2279
2276
|
var watermark = function watermark(option) {
|
|
2280
2277
|
// 默认设置
|
|
2278
|
+
var _width = parseInt(option.width || 480, 10);
|
|
2279
|
+
var _height = parseInt(option.width || 180, 10);
|
|
2280
|
+
var _rows = Math.round(document.body.clientHeight / _height);
|
|
2281
|
+
var _cols = Math.round(document.body.clientWidth / _width);
|
|
2281
2282
|
var config = {
|
|
2282
|
-
rows:
|
|
2283
|
-
cols:
|
|
2283
|
+
rows: _rows, // 水印行数
|
|
2284
|
+
cols: _cols,
|
|
2284
2285
|
html: '水印示例', // 水印文本内容
|
|
2285
2286
|
angle: -15, // 旋转角度
|
|
2286
2287
|
color: '#000', // 水印文字颜色
|
|
2287
|
-
|
|
2288
|
-
height:
|
|
2288
|
+
minWidth: _width, // 水印最小宽度
|
|
2289
|
+
height: _height, // 水印高度
|
|
2289
2290
|
lineHeight: 20, // 水印行高
|
|
2290
2291
|
opacity: 0.1, // 水印透明度
|
|
2291
2292
|
fontSize: 14, // 水印文字字体大小
|
|
@@ -2295,7 +2296,13 @@ var watermark = function watermark(option) {
|
|
|
2295
2296
|
zIndex: 999999 // 水印文字的层级
|
|
2296
2297
|
};
|
|
2297
2298
|
var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
|
|
2298
|
-
var wrap = document.
|
|
2299
|
+
var wrap = document.getElementById('watermark');
|
|
2300
|
+
if (!wrap) {
|
|
2301
|
+
wrap = document.createElement('div');
|
|
2302
|
+
wrap.id = 'watermark';
|
|
2303
|
+
} else {
|
|
2304
|
+
wrap.innerHTML = '';
|
|
2305
|
+
}
|
|
2299
2306
|
// 禁止选择和复制
|
|
2300
2307
|
wrap.onselectstart = wrap.oncontextmenu = function () {
|
|
2301
2308
|
return false;
|
|
@@ -2306,6 +2313,7 @@ var watermark = function watermark(option) {
|
|
|
2306
2313
|
html = options.html,
|
|
2307
2314
|
angle = options.angle,
|
|
2308
2315
|
color = options.color,
|
|
2316
|
+
minWidth = options.minWidth,
|
|
2309
2317
|
height = options.height,
|
|
2310
2318
|
lineHeight = options.lineHeight,
|
|
2311
2319
|
opacity = options.opacity,
|
|
@@ -2321,11 +2329,18 @@ var watermark = function watermark(option) {
|
|
|
2321
2329
|
for (var i = 0; i < num; i++) {
|
|
2322
2330
|
var item = document.createElement('div');
|
|
2323
2331
|
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 + ';';
|
|
2332
|
+
item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 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
2333
|
docFrag.appendChild(item);
|
|
2326
2334
|
}
|
|
2327
2335
|
wrap.appendChild(docFrag);
|
|
2328
2336
|
document.body.appendChild(wrap);
|
|
2337
|
+
var _timeout = void 0;
|
|
2338
|
+
window.onresize = function () {
|
|
2339
|
+
clearTimeout(_timeout);
|
|
2340
|
+
_timeout = setTimeout(function () {
|
|
2341
|
+
watermark(options);
|
|
2342
|
+
}, 1000);
|
|
2343
|
+
};
|
|
2329
2344
|
};
|
|
2330
2345
|
|
|
2331
2346
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
@@ -3086,8 +3101,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
3086
3101
|
},
|
|
3087
3102
|
render: function render(h) {
|
|
3088
3103
|
var useCaseCodes = util["a" /* default */].getStorage('useCaseCodes');
|
|
3089
|
-
if (
|
|
3090
|
-
if (useCaseCodes.indexOf(
|
|
3104
|
+
if (useCaseCodes && this.useCaseCode) {
|
|
3105
|
+
if (useCaseCodes.indexOf(this.useCaseCode) == -1) {
|
|
3091
3106
|
return false;
|
|
3092
3107
|
}
|
|
3093
3108
|
}
|
package/lib/checkbox-group.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
|
-
|
|
2091
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -2278,14 +2275,18 @@ var uuid = function uuid(len) {
|
|
|
2278
2275
|
**/
|
|
2279
2276
|
var watermark = function watermark(option) {
|
|
2280
2277
|
// 默认设置
|
|
2278
|
+
var _width = parseInt(option.width || 480, 10);
|
|
2279
|
+
var _height = parseInt(option.width || 180, 10);
|
|
2280
|
+
var _rows = Math.round(document.body.clientHeight / _height);
|
|
2281
|
+
var _cols = Math.round(document.body.clientWidth / _width);
|
|
2281
2282
|
var config = {
|
|
2282
|
-
rows:
|
|
2283
|
-
cols:
|
|
2283
|
+
rows: _rows, // 水印行数
|
|
2284
|
+
cols: _cols,
|
|
2284
2285
|
html: '水印示例', // 水印文本内容
|
|
2285
2286
|
angle: -15, // 旋转角度
|
|
2286
2287
|
color: '#000', // 水印文字颜色
|
|
2287
|
-
|
|
2288
|
-
height:
|
|
2288
|
+
minWidth: _width, // 水印最小宽度
|
|
2289
|
+
height: _height, // 水印高度
|
|
2289
2290
|
lineHeight: 20, // 水印行高
|
|
2290
2291
|
opacity: 0.1, // 水印透明度
|
|
2291
2292
|
fontSize: 14, // 水印文字字体大小
|
|
@@ -2295,7 +2296,13 @@ var watermark = function watermark(option) {
|
|
|
2295
2296
|
zIndex: 999999 // 水印文字的层级
|
|
2296
2297
|
};
|
|
2297
2298
|
var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
|
|
2298
|
-
var wrap = document.
|
|
2299
|
+
var wrap = document.getElementById('watermark');
|
|
2300
|
+
if (!wrap) {
|
|
2301
|
+
wrap = document.createElement('div');
|
|
2302
|
+
wrap.id = 'watermark';
|
|
2303
|
+
} else {
|
|
2304
|
+
wrap.innerHTML = '';
|
|
2305
|
+
}
|
|
2299
2306
|
// 禁止选择和复制
|
|
2300
2307
|
wrap.onselectstart = wrap.oncontextmenu = function () {
|
|
2301
2308
|
return false;
|
|
@@ -2306,6 +2313,7 @@ var watermark = function watermark(option) {
|
|
|
2306
2313
|
html = options.html,
|
|
2307
2314
|
angle = options.angle,
|
|
2308
2315
|
color = options.color,
|
|
2316
|
+
minWidth = options.minWidth,
|
|
2309
2317
|
height = options.height,
|
|
2310
2318
|
lineHeight = options.lineHeight,
|
|
2311
2319
|
opacity = options.opacity,
|
|
@@ -2321,11 +2329,18 @@ var watermark = function watermark(option) {
|
|
|
2321
2329
|
for (var i = 0; i < num; i++) {
|
|
2322
2330
|
var item = document.createElement('div');
|
|
2323
2331
|
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 + ';';
|
|
2332
|
+
item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 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
2333
|
docFrag.appendChild(item);
|
|
2326
2334
|
}
|
|
2327
2335
|
wrap.appendChild(docFrag);
|
|
2328
2336
|
document.body.appendChild(wrap);
|
|
2337
|
+
var _timeout = void 0;
|
|
2338
|
+
window.onresize = function () {
|
|
2339
|
+
clearTimeout(_timeout);
|
|
2340
|
+
_timeout = setTimeout(function () {
|
|
2341
|
+
watermark(options);
|
|
2342
|
+
}, 1000);
|
|
2343
|
+
};
|
|
2329
2344
|
};
|
|
2330
2345
|
|
|
2331
2346
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
package/lib/data-table-form.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
|
-
|
|
2090
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -2277,14 +2274,18 @@ var uuid = function uuid(len) {
|
|
|
2277
2274
|
**/
|
|
2278
2275
|
var watermark = function watermark(option) {
|
|
2279
2276
|
// 默认设置
|
|
2277
|
+
var _width = parseInt(option.width || 480, 10);
|
|
2278
|
+
var _height = parseInt(option.width || 180, 10);
|
|
2279
|
+
var _rows = Math.round(document.body.clientHeight / _height);
|
|
2280
|
+
var _cols = Math.round(document.body.clientWidth / _width);
|
|
2280
2281
|
var config = {
|
|
2281
|
-
rows:
|
|
2282
|
-
cols:
|
|
2282
|
+
rows: _rows, // 水印行数
|
|
2283
|
+
cols: _cols,
|
|
2283
2284
|
html: '水印示例', // 水印文本内容
|
|
2284
2285
|
angle: -15, // 旋转角度
|
|
2285
2286
|
color: '#000', // 水印文字颜色
|
|
2286
|
-
|
|
2287
|
-
height:
|
|
2287
|
+
minWidth: _width, // 水印最小宽度
|
|
2288
|
+
height: _height, // 水印高度
|
|
2288
2289
|
lineHeight: 20, // 水印行高
|
|
2289
2290
|
opacity: 0.1, // 水印透明度
|
|
2290
2291
|
fontSize: 14, // 水印文字字体大小
|
|
@@ -2294,7 +2295,13 @@ var watermark = function watermark(option) {
|
|
|
2294
2295
|
zIndex: 999999 // 水印文字的层级
|
|
2295
2296
|
};
|
|
2296
2297
|
var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
|
|
2297
|
-
var wrap = document.
|
|
2298
|
+
var wrap = document.getElementById('watermark');
|
|
2299
|
+
if (!wrap) {
|
|
2300
|
+
wrap = document.createElement('div');
|
|
2301
|
+
wrap.id = 'watermark';
|
|
2302
|
+
} else {
|
|
2303
|
+
wrap.innerHTML = '';
|
|
2304
|
+
}
|
|
2298
2305
|
// 禁止选择和复制
|
|
2299
2306
|
wrap.onselectstart = wrap.oncontextmenu = function () {
|
|
2300
2307
|
return false;
|
|
@@ -2305,6 +2312,7 @@ var watermark = function watermark(option) {
|
|
|
2305
2312
|
html = options.html,
|
|
2306
2313
|
angle = options.angle,
|
|
2307
2314
|
color = options.color,
|
|
2315
|
+
minWidth = options.minWidth,
|
|
2308
2316
|
height = options.height,
|
|
2309
2317
|
lineHeight = options.lineHeight,
|
|
2310
2318
|
opacity = options.opacity,
|
|
@@ -2320,11 +2328,18 @@ var watermark = function watermark(option) {
|
|
|
2320
2328
|
for (var i = 0; i < num; i++) {
|
|
2321
2329
|
var item = document.createElement('div');
|
|
2322
2330
|
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 + ';';
|
|
2331
|
+
item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 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
2332
|
docFrag.appendChild(item);
|
|
2325
2333
|
}
|
|
2326
2334
|
wrap.appendChild(docFrag);
|
|
2327
2335
|
document.body.appendChild(wrap);
|
|
2336
|
+
var _timeout = void 0;
|
|
2337
|
+
window.onresize = function () {
|
|
2338
|
+
clearTimeout(_timeout);
|
|
2339
|
+
_timeout = setTimeout(function () {
|
|
2340
|
+
watermark(options);
|
|
2341
|
+
}, 1000);
|
|
2342
|
+
};
|
|
2328
2343
|
};
|
|
2329
2344
|
|
|
2330
2345
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
package/lib/data-table.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
|
-
|
|
2090
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -2277,14 +2274,18 @@ var uuid = function uuid(len) {
|
|
|
2277
2274
|
**/
|
|
2278
2275
|
var watermark = function watermark(option) {
|
|
2279
2276
|
// 默认设置
|
|
2277
|
+
var _width = parseInt(option.width || 480, 10);
|
|
2278
|
+
var _height = parseInt(option.width || 180, 10);
|
|
2279
|
+
var _rows = Math.round(document.body.clientHeight / _height);
|
|
2280
|
+
var _cols = Math.round(document.body.clientWidth / _width);
|
|
2280
2281
|
var config = {
|
|
2281
|
-
rows:
|
|
2282
|
-
cols:
|
|
2282
|
+
rows: _rows, // 水印行数
|
|
2283
|
+
cols: _cols,
|
|
2283
2284
|
html: '水印示例', // 水印文本内容
|
|
2284
2285
|
angle: -15, // 旋转角度
|
|
2285
2286
|
color: '#000', // 水印文字颜色
|
|
2286
|
-
|
|
2287
|
-
height:
|
|
2287
|
+
minWidth: _width, // 水印最小宽度
|
|
2288
|
+
height: _height, // 水印高度
|
|
2288
2289
|
lineHeight: 20, // 水印行高
|
|
2289
2290
|
opacity: 0.1, // 水印透明度
|
|
2290
2291
|
fontSize: 14, // 水印文字字体大小
|
|
@@ -2294,7 +2295,13 @@ var watermark = function watermark(option) {
|
|
|
2294
2295
|
zIndex: 999999 // 水印文字的层级
|
|
2295
2296
|
};
|
|
2296
2297
|
var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
|
|
2297
|
-
var wrap = document.
|
|
2298
|
+
var wrap = document.getElementById('watermark');
|
|
2299
|
+
if (!wrap) {
|
|
2300
|
+
wrap = document.createElement('div');
|
|
2301
|
+
wrap.id = 'watermark';
|
|
2302
|
+
} else {
|
|
2303
|
+
wrap.innerHTML = '';
|
|
2304
|
+
}
|
|
2298
2305
|
// 禁止选择和复制
|
|
2299
2306
|
wrap.onselectstart = wrap.oncontextmenu = function () {
|
|
2300
2307
|
return false;
|
|
@@ -2305,6 +2312,7 @@ var watermark = function watermark(option) {
|
|
|
2305
2312
|
html = options.html,
|
|
2306
2313
|
angle = options.angle,
|
|
2307
2314
|
color = options.color,
|
|
2315
|
+
minWidth = options.minWidth,
|
|
2308
2316
|
height = options.height,
|
|
2309
2317
|
lineHeight = options.lineHeight,
|
|
2310
2318
|
opacity = options.opacity,
|
|
@@ -2320,11 +2328,18 @@ var watermark = function watermark(option) {
|
|
|
2320
2328
|
for (var i = 0; i < num; i++) {
|
|
2321
2329
|
var item = document.createElement('div');
|
|
2322
2330
|
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 + ';';
|
|
2331
|
+
item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 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
2332
|
docFrag.appendChild(item);
|
|
2325
2333
|
}
|
|
2326
2334
|
wrap.appendChild(docFrag);
|
|
2327
2335
|
document.body.appendChild(wrap);
|
|
2336
|
+
var _timeout = void 0;
|
|
2337
|
+
window.onresize = function () {
|
|
2338
|
+
clearTimeout(_timeout);
|
|
2339
|
+
_timeout = setTimeout(function () {
|
|
2340
|
+
watermark(options);
|
|
2341
|
+
}, 1000);
|
|
2342
|
+
};
|
|
2328
2343
|
};
|
|
2329
2344
|
|
|
2330
2345
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
package/lib/date-picker.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
|
-
|
|
2091
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -2278,14 +2275,18 @@ var uuid = function uuid(len) {
|
|
|
2278
2275
|
**/
|
|
2279
2276
|
var watermark = function watermark(option) {
|
|
2280
2277
|
// 默认设置
|
|
2278
|
+
var _width = parseInt(option.width || 480, 10);
|
|
2279
|
+
var _height = parseInt(option.width || 180, 10);
|
|
2280
|
+
var _rows = Math.round(document.body.clientHeight / _height);
|
|
2281
|
+
var _cols = Math.round(document.body.clientWidth / _width);
|
|
2281
2282
|
var config = {
|
|
2282
|
-
rows:
|
|
2283
|
-
cols:
|
|
2283
|
+
rows: _rows, // 水印行数
|
|
2284
|
+
cols: _cols,
|
|
2284
2285
|
html: '水印示例', // 水印文本内容
|
|
2285
2286
|
angle: -15, // 旋转角度
|
|
2286
2287
|
color: '#000', // 水印文字颜色
|
|
2287
|
-
|
|
2288
|
-
height:
|
|
2288
|
+
minWidth: _width, // 水印最小宽度
|
|
2289
|
+
height: _height, // 水印高度
|
|
2289
2290
|
lineHeight: 20, // 水印行高
|
|
2290
2291
|
opacity: 0.1, // 水印透明度
|
|
2291
2292
|
fontSize: 14, // 水印文字字体大小
|
|
@@ -2295,7 +2296,13 @@ var watermark = function watermark(option) {
|
|
|
2295
2296
|
zIndex: 999999 // 水印文字的层级
|
|
2296
2297
|
};
|
|
2297
2298
|
var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
|
|
2298
|
-
var wrap = document.
|
|
2299
|
+
var wrap = document.getElementById('watermark');
|
|
2300
|
+
if (!wrap) {
|
|
2301
|
+
wrap = document.createElement('div');
|
|
2302
|
+
wrap.id = 'watermark';
|
|
2303
|
+
} else {
|
|
2304
|
+
wrap.innerHTML = '';
|
|
2305
|
+
}
|
|
2299
2306
|
// 禁止选择和复制
|
|
2300
2307
|
wrap.onselectstart = wrap.oncontextmenu = function () {
|
|
2301
2308
|
return false;
|
|
@@ -2306,6 +2313,7 @@ var watermark = function watermark(option) {
|
|
|
2306
2313
|
html = options.html,
|
|
2307
2314
|
angle = options.angle,
|
|
2308
2315
|
color = options.color,
|
|
2316
|
+
minWidth = options.minWidth,
|
|
2309
2317
|
height = options.height,
|
|
2310
2318
|
lineHeight = options.lineHeight,
|
|
2311
2319
|
opacity = options.opacity,
|
|
@@ -2321,11 +2329,18 @@ var watermark = function watermark(option) {
|
|
|
2321
2329
|
for (var i = 0; i < num; i++) {
|
|
2322
2330
|
var item = document.createElement('div');
|
|
2323
2331
|
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 + ';';
|
|
2332
|
+
item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 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
2333
|
docFrag.appendChild(item);
|
|
2326
2334
|
}
|
|
2327
2335
|
wrap.appendChild(docFrag);
|
|
2328
2336
|
document.body.appendChild(wrap);
|
|
2337
|
+
var _timeout = void 0;
|
|
2338
|
+
window.onresize = function () {
|
|
2339
|
+
clearTimeout(_timeout);
|
|
2340
|
+
_timeout = setTimeout(function () {
|
|
2341
|
+
watermark(options);
|
|
2342
|
+
}, 1000);
|
|
2343
|
+
};
|
|
2329
2344
|
};
|
|
2330
2345
|
|
|
2331
2346
|
/* harmony default export */ __webpack_exports__["a"] = ({
|