@varlet/ui 3.2.2 → 3.2.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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <img src="https://varlet.gitee.io/varlet-ui/logo.svg" width="150">
4
4
  </a>
5
5
  <h1>VARLET</h1>
6
- <p>Material design mobile component library for Vue3</p>
6
+ <p>Vue3 mobile component library supports both Material Design 2 and 3, and also has a good experience on the desktop.</p>
7
7
  <p>
8
8
  <a href="https://varlet-varletjs.vercel.app/#/en-US/index">Documentation(Vercel)</a> |
9
9
  <a href="https://varlet.gitee.io/varlet-ui/#/en-US/index">Documentation(Gitee)</a> |
@@ -15,7 +15,6 @@
15
15
  <img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
16
16
  <img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
17
17
  <img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
18
- <img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
19
18
  <img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
20
19
  </p>
21
20
  </div>
package/README.zh-CN.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <img src="https://varlet.gitee.io/varlet-ui/logo.svg" width="150">
5
5
  </a>
6
6
  <h1>VARLET</h1>
7
- <p>基于 Vue3 Material design 风格移动端组件库</p>
7
+ <p>Vue3 移动端组件库,同时支持 Material Design 2 和 3,桌面端也有不错的体验。</p>
8
8
  <p>
9
9
  <a href="https://varlet-varletjs.vercel.app">文档(Vercel)</a> |
10
10
  <a href="https://varlet.gitee.io/varlet-ui">文档(Gitee)</a> |
@@ -16,7 +16,6 @@
16
16
  <img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
17
17
  <img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
18
18
  <img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
19
- <img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
20
19
  <img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
21
20
  </p>
22
21
  </div>
