@v1nt1248/3nclient-lib 0.1.28 → 0.1.29
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/dist/variables.css
CHANGED
package/package.json
CHANGED
|
@@ -101,7 +101,9 @@ watch(
|
|
|
101
101
|
},
|
|
102
102
|
);
|
|
103
103
|
|
|
104
|
-
function change() {
|
|
104
|
+
function change(ev: Event) {
|
|
105
|
+
ev.preventDefault();
|
|
106
|
+
|
|
105
107
|
val.value = checkBoxValue.value !== 'unchecked'
|
|
106
108
|
? props.uncheckedValue
|
|
107
109
|
: props.checkedValue;
|
|
@@ -122,6 +124,9 @@ function change() {
|
|
|
122
124
|
>
|
|
123
125
|
<div
|
|
124
126
|
:class="bodyCssClasses"
|
|
127
|
+
:tabindex="disabled ? -1 : 0"
|
|
128
|
+
@keydown.space="change"
|
|
129
|
+
@keydown.enter="change"
|
|
125
130
|
@click="change"
|
|
126
131
|
>
|
|
127
132
|
<svg
|
|
@@ -57,15 +57,30 @@ const val = ref<Ui3nRadioValue>(groupName ? groupValue!.value : props.modelValue
|
|
|
57
57
|
|
|
58
58
|
const isOn = computed(() => val.value === props.checkedValue);
|
|
59
59
|
|
|
60
|
-
function change() {
|
|
61
|
-
|
|
60
|
+
function change(ev: Event) {
|
|
61
|
+
ev.preventDefault();
|
|
62
62
|
|
|
63
|
-
if (groupName) {
|
|
64
|
-
isOn.value
|
|
65
|
-
} else {
|
|
63
|
+
if (!groupName) {
|
|
64
|
+
val.value = isOn.value ? props.uncheckedValue : props.checkedValue;
|
|
66
65
|
emits('change', val.value);
|
|
67
66
|
emits('update:modelValue', val.value);
|
|
67
|
+
return;
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
if (isOn.value) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
val.value = props.checkedValue;
|
|
75
|
+
updateGroupValue!(val.value);
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// if (groupName) {
|
|
79
|
+
// isOn.value && updateGroupValue!(val.value);
|
|
80
|
+
// } else {
|
|
81
|
+
// emits('change', val.value);
|
|
82
|
+
// emits('update:modelValue', val.value);
|
|
83
|
+
// }
|
|
69
84
|
}
|
|
70
85
|
|
|
71
86
|
onBeforeMount(() => {
|
|
@@ -132,6 +147,9 @@ watch(
|
|
|
132
147
|
>
|
|
133
148
|
<div
|
|
134
149
|
:class="[$style.body, disabled && $style.bodyDisabled]"
|
|
150
|
+
:tabindex="disabled ? -1 : 0"
|
|
151
|
+
@keydown.enter="change"
|
|
152
|
+
@keydown.space="change"
|
|
135
153
|
@click="change"
|
|
136
154
|
>
|
|
137
155
|
<slot
|
|
@@ -32,7 +32,9 @@ watch(
|
|
|
32
32
|
{ immediate: true },
|
|
33
33
|
);
|
|
34
34
|
|
|
35
|
-
function change() {
|
|
35
|
+
function change(ev: Event) {
|
|
36
|
+
ev.preventDefault();
|
|
37
|
+
|
|
36
38
|
val.value = !val.value;
|
|
37
39
|
emits('change', val.value);
|
|
38
40
|
emits('update:modelValue', val.value);
|
|
@@ -45,7 +47,13 @@ function change() {
|
|
|
45
47
|
:class="[$style.ui3nSwitch, val && $style.checked, !slots.default && $style.noLabel, disabled && $style.disabled]"
|
|
46
48
|
>
|
|
47
49
|
<Transition>
|
|
48
|
-
<div
|
|
50
|
+
<div
|
|
51
|
+
:class="$style.body"
|
|
52
|
+
:tabindex="disabled ? -1 : 0"
|
|
53
|
+
@keydown.enter="change"
|
|
54
|
+
@keydown.space="change"
|
|
55
|
+
@click="change"
|
|
56
|
+
>
|
|
49
57
|
<div :class="[$style.dot, val ? $style.right : $style.left]" />
|
|
50
58
|
</div>
|
|
51
59
|
</Transition>
|