@varlet/ui 2.12.2 → 2.12.3

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.
@@ -6,15 +6,23 @@ import VarHoverOverlay, { useHoverOverlay } from '../hover-overlay/index.mjs';
6
6
  import Hover from '../hover/index.mjs';
7
7
  import { props } from './props.mjs';
8
8
  import VarFormDetails from '../form-details/index.mjs';
9
- import VarLoading from '../loading/index.mjs';
10
9
  import Ripple from '../ripple/index.mjs';
11
10
  var {
12
11
  n,
13
12
  classes
14
13
  } = createNamespace('switch');
15
- import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from "vue";
14
+ import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
15
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
16
+ var _hoisted_1 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("svg", {
17
+ viewBox: "25 25 50 50"
18
+ }, [/*#__PURE__*/_createElementVNode("circle", {
19
+ cx: "50",
20
+ cy: "50",
21
+ r: "20",
22
+ fill: "none"
23
+ })], -1 /* HOISTED */));
24
+ var _hoisted_2 = [_hoisted_1];
16
25
  function __render__(_ctx, _cache) {
17
- var _component_var_loading = _resolveComponent("var-loading");
18
26
  var _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
19
27
  var _component_var_form_details = _resolveComponent("var-form-details");
20
28
  var _directive_ripple = _resolveDirective("ripple");
@@ -36,11 +44,14 @@ function __render__(_ctx, _cache) {
36
44
  }, [_createElementVNode("div", {
37
45
  style: _normalizeStyle(_ctx.styleComputed.handle),
38
46
  class: _normalizeClass(_ctx.classes(_ctx.n('handle'), _ctx.n('$-elevation--2'), [_ctx.modelValue === _ctx.activeValue, _ctx.n('handle--active')], [_ctx.errorMessage, _ctx.n('handle--error')]))
39
- }, [_ctx.loading ? (_openBlock(), _createBlock(_component_var_loading, {
47
+ }, [_ctx.loading ? (_openBlock(), _createElementBlock("span", {
40
48
  key: 0,
41
- radius: _ctx.radius,
42
- color: "currentColor"
43
- }, null, 8 /* PROPS */, ["radius"])) : _createCommentVNode("v-if", true)], 6 /* CLASS, STYLE */), _createVNode(_component_var_hover_overlay, {
49
+ class: _normalizeClass(_ctx.n('loading')),
50
+ style: _normalizeStyle({
51
+ width: _ctx.multiplySizeUnit(_ctx.radius, 2),
52
+ height: _ctx.multiplySizeUnit(_ctx.radius, 2)
53
+ })
54
+ }, _hoisted_2, 6 /* CLASS, STYLE */)) : _createCommentVNode("v-if", true)], 6 /* CLASS, STYLE */), _createVNode(_component_var_hover_overlay, {
44
55
  hovering: _ctx.hovering
45
56
  }, null, 8 /* PROPS */, ["hovering"])], 6 /* CLASS, STYLE */)), [[_directive_ripple, {
46
57
  disabled: !_ctx.ripple || _ctx.disabled || _ctx.loading || _ctx.formDisabled
@@ -51,7 +62,6 @@ function __render__(_ctx, _cache) {
51
62
  var __sfc__ = defineComponent({
52
63
  name: 'VarSwitch',
53
64
  components: {
54
- VarLoading,
55
65
  VarFormDetails,
56
66
  VarHoverOverlay
57
67
  },
@@ -112,7 +122,7 @@ var __sfc__ = defineComponent({
112
122
  }
113
123
  };
114
124
  });
115
- var radius = computed(() => multiplySizeUnit(props.size || 0, 0.4));
125
+ var radius = computed(() => multiplySizeUnit(props.size, 0.4));
116
126
  var switchActive = event => {
117
127
  var {
118
128
  onClick,
@@ -149,6 +159,7 @@ var __sfc__ = defineComponent({
149
159
  return {
150
160
  n,
151
161
  classes,
162
+ multiplySizeUnit,
152
163
  switchActive,
153
164
  hovering,
154
165
  hover,
@@ -1 +1 @@
1
- :root { --switch-track-background: #fff; --switch-track-active-background: var(--color-primary); --switch-track-error-background: var(--color-danger); --switch-ripple-color: var(--color-primary); --switch-handle-background: #fff; --switch-handle-color: #fff; --switch-handle-active-background: var(--color-primary); --switch-handle-error-background: var(--color-danger); --switch-disabled-opacity: var(--opacity-disabled);}.var-switch { display: inline-block;}.var-switch__block { position: relative; display: flex; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; justify-content: center; height: 24px; width: 40px; transition: filter 0.25s;}.var-switch--disabled { filter: opacity(var(--switch-disabled-opacity)); cursor: not-allowed;}.var-switch__track { background-color: var(--switch-track-background); transition: background-color 0.25s; filter: opacity(var(--switch-disabled-opacity)); height: 14.4px; width: 38px; border-radius: calc(20px * 2 / 3);}.var-switch__track--active { background-color: var(--switch-track-active-background);}.var-switch__track--error { background-color: var(--switch-track-error-background) !important;}.var-switch__ripple { position: absolute; display: flex; align-items: center; justify-content: center; color: var(--switch-ripple-color); border-radius: 50%; overflow: hidden; transition: 0.3s var(--cubic-bezier); width: 40px; height: 40px; left: -10px;}.var-switch__ripple--active { left: 10px;}.var-switch__handle { border-radius: 50%; background-color: var(--switch-handle-background); display: flex; align-items: center; justify-content: center; color: var(--switch-handle-color); transition: background-color 0.25s; width: 20px; height: 20px;}.var-switch__handle--active { background-color: var(--switch-handle-active-background);}.var-switch__handle--error { background-color: var(--switch-handle-error-background) !important;}
1
+ :root { --switch-track-background: #fff; --switch-track-active-background: var(--color-primary); --switch-track-error-background: var(--color-danger); --switch-ripple-color: var(--color-primary); --switch-handle-background: #fff; --switch-handle-color: #fff; --switch-handle-active-background: var(--color-primary); --switch-handle-error-background: var(--color-danger); --switch-disabled-opacity: var(--opacity-disabled);}.var-switch { display: inline-block;}.var-switch__block { position: relative; display: flex; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; justify-content: center; height: 24px; width: 40px; transition: filter 0.25s;}.var-switch--disabled { filter: opacity(var(--switch-disabled-opacity)); cursor: not-allowed;}.var-switch__track { background-color: var(--switch-track-background); transition: background-color 0.25s; filter: opacity(var(--switch-disabled-opacity)); height: 14.4px; width: 38px; border-radius: calc(20px * 2 / 3);}.var-switch__track--active { background-color: var(--switch-track-active-background);}.var-switch__track--error { background-color: var(--switch-track-error-background) !important;}.var-switch__ripple { position: absolute; display: flex; align-items: center; justify-content: center; color: var(--switch-ripple-color); border-radius: 50%; overflow: hidden; transition: 0.3s var(--cubic-bezier); width: 40px; height: 40px; left: -10px;}.var-switch__ripple--active { left: 10px;}.var-switch__handle { border-radius: 50%; background-color: var(--switch-handle-background); display: flex; align-items: center; justify-content: center; color: var(--switch-handle-color); transition: background-color 0.25s; width: 20px; height: 20px;}.var-switch__handle--active { background-color: var(--switch-handle-active-background);}.var-switch__handle--error { background-color: var(--switch-handle-error-background) !important;}.var-switch__loading { display: inline-block; width: 16px; height: 16px; animation: circle 1.8s linear infinite;}.var-switch__loading svg { display: block; width: 100%; height: 100%;}.var-switch__loading svg circle { animation: circular 1.5s ease-in-out infinite; stroke: currentColor; stroke-width: 3; stroke-linecap: round;}@keyframes circle { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}@keyframes circular { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -40; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -120; }}