kui-vue 3.4.3 → 3.4.4-a

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.
@@ -154,7 +154,8 @@ export default {
154
154
  className: [`k-${preCls}`, {
155
155
  [`k-${preCls}-${color}`]: color && !/^#/.test(color),
156
156
  [`k-${preCls}-has-color`]: /^#/.test(color),
157
- [`k-${preCls}-has-arrow`]: this.showPlacementArrow
157
+ [`k-${preCls}-has-arrow`]: this.showPlacementArrow,
158
+ [`k-${preCls}-dark`]: this.dark
158
159
  }],
159
160
  width: this.width,
160
161
  selection: this.selection,
@@ -7,14 +7,28 @@
7
7
  ```vue
8
8
  <template>
9
9
  <div>
10
- <Button @click="show=!show">普通抽屉</Button>
11
- <Button @click="show2=!show2">Width 30%</Button>
12
- <Drawer v-model="show" :footer="null" :title="null">
10
+ <Space>
11
+ <Button @click="show=!show">普通抽屉</Button>
12
+ <Button @click="show2=!show2">Width 30%</Button>
13
+ <Button @click="show3=!show3">点蒙层关闭</Button>
14
+ <Button @click="show4=!show4">没有蒙层</Button>
15
+ </Space>
16
+ <Drawer v-model="show" :footer="null" @ok="show=false">
13
17
  <p>something ...</p>
14
18
  <p>something ...</p>
15
19
  <p>something ...</p>
16
20
  </Drawer>
17
- <Drawer v-model="show2" width="30%" title="Width 30%">
21
+ <Drawer v-model="show2" width="30%" title="Width 30%" @ok="show2=false">
22
+ <p>something ...</p>
23
+ <p>something ...</p>
24
+ <p>something ...</p>
25
+ </Drawer>
26
+ <Drawer v-model="show3" title="Click mask to close" :mask-closable="true" @ok="show3=false">
27
+ <p>something ...</p>
28
+ <p>something ...</p>
29
+ <p>something ...</p>
30
+ </Drawer>
31
+ <Drawer v-model="show4" title="Click mask to close" :mask="false" @ok="submit" :loading="loading">
18
32
  <p>something ...</p>
19
33
  <p>something ...</p>
20
34
  <p>something ...</p>
@@ -26,7 +40,19 @@ export default{
26
40
  data() {
27
41
  return {
28
42
  show:false,
29
- show2:false
43
+ show2:false,
44
+ show3:false,
45
+ show4:false,
46
+ loading:false,
47
+ }
48
+ },
49
+ methods:{
50
+ submit(){
51
+ this.loading = true
52
+ setTimeout(() => {
53
+ this.show4 = false
54
+ this.loading = false
55
+ }, 2000);
30
56
  }
31
57
  }
32
58
  }
@@ -5,16 +5,18 @@
5
5
 
6
6
  ```vue
7
7
  <template>
8
- <Space>
9
- <RadioGroup v-model="placement">
10
- <Radio label="left" value="left"/>
11
- <Radio label="top" value="top"/>
12
- <Radio label="right" value="right"/>
13
- <Radio label="bottom" value="bottom"/>
14
- </RadioGroup>
15
- <Button @click="show=true" >Open</Button>
16
- <Drawer v-model="show" height="300" :placement="placement" title="What's your name? " cancelText="Cancel" okText="Ok">My name is chuchur.</Drawer>
17
- </Space>
8
+ <div>
9
+ <Space>
10
+ <RadioGroup v-model="placement">
11
+ <Radio label="left" value="left"/>
12
+ <Radio label="top" value="top"/>
13
+ <Radio label="right" value="right"/>
14
+ <Radio label="bottom" value="bottom"/>
15
+ </RadioGroup>
16
+ <Button @click="show=true" >Open</Button>
17
+ </Space>
18
+ <Drawer v-model="show" height="300" :placement="placement" title="What's your name? " cancelText="Cancel" okText="Ok" @ok="show=false">My name is chuchur.</Drawer>
19
+ </div>
18
20
  </template>
19
21
  <script>
20
22
  export default{
@@ -6,8 +6,10 @@
6
6
  ```vue
7
7
  <template>
8
8
  <div>
9
- <Button @click="show1=true">普通表单</Button>
10
- <Button @click="show2=true">自定义</Button>
9
+ <Space>
10
+ <Button @click="show1=true">普通表单</Button>
11
+ <Button @click="show2=true">自定义</Button>
12
+ </Space>
11
13
  <Drawer v-model="show1" title="表单验证" @ok="submitForm" @cancel="resetForm" footer>
12
14
  <Form ref="form" :model="form" :rules="rules" label-align="left" :labelCol="{span:5}" :wrapperCol="{span:19}">
13
15
  <FormItem label="Input" prop="input">
@@ -19,13 +19,4 @@ export default {
19
19
  )
20
20
  }
21
21
  }
22
- </script>
23
- <style lang="less">
24
- .demo-drawer {
25
- .k-btn{
26
- margin-right: 10px;
27
- margin-bottom: 10px;
28
- min-width: 70px;
29
- }
30
- }
31
- </style>
22
+ </script>
@@ -7,12 +7,15 @@
7
7
  ```vue
8
8
  <template>
9
9
  <div ref="drawer-box" style="height:300px;position:relative;overflow:hidden">
10
- <RadioGroup v-model="placement">
11
- <Radio label="left" value="left"/>
12
- <Radio label="top" value="top"/>
13
- <Radio label="right" value="right"/>
14
- <Radio label="bottom" value="bottom"/>
15
- </RadioGroup>
10
+ <Space>
11
+ <RadioGroup v-model="placement">
12
+ <Radio label="left" value="left"/>
13
+ <Radio label="top" value="top"/>
14
+ <Radio label="right" value="right"/>
15
+ <Radio label="bottom" value="bottom"/>
16
+ </RadioGroup>
17
+ <Button @click="show=!show">Open</Button>
18
+ </Space>
16
19
  <Drawer v-model="show" width="200"
17
20
  :footer="null"
18
21
  :placement="placement"
@@ -21,7 +24,6 @@
21
24
  <p>something ...</p>
22
25
  <p>something ...</p>
23
26
  </Drawer>
24
- <Button @click="show=!show">Open</Button>
25
27
  </div>
26
28
  </template>
27
29
  <script>
@@ -1,4 +1,4 @@
1
- import {Button} from "../button";
1
+ import { Button } from "../button";
2
2
  import Icon from "../icon";
3
3
  import { t } from "../locale";
4
4
  import transfer from "../_tool/transfer";
@@ -23,6 +23,7 @@ export default {
23
23
  maskClosable: { type: Boolean, default: false },
24
24
  target: { type: Function, default: () => document.body },
25
25
  mask: { type: Boolean, default: true },
26
+ loading: { type: Boolean, default: false },
26
27
  },
27
28
  watch: {
28
29
  value(v) {
@@ -110,10 +111,10 @@ export default {
110
111
  if (this.$isServer) return null;
111
112
  const { title, visible, cancelText, okText, ok,
112
113
  placement, cancel, $slots, width, height, open,
113
- closable, close, } = this
114
+ closable, close, loading } = this
114
115
  const hasFooter = this.footer || $slots.footer
115
116
  const canelBtn = <Button onClick={cancel}>{cancelText || t('k.drawer.cancel')}</Button>
116
- const okBtn = <Button type="primary" onClick={ok}>{okText || t('k.drawer.ok')}</Button>
117
+ const okBtn = <Button type="primary" onClick={ok} loading={loading}>{okText || t('k.drawer.ok')}</Button>
117
118
  const footNode = (
118
119
  hasFooter ? <div class="k-drawer-footer">
119
120
  {$slots.footer}
@@ -148,8 +149,7 @@ export default {
148
149
  <transition name={transitionName} time={3500000}>
149
150
  <div class="k-drawer-box" v-show={visible} style={styles}>
150
151
  <div class="k-drawer-content">
151
- {closeNode}
152
- {title !== null && title !== false && <div class="k-drawer-header"><div class="k-drawer-header-inner">{title}</div></div>}
152
+ {<div class="k-drawer-header">{closeNode}<div class="k-drawer-header-inner">{title}</div></div>}
153
153
  <div class="k-drawer-body">
154
154
  {$slots.default}
155
155
  </div>
@@ -157,7 +157,7 @@ export default {
157
157
  </div>
158
158
  </div>
159
159
  </transition>
160
- </div> : ''
160
+ </div> : null
161
161
  )
162
162
  }
163
163
  };
@@ -8,9 +8,10 @@
8
8
  | footer | 页脚内容,不显示页脚设置`footer=null`即可 | slot | true |
9
9
  | closable | 是否显示关闭按钮 | Boolean | true |
10
10
  | target | 展示的父元素 | Function | - |
11
- | mask-closable | 点击蒙层是否允许关闭 | Boolean | true |
11
+ | mask-closable | 点击蒙层是否允许关闭 | Boolean | false |
12
12
  | okText | 确定按钮文字 | String | 确定 |
13
13
  | cancelText | 取消按钮文字 | String | 取消 |
14
14
  | ok | 点击确定的回调 | Function | - |
15
15
  | cancel | 点击取消的回调 | Function | - |
16
- | close | 抽屉关闭的回调 | Function | - |
16
+ | close | 抽屉关闭的回调 | Function | - |
17
+ | mask | 是否展示蒙层 | Boolean | true |
@@ -1,9 +1,11 @@
1
1
  @import '../../styles/var.less';
2
2
  @import './animal.less';
3
+
3
4
  .k-drawer {
4
5
  position: fixed;
5
6
  z-index: 1002;
6
7
  top: 0;
8
+
7
9
  .k-drawer-mask {
8
10
  position: fixed;
9
11
  top: 0;
@@ -15,8 +17,9 @@
15
17
  width: 100%;
16
18
  z-index: 1000; // animation: mmask .5s ease-in-out;
17
19
  overflow: hidden;
18
- pointer-events: none;
20
+ pointer-events: all
19
21
  }
22
+
20
23
  .k-drawer-box {
21
24
  position: absolute;
22
25
  z-index: 1001;
@@ -25,6 +28,7 @@
25
28
  width: 520px; // animation: fadeIn .5s ease-in-out;
26
29
  // transition: transform .3s;
27
30
  }
31
+
28
32
  .k-drawer-content {
29
33
  position: relative;
30
34
  background-color: var(--kui-color-control-10);
@@ -33,45 +37,55 @@
33
37
  height: 100%;
34
38
  display: flex;
35
39
  flex-direction: column;
40
+
36
41
  .k-drawer-close {
37
- position: absolute;
42
+ // position: absolute;
38
43
  right: 16px;
39
44
  cursor: pointer;
40
45
  font-size: 20px;
46
+ display: flex;
41
47
  color: var(--kui-color-font);
42
- line-height: 43px;
43
- width: 43px;
44
- right: 0;
48
+ // line-height: 43px;
49
+ // width: 43px;
50
+ // right: 0;
45
51
  text-align: center;
46
- top: 0;
52
+ // top: 0;
47
53
  transition: all .3s ease-in-out;
48
-
54
+ margin-right: 12px;
55
+
49
56
  &:hover {
50
- .k-icon{
57
+ .k-icon {
51
58
  color: var(--kui-color-danger);
52
59
  background-color: var(--kui-color-gray-80);
53
60
  border-radius: var(--kui-border-radius);
54
61
  }
62
+
55
63
  // transform: rotate(360deg);
56
64
  }
57
65
  }
66
+
58
67
  .k-drawer-header {
59
68
  // border-bottom: 1px solid var(--kui-color-border);
60
- padding: 14px 35px 14px 16px;
69
+ padding: 14px 16px;
61
70
  line-height: 1;
62
71
  font-size: 14px;
63
72
  font-weight: 600;
64
73
  color: var(--kui-color-title);
65
74
  user-select: none;
75
+ display: flex;
76
+ align-items: center;
77
+
66
78
  .k-drawer-header-inner {
67
79
  white-space: nowrap;
68
80
  overflow: hidden;
69
81
  text-overflow: ellipsis;
70
82
  line-height: 1.1;
71
- font-size: 14px;
83
+ font-size: 16px;
84
+ flex: 1;
72
85
  }
73
86
  }
74
87
  }
88
+
75
89
  .k-drawer-body {
76
90
  padding: 16px;
77
91
  font-size: 14px;
@@ -83,6 +97,7 @@
83
97
  box-sizing: border-box;
84
98
  color: var(--kui-color-font);
85
99
  }
100
+
86
101
  .k-drawer-footer {
87
102
  // border-top: 1px solid var(--kui-color-border);
88
103
  padding: 10px 16px;
@@ -90,6 +105,7 @@
90
105
  display: inline-block;
91
106
  width: 100%;
92
107
  box-sizing: border-box;
108
+
93
109
  .k-btn {
94
110
  margin-left: 8px;
95
111
  }
@@ -103,12 +119,17 @@
103
119
  }
104
120
 
105
121
  .k-drawer-open {
106
- &.k-drawer-left, &.k-drawer-right {
122
+
123
+ &.k-drawer-left,
124
+ &.k-drawer-right {
107
125
  width: 100%;
108
126
  }
109
- &.k-drawer-top, &.k-drawer-bottom {
127
+
128
+ &.k-drawer-top,
129
+ &.k-drawer-bottom {
110
130
  height: 100%;
111
131
  }
132
+
112
133
  &.k-drawer-bottom .k-drawer-box {
113
134
  bottom: 0;
114
135
  }
@@ -118,6 +139,7 @@
118
139
  // width: 100%;
119
140
  height: 100%;
120
141
  right: 0;
142
+
121
143
  .k-drawer-box {
122
144
  top: 0;
123
145
  bottom: 0;
@@ -129,6 +151,7 @@
129
151
  // width: 0%;
130
152
  height: 100%;
131
153
  left: 0;
154
+
132
155
  .k-drawer-box {
133
156
  top: 0;
134
157
  bottom: 0;
@@ -140,6 +163,7 @@
140
163
  width: 100%;
141
164
  // height: 0;
142
165
  top: 0;
166
+
143
167
  .k-drawer-box {
144
168
  top: 0;
145
169
  left: 0;
@@ -151,9 +175,10 @@
151
175
  .k-drawer-bottom {
152
176
  width: 100%;
153
177
  // height: 0;
154
- bottom: 0;
155
- right: 0;
156
- left: 0;
178
+ // bottom: 0;
179
+ // right: 0;
180
+ // left: 0;
181
+
157
182
  .k-drawer-box {
158
183
  width: 100%;
159
184
  // height: 0;
@@ -168,12 +193,14 @@
168
193
  top: 0;
169
194
  width: 100%;
170
195
  height: 100%;
196
+
171
197
  .k-drawer-mask-nobody {
172
198
  position: absolute;
173
199
  pointer-events: all;
174
200
  }
201
+
175
202
  &.k-drawer-bottom .k-drawer-box {
176
- bottom: inherit;
203
+ bottom: 0;
177
204
  }
178
205
  }
179
206
 
@@ -247,7 +247,7 @@ select:-webkit-autofill:focus {
247
247
  }
248
248
 
249
249
  .k-input-icon {
250
- font-size: 25px;
250
+ font-size: 16px;
251
251
  }
252
252
 
253
253
  .k-input-suffix {
@@ -8,20 +8,27 @@
8
8
  <div>
9
9
  <Button @click="visible=true" type="primary">打开弹窗</Button>
10
10
  <Button @click="custom=true" type="primary">自定义</Button>
11
+ <Button @click="visible1=true" type="primary">点蒙层关闭</Button>
11
12
 
12
13
  <Modal :title="null"
13
14
  :footer="null"
14
15
  :showClose="false"
15
16
  v-model="custom">
16
17
  <Space direction="vertical" style="width:100%">
17
- <h2>我是一个标题</h2>
18
- <div><Button @click="custom=false">Close</Button></div>
18
+ <h2>我是一个标题</h2>
19
+ <div><Button @click="custom=false">Close</Button></div>
19
20
  </Space>
20
21
  </Modal>
21
22
 
22
23
  <Modal title="基本对话框" v-model="visible" @ok="okHandle">
23
- <p>This is the content of a basic modal.</p>
24
- <p>More content...</p></Modal>
24
+ <p>This is the content of a basic modal.</p>
25
+ <p>More content...</p>
26
+ </Modal>
27
+
28
+ <Modal title="基本对话框" v-model="visible1" @ok="visible1=false" :mask-closable="true">
29
+ <p>This is the content of a basic modal.</p>
30
+ <p>More content...</p>
31
+ </Modal>
25
32
  </div>
26
33
  </template>
27
34
  <script>
@@ -29,7 +36,8 @@ export default{
29
36
  data() {
30
37
  return {
31
38
  visible:false,
32
- custom:false
39
+ custom:false,
40
+ visible1:false
33
41
  }
34
42
  },
35
43
  methods:{
@@ -138,12 +138,12 @@
138
138
 
139
139
  .k-popconfirm-content {
140
140
  // .k-popconfirm-inner {
141
- // background: var(--kui-color-control-10);
142
- background: #333;
141
+ background: var(--kui-color-control-10);
142
+ // background: #333;
143
143
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
144
144
  border-radius: 12px; //var(--kui-border-radius);
145
145
  position: relative;
146
-
146
+ // border: 1px solid var(--kui-color-border);
147
147
  // }
148
148
  .k-popconfirm-body {
149
149
  padding: 18px 18px 10px 18px;
@@ -172,8 +172,8 @@
172
172
  position: absolute;
173
173
  box-sizing: border-box;
174
174
  display: flex;
175
- // color: var(--kui-color-control-10);
176
- color: #333;
175
+ color: var(--kui-color-control-10);
176
+ // color:inherit;
177
177
  width: 24px;
178
178
  height: 7px;
179
179
  }
@@ -12,7 +12,7 @@
12
12
  </template>
13
13
  <Button type="primary">Hover me</Button>
14
14
  </Poptip>
15
- <Poptip>
15
+ <Poptip dark>
16
16
  <template slot="content">
17
17
  <p>明月几时有,把酒问青天!</p>
18
18
  <p>明月几时有,把酒问青天!</p>
@@ -4,8 +4,8 @@
4
4
  display: inline-block;
5
5
  position: relative;
6
6
  // max-width: 300px;
7
- color: #fff;
8
- // color: var(--kui-color-font);
7
+ // color: #fff;
8
+ color: var(--kui-color-font);
9
9
  font-size: 12px;
10
10
  line-height: 1.5;
11
11
  position: absolute;
@@ -142,7 +142,8 @@
142
142
  min-width: 200px;
143
143
  // .k-poptip-inner {
144
144
  // background: var(--kui-color-control-10);
145
- background: #333; //var(--kui-color-control-10);
145
+ background: var(--kui-color-control-10);
146
+ // background: #333; //var(--kui-color-control-10);
146
147
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
147
148
  border-radius: 8px; // var(--kui-border-radius);
148
149
  position: relative;
@@ -157,12 +158,12 @@
157
158
  .k-poptip-title {
158
159
  font-size: 16px;
159
160
  font-weight: 500;
160
- // color: var(--kui-color-font);
161
- color: #fff;
161
+ color: var(--kui-color-font);
162
+ // color: #fff;
162
163
  margin: 0;
163
164
  padding: 8px 16px;
164
165
  position: relative;
165
- border-bottom: 1px solid var(--kui-color-gray-80);
166
+ // border-bottom: 1px solid var(--kui-color-gray-80);
166
167
  text-overflow: ellipsis;
167
168
  overflow: hidden;
168
169
  }
@@ -173,18 +174,25 @@
173
174
  display: flex;
174
175
  width: 24px;
175
176
  height: 7px;
176
- color: #333;
177
+ color: var(--kui-color-control-10);
178
+ // color: #333;
177
179
  // color: var(--kui-color-control-10);
178
180
  }
179
181
  }
180
182
 
181
183
  .k-poptip-dark {
182
- background: #333;
183
- // background-color: var(--kui-color-dark);
184
- color: #fff;
185
-
186
184
  .k-poptip-title {
187
- border-bottom: 1px solid rgba(0, 0, 0, .2);
185
+ color: #fff;
186
+ }
187
+
188
+ .k-poptip-content {
189
+ // background: #333;
190
+ color: #fff;
191
+ background-color: @dark-back-color-10;
192
+ }
193
+
194
+ .k-poptip-arrow {
195
+ color: @dark-back-color-10;
188
196
  }
189
197
  }
190
198