@varlet/ui 1.26.8 → 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/icon/icon.css +1 -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/icon/icon.css +1 -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/select/Select.js
CHANGED
|
@@ -5,10 +5,14 @@ import VarFormDetails from '../form-details';
|
|
|
5
5
|
import { computed, defineComponent, ref, watch, nextTick } from 'vue';
|
|
6
6
|
import { isArray, isEmpty } from '../utils/shared';
|
|
7
7
|
import { props } from './props';
|
|
8
|
-
import { useValidation } from '../utils/components';
|
|
8
|
+
import { useValidation, createNamespace, call } from '../utils/components';
|
|
9
9
|
import { useOptions } from './provide';
|
|
10
10
|
import { useForm } from '../form/provide';
|
|
11
11
|
import { toPxNum } from '../utils/elements';
|
|
12
|
+
var {
|
|
13
|
+
n,
|
|
14
|
+
classes
|
|
15
|
+
} = createNamespace('select');
|
|
12
16
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withModifiers as _withModifiers, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
13
17
|
|
|
14
18
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
@@ -17,19 +21,8 @@ var _hoisted_1 = {
|
|
|
17
21
|
key: 0
|
|
18
22
|
};
|
|
19
23
|
var _hoisted_2 = {
|
|
20
|
-
key: 0,
|
|
21
|
-
class: "var-select__chips"
|
|
22
|
-
};
|
|
23
|
-
var _hoisted_3 = {
|
|
24
|
-
key: 1,
|
|
25
|
-
class: "var-select__values"
|
|
26
|
-
};
|
|
27
|
-
var _hoisted_4 = {
|
|
28
24
|
key: 1
|
|
29
25
|
};
|
|
30
|
-
var _hoisted_5 = {
|
|
31
|
-
class: "var-select__scroller"
|
|
32
|
-
};
|
|
33
26
|
export function render(_ctx, _cache) {
|
|
34
27
|
var _component_var_chip = _resolveComponent("var-chip");
|
|
35
28
|
|
|
@@ -40,43 +33,50 @@ export function render(_ctx, _cache) {
|
|
|
40
33
|
var _component_var_form_details = _resolveComponent("var-form-details");
|
|
41
34
|
|
|
42
35
|
return _openBlock(), _createElementBlock("div", {
|
|
43
|
-
class: _normalizeClass(
|
|
36
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
|
|
44
37
|
onClick: _cache[3] || (_cache[3] = function () {
|
|
45
38
|
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
46
39
|
})
|
|
47
40
|
}, [_createElementVNode("div", {
|
|
48
|
-
class: _normalizeClass(
|
|
41
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('controller'), [_ctx.isFocus, _ctx.n('--focus')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
|
|
49
42
|
style: _normalizeStyle({
|
|
50
43
|
color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : undefined
|
|
51
44
|
})
|
|
52
45
|
}, [_createElementVNode("div", {
|
|
53
|
-
class: _normalizeClass(
|
|
46
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')]))
|
|
54
47
|
}, [_renderSlot(_ctx.$slots, "prepend-icon")], 2
|
|
55
48
|
/* CLASS */
|
|
56
49
|
), _createVNode(_component_var_menu, {
|
|
57
|
-
class:
|
|
50
|
+
class: _normalizeClass(_ctx.n('menu')),
|
|
58
51
|
"var-select-cover": "",
|
|
59
52
|
"offset-y": _ctx.offsetY,
|
|
60
53
|
show: _ctx.isFocus,
|
|
61
54
|
"onUpdate:show": _cache[2] || (_cache[2] = $event => _ctx.isFocus = $event),
|
|
62
55
|
onClose: _ctx.handleBlur
|
|
63
56
|
}, {
|
|
64
|
-
menu: _withCtx(() => [_createElementVNode("div",
|
|
57
|
+
menu: _withCtx(() => [_createElementVNode("div", {
|
|
58
|
+
class: _normalizeClass(_ctx.n('scroller'))
|
|
59
|
+
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
60
|
+
/* CLASS */
|
|
61
|
+
)]),
|
|
65
62
|
default: _withCtx(() => [_createElementVNode("div", {
|
|
66
|
-
class: _normalizeClass(
|
|
63
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('wrap'), [!_ctx.hint, _ctx.n('--non-hint')])),
|
|
67
64
|
ref: "wrapEl",
|
|
68
65
|
onClick: _cache[1] || (_cache[1] = function () {
|
|
69
66
|
return _ctx.handleFocus && _ctx.handleFocus(...arguments);
|
|
70
67
|
})
|
|
71
68
|
}, [_createElementVNode("div", {
|
|
72
|
-
class: _normalizeClass(
|
|
69
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('select'), [_ctx.errorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
|
|
73
70
|
style: _normalizeStyle({
|
|
74
71
|
textAlign: _ctx.textAlign,
|
|
75
72
|
color: _ctx.textColor
|
|
76
73
|
})
|
|
77
|
-
}, [_ctx.multiple ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_ctx.chip ? (_openBlock(), _createElementBlock("div",
|
|
74
|
+
}, [_ctx.multiple ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_ctx.chip ? (_openBlock(), _createElementBlock("div", {
|
|
75
|
+
key: 0,
|
|
76
|
+
class: _normalizeClass(_ctx.n('chips'))
|
|
77
|
+
}, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.labels, l => {
|
|
78
78
|
return _openBlock(), _createBlock(_component_var_chip, {
|
|
79
|
-
class:
|
|
79
|
+
class: _normalizeClass(_ctx.n('chip')),
|
|
80
80
|
"var-select-cover": "",
|
|
81
81
|
closable: "",
|
|
82
82
|
size: "small",
|
|
@@ -93,15 +93,20 @@ export function render(_ctx, _cache) {
|
|
|
93
93
|
|
|
94
94
|
}, 1032
|
|
95
95
|
/* PROPS, DYNAMIC_SLOTS */
|
|
96
|
-
, ["type", "onClose"]);
|
|
96
|
+
, ["class", "type", "onClose"]);
|
|
97
97
|
}), 128
|
|
98
98
|
/* KEYED_FRAGMENT */
|
|
99
|
-
))]
|
|
100
|
-
/*
|
|
101
|
-
))
|
|
99
|
+
))], 2
|
|
100
|
+
/* CLASS */
|
|
101
|
+
)) : (_openBlock(), _createElementBlock("div", {
|
|
102
|
+
key: 1,
|
|
103
|
+
class: _normalizeClass(_ctx.n('values'))
|
|
104
|
+
}, _toDisplayString(_ctx.labels.join(_ctx.separator)), 3
|
|
105
|
+
/* TEXT, CLASS */
|
|
106
|
+
))])) : (_openBlock(), _createElementBlock("span", _hoisted_2, _toDisplayString(_ctx.label), 1
|
|
102
107
|
/* TEXT */
|
|
103
108
|
)), _createVNode(_component_var_icon, {
|
|
104
|
-
class: _normalizeClass(
|
|
109
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('arrow'), [_ctx.isFocus, _ctx.n('--arrow-rotate')])),
|
|
105
110
|
"var-select-cover": "",
|
|
106
111
|
name: "menu-down",
|
|
107
112
|
transition: 300
|
|
@@ -110,7 +115,7 @@ export function render(_ctx, _cache) {
|
|
|
110
115
|
, ["class"])], 6
|
|
111
116
|
/* CLASS, STYLE */
|
|
112
117
|
), _createElementVNode("label", {
|
|
113
|
-
class: _normalizeClass(
|
|
118
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('placeholder'), 'var--ellipsis', [_ctx.isFocus, _ctx.n('--focus')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], _ctx.computePlaceholderState(), [!_ctx.hint, _ctx.n('--placeholder-non-hint')])),
|
|
114
119
|
style: _normalizeStyle({
|
|
115
120
|
color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : undefined
|
|
116
121
|
})
|
|
@@ -124,28 +129,28 @@ export function render(_ctx, _cache) {
|
|
|
124
129
|
|
|
125
130
|
}, 8
|
|
126
131
|
/* PROPS */
|
|
127
|
-
, ["offset-y", "show", "onClose"]), _createElementVNode("div", {
|
|
128
|
-
class: _normalizeClass(
|
|
132
|
+
, ["class", "offset-y", "show", "onClose"]), _createElementVNode("div", {
|
|
133
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')]))
|
|
129
134
|
}, [_renderSlot(_ctx.$slots, "append-icon", {}, () => [_ctx.clearable ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
130
135
|
key: 0,
|
|
131
|
-
class:
|
|
136
|
+
class: _normalizeClass(_ctx.n('clear-icon')),
|
|
132
137
|
name: "close-circle",
|
|
133
138
|
size: "14px",
|
|
134
139
|
onClick: _ctx.handleClear
|
|
135
140
|
}, null, 8
|
|
136
141
|
/* PROPS */
|
|
137
|
-
, ["onClick"])) : _createCommentVNode("v-if", true)])], 2
|
|
142
|
+
, ["class", "onClick"])) : _createCommentVNode("v-if", true)])], 2
|
|
138
143
|
/* CLASS */
|
|
139
144
|
)], 6
|
|
140
145
|
/* CLASS, STYLE */
|
|
141
146
|
), _ctx.line ? (_openBlock(), _createElementBlock("div", {
|
|
142
147
|
key: 0,
|
|
143
|
-
class: _normalizeClass(
|
|
148
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('line'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')], [_ctx.errorMessage, _ctx.n('--line-error')])),
|
|
144
149
|
style: _normalizeStyle({
|
|
145
150
|
background: !_ctx.errorMessage ? _ctx.blurColor : undefined
|
|
146
151
|
})
|
|
147
152
|
}, [_createElementVNode("div", {
|
|
148
|
-
class: _normalizeClass(
|
|
153
|
+
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')])),
|
|
149
154
|
style: _normalizeStyle({
|
|
150
155
|
background: !_ctx.errorMessage ? _ctx.focusColor : undefined
|
|
151
156
|
})
|
|
@@ -269,11 +274,11 @@ export default defineComponent({
|
|
|
269
274
|
} = props;
|
|
270
275
|
|
|
271
276
|
if (!hint && !isEmpty(modelValue)) {
|
|
272
|
-
return '
|
|
277
|
+
return n('--placeholder-hidden');
|
|
273
278
|
}
|
|
274
279
|
|
|
275
280
|
if (hint && (!isEmpty(modelValue) || isFocus.value)) {
|
|
276
|
-
return '
|
|
281
|
+
return n('--placeholder-hint');
|
|
277
282
|
}
|
|
278
283
|
};
|
|
279
284
|
|
|
@@ -300,7 +305,7 @@ export default defineComponent({
|
|
|
300
305
|
wrapWidth.value = getWrapWidth();
|
|
301
306
|
offsetY.value = getOffsetY() + toPxNum(props.offsetY);
|
|
302
307
|
isFocus.value = true;
|
|
303
|
-
onFocus
|
|
308
|
+
call(onFocus);
|
|
304
309
|
validateWithTrigger('onFocus');
|
|
305
310
|
};
|
|
306
311
|
|
|
@@ -315,13 +320,11 @@ export default defineComponent({
|
|
|
315
320
|
return;
|
|
316
321
|
}
|
|
317
322
|
|
|
318
|
-
onBlur
|
|
323
|
+
call(onBlur);
|
|
319
324
|
validateWithTrigger('onBlur');
|
|
320
325
|
};
|
|
321
326
|
|
|
322
327
|
var onSelect = option => {
|
|
323
|
-
var _props$onUpdateModel;
|
|
324
|
-
|
|
325
328
|
var {
|
|
326
329
|
disabled,
|
|
327
330
|
readonly,
|
|
@@ -339,15 +342,13 @@ export default defineComponent({
|
|
|
339
342
|
} = _ref4;
|
|
340
343
|
return selected.value;
|
|
341
344
|
}).map(findValueOrLabel) : findValueOrLabel(option);
|
|
342
|
-
(
|
|
343
|
-
onChange
|
|
345
|
+
call(props['onUpdate:modelValue'], selectedValue);
|
|
346
|
+
call(onChange, selectedValue);
|
|
344
347
|
validateWithTrigger('onChange');
|
|
345
348
|
!multiple && (isFocus.value = false);
|
|
346
349
|
};
|
|
347
350
|
|
|
348
351
|
var handleClear = () => {
|
|
349
|
-
var _props$onUpdateModel2;
|
|
350
|
-
|
|
351
352
|
var {
|
|
352
353
|
disabled,
|
|
353
354
|
readonly,
|
|
@@ -361,8 +362,8 @@ export default defineComponent({
|
|
|
361
362
|
}
|
|
362
363
|
|
|
363
364
|
var changedModelValue = multiple ? [] : undefined;
|
|
364
|
-
(
|
|
365
|
-
onClear
|
|
365
|
+
call(props['onUpdate:modelValue'], changedModelValue);
|
|
366
|
+
call(onClear, changedModelValue);
|
|
366
367
|
validateWithTrigger('onClear');
|
|
367
368
|
};
|
|
368
369
|
|
|
@@ -376,13 +377,11 @@ export default defineComponent({
|
|
|
376
377
|
return;
|
|
377
378
|
}
|
|
378
379
|
|
|
379
|
-
onClick
|
|
380
|
+
call(onClick, e);
|
|
380
381
|
validateWithTrigger('onClick');
|
|
381
382
|
};
|
|
382
383
|
|
|
383
384
|
var handleClose = text => {
|
|
384
|
-
var _props$onUpdateModel3;
|
|
385
|
-
|
|
386
385
|
var {
|
|
387
386
|
disabled,
|
|
388
387
|
readonly,
|
|
@@ -406,8 +405,8 @@ export default defineComponent({
|
|
|
406
405
|
|
|
407
406
|
return value !== ((_value$value = option.value.value) != null ? _value$value : option.label.value);
|
|
408
407
|
});
|
|
409
|
-
(
|
|
410
|
-
onClose
|
|
408
|
+
call(props['onUpdate:modelValue'], currentModelValue);
|
|
409
|
+
call(onClose, currentModelValue);
|
|
411
410
|
validateWithTrigger('onClose');
|
|
412
411
|
};
|
|
413
412
|
|
|
@@ -444,9 +443,7 @@ export default defineComponent({
|
|
|
444
443
|
|
|
445
444
|
|
|
446
445
|
var reset = () => {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
(_props$onUpdateModel4 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel4.call(props, props.multiple ? [] : undefined);
|
|
446
|
+
call(props['onUpdate:modelValue'], props.multiple ? [] : undefined);
|
|
450
447
|
resetValidation();
|
|
451
448
|
};
|
|
452
449
|
|
|
@@ -474,7 +471,7 @@ export default defineComponent({
|
|
|
474
471
|
resetValidation
|
|
475
472
|
};
|
|
476
473
|
bindOptions(selectProvider);
|
|
477
|
-
bindForm
|
|
474
|
+
call(bindForm, selectProvider);
|
|
478
475
|
return {
|
|
479
476
|
wrapEl,
|
|
480
477
|
offsetY,
|
|
@@ -483,6 +480,8 @@ export default defineComponent({
|
|
|
483
480
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
484
481
|
label,
|
|
485
482
|
labels,
|
|
483
|
+
n,
|
|
484
|
+
classes,
|
|
486
485
|
computePlaceholderState,
|
|
487
486
|
handleFocus,
|
|
488
487
|
handleBlur,
|
package/es/skeleton/Skeleton.js
CHANGED
|
@@ -2,114 +2,101 @@ import { defineComponent } from 'vue';
|
|
|
2
2
|
import { props } from './props';
|
|
3
3
|
import { toSizeUnit } from '../utils/elements';
|
|
4
4
|
import { toNumber } from '../utils/shared';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
var _hoisted_2 = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "var-skeleton__data"
|
|
15
|
-
};
|
|
16
|
-
var _hoisted_3 = {
|
|
17
|
-
key: 1,
|
|
18
|
-
class: "var-skeleton__content"
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
var _hoisted_4 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
|
|
22
|
-
class: "var-skeleton--animation"
|
|
23
|
-
}, null, -1
|
|
24
|
-
/* HOISTED */
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
var _hoisted_5 = [_hoisted_4];
|
|
28
|
-
var _hoisted_6 = {
|
|
29
|
-
class: "var-skeleton__article"
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var _hoisted_7 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
|
|
33
|
-
class: "var-skeleton--animation"
|
|
34
|
-
}, null, -1
|
|
35
|
-
/* HOISTED */
|
|
36
|
-
));
|
|
37
|
-
|
|
38
|
-
var _hoisted_8 = [_hoisted_7];
|
|
39
|
-
var _hoisted_9 = {
|
|
40
|
-
class: "var-skeleton__section"
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
var _hoisted_10 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
|
|
44
|
-
class: "var-skeleton--animation"
|
|
45
|
-
}, null, -1
|
|
46
|
-
/* HOISTED */
|
|
47
|
-
));
|
|
48
|
-
|
|
49
|
-
var _hoisted_11 = [_hoisted_10];
|
|
50
|
-
|
|
51
|
-
var _hoisted_12 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
|
|
52
|
-
class: "var-skeleton--animation"
|
|
53
|
-
}, null, -1
|
|
54
|
-
/* HOISTED */
|
|
55
|
-
));
|
|
56
|
-
|
|
57
|
-
var _hoisted_13 = [_hoisted_12];
|
|
58
|
-
|
|
59
|
-
var _hoisted_14 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("div", {
|
|
60
|
-
class: "var-skeleton--animation"
|
|
61
|
-
}, null, -1
|
|
62
|
-
/* HOISTED */
|
|
63
|
-
));
|
|
64
|
-
|
|
65
|
-
var _hoisted_15 = [_hoisted_14];
|
|
5
|
+
import { createNamespace } from '../utils/components';
|
|
6
|
+
var {
|
|
7
|
+
n,
|
|
8
|
+
classes
|
|
9
|
+
} = createNamespace('skeleton');
|
|
10
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, renderList as _renderList, Fragment as _Fragment } from "vue";
|
|
66
11
|
export function render(_ctx, _cache) {
|
|
67
|
-
return _openBlock(), _createElementBlock("div",
|
|
12
|
+
return _openBlock(), _createElementBlock("div", {
|
|
13
|
+
class: _normalizeClass(_ctx.classes('var--box', _ctx.n()))
|
|
14
|
+
}, [!_ctx.loading ? (_openBlock(), _createElementBlock("div", {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: _normalizeClass(_ctx.n('data'))
|
|
17
|
+
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
18
|
+
/* CLASS */
|
|
19
|
+
)) : _createCommentVNode("v-if", true), _ctx.loading && !_ctx.fullscreen ? (_openBlock(), _createElementBlock("div", {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: _normalizeClass(_ctx.n('content'))
|
|
22
|
+
}, [_ctx.card ? (_openBlock(), _createElementBlock("div", {
|
|
68
23
|
key: 0,
|
|
69
|
-
class:
|
|
24
|
+
class: _normalizeClass(_ctx.n('card')),
|
|
70
25
|
style: _normalizeStyle({
|
|
71
26
|
height: _ctx.toSizeUnit(_ctx.cardHeight)
|
|
72
27
|
})
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
28
|
+
}, [_createElementVNode("div", {
|
|
29
|
+
class: _normalizeClass(_ctx.n('--animation'))
|
|
30
|
+
}, null, 2
|
|
31
|
+
/* CLASS */
|
|
32
|
+
)], 6
|
|
33
|
+
/* CLASS, STYLE */
|
|
34
|
+
)) : _createCommentVNode("v-if", true), _createElementVNode("div", {
|
|
35
|
+
class: _normalizeClass(_ctx.n('article'))
|
|
36
|
+
}, [_ctx.avatar ? (_openBlock(), _createElementBlock("div", {
|
|
76
37
|
key: 0,
|
|
77
|
-
class:
|
|
38
|
+
class: _normalizeClass(_ctx.n('avatar')),
|
|
78
39
|
style: _normalizeStyle({
|
|
79
40
|
width: _ctx.toSizeUnit(_ctx.avatarSize),
|
|
80
41
|
height: _ctx.toSizeUnit(_ctx.avatarSize)
|
|
81
42
|
})
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
|
|
43
|
+
}, [_createElementVNode("div", {
|
|
44
|
+
class: _normalizeClass(_ctx.n('--animation'))
|
|
45
|
+
}, null, 2
|
|
46
|
+
/* CLASS */
|
|
47
|
+
)], 6
|
|
48
|
+
/* CLASS, STYLE */
|
|
49
|
+
)) : _createCommentVNode("v-if", true), _createElementVNode("div", {
|
|
50
|
+
class: _normalizeClass(_ctx.n('section'))
|
|
51
|
+
}, [_ctx.title ? (_openBlock(), _createElementBlock("div", {
|
|
85
52
|
key: 0,
|
|
86
|
-
class:
|
|
53
|
+
class: _normalizeClass(_ctx.n('title')),
|
|
87
54
|
style: _normalizeStyle({
|
|
88
55
|
width: _ctx.toSizeUnit(_ctx.titleWidth)
|
|
89
56
|
})
|
|
90
|
-
},
|
|
91
|
-
|
|
57
|
+
}, [_createElementVNode("div", {
|
|
58
|
+
class: _normalizeClass(_ctx.n('--animation'))
|
|
59
|
+
}, null, 2
|
|
60
|
+
/* CLASS */
|
|
61
|
+
)], 6
|
|
62
|
+
/* CLASS, STYLE */
|
|
92
63
|
)) : _createCommentVNode("v-if", true), (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.toNumber(_ctx.rows), (r, index) => {
|
|
93
64
|
return _openBlock(), _createElementBlock("div", {
|
|
94
|
-
class:
|
|
65
|
+
class: _normalizeClass(_ctx.n('row')),
|
|
95
66
|
key: r,
|
|
96
67
|
style: _normalizeStyle({
|
|
97
68
|
width: _ctx.toSizeUnit(_ctx.rowsWidth[index])
|
|
98
69
|
})
|
|
99
|
-
},
|
|
100
|
-
|
|
70
|
+
}, [_createElementVNode("div", {
|
|
71
|
+
class: _normalizeClass(_ctx.n('--animation'))
|
|
72
|
+
}, null, 2
|
|
73
|
+
/* CLASS */
|
|
74
|
+
)], 6
|
|
75
|
+
/* CLASS, STYLE */
|
|
101
76
|
);
|
|
102
77
|
}), 128
|
|
103
78
|
/* KEYED_FRAGMENT */
|
|
104
|
-
))]
|
|
79
|
+
))], 2
|
|
80
|
+
/* CLASS */
|
|
81
|
+
)], 2
|
|
82
|
+
/* CLASS */
|
|
83
|
+
)], 2
|
|
84
|
+
/* CLASS */
|
|
85
|
+
)) : _createCommentVNode("v-if", true), _ctx.loading && _ctx.fullscreen ? (_openBlock(), _createElementBlock("div", {
|
|
105
86
|
key: 2,
|
|
106
|
-
class:
|
|
87
|
+
class: _normalizeClass(_ctx.n('fullscreen')),
|
|
107
88
|
style: _normalizeStyle({
|
|
108
89
|
zIndex: _ctx.toNumber(_ctx.fullscreenZIndex)
|
|
109
90
|
})
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
|
|
91
|
+
}, [_createElementVNode("div", {
|
|
92
|
+
class: _normalizeClass(_ctx.n('--animation'))
|
|
93
|
+
}, null, 2
|
|
94
|
+
/* CLASS */
|
|
95
|
+
)], 6
|
|
96
|
+
/* CLASS, STYLE */
|
|
97
|
+
)) : _createCommentVNode("v-if", true)], 2
|
|
98
|
+
/* CLASS */
|
|
99
|
+
);
|
|
113
100
|
}
|
|
114
101
|
export default defineComponent({
|
|
115
102
|
render,
|
|
@@ -118,6 +105,8 @@ export default defineComponent({
|
|
|
118
105
|
|
|
119
106
|
setup() {
|
|
120
107
|
return {
|
|
108
|
+
n,
|
|
109
|
+
classes,
|
|
121
110
|
toSizeUnit,
|
|
122
111
|
toNumber
|
|
123
112
|
};
|