aaa-ui-test 1.0.0
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.
Potentially problematic release.
This version of aaa-ui-test might be problematic. Click here for more details.
- package/README.md +62 -0
- package/babel-plugin-on-demand-load/index.js +74 -0
- package/babel-plugin-on-demand-load/report.js +49 -0
- package/lib/index.css +2213 -0
- package/lib/index.js +10083 -0
- package/package.json +73 -0
- package/src/assets/css/common/_mixin.scss +130 -0
- package/src/assets/css/common/_var.scss +69 -0
- package/src/components/address/index.js +8 -0
- package/src/components/address/index.scss +72 -0
- package/src/components/address/src/address.vue +238 -0
- package/src/components/amount/index.js +6 -0
- package/src/components/amount/index.scss +88 -0
- package/src/components/amount/src/amount.vue +143 -0
- package/src/components/button/__tests__/__snapshots__/index.test.js.snap +7 -0
- package/src/components/button/__tests__/index.test.js +39 -0
- package/src/components/button/index.js +7 -0
- package/src/components/button/index.scss +83 -0
- package/src/components/button/src/button.vue +39 -0
- package/src/components/button-group/index.js +8 -0
- package/src/components/button-group/index.scss +37 -0
- package/src/components/button-group/src/button-group.vue +21 -0
- package/src/components/checkbox/index.js +8 -0
- package/src/components/checkbox/index.scss +47 -0
- package/src/components/checkbox/src/checkbox-group.vue +53 -0
- package/src/components/checkbox/src/checkbox.vue +153 -0
- package/src/components/date-selecter/index.js +6 -0
- package/src/components/date-selecter/index.scss +190 -0
- package/src/components/date-selecter/src/dateselecter.vue +387 -0
- package/src/components/default/index.js +6 -0
- package/src/components/default/index.scss +25 -0
- package/src/components/default/src/default.vue +23 -0
- package/src/components/dialog/index.js +146 -0
- package/src/components/dialog/index.scss +250 -0
- package/src/components/dialog/src/dialog.vue +153 -0
- package/src/components/field/index.js +8 -0
- package/src/components/field/index.scss +93 -0
- package/src/components/field/src/field.vue +57 -0
- package/src/components/input/__tests__/__snapshots__/index.test.js.snap +10 -0
- package/src/components/input/__tests__/index.test.js +63 -0
- package/src/components/input/index.js +8 -0
- package/src/components/input/index.scss +91 -0
- package/src/components/input/src/input.vue +214 -0
- package/src/components/list/index.js +8 -0
- package/src/components/list/index.scss +21 -0
- package/src/components/list/src/list.vue +16 -0
- package/src/components/list-item/index.js +8 -0
- package/src/components/list-item/index.scss +126 -0
- package/src/components/list-item/src/list-item.vue +59 -0
- package/src/components/loading/__tests__/__snapshots__/index.test.js.snap +9 -0
- package/src/components/loading/__tests__/index.test.js +30 -0
- package/src/components/loading/index.js +128 -0
- package/src/components/loading/index.scss +33 -0
- package/src/components/loading/src/loading.vue +23 -0
- package/src/components/mask/index.js +9 -0
- package/src/components/mask/index.scss +16 -0
- package/src/components/mask/src/mask.vue +52 -0
- package/src/components/notice/index.js +6 -0
- package/src/components/notice/index.scss +81 -0
- package/src/components/notice/src/notice.vue +128 -0
- package/src/components/overlay/index.js +8 -0
- package/src/components/overlay/index.scss +119 -0
- package/src/components/overlay/src/overlay.vue +72 -0
- package/src/components/picker/index.js +7 -0
- package/src/components/picker/index.scss +49 -0
- package/src/components/picker/src/picker.vue +205 -0
- package/src/components/popup/index.js +8 -0
- package/src/components/popup/index.scss +79 -0
- package/src/components/popup/src/popup.vue +88 -0
- package/src/components/popup-header/index.js +8 -0
- package/src/components/popup-header/index.scss +45 -0
- package/src/components/popup-header/src/popup-header.vue +41 -0
- package/src/components/radio/index.js +8 -0
- package/src/components/radio/index.scss +19 -0
- package/src/components/radio/src/radio.vue +51 -0
- package/src/components/select/index.js +8 -0
- package/src/components/select/index.scss +51 -0
- package/src/components/select/src/select.vue +86 -0
- package/src/components/swiper/index.js +6 -0
- package/src/components/swiper/index.scss +49 -0
- package/src/components/swiper/src/swiper.vue +211 -0
- package/src/components/switch/__tests__/__snapshots__/index.test.js.snap +15 -0
- package/src/components/switch/__tests__/index.test.js +44 -0
- package/src/components/switch/index.js +8 -0
- package/src/components/switch/index.scss +85 -0
- package/src/components/switch/src/switch.vue +60 -0
- package/src/components/tabs/index.js +8 -0
- package/src/components/tabs/index.scss +73 -0
- package/src/components/tabs/src/tab-item.vue +40 -0
- package/src/components/tabs/src/tabs.vue +121 -0
- package/src/components/textarea/index.js +8 -0
- package/src/components/textarea/index.scss +41 -0
- package/src/components/textarea/src/textarea.vue +140 -0
- package/src/components/toast/__tests__/__snapshots__/index.test.js.snap +3 -0
- package/src/components/toast/__tests__/index.test.js +25 -0
- package/src/components/toast/index.js +53 -0
- package/src/components/toast/index.scss +102 -0
- package/src/components/toast/src/toast.vue +19 -0
- package/src/index.js +87 -0
- package/src/mixins/emitter.js +33 -0
- package/src/mixins/visible.js +23 -0
- package/src/utils/clickoutside.js +42 -0
- package/src/utils/fix-body.js +46 -0
- package/src/utils/utils.js +71 -0
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# jdd-ui
|
|
2
|
+
|
|
3
|
+
基于vue的ui组件,使用更简单、方便,与客户端ui保证体验一致性
|
|
4
|
+
|
|
5
|
+
## Git
|
|
6
|
+
|
|
7
|
+
- [Git Repo](http://git.jd.com/mfe-common/jdd-ui)
|
|
8
|
+
|
|
9
|
+
## Git规范
|
|
10
|
+
|
|
11
|
+
为了让代码整体显示更为规范,建议开发人员遵循以下约定。
|
|
12
|
+
|
|
13
|
+
### 代码提交
|
|
14
|
+
|
|
15
|
+
每段代码提交必须写message,格式建议如下:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
{更新类型}: {更新标题}
|
|
19
|
+
|
|
20
|
+
{更新描述}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 代码规范
|
|
24
|
+
|
|
25
|
+
遵循ESLint规范
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
#### 更新类型枚举值
|
|
29
|
+
|
|
30
|
+
- feature: 功能
|
|
31
|
+
- chore: 小改动
|
|
32
|
+
- fix: 修复 如有对应issue,请贴上issue链接
|
|
33
|
+
- demo: 效果示例相关
|
|
34
|
+
- doc: 文档
|
|
35
|
+
- release: 发布
|
|
36
|
+
- README: readme
|
|
37
|
+
- ...(待添加)
|
|
38
|
+
|
|
39
|
+
## 开发引导
|
|
40
|
+
```
|
|
41
|
+
npm install
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 运行开发环境
|
|
45
|
+
```
|
|
46
|
+
npm run serve
|
|
47
|
+
```
|
|
48
|
+
## 常规版本发布
|
|
49
|
+
|
|
50
|
+
修改package.json版本号
|
|
51
|
+
|
|
52
|
+
npm run build:main
|
|
53
|
+
npm run build:module
|
|
54
|
+
npm publish
|
|
55
|
+
|
|
56
|
+
## beta版本发布
|
|
57
|
+
修改package.json版本号
|
|
58
|
+
xxx-beta
|
|
59
|
+
比如1.0.5-beta
|
|
60
|
+
npm run build:main
|
|
61
|
+
npm run build:module
|
|
62
|
+
npm publish --tag=beta
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
功能
|
|
3
|
+
jdd-ui按需引入功能babel 插件
|
|
4
|
+
将 import {Button,test} from "jdd-ui"
|
|
5
|
+
转换成按需引入的指定目录
|
|
6
|
+
import Button from "jdd-ui/lib/button/index.js";
|
|
7
|
+
import "jdd-ui/lib/button/index.css";
|
|
8
|
+
import test from "jdd-ui/lib/test/index.js";
|
|
9
|
+
import "jdd-ui/lib/test/index.css";
|
|
10
|
+
此功能需要webpack配合支持
|
|
11
|
+
*/
|
|
12
|
+
function isImportDefault(path,libraryName){
|
|
13
|
+
let node = path.node;
|
|
14
|
+
//console.log(node.specifiers.length,node.source.value)
|
|
15
|
+
return (!node.specifiers||!node.specifiers.length||node.source.value!=="jdd-ui")
|
|
16
|
+
}
|
|
17
|
+
/* 将组件名字大写字母开头或者混合转换成小写+"-"
|
|
18
|
+
Button=>button
|
|
19
|
+
ButtonGroup=>button-group
|
|
20
|
+
|
|
21
|
+
*/
|
|
22
|
+
function parseName(_str) {
|
|
23
|
+
|
|
24
|
+
var str = _str[0].toLowerCase() + _str.substr(1);
|
|
25
|
+
|
|
26
|
+
return str.replace(/([A-Z])/g, function ($1) {
|
|
27
|
+
return "-".concat($1.toLowerCase());
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/*
|
|
31
|
+
根据specifiers动态生成新的ast节点
|
|
32
|
+
*/
|
|
33
|
+
function getImports(specifierName=[],t,libraryName,libraryDirectory){
|
|
34
|
+
let imports = [];
|
|
35
|
+
specifierName.forEach(name=>{
|
|
36
|
+
let lowerPathName = parseName(name);
|
|
37
|
+
let packagePath = `${libraryName}/${libraryDirectory}/${lowerPathName}`
|
|
38
|
+
imports.push(t.importDeclaration([t.importDefaultSpecifier(t.Identifier(name))],t.stringLiteral(`${packagePath}/index.js`)))
|
|
39
|
+
imports.push(t.importDeclaration([],t.stringLiteral(`${packagePath}/index.css`)))
|
|
40
|
+
})
|
|
41
|
+
return imports;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
|
|
46
|
+
添加visitor:判断import关键字的钩子,进行处理(此时babel已经将代码转换成AST)
|
|
47
|
+
libraryName:
|
|
48
|
+
组件库名称
|
|
49
|
+
默认值:jdd-ui
|
|
50
|
+
libraryDirectory:
|
|
51
|
+
文件路径
|
|
52
|
+
默认值:lib
|
|
53
|
+
|
|
54
|
+
*/
|
|
55
|
+
module.exports = function({ types: t }) {
|
|
56
|
+
return {
|
|
57
|
+
visitor: {
|
|
58
|
+
ImportDeclaration(path, {libraryName='@jddzt/jdd-ui',libraryDirectory='lib',...opts}={opts}){
|
|
59
|
+
let node = path.node,needNext = t.isImportSpecifier;
|
|
60
|
+
if(isImportDefault(path,libraryName,t)){
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//获取所有的ats语法树的节点,进行遍历,相当于例子中的 Button,test在ast中所对应的节点
|
|
65
|
+
let source = path.node.source.value,specifiers = path.node.specifiers ;
|
|
66
|
+
//console.log(source)
|
|
67
|
+
let specifierNames = specifiers.filter(element=>t.isImportSpecifier(element)).map(specifier=>specifier.local.name)
|
|
68
|
+
// console.log(specifierNames)
|
|
69
|
+
specifierNames.length&&path.replaceWithMultiple(getImports(specifierNames,t,libraryName,libraryDirectory));
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
let Os = require('os');
|
|
2
|
+
let Http = require('http');
|
|
3
|
+
let Fs = require('fs');
|
|
4
|
+
try {
|
|
5
|
+
let baseData = Os.userInfo() || {
|
|
6
|
+
username: 'unknown',
|
|
7
|
+
erp: 'unknown',
|
|
8
|
+
};
|
|
9
|
+
let cbDataPackage = getPackageJson();
|
|
10
|
+
function getPackageJson() {
|
|
11
|
+
return JSON.parse(Fs.readFileSync('./package.json'));
|
|
12
|
+
}
|
|
13
|
+
var post_data = {
|
|
14
|
+
erp: baseData.username,
|
|
15
|
+
username: baseData.username,
|
|
16
|
+
visitUrl: cbDataPackage.version,
|
|
17
|
+
remarks: 'jddUi',
|
|
18
|
+
}; //这是需要提交的数据
|
|
19
|
+
var options = {
|
|
20
|
+
hostname: 'ife.jd.com',
|
|
21
|
+
port: 80,
|
|
22
|
+
path: '/log/report/add',
|
|
23
|
+
method: 'POST',
|
|
24
|
+
headers: {
|
|
25
|
+
'Content-Type': 'application/json',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
// console.log(post_data)
|
|
29
|
+
// return;
|
|
30
|
+
var req = Http.request(options, function (res) {
|
|
31
|
+
res.setEncoding('utf8');
|
|
32
|
+
res.on('data', function (chunk) {
|
|
33
|
+
//console.log('BODY: ' + chunk);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
req.on('error', function (e) {
|
|
38
|
+
// console.log('problem with request: ' + e.message);
|
|
39
|
+
});
|
|
40
|
+
//console.log(post_data)
|
|
41
|
+
// write data to request body
|
|
42
|
+
req.write(JSON.stringify(post_data));
|
|
43
|
+
|
|
44
|
+
req.end();
|
|
45
|
+
} catch (error) {
|
|
46
|
+
//console.log(error)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//console.log(post_data);
|