@varlet/ui 2.17.1 → 2.18.0-alpha.1697472019506

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 (44) hide show
  1. package/es/action-sheet/actionSheet.css +1 -1
  2. package/es/drag/Drag.mjs +2 -2
  3. package/es/form/Form.mjs +3 -3
  4. package/es/image-preview/ImagePreview.mjs +2 -2
  5. package/es/index-bar/indexBar.css +1 -1
  6. package/es/index.bundle.mjs +13 -1
  7. package/es/index.mjs +11 -1
  8. package/es/input/Input.mjs +2 -2
  9. package/es/menu/style/index.mjs +1 -1
  10. package/es/menu-option/MenuOption.mjs +122 -0
  11. package/es/menu-option/MenuOptionSfc.css +0 -0
  12. package/es/menu-option/index.mjs +11 -0
  13. package/es/menu-option/menuOption.css +1 -0
  14. package/es/menu-option/props.mjs +8 -0
  15. package/es/menu-option/provide.mjs +19 -0
  16. package/es/menu-option/style/index.mjs +5 -0
  17. package/es/menu-select/MenuSelect.mjs +110 -0
  18. package/es/menu-select/MenuSelectSfc.css +0 -0
  19. package/es/menu-select/index.mjs +9 -0
  20. package/es/menu-select/menuSelect.css +1 -0
  21. package/es/menu-select/props.mjs +58 -0
  22. package/es/menu-select/provide.mjs +16 -0
  23. package/es/menu-select/style/index.mjs +5 -0
  24. package/es/pull-refresh/PullRefresh.mjs +2 -2
  25. package/es/ripple/index.mjs +2 -0
  26. package/es/select/Select.mjs +14 -47
  27. package/es/select/useSelectController.mjs +67 -0
  28. package/es/slider/Slider.mjs +2 -2
  29. package/es/style.css +1 -1
  30. package/es/style.mjs +2 -0
  31. package/es/swipe/Swipe.mjs +13 -13
  32. package/es/themes/dark/index.mjs +3 -2
  33. package/es/themes/dark/menuOption.mjs +6 -0
  34. package/es/time-picker/TimePicker.mjs +2 -2
  35. package/es/varlet.esm.js +5546 -5256
  36. package/highlight/web-types.en-US.json +336 -89
  37. package/highlight/web-types.zh-CN.json +249 -2
  38. package/lib/style.css +1 -1
  39. package/lib/varlet.cjs.js +2120 -1770
  40. package/package.json +7 -7
  41. package/types/index.d.ts +4 -0
  42. package/types/menuOption.d.ts +20 -0
  43. package/types/menuSelect.d.ts +70 -0
  44. package/umd/varlet.js +6 -6
package/es/style.mjs CHANGED
@@ -45,6 +45,8 @@ import './loading/style/index.mjs'
45
45
  import './loading-bar/style/index.mjs'
46
46
  import './locale/style/index.mjs'
47
47
  import './menu/style/index.mjs'
48
+ import './menu-option/style/index.mjs'
49
+ import './menu-select/style/index.mjs'
48
50
  import './option/style/index.mjs'
49
51
  import './overlay/style/index.mjs'
50
52
  import './pagination/style/index.mjs'
@@ -24,7 +24,7 @@ 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 } from "@varlet/shared";
27
+ import { clamp, isNumber, toNumber, doubleRaf, preventDefault } from "@varlet/shared";
28
28
  import { call, createNamespace } from "../utils/components.mjs";
29
29
  import { onSmartUnmounted, onWindowResize, useTouch } from "@varlet/use";
30
30
  import { usePopup } from "../popup/provide.mjs";
