bkui-vue 0.0.1-beta.379 → 0.0.1-beta.380
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 +33 -30
- package/dist/index.esm.js +211 -52
- package/dist/index.umd.js +37 -34
- package/dist/style.css +1 -1
- package/lib/alert/alert.d.ts +1 -1
- package/lib/alert/index.d.ts +4 -4
- package/lib/badge/badge.d.ts +2 -2
- package/lib/badge/index.d.ts +7 -7
- package/lib/breadcrumb/breadcrumb.d.ts +1 -1
- package/lib/breadcrumb/index.d.ts +4 -4
- package/lib/button/button.d.ts +1 -1
- package/lib/button/index.d.ts +4 -4
- package/lib/card/card.d.ts +1 -1
- package/lib/card/index.d.ts +4 -4
- package/lib/cascader/cascader-panel.d.ts +1 -1
- package/lib/cascader/cascader.d.ts +3 -3
- package/lib/cascader/index.d.ts +11 -11
- package/lib/checkbox/checkbox.d.ts +1 -1
- package/lib/checkbox/index.d.ts +4 -4
- package/lib/color-picker/color-picker.d.ts +2 -2
- package/lib/color-picker/index.d.ts +7 -7
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -1
- package/lib/container/container.d.ts +1 -1
- package/lib/container/index.d.ts +4 -4
- package/lib/date-picker/date-picker.d.ts +3 -3
- package/lib/date-picker/index.d.ts +10 -10
- package/lib/date-picker/panel/time-range.d.ts +3 -3
- package/lib/date-picker/panel/time.d.ts +3 -3
- package/lib/date-picker/time-picker.d.ts +3 -3
- package/lib/directives/index.d.ts +1 -0
- package/lib/directives/index.js +1 -1
- package/lib/divider/divider.d.ts +1 -1
- package/lib/divider/index.d.ts +4 -4
- package/lib/dropdown/dropdown.d.ts +1 -1
- package/lib/dropdown/index.d.ts +4 -4
- package/lib/icon/image-fill.js +1 -0
- package/lib/icon/index.js +1 -1
- package/lib/link/index.d.ts +7 -7
- package/lib/link/link.d.ts +2 -2
- package/lib/loading/index.d.ts +7 -7
- package/lib/loading/loading.d.ts +2 -2
- package/lib/menu/index.d.ts +4 -4
- package/lib/menu/menu.d.ts +1 -1
- package/lib/overflow-title/components/OverflowTitle.d.ts +38 -0
- package/lib/overflow-title/directive/overflowTitle.d.ts +3 -0
- package/lib/overflow-title/index.d.ts +129 -0
- package/lib/overflow-title/index.js +1 -0
- package/lib/overflow-title/overflow.css +11 -0
- package/lib/overflow-title/overflow.less +13 -0
- package/lib/overflow-title/overflow.variable.css +11 -0
- package/lib/overflow-title/props.d.ts +16 -0
- package/lib/overflow-title/utils/getActualWidthByCanvas.d.ts +3 -0
- package/lib/overflow-title/utils/getActualWidthByDom.d.ts +3 -0
- package/lib/pagination/index.d.ts +4 -4
- package/lib/pagination/pagination.d.ts +1 -1
- package/lib/popover/index.d.ts +10 -10
- package/lib/popover/popover.d.ts +3 -3
- package/lib/progress/index.d.ts +4 -4
- package/lib/progress/progress.d.ts +1 -1
- package/lib/resize-layout/index.d.ts +4 -4
- package/lib/resize-layout/resize-layout.d.ts +1 -1
- package/lib/select/index.d.ts +11 -11
- package/lib/select/optionGroup.d.ts +1 -1
- package/lib/select/select.d.ts +3 -3
- package/lib/slider/index.d.ts +4 -4
- package/lib/slider/slider.d.ts +1 -1
- package/lib/switcher/index.d.ts +4 -4
- package/lib/switcher/switcher.d.ts +1 -1
- package/lib/tab/index.d.ts +5 -5
- package/lib/tab/tab-panel.d.ts +1 -1
- package/lib/tab/tab.d.ts +1 -1
- package/lib/table/const.d.ts +11 -1
- package/lib/table/index.d.ts +28 -16
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/head-filter.d.ts +1 -1
- package/lib/table/props.d.ts +2 -2
- package/lib/table/table.d.ts +10 -6
- package/lib/table/utils.d.ts +2 -0
- package/lib/table-column/index.js +1 -1
- package/lib/tag-input/index.d.ts +4 -4
- package/lib/tag-input/tag-input.d.ts +1 -1
- package/lib/time-picker/index.d.ts +10 -10
- package/lib/upload/index.d.ts +10 -10
- package/lib/upload/upload-list.d.ts +2 -2
- package/lib/upload/upload-trigger.d.ts +2 -2
- package/lib/upload/upload.d.ts +3 -3
- package/package.json +1 -1
- package/lib/icon/img-error.js +0 -1
package/dist/index.esm.js
CHANGED
@@ -849,8 +849,8 @@ function getDocumentRect$1(element) {
|
|
849
849
|
};
|
850
850
|
}
|
851
851
|
function isScrollParent(element) {
|
852
|
-
var _getComputedStyle = getComputedStyle$2(element),
|
853
|
-
return /auto|scroll|overlay|hidden/.test(
|
852
|
+
var _getComputedStyle = getComputedStyle$2(element), overflow2 = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
853
|
+
return /auto|scroll|overlay|hidden/.test(overflow2 + overflowY + overflowX);
|
854
854
|
}
|
855
855
|
function getScrollParent(node) {
|
856
856
|
if (["html", "body", "#document"].indexOf(getNodeName$1(node)) >= 0) {
|
@@ -1079,7 +1079,7 @@ function flip$1(_ref) {
|
|
1079
1079
|
var isStartVariation = getVariation(placement) === start;
|
1080
1080
|
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
1081
1081
|
var len = isVertical ? "width" : "height";
|
1082
|
-
var
|
1082
|
+
var overflow2 = detectOverflow$1(state, {
|
1083
1083
|
placement,
|
1084
1084
|
boundary,
|
1085
1085
|
rootBoundary,
|
@@ -1093,10 +1093,10 @@ function flip$1(_ref) {
|
|
1093
1093
|
var altVariationSide = getOppositePlacement$1(mainVariationSide);
|
1094
1094
|
var checks = [];
|
1095
1095
|
if (checkMainAxis) {
|
1096
|
-
checks.push(
|
1096
|
+
checks.push(overflow2[_basePlacement] <= 0);
|
1097
1097
|
}
|
1098
1098
|
if (checkAltAxis) {
|
1099
|
-
checks.push(
|
1099
|
+
checks.push(overflow2[mainVariationSide] <= 0, overflow2[altVariationSide] <= 0);
|
1100
1100
|
}
|
1101
1101
|
if (checks.every(function(check) {
|
1102
1102
|
return check;
|
@@ -1145,7 +1145,7 @@ var flip$2 = {
|
|
1145
1145
|
_skip: false
|
1146
1146
|
}
|
1147
1147
|
};
|
1148
|
-
function getSideOffsets$1(
|
1148
|
+
function getSideOffsets$1(overflow2, rect, preventedOffsets) {
|
1149
1149
|
if (preventedOffsets === void 0) {
|
1150
1150
|
preventedOffsets = {
|
1151
1151
|
x: 0,
|
@@ -1153,15 +1153,15 @@ function getSideOffsets$1(overflow, rect, preventedOffsets) {
|
|
1153
1153
|
};
|
1154
1154
|
}
|
1155
1155
|
return {
|
1156
|
-
top:
|
1157
|
-
right:
|
1158
|
-
bottom:
|
1159
|
-
left:
|
1156
|
+
top: overflow2.top - rect.height - preventedOffsets.y,
|
1157
|
+
right: overflow2.right - rect.width + preventedOffsets.x,
|
1158
|
+
bottom: overflow2.bottom - rect.height + preventedOffsets.y,
|
1159
|
+
left: overflow2.left - rect.width - preventedOffsets.x
|
1160
1160
|
};
|
1161
1161
|
}
|
1162
|
-
function isAnySideFullyClipped$1(
|
1162
|
+
function isAnySideFullyClipped$1(overflow2) {
|
1163
1163
|
return [top, right, bottom, left].some(function(side) {
|
1164
|
-
return
|
1164
|
+
return overflow2[side] >= 0;
|
1165
1165
|
});
|
1166
1166
|
}
|
1167
1167
|
function hide$2(_ref) {
|
@@ -1256,7 +1256,7 @@ function getAltAxis(axis) {
|
|
1256
1256
|
function preventOverflow(_ref) {
|
1257
1257
|
var state = _ref.state, options = _ref.options, name = _ref.name;
|
1258
1258
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
1259
|
-
var
|
1259
|
+
var overflow2 = detectOverflow$1(state, {
|
1260
1260
|
boundary,
|
1261
1261
|
rootBoundary,
|
1262
1262
|
padding,
|
@@ -1294,8 +1294,8 @@ function preventOverflow(_ref) {
|
|
1294
1294
|
var altSide = mainAxis === "y" ? bottom : right;
|
1295
1295
|
var len = mainAxis === "y" ? "height" : "width";
|
1296
1296
|
var offset2 = popperOffsets2[mainAxis];
|
1297
|
-
var min2 = offset2 +
|
1298
|
-
var max2 = offset2 -
|
1297
|
+
var min2 = offset2 + overflow2[mainSide];
|
1298
|
+
var max2 = offset2 - overflow2[altSide];
|
1299
1299
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
1300
1300
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
1301
1301
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
@@ -1325,8 +1325,8 @@ function preventOverflow(_ref) {
|
|
1325
1325
|
var _altSide = mainAxis === "x" ? bottom : right;
|
1326
1326
|
var _offset = popperOffsets2[altAxis];
|
1327
1327
|
var _len = altAxis === "y" ? "height" : "width";
|
1328
|
-
var _min = _offset +
|
1329
|
-
var _max = _offset -
|
1328
|
+
var _min = _offset + overflow2[_mainSide];
|
1329
|
+
var _max = _offset - overflow2[_altSide];
|
1330
1330
|
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
1331
1331
|
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
1332
1332
|
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
@@ -10502,7 +10502,7 @@ var Component$u = defineComponent({
|
|
10502
10502
|
}
|
10503
10503
|
});
|
10504
10504
|
const BkModal = withInstallProps(Component$u, { propsMixin: propsMixin$1 }, true);
|
10505
|
-
const props = __spreadProps(__spreadValues({}, propsMixin$1), {
|
10505
|
+
const props$1 = __spreadProps(__spreadValues({}, propsMixin$1), {
|
10506
10506
|
width: PropTypes.oneOfType([String, Number]).def(""),
|
10507
10507
|
height: PropTypes.oneOfType([String, Number]).def(""),
|
10508
10508
|
confirmText: PropTypes.string.def("\u786E\u5B9A"),
|
@@ -10527,7 +10527,7 @@ var Dialog = defineComponent({
|
|
10527
10527
|
BkModal,
|
10528
10528
|
BkButton
|
10529
10529
|
},
|
10530
|
-
props,
|
10530
|
+
props: props$1,
|
10531
10531
|
emits: ["closed", "update:isShow", "confirm", "prev", "next", "value-change"],
|
10532
10532
|
setup(props2, {
|
10533
10533
|
emit
|
@@ -10941,6 +10941,48 @@ var Component$r = defineComponent({
|
|
10941
10941
|
}
|
10942
10942
|
});
|
10943
10943
|
const BkLink = withInstall(Component$r);
|
10944
|
+
function getActualWidthByCanvas(text, options) {
|
10945
|
+
const { fontSize = 14, fontFamily = "Microsoft YaHei" } = options;
|
10946
|
+
const canvas = document.createElement("canvas");
|
10947
|
+
const ctx = canvas.getContext("2d");
|
10948
|
+
ctx.font = `${fontSize}px ${fontFamily}`;
|
10949
|
+
const metrics = ctx.measureText(text);
|
10950
|
+
const actual = Math.abs(metrics.actualBoundingBoxLeft) + Math.abs(metrics.actualBoundingBoxRight);
|
10951
|
+
return Math.max(metrics.width, actual);
|
10952
|
+
}
|
10953
|
+
function getActualWidthByDom(text, options, dom = document.body) {
|
10954
|
+
const { fontSize, fontFamily } = options || {};
|
10955
|
+
const tempDom = document.createElement("div");
|
10956
|
+
tempDom.style.cssText = `position: absolute;left: -999em;top:-999em;z-index: -1;text-overflow: initial;
|
10957
|
+
${fontSize ? `font-size:${fontSize} ;` : ""}
|
10958
|
+
${fontFamily ? `font-family:${fontFamily} ` : ""}
|
10959
|
+
`;
|
10960
|
+
tempDom.innerText = text;
|
10961
|
+
dom.append(tempDom);
|
10962
|
+
const { clientWidth } = tempDom;
|
10963
|
+
dom.removeChild(tempDom);
|
10964
|
+
return clientWidth;
|
10965
|
+
}
|
10966
|
+
const overflowTitle = {
|
10967
|
+
mounted(el, { value = {} }) {
|
10968
|
+
const { clientWidth } = el.parentElement;
|
10969
|
+
if (!clientWidth) {
|
10970
|
+
return;
|
10971
|
+
}
|
10972
|
+
const { content, calType = "dom" } = value;
|
10973
|
+
const text = content || el.innerText;
|
10974
|
+
let textWidth = 0;
|
10975
|
+
if (calType === "dom") {
|
10976
|
+
textWidth = getActualWidthByDom(el.textContent, null, el.parentElement);
|
10977
|
+
} else {
|
10978
|
+
const { fontSize, fontFamily } = getComputedStyle(el);
|
10979
|
+
textWidth = getActualWidthByCanvas(text, { fontSize, fontFamily });
|
10980
|
+
}
|
10981
|
+
if (textWidth > clientWidth) {
|
10982
|
+
el.setAttribute("title", text);
|
10983
|
+
}
|
10984
|
+
}
|
10985
|
+
};
|
10944
10986
|
var _populated = false;
|
10945
10987
|
var _ie, _firefox, _opera, _webkit, _chrome;
|
10946
10988
|
var _ie_real_version;
|
@@ -12104,7 +12146,7 @@ const autoPlacement = function(options) {
|
|
12104
12146
|
"autoAlignment"
|
12105
12147
|
]);
|
12106
12148
|
const placements2 = getPlacementList(alignment, autoAlignment, allowedPlacements);
|
12107
|
-
const
|
12149
|
+
const overflow2 = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
12108
12150
|
const currentIndex = (_middlewareData$autoP = (_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.index) != null ? _middlewareData$autoP : 0;
|
12109
12151
|
const currentPlacement = placements2[currentIndex];
|
12110
12152
|
if (currentPlacement == null) {
|
@@ -12123,7 +12165,7 @@ const autoPlacement = function(options) {
|
|
12123
12165
|
}
|
12124
12166
|
};
|
12125
12167
|
}
|
12126
|
-
const currentOverflows = [
|
12168
|
+
const currentOverflows = [overflow2[getSide(currentPlacement)], overflow2[main2], overflow2[cross]];
|
12127
12169
|
const allOverflows = [...(_middlewareData$autoP3 = (_middlewareData$autoP4 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP4.overflows) != null ? _middlewareData$autoP3 : [], {
|
12128
12170
|
placement: currentPlacement,
|
12129
12171
|
overflows: currentOverflows
|
@@ -12145,7 +12187,7 @@ const autoPlacement = function(options) {
|
|
12145
12187
|
let {
|
12146
12188
|
overflows
|
12147
12189
|
} = _ref;
|
12148
|
-
return overflows.every((
|
12190
|
+
return overflows.every((overflow3) => overflow3 <= 0);
|
12149
12191
|
})) == null ? void 0 : _placementsSortedByLe.placement;
|
12150
12192
|
const resetPlacement = placementThatFitsOnAllSides != null ? placementThatFitsOnAllSides : placementsSortedByLeastOverflow[0].placement;
|
12151
12193
|
if (resetPlacement !== placement) {
|
@@ -12201,18 +12243,18 @@ const flip = function(options) {
|
|
12201
12243
|
const isBasePlacement = side === initialPlacement;
|
12202
12244
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
12203
12245
|
const placements2 = [initialPlacement, ...fallbackPlacements];
|
12204
|
-
const
|
12246
|
+
const overflow2 = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
12205
12247
|
const overflows = [];
|
12206
12248
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
12207
12249
|
if (checkMainAxis) {
|
12208
|
-
overflows.push(
|
12250
|
+
overflows.push(overflow2[side]);
|
12209
12251
|
}
|
12210
12252
|
if (checkCrossAxis) {
|
12211
12253
|
const {
|
12212
12254
|
main: main2,
|
12213
12255
|
cross
|
12214
12256
|
} = getAlignmentSides(placement, rects, await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)));
|
12215
|
-
overflows.push(
|
12257
|
+
overflows.push(overflow2[main2], overflow2[cross]);
|
12216
12258
|
}
|
12217
12259
|
overflowsData = [...overflowsData, {
|
12218
12260
|
placement,
|
@@ -12237,7 +12279,7 @@ const flip = function(options) {
|
|
12237
12279
|
switch (fallbackStrategy) {
|
12238
12280
|
case "bestFit": {
|
12239
12281
|
var _overflowsData$map$so;
|
12240
|
-
const placement2 = (_overflowsData$map$so = overflowsData.map((d2) => [d2, d2.overflows.filter((
|
12282
|
+
const placement2 = (_overflowsData$map$so = overflowsData.map((d2) => [d2, d2.overflows.filter((overflow3) => overflow3 > 0).reduce((acc, overflow3) => acc + overflow3, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
|
12241
12283
|
if (placement2) {
|
12242
12284
|
resetPlacement = placement2;
|
12243
12285
|
}
|
@@ -12259,16 +12301,16 @@ const flip = function(options) {
|
|
12259
12301
|
}
|
12260
12302
|
};
|
12261
12303
|
};
|
12262
|
-
function getSideOffsets(
|
12304
|
+
function getSideOffsets(overflow2, rect) {
|
12263
12305
|
return {
|
12264
|
-
top:
|
12265
|
-
right:
|
12266
|
-
bottom:
|
12267
|
-
left:
|
12306
|
+
top: overflow2.top - rect.height,
|
12307
|
+
right: overflow2.right - rect.width,
|
12308
|
+
bottom: overflow2.bottom - rect.height,
|
12309
|
+
left: overflow2.left - rect.width
|
12268
12310
|
};
|
12269
12311
|
}
|
12270
|
-
function isAnySideFullyClipped(
|
12271
|
-
return sides.some((side) =>
|
12312
|
+
function isAnySideFullyClipped(overflow2) {
|
12313
|
+
return sides.some((side) => overflow2[side] >= 0);
|
12272
12314
|
}
|
12273
12315
|
const hide = function(_temp) {
|
12274
12316
|
let _a = _temp === void 0 ? {} : _temp, {
|
@@ -12284,10 +12326,10 @@ const hide = function(_temp) {
|
|
12284
12326
|
} = middlewareArguments;
|
12285
12327
|
switch (strategy) {
|
12286
12328
|
case "referenceHidden": {
|
12287
|
-
const
|
12329
|
+
const overflow2 = await detectOverflow(middlewareArguments, __spreadProps(__spreadValues({}, detectOverflowOptions), {
|
12288
12330
|
elementContext: "reference"
|
12289
12331
|
}));
|
12290
|
-
const offsets = getSideOffsets(
|
12332
|
+
const offsets = getSideOffsets(overflow2, rects.reference);
|
12291
12333
|
return {
|
12292
12334
|
data: {
|
12293
12335
|
referenceHiddenOffsets: offsets,
|
@@ -12296,10 +12338,10 @@ const hide = function(_temp) {
|
|
12296
12338
|
};
|
12297
12339
|
}
|
12298
12340
|
case "escaped": {
|
12299
|
-
const
|
12341
|
+
const overflow2 = await detectOverflow(middlewareArguments, __spreadProps(__spreadValues({}, detectOverflowOptions), {
|
12300
12342
|
altBoundary: true
|
12301
12343
|
}));
|
12302
|
-
const offsets = getSideOffsets(
|
12344
|
+
const offsets = getSideOffsets(overflow2, rects.floating);
|
12303
12345
|
return {
|
12304
12346
|
data: {
|
12305
12347
|
escapedOffsets: offsets,
|
@@ -12412,7 +12454,7 @@ const shift = function(options) {
|
|
12412
12454
|
x: x2,
|
12413
12455
|
y: y2
|
12414
12456
|
};
|
12415
|
-
const
|
12457
|
+
const overflow2 = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
12416
12458
|
const mainAxis = getMainAxisFromPlacement(getSide(placement));
|
12417
12459
|
const crossAxis = getCrossAxis(mainAxis);
|
12418
12460
|
let mainAxisCoord = coords[mainAxis];
|
@@ -12420,15 +12462,15 @@ const shift = function(options) {
|
|
12420
12462
|
if (checkMainAxis) {
|
12421
12463
|
const minSide = mainAxis === "y" ? "top" : "left";
|
12422
12464
|
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
12423
|
-
const min2 = mainAxisCoord +
|
12424
|
-
const max2 = mainAxisCoord -
|
12465
|
+
const min2 = mainAxisCoord + overflow2[minSide];
|
12466
|
+
const max2 = mainAxisCoord - overflow2[maxSide];
|
12425
12467
|
mainAxisCoord = within(min2, mainAxisCoord, max2);
|
12426
12468
|
}
|
12427
12469
|
if (checkCrossAxis) {
|
12428
12470
|
const minSide = crossAxis === "y" ? "top" : "left";
|
12429
12471
|
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
12430
|
-
const min2 = crossAxisCoord +
|
12431
|
-
const max2 = crossAxisCoord -
|
12472
|
+
const min2 = crossAxisCoord + overflow2[minSide];
|
12473
|
+
const max2 = crossAxisCoord - overflow2[maxSide];
|
12432
12474
|
crossAxisCoord = within(min2, crossAxisCoord, max2);
|
12433
12475
|
}
|
12434
12476
|
const limitedCoords = limiter.fn(__spreadProps(__spreadValues({}, middlewareArguments), {
|
@@ -12584,11 +12626,11 @@ function isShadowRoot(node) {
|
|
12584
12626
|
}
|
12585
12627
|
function isOverflowElement(element) {
|
12586
12628
|
const {
|
12587
|
-
overflow,
|
12629
|
+
overflow: overflow2,
|
12588
12630
|
overflowX,
|
12589
12631
|
overflowY
|
12590
12632
|
} = getComputedStyle$1$1(element);
|
12591
|
-
return /auto|scroll|overlay|hidden/.test(
|
12633
|
+
return /auto|scroll|overlay|hidden/.test(overflow2 + overflowY + overflowX);
|
12592
12634
|
}
|
12593
12635
|
function isTableElement(element) {
|
12594
12636
|
return ["table", "td", "th"].includes(getNodeName(element));
|
@@ -16368,6 +16410,10 @@ var EMIT_EVENTS = /* @__PURE__ */ ((EMIT_EVENTS2) => {
|
|
16368
16410
|
EMIT_EVENTS2["ROW_SELECT"] = "select";
|
16369
16411
|
EMIT_EVENTS2["ROW_SELECT_ALL"] = "selectAll";
|
16370
16412
|
EMIT_EVENTS2["ROW_SELECT_CHANGE"] = "selectionChange";
|
16413
|
+
EMIT_EVENTS2["CELL_CLICK"] = "cellClick";
|
16414
|
+
EMIT_EVENTS2["CELL_DBL_CLICK"] = "cellDblclick";
|
16415
|
+
EMIT_EVENTS2["NATIVE_CLICK"] = "click";
|
16416
|
+
EMIT_EVENTS2["NATIVE_DBL_CLICK"] = "dblclick";
|
16371
16417
|
return EMIT_EVENTS2;
|
16372
16418
|
})(EMIT_EVENTS || {});
|
16373
16419
|
const EMPTY$1 = (..._args) => true;
|
@@ -16385,7 +16431,9 @@ const EMIT_EVENT_TYPES = {
|
|
16385
16431
|
["pageLimitChange"]: EMPTY$1,
|
16386
16432
|
["pageValueChange"]: EMPTY$1,
|
16387
16433
|
["settingChange"]: EMPTY$1,
|
16388
|
-
["scrollBottom"]: EMPTY$1
|
16434
|
+
["scrollBottom"]: EMPTY$1,
|
16435
|
+
["cellClick"]: EMPTY$1,
|
16436
|
+
["cellDblclick"]: EMPTY$1
|
16389
16437
|
};
|
16390
16438
|
const TABLE_ROW_ATTRIBUTE = {
|
16391
16439
|
ROW_INDEX: "__$table_row_index",
|
@@ -17939,6 +17987,8 @@ const getRowId = (row, index2, props2) => {
|
|
17939
17987
|
}
|
17940
17988
|
return index2;
|
17941
17989
|
};
|
17990
|
+
const getRowSourceData = (row) => unref(row[TABLE_ROW_ATTRIBUTE.ROW_SOURCE_DATA] || row);
|
17991
|
+
const getColumnSourceData = (column) => unref(column[COLUMN_ATTRIBUTE.COL_SOURCE_DATA] || column);
|
17942
17992
|
var TableCell = defineComponent({
|
17943
17993
|
name: "TableCell",
|
17944
17994
|
props: {
|
@@ -18916,12 +18966,27 @@ class TableRender {
|
|
18916
18966
|
"expand-row": row[TABLE_ROW_ATTRIBUTE.ROW_EXPAND],
|
18917
18967
|
"is-last": rowIndex + rowspan >= rowLength
|
18918
18968
|
}];
|
18969
|
+
const handleEmit = (event, type) => {
|
18970
|
+
const args = {
|
18971
|
+
event,
|
18972
|
+
row: getRowSourceData(row),
|
18973
|
+
column: getColumnSourceData(column),
|
18974
|
+
cell: {
|
18975
|
+
getValue: () => this.renderCell(row, column, rowIndex, rows)
|
18976
|
+
},
|
18977
|
+
rowIndex,
|
18978
|
+
columnIndex: index2
|
18979
|
+
};
|
18980
|
+
this.context.emit(type, args);
|
18981
|
+
};
|
18919
18982
|
return createVNode("td", {
|
18920
18983
|
"class": cellClass,
|
18921
18984
|
"style": cellStyle,
|
18922
18985
|
"key": cellKey,
|
18923
18986
|
"colspan": colspan,
|
18924
|
-
"rowspan": rowspan
|
18987
|
+
"rowspan": rowspan,
|
18988
|
+
"onClick": (event) => handleEmit(event, EMIT_EVENTS.CELL_CLICK),
|
18989
|
+
"onDblclick": (event) => handleEmit(event, EMIT_EVENTS.CELL_DBL_CLICK)
|
18925
18990
|
}, [createVNode(TableCell, {
|
18926
18991
|
"class": tdCtxClass,
|
18927
18992
|
"column": column,
|
@@ -18954,7 +19019,7 @@ class TableRender {
|
|
18954
19019
|
}, [createVNode("td", {
|
18955
19020
|
"colspan": this.filterColgroups.length,
|
18956
19021
|
"rowspan": 1
|
18957
|
-
}, [(_c = (_b = (_a = this.context.slots).expandRow) == null ? void 0 : _b.call(_a, row
|
19022
|
+
}, [(_c = (_b = (_a = this.context.slots).expandRow) == null ? void 0 : _b.call(_a, getRowSourceData(row))) != null ? _c : createVNode("div", {
|
18958
19023
|
"class": "expand-cell-ctx"
|
18959
19024
|
}, [createTextVNode("Expand Row")])])])];
|
18960
19025
|
}
|
@@ -19892,8 +19957,8 @@ var Component$e = defineComponent({
|
|
19892
19957
|
e
|
19893
19958
|
} = args;
|
19894
19959
|
ctx.emit(EMIT_EVENTS.ROW_EXPAND_CLICK, {
|
19895
|
-
row:
|
19896
|
-
column:
|
19960
|
+
row: getRowSourceData(row),
|
19961
|
+
column: getColumnSourceData(column),
|
19897
19962
|
index: index2,
|
19898
19963
|
rows,
|
19899
19964
|
e
|
@@ -19914,14 +19979,14 @@ var Component$e = defineComponent({
|
|
19914
19979
|
} else {
|
19915
19980
|
toggleRowSelection(row, value);
|
19916
19981
|
ctx.emit(EMIT_EVENTS.ROW_SELECT, {
|
19917
|
-
row:
|
19982
|
+
row: getRowSourceData(row),
|
19918
19983
|
index: index2,
|
19919
19984
|
checked: value,
|
19920
19985
|
data: props2.data
|
19921
19986
|
});
|
19922
19987
|
}
|
19923
19988
|
ctx.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
19924
|
-
row:
|
19989
|
+
row: getRowSourceData(row),
|
19925
19990
|
isAll,
|
19926
19991
|
index: index2,
|
19927
19992
|
checked: value,
|
@@ -39299,6 +39364,99 @@ var Component = defineComponent({
|
|
39299
39364
|
}
|
39300
39365
|
});
|
39301
39366
|
const BkSearchSelect = withInstall(Component);
|
39367
|
+
var props = {
|
39368
|
+
content: String,
|
39369
|
+
type: {
|
39370
|
+
type: String,
|
39371
|
+
default: "title"
|
39372
|
+
},
|
39373
|
+
calType: {
|
39374
|
+
type: String,
|
39375
|
+
default: "dom"
|
39376
|
+
},
|
39377
|
+
resizeable: Boolean
|
39378
|
+
};
|
39379
|
+
var overflow = "";
|
39380
|
+
var OverflowTitle = defineComponent({
|
39381
|
+
name: "OverflowTitle",
|
39382
|
+
props,
|
39383
|
+
setup(props2, {
|
39384
|
+
slots
|
39385
|
+
}) {
|
39386
|
+
const boxRef = ref(null);
|
39387
|
+
const textRef = ref(null);
|
39388
|
+
const isShowTips = ref(false);
|
39389
|
+
const textProps = shallowRef();
|
39390
|
+
const contentText = computed(() => {
|
39391
|
+
var _a;
|
39392
|
+
if (props2.content) {
|
39393
|
+
return props2.content;
|
39394
|
+
}
|
39395
|
+
return (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots);
|
39396
|
+
});
|
39397
|
+
onMounted(() => {
|
39398
|
+
const {
|
39399
|
+
clientWidth
|
39400
|
+
} = boxRef.value;
|
39401
|
+
const resizeHandler = debounce(500, () => {
|
39402
|
+
isShowTips.value = false;
|
39403
|
+
textProps.value = {};
|
39404
|
+
let textWidth = 0;
|
39405
|
+
if (props2.calType === "dom") {
|
39406
|
+
textWidth = getActualWidthByDom(textRef.value.textContent, null, boxRef.value);
|
39407
|
+
} else {
|
39408
|
+
const {
|
39409
|
+
fontSize,
|
39410
|
+
fontFamily
|
39411
|
+
} = getComputedStyle(boxRef.value);
|
39412
|
+
textWidth = getActualWidthByCanvas(contentText.value, {
|
39413
|
+
fontSize,
|
39414
|
+
fontFamily
|
39415
|
+
});
|
39416
|
+
}
|
39417
|
+
if (textWidth > clientWidth) {
|
39418
|
+
isShowTips.value = true;
|
39419
|
+
if (props2.type === "title") {
|
39420
|
+
textProps.value = {
|
39421
|
+
title: textRef.value.innerText
|
39422
|
+
};
|
39423
|
+
}
|
39424
|
+
}
|
39425
|
+
});
|
39426
|
+
resizeHandler();
|
39427
|
+
if (props2.resizeable) {
|
39428
|
+
const observer = new ResizeObserver(resizeHandler);
|
39429
|
+
observer.observe(boxRef.value);
|
39430
|
+
onUnmounted(() => {
|
39431
|
+
observer.unobserve(boxRef.value);
|
39432
|
+
observer.disconnect();
|
39433
|
+
});
|
39434
|
+
}
|
39435
|
+
});
|
39436
|
+
return {
|
39437
|
+
boxRef,
|
39438
|
+
textRef,
|
39439
|
+
isShowTips,
|
39440
|
+
contentText,
|
39441
|
+
textProps
|
39442
|
+
};
|
39443
|
+
},
|
39444
|
+
render() {
|
39445
|
+
return createVNode("div", {
|
39446
|
+
"ref": "boxRef",
|
39447
|
+
"class": "position-relative"
|
39448
|
+
}, [createVNode(BkPopover, {
|
39449
|
+
"disabled": this.type === "title"
|
39450
|
+
}, {
|
39451
|
+
default: () => createVNode("div", mergeProps({
|
39452
|
+
"ref": "textRef",
|
39453
|
+
"class": "text-ov"
|
39454
|
+
}, this.textProps), [this.contentText]),
|
39455
|
+
content: () => this.contentText
|
39456
|
+
})]);
|
39457
|
+
}
|
39458
|
+
});
|
39459
|
+
const BkOverflowTitle = withInstall(OverflowTitle);
|
39302
39460
|
var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
39303
39461
|
__proto__: null,
|
39304
39462
|
Alert: BkAlert,
|
@@ -39358,6 +39516,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
39358
39516
|
ColorPicker: BkColorPicker,
|
39359
39517
|
TimePicker: BkTimePicker,
|
39360
39518
|
SearchSelect: BkSearchSelect,
|
39519
|
+
OverflowTitle: BkOverflowTitle,
|
39361
39520
|
$bkPopover: createPopoverComponent
|
39362
39521
|
}, Symbol.toStringTag, { value: "Module" }));
|
39363
39522
|
const createInstall = (prefix = "Bk") => (app) => {
|
@@ -39376,4 +39535,4 @@ var preset = {
|
|
39376
39535
|
install: createInstall(),
|
39377
39536
|
version: "0.0.1"
|
39378
39537
|
};
|
39379
|
-
export { createPopoverComponent as $bkPopover, BkAffix as Affix, BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkBreadcrumb as Breadcrumb, BkButton as Button, BkCard as Card, BkCascader as Cascader, BkCheckbox as Checkbox, BkCodeDiff as CodeDiff, BkCollapse as Collapse, BkColorPicker as ColorPicker, BkContainer as Container, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, BkInfoBox as InfoBox, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPagination as Pagination, BkPopover as Popover, BkPopover2 as Popover2, BkProcess as Process, BkProgress as Progress, BkRadio as Radio, BkRate as Rate, BkResizeLayout as ResizeLayout, BkSearchSelect as SearchSelect, BkSelect as Select, BkSideslider as Sideslider, Slider, BkSteps as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, BkTable as Table, BkTableColumn as TableColumn, BkTag as Tag, TagInput, BkTimeline as TimeLine, BkTimePicker as TimePicker, Transfer, BkTree as Tree, Upload, BkVirtualRender as VirtualRender, ellipsis as bkEllipsis, createInstance as bkEllipsisInstance, tooltips as bkTooltips, ClickOutside as clickoutside, BkContainer as containerProps, preset as default, mousewheel };
|
39538
|
+
export { createPopoverComponent as $bkPopover, BkAffix as Affix, BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkBreadcrumb as Breadcrumb, BkButton as Button, BkCard as Card, BkCascader as Cascader, BkCheckbox as Checkbox, BkCodeDiff as CodeDiff, BkCollapse as Collapse, BkColorPicker as ColorPicker, BkContainer as Container, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, BkInfoBox as InfoBox, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkOverflowTitle as OverflowTitle, BkPagination as Pagination, BkPopover as Popover, BkPopover2 as Popover2, BkProcess as Process, BkProgress as Progress, BkRadio as Radio, BkRate as Rate, BkResizeLayout as ResizeLayout, BkSearchSelect as SearchSelect, BkSelect as Select, BkSideslider as Sideslider, Slider, BkSteps as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, BkTable as Table, BkTableColumn as TableColumn, BkTag as Tag, TagInput, BkTimeline as TimeLine, BkTimePicker as TimePicker, Transfer, BkTree as Tree, Upload, BkVirtualRender as VirtualRender, ellipsis as bkEllipsis, createInstance as bkEllipsisInstance, tooltips as bkTooltips, ClickOutside as clickoutside, BkContainer as containerProps, preset as default, mousewheel, overflowTitle };
|