@varlet/ui 1.26.1 → 1.26.2

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/varlet.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reactive, getCurrentInstance, watch, onBeforeMount, onUnmounted, onActivated, onDeactivated, ref, onMounted, provide, computed, inject, nextTick, createApp, onBeforeUnmount, h, isVNode, defineComponent, createVNode, Teleport, Transition, withDirectives, mergeProps, vShow, openBlock, createBlock, resolveDynamicComponent, normalizeClass, normalizeStyle, resolveComponent, resolveDirective, withCtx, createElementVNode, renderSlot, toDisplayString, createElementBlock, Fragment, renderList, createCommentVNode, onUpdated, createTextVNode, pushScopeId, popScopeId, withModifiers, normalizeProps, guardReactiveProps, vModelText, toRefs, withKeys, toRaw, TransitionGroup } from "vue";
1
+ import { reactive, getCurrentInstance, watch, onBeforeMount, onUnmounted, onActivated, onDeactivated, ref, onMounted, provide, computed, inject, nextTick, createApp, onBeforeUnmount, h, isVNode, defineComponent, createVNode, Teleport, Transition, withDirectives, mergeProps, vShow, openBlock, createBlock, resolveDynamicComponent, normalizeClass, normalizeStyle, resolveComponent, resolveDirective, withCtx, createElementVNode, renderSlot, toDisplayString, createElementBlock, Fragment, renderList, createCommentVNode, onUpdated, createTextVNode, pushScopeId, popScopeId, withModifiers, normalizeProps, guardReactiveProps, vModelText, toRefs, withKeys, toRaw, TransitionGroup, Comment } from "vue";
2
2
  var context = {
3
3
  locks: {},
4
4
  zIndex: 2e3,
@@ -64,7 +64,6 @@ function createRipple(event) {
64
64
  return;
65
65
  }
66
66
  var task = () => {
67
- var _ripple$color;
68
67
  _ripple.tasker = null;
69
68
  var {
70
69
  x,
@@ -79,7 +78,7 @@ function createRipple(event) {
79
78
  ripple2.style.transform = "translate(" + x + "px, " + y + "px) scale3d(.3, .3, .3)";
80
79
  ripple2.style.width = size + "px";
81
80
  ripple2.style.height = size + "px";
82
- ripple2.style.backgroundColor = (_ripple$color = _ripple.color) != null ? _ripple$color : "currentColor";
81
+ _ripple.color && (ripple2.style.backgroundColor = _ripple.color);
83
82
  ripple2.dataset.createdAt = String(performance.now());
84
83
  setStyles(this);
85
84
  this.appendChild(ripple2);
@@ -2029,7 +2028,7 @@ var Badge = defineComponent({
2029
2028
  dot,
2030
2029
  icon: icon2
2031
2030
  } = props2;
2032
- var positionBasic = (slots.default == null ? void 0 : slots.default()) && "var-badge__position var-badge--" + position;
2031
+ var positionBasic = slots.default && "var-badge__position var-badge--" + position;
2033
2032
  var dotClass = dot && "var-badge__dot";
2034
2033
  var positionClass = getPositionClass();
2035
2034
  var iconClass = icon2 && "var-badge__icon";
@@ -8016,7 +8015,7 @@ var Divider = defineComponent({
8016
8015
  });
8017
8016
  });
8018
8017
  var checkHasText = () => {
8019
- state.withText = Boolean(slots.default == null ? void 0 : slots.default().length) || Boolean(props2.description);
8018
+ state.withText = Boolean(slots.default) || Boolean(props2.description);
8020
8019
  };
8021
8020
  onMounted(() => {
8022
8021
  checkHasText();
@@ -10518,7 +10517,7 @@ var Menu = defineComponent({
10518
10517
  });
10519
10518
  var renderTransition = () => createVNode(Transition, {
10520
10519
  "name": "var-menu",
10521
- "onAfterEnter": props2.onOpen,
10520
+ "onAfterEnter": props2.onOpened,
10522
10521
  "onAfterLeave": props2.onClosed
10523
10522
  }, {
10524
10523
  default: () => [withDirectives(createVNode("div", {
@@ -14025,9 +14024,25 @@ var Space = defineComponent({
14025
14024
  size
14026
14025
  } = props2;
14027
14026
  var children = (_slots$default = slots.default == null ? void 0 : slots.default()) != null ? _slots$default : [];
14028
- var lastIndex = children.length - 1;
14029
14027
  var isInternalSize = internalSizeValidator(size);
14030
14028
  var [y, x] = getSize(size, isInternalSize);
14029
+ var flatten = (vNodes) => {
14030
+ var result = [];
14031
+ vNodes.forEach((vNode) => {
14032
+ if (vNode.type === Comment)
14033
+ return;
14034
+ if (vNode.type === Fragment && isArray(vNode.children)) {
14035
+ vNode.children.forEach((item) => {
14036
+ result.push(item);
14037
+ });
14038
+ return;
14039
+ }
14040
+ result.push(vNode);
14041
+ });
14042
+ return result;
14043
+ };
14044
+ children = flatten(children);
14045
+ var lastIndex = children.length - 1;
14031
14046
  var spacers = children.map((child, index) => {
14032
14047
  var margin = "0";
14033
14048
  if (direction === "row") {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "1.26.0",
4
+ "version": "1.26.1",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -71,7 +71,7 @@ var _default = (0, _vue.defineComponent)({
71
71
  dot,
72
72
  icon
73
73
  } = props;
74
- var positionBasic = (slots.default == null ? void 0 : slots.default()) && "var-badge__position var-badge--" + position;
74
+ var positionBasic = slots.default && "var-badge__position var-badge--" + position;
75
75
  var dotClass = dot && 'var-badge__dot';
76
76
  var positionClass = getPositionClass();
77
77
  var iconClass = icon && 'var-badge__icon';
@@ -69,7 +69,7 @@ var _default = (0, _vue.defineComponent)({
69
69
  });
70
70
 
71
71
  var checkHasText = () => {
72
- state.withText = Boolean(slots.default == null ? void 0 : slots.default().length) || Boolean(props.description);
72
+ state.withText = Boolean(slots.default) || Boolean(props.description);
73
73
  };
74
74
 
75
75
  (0, _vue.onMounted)(() => {
package/lib/menu/Menu.js CHANGED
@@ -88,7 +88,7 @@ var _default = (0, _vue.defineComponent)({
88
88
 
89
89
  var renderTransition = () => (0, _vue.createVNode)(_vue.Transition, {
90
90
  "name": "var-menu",
91
- "onAfterEnter": props.onOpen,
91
+ "onAfterEnter": props.onOpened,
92
92
  "onAfterLeave": props.onClosed
93
93
  }, {
94
94
  default: () => [(0, _vue.withDirectives)((0, _vue.createVNode)("div", {
@@ -63,8 +63,6 @@ function createRipple(event) {
63
63
  }
64
64
 
65
65
  var task = () => {
66
- var _ripple$color;
67
-
68
66
  _ripple.tasker = null;
69
67
  var {
70
68
  x,
@@ -79,7 +77,7 @@ function createRipple(event) {
79
77
  ripple.style.transform = "translate(" + x + "px, " + y + "px) scale3d(.3, .3, .3)";
80
78
  ripple.style.width = size + "px";
81
79
  ripple.style.height = size + "px";
82
- ripple.style.backgroundColor = (_ripple$color = _ripple.color) != null ? _ripple$color : 'currentColor';
80
+ _ripple.color && (ripple.style.backgroundColor = _ripple.color);
83
81
  ripple.dataset.createdAt = String(performance.now());
84
82
  setStyles(this);
85
83
  this.appendChild(ripple);
@@ -1 +1 @@
1
- :root { --ripple-cubic-bezier: cubic-bezier(0.68, 0.01, 0.62, 0.6);}.var-ripple { position: absolute; transition: transform 0.2s var(--ripple-cubic-bezier), opacity 0.14s linear; top: 0; left: 0; border-radius: 50%; opacity: 0; will-change: transform, opacity; pointer-events: none; z-index: 100;}
1
+ :root { --ripple-cubic-bezier: cubic-bezier(0.68, 0.01, 0.62, 0.6); --ripple-color: currentColor;}.var-ripple { position: absolute; transition: transform 0.2s var(--ripple-cubic-bezier), opacity 0.14s linear; top: 0; left: 0; border-radius: 50%; opacity: 0; will-change: transform, opacity; pointer-events: none; z-index: 100; background-color: var(--ripple-color);}
@@ -1,7 +1,9 @@
1
1
  @ripple-cubic-bezier: cubic-bezier(0.68, 0.01, 0.62, 0.6);
2
+ @ripple-color: currentColor;
2
3
 
3
4
  :root {
4
5
  --ripple-cubic-bezier: @ripple-cubic-bezier;
6
+ --ripple-color: @ripple-color;
5
7
  }
6
8
 
7
9
  .var-ripple {
@@ -14,4 +16,5 @@
14
16
  will-change: transform, opacity;
15
17
  pointer-events: none;
16
18
  z-index: 100;
19
+ background-color: var(--ripple-color);
17
20
  }
@@ -47,9 +47,28 @@ var _default = (0, _vue.defineComponent)({
47
47
  size
48
48
  } = props;
49
49
  var children = (_slots$default = slots.default == null ? void 0 : slots.default()) != null ? _slots$default : [];
50
- var lastIndex = children.length - 1;
51
50
  var isInternalSize = (0, _props.internalSizeValidator)(size);
52
51
  var [y, x] = getSize(size, isInternalSize);
52
+
53
+ var flatten = vNodes => {
54
+ var result = [];
55
+ vNodes.forEach(vNode => {
56
+ if (vNode.type === _vue.Comment) return;
57
+
58
+ if (vNode.type === _vue.Fragment && (0, _shared.isArray)(vNode.children)) {
59
+ vNode.children.forEach(item => {
60
+ result.push(item);
61
+ });
62
+ return;
63
+ }
64
+
65
+ result.push(vNode);
66
+ });
67
+ return result;
68
+ };
69
+
70
+ children = flatten(children);
71
+ var lastIndex = children.length - 1;
53
72
  var spacers = children.map((child, index) => {
54
73
  var margin = '0';
55
74