@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.
- package/es/action-sheet/ActionSheet.mjs +20 -16
- package/es/app-bar/AppBar.mjs +10 -9
- package/es/avatar/Avatar.mjs +16 -15
- package/es/avatar-group/AvatarGroup.mjs +4 -3
- package/es/back-top/BackTop.mjs +20 -19
- package/es/badge/Badge.mjs +4 -3
- package/es/bottom-navigation/BottomNavigation.mjs +70 -63
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +13 -10
- package/es/breadcrumb/Breadcrumb.mjs +5 -4
- package/es/breadcrumbs/Breadcrumbs.mjs +2 -1
- package/es/button/Button.mjs +10 -9
- package/es/button-group/ButtonGroup.mjs +2 -1
- package/es/card/Card.mjs +28 -26
- package/es/cell/Cell.mjs +5 -4
- package/es/checkbox/Checkbox.mjs +32 -29
- package/es/checkbox-group/CheckboxGroup.mjs +45 -40
- package/es/chip/Chip.mjs +6 -5
- package/es/col/Col.mjs +15 -14
- package/es/collapse/Collapse.mjs +30 -29
- package/es/collapse-item/CollapseItem.mjs +52 -47
- package/es/countdown/Countdown.mjs +36 -35
- package/es/counter/Counter.mjs +63 -60
- package/es/date-picker/DatePicker.mjs +67 -63
- package/es/dialog/Dialog.mjs +39 -29
- package/es/divider/Divider.mjs +6 -9
- package/es/drag/Drag.mjs +47 -45
- package/es/ellipsis/Ellipsis.mjs +6 -5
- package/es/fab/Fab.mjs +21 -20
- package/es/field-decorator/FieldDecorator.mjs +14 -13
- package/es/form/Form.mjs +41 -36
- package/es/form-details/FormDetails.mjs +2 -1
- package/es/hover-overlay/HoverOverlay.mjs +6 -7
- package/es/icon/Icon.mjs +14 -12
- package/es/image/Image.mjs +14 -12
- package/es/image-preview/ImagePreview.mjs +51 -50
- package/es/index-anchor/IndexAnchor.mjs +15 -12
- package/es/index-bar/IndexBar.mjs +68 -65
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +63 -56
- package/es/link/Link.mjs +6 -5
- package/es/list/List.mjs +55 -46
- package/es/loading/Loading.mjs +11 -8
- package/es/loading-bar/LoadingBar.mjs +2 -1
- package/es/menu/Menu.mjs +2 -1
- package/es/option/Option.mjs +14 -11
- package/es/overlay/Overlay.mjs +18 -18
- package/es/pagination/Pagination.mjs +67 -64
- package/es/paper/Paper.mjs +4 -3
- package/es/picker/Picker.mjs +95 -85
- package/es/popup/Popup.mjs +26 -23
- package/es/progress/Progress.mjs +9 -8
- package/es/pull-refresh/PullRefresh.mjs +54 -51
- package/es/radio/Radio.mjs +25 -22
- package/es/radio-group/RadioGroup.mjs +30 -25
- package/es/rate/Rate.mjs +35 -28
- package/es/result/Result.mjs +6 -5
- package/es/row/Row.mjs +14 -13
- package/es/select/Select.mjs +57 -54
- package/es/skeleton/Skeleton.mjs +8 -9
- package/es/slider/Slider.mjs +86 -79
- package/es/snackbar/Snackbar.mjs +4 -3
- package/es/snackbar/style/index.mjs +1 -1
- package/es/space/Space.mjs +5 -2
- package/es/step/Step.mjs +7 -4
- package/es/steps/Steps.mjs +5 -4
- package/es/sticky/Sticky.mjs +30 -27
- package/es/style-provider/StyleProvider.mjs +2 -1
- package/es/swipe/Swipe.mjs +95 -89
- package/es/swipe-item/SwipeItem.mjs +5 -4
- package/es/switch/Switch.mjs +22 -17
- package/es/tab/Tab.mjs +16 -12
- package/es/tab-item/TabItem.mjs +7 -6
- package/es/table/Table.mjs +8 -9
- package/es/tabs/Tabs.mjs +57 -52
- package/es/tabs-items/TabsItems.mjs +38 -29
- package/es/time-picker/TimePicker.mjs +63 -60
- package/es/tooltip/Tooltip.mjs +3 -2
- package/es/uploader/Uploader.mjs +100 -85
- package/es/utils/components.mjs +2 -1
- package/es/utils/shared.mjs +0 -1
- package/es/varlet.esm.js +9589 -8914
- package/es/watermark/Watermark.mjs +29 -26
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/varlet.cjs.js +2365 -2102
- package/package.json +12 -14
- 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
|
|
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
|
-
|
|
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
|
-
|
|
97
|
-
|
|
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
|
|
114
|
-
|
|
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
|
-
|
|
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
|
-
|
|
131
|
-
|
|
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
|
|
141
|
-
|
|
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
|
};
|