@opentinyvue/vue-checkbox 3.27.0 → 3.28.0

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.
@@ -54,7 +54,7 @@ var _sfc_main = defineComponent({
54
54
  });
55
55
  }
56
56
  });
57
- var _hoisted_1 = ["id"];
57
+ var _hoisted_1 = ["id", "aria-checked", "aria-disabled", "aria-label"];
58
58
  var _hoisted_2 = ["role", "aria-checked"];
59
59
  var _hoisted_3 = {
60
60
  tabindex: "1"
@@ -75,14 +75,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
75
75
  "sm:py-2": _ctx.state.vertical
76
76
  }, _ctx.state.isDisplayOnly || _ctx.state.isGroupDisplayOnly ? _ctx.state.isChecked ? "cursor-default after:content-[';'] after:inline-block last:after:content-['']" : "hidden" : "", _ctx.state.showLabel ? "inline-flex" : "", _ctx.customClass),
77
77
  id: _ctx.id,
78
- tabindex: "-1"
78
+ tabindex: "-1",
79
+ role: "checkbox",
80
+ "aria-checked": _ctx.indeterminate ? "mixed" : _ctx.state.isChecked,
81
+ "aria-disabled": _ctx.state.isDisabled || _ctx.state.isDisplayOnly,
82
+ "aria-label": _ctx.text || _ctx.label
79
83
  }, _ctx.a(_ctx.$attrs, ["class", "style", "onClick"], true)), [createElementVNode("span", {
80
84
  class: normalizeClass(["relative w-7 h-7 mr-2 sm:mr-0 sm:p-0", _ctx.state.size === "medium" ? "sm:w-6 sm:h-6" : "sm:h-4 sm:w-4", _ctx.state.isDisplayOnly || _ctx.state.isGroupDisplayOnly ? "hidden" : ""]),
81
85
  role: _ctx.indeterminate ? "checkbox" : false,
82
86
  "aria-checked": _ctx.indeterminate ? "mixed" : false
83
87
  }, [createElementVNode("span", _hoisted_3, [createVNode(_component_icon_check, {
84
88
  "data-tag": "icon-check",
85
- class: normalizeClass(_ctx.m("w-5 h-5 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-0", _ctx.state.size === "medium" ? "sm:w-6 sm:h-6" : "sm:w-4 sm:h-4", _ctx.state.isDisabled ? "[&_path:nth-of-type(2)]:fill-color-icon-disabled [&_path:nth-of-type(1)]:fill-color-bg-3 cursor-not-allowed" : "[&_path:nth-of-type(1)]:fill-color-icon-inverse [&_path:nth-of-type(2)]:fill-color-none-hover"))
89
+ class: normalizeClass(_ctx.m("w-5 h-5 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-0", _ctx.state.size === "medium" ? "sm:w-6 sm:h-6" : "sm:w-4 sm:h-4", _ctx.state.isDisabled ? "[&_path:nth-of-type(2)]:fill-color-icon-disabled [&_path:nth-of-type(1)]:fill-color-bg-3 cursor-not-allowed" : "[&_path:nth-of-type(2)]:fill-color-none-hover"))
86
90
  }, null, 8, ["class"]), createVNode(_component_icon_halfselect, {
87
91
  "data-tag": "icon-halfselect",
88
92
  class: normalizeClass(_ctx.m("w-5 h-5 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 transition-all [&_path:nth-of-type(2)]:fill-color-icon-inverse", _ctx.indeterminate ? "opacity-100 scale-100 z-10" : "opacity-0 scale-0 z-0", _ctx.state.isDisabled ? "[&_path:nth-of-type(1)]:fill-color-brand-disabled cursor-not-allowed" : "[&_path:nth-of-type(1)]:fill-color-brand [&_path:nth-of-type(1)]:shadow-xsm", _ctx.state.size === "medium" ? "sm:w-6 sm:h-6" : "sm:w-4 sm:h-4"))
package/lib/pc.js CHANGED
@@ -59,14 +59,13 @@ var _sfc_main = defineComponent({
59
59
  });
60
60
  }
61
61
  });
62
- var _hoisted_1 = ["id"];
63
- var _hoisted_2 = ["role", "aria-checked"];
64
- var _hoisted_3 = ["tabindex", "aria-hidden", "name", "disabled", "true-value", "false-value"];
65
- var _hoisted_4 = ["tabindex", "aria-hidden", "disabled", "value", "name"];
66
- var _hoisted_5 = {
62
+ var _hoisted_1 = ["id", "aria-checked", "aria-disabled", "aria-label"];
63
+ var _hoisted_2 = ["tabindex", "aria-hidden", "name", "disabled", "true-value", "false-value"];
64
+ var _hoisted_3 = ["tabindex", "aria-hidden", "disabled", "value", "name"];
65
+ var _hoisted_4 = {
67
66
  class: "tiny-checkbox__inner"
68
67
  };
69
- var _hoisted_6 = {
68
+ var _hoisted_5 = {
70
69
  key: 0,
71
70
  class: "tiny-checkbox__label tiny-checkbox-display-only"
72
71
  };
@@ -90,73 +89,81 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
90
89
  "is-filter": _ctx.state.shape === "filter"
91
90
  }]],
92
91
  id: _ctx.id,
93
- tabindex: "-1"
94
- }, _ctx.a(_ctx.$attrs, ["class", "style", "onClick"], true)), [createElementVNode("span", {
95
- class: normalizeClass(["tiny-checkbox__input", {
96
- "is-disabled": _ctx.state.isDisabled || _ctx.state.isDisplayOnly,
97
- "is-checked": _ctx.state.isChecked,
98
- "is-indeterminate": _ctx.indeterminate,
99
- "is-focus": _ctx.state.focus
100
- }]),
101
- role: _ctx.indeterminate ? "checkbox" : void 0,
102
- "aria-checked": _ctx.indeterminate ? "mixed" : false
103
- }, [_ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
104
- key: 0,
105
- class: "tiny-checkbox__original",
106
- type: "checkbox",
107
- tabindex: _ctx.tabindex,
108
- "aria-hidden": _ctx.indeterminate ? "true" : "false",
109
- name: _ctx.name,
110
- disabled: _ctx.state.isDisabled || _ctx.state.isDisplayOnly,
111
- "true-value": _ctx.trueLabel,
112
- "false-value": _ctx.falseLabel,
113
- "onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) {
114
- return _ctx.state.model = $event;
115
- }),
116
- onChange: _cache[1] || (_cache[1] = withModifiers(function() {
117
- return _ctx.handleChange && _ctx.handleChange.apply(_ctx, arguments);
118
- }, ["stop"])),
119
- onFocus: _cache[2] || (_cache[2] = function($event) {
120
- return _ctx.state.focus = true;
121
- }),
122
- onBlur: _cache[3] || (_cache[3] = function($event) {
123
- return _ctx.state.focus = false;
124
- }),
125
- onClick: _cache[4] || (_cache[4] = withModifiers(function() {
126
- }, ["stop"]))
127
- }, null, 40, _hoisted_3)), [[vModelCheckbox, _ctx.state.model]]) : withDirectives((openBlock(), createElementBlock("input", {
128
- key: 1,
129
- class: "tiny-checkbox__original",
130
- type: "checkbox",
131
- tabindex: _ctx.tabindex,
132
- "aria-hidden": _ctx.indeterminate ? "true" : "false",
133
- disabled: _ctx.state.isDisabled || _ctx.state.isDisplayOnly,
134
- value: _ctx.label,
135
- name: _ctx.name,
136
- "onUpdate:modelValue": _cache[5] || (_cache[5] = function($event) {
137
- return _ctx.state.model = $event;
138
- }),
139
- onChange: _cache[6] || (_cache[6] = withModifiers(function() {
140
- return _ctx.handleChange && _ctx.handleChange.apply(_ctx, arguments);
141
- }, ["stop"])),
142
- onFocus: _cache[7] || (_cache[7] = function($event) {
143
- return _ctx.state.focus = true;
144
- }),
145
- onBlur: _cache[8] || (_cache[8] = function($event) {
146
- return _ctx.state.focus = false;
147
- }),
148
- onClick: _cache[9] || (_cache[9] = withModifiers(function() {
149
- }, ["stop"]))
150
- }, null, 40, _hoisted_4)), [[vModelCheckbox, _ctx.state.model]]), createElementVNode("span", _hoisted_5, [_ctx.indeterminate && _ctx.state.shape !== "filter" ? (openBlock(), createBlock(_component_icon_halfselect, {
151
- key: 0,
152
- class: "tiny-svg-size icon-halfselect"
153
- })) : _ctx.state.isChecked ? (openBlock(), createBlock(_component_icon_checked_sur, {
154
- key: 1,
155
- class: "tiny-svg-size icon-checked-sur"
156
- })) : (openBlock(), createBlock(_component_icon_check, {
157
- key: 2,
158
- class: "tiny-svg-size icon-check"
159
- }))])], 10, _hoisted_2), _ctx.slots.default && _ctx.slots.default() || _ctx.state.isShowText ? withDirectives((openBlock(), createElementBlock("span", _hoisted_6, [renderSlot(_ctx.$slots, "default", {}, function() {
92
+ tabindex: "-1",
93
+ role: "checkbox",
94
+ "aria-checked": _ctx.indeterminate ? "mixed" : _ctx.state.isChecked,
95
+ "aria-disabled": _ctx.state.isDisabled || _ctx.state.isDisplayOnly,
96
+ "aria-label": _ctx.text || _ctx.label
97
+ }, _ctx.a(_ctx.$attrs, ["class", "style", "onClick"], true)), [createElementVNode(
98
+ "span",
99
+ {
100
+ class: normalizeClass(["tiny-checkbox__input", {
101
+ "is-disabled": _ctx.state.isDisabled || _ctx.state.isDisplayOnly,
102
+ "is-checked": _ctx.state.isChecked,
103
+ "is-indeterminate": _ctx.indeterminate,
104
+ "is-focus": _ctx.state.focus
105
+ }])
106
+ },
107
+ [_ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
108
+ key: 0,
109
+ class: "tiny-checkbox__original",
110
+ type: "checkbox",
111
+ tabindex: _ctx.tabindex,
112
+ "aria-hidden": _ctx.indeterminate ? "true" : "false",
113
+ name: _ctx.name,
114
+ disabled: _ctx.state.isDisabled || _ctx.state.isDisplayOnly,
115
+ "true-value": _ctx.trueLabel,
116
+ "false-value": _ctx.falseLabel,
117
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) {
118
+ return _ctx.state.model = $event;
119
+ }),
120
+ onChange: _cache[1] || (_cache[1] = withModifiers(function() {
121
+ return _ctx.handleChange && _ctx.handleChange.apply(_ctx, arguments);
122
+ }, ["stop"])),
123
+ onFocus: _cache[2] || (_cache[2] = function($event) {
124
+ return _ctx.state.focus = true;
125
+ }),
126
+ onBlur: _cache[3] || (_cache[3] = function($event) {
127
+ return _ctx.state.focus = false;
128
+ }),
129
+ onClick: _cache[4] || (_cache[4] = withModifiers(function() {
130
+ }, ["stop"]))
131
+ }, null, 40, _hoisted_2)), [[vModelCheckbox, _ctx.state.model]]) : withDirectives((openBlock(), createElementBlock("input", {
132
+ key: 1,
133
+ class: "tiny-checkbox__original",
134
+ type: "checkbox",
135
+ tabindex: _ctx.tabindex,
136
+ "aria-hidden": _ctx.indeterminate ? "true" : "false",
137
+ disabled: _ctx.state.isDisabled || _ctx.state.isDisplayOnly,
138
+ value: _ctx.label,
139
+ name: _ctx.name,
140
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = function($event) {
141
+ return _ctx.state.model = $event;
142
+ }),
143
+ onChange: _cache[6] || (_cache[6] = withModifiers(function() {
144
+ return _ctx.handleChange && _ctx.handleChange.apply(_ctx, arguments);
145
+ }, ["stop"])),
146
+ onFocus: _cache[7] || (_cache[7] = function($event) {
147
+ return _ctx.state.focus = true;
148
+ }),
149
+ onBlur: _cache[8] || (_cache[8] = function($event) {
150
+ return _ctx.state.focus = false;
151
+ }),
152
+ onClick: _cache[9] || (_cache[9] = withModifiers(function() {
153
+ }, ["stop"]))
154
+ }, null, 40, _hoisted_3)), [[vModelCheckbox, _ctx.state.model]]), createElementVNode("span", _hoisted_4, [_ctx.indeterminate && _ctx.state.shape !== "filter" ? (openBlock(), createBlock(_component_icon_halfselect, {
155
+ key: 0,
156
+ class: "tiny-svg-size icon-halfselect"
157
+ })) : _ctx.state.isChecked ? (openBlock(), createBlock(_component_icon_checked_sur, {
158
+ key: 1,
159
+ class: "tiny-svg-size icon-checked-sur"
160
+ })) : (openBlock(), createBlock(_component_icon_check, {
161
+ key: 2,
162
+ class: "tiny-svg-size icon-check"
163
+ }))])],
164
+ 2
165
+ /* CLASS */
166
+ ), _ctx.slots.default && _ctx.slots.default() || _ctx.state.isShowText ? withDirectives((openBlock(), createElementBlock("span", _hoisted_5, [renderSlot(_ctx.$slots, "default", {}, function() {
160
167
  return [createTextVNode(
161
168
  toDisplayString(_ctx.state.showText),
162
169
  1
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-checkbox",
3
- "version": "3.27.0",
3
+ "version": "3.28.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
7
7
  "sideEffects": false,
8
8
  "type": "module",
9
9
  "dependencies": {
10
- "@opentinyvue/vue-common": "~3.27.0",
11
- "@opentinyvue/vue-renderless": "~3.27.0",
12
- "@opentinyvue/vue-directive": "~3.27.0",
13
- "@opentinyvue/vue-icon": "~3.27.0",
14
- "@opentinyvue/vue-theme": "~3.27.0"
10
+ "@opentinyvue/vue-common": "~3.28.0",
11
+ "@opentinyvue/vue-renderless": "~3.28.0",
12
+ "@opentinyvue/vue-directive": "~3.28.0",
13
+ "@opentinyvue/vue-icon": "~3.28.0",
14
+ "@opentinyvue/vue-theme": "~3.28.0"
15
15
  },
16
16
  "license": "MIT",
17
17
  "types": "index.d.ts",
package/src/index.d.ts CHANGED
@@ -199,13 +199,13 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
199
199
  indeterminate: boolean;
200
200
  tiny_mode_root: boolean;
201
201
  _constants: Record<string, any>;
202
+ shape: string;
202
203
  modelValue: string | number | boolean;
203
204
  tabindex: string;
204
205
  border: boolean;
205
206
  events: Record<string, any>;
206
207
  validateEvent: boolean;
207
208
  displayOnly: boolean;
208
- shape: string;
209
209
  controls: string;
210
210
  }, {}>;
211
211
  export default _default;
package/src/pc.vue.d.ts CHANGED
@@ -16,13 +16,13 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
16
16
  tiny_theme?: any;
17
17
  tiny_chart_theme?: any;
18
18
  tiny_mcp_config?: any;
19
+ shape?: any;
19
20
  modelValue?: any;
20
21
  tabindex?: any;
21
22
  border?: any;
22
23
  events?: any;
23
24
  validateEvent?: any;
24
25
  displayOnly?: any;
25
- shape?: any;
26
26
  trueLabel?: any;
27
27
  falseLabel?: any;
28
28
  controls?: any;
@@ -43,13 +43,13 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
43
43
  tiny_theme?: any;
44
44
  tiny_chart_theme?: any;
45
45
  tiny_mcp_config?: any;
46
+ shape?: any;
46
47
  modelValue?: any;
47
48
  tabindex?: any;
48
49
  border?: any;
49
50
  events?: any;
50
51
  validateEvent?: any;
51
52
  displayOnly?: any;
52
- shape?: any;
53
53
  trueLabel?: any;
54
54
  falseLabel?: any;
55
55
  controls?: any;
@@ -74,13 +74,13 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
74
74
  readonly tiny_theme?: any;
75
75
  readonly tiny_chart_theme?: any;
76
76
  readonly tiny_mcp_config?: any;
77
+ readonly shape?: any;
77
78
  readonly modelValue?: any;
78
79
  readonly tabindex?: any;
79
80
  readonly border?: any;
80
81
  readonly events?: any;
81
82
  readonly validateEvent?: any;
82
83
  readonly displayOnly?: any;
83
- readonly shape?: any;
84
84
  readonly trueLabel?: any;
85
85
  readonly falseLabel?: any;
86
86
  readonly controls?: any;