@varlet/ui 1.25.1 → 1.26.1-alpha.1644652196468
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.en-US.md +1 -1
- package/README.md +1 -1
- package/es/button/Button.js +1 -1
- package/es/checkbox/Checkbox.js +3 -3
- package/es/col/Col.js +28 -6
- package/es/col/col.css +1 -1
- package/es/col/col.less +35 -3
- package/es/col/props.js +15 -0
- package/es/icon/icon.css +1 -1
- package/es/list/List.js +3 -5
- package/es/option/Option.js +1 -1
- package/es/pagination/Pagination.js +5 -5
- package/es/picker/Picker.js +1 -0
- package/es/radio/Radio.js +3 -3
- package/es/row/Row.js +14 -49
- package/es/select/Select.js +1 -1
- package/es/style.css +1 -1
- package/es/switch/Switch.js +3 -3
- package/es/tab/Tab.js +1 -1
- package/es/time-picker/TimePicker.js +3 -3
- package/es/varlet.esm.js +68 -64
- package/highlight/attributes.json +20 -0
- package/highlight/tags.json +6 -1
- package/highlight/web-types.json +46 -1
- package/lib/checkbox/Checkbox.js +2 -2
- package/lib/col/Col.js +27 -5
- package/lib/col/col.css +1 -1
- package/lib/col/col.less +35 -3
- package/lib/col/props.js +15 -0
- package/lib/icon/icon.css +1 -1
- package/lib/list/List.js +2 -4
- package/lib/pagination/Pagination.js +4 -4
- package/lib/picker/Picker.js +1 -0
- package/lib/radio/Radio.js +2 -2
- package/lib/row/Row.js +13 -48
- package/lib/select/Select.js +1 -1
- package/lib/style.css +1 -1
- package/lib/switch/Switch.js +2 -2
- package/lib/time-picker/TimePicker.js +2 -2
- package/package.json +7 -7
- package/types/col.d.ts +10 -0
- package/umd/varlet.js +4 -4
package/es/radio/Radio.js
CHANGED
|
@@ -6,7 +6,7 @@ import { props } from './props';
|
|
|
6
6
|
import { useValidation } from '../utils/components';
|
|
7
7
|
import { useRadioGroup } from './provide';
|
|
8
8
|
import { useForm } from '../form/provide';
|
|
9
|
-
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, createVNode as _createVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective,
|
|
9
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, createVNode as _createVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createElementVNode as _createElementVNode, mergeProps as _mergeProps, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
10
10
|
|
|
11
11
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
12
12
|
|
|
@@ -25,7 +25,7 @@ export function render(_ctx, _cache) {
|
|
|
25
25
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
26
26
|
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
27
27
|
})
|
|
28
|
-
}, _ctx.$attrs), [_withDirectives(
|
|
28
|
+
}, _ctx.$attrs), [_withDirectives((_openBlock(), _createElementBlock("div", {
|
|
29
29
|
class: _normalizeClass(["var-radio__action", [_ctx.checked ? 'var-radio--checked' : 'var-radio--unchecked', _ctx.errorMessage || _ctx.radioGroupErrorMessage ? 'var-radio--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-radio--disabled' : null]]),
|
|
30
30
|
style: _normalizeStyle({
|
|
31
31
|
color: _ctx.checked ? _ctx.checkedColor : _ctx.uncheckedColor
|
|
@@ -50,7 +50,7 @@ export function render(_ctx, _cache) {
|
|
|
50
50
|
/* PROPS */
|
|
51
51
|
, ["class", "size"])])], 6
|
|
52
52
|
/* CLASS, STYLE */
|
|
53
|
-
), [[_directive_ripple, {
|
|
53
|
+
)), [[_directive_ripple, {
|
|
54
54
|
disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple
|
|
55
55
|
}]]), _createElementVNode("div", {
|
|
56
56
|
class: _normalizeClass(["var-radio__text", [_ctx.errorMessage || _ctx.radioGroupErrorMessage ? 'var-radio--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-radio--disabled' : null]])
|
package/es/row/Row.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, watch } from 'vue';
|
|
1
|
+
import { defineComponent, computed, watch } from 'vue';
|
|
2
2
|
import { props } from './props';
|
|
3
3
|
import { useCols } from './provide';
|
|
4
4
|
import { toPxNum } from '../utils/elements';
|
|
@@ -8,7 +8,8 @@ export function render(_ctx, _cache) {
|
|
|
8
8
|
class: "var-row var--box",
|
|
9
9
|
style: _normalizeStyle({
|
|
10
10
|
justifyContent: _ctx.justify,
|
|
11
|
-
alignItems: _ctx.align
|
|
11
|
+
alignItems: _ctx.align,
|
|
12
|
+
margin: _ctx.average ? "0 -" + _ctx.average + "px" : undefined
|
|
12
13
|
}),
|
|
13
14
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
14
15
|
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
@@ -28,55 +29,16 @@ export default defineComponent({
|
|
|
28
29
|
bindCols,
|
|
29
30
|
length
|
|
30
31
|
} = useCols();
|
|
31
|
-
|
|
32
|
-
var computeGroups = () => {
|
|
33
|
-
var groups = [[]];
|
|
34
|
-
var span = 0;
|
|
35
|
-
cols.forEach(col => {
|
|
36
|
-
var colSpan = col.span.value + col.offset.value;
|
|
37
|
-
var nextSpan = span + colSpan;
|
|
38
|
-
|
|
39
|
-
if (nextSpan > 24) {
|
|
40
|
-
groups.push([col]);
|
|
41
|
-
span = colSpan;
|
|
42
|
-
} else {
|
|
43
|
-
groups[groups.length - 1].push(col);
|
|
44
|
-
span += colSpan;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
return groups;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
var computePadding = () => {
|
|
51
|
-
var groups = computeGroups();
|
|
32
|
+
var average = computed(() => {
|
|
52
33
|
var gutter = toPxNum(props.gutter);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
cols.forEach((col, index) => {
|
|
56
|
-
if (cols.length <= 1) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (index === 0) {
|
|
61
|
-
col.setPadding({
|
|
62
|
-
left: 0,
|
|
63
|
-
right: average
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (index === cols.length - 1) {
|
|
68
|
-
col.setPadding({
|
|
69
|
-
left: average,
|
|
70
|
-
right: 0
|
|
71
|
-
});
|
|
72
|
-
}
|
|
34
|
+
return gutter / 2;
|
|
35
|
+
});
|
|
73
36
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
37
|
+
var computePadding = () => {
|
|
38
|
+
cols.forEach(col => {
|
|
39
|
+
col.setPadding({
|
|
40
|
+
left: average.value,
|
|
41
|
+
right: average.value
|
|
80
42
|
});
|
|
81
43
|
});
|
|
82
44
|
};
|
|
@@ -87,6 +49,9 @@ export default defineComponent({
|
|
|
87
49
|
watch(() => length.value, computePadding);
|
|
88
50
|
watch(() => props.gutter, computePadding);
|
|
89
51
|
bindCols(rowProvider);
|
|
52
|
+
return {
|
|
53
|
+
average
|
|
54
|
+
};
|
|
90
55
|
}
|
|
91
56
|
|
|
92
57
|
});
|
package/es/select/Select.js
CHANGED
|
@@ -83,7 +83,7 @@ export function render(_ctx, _cache) {
|
|
|
83
83
|
type: _ctx.errorMessage ? 'danger' : undefined,
|
|
84
84
|
key: l,
|
|
85
85
|
onClick: _cache[0] || (_cache[0] = _withModifiers(() => {}, ["stop"])),
|
|
86
|
-
onClose:
|
|
86
|
+
onClose: () => _ctx.handleClose(l)
|
|
87
87
|
}, {
|
|
88
88
|
default: _withCtx(() => [_createTextVNode(_toDisplayString(l), 1
|
|
89
89
|
/* TEXT */
|