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
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import Dialog from './src/dialog.vue';
|
|
3
|
+
import { Type } from '@/utils/utils';
|
|
4
|
+
|
|
5
|
+
import "./index.scss";
|
|
6
|
+
|
|
7
|
+
/* 注册 */
|
|
8
|
+
//Dialog.install = function(Vue) {
|
|
9
|
+
// Vue.component(Dialog.name, Dialog)
|
|
10
|
+
// 创建组件构造器
|
|
11
|
+
Dialog.install = function(Vue) {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
const dialogObj = Vue.extend(Dialog)
|
|
15
|
+
|
|
16
|
+
Dialog.$confirm = Dialog.$alert = Vue.prototype.$confirm = Vue.prototype.$alert = function install (options) {
|
|
17
|
+
let alertComponent;
|
|
18
|
+
//debugger
|
|
19
|
+
let existDom = document.getElementById('jdd-dialog-box');
|
|
20
|
+
if(existDom) {
|
|
21
|
+
document.body.removeChild(existDom)
|
|
22
|
+
}
|
|
23
|
+
alertComponent = new dialogObj({el: document.createElement('div')})
|
|
24
|
+
let { dialogType, title, content, unClickBg, okShowStage, okBtnTxt, okBtnClass, okCbFun, cancelShowStage, cancelBtnTxt, cancelBtnClass, cancelCbFun, btns } = options
|
|
25
|
+
/* dialog类型 alert (默认)、confirm、vertical*/
|
|
26
|
+
if(dialogType) {
|
|
27
|
+
alertComponent.dialogType = dialogType
|
|
28
|
+
/* 如果是confirm、vertical非自定义按钮回填初始化值 */
|
|
29
|
+
if(dialogType !== 'alert' && !btns) {
|
|
30
|
+
if(dialogType==='confirm'){
|
|
31
|
+
alertComponent.btns.unshift({
|
|
32
|
+
btnClass: 'jdd-cancel-btn',
|
|
33
|
+
showStage: false,
|
|
34
|
+
type: 'cancel',
|
|
35
|
+
text: '取消'
|
|
36
|
+
})
|
|
37
|
+
}else{
|
|
38
|
+
alertComponent.btns.push({
|
|
39
|
+
btnClass: 'jdd-cancel-btn',
|
|
40
|
+
showStage: false,
|
|
41
|
+
type: 'cancel',
|
|
42
|
+
text: '取消'
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/* 标题 */
|
|
48
|
+
if(title) {
|
|
49
|
+
alertComponent.title = title
|
|
50
|
+
}
|
|
51
|
+
/* 内容 */
|
|
52
|
+
if(content) {
|
|
53
|
+
alertComponent.content = content
|
|
54
|
+
}
|
|
55
|
+
/* 是否开启背景点击 */
|
|
56
|
+
if(Type.isBoolean(unClickBg) && !unClickBg) {
|
|
57
|
+
alertComponent.unClickBg = unClickBg
|
|
58
|
+
}
|
|
59
|
+
/* 按钮单独配置 */
|
|
60
|
+
if(!btns) {
|
|
61
|
+
//for (const item of alertComponent.btns) {
|
|
62
|
+
alertComponent.btns.forEach(item => {
|
|
63
|
+
let { type } = item
|
|
64
|
+
if(type && type === 'ok') {
|
|
65
|
+
if(okCbFun && Type.isFunction(okCbFun)) {
|
|
66
|
+
item.cbFun = okCbFun
|
|
67
|
+
}
|
|
68
|
+
if(okBtnTxt){
|
|
69
|
+
item.text = String(okBtnTxt)
|
|
70
|
+
}
|
|
71
|
+
if(okShowStage) {
|
|
72
|
+
item.showStage = okShowStage
|
|
73
|
+
}
|
|
74
|
+
if(okBtnClass) {
|
|
75
|
+
item.btnClass = okBtnClass
|
|
76
|
+
}
|
|
77
|
+
} else if (type && type === 'cancel') {
|
|
78
|
+
if(cancelCbFun && Type.isFunction(cancelCbFun)) {
|
|
79
|
+
item.cbFun = cancelCbFun
|
|
80
|
+
}
|
|
81
|
+
if(cancelBtnTxt){
|
|
82
|
+
item.text = String(cancelBtnTxt)
|
|
83
|
+
}
|
|
84
|
+
if(cancelShowStage) {
|
|
85
|
+
item.showStage = cancelShowStage
|
|
86
|
+
}
|
|
87
|
+
if(cancelBtnClass) {
|
|
88
|
+
item.btnClass = cancelBtnClass
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
// console.warn('item', item)
|
|
93
|
+
|
|
94
|
+
//}
|
|
95
|
+
}
|
|
96
|
+
/* 自定义按钮配置 */
|
|
97
|
+
if(dialogType === 'vertical' && btns && btns.length > 2 && btns.length <= 4 ) {
|
|
98
|
+
alertComponent.btns = btns;
|
|
99
|
+
}
|
|
100
|
+
Dialog.$close = Vue.prototype.$close = function (){
|
|
101
|
+
alertComponent._clearWin();
|
|
102
|
+
}
|
|
103
|
+
// 回调函数
|
|
104
|
+
alertComponent.callback = function(action={}) {
|
|
105
|
+
if (action.cbFun) {
|
|
106
|
+
action.cbFun();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
// 把alertHonor.vue加入body中
|
|
110
|
+
// console.warn('alertComponent', alertComponent.$el)
|
|
111
|
+
document.body.appendChild(alertComponent.$el)
|
|
112
|
+
return alertComponent
|
|
113
|
+
}
|
|
114
|
+
Dialog.$activity =Vue.prototype.$activity = function(options) {
|
|
115
|
+
let alertComponentAc = {};
|
|
116
|
+
let {imgSrc,backgroundColor,okCbFun} = options;
|
|
117
|
+
let existDom = document.getElementById('jdd-dialog-box');
|
|
118
|
+
if(existDom) {
|
|
119
|
+
document.body.removeChild(existDom)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
alertComponentAc = new dialogObj({el: document.createElement('div'),data: function () {
|
|
123
|
+
return {
|
|
124
|
+
activity: true,
|
|
125
|
+
imgSrc:imgSrc,
|
|
126
|
+
backgroundColor:backgroundColor,
|
|
127
|
+
okCbFun:okCbFun
|
|
128
|
+
}
|
|
129
|
+
}})
|
|
130
|
+
|
|
131
|
+
Dialog.$close = Vue.prototype.$close = function (){
|
|
132
|
+
alertComponentAc._clearWin();
|
|
133
|
+
}
|
|
134
|
+
// 回调函数
|
|
135
|
+
alertComponentAc.callback = function(action={}) {
|
|
136
|
+
okCbFun()
|
|
137
|
+
};
|
|
138
|
+
// 把alertHonor.vue加入body中
|
|
139
|
+
// console.warn('alertComponent', alertComponent.$el)
|
|
140
|
+
document.body.appendChild(alertComponentAc.$el)
|
|
141
|
+
return alertComponentAc;
|
|
142
|
+
}
|
|
143
|
+
//}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
export default Dialog;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
@charset "utf-8";
|
|
2
|
+
@import "~@/assets/css/common/var";
|
|
3
|
+
@import "~@/assets/css/common/mixin";
|
|
4
|
+
|
|
5
|
+
.hide {
|
|
6
|
+
display: none
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.jdd-dialog-box {
|
|
10
|
+
position: fixed;
|
|
11
|
+
z-index: 1002;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
.jdd-dialog-box .jdd-dialog-activity{
|
|
21
|
+
background: transparent;
|
|
22
|
+
overflow: unset;
|
|
23
|
+
width: 290px;
|
|
24
|
+
}
|
|
25
|
+
.jdd-dialog-activity-close {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: -35px;
|
|
28
|
+
right: 0px;
|
|
29
|
+
display: inline-block;
|
|
30
|
+
width: 25px;
|
|
31
|
+
height: 25px;
|
|
32
|
+
border-radius: 25px;
|
|
33
|
+
background-color: #000;
|
|
34
|
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABYCAYAAABxlTA0AAAAAXNSR0IArs4c6QAAAu9JREFUeAHt2r+LE0EUwPHLXqWlRQohhYWFIASSf+C82s5CQWut7QX9F+xTKni9licWlvlhQBRsUxmuucoiv3wPMse47ia3k7mdF+67EHay2X0788nL290hBwcsCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAALGBMbj8f3YXZKYdyaTyY3YcavGy6oeEHv/wWDwZjabfRsOh09ixR6NRnfn8/nX6XT6MTVyI9agQuIo7mq1er0+dpFl2bNOp/MhJJY7RnGXy+UXiXtbtzUajc/NZvNhq9X64/apc50sg7UsCMIrb7CHAvNul0zO42psOcexZPIL7zy1NpMBt9vt75qxMtqFN+Jg5CLcddye/CreeueotZm0ROhINWM1c6V56I28UrnYhNvtdp9LmVh5sWttJgfW0e6CbBlXx2YCOBTZOq4p4KrI+4BrDviyyPuCaxJ4G7JcsAb+fa7uv156qS9oriP+2kwN9jul7Q0XvnMBvpXb3ySu9tEssHauBFk/8hezuNpJ08DawS3IpnG1/8me5PTkl1m05soT33l+X9m+lO2nKR8i8n0qem8a2N0tFNRcnWPI9AlQM7xoYFa2mQV2uG5WzIFp5rq2rIPnLrwYV9o0CVyGKxI9AX4q6/8miGTq8/GVSgUGNwe8CVfvc3W+uGgWTjL9vUVkU3cR23D9C1rJ3cVCM1y+iJPAhIt+mBngKrhOYR+QTZSIEFxF1nJRVJMtlYvkGRyK67JY11p7FVWa/0zaWygXSYFj4Dpoq8jJSoT+byHmrJhe2MrKhdTqR+6LqHudDFj+C/Fbfta/cgPeaW6hBPlMzvMjd57a3iYtEf1+/6aM9JO8juS1E64cf7F45eJMsvqBwP+8+PC6NRRZQF5KlkX9srUsSNx7182T8SKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAK2Bf4CoKj4d3I8GvAAAAAASUVORK5CYII=);
|
|
35
|
+
background-size: 100% auto;
|
|
36
|
+
}
|
|
37
|
+
.jdd-dialog-activity-inner {
|
|
38
|
+
min-height: 250px;
|
|
39
|
+
max-height: 400px;
|
|
40
|
+
border-radius: 8px;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
width: 290px;
|
|
43
|
+
background: transparent;
|
|
44
|
+
}
|
|
45
|
+
.jdd-dialog {
|
|
46
|
+
position: relative;
|
|
47
|
+
z-index: 1001;
|
|
48
|
+
width: 280px;
|
|
49
|
+
background-color: #fff;
|
|
50
|
+
border-radius: 8px;
|
|
51
|
+
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
|
52
|
+
-webkit-user-select: none;
|
|
53
|
+
-webkit-user-drag: none;
|
|
54
|
+
overflow: hidden
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.jdd-dialog-inner {
|
|
58
|
+
padding: 24px 0 22px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// .jdd-dialog-title {
|
|
62
|
+
// position: relative;
|
|
63
|
+
// padding: .78125rem 0;
|
|
64
|
+
// font-family: 'PingFangSC-Medium';
|
|
65
|
+
// font-size: 1.0625rem;
|
|
66
|
+
// line-height: 1.875rem;
|
|
67
|
+
// color: #333;
|
|
68
|
+
// text-align: center;
|
|
69
|
+
// .jdd-text-left {
|
|
70
|
+
// text-align: left;
|
|
71
|
+
// }
|
|
72
|
+
// }
|
|
73
|
+
.jdd-dialog-inner,
|
|
74
|
+
.jdd-dialog-content {
|
|
75
|
+
h2 {
|
|
76
|
+
font-family: 'PingFangSC-Medium';
|
|
77
|
+
font-size: 18px;
|
|
78
|
+
color: #333;
|
|
79
|
+
line-height: 29px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
padding: 0 24px;
|
|
82
|
+
font-weight: normal
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&>img+h2 {
|
|
86
|
+
padding-top: 12px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.jdd-dialog-content {
|
|
91
|
+
line-height: 24px;
|
|
92
|
+
font-size: 17px;
|
|
93
|
+
color: #666;
|
|
94
|
+
max-height: 60vh;
|
|
95
|
+
overflow: auto;
|
|
96
|
+
&.dialogContent {
|
|
97
|
+
font-family: inherit;
|
|
98
|
+
// font-size: .0875rem;
|
|
99
|
+
text-align: justify;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
h3 {
|
|
103
|
+
font-size: 14px;
|
|
104
|
+
color: #444;
|
|
105
|
+
line-height: 22px;
|
|
106
|
+
padding: 12px 24px 0;
|
|
107
|
+
font-weight: 700;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
p {
|
|
111
|
+
font-size: 14px;
|
|
112
|
+
color: #666;
|
|
113
|
+
line-height: 22px;
|
|
114
|
+
padding: 12px 24px 0;
|
|
115
|
+
text-align: justify;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.contentScroll {
|
|
119
|
+
// padding: 1.5rem 0;
|
|
120
|
+
max-height: 280px;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
overflow-y: auto;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
img {
|
|
126
|
+
width: 100%;
|
|
127
|
+
display: block;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.jdd-dialog-btns {
|
|
132
|
+
position: relative;
|
|
133
|
+
table-layout: fixed;
|
|
134
|
+
display: table;
|
|
135
|
+
border-collapse: collapse;
|
|
136
|
+
width: 100%;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.jdd-border-top {
|
|
141
|
+
@include jdd-border-top($borderColor)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.jdd-btn {
|
|
145
|
+
position: relative;
|
|
146
|
+
|
|
147
|
+
&:active {
|
|
148
|
+
background: #f2f2f2;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.jdd-default-btns {
|
|
153
|
+
.jdd-btn {
|
|
154
|
+
&+.jdd-btn {
|
|
155
|
+
@include jdd-border-left($borderColor)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.jdd-vertical-btns {
|
|
161
|
+
display: block;
|
|
162
|
+
|
|
163
|
+
.jdd-btn {
|
|
164
|
+
display: block;
|
|
165
|
+
|
|
166
|
+
&+.jdd-btn {
|
|
167
|
+
@include jdd-border-top($borderColor)
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.jdd-btn {
|
|
173
|
+
display: table-cell;
|
|
174
|
+
width: 100%;
|
|
175
|
+
font-family: 'PingFangSC-Medium';
|
|
176
|
+
font-size: 18px;
|
|
177
|
+
height: 50px;
|
|
178
|
+
line-height: 50px;
|
|
179
|
+
text-align: center;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.jdd-primary-btn {
|
|
183
|
+
color: #4D7BFE;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.jdd-cancel-btn {
|
|
187
|
+
color: #666;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.jdd-alert-btn {
|
|
191
|
+
color: #FC3438;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.jdd-btn {
|
|
195
|
+
&.jdd-disable {
|
|
196
|
+
color: #aaa;
|
|
197
|
+
background: inherit;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@media only screen and (min-device-width:414px) and (-webkit-min-device-pixel-ratio:3) {
|
|
202
|
+
.jdd-dialog {
|
|
203
|
+
width: 308px;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
@keyframes jdd-dialogIn {
|
|
209
|
+
0% {
|
|
210
|
+
opacity: 0;
|
|
211
|
+
transform: scale(0.9)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
50% {
|
|
215
|
+
opacity: 1;
|
|
216
|
+
transform: scale(1.1)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
100% {
|
|
220
|
+
transform: scale(1)
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
@keyframes jdd-dialogOut {
|
|
225
|
+
0% {
|
|
226
|
+
transform: scale(1) translate3d(0, 0, 0);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
100% {
|
|
230
|
+
opacity: 0;
|
|
231
|
+
transform: translate3d(0, 100%, 0) scale(0.815);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.fade-dialog-enter-active {
|
|
237
|
+
animation-delay: .3s;
|
|
238
|
+
|
|
239
|
+
.jdd-dialog {
|
|
240
|
+
animation: jdd-dialogIn .3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
241
|
+
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.fade-dialog-leave-active {
|
|
246
|
+
animation-delay: .3s;
|
|
247
|
+
.jdd-dialog {
|
|
248
|
+
animation: jdd-dialogOut .3s ease-in both;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<transition name="fade-dialog" appear>
|
|
3
|
+
<div id="jdd-dialog-box" class="jdd-dialog-box" v-if="showAlert">
|
|
4
|
+
<jdd-mask v-model="showAlert" @onClick="shadowBoxClick" :background-color="backgroundColor"></jdd-mask>
|
|
5
|
+
<!-- <transition name="fade-dialog" appear> -->
|
|
6
|
+
<div class="jdd-dialog" v-if="!activity">
|
|
7
|
+
<div class="iconClose" :class="iconCloseClass" @click="iconClose" v-if="iconClosePro"></div>
|
|
8
|
+
<div class="jdd-dialog-inner">
|
|
9
|
+
<h2 v-if="title" v-text="title"></h2>
|
|
10
|
+
<div class="jdd-dialog-content" :class="contentClass" v-html="content" v-if="content"></div>
|
|
11
|
+
</div>
|
|
12
|
+
<div
|
|
13
|
+
class="jdd-dialog-btns jdd-border-top"
|
|
14
|
+
:class="(dialogType === 'vertical') ? 'jdd-vertical-btns':'jdd-default-btns'"
|
|
15
|
+
>
|
|
16
|
+
<div
|
|
17
|
+
class="jdd-btn"
|
|
18
|
+
v-for="btn in btns"
|
|
19
|
+
:class="btn.btnClass ? btn.btnClass : 'jdd-cancel-btn'"
|
|
20
|
+
:key="btn.id"
|
|
21
|
+
@click="btnsArg(btn)"
|
|
22
|
+
>{{btn.text}}</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div v-else class="jdd-dialog jdd-dialog-activity">
|
|
26
|
+
<span class="jdd-dialog-activity-close" @click="_clearWin"></span>
|
|
27
|
+
<div class="jdd-dialog-activity-inner" @click="activeJump">
|
|
28
|
+
<img :src="imgSrc" alt />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<!-- </transition> -->
|
|
32
|
+
<!-- <transition name="fade-bg" appear> -->
|
|
33
|
+
|
|
34
|
+
<!-- </transition> -->
|
|
35
|
+
</div>
|
|
36
|
+
</transition>
|
|
37
|
+
</template>
|
|
38
|
+
<script>
|
|
39
|
+
import JddMask from "../../mask";
|
|
40
|
+
|
|
41
|
+
let setTO = "";
|
|
42
|
+
export default {
|
|
43
|
+
name: "JddDialog",
|
|
44
|
+
props: {
|
|
45
|
+
unClickBg: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
/* dialog */
|
|
50
|
+
dialogType: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: "alert"
|
|
53
|
+
},
|
|
54
|
+
title: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ""
|
|
57
|
+
},
|
|
58
|
+
content: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: ""
|
|
61
|
+
},
|
|
62
|
+
iconCloseClass: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: "hide"
|
|
65
|
+
},
|
|
66
|
+
iconClosePro: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
callback: {
|
|
71
|
+
type: Function
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
data() {
|
|
75
|
+
/* dialog 模版参数说明
|
|
76
|
+
* showAlert: Boolean | 是否展示dialog模版弹窗判断
|
|
77
|
+
* dialogType: String | alert、confirm、vertical
|
|
78
|
+
* title: String | dialog时,标题
|
|
79
|
+
* content: String | 内容文字
|
|
80
|
+
* callback: Function | 公共回调方法
|
|
81
|
+
* btns: Array | 可自定义
|
|
82
|
+
* btnClass: String | jdd-ok-btn
|
|
83
|
+
showStage: Boolean | default false, true时不关闭弹窗
|
|
84
|
+
type: String | confirm、cancel
|
|
85
|
+
text: String | 按钮文案
|
|
86
|
+
*/
|
|
87
|
+
return {
|
|
88
|
+
showAlert: true,
|
|
89
|
+
activity: false,
|
|
90
|
+
btns: [
|
|
91
|
+
{
|
|
92
|
+
btnClass: "jdd-primary-btn",
|
|
93
|
+
showStage: false,
|
|
94
|
+
type: "ok",
|
|
95
|
+
text: "确定"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
computed: {
|
|
101
|
+
contentClass() {
|
|
102
|
+
/* 计算回填类名 */
|
|
103
|
+
return [this.dialogType !== "alert" ? "dialogContent" : ""];
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
methods: {
|
|
107
|
+
// _timeout: function(ms){
|
|
108
|
+
// return new Promise((resolve, reject) => {
|
|
109
|
+
// if(setTO) clearTimeout(setTO)
|
|
110
|
+
// if(typeof ms === 'number') {
|
|
111
|
+
// setTO = setTimeout(resolve, ms, 'done')
|
|
112
|
+
// } else {
|
|
113
|
+
// reject('no Number');
|
|
114
|
+
// }
|
|
115
|
+
// })
|
|
116
|
+
// },
|
|
117
|
+
_removeSelfDom: function(showStage) {
|
|
118
|
+
!showStage && this._clearWin();
|
|
119
|
+
},
|
|
120
|
+
//关闭整个窗口
|
|
121
|
+
_clearWin() {
|
|
122
|
+
//if(setTO) clearTimeout(setTO)
|
|
123
|
+
this.showAlert = false;
|
|
124
|
+
},
|
|
125
|
+
activeJump() {
|
|
126
|
+
this.callback(this.btns);
|
|
127
|
+
},
|
|
128
|
+
btnsArg: function(keys) {
|
|
129
|
+
if (keys.showStage) {
|
|
130
|
+
this._removeSelfDom(true);
|
|
131
|
+
} else {
|
|
132
|
+
this._removeSelfDom();
|
|
133
|
+
}
|
|
134
|
+
this.handleActions(keys);
|
|
135
|
+
},
|
|
136
|
+
shadowBoxClick() {
|
|
137
|
+
//点击其他区域
|
|
138
|
+
if (this.unClickBg) return;
|
|
139
|
+
this._removeSelfDom();
|
|
140
|
+
},
|
|
141
|
+
iconClose() {
|
|
142
|
+
//点击关闭图标
|
|
143
|
+
this._removeSelfDom();
|
|
144
|
+
},
|
|
145
|
+
handleActions(action) {
|
|
146
|
+
this.callback(action);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
components: {
|
|
150
|
+
JddMask
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
</script>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
@charset "utf-8";
|
|
2
|
+
@import "~@/assets/css/common/_mixin";
|
|
3
|
+
|
|
4
|
+
.jdd-field {
|
|
5
|
+
display: flex;
|
|
6
|
+
background-color: #fff;
|
|
7
|
+
padding: 0 16px;
|
|
8
|
+
min-height: 72px;
|
|
9
|
+
position: relative;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
|
|
12
|
+
.jdd-field-label {
|
|
13
|
+
transition: all 0.1s ease-in-out;
|
|
14
|
+
font-family: PingFangSC-Regular;
|
|
15
|
+
font-size: 18px;
|
|
16
|
+
color: #999999;
|
|
17
|
+
letter-spacing: 0;
|
|
18
|
+
padding-top: 24px;
|
|
19
|
+
line-height: 25px;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: auto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.jdd-field.jdd-field-focus {
|
|
26
|
+
.jdd-field-label {
|
|
27
|
+
padding-top: 12px;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
margin-bottom: 4px;
|
|
30
|
+
line-height: 20px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.jdd-field-row {
|
|
35
|
+
flex-direction: row;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.jdd-field-label {
|
|
39
|
+
font-family: PingFangSC-Regular;
|
|
40
|
+
font-size: 16px;
|
|
41
|
+
color: #333333;
|
|
42
|
+
letter-spacing: 0;
|
|
43
|
+
height: 56px;
|
|
44
|
+
line-height: 56px;
|
|
45
|
+
align-self: flex-start;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
text-align: left;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.jdd-field-border-top {
|
|
51
|
+
@include jdd-border-top(#e5e5e5, 16px);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.jdd-field-border-bottom {
|
|
55
|
+
@include jdd-border-bottom(#e5e5e5, 16px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.jdd-field-inline {
|
|
59
|
+
display: flex;
|
|
60
|
+
background-color: #fff;
|
|
61
|
+
padding: 0 16px;
|
|
62
|
+
min-height: 56px;
|
|
63
|
+
position: relative;
|
|
64
|
+
|
|
65
|
+
.jdd-field-control {
|
|
66
|
+
flex: 1;
|
|
67
|
+
margin-left: 10px;
|
|
68
|
+
}
|
|
69
|
+
.jdd-field-label {
|
|
70
|
+
width: 160px;
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
span{
|
|
73
|
+
display: inline-block;
|
|
74
|
+
width: 100%;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
text-overflow: ellipsis;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.jdd-field-inline.jdd-field-error .jdd-field-label {
|
|
84
|
+
line-height: unset;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.jdd-field-error {
|
|
88
|
+
.jdd-field-label {
|
|
89
|
+
color: #fc3438;
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="[ direction==='column'?'jdd-field':'jdd-field-inline',!state?'jdd-field-error':'',isFocus?'jdd-field-focus':'jdd-field-common',borderClass]"
|
|
4
|
+
|
|
5
|
+
>
|
|
6
|
+
<div class="jdd-field-label" @click="onClick"><span>{{label}}</span></div>
|
|
7
|
+
<slot></slot>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: "JddField",
|
|
13
|
+
props: {
|
|
14
|
+
state: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: true
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
border: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
direction: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "column"
|
|
29
|
+
},
|
|
30
|
+
isFocus: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
onClick() {
|
|
41
|
+
this.$emit("label-click");
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
computed: {
|
|
45
|
+
borderClass() {
|
|
46
|
+
if (this.border === "bottom") {
|
|
47
|
+
return "jdd-field-border-bottom";
|
|
48
|
+
} else if (this.border === "top") {
|
|
49
|
+
return "jdd-field-border-top";
|
|
50
|
+
}
|
|
51
|
+
return "";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Input renders the correct markup 1`] = `
|
|
4
|
+
<div class="jdd-field-inline jdd-field-common">
|
|
5
|
+
<div class="jdd-field-label">emaileamil</div>
|
|
6
|
+
<div class="jdd-field-control jdd-field-input"><input autocomplete="off" placeholder="email" type="text" class="">
|
|
7
|
+
<div class="jdd-field-icon-wrap"><i class="jdd-field-clean-icon" style="display: none;"></i> </div>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
`;
|