@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/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, createElementVNode as _createElementVNode, withDirectives as _withDirectives, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
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(_createElementVNode("div", {
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
- var average = gutter / 2;
54
- groups.forEach(cols => {
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
- if (index > 0 && index < cols.length - 1) {
75
- col.setPadding({
76
- left: average,
77
- right: average
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
  });
@@ -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: e => _ctx.handleClose(l)
86
+ onClose: () => _ctx.handleClose(l)
87
87
  }, {
88
88
  default: _withCtx(() => [_createTextVNode(_toDisplayString(l), 1
89
89
  /* TEXT */