kui-vue 3.3.9 → 3.3.11

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.
@@ -151,7 +151,7 @@ export function getPosition(selection, picker, transfer, placement = 'bottom-lef
151
151
  let showInRight = clientWidth - selectionRect.right > pickerWidth
152
152
 
153
153
  // console.log(showInRight, selectionRect.left > pickerWidth, selectionRect.right, pickerWidth)
154
-
154
+ console.log('bottom:', showInBottom, 'top:', showInTop, 'left:', showInLeft, 'right:', showInRight)
155
155
  // console.log(placement, 'showInTop:', showInTop, 'showInBottom:', showInBottom, clientHeight, scrollTop, selectionRect.top, pickerHeight)
156
156
 
157
157
  let hasBottom = placement.slice(0, 6) == 'bottom'
@@ -32,7 +32,7 @@ export default {
32
32
  data() {
33
33
  return {
34
34
  currentValue: this.value,
35
- // isFocus: false,
35
+ isFocus: false,
36
36
  // isEnter: false,
37
37
  isPassword: true,
38
38
  };
@@ -24,8 +24,8 @@
24
24
 
25
25
  // &:focus,
26
26
  &:hover {
27
- border-color: var(--kui-color-main-hover);
28
- color: var(--kui-color-main-hover);
27
+ border-color: var(--kui-color-main);
28
+ color: var(--kui-color-main);
29
29
  z-index: 1;
30
30
  }
31
31
 
@@ -61,7 +61,7 @@
61
61
  &:focus {
62
62
  +.k-checkbox-inner {
63
63
  border: 1px solid var(--kui-color-main);
64
- box-shadow: 0 0 5px var(--kui-color-main-30);
64
+ box-shadow: 0 0 0 2px var(--kui-color-main-90);
65
65
  }
66
66
  }
67
67
  }
@@ -8,11 +8,13 @@
8
8
  position: relative;
9
9
  display: inline-block;
10
10
  box-sizing: content-box;
11
+
11
12
  &:hover,
12
13
  &:focus {
13
14
  border-color: var(--kui-color-main-hover);
14
15
  }
15
- &:active{
16
+
17
+ &:active {
16
18
  opacity: .8;
17
19
  }
18
20
 
@@ -57,7 +59,8 @@
57
59
  transform: rotate(180deg);
58
60
  }
59
61
  }
60
- .k-color-picker-opened{
62
+
63
+ .k-color-picker-opened {
61
64
  border: 1px solid var(--kui-color-main);
62
65
  box-shadow: 0 0 5px var(--kui-color-main-30);
63
66
  }
@@ -66,11 +69,22 @@
66
69
  cursor: not-allowed;
67
70
  background: var(--kui-color-disable-back);
68
71
  border-color: var(--kui-color-disable-border);
69
- cursor: not-allowed;
72
+
73
+ * {
74
+ cursor: not-allowed;
75
+ }
70
76
 
71
77
  .k-color-picker-color {
72
78
  opacity: .5;
73
79
  }
80
+
81
+ &:hover {
82
+ border-color: var(--kui-color-disable-border);
83
+ }
84
+
85
+ &:active {
86
+ opacity: 1;
87
+ }
74
88
  }
75
89
 
76
90
  .k-color-picker-lg {
@@ -164,7 +164,9 @@ export default {
164
164
  }
165
165
  },
166
166
  isDisabled(date) {
167
- return (this.v1 && this.isRange && dayjs(date).isBefore(this.v1, 'date') && !this.v2) || this.disabledDate(date)
167
+ return (this.v1 && this.isRange && dayjs(date).isBefore(this.v1, 'date') && !this.v2)
168
+ || (this.v2 && this.isRange && dayjs(date).isAfter(this.v2, 'date') && !this.v1)
169
+ || this.disabledDate(date)
168
170
  },
169
171
  dayMouseHover(date) {
170
172
  if (this.v1 && !this.v2) {
@@ -311,6 +313,7 @@ export default {
311
313
  },
312
314
  getTimesNode() {
313
315
  let { $H, $m, $s } = this.date
316
+ // console.log($H, $m, $s)
314
317
  let hours = [], minus = [], sec = [];
315
318
  //hour
316
319
  for (let j = 0; j < 24; j++) {
@@ -45,8 +45,8 @@ export default {
45
45
  opened: false,
46
46
  currentValue: this.value,
47
47
  v1: null, // render selected
48
- v2: null,
49
- d1: null, //render date
48
+ v2: null, //
49
+ d1: null, //render date view
50
50
  d2: null,
51
51
  h2: null,
52
52
  fmt: {
@@ -99,10 +99,12 @@ export default {
99
99
  let { currentValue, isRange } = this
100
100
  if (isRange) {
101
101
  let [a, b] = currentValue || []
102
- this.d1 = a ? dayjs(a) : dayjs(), this.d2 = b ? dayjs(b) : dayjs().add(1, 'month')
102
+ this.d1 = a ? dayjs(a) : dayjs()
103
+ this.d2 = b ? dayjs(b) : dayjs().add(1, 'month')
103
104
  if (this.d1.isSame(this.d2, 'month')) {
104
- this.d2 = this.d1.add(1, 'month')
105
+ this.d2 = this.d2.add(1, 'month')
105
106
  }
107
+ // this.currentValue = [dayjs(this.d1), dayjs(this.d2)]
106
108
  } else {
107
109
  this.d1 = currentValue ? dayjs(currentValue) : dayjs()
108
110
  }
@@ -140,7 +142,7 @@ export default {
140
142
  picker1Update(value, type) {
141
143
  let { isRange, format, fmt, mode } = this
142
144
  if (!isRange) {
143
- if (!type) {
145
+ if (!type) { //for day
144
146
  this.d1 = dayjs(value)
145
147
  this.v1 = dayjs(value)
146
148
  } else {
@@ -159,82 +161,77 @@ export default {
159
161
 
160
162
  } else {
161
163
  let { v1, v2, withTime } = this
162
- if (!type) { //只改变年月时间
164
+ if (!type) { //for day
163
165
  this.d1 = dayjs(value)
164
166
  if (!v1 && !v2) {
165
167
  this.v1 = dayjs(value)
166
- this.currentValue = [dayjs(value),]
168
+ this.currentValue = [dayjs(value), v2]
167
169
  } else if (v1 && !v2) {
168
170
  this.v2 = dayjs(value)
169
171
  this.currentValue = [v1, this.v2]
170
172
 
171
- let ft = format || fmt[mode]
172
- let dateStr = [v1.format(ft), this.v2.format(ft)]
173
- // console.log(dateStr)
174
- // return
175
- this.$emit('input', dateStr)
176
- this.$emit('change', this.currentValue, dateStr)
177
- this.updateCalendDate()
173
+ this.updateStr()
174
+
178
175
  if (!withTime) {
179
176
  this.opened = false
180
177
  }
181
178
  } else if (v1 && v2) {
182
179
  this.v1 = dayjs(value)
183
180
  this.v2 = null
184
- this.currentValue = [dayjs(value),]
181
+ this.currentValue = [dayjs(value), v2]
185
182
  }
186
183
  } else {
187
- this.v1 = (this.v1 || dayjs())[type](value)
188
-
184
+ this.v1 = (this.v1 || dayjs(this.d1))[type](value)
189
185
  this.currentValue = [this.v1, v2]
190
186
  this.d1 = this.d1[type](value)
187
+
188
+ this.updateStr()
191
189
  }
192
190
  if (this.d1.isSame(this.d2, 'month') || this.d1.isAfter(this.d2, 'month')) {
193
- this.d2 = this.d1.add(1, 'month')
191
+ this.d2 = this.d2.add(1, 'month')
194
192
  }
195
193
  }
196
194
  },
195
+
197
196
  picker2Update(value, type) {
198
197
  let { v1, v2, withTime, format, fmt, mode } = this
199
- if (!type) { //day
200
- this.d2 = value
201
- if (!v1 && !v2) {
198
+ if (!type) { //for day
199
+ this.d2 = dayjs(value)
200
+ if (!v1) {
202
201
  this.v1 = dayjs(value)
203
- this.currentValue = [dayjs(value),]
202
+ this.currentValue = [dayjs(value), v2]
204
203
  } else if (v1 && !v2) {
205
204
  this.v2 = dayjs(value)
206
205
  this.currentValue = [v1, this.v2]
207
206
 
208
- let ft = format || fmt[mode]
209
- let dateStr = [v1.format(ft), this.v2.format(ft)]
210
- this.$emit('input', dateStr)
211
- this.$emit('change', this.currentValue, dateStr)
212
- this.updateCalendDate()
213
-
214
- // console.log(dateStr)
207
+ this.updateStr()
215
208
  if (!withTime) {
216
209
  this.opened = false
217
210
  }
218
211
  } else if (v1 && v2) {
219
212
  this.v1 = dayjs(value)
220
213
  this.v2 = null
221
- this.currentValue = [dayjs(value),]
214
+ this.currentValue = [dayjs(value), this.v2]
222
215
  }
223
216
  } else { //for year , month , datetime
224
- if (!this.v1) {
225
- this.v1 = (this.v1 || dayjs())[type](value)
226
- this.currentValue = [this.v1, v2]
227
- this.d2 = this.d2[type](value)
228
- } else {
229
- this.v2 = (this.v2 || dayjs())[type](value)
230
- this.currentValue = [v1, this.v2]
231
- this.d2 = this.d2[type](value)
232
- }
217
+
218
+ this.v2 = (this.v2 || dayjs(this.d2))[type](value)
219
+ this.d2 = this.d2[type](value)
220
+ this.currentValue = [v1, this.v2]
221
+ this.updateStr()
233
222
  }
234
223
  if (this.d2.isSame(this.d1, 'month') || this.d2.isBefore(this.d1, 'month')) {
235
- this.d1 = this.d2.subtract(1, 'month')
224
+ this.d1 = this.d1.subtract(1, 'month')
236
225
  }
237
226
  },
227
+ updateStr() {
228
+ let { v1, v2, withTime, format, fmt, mode } = this
229
+ let ft = format || fmt[mode]
230
+ let dateStr = [v1 ? v1.format(ft) : null, v2 ? v2.format(ft) : null]
231
+ this.$emit('input', dateStr)
232
+ this.$emit('change', this.currentValue, dateStr)
233
+ this.updateCalendDate()
234
+ },
238
235
  validValue(e) {
239
236
  // 只有一个值的时候, 直接置空
240
237
  if (this.isRange) {
@@ -364,7 +361,6 @@ export default {
364
361
  if (v) {
365
362
  this.opened = false
366
363
  this.validValue(e)
367
-
368
364
  }
369
365
  },
370
366
  hd: (v) => {
@@ -6,7 +6,7 @@
6
6
  ```vue
7
7
  <template>
8
8
  <div>
9
- <DatePicker value="2019-10-12 22:12:12" format="YYYY年MM月DD日 HH:mm:ss" mode="dateTime"/>
9
+ <DatePicker value="2019-10-12 22:12:12" format="YYYY年MM月DD日 HH:mm:ss" mode="dateTime" style="width:210px"/>
10
10
  <br/>
11
11
  <DatePicker value="2019-10-12" format="YYYY/MM/DD"/>
12
12
  <br/>
@@ -108,10 +108,18 @@
108
108
  &:hover {
109
109
  background-color: var(--kui-color-hover);
110
110
  }
111
+
112
+ &:active {
113
+ background-color: var(--kui-color-actived);
114
+ }
111
115
  }
112
116
 
113
117
  .k-calendar-item-selected {
114
- background-color: var(--kui-color-main-80);
118
+ background-color: var(--kui-color-main-90);
119
+
120
+ &:hover {
121
+ background-color: var(--kui-color-main-90);
122
+ }
115
123
  }
116
124
  }
117
125
 
@@ -156,7 +164,11 @@
156
164
  box-sizing: border-box;
157
165
 
158
166
  &:hover {
159
- background: var(--kui-color-main-80);
167
+ background: var(--kui-color-hover);
168
+ }
169
+
170
+ &:active {
171
+ background: var(--kui-color-actived);
160
172
  }
161
173
  }
162
174
 
@@ -167,11 +179,11 @@
167
179
 
168
180
  .k-calendar-day-in {
169
181
  // color: var(--kui-color-main-80);
170
- background: var(--kui-color-main-80);
182
+ background: var(--kui-color-main-90);
171
183
  }
172
184
 
173
- .k-calendar-year-this,
174
- .k-calendar-month-this,
185
+ // .k-calendar-year-this,
186
+ // .k-calendar-month-this,
175
187
  .k-calendar-day-this {
176
188
  // border: 1px solid var(--kui-color-main);
177
189
  color: var(--kui-color-main);
@@ -246,7 +258,7 @@
246
258
  content: '';
247
259
  display: block;
248
260
  width: 100%;
249
- height: 114px;
261
+ height: 127px;
250
262
  }
251
263
 
252
264
  &::-webkit-scrollbar {
@@ -275,14 +287,23 @@
275
287
  transition: all .3s;
276
288
 
277
289
  &:hover {
278
- background: var(--kui-color-main-90);
290
+ background: var(--kui-color-hover);
279
291
  }
292
+
293
+ &:active {
294
+ background: var(--kui-color-actived);
295
+ }
296
+
280
297
  }
281
298
 
282
299
  .k-calendar-item-selected {
283
- color: var(--kui-color-main);
284
- font-weight: bold;
285
- background: var(--kui-color-main-80);
300
+ // color: var(--kui-color-main);
301
+ // font-weight: bold;
302
+ background: var(--kui-color-main-90);
303
+
304
+ &:hover {
305
+ background: var(--kui-color-main-90);
306
+ }
286
307
  }
287
308
 
288
309
  .k-calendar-time-disabled {
@@ -1,9 +1,10 @@
1
1
  @import '../../styles/var.less';
2
2
 
3
3
  .k-datepicker {
4
- display: inline-block;
4
+ display: inline-flex;
5
+ box-sizing: border-box;
5
6
  // width: 100%;
6
- max-width: 100%;
7
+ // max-width: 100%;
7
8
  box-sizing: border-box;
8
9
  vertical-align: middle;
9
10
  color: var(--kui-color-font);
@@ -144,7 +145,7 @@
144
145
  .k-datepicker:focus,
145
146
  .k-datepicker-open {
146
147
  border-color: var(--kui-color-main);
147
- box-shadow: 0 0 5px var(--kui-color-main-30);
148
+ box-shadow: 0 0 0 2px var(--kui-color-main-90);
148
149
 
149
150
  &.k-datepicker-light {
150
151
  border-color: transparent;
@@ -8,7 +8,7 @@
8
8
  | footer | 页脚内容,不显示页脚设置`footer=null`即可 | slot | true |
9
9
  | closable | 是否显示关闭按钮 | Boolean | true |
10
10
  | target | 展示的父元素 | Function | - |
11
- | mas-closable | 点击蒙层是否允许关闭 | Boolean | true |
11
+ | mask-closable | 点击蒙层是否允许关闭 | Boolean | true |
12
12
  | okText | 确定按钮文字 | String | 确定 |
13
13
  | cancelText | 取消按钮文字 | String | 取消 |
14
14
  | ok | 点击确定的回调 | Function | - |
@@ -32,7 +32,7 @@
32
32
  <FormItem label="Captcha" prop="captcha">
33
33
  <Input >
34
34
  <template slot="suffix">
35
- <Button size="small" type="primary" v-if="time==60" @click="sendCode">获取验证码</Button>
35
+ <Button size="small" type="primary" v-if="time==60" theme="normal" @click="sendCode">获取验证码</Button>
36
36
  <span v-else>{{time}}(s)</span>
37
37
  </template>
38
38
  </Input>
@@ -78,7 +78,7 @@
78
78
  .k-form-item-error {
79
79
  .k-input[mult].k-input-focus {
80
80
  border-color: var(--kui-color-danger);
81
- box-shadow: 0 0 5px var(--kui-color-danger-30);
81
+ box-shadow: 0 0 0 2px var(--kui-color-danger-90);
82
82
 
83
83
  }
84
84
 
@@ -92,7 +92,7 @@
92
92
  &:hover,
93
93
  &:focus {
94
94
  border-color: var(--kui-color-danger);
95
- box-shadow: 0 0 5px var(--kui-color-danger-30);
95
+ box-shadow: 0 0 0 2px var(--kui-color-danger-90);
96
96
  }
97
97
  }
98
98
 
@@ -111,11 +111,11 @@
111
111
  }
112
112
 
113
113
  .k-select-open .k-select-selection {
114
- box-shadow: 0 0 5px var(--kui-color-danger-30);
114
+ box-shadow: 0 0 0 2px var(--kui-color-danger-90);
115
115
  }
116
116
 
117
117
  .k-datepicker-open {
118
- box-shadow: 0 0 5px var(--kui-color-danger-30);
118
+ box-shadow: 0 0 0 2px var(--kui-color-danger-90);
119
119
  }
120
120
  }
121
121
  }
@@ -55,7 +55,7 @@
55
55
 
56
56
  &.k-input-focus {
57
57
  border-color: var(--kui-color-main);
58
- box-shadow: 0 0 5px var(--kui-color-main-30);
58
+ box-shadow: 0 0 0 2px var(--kui-color-main-90);
59
59
  }
60
60
 
61
61
  .k-input-suffix,
@@ -105,7 +105,7 @@
105
105
  flex-shrink: 0;
106
106
  &:focus {
107
107
  // box-shadow: 0 0 5px rgba(59, 180, 242, 0.55);
108
- box-shadow: 0 0 5px var(--kui-color-main-30);
108
+ box-shadow: 0 0 0 2px var(--kui-color-main-90);
109
109
  border-color: var(--kui-color-main);
110
110
  outline: none;
111
111
  }
@@ -45,7 +45,11 @@
45
45
 
46
46
  &:hover {
47
47
  color: var(--kui-color-main);
48
- background-color: var(--kui-color-gray-80);
48
+ background-color: var(--kui-color-hover);
49
+ }
50
+ &:active {
51
+ color: var(--kui-color-main);
52
+ background-color: var(--kui-color-actived);
49
53
  }
50
54
 
51
55
  &:first-child {
@@ -81,7 +85,6 @@
81
85
  }
82
86
 
83
87
  &:focus {
84
- // box-shadow: 0 0 5px var(--kui-color-main-30);
85
88
  // border-color: var(--kui-color-main);
86
89
  outline: none;
87
90
  }
@@ -89,7 +92,7 @@
89
92
 
90
93
  &.k-input-number-focus {
91
94
  border-color: var(--kui-color-main);
92
- box-shadow: 0 0 5px var(--kui-color-main-30);
95
+ box-shadow: 0 0 0 2px var(--kui-color-main-90);
93
96
  }
94
97
 
95
98
  .k-input-number-suffix,
@@ -9,6 +9,7 @@
9
9
  display: flex;
10
10
  align-items: center;
11
11
  flex-shrink: 0;
12
+
12
13
  .k-pager {
13
14
  margin: 0;
14
15
  display: flex;
@@ -39,7 +40,7 @@
39
40
  &:hover {
40
41
  // border-color: var(--kui-color-main-hover);
41
42
  // color: var(--kui-color-main-hover);
42
- background-color: var(--kui-color-border);
43
+ background-color: var(--kui-color-hover);
43
44
 
44
45
  .k-icon {
45
46
  color: var(--kui-color-main-hover);
@@ -47,8 +48,9 @@
47
48
  }
48
49
 
49
50
  &:active {
50
- border-color: var(--kui-color-main-actived);
51
- color: var(--kui-color-main-actived);
51
+ // border-color: var(--kui-color-main-actived);
52
+ background-color: var(--kui-color-actived);
53
+ // color: var(--kui-color-main-actived);
52
54
 
53
55
  .k-icon {
54
56
  color: var(--kui-color-main-actived);
@@ -112,7 +114,8 @@
112
114
  }
113
115
 
114
116
  &:hover {
115
- border-color: var(--kui-color-disable-border);
117
+ // border-color: var(--kui-color-disable-border);
118
+ background: none;
116
119
 
117
120
  .k-icon {
118
121
  color: var(--kui-color-disable-color);
@@ -134,7 +134,7 @@
134
134
  &:hover {
135
135
  +.k-radio-inner {
136
136
  border: 1px solid var(--kui-color-main);
137
- box-shadow: 0 0 5px var(--kui-color-main-30);
137
+ box-shadow: 0 0 0 2px var(--kui-color-main-90);
138
138
  }
139
139
  }
140
140
  }
@@ -17,7 +17,7 @@
17
17
  &:focus {
18
18
  .k-select-selection {
19
19
  border: 1px solid var(--kui-color-border);
20
- box-shadow: 0 0 5px var(--kui-color-main-30);
20
+ box-shadow: 0 0 0 2px var(--kui-color-main-90);
21
21
  }
22
22
  }
23
23
 
@@ -333,6 +333,9 @@
333
333
  &:hover {
334
334
  background: var(--kui-color-hover);
335
335
  }
336
+ &:active {
337
+ background: var(--kui-color-actived);
338
+ }
336
339
 
337
340
  .k-icon {
338
341
  position: absolute;
@@ -353,8 +356,8 @@
353
356
 
354
357
  .k-select-item-selected {
355
358
  background: var(--kui-color-selected);
356
- color: var(--kui-color-main);
357
- font-weight: 500;
359
+ // color: var(--kui-color-main);
360
+ font-weight: bold;
358
361
 
359
362
  &:hover {
360
363
  background: var(--kui-color-selected);