@@ -372,7 +372,7 @@ const __sfc__ = defineComponent({
372
372
  if (!isExpectDirection.value) {
373
373
  return;
374
374
  }
375
- event.preventDefault();
375
+ preventDefault(event);
376
376
  setTrackTranslate(trackTranslate.value + (vertical2 ? moveY.value : moveX.value));
377
377
  }
378
378
  function handleTouchend() {
@@ -397,6 +397,17 @@ const __sfc__ = defineComponent({
397
397
  call(onChange, index.value);
398
398
  }
399
399
  }
400
+ function handleHovering(value) {
401
+ if (props2.navigation === "hover") {
402
+ hovering.value = value;
403
+ }
404
+ }
405
+ function getNavigationAnimation(type) {
406
+ if (props2.navigation !== "hover") {
407
+ return "";
408
+ }
409
+ return n(`--navigation${props2.vertical ? "-vertical" : ""}-${type}-animation`);
410
+ }
400
411
  function resize() {
401
412
  if (!swipeEl.value) {
402
413
  return;
@@ -471,17 +482,6 @@ const __sfc__ = defineComponent({
471
482
  task({ event: index2 === count - 1 ? options == null ? void 0 : options.event : false });
472
483
  });
473
484
  }
474
- const handleHovering = (value) => {
475
- if (props2.navigation === "hover") {
476
- hovering.value = value;
477
- }
478
- };
479
- function getNavigationAnimation(type) {
480
- if (props2.navigation !== "hover") {
481
- return "";
482
- }
483
- return props2.vertical ? n(`--navigation-vertical-${type}-animation`) : n(`--navigation-${type}-animation`);
484
- }
485
485
  return {
486
486
  length,
487
487
  index,
@@ -53,7 +53,8 @@ import progress from "./progress.mjs";
53
53
  import option from "./option.mjs";
54
54
  import countdown from "./countdown.mjs";
55
55
  import watermark from "./watermark.mjs";
56
- var stdin_default = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
56
+ import menuOption from "./menuOption.mjs";
57
+ var stdin_default = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
57
58
  // common
58
59
  "--color-body": "#1e1e1e",
59
60
  "--color-text": "#fff",
@@ -64,7 +65,7 @@ var stdin_default = __spreadValues(__spreadValues(__spreadValues(__spreadValues(
64
65
  "--color-danger": "#ef5350",
65
66
  "--color-disabled": "#404040",
66
67
  "--color-text-disabled": "#757575"
67
- }, button), cell), card), timePicker), datePicker), skeleton), tabs), tab), popup), dialog), actionSheet), chip), badge), uploader), collapse), pullRefresh), switchThemes), steps), pagination), table), fieldDecorator), select), radio), checkbox), divider), picker), appBar), bottomNavigation), bottomNavigationItem), menu), result), breadcrumb), paper), avatar), link), progress), option), countdown), watermark);
68
+ }, button), cell), card), timePicker), datePicker), skeleton), tabs), tab), popup), dialog), actionSheet), chip), badge), uploader), collapse), pullRefresh), switchThemes), steps), pagination), table), fieldDecorator), select), radio), checkbox), divider), picker), appBar), bottomNavigation), bottomNavigationItem), menu), result), breadcrumb), paper), avatar), link), progress), option), countdown), watermark), menuOption);
68
69
  export {
69
70
  stdin_default as default
70
71
  };
@@ -0,0 +1,6 @@
1
+ var stdin_default = {
2
+ "--menu-option-text-color": "#fff"
3
+ };
4
+ export {
5
+ stdin_default as default
6
+ };
@@ -2,7 +2,7 @@ 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 } from "@varlet/shared";
5
+ import { toNumber, getRect, preventDefault } from "@varlet/shared";
6
6
  import { createNamespace, call, formatElevation } from "../utils/components.mjs";
7
7
  import { padStart } from "../utils/shared.mjs";
8
8
  import { getNumberTime, getIsDisableMinute, getIsDisableSecond } from "./utils.mjs";
@@ -358,7 +358,7 @@ const __sfc__ = defineComponent({
358
358
  }
359
359
  }
360
360
  function moveHand(event) {
361
- event.preventDefault();
361
+ preventDefault(event);
362
362
  if (props2.readonly)
363
363
  return;
364
364
  setCenterAndRange();