bkui-vue 2.0.1-beta.66 → 2.0.1-beta.67
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 +42 -42
- package/dist/index.esm.js +12014 -11995
- package/dist/index.umd.js +42 -42
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/index.js +1 -1
- package/lib/input/index.js +39 -512
- package/lib/input/input.css +4 -1
- package/lib/input/input.less +4 -1
- package/lib/input/input.variable.css +4 -1
- package/lib/table/hooks/use-settings.d.ts +2 -0
- package/lib/table/index.js +56 -5
- package/lib/table/props.d.ts +1 -0
- package/lib/table/utils.d.ts +1 -0
- package/lib/upload/index.js +14 -8
- package/package.json +1 -1
package/lib/input/input.less
CHANGED
@@ -36,6 +36,7 @@ declare const useSettings: (props: TablePropTypes, ctx: SetupContext, columns: U
|
|
36
36
|
label: string;
|
37
37
|
text?: string;
|
38
38
|
value: string;
|
39
|
+
tipKey?: string;
|
39
40
|
}[];
|
40
41
|
filterFn?: (...args: any[]) => boolean;
|
41
42
|
match?: import("../props").FullEnum;
|
@@ -89,6 +90,7 @@ declare const useSettings: (props: TablePropTypes, ctx: SetupContext, columns: U
|
|
89
90
|
label: string;
|
90
91
|
text?: string;
|
91
92
|
value: string;
|
93
|
+
tipKey?: string;
|
92
94
|
}[];
|
93
95
|
filterFn?: (...args: any[]) => boolean;
|
94
96
|
match?: import("../props").FullEnum;
|
package/lib/table/index.js
CHANGED
@@ -17327,7 +17327,7 @@ function _objectDestructuringEmpty(obj) {
|
|
17327
17327
|
;// CONCATENATED MODULE: external "vue"
|
17328
17328
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
17329
17329
|
var external_vue_y = x => () => x
|
17330
|
-
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isRef, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
|
17330
|
+
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isRef, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
17331
17331
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
17332
17332
|
function typeof_typeof(o) {
|
17333
17333
|
"@babel/helpers - typeof";
|
@@ -21762,7 +21762,7 @@ const exception_less_namespaceObject = exception_less_x({ });
|
|
21762
21762
|
;// CONCATENATED MODULE: external "../directives"
|
21763
21763
|
var directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21764
21764
|
var directives_y = x => () => x
|
21765
|
-
const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__.bkEllipsisInstance });
|
21765
|
+
const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__.bkEllipsisInstance, ["bkTooltips"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__.bkTooltips });
|
21766
21766
|
;// CONCATENATED MODULE: ../../packages/table/src/components/table-cell.tsx
|
21767
21767
|
|
21768
21768
|
|
@@ -22433,12 +22433,16 @@ const input_less_namespaceObject = input_less_x({ });
|
|
22433
22433
|
|
22434
22434
|
|
22435
22435
|
|
22436
|
+
|
22436
22437
|
function _isSlot(s) {
|
22437
22438
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
|
22438
22439
|
}
|
22439
22440
|
var ROW_HEIGHT = 32;
|
22440
22441
|
/* harmony default export */ const head_filter = ((0,external_vue_namespaceObject.defineComponent)({
|
22441
22442
|
name: 'HeadFilter',
|
22443
|
+
directives: {
|
22444
|
+
bkTooltips: directives_namespaceObject.bkTooltips
|
22445
|
+
},
|
22442
22446
|
props: {
|
22443
22447
|
column: IColumnType,
|
22444
22448
|
height: shared_namespaceObject.PropTypes.number.def(ROW_HEIGHT)
|
@@ -22459,6 +22463,8 @@ var ROW_HEIGHT = 32;
|
|
22459
22463
|
return (_filter$value$checked = (_filter$value = filter.value) === null || _filter$value === void 0 ? void 0 : _filter$value.checked) !== null && _filter$value$checked !== void 0 ? _filter$value$checked : [];
|
22460
22464
|
});
|
22461
22465
|
var searchValue = (0,external_vue_namespaceObject.ref)('');
|
22466
|
+
var filterPopoverRef = (0,external_vue_namespaceObject.ref)();
|
22467
|
+
var allTextRef = (0,external_vue_namespaceObject.ref)([]);
|
22462
22468
|
var state = (0,external_vue_namespaceObject.reactive)({
|
22463
22469
|
isOpen: false,
|
22464
22470
|
checked: []
|
@@ -22555,6 +22561,42 @@ var ROW_HEIGHT = 32;
|
|
22555
22561
|
text: text
|
22556
22562
|
};
|
22557
22563
|
};
|
22564
|
+
var resolveOverflowTips = function resolveOverflowTips(payload) {
|
22565
|
+
var _filterPopoverRef$val;
|
22566
|
+
var labelRef = allTextRef.value["list-item-".concat(payload.value, "-ref")];
|
22567
|
+
var checkBoxLabelRef = (_filterPopoverRef$val = filterPopoverRef.value) === null || _filterPopoverRef$val === void 0 ? void 0 : _filterPopoverRef$val.querySelector('.bk-checkbox-label');
|
22568
|
+
if (labelRef && checkBoxLabelRef) {
|
22569
|
+
var _filterPopoverRef$val2, _filterPopoverRef$val3;
|
22570
|
+
var CHECKBOX_WIDTH = 16;
|
22571
|
+
var labelStyles = renderDomStyles(labelRef);
|
22572
|
+
var checkBoxLabel = renderDomStyles(checkBoxLabelRef);
|
22573
|
+
var filterPopoverStyles = renderDomStyles(filterPopoverRef.value);
|
22574
|
+
// 获取每个item项的margin、padding、 border
|
22575
|
+
var allTipStyles = (labelRef === null || labelRef === void 0 ? void 0 : labelRef.offsetWidth) + (labelStyles === null || labelStyles === void 0 ? void 0 : labelStyles.borderSize) + (labelStyles === null || labelStyles === void 0 ? void 0 : labelStyles.marginSize) + (labelStyles === null || labelStyles === void 0 ? void 0 : labelStyles.paddingSize) + (filterPopoverStyles === null || filterPopoverStyles === void 0 ? void 0 : filterPopoverStyles.borderSize) + (filterPopoverStyles === null || filterPopoverStyles === void 0 ? void 0 : filterPopoverStyles.marginSize) + (filterPopoverStyles === null || filterPopoverStyles === void 0 ? void 0 : filterPopoverStyles.paddingSize) + (checkBoxLabel === null || checkBoxLabel === void 0 ? void 0 : checkBoxLabel.marginSize) + (checkBoxLabel === null || checkBoxLabel === void 0 ? void 0 : checkBoxLabel.paddingSize);
|
22576
|
+
if ((labelRef === null || labelRef === void 0 ? void 0 : labelRef.offsetWidth) > ((_filterPopoverRef$val2 = filterPopoverRef.value) === null || _filterPopoverRef$val2 === void 0 ? void 0 : _filterPopoverRef$val2.offsetWidth) || CHECKBOX_WIDTH + allTipStyles > ((_filterPopoverRef$val3 = filterPopoverRef.value) === null || _filterPopoverRef$val3 === void 0 ? void 0 : _filterPopoverRef$val3.offsetWidth)) {
|
22577
|
+
return false;
|
22578
|
+
}
|
22579
|
+
}
|
22580
|
+
return true;
|
22581
|
+
};
|
22582
|
+
var renderDomStyles = function renderDomStyles(el) {
|
22583
|
+
if (!el) {
|
22584
|
+
return {
|
22585
|
+
paddingSize: 0,
|
22586
|
+
borderSize: 0,
|
22587
|
+
marginSize: 0
|
22588
|
+
};
|
22589
|
+
}
|
22590
|
+
var styles = getComputedStyle(el);
|
22591
|
+
var paddingSize = Number.parseFloat(styles.getPropertyValue('padding-left')) + Number.parseFloat(styles.getPropertyValue('padding-right'));
|
22592
|
+
var borderSize = Number.parseFloat(styles.getPropertyValue('border-left-width')) + Number.parseFloat(styles.getPropertyValue('border-right-width'));
|
22593
|
+
var marginSize = Number.parseFloat(styles.getPropertyValue('margin-left')) + Number.parseFloat(styles.getPropertyValue('margin-right'));
|
22594
|
+
return {
|
22595
|
+
paddingSize: paddingSize,
|
22596
|
+
borderSize: borderSize,
|
22597
|
+
marginSize: marginSize
|
22598
|
+
};
|
22599
|
+
};
|
22558
22600
|
var _filter$value4 = filter.value,
|
22559
22601
|
btnSave = _filter$value4.btnSave,
|
22560
22602
|
btnReset = _filter$value4.btnReset;
|
@@ -22611,8 +22653,9 @@ var ROW_HEIGHT = 32;
|
|
22611
22653
|
var renderFilterList = function renderFilterList(scope) {
|
22612
22654
|
if (scope.data.length) {
|
22613
22655
|
return scope.data.map(function (item) {
|
22614
|
-
return (0,external_vue_namespaceObject.createVNode)("div", {
|
22656
|
+
return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
|
22615
22657
|
"key": item.value,
|
22658
|
+
"ref": filterPopoverRef,
|
22616
22659
|
"class": "list-item"
|
22617
22660
|
}, [(0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
|
22618
22661
|
"checked": state.checked.includes(item.value),
|
@@ -22624,9 +22667,17 @@ var ROW_HEIGHT = 32;
|
|
22624
22667
|
}
|
22625
22668
|
}, {
|
22626
22669
|
"default": function _default() {
|
22627
|
-
return [
|
22670
|
+
return [(0,external_vue_namespaceObject.createVNode)("span", {
|
22671
|
+
"ref": function ref(el) {
|
22672
|
+
return allTextRef.value["list-item-".concat(item.value, "-ref")] = el;
|
22673
|
+
}
|
22674
|
+
}, ["".concat(item.text)])];
|
22628
22675
|
}
|
22629
|
-
})])
|
22676
|
+
})]), [[(0,external_vue_namespaceObject.resolveDirective)("bk-tooltips"), {
|
22677
|
+
content: item.tipKey || item.text,
|
22678
|
+
placement: 'right',
|
22679
|
+
disabled: resolveOverflowTips(item)
|
22680
|
+
}]]);
|
22630
22681
|
});
|
22631
22682
|
}
|
22632
22683
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
package/lib/table/props.d.ts
CHANGED
package/lib/table/utils.d.ts
CHANGED
package/lib/upload/index.js
CHANGED
@@ -2053,6 +2053,7 @@ var spark_md5_default = /*#__PURE__*/__webpack_require__.n(spark_md5);
|
|
2053
2053
|
*/
|
2054
2054
|
|
2055
2055
|
|
2056
|
+
var errMsg = 'An error occurred during upload';
|
2056
2057
|
function getRes(xhr) {
|
2057
2058
|
var res = xhr.responseText || xhr.response;
|
2058
2059
|
if (!res) {
|
@@ -2107,11 +2108,15 @@ var ajaxUpload = function ajaxUpload(option) {
|
|
2107
2108
|
formData.append(option.filename, option.file, option.file.name);
|
2108
2109
|
}
|
2109
2110
|
xhr.addEventListener('error', function () {
|
2110
|
-
|
2111
|
+
var responseText = getRes(xhr);
|
2112
|
+
var msg = new Error(responseText || errMsg);
|
2113
|
+
option.onError(msg);
|
2114
|
+
// option.onError(new Error('An error occurred during upload'));
|
2111
2115
|
});
|
2112
2116
|
xhr.addEventListener('load', function () {
|
2113
2117
|
if (xhr.status < 200 || xhr.status >= 300) {
|
2114
|
-
|
2118
|
+
var responseText = getRes(xhr);
|
2119
|
+
return option.onError(new Error(responseText || errMsg));
|
2115
2120
|
}
|
2116
2121
|
option.onSuccess(getRes(xhr));
|
2117
2122
|
});
|
@@ -2189,10 +2194,11 @@ var ajaxSliceUpload = /*#__PURE__*/function () {
|
|
2189
2194
|
req.open(option.method, option.mergeUrl, true);
|
2190
2195
|
req.onreadystatechange = function () {
|
2191
2196
|
if (req.readyState === 4) {
|
2197
|
+
var responseText = getRes(req);
|
2192
2198
|
if (req.status < 200 || req.status >= 300) {
|
2193
|
-
return option.onError(new Error(
|
2199
|
+
return option.onError(new Error(responseText || errMsg));
|
2194
2200
|
}
|
2195
|
-
option.onSuccess(
|
2201
|
+
option.onSuccess(responseText);
|
2196
2202
|
}
|
2197
2203
|
};
|
2198
2204
|
req.onloadend = function () {
|
@@ -2251,10 +2257,10 @@ var sliceSend = function sliceSend(option, file, blockCount, hash, progressList,
|
|
2251
2257
|
var xhr = new XMLHttpRequest();
|
2252
2258
|
xhr.onreadystatechange = function () {
|
2253
2259
|
if (xhr.readyState === 4) {
|
2254
|
-
var
|
2260
|
+
var responseText = getRes(xhr);
|
2255
2261
|
if (xhr.status < 200 || xhr.status >= 300) {
|
2256
|
-
reject(
|
2257
|
-
option.onError(new Error(
|
2262
|
+
reject(responseText);
|
2263
|
+
option.onError(new Error(responseText || errMsg));
|
2258
2264
|
} else {
|
2259
2265
|
resolve('reponseText');
|
2260
2266
|
}
|
@@ -2332,7 +2338,7 @@ var hashFile = function hashFile(file, chunkSize) {
|
|
2332
2338
|
}
|
2333
2339
|
};
|
2334
2340
|
fileReader.onerror = function () {
|
2335
|
-
reject(new Error('File
|
2341
|
+
reject(new Error('File slice failed'));
|
2336
2342
|
};
|
2337
2343
|
loadNext();
|
2338
2344
|
})["catch"](function (err) {
|