@varlet/ui 3.20.5 → 3.20.6

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.
@@ -310,7 +310,7 @@ import './tree-menu/style/index.mjs'
310
310
  import './uploader/style/index.mjs'
311
311
  import './watermark/style/index.mjs'
312
312
 
313
- const version = '3.20.5'
313
+ const version = '3.20.6'
314
314
 
315
315
  function install(app) {
316
316
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -206,7 +206,7 @@ export * from './tree-menu/index.mjs'
206
206
  export * from './uploader/index.mjs'
207
207
  export * from './watermark/index.mjs'
208
208
 
209
- const version = '3.20.5'
209
+ const version = '3.20.6'
210
210
 
211
211
  function install(app) {
212
212
  ActionSheet.install && app.use(ActionSheet)
@@ -7,7 +7,7 @@ import { createNamespace, formatElevation } from "../utils/components.mjs";
7
7
  import { toSizeUnit } from "../utils/elements.mjs";
8
8
  import { props } from "./props.mjs";
9
9
  const { name, n, classes } = createNamespace("paper");
10
- import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from "vue";
10
+ 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 } from "vue";
11
11
  function __render__(_ctx, _cache) {
12
12
  const _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
13
13
  const _directive_ripple = _resolveDirective("ripple");
@@ -20,7 +20,9 @@ function __render__(_ctx, _cache) {
20
20
  _ctx.n(),
21
21
  _ctx.n("$--box"),
22
22
  [_ctx.variant === "standard", _ctx.formatElevation(_ctx.elevation, 2)],
23
- [_ctx.onClick || !_ctx.normalizedHoverable.disabled, _ctx.n("--cursor")],
23
+ [!_ctx.disabled && (_ctx.onClick || !_ctx.normalizedHoverable.disabled), _ctx.n("--cursor")],
24
+ [_ctx.disabled, _ctx.n("--disabled")],
25
+ [!_ctx.disabled && _ctx.normalizedActive.enabled, _ctx.n("--active")],
24
26
  [_ctx.round, _ctx.n("--round")],
25
27
  [_ctx.surfaceLow, _ctx.n("--surface-low")],
26
28
  [_ctx.variant === "outlined", _ctx.n("--outlined")],
@@ -31,21 +33,26 @@ function __render__(_ctx, _cache) {
31
33
  style: _normalizeStyle({
32
34
  width: _ctx.toSizeUnit(_ctx.width),
33
35
  height: _ctx.toSizeUnit(_ctx.height),
34
- "border-radius": _ctx.toSizeUnit(_ctx.radius)
36
+ "border-radius": _ctx.toSizeUnit(_ctx.radius),
37
+ "--paper-active-color": _ctx.normalizedActive.color
35
38
  }),
36
39
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
37
40
  },
38
41
  [
39
42
  _renderSlot(_ctx.$slots, "default"),
40
43
  _createVNode(_component_var_hover_overlay, {
41
- hovering: !_ctx.normalizedHoverable.disabled ? _ctx.hovering : false,
44
+ class: _normalizeClass(_ctx.n("active-overlay")),
45
+ hovering: !_ctx.disabled && _ctx.normalizedActive.enabled
46
+ }, null, 8, ["class", "hovering"]),
47
+ _createVNode(_component_var_hover_overlay, {
48
+ hovering: !_ctx.disabled && !_ctx.normalizedHoverable.disabled ? _ctx.hovering : false,
42
49
  color: _ctx.normalizedHoverable.color
43
50
  }, null, 8, ["hovering", "color"])
44
51
  ],
45
52
  6
46
53
  /* CLASS, STYLE */
47
54
  )), [
48
- [_directive_ripple, { disabled: _ctx.normalizedRipple.disabled, color: _ctx.normalizedRipple.color }],
55
+ [_directive_ripple, { disabled: _ctx.disabled || _ctx.normalizedRipple.disabled, color: _ctx.normalizedRipple.color }],
49
56
  [_directive_hover, _ctx.handleHovering, "desktop"]
50
57
  ]);
51
58
  }
