@varlet/ui 2.16.7 → 2.16.8-alpha.1695118057982
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.mjs +97 -67
- package/es/action-sheet/index.mjs +43 -28
- package/es/action-sheet/props.mjs +39 -8
- package/es/app-bar/AppBar.mjs +129 -56
- package/es/app-bar/index.mjs +10 -5
- package/es/app-bar/props.mjs +6 -3
- package/es/avatar/Avatar.mjs +97 -87
- package/es/avatar/index.mjs +10 -5
- package/es/avatar/props.mjs +8 -5
- package/es/avatar-group/AvatarGroup.mjs +26 -20
- package/es/avatar-group/index.mjs +10 -5
- package/es/avatar-group/props.mjs +5 -2
- package/es/back-top/BackTop.mjs +71 -53
- package/es/back-top/index.mjs +10 -5
- package/es/back-top/props.mjs +6 -3
- package/es/badge/Badge.mjs +74 -46
- package/es/badge/index.mjs +10 -5
- package/es/badge/props.mjs +7 -4
- package/es/bottom-navigation/BottomNavigation.mjs +100 -97
- package/es/bottom-navigation/index.mjs +10 -5
- package/es/bottom-navigation/props.mjs +7 -4
- package/es/bottom-navigation/provide.mjs +13 -9
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +93 -74
- package/es/bottom-navigation-item/index.mjs +10 -5
- package/es/bottom-navigation-item/props.mjs +7 -4
- package/es/bottom-navigation-item/provide.mjs +14 -11
- package/es/breadcrumb/Breadcrumb.mjs +51 -36
- package/es/breadcrumb/index.mjs +10 -5
- package/es/breadcrumb/props.mjs +6 -3
- package/es/breadcrumb/provide.mjs +12 -11
- package/es/breadcrumbs/Breadcrumbs.mjs +26 -24
- package/es/breadcrumbs/index.mjs +10 -5
- package/es/breadcrumbs/props.mjs +6 -3
- package/es/breadcrumbs/provide.mjs +11 -9
- package/es/button/Button.mjs +88 -90
- package/es/button/index.mjs +10 -5
- package/es/button/props.mjs +31 -10
- package/es/button/provide.mjs +8 -9
- package/es/button-group/ButtonGroup.mjs +38 -26
- package/es/button-group/index.mjs +8 -4
- package/es/button-group/props.mjs +8 -5
- package/es/button-group/provide.mjs +9 -9
- package/es/card/Card.mjs +292 -189
- package/es/card/index.mjs +10 -5
- package/es/card/props.mjs +9 -6
- package/es/cell/Cell.mjs +96 -52
- package/es/cell/index.mjs +10 -5
- package/es/cell/props.mjs +6 -3
- package/es/checkbox/Checkbox.mjs +136 -130
- package/es/checkbox/index.mjs +10 -5
- package/es/checkbox/props.mjs +9 -6
- package/es/checkbox/provide.mjs +10 -9
- package/es/checkbox-group/CheckboxGroup.mjs +63 -96
- package/es/checkbox-group/index.mjs +10 -5
- package/es/checkbox-group/props.mjs +9 -6
- package/es/checkbox-group/provide.mjs +11 -9
- package/es/chip/Chip.mjs +66 -50
- package/es/chip/index.mjs +10 -5
- package/es/chip/props.mjs +10 -7
- package/es/col/Col.mjs +60 -55
- package/es/col/index.mjs +10 -5
- package/es/col/props.mjs +7 -4
- package/es/col/provide.mjs +8 -9
- package/es/collapse/Collapse.mjs +70 -73
- package/es/collapse/index.mjs +10 -5
- package/es/collapse/props.mjs +7 -4
- package/es/collapse/provide.mjs +11 -9
- package/es/collapse-item/CollapseItem.mjs +156 -93
- package/es/collapse-item/index.mjs +10 -5
- package/es/collapse-item/props.mjs +6 -3
- package/es/collapse-item/provide.mjs +12 -11
- package/es/context/index.mjs +9 -5
- package/es/context/lock.mjs +18 -22
- package/es/context/zIndex.mjs +19 -16
- package/es/countdown/Countdown.mjs +73 -70
- package/es/countdown/index.mjs +10 -5
- package/es/countdown/props.mjs +7 -4
- package/es/counter/Counter.mjs +169 -173
- package/es/counter/index.mjs +10 -5
- package/es/counter/props.mjs +8 -5
- package/es/counter/provide.ts +3 -0
- package/es/date-picker/DatePicker.mjs +411 -304
- package/es/date-picker/index.mjs +10 -5
- package/es/date-picker/props.mjs +71 -45
- package/es/date-picker/src/day-picker-panel.mjs +270 -208
- package/es/date-picker/src/month-picker-panel.mjs +205 -175
- package/es/date-picker/src/panel-header.mjs +101 -83
- package/es/date-picker/src/year-picker-panel.mjs +64 -54
- package/es/dialog/Dialog.mjs +171 -106
- package/es/dialog/index.mjs +49 -33
- package/es/dialog/props.mjs +39 -9
- package/es/divider/Divider.mjs +56 -51
- package/es/divider/index.mjs +10 -5
- package/es/divider/props.mjs +5 -2
- package/es/drag/Drag.mjs +126 -144
- package/es/drag/index.mjs +10 -5
- package/es/drag/props.mjs +8 -5
- package/es/ellipsis/Ellipsis.mjs +81 -50
- package/es/ellipsis/index.mjs +8 -4
- package/es/ellipsis/props.mjs +5 -2
- package/es/fab/Fab.mjs +73 -75
- package/es/fab/index.mjs +8 -4
- package/es/fab/props.mjs +14 -11
- package/es/field-decorator/FieldDecorator.mjs +215 -110
- package/es/field-decorator/props.mjs +9 -6
- package/es/form/Form.mjs +69 -79
- package/es/form/index.mjs +11 -6
- package/es/form/props.mjs +6 -3
- package/es/form/provide.mjs +35 -22
- package/es/form-details/FormDetails.mjs +81 -39
- package/es/form-details/index.mjs +10 -5
- package/es/form-details/props.mjs +7 -4
- package/es/hover/index.mjs +37 -40
- package/es/hover-overlay/HoverOverlay.mjs +18 -14
- package/es/hover-overlay/index.mjs +13 -8
- package/es/hover-overlay/props.mjs +5 -2
- package/es/icon/Icon.mjs +50 -33
- package/es/icon/index.mjs +10 -5
- package/es/icon/props.mjs +7 -4
- package/es/image/Image.mjs +76 -82
- package/es/image/index.mjs +10 -5
- package/es/image/props.mjs +7 -4
- package/es/image-preview/ImagePreview.mjs +176 -193
- package/es/image-preview/index.mjs +44 -30
- package/es/image-preview/props.mjs +34 -9
- package/es/index-anchor/IndexAnchor.mjs +45 -42
- package/es/index-anchor/index.mjs +10 -5
- package/es/index-anchor/props.mjs +5 -2
- package/es/index-anchor/provide.mjs +12 -11
- package/es/index-bar/IndexBar.mjs +130 -131
- package/es/index-bar/index.mjs +10 -5
- package/es/index-bar/props.mjs +6 -3
- package/es/index-bar/provide.mjs +11 -9
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +231 -247
- package/es/input/index.mjs +10 -5
- package/es/input/props.mjs +38 -8
- package/es/input/provide.ts +3 -0
- package/es/lazy/index.mjs +94 -87
- package/es/link/Link.mjs +39 -45
- package/es/link/index.mjs +10 -5
- package/es/link/props.mjs +8 -5
- package/es/list/List.mjs +144 -97
- package/es/list/index.mjs +10 -5
- package/es/list/props.mjs +8 -5
- package/es/list/provide.mjs +8 -9
- package/es/loading/Loading.mjs +165 -72
- package/es/loading/index.mjs +10 -5
- package/es/loading/props.mjs +7 -4
- package/es/loading-bar/LoadingBar.mjs +19 -16
- package/es/loading-bar/index.mjs +37 -30
- package/es/loading-bar/props.mjs +5 -2
- package/es/locale/en-US.mjs +76 -73
- package/es/locale/index.mjs +52 -41
- package/es/locale/zh-CN.mjs +76 -73
- package/es/menu/Menu.mjs +76 -57
- package/es/menu/index.mjs +10 -5
- package/es/menu/props.mjs +11 -8
- package/es/menu/usePopover.mjs +214 -207
- package/es/option/Option.mjs +86 -70
- package/es/option/index.mjs +10 -5
- package/es/option/props.mjs +5 -2
- package/es/option/provide.mjs +10 -11
- package/es/overlay/Overlay.mjs +29 -31
- package/es/overlay/index.mjs +10 -5
- package/es/overlay/props.mjs +7 -4
- package/es/pagination/Pagination.mjs +334 -202
- package/es/pagination/index.mjs +10 -5
- package/es/pagination/props.mjs +8 -5
- package/es/paper/Paper.mjs +43 -31
- package/es/paper/index.mjs +10 -5
- package/es/paper/props.mjs +6 -3
- package/es/picker/Picker.mjs +288 -224
- package/es/picker/index.mjs +24 -23
- package/es/picker/props.mjs +37 -7
- package/es/popup/Popup.mjs +68 -58
- package/es/popup/index.mjs +10 -5
- package/es/popup/props.mjs +9 -6
- package/es/popup/provide.mjs +12 -15
- package/es/progress/Progress.mjs +186 -114
- package/es/progress/index.mjs +10 -5
- package/es/progress/props.mjs +7 -4
- package/es/pull-refresh/PullRefresh.mjs +136 -116
- package/es/pull-refresh/index.mjs +10 -5
- package/es/pull-refresh/props.mjs +8 -5
- package/es/radio/Radio.mjs +122 -118
- package/es/radio/index.mjs +10 -5
- package/es/radio/props.mjs +8 -5
- package/es/radio/provide.mjs +8 -9
- package/es/radio-group/RadioGroup.mjs +50 -58
- package/es/radio-group/index.mjs +10 -5
- package/es/radio-group/props.mjs +10 -7
- package/es/radio-group/provide.mjs +11 -9
- package/es/rate/Rate.mjs +103 -132
- package/es/rate/index.mjs +10 -5
- package/es/rate/props.mjs +10 -7
- package/es/rate/provide.ts +3 -0
- package/es/result/Empty.mjs +21 -12
- package/es/result/Error.mjs +18 -9
- package/es/result/Info.mjs +18 -9
- package/es/result/Question.mjs +18 -9
- package/es/result/Result.mjs +102 -55
- package/es/result/Success.mjs +84 -40
- package/es/result/Warning.mjs +18 -9
- package/es/result/index.mjs +10 -5
- package/es/result/props.mjs +6 -3
- package/es/ripple/index.mjs +89 -101
- package/es/row/Row.mjs +40 -45
- package/es/row/index.mjs +10 -5
- package/es/row/props.mjs +8 -5
- package/es/row/provide.mjs +9 -9
- package/es/select/Select.mjs +308 -298
- package/es/select/index.mjs +10 -5
- package/es/select/props.mjs +40 -10
- package/es/select/provide.mjs +9 -9
- package/es/skeleton/Skeleton.mjs +182 -71
- package/es/skeleton/index.mjs +10 -5
- package/es/skeleton/props.mjs +5 -2
- package/es/slider/Slider.mjs +310 -260
- package/es/slider/index.mjs +10 -5
- package/es/slider/props.mjs +15 -11
- package/es/slider/provide.ts +3 -0
- package/es/snackbar/Snackbar.mjs +47 -34
- package/es/snackbar/core.mjs +140 -77
- package/es/snackbar/index.mjs +111 -97
- package/es/snackbar/props.mjs +35 -14
- package/es/space/Space.mjs +30 -28
- package/es/space/index.mjs +10 -5
- package/es/space/margin.mjs +22 -23
- package/es/space/props.mjs +8 -5
- package/es/step/Step.mjs +96 -74
- package/es/step/index.mjs +10 -5
- package/es/step/props.mjs +6 -3
- package/es/step/provide.mjs +10 -11
- package/es/steps/Steps.mjs +31 -30
- package/es/steps/index.mjs +10 -5
- package/es/steps/props.mjs +7 -4
- package/es/steps/provide.mjs +9 -8
- package/es/sticky/Sticky.mjs +104 -92
- package/es/sticky/index.mjs +10 -5
- package/es/sticky/props.mjs +6 -3
- package/es/style-provider/StyleProvider.mjs +19 -18
- package/es/style-provider/index.mjs +15 -11
- package/es/style-provider/props.mjs +6 -3
- package/es/swipe/Swipe.mjs +281 -268
- package/es/swipe/index.mjs +10 -5
- package/es/swipe/props.mjs +6 -3
- package/es/swipe/provide.mjs +11 -9
- package/es/swipe-item/SwipeItem.mjs +29 -29
- package/es/swipe-item/index.mjs +8 -4
- package/es/swipe-item/provide.mjs +10 -11
- package/es/switch/Switch.mjs +143 -103
- package/es/switch/index.mjs +10 -5
- package/es/switch/props.mjs +7 -4
- package/es/switch/provide.ts +3 -0
- package/es/tab/Tab.mjs +48 -61
- package/es/tab/index.mjs +10 -5
- package/es/tab/props.mjs +6 -3
- package/es/tab/provide.mjs +10 -11
- package/es/tab-item/TabItem.mjs +27 -32
- package/es/tab-item/index.mjs +10 -5
- package/es/tab-item/props.mjs +5 -2
- package/es/tab-item/provide.mjs +17 -18
- package/es/table/Table.mjs +54 -25
- package/es/table/index.mjs +10 -5
- package/es/table/props.mjs +6 -3
- package/es/tabs/Tabs.mjs +162 -134
- package/es/tabs/index.mjs +10 -5
- package/es/tabs/props.mjs +15 -12
- package/es/tabs/provide.mjs +9 -9
- package/es/tabs-items/TabsItems.mjs +61 -65
- package/es/tabs-items/index.mjs +10 -5
- package/es/tabs-items/props.mjs +7 -4
- package/es/tabs-items/provide.mjs +11 -9
- package/es/themes/dark/actionSheet.mjs +8 -5
- package/es/themes/dark/appBar.mjs +6 -3
- package/es/themes/dark/avatar.mjs +7 -4
- package/es/themes/dark/badge.mjs +6 -3
- package/es/themes/dark/bottomNavigation.mjs +7 -4
- package/es/themes/dark/bottomNavigationItem.mjs +6 -3
- package/es/themes/dark/breadcrumb.mjs +6 -3
- package/es/themes/dark/button.mjs +7 -4
- package/es/themes/dark/card.mjs +10 -7
- package/es/themes/dark/cell.mjs +7 -4
- package/es/themes/dark/checkbox.mjs +7 -4
- package/es/themes/dark/chip.mjs +7 -4
- package/es/themes/dark/collapse.mjs +8 -5
- package/es/themes/dark/countdown.mjs +6 -3
- package/es/themes/dark/datePicker.mjs +10 -7
- package/es/themes/dark/dialog.mjs +8 -5
- package/es/themes/dark/divider.mjs +7 -4
- package/es/themes/dark/fieldDecorator.mjs +7 -4
- package/es/themes/dark/index.mjs +69 -51
- package/es/themes/dark/link.mjs +6 -3
- package/es/themes/dark/menu.mjs +6 -3
- package/es/themes/dark/option.mjs +6 -3
- package/es/themes/dark/pagination.mjs +11 -8
- package/es/themes/dark/paper.mjs +6 -3
- package/es/themes/dark/picker.mjs +11 -8
- package/es/themes/dark/popup.mjs +6 -3
- package/es/themes/dark/progress.mjs +6 -3
- package/es/themes/dark/pullRefresh.mjs +6 -3
- package/es/themes/dark/radio.mjs +7 -4
- package/es/themes/dark/result.mjs +12 -9
- package/es/themes/dark/select.mjs +6 -3
- package/es/themes/dark/skeleton.mjs +11 -6
- package/es/themes/dark/steps.mjs +8 -5
- package/es/themes/dark/switch.mjs +7 -4
- package/es/themes/dark/tab.mjs +6 -3
- package/es/themes/dark/table.mjs +12 -9
- package/es/themes/dark/tabs.mjs +6 -3
- package/es/themes/dark/timePicker.mjs +9 -6
- package/es/themes/dark/uploader.mjs +10 -7
- package/es/themes/dark/watermark.mjs +6 -3
- package/es/themes/index.mjs +7 -5
- package/es/time-picker/TimePicker.mjs +297 -232
- package/es/time-picker/clock.mjs +222 -172
- package/es/time-picker/index.mjs +10 -5
- package/es/time-picker/props.mjs +14 -8
- package/es/time-picker/utils.mjs +46 -86
- package/es/tooltip/Tooltip.mjs +82 -62
- package/es/tooltip/index.mjs +10 -5
- package/es/tooltip/props.mjs +12 -9
- package/es/uploader/Uploader.mjs +315 -308
- package/es/uploader/index.mjs +10 -5
- package/es/uploader/props.mjs +10 -7
- package/es/uploader/provide.ts +3 -0
- package/es/utils/components.mjs +158 -127
- package/es/utils/elements.mjs +106 -123
- package/es/utils/logger.mjs +9 -5
- package/es/utils/shared.mjs +25 -23
- package/es/utils/test.mjs +105 -93
- package/es/varlet.esm.js +12464 -13425
- package/es/watermark/Watermark.mjs +191 -109
- package/es/watermark/index.mjs +8 -4
- package/es/watermark/props.mjs +8 -5
- package/highlight/web-types.en-US.json +3 -3
- package/highlight/web-types.zh-CN.json +2 -2
- package/lib/varlet.cjs.js +9187 -10199
- package/package.json +7 -7
- package/umd/varlet.js +4 -4
- package/es/counter/provide.mjs +0 -1
- package/es/input/provide.mjs +0 -1
- package/es/rate/provide.mjs +0 -1
- package/es/slider/provide.mjs +0 -1
- package/es/switch/provide.mjs +0 -1
- package/es/uploader/provide.mjs +0 -1
package/es/radio/Radio.mjs
CHANGED
|
@@ -1,68 +1,103 @@
|
|
|
1
|
-
import VarIcon from
|
|
2
|
-
import VarFormDetails from
|
|
3
|
-
import Ripple from
|
|
4
|
-
import Hover from
|
|
5
|
-
import VarHoverOverlay, { useHoverOverlay } from
|
|
6
|
-
import { computed, defineComponent, nextTick, ref } from
|
|
7
|
-
import { props } from
|
|
8
|
-
import { useValidation, createNamespace, call, useVModel } from
|
|
9
|
-
import { useRadioGroup } from
|
|
10
|
-
import { useForm } from
|
|
11
|
-
|
|
12
|
-
name,
|
|
13
|
-
n,
|
|
14
|
-
classes
|
|
15
|
-
} = createNamespace('radio');
|
|
1
|
+
import VarIcon from "../icon/index.mjs";
|
|
2
|
+
import VarFormDetails from "../form-details/index.mjs";
|
|
3
|
+
import Ripple from "../ripple/index.mjs";
|
|
4
|
+
import Hover from "../hover/index.mjs";
|
|
5
|
+
import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
|
|
6
|
+
import { computed, defineComponent, nextTick, ref } from "vue";
|
|
7
|
+
import { props } from "./props.mjs";
|
|
8
|
+
import { useValidation, createNamespace, call, useVModel } from "../utils/components.mjs";
|
|
9
|
+
import { useRadioGroup } from "./provide.mjs";
|
|
10
|
+
import { useForm } from "../form/provide.mjs";
|
|
11
|
+
const { name, n, classes } = createNamespace("radio");
|
|
16
12
|
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";
|
|
17
13
|
function __render__(_ctx, _cache) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return _openBlock(), _createElementBlock(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
14
|
+
const _component_var_icon = _resolveComponent("var-icon");
|
|
15
|
+
const _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
|
|
16
|
+
const _component_var_form_details = _resolveComponent("var-form-details");
|
|
17
|
+
const _directive_ripple = _resolveDirective("ripple");
|
|
18
|
+
const _directive_hover = _resolveDirective("hover");
|
|
19
|
+
return _openBlock(), _createElementBlock(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
class: _normalizeClass(_ctx.n("wrap"))
|
|
23
|
+
},
|
|
24
|
+
[
|
|
25
|
+
_createElementVNode(
|
|
26
|
+
"div",
|
|
27
|
+
_mergeProps({
|
|
28
|
+
class: _ctx.n(),
|
|
29
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
30
|
+
}, _ctx.$attrs),
|
|
31
|
+
[
|
|
32
|
+
_withDirectives((_openBlock(), _createElementBlock(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
class: _normalizeClass(
|
|
36
|
+
_ctx.classes(
|
|
37
|
+
_ctx.n("action"),
|
|
38
|
+
[_ctx.checked, _ctx.n("--checked"), _ctx.n("--unchecked")],
|
|
39
|
+
[_ctx.errorMessage || _ctx.radioGroupErrorMessage, _ctx.n("--error")],
|
|
40
|
+
[_ctx.formDisabled || _ctx.disabled, _ctx.n("--disabled")]
|
|
41
|
+
)
|
|
42
|
+
),
|
|
43
|
+
style: _normalizeStyle({ color: _ctx.checked ? _ctx.checkedColor : _ctx.uncheckedColor })
|
|
44
|
+
},
|
|
45
|
+
[
|
|
46
|
+
_ctx.checked ? _renderSlot(_ctx.$slots, "checked-icon", { key: 0 }, () => [
|
|
47
|
+
_createVNode(_component_var_icon, {
|
|
48
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("icon"), [_ctx.withAnimation, _ctx.n("--with-animation")])),
|
|
49
|
+
"var-radio-cover": "",
|
|
50
|
+
name: "radio-marked",
|
|
51
|
+
size: _ctx.iconSize
|
|
52
|
+
}, null, 8, ["class", "size"])
|
|
53
|
+
]) : _renderSlot(_ctx.$slots, "unchecked-icon", { key: 1 }, () => [
|
|
54
|
+
_createVNode(_component_var_icon, {
|
|
55
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("icon"), [_ctx.withAnimation, _ctx.n("--with-animation")])),
|
|
56
|
+
"var-radio-cover": "",
|
|
57
|
+
name: "radio-blank",
|
|
58
|
+
size: _ctx.iconSize
|
|
59
|
+
}, null, 8, ["class", "size"])
|
|
60
|
+
]),
|
|
61
|
+
_createVNode(_component_var_hover_overlay, {
|
|
62
|
+
hovering: !_ctx.disabled && !_ctx.formDisabled && _ctx.hovering
|
|
63
|
+
}, null, 8, ["hovering"])
|
|
64
|
+
],
|
|
65
|
+
6
|
|
66
|
+
/* CLASS, STYLE */
|
|
67
|
+
)), [
|
|
68
|
+
[_directive_ripple, { disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple }],
|
|
69
|
+
[_directive_hover, _ctx.handleHovering, "desktop"]
|
|
70
|
+
]),
|
|
71
|
+
_createElementVNode(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
class: _normalizeClass(
|
|
75
|
+
_ctx.classes(
|
|
76
|
+
_ctx.n("text"),
|
|
77
|
+
[_ctx.errorMessage || _ctx.radioGroupErrorMessage, _ctx.n("--error")],
|
|
78
|
+
[_ctx.formDisabled || _ctx.disabled, _ctx.n("--disabled")]
|
|
79
|
+
)
|
|
80
|
+
)
|
|
81
|
+
},
|
|
82
|
+
[
|
|
83
|
+
_renderSlot(_ctx.$slots, "default")
|
|
84
|
+
],
|
|
85
|
+
2
|
|
86
|
+
/* CLASS */
|
|
87
|
+
)
|
|
88
|
+
],
|
|
89
|
+
16
|
|
90
|
+
/* FULL_PROPS */
|
|
91
|
+
),
|
|
92
|
+
_createVNode(_component_var_form_details, { "error-message": _ctx.errorMessage }, null, 8, ["error-message"])
|
|
93
|
+
],
|
|
94
|
+
2
|
|
95
|
+
/* CLASS */
|
|
96
|
+
);
|
|
58
97
|
}
|
|
59
|
-
|
|
60
|
-
var __sfc__ = defineComponent({
|
|
98
|
+
const __sfc__ = defineComponent({
|
|
61
99
|
name,
|
|
62
|
-
directives: {
|
|
63
|
-
Ripple,
|
|
64
|
-
Hover
|
|
65
|
-
},
|
|
100
|
+
directives: { Ripple, Hover },
|
|
66
101
|
components: {
|
|
67
102
|
VarIcon,
|
|
68
103
|
VarFormDetails,
|
|
@@ -70,30 +105,21 @@ var __sfc__ = defineComponent({
|
|
|
70
105
|
},
|
|
71
106
|
inheritAttrs: false,
|
|
72
107
|
props,
|
|
73
|
-
setup(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
var {
|
|
82
|
-
hovering,
|
|
83
|
-
handleHovering
|
|
84
|
-
} = useHoverOverlay();
|
|
85
|
-
var {
|
|
86
|
-
form,
|
|
87
|
-
bindForm
|
|
88
|
-
} = useForm();
|
|
89
|
-
var {
|
|
108
|
+
setup(props2) {
|
|
109
|
+
const value = useVModel(props2, "modelValue");
|
|
110
|
+
const checked = computed(() => value.value === props2.checkedValue);
|
|
111
|
+
const withAnimation = ref(false);
|
|
112
|
+
const { radioGroup, bindRadioGroup } = useRadioGroup();
|
|
113
|
+
const { hovering, handleHovering } = useHoverOverlay();
|
|
114
|
+
const { form, bindForm } = useForm();
|
|
115
|
+
const {
|
|
90
116
|
errorMessage,
|
|
91
117
|
validateWithTrigger: vt,
|
|
92
118
|
validate: v,
|
|
93
119
|
// expose
|
|
94
120
|
resetValidation
|
|
95
121
|
} = useValidation();
|
|
96
|
-
|
|
122
|
+
const radioProvider = {
|
|
97
123
|
sync,
|
|
98
124
|
validate,
|
|
99
125
|
resetValidation,
|
|
@@ -103,71 +129,46 @@ var __sfc__ = defineComponent({
|
|
|
103
129
|
call(bindForm, radioProvider);
|
|
104
130
|
function validateWithTrigger(trigger) {
|
|
105
131
|
nextTick(() => {
|
|
106
|
-
|
|
107
|
-
validateTrigger,
|
|
108
|
-
rules,
|
|
109
|
-
modelValue
|
|
110
|
-
} = props;
|
|
132
|
+
const { validateTrigger, rules, modelValue } = props2;
|
|
111
133
|
vt(validateTrigger, trigger, rules, modelValue);
|
|
112
134
|
});
|
|
113
135
|
}
|
|
114
136
|
function change(changedValue) {
|
|
115
|
-
|
|
116
|
-
checkedValue,
|
|
117
|
-
onChange
|
|
118
|
-
} = props;
|
|
137
|
+
const { checkedValue, onChange } = props2;
|
|
119
138
|
if (radioGroup && value.value === checkedValue) {
|
|
120
139
|
return;
|
|
121
140
|
}
|
|
122
141
|
value.value = changedValue;
|
|
123
142
|
call(onChange, value.value);
|
|
124
143
|
radioGroup == null ? void 0 : radioGroup.onToggle(checkedValue);
|
|
125
|
-
validateWithTrigger(
|
|
144
|
+
validateWithTrigger("onChange");
|
|
126
145
|
}
|
|
127
146
|
function handleClick(e) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
readonly,
|
|
131
|
-
uncheckedValue,
|
|
132
|
-
checkedValue,
|
|
133
|
-
onClick
|
|
134
|
-
} = props;
|
|
135
|
-
if (form != null && form.disabled.value || disabled) {
|
|
147
|
+
const { disabled, readonly, uncheckedValue, checkedValue, onClick } = props2;
|
|
148
|
+
if ((form == null ? void 0 : form.disabled.value) || disabled) {
|
|
136
149
|
return;
|
|
137
150
|
}
|
|
138
151
|
call(onClick, e);
|
|
139
|
-
if (form
|
|
152
|
+
if ((form == null ? void 0 : form.readonly.value) || readonly) {
|
|
140
153
|
return;
|
|
141
154
|
}
|
|
142
155
|
withAnimation.value = true;
|
|
143
156
|
change(checked.value ? uncheckedValue : checkedValue);
|
|
144
157
|
}
|
|
145
|
-
function sync(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
uncheckedValue
|
|
149
|
-
} = props;
|
|
150
|
-
value.value = v === checkedValue ? checkedValue : uncheckedValue;
|
|
158
|
+
function sync(v2) {
|
|
159
|
+
const { checkedValue, uncheckedValue } = props2;
|
|
160
|
+
value.value = v2 === checkedValue ? checkedValue : uncheckedValue;
|
|
151
161
|
}
|
|
152
|
-
|
|
153
|
-
// expose
|
|
154
162
|
function reset() {
|
|
155
|
-
value.value =
|
|
163
|
+
value.value = props2.uncheckedValue;
|
|
156
164
|
resetValidation();
|
|
157
165
|
}
|
|
158
|
-
|
|
159
|
-
// expose
|
|
160
166
|
function validate() {
|
|
161
|
-
return v(
|
|
167
|
+
return v(props2.rules, props2.modelValue);
|
|
162
168
|
}
|
|
163
|
-
|
|
164
|
-
// expose
|
|
165
169
|
function toggle(changedValue) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
checkedValue
|
|
169
|
-
} = props;
|
|
170
|
-
var shouldReverse = ![uncheckedValue, checkedValue].includes(changedValue);
|
|
170
|
+
const { uncheckedValue, checkedValue } = props2;
|
|
171
|
+
const shouldReverse = ![uncheckedValue, checkedValue].includes(changedValue);
|
|
171
172
|
if (shouldReverse) {
|
|
172
173
|
changedValue = checked.value ? uncheckedValue : checkedValue;
|
|
173
174
|
}
|
|
@@ -193,4 +194,7 @@ var __sfc__ = defineComponent({
|
|
|
193
194
|
}
|
|
194
195
|
});
|
|
195
196
|
__sfc__.render = __render__;
|
|
196
|
-
|
|
197
|
+
var stdin_default = __sfc__;
|
|
198
|
+
export {
|
|
199
|
+
stdin_default as default
|
|
200
|
+
};
|
package/es/radio/index.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import Radio from
|
|
2
|
-
import { withInstall } from
|
|
1
|
+
import Radio from "./Radio.mjs";
|
|
2
|
+
import { withInstall } from "../utils/components.mjs";
|
|
3
3
|
withInstall(Radio);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { props } from "./props.mjs";
|
|
5
|
+
const _RadioComponent = Radio;
|
|
6
|
+
var stdin_default = Radio;
|
|
7
|
+
export {
|
|
8
|
+
_RadioComponent,
|
|
9
|
+
stdin_default as default,
|
|
10
|
+
props as radioProps
|
|
11
|
+
};
|
package/es/radio/props.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineListenerProp } from
|
|
2
|
-
|
|
1
|
+
import { defineListenerProp } from "../utils/components.mjs";
|
|
2
|
+
const props = {
|
|
3
3
|
modelValue: {
|
|
4
4
|
type: [String, Number, Boolean, Object, Array],
|
|
5
5
|
default: false
|
|
@@ -23,10 +23,13 @@ export var props = {
|
|
|
23
23
|
},
|
|
24
24
|
validateTrigger: {
|
|
25
25
|
type: Array,
|
|
26
|
-
default: () => [
|
|
26
|
+
default: () => ["onChange"]
|
|
27
27
|
},
|
|
28
28
|
rules: Array,
|
|
29
29
|
onClick: defineListenerProp(),
|
|
30
30
|
onChange: defineListenerProp(),
|
|
31
|
-
|
|
32
|
-
};
|
|
31
|
+
"onUpdate:modelValue": defineListenerProp()
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
props
|
|
35
|
+
};
|
package/es/radio/provide.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { useParent } from
|
|
2
|
-
import { RADIO_GROUP_BIND_RADIO_KEY } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
bindParent,
|
|
6
|
-
parentProvider,
|
|
7
|
-
index
|
|
8
|
-
} = useParent(RADIO_GROUP_BIND_RADIO_KEY);
|
|
1
|
+
import { useParent } from "@varlet/use";
|
|
2
|
+
import { RADIO_GROUP_BIND_RADIO_KEY } from "../radio-group/provide.mjs";
|
|
3
|
+
function useRadioGroup() {
|
|
4
|
+
const { bindParent, parentProvider, index } = useParent(RADIO_GROUP_BIND_RADIO_KEY);
|
|
9
5
|
return {
|
|
10
6
|
index,
|
|
11
7
|
radioGroup: parentProvider,
|
|
12
8
|
bindRadioGroup: bindParent
|
|
13
9
|
};
|
|
14
|
-
}
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
useRadioGroup
|
|
13
|
+
};
|
|
@@ -1,92 +1,81 @@
|
|
|
1
|
-
import VarFormDetails from
|
|
2
|
-
import { computed, defineComponent, nextTick, watch } from
|
|
3
|
-
import { props } from
|
|
4
|
-
import { useValidation, createNamespace, call } from
|
|
5
|
-
import { useRadios } from
|
|
6
|
-
import { useForm } from
|
|
7
|
-
|
|
8
|
-
name,
|
|
9
|
-
n,
|
|
10
|
-
classes
|
|
11
|
-
} = createNamespace('radio-group');
|
|
1
|
+
import VarFormDetails from "../form-details/index.mjs";
|
|
2
|
+
import { computed, defineComponent, nextTick, watch } from "vue";
|
|
3
|
+
import { props } from "./props.mjs";
|
|
4
|
+
import { useValidation, createNamespace, call } from "../utils/components.mjs";
|
|
5
|
+
import { useRadios } from "./provide.mjs";
|
|
6
|
+
import { useForm } from "../form/provide.mjs";
|
|
7
|
+
const { name, n, classes } = createNamespace("radio-group");
|
|
12
8
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
9
|
function __render__(_ctx, _cache) {
|
|
14
|
-
|
|
15
|
-
return _openBlock(), _createElementBlock(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
const _component_var_form_details = _resolveComponent("var-form-details");
|
|
11
|
+
return _openBlock(), _createElementBlock(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
class: _normalizeClass(_ctx.n("wrap"))
|
|
15
|
+
},
|
|
16
|
+
[
|
|
17
|
+
_createElementVNode(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n(`--${_ctx.direction}`)))
|
|
21
|
+
},
|
|
22
|
+
[
|
|
23
|
+
_renderSlot(_ctx.$slots, "default")
|
|
24
|
+
],
|
|
25
|
+
2
|
|
26
|
+
/* CLASS */
|
|
27
|
+
),
|
|
28
|
+
_createVNode(_component_var_form_details, { "error-message": _ctx.errorMessage }, null, 8, ["error-message"])
|
|
29
|
+
],
|
|
30
|
+
2
|
|
31
|
+
/* CLASS */
|
|
32
|
+
);
|
|
22
33
|
}
|
|
23
|
-
|
|
24
|
-
var __sfc__ = defineComponent({
|
|
34
|
+
const __sfc__ = defineComponent({
|
|
25
35
|
name,
|
|
26
|
-
components: {
|
|
27
|
-
VarFormDetails
|
|
28
|
-
},
|
|
36
|
+
components: { VarFormDetails },
|
|
29
37
|
props,
|
|
30
|
-
setup(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
bindRadios
|
|
35
|
-
} = useRadios();
|
|
36
|
-
var {
|
|
37
|
-
bindForm
|
|
38
|
-
} = useForm();
|
|
39
|
-
var {
|
|
38
|
+
setup(props2) {
|
|
39
|
+
const { length, radios, bindRadios } = useRadios();
|
|
40
|
+
const { bindForm } = useForm();
|
|
41
|
+
const {
|
|
40
42
|
errorMessage,
|
|
41
43
|
validateWithTrigger: vt,
|
|
42
44
|
validate: v,
|
|
43
45
|
// expose
|
|
44
46
|
resetValidation
|
|
45
47
|
} = useValidation();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
const radioGroupErrorMessage = computed(() => errorMessage.value);
|
|
49
|
+
const radioGroupProvider = {
|
|
48
50
|
onToggle,
|
|
49
51
|
validate,
|
|
50
52
|
reset,
|
|
51
53
|
resetValidation,
|
|
52
54
|
errorMessage: radioGroupErrorMessage
|
|
53
55
|
};
|
|
54
|
-
watch(() =>
|
|
56
|
+
watch(() => props2.modelValue, syncRadios);
|
|
55
57
|
watch(() => length.value, syncRadios);
|
|
56
58
|
call(bindForm, radioGroupProvider);
|
|
57
59
|
bindRadios(radioGroupProvider);
|
|
58
60
|
function validateWithTrigger(trigger) {
|
|
59
61
|
nextTick(() => {
|
|
60
|
-
|
|
61
|
-
validateTrigger,
|
|
62
|
-
rules,
|
|
63
|
-
modelValue
|
|
64
|
-
} = props;
|
|
62
|
+
const { validateTrigger, rules, modelValue } = props2;
|
|
65
63
|
vt(validateTrigger, trigger, rules, modelValue);
|
|
66
64
|
});
|
|
67
65
|
}
|
|
68
66
|
function syncRadios() {
|
|
69
|
-
return radios.forEach(
|
|
70
|
-
var {
|
|
71
|
-
sync
|
|
72
|
-
} = _ref;
|
|
73
|
-
return sync(props.modelValue);
|
|
74
|
-
});
|
|
67
|
+
return radios.forEach(({ sync }) => sync(props2.modelValue));
|
|
75
68
|
}
|
|
76
69
|
function onToggle(changedValue) {
|
|
77
|
-
call(
|
|
78
|
-
call(
|
|
79
|
-
validateWithTrigger(
|
|
70
|
+
call(props2["onUpdate:modelValue"], changedValue);
|
|
71
|
+
call(props2.onChange, changedValue);
|
|
72
|
+
validateWithTrigger("onChange");
|
|
80
73
|
}
|
|
81
|
-
|
|
82
|
-
// expose
|
|
83
74
|
function validate() {
|
|
84
|
-
return v(
|
|
75
|
+
return v(props2.rules, props2.modelValue);
|
|
85
76
|
}
|
|
86
|
-
|
|
87
|
-
// expose
|
|
88
77
|
function reset() {
|
|
89
|
-
call(
|
|
78
|
+
call(props2["onUpdate:modelValue"], void 0);
|
|
90
79
|
resetValidation();
|
|
91
80
|
}
|
|
92
81
|
return {
|
|
@@ -100,4 +89,7 @@ var __sfc__ = defineComponent({
|
|
|
100
89
|
}
|
|
101
90
|
});
|
|
102
91
|
__sfc__.render = __render__;
|
|
103
|
-
|
|
92
|
+
var stdin_default = __sfc__;
|
|
93
|
+
export {
|
|
94
|
+
stdin_default as default
|
|
95
|
+
};
|
package/es/radio-group/index.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import RadioGroup from
|
|
2
|
-
import { withInstall } from
|
|
1
|
+
import RadioGroup from "./RadioGroup.mjs";
|
|
2
|
+
import { withInstall } from "../utils/components.mjs";
|
|
3
3
|
withInstall(RadioGroup);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { props } from "./props.mjs";
|
|
5
|
+
const _RadioGroupComponent = RadioGroup;
|
|
6
|
+
var stdin_default = RadioGroup;
|
|
7
|
+
export {
|
|
8
|
+
_RadioGroupComponent,
|
|
9
|
+
stdin_default as default,
|
|
10
|
+
props as radioGroupProps
|
|
11
|
+
};
|
package/es/radio-group/props.mjs
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { defineListenerProp } from
|
|
2
|
-
|
|
1
|
+
import { defineListenerProp } from "../utils/components.mjs";
|
|
2
|
+
const props = {
|
|
3
3
|
modelValue: {
|
|
4
4
|
type: [String, Number, Boolean, Object, Array],
|
|
5
|
-
default:
|
|
5
|
+
default: void 0
|
|
6
6
|
},
|
|
7
7
|
direction: {
|
|
8
8
|
type: String,
|
|
9
|
-
default:
|
|
9
|
+
default: "horizontal"
|
|
10
10
|
},
|
|
11
11
|
validateTrigger: {
|
|
12
12
|
type: Array,
|
|
13
|
-
default: () => [
|
|
13
|
+
default: () => ["onChange"]
|
|
14
14
|
},
|
|
15
15
|
rules: Array,
|
|
16
16
|
onChange: defineListenerProp(),
|
|
17
|
-
|
|
18
|
-
};
|
|
17
|
+
"onUpdate:modelValue": defineListenerProp()
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
props
|
|
21
|
+
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { useChildren } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
length
|
|
8
|
-
} = useChildren(RADIO_GROUP_BIND_RADIO_KEY);
|
|
1
|
+
import { useChildren } from "@varlet/use";
|
|
2
|
+
const RADIO_GROUP_BIND_RADIO_KEY = Symbol("RADIO_GROUP_BIND_RADIO_KEY");
|
|
3
|
+
function useRadios() {
|
|
4
|
+
const { bindChildren, childProviders, length } = useChildren(
|
|
5
|
+
RADIO_GROUP_BIND_RADIO_KEY
|
|
6
|
+
);
|
|
9
7
|
return {
|
|
10
8
|
length,
|
|
11
9
|
radios: childProviders,
|
|
12
10
|
bindRadios: bindChildren
|
|
13
11
|
};
|
|
14
|
-
}
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
RADIO_GROUP_BIND_RADIO_KEY,
|
|
15
|
+
useRadios
|
|
16
|
+
};
|