@varlet/ui 2.13.1-alpha.1689619056304 → 2.13.1

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 (92) hide show
  1. package/es/action-sheet/index.mjs +3 -7
  2. package/es/app-bar/index.mjs +2 -3
  3. package/es/avatar/index.mjs +2 -3
  4. package/es/avatar-group/index.mjs +2 -3
  5. package/es/back-top/index.mjs +2 -3
  6. package/es/badge/index.mjs +2 -3
  7. package/es/bottom-navigation/index.mjs +2 -3
  8. package/es/bottom-navigation-item/index.mjs +2 -3
  9. package/es/breadcrumb/index.mjs +2 -3
  10. package/es/breadcrumbs/index.mjs +2 -3
  11. package/es/button/index.mjs +2 -3
  12. package/es/button-group/index.mjs +2 -4
  13. package/es/card/index.mjs +2 -3
  14. package/es/cell/index.mjs +2 -3
  15. package/es/checkbox/index.mjs +2 -3
  16. package/es/checkbox-group/index.mjs +2 -3
  17. package/es/chip/index.mjs +2 -3
  18. package/es/col/index.mjs +2 -3
  19. package/es/collapse/index.mjs +2 -3
  20. package/es/collapse-item/index.mjs +2 -3
  21. package/es/countdown/index.mjs +2 -3
  22. package/es/counter/index.mjs +2 -3
  23. package/es/date-picker/index.mjs +2 -3
  24. package/es/dialog/index.mjs +3 -7
  25. package/es/divider/index.mjs +2 -3
  26. package/es/drag/index.mjs +2 -3
  27. package/es/ellipsis/index.mjs +2 -3
  28. package/es/fab/index.mjs +2 -4
  29. package/es/form/index.mjs +2 -4
  30. package/es/form-details/index.mjs +2 -3
  31. package/es/hover-overlay/index.mjs +2 -3
  32. package/es/icon/index.mjs +2 -3
  33. package/es/image/index.mjs +2 -3
  34. package/es/image-preview/index.mjs +3 -7
  35. package/es/index-anchor/index.mjs +2 -3
  36. package/es/index-bar/index.mjs +2 -3
  37. package/es/index.bundle.mjs +1 -1
  38. package/es/index.mjs +1 -1
  39. package/es/input/index.mjs +2 -3
  40. package/es/link/index.mjs +2 -3
  41. package/es/list/index.mjs +2 -3
  42. package/es/loading/index.mjs +2 -3
  43. package/es/menu/Menu.mjs +3 -1
  44. package/es/menu/index.mjs +2 -3
  45. package/es/menu/menu.css +1 -1
  46. package/es/menu/usePopover.mjs +52 -1
  47. package/es/option/index.mjs +2 -3
  48. package/es/overlay/index.mjs +2 -3
  49. package/es/pagination/index.mjs +2 -3
  50. package/es/paper/index.mjs +2 -3
  51. package/es/picker/index.mjs +4 -8
  52. package/es/popup/index.mjs +2 -3
  53. package/es/progress/index.mjs +2 -3
  54. package/es/pull-refresh/index.mjs +2 -3
  55. package/es/radio/index.mjs +2 -3
  56. package/es/radio-group/index.mjs +2 -3
  57. package/es/rate/index.mjs +2 -3
  58. package/es/result/index.mjs +2 -3
  59. package/es/row/index.mjs +2 -3
  60. package/es/select/Select.mjs +1 -1
  61. package/es/select/index.mjs +2 -3
  62. package/es/skeleton/index.mjs +2 -3
  63. package/es/slider/index.mjs +2 -3
  64. package/es/snackbar/index.mjs +4 -8
  65. package/es/space/index.mjs +2 -3
  66. package/es/step/index.mjs +2 -3
  67. package/es/steps/index.mjs +2 -3
  68. package/es/sticky/index.mjs +2 -3
  69. package/es/style-provider/index.mjs +3 -6
  70. package/es/style.css +1 -1
  71. package/es/swipe/index.mjs +2 -3
  72. package/es/swipe-item/index.mjs +2 -3
  73. package/es/switch/index.mjs +2 -3
  74. package/es/tab/index.mjs +2 -3
  75. package/es/tab-item/index.mjs +2 -3
  76. package/es/table/index.mjs +2 -3
  77. package/es/tabs/index.mjs +2 -3
  78. package/es/tabs-items/index.mjs +2 -3
  79. package/es/time-picker/index.mjs +2 -3
  80. package/es/tooltip/Tooltip.mjs +3 -1
  81. package/es/tooltip/index.mjs +2 -3
  82. package/es/tooltip/tooltip.css +1 -1
  83. package/es/uploader/index.mjs +2 -3
  84. package/es/utils/components.mjs +12 -0
  85. package/es/varlet.esm.js +7052 -7151
  86. package/highlight/web-types.en-US.json +2 -2
  87. package/highlight/web-types.zh-CN.json +3 -3
  88. package/lib/style.css +1 -1
  89. package/lib/varlet.cjs.js +154 -247
  90. package/package.json +6 -6
  91. package/types/snackbar.d.ts +9 -10
  92. package/umd/varlet.js +5 -5
