@varlet/ui 1.26.4 → 1.26.7
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/README.en-US.md +14 -15
- package/README.md +19 -18
- package/es/date-picker/DatePicker.js +86 -12
- package/es/date-picker/date-picker.css +1 -1
- package/es/date-picker/date-picker.less +11 -0
- package/es/date-picker/props.js +4 -0
- package/es/date-picker/src/day-picker-panel.js +17 -4
- package/es/date-picker/src/month-picker-panel.js +17 -4
- package/es/date-picker/src/panel-header.js +1 -0
- package/es/image-preview/ImagePreview.js +4 -1
- package/es/image-preview/imagePreview.css +1 -1
- package/es/image-preview/imagePreview.less +11 -1
- package/es/index-bar/IndexBar.js +8 -14
- package/es/snackbar/style/index.js +1 -1
- package/es/snackbar/style/less.js +1 -1
- package/es/style.css +1 -1
- package/es/uploader/Uploader.js +14 -1
- package/es/uploader/props.js +4 -0
- package/es/varlet.esm.js +201 -83
- package/highlight/attributes.json +8 -0
- package/highlight/tags.json +3 -1
- package/highlight/web-types.json +23 -1
- package/lib/date-picker/DatePicker.js +86 -11
- package/lib/date-picker/date-picker.css +1 -1
- package/lib/date-picker/date-picker.less +11 -0
- package/lib/date-picker/props.js +4 -0
- package/lib/date-picker/src/day-picker-panel.js +17 -4
- package/lib/date-picker/src/month-picker-panel.js +17 -4
- package/lib/date-picker/src/panel-header.js +1 -0
- package/lib/image-preview/ImagePreview.js +4 -1
- package/lib/image-preview/imagePreview.css +1 -1
- package/lib/image-preview/imagePreview.less +11 -1
- package/lib/index-bar/IndexBar.js +7 -13
- package/lib/style.css +1 -1
- package/lib/uploader/Uploader.js +14 -1
- package/lib/uploader/props.js +4 -0
- package/package.json +5 -5
- package/types/datePicker.d.ts +1 -0
- package/types/uploader.d.ts +1 -0
- package/umd/varlet.js +4 -4
package/es/index-bar/IndexBar.js
CHANGED
|
@@ -4,7 +4,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
4
4
|
|
|
5
5
|
import { computed, defineComponent, ref, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
6
6
|
import { easeInOutCubic, isPlainObject, toNumber } from '../utils/shared';
|
|
7
|
-
import { doubleRaf, getParentScroller, getScrollLeft, nextTickFrame, requestAnimationFrame, scrollTo as varScrollTo } from '../utils/elements';
|
|
7
|
+
import { doubleRaf, getParentScroller, getScrollLeft, getScrollTop, nextTickFrame, requestAnimationFrame, scrollTo as varScrollTo } from '../utils/elements';
|
|
8
8
|
import { useIndexAnchors } from './provide';
|
|
9
9
|
import { props } from './props';
|
|
10
10
|
import { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
@@ -55,7 +55,6 @@ export default defineComponent({
|
|
|
55
55
|
indexAnchors,
|
|
56
56
|
bindIndexAnchors
|
|
57
57
|
} = useIndexAnchors();
|
|
58
|
-
var scrollEl = ref(null);
|
|
59
58
|
var clickedName = ref('');
|
|
60
59
|
var scroller = ref(null);
|
|
61
60
|
var barEl = ref(null);
|
|
@@ -82,10 +81,8 @@ export default defineComponent({
|
|
|
82
81
|
};
|
|
83
82
|
|
|
84
83
|
var handleScroll = () => {
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
scrollHeight
|
|
88
|
-
} = scrollEl.value;
|
|
84
|
+
var scrollTop = getScrollTop(scroller.value);
|
|
85
|
+
var scrollHeight = scroller.value === window ? document.body.scrollHeight : scroller.value.scrollHeight;
|
|
89
86
|
var {
|
|
90
87
|
offsetTop
|
|
91
88
|
} = barEl.value;
|
|
@@ -120,10 +117,10 @@ export default defineComponent({
|
|
|
120
117
|
});
|
|
121
118
|
if (!indexAnchor) return;
|
|
122
119
|
var top = indexAnchor.ownTop.value - stickyOffsetTop.value + offsetTop;
|
|
123
|
-
var left = getScrollLeft(
|
|
120
|
+
var left = getScrollLeft(scroller.value);
|
|
124
121
|
clickedName.value = anchorName;
|
|
125
122
|
emitEvent(anchorName);
|
|
126
|
-
yield varScrollTo(
|
|
123
|
+
yield varScrollTo(scroller.value, {
|
|
127
124
|
left,
|
|
128
125
|
top,
|
|
129
126
|
animation: easeInOutCubic,
|
|
@@ -156,17 +153,14 @@ export default defineComponent({
|
|
|
156
153
|
});
|
|
157
154
|
}));
|
|
158
155
|
onMounted( /*#__PURE__*/_asyncToGenerator(function* () {
|
|
159
|
-
var _scroller$value;
|
|
160
|
-
|
|
161
156
|
yield doubleRaf();
|
|
162
157
|
scroller.value = getParentScroller(barEl.value);
|
|
163
|
-
|
|
164
|
-
(_scroller$value = scroller.value) == null ? void 0 : _scroller$value.addEventListener('scroll', handleScroll);
|
|
158
|
+
scroller.value.addEventListener('scroll', handleScroll);
|
|
165
159
|
}));
|
|
166
160
|
onBeforeUnmount(() => {
|
|
167
|
-
var _scroller$
|
|
161
|
+
var _scroller$value;
|
|
168
162
|
|
|
169
|
-
(_scroller$
|
|
163
|
+
(_scroller$value = scroller.value) == null ? void 0 : _scroller$value.removeEventListener('scroll', handleScroll);
|
|
170
164
|
});
|
|
171
165
|
return {
|
|
172
166
|
barEl,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../styles/common.css'
|
|
2
|
-
import '../SnackbarSfc.css'
|
|
3
2
|
import '../../styles/elevation.css'
|
|
4
3
|
import '../../loading/loading.css'
|
|
5
4
|
import '../../button/button.css'
|
|
6
5
|
import '../../icon/icon.css'
|
|
7
6
|
import '../snackbar.css'
|
|
8
7
|
import '../coreSfc.css'
|
|
8
|
+
import '../SnackbarSfc.css'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../styles/common.less'
|
|
2
|
-
import '../SnackbarSfc.less'
|
|
3
2
|
import '../../styles/elevation.less'
|
|
4
3
|
import '../../loading/loading.less'
|
|
5
4
|
import '../../button/button.less'
|
|
6
5
|
import '../../icon/icon.less'
|
|
7
6
|
import '../snackbar.less'
|
|
8
7
|
import '../coreSfc.less'
|
|
8
|
+
import '../SnackbarSfc.less'
|