@lemonadejs/switch 1.3.0 → 1.4.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.
- package/dist/index.js +6 -0
- package/dist/react.d.ts +2 -2
- package/dist/style.css +21 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -19,6 +19,12 @@ if (!lemonade && typeof (require) === 'function') {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
self.onload = function() {
|
|
23
|
+
if (self.width) {
|
|
24
|
+
self.el.style.width = self.width;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
return `<label class="lm-switch" position="{{self.position}}">
|
|
23
29
|
<input type="checkbox" name="{{self.name}}" disabled="{{self.disabled}}" :bind="self.value" /> <span>{{self.text}}</span>
|
|
24
30
|
</label>`
|
package/dist/react.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ interface Switch {
|
|
|
11
11
|
[key: string]: any
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
type
|
|
14
|
+
type Props = IntrinsicAttributes & Component.Options & Switch;
|
|
15
15
|
|
|
16
|
-
declare function Switch<Switch>(props:
|
|
16
|
+
declare function Switch<Switch>(props: Props): any;
|
|
17
17
|
|
|
18
18
|
export default Switch;
|
package/dist/style.css
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
.lm-switch {
|
|
2
|
-
position: relative
|
|
3
|
-
display: inline-flex
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-flex;
|
|
4
4
|
z-index: 0;
|
|
5
5
|
align-items: center;
|
|
6
|
+
min-height: 40px;
|
|
7
|
+
min-width: 40px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.lm-switch:before {
|
|
11
|
+
content: '';
|
|
12
|
+
min-height: 1em;
|
|
6
13
|
}
|
|
7
14
|
|
|
8
15
|
.lm-switch > input {
|
|
@@ -14,10 +21,10 @@
|
|
|
14
21
|
margin: 0;
|
|
15
22
|
display: block;
|
|
16
23
|
border-radius: 50%;
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
19
|
-
max-width:
|
|
20
|
-
max-height:
|
|
24
|
+
width: 30px;
|
|
25
|
+
height: 30px;
|
|
26
|
+
max-width: 30px;
|
|
27
|
+
max-height: 30px;
|
|
21
28
|
outline: none;
|
|
22
29
|
opacity: 0;
|
|
23
30
|
transform: scale(1);
|
|
@@ -32,6 +39,8 @@
|
|
|
32
39
|
cursor: pointer;
|
|
33
40
|
margin: 0 0 0 45px;
|
|
34
41
|
align-items: center;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
max-width: -webkit-fill-available;
|
|
35
44
|
}
|
|
36
45
|
|
|
37
46
|
.lm-switch > span:empty {
|
|
@@ -62,10 +71,15 @@
|
|
|
62
71
|
}
|
|
63
72
|
|
|
64
73
|
.lm-switch > input:checked {
|
|
65
|
-
left:
|
|
74
|
+
left: 11px;
|
|
66
75
|
background-color: var(--lm-main-color, #2196f3);
|
|
67
76
|
}
|
|
68
77
|
|
|
78
|
+
.lm-switch > input:not(:checked) {
|
|
79
|
+
left: -5px;
|
|
80
|
+
background-color: var(--lm-secondary-color, #6A6A6A);
|
|
81
|
+
}
|
|
82
|
+
|
|
69
83
|
.lm-switch > input:checked + span::before {
|
|
70
84
|
background-color: var(--lm-main-color-alpha, #2196f388);
|
|
71
85
|
}
|