fangguo-component 1.1.2 → 1.1.4
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/dist/ArgHover.css +20 -1
- package/dist/ArgHover.vue_vue_type_style_index_0_lang-CSymSDRl.js +56 -0
- package/dist/ButtonGroup-DqViorHX.js +134 -0
- package/dist/ButtonGroup.css +35 -1
- package/dist/CitySelect.vue_vue_type_script_setup_true_lang-DZp6834K.js +224 -0
- package/dist/ContentTitle-By0Zk1u7.js +30 -0
- package/dist/ContentTitle.css +6 -1
- package/dist/CustomInputV2-BqhBSO53.js +157 -0
- package/dist/CustomInputV2.css +5 -1
- package/dist/CustomMultipleInput-DRMTUtkE.js +125 -0
- package/dist/CustomMultipleInput.css +8 -1
- package/dist/DragResizable.css +126 -1
- package/dist/DragResizable.vue_vue_type_style_index_0_lang-BePpQHve.js +331 -0
- package/dist/DragSort-5WetnkmW.js +98 -0
- package/dist/DragSort.css +5 -1
- package/dist/ErrorImage-Ao9kEEUg.js +36 -0
- package/dist/ErrorImage.css +4 -1
- package/dist/FgCascader.css +37 -1
- package/dist/FgCascader.vue_vue_type_style_index_0_lang-CM8FxFLJ.js +2424 -0
- package/dist/HSelect-BFkWiCFi.js +671 -0
- package/dist/HSelect.css +80 -1
- package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-BZX7ch2I.js +50 -0
- package/dist/HSelectSJ-DZmtdyjF.js +671 -0
- package/dist/HSelectSJ.css +88 -1
- package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BCIOF-Oy.js +5202 -0
- package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BaXHYlDu.js +92 -0
- package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-D5KGqlj4.js +107 -0
- package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-B2vtU4f4.js +34 -0
- package/dist/LoadingBtn-DWm2cY9k.js +87 -0
- package/dist/LoadingBtn.css +12 -1
- package/dist/MInput-s_P63myh.js +114 -0
- package/dist/MInput.css +21 -1
- package/dist/MyTable-CHvxPYgk.js +94 -0
- package/dist/MyTable.css +33 -1
- package/dist/NoRender.vue_vue_type_script_setup_true_lang-B0G6jxPg.js +31 -0
- package/dist/SelectAddress-CCepDxu8.js +254 -0
- package/dist/SelectAddress.css +18 -1
- package/dist/SelectAll.vue_vue_type_script_setup_true_lang-CyzY8ams.js +101 -0
- package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CrsaohxU.js +103 -0
- package/dist/SelectCustomAll.css +8 -1
- package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-BEZwlGXa.js +111 -0
- package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Dk4TpTBN.js +48 -0
- package/dist/SelectTree-DHbWogEU.js +1276 -0
- package/dist/SelectTree.css +74 -1
- package/dist/SvgIcon-DIg0upEk.js +33 -0
- package/dist/TextCopy-th0FAxwl.js +44 -0
- package/dist/TextCopy.css +7 -1
- package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-DVE1CxPm.js +174 -0
- package/dist/VirtualTable-Cm_L7q9W.js +703 -0
- package/dist/VirtualTable.css +185 -1
- package/dist/_commonjsHelpers-DnzVkjQg.js +38 -0
- package/dist/_plugin-vue_export-helper-1tPrXgE0.js +10 -0
- package/dist/common-B1nSpTGn.js +9669 -0
- package/dist/components/VirtualTable/index.js +2 -2
- package/dist/components/argHover/index.js +2 -2
- package/dist/components/buttonGroup/index.js +2 -2
- package/dist/components/cascader/index.js +2 -2
- package/dist/components/citySelect/index.js +2 -2
- package/dist/components/contentTitle/index.js +2 -2
- package/dist/components/customInputV2/index.js +2 -2
- package/dist/components/customMultipleInput/index.js +2 -2
- package/dist/components/dragResizable/index.js +2 -2
- package/dist/components/dragSort/index.js +2 -2
- package/dist/components/errorImage/index.js +2 -2
- package/dist/components/hSelect/index.js +2 -2
- package/dist/components/hSelectAll/index.js +2 -2
- package/dist/components/hSelectSJ/index.js +2 -2
- package/dist/components/identifyAddress/index.js +2 -2
- package/dist/components/imageLoupe/index.js +2 -2
- package/dist/components/index.js +62 -62
- package/dist/components/lazyComponent/index.js +2 -2
- package/dist/components/lazyPopover/index.js +2 -2
- package/dist/components/loadingBtn/index.js +2 -2
- package/dist/components/mInput/index.js +2 -2
- package/dist/components/myTable/index.js +2 -2
- package/dist/components/noRender/index.js +2 -2
- package/dist/components/selectAddress/index.js +2 -2
- package/dist/components/selectAll/index.js +2 -2
- package/dist/components/selectAll2/index.js +2 -2
- package/dist/components/selectCustomAll/index.js +2 -2
- package/dist/components/selectTimePicker/index.js +2 -2
- package/dist/components/selectTree/index.js +2 -2
- package/dist/components/svgIcon/index.js +2 -2
- package/dist/components/textCopy/index.js +2 -2
- package/dist/components/textEllipsisTooltip/index.js +2 -2
- package/dist/dateShortcuts-DjFC_Txu.js +27 -0
- package/dist/directive/index.js +2 -2
- package/dist/directive/loading/index.js +2 -2
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/usePagination/index.js +2 -2
- package/dist/index-BPnixsfc.js +103 -0
- package/dist/index-C9zyi90j.js +165 -0
- package/dist/index-CSMWzzp0.js +8 -0
- package/dist/index-DfQiknXJ.js +8 -0
- package/dist/index-DzdLpetc.js +29184 -0
- package/dist/index-uQXqC9BF.js +68 -0
- package/dist/index.css +1 -1
- package/dist/index.js +204 -194
- package/dist/loading-CGrVcnNl.js +47 -0
- package/dist/loading.css +110 -1
- package/dist/tools/ImageParserUtils/index.js +17239 -9074
- package/dist/tools/common/index.js +86 -86
- package/dist/tools/index.js +95 -95
- package/dist/usePagination-C63IRXjZ.js +29 -0
- package/dist/vue-virtual-scroller.esm-ZgBoGAjX.js +1507 -0
- package/package.json +1 -1
- package/dist/ArgHover.vue_vue_type_style_index_0_lang-CMhRP09M.js +0 -54
- package/dist/ButtonGroup-C0yZEkxK.js +0 -103
- package/dist/CitySelect.vue_vue_type_script_setup_true_lang-8EbHD3Nt.js +0 -159
- package/dist/ContentTitle-mqrusLjx.js +0 -24
- package/dist/CustomInputV2-uARhbFc8.js +0 -135
- package/dist/CustomMultipleInput-DDaqoHVU.js +0 -109
- package/dist/DragResizable.vue_vue_type_style_index_0_lang-CHv0gJmo.js +0 -179
- package/dist/DragSort-CfDeFAIG.js +0 -66
- package/dist/ErrorImage-CTP_5sal.js +0 -32
- package/dist/FgCascader.vue_vue_type_style_index_0_lang-BUZDDcVn.js +0 -1656
- package/dist/HSelect-Drf6YBwO.js +0 -468
- package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-Blq9xpfa.js +0 -36
- package/dist/HSelectSJ-D3GrXmvj.js +0 -462
- package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BJheMI1q.js +0 -4743
- package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BlX4VbRi.js +0 -79
- package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-vNk68D8E.js +0 -82
- package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-DcOrcH0T.js +0 -33
- package/dist/LoadingBtn-BhbhNboo.js +0 -66
- package/dist/MInput-CpoW17Wh.js +0 -101
- package/dist/MyTable-DmwyEVJb.js +0 -68
- package/dist/NoRender.vue_vue_type_script_setup_true_lang-Do36nSsV.js +0 -30
- package/dist/SelectAddress-B4oK5erq.js +0 -173
- package/dist/SelectAll.vue_vue_type_script_setup_true_lang-BC3q2U8f.js +0 -79
- package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CaET5eli.js +0 -74
- package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-_wCRO217.js +0 -83
- package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Bj0KMOKv.js +0 -45
- package/dist/SelectTree-Dm5259kY.js +0 -911
- package/dist/SvgIcon-C2ah8E0Z.js +0 -30
- package/dist/TextCopy-hOj-Wj2H.js +0 -41
- package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-aZbEQmbM.js +0 -112
- package/dist/VirtualTable-BWugJiQ5.js +0 -349
- package/dist/_commonjsHelpers-ByYUsBRP.js +0 -33
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/common-BIEgCXbl.js +0 -7030
- package/dist/dateShortcuts-DDPtAhDI.js +0 -26
- package/dist/index-BRcBDlVs.js +0 -68
- package/dist/index-CeWudY6u.js +0 -8
- package/dist/index-DIX8TpoT.js +0 -118
- package/dist/index-DpPsTMp0.js +0 -8
- package/dist/index-epuVZjZV.js +0 -103
- package/dist/index-uf7oyYDF.js +0 -16847
- package/dist/loading-DJVNc0eN.js +0 -36
- package/dist/usePagination-CwShBEjA.js +0 -20
- package/dist/vue-virtual-scroller.esm-CH-jx4ri.js +0 -1051
package/dist/SelectTree.css
CHANGED
|
@@ -1 +1,74 @@
|
|
|
1
|
-
.select-tree[data-v-68f09ab5]
|
|
1
|
+
.select-tree[data-v-68f09ab5] {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.select-tree .select-tree-wrapper[data-v-68f09ab5] {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
padding-right: 30px;
|
|
10
|
+
min-height: 32px;
|
|
11
|
+
background-color: white;
|
|
12
|
+
border: 1px solid #dcdfe6;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
flex-wrap: nowrap;
|
|
15
|
+
}
|
|
16
|
+
.select-tree .select-tree-wrapper.is-focused[data-v-68f09ab5] {
|
|
17
|
+
border-color: #4485f5;
|
|
18
|
+
}
|
|
19
|
+
.select-tree .select-tree-wrapper .select-tree-normal-placeholder[data-v-68f09ab5] {
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
flex: 1;
|
|
22
|
+
line-height: 30px;
|
|
23
|
+
margin-inline-start: 5px;
|
|
24
|
+
color: #000;
|
|
25
|
+
}
|
|
26
|
+
.select-tree .select-tree-wrapper .select-tree-normal-placeholder input[data-v-68f09ab5]:focus-visible {
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
.select-tree .select-tree-wrapper .select-tree-normal-value[data-v-68f09ab5] {
|
|
30
|
+
display: contents;
|
|
31
|
+
padding: 5px 4px;
|
|
32
|
+
margin-right: -12px;
|
|
33
|
+
text-wrap: nowrap;
|
|
34
|
+
}
|
|
35
|
+
.select-tree .select-tree-wrapper .select-tree-normal-value .m-val-tag[data-v-68f09ab5] {
|
|
36
|
+
max-width: 60%;
|
|
37
|
+
}
|
|
38
|
+
.select-tree .select-tree-wrapper .select-tree-normal-value .m-val-tag[data-v-68f09ab5] .el-tag__content {
|
|
39
|
+
display: inline-block;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
width: 100%;
|
|
42
|
+
text-overflow: ellipsis;
|
|
43
|
+
}
|
|
44
|
+
.select-tree .select-tree-wrapper .select-tree-arrow[data-v-68f09ab5] {
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 8px;
|
|
47
|
+
right: 10px;
|
|
48
|
+
color: #a8abb2;
|
|
49
|
+
transition: all 0.3s;
|
|
50
|
+
transform: rotateX(0);
|
|
51
|
+
}
|
|
52
|
+
.select-tree .select-tree-wrapper .select-tree-arrow.is-focused[data-v-68f09ab5] {
|
|
53
|
+
transform: rotateZ(-180deg);
|
|
54
|
+
}
|
|
55
|
+
.select-tree .select-tree-wrapper:hover .select-tree-clear[data-v-68f09ab5] {
|
|
56
|
+
display: block;
|
|
57
|
+
}
|
|
58
|
+
.select-tree .select-tree-wrapper .select-tree-clear[data-v-68f09ab5] {
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: 8px;
|
|
61
|
+
right: 10px;
|
|
62
|
+
display: none;
|
|
63
|
+
color: #a8abb2;
|
|
64
|
+
background: #fff;
|
|
65
|
+
transition: all 0.3s;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
transform: rotateX(0);
|
|
68
|
+
}.custom-select-tree-box .el-tree-node__content span {
|
|
69
|
+
display: inline-block;
|
|
70
|
+
max-width: 100%;
|
|
71
|
+
text-overflow: ellipsis;
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { openBlock, createElementBlock, createElementVNode, defineComponent, computed } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
3
|
+
const _sfc_main = defineComponent({
|
|
4
|
+
name: "SvgIcon",
|
|
5
|
+
props: {
|
|
6
|
+
prefix: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "icon"
|
|
9
|
+
},
|
|
10
|
+
name: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(props) {
|
|
16
|
+
const symbolId = computed(() => `#${props.prefix}-${props.name}`);
|
|
17
|
+
return { symbolId };
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const _hoisted_1 = {
|
|
21
|
+
class: "svgicon",
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
};
|
|
24
|
+
const _hoisted_2 = ["xlink:href"];
|
|
25
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
26
|
+
return openBlock(), createElementBlock("svg", _hoisted_1, [
|
|
27
|
+
createElementVNode("use", { "xlink:href": _ctx.symbolId }, null, 8, _hoisted_2)
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
const SvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
31
|
+
export {
|
|
32
|
+
SvgIcon as S
|
|
33
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ElIcon } from "element-plus/es";
|
|
2
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, toDisplayString, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
|
|
3
|
+
import { DocumentCopy } from "@element-plus/icons-vue";
|
|
4
|
+
import { m as copyWord } from "./common-B1nSpTGn.js";
|
|
5
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
6
|
+
import './TextCopy.css';const _hoisted_1 = { class: "fg-text-copy leading-[16px] inline-flex items-center" };
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "TextCopy",
|
|
9
|
+
props: {
|
|
10
|
+
text: String,
|
|
11
|
+
defaultSymbol: {
|
|
12
|
+
default: "-"
|
|
13
|
+
},
|
|
14
|
+
color: {
|
|
15
|
+
default: "#0b0c24"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
const _component_el_icon = ElIcon;
|
|
21
|
+
return openBlock(), createElementBlock("span", _hoisted_1, [
|
|
22
|
+
createElementVNode("span", {
|
|
23
|
+
style: normalizeStyle({ color: __props.color })
|
|
24
|
+
}, toDisplayString(__props.text || __props.defaultSymbol), 5),
|
|
25
|
+
__props.text ? (openBlock(), createBlock(_component_el_icon, {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "fg-text-copy__icon ml-1 cursor-pointer",
|
|
28
|
+
size: 12,
|
|
29
|
+
color: __props.color,
|
|
30
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(copyWord)(__props.text))
|
|
31
|
+
}, {
|
|
32
|
+
default: withCtx(() => [
|
|
33
|
+
createVNode(unref(DocumentCopy))
|
|
34
|
+
]),
|
|
35
|
+
_: 1
|
|
36
|
+
}, 8, ["color"])) : createCommentVNode("", true)
|
|
37
|
+
]);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const TextCopy = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8f259631"]]);
|
|
42
|
+
export {
|
|
43
|
+
TextCopy as T
|
|
44
|
+
};
|
package/dist/TextCopy.css
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
.fg-text-copy__icon[data-v-8f259631] {
|
|
3
|
+
transition: color 0.2s;
|
|
4
|
+
}
|
|
5
|
+
.fg-text-copy__icon[data-v-8f259631]:hover {
|
|
6
|
+
color: var(--el-color-primary);
|
|
7
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { ElTooltip } from "element-plus/es";
|
|
2
|
+
import { defineComponent, ref, watch, onMounted, openBlock, createBlock, withCtx, createElementVNode, mergeProps, toDisplayString, createElementBlock, nextTick } from "vue";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "TextEllipsisTooltip",
|
|
5
|
+
props: {
|
|
6
|
+
value: { default: "" },
|
|
7
|
+
row: { default: 1 },
|
|
8
|
+
width: { default: "100%" },
|
|
9
|
+
textAlign: { default: "center" },
|
|
10
|
+
max: { default: null },
|
|
11
|
+
contentClass: { default: "" },
|
|
12
|
+
unit: { default: "种" }
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const isShowHover = ref(false);
|
|
17
|
+
const textStyle = ref({
|
|
18
|
+
width: props.width
|
|
19
|
+
});
|
|
20
|
+
const textRef = ref();
|
|
21
|
+
const textValue = ref("");
|
|
22
|
+
const textShow = (el) => {
|
|
23
|
+
textRef.value = el;
|
|
24
|
+
};
|
|
25
|
+
const handleString = () => {
|
|
26
|
+
if (props.value) {
|
|
27
|
+
getStyle();
|
|
28
|
+
} else {
|
|
29
|
+
textValue.value = props.value;
|
|
30
|
+
isShowHover.value = false;
|
|
31
|
+
textStyle.value = {
|
|
32
|
+
width: props.width,
|
|
33
|
+
wordBreak: "break-all",
|
|
34
|
+
textAlign: props.textAlign
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function joinArrayWithinMaxLength(arr, maxLength, separator = "") {
|
|
39
|
+
if (!arr || arr.length === 0 || maxLength <= 0) {
|
|
40
|
+
return { text: "", isComplete: true };
|
|
41
|
+
}
|
|
42
|
+
let result = "";
|
|
43
|
+
let currentLength = 0;
|
|
44
|
+
let i = 0;
|
|
45
|
+
for (i = 0; i < arr.length; i++) {
|
|
46
|
+
const itemToAdd = i === 0 ? arr[i] : separator + arr[i];
|
|
47
|
+
const newLength = currentLength + itemToAdd.length;
|
|
48
|
+
if (newLength >= maxLength) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
result = i === 0 ? arr[i] : result + separator + arr[i];
|
|
52
|
+
currentLength = newLength;
|
|
53
|
+
}
|
|
54
|
+
const isComplete = i === arr.length;
|
|
55
|
+
return {
|
|
56
|
+
text: result,
|
|
57
|
+
isComplete
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const handleArray = () => {
|
|
61
|
+
var _a, _b, _c, _d, _e;
|
|
62
|
+
if (props.max) {
|
|
63
|
+
const { text, isComplete } = joinArrayWithinMaxLength(props.value, props.max, ",");
|
|
64
|
+
if (isComplete) {
|
|
65
|
+
textValue.value = text;
|
|
66
|
+
isShowHover.value = false;
|
|
67
|
+
} else {
|
|
68
|
+
textValue.value = text + `等${(_a = props.value) == null ? void 0 : _a.length}${props.unit}`;
|
|
69
|
+
isShowHover.value = true;
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
if (Number((_b = props.value) == null ? void 0 : _b.length) > 1) {
|
|
73
|
+
textValue.value = ((_c = props.value) == null ? void 0 : _c[0]) + `等${(_d = props.value) == null ? void 0 : _d.length}${props.unit}`;
|
|
74
|
+
isShowHover.value = true;
|
|
75
|
+
} else {
|
|
76
|
+
textValue.value = (_e = props.value) == null ? void 0 : _e[0];
|
|
77
|
+
isShowHover.value = false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
textStyle.value = {
|
|
81
|
+
width: props.width,
|
|
82
|
+
wordBreak: "break-all",
|
|
83
|
+
textAlign: props.textAlign
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
watch([() => props.value, () => props.width, () => props.row, () => props.max], () => {
|
|
87
|
+
var _a;
|
|
88
|
+
if (Array.isArray(props.value) && ((_a = props.value) == null ? void 0 : _a.length)) {
|
|
89
|
+
handleArray();
|
|
90
|
+
} else {
|
|
91
|
+
handleString();
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const handleShowTooltip = () => {
|
|
95
|
+
const lineHeight = Number(getComputedStyle(textRef.value).lineHeight.replace("px", ""));
|
|
96
|
+
const height = Number(getComputedStyle(textRef.value).height.replace("px", ""));
|
|
97
|
+
if (props.max) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
if (height > lineHeight * props.row * 1.2) {
|
|
101
|
+
isShowHover.value = true;
|
|
102
|
+
textStyle.value = {
|
|
103
|
+
overflow: "hidden",
|
|
104
|
+
textOverflow: "ellipsis",
|
|
105
|
+
display: "-webkit-box",
|
|
106
|
+
webkitLineClamp: props.row,
|
|
107
|
+
webkitBoxOrient: "vertical",
|
|
108
|
+
cursor: "pointer",
|
|
109
|
+
width: props.width,
|
|
110
|
+
wordBreak: "break-all",
|
|
111
|
+
textAlign: props.textAlign
|
|
112
|
+
};
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
};
|
|
117
|
+
const getStyle = () => {
|
|
118
|
+
var _a;
|
|
119
|
+
textValue.value = props.max ? (_a = props.value) == null ? void 0 : _a.substring(0, props.max) : props.value;
|
|
120
|
+
isShowHover.value = false;
|
|
121
|
+
textStyle.value = {
|
|
122
|
+
width: props.width,
|
|
123
|
+
wordBreak: "break-all",
|
|
124
|
+
textAlign: props.textAlign
|
|
125
|
+
};
|
|
126
|
+
nextTick(() => {
|
|
127
|
+
setTimeout(() => {
|
|
128
|
+
var _a2, _b;
|
|
129
|
+
if (props.max) {
|
|
130
|
+
const showTooltip = handleShowTooltip();
|
|
131
|
+
if (!showTooltip) {
|
|
132
|
+
textValue.value = ((_a2 = props.value) == null ? void 0 : _a2.length) > props.max ? textValue.value + "..." : textValue.value;
|
|
133
|
+
isShowHover.value = ((_b = props.value) == null ? void 0 : _b.length) > props.max;
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
handleShowTooltip();
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
onMounted(() => {
|
|
142
|
+
if (Array.isArray(props.value)) {
|
|
143
|
+
handleArray();
|
|
144
|
+
} else {
|
|
145
|
+
getStyle();
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
return (_ctx, _cache) => {
|
|
149
|
+
const _component_el_tooltip = ElTooltip;
|
|
150
|
+
return isShowHover.value ? (openBlock(), createBlock(_component_el_tooltip, {
|
|
151
|
+
key: 0,
|
|
152
|
+
content: `<div class='${__props.contentClass}'>${Array.isArray(__props.value) ? __props.value.join(",") : __props.value}</div>`,
|
|
153
|
+
"raw-content": "",
|
|
154
|
+
effect: "dark",
|
|
155
|
+
placement: "top-start",
|
|
156
|
+
"visible-arrow": false
|
|
157
|
+
}, {
|
|
158
|
+
default: withCtx(() => [
|
|
159
|
+
createElementVNode("div", mergeProps({
|
|
160
|
+
ref: textShow,
|
|
161
|
+
style: { "cursor": "pointer" }
|
|
162
|
+
}, _ctx.$attrs, { style: textStyle.value }), toDisplayString(textValue.value), 17)
|
|
163
|
+
]),
|
|
164
|
+
_: 1
|
|
165
|
+
}, 8, ["content"])) : (openBlock(), createElementBlock("div", mergeProps({
|
|
166
|
+
key: 1,
|
|
167
|
+
style: textStyle.value
|
|
168
|
+
}, _ctx.$attrs, { ref: textShow }), toDisplayString(textValue.value), 17));
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
export {
|
|
173
|
+
_sfc_main as _
|
|
174
|
+
};
|