@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/radio/Radio.js
CHANGED
|
@@ -3,16 +3,14 @@ import VarFormDetails from '../form-details';
|
|
|
3
3
|
import Ripple from '../ripple';
|
|
4
4
|
import { computed, defineComponent, nextTick, ref, watch } from 'vue';
|
|
5
5
|
import { props } from './props';
|
|
6
|
-
import { useValidation } from '../utils/components';
|
|
6
|
+
import { useValidation, createNamespace, call } from '../utils/components';
|
|
7
7
|
import { useRadioGroup } from './provide';
|
|
8
8
|
import { useForm } from '../form/provide';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class: "var-radio__wrap"
|
|
15
|
-
};
|
|
9
|
+
var {
|
|
10
|
+
n,
|
|
11
|
+
classes
|
|
12
|
+
} = createNamespace('radio');
|
|
13
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, createVNode as _createVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createElementVNode as _createElementVNode, mergeProps as _mergeProps } from "vue";
|
|
16
14
|
export function render(_ctx, _cache) {
|
|
17
15
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
18
16
|
|
|
@@ -20,20 +18,22 @@ export function render(_ctx, _cache) {
|
|
|
20
18
|
|
|
21
19
|
var _directive_ripple = _resolveDirective("ripple");
|
|
22
20
|
|
|
23
|
-
return _openBlock(), _createElementBlock("div",
|
|
24
|
-
class:
|
|
21
|
+
return _openBlock(), _createElementBlock("div", {
|
|
22
|
+
class: _normalizeClass(_ctx.n('wrap'))
|
|
23
|
+
}, [_createElementVNode("div", _mergeProps({
|
|
24
|
+
class: _ctx.n(),
|
|
25
25
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
26
26
|
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
27
27
|
})
|
|
28
28
|
}, _ctx.$attrs), [_withDirectives((_openBlock(), _createElementBlock("div", {
|
|
29
|
-
class: _normalizeClass(
|
|
29
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('action'), [_ctx.checked, _ctx.n('--checked'), _ctx.n('--unchecked')], [_ctx.errorMessage || _ctx.radioGroupErrorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
|
|
30
30
|
style: _normalizeStyle({
|
|
31
31
|
color: _ctx.checked ? _ctx.checkedColor : _ctx.uncheckedColor
|
|
32
32
|
})
|
|
33
33
|
}, [_ctx.checked ? _renderSlot(_ctx.$slots, "checked-icon", {
|
|
34
34
|
key: 0
|
|
35
35
|
}, () => [_createVNode(_component_var_icon, {
|
|
36
|
-
class: _normalizeClass(
|
|
36
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [_ctx.withAnimation, _ctx.n('--with-animation')])),
|
|
37
37
|
"var-radio-cover": "",
|
|
38
38
|
name: "radio-marked",
|
|
39
39
|
size: _ctx.iconSize
|
|
@@ -42,7 +42,7 @@ export function render(_ctx, _cache) {
|
|
|
42
42
|
, ["class", "size"])]) : _renderSlot(_ctx.$slots, "unchecked-icon", {
|
|
43
43
|
key: 1
|
|
44
44
|
}, () => [_createVNode(_component_var_icon, {
|
|
45
|
-
class: _normalizeClass(
|
|
45
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [_ctx.withAnimation, _ctx.n('--with-animation')])),
|
|
46
46
|
"var-radio-cover": "",
|
|
47
47
|
name: "radio-blank",
|
|
48
48
|
size: _ctx.iconSize
|
|
@@ -53,7 +53,7 @@ export function render(_ctx, _cache) {
|
|
|
53
53
|
)), [[_directive_ripple, {
|
|
54
54
|
disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple
|
|
55
55
|
}]]), _createElementVNode("div", {
|
|
56
|
-
class: _normalizeClass(
|
|
56
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('text'), [_ctx.errorMessage || _ctx.radioGroupErrorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')]))
|
|
57
57
|
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
58
58
|
/* CLASS */
|
|
59
59
|
)], 16
|
|
@@ -62,7 +62,9 @@ export function render(_ctx, _cache) {
|
|
|
62
62
|
"error-message": _ctx.errorMessage
|
|
63
63
|
}, null, 8
|
|
64
64
|
/* PROPS */
|
|
65
|
-
, ["error-message"])]
|
|
65
|
+
, ["error-message"])], 2
|
|
66
|
+
/* CLASS */
|
|
67
|
+
);
|
|
66
68
|
}
|
|
67
69
|
export default defineComponent({
|
|
68
70
|
render,
|
|
@@ -109,8 +111,6 @@ export default defineComponent({
|
|
|
109
111
|
};
|
|
110
112
|
|
|
111
113
|
var change = changedValue => {
|
|
112
|
-
var _props$onUpdateModel;
|
|
113
|
-
|
|
114
114
|
var {
|
|
115
115
|
checkedValue,
|
|
116
116
|
onChange
|
|
@@ -121,8 +121,8 @@ export default defineComponent({
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
value.value = changedValue;
|
|
124
|
-
(
|
|
125
|
-
onChange
|
|
124
|
+
call(props['onUpdate:modelValue'], value.value);
|
|
125
|
+
call(onChange, value.value);
|
|
126
126
|
radioGroup == null ? void 0 : radioGroup.onToggle(checkedValue);
|
|
127
127
|
validateWithTrigger('onChange');
|
|
128
128
|
};
|
|
@@ -140,7 +140,7 @@ export default defineComponent({
|
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
onClick
|
|
143
|
+
call(onClick, e);
|
|
144
144
|
|
|
145
145
|
if (form != null && form.readonly.value || readonly) {
|
|
146
146
|
return;
|
|
@@ -160,9 +160,7 @@ export default defineComponent({
|
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
var reset = () => {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
(_props$onUpdateModel2 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel2.call(props, props.uncheckedValue);
|
|
163
|
+
call(props['onUpdate:modelValue'], props.uncheckedValue);
|
|
166
164
|
resetValidation();
|
|
167
165
|
}; // expose
|
|
168
166
|
|
|
@@ -195,8 +193,8 @@ export default defineComponent({
|
|
|
195
193
|
resetValidation,
|
|
196
194
|
reset
|
|
197
195
|
};
|
|
198
|
-
bindRadioGroup
|
|
199
|
-
bindForm
|
|
196
|
+
call(bindRadioGroup, radioProvider);
|
|
197
|
+
call(bindForm, radioProvider);
|
|
200
198
|
return {
|
|
201
199
|
withAnimation,
|
|
202
200
|
checked,
|
|
@@ -204,6 +202,8 @@ export default defineComponent({
|
|
|
204
202
|
radioGroupErrorMessage: radioGroup == null ? void 0 : radioGroup.errorMessage,
|
|
205
203
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
206
204
|
formReadonly: form == null ? void 0 : form.readonly,
|
|
205
|
+
n,
|
|
206
|
+
classes,
|
|
207
207
|
handleClick,
|
|
208
208
|
toggle,
|
|
209
209
|
reset,
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import VarFormDetails from '../form-details';
|
|
2
2
|
import { computed, defineComponent, nextTick, watch } from 'vue';
|
|
3
3
|
import { props } from './props';
|
|
4
|
-
import { useValidation } from '../utils/components';
|
|
4
|
+
import { useValidation, createNamespace, call } from '../utils/components';
|
|
5
5
|
import { useRadios } from './provide';
|
|
6
6
|
import { useForm } from '../form/provide';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class: "var-radio-group__wrap"
|
|
13
|
-
};
|
|
7
|
+
var {
|
|
8
|
+
n,
|
|
9
|
+
classes
|
|
10
|
+
} = createNamespace('radio-group');
|
|
11
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
14
12
|
export function render(_ctx, _cache) {
|
|
15
13
|
var _component_var_form_details = _resolveComponent("var-form-details");
|
|
16
14
|
|
|
17
|
-
return _openBlock(), _createElementBlock("div",
|
|
18
|
-
class: _normalizeClass(
|
|
15
|
+
return _openBlock(), _createElementBlock("div", {
|
|
16
|
+
class: _normalizeClass(_ctx.n('wrap'))
|
|
17
|
+
}, [_createElementVNode("div", {
|
|
18
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("--" + _ctx.direction)))
|
|
19
19
|
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
20
20
|
/* CLASS */
|
|
21
21
|
), _createVNode(_component_var_form_details, {
|
|
22
22
|
"error-message": _ctx.errorMessage
|
|
23
23
|
}, null, 8
|
|
24
24
|
/* PROPS */
|
|
25
|
-
, ["error-message"])]
|
|
25
|
+
, ["error-message"])], 2
|
|
26
|
+
/* CLASS */
|
|
27
|
+
);
|
|
26
28
|
}
|
|
27
29
|
export default defineComponent({
|
|
28
30
|
render,
|
|
@@ -69,10 +71,8 @@ export default defineComponent({
|
|
|
69
71
|
});
|
|
70
72
|
|
|
71
73
|
var onToggle = changedValue => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(_props$onUpdateModel = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel.call(props, changedValue);
|
|
75
|
-
props.onChange == null ? void 0 : props.onChange(changedValue);
|
|
74
|
+
call(props['onUpdate:modelValue'], changedValue);
|
|
75
|
+
call(props.onChange, changedValue);
|
|
76
76
|
validateWithTrigger('onChange');
|
|
77
77
|
}; // expose
|
|
78
78
|
|
|
@@ -81,9 +81,7 @@ export default defineComponent({
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
var reset = () => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
(_props$onUpdateModel2 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel2.call(props, undefined);
|
|
84
|
+
call(props['onUpdate:modelValue'], undefined);
|
|
87
85
|
resetValidation();
|
|
88
86
|
};
|
|
89
87
|
|
|
@@ -96,10 +94,12 @@ export default defineComponent({
|
|
|
96
94
|
resetValidation,
|
|
97
95
|
errorMessage: radioGroupErrorMessage
|
|
98
96
|
};
|
|
99
|
-
bindForm
|
|
97
|
+
call(bindForm, radioGroupProvider);
|
|
100
98
|
bindRadios(radioGroupProvider);
|
|
101
99
|
return {
|
|
102
100
|
errorMessage,
|
|
101
|
+
n,
|
|
102
|
+
classes,
|
|
103
103
|
reset,
|
|
104
104
|
validate,
|
|
105
105
|
resetValidation
|
package/es/rate/Rate.js
CHANGED
|
@@ -3,21 +3,18 @@ import VarFormDetails from '../form-details';
|
|
|
3
3
|
import Ripple from '../ripple';
|
|
4
4
|
import { defineComponent, nextTick } from 'vue';
|
|
5
5
|
import { useForm } from '../form/provide';
|
|
6
|
-
import { useValidation } from '../utils/components';
|
|
6
|
+
import { useValidation, call, createNamespace } from '../utils/components';
|
|
7
7
|
import { toSizeUnit } from '../utils/elements';
|
|
8
8
|
import { toNumber } from '../utils/shared';
|
|
9
9
|
import { props } from './props';
|
|
10
|
+
var {
|
|
11
|
+
n
|
|
12
|
+
} = createNamespace('rate');
|
|
10
13
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, normalizeStyle as _normalizeStyle, createVNode as _createVNode, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
11
14
|
|
|
12
15
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
13
16
|
|
|
14
|
-
var _hoisted_1 =
|
|
15
|
-
class: "var-rate__warp"
|
|
16
|
-
};
|
|
17
|
-
var _hoisted_2 = {
|
|
18
|
-
class: "var-rate"
|
|
19
|
-
};
|
|
20
|
-
var _hoisted_3 = ["onClick"];
|
|
17
|
+
var _hoisted_1 = ["onClick"];
|
|
21
18
|
export function render(_ctx, _cache) {
|
|
22
19
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
23
20
|
|
|
@@ -25,7 +22,11 @@ export function render(_ctx, _cache) {
|
|
|
25
22
|
|
|
26
23
|
var _directive_ripple = _resolveDirective("ripple");
|
|
27
24
|
|
|
28
|
-
return _openBlock(), _createElementBlock("div",
|
|
25
|
+
return _openBlock(), _createElementBlock("div", {
|
|
26
|
+
class: _normalizeClass(_ctx.n('warp'))
|
|
27
|
+
}, [_createElementVNode("div", {
|
|
28
|
+
class: _normalizeClass(_ctx.n())
|
|
29
|
+
}, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.toNumber(_ctx.count), val => {
|
|
29
30
|
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
30
31
|
key: val,
|
|
31
32
|
style: _normalizeStyle(_ctx.getStyle(val)),
|
|
@@ -42,16 +43,20 @@ export function render(_ctx, _cache) {
|
|
|
42
43
|
/* PROPS */
|
|
43
44
|
, ["namespace", "name", "style"])], 14
|
|
44
45
|
/* CLASS, STYLE, PROPS */
|
|
45
|
-
,
|
|
46
|
+
, _hoisted_1)), [[_directive_ripple, {
|
|
46
47
|
disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple
|
|
47
48
|
}]]);
|
|
48
49
|
}), 128
|
|
49
50
|
/* KEYED_FRAGMENT */
|
|
50
|
-
))]
|
|
51
|
+
))], 2
|
|
52
|
+
/* CLASS */
|
|
53
|
+
), _createVNode(_component_var_form_details, {
|
|
51
54
|
"error-message": _ctx.errorMessage
|
|
52
55
|
}, null, 8
|
|
53
56
|
/* PROPS */
|
|
54
|
-
, ["error-message"])]
|
|
57
|
+
, ["error-message"])], 2
|
|
58
|
+
/* CLASS */
|
|
59
|
+
);
|
|
55
60
|
}
|
|
56
61
|
export default defineComponent({
|
|
57
62
|
render,
|
|
@@ -98,10 +103,10 @@ export default defineComponent({
|
|
|
98
103
|
color
|
|
99
104
|
} = transformValue(val);
|
|
100
105
|
return {
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
'
|
|
106
|
+
[n('content')]: true,
|
|
107
|
+
[n('--disabled')]: form == null ? void 0 : form.disabled.value,
|
|
108
|
+
[n('--error')]: errorMessage.value,
|
|
109
|
+
[n('--primary')]: type !== 'empty' && !color
|
|
105
110
|
};
|
|
106
111
|
};
|
|
107
112
|
|
|
@@ -153,8 +158,6 @@ export default defineComponent({
|
|
|
153
158
|
};
|
|
154
159
|
|
|
155
160
|
var changeValue = (score, event) => {
|
|
156
|
-
var _props$onUpdateModel;
|
|
157
|
-
|
|
158
161
|
if (props.half) {
|
|
159
162
|
var {
|
|
160
163
|
offsetWidth
|
|
@@ -162,7 +165,7 @@ export default defineComponent({
|
|
|
162
165
|
if (event.offsetX <= Math.floor(offsetWidth / 2)) score -= 0.5;
|
|
163
166
|
}
|
|
164
167
|
|
|
165
|
-
(
|
|
168
|
+
call(props['onUpdate:modelValue'], score);
|
|
166
169
|
};
|
|
167
170
|
|
|
168
171
|
var validate = () => v(props.rules, toNumber(props.modelValue));
|
|
@@ -181,14 +184,12 @@ export default defineComponent({
|
|
|
181
184
|
}
|
|
182
185
|
|
|
183
186
|
changeValue(score, event);
|
|
184
|
-
onChange
|
|
187
|
+
call(onChange, score);
|
|
185
188
|
validateWithTrigger();
|
|
186
189
|
};
|
|
187
190
|
|
|
188
191
|
var reset = () => {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
(_props$onUpdateModel2 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel2.call(props, 0);
|
|
192
|
+
call(props['onUpdate:modelValue'], 0);
|
|
192
193
|
resetValidation();
|
|
193
194
|
};
|
|
194
195
|
|
|
@@ -197,7 +198,7 @@ export default defineComponent({
|
|
|
197
198
|
validate,
|
|
198
199
|
resetValidation
|
|
199
200
|
};
|
|
200
|
-
bindForm
|
|
201
|
+
call(bindForm, rateProvider);
|
|
201
202
|
return {
|
|
202
203
|
errorMessage,
|
|
203
204
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
@@ -210,7 +211,8 @@ export default defineComponent({
|
|
|
210
211
|
validate,
|
|
211
212
|
resetValidation,
|
|
212
213
|
toSizeUnit,
|
|
213
|
-
toNumber
|
|
214
|
+
toNumber,
|
|
215
|
+
n
|
|
214
216
|
};
|
|
215
217
|
}
|
|
216
218
|
|
package/es/ripple/index.js
CHANGED
|
@@ -4,6 +4,10 @@ import context from '../context';
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
import { supportTouch } from '../utils/elements';
|
|
7
|
+
import { createNamespace } from '../utils/components';
|
|
8
|
+
var {
|
|
9
|
+
n
|
|
10
|
+
} = createNamespace('ripple');
|
|
7
11
|
var ANIMATION_DURATION = 250;
|
|
8
12
|
|
|
9
13
|
function setStyles(element) {
|
|
@@ -63,7 +67,7 @@ function createRipple(event) {
|
|
|
63
67
|
size
|
|
64
68
|
} = computeRippleStyles(this, event);
|
|
65
69
|
var ripple = document.createElement('div');
|
|
66
|
-
ripple.classList.add(
|
|
70
|
+
ripple.classList.add(n());
|
|
67
71
|
ripple.style.opacity = "0";
|
|
68
72
|
ripple.style.transform = "translate(" + x + "px, " + y + "px) scale3d(.3, .3, .3)";
|
|
69
73
|
ripple.style.width = size + "px";
|
|
@@ -85,7 +89,7 @@ function removeRipple() {
|
|
|
85
89
|
var _ripple = this._ripple;
|
|
86
90
|
|
|
87
91
|
var task = () => {
|
|
88
|
-
var ripples = this.querySelectorAll(
|
|
92
|
+
var ripples = this.querySelectorAll("." + n());
|
|
89
93
|
|
|
90
94
|
if (!ripples.length) {
|
|
91
95
|
return;
|
package/es/row/Row.js
CHANGED
|
@@ -2,10 +2,15 @@ import { defineComponent, computed, watch } from 'vue';
|
|
|
2
2
|
import { props } from './props';
|
|
3
3
|
import { useCols } from './provide';
|
|
4
4
|
import { toPxNum } from '../utils/elements';
|
|
5
|
-
import {
|
|
5
|
+
import { createNamespace } from '../utils/components';
|
|
6
|
+
var {
|
|
7
|
+
n,
|
|
8
|
+
classes
|
|
9
|
+
} = createNamespace('row');
|
|
10
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
6
11
|
export function render(_ctx, _cache) {
|
|
7
12
|
return _openBlock(), _createElementBlock("div", {
|
|
8
|
-
class:
|
|
13
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box')),
|
|
9
14
|
style: _normalizeStyle({
|
|
10
15
|
justifyContent: _ctx.justify,
|
|
11
16
|
alignItems: _ctx.align,
|
|
@@ -14,8 +19,8 @@ export function render(_ctx, _cache) {
|
|
|
14
19
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
15
20
|
return _ctx.onClick && _ctx.onClick(...arguments);
|
|
16
21
|
})
|
|
17
|
-
}, [_renderSlot(_ctx.$slots, "default")],
|
|
18
|
-
/* STYLE */
|
|
22
|
+
}, [_renderSlot(_ctx.$slots, "default")], 6
|
|
23
|
+
/* CLASS, STYLE */
|
|
19
24
|
);
|
|
20
25
|
}
|
|
21
26
|
export default defineComponent({
|
|
@@ -50,6 +55,8 @@ export default defineComponent({
|
|
|
50
55
|
watch(() => props.gutter, computePadding);
|
|
51
56
|
bindCols(rowProvider);
|
|
52
57
|
return {
|
|
58
|
+
n,
|
|
59
|
+
classes,
|
|
53
60
|
average
|
|
54
61
|
};
|
|
55
62
|
}
|