@varlet/ui 2.16.2 → 2.16.3-alpha.1694361535255

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 (88) hide show
  1. package/es/action-sheet/ActionSheet.mjs +20 -16
  2. package/es/app-bar/AppBar.mjs +10 -9
  3. package/es/avatar/Avatar.mjs +16 -15
  4. package/es/avatar-group/AvatarGroup.mjs +4 -3
  5. package/es/back-top/BackTop.mjs +20 -19
  6. package/es/badge/Badge.mjs +4 -3
  7. package/es/bottom-navigation/BottomNavigation.mjs +70 -63
  8. package/es/bottom-navigation-item/BottomNavigationItem.mjs +13 -10
  9. package/es/breadcrumb/Breadcrumb.mjs +5 -4
  10. package/es/breadcrumbs/Breadcrumbs.mjs +2 -1
  11. package/es/button/Button.mjs +10 -9
  12. package/es/button-group/ButtonGroup.mjs +2 -1
  13. package/es/card/Card.mjs +28 -26
  14. package/es/cell/Cell.mjs +5 -4
  15. package/es/checkbox/Checkbox.mjs +32 -29
  16. package/es/checkbox-group/CheckboxGroup.mjs +45 -40
  17. package/es/chip/Chip.mjs +6 -5
  18. package/es/col/Col.mjs +15 -14
  19. package/es/collapse/Collapse.mjs +30 -29
  20. package/es/collapse-item/CollapseItem.mjs +52 -47
  21. package/es/countdown/Countdown.mjs +36 -35
  22. package/es/counter/Counter.mjs +63 -60
  23. package/es/date-picker/DatePicker.mjs +67 -63
  24. package/es/dialog/Dialog.mjs +39 -29
  25. package/es/divider/Divider.mjs +6 -9
  26. package/es/drag/Drag.mjs +47 -45
  27. package/es/ellipsis/Ellipsis.mjs +6 -5
  28. package/es/fab/Fab.mjs +21 -20
  29. package/es/field-decorator/FieldDecorator.mjs +14 -13
  30. package/es/form/Form.mjs +41 -36
  31. package/es/form-details/FormDetails.mjs +2 -1
  32. package/es/hover-overlay/HoverOverlay.mjs +6 -7
  33. package/es/icon/Icon.mjs +14 -12
  34. package/es/image/Image.mjs +14 -12
  35. package/es/image-preview/ImagePreview.mjs +51 -50
  36. package/es/index-anchor/IndexAnchor.mjs +15 -12
  37. package/es/index-bar/IndexBar.mjs +68 -65
  38. package/es/index.bundle.mjs +1 -1
  39. package/es/index.mjs +1 -1
  40. package/es/input/Input.mjs +63 -56
  41. package/es/link/Link.mjs +6 -5
  42. package/es/list/List.mjs +55 -46
  43. package/es/loading/Loading.mjs +11 -8
  44. package/es/loading-bar/LoadingBar.mjs +2 -1
  45. package/es/menu/Menu.mjs +2 -1
  46. package/es/option/Option.mjs +14 -11
  47. package/es/overlay/Overlay.mjs +18 -18
  48. package/es/pagination/Pagination.mjs +67 -64
  49. package/es/paper/Paper.mjs +4 -3
  50. package/es/picker/Picker.mjs +95 -85
  51. package/es/popup/Popup.mjs +26 -23
  52. package/es/progress/Progress.mjs +9 -8
  53. package/es/pull-refresh/PullRefresh.mjs +54 -51
  54. package/es/radio/Radio.mjs +25 -22
  55. package/es/radio-group/RadioGroup.mjs +30 -25
  56. package/es/rate/Rate.mjs +35 -28
  57. package/es/result/Result.mjs +6 -5
  58. package/es/row/Row.mjs +14 -13
  59. package/es/select/Select.mjs +57 -54
  60. package/es/skeleton/Skeleton.mjs +8 -9
  61. package/es/slider/Slider.mjs +86 -79
  62. package/es/snackbar/Snackbar.mjs +4 -3
  63. package/es/snackbar/style/index.mjs +1 -1
  64. package/es/space/Space.mjs +5 -2
  65. package/es/step/Step.mjs +7 -4
  66. package/es/steps/Steps.mjs +5 -4
  67. package/es/sticky/Sticky.mjs +30 -27
  68. package/es/style-provider/StyleProvider.mjs +2 -1
  69. package/es/swipe/Swipe.mjs +95 -89
  70. package/es/swipe-item/SwipeItem.mjs +5 -4
  71. package/es/switch/Switch.mjs +22 -17
  72. package/es/tab/Tab.mjs +16 -12
  73. package/es/tab-item/TabItem.mjs +7 -6
  74. package/es/table/Table.mjs +8 -9
  75. package/es/tabs/Tabs.mjs +57 -52
  76. package/es/tabs-items/TabsItems.mjs +38 -29
  77. package/es/time-picker/TimePicker.mjs +63 -60
  78. package/es/tooltip/Tooltip.mjs +3 -2
  79. package/es/uploader/Uploader.mjs +100 -85
  80. package/es/utils/components.mjs +2 -1
  81. package/es/utils/shared.mjs +0 -1
  82. package/es/varlet.esm.js +9589 -8914
  83. package/es/watermark/Watermark.mjs +29 -26
  84. package/highlight/web-types.en-US.json +1 -1
  85. package/highlight/web-types.zh-CN.json +1 -1
  86. package/lib/varlet.cjs.js +2365 -2102
  87. package/package.json +12 -14
  88. package/umd/varlet.js +4 -4
