@varlet/ui 3.8.2 → 3.8.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/es/action-sheet/ActionItem.mjs +4 -4
- package/es/action-sheet/ActionSheet.mjs +9 -9
- package/es/action-sheet/index.mjs +2 -2
- package/es/action-sheet/props.mjs +1 -1
- package/es/action-sheet/style/index.mjs +1 -1
- package/es/alert/Alert.mjs +3 -3
- package/es/alert/index.mjs +1 -1
- package/es/app-bar/AppBar.mjs +5 -5
- package/es/app-bar/index.mjs +1 -1
- package/es/auto-complete/AutoComplete.mjs +23 -27
- package/es/auto-complete/index.mjs +1 -1
- package/es/auto-complete/props.mjs +1 -1
- package/es/avatar/Avatar.mjs +5 -5
- package/es/avatar/index.mjs +1 -1
- package/es/avatar-group/AvatarGroup.mjs +2 -2
- package/es/avatar-group/index.mjs +1 -1
- package/es/back-top/BackTop.mjs +7 -7
- package/es/back-top/index.mjs +1 -1
- package/es/badge/Badge.mjs +3 -3
- package/es/badge/index.mjs +1 -1
- package/es/badge/props.mjs +1 -1
- package/es/bottom-navigation/BottomNavigation.mjs +8 -9
- package/es/bottom-navigation/index.mjs +1 -1
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +4 -4
- package/es/bottom-navigation-item/index.mjs +1 -1
- package/es/bottom-navigation-item/provide.mjs +1 -1
- package/es/breadcrumb/Breadcrumb.mjs +3 -3
- package/es/breadcrumb/index.mjs +1 -1
- package/es/breadcrumb/provide.mjs +1 -1
- package/es/breadcrumbs/Breadcrumbs.mjs +2 -2
- package/es/breadcrumbs/index.mjs +1 -1
- package/es/button/Button.mjs +6 -6
- package/es/button/index.mjs +1 -1
- package/es/button-group/ButtonGroup.mjs +1 -1
- package/es/button-group/index.mjs +1 -1
- package/es/card/Card.mjs +39 -39
- package/es/card/index.mjs +1 -1
- package/es/cell/Cell.mjs +3 -3
- package/es/cell/index.mjs +1 -1
- package/es/cell/props.mjs +1 -1
- package/es/checkbox/Checkbox.mjs +7 -7
- package/es/checkbox/index.mjs +1 -1
- package/es/checkbox-group/CheckboxGroup.mjs +5 -5
- package/es/checkbox-group/index.mjs +1 -1
- package/es/chip/Chip.mjs +4 -4
- package/es/chip/index.mjs +1 -1
- package/es/chip/props.mjs +1 -1
- package/es/code/Code.mjs +1 -1
- package/es/code/index.mjs +1 -1
- package/es/col/Col.mjs +4 -4
- package/es/col/index.mjs +1 -1
- package/es/collapse/Collapse.mjs +6 -4
- package/es/collapse/index.mjs +1 -1
- package/es/collapse-item/CollapseItem.mjs +4 -4
- package/es/collapse-item/index.mjs +1 -1
- package/es/collapse-item/provide.mjs +1 -1
- package/es/collapse-transition/CollapseTransition.mjs +2 -2
- package/es/collapse-transition/index.mjs +1 -1
- package/es/collapse-transition/useCollapseTransition.mjs +1 -1
- package/es/context/lock.mjs +1 -1
- package/es/context/stack.mjs +1 -1
- package/es/context/zIndex.mjs +1 -1
- package/es/count-to/CountTo.mjs +4 -4
- package/es/count-to/index.mjs +1 -1
- package/es/countdown/Countdown.mjs +2 -2
- package/es/countdown/index.mjs +1 -1
- package/es/counter/Counter.mjs +8 -8
- package/es/counter/index.mjs +1 -1
- package/es/date-picker/DatePicker.mjs +92 -43
- package/es/date-picker/index.mjs +1 -1
- package/es/date-picker/src/day-picker-panel.mjs +59 -27
- package/es/date-picker/src/month-picker-panel.mjs +57 -23
- package/es/date-picker/src/panel-header.mjs +12 -6
- package/es/date-picker/src/year-picker-panel.mjs +53 -23
- package/es/dialog/Dialog.mjs +5 -5
- package/es/dialog/index.mjs +3 -3
- package/es/dialog/props.mjs +1 -1
- package/es/divider/Divider.mjs +4 -4
- package/es/divider/index.mjs +1 -1
- package/es/drag/Drag.mjs +21 -42
- package/es/drag/index.mjs +1 -1
- package/es/ellipsis/Ellipsis.mjs +2 -2
- package/es/ellipsis/index.mjs +1 -1
- package/es/fab/Fab.mjs +4 -5
- package/es/fab/index.mjs +1 -1
- package/es/fab/props.mjs +1 -1
- package/es/field-decorator/FieldDecorator.mjs +5 -5
- package/es/field-decorator/index.mjs +1 -1
- package/es/floating-panel/FloatingPanel.mjs +6 -6
- package/es/floating-panel/index.mjs +1 -1
- package/es/form/Form.mjs +4 -4
- package/es/form/index.mjs +2 -2
- package/es/form/provide.mjs +1 -1
- package/es/form-details/index.mjs +1 -1
- package/es/highlighter-provider/HighlighterProvider.mjs +2 -2
- package/es/highlighter-provider/index.mjs +1 -1
- package/es/highlighter-provider/provide.mjs +1 -1
- package/es/hover/index.mjs +12 -7
- package/es/hover-overlay/HoverOverlay.mjs +2 -2
- package/es/hover-overlay/index.mjs +2 -2
- package/es/icon/Icon.mjs +3 -3
- package/es/icon/index.mjs +1 -1
- package/es/image/Image.mjs +5 -5
- package/es/image/index.mjs +1 -1
- package/es/image-preview/ImagePreview.mjs +13 -14
- package/es/image-preview/index.mjs +2 -2
- package/es/image-preview/props.mjs +2 -2
- package/es/index-anchor/IndexAnchor.mjs +5 -5
- package/es/index-anchor/index.mjs +1 -1
- package/es/index-anchor/provide.mjs +1 -1
- package/es/index-bar/IndexBar.mjs +17 -13
- package/es/index-bar/index.mjs +1 -1
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +12 -12
- package/es/input/index.mjs +1 -1
- package/es/input/props.mjs +1 -1
- package/es/lazy/index.mjs +1 -1
- package/es/link/Link.mjs +2 -2
- package/es/link/index.mjs +1 -1
- package/es/list/List.mjs +10 -10
- package/es/list/index.mjs +1 -1
- package/es/list/provide.mjs +1 -1
- package/es/loading/Loading.mjs +2 -2
- package/es/loading/index.mjs +1 -1
- package/es/loading-bar/LoadingBar.mjs +1 -2
- package/es/loading-bar/index.mjs +1 -1
- package/es/locale/index.mjs +5 -5
- package/es/locale-provider/LocaleProvider.mjs +11 -8
- package/es/locale-provider/index.mjs +1 -1
- package/es/locale-provider/provide.mjs +1 -1
- package/es/menu/Menu.mjs +2 -2
- package/es/menu/index.mjs +1 -1
- package/es/menu/usePopover.mjs +6 -6
- package/es/menu-option/MenuOption.mjs +9 -9
- package/es/menu-option/index.mjs +1 -1
- package/es/menu-option/provide.mjs +1 -1
- package/es/menu-select/MenuChildren.mjs +21 -21
- package/es/menu-select/MenuSelect.mjs +9 -9
- package/es/menu-select/index.mjs +1 -1
- package/es/option/Option.mjs +5 -5
- package/es/option/index.mjs +1 -1
- package/es/option/provide.mjs +1 -1
- package/es/overlay/Overlay.mjs +4 -4
- package/es/overlay/index.mjs +1 -1
- package/es/pagination/Pagination.mjs +26 -18
- package/es/pagination/index.mjs +1 -1
- package/es/paper/Paper.mjs +3 -3
- package/es/paper/index.mjs +1 -1
- package/es/picker/Picker.mjs +9 -9
- package/es/picker/index.mjs +2 -2
- package/es/picker/props.mjs +1 -1
- package/es/popup/Popup.mjs +6 -6
- package/es/popup/index.mjs +1 -1
- package/es/progress/Progress.mjs +4 -4
- package/es/progress/index.mjs +1 -1
- package/es/pull-refresh/PullRefresh.mjs +10 -12
- package/es/pull-refresh/index.mjs +1 -1
- package/es/radio/Radio.mjs +10 -9
- package/es/radio/index.mjs +1 -1
- package/es/radio-group/RadioGroup.mjs +7 -6
- package/es/radio-group/index.mjs +1 -1
- package/es/rate/Rate.mjs +8 -8
- package/es/rate/index.mjs +1 -1
- package/es/rate/props.mjs +1 -1
- package/es/result/Result.mjs +7 -7
- package/es/result/index.mjs +1 -1
- package/es/ripple/index.mjs +1 -1
- package/es/row/Row.mjs +4 -4
- package/es/row/index.mjs +1 -1
- package/es/select/Select.mjs +13 -13
- package/es/select/index.mjs +1 -1
- package/es/select/props.mjs +1 -1
- package/es/skeleton/Skeleton.mjs +3 -3
- package/es/skeleton/index.mjs +1 -1
- package/es/slider/Slider.mjs +9 -9
- package/es/slider/index.mjs +1 -1
- package/es/snackbar/Snackbar.mjs +1 -1
- package/es/snackbar/core.mjs +8 -8
- package/es/snackbar/index.mjs +9 -8
- package/es/snackbar/props.mjs +1 -1
- package/es/space/Space.mjs +2 -2
- package/es/space/index.mjs +1 -1
- package/es/step/Step.mjs +3 -3
- package/es/step/index.mjs +1 -1
- package/es/step/provide.mjs +1 -1
- package/es/steps/Steps.mjs +3 -3
- package/es/steps/index.mjs +1 -1
- package/es/sticky/Sticky.mjs +7 -7
- package/es/sticky/index.mjs +1 -1
- package/es/style-provider/StyleProvider.mjs +2 -2
- package/es/style-provider/index.mjs +2 -2
- package/es/swipe/Swipe.mjs +10 -10
- package/es/swipe/index.mjs +1 -1
- package/es/swipe-item/SwipeItem.mjs +1 -1
- package/es/swipe-item/index.mjs +1 -1
- package/es/swipe-item/provide.mjs +1 -1
- package/es/switch/Switch.mjs +6 -6
- package/es/switch/index.mjs +1 -1
- package/es/tab/Tab.mjs +4 -4
- package/es/tab/index.mjs +1 -1
- package/es/tab/provide.mjs +1 -1
- package/es/tab-item/TabItem.mjs +3 -3
- package/es/tab-item/index.mjs +1 -1
- package/es/tab-item/provide.mjs +1 -1
- package/es/table/Table.mjs +1 -1
- package/es/table/index.mjs +1 -1
- package/es/tabs/Tabs.mjs +9 -7
- package/es/tabs/index.mjs +1 -1
- package/es/tabs/props.mjs +1 -1
- package/es/tabs-items/TabsItems.mjs +4 -4
- package/es/tabs-items/index.mjs +1 -1
- package/es/themes/dark/index.mjs +33 -33
- package/es/themes/index.mjs +1 -1
- package/es/themes/md3-dark/index.mjs +45 -45
- package/es/themes/md3-light/index.mjs +39 -39
- package/es/time-picker/TimePicker.mjs +48 -24
- package/es/time-picker/clock.mjs +41 -19
- package/es/time-picker/index.mjs +1 -1
- package/es/time-picker/utils.mjs +13 -5
- package/es/tooltip/Tooltip.mjs +2 -2
- package/es/tooltip/index.mjs +1 -1
- package/es/uploader/Uploader.mjs +14 -14
- package/es/uploader/index.mjs +1 -1
- package/es/utils/components.mjs +5 -5
- package/es/utils/elements.mjs +9 -9
- package/es/utils/test.mjs +1 -1
- package/es/varlet.esm.js +20946 -20941
- package/es/watermark/Watermark.mjs +15 -17
- package/es/watermark/index.mjs +1 -1
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/varlet.cjs.js +25205 -25003
- package/package.json +34 -34
- package/types/actionSheet.d.ts +2 -2
- package/types/alert.d.ts +1 -1
- package/types/appBar.d.ts +1 -1
- package/types/autoComplete.d.ts +4 -4
- package/types/avatar.d.ts +1 -1
- package/types/avatarGroup.d.ts +1 -1
- package/types/backTop.d.ts +1 -1
- package/types/badge.d.ts +1 -1
- package/types/bottomNavigation.d.ts +2 -2
- package/types/bottomNavigationItem.d.ts +2 -2
- package/types/breadcrumb.d.ts +1 -1
- package/types/breadcrumbs.d.ts +1 -1
- package/types/button.d.ts +5 -5
- package/types/buttonGroup.d.ts +2 -2
- package/types/card.d.ts +1 -1
- package/types/cell.d.ts +1 -1
- package/types/checkbox.d.ts +1 -1
- package/types/checkboxGroup.d.ts +2 -2
- package/types/chip.d.ts +3 -3
- package/types/code.d.ts +1 -1
- package/types/col.d.ts +1 -1
- package/types/collapse.d.ts +1 -1
- package/types/collapseItem.d.ts +1 -1
- package/types/collapseTransition.d.ts +1 -1
- package/types/countTo.d.ts +1 -1
- package/types/countdown.d.ts +1 -1
- package/types/counter.d.ts +1 -1
- package/types/datePicker.d.ts +1 -1
- package/types/dialog.d.ts +1 -1
- package/types/divider.d.ts +1 -1
- package/types/drag.d.ts +1 -1
- package/types/ellipsis.d.ts +1 -1
- package/types/fab.d.ts +2 -2
- package/types/floatingPanel.d.ts +2 -2
- package/types/form.d.ts +1 -1
- package/types/formDetails.d.ts +1 -1
- package/types/highlighterProvider.d.ts +1 -1
- package/types/hover.d.ts +1 -1
- package/types/hoverOverlay.d.ts +1 -1
- package/types/icon.d.ts +1 -1
- package/types/image.d.ts +2 -2
- package/types/imagePreview.d.ts +2 -2
- package/types/indexAnchor.d.ts +1 -1
- package/types/indexBar.d.ts +1 -1
- package/types/input.d.ts +4 -4
- package/types/link.d.ts +1 -1
- package/types/list.d.ts +1 -1
- package/types/loading.d.ts +1 -1
- package/types/localeProvider.d.ts +2 -2
- package/types/menu.d.ts +2 -2
- package/types/menuOption.d.ts +1 -1
- package/types/menuSelect.d.ts +2 -2
- package/types/option.d.ts +1 -1
- package/types/overlay.d.ts +2 -2
- package/types/pagination.d.ts +1 -1
- package/types/paper.d.ts +1 -1
- package/types/picker.d.ts +3 -3
- package/types/popup.d.ts +2 -2
- package/types/progress.d.ts +1 -1
- package/types/pullRefresh.d.ts +1 -1
- package/types/radio.d.ts +1 -1
- package/types/radioGroup.d.ts +3 -3
- package/types/rate.d.ts +1 -1
- package/types/result.d.ts +1 -1
- package/types/row.d.ts +1 -1
- package/types/select.d.ts +3 -3
- package/types/skeleton.d.ts +1 -1
- package/types/slider.d.ts +4 -4
- package/types/snackbar.d.ts +2 -2
- package/types/space.d.ts +1 -1
- package/types/step.d.ts +1 -1
- package/types/steps.d.ts +3 -3
- package/types/sticky.d.ts +1 -1
- package/types/styleProvider.d.ts +2 -2
- package/types/swipe.d.ts +1 -1
- package/types/swipeItem.d.ts +1 -1
- package/types/switch.d.ts +1 -1
- package/types/tab.d.ts +1 -1
- package/types/tabItem.d.ts +1 -1
- package/types/table.d.ts +1 -1
- package/types/tabs.d.ts +3 -3
- package/types/tabsItems.d.ts +2 -2
- package/types/timePicker.d.ts +1 -1
- package/types/tooltip.d.ts +2 -2
- package/types/uploader.d.ts +2 -2
- package/types/watermark.d.ts +1 -1
- package/umd/varlet.js +7 -7
package/es/time-picker/clock.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import dayjs from "dayjs/esm/index.js";
|
|
2
1
|
import { computed, defineComponent, ref, watch } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { toNumber, getRect } from "@varlet/shared";
|
|
2
|
+
import { getRect, toNumber } from "@varlet/shared";
|
|
3
|
+
import dayjs from "dayjs/esm/index.js";
|
|
6
4
|
import { createNamespace } from "../utils/components.mjs";
|
|
7
5
|
import { padStart } from "../utils/shared.mjs";
|
|
6
|
+
import { hours24, hoursAmpm, minSec } from "./props.mjs";
|
|
7
|
+
import { convertHour, getIsDisableMinute, getIsDisableSecond, getNumberTime, notConvert } from "./utils.mjs";
|
|
8
8
|
const { n, classes } = createNamespace("time-picker");
|
|
9
9
|
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode } from "vue";
|
|
10
10
|
function __render__(_ctx, _cache) {
|
|
@@ -31,6 +31,7 @@ function __render__(_ctx, _cache) {
|
|
|
31
31
|
return _openBlock(), _createElementBlock(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
+
key: timeScale,
|
|
34
35
|
class: _normalizeClass(
|
|
35
36
|
_ctx.classes(
|
|
36
37
|
_ctx.n("clock-item"),
|
|
@@ -38,7 +39,6 @@ function __render__(_ctx, _cache) {
|
|
|
38
39
|
[_ctx.isDisable(timeScale), _ctx.n("clock-item--disable")]
|
|
39
40
|
)
|
|
40
41
|
),
|
|
41
|
-
key: timeScale,
|
|
42
42
|
style: _normalizeStyle(_ctx.getStyle(index, timeScale, false))
|
|
43
43
|
},
|
|
44
44
|
_toDisplayString(timeScale),
|
|
@@ -53,8 +53,8 @@ function __render__(_ctx, _cache) {
|
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
key: 0,
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
ref: "inner",
|
|
57
|
+
class: _normalizeClass(_ctx.n("clock-inner"))
|
|
58
58
|
},
|
|
59
59
|
[
|
|
60
60
|
(_openBlock(true), _createElementBlock(
|
|
@@ -64,6 +64,7 @@ function __render__(_ctx, _cache) {
|
|
|
64
64
|
return _openBlock(), _createElementBlock(
|
|
65
65
|
"div",
|
|
66
66
|
{
|
|
67
|
+
key: hour,
|
|
67
68
|
class: _normalizeClass(
|
|
68
69
|
_ctx.classes(
|
|
69
70
|
_ctx.n("clock-item"),
|
|
@@ -71,7 +72,6 @@ function __render__(_ctx, _cache) {
|
|
|
71
72
|
[_ctx.isDisable(hour), _ctx.n("clock-item--disable")]
|
|
72
73
|
)
|
|
73
74
|
),
|
|
74
|
-
key: hour,
|
|
75
75
|
style: _normalizeStyle(_ctx.getStyle(index, hour, true))
|
|
76
76
|
},
|
|
77
77
|
_toDisplayString(hour),
|
|
@@ -148,12 +148,16 @@ const __sfc__ = defineComponent({
|
|
|
148
148
|
borderColor: getHandleColor()
|
|
149
149
|
}));
|
|
150
150
|
const activeItemIndex = computed(() => {
|
|
151
|
-
if (props.rad === void 0)
|
|
151
|
+
if (props.rad === void 0) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
152
154
|
const value = props.rad / 30;
|
|
153
155
|
return value >= 0 ? value : value + 12;
|
|
154
156
|
});
|
|
155
157
|
const timeScales = computed(() => {
|
|
156
|
-
if (props.type === "hour")
|
|
158
|
+
if (props.type === "hour") {
|
|
159
|
+
return hoursAmpm;
|
|
160
|
+
}
|
|
157
161
|
return minSec;
|
|
158
162
|
});
|
|
159
163
|
const isDisableMinSec = (time, isDisable2) => {
|
|
@@ -170,11 +174,15 @@ const __sfc__ = defineComponent({
|
|
|
170
174
|
allowedTime: props.allowedTime,
|
|
171
175
|
disableHour: disableHour.value
|
|
172
176
|
};
|
|
173
|
-
if (isDisable2 && props.type === "minute")
|
|
177
|
+
if (isDisable2 && props.type === "minute") {
|
|
178
|
+
Reflect.deleteProperty(values, "minute");
|
|
179
|
+
}
|
|
174
180
|
return disableMethod(values);
|
|
175
181
|
};
|
|
176
182
|
const getHandleColor = () => {
|
|
177
|
-
if (activeItemIndex.value === void 0)
|
|
183
|
+
if (activeItemIndex.value === void 0) {
|
|
184
|
+
return props.color;
|
|
185
|
+
}
|
|
178
186
|
const hour = props.isInner ? hours24[activeItemIndex.value] : timeScales.value[activeItemIndex.value];
|
|
179
187
|
if (timeScales.value === minSec) {
|
|
180
188
|
return isDisableMinSec() ? "var(--time-picker-clock-item-disable-background)" : props.color;
|
|
@@ -182,12 +190,16 @@ const __sfc__ = defineComponent({
|
|
|
182
190
|
return isDisable(hour) ? "var(--time-picker-clock-item-disable-background)" : props.color;
|
|
183
191
|
};
|
|
184
192
|
const isActive = (index, inner2) => {
|
|
185
|
-
if (inner2)
|
|
193
|
+
if (inner2) {
|
|
194
|
+
return activeItemIndex.value === index && props.isInner;
|
|
195
|
+
}
|
|
186
196
|
return activeItemIndex.value === index && (!props.isInner || props.type !== "hour");
|
|
187
197
|
};
|
|
188
198
|
const isDisable = (time) => {
|
|
189
199
|
if (props.type === "hour") {
|
|
190
|
-
if (notConvert(props.format, props.ampm))
|
|
200
|
+
if (notConvert(props.format, props.ampm)) {
|
|
201
|
+
return disableHour.value.includes(time);
|
|
202
|
+
}
|
|
191
203
|
const timeIndex = hoursAmpm.findIndex((hour) => hour === time);
|
|
192
204
|
return disable24HourIndex.value.includes(timeIndex);
|
|
193
205
|
}
|
|
@@ -231,26 +243,36 @@ const __sfc__ = defineComponent({
|
|
|
231
243
|
};
|
|
232
244
|
};
|
|
233
245
|
const getHour = () => {
|
|
234
|
-
if (activeItemIndex.value === void 0)
|
|
246
|
+
if (activeItemIndex.value === void 0) {
|
|
247
|
+
return void 0;
|
|
248
|
+
}
|
|
235
249
|
const hours = props.ampm === "am" ? hoursAmpm : hours24;
|
|
236
250
|
return padStart(hours[activeItemIndex.value], 2, "0");
|
|
237
251
|
};
|
|
238
252
|
watch([activeItemIndex, () => props.isInner], ([index, inner2], [oldIndex, oldInner]) => {
|
|
239
253
|
const isSame = index === oldIndex && inner2 === oldInner;
|
|
240
|
-
if (isSame || props.type !== "hour" || activeItemIndex.value === void 0)
|
|
254
|
+
if (isSame || props.type !== "hour" || activeItemIndex.value === void 0) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
241
257
|
const newHour = inner2 ? hours24[activeItemIndex.value] : getHour();
|
|
242
258
|
const second = props.useSeconds ? `:${props.time.second}` : "";
|
|
243
259
|
const newTime = `${newHour}:${props.time.minute}${second}`;
|
|
244
|
-
if (!props.preventNextUpdate)
|
|
260
|
+
if (!props.preventNextUpdate) {
|
|
261
|
+
emit("update", newTime);
|
|
262
|
+
}
|
|
245
263
|
emit("change-prevent-update");
|
|
246
264
|
});
|
|
247
265
|
watch(
|
|
248
266
|
() => props.rad,
|
|
249
267
|
(rad, oldRad) => {
|
|
250
|
-
if (props.type === "hour" || rad === void 0 || oldRad === void 0)
|
|
268
|
+
if (props.type === "hour" || rad === void 0 || oldRad === void 0) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
251
271
|
const radToMinSec = rad / 6 >= 0 ? rad / 6 : rad / 6 + 60;
|
|
252
272
|
const oldRadToMinSec = oldRad / 6 >= 0 ? oldRad / 6 : oldRad / 6 + 60;
|
|
253
|
-
if (radToMinSec === oldRadToMinSec)
|
|
273
|
+
if (radToMinSec === oldRadToMinSec) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
254
276
|
let newTime;
|
|
255
277
|
const { hourStr } = convertHour(props.format, props.ampm, props.time.hour);
|
|
256
278
|
if (props.type === "minute") {
|
package/es/time-picker/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import TimePicker from "./TimePicker.mjs";
|
|
2
1
|
import { withInstall, withPropsDefaultsSetter } from "../utils/components.mjs";
|
|
3
2
|
import { props as timePickerProps } from "./props.mjs";
|
|
3
|
+
import TimePicker from "./TimePicker.mjs";
|
|
4
4
|
withInstall(TimePicker);
|
|
5
5
|
withPropsDefaultsSetter(TimePicker, timePickerProps);
|
|
6
6
|
const _TimePickerComponent = TimePicker;
|
package/es/time-picker/utils.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hours24, hoursAmpm } from "./props.mjs";
|
|
2
1
|
import { toNumber } from "@varlet/shared";
|
|
2
|
+
import { hours24, hoursAmpm } from "./props.mjs";
|
|
3
3
|
const notConvert = (format, ampm) => format === "24hr" || ampm === "am";
|
|
4
4
|
const convertHour = (format, ampm, hour) => {
|
|
5
5
|
const index = hoursAmpm.findIndex((hourAmpm) => toNumber(hourAmpm) === toNumber(hour));
|
|
@@ -23,7 +23,9 @@ const getIsDisableMinute = (values) => {
|
|
|
23
23
|
const { hourStr, hourNum } = convertHour(format, ampm, hour);
|
|
24
24
|
let isBetweenMinMax = false;
|
|
25
25
|
let isAllow = false;
|
|
26
|
-
if (disableHour.includes(hourStr))
|
|
26
|
+
if (disableHour.includes(hourStr)) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
27
29
|
if (max && !min) {
|
|
28
30
|
const { hour: maxHour, minute: maxMinute } = getNumberTime(max);
|
|
29
31
|
isBetweenMinMax = maxHour === hourNum && time > maxMinute;
|
|
@@ -37,7 +39,9 @@ const getIsDisableMinute = (values) => {
|
|
|
37
39
|
const { hour: minHour, minute: minMinute } = getNumberTime(min);
|
|
38
40
|
isBetweenMinMax = minHour === hourNum && time < minMinute || maxHour === hourNum && time > maxMinute;
|
|
39
41
|
}
|
|
40
|
-
if ((_a = values.allowedTime) == null ? void 0 : _a.minutes)
|
|
42
|
+
if ((_a = values.allowedTime) == null ? void 0 : _a.minutes) {
|
|
43
|
+
isAllow = (_b = values.allowedTime) == null ? void 0 : _b.minutes(time);
|
|
44
|
+
}
|
|
41
45
|
return isBetweenMinMax || isAllow;
|
|
42
46
|
};
|
|
43
47
|
const getIsDisableSecond = (values) => {
|
|
@@ -46,7 +50,9 @@ const getIsDisableSecond = (values) => {
|
|
|
46
50
|
const { hourStr, hourNum } = convertHour(format, ampm, hour);
|
|
47
51
|
let isBetweenMinMax = false;
|
|
48
52
|
let isAllow = false;
|
|
49
|
-
if (disableHour.includes(hourStr))
|
|
53
|
+
if (disableHour.includes(hourStr)) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
50
56
|
if (max && !min) {
|
|
51
57
|
const { hour: maxHour, minute: maxMinute, second: maxSecond } = getNumberTime(max);
|
|
52
58
|
isBetweenMinMax = maxHour === hourNum && maxMinute < minute || maxMinute === minute && time > maxSecond;
|
|
@@ -60,7 +66,9 @@ const getIsDisableSecond = (values) => {
|
|
|
60
66
|
const { hour: minHour, minute: minMinute, second: minSecond } = getNumberTime(min);
|
|
61
67
|
isBetweenMinMax = maxHour === hourNum && maxMinute < minute || minHour === hourNum && minMinute > minute || maxHour === hourNum && maxMinute === minute && time > maxSecond || minHour === hourNum && minMinute === minute && time < minSecond;
|
|
62
68
|
}
|
|
63
|
-
if ((_a = values.allowedTime) == null ? void 0 : _a.seconds)
|
|
69
|
+
if ((_a = values.allowedTime) == null ? void 0 : _a.seconds) {
|
|
70
|
+
isAllow = (_b = values.allowedTime) == null ? void 0 : _b.seconds(time);
|
|
71
|
+
}
|
|
64
72
|
return isBetweenMinMax || isAllow;
|
|
65
73
|
};
|
|
66
74
|
export {
|
package/es/tooltip/Tooltip.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createNamespace, useTeleport } from "../utils/components.mjs";
|
|
2
1
|
import { defineComponent } from "vue";
|
|
3
|
-
import { toSizeUnit } from "../utils/elements.mjs";
|
|
4
2
|
import { usePopover } from "../menu/usePopover.mjs";
|
|
3
|
+
import { createNamespace, useTeleport } from "../utils/components.mjs";
|
|
4
|
+
import { toSizeUnit } from "../utils/elements.mjs";
|
|
5
5
|
import { props } from "./props.mjs";
|
|
6
6
|
const { name, n, classes } = createNamespace("tooltip");
|
|
7
7
|
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, vShow as _vShow, withModifiers as _withModifiers, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock } from "vue";
|
package/es/tooltip/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Tooltip from "./Tooltip.mjs";
|
|
2
1
|
import { withInstall, withPropsDefaultsSetter } from "../utils/components.mjs";
|
|
3
2
|
import { props as tooltipProps } from "./props.mjs";
|
|
3
|
+
import Tooltip from "./Tooltip.mjs";
|
|
4
4
|
withInstall(Tooltip);
|
|
5
5
|
withPropsDefaultsSetter(Tooltip, tooltipProps);
|
|
6
6
|
const _TooltipComponent = Tooltip;
|
package/es/uploader/Uploader.mjs
CHANGED
|
@@ -18,21 +18,21 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18
18
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
import
|
|
21
|
+
import { computed, defineComponent, nextTick, reactive, ref, watch } from "vue";
|
|
22
|
+
import { call, isNumber, normalizeToArray, toDataURL, toNumber } from "@varlet/shared";
|
|
23
|
+
import { useEventListener } from "@varlet/use";
|
|
22
24
|
import VarFormDetails from "../form-details/index.mjs";
|
|
25
|
+
import { useForm } from "../form/provide.mjs";
|
|
26
|
+
import Hover from "../hover/index.mjs";
|
|
27
|
+
import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
|
|
23
28
|
import VarIcon from "../icon/index.mjs";
|
|
24
|
-
import VarPopup from "../popup/index.mjs";
|
|
25
29
|
import ImagePreview from "../image-preview/index.mjs";
|
|
30
|
+
import VarPopup from "../popup/index.mjs";
|
|
26
31
|
import Ripple from "../ripple/index.mjs";
|
|
27
|
-
import
|
|
28
|
-
import { defineComponent, nextTick, reactive, computed, watch, ref } from "vue";
|
|
29
|
-
import { props } from "./props.mjs";
|
|
30
|
-
import { isNumber, toNumber, normalizeToArray, toDataURL, call } from "@varlet/shared";
|
|
31
|
-
import { isHTMLSupportImage, isHTMLSupportVideo } from "../utils/shared.mjs";
|
|
32
|
-
import { useValidation, createNamespace, formatElevation } from "../utils/components.mjs";
|
|
33
|
-
import { useForm } from "../form/provide.mjs";
|
|
32
|
+
import { createNamespace, formatElevation, useValidation } from "../utils/components.mjs";
|
|
34
33
|
import { toSizeUnit } from "../utils/elements.mjs";
|
|
35
|
-
import {
|
|
34
|
+
import { isHTMLSupportImage, isHTMLSupportVideo } from "../utils/shared.mjs";
|
|
35
|
+
import { props } from "./props.mjs";
|
|
36
36
|
const { name, n, classes } = createNamespace("uploader");
|
|
37
37
|
let fid = 0;
|
|
38
38
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives, withCtx as _withCtx, createSlots as _createSlots } from "vue";
|
|
@@ -66,8 +66,8 @@ function __render__(_ctx, _cache) {
|
|
|
66
66
|
null,
|
|
67
67
|
_renderList(_ctx.files, (f) => {
|
|
68
68
|
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
69
|
-
class: _normalizeClass(_ctx.classes(_ctx.n("file"), _ctx.formatElevation(_ctx.elevation, 2), [f.state === "loading", _ctx.n("--loading")])),
|
|
70
69
|
key: f.id,
|
|
70
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("file"), _ctx.formatElevation(_ctx.elevation, 2), [f.state === "loading", _ctx.n("--loading")])),
|
|
71
71
|
onClick: ($event) => _ctx.preview(f)
|
|
72
72
|
}, [
|
|
73
73
|
_createElementVNode(
|
|
@@ -197,11 +197,11 @@ function __render__(_ctx, _cache) {
|
|
|
197
197
|
} : void 0
|
|
198
198
|
]), 1032, ["error-message", "extra-message"]),
|
|
199
199
|
_createVNode(_component_var_popup, {
|
|
200
|
+
show: _ctx.showPreview,
|
|
201
|
+
"onUpdate:show": _cache[5] || (_cache[5] = ($event) => _ctx.showPreview = $event),
|
|
200
202
|
class: _normalizeClass(_ctx.n("preview")),
|
|
201
203
|
"var-uploader-cover": "",
|
|
202
204
|
position: "center",
|
|
203
|
-
show: _ctx.showPreview,
|
|
204
|
-
"onUpdate:show": _cache[5] || (_cache[5] = ($event) => _ctx.showPreview = $event),
|
|
205
205
|
onClosed: _cache[6] || (_cache[6] = ($event) => _ctx.currentPreview = null)
|
|
206
206
|
}, {
|
|
207
207
|
default: _withCtx(() => {
|
|
@@ -222,7 +222,7 @@ function __render__(_ctx, _cache) {
|
|
|
222
222
|
}),
|
|
223
223
|
_: 1
|
|
224
224
|
/* STABLE */
|
|
225
|
-
}, 8, ["
|
|
225
|
+
}, 8, ["show", "class"])
|
|
226
226
|
],
|
|
227
227
|
2
|
|
228
228
|
/* CLASS */
|
package/es/uploader/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Uploader from "./Uploader.mjs";
|
|
2
1
|
import { withInstall, withPropsDefaultsSetter } from "../utils/components.mjs";
|
|
3
2
|
import { props as uploaderProps } from "./props.mjs";
|
|
3
|
+
import Uploader from "./Uploader.mjs";
|
|
4
4
|
withInstall(Uploader);
|
|
5
5
|
withPropsDefaultsSetter(Uploader, uploaderProps);
|
|
6
6
|
const _UploaderComponent = Uploader;
|
package/es/utils/components.mjs
CHANGED
|
@@ -37,16 +37,15 @@ var __async = (__this, __arguments, generator) => {
|
|
|
37
37
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
import { useEventListener } from "@varlet/use";
|
|
41
40
|
import {
|
|
41
|
+
Comment,
|
|
42
42
|
createApp,
|
|
43
|
+
defineComponent,
|
|
44
|
+
Fragment,
|
|
43
45
|
h,
|
|
44
|
-
ref,
|
|
45
46
|
onActivated,
|
|
46
47
|
onDeactivated,
|
|
47
|
-
|
|
48
|
-
Fragment,
|
|
49
|
-
defineComponent
|
|
48
|
+
ref
|
|
50
49
|
} from "vue";
|
|
51
50
|
import {
|
|
52
51
|
createNamespaceFn,
|
|
@@ -57,6 +56,7 @@ import {
|
|
|
57
56
|
isString,
|
|
58
57
|
normalizeToArray
|
|
59
58
|
} from "@varlet/shared";
|
|
59
|
+
import { useEventListener } from "@varlet/use";
|
|
60
60
|
function pickProps(props, propsKey) {
|
|
61
61
|
return isArray(propsKey) ? propsKey.reduce((pickedProps, key) => {
|
|
62
62
|
pickedProps[key] = props[key];
|
package/es/utils/elements.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
assert,
|
|
3
|
+
getRect,
|
|
4
|
+
getScrollLeft,
|
|
5
|
+
getScrollTop,
|
|
6
|
+
getStyle,
|
|
7
|
+
inBrowser,
|
|
2
8
|
isNumber,
|
|
9
|
+
isNumeric,
|
|
3
10
|
isObject,
|
|
4
11
|
isString,
|
|
5
|
-
kebabCase,
|
|
6
|
-
toNumber,
|
|
7
12
|
isWindow,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getStyle,
|
|
11
|
-
getScrollTop,
|
|
12
|
-
getScrollLeft,
|
|
13
|
-
isNumeric
|
|
13
|
+
kebabCase,
|
|
14
|
+
toNumber
|
|
14
15
|
} from "@varlet/shared";
|
|
15
|
-
import { assert } from "@varlet/shared";
|
|
16
16
|
function getLeft(element) {
|
|
17
17
|
const { left } = getRect(element);
|
|
18
18
|
return left + (document.body.scrollLeft || document.documentElement.scrollLeft);
|
package/es/utils/test.mjs
CHANGED
|
@@ -22,8 +22,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
import { nextTick } from "vue";
|
|
25
|
+
import { getStyle, isPlainObject } from "@varlet/shared";
|
|
25
26
|
import { config } from "@vue/test-utils";
|
|
26
|
-
import { isPlainObject, getStyle } from "@varlet/shared";
|
|
27
27
|
const delay = (time) => new Promise((resolve) => {
|
|
28
28
|
setTimeout(resolve, time);
|
|
29
29
|
});
|