@varlet/ui 2.18.2 → 2.18.3-alpha.1699110299826
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/ActionSheet.mjs +2 -1
- package/es/action-sheet/index.mjs +2 -2
- package/es/avatar/Avatar.mjs +2 -1
- package/es/back-top/BackTop.mjs +2 -2
- package/es/bottom-navigation/BottomNavigation.mjs +2 -2
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +2 -1
- package/es/breadcrumb/Breadcrumb.mjs +2 -1
- package/es/button/Button.mjs +2 -2
- package/es/card/Card.mjs +2 -2
- package/es/cell/Cell.mjs +2 -1
- package/es/checkbox/Checkbox.mjs +3 -1
- package/es/checkbox-group/CheckboxGroup.mjs +2 -2
- package/es/chip/Chip.mjs +2 -1
- package/es/col/Col.mjs +2 -2
- package/es/collapse/Collapse.mjs +2 -2
- package/es/countdown/Countdown.mjs +2 -2
- package/es/counter/Counter.mjs +2 -2
- package/es/date-picker/DatePicker.mjs +2 -2
- package/es/dialog/Dialog.mjs +2 -1
- package/es/dialog/index.mjs +2 -2
- package/es/drag/Drag.mjs +2 -2
- package/es/ellipsis/Ellipsis.mjs +7 -6
- package/es/fab/Fab.mjs +3 -3
- package/es/field-decorator/FieldDecorator.mjs +2 -2
- package/es/floating-panel/FloatingPanel.mjs +3 -3
- package/es/form/Form.mjs +2 -2
- package/es/image/Image.mjs +2 -1
- package/es/image-preview/ImagePreview.mjs +2 -2
- package/es/image-preview/index.mjs +2 -2
- package/es/index-bar/IndexBar.mjs +4 -3
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +2 -2
- package/es/lazy/index.mjs +1 -2
- package/es/link/Link.mjs +2 -1
- package/es/list/List.mjs +2 -2
- package/es/loading/Loading.mjs +2 -1
- package/es/menu/usePopover.mjs +2 -3
- package/es/menu-select/MenuSelect.mjs +3 -1
- package/es/overlay/Overlay.mjs +2 -1
- package/es/pagination/Pagination.mjs +2 -2
- package/es/paper/Paper.mjs +2 -1
- package/es/picker/Picker.mjs +3 -3
- package/es/picker/index.mjs +2 -2
- package/es/popup/Popup.mjs +2 -1
- package/es/pull-refresh/PullRefresh.mjs +2 -2
- package/es/radio/Radio.mjs +3 -1
- package/es/radio-group/RadioGroup.mjs +2 -1
- package/es/rate/Rate.mjs +2 -2
- package/es/row/Row.mjs +2 -2
- package/es/select/Select.mjs +2 -2
- package/es/slider/Slider.mjs +2 -2
- package/es/snackbar/core.mjs +2 -1
- package/es/snackbar/index.mjs +2 -2
- package/es/space/Space.mjs +2 -2
- package/es/steps/Steps.mjs +2 -1
- package/es/sticky/Sticky.mjs +2 -2
- package/es/style-provider/StyleProvider.mjs +2 -1
- package/es/swipe/Swipe.mjs +2 -2
- package/es/switch/Switch.mjs +2 -1
- package/es/tab/Tab.mjs +2 -1
- package/es/tabs/Tabs.mjs +2 -2
- package/es/tabs-items/TabsItems.mjs +2 -2
- package/es/time-picker/TimePicker.mjs +2 -2
- package/es/uploader/Uploader.mjs +19 -6
- package/es/uploader/props.mjs +1 -0
- package/es/utils/components.mjs +2 -6
- package/es/varlet.esm.js +4125 -4112
- package/highlight/web-types.en-US.json +2 -2
- package/highlight/web-types.zh-CN.json +2 -2
- package/lib/varlet.cjs.js +29 -17
- package/package.json +7 -7
- package/umd/varlet.js +5 -5
package/es/picker/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import VarPicker from "./Picker.mjs";
|
|
2
2
|
import { nextTick, reactive } from "vue";
|
|
3
|
-
import { isArray } from "@varlet/shared";
|
|
4
|
-
import {
|
|
3
|
+
import { isArray, call } from "@varlet/shared";
|
|
4
|
+
import { mountInstance, withInstall } from "../utils/components.mjs";
|
|
5
5
|
let singletonOptions;
|
|
6
6
|
function Picker(options) {
|
|
7
7
|
return new Promise((resolve) => {
|
package/es/popup/Popup.mjs
CHANGED
|
@@ -19,9 +19,10 @@ import { defineComponent, watch, Transition, Teleport, computed } from "vue";
|
|
|
19
19
|
import { props } from "./props.mjs";
|
|
20
20
|
import { useLock } from "../context/lock.mjs";
|
|
21
21
|
import { useZIndex } from "../context/zIndex.mjs";
|
|
22
|
-
import { useRouteListener, useTeleport, createNamespace
|
|
22
|
+
import { useRouteListener, useTeleport, createNamespace } from "../utils/components.mjs";
|
|
23
23
|
import { usePopupItems } from "./provide.mjs";
|
|
24
24
|
import { useInitialized } from "@varlet/use";
|
|
25
|
+
import { call } from "@varlet/shared";
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
const {
|
|
@@ -22,8 +22,8 @@ import VarIcon from "../icon/index.mjs";
|
|
|
22
22
|
import { defineComponent, ref, computed, watch, nextTick } from "vue";
|
|
23
23
|
import { getParentScroller, getTarget } from "../utils/elements.mjs";
|
|
24
24
|
import { props } from "./props.mjs";
|
|
25
|
-
import { isNumber, isString, toNumber, getRect, preventDefault, getScrollTop } from "@varlet/shared";
|
|
26
|
-
import {
|
|
25
|
+
import { isNumber, isString, toNumber, getRect, preventDefault, getScrollTop, call } from "@varlet/shared";
|
|
26
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
27
27
|
import { useEventListener, onSmartMounted, useTouch } from "@varlet/use";
|
|
28
28
|
const { name, n, classes } = createNamespace("pull-refresh");
|
|
29
29
|
const ICON_TRANSITION = 150;
|
package/es/radio/Radio.mjs
CHANGED
|
@@ -5,9 +5,11 @@ import Hover from "../hover/index.mjs";
|
|
|
5
5
|
import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
|
|
6
6
|
import { computed, defineComponent, nextTick, ref } from "vue";
|
|
7
7
|
import { props } from "./props.mjs";
|
|
8
|
-
import { useValidation, createNamespace
|
|
8
|
+
import { useValidation, createNamespace } from "../utils/components.mjs";
|
|
9
9
|
import { useRadioGroup } from "./provide.mjs";
|
|
10
10
|
import { useForm } from "../form/provide.mjs";
|
|
11
|
+
import { call } from "@varlet/shared";
|
|
12
|
+
import { useVModel } from "@varlet/use";
|
|
11
13
|
const { name, n, classes } = createNamespace("radio");
|
|
12
14
|
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, createElementVNode as _createElementVNode, mergeProps as _mergeProps } from "vue";
|
|
13
15
|
function __render__(_ctx, _cache) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import VarFormDetails from "../form-details/index.mjs";
|
|
2
2
|
import { computed, defineComponent, nextTick, watch } from "vue";
|
|
3
3
|
import { props } from "./props.mjs";
|
|
4
|
-
import { useValidation, createNamespace
|
|
4
|
+
import { useValidation, createNamespace } from "../utils/components.mjs";
|
|
5
5
|
import { useRadios } from "./provide.mjs";
|
|
6
6
|
import { useForm } from "../form/provide.mjs";
|
|
7
|
+
import { call } from "@varlet/shared";
|
|
7
8
|
const { name, n, classes } = createNamespace("radio-group");
|
|
8
9
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
9
10
|
function __render__(_ctx, _cache) {
|
package/es/rate/Rate.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
|
|
|
5
5
|
import Hover from "../hover/index.mjs";
|
|
6
6
|
import { defineComponent, nextTick, ref } from "vue";
|
|
7
7
|
import { useForm } from "../form/provide.mjs";
|
|
8
|
-
import { useValidation,
|
|
8
|
+
import { useValidation, createNamespace } from "../utils/components.mjs";
|
|
9
9
|
import { toSizeUnit } from "../utils/elements.mjs";
|
|
10
|
-
import { toNumber } from "@varlet/shared";
|
|
10
|
+
import { toNumber, call } from "@varlet/shared";
|
|
11
11
|
import { props } from "./props.mjs";
|
|
12
12
|
const { name, n } = createNamespace("rate");
|
|
13
13
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createVNode as _createVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
package/es/row/Row.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent, computed, watch } from "vue";
|
|
2
2
|
import { props } from "./props.mjs";
|
|
3
|
-
import { isArray } from "@varlet/shared";
|
|
3
|
+
import { isArray, call } from "@varlet/shared";
|
|
4
4
|
import { useCols } from "./provide.mjs";
|
|
5
5
|
import { toPxNum, padStartFlex } from "../utils/elements.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
7
7
|
const { name, n, classes } = createNamespace("row");
|
|
8
8
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
9
9
|
function __render__(_ctx, _cache) {
|
package/es/select/Select.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import VarChip from "../chip/index.mjs";
|
|
|
4
4
|
import VarFieldDecorator from "../field-decorator/index.mjs";
|
|
5
5
|
import VarFormDetails from "../form-details/index.mjs";
|
|
6
6
|
import { computed, defineComponent, ref, watch, nextTick } from "vue";
|
|
7
|
-
import { isArray, isEmpty } from "@varlet/shared";
|
|
7
|
+
import { isArray, isEmpty, call } from "@varlet/shared";
|
|
8
8
|
import { props } from "./props.mjs";
|
|
9
|
-
import { useValidation, createNamespace
|
|
9
|
+
import { useValidation, createNamespace } from "../utils/components.mjs";
|
|
10
10
|
import { useOptions } from "./provide.mjs";
|
|
11
11
|
import { useForm } from "../form/provide.mjs";
|
|
12
12
|
import { toPxNum } from "../utils/elements.mjs";
|
package/es/slider/Slider.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import VarFormDetails from "../form-details/index.mjs";
|
|
|
2
2
|
import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
|
|
3
3
|
import Hover from "../hover/index.mjs";
|
|
4
4
|
import { defineComponent, ref, onBeforeUnmount, computed, reactive, nextTick, watch, unref } from "vue";
|
|
5
|
-
import { useValidation, createNamespace
|
|
5
|
+
import { useValidation, createNamespace } from "../utils/components.mjs";
|
|
6
6
|
import { useForm } from "../form/provide.mjs";
|
|
7
7
|
import { getLeft, multiplySizeUnit } from "../utils/elements.mjs";
|
|
8
8
|
import { warn } from "../utils/logger.mjs";
|
|
9
|
-
import { isArray, isNumber, toNumber, getRect, preventDefault } from "@varlet/shared";
|
|
9
|
+
import { isArray, isNumber, toNumber, getRect, preventDefault, call } from "@varlet/shared";
|
|
10
10
|
import { props, Thumbs } from "./props.mjs";
|
|
11
11
|
import { onSmartMounted } from "@varlet/use";
|
|
12
12
|
const { name, n, classes } = createNamespace("slider");
|
package/es/snackbar/core.mjs
CHANGED
|
@@ -5,8 +5,9 @@ import { useZIndex } from "../context/zIndex.mjs";
|
|
|
5
5
|
import { props } from "./props.mjs";
|
|
6
6
|
import { useLock } from "../context/lock.mjs";
|
|
7
7
|
import { SNACKBAR_TYPE } from "./index.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
9
9
|
import { onSmartMounted } from "@varlet/use";
|
|
10
|
+
import { call } from "@varlet/shared";
|
|
10
11
|
const { n, classes } = createNamespace("snackbar");
|
|
11
12
|
const ICON_TYPE_DICT = {
|
|
12
13
|
success: "checkbox-marked-circle",
|
package/es/snackbar/index.mjs
CHANGED
|
@@ -19,8 +19,8 @@ import VarSnackbarCore from "./core.mjs";
|
|
|
19
19
|
import VarSnackbar from "./Snackbar.mjs";
|
|
20
20
|
import context from "../context/index.mjs";
|
|
21
21
|
import { reactive, TransitionGroup } from "vue";
|
|
22
|
-
import {
|
|
23
|
-
import { isFunction, isPlainObject, isString, toNumber } from "@varlet/shared";
|
|
22
|
+
import { mountInstance, withInstall } from "../utils/components.mjs";
|
|
23
|
+
import { isFunction, isPlainObject, isString, toNumber, call } from "@varlet/shared";
|
|
24
24
|
const SNACKBAR_TYPE = ["loading", "success", "warning", "info", "error"];
|
|
25
25
|
let sid = 0;
|
|
26
26
|
let isMount = false;
|
package/es/space/Space.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
2
|
import { defineComponent } from "vue";
|
|
3
3
|
import { props } from "./props.mjs";
|
|
4
|
-
import { isArray } from "@varlet/shared";
|
|
5
|
-
import {
|
|
4
|
+
import { isArray, call } from "@varlet/shared";
|
|
5
|
+
import { createNamespace, flatFragment } from "../utils/components.mjs";
|
|
6
6
|
import { padStartFlex, toSizeUnit } from "../utils/elements.mjs";
|
|
7
7
|
import { computeMargin } from "./margin.mjs";
|
|
8
8
|
|
package/es/steps/Steps.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { computed, defineComponent } from "vue";
|
|
2
2
|
import { useStep } from "./provide.mjs";
|
|
3
3
|
import { props } from "./props.mjs";
|
|
4
|
-
import { createNamespace
|
|
4
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
5
|
+
import { call } from "@varlet/shared";
|
|
5
6
|
const { name, n } = createNamespace("steps");
|
|
6
7
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
7
8
|
function __render__(_ctx, _cache) {
|
package/es/sticky/Sticky.mjs
CHANGED
|
@@ -21,8 +21,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21
21
|
import { defineComponent, ref, computed, watch } from "vue";
|
|
22
22
|
import { props } from "./props.mjs";
|
|
23
23
|
import { getParentScroller, toPxNum } from "../utils/elements.mjs";
|
|
24
|
-
import { toNumber, raf, doubleRaf, getRect } from "@varlet/shared";
|
|
25
|
-
import {
|
|
24
|
+
import { toNumber, raf, doubleRaf, getRect, call } from "@varlet/shared";
|
|
25
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
26
26
|
import { useEventListener, onSmartMounted, onWindowResize, onSmartUnmounted } from "@varlet/use";
|
|
27
27
|
const { name, n, classes } = createNamespace("sticky");
|
|
28
28
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent, h } from "vue";
|
|
2
2
|
import { formatStyleVars } from "../utils/elements.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
4
4
|
import { props } from "./props.mjs";
|
|
5
|
+
import { call } from "@varlet/shared";
|
|
5
6
|
const { name, n } = createNamespace("style-provider");
|
|
6
7
|
const __sfc__ = defineComponent({
|
|
7
8
|
name,
|
package/es/swipe/Swipe.mjs
CHANGED
|
@@ -24,8 +24,8 @@ import Hover from "../hover/index.mjs";
|
|
|
24
24
|
import { defineComponent, ref, computed, watch, onActivated } from "vue";
|
|
25
25
|
import { useSwipeItems } from "./provide.mjs";
|
|
26
26
|
import { props } from "./props.mjs";
|
|
27
|
-
import { clamp, isNumber, toNumber, doubleRaf, preventDefault } from "@varlet/shared";
|
|
28
|
-
import {
|
|
27
|
+
import { clamp, isNumber, toNumber, doubleRaf, preventDefault, call } from "@varlet/shared";
|
|
28
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
29
29
|
import { onSmartUnmounted, onWindowResize, useTouch } from "@varlet/use";
|
|
30
30
|
import { usePopup } from "../popup/provide.mjs";
|
|
31
31
|
const SWIPE_DELAY = 250;
|
package/es/switch/Switch.mjs
CHANGED
|
@@ -3,10 +3,11 @@ import Ripple from "../ripple/index.mjs";
|
|
|
3
3
|
import Hover from "../hover/index.mjs";
|
|
4
4
|
import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
|
|
5
5
|
import { defineComponent, computed, nextTick } from "vue";
|
|
6
|
-
import { useValidation, createNamespace
|
|
6
|
+
import { useValidation, createNamespace } from "../utils/components.mjs";
|
|
7
7
|
import { multiplySizeUnit } from "../utils/elements.mjs";
|
|
8
8
|
import { useForm } from "../form/provide.mjs";
|
|
9
9
|
import { props } from "./props.mjs";
|
|
10
|
+
import { call } from "@varlet/shared";
|
|
10
11
|
const { name, n, classes } = createNamespace("switch");
|
|
11
12
|
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";
|
|
12
13
|
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
package/es/tab/Tab.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Ripple from "../ripple/index.mjs";
|
|
2
2
|
import { defineComponent, ref, computed, watch } from "vue";
|
|
3
3
|
import { props } from "./props.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
5
5
|
import { useTabs } from "./provide.mjs";
|
|
6
|
+
import { call } from "@varlet/shared";
|
|
6
7
|
const { name, n, classes } = createNamespace("tab");
|
|
7
8
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from "vue";
|
|
8
9
|
function __render__(_ctx, _cache) {
|
package/es/tabs/Tabs.mjs
CHANGED
|
@@ -22,10 +22,10 @@ import VarSticky from "../sticky/index.mjs";
|
|
|
22
22
|
import { defineComponent, watch, ref, computed, Transition, onActivated } from "vue";
|
|
23
23
|
import { props } from "./props.mjs";
|
|
24
24
|
import { useTabList } from "./provide.mjs";
|
|
25
|
-
import { clamp, isNumber, doubleRaf } from "@varlet/shared";
|
|
25
|
+
import { clamp, isNumber, doubleRaf, call } from "@varlet/shared";
|
|
26
26
|
import { linear } from "../utils/shared.mjs";
|
|
27
27
|
import { toSizeUnit, scrollTo } from "../utils/elements.mjs";
|
|
28
|
-
import { createNamespace,
|
|
28
|
+
import { createNamespace, formatElevation } from "../utils/components.mjs";
|
|
29
29
|
import { onWindowResize } from "@varlet/use";
|
|
30
30
|
const { name, n, classes } = createNamespace("tabs");
|
|
31
31
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
@@ -21,9 +21,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21
21
|
import VarSwipe from "../swipe/index.mjs";
|
|
22
22
|
import { defineComponent, watch, ref } from "vue";
|
|
23
23
|
import { useTabItem } from "./provide.mjs";
|
|
24
|
-
import {
|
|
24
|
+
import { createNamespace } from "../utils/components.mjs";
|
|
25
25
|
import { props } from "./props.mjs";
|
|
26
|
-
import { doubleRaf } from "@varlet/shared";
|
|
26
|
+
import { doubleRaf, call } from "@varlet/shared";
|
|
27
27
|
const { name, n } = createNamespace("tabs-items");
|
|
28
28
|
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
29
29
|
function __render__(_ctx, _cache) {
|
|
@@ -2,8 +2,8 @@ import dayjs from "dayjs/esm";
|
|
|
2
2
|
import Clock from "./clock.mjs";
|
|
3
3
|
import { computed, defineComponent, reactive, ref, watch } from "vue";
|
|
4
4
|
import { props, hoursAmpm, hours24 } from "./props.mjs";
|
|
5
|
-
import { toNumber, getRect, preventDefault } from "@varlet/shared";
|
|
6
|
-
import { createNamespace,
|
|
5
|
+
import { toNumber, getRect, preventDefault, call } from "@varlet/shared";
|
|
6
|
+
import { createNamespace, formatElevation } from "../utils/components.mjs";
|
|
7
7
|
import { padStart } from "../utils/shared.mjs";
|
|
8
8
|
import { getNumberTime, getIsDisableMinute, getIsDisableSecond } from "./utils.mjs";
|
|
9
9
|
import { pack } from "../locale/index.mjs";
|
package/es/uploader/Uploader.mjs
CHANGED
|
@@ -27,9 +27,9 @@ import Ripple from "../ripple/index.mjs";
|
|
|
27
27
|
import Hover from "../hover/index.mjs";
|
|
28
28
|
import { defineComponent, nextTick, reactive, computed, watch, ref } from "vue";
|
|
29
29
|
import { props } from "./props.mjs";
|
|
30
|
-
import { isNumber, toNumber, normalizeToArray, toDataURL } from "@varlet/shared";
|
|
30
|
+
import { isNumber, toNumber, normalizeToArray, toDataURL, call } from "@varlet/shared";
|
|
31
31
|
import { isHTMLSupportImage, isHTMLSupportVideo } from "../utils/shared.mjs";
|
|
32
|
-
import {
|
|
32
|
+
import { useValidation, createNamespace, formatElevation } from "../utils/components.mjs";
|
|
33
33
|
import { useForm } from "../form/provide.mjs";
|
|
34
34
|
import { toSizeUnit } from "../utils/elements.mjs";
|
|
35
35
|
const { name, n, classes } = createNamespace("uploader");
|
|
@@ -135,7 +135,7 @@ function __render__(_ctx, _cache) {
|
|
|
135
135
|
[_ctx.disabled || _ctx.formDisabled, _ctx.n("--disabled")]
|
|
136
136
|
)
|
|
137
137
|
),
|
|
138
|
-
onClick: _cache[
|
|
138
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleActionClick && _ctx.handleActionClick(...args))
|
|
139
139
|
},
|
|
140
140
|
[
|
|
141
141
|
_createElementVNode("input", {
|
|
@@ -146,7 +146,9 @@ function __render__(_ctx, _cache) {
|
|
|
146
146
|
accept: _ctx.accept,
|
|
147
147
|
capture: _ctx.capture,
|
|
148
148
|
disabled: _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly,
|
|
149
|
-
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
|
|
149
|
+
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.handleChange && _ctx.handleChange(...args)),
|
|
150
|
+
onClick: _cache[1] || (_cache[1] = _withModifiers(() => {
|
|
151
|
+
}, ["stop"]))
|
|
150
152
|
}, null, 42, _hoisted_4),
|
|
151
153
|
_renderSlot(_ctx.$slots, "default", {}, () => [
|
|
152
154
|
_createVNode(_component_var_icon, {
|
|
@@ -191,8 +193,8 @@ function __render__(_ctx, _cache) {
|
|
|
191
193
|
"var-uploader-cover": "",
|
|
192
194
|
position: "center",
|
|
193
195
|
show: _ctx.showPreview,
|
|
194
|
-
"onUpdate:show": _cache[
|
|
195
|
-
onClosed: _cache[
|
|
196
|
+
"onUpdate:show": _cache[3] || (_cache[3] = ($event) => _ctx.showPreview = $event),
|
|
197
|
+
onClosed: _cache[4] || (_cache[4] = ($event) => _ctx.currentPreview = null)
|
|
196
198
|
}, {
|
|
197
199
|
default: _withCtx(() => {
|
|
198
200
|
var _a, _b;
|
|
@@ -402,6 +404,16 @@ const __sfc__ = defineComponent({
|
|
|
402
404
|
call(props2["onUpdate:modelValue"], expectedFiles);
|
|
403
405
|
});
|
|
404
406
|
}
|
|
407
|
+
function handleActionClick(event) {
|
|
408
|
+
if ((form == null ? void 0 : form.disabled.value) || props2.disabled) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
if (props2.onClickAction) {
|
|
412
|
+
call(props2.onClickAction, chooseFile, event);
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
chooseFile();
|
|
416
|
+
}
|
|
405
417
|
function getSuccess() {
|
|
406
418
|
return props2.modelValue.filter((varFile) => varFile.state === "success");
|
|
407
419
|
}
|
|
@@ -461,6 +473,7 @@ const __sfc__ = defineComponent({
|
|
|
461
473
|
reset,
|
|
462
474
|
chooseFile,
|
|
463
475
|
closePreview,
|
|
476
|
+
handleActionClick,
|
|
464
477
|
toSizeUnit
|
|
465
478
|
};
|
|
466
479
|
}
|
package/es/uploader/props.mjs
CHANGED
package/es/utils/components.mjs
CHANGED
|
@@ -34,7 +34,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
34
34
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
import { useEventListener
|
|
37
|
+
import { useEventListener } from "@varlet/use";
|
|
38
38
|
import {
|
|
39
39
|
createApp,
|
|
40
40
|
h,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
Comment,
|
|
45
45
|
Fragment
|
|
46
46
|
} from "vue";
|
|
47
|
-
import {
|
|
47
|
+
import { createNamespaceFn, isArray } from "@varlet/shared";
|
|
48
48
|
function pickProps(props, propsKey) {
|
|
49
49
|
return Array.isArray(propsKey) ? propsKey.reduce((pickedProps, key) => {
|
|
50
50
|
pickedProps[key] = props[key];
|
|
@@ -146,8 +146,6 @@ function useTeleport() {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
const createNamespace = createNamespaceFn("var");
|
|
149
|
-
const call = _call;
|
|
150
|
-
const useVModel = _useVModel;
|
|
151
149
|
function defineListenerProp(fallback) {
|
|
152
150
|
return {
|
|
153
151
|
type: [Function, Array],
|
|
@@ -164,7 +162,6 @@ function formatElevation(elevation, defaultLevel) {
|
|
|
164
162
|
return `var-elevation--${elevation}`;
|
|
165
163
|
}
|
|
166
164
|
export {
|
|
167
|
-
call,
|
|
168
165
|
createNamespace,
|
|
169
166
|
defineListenerProp,
|
|
170
167
|
flatFragment,
|
|
@@ -174,7 +171,6 @@ export {
|
|
|
174
171
|
pickProps,
|
|
175
172
|
useRouteListener,
|
|
176
173
|
useTeleport,
|
|
177
|
-
useVModel,
|
|
178
174
|
useValidation,
|
|
179
175
|
withInstall
|
|
180
176
|
};
|