@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.
@@ -35,7 +35,7 @@
35
35
  --orange-50: #ff6428;
36
36
  --orange-60: #dc5520;
37
37
  --orange-70: #b94518;
38
- --orenge-80: #973610;
38
+ --orange-80: #973610;
39
39
  --orange-85: #852e0c;
40
40
  --orange-90: #742608;
41
41
  --orange-95: #621f04;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@v1nt1248/3nclient-lib",
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "v1nt1248",
5
- "version": "0.1.28",
5
+ "version": "0.1.29",
6
6
  "description": "Library for 3NWeb clients",
7
7
  "type": "module",
8
8
  "files": [
@@ -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
- val.value = isOn.value ? props.uncheckedValue : props.checkedValue;
60
+ function change(ev: Event) {
61
+ ev.preventDefault();
62
62
 
63
- if (groupName) {
64
- isOn.value && updateGroupValue!(val.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 :class="$style.body" @click="change">
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>