@varlet/ui 2.0.0-alpha.1664527888620 → 2.0.0
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/col/Col.js +1 -0
- package/es/col/props.js +9 -0
- package/es/dialog/Dialog.js +8 -2
- package/es/dialog/props.js +3 -0
- package/es/progress/Progress.js +18 -19
- package/es/progress/props.js +3 -10
- package/es/varlet.esm.js +1528 -1500
- package/highlight/attributes.json +9 -1
- package/highlight/tags.json +2 -0
- package/highlight/web-types.json +19 -1
- package/lib/col/Col.js +1 -0
- package/lib/col/props.js +10 -0
- package/lib/dialog/Dialog.js +9 -2
- package/lib/dialog/props.js +3 -0
- package/lib/progress/Progress.js +17 -18
- package/lib/progress/props.js +3 -10
- package/package.json +6 -9
- package/types/col.d.ts +9 -6
- package/types/dialog.d.ts +2 -0
- package/types/progress.d.ts +3 -2
- package/umd/varlet.js +6 -6
package/es/col/Col.js
CHANGED
|
@@ -13,6 +13,7 @@ export function render(_ctx, _cache) {
|
|
|
13
13
|
return _openBlock(), _createElementBlock("div", {
|
|
14
14
|
class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', [_ctx.span >= 0, _ctx.n("--span-" + _ctx.span)], [_ctx.offset, _ctx.n("--offset-" + _ctx.offset)], ..._ctx.getSize('xs', _ctx.xs), ..._ctx.getSize('sm', _ctx.sm), ..._ctx.getSize('md', _ctx.md), ..._ctx.getSize('lg', _ctx.lg), ..._ctx.getSize('xl', _ctx.xl))),
|
|
15
15
|
style: _normalizeStyle({
|
|
16
|
+
flexDirection: _ctx.direction,
|
|
16
17
|
paddingLeft: _ctx.toSizeUnit(_ctx.padding.left),
|
|
17
18
|
paddingRight: _ctx.toSizeUnit(_ctx.padding.right)
|
|
18
19
|
}),
|
package/es/col/props.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
function directionValidator(direction) {
|
|
2
|
+
return ['row', 'column'].includes(direction);
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
export var props = {
|
|
2
6
|
span: {
|
|
3
7
|
type: [String, Number],
|
|
@@ -7,6 +11,11 @@ export var props = {
|
|
|
7
11
|
type: [String, Number],
|
|
8
12
|
default: 0
|
|
9
13
|
},
|
|
14
|
+
direction: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'row',
|
|
17
|
+
validator: directionValidator
|
|
18
|
+
},
|
|
10
19
|
onClick: {
|
|
11
20
|
type: Function
|
|
12
21
|
},
|
package/es/dialog/Dialog.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
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
|
+
|
|
1
3
|
import VarPopup from '../popup';
|
|
2
4
|
import VarButton from '../button';
|
|
3
5
|
import { props } from './props';
|
|
@@ -5,6 +7,7 @@ import { defineComponent, ref, watch } from 'vue';
|
|
|
5
7
|
import { dt } from '../utils/shared';
|
|
6
8
|
import { pack } from '../locale';
|
|
7
9
|
import { call, createNamespace } from '../utils/components';
|
|
10
|
+
import { toSizeUnit } from '../utils/elements';
|
|
8
11
|
var {
|
|
9
12
|
n,
|
|
10
13
|
classes
|
|
@@ -34,7 +37,9 @@ export function render(_ctx, _cache) {
|
|
|
34
37
|
}, {
|
|
35
38
|
default: _withCtx(() => [_createElementVNode("div", _mergeProps({
|
|
36
39
|
class: _ctx.classes('var--box', _ctx.n(), _ctx.dialogClass),
|
|
37
|
-
style:
|
|
40
|
+
style: _extends({
|
|
41
|
+
width: _ctx.toSizeUnit(_ctx.width)
|
|
42
|
+
}, _ctx.dialogStyle)
|
|
38
43
|
}, _ctx.$attrs), [_createElementVNode("div", {
|
|
39
44
|
class: _normalizeClass(_ctx.n('title'))
|
|
40
45
|
}, [_renderSlot(_ctx.$slots, "title", {}, () => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.title, _ctx.pack.dialogTitle)), 1
|
|
@@ -188,7 +193,8 @@ export default defineComponent({
|
|
|
188
193
|
popupCloseOnClickOverlay,
|
|
189
194
|
handleClickOverlay,
|
|
190
195
|
confirm,
|
|
191
|
-
cancel
|
|
196
|
+
cancel,
|
|
197
|
+
toSizeUnit
|
|
192
198
|
};
|
|
193
199
|
}
|
|
194
200
|
|
package/es/dialog/props.js
CHANGED
package/es/progress/Progress.js
CHANGED
|
@@ -7,7 +7,7 @@ var {
|
|
|
7
7
|
n,
|
|
8
8
|
classes
|
|
9
9
|
} = createNamespace('progress');
|
|
10
|
-
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode,
|
|
10
|
+
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
11
11
|
|
|
12
12
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
13
13
|
|
|
@@ -20,12 +20,12 @@ export function render(_ctx, _cache) {
|
|
|
20
20
|
}, [_ctx.mode === 'linear' ? (_openBlock(), _createElementBlock("div", {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: _normalizeClass(_ctx.n('linear'))
|
|
23
|
-
}, [_createElementVNode("div",
|
|
24
|
-
class: _ctx.n('linear-block'),
|
|
25
|
-
style: {
|
|
23
|
+
}, [_createElementVNode("div", {
|
|
24
|
+
class: _normalizeClass(_ctx.n('linear-block')),
|
|
25
|
+
style: _normalizeStyle({
|
|
26
26
|
height: _ctx.toSizeUnit(_ctx.lineWidth)
|
|
27
|
-
}
|
|
28
|
-
},
|
|
27
|
+
})
|
|
28
|
+
}, [_ctx.track ? (_openBlock(), _createElementBlock("div", {
|
|
29
29
|
key: 0,
|
|
30
30
|
class: _normalizeClass(_ctx.n('linear-background')),
|
|
31
31
|
style: _normalizeStyle({
|
|
@@ -41,15 +41,15 @@ export function render(_ctx, _cache) {
|
|
|
41
41
|
})
|
|
42
42
|
}, null, 6
|
|
43
43
|
/* CLASS, STYLE */
|
|
44
|
-
)],
|
|
45
|
-
/*
|
|
46
|
-
), _ctx.label ? (_openBlock(), _createElementBlock("div",
|
|
44
|
+
)], 6
|
|
45
|
+
/* CLASS, STYLE */
|
|
46
|
+
), _ctx.label ? (_openBlock(), _createElementBlock("div", {
|
|
47
47
|
key: 0,
|
|
48
|
-
class: _ctx.n('linear-label')
|
|
49
|
-
},
|
|
48
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('linear-label'), [_ctx.labelClass, _ctx.labelClass]))
|
|
49
|
+
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.linearProps.roundValue), 1
|
|
50
50
|
/* TEXT */
|
|
51
|
-
)])],
|
|
52
|
-
/*
|
|
51
|
+
)])], 2
|
|
52
|
+
/* CLASS */
|
|
53
53
|
)) : _createCommentVNode("v-if", true)], 2
|
|
54
54
|
/* CLASS */
|
|
55
55
|
)) : _createCommentVNode("v-if", true), _ctx.mode === 'circle' ? (_openBlock(), _createElementBlock("div", {
|
|
@@ -94,13 +94,13 @@ export function render(_ctx, _cache) {
|
|
|
94
94
|
/* CLASS, STYLE, PROPS */
|
|
95
95
|
, _hoisted_3)], 14
|
|
96
96
|
/* CLASS, STYLE, PROPS */
|
|
97
|
-
, _hoisted_1)), _ctx.label ? (_openBlock(), _createElementBlock("div",
|
|
97
|
+
, _hoisted_1)), _ctx.label ? (_openBlock(), _createElementBlock("div", {
|
|
98
98
|
key: 0,
|
|
99
|
-
class: _ctx.n('circle-label')
|
|
100
|
-
},
|
|
99
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('circle-label'), [_ctx.labelClass, _ctx.labelClass]))
|
|
100
|
+
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.circleProps.roundValue), 1
|
|
101
101
|
/* TEXT */
|
|
102
|
-
)])],
|
|
103
|
-
/*
|
|
102
|
+
)])], 2
|
|
103
|
+
/* CLASS */
|
|
104
104
|
)) : _createCommentVNode("v-if", true)], 6
|
|
105
105
|
/* CLASS, STYLE */
|
|
106
106
|
)) : _createCommentVNode("v-if", true)], 2
|
|
@@ -110,7 +110,6 @@ export function render(_ctx, _cache) {
|
|
|
110
110
|
export default defineComponent({
|
|
111
111
|
render,
|
|
112
112
|
name: 'VarProgress',
|
|
113
|
-
inheritAttrs: false,
|
|
114
113
|
props,
|
|
115
114
|
|
|
116
115
|
setup(props) {
|
package/es/progress/props.js
CHANGED
|
@@ -3,51 +3,44 @@ function modeValidator(mode) {
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
export var props = {
|
|
6
|
-
// progress 模式
|
|
7
6
|
mode: {
|
|
8
7
|
type: String,
|
|
9
8
|
default: 'linear',
|
|
10
9
|
validator: modeValidator
|
|
11
10
|
},
|
|
12
|
-
// progress 线宽
|
|
13
11
|
lineWidth: {
|
|
14
12
|
type: [Number, String],
|
|
15
13
|
default: 4
|
|
16
14
|
},
|
|
17
|
-
// progress 颜色
|
|
18
15
|
color: {
|
|
19
16
|
type: String
|
|
20
17
|
},
|
|
21
|
-
// progress 轨道颜色
|
|
22
18
|
trackColor: {
|
|
23
19
|
type: String
|
|
24
20
|
},
|
|
25
|
-
// 是否添加水波纹效果
|
|
26
21
|
ripple: {
|
|
27
22
|
type: Boolean,
|
|
28
23
|
default: false
|
|
29
24
|
},
|
|
30
|
-
// progress 值
|
|
31
25
|
value: {
|
|
32
26
|
type: [Number, String],
|
|
33
27
|
default: 0
|
|
34
28
|
},
|
|
35
|
-
// 是否显示label
|
|
36
29
|
label: {
|
|
37
30
|
type: Boolean,
|
|
38
31
|
default: false
|
|
39
32
|
},
|
|
40
|
-
|
|
33
|
+
labelClass: {
|
|
34
|
+
type: String
|
|
35
|
+
},
|
|
41
36
|
size: {
|
|
42
37
|
type: [Number, String],
|
|
43
38
|
default: 40
|
|
44
39
|
},
|
|
45
|
-
// circle的原点
|
|
46
40
|
rotate: {
|
|
47
41
|
type: Number,
|
|
48
42
|
default: 0
|
|
49
43
|
},
|
|
50
|
-
// 是否显示 circle 轨道
|
|
51
44
|
track: {
|
|
52
45
|
type: Boolean,
|
|
53
46
|
default: true
|