@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.
Files changed (321) hide show
  1. package/es/action-sheet/ActionItem.mjs +4 -4
  2. package/es/action-sheet/ActionSheet.mjs +9 -9
  3. package/es/action-sheet/index.mjs +2 -2
  4. package/es/action-sheet/props.mjs +1 -1
  5. package/es/action-sheet/style/index.mjs +1 -1
  6. package/es/alert/Alert.mjs +3 -3
  7. package/es/alert/index.mjs +1 -1
  8. package/es/app-bar/AppBar.mjs +5 -5
  9. package/es/app-bar/index.mjs +1 -1
  10. package/es/auto-complete/AutoComplete.mjs +23 -27
  11. package/es/auto-complete/index.mjs +1 -1
  12. package/es/auto-complete/props.mjs +1 -1
  13. package/es/avatar/Avatar.mjs +5 -5
  14. package/es/avatar/index.mjs +1 -1
  15. package/es/avatar-group/AvatarGroup.mjs +2 -2
  16. package/es/avatar-group/index.mjs +1 -1
  17. package/es/back-top/BackTop.mjs +7 -7
  18. package/es/back-top/index.mjs +1 -1
  19. package/es/badge/Badge.mjs +3 -3
  20. package/es/badge/index.mjs +1 -1
  21. package/es/badge/props.mjs +1 -1
  22. package/es/bottom-navigation/BottomNavigation.mjs +8 -9
  23. package/es/bottom-navigation/index.mjs +1 -1
  24. package/es/bottom-navigation-item/BottomNavigationItem.mjs +4 -4
  25. package/es/bottom-navigation-item/index.mjs +1 -1
  26. package/es/bottom-navigation-item/provide.mjs +1 -1
  27. package/es/breadcrumb/Breadcrumb.mjs +3 -3
  28. package/es/breadcrumb/index.mjs +1 -1
  29. package/es/breadcrumb/provide.mjs +1 -1
  30. package/es/breadcrumbs/Breadcrumbs.mjs +2 -2
  31. package/es/breadcrumbs/index.mjs +1 -1
  32. package/es/button/Button.mjs +6 -6
  33. package/es/button/index.mjs +1 -1
  34. package/es/button-group/ButtonGroup.mjs +1 -1
  35. package/es/button-group/index.mjs +1 -1
  36. package/es/card/Card.mjs +39 -39
  37. package/es/card/index.mjs +1 -1
  38. package/es/cell/Cell.mjs +3 -3
  39. package/es/cell/index.mjs +1 -1
  40. package/es/cell/props.mjs +1 -1
  41. package/es/checkbox/Checkbox.mjs +7 -7
  42. package/es/checkbox/index.mjs +1 -1
  43. package/es/checkbox-group/CheckboxGroup.mjs +5 -5
  44. package/es/checkbox-group/index.mjs +1 -1
  45. package/es/chip/Chip.mjs +4 -4
  46. package/es/chip/index.mjs +1 -1
  47. package/es/chip/props.mjs +1 -1
  48. package/es/code/Code.mjs +1 -1
  49. package/es/code/index.mjs +1 -1
  50. package/es/col/Col.mjs +4 -4
  51. package/es/col/index.mjs +1 -1
  52. package/es/collapse/Collapse.mjs +6 -4
  53. package/es/collapse/index.mjs +1 -1
  54. package/es/collapse-item/CollapseItem.mjs +4 -4
  55. package/es/collapse-item/index.mjs +1 -1
  56. package/es/collapse-item/provide.mjs +1 -1
  57. package/es/collapse-transition/CollapseTransition.mjs +2 -2
  58. package/es/collapse-transition/index.mjs +1 -1
  59. package/es/collapse-transition/useCollapseTransition.mjs +1 -1
  60. package/es/context/lock.mjs +1 -1
  61. package/es/context/stack.mjs +1 -1
  62. package/es/context/zIndex.mjs +1 -1
  63. package/es/count-to/CountTo.mjs +4 -4
  64. package/es/count-to/index.mjs +1 -1
  65. package/es/countdown/Countdown.mjs +2 -2
  66. package/es/countdown/index.mjs +1 -1
  67. package/es/counter/Counter.mjs +8 -8
  68. package/es/counter/index.mjs +1 -1
  69. package/es/date-picker/DatePicker.mjs +92 -43
  70. package/es/date-picker/index.mjs +1 -1
  71. package/es/date-picker/src/day-picker-panel.mjs +59 -27
  72. package/es/date-picker/src/month-picker-panel.mjs +57 -23
  73. package/es/date-picker/src/panel-header.mjs +12 -6
  74. package/es/date-picker/src/year-picker-panel.mjs +53 -23
  75. package/es/dialog/Dialog.mjs +5 -5
  76. package/es/dialog/index.mjs +3 -3
  77. package/es/dialog/props.mjs +1 -1
  78. package/es/divider/Divider.mjs +4 -4
  79. package/es/divider/index.mjs +1 -1
  80. package/es/drag/Drag.mjs +21 -42
  81. package/es/drag/index.mjs +1 -1
  82. package/es/ellipsis/Ellipsis.mjs +2 -2
  83. package/es/ellipsis/index.mjs +1 -1
  84. package/es/fab/Fab.mjs +4 -5
  85. package/es/fab/index.mjs +1 -1
  86. package/es/fab/props.mjs +1 -1
  87. package/es/field-decorator/FieldDecorator.mjs +5 -5
  88. package/es/field-decorator/index.mjs +1 -1
  89. package/es/floating-panel/FloatingPanel.mjs +6 -6
  90. package/es/floating-panel/index.mjs +1 -1
  91. package/es/form/Form.mjs +4 -4
  92. package/es/form/index.mjs +2 -2
  93. package/es/form/provide.mjs +1 -1
  94. package/es/form-details/index.mjs +1 -1
  95. package/es/highlighter-provider/HighlighterProvider.mjs +2 -2
  96. package/es/highlighter-provider/index.mjs +1 -1
  97. package/es/highlighter-provider/provide.mjs +1 -1
  98. package/es/hover/index.mjs +12 -7
  99. package/es/hover-overlay/HoverOverlay.mjs +2 -2
  100. package/es/hover-overlay/index.mjs +2 -2
  101. package/es/icon/Icon.mjs +3 -3
  102. package/es/icon/index.mjs +1 -1
  103. package/es/image/Image.mjs +5 -5
  104. package/es/image/index.mjs +1 -1
  105. package/es/image-preview/ImagePreview.mjs +13 -14
  106. package/es/image-preview/index.mjs +2 -2
  107. package/es/image-preview/props.mjs +2 -2
  108. package/es/index-anchor/IndexAnchor.mjs +5 -5
  109. package/es/index-anchor/index.mjs +1 -1
  110. package/es/index-anchor/provide.mjs +1 -1
  111. package/es/index-bar/IndexBar.mjs +17 -13
  112. package/es/index-bar/index.mjs +1 -1
  113. package/es/index.bundle.mjs +1 -1
  114. package/es/index.mjs +1 -1
  115. package/es/input/Input.mjs +12 -12
  116. package/es/input/index.mjs +1 -1
  117. package/es/input/props.mjs +1 -1
  118. package/es/lazy/index.mjs +1 -1
  119. package/es/link/Link.mjs +2 -2
  120. package/es/link/index.mjs +1 -1
  121. package/es/list/List.mjs +10 -10
  122. package/es/list/index.mjs +1 -1
  123. package/es/list/provide.mjs +1 -1
  124. package/es/loading/Loading.mjs +2 -2
  125. package/es/loading/index.mjs +1 -1
  126. package/es/loading-bar/LoadingBar.mjs +1 -2
  127. package/es/loading-bar/index.mjs +1 -1
  128. package/es/locale/index.mjs +5 -5
  129. package/es/locale-provider/LocaleProvider.mjs +11 -8
  130. package/es/locale-provider/index.mjs +1 -1
  131. package/es/locale-provider/provide.mjs +1 -1
  132. package/es/menu/Menu.mjs +2 -2
  133. package/es/menu/index.mjs +1 -1
  134. package/es/menu/usePopover.mjs +6 -6
  135. package/es/menu-option/MenuOption.mjs +9 -9
  136. package/es/menu-option/index.mjs +1 -1
  137. package/es/menu-option/provide.mjs +1 -1
  138. package/es/menu-select/MenuChildren.mjs +21 -21
  139. package/es/menu-select/MenuSelect.mjs +9 -9
  140. package/es/menu-select/index.mjs +1 -1
  141. package/es/option/Option.mjs +5 -5
  142. package/es/option/index.mjs +1 -1
  143. package/es/option/provide.mjs +1 -1
  144. package/es/overlay/Overlay.mjs +4 -4
  145. package/es/overlay/index.mjs +1 -1
  146. package/es/pagination/Pagination.mjs +26 -18
  147. package/es/pagination/index.mjs +1 -1
  148. package/es/paper/Paper.mjs +3 -3
  149. package/es/paper/index.mjs +1 -1
  150. package/es/picker/Picker.mjs +9 -9
  151. package/es/picker/index.mjs +2 -2
  152. package/es/picker/props.mjs +1 -1
  153. package/es/popup/Popup.mjs +6 -6
  154. package/es/popup/index.mjs +1 -1
  155. package/es/progress/Progress.mjs +4 -4
  156. package/es/progress/index.mjs +1 -1
  157. package/es/pull-refresh/PullRefresh.mjs +10 -12
  158. package/es/pull-refresh/index.mjs +1 -1
  159. package/es/radio/Radio.mjs +10 -9
  160. package/es/radio/index.mjs +1 -1
  161. package/es/radio-group/RadioGroup.mjs +7 -6
  162. package/es/radio-group/index.mjs +1 -1
  163. package/es/rate/Rate.mjs +8 -8
  164. package/es/rate/index.mjs +1 -1
  165. package/es/rate/props.mjs +1 -1
  166. package/es/result/Result.mjs +7 -7
  167. package/es/result/index.mjs +1 -1
  168. package/es/ripple/index.mjs +1 -1
  169. package/es/row/Row.mjs +4 -4
  170. package/es/row/index.mjs +1 -1
  171. package/es/select/Select.mjs +13 -13
  172. package/es/select/index.mjs +1 -1
  173. package/es/select/props.mjs +1 -1
  174. package/es/skeleton/Skeleton.mjs +3 -3
  175. package/es/skeleton/index.mjs +1 -1
  176. package/es/slider/Slider.mjs +9 -9
  177. package/es/slider/index.mjs +1 -1
  178. package/es/snackbar/Snackbar.mjs +1 -1
  179. package/es/snackbar/core.mjs +8 -8
  180. package/es/snackbar/index.mjs +9 -8
  181. package/es/snackbar/props.mjs +1 -1
  182. package/es/space/Space.mjs +2 -2
  183. package/es/space/index.mjs +1 -1
  184. package/es/step/Step.mjs +3 -3
  185. package/es/step/index.mjs +1 -1
  186. package/es/step/provide.mjs +1 -1
  187. package/es/steps/Steps.mjs +3 -3
  188. package/es/steps/index.mjs +1 -1
  189. package/es/sticky/Sticky.mjs +7 -7
  190. package/es/sticky/index.mjs +1 -1
  191. package/es/style-provider/StyleProvider.mjs +2 -2
  192. package/es/style-provider/index.mjs +2 -2
  193. package/es/swipe/Swipe.mjs +10 -10
  194. package/es/swipe/index.mjs +1 -1
  195. package/es/swipe-item/SwipeItem.mjs +1 -1
  196. package/es/swipe-item/index.mjs +1 -1
  197. package/es/swipe-item/provide.mjs +1 -1
  198. package/es/switch/Switch.mjs +6 -6
  199. package/es/switch/index.mjs +1 -1
  200. package/es/tab/Tab.mjs +4 -4
  201. package/es/tab/index.mjs +1 -1
  202. package/es/tab/provide.mjs +1 -1
  203. package/es/tab-item/TabItem.mjs +3 -3
  204. package/es/tab-item/index.mjs +1 -1
  205. package/es/tab-item/provide.mjs +1 -1
  206. package/es/table/Table.mjs +1 -1
  207. package/es/table/index.mjs +1 -1
  208. package/es/tabs/Tabs.mjs +9 -7
  209. package/es/tabs/index.mjs +1 -1
  210. package/es/tabs/props.mjs +1 -1
  211. package/es/tabs-items/TabsItems.mjs +4 -4
  212. package/es/tabs-items/index.mjs +1 -1
  213. package/es/themes/dark/index.mjs +33 -33
  214. package/es/themes/index.mjs +1 -1
  215. package/es/themes/md3-dark/index.mjs +45 -45
  216. package/es/themes/md3-light/index.mjs +39 -39
  217. package/es/time-picker/TimePicker.mjs +48 -24
  218. package/es/time-picker/clock.mjs +41 -19
  219. package/es/time-picker/index.mjs +1 -1
  220. package/es/time-picker/utils.mjs +13 -5
  221. package/es/tooltip/Tooltip.mjs +2 -2
  222. package/es/tooltip/index.mjs +1 -1
  223. package/es/uploader/Uploader.mjs +14 -14
  224. package/es/uploader/index.mjs +1 -1
  225. package/es/utils/components.mjs +5 -5
  226. package/es/utils/elements.mjs +9 -9
  227. package/es/utils/test.mjs +1 -1
  228. package/es/varlet.esm.js +20946 -20941
  229. package/es/watermark/Watermark.mjs +15 -17
  230. package/es/watermark/index.mjs +1 -1
  231. package/highlight/web-types.en-US.json +1 -1
  232. package/highlight/web-types.zh-CN.json +1 -1
  233. package/lib/varlet.cjs.js +25205 -25003
  234. package/package.json +34 -34
  235. package/types/actionSheet.d.ts +2 -2
  236. package/types/alert.d.ts +1 -1
  237. package/types/appBar.d.ts +1 -1
  238. package/types/autoComplete.d.ts +4 -4
  239. package/types/avatar.d.ts +1 -1
  240. package/types/avatarGroup.d.ts +1 -1
  241. package/types/backTop.d.ts +1 -1
  242. package/types/badge.d.ts +1 -1
  243. package/types/bottomNavigation.d.ts +2 -2
  244. package/types/bottomNavigationItem.d.ts +2 -2
  245. package/types/breadcrumb.d.ts +1 -1
  246. package/types/breadcrumbs.d.ts +1 -1
  247. package/types/button.d.ts +5 -5
  248. package/types/buttonGroup.d.ts +2 -2
  249. package/types/card.d.ts +1 -1
  250. package/types/cell.d.ts +1 -1
  251. package/types/checkbox.d.ts +1 -1
  252. package/types/checkboxGroup.d.ts +2 -2
  253. package/types/chip.d.ts +3 -3
  254. package/types/code.d.ts +1 -1
  255. package/types/col.d.ts +1 -1
  256. package/types/collapse.d.ts +1 -1
  257. package/types/collapseItem.d.ts +1 -1
  258. package/types/collapseTransition.d.ts +1 -1
  259. package/types/countTo.d.ts +1 -1
  260. package/types/countdown.d.ts +1 -1
  261. package/types/counter.d.ts +1 -1
  262. package/types/datePicker.d.ts +1 -1
  263. package/types/dialog.d.ts +1 -1
  264. package/types/divider.d.ts +1 -1
  265. package/types/drag.d.ts +1 -1
  266. package/types/ellipsis.d.ts +1 -1
  267. package/types/fab.d.ts +2 -2
  268. package/types/floatingPanel.d.ts +2 -2
  269. package/types/form.d.ts +1 -1
  270. package/types/formDetails.d.ts +1 -1
  271. package/types/highlighterProvider.d.ts +1 -1
  272. package/types/hover.d.ts +1 -1
  273. package/types/hoverOverlay.d.ts +1 -1
  274. package/types/icon.d.ts +1 -1
  275. package/types/image.d.ts +2 -2
  276. package/types/imagePreview.d.ts +2 -2
  277. package/types/indexAnchor.d.ts +1 -1
  278. package/types/indexBar.d.ts +1 -1
  279. package/types/input.d.ts +4 -4
  280. package/types/link.d.ts +1 -1
  281. package/types/list.d.ts +1 -1
  282. package/types/loading.d.ts +1 -1
  283. package/types/localeProvider.d.ts +2 -2
  284. package/types/menu.d.ts +2 -2
  285. package/types/menuOption.d.ts +1 -1
  286. package/types/menuSelect.d.ts +2 -2
  287. package/types/option.d.ts +1 -1
  288. package/types/overlay.d.ts +2 -2
  289. package/types/pagination.d.ts +1 -1
  290. package/types/paper.d.ts +1 -1
  291. package/types/picker.d.ts +3 -3
  292. package/types/popup.d.ts +2 -2
  293. package/types/progress.d.ts +1 -1
  294. package/types/pullRefresh.d.ts +1 -1
  295. package/types/radio.d.ts +1 -1
  296. package/types/radioGroup.d.ts +3 -3
  297. package/types/rate.d.ts +1 -1
  298. package/types/result.d.ts +1 -1
  299. package/types/row.d.ts +1 -1
  300. package/types/select.d.ts +3 -3
  301. package/types/skeleton.d.ts +1 -1
  302. package/types/slider.d.ts +4 -4
  303. package/types/snackbar.d.ts +2 -2
  304. package/types/space.d.ts +1 -1
  305. package/types/step.d.ts +1 -1
  306. package/types/steps.d.ts +3 -3
  307. package/types/sticky.d.ts +1 -1
  308. package/types/styleProvider.d.ts +2 -2
  309. package/types/swipe.d.ts +1 -1
  310. package/types/swipeItem.d.ts +1 -1
  311. package/types/switch.d.ts +1 -1
  312. package/types/tab.d.ts +1 -1
  313. package/types/tabItem.d.ts +1 -1
  314. package/types/table.d.ts +1 -1
  315. package/types/tabs.d.ts +3 -3
  316. package/types/tabsItems.d.ts +2 -2
  317. package/types/timePicker.d.ts +1 -1
  318. package/types/tooltip.d.ts +2 -2
  319. package/types/uploader.d.ts +2 -2
  320. package/types/watermark.d.ts +1 -1
  321. package/umd/varlet.js +7 -7
