@ddwl/ddwl-ui 1.3.1 → 1.3.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.
- package/README.md +92 -92
- package/dist/demo.html +1 -1
- package/dist/{app.common.js → index.common.js} +21 -21
- package/dist/{app.umd.js → index.umd.js} +23 -23
- package/dist/{app.umd.min.js → index.umd.min.js} +2 -2
- package/package.json +4 -4
- package/src/packages/table/index.vue +1 -0
- package/src/utils/index.js +51 -51
- /package/dist/{app.css → index.css} +0 -0
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddwl/ddwl-ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"private": false,
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"style": "dist/
|
|
5
|
+
"main": "dist/index.common.js",
|
|
6
|
+
"style": "dist/index.css",
|
|
7
7
|
"description": "ddwl组件库",
|
|
8
8
|
"author": "dingshengfei",
|
|
9
9
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"lint": "vue-cli-service lint",
|
|
19
19
|
"dev": "vue-cli-service lint && vue-cli-service serve",
|
|
20
|
-
"build": "vue-cli-service build --target lib --name
|
|
20
|
+
"build": "vue-cli-service lint && vue-cli-service build --target lib --name index src/main.js",
|
|
21
21
|
"release": "npm run build && bumpp -r && npm publish --access=public"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
package/src/utils/index.js
CHANGED
|
@@ -24,54 +24,54 @@ export const convertBytesToSize = (bytes) => {
|
|
|
24
24
|
*/
|
|
25
25
|
export function getQueryString(name) {
|
|
26
26
|
const href = window.location.href
|
|
27
|
-
/*eslint-disable */
|
|
28
|
-
const reg = new RegExp(name + '=[^&|#|\/]*')
|
|
29
|
-
const res = href.match(reg)
|
|
30
|
-
return res ? href.match(reg)[0].split('=')[1] : ''
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description: 移除url参数
|
|
35
|
-
* @param {*} name 参数名称
|
|
36
|
-
* @return {string}
|
|
37
|
-
*/
|
|
38
|
-
export const removeURLParam = (name) => {
|
|
39
|
-
let tempUrl = window.location.href
|
|
40
|
-
tempUrl = tempUrl.split("?")[0]
|
|
41
|
-
window.history.replaceState({}, "0", tempUrl)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @description: 复制内容到剪贴板
|
|
46
|
-
* @param {string} text 复制文本
|
|
47
|
-
* @return {string}
|
|
48
|
-
*/
|
|
49
|
-
export const copy = (text) => {
|
|
50
|
-
return new Promise((resolve, reject) => {
|
|
51
|
-
const input = document.createElement('input')
|
|
52
|
-
document.body.appendChild(input)
|
|
53
|
-
input.setAttribute('value', text)
|
|
54
|
-
input.select()
|
|
55
|
-
if (document.execCommand('copy')) {
|
|
56
|
-
document.execCommand('copy')
|
|
57
|
-
resolve()
|
|
58
|
-
} else {
|
|
59
|
-
reject()
|
|
60
|
-
}
|
|
61
|
-
document.body.removeChild(input)
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @description: 根据字符串长度生成*号字符串
|
|
67
|
-
* @param {*} text 字符串
|
|
68
|
-
* @return {string}
|
|
69
|
-
*/
|
|
70
|
-
export function generateAsterisksByString (text) {
|
|
71
|
-
const length = text.length
|
|
72
|
-
if (typeof length !== 'number' || length <= 0) {
|
|
73
|
-
return ''
|
|
74
|
-
}
|
|
75
|
-
return '*'.repeat(length)
|
|
76
|
-
}
|
|
77
|
-
|
|
27
|
+
/*eslint-disable */
|
|
28
|
+
const reg = new RegExp(name + '=[^&|#|\/]*')
|
|
29
|
+
const res = href.match(reg)
|
|
30
|
+
return res ? href.match(reg)[0].split('=')[1] : ''
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @description: 移除url参数
|
|
35
|
+
* @param {*} name 参数名称
|
|
36
|
+
* @return {string}
|
|
37
|
+
*/
|
|
38
|
+
export const removeURLParam = (name) => {
|
|
39
|
+
let tempUrl = window.location.href
|
|
40
|
+
tempUrl = tempUrl.split("?")[0]
|
|
41
|
+
window.history.replaceState({}, "0", tempUrl)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @description: 复制内容到剪贴板
|
|
46
|
+
* @param {string} text 复制文本
|
|
47
|
+
* @return {string}
|
|
48
|
+
*/
|
|
49
|
+
export const copy = (text) => {
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
const input = document.createElement('input')
|
|
52
|
+
document.body.appendChild(input)
|
|
53
|
+
input.setAttribute('value', text)
|
|
54
|
+
input.select()
|
|
55
|
+
if (document.execCommand('copy')) {
|
|
56
|
+
document.execCommand('copy')
|
|
57
|
+
resolve()
|
|
58
|
+
} else {
|
|
59
|
+
reject()
|
|
60
|
+
}
|
|
61
|
+
document.body.removeChild(input)
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @description: 根据字符串长度生成*号字符串
|
|
67
|
+
* @param {*} text 字符串
|
|
68
|
+
* @return {string}
|
|
69
|
+
*/
|
|
70
|
+
export function generateAsterisksByString (text) {
|
|
71
|
+
const length = text.length
|
|
72
|
+
if (typeof length !== 'number' || length <= 0) {
|
|
73
|
+
return ''
|
|
74
|
+
}
|
|
75
|
+
return '*'.repeat(length)
|
|
76
|
+
}
|
|
77
|
+
|
|
File without changes
|