vant 4.6.1 → 4.6.3
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/README.md +1 -1
- package/es/address-list/AddressList.d.ts +13 -0
- package/es/address-list/AddressList.mjs +3 -2
- package/es/address-list/index.d.ts +9 -0
- package/es/checkbox/Checkbox.d.ts +14 -23
- package/es/checkbox/Checkbox.mjs +2 -1
- package/es/checkbox/Checker.d.ts +6 -15
- package/es/checkbox/Checker.mjs +18 -6
- package/es/checkbox/index.d.ts +2 -9
- package/es/checkbox-group/CheckboxGroup.d.ts +14 -1
- package/es/checkbox-group/CheckboxGroup.mjs +2 -1
- package/es/checkbox-group/index.d.ts +9 -0
- package/es/field/Field.d.ts +25 -0
- package/es/field/Field.mjs +9 -0
- package/es/field/index.d.ts +13 -0
- package/es/floating-bubble/FloatingBubble.d.ts +16 -21
- package/es/floating-bubble/FloatingBubble.mjs +6 -8
- package/es/floating-bubble/index.css +1 -1
- package/es/floating-bubble/index.d.ts +19 -19
- package/es/floating-bubble/types.d.ts +12 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/pagination/index.css +1 -1
- package/es/radio/Radio.d.ts +18 -25
- package/es/radio/Radio.mjs +5 -3
- package/es/radio/index.css +1 -1
- package/es/radio/index.d.ts +4 -9
- package/es/radio/types.d.ts +1 -0
- package/es/radio-group/RadioGroup.d.ts +4 -0
- package/es/radio-group/RadioGroup.mjs +1 -0
- package/es/radio-group/index.d.ts +2 -0
- package/es/search/Search.d.ts +19 -0
- package/es/search/index.d.ts +13 -0
- package/es/tab/Tab.mjs +2 -2
- package/es/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/es/text-ellipsis/TextEllipsis.mjs +50 -19
- package/es/text-ellipsis/index.d.ts +9 -0
- package/es/utils/basic.d.ts +8 -0
- package/es/utils/basic.mjs +28 -7
- package/es/utils/create.mjs +1 -2
- package/es/utils/deep-assign.mjs +1 -1
- package/es/utils/deep-clone.mjs +1 -1
- package/es/utils/dom.mjs +1 -1
- package/es/utils/format.mjs +1 -1
- package/es/utils/index.d.ts +0 -1
- package/es/utils/index.mjs +0 -1
- package/es/utils/interceptor.mjs +1 -2
- package/lib/address-list/AddressList.d.ts +13 -0
- package/lib/address-list/AddressList.js +3 -2
- package/lib/address-list/index.d.ts +9 -0
- package/lib/checkbox/Checkbox.d.ts +14 -23
- package/lib/checkbox/Checkbox.js +1 -0
- package/lib/checkbox/Checker.d.ts +6 -15
- package/lib/checkbox/Checker.js +17 -5
- package/lib/checkbox/index.d.ts +2 -9
- package/lib/checkbox-group/CheckboxGroup.d.ts +14 -1
- package/lib/checkbox-group/CheckboxGroup.js +1 -0
- package/lib/checkbox-group/index.d.ts +9 -0
- package/lib/field/Field.d.ts +25 -0
- package/lib/field/Field.js +9 -0
- package/lib/field/index.d.ts +13 -0
- package/lib/floating-bubble/FloatingBubble.d.ts +16 -21
- package/lib/floating-bubble/FloatingBubble.js +6 -8
- package/lib/floating-bubble/index.css +1 -1
- package/lib/floating-bubble/index.d.ts +19 -19
- package/lib/floating-bubble/types.d.ts +12 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/pagination/index.css +1 -1
- package/lib/radio/Radio.d.ts +18 -25
- package/lib/radio/Radio.js +4 -2
- package/lib/radio/index.css +1 -1
- package/lib/radio/index.d.ts +4 -9
- package/lib/radio/types.d.ts +1 -0
- package/lib/radio-group/RadioGroup.d.ts +4 -0
- package/lib/radio-group/RadioGroup.js +1 -0
- package/lib/radio-group/index.d.ts +2 -0
- package/lib/search/Search.d.ts +19 -0
- package/lib/search/index.d.ts +13 -0
- package/lib/tab/Tab.js +2 -2
- package/lib/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/lib/text-ellipsis/TextEllipsis.js +49 -18
- package/lib/text-ellipsis/index.d.ts +9 -0
- package/lib/utils/basic.d.ts +8 -0
- package/lib/utils/basic.js +29 -8
- package/lib/utils/create.js +1 -2
- package/lib/utils/deep-assign.js +3 -3
- package/lib/utils/deep-clone.js +3 -3
- package/lib/utils/dom.js +2 -2
- package/lib/utils/format.js +4 -4
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/interceptor.js +1 -2
- package/lib/vant.cjs.js +107 -48
- package/lib/vant.es.js +107 -48
- package/lib/vant.js +172 -59
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
- package/es/utils/validate.d.ts +0 -9
- package/es/utils/validate.mjs +0 -22
- package/lib/utils/validate.d.ts +0 -9
- package/lib/utils/validate.js +0 -41
package/lib/utils/dom.js
CHANGED
@@ -32,7 +32,7 @@ __export(stdin_exports, {
|
|
32
32
|
module.exports = __toCommonJS(stdin_exports);
|
33
33
|
var import_use = require("@vant/use");
|
34
34
|
var import_vue = require("vue");
|
35
|
-
var
|
35
|
+
var import_basic = require("./basic");
|
36
36
|
function getScrollTop(el) {
|
37
37
|
const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
|
38
38
|
return Math.max(top, 0);
|
@@ -58,7 +58,7 @@ function getElementTop(el, scroller) {
|
|
58
58
|
const scrollTop = scroller ? getScrollTop(scroller) : getRootScrollTop();
|
59
59
|
return (0, import_use.useRect)(el).top + scrollTop;
|
60
60
|
}
|
61
|
-
const isIOS = (0,
|
61
|
+
const isIOS = (0, import_basic.isIOS)();
|
62
62
|
function resetScroll() {
|
63
63
|
if (isIOS) {
|
64
64
|
setRootScrollTop(getRootScrollTop());
|
package/lib/utils/format.js
CHANGED
@@ -31,15 +31,15 @@ __export(stdin_exports, {
|
|
31
31
|
module.exports = __toCommonJS(stdin_exports);
|
32
32
|
var import_basic = require("./basic");
|
33
33
|
var import_dom = require("./dom");
|
34
|
-
var
|
34
|
+
var import_basic2 = require("./basic");
|
35
35
|
function addUnit(value) {
|
36
|
-
if ((0,
|
37
|
-
return (0,
|
36
|
+
if ((0, import_basic2.isDef)(value)) {
|
37
|
+
return (0, import_basic2.isNumeric)(value) ? `${value}px` : String(value);
|
38
38
|
}
|
39
39
|
return void 0;
|
40
40
|
}
|
41
41
|
function getSizeStyle(originSize) {
|
42
|
-
if ((0,
|
42
|
+
if ((0, import_basic2.isDef)(originSize)) {
|
43
43
|
if (Array.isArray(originSize)) {
|
44
44
|
return {
|
45
45
|
width: addUnit(originSize[0]),
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
@@ -20,7 +20,6 @@ __reExport(stdin_exports, require("./dom"), module.exports);
|
|
20
20
|
__reExport(stdin_exports, require("./create"), module.exports);
|
21
21
|
__reExport(stdin_exports, require("./format"), module.exports);
|
22
22
|
__reExport(stdin_exports, require("./constant"), module.exports);
|
23
|
-
__reExport(stdin_exports, require("./validate"), module.exports);
|
24
23
|
__reExport(stdin_exports, require("./interceptor"), module.exports);
|
25
24
|
__reExport(stdin_exports, require("./with-install"), module.exports);
|
26
25
|
__reExport(stdin_exports, require("./closest"), module.exports);
|
package/lib/utils/interceptor.js
CHANGED
@@ -21,7 +21,6 @@ __export(stdin_exports, {
|
|
21
21
|
});
|
22
22
|
module.exports = __toCommonJS(stdin_exports);
|
23
23
|
var import_basic = require("./basic");
|
24
|
-
var import_validate = require("./validate");
|
25
24
|
function callInterceptor(interceptor, {
|
26
25
|
args = [],
|
27
26
|
done,
|
@@ -29,7 +28,7 @@ function callInterceptor(interceptor, {
|
|
29
28
|
}) {
|
30
29
|
if (interceptor) {
|
31
30
|
const returnVal = interceptor.apply(null, args);
|
32
|
-
if ((0,
|
31
|
+
if ((0, import_basic.isPromise)(returnVal)) {
|
33
32
|
returnVal.then((value) => {
|
34
33
|
if (value) {
|
35
34
|
done();
|
package/lib/vant.cjs.js
CHANGED
@@ -4,9 +4,13 @@ const vue = require("vue");
|
|
4
4
|
const use = require("@vant/use");
|
5
5
|
const shared = require("@vue/shared");
|
6
6
|
const popperjs = require("@vant/popperjs");
|
7
|
+
function noop() {
|
8
|
+
}
|
9
|
+
const extend = Object.assign;
|
10
|
+
const inBrowser = typeof window !== "undefined";
|
11
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
7
12
|
const isDef = (val) => val !== void 0 && val !== null;
|
8
13
|
const isFunction = (val) => typeof val === "function";
|
9
|
-
const isObject = (val) => val !== null && typeof val === "object";
|
10
14
|
const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
11
15
|
const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
12
16
|
function isMobile(value) {
|
@@ -15,10 +19,6 @@ function isMobile(value) {
|
|
15
19
|
}
|
16
20
|
const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
|
17
21
|
const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
18
|
-
function noop() {
|
19
|
-
}
|
20
|
-
const extend = Object.assign;
|
21
|
-
const inBrowser = typeof window !== "undefined";
|
22
22
|
function get(object, path) {
|
23
23
|
const keys = path.split(".");
|
24
24
|
let result = object;
|
@@ -29,12 +29,15 @@ function get(object, path) {
|
|
29
29
|
return result;
|
30
30
|
}
|
31
31
|
function pick(obj, keys, ignoreUndefined) {
|
32
|
-
return keys.reduce(
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
return keys.reduce(
|
33
|
+
(ret, key) => {
|
34
|
+
if (!ignoreUndefined || obj[key] !== void 0) {
|
35
|
+
ret[key] = obj[key];
|
36
|
+
}
|
37
|
+
return ret;
|
38
|
+
},
|
39
|
+
{}
|
40
|
+
);
|
38
41
|
}
|
39
42
|
const isSameValue = (newValue, oldValue) => JSON.stringify(newValue) === JSON.stringify(oldValue);
|
40
43
|
const toArray = (item) => Array.isArray(item) ? item : [item];
|
@@ -3107,8 +3110,8 @@ var stdin_default$1A = vue.defineComponent({
|
|
3107
3110
|
titleClass,
|
3108
3111
|
titleStyle
|
3109
3112
|
} = props2;
|
3110
|
-
parsedClass.value = titleClass ?
|
3111
|
-
parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? shared.stringifyStyle(
|
3113
|
+
parsedClass.value = titleClass ? shared.normalizeClass(titleClass) : "";
|
3114
|
+
parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? shared.stringifyStyle(shared.normalizeStyle(titleStyle)) : titleStyle;
|
3112
3115
|
});
|
3113
3116
|
const renderTitle = (onClickTab) => vue.createVNode(TabTitle, vue.mergeProps({
|
3114
3117
|
"key": id,
|
@@ -3977,8 +3980,14 @@ const fieldSharedProps = {
|
|
3977
3980
|
inputAlign: String,
|
3978
3981
|
placeholder: String,
|
3979
3982
|
autocomplete: String,
|
3983
|
+
autocapitalize: String,
|
3984
|
+
autocorrect: String,
|
3980
3985
|
errorMessage: String,
|
3981
3986
|
enterkeyhint: String,
|
3987
|
+
spellcheck: {
|
3988
|
+
type: Boolean,
|
3989
|
+
default: null
|
3990
|
+
},
|
3982
3991
|
clearTrigger: makeStringProp("focus"),
|
3983
3992
|
formatTrigger: makeStringProp("onChange"),
|
3984
3993
|
error: {
|
@@ -4306,7 +4315,10 @@ var stdin_default$1u = vue.defineComponent({
|
|
4306
4315
|
autofocus: props2.autofocus,
|
4307
4316
|
placeholder: props2.placeholder,
|
4308
4317
|
autocomplete: props2.autocomplete,
|
4318
|
+
autocapitalize: props2.autocapitalize,
|
4319
|
+
autocorrect: props2.autocorrect,
|
4309
4320
|
enterkeyhint: props2.enterkeyhint,
|
4321
|
+
spellcheck: props2.spellcheck,
|
4310
4322
|
"aria-labelledby": props2.label ? `${id}-label` : void 0,
|
4311
4323
|
onBlur,
|
4312
4324
|
onFocus,
|
@@ -5179,6 +5191,7 @@ var stdin_default$1q = vue.defineComponent({
|
|
5179
5191
|
const AddressEdit = withInstall(stdin_default$1q);
|
5180
5192
|
const [name$1f, bem$1b] = createNamespace("radio-group");
|
5181
5193
|
const radioGroupProps = {
|
5194
|
+
shape: String,
|
5182
5195
|
disabled: Boolean,
|
5183
5196
|
iconSize: numericProp,
|
5184
5197
|
direction: String,
|
@@ -5288,7 +5301,6 @@ var stdin_default$1o = vue.defineComponent({
|
|
5288
5301
|
const Tag = withInstall(stdin_default$1o);
|
5289
5302
|
const checkerProps = {
|
5290
5303
|
name: unknownProp,
|
5291
|
-
shape: makeStringProp("round"),
|
5292
5304
|
disabled: Boolean,
|
5293
5305
|
iconSize: numericProp,
|
5294
5306
|
modelValue: unknownProp,
|
@@ -5300,6 +5312,7 @@ var stdin_default$1n = vue.defineComponent({
|
|
5300
5312
|
props: extend({}, checkerProps, {
|
5301
5313
|
bem: makeRequiredProp(Function),
|
5302
5314
|
role: String,
|
5315
|
+
shape: String,
|
5303
5316
|
parent: Object,
|
5304
5317
|
checked: Boolean,
|
5305
5318
|
bindGroup: truthProp
|
@@ -5338,6 +5351,9 @@ var stdin_default$1n = vue.defineComponent({
|
|
5338
5351
|
};
|
5339
5352
|
}
|
5340
5353
|
});
|
5354
|
+
const shape = vue.computed(() => {
|
5355
|
+
return props2.shape || getParentProp("shape") || "round";
|
5356
|
+
});
|
5341
5357
|
const onClick = (event) => {
|
5342
5358
|
const {
|
5343
5359
|
target
|
@@ -5350,27 +5366,36 @@ var stdin_default$1n = vue.defineComponent({
|
|
5350
5366
|
emit("click", event);
|
5351
5367
|
};
|
5352
5368
|
const renderIcon = () => {
|
5369
|
+
var _a, _b;
|
5353
5370
|
const {
|
5354
5371
|
bem: bem2,
|
5355
|
-
shape,
|
5356
5372
|
checked
|
5357
5373
|
} = props2;
|
5358
5374
|
const iconSize = props2.iconSize || getParentProp("iconSize");
|
5359
5375
|
return vue.createVNode("div", {
|
5360
5376
|
"ref": iconRef,
|
5361
|
-
"class": bem2("icon", [shape, {
|
5377
|
+
"class": bem2("icon", [shape.value, {
|
5362
5378
|
disabled: disabled.value,
|
5363
5379
|
checked
|
5364
5380
|
}]),
|
5365
|
-
"style": {
|
5381
|
+
"style": shape.value !== "dot" ? {
|
5366
5382
|
fontSize: addUnit(iconSize)
|
5383
|
+
} : {
|
5384
|
+
width: addUnit(iconSize),
|
5385
|
+
height: addUnit(iconSize),
|
5386
|
+
borderColor: (_a = iconStyle.value) == null ? void 0 : _a.borderColor
|
5367
5387
|
}
|
5368
5388
|
}, [slots.icon ? slots.icon({
|
5369
5389
|
checked,
|
5370
5390
|
disabled: disabled.value
|
5371
|
-
}) : vue.createVNode(Icon, {
|
5391
|
+
}) : shape.value !== "dot" ? vue.createVNode(Icon, {
|
5372
5392
|
"name": "success",
|
5373
5393
|
"style": iconStyle.value
|
5394
|
+
}, null) : vue.createVNode("div", {
|
5395
|
+
"class": bem2("icon--dot__icon"),
|
5396
|
+
"style": {
|
5397
|
+
backgroundColor: (_b = iconStyle.value) == null ? void 0 : _b.backgroundColor
|
5398
|
+
}
|
5374
5399
|
}, null)]);
|
5375
5400
|
};
|
5376
5401
|
const renderLabel = () => {
|
@@ -5397,11 +5422,13 @@ var stdin_default$1n = vue.defineComponent({
|
|
5397
5422
|
};
|
5398
5423
|
}
|
5399
5424
|
});
|
5400
|
-
const radioProps = checkerProps
|
5425
|
+
const radioProps = extend({}, checkerProps, {
|
5426
|
+
shape: String
|
5427
|
+
});
|
5401
5428
|
const [name$1d, bem$19] = createNamespace("radio");
|
5402
5429
|
var stdin_default$1m = vue.defineComponent({
|
5403
5430
|
name: name$1d,
|
5404
|
-
props:
|
5431
|
+
props: radioProps,
|
5405
5432
|
emits: ["update:modelValue"],
|
5406
5433
|
setup(props2, {
|
5407
5434
|
emit,
|
@@ -5525,6 +5552,7 @@ const addressListProps = {
|
|
5525
5552
|
switchable: truthProp,
|
5526
5553
|
disabledText: String,
|
5527
5554
|
disabledList: makeArrayProp(),
|
5555
|
+
showAddButton: truthProp,
|
5528
5556
|
addButtonText: String,
|
5529
5557
|
defaultTagText: String,
|
5530
5558
|
rightIcon: makeStringProp("edit")
|
@@ -5566,7 +5594,7 @@ var stdin_default$1k = vue.defineComponent({
|
|
5566
5594
|
return list.map((item, index) => renderItem(item, index, disabled));
|
5567
5595
|
}
|
5568
5596
|
};
|
5569
|
-
const renderBottom = () => vue.createVNode("div", {
|
5597
|
+
const renderBottom = () => props2.showAddButton ? vue.createVNode("div", {
|
5570
5598
|
"class": [bem$17("bottom"), "van-safe-area-bottom"]
|
5571
5599
|
}, [vue.createVNode(Button, {
|
5572
5600
|
"round": true,
|
@@ -5575,7 +5603,7 @@ var stdin_default$1k = vue.defineComponent({
|
|
5575
5603
|
"text": props2.addButtonText || t$h("add"),
|
5576
5604
|
"class": bem$17("add"),
|
5577
5605
|
"onClick": () => emit("add")
|
5578
|
-
}, null)]);
|
5606
|
+
}, null)]) : void 0;
|
5579
5607
|
return () => {
|
5580
5608
|
var _a, _b;
|
5581
5609
|
const List2 = renderList(props2.list);
|
@@ -7394,6 +7422,7 @@ const CellGroup = withInstall(stdin_default$1a);
|
|
7394
7422
|
const [name$10, bem$$] = createNamespace("checkbox-group");
|
7395
7423
|
const checkboxGroupProps = {
|
7396
7424
|
max: numericProp,
|
7425
|
+
shape: makeStringProp("round"),
|
7397
7426
|
disabled: Boolean,
|
7398
7427
|
iconSize: numericProp,
|
7399
7428
|
direction: String,
|
@@ -7455,6 +7484,7 @@ var stdin_default$19 = vue.defineComponent({
|
|
7455
7484
|
});
|
7456
7485
|
const [name$$, bem$_] = createNamespace("checkbox");
|
7457
7486
|
const checkboxProps = extend({}, checkerProps, {
|
7487
|
+
shape: String,
|
7458
7488
|
bindGroup: truthProp
|
7459
7489
|
});
|
7460
7490
|
var stdin_default$18 = vue.defineComponent({
|
@@ -9687,10 +9717,10 @@ var stdin_default$S = vue.defineComponent({
|
|
9687
9717
|
const DropdownItem = withInstall(stdin_default$S);
|
9688
9718
|
const DropdownMenu = withInstall(stdin_default$T);
|
9689
9719
|
const floatingBubbleProps = {
|
9720
|
+
gap: makeNumberProp(24),
|
9721
|
+
icon: String,
|
9690
9722
|
axis: makeStringProp("y"),
|
9691
9723
|
magnetic: String,
|
9692
|
-
icon: String,
|
9693
|
-
gap: makeNumberProp(24),
|
9694
9724
|
offset: {
|
9695
9725
|
type: Object,
|
9696
9726
|
default: () => ({
|
@@ -9721,8 +9751,8 @@ var stdin_default$R = vue.defineComponent({
|
|
9721
9751
|
});
|
9722
9752
|
const boundary = vue.computed(() => ({
|
9723
9753
|
top: props2.gap,
|
9724
|
-
right: windowWidth.value - state.value.
|
9725
|
-
bottom: windowHeight.value - state.value.
|
9754
|
+
right: windowWidth.value - state.value.width - props2.gap,
|
9755
|
+
bottom: windowHeight.value - state.value.height - props2.gap,
|
9726
9756
|
left: props2.gap
|
9727
9757
|
}));
|
9728
9758
|
const dragging = vue.ref(false);
|
@@ -9820,9 +9850,7 @@ var stdin_default$R = vue.defineComponent({
|
|
9820
9850
|
initialized = true;
|
9821
9851
|
});
|
9822
9852
|
});
|
9823
|
-
vue.watch([windowWidth, windowHeight, () => props2.gap, () => props2.offset],
|
9824
|
-
deep: true
|
9825
|
-
});
|
9853
|
+
vue.watch([windowWidth, windowHeight, () => props2.gap, () => props2.offset], updateState);
|
9826
9854
|
const show = vue.ref(true);
|
9827
9855
|
vue.onActivated(() => {
|
9828
9856
|
show.value = true;
|
@@ -14582,7 +14610,8 @@ const textEllipsisProps = {
|
|
14582
14610
|
dots: makeStringProp("..."),
|
14583
14611
|
content: makeStringProp(""),
|
14584
14612
|
expandText: makeStringProp(""),
|
14585
|
-
collapseText: makeStringProp("")
|
14613
|
+
collapseText: makeStringProp(""),
|
14614
|
+
position: makeStringProp("end")
|
14586
14615
|
};
|
14587
14616
|
var stdin_default$9 = vue.defineComponent({
|
14588
14617
|
name: name$4,
|
@@ -14595,6 +14624,7 @@ var stdin_default$9 = vue.defineComponent({
|
|
14595
14624
|
const expanded = vue.ref(false);
|
14596
14625
|
const hasAction = vue.ref(false);
|
14597
14626
|
const root = vue.ref();
|
14627
|
+
const actionText = vue.computed(() => expanded.value ? props2.expandText : props2.collapseText);
|
14598
14628
|
const pxToNum = (value) => {
|
14599
14629
|
if (!value)
|
14600
14630
|
return 0;
|
@@ -14623,24 +14653,53 @@ var stdin_default$9 = vue.defineComponent({
|
|
14623
14653
|
};
|
14624
14654
|
const calcEllipsisText = (container2, maxHeight2) => {
|
14625
14655
|
const {
|
14626
|
-
dots,
|
14627
14656
|
content,
|
14628
|
-
|
14657
|
+
position,
|
14658
|
+
dots
|
14629
14659
|
} = props2;
|
14630
|
-
|
14631
|
-
|
14632
|
-
|
14633
|
-
|
14634
|
-
|
14635
|
-
|
14636
|
-
|
14637
|
-
|
14638
|
-
|
14639
|
-
|
14640
|
-
|
14660
|
+
const end = content.length;
|
14661
|
+
const calcEllipse = () => {
|
14662
|
+
const tail = (left, right) => {
|
14663
|
+
if (right - left <= 1) {
|
14664
|
+
if (position === "end") {
|
14665
|
+
return content.slice(0, left) + dots;
|
14666
|
+
}
|
14667
|
+
return dots + content.slice(right, end);
|
14668
|
+
}
|
14669
|
+
const middle2 = Math.round(left + right >> 1);
|
14670
|
+
if (position === "end") {
|
14671
|
+
container2.innerText = content.slice(0, middle2) + dots + actionText.value;
|
14672
|
+
} else {
|
14673
|
+
container2.innerText = dots + content.slice(middle2, end) + actionText.value;
|
14674
|
+
}
|
14675
|
+
if (container2.offsetHeight > maxHeight2) {
|
14676
|
+
if (position === "end") {
|
14677
|
+
return tail(left, middle2);
|
14678
|
+
}
|
14679
|
+
return tail(middle2, right);
|
14680
|
+
}
|
14681
|
+
if (position === "end") {
|
14682
|
+
return tail(middle2, right);
|
14683
|
+
}
|
14684
|
+
return tail(left, middle2);
|
14685
|
+
};
|
14686
|
+
container2.innerText = tail(0, end);
|
14687
|
+
};
|
14688
|
+
const middleTail = (leftPart, rightPart) => {
|
14689
|
+
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
14690
|
+
return content.slice(0, leftPart[1]) + dots + dots + content.slice(rightPart[1], end);
|
14641
14691
|
}
|
14642
|
-
|
14643
|
-
|
14692
|
+
const leftMiddle = Math.floor(leftPart[0] + leftPart[1] >> 1);
|
14693
|
+
const rightMiddle = Math.ceil(rightPart[0] + rightPart[1] >> 1);
|
14694
|
+
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + actionText.value + props2.dots + props2.content.slice(rightMiddle, end);
|
14695
|
+
if (container2.offsetHeight >= maxHeight2) {
|
14696
|
+
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
14697
|
+
}
|
14698
|
+
return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
|
14699
|
+
};
|
14700
|
+
const middle = 0 + end >> 1;
|
14701
|
+
props2.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end]) : calcEllipse();
|
14702
|
+
return container2.innerText;
|
14644
14703
|
};
|
14645
14704
|
const container = cloneContainer();
|
14646
14705
|
if (!container)
|
@@ -14650,7 +14709,7 @@ var stdin_default$9 = vue.defineComponent({
|
|
14650
14709
|
paddingTop,
|
14651
14710
|
lineHeight
|
14652
14711
|
} = container.style;
|
14653
|
-
const maxHeight = (Number(props2.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
|
14712
|
+
const maxHeight = Math.ceil((Number(props2.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
|
14654
14713
|
if (maxHeight < container.offsetHeight) {
|
14655
14714
|
hasAction.value = true;
|
14656
14715
|
text.value = calcEllipsisText(container, maxHeight);
|
@@ -14669,7 +14728,7 @@ var stdin_default$9 = vue.defineComponent({
|
|
14669
14728
|
"onClick": onClickAction
|
14670
14729
|
}, [expanded.value ? props2.collapseText : props2.expandText]);
|
14671
14730
|
vue.onMounted(calcEllipsised);
|
14672
|
-
vue.watch(() => [props2.content, props2.rows], calcEllipsised);
|
14731
|
+
vue.watch(() => [props2.content, props2.rows, props2.position], calcEllipsised);
|
14673
14732
|
use.useEventListener("resize", calcEllipsised);
|
14674
14733
|
return () => vue.createVNode("div", {
|
14675
14734
|
"ref": root,
|
@@ -16328,7 +16387,7 @@ const Lazyload = {
|
|
16328
16387
|
});
|
16329
16388
|
}
|
16330
16389
|
};
|
16331
|
-
const version = "4.6.
|
16390
|
+
const version = "4.6.3";
|
16332
16391
|
function install(app) {
|
16333
16392
|
const components = [
|
16334
16393
|
ActionBar,
|