@varlet/ui 1.24.1 → 1.24.2-alpha.1640861757955
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/back-top/BackTop.js +3 -1
- package/es/badge/Badge.js +4 -3
- package/es/button/Button.js +6 -2
- package/es/card/Card.js +3 -1
- package/es/checkbox/Checkbox.js +3 -1
- package/es/checkbox-group/CheckboxGroup.js +23 -11
- package/es/chip/Chip.js +3 -1
- package/es/col/Col.js +3 -1
- package/es/collapse/Collapse.js +24 -14
- package/es/collapse-item/CollapseItem.js +3 -1
- package/es/counter/Counter.js +3 -1
- package/es/date-picker/DatePicker.js +2 -2
- package/es/date-picker/src/day-picker-panel.js +4 -3
- package/es/date-picker/src/month-picker-panel.js +4 -3
- package/es/date-picker/src/panel-header.js +4 -3
- package/es/date-picker/src/year-picker-panel.js +4 -3
- package/es/divider/Divider.js +4 -3
- package/es/form/Form.js +18 -9
- package/es/icon/icon.css +1 -1
- package/es/image/Image.js +18 -6
- package/es/image-preview/ImagePreview.js +21 -12
- package/es/index-bar/IndexBar.js +11 -7
- package/es/input/Input.js +27 -9
- package/es/lazy/index.js +5 -1
- package/es/list/List.js +3 -1
- package/es/loading/Loading.js +4 -3
- package/es/menu/Menu.js +59 -52
- package/es/menu/index.js +1 -1
- package/es/menu/style/index.js +0 -1
- package/es/menu/style/less.js +0 -1
- package/es/option/Option.js +3 -1
- package/es/pagination/Pagination.js +9 -3
- package/es/picker/Picker.js +5 -1
- package/es/popup/Popup.js +5 -4
- package/es/pull-refresh/PullRefresh.js +12 -4
- package/es/radio/Radio.js +3 -1
- package/es/radio-group/RadioGroup.js +6 -3
- package/es/row/Row.js +3 -1
- package/es/select/Select.js +36 -18
- package/es/slider/Slider.js +14 -3
- package/es/snackbar/index.js +16 -7
- package/es/space/Space.js +5 -3
- package/es/step/Step.js +6 -2
- package/es/style-provider/StyleProvider.js +4 -3
- package/es/style-provider/index.js +7 -2
- package/es/swipe/Swipe.js +16 -7
- package/es/switch/Switch.js +3 -1
- package/es/tab/Tab.js +3 -1
- package/es/tabs/Tabs.js +21 -12
- package/es/tabs-items/TabsItems.js +24 -12
- package/es/time-picker/TimePicker.js +9 -3
- package/es/time-picker/clock.js +9 -5
- package/es/uploader/Uploader.js +16 -8
- package/es/utils/components.js +9 -1
- package/es/utils/elements.js +9 -7
- package/es/utils/jest.js +41 -12
- package/es/utils/shared.js +20 -4
- package/lib/action-sheet/ActionSheet.js +1 -1
- package/lib/app-bar/AppBar.js +1 -1
- package/lib/back-top/BackTop.js +4 -2
- package/lib/badge/Badge.js +5 -4
- package/lib/button/Button.js +7 -3
- package/lib/card/Card.js +4 -2
- package/lib/cell/Cell.js +1 -1
- package/lib/checkbox/Checkbox.js +4 -2
- package/lib/checkbox-group/CheckboxGroup.js +24 -12
- package/lib/checkbox-group/provide.js +1 -1
- package/lib/chip/Chip.js +4 -2
- package/lib/col/Col.js +4 -2
- package/lib/collapse/Collapse.js +25 -15
- package/lib/collapse/provide.js +1 -1
- package/lib/collapse-item/CollapseItem.js +4 -2
- package/lib/context/lock.js +1 -1
- package/lib/countdown/Countdown.js +1 -1
- package/lib/counter/Counter.js +4 -2
- package/lib/date-picker/DatePicker.js +3 -3
- package/lib/date-picker/src/day-picker-panel.js +5 -4
- package/lib/date-picker/src/month-picker-panel.js +5 -4
- package/lib/date-picker/src/panel-header.js +5 -4
- package/lib/date-picker/src/year-picker-panel.js +5 -4
- package/lib/dialog/Dialog.js +1 -1
- package/lib/divider/Divider.js +5 -4
- package/lib/form/Form.js +19 -10
- package/lib/form/provide.js +1 -1
- package/lib/form-details/FormDetails.js +1 -1
- package/lib/icon/Icon.js +1 -1
- package/lib/icon/icon.css +1 -1
- package/lib/image/Image.js +19 -7
- package/lib/image-preview/ImagePreview.js +22 -13
- package/lib/index-anchor/IndexAnchor.js +1 -1
- package/lib/index-bar/IndexBar.js +12 -8
- package/lib/index-bar/provide.js +1 -1
- package/lib/input/Input.js +28 -10
- package/lib/input/props.js +1 -1
- package/lib/lazy/index.js +6 -2
- package/lib/list/List.js +4 -2
- package/lib/loading/Loading.js +5 -4
- package/lib/loading/props.js +2 -2
- package/lib/locale/index.js +1 -1
- package/lib/menu/Menu.js +56 -50
- package/lib/menu/index.js +1 -1
- package/lib/menu/style/index.js +0 -1
- package/lib/menu/style/less.js +0 -1
- package/lib/option/Option.js +4 -2
- package/lib/pagination/Pagination.js +10 -4
- package/lib/picker/Picker.js +6 -2
- package/lib/popup/Popup.js +5 -4
- package/lib/progress/Progress.js +1 -1
- package/lib/pull-refresh/PullRefresh.js +13 -5
- package/lib/radio/Radio.js +4 -2
- package/lib/radio-group/RadioGroup.js +7 -4
- package/lib/radio-group/provide.js +1 -1
- package/lib/rate/Rate.js +1 -1
- package/lib/row/Row.js +4 -2
- package/lib/row/provide.js +1 -1
- package/lib/select/Select.js +37 -19
- package/lib/select/props.js +1 -1
- package/lib/select/provide.js +1 -1
- package/lib/skeleton/Skeleton.js +1 -1
- package/lib/slider/Slider.js +15 -4
- package/lib/snackbar/Snackbar.js +1 -1
- package/lib/snackbar/core.js +1 -1
- package/lib/snackbar/index.js +16 -7
- package/lib/snackbar/props.js +1 -1
- package/lib/space/Space.js +5 -3
- package/lib/space/props.js +1 -1
- package/lib/step/Step.js +7 -3
- package/lib/steps/Steps.js +1 -1
- package/lib/steps/provide.js +1 -1
- package/lib/sticky/Sticky.js +1 -1
- package/lib/style-provider/StyleProvider.js +4 -3
- package/lib/style-provider/index.js +7 -2
- package/lib/style.css +1 -1
- package/lib/swipe/Swipe.js +17 -8
- package/lib/swipe/provide.js +1 -1
- package/lib/swipe-item/SwipeItem.js +1 -1
- package/lib/switch/Switch.js +4 -2
- package/lib/tab/Tab.js +4 -2
- package/lib/tab-item/TabItem.js +1 -1
- package/lib/table/Table.js +1 -1
- package/lib/tabs/Tabs.js +22 -13
- package/lib/tabs/provide.js +1 -1
- package/lib/tabs-items/TabsItems.js +25 -13
- package/lib/tabs-items/provide.js +1 -1
- package/lib/time-picker/TimePicker.js +10 -4
- package/lib/time-picker/clock.js +10 -6
- package/lib/time-picker/props.js +1 -1
- package/lib/time-picker/utils.js +1 -1
- package/lib/uploader/Uploader.js +17 -9
- package/lib/utils/components.js +15 -7
- package/lib/utils/elements.js +20 -17
- package/lib/utils/jest.js +49 -20
- package/lib/utils/shared.js +24 -6
- package/package.json +25 -17
- package/umd/varlet.js +4 -4
- package/es/menu/MenuSfc.css +0 -0
- package/es/menu/MenuSfc.less +0 -0
- package/lib/menu/MenuSfc.css +0 -0
- package/lib/menu/MenuSfc.less +0 -0
package/es/snackbar/index.js
CHANGED
|
@@ -44,11 +44,12 @@ var transitionGroupProps = {
|
|
|
44
44
|
var TransitionGroupHost = {
|
|
45
45
|
setup() {
|
|
46
46
|
return () => {
|
|
47
|
-
var snackbarList = uniqSnackbarOptions.map(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
var snackbarList = uniqSnackbarOptions.map(_ref => {
|
|
48
|
+
var {
|
|
49
|
+
id,
|
|
50
|
+
reactiveSnackOptions,
|
|
51
|
+
_update
|
|
52
|
+
} = _ref;
|
|
52
53
|
var transitionGroupEl = document.querySelector('.var-transition-group');
|
|
53
54
|
|
|
54
55
|
if (reactiveSnackOptions.forbidClick || reactiveSnackOptions.type === 'loading') {
|
|
@@ -150,7 +151,11 @@ Snackbar.install = function (app) {
|
|
|
150
151
|
app.component(VarSnackbar.name, VarSnackbar);
|
|
151
152
|
};
|
|
152
153
|
|
|
153
|
-
Snackbar.allowMultiple = function (bool
|
|
154
|
+
Snackbar.allowMultiple = function (bool) {
|
|
155
|
+
if (bool === void 0) {
|
|
156
|
+
bool = false;
|
|
157
|
+
}
|
|
158
|
+
|
|
154
159
|
if (bool !== isAllowMultiple) {
|
|
155
160
|
uniqSnackbarOptions.forEach(option => {
|
|
156
161
|
option.reactiveSnackOptions.show = false;
|
|
@@ -202,7 +207,11 @@ function updateUniqOption(reactiveSnackOptions, _update) {
|
|
|
202
207
|
firstOption._update = _update;
|
|
203
208
|
}
|
|
204
209
|
|
|
205
|
-
function getTop(position
|
|
210
|
+
function getTop(position) {
|
|
211
|
+
if (position === void 0) {
|
|
212
|
+
position = 'top';
|
|
213
|
+
}
|
|
214
|
+
|
|
206
215
|
if (position === 'bottom') return {
|
|
207
216
|
[position]: '5%'
|
|
208
217
|
};
|
package/es/space/Space.js
CHANGED
|
@@ -15,9 +15,11 @@ export default defineComponent({
|
|
|
15
15
|
name: 'VarSpace',
|
|
16
16
|
props,
|
|
17
17
|
|
|
18
|
-
setup(props, {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
setup(props, _ref) {
|
|
19
|
+
var {
|
|
20
|
+
slots
|
|
21
|
+
} = _ref;
|
|
22
|
+
|
|
21
23
|
var getSize = (size, isInternalSize) => {
|
|
22
24
|
return isInternalSize ? internalSizes[size] : isArray(size) ? size.map(toPxNum) : [toPxNum(size), toPxNum(size)];
|
|
23
25
|
};
|
package/es/step/Step.js
CHANGED
|
@@ -28,7 +28,9 @@ export function render(_ctx, _cache) {
|
|
|
28
28
|
style: _normalizeStyle({
|
|
29
29
|
backgroundColor: _ctx.isActive || _ctx.isCurrent ? _ctx.activeColor : _ctx.inactiveColor
|
|
30
30
|
}),
|
|
31
|
-
onClick: _cache[0] || (_cache[0] = (
|
|
31
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
32
|
+
return _ctx.click && _ctx.click(...arguments);
|
|
33
|
+
})
|
|
32
34
|
}, [_ctx.isActive ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
33
35
|
key: 0,
|
|
34
36
|
class: "var-step__icon",
|
|
@@ -59,7 +61,9 @@ export function render(_ctx, _cache) {
|
|
|
59
61
|
["var-step-" + _ctx.direction + "__content"]: true,
|
|
60
62
|
["var-step-" + _ctx.direction + "__content--active"]: _ctx.isActive || _ctx.isCurrent
|
|
61
63
|
}),
|
|
62
|
-
onClick: _cache[1] || (_cache[1] = (
|
|
64
|
+
onClick: _cache[1] || (_cache[1] = function () {
|
|
65
|
+
return _ctx.click && _ctx.click(...arguments);
|
|
66
|
+
})
|
|
63
67
|
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
64
68
|
/* CLASS */
|
|
65
69
|
)], 2
|
|
@@ -2,11 +2,16 @@ import VarStyleProvider from './StyleProvider.js'
|
|
|
2
2
|
import { formatStyleVars } from '../utils/elements';
|
|
3
3
|
var mountedVarKeys = [];
|
|
4
4
|
|
|
5
|
-
function StyleProvider(styleVars
|
|
5
|
+
function StyleProvider(styleVars) {
|
|
6
|
+
if (styleVars === void 0) {
|
|
7
|
+
styleVars = {};
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
mountedVarKeys.forEach(key => document.documentElement.style.removeProperty(key));
|
|
7
11
|
mountedVarKeys.length = 0;
|
|
8
12
|
var styles = formatStyleVars(styleVars);
|
|
9
|
-
Object.entries(styles).forEach(
|
|
13
|
+
Object.entries(styles).forEach(_ref => {
|
|
14
|
+
var [key, value] = _ref;
|
|
10
15
|
document.documentElement.style.setProperty(key, value);
|
|
11
16
|
mountedVarKeys.push(key);
|
|
12
17
|
});
|
package/es/swipe/Swipe.js
CHANGED
|
@@ -23,9 +23,15 @@ export function render(_ctx, _cache) {
|
|
|
23
23
|
transform: "translate" + (_ctx.vertical ? 'Y' : 'X') + "(" + _ctx.translate + "px)",
|
|
24
24
|
transitionDuration: _ctx.lockDuration ? "0ms" : _ctx.toNumber(_ctx.duration) + "ms"
|
|
25
25
|
}),
|
|
26
|
-
onTouchstart: _cache[0] || (_cache[0] = (
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
onTouchstart: _cache[0] || (_cache[0] = function () {
|
|
27
|
+
return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
|
|
28
|
+
}),
|
|
29
|
+
onTouchmove: _cache[1] || (_cache[1] = function () {
|
|
30
|
+
return _ctx.handleTouchmove && _ctx.handleTouchmove(...arguments);
|
|
31
|
+
}),
|
|
32
|
+
onTouchend: _cache[2] || (_cache[2] = function () {
|
|
33
|
+
return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
|
|
34
|
+
})
|
|
29
35
|
}, [_renderSlot(_ctx.$slots, "default")], 38
|
|
30
36
|
/* CLASS, STYLE, HYDRATE_EVENTS */
|
|
31
37
|
), _renderSlot(_ctx.$slots, "indicator", {
|
|
@@ -79,9 +85,12 @@ export default defineComponent({
|
|
|
79
85
|
var prevX;
|
|
80
86
|
var prevY;
|
|
81
87
|
|
|
82
|
-
var findSwipeItem = idx => swipeItems.find(
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
var findSwipeItem = idx => swipeItems.find(_ref => {
|
|
89
|
+
var {
|
|
90
|
+
index
|
|
91
|
+
} = _ref;
|
|
92
|
+
return index.value === idx;
|
|
93
|
+
});
|
|
85
94
|
|
|
86
95
|
var dispatchBorrower = () => {
|
|
87
96
|
if (!props.loop) {
|
|
@@ -195,7 +204,7 @@ export default defineComponent({
|
|
|
195
204
|
};
|
|
196
205
|
|
|
197
206
|
var stopAutoplay = () => {
|
|
198
|
-
timer &&
|
|
207
|
+
timer && clearTimeout(timer);
|
|
199
208
|
};
|
|
200
209
|
|
|
201
210
|
var getDirection = (x, y) => {
|
package/es/switch/Switch.js
CHANGED
|
@@ -22,7 +22,9 @@ export function render(_ctx, _cache) {
|
|
|
22
22
|
|
|
23
23
|
return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
|
|
24
24
|
class: _normalizeClass(["var-switch-block", [_ctx.disabled || _ctx.formDisabled ? 'var-switch__disable' : null]]),
|
|
25
|
-
onClick: _cache[0] || (_cache[0] = (
|
|
25
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
26
|
+
return _ctx.switchActive && _ctx.switchActive(...arguments);
|
|
27
|
+
}),
|
|
26
28
|
style: _normalizeStyle(_ctx.styleComputed.switch)
|
|
27
29
|
}, [_createElementVNode("div", {
|
|
28
30
|
style: _normalizeStyle(_ctx.styleComputed.track),
|
package/es/tab/Tab.js
CHANGED
|
@@ -12,7 +12,9 @@ export function render(_ctx, _cache) {
|
|
|
12
12
|
style: _normalizeStyle({
|
|
13
13
|
color: _ctx.computeColorStyle()
|
|
14
14
|
}),
|
|
15
|
-
onClick: _cache[0] || (_cache[0] = (
|
|
15
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
16
|
+
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
17
|
+
})
|
|
16
18
|
}, [_renderSlot(_ctx.$slots, "default")], 6
|
|
17
19
|
/* CLASS, STYLE */
|
|
18
20
|
)), [[_directive_ripple, {
|
package/es/tabs/Tabs.js
CHANGED
|
@@ -81,15 +81,21 @@ export default defineComponent({
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
var matchName = () => {
|
|
84
|
-
return tabList.find(
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
return tabList.find(_ref => {
|
|
85
|
+
var {
|
|
86
|
+
name
|
|
87
|
+
} = _ref;
|
|
88
|
+
return props.active === name.value;
|
|
89
|
+
});
|
|
87
90
|
};
|
|
88
91
|
|
|
89
92
|
var matchIndex = () => {
|
|
90
|
-
return tabList.find(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
return tabList.find(_ref2 => {
|
|
94
|
+
var {
|
|
95
|
+
index
|
|
96
|
+
} = _ref2;
|
|
97
|
+
return props.active === index.value;
|
|
98
|
+
});
|
|
93
99
|
};
|
|
94
100
|
|
|
95
101
|
var matchBoundary = () => {
|
|
@@ -110,9 +116,10 @@ export default defineComponent({
|
|
|
110
116
|
scrollable.value = tabList.length >= 5;
|
|
111
117
|
};
|
|
112
118
|
|
|
113
|
-
var moveIndicator =
|
|
114
|
-
|
|
115
|
-
|
|
119
|
+
var moveIndicator = _ref3 => {
|
|
120
|
+
var {
|
|
121
|
+
element
|
|
122
|
+
} = _ref3;
|
|
116
123
|
var el = element.value;
|
|
117
124
|
|
|
118
125
|
if (props.layoutDirection === 'horizontal') {
|
|
@@ -124,9 +131,11 @@ export default defineComponent({
|
|
|
124
131
|
}
|
|
125
132
|
};
|
|
126
133
|
|
|
127
|
-
var scrollToCenter =
|
|
128
|
-
|
|
129
|
-
|
|
134
|
+
var scrollToCenter = _ref4 => {
|
|
135
|
+
var {
|
|
136
|
+
element
|
|
137
|
+
} = _ref4;
|
|
138
|
+
|
|
130
139
|
if (!scrollable.value) {
|
|
131
140
|
return;
|
|
132
141
|
}
|
|
@@ -39,15 +39,21 @@ export default defineComponent({
|
|
|
39
39
|
} = useTabItem();
|
|
40
40
|
|
|
41
41
|
var matchName = active => {
|
|
42
|
-
return tabItemList.find(
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
return tabItemList.find(_ref => {
|
|
43
|
+
var {
|
|
44
|
+
name
|
|
45
|
+
} = _ref;
|
|
46
|
+
return active === name.value;
|
|
47
|
+
});
|
|
45
48
|
};
|
|
46
49
|
|
|
47
50
|
var matchIndex = active => {
|
|
48
|
-
return tabItemList.find(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
return tabItemList.find(_ref2 => {
|
|
52
|
+
var {
|
|
53
|
+
index
|
|
54
|
+
} = _ref2;
|
|
55
|
+
return active === index.value;
|
|
56
|
+
});
|
|
51
57
|
};
|
|
52
58
|
|
|
53
59
|
var matchActive = active => {
|
|
@@ -63,9 +69,12 @@ export default defineComponent({
|
|
|
63
69
|
return;
|
|
64
70
|
}
|
|
65
71
|
|
|
66
|
-
tabItemList.forEach(
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
tabItemList.forEach(_ref3 => {
|
|
73
|
+
var {
|
|
74
|
+
setCurrent
|
|
75
|
+
} = _ref3;
|
|
76
|
+
return setCurrent(false);
|
|
77
|
+
});
|
|
69
78
|
newActiveTabItemProvider.setCurrent(true);
|
|
70
79
|
(_swipe$value = swipe.value) == null ? void 0 : _swipe$value.to(newActiveTabItemProvider.index.value);
|
|
71
80
|
};
|
|
@@ -73,9 +82,12 @@ export default defineComponent({
|
|
|
73
82
|
var handleSwipeChange = currentIndex => {
|
|
74
83
|
var _tabItem$name$value, _props$onUpdateActiv;
|
|
75
84
|
|
|
76
|
-
var tabItem = tabItemList.find(
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
var tabItem = tabItemList.find(_ref4 => {
|
|
86
|
+
var {
|
|
87
|
+
index
|
|
88
|
+
} = _ref4;
|
|
89
|
+
return index.value === currentIndex;
|
|
90
|
+
});
|
|
79
91
|
var active = (_tabItem$name$value = tabItem.name.value) != null ? _tabItem$name$value : tabItem.index.value;
|
|
80
92
|
(_props$onUpdateActiv = props['onUpdate:active']) == null ? void 0 : _props$onUpdateActiv.call(props, active);
|
|
81
93
|
};
|
|
@@ -67,9 +67,15 @@ export function render(_ctx, _cache) {
|
|
|
67
67
|
/* STYLE */
|
|
68
68
|
), _createElementVNode("div", _hoisted_5, [_createElementVNode("div", {
|
|
69
69
|
class: "var-time-picker-clock__container",
|
|
70
|
-
onTouchstart: _cache[5] || (_cache[5] = (
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
onTouchstart: _cache[5] || (_cache[5] = function () {
|
|
71
|
+
return _ctx.moveHand && _ctx.moveHand(...arguments);
|
|
72
|
+
}),
|
|
73
|
+
onTouchmove: _cache[6] || (_cache[6] = function () {
|
|
74
|
+
return _ctx.moveHand && _ctx.moveHand(...arguments);
|
|
75
|
+
}),
|
|
76
|
+
onTouchend: _cache[7] || (_cache[7] = function () {
|
|
77
|
+
return _ctx.end && _ctx.end(...arguments);
|
|
78
|
+
}),
|
|
73
79
|
ref: "container"
|
|
74
80
|
}, [_createVNode(_Transition, {
|
|
75
81
|
name: "var-time-picker-panel-fade"
|
package/es/time-picker/clock.js
CHANGED
|
@@ -95,9 +95,10 @@ export default defineComponent({
|
|
|
95
95
|
},
|
|
96
96
|
emits: ['update', 'change-prevent-update'],
|
|
97
97
|
|
|
98
|
-
setup(props, {
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
setup(props, _ref) {
|
|
99
|
+
var {
|
|
100
|
+
emit
|
|
101
|
+
} = _ref;
|
|
101
102
|
var inner = ref(null);
|
|
102
103
|
var disableHour = ref([]);
|
|
103
104
|
var disable24HourIndex = ref([]);
|
|
@@ -218,7 +219,9 @@ export default defineComponent({
|
|
|
218
219
|
return hours[activeItemIndex.value].padStart(2, '0');
|
|
219
220
|
};
|
|
220
221
|
|
|
221
|
-
watch([activeItemIndex, () => props.isInner], (
|
|
222
|
+
watch([activeItemIndex, () => props.isInner], (_ref2, _ref3) => {
|
|
223
|
+
var [index, inner] = _ref2;
|
|
224
|
+
var [oldIndex, oldInner] = _ref3;
|
|
222
225
|
var isSame = index === oldIndex && inner === oldInner;
|
|
223
226
|
if (isSame || props.type !== 'hour' || activeItemIndex.value === undefined) return;
|
|
224
227
|
var newHour = inner ? hours24[activeItemIndex.value] : getHour();
|
|
@@ -253,7 +256,8 @@ export default defineComponent({
|
|
|
253
256
|
|
|
254
257
|
emit('update', newTime);
|
|
255
258
|
});
|
|
256
|
-
watch([() => props.max, () => props.min, () => props.allowedTime],
|
|
259
|
+
watch([() => props.max, () => props.min, () => props.allowedTime], _ref4 => {
|
|
260
|
+
var [max, min, allowedTime] = _ref4;
|
|
257
261
|
disableHour.value = [];
|
|
258
262
|
|
|
259
263
|
if (max && !min) {
|
package/es/uploader/Uploader.js
CHANGED
|
@@ -88,7 +88,9 @@ export function render(_ctx, _cache) {
|
|
|
88
88
|
accept: _ctx.accept,
|
|
89
89
|
capture: _ctx.capture,
|
|
90
90
|
disabled: _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly,
|
|
91
|
-
onChange: _cache[0] || (_cache[0] = (
|
|
91
|
+
onChange: _cache[0] || (_cache[0] = function () {
|
|
92
|
+
return _ctx.handleChange && _ctx.handleChange(...arguments);
|
|
93
|
+
})
|
|
92
94
|
}, null, 40
|
|
93
95
|
/* PROPS, HYDRATE_EVENTS */
|
|
94
96
|
, _hoisted_7), _renderSlot(_ctx.$slots, "default", {}, () => [_createVNode(_component_var_icon, {
|
|
@@ -291,11 +293,17 @@ export default defineComponent({
|
|
|
291
293
|
|
|
292
294
|
var resolvedVarFiles = yield Promise.all(getResolvers(varFiles));
|
|
293
295
|
var validationVarFiles = yield Promise.all(getBeforeReaders(resolvedVarFiles));
|
|
294
|
-
var validVarFiles = validationVarFiles.filter(
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
var validVarFiles = validationVarFiles.filter(_ref2 => {
|
|
297
|
+
var {
|
|
298
|
+
valid
|
|
299
|
+
} = _ref2;
|
|
300
|
+
return valid;
|
|
301
|
+
}).map(_ref3 => {
|
|
302
|
+
var {
|
|
303
|
+
varFile
|
|
304
|
+
} = _ref3;
|
|
305
|
+
return varFile;
|
|
306
|
+
});
|
|
299
307
|
(_props$onUpdateModel = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel.call(props, [...modelValue, ...validVarFiles]);
|
|
300
308
|
event.target.value = '';
|
|
301
309
|
validVarFiles.forEach(varFile => onAfterRead == null ? void 0 : onAfterRead(reactive(varFile)));
|
|
@@ -307,7 +315,7 @@ export default defineComponent({
|
|
|
307
315
|
}();
|
|
308
316
|
|
|
309
317
|
var handleRemove = /*#__PURE__*/function () {
|
|
310
|
-
var
|
|
318
|
+
var _ref4 = _asyncToGenerator(function* (removedVarFile) {
|
|
311
319
|
var _props$onUpdateModel2;
|
|
312
320
|
|
|
313
321
|
var {
|
|
@@ -333,7 +341,7 @@ export default defineComponent({
|
|
|
333
341
|
});
|
|
334
342
|
|
|
335
343
|
return function handleRemove(_x2) {
|
|
336
|
-
return
|
|
344
|
+
return _ref4.apply(this, arguments);
|
|
337
345
|
};
|
|
338
346
|
}(); // expose
|
|
339
347
|
|
package/es/utils/components.js
CHANGED
|
@@ -30,7 +30,15 @@ export function mount(component) {
|
|
|
30
30
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
export function mountInstance(component, props
|
|
33
|
+
export function mountInstance(component, props, eventListener) {
|
|
34
|
+
if (props === void 0) {
|
|
35
|
+
props = {};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (eventListener === void 0) {
|
|
39
|
+
eventListener = {};
|
|
40
|
+
}
|
|
41
|
+
|
|
34
42
|
var Host = {
|
|
35
43
|
setup() {
|
|
36
44
|
return () => h(component, _extends({}, props, eventListener));
|
package/es/utils/elements.js
CHANGED
|
@@ -170,12 +170,13 @@ export function doubleRaf() {
|
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
export function scrollTo(element, {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
export function scrollTo(element, _ref) {
|
|
174
|
+
var {
|
|
175
|
+
top = 0,
|
|
176
|
+
left = 0,
|
|
177
|
+
duration = 300,
|
|
178
|
+
animation
|
|
179
|
+
} = _ref;
|
|
179
180
|
var startTime = Date.now();
|
|
180
181
|
var scrollTop = getScrollTop(element);
|
|
181
182
|
var scrollLeft = getScrollLeft(element);
|
|
@@ -198,7 +199,8 @@ export function scrollTo(element, {
|
|
|
198
199
|
});
|
|
199
200
|
}
|
|
200
201
|
export function formatStyleVars(styleVars) {
|
|
201
|
-
return Object.entries(styleVars != null ? styleVars : {}).reduce((styles,
|
|
202
|
+
return Object.entries(styleVars != null ? styleVars : {}).reduce((styles, _ref2) => {
|
|
203
|
+
var [key, value] = _ref2;
|
|
202
204
|
var cssVar = key.startsWith('--') ? key : "--" + kebabCase(key);
|
|
203
205
|
styles[cssVar] = value;
|
|
204
206
|
return styles;
|
package/es/utils/jest.js
CHANGED
|
@@ -35,7 +35,23 @@ export function mockDoubleRaf() {
|
|
|
35
35
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
export function trigger(wrapper, eventName, x
|
|
38
|
+
export function trigger(wrapper, eventName, x, y, offsetX, offsetY) {
|
|
39
|
+
if (x === void 0) {
|
|
40
|
+
x = 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (y === void 0) {
|
|
44
|
+
y = 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (offsetX === void 0) {
|
|
48
|
+
offsetX = 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (offsetY === void 0) {
|
|
52
|
+
offsetY = 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
39
55
|
var el = 'element' in wrapper ? wrapper.element : wrapper;
|
|
40
56
|
var touchList = [getTouch(el, x, y)];
|
|
41
57
|
var event = document.createEvent('CustomEvent');
|
|
@@ -52,14 +68,15 @@ export function trigger(wrapper, eventName, x = 0, y = 0, offsetX = 0, offsetY =
|
|
|
52
68
|
el.dispatchEvent(event);
|
|
53
69
|
return nextTick();
|
|
54
70
|
}
|
|
55
|
-
export function mockOffset({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
export function mockOffset(_temp) {
|
|
72
|
+
var {
|
|
73
|
+
offsetWidth,
|
|
74
|
+
offsetHeight,
|
|
75
|
+
clientWidth,
|
|
76
|
+
clientHeight,
|
|
77
|
+
offsetLeft,
|
|
78
|
+
offsetTop
|
|
79
|
+
} = _temp === void 0 ? {} : _temp;
|
|
63
80
|
Object.defineProperties(HTMLElement.prototype, {
|
|
64
81
|
offsetWidth: {
|
|
65
82
|
get() {
|
|
@@ -123,12 +140,20 @@ export function mockImageNaturalSize(naturalWidth, naturalHeight) {
|
|
|
123
140
|
}
|
|
124
141
|
});
|
|
125
142
|
}
|
|
126
|
-
export function triggerDrag(_x) {
|
|
143
|
+
export function triggerDrag(_x, _x2, _x3) {
|
|
127
144
|
return _triggerDrag.apply(this, arguments);
|
|
128
145
|
}
|
|
129
146
|
|
|
130
147
|
function _triggerDrag() {
|
|
131
|
-
_triggerDrag = _asyncToGenerator(function* (el, x
|
|
148
|
+
_triggerDrag = _asyncToGenerator(function* (el, x, y) {
|
|
149
|
+
if (x === void 0) {
|
|
150
|
+
x = 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (y === void 0) {
|
|
154
|
+
y = 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
132
157
|
yield trigger(el, 'touchstart', 0, 0);
|
|
133
158
|
yield trigger(el, 'touchmove', x / 4, y / 4);
|
|
134
159
|
yield trigger(el, 'touchmove', x / 3, y / 3);
|
|
@@ -198,7 +223,11 @@ export function mockStubs() {
|
|
|
198
223
|
|
|
199
224
|
};
|
|
200
225
|
}
|
|
201
|
-
export function mockConsole(method, fn
|
|
226
|
+
export function mockConsole(method, fn) {
|
|
227
|
+
if (fn === void 0) {
|
|
228
|
+
fn = () => {};
|
|
229
|
+
}
|
|
230
|
+
|
|
202
231
|
var originMethod = console[method];
|
|
203
232
|
console[method] = fn;
|
|
204
233
|
return {
|
package/es/utils/shared.js
CHANGED
|
@@ -46,10 +46,18 @@ export var removeItem = (arr, item) => {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
export var throttle = (method, mustRunDelay
|
|
49
|
+
export var throttle = function (method, mustRunDelay) {
|
|
50
|
+
if (mustRunDelay === void 0) {
|
|
51
|
+
mustRunDelay = 200;
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
var timer;
|
|
51
55
|
var start = 0;
|
|
52
|
-
return function loop(
|
|
56
|
+
return function loop() {
|
|
57
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
58
|
+
args[_key] = arguments[_key];
|
|
59
|
+
}
|
|
60
|
+
|
|
53
61
|
var now = Date.now();
|
|
54
62
|
var elapsed = now - start;
|
|
55
63
|
|
|
@@ -71,9 +79,17 @@ export var throttle = (method, mustRunDelay = 200) => {
|
|
|
71
79
|
}
|
|
72
80
|
};
|
|
73
81
|
};
|
|
74
|
-
export var debounce = (method, delay
|
|
82
|
+
export var debounce = function (method, delay) {
|
|
83
|
+
if (delay === void 0) {
|
|
84
|
+
delay = 200;
|
|
85
|
+
}
|
|
86
|
+
|
|
75
87
|
var timer;
|
|
76
|
-
return function (
|
|
88
|
+
return function () {
|
|
89
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
90
|
+
args[_key2] = arguments[_key2];
|
|
91
|
+
}
|
|
92
|
+
|
|
77
93
|
timer && window.clearTimeout(timer);
|
|
78
94
|
timer = window.setTimeout(() => {
|
|
79
95
|
method.apply(this, args);
|
package/lib/app-bar/AppBar.js
CHANGED
package/lib/back-top/BackTop.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.render = render;
|
|
5
4
|
exports.default = void 0;
|
|
5
|
+
exports.render = render;
|
|
6
6
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
|
|
@@ -25,7 +25,9 @@ function render(_ctx, _cache) {
|
|
|
25
25
|
|
|
26
26
|
return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
27
27
|
class: (0, _vue.normalizeClass)(["var-back-top", [_ctx.show ? 'var-back-top--active' : null]]),
|
|
28
|
-
onClick: _cache[0] || (_cache[0] = (0, _vue.withModifiers)(
|
|
28
|
+
onClick: _cache[0] || (_cache[0] = (0, _vue.withModifiers)(function () {
|
|
29
|
+
return _ctx.click && _ctx.click(...arguments);
|
|
30
|
+
}, ["stop"]))
|
|
29
31
|
}, [(0, _vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, _vue.createVNode)(_component_var_button, {
|
|
30
32
|
type: "primary",
|
|
31
33
|
round: "",
|
package/lib/badge/Badge.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.render = render;
|
|
5
4
|
exports.default = void 0;
|
|
5
|
+
exports.render = render;
|
|
6
6
|
|
|
7
7
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
8
8
|
|
|
@@ -60,9 +60,10 @@ var _default = (0, _vue.defineComponent)({
|
|
|
60
60
|
inheritAttrs: false,
|
|
61
61
|
props: _props.props,
|
|
62
62
|
|
|
63
|
-
setup(props, {
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
setup(props, _ref) {
|
|
64
|
+
var {
|
|
65
|
+
slots
|
|
66
|
+
} = _ref;
|
|
66
67
|
var contentClass = (0, _vue.computed)(() => {
|
|
67
68
|
var {
|
|
68
69
|
type,
|