@varlet/ui 2.7.5 → 2.8.0-alpha.1676441771603
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 +3 -1
- package/README.zh-CN.md +6 -4
- package/es/app-bar/AppBar.mjs +30 -6
- package/es/app-bar/appBar.css +1 -1
- package/es/app-bar/props.mjs +6 -0
- package/es/badge/Badge.mjs +3 -2
- package/es/cell/Cell.mjs +59 -31
- package/es/cell/cell.css +1 -1
- package/es/cell/props.mjs +11 -0
- package/es/collapse/Collapse.mjs +2 -2
- package/es/ellipsis/Ellipsis.mjs +106 -0
- package/es/ellipsis/EllipsisSfc.css +0 -0
- package/es/ellipsis/ellipsis.css +1 -0
- package/es/ellipsis/index.mjs +8 -0
- package/es/ellipsis/props.mjs +16 -0
- package/es/ellipsis/style/index.mjs +4 -0
- package/es/index.bundle.mjs +13 -1
- package/es/index.mjs +11 -1
- package/es/paper/Paper.mjs +55 -0
- package/es/paper/PaperSfc.css +0 -0
- package/es/paper/index.mjs +9 -0
- package/es/paper/paper.css +1 -0
- package/es/paper/props.mjs +28 -0
- package/es/paper/style/index.mjs +4 -0
- package/es/ripple/index.mjs +2 -2
- package/es/style.css +1 -1
- package/es/style.mjs +2 -0
- package/es/tabs/Tabs.mjs +5 -4
- package/es/themes/dark/index.mjs +2 -1
- package/es/themes/dark/paper.mjs +3 -0
- package/es/tooltip/Tooltip.mjs +6 -1
- package/es/tooltip/props.mjs +4 -0
- package/es/tooltip/tooltip.css +1 -1
- package/es/varlet.esm.js +7577 -7328
- package/highlight/web-types.en-US.json +179 -2
- package/highlight/web-types.zh-CN.json +179 -2
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +5703 -5410
- package/package.json +5 -5
- package/types/appBar.d.ts +2 -0
- package/types/cell.d.ts +4 -1
- package/types/ellipsis.d.ts +23 -0
- package/types/index.d.ts +4 -0
- package/types/paper.d.ts +25 -0
- package/types/tooltip.d.ts +1 -0
- package/umd/style.css +1 -1
- package/umd/varlet.js +6 -6
package/README.md
CHANGED
|
@@ -28,17 +28,19 @@ Varlet is a Material design mobile component library developed based on `Vue3`,
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
### Features
|
|
31
|
+
|
|
31
32
|
- 🚀 Provide 50+ high quality general purpose components
|
|
32
33
|
- 🚀 Components are very lightweight
|
|
33
34
|
- 💪 Developed by Chinese, complete Chinese and English documentation and logistics support
|
|
34
35
|
- 🛠️ Support on-demand introduction
|
|
35
36
|
- 🛠️ Support theme customization
|
|
36
37
|
- 🌍 Support internationalization
|
|
37
|
-
- 💡 Support WebStorm
|
|
38
|
+
- 💡 Support WebStorm syntax highlighting
|
|
38
39
|
- 💪 Support the SSR
|
|
39
40
|
- 💡 Support the Typescript
|
|
40
41
|
- 💪 Make sure more than 90 percent unit test coverage, providing stability assurance
|
|
41
42
|
- 🛠️ Support dark mode
|
|
43
|
+
- 🛠️ Provide official VSCode extension
|
|
42
44
|
|
|
43
45
|
### Install
|
|
44
46
|
|
package/README.zh-CN.md
CHANGED
|
@@ -28,17 +28,19 @@
|
|
|
28
28
|
Varlet 是一个基于 `Vue3` 开发的 Material 风格移动端组件库,全面拥抱 `Vue3` 生态,由 `varletjs` 社区团队进行维护。
|
|
29
29
|
|
|
30
30
|
### 特性
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
- 🚀 提供 50+ 个高质量通用组件
|
|
32
33
|
- 🚀 组件十分轻量
|
|
33
34
|
- 💪 由国人开发,完善的中英文文档和后勤保障
|
|
34
35
|
- 🛠️ 支持按需引入
|
|
35
36
|
- 🛠️ 支持主题定制
|
|
36
37
|
- 🌍 支持国际化
|
|
37
|
-
- 💡 支持 webstorm
|
|
38
|
+
- 💡 支持 webstorm 组件属性高亮
|
|
38
39
|
- 💪 支持 SSR
|
|
39
|
-
- 💡 支持 Typescript
|
|
40
|
-
- 💪 确保90
|
|
40
|
+
- 💡 支持 Typescript
|
|
41
|
+
- 💪 确保 90% 以上单元测试覆盖率,提供稳定性保证
|
|
41
42
|
- 🛠️ 支持暗黑模式
|
|
43
|
+
- 🛠️ 提供官方的 VSCode 插件
|
|
42
44
|
|
|
43
45
|
### 安装
|
|
44
46
|
|
package/es/app-bar/AppBar.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, onMounted, onUpdated } from 'vue';
|
|
1
|
+
import { defineComponent, ref, onMounted, onUpdated, computed } from 'vue';
|
|
2
2
|
import { props } from './props.mjs';
|
|
3
3
|
import { createNamespace } from '../utils/components.mjs';
|
|
4
4
|
var {
|
|
@@ -10,10 +10,9 @@ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createT
|
|
|
10
10
|
function __render__(_ctx, _cache) {
|
|
11
11
|
return _openBlock(), _createElementBlock("div", {
|
|
12
12
|
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.round, _ctx.n('--round')], [_ctx.elevation, _ctx.n('$-elevation--3')])),
|
|
13
|
-
style: _normalizeStyle(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
13
|
+
style: _normalizeStyle(_ctx.rootStyles)
|
|
14
|
+
}, [_createElementVNode("div", {
|
|
15
|
+
class: _normalizeClass(_ctx.n('toolbar'))
|
|
17
16
|
}, [_createElementVNode("div", {
|
|
18
17
|
class: _normalizeClass(_ctx.n('left'))
|
|
19
18
|
}, [_renderSlot(_ctx.$slots, "left"), _ctx.titlePosition === 'left' ? (_openBlock(), _createElementBlock("div", {
|
|
@@ -49,7 +48,9 @@ function __render__(_ctx, _cache) {
|
|
|
49
48
|
/* CLASS, STYLE */
|
|
50
49
|
)) : _createCommentVNode("v-if", true), _renderSlot(_ctx.$slots, "right")], 2
|
|
51
50
|
/* CLASS */
|
|
52
|
-
)],
|
|
51
|
+
)], 2
|
|
52
|
+
/* CLASS */
|
|
53
|
+
), _renderSlot(_ctx.$slots, "content")], 6
|
|
53
54
|
/* CLASS, STYLE */
|
|
54
55
|
);
|
|
55
56
|
}
|
|
@@ -70,11 +71,34 @@ var __sfc__ = defineComponent({
|
|
|
70
71
|
paddingRight.value = slots.right ? 0 : undefined;
|
|
71
72
|
};
|
|
72
73
|
|
|
74
|
+
var rootStyles = computed(() => {
|
|
75
|
+
var {
|
|
76
|
+
image,
|
|
77
|
+
color,
|
|
78
|
+
textColor,
|
|
79
|
+
imageLinearGradient
|
|
80
|
+
} = props;
|
|
81
|
+
|
|
82
|
+
if (image != null) {
|
|
83
|
+
var gradient = imageLinearGradient ? "linear-gradient(" + imageLinearGradient + "), " : '';
|
|
84
|
+
return {
|
|
85
|
+
'background-image': gradient + "url(" + image + ")",
|
|
86
|
+
'background-position': 'center center',
|
|
87
|
+
'background-size': 'cover'
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
background: color,
|
|
93
|
+
color: textColor
|
|
94
|
+
};
|
|
95
|
+
});
|
|
73
96
|
onMounted(computePadding);
|
|
74
97
|
onUpdated(computePadding);
|
|
75
98
|
return {
|
|
76
99
|
n,
|
|
77
100
|
classes,
|
|
101
|
+
rootStyles,
|
|
78
102
|
paddingLeft,
|
|
79
103
|
paddingRight
|
|
80
104
|
};
|
package/es/app-bar/appBar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --app-bar-color: var(--color-primary); --app-bar-title-padding: 0 12px; --app-bar-title-font-size: var(--font-size-lg); --app-bar-text-color: #fff; --app-bar-height: 54px; --app-bar-left-gap: 6px; --app-bar-right-gap: 6px; --app-bar-border-radius: 4px; --app-bar-font-size: var(--font-size-lg);}.var-app-bar { position: relative;
|
|
1
|
+
:root { --app-bar-color: var(--color-primary); --app-bar-title-padding: 0 12px; --app-bar-title-font-size: var(--font-size-lg); --app-bar-text-color: #fff; --app-bar-height: 54px; --app-bar-left-gap: 6px; --app-bar-right-gap: 6px; --app-bar-border-radius: 4px; --app-bar-font-size: var(--font-size-lg);}.var-app-bar { position: relative; z-index: 0; width: 100%; font-size: var(--app-bar-font-size); background: var(--app-bar-color); color: var(--app-bar-text-color); transition: background-color 0.25s;}.var-app-bar__toolbar { position: relative; display: flex; justify-content: center; align-items: center; height: var(--app-bar-height);}.var-app-bar__title { font-size: var(--app-bar-title-font-size); flex: 1; display: flex; justify-content: center; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; padding: var(--app-bar-title-padding);}.var-app-bar__left,.var-app-bar__right { display: flex; align-items: center; height: 100%; z-index: 2;}.var-app-bar__left { position: absolute; top: 0; left: var(--app-bar-left-gap);}.var-app-bar__right { position: absolute; top: 0; right: var(--app-bar-right-gap);}.var-app-bar--round { border-radius: var(--app-bar-border-radius);}
|
package/es/app-bar/props.mjs
CHANGED
package/es/badge/Badge.mjs
CHANGED
|
@@ -90,8 +90,9 @@ var __sfc__ = defineComponent({
|
|
|
90
90
|
position,
|
|
91
91
|
dot
|
|
92
92
|
} = props;
|
|
93
|
-
if (dot
|
|
94
|
-
if (
|
|
93
|
+
if (!dot) return;
|
|
94
|
+
if (position.includes('right')) return n('dot--right');
|
|
95
|
+
if (position.includes('left')) return n('dot--left');
|
|
95
96
|
};
|
|
96
97
|
|
|
97
98
|
return {
|
package/es/cell/Cell.mjs
CHANGED
|
@@ -1,52 +1,59 @@
|
|
|
1
|
-
import { defineComponent } from 'vue';
|
|
2
|
-
import { props } from './props.mjs';
|
|
3
1
|
import VarIcon from '../icon/index.mjs';
|
|
4
|
-
import
|
|
2
|
+
import Ripple from '../ripple/index.mjs';
|
|
3
|
+
import { computed, defineComponent } from 'vue';
|
|
4
|
+
import { props } from './props.mjs';
|
|
5
|
+
import { call, createNamespace } from '../utils/components.mjs';
|
|
6
|
+
import { toSizeUnit } from '../utils/elements.mjs';
|
|
5
7
|
var {
|
|
6
8
|
n,
|
|
7
9
|
classes
|
|
8
10
|
} = createNamespace('cell');
|
|
9
|
-
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString,
|
|
11
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives } from "vue";
|
|
10
12
|
|
|
11
13
|
function __render__(_ctx, _cache) {
|
|
12
14
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
var _directive_ripple = _resolveDirective("ripple");
|
|
17
|
+
|
|
18
|
+
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
19
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.border, _ctx.n('--border')], [_ctx.onClick, _ctx.n('--cursor')])),
|
|
20
|
+
style: _normalizeStyle(_ctx.borderOffsetStyles),
|
|
21
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
22
|
+
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
23
|
+
})
|
|
24
|
+
}, [_renderSlot(_ctx.$slots, "icon", {}, () => [_ctx.icon ? (_openBlock(), _createElementBlock("div", {
|
|
17
25
|
key: 0,
|
|
18
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('icon'),
|
|
19
|
-
}, [
|
|
26
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), _ctx.iconClass))
|
|
27
|
+
}, [_createVNode(_component_var_icon, {
|
|
20
28
|
name: _ctx.icon
|
|
21
29
|
}, null, 8
|
|
22
30
|
/* PROPS */
|
|
23
|
-
, ["name"])]
|
|
31
|
+
, ["name"])], 2
|
|
24
32
|
/* CLASS */
|
|
25
|
-
)) : _createCommentVNode("v-if", true), _createElementVNode("div", {
|
|
33
|
+
)) : _createCommentVNode("v-if", true)]), _createElementVNode("div", {
|
|
26
34
|
class: _normalizeClass(_ctx.n('content'))
|
|
27
|
-
}, [
|
|
28
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('title'), [_ctx.titleClass, _ctx.titleClass]))
|
|
29
|
-
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.title), 1
|
|
30
|
-
/* TEXT */
|
|
31
|
-
)])], 2
|
|
32
|
-
/* CLASS */
|
|
33
|
-
), _ctx.$slots.description || _ctx.description ? (_openBlock(), _createElementBlock("div", {
|
|
35
|
+
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_ctx.title ? (_openBlock(), _createElementBlock("div", {
|
|
34
36
|
key: 0,
|
|
35
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('
|
|
36
|
-
},
|
|
37
|
-
/* TEXT */
|
|
38
|
-
)])
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('title'), _ctx.titleClass))
|
|
38
|
+
}, _toDisplayString(_ctx.title), 3
|
|
39
|
+
/* TEXT, CLASS */
|
|
40
|
+
)) : _createCommentVNode("v-if", true)]), _renderSlot(_ctx.$slots, "description", {}, () => [_ctx.description ? (_openBlock(), _createElementBlock("div", {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('description'), _ctx.descriptionClass))
|
|
43
|
+
}, _toDisplayString(_ctx.description), 3
|
|
44
|
+
/* TEXT, CLASS */
|
|
45
|
+
)) : _createCommentVNode("v-if", true)])], 2
|
|
41
46
|
/* CLASS */
|
|
42
47
|
), _ctx.$slots.extra ? (_openBlock(), _createElementBlock("div", {
|
|
43
|
-
key:
|
|
44
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('extra'),
|
|
48
|
+
key: 0,
|
|
49
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('extra'), _ctx.extraClass))
|
|
45
50
|
}, [_renderSlot(_ctx.$slots, "extra")], 2
|
|
46
51
|
/* CLASS */
|
|
47
|
-
)) : _createCommentVNode("v-if", true)],
|
|
48
|
-
/* CLASS */
|
|
49
|
-
)
|
|
52
|
+
)) : _createCommentVNode("v-if", true)], 6
|
|
53
|
+
/* CLASS, STYLE */
|
|
54
|
+
)), [[_directive_ripple, {
|
|
55
|
+
disabled: !_ctx.ripple
|
|
56
|
+
}]]);
|
|
50
57
|
}
|
|
51
58
|
|
|
52
59
|
var __sfc__ = defineComponent({
|
|
@@ -54,12 +61,33 @@ var __sfc__ = defineComponent({
|
|
|
54
61
|
components: {
|
|
55
62
|
VarIcon
|
|
56
63
|
},
|
|
64
|
+
directives: {
|
|
65
|
+
Ripple
|
|
66
|
+
},
|
|
57
67
|
props,
|
|
58
68
|
|
|
59
|
-
setup() {
|
|
69
|
+
setup(props) {
|
|
70
|
+
var borderOffsetStyles = computed(() => {
|
|
71
|
+
if (props.borderOffset == null) {
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
'--cell-border-left': toSizeUnit(props.borderOffset),
|
|
77
|
+
'--cell-border-right': toSizeUnit(props.borderOffset)
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
var handleClick = e => {
|
|
82
|
+
call(props.onClick, e);
|
|
83
|
+
};
|
|
84
|
+
|
|
60
85
|
return {
|
|
61
86
|
n,
|
|
62
|
-
classes
|
|
87
|
+
classes,
|
|
88
|
+
toSizeUnit,
|
|
89
|
+
borderOffsetStyles,
|
|
90
|
+
handleClick
|
|
63
91
|
};
|
|
64
92
|
}
|
|
65
93
|
|
package/es/cell/cell.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --cell-color: var(--color-text); --cell-font-size: var(--font-size-md); --cell-description-font-size: var(--font-size-sm); --cell-description-color: rgba(0, 0, 0, 0.6); --cell-padding: 10px 12px; --cell-min-height: 40px; --cell-border-color: #bcc2cb; --cell-border-left: 12px; --cell-border-right: 12px; --cell-icon-right: 8px; --cell-extra-left: 8px;}.var-cell { align-items: center; display: flex; min-height: var(--cell-min-height); outline: none; width: 100%; padding: var(--cell-padding); position: relative; box-sizing: border-box; font-size: var(--cell-font-size); color: var(--cell-color);}.var-cell--border::after { position: absolute; box-sizing: border-box; content: ' '; pointer-events: none; right: var(--cell-border-right);
|
|
1
|
+
:root { --cell-color: var(--color-text); --cell-font-size: var(--font-size-md); --cell-description-font-size: var(--font-size-sm); --cell-description-color: rgba(0, 0, 0, 0.6); --cell-description-margin-top: 4px; --cell-padding: 10px 12px; --cell-min-height: 40px; --cell-border-color: #bcc2cb; --cell-border-left: 12px; --cell-border-right: 12px; --cell-icon-right: 8px; --cell-extra-left: 8px;}.var-cell { align-items: center; display: flex; min-height: var(--cell-min-height); outline: none; width: 100%; padding: var(--cell-padding); position: relative; box-sizing: border-box; font-size: var(--cell-font-size); color: var(--cell-color);}.var-cell--border::after { position: absolute; box-sizing: border-box; content: ' '; pointer-events: none; bottom: 0; right: var(--cell-border-right); left: var(--cell-border-left); border-bottom: 1px solid var(--cell-border-color); transform: scaleY(0.5);}.var-cell__icon { margin-right: var(--cell-icon-right); flex: 0;}.var-cell__content { flex: 1; overflow: hidden;}.var-cell__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.var-cell__description { font-size: var(--cell-description-font-size); color: var(--cell-description-color); margin-top: var(--cell-description-margin-top);}.var-cell__extra { flex: 0; margin-left: var(--cell-extra-left);}.var-cell--cursor { cursor: pointer;}
|
package/es/cell/props.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components.mjs';
|
|
1
2
|
export var props = {
|
|
2
3
|
title: {
|
|
3
4
|
type: [Number, String]
|
|
@@ -12,6 +13,9 @@ export var props = {
|
|
|
12
13
|
type: Boolean,
|
|
13
14
|
default: false
|
|
14
15
|
},
|
|
16
|
+
borderOffset: {
|
|
17
|
+
type: [Number, String]
|
|
18
|
+
},
|
|
15
19
|
iconClass: {
|
|
16
20
|
type: String
|
|
17
21
|
},
|
|
@@ -23,5 +27,12 @@ export var props = {
|
|
|
23
27
|
},
|
|
24
28
|
extraClass: {
|
|
25
29
|
type: String
|
|
30
|
+
},
|
|
31
|
+
ripple: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
onClick: {
|
|
36
|
+
type: defineListenerProp
|
|
26
37
|
}
|
|
27
38
|
};
|
package/es/collapse/Collapse.mjs
CHANGED
|
@@ -82,7 +82,7 @@ var __sfc__ = defineComponent({
|
|
|
82
82
|
index,
|
|
83
83
|
name
|
|
84
84
|
} = _ref3;
|
|
85
|
-
return name.value === undefined
|
|
85
|
+
return name.value === undefined && props.modelValue === index.value;
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -91,7 +91,7 @@ var __sfc__ = defineComponent({
|
|
|
91
91
|
index,
|
|
92
92
|
name
|
|
93
93
|
} = _ref4;
|
|
94
|
-
return name.value === undefined
|
|
94
|
+
return name.value === undefined && props.modelValue.includes(index.value);
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import VarTooltip from '../tooltip/index.mjs';
|
|
4
|
+
import { computed, defineComponent, ref } from 'vue';
|
|
5
|
+
import { createNamespace } from '../utils/components.mjs';
|
|
6
|
+
import { props } from './props.mjs';
|
|
7
|
+
var {
|
|
8
|
+
n,
|
|
9
|
+
classes
|
|
10
|
+
} = createNamespace('ellipsis');
|
|
11
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
12
|
+
|
|
13
|
+
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
14
|
+
|
|
15
|
+
var _hoisted_1 = {
|
|
16
|
+
key: 0
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function __render__(_ctx, _cache) {
|
|
20
|
+
var _component_var_tooltip = _resolveComponent("var-tooltip");
|
|
21
|
+
|
|
22
|
+
return _openBlock(), _createBlock(_component_var_tooltip, _normalizeProps(_guardReactiveProps(_ctx.tooltip)), {
|
|
23
|
+
content: _withCtx(() => [_renderSlot(_ctx.$slots, "tooltip-content", {}, () => {
|
|
24
|
+
var _ctx$tooltip;
|
|
25
|
+
|
|
26
|
+
return [(_ctx$tooltip = _ctx.tooltip) != null && _ctx$tooltip.content ? (_openBlock(), _createElementBlock("span", _hoisted_1, _toDisplayString(_ctx.tooltip.content), 1
|
|
27
|
+
/* TEXT */
|
|
28
|
+
)) : _renderSlot(_ctx.$slots, "default", {
|
|
29
|
+
key: 1
|
|
30
|
+
})];
|
|
31
|
+
})]),
|
|
32
|
+
default: _withCtx(() => [_createElementVNode("span", {
|
|
33
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.lineClamp, _ctx.n('--clamp'), _ctx.n('--line')], [_ctx.expandTrigger, _ctx.n('--cursor')], [_ctx.expanding, _ctx.n('--expand')])),
|
|
34
|
+
style: _normalizeStyle(_ctx.rootStyles),
|
|
35
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
36
|
+
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
37
|
+
})
|
|
38
|
+
}, [_renderSlot(_ctx.$slots, "default")], 6
|
|
39
|
+
/* CLASS, STYLE */
|
|
40
|
+
)]),
|
|
41
|
+
_: 3
|
|
42
|
+
/* FORWARDED */
|
|
43
|
+
|
|
44
|
+
}, 16
|
|
45
|
+
/* FULL_PROPS */
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var __sfc__ = defineComponent({
|
|
50
|
+
name: 'VarEllipsis',
|
|
51
|
+
components: {
|
|
52
|
+
VarTooltip
|
|
53
|
+
},
|
|
54
|
+
props,
|
|
55
|
+
|
|
56
|
+
setup(props) {
|
|
57
|
+
var expanding = ref(false);
|
|
58
|
+
var rootStyles = computed(() => {
|
|
59
|
+
if (!props.lineClamp) {
|
|
60
|
+
return {};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
'-webkit-line-clamp': props.lineClamp
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
var tooltip = computed(() => {
|
|
68
|
+
if (props.tooltip === false) {
|
|
69
|
+
return {
|
|
70
|
+
disabled: true
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (props.tooltip === true) {
|
|
75
|
+
return {
|
|
76
|
+
sameWidth: true
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return _extends({
|
|
81
|
+
sameWidth: true
|
|
82
|
+
}, props.tooltip);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var handleClick = () => {
|
|
86
|
+
if (!props.expandTrigger) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
expanding.value = !expanding.value;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
n,
|
|
95
|
+
classes,
|
|
96
|
+
tooltip,
|
|
97
|
+
expanding,
|
|
98
|
+
rootStyles,
|
|
99
|
+
handleClick
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
__sfc__.render = __render__;
|
|
106
|
+
export default __sfc__;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.var-ellipsis { width: 100%; overflow: hidden; vertical-align: bottom;}.var-ellipsis--clamp { display: -webkit-inline-box; -webkit-box-orient: vertical;}.var-ellipsis--line { display: inline-block; white-space: nowrap; text-overflow: ellipsis;}.var-ellipsis--cursor { cursor: pointer;}.var-ellipsis--expand { display: inline-block; white-space: wrap; overflow: visible;}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function expandTriggerValidator(expandTrigger) {
|
|
2
|
+
return ['click'].includes(expandTrigger);
|
|
3
|
+
}
|
|
4
|
+
export var props = {
|
|
5
|
+
expandTrigger: {
|
|
6
|
+
type: String,
|
|
7
|
+
validator: expandTriggerValidator
|
|
8
|
+
},
|
|
9
|
+
lineClamp: {
|
|
10
|
+
type: [Number, String]
|
|
11
|
+
},
|
|
12
|
+
tooltip: {
|
|
13
|
+
type: [Object, Boolean],
|
|
14
|
+
default: true
|
|
15
|
+
}
|
|
16
|
+
};
|
package/es/index.bundle.mjs
CHANGED
|
@@ -21,6 +21,7 @@ import Counter from './counter/index.mjs'
|
|
|
21
21
|
import DatePicker from './date-picker/index.mjs'
|
|
22
22
|
import Dialog from './dialog/index.mjs'
|
|
23
23
|
import Divider from './divider/index.mjs'
|
|
24
|
+
import Ellipsis from './ellipsis/index.mjs'
|
|
24
25
|
import Form from './form/index.mjs'
|
|
25
26
|
import FormDetails from './form-details/index.mjs'
|
|
26
27
|
import Icon from './icon/index.mjs'
|
|
@@ -39,6 +40,7 @@ import Menu from './menu/index.mjs'
|
|
|
39
40
|
import Option from './option/index.mjs'
|
|
40
41
|
import Overlay from './overlay/index.mjs'
|
|
41
42
|
import Pagination from './pagination/index.mjs'
|
|
43
|
+
import Paper from './paper/index.mjs'
|
|
42
44
|
import Picker from './picker/index.mjs'
|
|
43
45
|
import Popup from './popup/index.mjs'
|
|
44
46
|
import Progress from './progress/index.mjs'
|
|
@@ -94,6 +96,7 @@ export * from './counter/index.mjs'
|
|
|
94
96
|
export * from './date-picker/index.mjs'
|
|
95
97
|
export * from './dialog/index.mjs'
|
|
96
98
|
export * from './divider/index.mjs'
|
|
99
|
+
export * from './ellipsis/index.mjs'
|
|
97
100
|
export * from './form/index.mjs'
|
|
98
101
|
export * from './form-details/index.mjs'
|
|
99
102
|
export * from './icon/index.mjs'
|
|
@@ -112,6 +115,7 @@ export * from './menu/index.mjs'
|
|
|
112
115
|
export * from './option/index.mjs'
|
|
113
116
|
export * from './overlay/index.mjs'
|
|
114
117
|
export * from './pagination/index.mjs'
|
|
118
|
+
export * from './paper/index.mjs'
|
|
115
119
|
export * from './picker/index.mjs'
|
|
116
120
|
export * from './popup/index.mjs'
|
|
117
121
|
export * from './progress/index.mjs'
|
|
@@ -167,6 +171,7 @@ import './counter/style/index.mjs'
|
|
|
167
171
|
import './date-picker/style/index.mjs'
|
|
168
172
|
import './dialog/style/index.mjs'
|
|
169
173
|
import './divider/style/index.mjs'
|
|
174
|
+
import './ellipsis/style/index.mjs'
|
|
170
175
|
import './form/style/index.mjs'
|
|
171
176
|
import './form-details/style/index.mjs'
|
|
172
177
|
import './icon/style/index.mjs'
|
|
@@ -185,6 +190,7 @@ import './menu/style/index.mjs'
|
|
|
185
190
|
import './option/style/index.mjs'
|
|
186
191
|
import './overlay/style/index.mjs'
|
|
187
192
|
import './pagination/style/index.mjs'
|
|
193
|
+
import './paper/style/index.mjs'
|
|
188
194
|
import './picker/style/index.mjs'
|
|
189
195
|
import './popup/style/index.mjs'
|
|
190
196
|
import './progress/style/index.mjs'
|
|
@@ -217,7 +223,7 @@ import './time-picker/style/index.mjs'
|
|
|
217
223
|
import './tooltip/style/index.mjs'
|
|
218
224
|
import './uploader/style/index.mjs'
|
|
219
225
|
|
|
220
|
-
const version = '2.
|
|
226
|
+
const version = '2.8.0-alpha.1676441771603'
|
|
221
227
|
|
|
222
228
|
function install(app) {
|
|
223
229
|
ActionSheet.install && app.use(ActionSheet)
|
|
@@ -243,6 +249,7 @@ function install(app) {
|
|
|
243
249
|
DatePicker.install && app.use(DatePicker)
|
|
244
250
|
Dialog.install && app.use(Dialog)
|
|
245
251
|
Divider.install && app.use(Divider)
|
|
252
|
+
Ellipsis.install && app.use(Ellipsis)
|
|
246
253
|
Form.install && app.use(Form)
|
|
247
254
|
FormDetails.install && app.use(FormDetails)
|
|
248
255
|
Icon.install && app.use(Icon)
|
|
@@ -261,6 +268,7 @@ function install(app) {
|
|
|
261
268
|
Option.install && app.use(Option)
|
|
262
269
|
Overlay.install && app.use(Overlay)
|
|
263
270
|
Pagination.install && app.use(Pagination)
|
|
271
|
+
Paper.install && app.use(Paper)
|
|
264
272
|
Picker.install && app.use(Picker)
|
|
265
273
|
Popup.install && app.use(Popup)
|
|
266
274
|
Progress.install && app.use(Progress)
|
|
@@ -320,6 +328,7 @@ export {
|
|
|
320
328
|
DatePicker,
|
|
321
329
|
Dialog,
|
|
322
330
|
Divider,
|
|
331
|
+
Ellipsis,
|
|
323
332
|
Form,
|
|
324
333
|
FormDetails,
|
|
325
334
|
Icon,
|
|
@@ -338,6 +347,7 @@ export {
|
|
|
338
347
|
Option,
|
|
339
348
|
Overlay,
|
|
340
349
|
Pagination,
|
|
350
|
+
Paper,
|
|
341
351
|
Picker,
|
|
342
352
|
Popup,
|
|
343
353
|
Progress,
|
|
@@ -397,6 +407,7 @@ export default {
|
|
|
397
407
|
DatePicker,
|
|
398
408
|
Dialog,
|
|
399
409
|
Divider,
|
|
410
|
+
Ellipsis,
|
|
400
411
|
Form,
|
|
401
412
|
FormDetails,
|
|
402
413
|
Icon,
|
|
@@ -415,6 +426,7 @@ export default {
|
|
|
415
426
|
Option,
|
|
416
427
|
Overlay,
|
|
417
428
|
Pagination,
|
|
429
|
+
Paper,
|
|
418
430
|
Picker,
|
|
419
431
|
Popup,
|
|
420
432
|
Progress,
|
package/es/index.mjs
CHANGED
|
@@ -21,6 +21,7 @@ import Counter from './counter/index.mjs'
|
|
|
21
21
|
import DatePicker from './date-picker/index.mjs'
|
|
22
22
|
import Dialog from './dialog/index.mjs'
|
|
23
23
|
import Divider from './divider/index.mjs'
|
|
24
|
+
import Ellipsis from './ellipsis/index.mjs'
|
|
24
25
|
import Form from './form/index.mjs'
|
|
25
26
|
import FormDetails from './form-details/index.mjs'
|
|
26
27
|
import Icon from './icon/index.mjs'
|
|
@@ -39,6 +40,7 @@ import Menu from './menu/index.mjs'
|
|
|
39
40
|
import Option from './option/index.mjs'
|
|
40
41
|
import Overlay from './overlay/index.mjs'
|
|
41
42
|
import Pagination from './pagination/index.mjs'
|
|
43
|
+
import Paper from './paper/index.mjs'
|
|
42
44
|
import Picker from './picker/index.mjs'
|
|
43
45
|
import Popup from './popup/index.mjs'
|
|
44
46
|
import Progress from './progress/index.mjs'
|
|
@@ -94,6 +96,7 @@ export * from './counter/index.mjs'
|
|
|
94
96
|
export * from './date-picker/index.mjs'
|
|
95
97
|
export * from './dialog/index.mjs'
|
|
96
98
|
export * from './divider/index.mjs'
|
|
99
|
+
export * from './ellipsis/index.mjs'
|
|
97
100
|
export * from './form/index.mjs'
|
|
98
101
|
export * from './form-details/index.mjs'
|
|
99
102
|
export * from './icon/index.mjs'
|
|
@@ -112,6 +115,7 @@ export * from './menu/index.mjs'
|
|
|
112
115
|
export * from './option/index.mjs'
|
|
113
116
|
export * from './overlay/index.mjs'
|
|
114
117
|
export * from './pagination/index.mjs'
|
|
118
|
+
export * from './paper/index.mjs'
|
|
115
119
|
export * from './picker/index.mjs'
|
|
116
120
|
export * from './popup/index.mjs'
|
|
117
121
|
export * from './progress/index.mjs'
|
|
@@ -144,7 +148,7 @@ export * from './time-picker/index.mjs'
|
|
|
144
148
|
export * from './tooltip/index.mjs'
|
|
145
149
|
export * from './uploader/index.mjs'
|
|
146
150
|
|
|
147
|
-
const version = '2.
|
|
151
|
+
const version = '2.8.0-alpha.1676441771603'
|
|
148
152
|
|
|
149
153
|
function install(app) {
|
|
150
154
|
ActionSheet.install && app.use(ActionSheet)
|
|
@@ -170,6 +174,7 @@ function install(app) {
|
|
|
170
174
|
DatePicker.install && app.use(DatePicker)
|
|
171
175
|
Dialog.install && app.use(Dialog)
|
|
172
176
|
Divider.install && app.use(Divider)
|
|
177
|
+
Ellipsis.install && app.use(Ellipsis)
|
|
173
178
|
Form.install && app.use(Form)
|
|
174
179
|
FormDetails.install && app.use(FormDetails)
|
|
175
180
|
Icon.install && app.use(Icon)
|
|
@@ -188,6 +193,7 @@ function install(app) {
|
|
|
188
193
|
Option.install && app.use(Option)
|
|
189
194
|
Overlay.install && app.use(Overlay)
|
|
190
195
|
Pagination.install && app.use(Pagination)
|
|
196
|
+
Paper.install && app.use(Paper)
|
|
191
197
|
Picker.install && app.use(Picker)
|
|
192
198
|
Popup.install && app.use(Popup)
|
|
193
199
|
Progress.install && app.use(Progress)
|
|
@@ -247,6 +253,7 @@ export {
|
|
|
247
253
|
DatePicker,
|
|
248
254
|
Dialog,
|
|
249
255
|
Divider,
|
|
256
|
+
Ellipsis,
|
|
250
257
|
Form,
|
|
251
258
|
FormDetails,
|
|
252
259
|
Icon,
|
|
@@ -265,6 +272,7 @@ export {
|
|
|
265
272
|
Option,
|
|
266
273
|
Overlay,
|
|
267
274
|
Pagination,
|
|
275
|
+
Paper,
|
|
268
276
|
Picker,
|
|
269
277
|
Popup,
|
|
270
278
|
Progress,
|
|
@@ -324,6 +332,7 @@ export default {
|
|
|
324
332
|
DatePicker,
|
|
325
333
|
Dialog,
|
|
326
334
|
Divider,
|
|
335
|
+
Ellipsis,
|
|
327
336
|
Form,
|
|
328
337
|
FormDetails,
|
|
329
338
|
Icon,
|
|
@@ -342,6 +351,7 @@ export default {
|
|
|
342
351
|
Option,
|
|
343
352
|
Overlay,
|
|
344
353
|
Pagination,
|
|
354
|
+
Paper,
|
|
345
355
|
Picker,
|
|
346
356
|
Popup,
|
|
347
357
|
Progress,
|