@@ -34,7 +34,7 @@ function __render__(_ctx, _cache) {
34
34
  referrerpolicy: _ctx.referrerpolicy,
35
35
  "lazy-loading": _ctx.loading,
36
36
  "lazy-error": _ctx.error,
37
- style: _normalizeStyle({ objectFit: _ctx.fit }),
37
+ style: _normalizeStyle({ objectFit: _ctx.fit, objectPosition: _ctx.position }),
38
38
  onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
39
39
  onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
40
40
  }, null, 46, _hoisted_1)), [
@@ -47,7 +47,7 @@ function __render__(_ctx, _cache) {
47
47
  alt: _ctx.alt,
48
48
  title: _ctx.title,
49
49
  referrerpolicy: _ctx.referrerpolicy,
50
- style: _normalizeStyle({ objectFit: _ctx.fit }),
50
+ style: _normalizeStyle({ objectFit: _ctx.fit, objectPosition: _ctx.position }),
51
51
  src: _ctx.src,
52
52
  onLoad: _cache[2] || (_cache[2] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
53
53
  onError: _cache[3] || (_cache[3] = (...args) => _ctx.handleError && _ctx.handleError(...args)),
@@ -5,6 +5,10 @@ const props = {
5
5
  type: String,
6
6
  default: "fill"
7
7
  },
8
+ position: {
9
+ type: String,
10
+ default: "50% 50%"
11
+ },
8
12
  alt: String,
9
13
  title: String,
10
14
  referrerpolicy: String,
@@ -262,7 +262,7 @@ import './tooltip/style/index.mjs'
262
262
  import './uploader/style/index.mjs'
263
263
  import './watermark/style/index.mjs'
264
264
 
265
- const version = '3.2.2'
265
+ const version = '3.2.3'
266
266
 
267
267
  function install(app) {
268
268
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -174,7 +174,7 @@ export * from './tooltip/index.mjs'
174
174
  export * from './uploader/index.mjs'
175
175
  export * from './watermark/index.mjs'
176
176
 
177
- const version = '3.2.2'
177
+ const version = '3.2.3'
178
178
 
179
179
  function install(app) {
180
180
  ActionSheet.install && app.use(ActionSheet)
@@ -56,7 +56,6 @@ function usePopover(options) {
56
56
  defaultValue: false,
57
57
  emit(event, value) {
58
58
  if (value) {
59
- resize();
60
59
  call(options.onOpen);
61
60
  } else {
62
61
  call(options.onClose);
@@ -317,6 +316,14 @@ function usePopover(options) {
317
316
  onWindowResize(resize);
318
317
  watch(() => [options.offsetX, options.offsetY, options.placement, options.strategy], resize);
319
318
  watch(() => options.disabled, close);
319
+ watch(
320
+ () => show.value,
321
+ (newValue) => {
322
+ if (newValue) {
323
+ resize();
324
+ }
325
+ }
326
+ );
320
327
  onMounted(() => {
321
328
  var _a;
322
329
  popoverInstance = createPopper((_a = getReference()) != null ? _a : host.value, popover.value, getPopperOptions());
@@ -5,10 +5,9 @@ import Success from "./Success.mjs";
5
5
  import Question from "./Question.mjs";
6
6
  import Empty from "./Empty.mjs";
7
7
  import { computed, defineComponent } from "vue";
8
- import { toNumber } from "@varlet/shared";
9
8
  import { props } from "./props.mjs";
10
9
  import { createNamespace } from "../utils/components.mjs";
11
- import { toPxNum, toSizeUnit } from "../utils/elements.mjs";
10
+ import { toSizeUnit } from "../utils/elements.mjs";
12
11
  const { name, n, classes } = createNamespace("result");
13
12
  import { renderSlot as _renderSlot, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString } from "vue";
14
13
  function __render__(_ctx, _cache) {
@@ -103,22 +102,17 @@ const __sfc__ = defineComponent({
103
102
  },
104
103
  props,
105
104
  setup(props2) {
106
- const circleSize = computed(() => {
107
- const { imageSize } = props2;
108
- return `calc(${imageSize ? toSizeUnit(imageSize) : "var(--result-image-size)"} * 0.9)`;
109
- });
110
- const borderSize = computed(() => {
111
- const { imageSize } = props2;
112
- return `calc(${imageSize ? toSizeUnit(props2.imageSize) : "var(--result-image-size)"} * 0.05)`;
113
- });
105
+ const circleSize = computed(
106
+ () => `calc(${props2.imageSize ? toSizeUnit(props2.imageSize) : "var(--result-image-size)"} * 0.9)`
107
+ );
108
+ const borderSize = computed(
109
+ () => `calc(${props2.imageSize ? toSizeUnit(props2.imageSize) : "var(--result-image-size)"} * 0.05)`
110
+ );
114
111
  return {
115
112
  circleSize,
116
113
  borderSize,
117
- toSizeUnit,
118
114
  n,
119
- classes,
120
- toNumber,
121
- toPxNum
115
+ classes
122
116
  };
123
117
  }
124
118
  });
@@ -1,6 +1,5 @@
1
1
  import { defineComponent } from "vue";
2
2
  import { createNamespace } from "../utils/components.mjs";
3
- import { toNumber } from "@varlet/shared";
4
3
  const { n, classes } = createNamespace("result");
5
4
  import { normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
6
5
  function __render__(_ctx, _cache) {
@@ -22,7 +21,7 @@ function __render__(_ctx, _cache) {
22
21
  {
23
22
  class: _normalizeClass(_ctx.classes(_ctx.n("success-line"), _ctx.n("success-line-tip"))),
24
23
  style: _normalizeStyle({
25
- animationDuration: _ctx.animation ? `760ms` : "0ms",
24
+ animationDuration: _ctx.animation ? "760ms" : "0ms",
26
25
  borderRadius: `calc(${_ctx.borderSize} * 0.625)`
27
26
  })
28
27
  },
@@ -35,7 +34,7 @@ function __render__(_ctx, _cache) {
35
34
  {
36
35
  class: _normalizeClass(_ctx.classes(_ctx.n("success-line"), _ctx.n("success-line-long"))),
37
36
  style: _normalizeStyle({
38
- animationDuration: _ctx.animation ? `770ms` : "0ms",
37
+ animationDuration: _ctx.animation ? "770ms" : "0ms",
39
38
  borderRadius: `calc(${_ctx.borderSize} * 0.625)`
40
39
  })
41
40
  },
@@ -68,7 +67,7 @@ function __render__(_ctx, _cache) {
68
67
  {
69
68
  class: _normalizeClass(_ctx.n("success-cover-right")),
70
69
  style: _normalizeStyle({
71
- animationDuration: _ctx.animation ? `4250ms` : "0ms"
70
+ animationDuration: _ctx.animation ? "4250ms" : "0ms"
72
71
  })
73
72
  },
74
73
  null,
@@ -92,8 +91,7 @@ const __sfc__ = defineComponent({
92
91
  setup() {
93
92
  return {
94
93
  n,
95
- classes,
96
- toNumber
94
+ classes
97
95
  };
98
96
  }
99
97
  });