@@ -61,6 +68,7 @@ const __sfc__ = defineComponent({
61
68
  const { hovering, handleHovering } = useHoverOverlay();
62
69
  const normalizedRipple = computed(() => normalizeRipple(props2.ripple));
63
70
  const normalizedHoverable = computed(() => normalizeHoverable(props2.hoverable));
71
+ const normalizedActive = computed(() => normalizeActive(props2.active));
64
72
  function normalizeRipple(value) {
65
73
  if (isPlainObject(value)) {
66
74
  return {
@@ -85,7 +93,22 @@ const __sfc__ = defineComponent({
85
93
  color: void 0
86
94
  };
87
95
  }
96
+ function normalizeActive(value) {
97
+ if (isPlainObject(value)) {
98
+ return {
99
+ enabled: true,
100
+ color: value.color
101
+ };
102
+ }
103
+ return {
104
+ enabled: value,
105
+ color: void 0
106
+ };
107
+ }
88
108
  function handleClick(e) {
109
+ if (props2.disabled) {
110
+ return;
111
+ }
89
112
  call(props2.onClick, e);
90
113
  }
91
114
  return {
@@ -95,6 +118,7 @@ const __sfc__ = defineComponent({
95
118
  surfaceLow,
96
119
  normalizedRipple,
97
120
  normalizedHoverable,
121
+ normalizedActive,
98
122
  hovering,
99
123
  handleHovering,
100
124
  toSizeUnit,
@@ -1 +1 @@
1
- :root { --paper-background: var(--color-surface-container-highest); --paper-surface-low-background: var(--color-surface-container-highest); --paper-outlined-background: transparent; --paper-filled-background: hsl(0, 0%, 93%); --paper-outline-color: var(--color-outline); --paper-border-radius: 4px;}.var-paper { position: relative; background: var(--paper-background); transition: background-color 0.25s; overflow: hidden; border-radius: var(--paper-border-radius); -webkit-tap-highlight-color: transparent;}.var-paper--round { border-radius: 50%;}.var-paper--cursor { cursor: pointer;}.var-paper--surface-low { background: var(--paper-surface-low-background);}.var-paper--outlined { border: thin solid var(--paper-outline-color); background: var(--paper-outlined-background);}.var-paper--filled { background: var(--paper-filled-background);}
1
+ :root { --paper-background: var(--color-surface-container-highest); --paper-surface-low-background: var(--color-surface-container-highest); --paper-outlined-background: transparent; --paper-filled-background: hsl(0, 0%, 93%); --paper-outline-color: var(--color-outline); --paper-border-radius: 4px; --paper-active-color: var(--color-primary); --paper-active-opacity: 0.2;}.var-paper { position: relative; background: var(--paper-background); transition: background-color 0.25s; overflow: hidden; border-radius: var(--paper-border-radius); -webkit-tap-highlight-color: transparent;}.var-paper--round { border-radius: 50%;}.var-paper--cursor { cursor: pointer;}.var-paper--disabled { cursor: not-allowed;}.var-paper--active { color: var(--paper-active-color);}.var-paper__active-overlay { color: var(--paper-active-color);}.var-paper__active-overlay.var-hover-overlay--hovering { opacity: var(--paper-active-opacity);}.var-paper--surface-low { background: var(--paper-surface-low-background);}.var-paper--outlined { border: thin solid var(--paper-outline-color); background: var(--paper-outlined-background);}.var-paper--filled { background: var(--paper-filled-background);}
@@ -22,6 +22,11 @@ const props = {
22
22
  type: [Boolean, Object],
23
23
  default: false
24
24
  },
25
+ active: {
26
+ type: [Boolean, Object],
27
+ default: false
28
+ },
29
+ disabled: Boolean,
25
30
  onClick: defineListenerProp()
26
31
  };
27
32
  export {
@@ -1,7 +1,7 @@
1
1
  import '../../styles/common.css'
2
- import '../SnackbarSfc.css'
3
2
  import '../../styles/elevation.css'
4
3
  import '../../loading/loading.css'
5
4
  import '../../icon/icon.css'
6
5
  import '../snackbar.css'
7
6
  import '../coreSfc.css'
7
+ import '../SnackbarSfc.css'
@@ -3,7 +3,9 @@ var stdin_default = {
3
3
  "--paper-outlined-background": "transparent",
4
4
  "--paper-filled-background": "var(--color-surface-container-highest)",
5
5
  "--paper-outline-color": "var(--color-outline)",
6
- "--paper-border-radius": "4px"
6
+ "--paper-border-radius": "4px",
7
+ "--paper-active-color": "var(--color-primary)",
8
+ "--paper-active-opacity": "0.2"
7
9
  };
8
10
  export {
9
11
  stdin_default as default
@@ -4,7 +4,9 @@ var stdin_default = {
4
4
  "--paper-outlined-background": "transparent",
5
5
  "--paper-filled-background": "var(--color-surface-container-highest)",
6
6
  "--paper-outline-color": "var(--color-outline)",
7
- "--paper-border-radius": "12px"
7
+ "--paper-border-radius": "12px",
8
+ "--paper-active-color": "var(--color-primary)",
9
+ "--paper-active-opacity": "0.2"
8
10
  };
9
11
  export {
10
12
  stdin_default as default
@@ -4,7 +4,9 @@ var stdin_default = {
4
4
  "--paper-outlined-background": "transparent",
5
5
  "--paper-filled-background": "var(--color-surface-container-highest)",
6
6
  "--paper-outline-color": "var(--color-outline)",
7
- "--paper-border-radius": "12px"
7
+ "--paper-border-radius": "12px",
8
+ "--paper-active-color": "var(--color-primary)",
9
+ "--paper-active-opacity": "0.2"
8
10
  };
9
11
  export {
10
12
  stdin_default as default