bri-components 1.2.9 → 1.2.10
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/lib/bri-components.min.js +3 -3
- package/package.json +1 -1
- package/src/components/controls/base/DshCascader/DshCascader.vue +6 -1
- package/src/components/controls/base/DshInput.vue +1 -0
- package/src/components/controls/controlMixin.js +1 -0
- package/src/components/small/BriTooltip.vue +34 -41
- package/src/components/unit/DshUnit.vue +1 -0
- package/src/styles/components/small/BriTooltip.less +2 -2
package/package.json
CHANGED
|
@@ -126,7 +126,9 @@
|
|
|
126
126
|
@on-visible-change="visibleChange"
|
|
127
127
|
@on-change="changeVal"
|
|
128
128
|
@click.stop="clickCascader"
|
|
129
|
-
|
|
129
|
+
>
|
|
130
|
+
<slot></slot>
|
|
131
|
+
</Cascader>
|
|
130
132
|
</template>
|
|
131
133
|
</template>
|
|
132
134
|
</template>
|
|
@@ -394,6 +396,9 @@
|
|
|
394
396
|
if (this.isVisible || !val.length) {
|
|
395
397
|
this.curValList = val;
|
|
396
398
|
}
|
|
399
|
+
|
|
400
|
+
// 注:...params 参数不可去单独使用地区组件时调用
|
|
401
|
+
this.$emit("change", this.value[this.controlKey], ...params);
|
|
397
402
|
}
|
|
398
403
|
},
|
|
399
404
|
watch: {
|
|
@@ -2,18 +2,13 @@
|
|
|
2
2
|
<Tooltip
|
|
3
3
|
class="BriTooltip"
|
|
4
4
|
style="width: 100%;"
|
|
5
|
-
:disabled="disabled"
|
|
6
5
|
:content="content"
|
|
6
|
+
:disabled="toolTipDisabled"
|
|
7
7
|
:placement="placement"
|
|
8
|
-
:transfer="transfer"
|
|
9
8
|
:max-width="maxWidth"
|
|
9
|
+
:transfer="transfer"
|
|
10
10
|
>
|
|
11
|
-
<
|
|
12
|
-
ref="ellipsisContent"
|
|
13
|
-
class="ellipsisContent"
|
|
14
|
-
>
|
|
15
|
-
<slot></slot>
|
|
16
|
-
</div>
|
|
11
|
+
<slot></slot>
|
|
17
12
|
|
|
18
13
|
<slot
|
|
19
14
|
slot="content"
|
|
@@ -27,12 +22,6 @@
|
|
|
27
22
|
name: "BriTooltip",
|
|
28
23
|
props: {
|
|
29
24
|
content: String,
|
|
30
|
-
propsObj: {
|
|
31
|
-
type: Object,
|
|
32
|
-
default () {
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
25
|
placement: {
|
|
37
26
|
type: String,
|
|
38
27
|
default: "bottom"
|
|
@@ -44,44 +33,48 @@
|
|
|
44
33
|
transfer: {
|
|
45
34
|
type: Boolean,
|
|
46
35
|
default: false
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
defaultDisabled: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
47
41
|
}
|
|
48
42
|
},
|
|
49
43
|
data () {
|
|
50
44
|
return {
|
|
51
|
-
|
|
45
|
+
toolTipDisabled: true,
|
|
46
|
+
tmpToolTipDisabled: true
|
|
52
47
|
};
|
|
53
48
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// 获取overflow:hidden元素的实际被撑开的宽度
|
|
58
|
-
let test = this.$refs.ellipsisContent;
|
|
59
|
-
if (test) {
|
|
60
|
-
let cp = test.cloneNode(true);
|
|
61
|
-
cp.style.cssText = "all: unset;position: absolute;opacity:0;";
|
|
62
|
-
test.parentElement.appendChild(cp);
|
|
63
|
-
let realWidth = cp.offsetWidth;
|
|
64
|
-
cp.remove();
|
|
65
|
-
this.disabled = realWidth <= test.offsetWidth;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
49
|
+
created () {
|
|
50
|
+
this.toolTipDisabled = this.defaultDisabled;
|
|
51
|
+
this.tmpToolTipDisabled = this.toolTipDisabled;
|
|
68
52
|
},
|
|
69
|
-
created () {},
|
|
70
53
|
mounted () {
|
|
71
|
-
this
|
|
72
|
-
this.computedDisable();
|
|
73
|
-
});
|
|
54
|
+
this.getToolTipDisabled("mouted");
|
|
74
55
|
},
|
|
75
56
|
updated () {
|
|
76
|
-
this
|
|
77
|
-
this.computedDisable();
|
|
78
|
-
});
|
|
57
|
+
this.getToolTipDisabled("updated");
|
|
79
58
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.$
|
|
83
|
-
|
|
84
|
-
|
|
59
|
+
methods: {
|
|
60
|
+
getToolTipDisabled (type) {
|
|
61
|
+
const isOverflow = this.$slots.default;
|
|
62
|
+
const toolTipDisabled = isOverflow[0]
|
|
63
|
+
? !(isOverflow[0].elm.scrollWidth > isOverflow[0].elm.clientWidth)
|
|
64
|
+
: this.toolTipDisabled;
|
|
65
|
+
|
|
66
|
+
if (toolTipDisabled !== this.toolTipDisabled) {
|
|
67
|
+
if (toolTipDisabled !== this.tmpToolTipDisabled) {
|
|
68
|
+
this.tmpToolTipDisabled = toolTipDisabled;
|
|
69
|
+
|
|
70
|
+
this.timer = setTimeout(() => {
|
|
71
|
+
this.toolTipDisabled = toolTipDisabled;
|
|
72
|
+
this.tmpToolTipDisabled = this.toolTipDisabled;
|
|
73
|
+
}, 2000);
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
clearTimeout(this.timer);
|
|
77
|
+
}
|
|
85
78
|
}
|
|
86
79
|
}
|
|
87
80
|
};
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.ivu-tooltip-inner {
|
|
9
|
+
padding: 5px 8px;
|
|
9
10
|
border-radius: 4px;
|
|
10
11
|
background: rgba(0, 0, 0, 0.9);
|
|
11
|
-
color: rgba(255, 255, 255, 0.9);
|
|
12
12
|
font-size: 14px;
|
|
13
13
|
font-weight: 400;
|
|
14
|
-
|
|
14
|
+
color: rgba(255, 255, 255, 0.9);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.ivu-tooltip-rel {
|