@@ -1,7 +1,6 @@
1
1
  import Option from './Option.mjs';
2
- Option.install = function (app) {
3
- app.component(Option.name, Option);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Option);
5
4
  export { props as optionProps } from './props.mjs';
6
5
  export var _OptionComponent = Option;
7
6
  export default Option;
@@ -1,7 +1,6 @@
1
1
  import Overlay from './Overlay.mjs';
2
- Overlay.install = function (app) {
3
- app.component(Overlay.name, Overlay);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Overlay);
5
4
  export { props as overlayProps } from './props.mjs';
6
5
  export var _OverlayComponent = Overlay;
7
6
  export default Overlay;
@@ -1,7 +1,6 @@
1
1
  import Pagination from './Pagination.mjs';
2
- Pagination.install = function (app) {
3
- app.component(Pagination.name, Pagination);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Pagination);
5
4
  export { props as paginationProps } from './props.mjs';
6
5
  export var _PaginationComponent = Pagination;
7
6
  export default Pagination;
@@ -1,7 +1,6 @@
1
1
  import Paper from './Paper.mjs';
2
- Paper.install = function (app) {
3
- app.component(Paper.name, Paper);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Paper);
5
4
  export { props as paperProps } from './props.mjs';
6
5
  export var _PaperComponent = Paper;
7
6
  export default Paper;
@@ -1,7 +1,7 @@
1
1
  import VarPicker from './Picker.mjs';
2
2
  import { nextTick, reactive } from 'vue';
3
3
  import { isArray } from '@varlet/shared';
4
- import { call, mountInstance } from '../utils/components.mjs';
4
+ import { call, mountInstance, withInstall } from '../utils/components.mjs';
5
5
  var singletonOptions;
6
6
  function Picker(options) {
7
7
  return new Promise(resolve => {
@@ -59,13 +59,6 @@ function Picker(options) {
59
59
  reactivePickerOptions.show = true;
60
60
  });
61
61
  }
62
- VarPicker.install = function (app) {
63
- app.component(VarPicker.name, VarPicker);
64
- };
65
- Picker.Component = VarPicker;
66
- Picker.install = function (app) {
67
- app.component(VarPicker.name, VarPicker);
68
- };
69
62
  Picker.close = function () {
70
63
  if (singletonOptions != null) {
71
64
  var prevSingletonOptions = singletonOptions;
@@ -75,6 +68,9 @@ Picker.close = function () {
75
68
  });
76
69
  }
77
70
  };
71
+ Picker.Component = VarPicker;
72
+ withInstall(VarPicker);
73
+ withInstall(VarPicker, Picker);
78
74
  export { props as pickerProps } from './props.mjs';
79
75
  export var _PickerComponent = VarPicker;
80
76
  export default Picker;
@@ -1,7 +1,6 @@
1
1
  import Popup from './Popup.mjs';
2
- Popup.install = function (app) {
3
- app.component(Popup.name, Popup);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Popup);
5
4
  export { props as popupProps } from './props.mjs';
6
5
  export var _PopupComponent = Popup;
7
6
  export default Popup;
@@ -1,7 +1,6 @@
1
1
  import Progress from './Progress.mjs';
