@lemonadejs/switch 1.0.1 → 1.0.2
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/index.js +1 -1
- package/dist/style.css +30 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ if (!lemonade && typeof (require) === 'function') {
|
|
|
10
10
|
const Switch = function () {
|
|
11
11
|
let self = this;
|
|
12
12
|
|
|
13
|
-
return `<label class="lm-switch">
|
|
13
|
+
return `<label class="lm-switch" position="{{self.position}}">
|
|
14
14
|
<input type="checkbox" name="{{self.name}}" disabled="{{self.disabled}}" :bind="self.value"> <span>{{self.text}}</span>
|
|
15
15
|
</label>`
|
|
16
16
|
}
|
package/dist/style.css
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
.lm-switch {
|
|
2
2
|
position: relative;
|
|
3
|
-
display: inline-
|
|
3
|
+
display: inline-flex;
|
|
4
4
|
z-index: 0;
|
|
5
|
+
align-items: center;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.lm-switch > input {
|
|
8
9
|
appearance: none;
|
|
9
10
|
-moz-appearance: none;
|
|
10
11
|
-webkit-appearance: none;
|
|
11
|
-
z-index: -1;
|
|
12
12
|
position: absolute;
|
|
13
|
-
|
|
14
|
-
top: -8px;
|
|
15
|
-
display: block;
|
|
13
|
+
left: 0;
|
|
16
14
|
margin: 0;
|
|
15
|
+
display: block;
|
|
17
16
|
border-radius: 50%;
|
|
18
17
|
width: 40px;
|
|
19
18
|
height: 40px;
|
|
@@ -27,11 +26,12 @@
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
.lm-switch > span {
|
|
30
|
-
display: inline-
|
|
29
|
+
display: inline-flex;
|
|
31
30
|
width: 100%;
|
|
32
31
|
line-height: 24px;
|
|
33
32
|
cursor: pointer;
|
|
34
|
-
margin: 0
|
|
33
|
+
margin: 0 0 0 45px;
|
|
34
|
+
align-items: center;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.lm-switch > span:empty {
|
|
@@ -40,22 +40,19 @@
|
|
|
40
40
|
|
|
41
41
|
.lm-switch > span::before {
|
|
42
42
|
content: "";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
margin: 5px 0 5px 0;
|
|
43
|
+
position: absolute;
|
|
44
|
+
left: 0;
|
|
46
45
|
border-radius: 7px;
|
|
47
46
|
width: 36px;
|
|
48
47
|
height: 14px;
|
|
49
48
|
background-color: rgba(var(--lm-switch-front-color, 0,0,0), 0.38);
|
|
50
|
-
vertical-align: top;
|
|
51
49
|
transition: background-color 0.2s, opacity 0.2s;
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
.lm-switch > span::after {
|
|
55
53
|
content: "";
|
|
56
54
|
position: absolute;
|
|
57
|
-
|
|
58
|
-
right: 16px;
|
|
55
|
+
left: 0;
|
|
59
56
|
border-radius: 50%;
|
|
60
57
|
width: 20px;
|
|
61
58
|
height: 20px;
|
|
@@ -65,7 +62,7 @@
|
|
|
65
62
|
}
|
|
66
63
|
|
|
67
64
|
.lm-switch > input:checked {
|
|
68
|
-
|
|
65
|
+
left: 6px;
|
|
69
66
|
background-color: rgb(var(--pure-material-primary-rgb, 33,150,243));
|
|
70
67
|
}
|
|
71
68
|
|
|
@@ -122,3 +119,22 @@
|
|
|
122
119
|
.lm-switch > input:checked:disabled + span::before {
|
|
123
120
|
background-color: rgba(var(--pure-material-primary-rgb,33,150,243), 0.6);
|
|
124
121
|
}
|
|
122
|
+
|
|
123
|
+
.lm-switch[position="right"] > span {
|
|
124
|
+
margin: 0 45px 0 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.lm-switch[position="right"] > input {
|
|
128
|
+
left: initial;
|
|
129
|
+
right: -11px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.lm-switch[position="right"] > span::before {
|
|
133
|
+
left: initial;
|
|
134
|
+
right: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.lm-switch[position="right"] > span::after {
|
|
138
|
+
left: initial;
|
|
139
|
+
right: 16px;
|
|
140
|
+
}
|
package/package.json
CHANGED