@varlet/ui 1.27.12 → 1.27.13
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/es/back-top/BackTop.js +10 -8
- package/es/select/Select.js +22 -0
- package/es/varlet.esm.js +30 -6
- package/highlight/attributes.json +1 -1
- package/highlight/web-types.json +2 -2
- package/lib/back-top/BackTop.js +9 -7
- package/lib/select/Select.js +22 -0
- package/package.json +4 -4
- package/types/icon.d.ts +1 -1
- package/umd/varlet.js +3 -3
package/es/back-top/BackTop.js
CHANGED
|
@@ -9,7 +9,7 @@ var {
|
|
|
9
9
|
n,
|
|
10
10
|
classes
|
|
11
11
|
} = createNamespace('back-top');
|
|
12
|
-
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, withModifiers as _withModifiers,
|
|
12
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, withModifiers as _withModifiers, mergeProps as _mergeProps, createElementVNode as _createElementVNode, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
13
13
|
export function render(_ctx, _cache) {
|
|
14
14
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
15
15
|
|
|
@@ -18,17 +18,18 @@ export function render(_ctx, _cache) {
|
|
|
18
18
|
return _openBlock(), _createBlock(_Teleport, {
|
|
19
19
|
to: "body",
|
|
20
20
|
disabled: _ctx.disabled
|
|
21
|
-
}, [_createElementVNode("div", {
|
|
22
|
-
class:
|
|
21
|
+
}, [_createElementVNode("div", _mergeProps({
|
|
22
|
+
class: _ctx.classes(_ctx.n(), [_ctx.show, _ctx.n('--active')]),
|
|
23
23
|
ref: "backTopEl",
|
|
24
|
-
style:
|
|
24
|
+
style: {
|
|
25
25
|
right: _ctx.toSizeUnit(_ctx.right),
|
|
26
26
|
bottom: _ctx.toSizeUnit(_ctx.bottom)
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
|
+
}, _ctx.$attrs, {
|
|
28
29
|
onClick: _cache[0] || (_cache[0] = _withModifiers(function () {
|
|
29
30
|
return _ctx.click && _ctx.click(...arguments);
|
|
30
31
|
}, ["stop"]))
|
|
31
|
-
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_createVNode(_component_var_button, {
|
|
32
|
+
}), [_renderSlot(_ctx.$slots, "default", {}, () => [_createVNode(_component_var_button, {
|
|
32
33
|
type: "primary",
|
|
33
34
|
round: "",
|
|
34
35
|
"var-back-top-cover": ""
|
|
@@ -39,8 +40,8 @@ export function render(_ctx, _cache) {
|
|
|
39
40
|
_: 1
|
|
40
41
|
/* STABLE */
|
|
41
42
|
|
|
42
|
-
})])],
|
|
43
|
-
/*
|
|
43
|
+
})])], 16
|
|
44
|
+
/* FULL_PROPS */
|
|
44
45
|
)], 8
|
|
45
46
|
/* PROPS */
|
|
46
47
|
, ["disabled"]);
|
|
@@ -52,6 +53,7 @@ export default defineComponent({
|
|
|
52
53
|
VarButton,
|
|
53
54
|
VarIcon
|
|
54
55
|
},
|
|
56
|
+
inheritAttrs: false,
|
|
55
57
|
props,
|
|
56
58
|
|
|
57
59
|
setup(props) {
|
package/es/select/Select.js
CHANGED
|
@@ -55,6 +55,7 @@ export function render(_ctx, _cache) {
|
|
|
55
55
|
onClose: _ctx.handleBlur
|
|
56
56
|
}, {
|
|
57
57
|
menu: _withCtx(() => [_createElementVNode("div", {
|
|
58
|
+
ref: "menuEl",
|
|
58
59
|
class: _normalizeClass(_ctx.n('scroller'))
|
|
59
60
|
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
60
61
|
/* CLASS */
|
|
@@ -202,6 +203,7 @@ export default defineComponent({
|
|
|
202
203
|
// expose
|
|
203
204
|
resetValidation
|
|
204
205
|
} = useValidation();
|
|
206
|
+
var menuEl = ref(null);
|
|
205
207
|
|
|
206
208
|
var computeLabel = () => {
|
|
207
209
|
var {
|
|
@@ -309,6 +311,7 @@ export default defineComponent({
|
|
|
309
311
|
isFocus.value = true;
|
|
310
312
|
call(onFocus);
|
|
311
313
|
validateWithTrigger('onFocus');
|
|
314
|
+
detectBoundary();
|
|
312
315
|
};
|
|
313
316
|
|
|
314
317
|
var handleBlur = () => {
|
|
@@ -433,6 +436,7 @@ export default defineComponent({
|
|
|
433
436
|
wrapWidth.value = getWrapWidth();
|
|
434
437
|
offsetY.value = getOffsetY() + toPxNum(props.offsetY);
|
|
435
438
|
isFocus.value = true;
|
|
439
|
+
detectBoundary();
|
|
436
440
|
}; // expose
|
|
437
441
|
|
|
438
442
|
|
|
@@ -449,6 +453,23 @@ export default defineComponent({
|
|
|
449
453
|
resetValidation();
|
|
450
454
|
};
|
|
451
455
|
|
|
456
|
+
var detectBoundary = () => {
|
|
457
|
+
var {
|
|
458
|
+
body
|
|
459
|
+
} = document;
|
|
460
|
+
nextTick(() => {
|
|
461
|
+
var _menuEl$value, _menuEl$value2;
|
|
462
|
+
|
|
463
|
+
var {
|
|
464
|
+
offsetTop: menuOffsetTop,
|
|
465
|
+
offsetHeight: menuOffsetHeight
|
|
466
|
+
} = (_menuEl$value = menuEl.value) == null ? void 0 : _menuEl$value.parentElement;
|
|
467
|
+
var menuOffsetBottom = body.scrollHeight - menuOffsetHeight - menuOffsetTop;
|
|
468
|
+
if (menuOffsetTop < 0) offsetY.value = getOffsetY();
|
|
469
|
+
if (menuOffsetBottom < 0) offsetY.value -= ((_menuEl$value2 = menuEl.value) == null ? void 0 : _menuEl$value2.parentElement).offsetHeight - getOffsetY();
|
|
470
|
+
});
|
|
471
|
+
};
|
|
472
|
+
|
|
452
473
|
watch(() => props.multiple, () => {
|
|
453
474
|
var {
|
|
454
475
|
multiple,
|
|
@@ -482,6 +503,7 @@ export default defineComponent({
|
|
|
482
503
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
483
504
|
label,
|
|
484
505
|
labels,
|
|
506
|
+
menuEl,
|
|
485
507
|
n,
|
|
486
508
|
classes,
|
|
487
509
|
computePlaceholderState,
|
package/es/varlet.esm.js
CHANGED
|
@@ -1945,17 +1945,18 @@ function render$U(_ctx, _cache) {
|
|
|
1945
1945
|
return openBlock(), createBlock(Teleport, {
|
|
1946
1946
|
to: "body",
|
|
1947
1947
|
disabled: _ctx.disabled
|
|
1948
|
-
}, [createElementVNode("div", {
|
|
1949
|
-
class:
|
|
1948
|
+
}, [createElementVNode("div", mergeProps({
|
|
1949
|
+
class: _ctx.classes(_ctx.n(), [_ctx.show, _ctx.n("--active")]),
|
|
1950
1950
|
ref: "backTopEl",
|
|
1951
|
-
style:
|
|
1951
|
+
style: {
|
|
1952
1952
|
right: _ctx.toSizeUnit(_ctx.right),
|
|
1953
1953
|
bottom: _ctx.toSizeUnit(_ctx.bottom)
|
|
1954
|
-
}
|
|
1954
|
+
}
|
|
1955
|
+
}, _ctx.$attrs, {
|
|
1955
1956
|
onClick: _cache[0] || (_cache[0] = withModifiers(function() {
|
|
1956
1957
|
return _ctx.click && _ctx.click(...arguments);
|
|
1957
1958
|
}, ["stop"]))
|
|
1958
|
-
}, [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(_component_var_button, {
|
|
1959
|
+
}), [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(_component_var_button, {
|
|
1959
1960
|
type: "primary",
|
|
1960
1961
|
round: "",
|
|
1961
1962
|
"var-back-top-cover": ""
|
|
@@ -1964,7 +1965,7 @@ function render$U(_ctx, _cache) {
|
|
|
1964
1965
|
name: "chevron-up"
|
|
1965
1966
|
})]),
|
|
1966
1967
|
_: 1
|
|
1967
|
-
})])],
|
|
1968
|
+
})])], 16)], 8, ["disabled"]);
|
|
1968
1969
|
}
|
|
1969
1970
|
var BackTop = defineComponent({
|
|
1970
1971
|
render: render$U,
|
|
@@ -1973,6 +1974,7 @@ var BackTop = defineComponent({
|
|
|
1973
1974
|
VarButton: Button,
|
|
1974
1975
|
VarIcon: Icon
|
|
1975
1976
|
},
|
|
1977
|
+
inheritAttrs: false,
|
|
1976
1978
|
props: props$O,
|
|
1977
1979
|
setup(props2) {
|
|
1978
1980
|
var show = ref(false);
|
|
@@ -13655,6 +13657,7 @@ function render$f(_ctx, _cache) {
|
|
|
13655
13657
|
onClose: _ctx.handleBlur
|
|
13656
13658
|
}, {
|
|
13657
13659
|
menu: withCtx(() => [createElementVNode("div", {
|
|
13660
|
+
ref: "menuEl",
|
|
13658
13661
|
class: normalizeClass(_ctx.n("scroller"))
|
|
13659
13662
|
}, [renderSlot(_ctx.$slots, "default")], 2)]),
|
|
13660
13663
|
default: withCtx(() => [createElementVNode("div", {
|
|
@@ -13759,6 +13762,7 @@ var Select = defineComponent({
|
|
|
13759
13762
|
validate: v,
|
|
13760
13763
|
resetValidation
|
|
13761
13764
|
} = useValidation();
|
|
13765
|
+
var menuEl = ref(null);
|
|
13762
13766
|
var computeLabel = () => {
|
|
13763
13767
|
var {
|
|
13764
13768
|
multiple: multiple2,
|
|
@@ -13846,6 +13850,7 @@ var Select = defineComponent({
|
|
|
13846
13850
|
isFocus.value = true;
|
|
13847
13851
|
call(onFocus);
|
|
13848
13852
|
validateWithTrigger("onFocus");
|
|
13853
|
+
detectBoundary();
|
|
13849
13854
|
};
|
|
13850
13855
|
var handleBlur = () => {
|
|
13851
13856
|
var {
|
|
@@ -13949,6 +13954,7 @@ var Select = defineComponent({
|
|
|
13949
13954
|
wrapWidth.value = getWrapWidth();
|
|
13950
13955
|
offsetY.value = getOffsetY() + toPxNum(props2.offsetY);
|
|
13951
13956
|
isFocus.value = true;
|
|
13957
|
+
detectBoundary();
|
|
13952
13958
|
};
|
|
13953
13959
|
var blur = () => {
|
|
13954
13960
|
isFocus.value = false;
|
|
@@ -13958,6 +13964,23 @@ var Select = defineComponent({
|
|
|
13958
13964
|
call(props2["onUpdate:modelValue"], props2.multiple ? [] : void 0);
|
|
13959
13965
|
resetValidation();
|
|
13960
13966
|
};
|
|
13967
|
+
var detectBoundary = () => {
|
|
13968
|
+
var {
|
|
13969
|
+
body
|
|
13970
|
+
} = document;
|
|
13971
|
+
nextTick(() => {
|
|
13972
|
+
var _menuEl$value, _menuEl$value2;
|
|
13973
|
+
var {
|
|
13974
|
+
offsetTop: menuOffsetTop,
|
|
13975
|
+
offsetHeight: menuOffsetHeight
|
|
13976
|
+
} = (_menuEl$value = menuEl.value) == null ? void 0 : _menuEl$value.parentElement;
|
|
13977
|
+
var menuOffsetBottom = body.scrollHeight - menuOffsetHeight - menuOffsetTop;
|
|
13978
|
+
if (menuOffsetTop < 0)
|
|
13979
|
+
offsetY.value = getOffsetY();
|
|
13980
|
+
if (menuOffsetBottom < 0)
|
|
13981
|
+
offsetY.value -= ((_menuEl$value2 = menuEl.value) == null ? void 0 : _menuEl$value2.parentElement).offsetHeight - getOffsetY();
|
|
13982
|
+
});
|
|
13983
|
+
};
|
|
13961
13984
|
watch(() => props2.multiple, () => {
|
|
13962
13985
|
var {
|
|
13963
13986
|
multiple: multiple2,
|
|
@@ -13990,6 +14013,7 @@ var Select = defineComponent({
|
|
|
13990
14013
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
13991
14014
|
label,
|
|
13992
14015
|
labels,
|
|
14016
|
+
menuEl,
|
|
13993
14017
|
n: n$h,
|
|
13994
14018
|
classes: classes$d,
|
|
13995
14019
|
computePlaceholderState,
|
package/highlight/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
|
-
"version": "1.27.
|
|
4
|
+
"version": "1.27.12",
|
|
5
5
|
"name": "VARLET",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -3976,7 +3976,7 @@
|
|
|
3976
3976
|
{
|
|
3977
3977
|
"name": "offset-y",
|
|
3978
3978
|
"description": "下拉菜单的垂直偏移量",
|
|
3979
|
-
"default": "
|
|
3979
|
+
"default": "0",
|
|
3980
3980
|
"value": {
|
|
3981
3981
|
"type": "string | number",
|
|
3982
3982
|
"kind": "expression"
|
package/lib/back-top/BackTop.js
CHANGED
|
@@ -33,17 +33,18 @@ function render(_ctx, _cache) {
|
|
|
33
33
|
return (0, _vue.openBlock)(), (0, _vue.createBlock)(_vue.Teleport, {
|
|
34
34
|
to: "body",
|
|
35
35
|
disabled: _ctx.disabled
|
|
36
|
-
}, [(0, _vue.createElementVNode)("div", {
|
|
37
|
-
class:
|
|
36
|
+
}, [(0, _vue.createElementVNode)("div", (0, _vue.mergeProps)({
|
|
37
|
+
class: _ctx.classes(_ctx.n(), [_ctx.show, _ctx.n('--active')]),
|
|
38
38
|
ref: "backTopEl",
|
|
39
|
-
style:
|
|
39
|
+
style: {
|
|
40
40
|
right: _ctx.toSizeUnit(_ctx.right),
|
|
41
41
|
bottom: _ctx.toSizeUnit(_ctx.bottom)
|
|
42
|
-
}
|
|
42
|
+
}
|
|
43
|
+
}, _ctx.$attrs, {
|
|
43
44
|
onClick: _cache[0] || (_cache[0] = (0, _vue.withModifiers)(function () {
|
|
44
45
|
return _ctx.click && _ctx.click(...arguments);
|
|
45
46
|
}, ["stop"]))
|
|
46
|
-
}, [(0, _vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, _vue.createVNode)(_component_var_button, {
|
|
47
|
+
}), [(0, _vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, _vue.createVNode)(_component_var_button, {
|
|
47
48
|
type: "primary",
|
|
48
49
|
round: "",
|
|
49
50
|
"var-back-top-cover": ""
|
|
@@ -54,8 +55,8 @@ function render(_ctx, _cache) {
|
|
|
54
55
|
_: 1
|
|
55
56
|
/* STABLE */
|
|
56
57
|
|
|
57
|
-
})])],
|
|
58
|
-
/*
|
|
58
|
+
})])], 16
|
|
59
|
+
/* FULL_PROPS */
|
|
59
60
|
)], 8
|
|
60
61
|
/* PROPS */
|
|
61
62
|
, ["disabled"]);
|
|
@@ -68,6 +69,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
68
69
|
VarButton: _button.default,
|
|
69
70
|
VarIcon: _icon.default
|
|
70
71
|
},
|
|
72
|
+
inheritAttrs: false,
|
|
71
73
|
props: _props.props,
|
|
72
74
|
|
|
73
75
|
setup(props) {
|
package/lib/select/Select.js
CHANGED
|
@@ -74,6 +74,7 @@ function render(_ctx, _cache) {
|
|
|
74
74
|
onClose: _ctx.handleBlur
|
|
75
75
|
}, {
|
|
76
76
|
menu: (0, _vue.withCtx)(() => [(0, _vue.createElementVNode)("div", {
|
|
77
|
+
ref: "menuEl",
|
|
77
78
|
class: (0, _vue.normalizeClass)(_ctx.n('scroller'))
|
|
78
79
|
}, [(0, _vue.renderSlot)(_ctx.$slots, "default")], 2
|
|
79
80
|
/* CLASS */
|
|
@@ -222,6 +223,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
222
223
|
// expose
|
|
223
224
|
resetValidation
|
|
224
225
|
} = (0, _components.useValidation)();
|
|
226
|
+
var menuEl = (0, _vue.ref)(null);
|
|
225
227
|
|
|
226
228
|
var computeLabel = () => {
|
|
227
229
|
var {
|
|
@@ -329,6 +331,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
329
331
|
isFocus.value = true;
|
|
330
332
|
(0, _components.call)(onFocus);
|
|
331
333
|
validateWithTrigger('onFocus');
|
|
334
|
+
detectBoundary();
|
|
332
335
|
};
|
|
333
336
|
|
|
334
337
|
var handleBlur = () => {
|
|
@@ -453,6 +456,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
453
456
|
wrapWidth.value = getWrapWidth();
|
|
454
457
|
offsetY.value = getOffsetY() + (0, _elements.toPxNum)(props.offsetY);
|
|
455
458
|
isFocus.value = true;
|
|
459
|
+
detectBoundary();
|
|
456
460
|
}; // expose
|
|
457
461
|
|
|
458
462
|
|
|
@@ -469,6 +473,23 @@ var _default = (0, _vue.defineComponent)({
|
|
|
469
473
|
resetValidation();
|
|
470
474
|
};
|
|
471
475
|
|
|
476
|
+
var detectBoundary = () => {
|
|
477
|
+
var {
|
|
478
|
+
body
|
|
479
|
+
} = document;
|
|
480
|
+
(0, _vue.nextTick)(() => {
|
|
481
|
+
var _menuEl$value, _menuEl$value2;
|
|
482
|
+
|
|
483
|
+
var {
|
|
484
|
+
offsetTop: menuOffsetTop,
|
|
485
|
+
offsetHeight: menuOffsetHeight
|
|
486
|
+
} = (_menuEl$value = menuEl.value) == null ? void 0 : _menuEl$value.parentElement;
|
|
487
|
+
var menuOffsetBottom = body.scrollHeight - menuOffsetHeight - menuOffsetTop;
|
|
488
|
+
if (menuOffsetTop < 0) offsetY.value = getOffsetY();
|
|
489
|
+
if (menuOffsetBottom < 0) offsetY.value -= ((_menuEl$value2 = menuEl.value) == null ? void 0 : _menuEl$value2.parentElement).offsetHeight - getOffsetY();
|
|
490
|
+
});
|
|
491
|
+
};
|
|
492
|
+
|
|
472
493
|
(0, _vue.watch)(() => props.multiple, () => {
|
|
473
494
|
var {
|
|
474
495
|
multiple,
|
|
@@ -502,6 +523,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
502
523
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
503
524
|
label,
|
|
504
525
|
labels,
|
|
526
|
+
menuEl,
|
|
505
527
|
n,
|
|
506
528
|
classes,
|
|
507
529
|
computePlaceholderState,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.13",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
},
|
|
40
40
|
"gitHead": "ee9c3866bedad96c86365b0f9888a3a6bb781b1f",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@varlet/icons": "1.27.
|
|
42
|
+
"@varlet/icons": "1.27.13",
|
|
43
43
|
"dayjs": "^1.10.4",
|
|
44
44
|
"decimal.js": "^10.2.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@varlet/cli": "1.27.
|
|
48
|
-
"@varlet/touch-emulator": "1.27.
|
|
47
|
+
"@varlet/cli": "1.27.13",
|
|
48
|
+
"@varlet/touch-emulator": "1.27.13",
|
|
49
49
|
"@vue/runtime-core": "3.2.25",
|
|
50
50
|
"@vue/test-utils": "2.0.0-rc.6",
|
|
51
51
|
"clipboard": "^2.0.6",
|