@kengic/uni 0.5.2 → 0.6.1-beta.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.
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 0.6.0
|
|
2
|
+
|
|
3
|
+
1. 优化导入路径
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
// 旧
|
|
7
|
+
// --------------------------------------------------
|
|
8
|
+
import { UniEasyinput } from '@kengic/uni/dist';
|
|
9
|
+
|
|
10
|
+
// 新
|
|
11
|
+
// --------------------------------------------------
|
|
12
|
+
import { UniEasyinput } from '@kengic/uni';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
<view class="uni-stat-box" :class="{ 'uni-stat__actived': current }">
|
|
5
5
|
<view class="uni-select" :class="{ 'uni-select--disabled': disabled }">
|
|
6
6
|
<view class="uni-select__input-box" @click="toggleSelector">
|
|
7
|
-
<view v-if="current" class="uni-select__input-text">{{
|
|
7
|
+
<view v-if="current" class="uni-select__input-text">{{ textShow }}</view>
|
|
8
8
|
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{ typePlaceholder }}</view>
|
|
9
9
|
<view v-if="current && clear && !disabled" @click.stop="clearVal">
|
|
10
|
-
<uni-icons type="clear" color="#c0c4cc" size="
|
|
10
|
+
<uni-icons type="clear" color="#c0c4cc" size="24" />
|
|
11
11
|
</view>
|
|
12
12
|
<view v-else style="display: flex; align-items: center; justify-content: center">
|
|
13
13
|
<view :class="showSelector ? 'ant-design--caret-up-filled' : 'ant-design--caret-down-filled'" />
|
|
14
14
|
</view>
|
|
15
15
|
</view>
|
|
16
16
|
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
|
|
17
|
-
<view class="uni-select__selector" v-if="showSelector">
|
|
18
|
-
<view class="uni-
|
|
17
|
+
<view class="uni-select__selector" :style="getOffsetByPlacement" v-if="showSelector">
|
|
18
|
+
<view :class="placement == 'bottom' ? 'uni-popper__arrow_bottom' : 'uni-popper__arrow_top'"></view>
|
|
19
19
|
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
|
|
20
20
|
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
|
|
21
21
|
<text>{{ emptyTips }}</text>
|
|
@@ -42,6 +42,9 @@
|
|
|
42
42
|
* @property {String} label 左侧标题
|
|
43
43
|
* @property {String} placeholder 输入框的提示文字
|
|
44
44
|
* @property {Boolean} disabled 是否禁用
|
|
45
|
+
* @property {String} placement 弹出位置
|
|
46
|
+
* @value top 顶部弹出
|
|
47
|
+
* @value bottom 底部弹出(default)
|
|
45
48
|
* @event {Function} change 选中发生变化触发
|
|
46
49
|
*/
|
|
47
50
|
|
|
@@ -92,6 +95,10 @@
|
|
|
92
95
|
type: String,
|
|
93
96
|
default: '',
|
|
94
97
|
},
|
|
98
|
+
placement: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: 'bottom',
|
|
101
|
+
},
|
|
95
102
|
},
|
|
96
103
|
data() {
|
|
97
104
|
return {
|
|
@@ -130,7 +137,24 @@
|
|
|
130
137
|
return this.value;
|
|
131
138
|
// #endif
|
|
132
139
|
},
|
|
140
|
+
textShow() {
|
|
141
|
+
// 长文本显示
|
|
142
|
+
let text = this.current;
|
|
143
|
+
if (text.length > 10) {
|
|
144
|
+
return text.slice(0, 25) + '...';
|
|
145
|
+
}
|
|
146
|
+
return text;
|
|
147
|
+
},
|
|
148
|
+
getOffsetByPlacement() {
|
|
149
|
+
switch (this.placement) {
|
|
150
|
+
case 'top':
|
|
151
|
+
return 'bottom:calc(100% + 12px);';
|
|
152
|
+
case 'bottom':
|
|
153
|
+
return 'top:calc(100% + 12px);';
|
|
154
|
+
}
|
|
155
|
+
},
|
|
133
156
|
},
|
|
157
|
+
|
|
134
158
|
watch: {
|
|
135
159
|
localdata: {
|
|
136
160
|
immediate: true,
|
|
@@ -393,17 +417,23 @@
|
|
|
393
417
|
box-sizing: border-box;
|
|
394
418
|
/* #endif */
|
|
395
419
|
position: absolute;
|
|
420
|
+
left: 0;
|
|
421
|
+
width: 100%;
|
|
422
|
+
background-color: #ffffff;
|
|
423
|
+
border: 1px solid #ebeef5;
|
|
424
|
+
border-radius: 6px;
|
|
425
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
426
|
+
z-index: 3;
|
|
427
|
+
padding: 4px 0;
|
|
396
428
|
top: calc(100% + 2px);
|
|
397
429
|
left: -1px;
|
|
398
430
|
width: calc(100% + 2px);
|
|
399
|
-
background-color: #ffffff;
|
|
400
431
|
border: 1px solid #e5e5e5;
|
|
401
432
|
border-radius: 3px;
|
|
402
433
|
box-shadow:
|
|
403
434
|
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
404
435
|
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
405
436
|
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
406
|
-
z-index: 3;
|
|
407
437
|
padding: 1px 1px;
|
|
408
438
|
}
|
|
409
439
|
|
|
@@ -420,6 +450,7 @@
|
|
|
420
450
|
max-height: 600px;
|
|
421
451
|
}
|
|
422
452
|
}
|
|
453
|
+
|
|
423
454
|
/* #endif */
|
|
424
455
|
|
|
425
456
|
.uni-select__selector-empty {
|
|
@@ -435,10 +466,10 @@
|
|
|
435
466
|
line-height: 25px;
|
|
436
467
|
font-size: 14px;
|
|
437
468
|
text-align: center;
|
|
438
|
-
margin-bottom: 1px;
|
|
439
|
-
border-radius: 2px;
|
|
440
469
|
/* border-bottom: solid 1px $uni-border-3; */
|
|
441
470
|
padding: 0px 10px;
|
|
471
|
+
margin-bottom: 1px;
|
|
472
|
+
border-radius: 2px;
|
|
442
473
|
}
|
|
443
474
|
|
|
444
475
|
.uni-select__selector-item:hover {
|
|
@@ -449,8 +480,8 @@
|
|
|
449
480
|
.uni-select__selector-item:last-child {
|
|
450
481
|
/* #ifndef APP-NVUE */
|
|
451
482
|
border-bottom: none;
|
|
452
|
-
margin-bottom: 0px;
|
|
453
483
|
/* #endif */
|
|
484
|
+
margin-bottom: 0px;
|
|
454
485
|
}
|
|
455
486
|
|
|
456
487
|
.uni-select__selector__disabled {
|
|
@@ -459,8 +490,10 @@
|
|
|
459
490
|
}
|
|
460
491
|
|
|
461
492
|
/* picker 弹出层通用的指示小三角 */
|
|
462
|
-
.uni-
|
|
463
|
-
.uni-
|
|
493
|
+
.uni-popper__arrow_bottom,
|
|
494
|
+
.uni-popper__arrow_bottom::after,
|
|
495
|
+
.uni-popper__arrow_top,
|
|
496
|
+
.uni-popper__arrow_top::after {
|
|
464
497
|
position: absolute;
|
|
465
498
|
display: block;
|
|
466
499
|
width: 0;
|
|
@@ -470,7 +503,7 @@
|
|
|
470
503
|
border-width: 6px;
|
|
471
504
|
}
|
|
472
505
|
|
|
473
|
-
.uni-
|
|
506
|
+
.uni-popper__arrow_bottom {
|
|
474
507
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
|
475
508
|
top: -6px;
|
|
476
509
|
left: 10%;
|
|
@@ -480,7 +513,7 @@
|
|
|
480
513
|
display: none !important;
|
|
481
514
|
}
|
|
482
515
|
|
|
483
|
-
.uni-
|
|
516
|
+
.uni-popper__arrow_bottom::after {
|
|
484
517
|
content: ' ';
|
|
485
518
|
top: 1px;
|
|
486
519
|
margin-left: -6px;
|
|
@@ -488,6 +521,24 @@
|
|
|
488
521
|
border-bottom-color: #fff;
|
|
489
522
|
}
|
|
490
523
|
|
|
524
|
+
.uni-popper__arrow_top {
|
|
525
|
+
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
|
526
|
+
bottom: -6px;
|
|
527
|
+
left: 10%;
|
|
528
|
+
margin-right: 3px;
|
|
529
|
+
border-bottom-width: 0;
|
|
530
|
+
border-top-color: #ebeef5;
|
|
531
|
+
display: none !important;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.uni-popper__arrow_top::after {
|
|
535
|
+
content: ' ';
|
|
536
|
+
bottom: 1px;
|
|
537
|
+
margin-left: -6px;
|
|
538
|
+
border-bottom-width: 0;
|
|
539
|
+
border-top-color: #fff;
|
|
540
|
+
}
|
|
541
|
+
|
|
491
542
|
.uni-select__input-text {
|
|
492
543
|
// width: 280px;
|
|
493
544
|
width: 100%;
|