@tuya-miniapp/smart-ui 2.6.4-beta-10 → 2.7.0-beta-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/loading/index.css +1 -1
- package/dist/loading/index.js +5 -5
- package/dist/loading/index.wxs +5 -5
- package/dist/loading/index.wxss +1 -1
- package/dist/picker/index.js +2 -2
- package/dist/picker-column/index.js +38 -40
- package/dist/picker-column/index.wxml +2 -2
- package/dist/popover/index.js +5 -1
- package/dist/popover/index.wxml +1 -1
- package/dist/switch/index.css +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.wxml +14 -2
- package/dist/switch/index.wxss +1 -1
- package/lib/loading/index.css +1 -1
- package/lib/loading/index.js +5 -5
- package/lib/loading/index.wxs +5 -5
- package/lib/loading/index.wxss +1 -1
- package/lib/picker/index.js +2 -4
- package/lib/picker-column/index.js +38 -40
- package/lib/picker-column/index.wxml +2 -2
- package/lib/popover/index.js +5 -1
- package/lib/popover/index.wxml +1 -1
- package/lib/switch/index.css +1 -1
- package/lib/switch/index.js +2 -0
- package/lib/switch/index.wxml +14 -2
- package/lib/switch/index.wxss +1 -1
- package/package.json +1 -1
package/dist/loading/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#1989fa);display:inline-flex;justify-content:center}.smart-loading__spinner{animation:smart-rotate var(--loading-spinner-animation-duration,.8s) linear infinite;background:var(--loading-spinner-color,#1989fa);box-sizing:border-box;height:var(--loading-spinner-size,30px);max-height:100%;max-width:100%;position:relative;width:var(--loading-spinner-size,30px)}.smart-loading__spinner--spinner{animation-timing-function:steps(8)}.smart-loading__loading{background:var(--loading-spinner-color,#1989fa)}.smart-loading__text{color:var(--loading-text-color,#969799);font-size:var(--loading-text-font-size,14px);line-height:var(--loading-text-line-height,20px);margin-left:var(--padding-xs,8px)}.smart-loading__text:empty{display:none}.smart-loading--vertical{flex-direction:column}.smart-loading--vertical .smart-loading__text{margin:var(--padding-xs,8px) 0 0}@keyframes smart-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
|
package/dist/loading/index.js
CHANGED
|
@@ -3,7 +3,7 @@ SmartComponent({
|
|
|
3
3
|
props: {
|
|
4
4
|
color: {
|
|
5
5
|
type: String,
|
|
6
|
-
value: '#1989FA'
|
|
6
|
+
value: 'var(--loading-text-color, #1989FA)',
|
|
7
7
|
},
|
|
8
8
|
vertical: Boolean,
|
|
9
9
|
type: {
|
|
@@ -18,12 +18,12 @@ SmartComponent({
|
|
|
18
18
|
},
|
|
19
19
|
data: {
|
|
20
20
|
spinner: '',
|
|
21
|
-
circular: ''
|
|
21
|
+
circular: '',
|
|
22
22
|
},
|
|
23
23
|
created() {
|
|
24
24
|
this.setData({
|
|
25
25
|
spinner: this.SpinnerLoading({ color: this.data.color }),
|
|
26
|
-
circular: this.CircularLoading({ color: this.data.color })
|
|
26
|
+
circular: this.CircularLoading({ color: this.data.color }),
|
|
27
27
|
});
|
|
28
28
|
},
|
|
29
29
|
methods: {
|
|
@@ -35,6 +35,6 @@ SmartComponent({
|
|
|
35
35
|
},
|
|
36
36
|
SpinnerLoading({ color = '#3678E3' }) {
|
|
37
37
|
return this.createSvgIcon(`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="32" height="32" viewBox="0 0 32 32"><defs><clipPath id="master_svg0_1695_29273"><rect x="0" y="0" width="32" height="32" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_1695_29273)"><g><path d="M14.73077392578125,8.807690000000001L14.73077392578125,6.26923C14.73077392578125,5.568254,15.29902692578125,5,16.00000392578125,5C16.70097392578125,5,17.26923392578125,5.568254,17.26923392578125,6.26923L17.26923392578125,8.807690000000001C17.26923392578125,9.50867,16.70097392578125,10.07693,16.00000392578125,10.07693C15.29902692578125,10.07693,14.73077392578125,9.50867,14.73077392578125,8.807690000000001Z" fill="${color}" fill-opacity="1"/></g><g transform="matrix(0.7071067690849304,0.7071067690849304,-0.7071067690849304,0.7071067690849304,11.880707750418878,-14.033822285849965)" style="opacity:0.05000000074505806;"><path d="M22.88067626953125,11.132061337890626L22.88067626953125,8.593601337890625C22.88067626953125,7.892624337890625,23.44892926953125,7.324371337890625,24.14990626953125,7.324371337890625C24.85088626953125,7.324371337890625,25.41913626953125,7.892624337890625,25.41913626953125,8.593601337890625L25.41913626953125,11.132061337890626C25.41913626953125,11.833041337890625,24.85088626953125,12.401291337890626,24.14990626953125,12.401291337890626C23.44892926953125,12.401291337890626,22.88067626953125,11.833041337890625,22.88067626953125,11.132061337890626Z" fill="${color}" fill-opacity="1"/></g><g transform="matrix(0,1,-1,0,41.73081970214844,-12.269180297851562)" style="opacity:0.10000000149011612;"><path d="M27,18.53850970214844L27,16.000049702148438C27,15.299072702148438,27.568253,14.730819702148438,28.26923,14.730819702148438C28.97021,14.730819702148438,29.53846,15.299072702148438,29.53846,16.000049702148438L29.53846,18.53850970214844C29.53846,19.23948970214844,28.97021,19.80773970214844,28.26923,19.80773970214844C27.568253,19.80773970214844,27,19.23948970214844,27,18.53850970214844Z" fill="${color}" fill-opacity="1"/></g><g transform="matrix(-0.7071067690849304,0.7071067690849304,-0.7071067690849304,-0.7071067690849304,58.30294381839121,21.611726407169044)" style="opacity:0.15000000596046448;"><path d="M24.675537109375,26.68848833984375L24.675537109375,24.15002833984375C24.675537109375,23.44905133984375,25.243790109375,22.88079833984375,25.944767109375,22.88079833984375C26.645747109375,22.88079833984375,27.213997109375,23.44905133984375,27.213997109375,24.15002833984375L27.213997109375,26.68848833984375C27.213997109375,27.389468339843752,26.645747109375,27.95771833984375,25.944767109375,27.95771833984375C25.243790109375,27.95771833984375,24.675537109375,27.389468339843752,24.675537109375,26.68848833984375Z" fill="${color}" fill-opacity="1"/></g><g transform="matrix(-1,0,0,-1,34.5384521484375,54)" style="opacity:0.30000001192092896;"><path d="M17.26922607421875,30.80769L17.26922607421875,28.26923C17.26922607421875,27.568254,17.83747907421875,27,18.53845607421875,27C19.23942607421875,27,19.80768607421875,27.568254,19.80768607421875,28.26923L19.80768607421875,30.80769C19.80768607421875,31.508670000000002,19.23942607421875,32.07693,18.53845607421875,32.07693C17.83747907421875,32.07693,17.26922607421875,31.508670000000002,17.26922607421875,30.80769Z" fill="${color}" fill-opacity="1"/></g><g transform="matrix(-0.7071068286895752,-0.7071067094802856,0.7071067094802856,-0.7071068286895752,-1.8805817391439632,48.572416538932885)" style="opacity:0.550000011920929;"><path d="M9.119384765625,28.483379697265626L9.119384765625,25.944919697265625C9.119384765625,25.243942697265624,9.687637765625,24.675689697265625,10.388614765625,24.675689697265625C11.089594765625,24.675689697265625,11.657844765625,25.243942697265624,11.657844765625,25.944919697265625L11.657844765625,28.483379697265626C11.657844765625,29.184359697265627,11.089594765625,29.752609697265626,10.388614765625,29.752609697265626C9.687637765625,29.752609697265626,9.119384765625,29.184359697265627,9.119384765625,28.483379697265626Z" fill="${color}" fill-opacity="1"/></g><g transform="matrix(0,-1,1,0,-12.269241333007812,22.269241333007812)" style="opacity:0.699999988079071;"><path d="M5,21.076931333007813L5,18.538471333007813C5,17.83749433300781,5.568253,17.269241333007812,6.26923,17.269241333007812C6.97021,17.269241333007812,7.538460000000001,17.83749433300781,7.538460000000001,18.538471333007813L7.538460000000001,21.076931333007813C7.538460000000001,21.777911333007815,6.97021,22.346161333007814,6.26923,22.346161333007814C5.568253,22.346161333007814,5,21.777911333007815,5,21.076931333007813Z" fill="${color}" fill-opacity="1"/></g><g transform="matrix(0.7071066498756409,-0.70710688829422,0.70710688829422,0.7071066498756409,-4.303046450104375,7.850115344526785)" style="opacity:0.8500000238418579;"><path d="M7.32440185546875,12.926983212890626L7.32440185546875,10.388523212890625C7.32440185546875,9.687546212890625,7.89265485546875,9.119293212890625,8.59363185546875,9.119293212890625C9.29461185546875,9.119293212890625,9.86286185546875,9.687546212890625,9.86286185546875,10.388523212890625L9.86286185546875,12.926983212890626C9.86286185546875,13.627963212890625,9.29461185546875,14.196213212890626,8.59363185546875,14.196213212890626C7.89265485546875,14.196213212890626,7.32440185546875,13.627963212890625,7.32440185546875,12.926983212890626Z" fill="${color}" fill-opacity="1"/></g></g></svg>`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
40
|
});
|
package/dist/loading/index.wxs
CHANGED
|
@@ -12,21 +12,21 @@ function textStyle(data) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function loadingStyle(data) {
|
|
15
|
-
var iconSrc = ''
|
|
15
|
+
var iconSrc = '';
|
|
16
16
|
|
|
17
17
|
if (data.type === 'spinner') {
|
|
18
|
-
iconSrc = data.spinner
|
|
18
|
+
iconSrc = data.spinner;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
if (data.type === 'circular') {
|
|
22
|
-
iconSrc = data.circular
|
|
22
|
+
iconSrc = data.circular;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var ret = style({
|
|
26
|
-
'
|
|
26
|
+
'mask-image': "url('".concat(iconSrc, "')"),
|
|
27
27
|
width: addUnit(data.size),
|
|
28
28
|
height: addUnit(data.size),
|
|
29
|
-
'
|
|
29
|
+
'mask-size': addUnit(data.size),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
return ret;
|
package/dist/loading/index.wxss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#1989fa);display:inline-flex;justify-content:center}.smart-loading__spinner{animation:smart-rotate var(--loading-spinner-animation-duration,.8s) linear infinite;background:var(--loading-spinner-color,#1989fa);box-sizing:border-box;height:var(--loading-spinner-size,30px);max-height:100%;max-width:100%;position:relative;width:var(--loading-spinner-size,30px)}.smart-loading__spinner--spinner{animation-timing-function:steps(8)}.smart-loading__loading{background:var(--loading-spinner-color,#1989fa)}.smart-loading__text{color:var(--loading-text-color,#969799);font-size:var(--loading-text-font-size,14px);line-height:var(--loading-text-line-height,20px);margin-left:var(--padding-xs,8px)}.smart-loading__text:empty{display:none}.smart-loading--vertical{flex-direction:column}.smart-loading--vertical .smart-loading__text{margin:var(--padding-xs,8px) 0 0}@keyframes smart-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
|
package/dist/picker/index.js
CHANGED
|
@@ -100,7 +100,7 @@ SmartComponent({
|
|
|
100
100
|
},
|
|
101
101
|
// get column option index by column index
|
|
102
102
|
getColumnIndex(columnIndex) {
|
|
103
|
-
return (this.getColumn(columnIndex) || {}).data.
|
|
103
|
+
return (this.getColumn(columnIndex) || {}).data.currentIndex;
|
|
104
104
|
},
|
|
105
105
|
// set column option index by column index
|
|
106
106
|
setColumnIndex(columnIndex, optionIndex) {
|
|
@@ -141,7 +141,7 @@ SmartComponent({
|
|
|
141
141
|
},
|
|
142
142
|
// get indexes of all columns
|
|
143
143
|
getIndexes() {
|
|
144
|
-
return this.children.map(child => child.data.
|
|
144
|
+
return this.children.map(child => child.data.currentIndex);
|
|
145
145
|
},
|
|
146
146
|
// set indexes of all columns
|
|
147
147
|
setIndexes(indexes) {
|
|
@@ -28,7 +28,8 @@ SmartComponent({
|
|
|
28
28
|
if (!this.data.isInit)
|
|
29
29
|
return;
|
|
30
30
|
this.updateUint(value);
|
|
31
|
-
this.
|
|
31
|
+
this.updateCurrentIndex(this.data.currentIndex);
|
|
32
|
+
this.updateVisibleOptions();
|
|
32
33
|
},
|
|
33
34
|
},
|
|
34
35
|
defaultIndex: {
|
|
@@ -45,10 +46,11 @@ SmartComponent({
|
|
|
45
46
|
},
|
|
46
47
|
activeIndex: {
|
|
47
48
|
type: null,
|
|
48
|
-
observer() {
|
|
49
|
+
observer(activeIndex) {
|
|
49
50
|
if (!this.data.isInit)
|
|
50
51
|
return;
|
|
51
|
-
this.
|
|
52
|
+
this.updateCurrentIndex(activeIndex);
|
|
53
|
+
this.updateVisibleOptions();
|
|
52
54
|
},
|
|
53
55
|
},
|
|
54
56
|
unit: {
|
|
@@ -68,14 +70,8 @@ SmartComponent({
|
|
|
68
70
|
isInit: false,
|
|
69
71
|
maxText: '',
|
|
70
72
|
optionsVIndexList: [],
|
|
71
|
-
offsetActiveIndex: 0,
|
|
72
|
-
endTimer: null,
|
|
73
|
-
offsetList: [],
|
|
74
|
-
moving: false,
|
|
75
|
-
movingDirection: 'down',
|
|
76
|
-
startY: 0,
|
|
77
|
-
offsetting: 0,
|
|
78
73
|
animationIndex: 0,
|
|
74
|
+
currentIndex: 0,
|
|
79
75
|
isDestroy: false,
|
|
80
76
|
},
|
|
81
77
|
created() {
|
|
@@ -83,7 +79,10 @@ SmartComponent({
|
|
|
83
79
|
instanceId: getId(),
|
|
84
80
|
});
|
|
85
81
|
this.updateUint(this.data.options);
|
|
86
|
-
this.
|
|
82
|
+
const { activeIndex, defaultIndex } = this.data;
|
|
83
|
+
const currIndex = activeIndex !== null ? activeIndex : defaultIndex;
|
|
84
|
+
this.updateCurrentIndex(currIndex);
|
|
85
|
+
this.updateVisibleOptions();
|
|
87
86
|
this.setData({
|
|
88
87
|
isInit: true,
|
|
89
88
|
});
|
|
@@ -94,34 +93,33 @@ SmartComponent({
|
|
|
94
93
|
});
|
|
95
94
|
},
|
|
96
95
|
methods: {
|
|
97
|
-
|
|
98
|
-
const { activeIndex, defaultIndex } = this.data;
|
|
96
|
+
updateCurrentIndex(currIndex) {
|
|
99
97
|
const count = this.data.options.length;
|
|
100
|
-
const currIndex = activeIndex !== null ? activeIndex : defaultIndex;
|
|
101
98
|
let animationIndex = this.getAnimationIndex(currIndex);
|
|
102
99
|
animationIndex = this.adjustIndex(animationIndex);
|
|
103
100
|
let currActiveIndex = this.data.loop ? ((animationIndex + 1) % count) - 1 : animationIndex;
|
|
104
101
|
if (currActiveIndex < 0) {
|
|
105
102
|
currActiveIndex += count;
|
|
106
103
|
}
|
|
107
|
-
const optionsVIndexList = this.getVisibleOptions(animationIndex);
|
|
108
104
|
this.setData({
|
|
109
|
-
|
|
105
|
+
currentIndex: currActiveIndex,
|
|
110
106
|
animationIndex: animationIndex,
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
updateVisibleOptions() {
|
|
110
|
+
const optionsVIndexList = this.getVisibleOptions(this.data.animationIndex);
|
|
111
|
+
this.setData({
|
|
111
112
|
optionsVIndexList: optionsVIndexList,
|
|
112
113
|
});
|
|
113
|
-
// if (currActiveIndex !== activeIndex) {
|
|
114
|
-
// this.$emit('change', currActiveIndex);
|
|
115
|
-
// }
|
|
116
114
|
},
|
|
117
|
-
getAnimationIndex(
|
|
115
|
+
getAnimationIndex(currentIndex) {
|
|
118
116
|
const { animationIndex } = this.data;
|
|
119
117
|
const length = this.data.options.length || 1;
|
|
120
118
|
if (this.data.loop) {
|
|
121
|
-
const newAnimationIndex = this.getNewAnimationIndex(animationIndex,
|
|
119
|
+
const newAnimationIndex = this.getNewAnimationIndex(animationIndex, currentIndex, length, this.data.loop);
|
|
122
120
|
return newAnimationIndex;
|
|
123
121
|
}
|
|
124
|
-
return
|
|
122
|
+
return currentIndex;
|
|
125
123
|
},
|
|
126
124
|
getCount() {
|
|
127
125
|
return this.data.options.length;
|
|
@@ -224,12 +222,12 @@ SmartComponent({
|
|
|
224
222
|
}
|
|
225
223
|
return newArr;
|
|
226
224
|
},
|
|
227
|
-
getNewAnimationIndex(animationIndex,
|
|
228
|
-
const curOptionsNewIndex = Math.floor((animationIndex + 1) / length) * length +
|
|
225
|
+
getNewAnimationIndex(animationIndex, currentIndex, length, loop) {
|
|
226
|
+
const curOptionsNewIndex = Math.floor((animationIndex + 1) / length) * length + currentIndex;
|
|
229
227
|
const preOptionsNewIndex = curOptionsNewIndex - length;
|
|
230
228
|
const afterOptionsNewIndex = curOptionsNewIndex + length;
|
|
231
229
|
const newAnimationIndex = !loop
|
|
232
|
-
?
|
|
230
|
+
? currentIndex
|
|
233
231
|
: Math.abs(preOptionsNewIndex - animationIndex) >
|
|
234
232
|
Math.abs(curOptionsNewIndex - animationIndex)
|
|
235
233
|
? Math.abs(curOptionsNewIndex - animationIndex) >
|
|
@@ -259,12 +257,12 @@ SmartComponent({
|
|
|
259
257
|
}
|
|
260
258
|
return 0;
|
|
261
259
|
}
|
|
262
|
-
const
|
|
263
|
-
for (let i =
|
|
260
|
+
const currentIndex = range(index, 0, count);
|
|
261
|
+
for (let i = currentIndex; i < count; i++) {
|
|
264
262
|
if (!this.isDisabled(data.options[i]) && data.options[i] !== undefined)
|
|
265
263
|
return i;
|
|
266
264
|
}
|
|
267
|
-
for (let i =
|
|
265
|
+
for (let i = currentIndex - 1; i >= 0; i--) {
|
|
268
266
|
if (!this.isDisabled(data.options[i]) && data.options[i] !== undefined)
|
|
269
267
|
return i;
|
|
270
268
|
}
|
|
@@ -287,29 +285,29 @@ SmartComponent({
|
|
|
287
285
|
return Promise.resolve();
|
|
288
286
|
},
|
|
289
287
|
setIndex(index) {
|
|
290
|
-
let
|
|
291
|
-
if (
|
|
292
|
-
|
|
288
|
+
let currentIndex = ((index + 1) % this.data.options.length) - 1;
|
|
289
|
+
if (currentIndex < 0) {
|
|
290
|
+
currentIndex += this.data.options.length;
|
|
293
291
|
}
|
|
294
292
|
this.setData({
|
|
295
|
-
|
|
293
|
+
currentIndex,
|
|
296
294
|
animationIndex: index,
|
|
297
295
|
});
|
|
298
296
|
},
|
|
299
297
|
getValue() {
|
|
300
298
|
const { data } = this;
|
|
301
|
-
return isObj(data.options[data.
|
|
302
|
-
? data.options[data.
|
|
303
|
-
: data.options[data.
|
|
299
|
+
return isObj(data.options[data.currentIndex])
|
|
300
|
+
? data.options[data.currentIndex][data.valueKey]
|
|
301
|
+
: data.options[data.currentIndex];
|
|
304
302
|
},
|
|
305
303
|
activeIndexChange(index) {
|
|
306
|
-
let
|
|
307
|
-
if (
|
|
308
|
-
|
|
304
|
+
let currentIndex = ((index + 1) % this.data.options.length) - 1;
|
|
305
|
+
if (currentIndex < 0) {
|
|
306
|
+
currentIndex += this.data.options.length;
|
|
309
307
|
}
|
|
310
|
-
const isSame =
|
|
308
|
+
const isSame = currentIndex === this.data.activeIndex;
|
|
311
309
|
this.setData({
|
|
312
|
-
|
|
310
|
+
currentIndex,
|
|
313
311
|
animationIndex: index,
|
|
314
312
|
});
|
|
315
313
|
!isSame && this.$emit('change', index);
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
data-valuekey="{{valueKey}}"
|
|
13
13
|
data-itemheight="{{itemHeight}}"
|
|
14
14
|
data-visibleitemcount="{{visibleItemCount}}"
|
|
15
|
-
data-activeindex="{{
|
|
15
|
+
data-activeindex="{{currentIndex}}"
|
|
16
16
|
data-loop="{{loop}}"
|
|
17
17
|
data-animationtime="{{animationTime}}"
|
|
18
18
|
isdestroy="{{isDestroy}}"
|
|
19
19
|
options="{{options}}"
|
|
20
|
-
activeindex="{{
|
|
20
|
+
activeindex="{{currentIndex}}"
|
|
21
21
|
changeanimation="{{changeAnimation}}"
|
|
22
22
|
loop="{{loop}}"
|
|
23
23
|
valuekey="{{valueKey}}"
|
package/dist/popover/index.js
CHANGED
|
@@ -54,7 +54,7 @@ SmartComponent({
|
|
|
54
54
|
},
|
|
55
55
|
duration: {
|
|
56
56
|
type: Number,
|
|
57
|
-
value:
|
|
57
|
+
value: 3000,
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
data: { currentShow: false, showStyle: '', cancel_timer: null },
|
|
@@ -190,6 +190,10 @@ SmartComponent({
|
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
192
|
onClose() {
|
|
193
|
+
if (this.data.cancel_timer) {
|
|
194
|
+
clearTimeout(this.data.cancel_timer);
|
|
195
|
+
this.data.cancel_timer = null;
|
|
196
|
+
}
|
|
193
197
|
this.setData({
|
|
194
198
|
showStyle: 'opacity: 0;',
|
|
195
199
|
});
|
package/dist/popover/index.wxml
CHANGED
package/dist/switch/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,var(--app-B3,#fff));display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,var(--app-B3,#fff));display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));left:calc(100% - var(--switch-node-size, .867em))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
package/dist/switch/index.js
CHANGED
package/dist/switch/index.wxml
CHANGED
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
<block wx:if="{{stopClickPropagation}}">
|
|
5
5
|
<view
|
|
6
|
-
class="{{ utils.bem('switch', { on: checked === activeValue, disabled }) }} custom-class"
|
|
6
|
+
class="{{ utils.bem('switch', { on: checked === activeValue, disabled, label: activeText || inactiveText }) }} custom-class"
|
|
7
7
|
style="{{ computed.rootStyle({ size, checked, activeColor, inactiveColor, activeValue }) }}"
|
|
8
8
|
catch:tap="onClick"
|
|
9
9
|
>
|
|
10
10
|
<view class="smart-switch__center">
|
|
11
|
+
<view wx:if="{{ activeText }}" style="opacity: {{checked ? '1' : '0'}}" class="smart-switch__label_active">
|
|
12
|
+
<text class="smart-switch__label_text">{{ activeText }}</text>
|
|
13
|
+
</view>
|
|
14
|
+
<view wx:if="{{ inactiveText }}" style="opacity: {{!checked ? '1' : '0'}}" class="smart-switch__label_inactive">
|
|
15
|
+
<text class="smart-switch__label_text">{{ inactiveText }}</text>
|
|
16
|
+
</view>
|
|
11
17
|
<view class="smart-switch__node node-class">
|
|
12
18
|
<smart-loading
|
|
13
19
|
wx:if="{{ loading }}"
|
|
@@ -20,11 +26,17 @@
|
|
|
20
26
|
</block>
|
|
21
27
|
<block wx:else>
|
|
22
28
|
<view
|
|
23
|
-
class="{{ utils.bem('switch', { on: checked === activeValue, disabled }) }} custom-class"
|
|
29
|
+
class="{{ utils.bem('switch', { on: checked === activeValue, disabled, label: activeText || inactiveText }) }} custom-class"
|
|
24
30
|
style="{{ computed.rootStyle({ size, checked, activeColor, inactiveColor, activeValue }) }}"
|
|
25
31
|
bind:tap="onClick"
|
|
26
32
|
>
|
|
27
33
|
<view class="smart-switch__center">
|
|
34
|
+
<view wx:if="{{ activeText }}" style="opacity: {{checked ? '1' : '0'}}" class="smart-switch__label_active">
|
|
35
|
+
<text class="smart-switch__label_text">{{ activeText }}</text>
|
|
36
|
+
</view>
|
|
37
|
+
<view wx:if="{{ inactiveText }}" style="opacity: {{!checked ? '1' : '0'}}" class="smart-switch__label_inactive">
|
|
38
|
+
<text class="smart-switch__label_text">{{ inactiveText }}</text>
|
|
39
|
+
</view>
|
|
28
40
|
<view class="smart-switch__node node-class">
|
|
29
41
|
<smart-loading
|
|
30
42
|
wx:if="{{ loading }}"
|
package/dist/switch/index.wxss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,var(--app-B3,#fff));display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,var(--app-B3,#fff));display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));left:calc(100% - var(--switch-node-size, .867em))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
package/lib/loading/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#1989fa);display:inline-flex;justify-content:center}.smart-loading__spinner{animation:smart-rotate var(--loading-spinner-animation-duration,.8s) linear infinite;background:var(--loading-spinner-color,#1989fa);box-sizing:border-box;height:var(--loading-spinner-size,30px);max-height:100%;max-width:100%;position:relative;width:var(--loading-spinner-size,30px)}.smart-loading__spinner--spinner{animation-timing-function:steps(8)}.smart-loading__loading{background:var(--loading-spinner-color,#1989fa)}.smart-loading__text{color:var(--loading-text-color,#969799);font-size:var(--loading-text-font-size,14px);line-height:var(--loading-text-line-height,20px);margin-left:var(--padding-xs,8px)}.smart-loading__text:empty{display:none}.smart-loading--vertical{flex-direction:column}.smart-loading--vertical .smart-loading__text{margin:var(--padding-xs,8px) 0 0}@keyframes smart-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
|
package/lib/loading/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var component_1 = require("../common/component");
|
|
|
5
5
|
props: {
|
|
6
6
|
color: {
|
|
7
7
|
type: String,
|
|
8
|
-
value: '#1989FA'
|
|
8
|
+
value: 'var(--loading-text-color, #1989FA)',
|
|
9
9
|
},
|
|
10
10
|
vertical: Boolean,
|
|
11
11
|
type: {
|
|
@@ -20,12 +20,12 @@ var component_1 = require("../common/component");
|
|
|
20
20
|
},
|
|
21
21
|
data: {
|
|
22
22
|
spinner: '',
|
|
23
|
-
circular: ''
|
|
23
|
+
circular: '',
|
|
24
24
|
},
|
|
25
25
|
created: function () {
|
|
26
26
|
this.setData({
|
|
27
27
|
spinner: this.SpinnerLoading({ color: this.data.color }),
|
|
28
|
-
circular: this.CircularLoading({ color: this.data.color })
|
|
28
|
+
circular: this.CircularLoading({ color: this.data.color }),
|
|
29
29
|
});
|
|
30
30
|
},
|
|
31
31
|
methods: {
|
|
@@ -39,6 +39,6 @@ var component_1 = require("../common/component");
|
|
|
39
39
|
SpinnerLoading: function (_a) {
|
|
40
40
|
var _b = _a.color, color = _b === void 0 ? '#3678E3' : _b;
|
|
41
41
|
return this.createSvgIcon("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" fill=\"none\" version=\"1.1\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\"><defs><clipPath id=\"master_svg0_1695_29273\"><rect x=\"0\" y=\"0\" width=\"32\" height=\"32\" rx=\"0\"/></clipPath></defs><g clip-path=\"url(#master_svg0_1695_29273)\"><g><path d=\"M14.73077392578125,8.807690000000001L14.73077392578125,6.26923C14.73077392578125,5.568254,15.29902692578125,5,16.00000392578125,5C16.70097392578125,5,17.26923392578125,5.568254,17.26923392578125,6.26923L17.26923392578125,8.807690000000001C17.26923392578125,9.50867,16.70097392578125,10.07693,16.00000392578125,10.07693C15.29902692578125,10.07693,14.73077392578125,9.50867,14.73077392578125,8.807690000000001Z\" fill=\"".concat(color, "\" fill-opacity=\"1\"/></g><g transform=\"matrix(0.7071067690849304,0.7071067690849304,-0.7071067690849304,0.7071067690849304,11.880707750418878,-14.033822285849965)\" style=\"opacity:0.05000000074505806;\"><path d=\"M22.88067626953125,11.132061337890626L22.88067626953125,8.593601337890625C22.88067626953125,7.892624337890625,23.44892926953125,7.324371337890625,24.14990626953125,7.324371337890625C24.85088626953125,7.324371337890625,25.41913626953125,7.892624337890625,25.41913626953125,8.593601337890625L25.41913626953125,11.132061337890626C25.41913626953125,11.833041337890625,24.85088626953125,12.401291337890626,24.14990626953125,12.401291337890626C23.44892926953125,12.401291337890626,22.88067626953125,11.833041337890625,22.88067626953125,11.132061337890626Z\" fill=\"").concat(color, "\" fill-opacity=\"1\"/></g><g transform=\"matrix(0,1,-1,0,41.73081970214844,-12.269180297851562)\" style=\"opacity:0.10000000149011612;\"><path d=\"M27,18.53850970214844L27,16.000049702148438C27,15.299072702148438,27.568253,14.730819702148438,28.26923,14.730819702148438C28.97021,14.730819702148438,29.53846,15.299072702148438,29.53846,16.000049702148438L29.53846,18.53850970214844C29.53846,19.23948970214844,28.97021,19.80773970214844,28.26923,19.80773970214844C27.568253,19.80773970214844,27,19.23948970214844,27,18.53850970214844Z\" fill=\"").concat(color, "\" fill-opacity=\"1\"/></g><g transform=\"matrix(-0.7071067690849304,0.7071067690849304,-0.7071067690849304,-0.7071067690849304,58.30294381839121,21.611726407169044)\" style=\"opacity:0.15000000596046448;\"><path d=\"M24.675537109375,26.68848833984375L24.675537109375,24.15002833984375C24.675537109375,23.44905133984375,25.243790109375,22.88079833984375,25.944767109375,22.88079833984375C26.645747109375,22.88079833984375,27.213997109375,23.44905133984375,27.213997109375,24.15002833984375L27.213997109375,26.68848833984375C27.213997109375,27.389468339843752,26.645747109375,27.95771833984375,25.944767109375,27.95771833984375C25.243790109375,27.95771833984375,24.675537109375,27.389468339843752,24.675537109375,26.68848833984375Z\" fill=\"").concat(color, "\" fill-opacity=\"1\"/></g><g transform=\"matrix(-1,0,0,-1,34.5384521484375,54)\" style=\"opacity:0.30000001192092896;\"><path d=\"M17.26922607421875,30.80769L17.26922607421875,28.26923C17.26922607421875,27.568254,17.83747907421875,27,18.53845607421875,27C19.23942607421875,27,19.80768607421875,27.568254,19.80768607421875,28.26923L19.80768607421875,30.80769C19.80768607421875,31.508670000000002,19.23942607421875,32.07693,18.53845607421875,32.07693C17.83747907421875,32.07693,17.26922607421875,31.508670000000002,17.26922607421875,30.80769Z\" fill=\"").concat(color, "\" fill-opacity=\"1\"/></g><g transform=\"matrix(-0.7071068286895752,-0.7071067094802856,0.7071067094802856,-0.7071068286895752,-1.8805817391439632,48.572416538932885)\" style=\"opacity:0.550000011920929;\"><path d=\"M9.119384765625,28.483379697265626L9.119384765625,25.944919697265625C9.119384765625,25.243942697265624,9.687637765625,24.675689697265625,10.388614765625,24.675689697265625C11.089594765625,24.675689697265625,11.657844765625,25.243942697265624,11.657844765625,25.944919697265625L11.657844765625,28.483379697265626C11.657844765625,29.184359697265627,11.089594765625,29.752609697265626,10.388614765625,29.752609697265626C9.687637765625,29.752609697265626,9.119384765625,29.184359697265627,9.119384765625,28.483379697265626Z\" fill=\"").concat(color, "\" fill-opacity=\"1\"/></g><g transform=\"matrix(0,-1,1,0,-12.269241333007812,22.269241333007812)\" style=\"opacity:0.699999988079071;\"><path d=\"M5,21.076931333007813L5,18.538471333007813C5,17.83749433300781,5.568253,17.269241333007812,6.26923,17.269241333007812C6.97021,17.269241333007812,7.538460000000001,17.83749433300781,7.538460000000001,18.538471333007813L7.538460000000001,21.076931333007813C7.538460000000001,21.777911333007815,6.97021,22.346161333007814,6.26923,22.346161333007814C5.568253,22.346161333007814,5,21.777911333007815,5,21.076931333007813Z\" fill=\"").concat(color, "\" fill-opacity=\"1\"/></g><g transform=\"matrix(0.7071066498756409,-0.70710688829422,0.70710688829422,0.7071066498756409,-4.303046450104375,7.850115344526785)\" style=\"opacity:0.8500000238418579;\"><path d=\"M7.32440185546875,12.926983212890626L7.32440185546875,10.388523212890625C7.32440185546875,9.687546212890625,7.89265485546875,9.119293212890625,8.59363185546875,9.119293212890625C9.29461185546875,9.119293212890625,9.86286185546875,9.687546212890625,9.86286185546875,10.388523212890625L9.86286185546875,12.926983212890626C9.86286185546875,13.627963212890625,9.29461185546875,14.196213212890626,8.59363185546875,14.196213212890626C7.89265485546875,14.196213212890626,7.32440185546875,13.627963212890625,7.32440185546875,12.926983212890626Z\" fill=\"").concat(color, "\" fill-opacity=\"1\"/></g></g></svg>"));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
44
|
});
|
package/lib/loading/index.wxs
CHANGED
|
@@ -12,21 +12,21 @@ function textStyle(data) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function loadingStyle(data) {
|
|
15
|
-
var iconSrc = ''
|
|
15
|
+
var iconSrc = '';
|
|
16
16
|
|
|
17
17
|
if (data.type === 'spinner') {
|
|
18
|
-
iconSrc = data.spinner
|
|
18
|
+
iconSrc = data.spinner;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
if (data.type === 'circular') {
|
|
22
|
-
iconSrc = data.circular
|
|
22
|
+
iconSrc = data.circular;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var ret = style({
|
|
26
|
-
'
|
|
26
|
+
'mask-image': "url('".concat(iconSrc, "')"),
|
|
27
27
|
width: addUnit(data.size),
|
|
28
28
|
height: addUnit(data.size),
|
|
29
|
-
'
|
|
29
|
+
'mask-size': addUnit(data.size),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
return ret;
|
package/lib/loading/index.wxss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{font-size:0;line-height:1}.smart-loading{align-items:center;color:var(--loading-spinner-color,#1989fa);display:inline-flex;justify-content:center}.smart-loading__spinner{animation:smart-rotate var(--loading-spinner-animation-duration,.8s) linear infinite;background:var(--loading-spinner-color,#1989fa);box-sizing:border-box;height:var(--loading-spinner-size,30px);max-height:100%;max-width:100%;position:relative;width:var(--loading-spinner-size,30px)}.smart-loading__spinner--spinner{animation-timing-function:steps(8)}.smart-loading__loading{background:var(--loading-spinner-color,#1989fa)}.smart-loading__text{color:var(--loading-text-color,#969799);font-size:var(--loading-text-font-size,14px);line-height:var(--loading-text-line-height,20px);margin-left:var(--padding-xs,8px)}.smart-loading__text:empty{display:none}.smart-loading--vertical{flex-direction:column}.smart-loading--vertical .smart-loading__text{margin:var(--padding-xs,8px) 0 0}@keyframes smart-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
|
package/lib/picker/index.js
CHANGED
|
@@ -118,7 +118,7 @@ var shared_1 = require("./shared");
|
|
|
118
118
|
},
|
|
119
119
|
// get column option index by column index
|
|
120
120
|
getColumnIndex: function (columnIndex) {
|
|
121
|
-
return (this.getColumn(columnIndex) || {}).data.
|
|
121
|
+
return (this.getColumn(columnIndex) || {}).data.currentIndex;
|
|
122
122
|
},
|
|
123
123
|
// set column option index by column index
|
|
124
124
|
setColumnIndex: function (columnIndex, optionIndex) {
|
|
@@ -161,9 +161,7 @@ var shared_1 = require("./shared");
|
|
|
161
161
|
},
|
|
162
162
|
// get indexes of all columns
|
|
163
163
|
getIndexes: function () {
|
|
164
|
-
return this.children.map(function (child) {
|
|
165
|
-
return child.data.activeIndex === null ? child.data.defaultIndex : child.data.activeIndex;
|
|
166
|
-
});
|
|
164
|
+
return this.children.map(function (child) { return child.data.currentIndex; });
|
|
167
165
|
},
|
|
168
166
|
// set indexes of all columns
|
|
169
167
|
setIndexes: function (indexes) {
|
|
@@ -33,7 +33,8 @@ var getId = function () {
|
|
|
33
33
|
if (!this.data.isInit)
|
|
34
34
|
return;
|
|
35
35
|
this.updateUint(value);
|
|
36
|
-
this.
|
|
36
|
+
this.updateCurrentIndex(this.data.currentIndex);
|
|
37
|
+
this.updateVisibleOptions();
|
|
37
38
|
},
|
|
38
39
|
},
|
|
39
40
|
defaultIndex: {
|
|
@@ -50,10 +51,11 @@ var getId = function () {
|
|
|
50
51
|
},
|
|
51
52
|
activeIndex: {
|
|
52
53
|
type: null,
|
|
53
|
-
observer: function () {
|
|
54
|
+
observer: function (activeIndex) {
|
|
54
55
|
if (!this.data.isInit)
|
|
55
56
|
return;
|
|
56
|
-
this.
|
|
57
|
+
this.updateCurrentIndex(activeIndex);
|
|
58
|
+
this.updateVisibleOptions();
|
|
57
59
|
},
|
|
58
60
|
},
|
|
59
61
|
unit: {
|
|
@@ -73,14 +75,8 @@ var getId = function () {
|
|
|
73
75
|
isInit: false,
|
|
74
76
|
maxText: '',
|
|
75
77
|
optionsVIndexList: [],
|
|
76
|
-
offsetActiveIndex: 0,
|
|
77
|
-
endTimer: null,
|
|
78
|
-
offsetList: [],
|
|
79
|
-
moving: false,
|
|
80
|
-
movingDirection: 'down',
|
|
81
|
-
startY: 0,
|
|
82
|
-
offsetting: 0,
|
|
83
78
|
animationIndex: 0,
|
|
79
|
+
currentIndex: 0,
|
|
84
80
|
isDestroy: false,
|
|
85
81
|
},
|
|
86
82
|
created: function () {
|
|
@@ -88,7 +84,10 @@ var getId = function () {
|
|
|
88
84
|
instanceId: getId(),
|
|
89
85
|
});
|
|
90
86
|
this.updateUint(this.data.options);
|
|
91
|
-
this.
|
|
87
|
+
var _a = this.data, activeIndex = _a.activeIndex, defaultIndex = _a.defaultIndex;
|
|
88
|
+
var currIndex = activeIndex !== null ? activeIndex : defaultIndex;
|
|
89
|
+
this.updateCurrentIndex(currIndex);
|
|
90
|
+
this.updateVisibleOptions();
|
|
92
91
|
this.setData({
|
|
93
92
|
isInit: true,
|
|
94
93
|
});
|
|
@@ -99,34 +98,33 @@ var getId = function () {
|
|
|
99
98
|
});
|
|
100
99
|
},
|
|
101
100
|
methods: {
|
|
102
|
-
|
|
103
|
-
var _a = this.data, activeIndex = _a.activeIndex, defaultIndex = _a.defaultIndex;
|
|
101
|
+
updateCurrentIndex: function (currIndex) {
|
|
104
102
|
var count = this.data.options.length;
|
|
105
|
-
var currIndex = activeIndex !== null ? activeIndex : defaultIndex;
|
|
106
103
|
var animationIndex = this.getAnimationIndex(currIndex);
|
|
107
104
|
animationIndex = this.adjustIndex(animationIndex);
|
|
108
105
|
var currActiveIndex = this.data.loop ? ((animationIndex + 1) % count) - 1 : animationIndex;
|
|
109
106
|
if (currActiveIndex < 0) {
|
|
110
107
|
currActiveIndex += count;
|
|
111
108
|
}
|
|
112
|
-
var optionsVIndexList = this.getVisibleOptions(animationIndex);
|
|
113
109
|
this.setData({
|
|
114
|
-
|
|
110
|
+
currentIndex: currActiveIndex,
|
|
115
111
|
animationIndex: animationIndex,
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
updateVisibleOptions: function () {
|
|
115
|
+
var optionsVIndexList = this.getVisibleOptions(this.data.animationIndex);
|
|
116
|
+
this.setData({
|
|
116
117
|
optionsVIndexList: optionsVIndexList,
|
|
117
118
|
});
|
|
118
|
-
// if (currActiveIndex !== activeIndex) {
|
|
119
|
-
// this.$emit('change', currActiveIndex);
|
|
120
|
-
// }
|
|
121
119
|
},
|
|
122
|
-
getAnimationIndex: function (
|
|
120
|
+
getAnimationIndex: function (currentIndex) {
|
|
123
121
|
var animationIndex = this.data.animationIndex;
|
|
124
122
|
var length = this.data.options.length || 1;
|
|
125
123
|
if (this.data.loop) {
|
|
126
|
-
var newAnimationIndex = this.getNewAnimationIndex(animationIndex,
|
|
124
|
+
var newAnimationIndex = this.getNewAnimationIndex(animationIndex, currentIndex, length, this.data.loop);
|
|
127
125
|
return newAnimationIndex;
|
|
128
126
|
}
|
|
129
|
-
return
|
|
127
|
+
return currentIndex;
|
|
130
128
|
},
|
|
131
129
|
getCount: function () {
|
|
132
130
|
return this.data.options.length;
|
|
@@ -230,12 +228,12 @@ var getId = function () {
|
|
|
230
228
|
}
|
|
231
229
|
return newArr;
|
|
232
230
|
},
|
|
233
|
-
getNewAnimationIndex: function (animationIndex,
|
|
234
|
-
var curOptionsNewIndex = Math.floor((animationIndex + 1) / length) * length +
|
|
231
|
+
getNewAnimationIndex: function (animationIndex, currentIndex, length, loop) {
|
|
232
|
+
var curOptionsNewIndex = Math.floor((animationIndex + 1) / length) * length + currentIndex;
|
|
235
233
|
var preOptionsNewIndex = curOptionsNewIndex - length;
|
|
236
234
|
var afterOptionsNewIndex = curOptionsNewIndex + length;
|
|
237
235
|
var newAnimationIndex = !loop
|
|
238
|
-
?
|
|
236
|
+
? currentIndex
|
|
239
237
|
: Math.abs(preOptionsNewIndex - animationIndex) >
|
|
240
238
|
Math.abs(curOptionsNewIndex - animationIndex)
|
|
241
239
|
? Math.abs(curOptionsNewIndex - animationIndex) >
|
|
@@ -265,12 +263,12 @@ var getId = function () {
|
|
|
265
263
|
}
|
|
266
264
|
return 0;
|
|
267
265
|
}
|
|
268
|
-
var
|
|
269
|
-
for (var i =
|
|
266
|
+
var currentIndex = (0, utils_1.range)(index, 0, count);
|
|
267
|
+
for (var i = currentIndex; i < count; i++) {
|
|
270
268
|
if (!this.isDisabled(data.options[i]) && data.options[i] !== undefined)
|
|
271
269
|
return i;
|
|
272
270
|
}
|
|
273
|
-
for (var i =
|
|
271
|
+
for (var i = currentIndex - 1; i >= 0; i--) {
|
|
274
272
|
if (!this.isDisabled(data.options[i]) && data.options[i] !== undefined)
|
|
275
273
|
return i;
|
|
276
274
|
}
|
|
@@ -293,29 +291,29 @@ var getId = function () {
|
|
|
293
291
|
return Promise.resolve();
|
|
294
292
|
},
|
|
295
293
|
setIndex: function (index) {
|
|
296
|
-
var
|
|
297
|
-
if (
|
|
298
|
-
|
|
294
|
+
var currentIndex = ((index + 1) % this.data.options.length) - 1;
|
|
295
|
+
if (currentIndex < 0) {
|
|
296
|
+
currentIndex += this.data.options.length;
|
|
299
297
|
}
|
|
300
298
|
this.setData({
|
|
301
|
-
|
|
299
|
+
currentIndex: currentIndex,
|
|
302
300
|
animationIndex: index,
|
|
303
301
|
});
|
|
304
302
|
},
|
|
305
303
|
getValue: function () {
|
|
306
304
|
var data = this.data;
|
|
307
|
-
return (0, validator_1.isObj)(data.options[data.
|
|
308
|
-
? data.options[data.
|
|
309
|
-
: data.options[data.
|
|
305
|
+
return (0, validator_1.isObj)(data.options[data.currentIndex])
|
|
306
|
+
? data.options[data.currentIndex][data.valueKey]
|
|
307
|
+
: data.options[data.currentIndex];
|
|
310
308
|
},
|
|
311
309
|
activeIndexChange: function (index) {
|
|
312
|
-
var
|
|
313
|
-
if (
|
|
314
|
-
|
|
310
|
+
var currentIndex = ((index + 1) % this.data.options.length) - 1;
|
|
311
|
+
if (currentIndex < 0) {
|
|
312
|
+
currentIndex += this.data.options.length;
|
|
315
313
|
}
|
|
316
|
-
var isSame =
|
|
314
|
+
var isSame = currentIndex === this.data.activeIndex;
|
|
317
315
|
this.setData({
|
|
318
|
-
|
|
316
|
+
currentIndex: currentIndex,
|
|
319
317
|
animationIndex: index,
|
|
320
318
|
});
|
|
321
319
|
!isSame && this.$emit('change', index);
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
data-valuekey="{{valueKey}}"
|
|
13
13
|
data-itemheight="{{itemHeight}}"
|
|
14
14
|
data-visibleitemcount="{{visibleItemCount}}"
|
|
15
|
-
data-activeindex="{{
|
|
15
|
+
data-activeindex="{{currentIndex}}"
|
|
16
16
|
data-loop="{{loop}}"
|
|
17
17
|
data-animationtime="{{animationTime}}"
|
|
18
18
|
isdestroy="{{isDestroy}}"
|
|
19
19
|
options="{{options}}"
|
|
20
|
-
activeindex="{{
|
|
20
|
+
activeindex="{{currentIndex}}"
|
|
21
21
|
changeanimation="{{changeAnimation}}"
|
|
22
22
|
loop="{{loop}}"
|
|
23
23
|
valuekey="{{valueKey}}"
|
package/lib/popover/index.js
CHANGED
|
@@ -67,7 +67,7 @@ function createSvgIcon(svg) {
|
|
|
67
67
|
},
|
|
68
68
|
duration: {
|
|
69
69
|
type: Number,
|
|
70
|
-
value:
|
|
70
|
+
value: 3000,
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
data: { currentShow: false, showStyle: '', cancel_timer: null },
|
|
@@ -205,6 +205,10 @@ function createSvgIcon(svg) {
|
|
|
205
205
|
},
|
|
206
206
|
onClose: function () {
|
|
207
207
|
var _this = this;
|
|
208
|
+
if (this.data.cancel_timer) {
|
|
209
|
+
clearTimeout(this.data.cancel_timer);
|
|
210
|
+
this.data.cancel_timer = null;
|
|
211
|
+
}
|
|
208
212
|
this.setData({
|
|
209
213
|
showStyle: 'opacity: 0;',
|
|
210
214
|
});
|
package/lib/popover/index.wxml
CHANGED
package/lib/switch/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,var(--app-B3,#fff));display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,var(--app-B3,#fff));display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));left:calc(100% - var(--switch-node-size, .867em))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
package/lib/switch/index.js
CHANGED
package/lib/switch/index.wxml
CHANGED
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
<block wx:if="{{stopClickPropagation}}">
|
|
5
5
|
<view
|
|
6
|
-
class="{{ utils.bem('switch', { on: checked === activeValue, disabled }) }} custom-class"
|
|
6
|
+
class="{{ utils.bem('switch', { on: checked === activeValue, disabled, label: activeText || inactiveText }) }} custom-class"
|
|
7
7
|
style="{{ computed.rootStyle({ size, checked, activeColor, inactiveColor, activeValue }) }}"
|
|
8
8
|
catch:tap="onClick"
|
|
9
9
|
>
|
|
10
10
|
<view class="smart-switch__center">
|
|
11
|
+
<view wx:if="{{ activeText }}" style="opacity: {{checked ? '1' : '0'}}" class="smart-switch__label_active">
|
|
12
|
+
<text class="smart-switch__label_text">{{ activeText }}</text>
|
|
13
|
+
</view>
|
|
14
|
+
<view wx:if="{{ inactiveText }}" style="opacity: {{!checked ? '1' : '0'}}" class="smart-switch__label_inactive">
|
|
15
|
+
<text class="smart-switch__label_text">{{ inactiveText }}</text>
|
|
16
|
+
</view>
|
|
11
17
|
<view class="smart-switch__node node-class">
|
|
12
18
|
<smart-loading
|
|
13
19
|
wx:if="{{ loading }}"
|
|
@@ -20,11 +26,17 @@
|
|
|
20
26
|
</block>
|
|
21
27
|
<block wx:else>
|
|
22
28
|
<view
|
|
23
|
-
class="{{ utils.bem('switch', { on: checked === activeValue, disabled }) }} custom-class"
|
|
29
|
+
class="{{ utils.bem('switch', { on: checked === activeValue, disabled, label: activeText || inactiveText }) }} custom-class"
|
|
24
30
|
style="{{ computed.rootStyle({ size, checked, activeColor, inactiveColor, activeValue }) }}"
|
|
25
31
|
bind:tap="onClick"
|
|
26
32
|
>
|
|
27
33
|
<view class="smart-switch__center">
|
|
34
|
+
<view wx:if="{{ activeText }}" style="opacity: {{checked ? '1' : '0'}}" class="smart-switch__label_active">
|
|
35
|
+
<text class="smart-switch__label_text">{{ activeText }}</text>
|
|
36
|
+
</view>
|
|
37
|
+
<view wx:if="{{ inactiveText }}" style="opacity: {{!checked ? '1' : '0'}}" class="smart-switch__label_inactive">
|
|
38
|
+
<text class="smart-switch__label_text">{{ inactiveText }}</text>
|
|
39
|
+
</view>
|
|
28
40
|
<view class="smart-switch__node node-class">
|
|
29
41
|
<smart-loading
|
|
30
42
|
wx:if="{{ loading }}"
|
package/lib/switch/index.wxss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,var(--app-B3,#fff));display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,var(--app-B3,#fff));display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));left:calc(100% - var(--switch-node-size, .867em))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|