@varlet/ui 3.19.0 → 3.19.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/action-sheet/style/index.mjs +1 -1
- package/es/back-top/BackTop.mjs +2 -1
- package/es/back-top/props.mjs +1 -0
- package/es/field-decorator/FieldDecorator.mjs +33 -14
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/varlet.esm.js +3371 -3361
- package/highlight/web-types.en-US.json +10 -1
- package/highlight/web-types.zh-CN.json +10 -1
- package/lib/varlet.cjs.js +31 -14
- package/package.json +7 -7
- package/umd/varlet.js +6 -6
package/es/back-top/BackTop.mjs
CHANGED
|
@@ -23,7 +23,8 @@ function __render__(_ctx, _cache) {
|
|
|
23
23
|
class: _ctx.classes(_ctx.n(), [_ctx.show, _ctx.n("--active")]),
|
|
24
24
|
style: {
|
|
25
25
|
right: _ctx.toSizeUnit(_ctx.right),
|
|
26
|
-
bottom: _ctx.toSizeUnit(_ctx.bottom)
|
|
26
|
+
bottom: _ctx.toSizeUnit(_ctx.bottom),
|
|
27
|
+
"--back-top-button-size": _ctx.toSizeUnit(_ctx.size)
|
|
27
28
|
}
|
|
28
29
|
}, _ctx.$attrs, {
|
|
29
30
|
onClick: _cache[0] || (_cache[0] = _withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"]))
|
package/es/back-top/props.mjs
CHANGED
|
@@ -18,8 +18,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18
18
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
import { call, doubleRaf, getStyle, isEmpty } from "@varlet/shared";
|
|
22
|
-
import { onSmartMounted, onWindowResize } from "@varlet/use";
|
|
21
|
+
import { call, doubleRaf, getStyle, isEmpty, raf } from "@varlet/shared";
|
|
22
|
+
import { onSmartMounted, onWindowResize, useResizeObserver } from "@varlet/use";
|
|
23
23
|
import { computed, defineComponent, nextTick, onUpdated, ref, watch } from "vue";
|
|
24
24
|
import VarIcon from "../icon/index.mjs";
|
|
25
25
|
import { usePopup } from "../popup/provide.mjs";
|
|
@@ -237,10 +237,12 @@ const __sfc__ = defineComponent({
|
|
|
237
237
|
const isFloating = computed(() => props2.hint && (!isEmpty(props2.value) || props2.isFocusing));
|
|
238
238
|
const { popup, bindPopup } = usePopup();
|
|
239
239
|
const { bindSwipeResizeDispatcher } = useSwipeResizeDispatcher();
|
|
240
|
+
let transitionVersion = 0;
|
|
240
241
|
const color = computed(
|
|
241
242
|
() => !props2.isError ? props2.isFocusing ? props2.focusColor : props2.blurColor : void 0
|
|
242
243
|
);
|
|
243
|
-
onWindowResize(resize);
|
|
244
|
+
onWindowResize(() => resize(true));
|
|
245
|
+
useResizeObserver(middleEl, () => resize(true));
|
|
244
246
|
onSmartMounted(() => {
|
|
245
247
|
resize();
|
|
246
248
|
nextTick().then(() => {
|
|
@@ -251,7 +253,7 @@ const __sfc__ = defineComponent({
|
|
|
251
253
|
call(bindPopup, null);
|
|
252
254
|
call(bindSwipeResizeDispatcher, {
|
|
253
255
|
onResize() {
|
|
254
|
-
nextTick().then(resize);
|
|
256
|
+
nextTick().then(() => resize(true));
|
|
255
257
|
}
|
|
256
258
|
});
|
|
257
259
|
if (popup) {
|
|
@@ -260,7 +262,7 @@ const __sfc__ = defineComponent({
|
|
|
260
262
|
(show) => __async(null, null, function* () {
|
|
261
263
|
if (show) {
|
|
262
264
|
yield doubleRaf();
|
|
263
|
-
resize();
|
|
265
|
+
resize(true);
|
|
264
266
|
}
|
|
265
267
|
})
|
|
266
268
|
);
|
|
@@ -280,15 +282,32 @@ const __sfc__ = defineComponent({
|
|
|
280
282
|
function handleClick(e) {
|
|
281
283
|
call(props2.onClick, e);
|
|
282
284
|
}
|
|
283
|
-
function resize() {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
285
|
+
function resize(disableTransition = false) {
|
|
286
|
+
return __async(this, null, function* () {
|
|
287
|
+
if (!middleEl.value) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
if (disableTransition) {
|
|
291
|
+
transitionVersion++;
|
|
292
|
+
transitionDisabled.value = true;
|
|
293
|
+
}
|
|
294
|
+
const currentTransitionVersion = transitionVersion;
|
|
295
|
+
middleOffsetLeft.value = `${middleEl.value.offsetLeft}px`;
|
|
296
|
+
middleOffsetWidth.value = `${middleEl.value.offsetWidth}px`;
|
|
297
|
+
middleOffsetHeight.value = `${middleEl.value.offsetHeight}px`;
|
|
298
|
+
if (props2.variant === "outlined" && placeholderTextEl.value) {
|
|
299
|
+
const placeholderTextStyle = getStyle(placeholderTextEl.value);
|
|
300
|
+
const placeholderSpace = `var(--field-decorator-outlined-${props2.size}-placeholder-space)`;
|
|
301
|
+
legendWidth.value = `calc(${placeholderTextStyle.width} * 0.75 + ${placeholderSpace} * 2)`;
|
|
302
|
+
}
|
|
303
|
+
if (disableTransition) {
|
|
304
|
+
yield nextTick();
|
|
305
|
+
yield raf();
|
|
306
|
+
if (currentTransitionVersion === transitionVersion) {
|
|
307
|
+
transitionDisabled.value = false;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
});
|
|
292
311
|
}
|
|
293
312
|
return {
|
|
294
313
|
placeholderTextEl,
|
package/es/index.bundle.mjs
CHANGED
|
@@ -307,7 +307,7 @@ import './tree-menu/style/index.mjs'
|
|
|
307
307
|
import './uploader/style/index.mjs'
|
|
308
308
|
import './watermark/style/index.mjs'
|
|
309
309
|
|
|
310
|
-
const version = '3.19.
|
|
310
|
+
const version = '3.19.2'
|
|
311
311
|
|
|
312
312
|
function install(app) {
|
|
313
313
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -204,7 +204,7 @@ export * from './tree-menu/index.mjs'
|
|
|
204
204
|
export * from './uploader/index.mjs'
|
|
205
205
|
export * from './watermark/index.mjs'
|
|
206
206
|
|
|
207
|
-
const version = '3.19.
|
|
207
|
+
const version = '3.19.2'
|
|
208
208
|
|
|
209
209
|
function install(app) {
|
|
210
210
|
ActionSheet.install && app.use(ActionSheet)
|