@@ -1,10 +1,10 @@
1
- import dayjs from "dayjs/esm/index.js";
2
1
  import { computed, defineComponent, ref, watch } from "vue";
3
- import { hoursAmpm, hours24, minSec } from "./props.mjs";
4
- import { notConvert, convertHour, getIsDisableMinute, getIsDisableSecond, getNumberTime } from "./utils.mjs";
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
- class: _normalizeClass(_ctx.n("clock-inner")),
57
- ref: "inner"
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) return;
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") return hoursAmpm;
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") Reflect.deleteProperty(values, "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) return props.color;
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) return activeItemIndex.value === index && props.isInner;
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)) return disableHour.value.includes(time);
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) return 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) return;
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) emit("update", newTime);
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) return;
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) return;
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") {
@@ -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;
@@ -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)) return true;
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) isAllow = (_b = values.allowedTime) == null ? void 0 : _b.minutes(time);
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)) return true;
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) isAllow = (_b = values.allowedTime) == null ? void 0 : _b.seconds(time);
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 {
@@ -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";
@@ -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;
@@ -18,21 +18,21 @@ var __async = (__this, __arguments, generator) => {
18
18
  step((generator = generator.apply(__this, __arguments)).next());
19
19
  });
20
20
  };
21
- import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
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 Hover from "../hover/index.mjs";
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 { useEventListener } from "@varlet/use";
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, ["class", "show"])
225
+ }, 8, ["show", "class"])
226
226
  ],
227
227
  2
228
228
  /* CLASS */
@@ -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;
@@ -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
- Comment,
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];
@@ -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
- inBrowser,
9
- getRect,
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
  });