@varlet/ui 3.8.4 → 3.8.5
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/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/radio/Radio.mjs +65 -64
- package/es/radio-group/RadioGroup.mjs +29 -32
- package/es/radio-group/props.mjs +4 -0
- package/es/snackbar/style/index.mjs +1 -1
- package/es/varlet.esm.js +1792 -1793
- package/highlight/web-types.en-US.json +10 -1
- package/highlight/web-types.zh-CN.json +10 -1
- package/lib/varlet.cjs.js +161 -159
- package/package.json +7 -7
- package/types/radioGroup.d.ts +1 -0
- package/umd/varlet.js +7 -7
package/es/index.bundle.mjs
CHANGED
|
@@ -280,7 +280,7 @@ import './tooltip/style/index.mjs'
|
|
|
280
280
|
import './uploader/style/index.mjs'
|
|
281
281
|
import './watermark/style/index.mjs'
|
|
282
282
|
|
|
283
|
-
const version = '3.8.
|
|
283
|
+
const version = '3.8.5'
|
|
284
284
|
|
|
285
285
|
function install(app) {
|
|
286
286
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -186,7 +186,7 @@ export * from './tooltip/index.mjs'
|
|
|
186
186
|
export * from './uploader/index.mjs'
|
|
187
187
|
export * from './watermark/index.mjs'
|
|
188
188
|
|
|
189
|
-
const version = '3.8.
|
|
189
|
+
const version = '3.8.5'
|
|
190
190
|
|
|
191
191
|
function install(app) {
|
|
192
192
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/radio/Radio.mjs
CHANGED
|
@@ -12,7 +12,8 @@ import { props } from "./props.mjs";
|
|
|
12
12
|
import { useRadioGroup } from "./provide.mjs";
|
|
13
13
|
const { name, n, classes } = createNamespace("radio");
|
|
14
14
|
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, createVNode as _createVNode, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, mergeProps as _mergeProps, createElementVNode as _createElementVNode } from "vue";
|
|
15
|
-
const _hoisted_1 = ["
|
|
15
|
+
const _hoisted_1 = ["aria-checked"];
|
|
16
|
+
const _hoisted_2 = ["tabindex"];
|
|
16
17
|
function __render__(_ctx, _cache) {
|
|
17
18
|
const _component_var_icon = _resolveComponent("var-icon");
|
|
18
19
|
const _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
|
|
@@ -25,75 +26,71 @@ function __render__(_ctx, _cache) {
|
|
|
25
26
|
class: _normalizeClass(_ctx.n("wrap"))
|
|
26
27
|
},
|
|
27
28
|
[
|
|
28
|
-
_createElementVNode(
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
_createElementVNode("div", _mergeProps({
|
|
30
|
+
role: "radio",
|
|
31
|
+
"aria-checked": _ctx.checked,
|
|
32
|
+
class: _ctx.n()
|
|
33
|
+
}, _ctx.$attrs, {
|
|
34
|
+
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
35
|
+
}), [
|
|
36
|
+
_withDirectives((_openBlock(), _createElementBlock("div", {
|
|
37
|
+
ref: "action",
|
|
38
|
+
class: _normalizeClass(
|
|
39
|
+
_ctx.classes(
|
|
40
|
+
_ctx.n("action"),
|
|
41
|
+
[_ctx.checked, _ctx.n("--checked"), _ctx.n("--unchecked")],
|
|
42
|
+
[_ctx.errorMessage || _ctx.radioGroupErrorMessage, _ctx.n("--error")],
|
|
43
|
+
[_ctx.formDisabled || _ctx.disabled, _ctx.n("--disabled")]
|
|
44
|
+
)
|
|
45
|
+
),
|
|
46
|
+
tabindex: _ctx.tabIndex,
|
|
47
|
+
style: _normalizeStyle({ color: _ctx.checked ? _ctx.checkedColor : _ctx.uncheckedColor }),
|
|
48
|
+
onFocus: _cache[0] || (_cache[0] = ($event) => _ctx.isFocusing = true),
|
|
49
|
+
onBlur: _cache[1] || (_cache[1] = ($event) => _ctx.isFocusing = false)
|
|
50
|
+
}, [
|
|
51
|
+
_ctx.checked ? _renderSlot(_ctx.$slots, "checked-icon", { key: 0 }, () => [
|
|
52
|
+
_createVNode(_component_var_icon, {
|
|
53
|
+
class: _normalizeClass(_ctx.n("icon")),
|
|
54
|
+
"var-radio-cover": "",
|
|
55
|
+
name: "radio-marked",
|
|
56
|
+
size: _ctx.iconSize
|
|
57
|
+
}, null, 8, ["class", "size"])
|
|
58
|
+
]) : _renderSlot(_ctx.$slots, "unchecked-icon", { key: 1 }, () => [
|
|
59
|
+
_createVNode(_component_var_icon, {
|
|
60
|
+
class: _normalizeClass(_ctx.n("icon")),
|
|
61
|
+
"var-radio-cover": "",
|
|
62
|
+
name: "radio-blank",
|
|
63
|
+
size: _ctx.iconSize
|
|
64
|
+
}, null, 8, ["class", "size"])
|
|
65
|
+
]),
|
|
66
|
+
_createVNode(_component_var_hover_overlay, {
|
|
67
|
+
hovering: !_ctx.disabled && !_ctx.formDisabled && _ctx.hovering,
|
|
68
|
+
focusing: !_ctx.disabled && !_ctx.formDisabled && _ctx.isFocusing
|
|
69
|
+
}, null, 8, ["hovering", "focusing"])
|
|
70
|
+
], 46, _hoisted_2)), [
|
|
71
|
+
[_directive_ripple, { disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple }],
|
|
72
|
+
[_directive_hover, _ctx.handleHovering, "desktop"]
|
|
73
|
+
]),
|
|
74
|
+
_ctx.$slots.default ? (_openBlock(), _createElementBlock(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
key: 0,
|
|
38
78
|
class: _normalizeClass(
|
|
39
79
|
_ctx.classes(
|
|
40
|
-
_ctx.n("
|
|
41
|
-
[_ctx.checked, _ctx.n("--checked"), _ctx.n("--unchecked")],
|
|
80
|
+
_ctx.n("text"),
|
|
42
81
|
[_ctx.errorMessage || _ctx.radioGroupErrorMessage, _ctx.n("--error")],
|
|
43
82
|
[_ctx.formDisabled || _ctx.disabled, _ctx.n("--disabled")]
|
|
44
83
|
)
|
|
45
84
|
),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
name: "radio-marked",
|
|
56
|
-
size: _ctx.iconSize
|
|
57
|
-
}, null, 8, ["class", "size"])
|
|
58
|
-
]) : _renderSlot(_ctx.$slots, "unchecked-icon", { key: 1 }, () => [
|
|
59
|
-
_createVNode(_component_var_icon, {
|
|
60
|
-
class: _normalizeClass(_ctx.n("icon")),
|
|
61
|
-
"var-radio-cover": "",
|
|
62
|
-
name: "radio-blank",
|
|
63
|
-
size: _ctx.iconSize
|
|
64
|
-
}, null, 8, ["class", "size"])
|
|
65
|
-
]),
|
|
66
|
-
_createVNode(_component_var_hover_overlay, {
|
|
67
|
-
hovering: !_ctx.disabled && !_ctx.formDisabled && _ctx.hovering,
|
|
68
|
-
focusing: !_ctx.disabled && !_ctx.formDisabled && _ctx.isFocusing
|
|
69
|
-
}, null, 8, ["hovering", "focusing"])
|
|
70
|
-
], 46, _hoisted_1)), [
|
|
71
|
-
[_directive_ripple, { disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple }],
|
|
72
|
-
[_directive_hover, _ctx.handleHovering, "desktop"]
|
|
73
|
-
]),
|
|
74
|
-
_ctx.$slots.default ? (_openBlock(), _createElementBlock(
|
|
75
|
-
"div",
|
|
76
|
-
{
|
|
77
|
-
key: 0,
|
|
78
|
-
class: _normalizeClass(
|
|
79
|
-
_ctx.classes(
|
|
80
|
-
_ctx.n("text"),
|
|
81
|
-
[_ctx.errorMessage || _ctx.radioGroupErrorMessage, _ctx.n("--error")],
|
|
82
|
-
[_ctx.formDisabled || _ctx.disabled, _ctx.n("--disabled")]
|
|
83
|
-
)
|
|
84
|
-
),
|
|
85
|
-
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleTextClick && _ctx.handleTextClick(...args))
|
|
86
|
-
},
|
|
87
|
-
[
|
|
88
|
-
_renderSlot(_ctx.$slots, "default", { checked: _ctx.checked })
|
|
89
|
-
],
|
|
90
|
-
2
|
|
91
|
-
/* CLASS */
|
|
92
|
-
)) : _createCommentVNode("v-if", true)
|
|
93
|
-
],
|
|
94
|
-
16
|
|
95
|
-
/* FULL_PROPS */
|
|
96
|
-
),
|
|
85
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleTextClick && _ctx.handleTextClick(...args))
|
|
86
|
+
},
|
|
87
|
+
[
|
|
88
|
+
_renderSlot(_ctx.$slots, "default", { checked: _ctx.checked })
|
|
89
|
+
],
|
|
90
|
+
2
|
|
91
|
+
/* CLASS */
|
|
92
|
+
)) : _createCommentVNode("v-if", true)
|
|
93
|
+
], 16, _hoisted_1),
|
|
97
94
|
_createVNode(_component_var_form_details, { "error-message": _ctx.errorMessage }, null, 8, ["error-message"])
|
|
98
95
|
],
|
|
99
96
|
2
|
|
@@ -118,6 +115,9 @@ const __sfc__ = defineComponent({
|
|
|
118
115
|
const { radioGroup, bindRadioGroup } = useRadioGroup();
|
|
119
116
|
const { hovering, handleHovering } = useHoverOverlay();
|
|
120
117
|
const { form, bindForm } = useForm();
|
|
118
|
+
const tabIndex = computed(
|
|
119
|
+
() => (form == null ? void 0 : form.disabled.value) || props2.disabled || checked.value && radioGroup ? void 0 : "0"
|
|
120
|
+
);
|
|
121
121
|
const {
|
|
122
122
|
errorMessage,
|
|
123
123
|
validateWithTrigger: vt,
|
|
@@ -223,6 +223,7 @@ const __sfc__ = defineComponent({
|
|
|
223
223
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
224
224
|
formReadonly: form == null ? void 0 : form.readonly,
|
|
225
225
|
hovering,
|
|
226
|
+
tabIndex,
|
|
226
227
|
handleHovering,
|
|
227
228
|
n,
|
|
228
229
|
classes,
|
|
@@ -9,6 +9,7 @@ import { props } from "./props.mjs";
|
|
|
9
9
|
import { useRadios } from "./provide.mjs";
|
|
10
10
|
const { name, n, classes } = createNamespace("radio-group");
|
|
11
11
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode } from "vue";
|
|
12
|
+
const _hoisted_1 = ["aria-label"];
|
|
12
13
|
function __render__(_ctx, _cache) {
|
|
13
14
|
const _component_maybe_v_node = _resolveComponent("maybe-v-node");
|
|
14
15
|
const _component_var_radio = _resolveComponent("var-radio");
|
|
@@ -19,38 +20,34 @@ function __render__(_ctx, _cache) {
|
|
|
19
20
|
class: _normalizeClass(_ctx.n("wrap"))
|
|
20
21
|
},
|
|
21
22
|
[
|
|
22
|
-
_createElementVNode(
|
|
23
|
-
"
|
|
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
|
-
2
|
|
52
|
-
/* CLASS */
|
|
53
|
-
),
|
|
23
|
+
_createElementVNode("div", {
|
|
24
|
+
"aria-label": _ctx.ariaLabel,
|
|
25
|
+
role: "radiogroup",
|
|
26
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n(`--${_ctx.direction}`)))
|
|
27
|
+
}, [
|
|
28
|
+
_ctx.options.length ? (_openBlock(true), _createElementBlock(
|
|
29
|
+
_Fragment,
|
|
30
|
+
{ key: 0 },
|
|
31
|
+
_renderList(_ctx.options, (option) => {
|
|
32
|
+
return _openBlock(), _createBlock(_component_var_radio, {
|
|
33
|
+
key: option[_ctx.valueKey],
|
|
34
|
+
"checked-value": option[_ctx.valueKey],
|
|
35
|
+
disabled: option.disabled
|
|
36
|
+
}, {
|
|
37
|
+
default: _withCtx(({ checked }) => [
|
|
38
|
+
_createVNode(_component_maybe_v_node, {
|
|
39
|
+
is: _ctx.isFunction(option[_ctx.labelKey]) ? option[_ctx.labelKey](option, checked) : option[_ctx.labelKey]
|
|
40
|
+
}, null, 8, ["is"])
|
|
41
|
+
]),
|
|
42
|
+
_: 2
|
|
43
|
+
/* DYNAMIC */
|
|
44
|
+
}, 1032, ["checked-value", "disabled"]);
|
|
45
|
+
}),
|
|
46
|
+
128
|
|
47
|
+
/* KEYED_FRAGMENT */
|
|
48
|
+
)) : _createCommentVNode("v-if", true),
|
|
49
|
+
_renderSlot(_ctx.$slots, "default")
|
|
50
|
+
], 10, _hoisted_1),
|
|
54
51
|
_createVNode(_component_var_form_details, { "error-message": _ctx.errorMessage }, null, 8, ["error-message"])
|
|
55
52
|
],
|
|
56
53
|
2
|
package/es/radio-group/props.mjs
CHANGED