2
- Progress.install = function (app) {
3
- app.component(Progress.name, Progress);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Progress);
5
4
  export { props as progressProps } from './props.mjs';
6
5
  export var _ProgressComponent = Progress;
7
6
  export default Progress;
@@ -1,7 +1,6 @@
1
1
  import PullRefresh from './PullRefresh.mjs';
2
- PullRefresh.install = function (app) {
3
- app.component(PullRefresh.name, PullRefresh);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(PullRefresh);
5
4
  export { props as pullRefreshProps } from './props.mjs';
6
5
  export var _PullRefreshComponent = PullRefresh;
7
6
  export default PullRefresh;
@@ -1,7 +1,6 @@
1
1
  import Radio from './Radio.mjs';
2
- Radio.install = function (app) {
3
- app.component(Radio.name, Radio);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Radio);
5
4
  export { props as radioProps } from './props.mjs';
6
5
  export var _RadioComponent = Radio;
7
6
  export default Radio;
@@ -1,7 +1,6 @@
1
1
  import RadioGroup from './RadioGroup.mjs';
2
- RadioGroup.install = function (app) {
3
- app.component(RadioGroup.name, RadioGroup);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(RadioGroup);
5
4
  export { props as radioGroupProps } from './props.mjs';
6
5
  export var _RadioGroupComponent = RadioGroup;
7
6
  export default RadioGroup;
package/es/rate/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import Rate from './Rate.mjs';
2
- Rate.install = function (app) {
3
- app.component(Rate.name, Rate);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Rate);
5
4
  export { props as rateProps } from './props.mjs';
6
5
  export var _RateComponent = Rate;
7
6
  export default Rate;
@@ -1,7 +1,6 @@
1
1
  import Result from './Result.mjs';
2
- Result.install = function (app) {
3
- app.component(Result.name, Result);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Result);
5
4
  export { props as resultProps } from './props.mjs';
6
5
  export var _ResultComponent = Result;
7
6
  export default Result;
package/es/row/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import Row from './Row.mjs';
2
- Row.install = function (app) {
3
- app.component(Row.name, Row);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Row);
5
4
  export { props as rowProps } from './props.mjs';
6
5
  export var _RowComponent = Row;
7
6
  export default Row;
@@ -169,7 +169,7 @@ var __sfc__ = defineComponent({
169
169
  resetValidation
170
170
  } = useValidation();
171
171
  var menuEl = ref(null);
172
- var placement = computed(() => props.variant === 'outlined' ? 'bottom-start' : 'cover-top-start');
172
+ var placement = computed(() => props.variant === 'outlined' ? 'bottom' : 'cover-top');
173
173
  var placeholderColor = computed(() => {
174
174
  var {
175
175
  hint,
@@ -1,7 +1,6 @@
1
1
  import Select from './Select.mjs';
2
- Select.install = function (app) {
3
- app.component(Select.name, Select);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Select);
5
4
  export { props as selectProps } from './props.mjs';
6
5
  export var _SelectComponent = Select;
7
6
  export default Select;
@@ -1,7 +1,6 @@
1
1
  import Skeleton from './Skeleton.mjs';
2
- Skeleton.install = function (app) {
3
- app.component(Skeleton.name, Skeleton);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Skeleton);
5
4
  export { props as skeletonProps } from './props.mjs';
6
5
  export var _SkeletonComponent = Skeleton;
7
6
  export default Skeleton;
@@ -1,7 +1,6 @@
1
1
  import Slider from './Slider.mjs';
2
- Slider.install = function (app) {
3
- app.component(Slider.name, Slider);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Slider);
5
4
  export { props as sliderProps } from './props.mjs';
6
5
  export var _SliderComponent = Slider;
7
6
  export default Slider;
@@ -4,7 +4,7 @@ import VarSnackbarCore from './core.mjs';
4
4
  import VarSnackbar from './Snackbar.mjs';
5
5
  import context from '../context/index.mjs';
6
6
  import { reactive, TransitionGroup } from 'vue';
7
- import { call, mountInstance } from '../utils/components.mjs';
7
+ import { call, mountInstance, withInstall } from '../utils/components.mjs';
8
8
  import { isFunction, isPlainObject, isString, toNumber } from '@varlet/shared';
9
9
  function _isSlot(s) {
10
10
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
@@ -138,9 +138,6 @@ SNACKBAR_TYPE.forEach(type => {
138
138
  return Snackbar(options);
139
139
  };
140
140
  });
141
- Snackbar.install = function (app) {
142
- app.component(VarSnackbar.name, VarSnackbar);
143
- };
144
141
  Snackbar.allowMultiple = function (bool) {
145
142
  if (bool === void 0) {
146
143
  bool = false;
@@ -163,7 +160,6 @@ Snackbar.setDefaultOptions = function (options) {
163
160
  Snackbar.resetDefaultOptions = function () {
164
161
  defaultOptions = defaultOptionsValue;
165
162
  };
166
- Snackbar.Component = VarSnackbar;
167
163
  function opened(element) {
168
164
  var id = element.getAttribute('data-id');
169
165
  var option = uniqSnackbarOptions.find(option => option.id === toNumber(id));
@@ -213,9 +209,9 @@ function getTop(position) {
213
209
  top: position === 'top' ? '5%' : '45%'
214
210
  };
215
211
  }
216
- VarSnackbar.install = function (app) {
217
- app.component(VarSnackbar.name, VarSnackbar);
218
- };
212
+ Snackbar.Component = VarSnackbar;
213
+ withInstall(VarSnackbar);
214
+ withInstall(VarSnackbar, Snackbar);
219
215
  export { props as snackbarProps } from './props.mjs';
220
216
  export var _SnackbarComponent = VarSnackbar;
221
217
  export default Snackbar;
@@ -1,7 +1,6 @@
1
1
  import Space from './Space.mjs';
2
- Space.install = function (app) {
3
- app.component(Space.name, Space);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Space);
5
4
  export { props as spaceProps } from './props.mjs';
6
5
  export var _SpaceComponent = Space;
7
6
  export default Space;
package/es/step/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import Step from './Step.mjs';
2
- Step.install = function (app) {
3
- app.component(Step.name, Step);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Step);
5
4
  export { props as stepProps } from './props.mjs';
6
5
  export var _StepComponent = Step;
7
6
  export default Step;
@@ -1,7 +1,6 @@
1
1
  import Steps from './Steps.mjs';
2
- Steps.install = function (app) {
3
- app.component(Steps.name, Steps);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Steps);
5
4
  export { props as stepsProps } from './props.mjs';
6
5
  export var _StepsComponent = Steps;
7
6
  export default Steps;
@@ -1,7 +1,6 @@
1
1
  import Sticky from './Sticky.mjs';
2
- Sticky.install = function (app) {
3
- app.component(Sticky.name, Sticky);
4
- };
2
+ import { withInstall } from '../utils/components.mjs';
3
+ withInstall(Sticky);
5
4
  export { props as stickyProps } from './props.mjs';
6
5
  export var _StickyComponent = Sticky;
7
6
  export default Sticky;
@@ -1,5 +1,6 @@
1
1
  import VarStyleProvider from './StyleProvider.mjs';
2
2
  import { formatStyleVars } from '../utils/elements.mjs';
3
+ import { withInstall } from '../utils/components.mjs';
3
4
  var mountedVarKeys = [];
4
5
  function StyleProvider(styleVars) {
5
6
  mountedVarKeys.forEach(key => document.documentElement.style.removeProperty(key));
@@ -12,12 +13,8 @@ function StyleProvider(styleVars) {
12
13
  });
13
14
  }
14
15
  StyleProvider.Component = VarStyleProvider;
15
- VarStyleProvider.install = function (app) {
16
- app.component(VarStyleProvider.name, VarStyleProvider);
17
- };
18
- StyleProvider.install = function (app) {
19
- app.component(VarStyleProvider.name, VarStyleProvider);
20
- };
16
+ withInstall(VarStyleProvider);
17
+ withInstall(VarStyleProvider, StyleProvider);
21
18
  export { props as styleProviderProps } from './props.mjs';
22
19
  export var _StyleProviderComponent = VarStyleProvider;
23
20
  export default StyleProvider;