@varlet/ui 1.27.9-alpha.1653036733481 → 1.27.9
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/bottom-navigation-item/BottomNavigationItem.js +3 -1
- package/es/card/Card.js +48 -40
- package/es/card/card.css +1 -1
- package/es/card/card.less +33 -32
- package/es/card/props.js +8 -1
- package/es/style.css +1 -1
- package/es/varlet.esm.js +46 -37
- package/highlight/attributes.json +3 -3
- package/highlight/tags.json +3 -3
- package/highlight/web-types.json +5 -5
- package/lib/bottom-navigation-item/BottomNavigationItem.js +3 -1
- package/lib/card/Card.js +48 -40
- package/lib/card/card.css +1 -1
- package/lib/card/card.less +33 -32
- package/lib/card/props.js +8 -1
- package/lib/snackbar/style/index.js +1 -1
- package/lib/snackbar/style/less.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +4 -4
- package/types/card.d.ts +9 -2
- package/umd/varlet.js +2 -2
package/es/varlet.esm.js
CHANGED
|
@@ -2502,7 +2502,8 @@ var BottomNavigationItem = defineComponent({
|
|
|
2502
2502
|
return active.value === name.value || active.value === index.value ? activeColor.value : inactiveColor.value;
|
|
2503
2503
|
};
|
|
2504
2504
|
var handleClick = () => {
|
|
2505
|
-
var
|
|
2505
|
+
var _name$value;
|
|
2506
|
+
var active2 = (_name$value = name.value) != null ? _name$value : index.value;
|
|
2506
2507
|
call(props2.onClick, active2);
|
|
2507
2508
|
call(bottomNavigation2.onToggle, active2);
|
|
2508
2509
|
};
|
|
@@ -2542,7 +2543,10 @@ var props$K = {
|
|
|
2542
2543
|
height: {
|
|
2543
2544
|
type: [String, Number]
|
|
2544
2545
|
},
|
|
2545
|
-
|
|
2546
|
+
imageHeight: {
|
|
2547
|
+
type: [String, Number]
|
|
2548
|
+
},
|
|
2549
|
+
imageWidth: {
|
|
2546
2550
|
type: [String, Number]
|
|
2547
2551
|
},
|
|
2548
2552
|
layout: {
|
|
@@ -2622,15 +2626,18 @@ function render$Q(_ctx, _cache) {
|
|
|
2622
2626
|
var _component_var_icon = resolveComponent("var-icon");
|
|
2623
2627
|
var _component_var_button = resolveComponent("var-button");
|
|
2624
2628
|
var _directive_ripple = resolveDirective("ripple");
|
|
2625
|
-
return openBlock(), createElementBlock("div", {
|
|
2629
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
2626
2630
|
ref: "card",
|
|
2627
|
-
class: normalizeClass(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n("--layout-row")])),
|
|
2631
|
+
class: normalizeClass(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n("--layout-row")], [_ctx.elevation, "var-elevation--" + _ctx.elevation, "var-elevation--1"])),
|
|
2632
|
+
style: normalizeStyle({
|
|
2633
|
+
zIndex: _ctx.floated ? _ctx.zIndex : void 0
|
|
2634
|
+
}),
|
|
2628
2635
|
onClick: _cache[0] || (_cache[0] = function() {
|
|
2629
2636
|
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
2630
2637
|
})
|
|
2631
|
-
}, [
|
|
2638
|
+
}, [createElementVNode("div", {
|
|
2632
2639
|
ref: "cardFloater",
|
|
2633
|
-
class: normalizeClass(_ctx.classes(_ctx.n("floater")
|
|
2640
|
+
class: normalizeClass(_ctx.classes(_ctx.n("floater"))),
|
|
2634
2641
|
style: normalizeStyle({
|
|
2635
2642
|
width: _ctx.floaterWidth,
|
|
2636
2643
|
height: _ctx.floaterHeight,
|
|
@@ -2638,21 +2645,22 @@ function render$Q(_ctx, _cache) {
|
|
|
2638
2645
|
left: _ctx.floaterLeft,
|
|
2639
2646
|
overflow: _ctx.floaterOverflow,
|
|
2640
2647
|
position: _ctx.floaterPosition,
|
|
2641
|
-
|
|
2642
|
-
zIndex: _ctx.floated ? _ctx.zIndex : void 0,
|
|
2643
|
-
transition: _ctx.floated ? "background-color " + _ctx.floatingDuration + "ms, border-radius " + _ctx.floatingDuration + "ms, width " + _ctx.floatingDuration + "ms, height " + _ctx.floatingDuration + "ms, top " + _ctx.floatingDuration + "ms, left " + _ctx.floatingDuration + "ms" : void 0
|
|
2648
|
+
transition: _ctx.floated ? "background-color " + _ctx.floatingDuration + "ms, width " + _ctx.floatingDuration + "ms, height " + _ctx.floatingDuration + "ms, top " + _ctx.floatingDuration + "ms, left " + _ctx.floatingDuration + "ms" : void 0
|
|
2644
2649
|
})
|
|
2645
|
-
}, [renderSlot(_ctx.$slots, "image", {}, () =>
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2650
|
+
}, [renderSlot(_ctx.$slots, "image", {}, () => {
|
|
2651
|
+
var _ctx$imageHeight;
|
|
2652
|
+
return [_ctx.src ? (openBlock(), createElementBlock("img", {
|
|
2653
|
+
key: 0,
|
|
2654
|
+
class: normalizeClass(_ctx.n("image")),
|
|
2655
|
+
style: normalizeStyle({
|
|
2656
|
+
objectFit: _ctx.fit,
|
|
2657
|
+
height: _ctx.toSizeUnit((_ctx$imageHeight = _ctx.imageHeight) != null ? _ctx$imageHeight : _ctx.height),
|
|
2658
|
+
width: _ctx.toSizeUnit(_ctx.imageWidth)
|
|
2659
|
+
}),
|
|
2660
|
+
src: _ctx.src,
|
|
2661
|
+
alt: _ctx.alt
|
|
2662
|
+
}, null, 14, _hoisted_1$g)) : createCommentVNode("v-if", true)];
|
|
2663
|
+
}), createElementVNode("div", {
|
|
2656
2664
|
class: normalizeClass(_ctx.n("container"))
|
|
2657
2665
|
}, [renderSlot(_ctx.$slots, "title", {}, () => [_ctx.title ? (openBlock(), createElementBlock("div", {
|
|
2658
2666
|
key: 0,
|
|
@@ -2674,34 +2682,35 @@ function render$Q(_ctx, _cache) {
|
|
|
2674
2682
|
opacity: _ctx.opacity,
|
|
2675
2683
|
transition: "opacity " + _ctx.floatingDuration * 2 + "ms"
|
|
2676
2684
|
})
|
|
2677
|
-
}, [renderSlot(_ctx.$slots, "content")], 6)) : createCommentVNode("v-if", true)], 2), _ctx.
|
|
2685
|
+
}, [renderSlot(_ctx.$slots, "content")], 6)) : createCommentVNode("v-if", true)], 2), _ctx.showFloatingButtons ? (openBlock(), createElementBlock("div", {
|
|
2678
2686
|
key: 0,
|
|
2679
|
-
class: normalizeClass(_ctx.classes(_ctx.n("
|
|
2687
|
+
class: normalizeClass(_ctx.classes(_ctx.n("floating-buttons"), "var--box")),
|
|
2680
2688
|
style: normalizeStyle({
|
|
2681
2689
|
zIndex: _ctx.zIndex,
|
|
2682
2690
|
opacity: _ctx.opacity,
|
|
2683
2691
|
transition: "opacity " + _ctx.floatingDuration * 2 + "ms"
|
|
2684
2692
|
})
|
|
2685
|
-
}, [renderSlot(_ctx.$slots, "
|
|
2686
|
-
|
|
2693
|
+
}, [renderSlot(_ctx.$slots, "close-button", {}, () => [createVNode(_component_var_button, {
|
|
2694
|
+
"var-card-cover": "",
|
|
2687
2695
|
round: "",
|
|
2688
|
-
class: normalizeClass(_ctx.classes(_ctx.n("
|
|
2696
|
+
class: normalizeClass(_ctx.classes(_ctx.n("close-button"), "var-elevation--6")),
|
|
2689
2697
|
onClick: withModifiers(_ctx.close, ["stop"])
|
|
2690
2698
|
}, {
|
|
2691
2699
|
default: withCtx(() => [createVNode(_component_var_icon, {
|
|
2700
|
+
"var-card-cover": "",
|
|
2692
2701
|
name: "window-close",
|
|
2693
|
-
|
|
2694
|
-
})]),
|
|
2702
|
+
class: normalizeClass(_ctx.n("close-button-icon"))
|
|
2703
|
+
}, null, 8, ["class"])]),
|
|
2695
2704
|
_: 1
|
|
2696
|
-
}, 8, ["class", "onClick"])])
|
|
2697
|
-
disabled: !_ctx.ripple || _ctx.floater
|
|
2698
|
-
}]]), createElementVNode("div", {
|
|
2705
|
+
}, 8, ["class", "onClick"])])], 6)) : createCommentVNode("v-if", true)], 6), createElementVNode("div", {
|
|
2699
2706
|
class: normalizeClass(_ctx.n("holder")),
|
|
2700
2707
|
style: normalizeStyle({
|
|
2701
2708
|
width: _ctx.holderWidth,
|
|
2702
2709
|
height: _ctx.holderHeight
|
|
2703
2710
|
})
|
|
2704
|
-
}, null, 6)],
|
|
2711
|
+
}, null, 6)], 6)), [[_directive_ripple, {
|
|
2712
|
+
disabled: !_ctx.ripple || _ctx.floater
|
|
2713
|
+
}]]);
|
|
2705
2714
|
}
|
|
2706
2715
|
var Card = defineComponent({
|
|
2707
2716
|
render: render$Q,
|
|
@@ -2723,7 +2732,7 @@ var Card = defineComponent({
|
|
|
2723
2732
|
var floaterHeight = ref("100%");
|
|
2724
2733
|
var floaterTop = ref("auto");
|
|
2725
2734
|
var floaterLeft = ref("auto");
|
|
2726
|
-
var floaterPosition = ref(
|
|
2735
|
+
var floaterPosition = ref(void 0);
|
|
2727
2736
|
var floaterOverflow = ref("hidden");
|
|
2728
2737
|
var contentHeight = ref("0px");
|
|
2729
2738
|
var opacity = ref("0");
|
|
@@ -2731,7 +2740,7 @@ var Card = defineComponent({
|
|
|
2731
2740
|
zIndex
|
|
2732
2741
|
} = useZIndex(() => props2.floating, 1);
|
|
2733
2742
|
var isRow = computed(() => props2.layout === "row");
|
|
2734
|
-
var
|
|
2743
|
+
var showFloatingButtons = ref(false);
|
|
2735
2744
|
var floated = ref(false);
|
|
2736
2745
|
useLock(() => props2.floating, () => isRow);
|
|
2737
2746
|
var dropdownFloaterTop = "auto";
|
|
@@ -2759,7 +2768,7 @@ var Card = defineComponent({
|
|
|
2759
2768
|
floaterPosition.value = "fixed";
|
|
2760
2769
|
dropdownFloaterTop = floaterTop.value;
|
|
2761
2770
|
dropdownFloaterLeft = floaterLeft.value;
|
|
2762
|
-
|
|
2771
|
+
showFloatingButtons.value = true;
|
|
2763
2772
|
yield doubleRaf();
|
|
2764
2773
|
floaterTop.value = "0";
|
|
2765
2774
|
floaterLeft.value = "0";
|
|
@@ -2785,7 +2794,7 @@ var Card = defineComponent({
|
|
|
2785
2794
|
floaterLeft.value = dropdownFloaterLeft;
|
|
2786
2795
|
contentHeight.value = "0px";
|
|
2787
2796
|
opacity.value = "0";
|
|
2788
|
-
|
|
2797
|
+
showFloatingButtons.value = false;
|
|
2789
2798
|
dropper = setTimeout(() => {
|
|
2790
2799
|
holderWidth.value = "auto";
|
|
2791
2800
|
holderHeight.value = "auto";
|
|
@@ -2796,7 +2805,7 @@ var Card = defineComponent({
|
|
|
2796
2805
|
dropdownFloaterTop = "auto";
|
|
2797
2806
|
dropdownFloaterLeft = "auto";
|
|
2798
2807
|
floaterOverflow.value = "hidden";
|
|
2799
|
-
floaterPosition.value =
|
|
2808
|
+
floaterPosition.value = void 0;
|
|
2800
2809
|
floated.value = false;
|
|
2801
2810
|
}, props2.floatingDuration);
|
|
2802
2811
|
};
|
|
@@ -2832,7 +2841,7 @@ var Card = defineComponent({
|
|
|
2832
2841
|
zIndex,
|
|
2833
2842
|
isRow,
|
|
2834
2843
|
close,
|
|
2835
|
-
|
|
2844
|
+
showFloatingButtons,
|
|
2836
2845
|
floated
|
|
2837
2846
|
};
|
|
2838
2847
|
}
|
|
@@ -251,11 +251,11 @@
|
|
|
251
251
|
"type": "string",
|
|
252
252
|
"description": "替代文本 默认值:-"
|
|
253
253
|
},
|
|
254
|
-
"var-card/height": {
|
|
254
|
+
"var-card/image-height": {
|
|
255
255
|
"type": "string | number",
|
|
256
256
|
"description": "图片高度 默认值:-"
|
|
257
257
|
},
|
|
258
|
-
"var-card/width": {
|
|
258
|
+
"var-card/image-width": {
|
|
259
259
|
"type": "string | number",
|
|
260
260
|
"description": "图片宽度 默认值:-"
|
|
261
261
|
},
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
"type": "boolean",
|
|
268
268
|
"description": "是否开启全屏 默认值:false"
|
|
269
269
|
},
|
|
270
|
-
"var-card/
|
|
270
|
+
"var-card/floating-duration": {
|
|
271
271
|
"type": "number",
|
|
272
272
|
"description": "开关全屏所需时间(ms) 默认值:250"
|
|
273
273
|
},
|
package/highlight/tags.json
CHANGED
package/highlight/web-types.json
CHANGED
|
@@ -734,7 +734,7 @@
|
|
|
734
734
|
}
|
|
735
735
|
},
|
|
736
736
|
{
|
|
737
|
-
"name": "height",
|
|
737
|
+
"name": "image-height",
|
|
738
738
|
"description": "图片高度",
|
|
739
739
|
"default": "-",
|
|
740
740
|
"value": {
|
|
@@ -743,7 +743,7 @@
|
|
|
743
743
|
}
|
|
744
744
|
},
|
|
745
745
|
{
|
|
746
|
-
"name": "width",
|
|
746
|
+
"name": "image-width",
|
|
747
747
|
"description": "图片宽度",
|
|
748
748
|
"default": "-",
|
|
749
749
|
"value": {
|
|
@@ -770,7 +770,7 @@
|
|
|
770
770
|
}
|
|
771
771
|
},
|
|
772
772
|
{
|
|
773
|
-
"name": "
|
|
773
|
+
"name": "floating-duration",
|
|
774
774
|
"description": "开关全屏所需时间(ms)",
|
|
775
775
|
"default": "250",
|
|
776
776
|
"value": {
|
|
@@ -811,8 +811,8 @@
|
|
|
811
811
|
"description": "自定义底部内容"
|
|
812
812
|
},
|
|
813
813
|
{
|
|
814
|
-
"name": "
|
|
815
|
-
"description": "
|
|
814
|
+
"name": "close-button",
|
|
815
|
+
"description": "自定义关闭"
|
|
816
816
|
}
|
|
817
817
|
]
|
|
818
818
|
},
|
|
@@ -112,7 +112,9 @@ var _default = (0, _vue.defineComponent)({
|
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
var handleClick = () => {
|
|
115
|
-
var
|
|
115
|
+
var _name$value;
|
|
116
|
+
|
|
117
|
+
var active = (_name$value = name.value) != null ? _name$value : index.value;
|
|
116
118
|
(0, _components.call)(props.onClick, active);
|
|
117
119
|
(0, _components.call)(bottomNavigation.onToggle, active);
|
|
118
120
|
};
|
package/lib/card/Card.js
CHANGED
|
@@ -45,15 +45,18 @@ function render(_ctx, _cache) {
|
|
|
45
45
|
|
|
46
46
|
var _directive_ripple = (0, _vue.resolveDirective)("ripple");
|
|
47
47
|
|
|
48
|
-
return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
48
|
+
return (0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
49
49
|
ref: "card",
|
|
50
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n('--layout-row')])),
|
|
50
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n('--layout-row')], [_ctx.elevation, "var-elevation--" + _ctx.elevation, 'var-elevation--1'])),
|
|
51
|
+
style: (0, _vue.normalizeStyle)({
|
|
52
|
+
zIndex: _ctx.floated ? _ctx.zIndex : undefined
|
|
53
|
+
}),
|
|
51
54
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
52
55
|
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
53
56
|
})
|
|
54
|
-
}, [(0, _vue.
|
|
57
|
+
}, [(0, _vue.createElementVNode)("div", {
|
|
55
58
|
ref: "cardFloater",
|
|
56
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('floater')
|
|
59
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('floater'))),
|
|
57
60
|
style: (0, _vue.normalizeStyle)({
|
|
58
61
|
width: _ctx.floaterWidth,
|
|
59
62
|
height: _ctx.floaterHeight,
|
|
@@ -61,23 +64,25 @@ function render(_ctx, _cache) {
|
|
|
61
64
|
left: _ctx.floaterLeft,
|
|
62
65
|
overflow: _ctx.floaterOverflow,
|
|
63
66
|
position: _ctx.floaterPosition,
|
|
64
|
-
|
|
65
|
-
zIndex: _ctx.floated ? _ctx.zIndex : undefined,
|
|
66
|
-
transition: _ctx.floated ? "background-color " + _ctx.floatingDuration + "ms, border-radius " + _ctx.floatingDuration + "ms, width " + _ctx.floatingDuration + "ms, height " + _ctx.floatingDuration + "ms, top " + _ctx.floatingDuration + "ms, left " + _ctx.floatingDuration + "ms" : undefined
|
|
67
|
+
transition: _ctx.floated ? "background-color " + _ctx.floatingDuration + "ms, width " + _ctx.floatingDuration + "ms, height " + _ctx.floatingDuration + "ms, top " + _ctx.floatingDuration + "ms, left " + _ctx.floatingDuration + "ms" : undefined
|
|
67
68
|
})
|
|
68
|
-
}, [(0, _vue.renderSlot)(_ctx.$slots, "image", {}, () =>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
}, [(0, _vue.renderSlot)(_ctx.$slots, "image", {}, () => {
|
|
70
|
+
var _ctx$imageHeight;
|
|
71
|
+
|
|
72
|
+
return [_ctx.src ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("img", {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: (0, _vue.normalizeClass)(_ctx.n('image')),
|
|
75
|
+
style: (0, _vue.normalizeStyle)({
|
|
76
|
+
objectFit: _ctx.fit,
|
|
77
|
+
height: _ctx.toSizeUnit((_ctx$imageHeight = _ctx.imageHeight) != null ? _ctx$imageHeight : _ctx.height),
|
|
78
|
+
width: _ctx.toSizeUnit(_ctx.imageWidth)
|
|
79
|
+
}),
|
|
80
|
+
src: _ctx.src,
|
|
81
|
+
alt: _ctx.alt
|
|
82
|
+
}, null, 14
|
|
83
|
+
/* CLASS, STYLE, PROPS */
|
|
84
|
+
, _hoisted_1)) : (0, _vue.createCommentVNode)("v-if", true)];
|
|
85
|
+
}), (0, _vue.createElementVNode)("div", {
|
|
81
86
|
class: (0, _vue.normalizeClass)(_ctx.n('container'))
|
|
82
87
|
}, [(0, _vue.renderSlot)(_ctx.$slots, "title", {}, () => [_ctx.title ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
83
88
|
key: 0,
|
|
@@ -111,36 +116,37 @@ function render(_ctx, _cache) {
|
|
|
111
116
|
/* CLASS, STYLE */
|
|
112
117
|
)) : (0, _vue.createCommentVNode)("v-if", true)], 2
|
|
113
118
|
/* CLASS */
|
|
114
|
-
), _ctx.
|
|
119
|
+
), _ctx.showFloatingButtons ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
115
120
|
key: 0,
|
|
116
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('
|
|
121
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('floating-buttons'), 'var--box')),
|
|
117
122
|
style: (0, _vue.normalizeStyle)({
|
|
118
123
|
zIndex: _ctx.zIndex,
|
|
119
124
|
opacity: _ctx.opacity,
|
|
120
125
|
transition: "opacity " + _ctx.floatingDuration * 2 + "ms"
|
|
121
126
|
})
|
|
122
|
-
}, [(0, _vue.renderSlot)(_ctx.$slots, "
|
|
123
|
-
|
|
127
|
+
}, [(0, _vue.renderSlot)(_ctx.$slots, "close-button", {}, () => [(0, _vue.createVNode)(_component_var_button, {
|
|
128
|
+
"var-card-cover": "",
|
|
124
129
|
round: "",
|
|
125
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('
|
|
130
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('close-button'), 'var-elevation--6')),
|
|
126
131
|
onClick: (0, _vue.withModifiers)(_ctx.close, ["stop"])
|
|
127
132
|
}, {
|
|
128
133
|
default: (0, _vue.withCtx)(() => [(0, _vue.createVNode)(_component_var_icon, {
|
|
134
|
+
"var-card-cover": "",
|
|
129
135
|
name: "window-close",
|
|
130
|
-
|
|
131
|
-
}
|
|
136
|
+
class: (0, _vue.normalizeClass)(_ctx.n('close-button-icon'))
|
|
137
|
+
}, null, 8
|
|
138
|
+
/* PROPS */
|
|
139
|
+
, ["class"])]),
|
|
132
140
|
_: 1
|
|
133
141
|
/* STABLE */
|
|
134
142
|
|
|
135
143
|
}, 8
|
|
136
144
|
/* PROPS */
|
|
137
|
-
, ["class", "onClick"])])
|
|
145
|
+
, ["class", "onClick"])])], 6
|
|
138
146
|
/* CLASS, STYLE */
|
|
139
147
|
)) : (0, _vue.createCommentVNode)("v-if", true)], 6
|
|
140
148
|
/* CLASS, STYLE */
|
|
141
|
-
)
|
|
142
|
-
disabled: !_ctx.ripple || _ctx.floater
|
|
143
|
-
}]]), (0, _vue.createElementVNode)("div", {
|
|
149
|
+
), (0, _vue.createElementVNode)("div", {
|
|
144
150
|
class: (0, _vue.normalizeClass)(_ctx.n('holder')),
|
|
145
151
|
style: (0, _vue.normalizeStyle)({
|
|
146
152
|
width: _ctx.holderWidth,
|
|
@@ -148,9 +154,11 @@ function render(_ctx, _cache) {
|
|
|
148
154
|
})
|
|
149
155
|
}, null, 6
|
|
150
156
|
/* CLASS, STYLE */
|
|
151
|
-
)],
|
|
152
|
-
/* CLASS */
|
|
153
|
-
)
|
|
157
|
+
)], 6
|
|
158
|
+
/* CLASS, STYLE */
|
|
159
|
+
)), [[_directive_ripple, {
|
|
160
|
+
disabled: !_ctx.ripple || _ctx.floater
|
|
161
|
+
}]]);
|
|
154
162
|
}
|
|
155
163
|
|
|
156
164
|
var _default = (0, _vue.defineComponent)({
|
|
@@ -174,7 +182,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
174
182
|
var floaterHeight = (0, _vue.ref)('100%');
|
|
175
183
|
var floaterTop = (0, _vue.ref)('auto');
|
|
176
184
|
var floaterLeft = (0, _vue.ref)('auto');
|
|
177
|
-
var floaterPosition = (0, _vue.ref)(
|
|
185
|
+
var floaterPosition = (0, _vue.ref)(undefined);
|
|
178
186
|
var floaterOverflow = (0, _vue.ref)('hidden');
|
|
179
187
|
var contentHeight = (0, _vue.ref)('0px');
|
|
180
188
|
var opacity = (0, _vue.ref)('0');
|
|
@@ -182,7 +190,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
182
190
|
zIndex
|
|
183
191
|
} = (0, _zIndex.useZIndex)(() => props.floating, 1);
|
|
184
192
|
var isRow = (0, _vue.computed)(() => props.layout === 'row');
|
|
185
|
-
var
|
|
193
|
+
var showFloatingButtons = (0, _vue.ref)(false);
|
|
186
194
|
var floated = (0, _vue.ref)(false);
|
|
187
195
|
(0, _lock.useLock)(() => props.floating, () => isRow);
|
|
188
196
|
var dropdownFloaterTop = 'auto';
|
|
@@ -211,7 +219,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
211
219
|
floaterPosition.value = 'fixed';
|
|
212
220
|
dropdownFloaterTop = floaterTop.value;
|
|
213
221
|
dropdownFloaterLeft = floaterLeft.value;
|
|
214
|
-
|
|
222
|
+
showFloatingButtons.value = true;
|
|
215
223
|
yield (0, _elements.doubleRaf)();
|
|
216
224
|
floaterTop.value = '0';
|
|
217
225
|
floaterLeft.value = '0';
|
|
@@ -239,7 +247,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
239
247
|
floaterLeft.value = dropdownFloaterLeft;
|
|
240
248
|
contentHeight.value = '0px';
|
|
241
249
|
opacity.value = '0';
|
|
242
|
-
|
|
250
|
+
showFloatingButtons.value = false;
|
|
243
251
|
dropper = setTimeout(() => {
|
|
244
252
|
holderWidth.value = 'auto';
|
|
245
253
|
holderHeight.value = 'auto';
|
|
@@ -250,7 +258,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
250
258
|
dropdownFloaterTop = 'auto';
|
|
251
259
|
dropdownFloaterLeft = 'auto';
|
|
252
260
|
floaterOverflow.value = 'hidden';
|
|
253
|
-
floaterPosition.value =
|
|
261
|
+
floaterPosition.value = undefined;
|
|
254
262
|
floated.value = false;
|
|
255
263
|
}, props.floatingDuration);
|
|
256
264
|
};
|
|
@@ -287,7 +295,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
287
295
|
zIndex,
|
|
288
296
|
isRow,
|
|
289
297
|
close,
|
|
290
|
-
|
|
298
|
+
showFloatingButtons,
|
|
291
299
|
floated
|
|
292
300
|
};
|
|
293
301
|
}
|
package/lib/card/card.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --card-padding: 0 0 15px 0; --card-background: #fff; --card-border-radius: 4px; --card-image-width: 100%; --card-row-image-width:
|
|
1
|
+
:root { --card-padding: 0 0 15px 0; --card-background: #fff; --card-border-radius: 4px; --card-image-width: 100%; --card-row-image-width: 140px; --card-image-height: 200px; --card-row-height: 140px; --card-title-color: #333; --card-title-font-size: 20px; --card-title-padding: 0 12px; --card-title-margin: 15px 0 0 0; --card-title-row-margin: 12px 0; --card-subtitle-color: rgba(0, 0, 0, 0.6); --card-subtitle-font-size: 14px; --card-subtitle-padding: 0 12px; --card-subtitle-margin: 10px 0 0 0; --card-subtitle-row-margin: -8px 0 0 0; --card-description-color: rgba(0, 0, 0, 0.6); --card-description-font-size: 14px; --card-description-margin: 20px 0 0 0; --card-description-padding: 0 13px; --card-footer-padding: 0 12px; --card-footer-right: 13px; --card-footer-bottom: 9px; --card-footer-margin: 30px 0 0px 0; --card-line-height: 22px; --card-row-line-height: 1.5; --card-floating-buttons-bottom: 16px; --card-floating-buttons-right: 16px; --card-floating-buttons-color: #fff; --card-close-button-icon-size: 24px; --card-close-button-size: 56px; --card-close-button-primary-color: #212121;}.var-card { border-radius: var(--card-border-radius); overflow: hidden;}.var-card__floater { display: flex; flex-direction: column; position: static; line-height: var(--card-line-height); background: var(--card-background); transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);}.var-card__container { padding: var(--card-padding); flex-grow: 1; min-width: 0;}.var-card--layout-row .var-card__floater { min-height: var(--card-row-height); height: 100%; flex-direction: row; position: relative; line-height: var(--card-row-line-height);}.var-card__image { width: var(--card-image-width); height: var(--card-image-height); display: block;}.var-card--layout-row .var-card__image { width: var(--card-row-image-width); height: auto; display: block; flex-shrink: 0;}.var-card__title { font-size: var(--card-title-font-size); padding: var(--card-title-padding); margin: var(--card-title-margin); color: var(--card-title-color); word-break: break-word;}.var-card--layout-row .var-card__title { max-width: 100%; overflow: hidden; margin: var(--card-title-row-margin); text-overflow: ellipsis; white-space: nowrap;}.var-card__subtitle { font-size: var(--card-subtitle-font-size); color: var(--card-subtitle-color); padding: var(--card-subtitle-padding); margin: var(--card-subtitle-margin); word-break: break-word;}.var-card--layout-row .var-card__subtitle { margin: var(--card-subtitle-row-margin); text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;}.var-card__description { font-size: var(--card-description-font-size); color: var(--card-description-color); margin: var(--card-description-margin); padding: var(--card-description-padding); word-break: break-all;}.var-card__footer { display: flex; justify-content: flex-end; padding: var(--card-footer-padding); margin: var(--card-footer-margin);}.var-card--layout-row .var-card__footer { position: absolute; padding: 0; right: var(--card-footer-right); bottom: var(--card-footer-bottom);}.var-card__content { overflow: hidden; transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);}.var-card__floating-buttons { position: fixed; bottom: var(--card-floating-buttons-bottom); right: var(--card-floating-buttons-right); color: var(--card-floating-buttons-color);}.var-card__close-button[var-card-cover] { padding: var(--card-close-button-padding); width: var(--card-close-button-size); height: var(--card-close-button-size); background-color: var(--card-close-button-primary-color);}.var-card__close-button-icon[var-card-cover] { font-size: var(--card-close-button-icon-size);}
|
package/lib/card/card.less
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
@card-background: #fff;
|
|
3
3
|
@card-border-radius: 4px;
|
|
4
4
|
@card-image-width: 100%;
|
|
5
|
-
@card-row-image-width:
|
|
6
|
-
@card-row-height:
|
|
5
|
+
@card-row-image-width: 140px;
|
|
6
|
+
@card-row-height: 140px;
|
|
7
7
|
@card-image-height: 200px;
|
|
8
8
|
@card-title-color: #333;
|
|
9
9
|
@card-title-font-size: 20px;
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
@card-footer-margin: 30px 0 0px 0;
|
|
26
26
|
@card-line-height: 22px;
|
|
27
27
|
@card-row-line-height: 1.5;
|
|
28
|
-
@card-
|
|
29
|
-
@card-
|
|
30
|
-
@card-
|
|
31
|
-
@card-
|
|
32
|
-
@card-
|
|
33
|
-
@card-
|
|
28
|
+
@card-floating-buttons-bottom: 16px;
|
|
29
|
+
@card-floating-buttons-right: 16px;
|
|
30
|
+
@card-floating-buttons-color: #fff;
|
|
31
|
+
@card-close-button-icon-size: 24px;
|
|
32
|
+
@card-close-button-size: 56px;
|
|
33
|
+
@card-close-button-primary-color: #212121;
|
|
34
34
|
|
|
35
35
|
:root {
|
|
36
36
|
--card-padding: @card-padding;
|
|
@@ -60,24 +60,22 @@
|
|
|
60
60
|
--card-footer-margin: @card-footer-margin;
|
|
61
61
|
--card-line-height: @card-line-height;
|
|
62
62
|
--card-row-line-height: @card-row-line-height;
|
|
63
|
-
--card-
|
|
64
|
-
--card-
|
|
65
|
-
--card-
|
|
66
|
-
--card-
|
|
67
|
-
--card-
|
|
68
|
-
--card-
|
|
63
|
+
--card-floating-buttons-bottom: @card-floating-buttons-bottom;
|
|
64
|
+
--card-floating-buttons-right: @card-floating-buttons-right;
|
|
65
|
+
--card-floating-buttons-color: @card-floating-buttons-color;
|
|
66
|
+
--card-close-button-icon-size: @card-close-button-icon-size;
|
|
67
|
+
--card-close-button-size: @card-close-button-size;
|
|
68
|
+
--card-close-button-primary-color: @card-close-button-primary-color;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.var-card {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
position: relative;
|
|
75
|
-
}
|
|
72
|
+
border-radius: var(--card-border-radius);
|
|
73
|
+
overflow: hidden;
|
|
76
74
|
|
|
77
75
|
&__floater {
|
|
78
|
-
border-radius: var(--card-border-radius);
|
|
79
76
|
display: flex;
|
|
80
77
|
flex-direction: column;
|
|
78
|
+
position: static;
|
|
81
79
|
line-height: var(--card-line-height);
|
|
82
80
|
background: var(--card-background);
|
|
83
81
|
transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);
|
|
@@ -90,7 +88,10 @@
|
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
&--layout-row &__floater {
|
|
91
|
+
min-height: var(--card-row-height);
|
|
92
|
+
height: 100%;
|
|
93
93
|
flex-direction: row;
|
|
94
|
+
position: relative;
|
|
94
95
|
line-height: var(--card-row-line-height);
|
|
95
96
|
}
|
|
96
97
|
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
|
|
103
104
|
&--layout-row &__image {
|
|
104
105
|
width: var(--card-row-image-width);
|
|
105
|
-
height:
|
|
106
|
+
height: auto;
|
|
106
107
|
display: block;
|
|
107
108
|
flex-shrink: 0;
|
|
108
109
|
}
|
|
@@ -167,21 +168,21 @@
|
|
|
167
168
|
transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);
|
|
168
169
|
}
|
|
169
170
|
|
|
170
|
-
&
|
|
171
|
+
&__floating-buttons {
|
|
171
172
|
position: fixed;
|
|
172
|
-
bottom: var(--card-
|
|
173
|
-
right: var(--card-
|
|
173
|
+
bottom: var(--card-floating-buttons-bottom);
|
|
174
|
+
right: var(--card-floating-buttons-right);
|
|
175
|
+
color: var(--card-floating-buttons-color);
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
&
|
|
177
|
-
padding: var(--card-
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
&__close-button[var-card-cover] {
|
|
179
|
+
padding: var(--card-close-button-padding);
|
|
180
|
+
width: var(--card-close-button-size);
|
|
181
|
+
height: var(--card-close-button-size);
|
|
182
|
+
background-color: var(--card-close-button-primary-color);
|
|
183
|
+
}
|
|
180
184
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
height: var(--card-floater-toolbar-close-size);
|
|
184
|
-
font-size: var(--card-floater-toolbar-close-size);
|
|
185
|
-
}
|
|
185
|
+
&__close-button-icon[var-card-cover] {
|
|
186
|
+
font-size: var(--card-close-button-icon-size);
|
|
186
187
|
}
|
|
187
188
|
}
|
package/lib/card/props.js
CHANGED
|
@@ -16,10 +16,17 @@ var props = {
|
|
|
16
16
|
validator: fitValidator,
|
|
17
17
|
default: 'cover'
|
|
18
18
|
},
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated use imageHeight instead
|
|
22
|
+
*/
|
|
19
23
|
height: {
|
|
20
24
|
type: [String, Number]
|
|
21
25
|
},
|
|
22
|
-
|
|
26
|
+
imageHeight: {
|
|
27
|
+
type: [String, Number]
|
|
28
|
+
},
|
|
29
|
+
imageWidth: {
|
|
23
30
|
type: [String, Number]
|
|
24
31
|
},
|
|
25
32
|
layout: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
require('../../styles/common.css')
|
|
2
|
-
require('../SnackbarSfc.css')
|
|
3
2
|
require('../../styles/elevation.css')
|
|
4
3
|
require('../../loading/loading.css')
|
|
5
4
|
require('../../button/button.css')
|
|
6
5
|
require('../../icon/icon.css')
|
|
7
6
|
require('../snackbar.css')
|
|
8
7
|
require('../coreSfc.css')
|
|
8
|
+
require('../SnackbarSfc.css')
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
require('../../styles/common.less')
|
|
2
|
-
require('../SnackbarSfc.less')
|
|
3
2
|
require('../../styles/elevation.less')
|
|
4
3
|
require('../../loading/loading.less')
|
|
5
4
|
require('../../button/button.less')
|
|
6
5
|
require('../../icon/icon.less')
|
|
7
6
|
require('../snackbar.less')
|
|
8
7
|
require('../coreSfc.less')
|
|
8
|
+
require('../SnackbarSfc.less')
|