@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.
@@ -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.4'
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.4'
189
+ const version = '3.8.5'
190
190
 
191
191
  function install(app) {
192
192
  ActionSheet.install && app.use(ActionSheet)
@@ -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 = ["tabindex"];
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
- "div",
30
- _mergeProps({
31
- class: _ctx.n()
32
- }, _ctx.$attrs, {
33
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
34
- }),
35
- [
36
- _withDirectives((_openBlock(), _createElementBlock("div", {
37
- ref: "action",
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("action"),
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
- tabindex: _ctx.formDisabled || _ctx.disabled ? void 0 : "0",
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_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
- "div",
24
- {
25
- class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n(`--${_ctx.direction}`)))
26
- },
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
- ],
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
@@ -12,6 +12,10 @@ const props = {
12
12
  type: Array,
13
13
  default: () => []
14
14
  },
15
+ ariaLabel: {
16
+ type: String,
17
+ default: ""
18
+ },
15
19
  labelKey: {
16
20
  type: String,
17
21
  default: "label"
@@ -1,7 +1,7 @@
1
1
  import '../../styles/common.css'
2
+ import '../SnackbarSfc.css'
2
3
  import '../../styles/elevation.css'
3
4
  import '../../loading/loading.css'
4
5
  import '../../icon/icon.css'
5
6
  import '../snackbar.css'
6
7
  import '../coreSfc.css'
7
- import '../SnackbarSfc.css'