@varlet/ui 3.19.1 → 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/field-decorator/FieldDecorator.mjs +32 -17
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/snackbar/style/index.mjs +1 -1
- package/es/varlet.esm.js +2921 -2913
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/varlet.cjs.js +28 -15
- package/package.json +7 -7
- package/umd/varlet.js +6 -6
|
@@ -18,7 +18,7 @@ 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";
|
|
21
|
+
import { call, doubleRaf, getStyle, isEmpty, raf } from "@varlet/shared";
|
|
22
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";
|
|
@@ -237,11 +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
|
-
useResizeObserver(middleEl, resize);
|
|
244
|
+
onWindowResize(() => resize(true));
|
|
245
|
+
useResizeObserver(middleEl, () => resize(true));
|
|
245
246
|
onSmartMounted(() => {
|
|
246
247
|
resize();
|
|
247
248
|
nextTick().then(() => {
|
|
@@ -252,7 +253,7 @@ const __sfc__ = defineComponent({
|
|
|
252
253
|
call(bindPopup, null);
|
|
253
254
|
call(bindSwipeResizeDispatcher, {
|
|
254
255
|
onResize() {
|
|
255
|
-
nextTick().then(resize);
|
|
256
|
+
nextTick().then(() => resize(true));
|
|
256
257
|
}
|
|
257
258
|
});
|
|
258
259
|
if (popup) {
|
|
@@ -261,7 +262,7 @@ const __sfc__ = defineComponent({
|
|
|
261
262
|
(show) => __async(null, null, function* () {
|
|
262
263
|
if (show) {
|
|
263
264
|
yield doubleRaf();
|
|
264
|
-
resize();
|
|
265
|
+
resize(true);
|
|
265
266
|
}
|
|
266
267
|
})
|
|
267
268
|
);
|
|
@@ -281,18 +282,32 @@ const __sfc__ = defineComponent({
|
|
|
281
282
|
function handleClick(e) {
|
|
282
283
|
call(props2.onClick, e);
|
|
283
284
|
}
|
|
284
|
-
function resize() {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
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
|
+
});
|
|
296
311
|
}
|
|
297
312
|
return {
|
|
298
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)
|