@varlet/ui 2.11.4 → 2.11.6-alpha.1686800314469

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 (45) hide show
  1. package/es/app-bar/AppBar.mjs +2 -2
  2. package/es/avatar/Avatar.mjs +2 -2
  3. package/es/back-top/BackTop.mjs +3 -3
  4. package/es/bottom-navigation/BottomNavigation.mjs +2 -2
  5. package/es/button/button.css +1 -1
  6. package/es/date-picker/date-picker.css +1 -1
  7. package/es/date-picker/src/day-picker-panel.mjs +2 -2
  8. package/es/date-picker/src/year-picker-panel.mjs +2 -2
  9. package/es/divider/Divider.mjs +2 -2
  10. package/es/field-decorator/FieldDecorator.mjs +3 -3
  11. package/es/index-bar/IndexBar.mjs +2 -2
  12. package/es/index.bundle.mjs +1 -1
  13. package/es/index.mjs +1 -1
  14. package/es/input/Input.mjs +2 -2
  15. package/es/link/link.css +1 -1
  16. package/es/list/List.mjs +4 -5
  17. package/es/pagination/Pagination.mjs +2 -2
  18. package/es/pull-refresh/PullRefresh.mjs +2 -2
  19. package/es/rate/Rate.mjs +13 -2
  20. package/es/rate/props.mjs +4 -0
  21. package/es/rate/rate.css +1 -1
  22. package/es/slider/Slider.mjs +2 -2
  23. package/es/snackbar/core.mjs +2 -2
  24. package/es/snackbar/style/index.mjs +1 -1
  25. package/es/step/Step.mjs +7 -38
  26. package/es/step/step.css +1 -1
  27. package/es/steps/Steps.mjs +0 -2
  28. package/es/steps/provide.mjs +0 -2
  29. package/es/sticky/Sticky.mjs +5 -6
  30. package/es/style.css +1 -1
  31. package/es/swipe/Swipe.mjs +4 -5
  32. package/es/switch/Switch.mjs +1 -4
  33. package/es/tabs/Tabs.mjs +2 -2
  34. package/es/themes/dark/button.mjs +2 -1
  35. package/es/themes/dark/index.mjs +2 -1
  36. package/es/themes/dark/link.mjs +3 -0
  37. package/es/time-picker/timePicker.css +1 -1
  38. package/es/varlet.esm.js +4324 -4337
  39. package/highlight/web-types.en-US.json +1 -1
  40. package/highlight/web-types.zh-CN.json +10 -1
  41. package/lib/style.css +1 -1
  42. package/lib/varlet.cjs.js +120 -136
  43. package/package.json +6 -6
  44. package/types/rate.d.ts +1 -0
  45. package/umd/varlet.js +5 -5
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, onUpdated, computed } from 'vue';
2
2
  import { props } from './props.mjs';
3
3
  import { createNamespace, formatElevation } from '../utils/components.mjs';
4
- import { useMounted } from '@varlet/use';
4
+ import { onSmartMounted } from '@varlet/use';
5
5
  var {
6
6
  n,
7
7
  classes
@@ -94,7 +94,7 @@ var __sfc__ = defineComponent({
94
94
  color: textColor
95
95
  };
96
96
  });
97
- useMounted(computePadding);
97
+ onSmartMounted(computePadding);
98
98
  onUpdated(computePadding);
