bkui-vue 0.0.1-beta.175 → 0.0.1-beta.178
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/index.cjs.js +26 -26
- package/dist/index.esm.js +46 -9
- package/dist/index.umd.js +24 -24
- package/lib/directives/ellipsis.d.ts +4 -1
- package/lib/directives/index.js +1 -1
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -11130,6 +11130,9 @@ const ClickOutside = {
|
|
11130
11130
|
nodeList$1.delete(el);
|
11131
11131
|
}
|
11132
11132
|
};
|
11133
|
+
ClickOutside.install = (app) => {
|
11134
|
+
app.directive("bkTooltips", ClickOutside);
|
11135
|
+
};
|
11133
11136
|
const nodeList = /* @__PURE__ */ new Map();
|
11134
11137
|
const tooltips = {
|
11135
11138
|
beforeMount(el, binding) {
|
@@ -11315,6 +11318,16 @@ const createInstance = (el, binding) => {
|
|
11315
11318
|
handleMouseLeave
|
11316
11319
|
}
|
11317
11320
|
});
|
11321
|
+
const destroyInstance = (element) => {
|
11322
|
+
var _a, _b;
|
11323
|
+
handleMouseLeave();
|
11324
|
+
(_a = element != null ? element : el) == null ? void 0 : _a.removeEventListener("mouseenter", handleMouseEnter);
|
11325
|
+
(_b = element != null ? element : el) == null ? void 0 : _b.removeEventListener("mouseleave", handleMouseLeave);
|
11326
|
+
};
|
11327
|
+
return {
|
11328
|
+
destroyInstance,
|
11329
|
+
instance
|
11330
|
+
};
|
11318
11331
|
};
|
11319
11332
|
const ellipsis = {
|
11320
11333
|
mounted(el, binding) {
|
@@ -16015,8 +16028,9 @@ const IColumnType = {
|
|
16015
16028
|
width: PropTypes.oneOfType([PropTypes.number.def(void 0), PropTypes.string.def("auto")]),
|
16016
16029
|
minWidth: PropTypes.oneOfType([PropTypes.number.def(void 0), PropTypes.string.def("auto")]).def(),
|
16017
16030
|
showOverflowTooltip: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
16018
|
-
content: PropTypes.string,
|
16019
|
-
disabled: PropTypes.bool
|
16031
|
+
content: PropTypes.string.def(""),
|
16032
|
+
disabled: PropTypes.bool.def(false),
|
16033
|
+
watchCellResize: PropTypes.bool.def(true)
|
16020
16034
|
})]).def(false),
|
16021
16035
|
type: PropTypes.commonType(["selection", "index", "expand", "none"], "columnType").def("none"),
|
16022
16036
|
resizable: PropTypes.bool.def(true),
|
@@ -16887,6 +16901,8 @@ var TableCell = defineComponent({
|
|
16887
16901
|
const {
|
16888
16902
|
showOverflowTooltip = false
|
16889
16903
|
} = props2.column || {};
|
16904
|
+
let observerIns = null;
|
16905
|
+
let bkEllipsisIns = null;
|
16890
16906
|
const resolveTooltipOption = () => {
|
16891
16907
|
let disabled = true;
|
16892
16908
|
let content = refRoot.value.innerText;
|
@@ -16905,17 +16921,38 @@ var TableCell = defineComponent({
|
|
16905
16921
|
content
|
16906
16922
|
};
|
16907
16923
|
};
|
16924
|
+
const resolveOverflowTooltip = () => {
|
16925
|
+
const textWidth = getElementTextWidth(refRoot.value);
|
16926
|
+
const cellWidth = refRoot.value.clientWidth;
|
16927
|
+
isTipsEnabled.value = textWidth > cellWidth;
|
16928
|
+
if (isTipsEnabled.value) {
|
16929
|
+
const bindings = ref(resolveTooltipOption());
|
16930
|
+
if (bkEllipsisIns === null) {
|
16931
|
+
bkEllipsisIns = createInstance(refRoot.value, bindings);
|
16932
|
+
}
|
16933
|
+
} else {
|
16934
|
+
bkEllipsisIns == null ? void 0 : bkEllipsisIns.destroyInstance(refRoot.value);
|
16935
|
+
bkEllipsisIns = null;
|
16936
|
+
}
|
16937
|
+
};
|
16908
16938
|
onMounted(() => {
|
16909
|
-
|
16910
|
-
|
16911
|
-
|
16912
|
-
|
16913
|
-
|
16914
|
-
|
16915
|
-
|
16939
|
+
var _a;
|
16940
|
+
const {
|
16941
|
+
disabled
|
16942
|
+
} = resolveTooltipOption();
|
16943
|
+
if (!disabled) {
|
16944
|
+
resolveOverflowTooltip();
|
16945
|
+
if (((_a = props2.column.showOverflowTooltip) == null ? void 0 : _a.watchCellResize) !== false) {
|
16946
|
+
observerIns = observerResize(refRoot.value, () => {
|
16947
|
+
resolveOverflowTooltip();
|
16948
|
+
}, 60, true);
|
16949
|
+
observerIns.start();
|
16916
16950
|
}
|
16917
16951
|
}
|
16918
16952
|
});
|
16953
|
+
onBeforeUnmount(() => {
|
16954
|
+
bkEllipsisIns == null ? void 0 : bkEllipsisIns.destroyInstance(refRoot.value);
|
16955
|
+
});
|
16919
16956
|
return () => {
|
16920
16957
|
var _a;
|
16921
16958
|
return createVNode("div", {
|