@10yun/cv-pc-ui 0.3.50 → 0.3.52
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 +1 -1
- package/lib/cv-ui.cjs +8 -8
- package/lib/cv-ui.css +1 -1
- package/lib/cv-ui.js +1167 -1250
- package/package.json +13 -13
- package/src/mixins/attrs.js +37 -0
- package/src/utils/copy.js +9 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@10yun/cv-pc-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.52",
|
|
4
4
|
"description": "cvjs-pc-ui组件",
|
|
5
5
|
"author": "10yun",
|
|
6
6
|
"private": false,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"registry": "https://registry.npmjs.org/"
|
|
17
17
|
},
|
|
18
18
|
"npmjs": "https://www.npmjs.com/package/@10yun/cv-pc-ui",
|
|
19
|
-
"homepage": "
|
|
19
|
+
"homepage": "http://cvjs.cn/cv-pc-ui",
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
22
|
"url": "https://gitee.com/cvjs/cv-pc-ui"
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
56
56
|
"@codemirror/lang-json": "^6.0.2",
|
|
57
57
|
"@codemirror/lang-lezer": "^6.0.2",
|
|
58
|
-
"@codemirror/lang-markdown": "^6.3.
|
|
58
|
+
"@codemirror/lang-markdown": "^6.3.4",
|
|
59
59
|
"@codemirror/lang-php": "^6.0.2",
|
|
60
60
|
"@codemirror/lang-python": "^6.2.1",
|
|
61
61
|
"@codemirror/lang-rust": "^6.0.2",
|
|
62
|
-
"@codemirror/lang-sql": "^6.9.
|
|
62
|
+
"@codemirror/lang-sql": "^6.9.1",
|
|
63
63
|
"@codemirror/lang-vue": "^0.1.3",
|
|
64
64
|
"@codemirror/lang-xml": "^6.1.0",
|
|
65
65
|
"@codemirror/language": "6.x",
|
|
@@ -68,24 +68,24 @@
|
|
|
68
68
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
69
69
|
"@codemirror/view": "6.x",
|
|
70
70
|
"@ddietr/codemirror-themes": "^1.5.1",
|
|
71
|
-
"@element-plus/icons-vue": "^2.3.
|
|
71
|
+
"@element-plus/icons-vue": "^2.3.2",
|
|
72
72
|
"@lezer/highlight": "^1.2.1",
|
|
73
|
-
"@vitejs/plugin-vue-jsx": "^5.
|
|
74
|
-
"@vueuse/core": "^13.
|
|
73
|
+
"@vitejs/plugin-vue-jsx": "^5.1.0",
|
|
74
|
+
"@vueuse/core": "^13.7.0",
|
|
75
75
|
"codemirror": "^6.0.2",
|
|
76
|
-
"element-plus": "^2.
|
|
76
|
+
"element-plus": "^2.11.1",
|
|
77
77
|
"highlight.js": "^11.11.1",
|
|
78
78
|
"html-to-md": "^0.8.8",
|
|
79
|
-
"vue": "^3.5.
|
|
79
|
+
"vue": "^3.5.20",
|
|
80
80
|
"vue-cropper": "^1.1.4",
|
|
81
81
|
"vue-router": "^4.5.1"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@10yun/cv-js-utils": "^0.3.
|
|
84
|
+
"@10yun/cv-js-utils": "^0.3.30",
|
|
85
85
|
"@rollup/plugin-terser": "^0.4.4",
|
|
86
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
87
|
-
"vite": "^7.
|
|
88
|
-
"vue-tsc": "^
|
|
86
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
87
|
+
"vite": "^7.1.3",
|
|
88
|
+
"vue-tsc": "^3.0.6"
|
|
89
89
|
},
|
|
90
90
|
"engines": {
|
|
91
91
|
"node": ">=20.0.0"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
computed: {
|
|
3
|
+
// 获取组件名: 并将组件转为 kebab-case
|
|
4
|
+
componentName() {
|
|
5
|
+
let name = this.$options.name;
|
|
6
|
+
// name = name
|
|
7
|
+
// .replace('cv', '')
|
|
8
|
+
// .replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, '-$&')
|
|
9
|
+
// .toLowerCase()
|
|
10
|
+
// if (name.startsWith('-')) name = name.slice(1)
|
|
11
|
+
return name;
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
methods: {
|
|
15
|
+
_mergeAttrs(key) {
|
|
16
|
+
// 全局属性
|
|
17
|
+
const globalAttrs = this.$cvUiParams || {};
|
|
18
|
+
// 全局上传组件属性
|
|
19
|
+
const globalUploadAttrs = key ? globalAttrs[key] || {} : {};
|
|
20
|
+
// 最终组件属性
|
|
21
|
+
const globalCompoAttr = globalAttrs[this.componentName] || {};
|
|
22
|
+
const lastCompAttrs = Object.assign({}, globalUploadAttrs, globalCompoAttr);
|
|
23
|
+
// console.log('---lastCompAttrs---', this.componentName, lastCompAttrs, this.$props, this.$attrs);
|
|
24
|
+
return Object.assign(
|
|
25
|
+
{},
|
|
26
|
+
lastCompAttrs,
|
|
27
|
+
// this.$props,
|
|
28
|
+
this.$attrs
|
|
29
|
+
// { disabled: this.disabled || this.$attrs.disabled },
|
|
30
|
+
// { readonly: this.readonly || this.$attrs.readonly }
|
|
31
|
+
);
|
|
32
|
+
console.log(globalAttrs);
|
|
33
|
+
console.log(globalCompoAttr);
|
|
34
|
+
return 'NQWBZ-VG6KO-YUDWV-SCAPV-MFRYH-QJB7S';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
package/src/utils/copy.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { ExtendMessage } from '../extend-ui';
|
|
2
2
|
export function commonCopy(data) {
|
|
3
3
|
const needContent = data;
|
|
4
|
-
const oInput = document.createElement('textarea');
|
|
5
|
-
oInput.value = needContent;
|
|
6
|
-
// oInput.setAttribute('value', needContent);
|
|
7
|
-
document.body.appendChild(oInput);
|
|
8
|
-
oInput.select(); // 选择对象;
|
|
9
|
-
// console.log(oInput.value)
|
|
10
|
-
document.execCommand('Copy'); // 执行浏览器复制命令
|
|
11
|
-
ExtendMessage({
|
|
12
|
-
message: '复制成功',
|
|
13
|
-
type: 'success'
|
|
14
|
-
});
|
|
15
|
-
oInput.remove();
|
|
16
4
|
try {
|
|
5
|
+
const oInput = document.createElement('textarea');
|
|
6
|
+
oInput.value = needContent;
|
|
7
|
+
// oInput.setAttribute('value', needContent);
|
|
8
|
+
document.body.appendChild(oInput);
|
|
9
|
+
oInput.select(); // 选择对象;
|
|
10
|
+
// console.log(oInput.value)
|
|
17
11
|
document.execCommand('Copy'); // 执行浏览器复制命令
|
|
12
|
+
oInput.remove();
|
|
13
|
+
document.body.removeChild(oInput);
|
|
18
14
|
} catch (error) {
|
|
19
15
|
// 复制文本到剪贴板
|
|
20
16
|
navigator.clipboard
|
|
@@ -26,10 +22,8 @@ export function commonCopy(data) {
|
|
|
26
22
|
console.error('复制失败:', err);
|
|
27
23
|
});
|
|
28
24
|
}
|
|
29
|
-
|
|
25
|
+
ExtendMessage({
|
|
30
26
|
message: '复制成功',
|
|
31
27
|
type: 'success'
|
|
32
28
|
});
|
|
33
|
-
oInput.remove();
|
|
34
|
-
document.body.removeChild(oInput);
|
|
35
29
|
}
|