@varlet/ui 1.24.0 → 1.24.2-alpha.1640872324277
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/CHANGELOG.md +11 -0
- 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/snackbar/style/index.js +1 -1
- package/es/snackbar/style/less.js +1 -1
- 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/styles/elevation.css +1 -1
- package/es/styles/elevation.less +2 -0
- 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/highlight/web-types.json +1 -1
- 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/styles/elevation.css +1 -1
- package/lib/styles/elevation.less +2 -0
- 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/image/Image.js
CHANGED
|
@@ -30,9 +30,15 @@ export function render(_ctx, _cache) {
|
|
|
30
30
|
style: _normalizeStyle({
|
|
31
31
|
objectFit: _ctx.fit
|
|
32
32
|
}),
|
|
33
|
-
onLoad: _cache[0] || (_cache[0] = (
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
onLoad: _cache[0] || (_cache[0] = function () {
|
|
34
|
+
return _ctx.handleLoad && _ctx.handleLoad(...arguments);
|
|
35
|
+
}),
|
|
36
|
+
onError: _cache[1] || (_cache[1] = function () {
|
|
37
|
+
return _ctx.handleError && _ctx.handleError(...arguments);
|
|
38
|
+
}),
|
|
39
|
+
onClick: _cache[2] || (_cache[2] = function () {
|
|
40
|
+
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
41
|
+
})
|
|
36
42
|
}, null, 44
|
|
37
43
|
/* STYLE, PROPS, HYDRATE_EVENTS */
|
|
38
44
|
, _hoisted_1)), [[_directive_lazy, _ctx.src]]) : (_openBlock(), _createElementBlock("img", {
|
|
@@ -43,9 +49,15 @@ export function render(_ctx, _cache) {
|
|
|
43
49
|
objectFit: _ctx.fit
|
|
44
50
|
}),
|
|
45
51
|
src: _ctx.src,
|
|
46
|
-
onLoad: _cache[3] || (_cache[3] = (
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
onLoad: _cache[3] || (_cache[3] = function () {
|
|
53
|
+
return _ctx.handleLoad && _ctx.handleLoad(...arguments);
|
|
54
|
+
}),
|
|
55
|
+
onError: _cache[4] || (_cache[4] = function () {
|
|
56
|
+
return _ctx.handleError && _ctx.handleError(...arguments);
|
|
57
|
+
}),
|
|
58
|
+
onClick: _cache[5] || (_cache[5] = function () {
|
|
59
|
+
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
60
|
+
})
|
|
49
61
|
}, null, 44
|
|
50
62
|
/* STYLE, PROPS, HYDRATE_EVENTS */
|
|
51
63
|
, _hoisted_2))], 6
|
|
@@ -63,9 +63,15 @@ export function render(_ctx, _cache) {
|
|
|
63
63
|
transitionTimingFunction: _ctx.transitionTimingFunction,
|
|
64
64
|
transitionDuration: _ctx.transitionDuration
|
|
65
65
|
}),
|
|
66
|
-
onTouchstart: _cache[0] || (_cache[0] = (
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
onTouchstart: _cache[0] || (_cache[0] = function () {
|
|
67
|
+
return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
|
|
68
|
+
}),
|
|
69
|
+
onTouchmove: _cache[1] || (_cache[1] = function () {
|
|
70
|
+
return _ctx.handleTouchmove && _ctx.handleTouchmove(...arguments);
|
|
71
|
+
}),
|
|
72
|
+
onTouchend: _cache[2] || (_cache[2] = function () {
|
|
73
|
+
return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
|
|
74
|
+
})
|
|
69
75
|
}, [_createElementVNode("img", {
|
|
70
76
|
class: "var-image-preview__image",
|
|
71
77
|
src: image,
|
|
@@ -84,15 +90,18 @@ export function render(_ctx, _cache) {
|
|
|
84
90
|
}), 128
|
|
85
91
|
/* KEYED_FRAGMENT */
|
|
86
92
|
))]),
|
|
87
|
-
indicator: _withCtx(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
indicator: _withCtx(_ref => {
|
|
94
|
+
var {
|
|
95
|
+
index,
|
|
96
|
+
length
|
|
97
|
+
} = _ref;
|
|
98
|
+
return [_renderSlot(_ctx.$slots, "indicator", {
|
|
99
|
+
index: index,
|
|
100
|
+
length: length
|
|
101
|
+
}, () => [_ctx.indicator && _ctx.images.length > 1 ? (_openBlock(), _createElementBlock("div", _hoisted_2, _toDisplayString(index + 1) + " / " + _toDisplayString(length), 1
|
|
102
|
+
/* TEXT */
|
|
103
|
+
)) : _createCommentVNode("v-if", true)])];
|
|
104
|
+
}),
|
|
96
105
|
_: 3
|
|
97
106
|
/* FORWARDED */
|
|
98
107
|
|
package/es/index-bar/IndexBar.js
CHANGED
|
@@ -109,9 +109,12 @@ export default defineComponent({
|
|
|
109
109
|
var _ref = _asyncToGenerator(function* (anchorName, manualCall) {
|
|
110
110
|
if (manualCall) props.onClick == null ? void 0 : props.onClick(anchorName);
|
|
111
111
|
if (anchorName === active.value) return;
|
|
112
|
-
var indexAnchor = indexAnchors.find(
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
var indexAnchor = indexAnchors.find(_ref2 => {
|
|
113
|
+
var {
|
|
114
|
+
name
|
|
115
|
+
} = _ref2;
|
|
116
|
+
return anchorName === name.value;
|
|
117
|
+
});
|
|
115
118
|
if (!indexAnchor) return;
|
|
116
119
|
var top = indexAnchor.ownTop.value;
|
|
117
120
|
var left = getScrollLeft(scrollEl.value);
|
|
@@ -139,10 +142,11 @@ export default defineComponent({
|
|
|
139
142
|
};
|
|
140
143
|
|
|
141
144
|
watch(() => length.value, () => nextTick(() => {
|
|
142
|
-
indexAnchors.forEach(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
indexAnchors.forEach(_ref3 => {
|
|
146
|
+
var {
|
|
147
|
+
name,
|
|
148
|
+
setOwnTop
|
|
149
|
+
} = _ref3;
|
|
146
150
|
if (name.value) anchorNameList.value.push(name.value);
|
|
147
151
|
setOwnTop();
|
|
148
152
|
});
|
package/es/input/Input.js
CHANGED
|
@@ -23,7 +23,9 @@ export function render(_ctx, _cache) {
|
|
|
23
23
|
|
|
24
24
|
return _openBlock(), _createElementBlock("div", {
|
|
25
25
|
class: _normalizeClass(["var-input var--box", [_ctx.disabled ? 'var-input--disabled' : null]]),
|
|
26
|
-
onClick: _cache[8] || (_cache[8] = (
|
|
26
|
+
onClick: _cache[8] || (_cache[8] = function () {
|
|
27
|
+
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
28
|
+
})
|
|
27
29
|
}, [_createElementVNode("div", {
|
|
28
30
|
class: _normalizeClass(["var-input__controller", [_ctx.isFocus ? 'var-input--focus' : null, _ctx.errorMessage ? 'var-input--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-input--disabled' : null]]),
|
|
29
31
|
style: _normalizeStyle({
|
|
@@ -51,10 +53,18 @@ export function render(_ctx, _cache) {
|
|
|
51
53
|
caretColor: !_ctx.errorMessage ? _ctx.focusColor : null,
|
|
52
54
|
resize: _ctx.resize ? 'vertical' : 'none'
|
|
53
55
|
}),
|
|
54
|
-
onFocus: _cache[0] || (_cache[0] = (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
onFocus: _cache[0] || (_cache[0] = function () {
|
|
57
|
+
return _ctx.handleFocus && _ctx.handleFocus(...arguments);
|
|
58
|
+
}),
|
|
59
|
+
onBlur: _cache[1] || (_cache[1] = function () {
|
|
60
|
+
return _ctx.handleBlur && _ctx.handleBlur(...arguments);
|
|
61
|
+
}),
|
|
62
|
+
onInput: _cache[2] || (_cache[2] = function () {
|
|
63
|
+
return _ctx.handleInput && _ctx.handleInput(...arguments);
|
|
64
|
+
}),
|
|
65
|
+
onChange: _cache[3] || (_cache[3] = function () {
|
|
66
|
+
return _ctx.handleChange && _ctx.handleChange(...arguments);
|
|
67
|
+
})
|
|
58
68
|
}, "\n ", 46
|
|
59
69
|
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
60
70
|
, _hoisted_2)) : (_openBlock(), _createElementBlock("input", {
|
|
@@ -71,10 +81,18 @@ export function render(_ctx, _cache) {
|
|
|
71
81
|
color: _ctx.textColor,
|
|
72
82
|
caretColor: !_ctx.errorMessage ? _ctx.focusColor : null
|
|
73
83
|
}),
|
|
74
|
-
onFocus: _cache[4] || (_cache[4] = (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
onFocus: _cache[4] || (_cache[4] = function () {
|
|
85
|
+
return _ctx.handleFocus && _ctx.handleFocus(...arguments);
|
|
86
|
+
}),
|
|
87
|
+
onBlur: _cache[5] || (_cache[5] = function () {
|
|
88
|
+
return _ctx.handleBlur && _ctx.handleBlur(...arguments);
|
|
89
|
+
}),
|
|
90
|
+
onInput: _cache[6] || (_cache[6] = function () {
|
|
91
|
+
return _ctx.handleInput && _ctx.handleInput(...arguments);
|
|
92
|
+
}),
|
|
93
|
+
onChange: _cache[7] || (_cache[7] = function () {
|
|
94
|
+
return _ctx.handleChange && _ctx.handleChange(...arguments);
|
|
95
|
+
})
|
|
78
96
|
}, null, 46
|
|
79
97
|
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
80
98
|
, _hoisted_3)), _createElementVNode("label", {
|
package/es/lazy/index.js
CHANGED
|
@@ -202,7 +202,11 @@ function _updated() {
|
|
|
202
202
|
return _updated.apply(this, arguments);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
function mergeLazyOptions(lazyOptions
|
|
205
|
+
function mergeLazyOptions(lazyOptions) {
|
|
206
|
+
if (lazyOptions === void 0) {
|
|
207
|
+
lazyOptions = {};
|
|
208
|
+
}
|
|
209
|
+
|
|
206
210
|
var {
|
|
207
211
|
events,
|
|
208
212
|
loading,
|
package/es/list/List.js
CHANGED
|
@@ -50,7 +50,9 @@ export function render(_ctx, _cache) {
|
|
|
50
50
|
key: 2
|
|
51
51
|
}, () => [_withDirectives(_createElementVNode("div", {
|
|
52
52
|
class: "var-list__error",
|
|
53
|
-
onClick: _cache[0] || (_cache[0] = (
|
|
53
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
54
|
+
return _ctx.load && _ctx.load(...arguments);
|
|
55
|
+
})
|
|
54
56
|
}, [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.errorText, _ctx.pack.listErrorText)), 1
|
|
55
57
|
/* TEXT */
|
|
56
58
|
)], 512
|
package/es/loading/Loading.js
CHANGED
package/es/menu/Menu.js
CHANGED
|
@@ -1,55 +1,30 @@
|
|
|
1
|
+
import { isVNode as _isVNode, withDirectives as _withDirectives, createVNode as _createVNode, vShow as _vShow } from "vue";
|
|
2
|
+
|
|
1
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
4
|
|
|
3
5
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
6
|
|
|
5
|
-
import { defineComponent, ref, watch, onMounted, onUnmounted } from 'vue';
|
|
7
|
+
import { defineComponent, ref, watch, onMounted, onUnmounted, Transition, Teleport, nextTick } from 'vue';
|
|
6
8
|
import { props } from './props';
|
|
7
9
|
import { getLeft, getTop, toSizeUnit } from '../utils/elements';
|
|
8
10
|
import { useZIndex } from '../context/zIndex';
|
|
9
|
-
import { useTeleport } from '../utils/components';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}, [_renderSlot(_ctx.$slots, "default"), (_openBlock(), _createBlock(_Teleport, {
|
|
17
|
-
to: _ctx.teleport,
|
|
18
|
-
disabled: !_ctx.teleport || _ctx.disabled
|
|
19
|
-
}, [_createVNode(_Transition, {
|
|
20
|
-
name: "var-menu",
|
|
21
|
-
onAfterEnter: _ctx.onOpened,
|
|
22
|
-
onAfterLeave: _ctx.onClosed
|
|
23
|
-
}, {
|
|
24
|
-
default: _withCtx(() => [_withDirectives(_createElementVNode("div", {
|
|
25
|
-
class: "var-menu__menu var-elevation--3",
|
|
26
|
-
ref: "menu",
|
|
27
|
-
style: _normalizeStyle({
|
|
28
|
-
top: "calc(" + _ctx.top + "px + " + _ctx.toSizeUnit(_ctx.offsetY) + ")",
|
|
29
|
-
left: "calc(" + _ctx.left + "px + " + _ctx.toSizeUnit(_ctx.offsetX) + ")",
|
|
30
|
-
zIndex: _ctx.zIndex
|
|
31
|
-
}),
|
|
32
|
-
onClick: _cache[0] || (_cache[0] = _withModifiers(() => {}, ["stop"]))
|
|
33
|
-
}, [_renderSlot(_ctx.$slots, "menu")], 4
|
|
34
|
-
/* STYLE */
|
|
35
|
-
), [[_vShow, _ctx.show]])]),
|
|
36
|
-
_: 3
|
|
37
|
-
/* FORWARDED */
|
|
38
|
-
|
|
39
|
-
}, 8
|
|
40
|
-
/* PROPS */
|
|
41
|
-
, ["onAfterEnter", "onAfterLeave"])], 8
|
|
42
|
-
/* PROPS */
|
|
43
|
-
, ["to", "disabled"]))], 512
|
|
44
|
-
/* NEED_PATCH */
|
|
45
|
-
);
|
|
11
|
+
import { exposeApis, useTeleport } from '../utils/components';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
function _isSlot(s) {
|
|
17
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
|
|
46
18
|
}
|
|
19
|
+
|
|
47
20
|
export default defineComponent({
|
|
48
|
-
render,
|
|
49
21
|
name: 'VarMenu',
|
|
50
22
|
props,
|
|
51
23
|
|
|
52
|
-
setup(props) {
|
|
24
|
+
setup(props, _ref) {
|
|
25
|
+
var {
|
|
26
|
+
slots
|
|
27
|
+
} = _ref;
|
|
53
28
|
var host = ref(null);
|
|
54
29
|
var menu = ref(null);
|
|
55
30
|
var top = ref(0);
|
|
@@ -73,6 +48,8 @@ export default defineComponent({
|
|
|
73
48
|
var handleMenuClose = () => {
|
|
74
49
|
var _props$onUpdateShow;
|
|
75
50
|
|
|
51
|
+
console.log(123);
|
|
52
|
+
|
|
76
53
|
if (clickSelf) {
|
|
77
54
|
clickSelf = false;
|
|
78
55
|
return;
|
|
@@ -91,19 +68,43 @@ export default defineComponent({
|
|
|
91
68
|
left.value = getLeft(host.value);
|
|
92
69
|
};
|
|
93
70
|
|
|
71
|
+
var renderTransition = () => _createVNode(Transition, {
|
|
72
|
+
"name": "var-menu",
|
|
73
|
+
"onAfterEnter": props.onOpen,
|
|
74
|
+
"onAfterLeave": props.onClosed
|
|
75
|
+
}, {
|
|
76
|
+
default: () => [_withDirectives(_createVNode("div", {
|
|
77
|
+
"class": "var-menu__menu var-elevation--3",
|
|
78
|
+
"ref": menu,
|
|
79
|
+
"style": {
|
|
80
|
+
top: "calc(" + top.value + "px + " + toSizeUnit(props.offsetY) + ")",
|
|
81
|
+
left: "calc(" + left.value + "px + " + toSizeUnit(props.offsetX) + ")",
|
|
82
|
+
zIndex: zIndex.value
|
|
83
|
+
},
|
|
84
|
+
"onClick": event => {
|
|
85
|
+
event.stopPropagation();
|
|
86
|
+
}
|
|
87
|
+
}, [slots.menu == null ? void 0 : slots.menu()]), [[_vShow, props.show]])]
|
|
88
|
+
});
|
|
89
|
+
|
|
94
90
|
watch(() => props.alignment, resize);
|
|
95
91
|
watch(() => props.show, /*#__PURE__*/function () {
|
|
96
|
-
var
|
|
92
|
+
var _ref2 = _asyncToGenerator(function* (newValue) {
|
|
97
93
|
var {
|
|
98
94
|
onOpen,
|
|
99
95
|
onClose
|
|
100
96
|
} = props;
|
|
101
|
-
|
|
97
|
+
|
|
98
|
+
if (newValue) {
|
|
99
|
+
yield nextTick();
|
|
100
|
+
resize();
|
|
101
|
+
}
|
|
102
|
+
|
|
102
103
|
newValue ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
103
104
|
});
|
|
104
105
|
|
|
105
106
|
return function (_x) {
|
|
106
|
-
return
|
|
107
|
+
return _ref2.apply(this, arguments);
|
|
107
108
|
};
|
|
108
109
|
}());
|
|
109
110
|
onMounted(() => {
|
|
@@ -115,16 +116,22 @@ export default defineComponent({
|
|
|
115
116
|
document.removeEventListener('click', handleMenuClose);
|
|
116
117
|
window.removeEventListener('resize', resize);
|
|
117
118
|
});
|
|
118
|
-
|
|
119
|
-
disabled,
|
|
120
|
-
zIndex,
|
|
121
|
-
host,
|
|
122
|
-
menu,
|
|
123
|
-
top,
|
|
124
|
-
left,
|
|
125
|
-
toSizeUnit,
|
|
126
|
-
handleClick,
|
|
119
|
+
exposeApis({
|
|
127
120
|
resize
|
|
121
|
+
});
|
|
122
|
+
return () => {
|
|
123
|
+
var _slot;
|
|
124
|
+
|
|
125
|
+
return _createVNode("div", {
|
|
126
|
+
"class": "var-menu",
|
|
127
|
+
"ref": host,
|
|
128
|
+
"onClick": handleClick
|
|
129
|
+
}, [slots.default == null ? void 0 : slots.default(), props.teleport ? _createVNode(Teleport, {
|
|
130
|
+
"to": props.teleport,
|
|
131
|
+
"disabled": disabled.value
|
|
132
|
+
}, _isSlot(_slot = renderTransition()) ? _slot : {
|
|
133
|
+
default: () => [_slot]
|
|
134
|
+
}) : renderTransition()]);
|
|
128
135
|
};
|
|
129
136
|
}
|
|
130
137
|
|
package/es/menu/index.js
CHANGED
package/es/menu/style/index.js
CHANGED
package/es/menu/style/less.js
CHANGED
package/es/option/Option.js
CHANGED
|
@@ -21,7 +21,9 @@ export function render(_ctx, _cache) {
|
|
|
21
21
|
width: _ctx.wrapWidth,
|
|
22
22
|
color: _ctx.optionSelected ? _ctx.focusColor : undefined
|
|
23
23
|
}),
|
|
24
|
-
onClick: _cache[2] || (_cache[2] = (
|
|
24
|
+
onClick: _cache[2] || (_cache[2] = function () {
|
|
25
|
+
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
26
|
+
})
|
|
25
27
|
}, [_createElementVNode("div", {
|
|
26
28
|
class: _normalizeClass(["var-option__cover", [_ctx.optionSelected ? 'var-option--selected-background' : null]]),
|
|
27
29
|
style: _normalizeStyle({
|
|
@@ -131,7 +131,9 @@ export function render(_ctx, _cache) {
|
|
|
131
131
|
style: {
|
|
132
132
|
"display": "flex"
|
|
133
133
|
},
|
|
134
|
-
onClick: _cache[5] || (_cache[5] = (
|
|
134
|
+
onClick: _cache[5] || (_cache[5] = function () {
|
|
135
|
+
return _ctx.showMenu && _ctx.showMenu(...arguments);
|
|
136
|
+
})
|
|
135
137
|
}, [_createElementVNode("span", null, _toDisplayString(_ctx.size) + _toDisplayString(_ctx.pack.paginationItem) + " / " + _toDisplayString(_ctx.pack.paginationPage), 1
|
|
136
138
|
/* TEXT */
|
|
137
139
|
), _createVNode(_component_var_icon, {
|
|
@@ -258,11 +260,15 @@ export default defineComponent({
|
|
|
258
260
|
if (type === 'simple' && !isValidatePage(value)) simpleValue.value = "" + current.value;
|
|
259
261
|
};
|
|
260
262
|
|
|
261
|
-
watch([() => props.current, () => props.size],
|
|
263
|
+
watch([() => props.current, () => props.size], _ref => {
|
|
264
|
+
var [newCurrent, newSize] = _ref;
|
|
262
265
|
current.value = toNumber(newCurrent) || 1;
|
|
263
266
|
size.value = toNumber(newSize || 10);
|
|
264
267
|
});
|
|
265
|
-
watch([current, pageCount], (
|
|
268
|
+
watch([current, pageCount], (_ref2, _ref3) => {
|
|
269
|
+
var [newCurrent, newCount] = _ref2;
|
|
270
|
+
var [oldCurrent, oldCount] = _ref3;
|
|
271
|
+
|
|
266
272
|
if (newCurrent > newCount) {
|
|
267
273
|
current.value = newCount;
|
|
268
274
|
return;
|
package/es/picker/Picker.js
CHANGED
|
@@ -209,7 +209,11 @@ export default defineComponent({
|
|
|
209
209
|
};
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
-
var scrollTo = (scrollColumn, index, duration, noEmit
|
|
212
|
+
var scrollTo = function (scrollColumn, index, duration, noEmit) {
|
|
213
|
+
if (noEmit === void 0) {
|
|
214
|
+
noEmit = false;
|
|
215
|
+
}
|
|
216
|
+
|
|
213
217
|
var translate = center.value - boundaryIndex(scrollColumn, index) * optionHeight.value;
|
|
214
218
|
|
|
215
219
|
if (translate === scrollColumn.translate) {
|
package/es/popup/Popup.js
CHANGED
|
@@ -13,10 +13,18 @@ export function render(_ctx, _cache) {
|
|
|
13
13
|
return _openBlock(), _createElementBlock("div", {
|
|
14
14
|
ref: "freshNode",
|
|
15
15
|
class: "var-pull-refresh",
|
|
16
|
-
onTouchstart: _cache[0] || (_cache[0] = (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
onTouchstart: _cache[0] || (_cache[0] = function () {
|
|
17
|
+
return _ctx.touchStart && _ctx.touchStart(...arguments);
|
|
18
|
+
}),
|
|
19
|
+
onTouchmove: _cache[1] || (_cache[1] = function () {
|
|
20
|
+
return _ctx.touchMove && _ctx.touchMove(...arguments);
|
|
21
|
+
}),
|
|
22
|
+
onTouchend: _cache[2] || (_cache[2] = function () {
|
|
23
|
+
return _ctx.touchEnd && _ctx.touchEnd(...arguments);
|
|
24
|
+
}),
|
|
25
|
+
onTouchcancel: _cache[3] || (_cache[3] = function () {
|
|
26
|
+
return _ctx.touchEnd && _ctx.touchEnd(...arguments);
|
|
27
|
+
})
|
|
20
28
|
}, [_createElementVNode("div", {
|
|
21
29
|
class: _normalizeClass(["var-pull-refresh__control var-elevation--2", [_ctx.isSuccess ? 'var-pull-refresh__control-success' : null]]),
|
|
22
30
|
style: _normalizeStyle(_ctx.controlStyle)
|
package/es/radio/Radio.js
CHANGED
|
@@ -22,7 +22,9 @@ export function render(_ctx, _cache) {
|
|
|
22
22
|
|
|
23
23
|
return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _mergeProps({
|
|
24
24
|
class: "var-radio",
|
|
25
|
-
onClick: _cache[0] || (_cache[0] = (
|
|
25
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
26
|
+
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
27
|
+
})
|
|
26
28
|
}, _ctx.$attrs), [_withDirectives(_createElementVNode("div", {
|
|
27
29
|
class: _normalizeClass(["var-radio__action", [_ctx.checked ? 'var-radio--checked' : 'var-radio--unchecked', _ctx.errorMessage || _ctx.radioGroupErrorMessage ? 'var-radio--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-radio--disabled' : null]]),
|
|
28
30
|
style: _normalizeStyle({
|
|
@@ -61,9 +61,12 @@ export default defineComponent({
|
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
var syncRadios = () => radios.forEach(
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
var syncRadios = () => radios.forEach(_ref => {
|
|
65
|
+
var {
|
|
66
|
+
sync
|
|
67
|
+
} = _ref;
|
|
68
|
+
return sync(props.modelValue);
|
|
69
|
+
});
|
|
67
70
|
|
|
68
71
|
var onToggle = changedValue => {
|
|
69
72
|
var _props$onUpdateModel;
|
package/es/row/Row.js
CHANGED
|
@@ -10,7 +10,9 @@ export function render(_ctx, _cache) {
|
|
|
10
10
|
justifyContent: _ctx.justify,
|
|
11
11
|
alignItems: _ctx.align
|
|
12
12
|
}),
|
|
13
|
-
onClick: _cache[0] || (_cache[0] = (
|
|
13
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
14
|
+
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
15
|
+
})
|
|
14
16
|
}, [_renderSlot(_ctx.$slots, "default")], 4
|
|
15
17
|
/* STYLE */
|
|
16
18
|
);
|
package/es/select/Select.js
CHANGED
|
@@ -41,7 +41,9 @@ export function render(_ctx, _cache) {
|
|
|
41
41
|
|
|
42
42
|
return _openBlock(), _createElementBlock("div", {
|
|
43
43
|
class: _normalizeClass(["var-select var--box", [_ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null]]),
|
|
44
|
-
onClick: _cache[3] || (_cache[3] = (
|
|
44
|
+
onClick: _cache[3] || (_cache[3] = function () {
|
|
45
|
+
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
46
|
+
})
|
|
45
47
|
}, [_createElementVNode("div", {
|
|
46
48
|
class: _normalizeClass(["var-select__controller", [_ctx.isFocus ? 'var-select--focus' : null, _ctx.errorMessage ? 'var-select--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null]]),
|
|
47
49
|
style: _normalizeStyle({
|
|
@@ -63,7 +65,9 @@ export function render(_ctx, _cache) {
|
|
|
63
65
|
default: _withCtx(() => [_createElementVNode("div", {
|
|
64
66
|
class: _normalizeClass(["var-select__wrap", [!_ctx.hint ? 'var-select--non-hint' : null]]),
|
|
65
67
|
ref: "wrapEl",
|
|
66
|
-
onClick: _cache[1] || (_cache[1] = (
|
|
68
|
+
onClick: _cache[1] || (_cache[1] = function () {
|
|
69
|
+
return _ctx.handleFocus && _ctx.handleFocus(...arguments);
|
|
70
|
+
})
|
|
67
71
|
}, [_createElementVNode("div", {
|
|
68
72
|
class: _normalizeClass(["var-select__select", [_ctx.errorMessage ? 'var-select--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null]]),
|
|
69
73
|
style: _normalizeStyle({
|
|
@@ -227,10 +231,12 @@ export default defineComponent({
|
|
|
227
231
|
});
|
|
228
232
|
};
|
|
229
233
|
|
|
230
|
-
var findValueOrLabel =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
+
var findValueOrLabel = _ref => {
|
|
235
|
+
var {
|
|
236
|
+
value,
|
|
237
|
+
label
|
|
238
|
+
} = _ref;
|
|
239
|
+
|
|
234
240
|
if (value.value != null) {
|
|
235
241
|
return value.value;
|
|
236
242
|
}
|
|
@@ -239,14 +245,20 @@ export default defineComponent({
|
|
|
239
245
|
};
|
|
240
246
|
|
|
241
247
|
var findLabel = modelValue => {
|
|
242
|
-
var option = options.find(
|
|
243
|
-
|
|
244
|
-
|
|
248
|
+
var option = options.find(_ref2 => {
|
|
249
|
+
var {
|
|
250
|
+
value
|
|
251
|
+
} = _ref2;
|
|
252
|
+
return value.value === modelValue;
|
|
253
|
+
});
|
|
245
254
|
|
|
246
255
|
if (!option) {
|
|
247
|
-
option = options.find(
|
|
248
|
-
|
|
249
|
-
|
|
256
|
+
option = options.find(_ref3 => {
|
|
257
|
+
var {
|
|
258
|
+
label
|
|
259
|
+
} = _ref3;
|
|
260
|
+
return label.value === modelValue;
|
|
261
|
+
});
|
|
250
262
|
}
|
|
251
263
|
|
|
252
264
|
return option.label.value;
|
|
@@ -312,9 +324,12 @@ export default defineComponent({
|
|
|
312
324
|
return;
|
|
313
325
|
}
|
|
314
326
|
|
|
315
|
-
var selectedValue = multiple ? options.filter(
|
|
316
|
-
|
|
317
|
-
|
|
327
|
+
var selectedValue = multiple ? options.filter(_ref4 => {
|
|
328
|
+
var {
|
|
329
|
+
selected
|
|
330
|
+
} = _ref4;
|
|
331
|
+
return selected.value;
|
|
332
|
+
}).map(findValueOrLabel) : findValueOrLabel(option);
|
|
318
333
|
(_props$onUpdateModel = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel.call(props, selectedValue);
|
|
319
334
|
onChange == null ? void 0 : onChange(selectedValue);
|
|
320
335
|
validateWithTrigger('onChange');
|
|
@@ -371,9 +386,12 @@ export default defineComponent({
|
|
|
371
386
|
}
|
|
372
387
|
|
|
373
388
|
var rawModelValue = modelValue;
|
|
374
|
-
var option = options.find(
|
|
375
|
-
|
|
376
|
-
|
|
389
|
+
var option = options.find(_ref5 => {
|
|
390
|
+
var {
|
|
391
|
+
label
|
|
392
|
+
} = _ref5;
|
|
393
|
+
return label.value === text;
|
|
394
|
+
});
|
|
377
395
|
var currentModelValue = rawModelValue.filter(value => {
|
|
378
396
|
var _value$value;
|
|
379
397
|
|