yc-design-vue 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/es/Alert/index.vue2.js +1 -1
  2. package/es/Badge/index.vue.js +1 -1
  3. package/es/Calendar/Calendar.vue2.js +1 -1
  4. package/es/Carousel/Carousel.vue.js +1 -1
  5. package/es/Carousel/Carousel.vue2.js +9 -10
  6. package/es/Cascader/CascaderIcon.vue2.js +1 -1
  7. package/es/Checkbox/Checkbox.vue2.js +1 -1
  8. package/es/Collapse/CollapseItem.vue2.js +1 -1
  9. package/es/Descriptions/Descriptions.vue.d.ts +1 -1
  10. package/es/Descriptions/index.d.ts +3 -3
  11. package/es/Drawer/Drawer.vue2.js +1 -1
  12. package/es/Grid/GridCol.vue.js +38 -5
  13. package/es/Input/Input.vue2.js +1 -1
  14. package/es/Input/InputSuffix.vue2.js +1 -1
  15. package/es/InputTag/index.vue2.js +1 -1
  16. package/es/Menu/SubMenu.vue2.js +1 -1
  17. package/es/Message/Message.vue2.js +1 -1
  18. package/es/Modal/Modal.vue2.js +1 -1
  19. package/es/Modal/hooks/useModalClose.d.ts +1 -1
  20. package/es/Modal/hooks/useModalClose.js +16 -10
  21. package/es/Notification/Notification.vue2.js +1 -1
  22. package/es/PageHeader/index.vue2.js +1 -1
  23. package/es/Radio/Radio.vue2.js +1 -1
  24. package/es/Select/SelectIcon.vue2.js +1 -1
  25. package/es/Slider/hooks/useContext.js +10 -9
  26. package/es/Tabs/TabButton.vue2.js +1 -1
  27. package/es/Tag/index.vue2.js +1 -1
  28. package/es/Textarea/index.vue2.js +1 -1
  29. package/es/TimePicker/TimePicker.vue2.js +1 -1
  30. package/es/Transfer/TransferPanel.vue2.js +1 -1
  31. package/es/Trigger/index.vue2.js +1 -1
  32. package/es/Typography/TypographyBase.vue2.js +2 -2
  33. package/es/Watermark/index.d.ts +3 -3
  34. package/es/Watermark/index.vue.d.ts +1 -1
  35. package/es/_shared/components/{ExpandTransition.vue2.js → ExpandTransition.vue.js} +1 -1
  36. package/es/_shared/icons/IconCopy.vue.js +1 -16
  37. package/es/_shared/icons/IconCopy.vue2.js +16 -1
  38. package/es/_shared/icons/IconEdit.vue.js +1 -16
  39. package/es/_shared/icons/IconEdit.vue2.js +16 -1
  40. package/es/node_modules/@vueuse/core/index.js +1 -3
  41. package/es/node_modules/@vueuse/shared/index.js +1 -76
  42. package/es/style.css +1 -1
  43. package/lib/Alert/index.vue2.js +1 -1
  44. package/lib/Badge/index.vue.js +1 -1
  45. package/lib/Calendar/Calendar.vue2.js +1 -1
  46. package/lib/Carousel/Carousel.vue.js +1 -1
  47. package/lib/Carousel/Carousel.vue2.js +1 -1
  48. package/lib/Cascader/CascaderIcon.vue2.js +1 -1
  49. package/lib/Checkbox/Checkbox.vue2.js +1 -1
  50. package/lib/Collapse/CollapseItem.vue2.js +1 -1
  51. package/lib/Descriptions/Descriptions.vue.d.ts +1 -1
  52. package/lib/Descriptions/index.d.ts +3 -3
  53. package/lib/Drawer/Drawer.vue2.js +1 -1
  54. package/lib/Grid/GridCol.vue.js +1 -1
  55. package/lib/Input/Input.vue2.js +1 -1
  56. package/lib/Input/InputSuffix.vue2.js +1 -1
  57. package/lib/InputTag/index.vue2.js +1 -1
  58. package/lib/Menu/SubMenu.vue2.js +1 -1
  59. package/lib/Message/Message.vue2.js +1 -1
  60. package/lib/Modal/Modal.vue2.js +1 -1
  61. package/lib/Modal/hooks/useModalClose.d.ts +1 -1
  62. package/lib/Modal/hooks/useModalClose.js +1 -1
  63. package/lib/Notification/Notification.vue2.js +1 -1
  64. package/lib/PageHeader/index.vue2.js +1 -1
  65. package/lib/Radio/Radio.vue2.js +1 -1
  66. package/lib/Select/SelectIcon.vue2.js +1 -1
  67. package/lib/Slider/hooks/useContext.js +1 -1
  68. package/lib/Tabs/TabButton.vue2.js +1 -1
  69. package/lib/Tag/index.vue2.js +1 -1
  70. package/lib/Textarea/index.vue2.js +1 -1
  71. package/lib/TimePicker/TimePicker.vue2.js +1 -1
  72. package/lib/Transfer/TransferPanel.vue2.js +1 -1
  73. package/lib/Trigger/index.vue2.js +1 -1
  74. package/lib/Typography/TypographyBase.vue2.js +1 -1
  75. package/lib/Watermark/index.d.ts +3 -3
  76. package/lib/Watermark/index.vue.d.ts +1 -1
  77. package/lib/_shared/components/ExpandTransition.vue.js +1 -0
  78. package/lib/_shared/icons/IconCopy.vue.js +1 -1
  79. package/lib/_shared/icons/IconCopy.vue2.js +1 -1
  80. package/lib/_shared/icons/IconEdit.vue.js +1 -1
  81. package/lib/_shared/icons/IconEdit.vue2.js +1 -1
  82. package/lib/node_modules/@vueuse/core/index.js +1 -1
  83. package/lib/node_modules/@vueuse/shared/index.js +1 -1
  84. package/lib/style.css +1 -1
  85. package/package.json +1 -1
  86. package/lib/_shared/components/ExpandTransition.vue2.js +0 -1