99
99
  return {
100
100
  n,
@@ -3,7 +3,7 @@ import { defineComponent, ref, onUpdated } from 'vue';
3
3
  import { props, internalSizeValidator, sizeValidator } from './props.mjs';
4
4
  import { toSizeUnit } from '../utils/elements.mjs';
5
5
  import { createNamespace, call } from '../utils/components.mjs';
6
- import { useMounted } from '@varlet/use';
6
+ import { onSmartMounted } from '@varlet/use';
7
7
  var {
8
8
  n,
9
9
  classes
@@ -129,7 +129,7 @@ var __sfc__ = defineComponent({
129
129
  call(props.onClick, e);
130
130
  };
131
131
 
132
- useMounted(getScale);
132
+ onSmartMounted(getScale);
133
133
  onUpdated(getScale);
134
134
  return {
135
135
  internalSizeValidator,
@@ -1,11 +1,12 @@
1
1
  import VarButton from '../button/index.mjs';
2
2
  import VarIcon from '../icon/index.mjs';
3
- import { defineComponent, ref, onBeforeUnmount, onDeactivated, onMounted, onActivated } from 'vue';
3
+ import { defineComponent, ref, onMounted, onActivated } from 'vue';
4
4
  import { props } from './props.mjs';
5
5
  import { throttle } from '@varlet/shared';
6
6
  import { easeInOutCubic } from '../utils/shared.mjs';
7
7
  import { getScrollTop, getScrollLeft, scrollTo, getParentScroller, toPxNum, toSizeUnit, getTarget } from '../utils/elements.mjs';
8
8
  import { call, createNamespace } from '../utils/components.mjs';
9
+ import { onSmartUnmounted } from '@varlet/use';
9
10
  var {
10
11
  n,
11
12
  classes
@@ -99,8 +100,7 @@ var __sfc__ = defineComponent({
99
100
  disabled.value = false;
100
101
  });
101
102
  onActivated(addScrollerEventListener);
102
- onBeforeUnmount(removeScrollerEventListener);
103
- onDeactivated(removeScrollerEventListener);
103
+ onSmartUnmounted(removeScrollerEventListener);
104
104
  return {
105
105
  disabled,
106
106
  show,
@@ -6,7 +6,7 @@ import { props } from './props.mjs';
6
6
  import { useBottomNavigationItems } from './provide.mjs';
7
7
  import { createNamespace, call } from '../utils/components.mjs';
8
8
  import { isNumber, normalizeToArray } from '@varlet/shared';
9
- import { useMounted } from '@varlet/use';
9
+ import { onSmartMounted } from '@varlet/use';
10
10
  var {
11
11
  n,
12
12
  classes
@@ -186,7 +186,7 @@ var __sfc__ = defineComponent({
186
186
  immediate: true,
187
187
  deep: true
188
188
  });
189
- useMounted(() => {
189
+ onSmartMounted(() => {
190
190
  if (!slots.fab) {
191
191
  return;
192
192
  }
@@ -1 +1 @@
1
- :root { --button-default-color: #f5f5f5; --button-primary-color: var(--color-primary); --button-danger-color: var(--color-danger); --button-success-color: var(--color-success); --button-warning-color: var(--color-warning); --button-info-color: var(--color-info); --button-disabled-color: var(--color-disabled); --button-disabled-text-color: var(--color-text-disabled); --button-border-radius: 4px; --button-mini-padding: 0 9px; --button-small-padding: 0 11px; --button-normal-padding: 0 15px; --button-large-padding: 0 22px; --button-round-padding: 6px; --button-mini-height: 20px; --button-small-height: 28px; --button-normal-height: 36px; --button-large-height: 44px; --button-mini-font-size: var(--font-size-xs); --button-small-font-size: var(--font-size-sm); --button-normal-font-size: var(--font-size-md); --button-large-font-size: var(--font-size-lg);}.var-button { position: relative; justify-content: center; align-items: center; outline: none; border: none; border-radius: var(--button-border-radius); user-select: none; cursor: pointer; font-family: inherit; transition: box-shadow 0.2s, background-color 0.25s; will-change: box-shadow; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); white-space: nowrap;}.var-button:active { box-shadow: 0 3px 5px -1px var(--shadow-key-umbra-opacity), 0 5px 8px 0 var(--shadow-key-penumbra-opacity), 0 1px 14px 0 var(--shadow-key-ambient-opacity);}.var-button__content { display: flex; align-items: center; flex-wrap: wrap;}.var-button__loading[var-button-cover] { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);}.var-button--default { color: inherit; background-color: var(--button-default-color);}.var-button--primary { color: #fff; background-color: var(--button-primary-color);}.var-button--info { color: #fff; background-color: var(--button-info-color);}.var-button--success { color: #fff; background-color: var(--button-success-color);}.var-button--warning { color: #fff; background-color: var(--button-warning-color);}.var-button--danger { color: #fff; background-color: var(--button-danger-color);}.var-button--disabled { background-color: var(--button-disabled-color); color: var(--button-disabled-text-color); cursor: not-allowed; box-shadow: none !important;}.var-button--block { width: 100%;}.var-button--text { background-color: transparent;}.var-button--text:active { box-shadow: none;}.var-button--text-default { color: inherit;}.var-button--text-primary { color: var(--button-primary-color);}.var-button--text-info { color: var(--button-info-color);}.var-button--text-success { color: var(--button-success-color);}.var-button--text-warning { color: var(--button-warning-color);}.var-button--text-danger { color: var(--button-danger-color);}.var-button--text-disabled { color: var(--button-disabled-text-color);}.var-button--normal { height: var(--button-normal-height); padding: var(--button-normal-padding); font-size: var(--button-normal-font-size);}.var-button--large { height: var(--button-large-height); padding: var(--button-large-padding); font-size: var(--button-large-font-size);}.var-button--small { height: var(--button-small-height); padding: var(--button-small-padding); font-size: var(--button-small-font-size);}.var-button--mini { height: var(--button-mini-height); padding: var(--button-mini-padding); font-size: var(--button-mini-font-size);}.var-button--round { padding: var(--button-round-padding); border-radius: 50%; height: auto;}.var-button--outline { border: thin solid currentColor;}.var-button--hidden { opacity: 0;}
1
+ :root { --button-default-color: #f5f5f5; --button-default-text-color: #555; --button-primary-color: var(--color-primary); --button-danger-color: var(--color-danger); --button-success-color: var(--color-success); --button-warning-color: var(--color-warning); --button-info-color: var(--color-info); --button-disabled-color: var(--color-disabled); --button-disabled-text-color: var(--color-text-disabled); --button-border-radius: 4px; --button-mini-padding: 0 9px; --button-small-padding: 0 11px; --button-normal-padding: 0 15px; --button-large-padding: 0 22px; --button-round-padding: 6px; --button-mini-height: 20px; --button-small-height: 28px; --button-normal-height: 36px; --button-large-height: 44px; --button-mini-font-size: var(--font-size-xs); --button-small-font-size: var(--font-size-sm); --button-normal-font-size: var(--font-size-md); --button-large-font-size: var(--font-size-lg);}.var-button { position: relative; justify-content: center; align-items: center; outline: none; border: none; border-radius: var(--button-border-radius); user-select: none; cursor: pointer; font-family: inherit; transition: box-shadow 0.2s, background-color 0.25s; will-change: box-shadow; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); white-space: nowrap;}.var-button:active { box-shadow: 0 3px 5px -1px var(--shadow-key-umbra-opacity), 0 5px 8px 0 var(--shadow-key-penumbra-opacity), 0 1px 14px 0 var(--shadow-key-ambient-opacity);}.var-button__content { display: flex; align-items: center; flex-wrap: wrap;}.var-button__loading[var-button-cover] { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);}.var-button--default { color: var(--button-default-text-color); background-color: var(--button-default-color);}.var-button--primary { color: #fff; background-color: var(--button-primary-color);}.var-button--info { color: #fff; background-color: var(--button-info-color);}.var-button--success { color: #fff; background-color: var(--button-success-color);}.var-button--warning { color: #fff; background-color: var(--button-warning-color);}.var-button--danger { color: #fff; background-color: var(--button-danger-color);}.var-button--disabled { background-color: var(--button-disabled-color); color: var(--button-disabled-text-color); cursor: not-allowed; box-shadow: none !important;}.var-button--block { width: 100%;}.var-button--text { background-color: transparent;}.var-button--text:active { box-shadow: none;}.var-button--text-default { color: inherit;}.var-button--text-primary { color: var(--button-primary-color);}.var-button--text-info { color: var(--button-info-color);}.var-button--text-success { color: var(--button-success-color);}.var-button--text-warning { color: var(--button-warning-color);}.var-button--text-danger { color: var(--button-danger-color);}.var-button--text-disabled { color: var(--button-disabled-text-color);}.var-button--normal { height: var(--button-normal-height); padding: var(--button-normal-padding); font-size: var(--button-normal-font-size);}.var-button--large { height: var(--button-large-height); padding: var(--button-large-padding); font-size: var(--button-large-font-size);}.var-button--small { height: var(--button-small-height); padding: var(--button-small-padding); font-size: var(--button-small-font-size);}.var-button--mini { height: var(--button-mini-height); padding: var(--button-mini-padding); font-size: var(--button-mini-font-size);}.var-button--round { padding: var(--button-round-padding); border-radius: 50%; height: auto;}.var-button--outline { border: thin solid currentColor;}.var-button--hidden { opacity: 0;}
@@ -1 +1 @@
1
- :root { --date-picker-border-radius: 4px; --date-picker-font-size: var(--font-size-md); --date-picker-min-width: 290px; --date-picker-height: 385px; --date-picker-main-color: rgba(0, 0, 0, 0.87); --date-picker-title-padding: 16px; --date-picker-title-background: var(--color-primary); --date-picker-title-color: #fff; --date-picker-title-year-font-size: var(--font-size-md); --date-picker-title-year-font-weight: 500; --date-picker-title-year-margin-bottom: 8px; --date-picker-title-date-height: 48px; --date-picker-title-date-font-size: 34px; --date-picker-title-date-font-weight: 500; --date-picker-title-date-range-font-size: 20px; --date-picker-body-background-color: transparent; --picker-header-padding: 4px 16px; --month-picker-padding: 0 12px; --month-picker-item-width: 33%; --month-picker-item-height: 56px; --month-picker-item-button-max-width: 140px; --year-picker-font-weight: 400; --year-picker-item-padding: 8px 0; --year-picker-item-active-font-size: 26px; --year-picker-item-active-font-weight: 500; --year-picker-item-active-font-padding: 10px 0; --year-picker-item-active-color: var(--color-primary); --day-picker-content-item-width: 14.28%; --day-picker-content-item-font-size: var(--font-size-sm); --day-picker-content-item-padding: 2px 0; --day-picker-content-item-button-width: 32px; --day-picker-content-item-button-height: 32px; --day-picker-content-item-button-font-size: var(--font-size-sm); --day-picker-head-item-color: rgba(0, 0, 0, 0.38); --day-picker-head-item-padding: 8px 0; --day-picker-head-item-font-weight: 600;}.var-date-picker { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: var(--date-picker-border-radius); contain: layout style; display: flex; width: 100%; flex-direction: column; font-size: var(--date-picker-font-size); position: relative; min-width: var(--date-picker-min-width); height: var(--date-picker-height); overflow: hidden;}.var-date-picker ul { list-style: none; margin: 0; padding: 0;}.var-date-picker__title { padding: var(--date-picker-title-padding); color: var(--date-picker-title-color); background: var(--date-picker-title-background); display: flex; justify-content: space-between; flex-direction: column; flex-wrap: wrap;}.var-date-picker__title-year { opacity: 0.6; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: inline-flex; font-size: var(--date-picker-title-year-font-size); font-weight: var(--date-picker-title-year-font-weight); margin-bottom: var(--date-picker-title-year-margin-bottom); transition: 0.3s var(--cubic-bezier);}.var-date-picker__title-year--active { opacity: 1;}.var-date-picker__title-date { height: var(--date-picker-title-date-height); overflow: hidden; font-size: var(--date-picker-title-date-font-size); text-align: left; font-weight: var(--date-picker-title-date-font-weight); position: relative; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); display: flex; align-items: center; opacity: 0.6; transition: 0.3s var(--cubic-bezier);}.var-date-picker__title-date--active { opacity: 1;}.var-date-picker__title-date--range { font-size: var(--date-picker-title-date-range-font-size);}.var-date-picker__body { flex: 1; position: relative; overflow: auto; background-color: var(--date-picker-body-background-color);}.var-date-picker__body::-webkit-scrollbar { display: none; width: 0; background: transparent;}.var-date-picker .var-picker-header { padding: var(--picker-header-padding); align-items: center; display: flex; justify-content: space-between; position: relative;}.var-date-picker .var-picker-header__value { flex: 1; text-align: center; position: relative; overflow: hidden; font-weight: 700; cursor: pointer; user-select: none;}.var-date-picker .var-picker-header__value div { width: 100%;}.var-date-picker .var-month-picker__content { padding: var(--month-picker-padding);}.var-date-picker .var-month-picker__content ul { display: flex; flex-wrap: wrap; justify-content: space-between;}.var-date-picker .var-month-picker__content ul li { width: var(--month-picker-item-width); display: flex; height: var(--month-picker-item-height); align-items: center; justify-content: center;}.var-date-picker .var-month-picker__button[var-month-picker-cover] { width: 100%; max-width: var(--month-picker-item-button-max-width);}.var-date-picker .var-month-picker__button[var-date-picker-color-cover='true'] { color: var(--date-picker-main-color);}.var-date-picker .var-month-picker__button--disabled { color: var(--color-text-disabled) !important; cursor: not-allowed;}.var-date-picker .var-year-picker { width: 100%; height: 100%; font-weight: var(--year-picker-font-weight); padding: 0; margin: 0; list-style-type: none; overflow: auto; text-align: center;}.var-date-picker .var-year-picker__item { padding: var(--year-picker-item-padding); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-date-picker .var-year-picker__item--active { font-size: var(--year-picker-item-active-font-size); font-weight: var(--year-picker-item-active-font-weight); padding: var(--year-picker-item-active-font-padding); color: var(--year-picker-item-active-color);}.var-date-picker .var-day-picker__content ul { display: flex; flex-wrap: wrap;}.var-date-picker .var-day-picker__content ul li { position: relative; display: flex; justify-content: center; width: var(--day-picker-content-item-width); font-size: var(--day-picker-content-item-font-size); padding: var(--day-picker-content-item-padding);}.var-date-picker .var-day-picker__head li { color: var(--day-picker-head-item-color); padding: var(--day-picker-head-item-padding); font-weight: var(--day-picker-head-item-font-weight);}.var-date-picker .var-day-picker__button[var-day-picker-cover] { width: var(--day-picker-content-item-button-width); height: var(--day-picker-content-item-button-height); font-size: var(--day-picker-content-item-button-font-size);}.var-date-picker .var-day-picker__button:not(.var-day-picker__button--usable) { cursor: unset;}.var-date-picker .var-day-picker__button[var-date-picker-color-cover='true'] { color: var(--date-picker-main-color);}.var-date-picker .var-day-picker__button--disabled { color: var(--color-text-disabled) !important; cursor: not-allowed;}.var-date-picker-translatey-enter-from { opacity: 0; transform: translateY(100%);}.var-date-picker-translatey-enter-active,.var-date-picker-reverse-translatey-enter-active { transition: 0.3s var(--cubic-bezier);}.var-date-picker-translatey-leave-active,.var-date-picker-reverse-translatey-leave-active { position: absolute; transition: 0.3s var(--cubic-bezier);}.var-date-picker-translatey-leave-to { opacity: 0; transform: translateY(-100%);}.var-date-picker-reverse-translatey-enter-from { opacity: 0; transform: translateY(-100%);}.var-date-picker-reverse-translatey-leave-to { opacity: 0; transform: translateY(100%);}.var-date-picker-panel-fade-enter-from,.var-date-picker-panel-fade-leave-to { transition: 0.3s var(--cubic-bezier); opacity: 0;}.var-date-picker-panel-fade-leave-active { position: absolute;}.var-date-picker-translatex-enter-from { opacity: 0; transform: translateX(100%);}.var-date-picker-reverse-translatex-enter-from { opacity: 0; transform: translateX(-100%);}.var-date-picker-translatex-enter-active,.var-date-picker-reverse-translatex-enter-active { transition: 0.3s var(--cubic-bezier);}.var-date-picker-translatex-leave-active,.var-date-picker-reverse-translatex-leave-active { position: absolute; transition: 0.3s var(--cubic-bezier);}.var-date-picker-translatex-leave-to { opacity: 0; transform: translateX(-100%);}.var-date-picker-reverse-translatex-leave-to { opacity: 0; transform: translateX(100%);}
1
+ :root { --date-picker-border-radius: 4px; --date-picker-font-size: var(--font-size-md); --date-picker-min-width: 290px; --date-picker-height: 385px; --date-picker-main-color: rgba(0, 0, 0, 0.87); --date-picker-title-padding: 16px; --date-picker-title-background: var(--color-primary); --date-picker-title-color: #fff; --date-picker-title-year-font-size: var(--font-size-md); --date-picker-title-year-font-weight: 500; --date-picker-title-year-margin-bottom: 8px; --date-picker-title-date-height: 48px; --date-picker-title-date-font-size: 34px; --date-picker-title-date-font-weight: 500; --date-picker-title-date-range-font-size: 20px; --date-picker-body-background-color: #fff; --picker-header-padding: 4px 16px; --month-picker-padding: 0 12px; --month-picker-item-width: 33%; --month-picker-item-height: 56px; --month-picker-item-button-max-width: 140px; --year-picker-font-weight: 400; --year-picker-item-padding: 8px 0; --year-picker-item-active-font-size: 26px; --year-picker-item-active-font-weight: 500; --year-picker-item-active-font-padding: 10px 0; --year-picker-item-active-color: var(--color-primary); --day-picker-content-item-width: 14.28%; --day-picker-content-item-font-size: var(--font-size-sm); --day-picker-content-item-padding: 2px 0; --day-picker-content-item-button-width: 32px; --day-picker-content-item-button-height: 32px; --day-picker-content-item-button-font-size: var(--font-size-sm); --day-picker-head-item-color: rgba(0, 0, 0, 0.38); --day-picker-head-item-padding: 8px 0; --day-picker-head-item-font-weight: 600;}.var-date-picker { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: var(--date-picker-border-radius); contain: layout style; display: flex; width: 100%; flex-direction: column; font-size: var(--date-picker-font-size); position: relative; min-width: var(--date-picker-min-width); height: var(--date-picker-height); overflow: hidden;}.var-date-picker ul { list-style: none; margin: 0; padding: 0;}.var-date-picker__title { padding: var(--date-picker-title-padding); color: var(--date-picker-title-color); background: var(--date-picker-title-background); display: flex; justify-content: space-between; flex-direction: column; flex-wrap: wrap;}.var-date-picker__title-year { opacity: 0.6; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); align-items: center; display: inline-flex; font-size: var(--date-picker-title-year-font-size); font-weight: var(--date-picker-title-year-font-weight); margin-bottom: var(--date-picker-title-year-margin-bottom); transition: 0.3s var(--cubic-bezier);}.var-date-picker__title-year--active { opacity: 1;}.var-date-picker__title-date { height: var(--date-picker-title-date-height); overflow: hidden; font-size: var(--date-picker-title-date-font-size); text-align: left; font-weight: var(--date-picker-title-date-font-weight); position: relative; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); display: flex; align-items: center; opacity: 0.6; transition: 0.3s var(--cubic-bezier);}.var-date-picker__title-date--active { opacity: 1;}.var-date-picker__title-date--range { font-size: var(--date-picker-title-date-range-font-size);}.var-date-picker__body { flex: 1; position: relative; overflow: auto; background-color: var(--date-picker-body-background-color);}.var-date-picker__body::-webkit-scrollbar { display: none; width: 0; background: transparent;}.var-date-picker .var-picker-header { padding: var(--picker-header-padding); align-items: center; display: flex; justify-content: space-between; position: relative;}.var-date-picker .var-picker-header__value { flex: 1; text-align: center; position: relative; overflow: hidden; font-weight: 700; cursor: pointer; user-select: none;}.var-date-picker .var-picker-header__value div { width: 100%;}.var-date-picker .var-month-picker__content { padding: var(--month-picker-padding);}.var-date-picker .var-month-picker__content ul { display: flex; flex-wrap: wrap; justify-content: space-between;}.var-date-picker .var-month-picker__content ul li { width: var(--month-picker-item-width); display: flex; height: var(--month-picker-item-height); align-items: center; justify-content: center;}.var-date-picker .var-month-picker__button[var-month-picker-cover] { width: 100%; max-width: var(--month-picker-item-button-max-width);}.var-date-picker .var-month-picker__button[var-date-picker-color-cover='true'] { color: var(--date-picker-main-color);}.var-date-picker .var-month-picker__button--disabled { color: var(--color-text-disabled) !important; cursor: not-allowed;}.var-date-picker .var-year-picker { width: 100%; height: 100%; font-weight: var(--year-picker-font-weight); padding: 0; margin: 0; list-style-type: none; overflow: auto; text-align: center;}.var-date-picker .var-year-picker__item { padding: var(--year-picker-item-padding); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-date-picker .var-year-picker__item--active { font-size: var(--year-picker-item-active-font-size); font-weight: var(--year-picker-item-active-font-weight); padding: var(--year-picker-item-active-font-padding); color: var(--year-picker-item-active-color);}.var-date-picker .var-day-picker__content ul { display: flex; flex-wrap: wrap;}.var-date-picker .var-day-picker__content ul li { position: relative; display: flex; justify-content: center; width: var(--day-picker-content-item-width); font-size: var(--day-picker-content-item-font-size); padding: var(--day-picker-content-item-padding);}.var-date-picker .var-day-picker__head li { color: var(--day-picker-head-item-color); padding: var(--day-picker-head-item-padding); font-weight: var(--day-picker-head-item-font-weight);}.var-date-picker .var-day-picker__button[var-day-picker-cover] { width: var(--day-picker-content-item-button-width); height: var(--day-picker-content-item-button-height); font-size: var(--day-picker-content-item-button-font-size);}.var-date-picker .var-day-picker__button:not(.var-day-picker__button--usable) { cursor: unset;}.var-date-picker .var-day-picker__button[var-date-picker-color-cover='true'] { color: var(--date-picker-main-color);}.var-date-picker .var-day-picker__button--disabled { color: var(--color-text-disabled) !important; cursor: not-allowed;}.var-date-picker-translatey-enter-from { opacity: 0; transform: translateY(100%);}.var-date-picker-translatey-enter-active,.var-date-picker-reverse-translatey-enter-active { transition: 0.3s var(--cubic-bezier);}.var-date-picker-translatey-leave-active,.var-date-picker-reverse-translatey-leave-active { position: absolute; transition: 0.3s var(--cubic-bezier);}.var-date-picker-translatey-leave-to { opacity: 0; transform: translateY(-100%);}.var-date-picker-reverse-translatey-enter-from { opacity: 0; transform: translateY(-100%);}.var-date-picker-reverse-translatey-leave-to { opacity: 0; transform: translateY(100%);}.var-date-picker-panel-fade-enter-from,.var-date-picker-panel-fade-leave-to { transition: 0.3s var(--cubic-bezier); opacity: 0;}.var-date-picker-panel-fade-leave-active { position: absolute;}.var-date-picker-translatex-enter-from { opacity: 0; transform: translateX(100%);}.var-date-picker-reverse-translatex-enter-from { opacity: 0; transform: translateX(-100%);}.var-date-picker-translatex-enter-active,.var-date-picker-reverse-translatex-enter-active { transition: 0.3s var(--cubic-bezier);}.var-date-picker-translatex-leave-active,.var-date-picker-reverse-translatex-leave-active { position: absolute; transition: 0.3s var(--cubic-bezier);}.var-date-picker-translatex-leave-to { opacity: 0; transform: translateX(-100%);}.var-date-picker-reverse-translatex-leave-to { opacity: 0; transform: translateX(100%);}
@@ -10,7 +10,7 @@ import { WEEK_HEADER } from '../props.mjs';
10
10
  import { toNumber } from '@varlet/shared';
11
11
  import { createNamespace } from '../../utils/components.mjs';
12
12
  import { pack } from '../../locale/index.mjs';
13
- import { useMounted } from '@varlet/use';
13
+ import { onSmartMounted } from '@varlet/use';
14
14
  dayjs.extend(isSameOrBefore);
15
15
  dayjs.extend(isSameOrAfter);
16
16
  var {
@@ -331,7 +331,7 @@ var __sfc__ = defineComponent({
331
331
  headerEl.value.checkDate(checkType);
332
332
  };
333
333
 
334
- useMounted(() => {
334
+ onSmartMounted(() => {
335
335
  initDate();
336
336
  initHeader();
337
337
  });
@@ -2,7 +2,7 @@ import dayjs from 'dayjs/esm';
2
2
  import { defineComponent, computed } from 'vue';
3
3
  import { toNumber } from '@varlet/shared';
4
4
  import { createNamespace } from '../../utils/components.mjs';
5
- import { useMounted } from '@varlet/use';
5
+ import { onSmartMounted } from '@varlet/use';
6
6
  var {
7
7
  n,
8
8
  classes
@@ -90,7 +90,7 @@ var __sfc__ = defineComponent({
90
90
  emit('choose-year', year);
91
91
  };
92
92
 
93
- useMounted(() => {
93
+ onSmartMounted(() => {
94
94
  var activeEl = document.querySelector("." + n('item--active'));
95
95
  activeEl == null ? void 0 : activeEl.scrollIntoView({
96
96
  block: 'center'
@@ -5,7 +5,7 @@ import { toSizeUnit } from '../utils/elements.mjs';
5
5
  import { isBoolean, toNumber } from '@varlet/shared';
6
6
  import { props } from './props.mjs';
7
7
  import { createNamespace } from '../utils/components.mjs';
8
- import { useMounted } from '@varlet/use';
8
+ import { onSmartMounted } from '@varlet/use';
9
9
  var {
10
10
  n,
11
11
  classes
@@ -69,7 +69,7 @@ var __sfc__ = defineComponent({
69
69
  state.withText = Boolean(slots.default) || Boolean(props.description);
70
70
  };
71
71
 
72
- useMounted(() => {
72
+ onSmartMounted(() => {
73
73
  checkHasText();
74
74
  });
75
75
  onUpdated(() => {
@@ -3,7 +3,7 @@ import { defineComponent, ref, computed, onUpdated } from 'vue';
3
3
  import { props } from './props.mjs';
4
4
  import { isEmpty } from '@varlet/shared';
5
5
  import { createNamespace, call } from '../utils/components.mjs';
6
- import { useEventListener, useMounted } from '@varlet/use';
6
+ import { onWindowResize, onSmartMounted } from '@varlet/use';
7
7
  import { getStyle } from '../utils/elements.mjs';
8
8
  var {
9
9
  n,
@@ -168,9 +168,9 @@ var __sfc__ = defineComponent({
168
168
  call(props.onClick, e);
169
169
  };
170
170
 
171
- useMounted(resize);
171
+ onWindowResize(resize);
172
+ onSmartMounted(resize);
172
173
  onUpdated(resize);
173
- useEventListener(() => window, 'resize', resize);
174
174
  return {
175
175
  placeholderTextEl,
176
176
  color,
@@ -9,7 +9,7 @@ import { doubleRaf, getParentScroller, getScrollLeft, getScrollTop, nextTickFram
9
9
  import { useIndexAnchors } from './provide.mjs';
10
10
  import { props } from './props.mjs';
11
11
  import { createNamespace, call } from '../utils/components.mjs';
12
- import { useMounted } from '@varlet/use';
12
+ import { onSmartMounted } from '@varlet/use';
13
13
  var {
14
14
  n,
15
15
  classes
@@ -209,7 +209,7 @@ var __sfc__ = defineComponent({
209
209
  setOwnTop();
210
210
  });
211
211
  }));
212
- useMounted( /*#__PURE__*/_asyncToGenerator(function* () {
212
+ onSmartMounted( /*#__PURE__*/_asyncToGenerator(function* () {
213
213
  yield setScroller();
214
214
  addScrollerListener();
215
215
  }));
@@ -241,7 +241,7 @@ import './time-picker/style/index.mjs'
241
241
  import './tooltip/style/index.mjs'
242
242
  import './uploader/style/index.mjs'
243
243
 
244
- const version = '2.11.4'
244
+ const version = '2.11.6-alpha.1686800314469'
245
245
 
246
246
  function install(app) {
247
247
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -160,7 +160,7 @@ export * from './time-picker/index.mjs'
160
160
  export * from './tooltip/index.mjs'
161
161
  export * from './uploader/index.mjs'
162
162
 
163
- const version = '2.11.4'
163
+ const version = '2.11.6-alpha.1686800314469'
164
164
 
165
165
  function install(app) {
166
166
  ActionSheet.install && app.use(ActionSheet)
@@ -5,7 +5,7 @@ import { props } from './props.mjs';
5
5
  import { isEmpty, toNumber } from '@varlet/shared';
6
6
  import { useValidation, createNamespace, call } from '../utils/components.mjs';
7
7
  import { useForm } from '../form/provide.mjs';
8
- import { useMounted } from '@varlet/use';
8
+ import { onSmartMounted } from '@varlet/use';
9
9
  var {
10
10
  n,
11
11
  classes
@@ -406,7 +406,7 @@ var __sfc__ = defineComponent({
406
406
  resetValidation
407
407
  };
408
408
  call(bindForm, inputProvider);
409
- useMounted(() => {
409
+ onSmartMounted(() => {
410
410
  if (props.autofocus) {
411
411
  focus();
412
412
  }
package/es/link/link.css CHANGED
@@ -1 +1 @@
1
- :root { --link-primary-color: var(--color-primary); --link-danger-color: var(--color-danger); --link-success-color: var(--color-success); --link-warning-color: var(--color-warning); --link-info-color: var(--color-info); --link-disabled-color: var(--color-text-disabled); --link-font-size: var(--font-size-md);}.var-link { position: relative; justify-content: center; align-items: center; outline: none; cursor: pointer; font-family: inherit; white-space: nowrap; color: inherit; text-decoration: none; font-size: var(--link-font-size);}.var-link--underline-always { text-decoration: underline;}.var-link--underline-hover:hover { text-decoration: underline;}.var-link--default { color: inherit;}.var-link--primary { color: var(--link-primary-color);}.var-link--info { color: var(--link-info-color);}.var-link--success { color: var(--link-success-color);}.var-link--warning { color: var(--link-warning-color);}.var-link--danger { color: var(--link-danger-color);}.var-link--disabled { color: var(--link-disabled-color); cursor: not-allowed;}
1
+ :root { --link-default-color: #555; --link-primary-color: var(--color-primary); --link-danger-color: var(--color-danger); --link-success-color: var(--color-success); --link-warning-color: var(--color-warning); --link-info-color: var(--color-info); --link-disabled-color: var(--color-text-disabled); --link-font-size: var(--font-size-md);}.var-link { position: relative; justify-content: center; align-items: center; outline: none; cursor: pointer; font-family: inherit; white-space: nowrap; text-decoration: none; font-size: var(--link-font-size);}.var-link--underline-always { text-decoration: underline;}.var-link--underline-hover:hover { text-decoration: underline;}.var-link--default { color: var(--link-default-color);}.var-link--primary { color: var(--link-primary-color);}.var-link--info { color: var(--link-info-color);}.var-link--success { color: var(--link-success-color);}.var-link--warning { color: var(--link-warning-color);}.var-link--danger { color: var(--link-danger-color);}.var-link--disabled { color: var(--link-disabled-color); cursor: not-allowed;}
package/es/list/List.mjs CHANGED
@@ -4,14 +4,14 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
4
4
 
5
5
  import VarLoading from '../loading/index.mjs';
6
6
  import Ripple from '../ripple/index.mjs';
7
- import { defineComponent, onUnmounted, ref, nextTick, onDeactivated, watch } from 'vue';
7
+ import { defineComponent, ref, nextTick, watch } from 'vue';
8
8
  import { getParentScroller, getRect, toPxNum } from '../utils/elements.mjs';
9
9
  import { props } from './props.mjs';
10
10
  import { isNumber } from '@varlet/shared';
11
11
  import { dt } from '../utils/shared.mjs';
12
12
  import { createNamespace, call } from '../utils/components.mjs';
13
13
  import { pack } from '../locale/index.mjs';
14
- import { useMounted } from '@varlet/use';
14
+ import { onSmartMounted, onSmartUnmounted } from '@varlet/use';
15
15
  import { useTabItem } from './provide.mjs';
16
16
  var {
17
17
  n,
@@ -132,7 +132,7 @@ var __sfc__ = defineComponent({
132
132
  }
133
133
 
134
134
  watch(() => [props.loading, props.error, props.finished], check);
135
- useMounted(() => {
135
+ onSmartMounted(() => {
136
136
  scroller = getParentScroller(listEl.value);
137
137
  scroller.addEventListener('scroll', check);
138
138
 
@@ -140,8 +140,7 @@ var __sfc__ = defineComponent({
140
140
  check();
141
141
  }
142
142
  });
143
- onDeactivated(removeScrollerListener);
144
- onUnmounted(removeScrollerListener);
143
+ onSmartUnmounted(removeScrollerListener);
145
144
  return {
146
145
  pack,
147
146
  listEl,
@@ -91,10 +91,10 @@ function __render__(_ctx, _cache) {
91
91
  key: 2,
92
92
  class: _normalizeClass(_ctx.classes(_ctx.n('size'), [_ctx.disabled, _ctx.n('item--disabled')]))
93
93
  }, [_createVNode(_component_var_menu, {
94
+ placement: "cover-top",
94
95
  disabled: _ctx.disabled,
95
96
  show: _ctx.menuVisible,
96
- "onUpdate:show": _cache[6] || (_cache[6] = $event => _ctx.menuVisible = $event),
97
- "offset-x": -4
97
+ "onUpdate:show": _cache[6] || (_cache[6] = $event => _ctx.menuVisible = $event)
98
98
  }, {
99
99
  menu: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.sizeOption, (option, index) => {
100
100
  return _withDirectives((_openBlock(), _createBlock(_component_var_cell, {
@@ -8,7 +8,7 @@ import { getParentScroller, getScrollTop, getTarget, getRect } from '../utils/el
8
8
  import { props } from './props.mjs';
9
9
  import { isString, toNumber } from '@varlet/shared';
10
10
  import { call, createNamespace } from '../utils/components.mjs';
11
- import { useEventListener, useMounted } from '@varlet/use';
11
+ import { useEventListener, onSmartMounted } from '@varlet/use';
12
12
  var {
13
13
  n,
14
14
  classes
@@ -210,7 +210,7 @@ var __sfc__ = defineComponent({
210
210
  }, toNumber(props.successDuration));
211
211
  }
212
212
  });
213
- useMounted(setScroller);
213
+ onSmartMounted(setScroller);
214
214
  useEventListener(freshNode, 'touchmove', touchMove);
215
215
  return {
216
216
  n,
package/es/rate/Rate.mjs CHANGED
@@ -100,6 +100,7 @@ var __sfc__ = defineComponent({
100
100
  hovering
101
101
  } = useHoverOverlay();
102
102
  var currentHoveringValue = ref(-1);
103
+ var lastScore = Number(props.modelValue);
103
104
 
104
105
  var getStyle = val => {
105
106
  var {
@@ -161,13 +162,23 @@ var __sfc__ = defineComponent({
161
162
  };
162
163
 
163
164
  var changeValue = (score, event) => {
164
- if (props.half) {
165
+ var {
166
+ half,
167
+ clearable
168
+ } = props;
169
+
170
+ if (half) {
165
171
  var {
166
172
  offsetWidth
167
173
  } = event.target;
168
174
  if (event.offsetX <= Math.floor(offsetWidth / 2)) score -= 0.5;
169
- }
175
+ } // set score to 0 when last score is equal to current score
176
+ // and the value of clearable is true
177
+
178
+
179
+ if (lastScore === score && clearable) score = 0; // update last score
170
180
 
181
+ lastScore = score;
171
182
  call(props['onUpdate:modelValue'], score);
172
183
  };
173
184
 
package/es/rate/props.mjs CHANGED
@@ -54,6 +54,10 @@ export var props = {
54
54
  type: Boolean,
55
55
  default: true
56
56
  },
57
+ clearable: {
58
+ type: Boolean,
59
+ default: false
60
+ },
57
61
  rules: {
58
62
  type: Array
59
63
  },
package/es/rate/rate.css CHANGED
@@ -1 +1 @@
1
- :root { --rate-color: var(--color-text); --rate-disabled-color: var(--color-text-disabled); --rate-error-color: var(--color-danger); --rate-action-padding: 4px; --rate-primary-color: var(--color-primary);}.var-rate { display: flex; transform: translateX(calc(-1 * var(--rate-action-padding)));}.var-rate__wrap { width: 100%;}.var-rate__content { position: relative; padding: var(--rate-action-padding); cursor: pointer; border-radius: 50%; color: var(--rate-color); transition: color 0.25s; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-rate__content-icon[var-rate-cover] { font-size: 24px;}.var-rate--primary { color: var(--rate-primary-color);}.var-rate--disabled { color: var(--rate-disabled-color); cursor: not-allowed;}.var-rate--error { color: var(--rate-error-color);}
1
+ :root { --rate-color: var(--color-text); --rate-disabled-color: var(--color-text-disabled); --rate-error-color: var(--color-danger); --rate-action-padding: 4px; --rate-primary-color: var(--color-primary);}.var-rate { display: flex; transform: translateX(calc(-1 * var(--rate-action-padding)));}.var-rate__wrap { width: 100%;}.var-rate__content { position: relative; display: flex; padding: var(--rate-action-padding); cursor: pointer; border-radius: 50%; color: var(--rate-color); transition: color 0.25s; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-rate__content-icon[var-rate-cover] { font-size: 24px;}.var-rate--primary { color: var(--rate-primary-color);}.var-rate--disabled { color: var(--rate-disabled-color); cursor: not-allowed;}.var-rate--error { color: var(--rate-error-color);}
@@ -8,7 +8,7 @@ import { getLeft, multiplySizeUnit, getRect } from '../utils/elements.mjs';
8
8
  import { warn } from '../utils/logger.mjs';
9
9
  import { isArray, isNumber, toNumber } from '@varlet/shared';
10
10
  import { props, Thumbs } from './props.mjs';
11
- import { useMounted } from '@varlet/use';
11
+ import { onSmartMounted } from '@varlet/use';
12
12
  var {
13
13
  n,
14
14
  classes
@@ -475,7 +475,7 @@ var __sfc__ = defineComponent({
475
475
  setProps(modelValue, toNumber(step));
476
476
  });
477
477
  watch(maxDistance, () => setProps());
478
- useMounted(() => {
478
+ onSmartMounted(() => {
479
479
  if (!stepValidator() || !valueValidator()) return;
480
480
  maxDistance.value = sliderEl.value[isVertical.value ? 'offsetHeight' : 'offsetWidth'];
481
481
  });
@@ -6,7 +6,7 @@ import { props } from './props.mjs';
6
6
  import { useLock } from '../context/lock.mjs';
7
7
  import { SNACKBAR_TYPE } from './index.mjs';
8
8
  import { call, createNamespace } from '../utils/components.mjs';
9
- import { useMounted } from '@varlet/use';
9
+ import { onSmartMounted } from '@varlet/use';
10
10
  var {
11
11
  n,
12
12
  classes
@@ -109,7 +109,7 @@ var __sfc__ = defineComponent({
109
109
  clearTimeout(timer.value);
110
110
  updateAfterDuration();
111
111
  });
112
- useMounted(() => {
112
+ onSmartMounted(() => {
113
113
  if (props.show) {
114
114
  call(props.onOpen);
115
115
  updateAfterDuration();
@@ -1,8 +1,8 @@
1
1
  import '../../styles/common.css'
2
+ import '../SnackbarSfc.css'
2
3
  import '../../styles/elevation.css'
3
4
  import '../../loading/loading.css'
4
5
  import '../../button/button.css'
5
6
  import '../../icon/icon.css'
6
7
  import '../snackbar.css'
7
8
  import '../coreSfc.css'
8
- import '../SnackbarSfc.css'
package/es/step/Step.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { computed, defineComponent, ref, watch } from 'vue';
1
+ import { computed, defineComponent } from 'vue';
2
2
  import { props } from './props.mjs';
3
3
  import { useSteps } from './provide.mjs';
4
4
  import VarIcon from '../icon/index.mjs';
@@ -7,7 +7,7 @@ var {
7
7
  n,
8
8
  classes
9
9
  } = createNamespace('step');
10
- import { resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderSlot as _renderSlot, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
10
+ import { resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderSlot as _renderSlot, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
11
11
 
12
12
  var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
13
13
 
@@ -22,9 +22,6 @@ function __render__(_ctx, _cache) {
22
22
  class: _normalizeClass(_ctx.n())
23
23
  }, [_createElementVNode("div", {
24
24
  class: _normalizeClass(_ctx.n(_ctx.direction))
25
- }, [_createElementVNode("div", {
26
- class: _normalizeClass(_ctx.n(_ctx.direction + "-main")),
27
- ref: _ctx.getRef
28
25
  }, [_createElementVNode("div", {
29
26
  class: _normalizeClass(_ctx.classes(_ctx.n(_ctx.direction + "-tag"), [_ctx.isActive || _ctx.isCurrent, _ctx.n(_ctx.direction + "-tag--active")])),
30
27
  style: _normalizeStyle({
@@ -65,17 +62,11 @@ function __render__(_ctx, _cache) {
65
62
  })
66
63
  }, [_renderSlot(_ctx.$slots, "default")], 2
67
64
  /* CLASS */
68
- )], 2
65
+ ), _createElementVNode("div", {
66
+ class: _normalizeClass(_ctx.n(_ctx.direction + "-line"))
67
+ }, null, 2
69
68
  /* CLASS */
70
- ), !_ctx.isLastChild ? (_openBlock(), _createElementBlock("div", {
71
- key: 0,
72
- class: _normalizeClass(_ctx.n(_ctx.direction + "-line")),
73
- style: _normalizeStyle({
74
- margin: _ctx.lineMargin
75
- })
76
- }, null, 6
77
- /* CLASS, STYLE */
78
- )) : _createCommentVNode("v-if", true)], 2
69
+ )], 2
79
70
  /* CLASS */
80
71
  )], 2
81
72
  /* CLASS */
@@ -90,9 +81,6 @@ var __sfc__ = defineComponent({
90
81
  props,
91
82
 
92
83
  setup() {
93
- var main = ref(null);
94
- var lineMargin = ref('');
95
- var isLastChild = ref(false);
96
84
  var {
97
85
  index,
98
86
  steps,
@@ -100,7 +88,6 @@ var __sfc__ = defineComponent({
100
88
  } = useSteps();
101
89
  var {
102
90
  active,
103
- length,
104
91
  activeColor,
105
92
  inactiveColor,
106
93
  direction,
@@ -114,35 +101,17 @@ var __sfc__ = defineComponent({
114
101
 
115
102
  var click = () => clickStep(index.value);
116
103
 
117
- var getRef = el => {
118
- if (direction.value === 'horizontal') {
119
- main.value = el;
120
- }
121
- };
122
-
123
104
  bindSteps(stepProvider);
124
- watch(length, newLength => {
125
- isLastChild.value = newLength - 1 === index.value;
126
-
127
- if (main.value) {
128
- var margin = main.value.offsetWidth / 2 - 14;
129
- lineMargin.value = "0 -" + margin + "px";
130
- }
131
- });
132
105
  return {
133
106
  n,
134
107
  classes,
135
- main,
136
108
  index,
137
109
  isActive,
138
110
  isCurrent,
139
111
  direction,
140
- lineMargin,
141
112
  activeColor,
142
113
  inactiveColor,
143
- isLastChild,
144
- click,
145
- getRef
114
+ click
146
115
  };
147
116
  }
148
117
 
package/es/step/step.css CHANGED
@@ -1 +1 @@
1
- :root { --step-tag-size: 20px; --step-tag-background: #9e9e9e; --step-tag-font-size: var(--font-size-md); --step-tag-color: #fff; --step-tag-active-color: var(--color-primary); --step-tag-margin: 4px 0; --step-tag-icon-size: var(--font-size-lg); --step-content-font-size: var(--font-size-md); --step-content-color: rgba(0, 0, 0, 0.38); --step-content-active-color: #000; --step-line-background: #000; --step-vertical-min-height: 30px; --step-vertical-tag-margin: 0 4px; --step-vertical-line-height: calc(100% - 30px); --step-vertical-line-min-height: 20px;}.tag { width: var(--step-tag-size); height: var(--step-tag-size); background: var(--step-tag-background); display: flex; font-size: var(--step-tag-font-size); align-items: center; justify-content: center; border-radius: 50%; color: var(--step-tag-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.content { font-size: var(--step-content-font-size); color: var(--step-content-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step { display: flex; position: relative; flex: 1; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-step__horizontal { display: flex; width: 100%;}.var-step__horizontal-main { display: flex; flex-direction: column; align-items: center; flex-basis: 100%;}.var-step__horizontal-tag { margin: var(--step-tag-margin); width: var(--step-tag-size); height: var(--step-tag-size); background: var(--step-tag-background); display: flex; font-size: var(--step-tag-font-size); align-items: center; justify-content: center; border-radius: 50%; color: var(--step-tag-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__horizontal-tag--active { background: var(--step-tag-active-color);}.var-step__horizontal-content { font-size: var(--step-content-font-size); color: var(--step-content-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__horizontal-content--active { color: var(--step-content-active-color);}.var-step__horizontal-line { position: relative; top: 14px; flex: 1; height: 1px; transform: scaleY(0.5); background: var(--step-line-background);}.var-step__vertical { width: 100%;}.var-step__vertical-main { display: flex; align-items: flex-start; min-height: var(--step-vertical-min-height);}.var-step__vertical-tag { flex-shrink: 0; margin: var(--step-vertical-tag-margin); width: var(--step-tag-size); height: var(--step-tag-size); background: var(--step-tag-background); display: flex; font-size: var(--step-tag-font-size); align-items: center; justify-content: center; border-radius: 50%; color: var(--step-tag-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__vertical-tag--active { background: var(--step-tag-active-color);}.var-step__vertical-content { font-size: var(--step-content-font-size); color: var(--step-content-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__vertical-content--active { color: var(--step-content-active-color);}.var-step__vertical-line { position: relative; height: var(--step-vertical-line-height); left: 14px; top: calc(-100% + 45px); min-height: var(--step-vertical-line-min-height); width: 1px; transform: scaleX(0.5); background: var(--step-line-background);}.var-step__icon[var-step-cover] { font-size: var(--step-tag-icon-size);}
1
+ :root { --step-tag-size: 20px; --step-tag-background: #9e9e9e; --step-tag-font-size: var(--font-size-md); --step-tag-color: #fff; --step-tag-active-color: var(--color-primary); --step-tag-margin: 4px 0; --step-tag-icon-size: var(--font-size-lg); --step-content-font-size: var(--font-size-md); --step-content-color: rgba(0, 0, 0, 0.38); --step-content-active-color: #000; --step-line-background: #000; --step-line-gap: 8px; --step-min-size: calc(var(--step-tag-size) + var(--step-line-gap)); --step-line-size: calc(100% - var(--step-min-size)); --step-vertical-tag-margin: 0 4px; --step-vertical-min-height: 50px;}.tag { width: var(--step-tag-size); height: var(--step-tag-size); background: var(--step-tag-background); display: flex; font-size: var(--step-tag-font-size); align-items: center; justify-content: center; border-radius: 50%; color: var(--step-tag-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.content { font-size: var(--step-content-font-size); color: var(--step-content-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step { position: relative; flex: 1; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-step:last-child .var-step__horizontal-line { width: 0;}.var-step:last-child .var-step__vertical-line { height: 0;}.var-step__horizontal { display: flex; flex-direction: column; align-items: center;}.var-step__horizontal-tag { margin: var(--step-tag-margin); width: var(--step-tag-size); height: var(--step-tag-size); background: var(--step-tag-background); display: flex; font-size: var(--step-tag-font-size); align-items: center; justify-content: center; border-radius: 50%; color: var(--step-tag-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__horizontal-tag--active { background: var(--step-tag-active-color);}.var-step__horizontal-content { font-size: var(--step-content-font-size); color: var(--step-content-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__horizontal-content--active { color: var(--step-content-active-color);}.var-step__horizontal-line { position: absolute; top: calc(var(--step-min-size) / 2); left: calc(50% + var(--step-min-size) / 2); width: var(--step-line-size); height: 1px; transform: scaleY(0.5); background: var(--step-line-background);}.var-step__vertical { display: flex; height: 100%; min-height: var(--step-vertical-min-height);}.var-step__vertical-tag { flex-shrink: 0; margin: var(--step-vertical-tag-margin); width: var(--step-tag-size); height: var(--step-tag-size); background: var(--step-tag-background); display: flex; font-size: var(--step-tag-font-size); align-items: center; justify-content: center; border-radius: 50%; color: var(--step-tag-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__vertical-tag--active { background: var(--step-tag-active-color);}.var-step__vertical-content { font-size: var(--step-content-font-size); color: var(--step-content-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__vertical-content--active { color: var(--step-content-active-color);}.var-step__vertical-line { position: absolute; height: var(--step-line-size); left: calc(var(--step-min-size) / 2); top: calc(var(--step-min-size) - var(--step-line-gap) / 2); width: 1px; transform: scaleX(0.5); background: var(--step-line-background);}.var-step__icon[var-step-cover] { font-size: var(--step-tag-icon-size);}
@@ -28,7 +28,6 @@ var __sfc__ = defineComponent({
28
28
  var inactiveColor = computed(() => props.inactiveColor);
29
29
  var direction = computed(() => props.direction);
30
30
  var {
31
- length,
32
31
  bindStep
33
32
  } = useStep();
34
33
 
@@ -38,7 +37,6 @@ var __sfc__ = defineComponent({
38
37
 
39
38
  var stepsProvider = {
40
39
  active,
41
- length,
42
40
  direction,
43
41
  activeColor,
44
42
  inactiveColor,
@@ -3,11 +3,9 @@ export var STEPS_BIND_STEP_KEY = Symbol('STEPS_BIND_STEP_KEY');
3
3
  export function useStep() {
4
4
  var {
5
5
  bindChildren,
6
- length,
7
6
  childProviders
8
7
  } = useChildren(STEPS_BIND_STEP_KEY);
9
8
  return {
10
- length,
11
9
  step: childProviders,
12
10
  bindStep: bindChildren
13
11
  };
@@ -2,12 +2,12 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
2
2
 
3
3
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4
4
 
5
- import { defineComponent, ref, onUnmounted, onDeactivated, computed, watch } from 'vue';
5
+ import { defineComponent, ref, computed, watch } from 'vue';
6
6
  import { props } from './props.mjs';
7
7
  import { doubleRaf, getParentScroller, raf, toPxNum, getRect } from '../utils/elements.mjs';
8
8
  import { toNumber } from '@varlet/shared';
9
9
  import { call, createNamespace } from '../utils/components.mjs';
10
- import { useEventListener, useMounted } from '@varlet/use';
10
+ import { useEventListener, onSmartMounted, onWindowResize, onSmartUnmounted } from '@varlet/use';
11
11
  var {
12
12
  n,
13
13
  classes
@@ -156,11 +156,10 @@ var __sfc__ = defineComponent({
156
156
  };
157
157
 
158
158
  watch(() => props.disabled, resize);
159
- useMounted(addScrollListener);
160
- onUnmounted(removeScrollListener);
161
- onDeactivated(removeScrollListener);
159
+ onSmartMounted(addScrollListener);
160
+ onSmartUnmounted(removeScrollListener);
161
+ onWindowResize(resize);
162
162
  useEventListener(() => window, 'scroll', handleScroll);
163
- useEventListener(() => window, 'resize', resize);
164
163
  return {
165
164
  n,
166
165
  classes,