@varlet/ui 1.26.9 → 1.27.0-alpha.1649242923701
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.js +29 -27
- package/es/app-bar/AppBar.js +32 -27
- package/es/back-top/BackTop.js +9 -2
- package/es/badge/Badge.js +22 -14
- package/es/bottom-navigation/BottomNavigation.js +167 -0
- package/es/bottom-navigation/BottomNavigationSfc.css +0 -0
- package/es/bottom-navigation/BottomNavigationSfc.less +0 -0
- package/es/bottom-navigation/bottomNavigation.css +1 -0
- package/es/bottom-navigation/bottomNavigation.less +49 -0
- package/es/bottom-navigation/index.js +8 -0
- package/es/bottom-navigation/props.js +40 -0
- package/es/bottom-navigation/provide.js +17 -0
- package/es/bottom-navigation/style/index.js +4 -0
- package/es/bottom-navigation/style/less.js +4 -0
- package/es/bottom-navigation-item/BottomNavigationItem.js +122 -0
- package/es/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
- package/es/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
- package/es/bottom-navigation-item/bottomNavigationItem.css +1 -0
- package/es/bottom-navigation-item/bottomNavigationItem.less +78 -0
- package/es/bottom-navigation-item/index.js +8 -0
- package/es/bottom-navigation-item/props.js +22 -0
- package/es/bottom-navigation-item/provide.js +21 -0
- package/es/bottom-navigation-item/style/index.js +6 -0
- package/es/bottom-navigation-item/style/less.js +6 -0
- package/es/button/Button.js +12 -5
- package/es/card/Card.js +33 -28
- package/es/cell/Cell.js +26 -15
- package/es/checkbox/Checkbox.js +28 -26
- package/es/checkbox-group/CheckboxGroup.js +21 -25
- package/es/chip/Chip.js +16 -7
- package/es/chip/chip.css +1 -1
- package/es/chip/chip.less +11 -11
- package/es/col/Col.js +12 -5
- package/es/collapse/Collapse.js +15 -12
- package/es/collapse-item/CollapseItem.js +31 -30
- package/es/collapse-item/collapseItem.css +1 -1
- package/es/collapse-item/collapseItem.less +16 -16
- package/es/countdown/Countdown.js +14 -11
- package/es/counter/Counter.js +30 -27
- package/es/date-picker/DatePicker.js +28 -23
- package/es/date-picker/date-picker.css +1 -1
- package/es/date-picker/date-picker.less +22 -20
- package/es/date-picker/src/day-picker-panel.js +41 -34
- package/es/date-picker/src/month-picker-panel.js +27 -21
- package/es/date-picker/src/panel-header.js +16 -11
- package/es/date-picker/src/year-picker-panel.js +17 -9
- package/es/dialog/Dialog.js +36 -40
- package/es/divider/Divider.js +16 -12
- package/es/form/Form.js +11 -8
- package/es/form-details/FormDetails.js +27 -22
- package/es/icon/Icon.js +8 -1
- package/es/image/Image.js +19 -12
- package/es/image-preview/ImagePreview.js +35 -34
- package/es/index-anchor/IndexAnchor.js +8 -1
- package/es/index-bar/IndexBar.js +22 -20
- package/es/index.js +10 -0
- package/es/input/Input.js +45 -44
- package/es/lazy/index.js +2 -1
- package/es/less.js +2 -0
- package/es/list/List.js +39 -38
- package/es/loading/Loading.js +31 -23
- package/es/loading/loading.css +1 -1
- package/es/loading/loading.less +32 -32
- package/es/menu/Menu.js +12 -10
- package/es/option/Option.js +16 -11
- package/es/pagination/Pagination.js +34 -44
- package/es/pagination/pagination.css +1 -1
- package/es/pagination/pagination.less +8 -8
- package/es/picker/Picker.js +51 -47
- package/es/popup/Popup.js +9 -5
- package/es/progress/Progress.js +44 -35
- package/es/progress/progress.css +1 -1
- package/es/progress/progress.less +12 -12
- package/es/pull-refresh/PullRefresh.js +13 -10
- package/es/radio/Radio.js +25 -25
- package/es/radio-group/RadioGroup.js +19 -19
- package/es/rate/Rate.js +27 -25
- package/es/ripple/index.js +6 -2
- package/es/row/Row.js +11 -4
- package/es/select/Select.js +53 -54
- package/es/skeleton/Skeleton.js +70 -81
- package/es/slider/Slider.js +44 -40
- package/es/slider/slider.css +1 -1
- package/es/slider/slider.less +5 -5
- package/es/snackbar/Snackbar.js +9 -5
- package/es/snackbar/core.js +20 -26
- package/es/snackbar/snackbar.css +1 -1
- package/es/snackbar/snackbar.less +66 -68
- package/es/space/Space.js +8 -3
- package/es/step/Step.js +25 -23
- package/es/step/step.css +1 -1
- package/es/step/step.less +10 -10
- package/es/steps/Steps.js +12 -5
- package/es/sticky/Sticky.js +14 -7
- package/es/style-provider/StyleProvider.js +6 -2
- package/es/style.css +1 -1
- package/es/style.js +2 -0
- package/es/swipe/Swipe.js +22 -16
- package/es/swipe-item/SwipeItem.js +9 -4
- package/es/switch/Switch.js +25 -23
- package/es/switch/switch.css +1 -1
- package/es/switch/switch.less +2 -2
- package/es/tab/Tab.js +8 -1
- package/es/tab-item/TabItem.js +8 -1
- package/es/table/Table.js +27 -20
- package/es/tabs/Tabs.js +16 -11
- package/es/tabs-items/TabsItems.js +10 -5
- package/es/themes/dark/bottomNavigation.js +4 -0
- package/es/themes/dark/bottomNavigationItem.js +3 -0
- package/es/themes/dark/index.js +3 -1
- package/es/time-picker/TimePicker.js +47 -38
- package/es/time-picker/clock.js +26 -22
- package/es/time-picker/timePicker.css +1 -1
- package/es/time-picker/timePicker.less +11 -11
- package/es/umdIndex.js +10 -0
- package/es/uploader/Uploader.js +62 -57
- package/es/utils/components.js +35 -0
- package/es/varlet.esm.js +2082 -1527
- package/highlight/attributes.json +48 -0
- package/highlight/tags.json +20 -0
- package/highlight/web-types.json +155 -1
- package/lib/action-sheet/ActionSheet.js +30 -26
- package/lib/app-bar/AppBar.js +31 -24
- package/lib/back-top/BackTop.js +11 -2
- package/lib/badge/Badge.js +23 -13
- package/lib/bottom-navigation/BottomNavigation.js +183 -0
- package/lib/bottom-navigation/BottomNavigationSfc.css +0 -0
- package/lib/bottom-navigation/BottomNavigationSfc.less +0 -0
- package/lib/bottom-navigation/bottomNavigation.css +1 -0
- package/lib/bottom-navigation/bottomNavigation.less +49 -0
- package/lib/bottom-navigation/index.js +17 -0
- package/lib/bottom-navigation/props.js +45 -0
- package/lib/bottom-navigation/provide.js +27 -0
- package/lib/bottom-navigation/style/index.js +4 -0
- package/lib/bottom-navigation/style/less.js +4 -0
- package/lib/bottom-navigation-item/BottomNavigationItem.js +140 -0
- package/lib/bottom-navigation-item/BottomNavigationItemSfc.css +0 -0
- package/lib/bottom-navigation-item/BottomNavigationItemSfc.less +0 -0
- package/lib/bottom-navigation-item/bottomNavigationItem.css +1 -0
- package/lib/bottom-navigation-item/bottomNavigationItem.less +78 -0
- package/lib/bottom-navigation-item/index.js +17 -0
- package/lib/bottom-navigation-item/props.js +27 -0
- package/lib/bottom-navigation-item/provide.js +28 -0
- package/lib/bottom-navigation-item/style/index.js +6 -0
- package/lib/bottom-navigation-item/style/less.js +6 -0
- package/lib/button/Button.js +13 -4
- package/lib/card/Card.js +34 -27
- package/lib/cell/Cell.js +26 -13
- package/lib/checkbox/Checkbox.js +26 -23
- package/lib/checkbox-group/CheckboxGroup.js +19 -22
- package/lib/chip/Chip.js +18 -7
- package/lib/chip/chip.css +1 -1
- package/lib/chip/chip.less +11 -11
- package/lib/col/Col.js +14 -5
- package/lib/collapse/Collapse.js +15 -10
- package/lib/collapse-item/CollapseItem.js +31 -28
- package/lib/collapse-item/collapseItem.css +1 -1
- package/lib/collapse-item/collapseItem.less +16 -16
- package/lib/countdown/Countdown.js +14 -10
- package/lib/counter/Counter.js +29 -26
- package/lib/date-picker/DatePicker.js +30 -23
- package/lib/date-picker/date-picker.css +1 -1
- package/lib/date-picker/date-picker.less +22 -20
- package/lib/date-picker/src/day-picker-panel.js +41 -32
- package/lib/date-picker/src/month-picker-panel.js +27 -19
- package/lib/date-picker/src/panel-header.js +16 -9
- package/lib/date-picker/src/year-picker-panel.js +19 -9
- package/lib/dialog/Dialog.js +36 -38
- package/lib/divider/Divider.js +16 -10
- package/lib/form/Form.js +11 -6
- package/lib/form-details/FormDetails.js +27 -20
- package/lib/icon/Icon.js +10 -1
- package/lib/image/Image.js +20 -11
- package/lib/image-preview/ImagePreview.js +35 -33
- package/lib/index-anchor/IndexAnchor.js +10 -1
- package/lib/index-bar/IndexBar.js +24 -20
- package/lib/index.js +6 -0
- package/lib/input/Input.js +45 -43
- package/lib/lazy/index.js +3 -1
- package/lib/less.js +2 -0
- package/lib/list/List.js +39 -36
- package/lib/loading/Loading.js +33 -23
- package/lib/loading/loading.css +1 -1
- package/lib/loading/loading.less +32 -32
- package/lib/menu/Menu.js +12 -9
- package/lib/option/Option.js +16 -9
- package/lib/pagination/Pagination.js +36 -44
- package/lib/pagination/pagination.css +1 -1
- package/lib/pagination/pagination.less +8 -8
- package/lib/picker/Picker.js +51 -46
- package/lib/popup/Popup.js +9 -4
- package/lib/progress/Progress.js +45 -34
- package/lib/progress/progress.css +1 -1
- package/lib/progress/progress.less +12 -12
- package/lib/pull-refresh/PullRefresh.js +14 -10
- package/lib/radio/Radio.js +23 -22
- package/lib/radio-group/RadioGroup.js +17 -16
- package/lib/rate/Rate.js +27 -24
- package/lib/ripple/index.js +7 -2
- package/lib/row/Row.js +12 -3
- package/lib/select/Select.js +53 -53
- package/lib/skeleton/Skeleton.js +69 -78
- package/lib/slider/Slider.js +42 -38
- package/lib/slider/slider.css +1 -1
- package/lib/slider/slider.less +5 -5
- package/lib/snackbar/Snackbar.js +9 -4
- package/lib/snackbar/core.js +20 -25
- package/lib/snackbar/snackbar.css +1 -1
- package/lib/snackbar/snackbar.less +66 -68
- package/lib/space/Space.js +9 -3
- package/lib/step/Step.js +26 -22
- package/lib/step/step.css +1 -1
- package/lib/step/step.less +10 -10
- package/lib/steps/Steps.js +13 -4
- package/lib/sticky/Sticky.js +15 -6
- package/lib/style-provider/StyleProvider.js +8 -2
- package/lib/style.css +1 -1
- package/lib/style.js +2 -0
- package/lib/swipe/Swipe.js +23 -16
- package/lib/swipe-item/SwipeItem.js +10 -3
- package/lib/switch/Switch.js +23 -20
- package/lib/switch/switch.css +1 -1
- package/lib/switch/switch.less +2 -2
- package/lib/tab/Tab.js +10 -1
- package/lib/tab-item/TabItem.js +10 -1
- package/lib/table/Table.js +27 -18
- package/lib/tabs/Tabs.js +18 -11
- package/lib/tabs-items/TabsItems.js +11 -4
- package/lib/themes/dark/bottomNavigation.js +9 -0
- package/lib/themes/dark/bottomNavigationItem.js +8 -0
- package/lib/themes/dark/index.js +5 -1
- package/lib/time-picker/TimePicker.js +49 -38
- package/lib/time-picker/clock.js +26 -20
- package/lib/time-picker/timePicker.css +1 -1
- package/lib/time-picker/timePicker.less +11 -11
- package/lib/uploader/Uploader.js +60 -55
- package/lib/utils/components.js +39 -0
- package/package.json +4 -4
- package/types/bottomNavigation.d.ts +19 -0
- package/types/bottomNavigationItem.d.ts +16 -0
- package/types/global.d.ts +2 -0
- package/types/index.d.ts +2 -0
- package/umd/varlet.js +4 -4
package/es/image/Image.js
CHANGED
|
@@ -3,7 +3,12 @@ import Lazy from '../lazy';
|
|
|
3
3
|
import { defineComponent } from 'vue';
|
|
4
4
|
import { props } from './props';
|
|
5
5
|
import { toSizeUnit } from '../utils/elements';
|
|
6
|
-
import {
|
|
6
|
+
import { createNamespace, call } from '../utils/components';
|
|
7
|
+
var {
|
|
8
|
+
n,
|
|
9
|
+
classes
|
|
10
|
+
} = createNamespace('image');
|
|
11
|
+
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
7
12
|
|
|
8
13
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
9
14
|
|
|
@@ -15,7 +20,7 @@ export function render(_ctx, _cache) {
|
|
|
15
20
|
var _directive_ripple = _resolveDirective("ripple");
|
|
16
21
|
|
|
17
22
|
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
18
|
-
class: _normalizeClass(
|
|
23
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', [!_ctx.block, 'var--inline-block'])),
|
|
19
24
|
style: _normalizeStyle({
|
|
20
25
|
width: _ctx.toSizeUnit(_ctx.width),
|
|
21
26
|
height: _ctx.toSizeUnit(_ctx.height),
|
|
@@ -23,7 +28,7 @@ export function render(_ctx, _cache) {
|
|
|
23
28
|
})
|
|
24
29
|
}, [_ctx.lazy ? _withDirectives((_openBlock(), _createElementBlock("img", {
|
|
25
30
|
key: 0,
|
|
26
|
-
class:
|
|
31
|
+
class: _normalizeClass(_ctx.n('image')),
|
|
27
32
|
alt: _ctx.alt,
|
|
28
33
|
"lazy-error": _ctx.error,
|
|
29
34
|
"lazy-loading": _ctx.loading,
|
|
@@ -39,11 +44,11 @@ export function render(_ctx, _cache) {
|
|
|
39
44
|
onClick: _cache[2] || (_cache[2] = function () {
|
|
40
45
|
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
41
46
|
})
|
|
42
|
-
}, null,
|
|
43
|
-
/* STYLE, PROPS, HYDRATE_EVENTS */
|
|
47
|
+
}, null, 46
|
|
48
|
+
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
44
49
|
, _hoisted_1)), [[_directive_lazy, _ctx.src]]) : (_openBlock(), _createElementBlock("img", {
|
|
45
50
|
key: 1,
|
|
46
|
-
class:
|
|
51
|
+
class: _normalizeClass(_ctx.n('image')),
|
|
47
52
|
alt: _ctx.alt,
|
|
48
53
|
style: _normalizeStyle({
|
|
49
54
|
objectFit: _ctx.fit
|
|
@@ -58,8 +63,8 @@ export function render(_ctx, _cache) {
|
|
|
58
63
|
onClick: _cache[5] || (_cache[5] = function () {
|
|
59
64
|
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
60
65
|
})
|
|
61
|
-
}, null,
|
|
62
|
-
/* STYLE, PROPS, HYDRATE_EVENTS */
|
|
66
|
+
}, null, 46
|
|
67
|
+
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
63
68
|
, _hoisted_2))], 6
|
|
64
69
|
/* CLASS, STYLE */
|
|
65
70
|
)), [[_directive_ripple, {
|
|
@@ -85,10 +90,10 @@ export default defineComponent({
|
|
|
85
90
|
} = props;
|
|
86
91
|
|
|
87
92
|
if (lazy) {
|
|
88
|
-
el._lazy.state === 'success' && (onLoad
|
|
89
|
-
el._lazy.state === 'error' && (onError
|
|
93
|
+
el._lazy.state === 'success' && call(onLoad, e);
|
|
94
|
+
el._lazy.state === 'error' && call(onError, e);
|
|
90
95
|
} else {
|
|
91
|
-
onLoad
|
|
96
|
+
call(onLoad, e);
|
|
92
97
|
}
|
|
93
98
|
};
|
|
94
99
|
|
|
@@ -97,10 +102,12 @@ export default defineComponent({
|
|
|
97
102
|
lazy,
|
|
98
103
|
onError
|
|
99
104
|
} = props;
|
|
100
|
-
!lazy && (onError
|
|
105
|
+
!lazy && call(onError, e);
|
|
101
106
|
};
|
|
102
107
|
|
|
103
108
|
return {
|
|
109
|
+
n,
|
|
110
|
+
classes,
|
|
104
111
|
toSizeUnit,
|
|
105
112
|
handleLoad,
|
|
106
113
|
handleError
|
|
@@ -5,22 +5,20 @@ import VarPopup from '../popup';
|
|
|
5
5
|
import { defineComponent, ref, computed, watch } from 'vue';
|
|
6
6
|
import { props } from './props';
|
|
7
7
|
import { toNumber } from '../utils/shared';
|
|
8
|
+
import { call, createNamespace } from '../utils/components';
|
|
9
|
+
var {
|
|
10
|
+
n,
|
|
11
|
+
classes
|
|
12
|
+
} = createNamespace('image-preview');
|
|
8
13
|
var DISTANCE_OFFSET = 12;
|
|
9
14
|
var EVENT_DELAY = 200;
|
|
10
15
|
var TAP_DELAY = 350;
|
|
11
16
|
var ANIMATION_DURATION = 200;
|
|
12
|
-
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
17
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
13
18
|
|
|
14
19
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
15
20
|
|
|
16
21
|
var _hoisted_1 = ["src", "alt"];
|
|
17
|
-
var _hoisted_2 = {
|
|
18
|
-
key: 0,
|
|
19
|
-
class: "var-image-preview__indicators"
|
|
20
|
-
};
|
|
21
|
-
var _hoisted_3 = {
|
|
22
|
-
class: "var-image-preview__extra"
|
|
23
|
-
};
|
|
24
22
|
export function render(_ctx, _cache) {
|
|
25
23
|
var _component_var_swipe_item = _resolveComponent("var-swipe-item");
|
|
26
24
|
|
|
@@ -31,7 +29,7 @@ export function render(_ctx, _cache) {
|
|
|
31
29
|
var _component_var_popup = _resolveComponent("var-popup");
|
|
32
30
|
|
|
33
31
|
return _openBlock(), _createBlock(_component_var_popup, {
|
|
34
|
-
class:
|
|
32
|
+
class: _normalizeClass(_ctx.n('popup')),
|
|
35
33
|
"var-image-preview-cover": "",
|
|
36
34
|
transition: "var-fade",
|
|
37
35
|
show: _ctx.popupShow,
|
|
@@ -46,7 +44,7 @@ export function render(_ctx, _cache) {
|
|
|
46
44
|
onRouteChange: _ctx.onRouteChange
|
|
47
45
|
}, {
|
|
48
46
|
default: _withCtx(() => [_createVNode(_component_var_swipe, _mergeProps({
|
|
49
|
-
class:
|
|
47
|
+
class: _ctx.n('swipe'),
|
|
50
48
|
"var-image-preview-cover": "",
|
|
51
49
|
touchable: _ctx.canSwipe,
|
|
52
50
|
indicator: _ctx.indicator && _ctx.images.length > 1,
|
|
@@ -56,12 +54,12 @@ export function render(_ctx, _cache) {
|
|
|
56
54
|
}, _ctx.$attrs), {
|
|
57
55
|
default: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.images, image => {
|
|
58
56
|
return _openBlock(), _createBlock(_component_var_swipe_item, {
|
|
59
|
-
class:
|
|
57
|
+
class: _normalizeClass(_ctx.n('swipe-item')),
|
|
60
58
|
"var-image-preview-cover": "",
|
|
61
59
|
key: image
|
|
62
60
|
}, {
|
|
63
61
|
default: _withCtx(() => [_createElementVNode("div", {
|
|
64
|
-
class:
|
|
62
|
+
class: _normalizeClass(_ctx.n('zoom-container')),
|
|
65
63
|
style: _normalizeStyle({
|
|
66
64
|
transform: "scale(" + _ctx.scale + ") translate(" + _ctx.translateX + "px, " + _ctx.translateY + "px)",
|
|
67
65
|
transitionTimingFunction: _ctx.transitionTimingFunction,
|
|
@@ -77,20 +75,20 @@ export function render(_ctx, _cache) {
|
|
|
77
75
|
return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
|
|
78
76
|
})
|
|
79
77
|
}, [_createElementVNode("img", {
|
|
80
|
-
class:
|
|
78
|
+
class: _normalizeClass(_ctx.n('image')),
|
|
81
79
|
src: image,
|
|
82
80
|
alt: image
|
|
83
|
-
}, null,
|
|
84
|
-
/* PROPS */
|
|
85
|
-
, _hoisted_1)],
|
|
86
|
-
/* STYLE, HYDRATE_EVENTS */
|
|
81
|
+
}, null, 10
|
|
82
|
+
/* CLASS, PROPS */
|
|
83
|
+
, _hoisted_1)], 38
|
|
84
|
+
/* CLASS, STYLE, HYDRATE_EVENTS */
|
|
87
85
|
)]),
|
|
88
86
|
_: 2
|
|
89
87
|
/* DYNAMIC */
|
|
90
88
|
|
|
91
|
-
},
|
|
92
|
-
/* DYNAMIC_SLOTS */
|
|
93
|
-
);
|
|
89
|
+
}, 1032
|
|
90
|
+
/* PROPS, DYNAMIC_SLOTS */
|
|
91
|
+
, ["class"]);
|
|
94
92
|
}), 128
|
|
95
93
|
/* KEYED_FRAGMENT */
|
|
96
94
|
))]),
|
|
@@ -102,8 +100,11 @@ export function render(_ctx, _cache) {
|
|
|
102
100
|
return [_renderSlot(_ctx.$slots, "indicator", {
|
|
103
101
|
index: index,
|
|
104
102
|
length: length
|
|
105
|
-
}, () => [_ctx.indicator && _ctx.images.length > 1 ? (_openBlock(), _createElementBlock("div",
|
|
106
|
-
|
|
103
|
+
}, () => [_ctx.indicator && _ctx.images.length > 1 ? (_openBlock(), _createElementBlock("div", {
|
|
104
|
+
key: 0,
|
|
105
|
+
class: _normalizeClass(_ctx.n('indicators'))
|
|
106
|
+
}, _toDisplayString(index + 1) + " / " + _toDisplayString(length), 3
|
|
107
|
+
/* TEXT, CLASS */
|
|
107
108
|
)) : _createCommentVNode("v-if", true)])];
|
|
108
109
|
}),
|
|
109
110
|
_: 3
|
|
@@ -111,21 +112,25 @@ export function render(_ctx, _cache) {
|
|
|
111
112
|
|
|
112
113
|
}, 16
|
|
113
114
|
/* FULL_PROPS */
|
|
114
|
-
, ["touchable", "indicator", "initial-index", "loop", "onChange"]), _renderSlot(_ctx.$slots, "close-icon", {}, () => [_ctx.closeable ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
115
|
+
, ["class", "touchable", "indicator", "initial-index", "loop", "onChange"]), _renderSlot(_ctx.$slots, "close-icon", {}, () => [_ctx.closeable ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
115
116
|
key: 0,
|
|
116
|
-
class:
|
|
117
|
+
class: _normalizeClass(_ctx.n('close-icon')),
|
|
117
118
|
name: "close-circle",
|
|
118
119
|
"var-image-preview-cover": "",
|
|
119
120
|
onClick: _ctx.close
|
|
120
121
|
}, null, 8
|
|
121
122
|
/* PROPS */
|
|
122
|
-
, ["onClick"])) : _createCommentVNode("v-if", true)]), _createElementVNode("div",
|
|
123
|
+
, ["class", "onClick"])) : _createCommentVNode("v-if", true)]), _createElementVNode("div", {
|
|
124
|
+
class: _normalizeClass(_ctx.n('extra'))
|
|
125
|
+
}, [_renderSlot(_ctx.$slots, "extra")], 2
|
|
126
|
+
/* CLASS */
|
|
127
|
+
)]),
|
|
123
128
|
_: 3
|
|
124
129
|
/* FORWARDED */
|
|
125
130
|
|
|
126
131
|
}, 8
|
|
127
132
|
/* PROPS */
|
|
128
|
-
, ["show", "lock-scroll", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
|
|
133
|
+
, ["class", "show", "lock-scroll", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
|
|
129
134
|
}
|
|
130
135
|
export default defineComponent({
|
|
131
136
|
render,
|
|
@@ -325,19 +330,13 @@ export default defineComponent({
|
|
|
325
330
|
};
|
|
326
331
|
|
|
327
332
|
var close = () => {
|
|
328
|
-
var _props$onUpdateShow2;
|
|
329
|
-
|
|
330
333
|
if (scale.value > 1) {
|
|
331
334
|
zoomOut();
|
|
332
|
-
setTimeout(() =>
|
|
333
|
-
var _props$onUpdateShow;
|
|
334
|
-
|
|
335
|
-
return (_props$onUpdateShow = props['onUpdate:show']) == null ? void 0 : _props$onUpdateShow.call(props, false);
|
|
336
|
-
}, ANIMATION_DURATION);
|
|
335
|
+
setTimeout(() => call(props['onUpdate:show'], false), ANIMATION_DURATION);
|
|
337
336
|
return;
|
|
338
337
|
}
|
|
339
338
|
|
|
340
|
-
(
|
|
339
|
+
call(props['onUpdate:show'], false);
|
|
341
340
|
};
|
|
342
341
|
|
|
343
342
|
watch(() => props.show, newValue => {
|
|
@@ -346,6 +345,8 @@ export default defineComponent({
|
|
|
346
345
|
immediate: true
|
|
347
346
|
});
|
|
348
347
|
return {
|
|
348
|
+
n,
|
|
349
|
+
classes,
|
|
349
350
|
initialIndex,
|
|
350
351
|
popupShow,
|
|
351
352
|
scale,
|
|
@@ -2,6 +2,11 @@ import VarSticky from '../sticky';
|
|
|
2
2
|
import { computed, defineComponent, ref, Transition } from 'vue';
|
|
3
3
|
import { useIndexBar } from './provide';
|
|
4
4
|
import { props } from './props';
|
|
5
|
+
import { createNamespace } from '../utils/components';
|
|
6
|
+
var {
|
|
7
|
+
n,
|
|
8
|
+
classes
|
|
9
|
+
} = createNamespace('index-anchor');
|
|
5
10
|
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, createElementVNode as _createElementVNode, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
6
11
|
export function render(_ctx, _cache) {
|
|
7
12
|
return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.sticky ? 'var-sticky' : _ctx.Transition), {
|
|
@@ -12,7 +17,7 @@ export function render(_ctx, _cache) {
|
|
|
12
17
|
ref: "anchorEl"
|
|
13
18
|
}, {
|
|
14
19
|
default: _withCtx(() => [_createElementVNode("div", _mergeProps({
|
|
15
|
-
class:
|
|
20
|
+
class: _ctx.n()
|
|
16
21
|
}, _ctx.$attrs), [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.name), 1
|
|
17
22
|
/* TEXT */
|
|
18
23
|
)])], 16
|
|
@@ -70,6 +75,8 @@ export default defineComponent({
|
|
|
70
75
|
};
|
|
71
76
|
bindIndexBar(indexAnchorProvider);
|
|
72
77
|
return {
|
|
78
|
+
n,
|
|
79
|
+
classes,
|
|
73
80
|
name,
|
|
74
81
|
anchorEl,
|
|
75
82
|
active,
|
package/es/index-bar/IndexBar.js
CHANGED
|
@@ -7,18 +7,22 @@ import { easeInOutCubic, isPlainObject, toNumber } from '../utils/shared';
|
|
|
7
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
|
+
import { createNamespace, call } from '../utils/components';
|
|
11
|
+
var {
|
|
12
|
+
n,
|
|
13
|
+
classes
|
|
14
|
+
} = createNamespace('index-bar');
|
|
10
15
|
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";
|
|
11
16
|
|
|
12
17
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
13
18
|
|
|
14
|
-
var _hoisted_1 =
|
|
15
|
-
class: "var-index-bar",
|
|
16
|
-
ref: "barEl"
|
|
17
|
-
};
|
|
18
|
-
var _hoisted_2 = ["onClick"];
|
|
19
|
+
var _hoisted_1 = ["onClick"];
|
|
19
20
|
export function render(_ctx, _cache) {
|
|
20
|
-
return _openBlock(), _createElementBlock("div",
|
|
21
|
-
class:
|
|
21
|
+
return _openBlock(), _createElementBlock("div", {
|
|
22
|
+
class: _normalizeClass(_ctx.n()),
|
|
23
|
+
ref: "barEl"
|
|
24
|
+
}, [_renderSlot(_ctx.$slots, "default"), _createElementVNode("ul", {
|
|
25
|
+
class: _normalizeClass(_ctx.n('anchor-list')),
|
|
22
26
|
style: _normalizeStyle({
|
|
23
27
|
zIndex: _ctx.toNumber(_ctx.zIndex) + 2,
|
|
24
28
|
display: _ctx.hideList ? 'none' : 'block'
|
|
@@ -26,22 +30,20 @@ export function render(_ctx, _cache) {
|
|
|
26
30
|
}, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.anchorNameList, anchorName => {
|
|
27
31
|
return _openBlock(), _createElementBlock("li", {
|
|
28
32
|
key: anchorName,
|
|
29
|
-
class: _normalizeClass([
|
|
30
|
-
'var-index-bar__anchor-item--active': _ctx.active === anchorName
|
|
31
|
-
}]),
|
|
33
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('anchor-item'), [_ctx.active === anchorName, _ctx.n('anchor-item--active')])),
|
|
32
34
|
style: _normalizeStyle({
|
|
33
35
|
color: _ctx.active === anchorName && _ctx.highlightColor ? _ctx.highlightColor : ''
|
|
34
36
|
}),
|
|
35
37
|
onClick: $event => _ctx.anchorClick(anchorName)
|
|
36
38
|
}, _toDisplayString(anchorName), 15
|
|
37
39
|
/* TEXT, CLASS, STYLE, PROPS */
|
|
38
|
-
,
|
|
40
|
+
, _hoisted_1);
|
|
39
41
|
}), 128
|
|
40
42
|
/* KEYED_FRAGMENT */
|
|
41
|
-
))],
|
|
42
|
-
/* STYLE */
|
|
43
|
-
)],
|
|
44
|
-
/*
|
|
43
|
+
))], 6
|
|
44
|
+
/* CLASS, STYLE */
|
|
45
|
+
)], 2
|
|
46
|
+
/* CLASS */
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
49
|
export default defineComponent({
|
|
@@ -77,7 +79,7 @@ export default defineComponent({
|
|
|
77
79
|
var anchorName = isPlainObject(anchor) ? anchor.name.value : anchor;
|
|
78
80
|
if (anchorName === active.value || anchorName === undefined) return;
|
|
79
81
|
active.value = anchorName;
|
|
80
|
-
props.onChange
|
|
82
|
+
call(props.onChange, anchorName);
|
|
81
83
|
};
|
|
82
84
|
|
|
83
85
|
var handleScroll = () => {
|
|
@@ -107,7 +109,7 @@ export default defineComponent({
|
|
|
107
109
|
var {
|
|
108
110
|
offsetTop
|
|
109
111
|
} = barEl.value;
|
|
110
|
-
if (manualCall) props.onClick
|
|
112
|
+
if (manualCall) call(props.onClick, anchorName);
|
|
111
113
|
if (anchorName === active.value) return;
|
|
112
114
|
var indexAnchor = indexAnchors.find(_ref2 => {
|
|
113
115
|
var {
|
|
@@ -158,11 +160,11 @@ export default defineComponent({
|
|
|
158
160
|
scroller.value.addEventListener('scroll', handleScroll);
|
|
159
161
|
}));
|
|
160
162
|
onBeforeUnmount(() => {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
(_scroller$value = scroller.value) == null ? void 0 : _scroller$value.removeEventListener('scroll', handleScroll);
|
|
163
|
+
call(scroller.value.removeEventListener, 'scroll', handleScroll);
|
|
164
164
|
});
|
|
165
165
|
return {
|
|
166
|
+
n,
|
|
167
|
+
classes,
|
|
166
168
|
barEl,
|
|
167
169
|
active,
|
|
168
170
|
zIndex,
|
package/es/index.js
CHANGED
|
@@ -2,6 +2,8 @@ import ActionSheet, * as ActionSheetModule from './action-sheet'
|
|
|
2
2
|
import AppBar, * as AppBarModule from './app-bar'
|
|
3
3
|
import BackTop, * as BackTopModule from './back-top'
|
|
4
4
|
import Badge, * as BadgeModule from './badge'
|
|
5
|
+
import BottomNavigation, * as BottomNavigationModule from './bottom-navigation'
|
|
6
|
+
import BottomNavigationItem, * as BottomNavigationItemModule from './bottom-navigation-item'
|
|
5
7
|
import Button, * as ButtonModule from './button'
|
|
6
8
|
import Card, * as CardModule from './card'
|
|
7
9
|
import Cell, * as CellModule from './cell'
|
|
@@ -65,6 +67,8 @@ export const _ActionSheetComponent = ActionSheetModule._ActionSheetComponent ||
|
|
|
65
67
|
export const _AppBarComponent = AppBarModule._AppBarComponent || {}
|
|
66
68
|
export const _BackTopComponent = BackTopModule._BackTopComponent || {}
|
|
67
69
|
export const _BadgeComponent = BadgeModule._BadgeComponent || {}
|
|
70
|
+
export const _BottomNavigationComponent = BottomNavigationModule._BottomNavigationComponent || {}
|
|
71
|
+
export const _BottomNavigationItemComponent = BottomNavigationItemModule._BottomNavigationItemComponent || {}
|
|
68
72
|
export const _ButtonComponent = ButtonModule._ButtonComponent || {}
|
|
69
73
|
export const _CardComponent = CardModule._CardComponent || {}
|
|
70
74
|
export const _CellComponent = CellModule._CellComponent || {}
|
|
@@ -130,6 +134,8 @@ function install(app) {
|
|
|
130
134
|
AppBar.install && app.use(AppBar)
|
|
131
135
|
BackTop.install && app.use(BackTop)
|
|
132
136
|
Badge.install && app.use(Badge)
|
|
137
|
+
BottomNavigation.install && app.use(BottomNavigation)
|
|
138
|
+
BottomNavigationItem.install && app.use(BottomNavigationItem)
|
|
133
139
|
Button.install && app.use(Button)
|
|
134
140
|
Card.install && app.use(Card)
|
|
135
141
|
Cell.install && app.use(Cell)
|
|
@@ -196,6 +202,8 @@ export {
|
|
|
196
202
|
AppBar,
|
|
197
203
|
BackTop,
|
|
198
204
|
Badge,
|
|
205
|
+
BottomNavigation,
|
|
206
|
+
BottomNavigationItem,
|
|
199
207
|
Button,
|
|
200
208
|
Card,
|
|
201
209
|
Cell,
|
|
@@ -262,6 +270,8 @@ export default {
|
|
|
262
270
|
AppBar,
|
|
263
271
|
BackTop,
|
|
264
272
|
Badge,
|
|
273
|
+
BottomNavigation,
|
|
274
|
+
BottomNavigationItem,
|
|
265
275
|
Button,
|
|
266
276
|
Card,
|
|
267
277
|
Cell,
|
package/es/input/Input.js
CHANGED
|
@@ -3,43 +3,48 @@ import VarIcon from '../icon';
|
|
|
3
3
|
import { defineComponent, getCurrentInstance, ref, computed, nextTick } from 'vue';
|
|
4
4
|
import { props } from './props';
|
|
5
5
|
import { isEmpty } from '../utils/shared';
|
|
6
|
-
import { useValidation } from '../utils/components';
|
|
6
|
+
import { useValidation, createNamespace, call } from '../utils/components';
|
|
7
7
|
import { useForm } from '../form/provide';
|
|
8
|
+
var {
|
|
9
|
+
n,
|
|
10
|
+
classes
|
|
11
|
+
} = createNamespace('input');
|
|
8
12
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, toDisplayString as _toDisplayString, resolveComponent as _resolveComponent, createBlock as _createBlock, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
9
13
|
|
|
10
14
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
11
15
|
|
|
12
|
-
var _hoisted_1 =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
var _hoisted_2 = ["id", "disabled", "type", "value", "maxlength", "rows"];
|
|
17
|
-
var _hoisted_3 = ["id", "disabled", "type", "value", "maxlength"];
|
|
18
|
-
var _hoisted_4 = ["for"];
|
|
16
|
+
var _hoisted_1 = ["id", "disabled", "type", "value", "maxlength", "rows"];
|
|
17
|
+
var _hoisted_2 = ["id", "disabled", "type", "value", "maxlength"];
|
|
18
|
+
var _hoisted_3 = ["for"];
|
|
19
19
|
export function render(_ctx, _cache) {
|
|
20
20
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
21
21
|
|
|
22
22
|
var _component_var_form_details = _resolveComponent("var-form-details");
|
|
23
23
|
|
|
24
24
|
return _openBlock(), _createElementBlock("div", {
|
|
25
|
-
class: _normalizeClass(
|
|
25
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', [_ctx.disabled, _ctx.n('--disabled')])),
|
|
26
26
|
onClick: _cache[8] || (_cache[8] = function () {
|
|
27
27
|
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
28
28
|
})
|
|
29
29
|
}, [_createElementVNode("div", {
|
|
30
|
-
class: _normalizeClass(
|
|
30
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('controller'), [_ctx.isFocus, _ctx.n('--focus')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
|
|
31
31
|
style: _normalizeStyle({
|
|
32
32
|
color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : undefined
|
|
33
33
|
})
|
|
34
34
|
}, [_createElementVNode("div", {
|
|
35
|
-
class: _normalizeClass(
|
|
35
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')]))
|
|
36
36
|
}, [_renderSlot(_ctx.$slots, "prepend-icon")], 2
|
|
37
37
|
/* CLASS */
|
|
38
38
|
), _createElementVNode("div", {
|
|
39
|
-
class: _normalizeClass(
|
|
40
|
-
}, [_ctx.type === 'password' ? (_openBlock(), _createElementBlock("input",
|
|
39
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('wrap'), [!_ctx.hint, _ctx.n('--non-hint')]))
|
|
40
|
+
}, [_ctx.type === 'password' ? (_openBlock(), _createElementBlock("input", {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: _normalizeClass(_ctx.n('autocomplete'))
|
|
43
|
+
}, null, 2
|
|
44
|
+
/* CLASS */
|
|
45
|
+
)) : _createCommentVNode("v-if", true), _ctx.textarea ? (_openBlock(), _createElementBlock("textarea", {
|
|
41
46
|
key: 1,
|
|
42
|
-
class: _normalizeClass(
|
|
47
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('input'), _ctx.n('--textarea'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--caret-error')])),
|
|
43
48
|
ref: "el",
|
|
44
49
|
autocomplete: "new-password",
|
|
45
50
|
id: _ctx.id,
|
|
@@ -50,7 +55,7 @@ export function render(_ctx, _cache) {
|
|
|
50
55
|
rows: _ctx.rows,
|
|
51
56
|
style: _normalizeStyle({
|
|
52
57
|
color: _ctx.textColor,
|
|
53
|
-
caretColor: !_ctx.errorMessage ? _ctx.focusColor :
|
|
58
|
+
caretColor: !_ctx.errorMessage ? _ctx.focusColor : undefined,
|
|
54
59
|
resize: _ctx.resize ? 'vertical' : 'none'
|
|
55
60
|
}),
|
|
56
61
|
onFocus: _cache[0] || (_cache[0] = function () {
|
|
@@ -67,9 +72,9 @@ export function render(_ctx, _cache) {
|
|
|
67
72
|
})
|
|
68
73
|
}, "\n ", 46
|
|
69
74
|
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
70
|
-
,
|
|
75
|
+
, _hoisted_1)) : (_openBlock(), _createElementBlock("input", {
|
|
71
76
|
key: 2,
|
|
72
|
-
class: _normalizeClass(
|
|
77
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('input'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--caret-error')])),
|
|
73
78
|
ref: "el",
|
|
74
79
|
autocomplete: "new-password",
|
|
75
80
|
id: _ctx.id,
|
|
@@ -79,7 +84,7 @@ export function render(_ctx, _cache) {
|
|
|
79
84
|
maxlength: _ctx.maxlength,
|
|
80
85
|
style: _normalizeStyle({
|
|
81
86
|
color: _ctx.textColor,
|
|
82
|
-
caretColor: !_ctx.errorMessage ? _ctx.focusColor :
|
|
87
|
+
caretColor: !_ctx.errorMessage ? _ctx.focusColor : undefined
|
|
83
88
|
}),
|
|
84
89
|
onFocus: _cache[4] || (_cache[4] = function () {
|
|
85
90
|
return _ctx.handleFocus && _ctx.handleFocus(...arguments);
|
|
@@ -95,39 +100,39 @@ export function render(_ctx, _cache) {
|
|
|
95
100
|
})
|
|
96
101
|
}, null, 46
|
|
97
102
|
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
98
|
-
,
|
|
99
|
-
class: _normalizeClass(
|
|
103
|
+
, _hoisted_2)), _createElementVNode("label", {
|
|
104
|
+
class: _normalizeClass(_ctx.classes('var--ellipsis', [_ctx.isFocus, _ctx.n('--focus')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.textarea, _ctx.n('textarea-placeholder'), _ctx.n('placeholder')], _ctx.computePlaceholderState(), [!_ctx.hint, _ctx.n('--placeholder-non-hint')])),
|
|
100
105
|
style: _normalizeStyle({
|
|
101
106
|
color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : undefined
|
|
102
107
|
}),
|
|
103
108
|
for: _ctx.id
|
|
104
109
|
}, _toDisplayString(_ctx.placeholder), 15
|
|
105
110
|
/* TEXT, CLASS, STYLE, PROPS */
|
|
106
|
-
,
|
|
111
|
+
, _hoisted_3)], 2
|
|
107
112
|
/* CLASS */
|
|
108
113
|
), _createElementVNode("div", {
|
|
109
|
-
class: _normalizeClass(
|
|
114
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')]))
|
|
110
115
|
}, [_renderSlot(_ctx.$slots, "append-icon", {}, () => [_ctx.clearable && !_ctx.isEmpty(_ctx.modelValue) ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
111
116
|
key: 0,
|
|
112
|
-
class:
|
|
117
|
+
class: _normalizeClass(_ctx.n('clear-icon')),
|
|
113
118
|
"var-input-cover": "",
|
|
114
119
|
name: "close-circle",
|
|
115
120
|
size: "14px",
|
|
116
121
|
onClick: _ctx.handleClear
|
|
117
122
|
}, null, 8
|
|
118
123
|
/* PROPS */
|
|
119
|
-
, ["onClick"])) : _createCommentVNode("v-if", true)])], 2
|
|
124
|
+
, ["class", "onClick"])) : _createCommentVNode("v-if", true)])], 2
|
|
120
125
|
/* CLASS */
|
|
121
126
|
)], 6
|
|
122
127
|
/* CLASS, STYLE */
|
|
123
128
|
), _ctx.line ? (_openBlock(), _createElementBlock("div", {
|
|
124
129
|
key: 0,
|
|
125
|
-
class: _normalizeClass(
|
|
130
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('line'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')], [_ctx.errorMessage, _ctx.n('--line-error')])),
|
|
126
131
|
style: _normalizeStyle({
|
|
127
132
|
background: !_ctx.errorMessage ? _ctx.blurColor : undefined
|
|
128
133
|
})
|
|
129
134
|
}, [_createElementVNode("div", {
|
|
130
|
-
class: _normalizeClass(
|
|
135
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('dot'), [_ctx.isFocus, _ctx.n('--spread')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')], [_ctx.errorMessage, _ctx.n('--line-error')])),
|
|
131
136
|
style: _normalizeStyle({
|
|
132
137
|
background: !_ctx.errorMessage ? _ctx.focusColor : undefined
|
|
133
138
|
})
|
|
@@ -203,34 +208,32 @@ export default defineComponent({
|
|
|
203
208
|
} = props;
|
|
204
209
|
|
|
205
210
|
if (!hint && !isEmpty(modelValue)) {
|
|
206
|
-
return '
|
|
211
|
+
return n('--placeholder-hidden');
|
|
207
212
|
}
|
|
208
213
|
|
|
209
214
|
if (hint && (!isEmpty(modelValue) || isFocus.value)) {
|
|
210
|
-
return '
|
|
215
|
+
return n('--placeholder-hint');
|
|
211
216
|
}
|
|
212
217
|
};
|
|
213
218
|
|
|
214
219
|
var handleFocus = e => {
|
|
215
220
|
isFocus.value = true;
|
|
216
|
-
props.onFocus
|
|
221
|
+
call(props.onFocus, e);
|
|
217
222
|
validateWithTrigger('onFocus');
|
|
218
223
|
};
|
|
219
224
|
|
|
220
225
|
var handleBlur = e => {
|
|
221
226
|
isFocus.value = false;
|
|
222
|
-
props.onBlur
|
|
227
|
+
call(props.onBlur, e);
|
|
223
228
|
validateWithTrigger('onBlur');
|
|
224
229
|
};
|
|
225
230
|
|
|
226
231
|
var handleInput = e => {
|
|
227
|
-
var _props$onUpdateModel;
|
|
228
|
-
|
|
229
232
|
var {
|
|
230
233
|
value
|
|
231
234
|
} = e.target;
|
|
232
|
-
(
|
|
233
|
-
props.onInput
|
|
235
|
+
call(props['onUpdate:modelValue'], value);
|
|
236
|
+
call(props.onInput, value, e);
|
|
234
237
|
validateWithTrigger('onInput');
|
|
235
238
|
};
|
|
236
239
|
|
|
@@ -238,13 +241,11 @@ export default defineComponent({
|
|
|
238
241
|
var {
|
|
239
242
|
value
|
|
240
243
|
} = e.target;
|
|
241
|
-
props.onChange
|
|
244
|
+
call(props.onChange, value, e);
|
|
242
245
|
validateWithTrigger('onChange');
|
|
243
246
|
};
|
|
244
247
|
|
|
245
248
|
var handleClear = () => {
|
|
246
|
-
var _props$onUpdateModel2;
|
|
247
|
-
|
|
248
249
|
var {
|
|
249
250
|
disabled,
|
|
250
251
|
readonly,
|
|
@@ -256,8 +257,8 @@ export default defineComponent({
|
|
|
256
257
|
return;
|
|
257
258
|
}
|
|
258
259
|
|
|
259
|
-
(
|
|
260
|
-
onClear
|
|
260
|
+
call(props['onUpdate:modelValue'], '');
|
|
261
|
+
call(onClear, '');
|
|
261
262
|
validateWithTrigger('onClear');
|
|
262
263
|
};
|
|
263
264
|
|
|
@@ -271,15 +272,13 @@ export default defineComponent({
|
|
|
271
272
|
return;
|
|
272
273
|
}
|
|
273
274
|
|
|
274
|
-
onClick
|
|
275
|
+
call(onClick, e);
|
|
275
276
|
validateWithTrigger('onClick');
|
|
276
277
|
}; // expose
|
|
277
278
|
|
|
278
279
|
|
|
279
280
|
var reset = () => {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
(_props$onUpdateModel3 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel3.call(props, '');
|
|
281
|
+
call(props['onUpdate:modelValue'], '');
|
|
283
282
|
resetValidation();
|
|
284
283
|
}; // expose
|
|
285
284
|
|
|
@@ -303,7 +302,7 @@ export default defineComponent({
|
|
|
303
302
|
validate,
|
|
304
303
|
resetValidation
|
|
305
304
|
};
|
|
306
|
-
bindForm
|
|
305
|
+
call(bindForm, inputProvider);
|
|
307
306
|
return {
|
|
308
307
|
el,
|
|
309
308
|
id,
|
|
@@ -312,6 +311,8 @@ export default defineComponent({
|
|
|
312
311
|
maxlengthText,
|
|
313
312
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
314
313
|
formReadonly: form == null ? void 0 : form.readonly,
|
|
314
|
+
n,
|
|
315
|
+
classes,
|
|
315
316
|
isEmpty,
|
|
316
317
|
computePlaceholderState,
|
|
317
318
|
handleFocus,
|