@@ -6,7 +6,7 @@ import "../_shared/utils/dom.js";
6
6
  import "../_shared/utils/time.js";
7
7
  import "../Empty/index.js";
8
8
  /* empty css */
9
- /* empty css */
9
+ /* empty css */
10
10
  const _hoisted_1 = {
11
11
  key: 0,
12
12
  class: "yc-alert-icon"
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./index.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const _Badge = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d3df3cf9"]]);
4
+ const _Badge = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-03650e28"]]);
5
5
  export {
6
6
  _Badge as default
7
7
  };
@@ -8,7 +8,7 @@ import "../Empty/index.js";
8
8
  import _sfc_main$1 from "../_shared/icons/IconArrowRight.vue.js";
9
9
  import useControlValue from "../_shared/utils/control.js";
10
10
  import IconButton from "../_shared/components/IconButton.vue.js";
11
- /* empty css */
11
+ /* empty css */
12
12
  import Button from "../Button/index.js";
13
13
  import "../Radio/index.js";
14
14
  import MonthCalendar from "./CalendarMonth.vue.js";
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Carousel.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const _Carousel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5285806c"]]);
4
+ const _Carousel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c790779f"]]);
5
5
  export {
6
6
  _Carousel as default
7
7
  };
@@ -8,7 +8,6 @@ import "../Empty/index.js";
8
8
  import useContext from "./hooks/useContext.js";
9
9
  import CarouselArrow from "./CarouselArrow.vue.js";
10
10
  import CarouselIndicator from "./CarouselIndicator.vue.js";
11
- import { useInterval } from "../node_modules/@vueuse/shared/index.js";
12
11
  const _hoisted_1 = {
13
12
  key: 0,
14
13
  class: "yc-carousel-indicator-wrapper"
@@ -42,21 +41,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
41
  const props = __props;
43
42
  const emits = __emit;
44
43
  const { slideTo, computedCurrent, autoPlay, carouselItems } = useContext().provide(props, emits);
45
- let autoPlayTimer = ref(0);
44
+ const autoPlayTimer = ref(0);
46
45
  const stopAutoPlay = () => {
46
+ if (!autoPlayTimer.value) return;
47
47
  clearInterval(autoPlayTimer.value);
48
+ autoPlayTimer.value = 0;
48
49
  };
49
50
  const setAutoPlay = () => {
50
51
  var _a;
51
52
  if (!autoPlay.value) return;
52
- autoPlayTimer = useInterval(
53
- ((_a = autoPlay.value) == null ? void 0 : _a.interval) ?? 3e3,
54
- {
55
- callback: () => {
56
- console.log("定时器触发了");
57
- slideTo(computedCurrent.value + 1);
58
- }
59
- }
53
+ stopAutoPlay();
54
+ autoPlayTimer.value = window.setInterval(
55
+ () => {
56
+ slideTo(computedCurrent.value + 1);
57
+ },
58
+ ((_a = autoPlay.value) == null ? void 0 : _a.interval) ?? 3e3
60
59
  );
61
60
  };
62
61
  const handleChange = async (index) => {
@@ -7,7 +7,7 @@ import "../_shared/utils/time.js";
7
7
  import "../Empty/index.js";
8
8
  /* empty css */
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
- /* empty css */
10
+ /* empty css */
11
11
  import Spin from "../Spin/index.js";
12
12
  const _hoisted_1 = { class: "yc-cascader-suffix-icon" };
13
13
  const _hoisted_2 = {
@@ -9,7 +9,7 @@ import _sfc_main$1 from "../_shared/icons/IconCheckboxChecked.vue.js";
9
9
  import useControlValue from "../_shared/utils/control.js";
10
10
  import useContext from "./hooks/useContext.js";
11
11
  import IconButton from "../_shared/components/IconButton.vue.js";
12
- /* empty css */
12
+ /* empty css */
13
13
  const _hoisted_1 = ["value", "disabled", "checked"];
14
14
  const _hoisted_2 = { class: "yc-checkbox-icon" };
15
15
  const _hoisted_3 = {
@@ -7,7 +7,7 @@ import "../Empty/index.js";
7
7
  /* empty css */
8
8
  import _sfc_main$1 from "../_shared/icons/IconRight.vue.js";
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
- import ExpandTransition from "../_shared/components/ExpandTransition.vue2.js";
10
+ import ExpandTransition from "../_shared/components/ExpandTransition.vue.js";
11
11
  const _hoisted_1 = { class: "yc-collapse-item-header-title text-ellipsis" };
12
12
  const _hoisted_2 = {
13
13
  key: 1,
@@ -13,8 +13,8 @@ declare const __VLS_component: import('vue').DefineComponent<DescriptionsProps,
13
13
  data: DescData[];
14
14
  title: string;
15
15
  bordered: boolean;
16
- align: import('./type').DescriptionsAlign;
17
16
  tableLayout: import('./type').TableLayout;
17
+ align: import('./type').DescriptionsAlign;
18
18
  labelStyle: import('vue').CSSProperties;
19
19
  valueStyle: import('vue').CSSProperties;
20
20
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
@@ -12,8 +12,8 @@ declare const Descriptions: {
12
12
  data: import('./type').DescData[];
13
13
  title: string;
14
14
  bordered: boolean;
15
- align: import('./type').DescriptionsAlign;
16
15
  tableLayout: import('./type').TableLayout;
16
+ align: import('./type').DescriptionsAlign;
17
17
  labelStyle: import('vue').CSSProperties;
18
18
  valueStyle: import('vue').CSSProperties;
19
19
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
@@ -30,8 +30,8 @@ declare const Descriptions: {
30
30
  data: import('./type').DescData[];
31
31
  title: string;
32
32
  bordered: boolean;
33
- align: import('./type').DescriptionsAlign;
34
33
  tableLayout: import('./type').TableLayout;
34
+ align: import('./type').DescriptionsAlign;
35
35
  labelStyle: import('vue').CSSProperties;
36
36
  valueStyle: import('vue').CSSProperties;
37
37
  }>;
@@ -45,8 +45,8 @@ declare const Descriptions: {
45
45
  data: import('./type').DescData[];
46
46
  title: string;
47
47
  bordered: boolean;
48
- align: import('./type').DescriptionsAlign;
49
48
  tableLayout: import('./type').TableLayout;
49
+ align: import('./type').DescriptionsAlign;
50
50
  labelStyle: import('vue').CSSProperties;
51
51
  valueStyle: import('vue').CSSProperties;
52
52
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
@@ -6,7 +6,7 @@ import { getGlobalConfig } from "../_shared/utils/global-config.js";
6
6
  import useModalClose from "../Modal/hooks/useModalClose.js";
7
7
  import Button from "../Button/index.js";
8
8
  import IconButton from "../_shared/components/IconButton.vue.js";
9
- /* empty css */
9
+ /* empty css */
10
10
  /* empty css */
11
11
  const _hoisted_1 = {
12
12
  key: 0,
@@ -1,6 +1,7 @@
1
1
  import { defineComponent, toRefs, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot } from "vue";
2
2
  import "../node_modules/tinycolor2/esm/tinycolor.js";
3
3
  import { getBreakpointValue, valueToPx } from "../_shared/utils/dom.js";
4
+ import { isString } from "../_shared/utils/is.js";
4
5
  import "../_shared/utils/time.js";
5
6
  import "../Empty/index.js";
6
7
  /* empty css */
@@ -21,12 +22,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
22
  const { span, order, offset, flex } = toRefs(props);
22
23
  const { gutter, div, breakpoint } = useContext().inject();
23
24
  const style = computed(() => {
25
+ const curFlex = getBreakpointValue(breakpoint.value, flex.value);
26
+ const curSpan = getBreakpointValue(
27
+ breakpoint.value,
28
+ span.value,
29
+ 24
30
+ );
31
+ const curOffset = getBreakpointValue(
32
+ breakpoint.value,
33
+ offset.value,
34
+ 0
35
+ );
36
+ const baseStyle = {
37
+ padding: `${valueToPx(gutter.value[1] / 2)} ${valueToPx(
38
+ gutter.value[0] / 2
39
+ )}`,
40
+ order: getBreakpointValue(breakpoint.value, order.value, 0)
41
+ };
42
+ if (!curFlex) {
43
+ if (!curSpan) {
44
+ return {
45
+ display: "none"
46
+ };
47
+ }
48
+ return {
49
+ ...baseStyle,
50
+ flex: `0 0 ${curSpan / 24 * 100}%`,
51
+ marginLeft: `calc(${curOffset / 24 * 100}%)`
52
+ };
53
+ }
54
+ let styleFlex = "";
55
+ if (isString(curFlex)) {
56
+ styleFlex = /\d/.test(curFlex) ? `0 0 ${curFlex}` : curFlex;
57
+ } else {
58
+ styleFlex = `${curFlex} 1 0%`;
59
+ }
24
60
  return {
25
- width: `calc((100% / 24) * ${getBreakpointValue(breakpoint.value, span.value, 24)})`,
26
- padding: `${valueToPx(gutter.value[1] / 2)} ${valueToPx(gutter.value[0] / 2)}`,
27
- marginLeft: offset.value ? `calc((100% / 24) * ${getBreakpointValue(breakpoint.value, offset.value, 0)})` : "",
28
- order: getBreakpointValue(breakpoint.value, order.value),
29
- flex: getBreakpointValue(breakpoint.value, flex.value)
61
+ ...baseStyle,
62
+ flex: styleFlex
30
63
  };
31
64
  });
32
65
  return (_ctx, _cache) => {
@@ -7,7 +7,7 @@ import useControlValue from "../_shared/utils/control.js";
7
7
  import useLimitedInput from "./hooks/useLimitedInput.js";
8
8
  import IconButton from "../_shared/components/IconButton.vue.js";
9
9
  import _sfc_main$1 from "../_shared/components/PreventFocus.vue.js";
10
- /* empty css */
10
+ /* empty css */
11
11
  /* empty css */
12
12
  import InputSuffix from "./InputSuffix.vue.js";
13
13
  const _hoisted_1 = ["value", "type", "disabled", "readonly", "placeholder"];
@@ -8,7 +8,7 @@ import _sfc_main$3 from "../_shared/icons/IconEyeClose.vue2.js";
8
8
  import _sfc_main$2 from "../_shared/icons/IconEyeOpen.vue2.js";
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
10
  import _sfc_main$1 from "../_shared/components/PreventFocus.vue.js";
11
- /* empty css */
11
+ /* empty css */
12
12
  const _hoisted_1 = {
13
13
  key: 0,
14
14
  class: "yc-input-word-limit"
@@ -10,7 +10,7 @@ import useControlValue from "../_shared/utils/control.js";
10
10
  import Tag from "../Tag/index.js";
11
11
  import IconButton from "../_shared/components/IconButton.vue.js";
12
12
  import _sfc_main$1 from "../_shared/components/PreventFocus.vue.js";
13
- /* empty css */
13
+ /* empty css */
14
14
  /* empty css */
15
15
  const _hoisted_1 = ["disabled", "readonly", "placeholder"];
16
16
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -7,7 +7,7 @@ import "../_shared/utils/time.js";
7
7
  import "../Empty/index.js";
8
8
  /* empty css */
9
9
  /* empty css */
10
- import ExpandTransition from "../_shared/components/ExpandTransition.vue2.js";
10
+ import ExpandTransition from "../_shared/components/ExpandTransition.vue.js";
11
11
  import "./index.js";
12
12
  import MenuItem from "./MenuItem.vue.js";
13
13
  const _hoisted_1 = { class: "yc-menu-inline" };
@@ -7,7 +7,7 @@ import "../Empty/index.js";
7
7
  /* empty css */
8
8
  import { TYPE_ICON_MAP } from "../_shared/constants/index.js";
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
- /* empty css */
10
+ /* empty css */
11
11
  import { useTimeoutFn } from "../node_modules/@vueuse/shared/index.js";
12
12
  const _hoisted_1 = {
13
13
  key: 0,
@@ -7,7 +7,7 @@ import useModalClose from "./hooks/useModalClose.js";
7
7
  import useModalDraggable from "./hooks/useModalDraggable.js";
8
8
  import Button from "../Button/index.js";
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
- /* empty css */
10
+ /* empty css */
11
11
  /* empty css */
12
12
  const _hoisted_1 = {
13
13
  key: 0,
@@ -12,7 +12,7 @@ declare const _default: (params: {
12
12
  }) => {
13
13
  asyncLoading: Ref<boolean, boolean>;
14
14
  outerVisible: Ref<boolean, boolean>;
15
- innerVisible: import('vue').WritableComputedRef<any, boolean>;
15
+ innerVisible: Ref<boolean, boolean>;
16
16
  handleClose: (type: CloseEventType, ev: MouseEvent | KeyboardEvent, cancelEmits?: boolean) => Promise<void>;
17
17
  handleAfterLeave: () => void;
18
18
  };
@@ -1,4 +1,4 @@
1
- import { ref, watch } from "vue";
1
+ import { ref, watch, nextTick } from "vue";
2
2
  import { onKeyStroke } from "../../node_modules/@vueuse/core/index.js";
3
3
  import "../../node_modules/tinycolor2/esm/tinycolor.js";
4
4
  import "../../_shared/utils/dom.js";
@@ -17,15 +17,16 @@ const useModalClose = (params) => {
17
17
  onBeforeOk,
18
18
  emits
19
19
  } = params;
20
- const outerVisible = ref(false);
21
- const asyncLoading = ref(false);
22
- const innerVisible = useControlValue(
20
+ const computedVisible = useControlValue(
23
21
  visible,
24
22
  defaultVisible.value,
25
23
  (val) => {
26
24
  emits("update:visible", val);
27
25
  }
28
26
  );
27
+ const outerVisible = ref(false);
28
+ const innerVisible = ref(false);
29
+ const asyncLoading = ref(false);
29
30
  const handleAfterLeave = () => {
30
31
  emits("close");
31
32
  outerVisible.value = false;
@@ -42,19 +43,24 @@ const useModalClose = (params) => {
42
43
  emits("ok");
43
44
  }
44
45
  cancelEmits && emits("cancel", ev);
45
- innerVisible.value = false;
46
+ computedVisible.value = false;
46
47
  };
47
48
  if (escToClose.value) {
48
49
  onKeyStroke(["Escape"], (ev) => {
49
- if (!innerVisible.value) return;
50
+ if (!computedVisible.value) return;
50
51
  handleClose("esc", ev);
51
52
  });
52
53
  }
53
54
  watch(
54
- () => innerVisible.value,
55
- (val) => {
56
- if (!val) return;
57
- outerVisible.value = val;
55
+ () => computedVisible.value,
56
+ async (val) => {
57
+ if (!val) {
58
+ innerVisible.value = val;
59
+ } else {
60
+ outerVisible.value = val;
61
+ await nextTick();
62
+ innerVisible.value = val;
63
+ }
58
64
  },
59
65
  {
60
66
  immediate: true
@@ -8,7 +8,7 @@ import { getSlotFunction } from "../_shared/utils/vue-utils.js";
8
8
  import "../Empty/index.js";
9
9
  /* empty css */
10
10
  import IconButton from "../_shared/components/IconButton.vue.js";
11
- /* empty css */
11
+ /* empty css */
12
12
  import { useTimeoutFn } from "../node_modules/@vueuse/shared/index.js";
13
13
  const _hoisted_1 = { class: "yc-notification-left" };
14
14
  const _hoisted_2 = {
@@ -7,7 +7,7 @@ import "../Empty/index.js";
7
7
  import _sfc_main$1 from "../_shared/icons/IconArrowRight.vue.js";
8
8
  import Divider from "../Divider/index.js";
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
- /* empty css */
10
+ /* empty css */
11
11
  const _hoisted_1 = { class: "yc-page-header" };
12
12
  const _hoisted_2 = { class: "yc-page-header-wrapper" };
13
13
  const _hoisted_3 = {
@@ -7,7 +7,7 @@ import "../Empty/index.js";
7
7
  import useControlValue from "../_shared/utils/control.js";
8
8
  import useContext from "./hooks/useContext.js";
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
- /* empty css */
10
+ /* empty css */
11
11
  const _hoisted_1 = ["value", "checked", "disabled"];
12
12
  const _hoisted_2 = {
13
13
  key: 0,
@@ -7,7 +7,7 @@ import "../_shared/utils/time.js";
7
7
  import "../Empty/index.js";
8
8
  /* empty css */
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
- /* empty css */
10
+ /* empty css */
11
11
  import Spin from "../Spin/index.js";
12
12
  const _hoisted_1 = { class: "yc-select-suffix-icon" };
13
13
  const _hoisted_2 = {
@@ -84,17 +84,18 @@ const useContext = () => {
84
84
  return decimalIndex === -1 ? 0 : str.length - decimalIndex - 1;
85
85
  }
86
86
  function normalizeValue(value) {
87
- const totalSteps = (max.value - min.value) / step.value;
88
- const currentStep = (value - min.value) / step.value;
89
- const normalized = currentStep / totalSteps * 100;
90
- return Math.round(normalized);
87
+ if (max.value - min.value === 0) return 0;
88
+ const normalized = (value - min.value) / (max.value - min.value) * 100;
89
+ return normalized;
91
90
  }
92
- function denormalizeValue(value) {
93
- const totalSteps = (max.value - min.value) / step.value;
94
- const stepPosition = value / 100 * totalSteps;
95
- const exactValue = min.value + stepPosition * step.value;
91
+ function denormalizeValue(percent) {
92
+ const estimatedValue = min.value + percent / 100 * (max.value - min.value);
93
+ const steps = (estimatedValue - min.value) / step.value;
94
+ const closestStep = Math.round(steps);
95
+ const finalValue = min.value + closestStep * step.value;
96
96
  const digit = getDecimalPlaces(step.value);
97
- return +(Math.round(exactValue / step.value) * step.value).toFixed(digit);
97
+ const clampedValue = Math.max(min.value, Math.min(finalValue, max.value));
98
+ return +clampedValue.toFixed(digit);
98
99
  }
99
100
  provide(SLIDER_CONTEXT_KEY, {
100
101
  startValue,
@@ -5,7 +5,7 @@ import "../_shared/utils/dom.js";
5
5
  import "../_shared/utils/time.js";
6
6
  import "../Empty/index.js";
7
7
  /* empty css */
8
- /* empty css */
8
+ /* empty css */
9
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
10
10
  __name: "TabButton",
11
11
  props: {
@@ -7,7 +7,7 @@ import { getGlobalConfig } from "../_shared/utils/global-config.js";
7
7
  import useControlValue from "../_shared/utils/control.js";
8
8
  import Spin from "../Spin/index.js";
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
- /* empty css */
10
+ /* empty css */
11
11
  /* empty css */
12
12
  const _hoisted_1 = {
13
13
  key: 0,
@@ -8,7 +8,7 @@ import "../_shared/utils/dom.js";
8
8
  import "../_shared/utils/time.js";
9
9
  import "../Empty/index.js";
10
10
  /* empty css */
11
- /* empty css */
11
+ /* empty css */
12
12
  const _hoisted_1 = ["value", "disabled", "readonly", "placeholder"];
13
13
  const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  ...{
@@ -6,7 +6,7 @@ import { isValidTimeRange } from "../_shared/utils/time.js";
6
6
  import { getGlobalConfig } from "../_shared/utils/global-config.js";
7
7
  import useContext from "./hooks/useContext.js";
8
8
  import IconButton from "../_shared/components/IconButton.vue.js";
9
- /* empty css */
9
+ /* empty css */
10
10
  /* empty css */
11
11
  import _sfc_main$1 from "../_shared/icons/IconTime.vue.js";
12
12
  import Trigger from "../Trigger/index.js";
@@ -12,7 +12,7 @@ import Checkbox from "../Checkbox/index.js";
12
12
  import Scrollbar from "../Scrollbar/index.js";
13
13
  import Input from "../Input/index.js";
14
14
  import IconButton from "../_shared/components/IconButton.vue.js";
15
- /* empty css */
15
+ /* empty css */
16
16
  const _hoisted_1 = { class: "yc-transfer-view" };
17
17
  const _hoisted_2 = { class: "yc-transfer-view-header" };
18
18
  const _hoisted_3 = { class: "yc-transfer-view-header-title" };
@@ -9,7 +9,7 @@ import useTriggerPosition from "./hooks/useTriggerPosition.js";
9
9
  /* empty css */
10
10
  /* empty css */
11
11
  import _sfc_main$1 from "../_shared/components/PreventFocus.vue.js";
12
- /* empty css */
12
+ /* empty css */
13
13
  const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  ...{
15
15
  name: "Trigger",
@@ -5,8 +5,8 @@ import { getDomText, sleep } from "../_shared/utils/dom.js";
5
5
  import "../_shared/utils/time.js";
6
6
  import "../Empty/index.js";
7
7
  /* empty css */
8
- import _sfc_main$3 from "../_shared/icons/IconCopy.vue.js";
9
- import _sfc_main$1 from "../_shared/icons/IconEdit.vue.js";
8
+ import _sfc_main$3 from "../_shared/icons/IconCopy.vue2.js";
9
+ import _sfc_main$1 from "../_shared/icons/IconEdit.vue2.js";
10
10
  import _sfc_main$2 from "../_shared/icons/IconInfo.vue.js";
11
11
  import useControlValue from "../_shared/utils/control.js";
12
12
  import Input from "../Input/index.js";
@@ -13,8 +13,8 @@ declare const Watermark: {
13
13
  rotate: number;
14
14
  image: string;
15
15
  offset: number[];
16
- gap: number[];
17
16
  font: import('./type').WatermarkFont;
17
+ gap: number[];
18
18
  grayscale: boolean;
19
19
  staggered: boolean;
20
20
  antiTamper: boolean;
@@ -37,8 +37,8 @@ declare const Watermark: {
37
37
  rotate: number;
38
38
  image: string;
39
39
  offset: number[];
40
- gap: number[];
41
40
  font: import('./type').WatermarkFont;
41
+ gap: number[];
42
42
  grayscale: boolean;
43
43
  staggered: boolean;
44
44
  antiTamper: boolean;
@@ -56,8 +56,8 @@ declare const Watermark: {
56
56
  rotate: number;
57
57
  image: string;
58
58
  offset: number[];
59
- gap: number[];
60
59
  font: import('./type').WatermarkFont;
60
+ gap: number[];
61
61
  grayscale: boolean;
62
62
  staggered: boolean;
63
63
  antiTamper: boolean;
@@ -18,8 +18,8 @@ declare const __VLS_component: import('vue').DefineComponent<WatermarkProps, {},
18
18
  rotate: number;
19
19
  image: string;
20
20
  offset: number[];
21
- gap: number[];
22
21
  font: import('./type').WatermarkFont;
22
+ gap: number[];
23
23
  grayscale: boolean;
24
24
  staggered: boolean;
25
25
  antiTamper: boolean;
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from "./ExpandTransition.vue3.js";
2
- /* empty css */
2
+ /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const ExpandTransition = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6e588238"]]);
5
5
  export {
@@ -1,19 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
- import YcIcon from "../components/Icon.vue2.js";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
- __name: "IconCopy",
5
- setup(__props) {
6
- return (_ctx, _cache) => {
7
- return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
8
- default: withCtx(() => _cache[0] || (_cache[0] = [
9
- createElementVNode("path", { d: "M20 6h18a2 2 0 0 1 2 2v22M8 16v24c0 1.105.891 2 1.996 2h20.007A1.99 1.99 0 0 0 32 40.008V15.997A1.997 1.997 0 0 0 30 14H10a2 2 0 0 0-2 2Z" }, null, -1)
10
- ])),
11
- _: 1,
12
- __: [0]
13
- }, 16);
14
- };
15
- }
16
- });
1
+ import _sfc_main from "./IconCopy.vue2.js";
17
2
  export {
18
3
  _sfc_main as default
19
4
  };
@@ -1,4 +1,19 @@
1
- import _sfc_main from "./IconCopy.vue.js";
1
+ import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
+ import YcIcon from "../components/Icon.vue2.js";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "IconCopy",
5
+ setup(__props) {
6
+ return (_ctx, _cache) => {
7
+ return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
8
+ default: withCtx(() => _cache[0] || (_cache[0] = [
9
+ createElementVNode("path", { d: "M20 6h18a2 2 0 0 1 2 2v22M8 16v24c0 1.105.891 2 1.996 2h20.007A1.99 1.99 0 0 0 32 40.008V15.997A1.997 1.997 0 0 0 30 14H10a2 2 0 0 0-2 2Z" }, null, -1)
10
+ ])),
11
+ _: 1,
12
+ __: [0]
13
+ }, 16);
14
+ };
15
+ }
16
+ });
2
17
  export {
3
18
  _sfc_main as default
4
19
  };
@@ -1,19 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
- import YcIcon from "../components/Icon.vue2.js";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
- __name: "IconEdit",
5
- setup(__props) {
6
- return (_ctx, _cache) => {
7
- return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
8
- default: withCtx(() => _cache[0] || (_cache[0] = [
9
- createElementVNode("path", { d: "m30.48 19.038 5.733-5.734a1 1 0 0 0 0-1.414l-5.586-5.586a1 1 0 0 0-1.414 0l-5.734 5.734m7 7L15.763 33.754a1 1 0 0 1-.59.286l-6.048.708a1 1 0 0 1-1.113-1.069l.477-6.31a1 1 0 0 1 .29-.631l14.7-14.7m7 7-7-7M6 42h36" }, null, -1)
10
- ])),
11
- _: 1,
12
- __: [0]
13
- }, 16);
14
- };
15
- }
16
- });
1
+ import _sfc_main from "./IconEdit.vue2.js";
17
2
  export {
18
3
  _sfc_main as default
19
4
  };
@@ -1,4 +1,19 @@
1
- import _sfc_main from "./IconEdit.vue.js";
1
+ import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
+ import YcIcon from "../components/Icon.vue2.js";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "IconEdit",
5
+ setup(__props) {
6
+ return (_ctx, _cache) => {
7
+ return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
8
+ default: withCtx(() => _cache[0] || (_cache[0] = [
9
+ createElementVNode("path", { d: "m30.48 19.038 5.733-5.734a1 1 0 0 0 0-1.414l-5.586-5.586a1 1 0 0 0-1.414 0l-5.734 5.734m7 7L15.763 33.754a1 1 0 0 1-.59.286l-6.048.708a1 1 0 0 1-1.113-1.069l.477-6.31a1 1 0 0 1 .29-.631l14.7-14.7m7 7-7-7M6 42h36" }, null, -1)
10
+ ])),
11
+ _: 1,
12
+ __: [0]
13
+ }, 16);
14
+ };
15
+ }
16
+ });
2
17
  export {
3
18
  _sfc_main as default
4
19
  };