@@ -6,6 +6,7 @@ import { createNamespace } from '../utils/components.mjs';
6
6
  import { props } from './props.mjs';
7
7
  import { getStyle } from '@varlet/shared';
8
8
  var {
9
+ name,
9
10
  n,
10
11
  classes
11
12
  } = createNamespace('watermark');
@@ -73,7 +74,7 @@ function __render__(_ctx, _cache) {
73
74
  }
74
75
 
75
76
  var __sfc__ = defineComponent({
76
- name: 'VarWatermark',
77
+ name,
77
78
  props,
78
79
  setup(props, _ref) {
79
80
  var {
@@ -84,7 +85,12 @@ var __sfc__ = defineComponent({
84
85
  var textColor = ref('');
85
86
  var svgRef = ref(null);
86
87
  var containerRef = ref(null);
87
- var showContent = () => {
88
+ watch(() => [props.image, props.font, props.content, props.height, props.width, props.rotate, props.gapX, props.gapY, props.offsetX, props.offsetY, props.opacity], resize, {
89
+ deep: true
90
+ });
91
+ onMounted(resize);
92
+ onUnmounted(revokeWatermarkUrl);
93
+ function showContent() {
88
94
  if (slots.content) {
89
95
  return true;
90
96
  }
@@ -92,9 +98,12 @@ var __sfc__ = defineComponent({
92
98
  return true;
93
99
  }
94
100
  return false;
95
- };
96
- var imageToBase64 = /*#__PURE__*/function () {
97
- var _ref2 = _asyncToGenerator(function* () {
101
+ }
102
+ function imageToBase64() {
103
+ return _imageToBase.apply(this, arguments);
104
+ }
105
+ function _imageToBase() {
106
+ _imageToBase = _asyncToGenerator(function* () {
98
107
  return new Promise(resolve => {
99
108
  var canvas = document.createElement('canvas');
100
109
  var ctx = canvas.getContext('2d');
@@ -110,25 +119,26 @@ var __sfc__ = defineComponent({
110
119
  };
111
120
  });
112
121
  });
113
- return function imageToBase64() {
114
- return _ref2.apply(this, arguments);
115
- };
116
- }();
117
- var svgToBlobUrl = svgStr => {
122
+ return _imageToBase.apply(this, arguments);
123
+ }
124
+ function svgToBlobUrl(svgStr) {
118
125
  var svgBlob = new Blob([svgStr], {
119
126
  type: 'image/svg+xml'
120
127
  });
121
128
  return URL.createObjectURL(svgBlob);
122
- };
123
- var revokeWatermarkUrl = () => {
129
+ }
130
+ function revokeWatermarkUrl() {
124
131
  if (watermarkUrl.value) {
125
132
  URL.revokeObjectURL(watermarkUrl.value);
126
133
  }
127
- };
134
+ }
128
135
 
129
136
  // expose
130
- var resize = /*#__PURE__*/function () {
131
- var _ref3 = _asyncToGenerator(function* () {
137
+ function resize() {
138
+ return _resize.apply(this, arguments);
139
+ }
140
+ function _resize() {
141
+ _resize = _asyncToGenerator(function* () {
132
142
  textColor.value = getStyle(containerRef.value).color;
133
143
  if (props.image) {
134
144
  imageUrl.value = yield imageToBase64();
@@ -137,23 +147,16 @@ var __sfc__ = defineComponent({
137
147
  revokeWatermarkUrl();
138
148
  watermarkUrl.value = svgToBlobUrl(svgRef.value.innerHTML);
139
149
  });
140
- return function resize() {
141
- return _ref3.apply(this, arguments);
142
- };
143
- }();
144
- watch(() => [props.image, props.font, props.content, props.height, props.width, props.rotate, props.gapX, props.gapY, props.offsetX, props.offsetY, props.opacity], resize, {
145
- deep: true
146
- });
147
- onMounted(resize);
148
- onUnmounted(revokeWatermarkUrl);
150
+ return _resize.apply(this, arguments);
151
+ }
149
152
  return {
150
- n,
151
- classes,
152
153
  svgRef,
153
154
  containerRef,
154
155
  watermarkUrl,
155
156
  imageUrl,
156
157
  textColor,
158
+ n,
159
+ classes,
157
160
  showContent,
158
161
  resize
159
162
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "2.16.2",
4
+ "version": "2.16.3-alpha.1694361535255",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "2.16.2",
4
+ "version": "2.16.3-alpha.1694361535255",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {