classcard-ui 0.2.344 → 0.2.347
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/classcard-ui.common.js +70 -52
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +70 -52
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +1 -1
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CSwitch/CSwitch.vue +29 -11
package/package.json
CHANGED
|
@@ -4,15 +4,20 @@
|
|
|
4
4
|
<div
|
|
5
5
|
v-if="size === 'small'"
|
|
6
6
|
:class="label == '' ? 'items-center' : 'items-start'"
|
|
7
|
-
class="flex justify-between
|
|
7
|
+
class="flex cursor-pointer justify-between"
|
|
8
8
|
>
|
|
9
|
-
<span
|
|
9
|
+
<span
|
|
10
|
+
class="flex flex-grow flex-col"
|
|
11
|
+
id="smallleft"
|
|
12
|
+
v-if="direction == 'left'"
|
|
13
|
+
@click="switchValue"
|
|
14
|
+
>
|
|
10
15
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
11
16
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
12
17
|
</span>
|
|
13
18
|
<button
|
|
14
19
|
type="button"
|
|
15
|
-
class="
|
|
20
|
+
class="group focus:outline-none relative inline-flex h-5 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-full focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:opacity-50"
|
|
16
21
|
aria-pressed="false"
|
|
17
22
|
@click="switchValue"
|
|
18
23
|
:disabled="disabled"
|
|
@@ -20,17 +25,17 @@
|
|
|
20
25
|
<span class="sr-only">Use setting</span>
|
|
21
26
|
<span
|
|
22
27
|
aria-hidden="true"
|
|
23
|
-
class="pointer-events-none absolute
|
|
28
|
+
class="pointer-events-none absolute h-full w-full rounded-md bg-white"
|
|
24
29
|
></span>
|
|
25
30
|
<span
|
|
26
31
|
aria-hidden="true"
|
|
27
32
|
:class="{ 'bg-indigo-600': isToggle, 'bg-gray-200': !isToggle }"
|
|
28
|
-
class="pointer-events-none absolute h-4 w-9
|
|
33
|
+
class="pointer-events-none absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out"
|
|
29
34
|
></span>
|
|
30
35
|
<span
|
|
31
36
|
aria-hidden="true"
|
|
32
37
|
:class="{ 'translate-x-5': isToggle, 'translate-x-0': !isToggle }"
|
|
33
|
-
class="pointer-events-none absolute left-0 inline-block h-5 w-5 border border-gray-200
|
|
38
|
+
class="pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-full border border-gray-200 bg-white ring-0 transition-transform duration-200 ease-in-out"
|
|
34
39
|
></span>
|
|
35
40
|
</button>
|
|
36
41
|
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'" @click="switchValue">
|
|
@@ -39,8 +44,17 @@
|
|
|
39
44
|
</span>
|
|
40
45
|
</div>
|
|
41
46
|
<!-- large toggle -->
|
|
42
|
-
<div
|
|
43
|
-
|
|
47
|
+
<div
|
|
48
|
+
v-else
|
|
49
|
+
:class="label == '' ? 'items-center' : 'items-start'"
|
|
50
|
+
class="flex cursor-pointer justify-between"
|
|
51
|
+
>
|
|
52
|
+
<span
|
|
53
|
+
class="flex flex-grow flex-col"
|
|
54
|
+
id="toggleLabel"
|
|
55
|
+
v-if="direction == 'left'"
|
|
56
|
+
@click="switchValue"
|
|
57
|
+
>
|
|
44
58
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
45
59
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
46
60
|
</span>
|
|
@@ -49,17 +63,17 @@
|
|
|
49
63
|
aria-pressed="false"
|
|
50
64
|
:class="{ 'bg-indigo-600': isToggle == 1, 'bg-gray-200': isToggle == 0 }"
|
|
51
65
|
@click="switchValue"
|
|
52
|
-
class="relative inline-flex flex-shrink-0
|
|
66
|
+
class="focus:outline-none relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:opacity-50"
|
|
53
67
|
:disabled="disabled"
|
|
54
68
|
>
|
|
55
69
|
<span class="sr-only">Use setting</span>
|
|
56
70
|
<span
|
|
57
71
|
aria-hidden="true"
|
|
58
72
|
:class="{ 'translate-x-5': isToggle == 1, 'translate-x-0': isToggle == 0 }"
|
|
59
|
-
class="inline-block h-5 w-5 rounded-full bg-white
|
|
73
|
+
class="inline-block h-5 w-5 transform rounded-full bg-white ring-0 transition duration-200 ease-in-out"
|
|
60
74
|
></span>
|
|
61
75
|
</button>
|
|
62
|
-
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'"
|
|
76
|
+
<span class="flex flex-col disabled:opacity-50" id="toggleLabel" v-if="direction == 'right'">
|
|
63
77
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
64
78
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
65
79
|
</span>
|
|
@@ -91,6 +105,10 @@ export default {
|
|
|
91
105
|
direction: {
|
|
92
106
|
type: String,
|
|
93
107
|
},
|
|
108
|
+
disabled: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false,
|
|
111
|
+
},
|
|
94
112
|
},
|
|
95
113
|
data() {
|
|
96
114
|
return {
|