@tarojs/components-react 4.1.12-beta.39 → 4.1.12-beta.40
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/components/switch/index.js +125 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/switch/style/index.scss.js +4 -0
- package/dist/components/switch/style/index.scss.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/original/components/switch/index.js +125 -0
- package/dist/original/components/switch/index.js.map +1 -0
- package/dist/original/components/switch/style/index.scss +35 -0
- package/dist/original/index.js +2 -1
- package/dist/original/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import './style/index.scss.js';
|
|
3
|
+
import { View } from '@tarojs/components';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { omit, createForwardRefComponent } from '../../utils/index.js';
|
|
6
|
+
import { useState, useCallback } from '../../utils/hooks.react.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function Switch(props) {
|
|
10
|
+
const {
|
|
11
|
+
type = 'switch',
|
|
12
|
+
checked: controlledChecked,
|
|
13
|
+
defaultChecked = false,
|
|
14
|
+
disabled = false,
|
|
15
|
+
color = '#04BE02',
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
beforeChange,
|
|
19
|
+
nativeProps = {},
|
|
20
|
+
onChange,
|
|
21
|
+
forwardedRef,
|
|
22
|
+
className,
|
|
23
|
+
style
|
|
24
|
+
} = props,
|
|
25
|
+
rest = __rest(props, ["type", "checked", "defaultChecked", "disabled", "color", "width", "height", "beforeChange", "nativeProps", "onChange", "forwardedRef", "className", "style"]);
|
|
26
|
+
const [innerChecked, setInnerChecked] = useState(defaultChecked);
|
|
27
|
+
const [loading, setLoading] = useState(false);
|
|
28
|
+
const isChecked = controlledChecked !== undefined ? controlledChecked : innerChecked;
|
|
29
|
+
const applyChange = useCallback(value => {
|
|
30
|
+
if (controlledChecked === undefined) {
|
|
31
|
+
setInnerChecked(value);
|
|
32
|
+
}
|
|
33
|
+
const e = {
|
|
34
|
+
detail: {
|
|
35
|
+
value
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
onChange && onChange(e);
|
|
39
|
+
}, [controlledChecked, onChange]);
|
|
40
|
+
const handleToggle = useCallback(newValue => {
|
|
41
|
+
if (disabled || loading) return;
|
|
42
|
+
if (beforeChange) {
|
|
43
|
+
const result = beforeChange(newValue);
|
|
44
|
+
if (result === false) return;
|
|
45
|
+
if (result instanceof Promise) {
|
|
46
|
+
setLoading(true);
|
|
47
|
+
result.then(asyncResult => {
|
|
48
|
+
setLoading(false);
|
|
49
|
+
if (asyncResult === false) return;
|
|
50
|
+
applyChange(newValue);
|
|
51
|
+
}, () => {
|
|
52
|
+
setLoading(false);
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
applyChange(newValue);
|
|
58
|
+
}, [disabled, loading, beforeChange, applyChange]);
|
|
59
|
+
const isSwitch = type === 'switch';
|
|
60
|
+
const sw = width !== null && width !== void 0 ? width : isSwitch ? 52 : 20;
|
|
61
|
+
const sh = height !== null && height !== void 0 ? height : isSwitch ? 32 : 20;
|
|
62
|
+
const dynamicStyle = isSwitch ? {
|
|
63
|
+
width: `${sw}px`,
|
|
64
|
+
height: `${sh}px`,
|
|
65
|
+
borderRadius: `${sh / 2}px`,
|
|
66
|
+
backgroundColor: isChecked ? color : '#DFDFDF',
|
|
67
|
+
borderColor: isChecked ? color : '#DFDFDF'
|
|
68
|
+
} : {
|
|
69
|
+
width: `${sh}px`,
|
|
70
|
+
height: `${sh}px`,
|
|
71
|
+
borderRadius: '4px',
|
|
72
|
+
backgroundColor: isChecked ? color : 'transparent',
|
|
73
|
+
borderColor: isChecked ? color : '#c9c9c9'
|
|
74
|
+
};
|
|
75
|
+
const cls = classNames('taro-switch', `taro-switch--type-${type}`, {
|
|
76
|
+
'taro-switch--checked': isChecked,
|
|
77
|
+
'taro-switch--disabled': disabled
|
|
78
|
+
}, className);
|
|
79
|
+
const rootStyle = Object.assign(Object.assign({}, dynamicStyle), style);
|
|
80
|
+
const onClick = e => {
|
|
81
|
+
e.stopPropagation();
|
|
82
|
+
handleToggle(!isChecked);
|
|
83
|
+
};
|
|
84
|
+
if (isSwitch) {
|
|
85
|
+
const thumbStyle = {
|
|
86
|
+
width: `${sh - 4}px`,
|
|
87
|
+
height: `${sh - 4}px`,
|
|
88
|
+
transform: isChecked ? `translateX(${sw - sh}px)` : undefined
|
|
89
|
+
};
|
|
90
|
+
return /*#__PURE__*/jsx(View, {
|
|
91
|
+
className: cls,
|
|
92
|
+
style: rootStyle,
|
|
93
|
+
ref: forwardedRef,
|
|
94
|
+
onClick: onClick,
|
|
95
|
+
...omit(rest, ['forwardedRef']),
|
|
96
|
+
...nativeProps,
|
|
97
|
+
children: /*#__PURE__*/jsx(View, {
|
|
98
|
+
className: "taro-switch__thumb",
|
|
99
|
+
style: thumbStyle
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return /*#__PURE__*/jsx(View, {
|
|
104
|
+
className: cls,
|
|
105
|
+
style: rootStyle,
|
|
106
|
+
ref: forwardedRef,
|
|
107
|
+
onClick: onClick,
|
|
108
|
+
...omit(rest, ['forwardedRef']),
|
|
109
|
+
...nativeProps,
|
|
110
|
+
children: /*#__PURE__*/jsx(View, {
|
|
111
|
+
className: "taro-switch__checkmark",
|
|
112
|
+
style: {
|
|
113
|
+
width: `${Math.round(sh * 0.3)}px`,
|
|
114
|
+
height: `${Math.round(sh * 0.5)}px`,
|
|
115
|
+
borderRight: `${Math.round(sh * 0.1)}px solid #fff`,
|
|
116
|
+
borderBottom: `${Math.round(sh * 0.1)}px solid #fff`,
|
|
117
|
+
transform: isChecked ? `translate(-50%, -65%) rotate(45deg) scale(1)` : `translate(-50%, -65%) rotate(45deg) scale(0)`
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
var index = createForwardRefComponent(Switch);
|
|
123
|
+
|
|
124
|
+
export { index as default };
|
|
125
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/switch/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport { View } from '@tarojs/components'\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\nimport { useCallback, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\nexport type BeforeChange = (value: boolean) => boolean | Promise<boolean>\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n type?: 'switch' | 'checkbox'\n checked?: boolean\n defaultChecked?: boolean\n disabled?: boolean\n color?: string\n width?: number\n height?: number\n beforeChange?: BeforeChange\n nativeProps?: Record<string, any>\n onChange?: (e: any) => void\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\nfunction Switch (props: IProps) {\n const {\n type = 'switch',\n checked: controlledChecked,\n defaultChecked = false,\n disabled = false,\n color = '#04BE02',\n width,\n height,\n beforeChange,\n nativeProps = {},\n onChange,\n forwardedRef,\n className,\n style,\n ...rest\n } = props\n\n const [innerChecked, setInnerChecked] = useState(defaultChecked)\n const [loading, setLoading] = useState(false)\n\n const isChecked = controlledChecked !== undefined\n ? controlledChecked\n : innerChecked\n\n const applyChange = useCallback((value: boolean) => {\n if (controlledChecked === undefined) {\n setInnerChecked(value)\n }\n\n const e = { detail: { value } }\n onChange && onChange(e)\n }, [controlledChecked, onChange])\n\n const handleToggle = useCallback((newValue: boolean) => {\n if (disabled || loading) return\n\n if (beforeChange) {\n const result = beforeChange(newValue)\n\n if (result === false) return\n\n if (result instanceof Promise) {\n setLoading(true)\n result\n .then((asyncResult) => {\n setLoading(false)\n if (asyncResult === false) return\n applyChange(newValue)\n }, () => {\n setLoading(false)\n })\n return\n }\n }\n\n applyChange(newValue)\n }, [disabled, loading, beforeChange, applyChange])\n\n const isSwitch = type === 'switch'\n const sw = width ?? (isSwitch ? 52 : 20)\n const sh = height ?? (isSwitch ? 32 : 20)\n\n const dynamicStyle: React.CSSProperties = isSwitch ? {\n width: `${sw}px`,\n height: `${sh}px`,\n borderRadius: `${sh / 2}px`,\n backgroundColor: isChecked ? color : '#DFDFDF',\n borderColor: isChecked ? color : '#DFDFDF'\n } : {\n width: `${sh}px`,\n height: `${sh}px`,\n borderRadius: '4px',\n backgroundColor: isChecked ? color : 'transparent',\n borderColor: isChecked ? color : '#c9c9c9'\n }\n\n const cls = classNames(\n 'taro-switch',\n `taro-switch--type-${type}`,\n {\n 'taro-switch--checked': isChecked,\n 'taro-switch--disabled': disabled\n },\n className\n )\n\n const rootStyle = {\n ...dynamicStyle,\n ...style\n } as unknown as React.CSSProperties\n\n const onClick = (e: React.MouseEvent) => {\n e.stopPropagation()\n handleToggle(!isChecked)\n }\n\n if (isSwitch) {\n const thumbStyle: React.CSSProperties = {\n width: `${sh - 4}px`,\n height: `${sh - 4}px`,\n transform: isChecked ? `translateX(${sw - sh}px)` : undefined\n }\n return (\n <View\n className={cls}\n style={rootStyle}\n ref={forwardedRef}\n onClick={onClick}\n {...omit(rest, ['forwardedRef'])}\n {...nativeProps}\n >\n <View className='taro-switch__thumb' style={thumbStyle} />\n </View>\n )\n }\n\n return (\n <View\n className={cls}\n style={rootStyle}\n ref={forwardedRef}\n onClick={onClick}\n {...omit(rest, ['forwardedRef'])}\n {...nativeProps}\n >\n <View\n className='taro-switch__checkmark'\n style={{\n width: `${Math.round(sh * 0.3)}px`,\n height: `${Math.round(sh * 0.5)}px`,\n borderRight: `${Math.round(sh * 0.1)}px solid #fff`,\n borderBottom: `${Math.round(sh * 0.1)}px solid #fff`,\n transform: isChecked\n ? `translate(-50%, -65%) rotate(45deg) scale(1)`\n : `translate(-50%, -65%) rotate(45deg) scale(0)`\n }}\n />\n </View>\n )\n}\n\nexport default createForwardRefComponent(Switch)\n"],"names":["Switch","props","type","checked","controlledChecked","defaultChecked","disabled","color","width","height","beforeChange","nativeProps","onChange","forwardedRef","className","style","rest","innerChecked","setInnerChecked","useState","loading","setLoading","isChecked","undefined","applyChange","useCallback","value","e","detail","handleToggle","newValue","result","Promise","then","asyncResult","isSwitch","sw","sh","dynamicStyle","borderRadius","backgroundColor","borderColor","cls","classNames","rootStyle","Object","assign","onClick","stopPropagation","thumbStyle","transform","_jsx","View","ref","omit","children","Math","round","borderRight","borderBottom","createForwardRefComponent"],"mappings":";;;;;;;;AA0BA,SAASA,MAAMA,CAAEC,KAAa,EAAA;EAC5B,MAAM;AACJC,MAAAA,IAAI,GAAG,QAAQ;AACfC,MAAAA,OAAO,EAAEC,iBAAiB;AAC1BC,MAAAA,cAAc,GAAG,KAAK;AACtBC,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,KAAK,GAAG,SAAS;MACjBC,KAAK;MACLC,MAAM;MACNC,YAAY;MACZC,WAAW,GAAG,EAAE;MAChBC,QAAQ;MACRC,YAAY;MACZC,SAAS;AACTC,MAAAA;AAAK,KAAA,GAEHd,KAAK;AADJe,IAAAA,IAAI,UACLf,KAAK,EAfH,CAeL,MAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,OAAA,EAAA,OAAA,EAAA,QAAA,EAAA,cAAA,EAAA,aAAA,EAAA,UAAA,EAAA,cAAA,EAAA,WAAA,EAAA,OAAA,CAAA,CAAQ;EAET,MAAM,CAACgB,YAAY,EAAEC,eAAe,CAAC,GAAGC,QAAQ,CAACd,cAAc,CAAC;EAChE,MAAM,CAACe,OAAO,EAAEC,UAAU,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC;EAE7C,MAAMG,SAAS,GAAGlB,iBAAiB,KAAKmB,SAAS,GAC7CnB,iBAAiB,GACjBa,YAAY;AAEhB,EAAA,MAAMO,WAAW,GAAGC,WAAW,CAA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K,CAACpB,EAAE,GAAG,GAAG,CAAC,CAAe,aAAA,CAAA;QACnDsB,YAAY,EAAE,CAAGH,EAAAA,IAAI,CAACC,KAAK,CAACpB,EAAE,GAAG,GAAG,CAAC,CAAe,aAAA,CAAA;AACpDa,QAAAA,SAAS,EAAE5B,SAAS,GAChB,CAAA,4CAAA,CAA8C,GAC9C,CAAA,4CAAA;AACL;KAEL;AAAA,GAAM,CAAC;AAEX;AAEA,YAAesC,yBAAyB,CAAC5D,MAAM,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@-webkit-keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.taro-button-core.taro-btn-loading .weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url(https://img13.360buyimg.com/imagetools/jfs/t1/353674/27/5761/14397/690ac1cfFf6bf0e2c/77727d0791bacf8e.png) no-repeat;background-size:cover;display:inline-block;height:22px;width:22px}.taro-button-core.taro-btn-loading .weui-loading.weui-btn_primary,.taro-button-core.taro-btn-loading .weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-loading .weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core.taro-btn-loading .weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core.taro-btn-loading.taro-btn-mini .weui-loading{display:inline-block;height:16px;vertical-align:middle;width:16px}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;appearance:none;background-color:#f8f8f8;border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;color:#000;display:flex;font-size:18px;justify-content:center;outline:0;overflow:hidden;padding:0 14px;position:relative;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not(.taro-btn-disabled):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core.taro-btn-default{background-color:#f8f8f8;color:#000}.taro-button-core.taro-btn-default:not(.taro-btn-disabled):visited{color:#000}.taro-button-core.taro-btn-default:not(.taro-btn-disabled):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core.taro-btn-mini{display:inline-block;font-size:13px;padding:0 26px;vertical-align:middle;width:auto}.taro-button-core.taro-btn-plain,.taro-button-core.taro-btn-plain.taro-btn-default,.taro-button-core.taro-btn-plain.taro-btn-primary,.taro-button-core.taro-btn-plain.taro-btn-warn{background-color:transparent;border-width:1px}.taro-button-core.taro-btn-disabled{color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-disabled.taro-btn-default{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core.taro-btn-disabled.taro-btn-primary{background-color:#9ed99d}.taro-button-core.taro-btn-disabled.taro-btn-warn{background-color:#ec8b89}.taro-button-core.taro-btn-loading.taro-btn-primary,.taro-button-core.taro-btn-loading.taro-btn-warn{color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-loading.taro-btn-primary{background-color:#179b16}.taro-button-core.taro-btn-loading.taro-btn-warn{background-color:#ce3c39}.taro-button-core.taro-btn-plain.taro-btn-primary{border:1px solid #1aad19;color:#1aad19}.taro-button-core.taro-btn-plain.taro-btn-primary:not(.taro-btn-disabled):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core.taro-btn-plain.taro-btn-primary:after{border-width:0}.taro-button-core.taro-btn-plain.taro-btn-warn{border:1px solid #e64340;color:#e64340}.taro-button-core.taro-btn-plain.taro-btn-warn:not(.taro-btn-disabled):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core.taro-btn-plain.taro-btn-warn:after{border-width:0}.taro-button-core.taro-btn-plain,.taro-button-core.taro-btn-plain.taro-btn-default{border:1px solid #353535;color:#353535}.taro-button-core.taro-btn-plain.taro-btn-default:not(.taro-btn-disabled):active,.taro-button-core.taro-btn-plain:not(.taro-btn-disabled):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core.taro-btn-plain.taro-btn-default:after,.taro-button-core.taro-btn-plain:after{border-width:0}.taro-button-core.taro-btn-primary{background-color:#1aad19;color:#fff}.taro-button-core.taro-btn-primary:not(.taro-btn-disabled):visited{color:#fff}.taro-button-core.taro-btn-primary:not(.taro-btn-disabled):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-warn{background-color:#e64340;color:#fff}.taro-button-core.taro-btn-warn:not(.taro-btn-disabled):visited{color:#fff}.taro-button-core.taro-btn-warn:not(.taro-btn-disabled):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-plain.taro-btn-disabled.taro-btn-default,.taro-button-core.taro-btn-plain.taro-btn-disabled.taro-btn-primary,.taro-button-core.taro-btn-plain.taro-btn-disabled.taro-btn-warn{background-color:#f7f7f7;border:1px solid rgba(0,0,0,.2);color:rgba(0,0,0,.3)}.weui-icon-circle:before{content:"\ea01"}.weui-icon-download:before{content:"\ea02"}.weui-icon-info:before{content:"\ea03"}.weui-icon-safe-success:before{content:"\ea04"}.weui-icon-safe-warn:before{content:"\ea05"}.weui-icon-success:before{content:"\ea06"}.weui-icon-success-circle:before{content:"\ea07"}.weui-icon-success-no-circle:before{content:"\ea08"}.weui-icon-waiting:before{content:"\ea09"}.weui-icon-waiting-circle:before{content:"\ea0a"}.weui-icon-warn:before{content:"\ea0b"}.weui-icon-info-circle:before{content:"\ea0c"}.weui-icon-cancel:before{content:"\ea0d"}.weui-icon-search:before{content:"\ea0e"}.weui-icon-clear:before{content:"\ea0f"}.weui-icon-back:before{content:"\ea10"}.weui-icon-delete:before{content:"\ea11"}.weui-icon-success{color:#09bb07;font-size:23px}.weui-icon-waiting{color:#10aeff;font-size:23px}.weui-icon-warn{color:#f43530;font-size:23px}.weui-icon-info{color:#10aeff;font-size:23px}.weui-icon-success-circle,.weui-icon-success-no-circle{color:#09bb07;font-size:23px}.weui-icon-waiting-circle{color:#10aeff;font-size:23px}.weui-icon-circle{color:#c9c9c9;font-size:23px}.weui-icon-download,.weui-icon-info-circle{color:#09bb07;font-size:23px}.weui-icon-safe-success{color:#09bb07}.weui-icon-safe-warn{color:#ffbe00}.weui-icon-cancel{color:#f43530;font-size:22px}.weui-icon-clear,.weui-icon-search{color:#b2b2b2;font-size:14px}.weui-icon-delete.weui-icon_gallery-delete{color:#fff;font-size:22px}.weui-icon_msg{font-size:93px}.weui-icon_msg.weui-icon-warn{color:#f76260}.weui-icon_msg-primary{font-size:93px}.weui-icon_msg-primary.weui-icon-warn{color:#ffbe00}img[src=""]{opacity:0}.taro-img{display:inline-block;font-size:0;overflow:hidden;position:relative}.taro-img--with-default-host-size{height:240px;width:320px}.taro-img.taro-img__widthfix,.taro-img__mode-heightfix{height:100%}.taro-img__mode-scaletofill{height:100%;width:100%}.taro-img__mode-aspectfit{height:100%;object-fit:contain;width:100%}.taro-img__mode-aspectfill{height:100%;object-fit:cover;width:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-bottom,.taro-img__mode-top{left:50%;position:absolute;transform:translate(-50%)}.taro-img__mode-bottom{bottom:0}.taro-img__mode-center{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.taro-img__mode-left,.taro-img__mode-right{position:absolute;top:50%;transform:translateY(-50%)}.taro-img__mode-right{right:0}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{bottom:0;position:absolute}.taro-img__mode-bottomright{bottom:0;position:absolute;right:0}.taro-input-core{display:block}.weui-input{-webkit-appearance:none;background-color:transparent;border:0;color:inherit;font-size:inherit;height:1.4705882353em;line-height:1.4705882353;outline:0;width:100%}.weui-input::-webkit-inner-spin-button,.weui-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.taro-picker__overlay{position:fixed;z-index:1000}.taro-picker__mask-overlay,.taro-picker__overlay{bottom:0;height:100%;left:0;right:0;top:0;width:100%}.taro-picker__mask-overlay{position:absolute;z-index:1001}.taro-picker{bottom:0;font-size:14px;left:0;position:absolute;width:100%;z-index:1002}.taro-picker__hd{align-items:center;display:flex;font-size:17px;height:44px;justify-content:space-between;padding:0;position:relative}.taro-picker__hd:after{bottom:0;content:"";height:1px;left:0;position:absolute;transform:scaleY(.5);width:100%}.taro-picker__action{flex:0 0 auto;font-size:14px;height:44px;line-height:44px;padding:0 10px}.taro-picker__title{font-size:16px;font-weight:500;left:50%;max-width:40%;overflow:hidden;position:absolute;text-overflow:ellipsis;top:50%;transform:translate(-50%,-50%);white-space:nowrap}.taro-picker__bd{box-sizing:border-box;display:flex;flex:1;height:238px;overflow:hidden;width:100%}.taro-picker-theme-light{background-color:#e5e5e5}.taro-picker-theme-light .taro-picker__mask-overlay{background-color:rgba(0,0,0,.6)}.taro-picker-theme-light .taro-picker__hd{background-color:#fff}.taro-picker-theme-light .taro-picker__hd:after{background-color:#e5e5e5}.taro-picker-theme-light .taro-picker__action{color:#ff0f23}.taro-picker-theme-light .taro-picker__action:first-child{color:#888}.taro-picker-theme-light .taro-picker__title{color:#000}.taro-picker-theme-light .taro-picker__bd{background-color:#fff}.taro-picker-theme-light .taro-picker__indicator{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5}.taro-picker-theme-light .taro-picker__mask{background:linear-gradient(180deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6) 40%,hsla(0,0%,100%,0) 45%,hsla(0,0%,100%,0) 55%,hsla(0,0%,100%,.6) 60%,hsla(0,0%,100%,.95))}.taro-picker-theme-light .taro-picker__item{color:#000}.taro-picker-theme-light .taro-picker__item--selected{color:#ff0f23}.taro-picker-theme-light .taro-picker__item--disabled{color:#999}.taro-picker-theme-dark{background-color:hsla(0,0%,100%,.06)}.taro-picker-theme-dark .taro-picker__mask-overlay{background-color:hsla(0,0%,8%,.7)}.taro-picker-theme-dark .taro-picker__hd{background-color:#1f1f1f}.taro-picker-theme-dark .taro-picker__hd:after{background-color:hsla(0,0%,100%,.06)}.taro-picker-theme-dark .taro-picker__action{color:#ff0f23}.taro-picker-theme-dark .taro-picker__action:first-child{color:#818181}.taro-picker-theme-dark .taro-picker__title{color:#e6e6e6}.taro-picker-theme-dark .taro-picker__bd{background-color:#1f1f1f}.taro-picker-theme-dark .taro-picker__indicator{border-bottom:1px solid hsla(0,0%,100%,.06);border-top:1px solid hsla(0,0%,100%,.06)}.taro-picker-theme-dark .taro-picker__mask{background:linear-gradient(180deg,rgba(31,31,31,.95),rgba(31,31,31,.6) 40%,rgba(31,31,31,0) 45%,rgba(31,31,31,0) 55%,rgba(31,31,31,.6) 60%,rgba(31,31,31,.95))}.taro-picker-theme-dark .taro-picker__item{color:#e6e6e6}.taro-picker-theme-dark .taro-picker__item--selected{color:#ff0f23}.taro-picker-theme-dark .taro-picker__item--disabled{color:#999}.taro-picker__group{align-items:center;box-sizing:border-box;display:flex;flex:1;height:100%;justify-content:center;min-width:0;position:relative}.taro-picker__group--date .taro-picker__columns{display:flex;height:100%;width:100%}.taro-picker__mask{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:1}.taro-picker__indicator{box-sizing:border-box;height:34px;left:0;position:absolute;top:50%;transform:translateY(-50%);width:100%;z-index:1002}.taro-picker__content{box-sizing:border-box;height:100%;width:100%}.taro-picker__item{align-items:center;box-sizing:border-box;display:flex;font-size:16px;height:34px;justify-content:center;line-height:34px;overflow:hidden;padding:0 8px;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%}.taro-picker__item--selected{font-weight:500}.taro-picker__column{flex:1;margin:0 8px}.taro-picker__column:first-child{margin-left:0}.taro-picker__column:last-child{margin-right:0}.taro-picker__item--custom{align-items:center;color:#888;display:flex;font-weight:400;justify-content:center;text-align:center}@keyframes taro-picker__slide-up{0%{transform:translate3d(0,100%,0)}to{transform:translateZ(0)}}@keyframes taro-picker__slide-down{0%{transform:translateZ(0)}to{transform:translate3d(0,100%,0)}}@keyframes taro-picker__fade-in{0%{opacity:0}to{opacity:1}}@keyframes taro-picker__fade-out{0%{opacity:1}to{opacity:0}}.rmc-pull-to-refresh-content{transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100%}.rmc-pull-to-refresh-transition{transition:transform .3s}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:.2}to{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{animation-fill-mode:both;animation:rmc-pull-to-refresh-indicator .5s linear 0s infinite;background-color:grey;border-radius:100%;display:inline-block;height:6px;margin:3px;width:6px}.rmc-pull-to-refresh-indicator>div:nth-child(0){animation-delay:-.1s!important}.rmc-pull-to-refresh-indicator>div:first-child{animation-delay:-.2s!important}.rmc-pull-to-refresh-indicator>div:nth-child(2){animation-delay:-.3s!important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}.taro-scroll{-webkit-overflow-scrolling:auto}.taro-scroll--hidebar::-webkit-scrollbar{display:none}.taro-scroll-view{overflow:hidden}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}.swiper-container-wrapper{height:150px}.swiper-container{height:100%;overflow:visible;position:relative}.taro-text{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.taro-text__selectable{-moz-user-select:text;-webkit-user-select:text;-ms-user-select:text;user-select:text}
|
|
1
|
+
@-webkit-keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.taro-button-core.taro-btn-loading .weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url(https://img13.360buyimg.com/imagetools/jfs/t1/353674/27/5761/14397/690ac1cfFf6bf0e2c/77727d0791bacf8e.png) no-repeat;background-size:cover;display:inline-block;height:22px;width:22px}.taro-button-core.taro-btn-loading .weui-loading.weui-btn_primary,.taro-button-core.taro-btn-loading .weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-loading .weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core.taro-btn-loading .weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core.taro-btn-loading.taro-btn-mini .weui-loading{display:inline-block;height:16px;vertical-align:middle;width:16px}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;appearance:none;background-color:#f8f8f8;border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;color:#000;display:flex;font-size:18px;justify-content:center;outline:0;overflow:hidden;padding:0 14px;position:relative;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not(.taro-btn-disabled):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core.taro-btn-default{background-color:#f8f8f8;color:#000}.taro-button-core.taro-btn-default:not(.taro-btn-disabled):visited{color:#000}.taro-button-core.taro-btn-default:not(.taro-btn-disabled):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core.taro-btn-mini{display:inline-block;font-size:13px;padding:0 26px;vertical-align:middle;width:auto}.taro-button-core.taro-btn-plain,.taro-button-core.taro-btn-plain.taro-btn-default,.taro-button-core.taro-btn-plain.taro-btn-primary,.taro-button-core.taro-btn-plain.taro-btn-warn{background-color:transparent;border-width:1px}.taro-button-core.taro-btn-disabled{color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-disabled.taro-btn-default{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core.taro-btn-disabled.taro-btn-primary{background-color:#9ed99d}.taro-button-core.taro-btn-disabled.taro-btn-warn{background-color:#ec8b89}.taro-button-core.taro-btn-loading.taro-btn-primary,.taro-button-core.taro-btn-loading.taro-btn-warn{color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-loading.taro-btn-primary{background-color:#179b16}.taro-button-core.taro-btn-loading.taro-btn-warn{background-color:#ce3c39}.taro-button-core.taro-btn-plain.taro-btn-primary{border:1px solid #1aad19;color:#1aad19}.taro-button-core.taro-btn-plain.taro-btn-primary:not(.taro-btn-disabled):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core.taro-btn-plain.taro-btn-primary:after{border-width:0}.taro-button-core.taro-btn-plain.taro-btn-warn{border:1px solid #e64340;color:#e64340}.taro-button-core.taro-btn-plain.taro-btn-warn:not(.taro-btn-disabled):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core.taro-btn-plain.taro-btn-warn:after{border-width:0}.taro-button-core.taro-btn-plain,.taro-button-core.taro-btn-plain.taro-btn-default{border:1px solid #353535;color:#353535}.taro-button-core.taro-btn-plain.taro-btn-default:not(.taro-btn-disabled):active,.taro-button-core.taro-btn-plain:not(.taro-btn-disabled):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core.taro-btn-plain.taro-btn-default:after,.taro-button-core.taro-btn-plain:after{border-width:0}.taro-button-core.taro-btn-primary{background-color:#1aad19;color:#fff}.taro-button-core.taro-btn-primary:not(.taro-btn-disabled):visited{color:#fff}.taro-button-core.taro-btn-primary:not(.taro-btn-disabled):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-warn{background-color:#e64340;color:#fff}.taro-button-core.taro-btn-warn:not(.taro-btn-disabled):visited{color:#fff}.taro-button-core.taro-btn-warn:not(.taro-btn-disabled):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-plain.taro-btn-disabled.taro-btn-default,.taro-button-core.taro-btn-plain.taro-btn-disabled.taro-btn-primary,.taro-button-core.taro-btn-plain.taro-btn-disabled.taro-btn-warn{background-color:#f7f7f7;border:1px solid rgba(0,0,0,.2);color:rgba(0,0,0,.3)}.weui-icon-circle:before{content:"\ea01"}.weui-icon-download:before{content:"\ea02"}.weui-icon-info:before{content:"\ea03"}.weui-icon-safe-success:before{content:"\ea04"}.weui-icon-safe-warn:before{content:"\ea05"}.weui-icon-success:before{content:"\ea06"}.weui-icon-success-circle:before{content:"\ea07"}.weui-icon-success-no-circle:before{content:"\ea08"}.weui-icon-waiting:before{content:"\ea09"}.weui-icon-waiting-circle:before{content:"\ea0a"}.weui-icon-warn:before{content:"\ea0b"}.weui-icon-info-circle:before{content:"\ea0c"}.weui-icon-cancel:before{content:"\ea0d"}.weui-icon-search:before{content:"\ea0e"}.weui-icon-clear:before{content:"\ea0f"}.weui-icon-back:before{content:"\ea10"}.weui-icon-delete:before{content:"\ea11"}.weui-icon-success{color:#09bb07;font-size:23px}.weui-icon-waiting{color:#10aeff;font-size:23px}.weui-icon-warn{color:#f43530;font-size:23px}.weui-icon-info{color:#10aeff;font-size:23px}.weui-icon-success-circle,.weui-icon-success-no-circle{color:#09bb07;font-size:23px}.weui-icon-waiting-circle{color:#10aeff;font-size:23px}.weui-icon-circle{color:#c9c9c9;font-size:23px}.weui-icon-download,.weui-icon-info-circle{color:#09bb07;font-size:23px}.weui-icon-safe-success{color:#09bb07}.weui-icon-safe-warn{color:#ffbe00}.weui-icon-cancel{color:#f43530;font-size:22px}.weui-icon-clear,.weui-icon-search{color:#b2b2b2;font-size:14px}.weui-icon-delete.weui-icon_gallery-delete{color:#fff;font-size:22px}.weui-icon_msg{font-size:93px}.weui-icon_msg.weui-icon-warn{color:#f76260}.weui-icon_msg-primary{font-size:93px}.weui-icon_msg-primary.weui-icon-warn{color:#ffbe00}img[src=""]{opacity:0}.taro-img{display:inline-block;font-size:0;overflow:hidden;position:relative}.taro-img--with-default-host-size{height:240px;width:320px}.taro-img.taro-img__widthfix,.taro-img__mode-heightfix{height:100%}.taro-img__mode-scaletofill{height:100%;width:100%}.taro-img__mode-aspectfit{height:100%;object-fit:contain;width:100%}.taro-img__mode-aspectfill{height:100%;object-fit:cover;width:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-bottom,.taro-img__mode-top{left:50%;position:absolute;transform:translate(-50%)}.taro-img__mode-bottom{bottom:0}.taro-img__mode-center{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.taro-img__mode-left,.taro-img__mode-right{position:absolute;top:50%;transform:translateY(-50%)}.taro-img__mode-right{right:0}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{bottom:0;position:absolute}.taro-img__mode-bottomright{bottom:0;position:absolute;right:0}.taro-input-core{display:block}.weui-input{-webkit-appearance:none;background-color:transparent;border:0;color:inherit;font-size:inherit;height:1.4705882353em;line-height:1.4705882353;outline:0;width:100%}.weui-input::-webkit-inner-spin-button,.weui-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.taro-picker__overlay{position:fixed;z-index:1000}.taro-picker__mask-overlay,.taro-picker__overlay{bottom:0;height:100%;left:0;right:0;top:0;width:100%}.taro-picker__mask-overlay{position:absolute;z-index:1001}.taro-picker{bottom:0;font-size:14px;left:0;position:absolute;width:100%;z-index:1002}.taro-picker__hd{align-items:center;display:flex;font-size:17px;height:44px;justify-content:space-between;padding:0;position:relative}.taro-picker__hd:after{bottom:0;content:"";height:1px;left:0;position:absolute;transform:scaleY(.5);width:100%}.taro-picker__action{flex:0 0 auto;font-size:14px;height:44px;line-height:44px;padding:0 10px}.taro-picker__title{font-size:16px;font-weight:500;left:50%;max-width:40%;overflow:hidden;position:absolute;text-overflow:ellipsis;top:50%;transform:translate(-50%,-50%);white-space:nowrap}.taro-picker__bd{box-sizing:border-box;display:flex;flex:1;height:238px;overflow:hidden;width:100%}.taro-picker-theme-light{background-color:#e5e5e5}.taro-picker-theme-light .taro-picker__mask-overlay{background-color:rgba(0,0,0,.6)}.taro-picker-theme-light .taro-picker__hd{background-color:#fff}.taro-picker-theme-light .taro-picker__hd:after{background-color:#e5e5e5}.taro-picker-theme-light .taro-picker__action{color:#ff0f23}.taro-picker-theme-light .taro-picker__action:first-child{color:#888}.taro-picker-theme-light .taro-picker__title{color:#000}.taro-picker-theme-light .taro-picker__bd{background-color:#fff}.taro-picker-theme-light .taro-picker__indicator{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5}.taro-picker-theme-light .taro-picker__mask{background:linear-gradient(180deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6) 40%,hsla(0,0%,100%,0) 45%,hsla(0,0%,100%,0) 55%,hsla(0,0%,100%,.6) 60%,hsla(0,0%,100%,.95))}.taro-picker-theme-light .taro-picker__item{color:#000}.taro-picker-theme-light .taro-picker__item--selected{color:#ff0f23}.taro-picker-theme-light .taro-picker__item--disabled{color:#999}.taro-picker-theme-dark{background-color:hsla(0,0%,100%,.06)}.taro-picker-theme-dark .taro-picker__mask-overlay{background-color:hsla(0,0%,8%,.7)}.taro-picker-theme-dark .taro-picker__hd{background-color:#1f1f1f}.taro-picker-theme-dark .taro-picker__hd:after{background-color:hsla(0,0%,100%,.06)}.taro-picker-theme-dark .taro-picker__action{color:#ff0f23}.taro-picker-theme-dark .taro-picker__action:first-child{color:#818181}.taro-picker-theme-dark .taro-picker__title{color:#e6e6e6}.taro-picker-theme-dark .taro-picker__bd{background-color:#1f1f1f}.taro-picker-theme-dark .taro-picker__indicator{border-bottom:1px solid hsla(0,0%,100%,.06);border-top:1px solid hsla(0,0%,100%,.06)}.taro-picker-theme-dark .taro-picker__mask{background:linear-gradient(180deg,rgba(31,31,31,.95),rgba(31,31,31,.6) 40%,rgba(31,31,31,0) 45%,rgba(31,31,31,0) 55%,rgba(31,31,31,.6) 60%,rgba(31,31,31,.95))}.taro-picker-theme-dark .taro-picker__item{color:#e6e6e6}.taro-picker-theme-dark .taro-picker__item--selected{color:#ff0f23}.taro-picker-theme-dark .taro-picker__item--disabled{color:#999}.taro-picker__group{align-items:center;box-sizing:border-box;display:flex;flex:1;height:100%;justify-content:center;min-width:0;position:relative}.taro-picker__group--date .taro-picker__columns{display:flex;height:100%;width:100%}.taro-picker__mask{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:1}.taro-picker__indicator{box-sizing:border-box;height:34px;left:0;position:absolute;top:50%;transform:translateY(-50%);width:100%;z-index:1002}.taro-picker__content{box-sizing:border-box;height:100%;width:100%}.taro-picker__item{align-items:center;box-sizing:border-box;display:flex;font-size:16px;height:34px;justify-content:center;line-height:34px;overflow:hidden;padding:0 8px;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%}.taro-picker__item--selected{font-weight:500}.taro-picker__column{flex:1;margin:0 8px}.taro-picker__column:first-child{margin-left:0}.taro-picker__column:last-child{margin-right:0}.taro-picker__item--custom{align-items:center;color:#888;display:flex;font-weight:400;justify-content:center;text-align:center}@keyframes taro-picker__slide-up{0%{transform:translate3d(0,100%,0)}to{transform:translateZ(0)}}@keyframes taro-picker__slide-down{0%{transform:translateZ(0)}to{transform:translate3d(0,100%,0)}}@keyframes taro-picker__fade-in{0%{opacity:0}to{opacity:1}}@keyframes taro-picker__fade-out{0%{opacity:1}to{opacity:0}}.rmc-pull-to-refresh-content{transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100%}.rmc-pull-to-refresh-transition{transition:transform .3s}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:.2}to{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{animation-fill-mode:both;animation:rmc-pull-to-refresh-indicator .5s linear 0s infinite;background-color:grey;border-radius:100%;display:inline-block;height:6px;margin:3px;width:6px}.rmc-pull-to-refresh-indicator>div:nth-child(0){animation-delay:-.1s!important}.rmc-pull-to-refresh-indicator>div:first-child{animation-delay:-.2s!important}.rmc-pull-to-refresh-indicator>div:nth-child(2){animation-delay:-.3s!important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}.taro-scroll{-webkit-overflow-scrolling:auto}.taro-scroll--hidebar::-webkit-scrollbar{display:none}.taro-scroll-view{overflow:hidden}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}.swiper-container-wrapper{height:150px}.swiper-container{height:100%;overflow:visible;position:relative}.taro-switch{cursor:pointer;display:inline-block;position:relative}.taro-switch--disabled{cursor:not-allowed;opacity:.5}.taro-switch--type-switch{border:1px solid #dfdfdf;box-sizing:border-box}.taro-switch--type-switch .taro-switch__thumb{background-color:#fff;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.4);left:1px;position:absolute;top:1px}.taro-switch--type-checkbox{border:1px solid #c9c9c9;box-sizing:border-box}.taro-switch--type-checkbox .taro-switch__checkmark{left:50%;position:absolute;top:50%}.taro-text{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.taro-text__selectable{-moz-user-select:text;-webkit-user-select:text;-ms-user-select:text;user-select:text}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, DraggableSheet, Editor, FollowSwan, Form, FunctionalPageNavigator, GridBuilder, GridView, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, ListBuilder, ListView, LivePlayer, LivePusher, Login, Lottie, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, NestedScrollBody, NestedScrollHeader, OfficialAccount, OpenContainer, OpenData, PageContainer, PageMeta, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span,
|
|
1
|
+
export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, DraggableSheet, Editor, FollowSwan, Form, FunctionalPageNavigator, GridBuilder, GridView, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, ListBuilder, ListView, LivePlayer, LivePusher, Login, Lottie, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, NestedScrollBody, NestedScrollHeader, OfficialAccount, OpenContainer, OpenData, PageContainer, PageMeta, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span, Tabs, Textarea, Video, VoipRoom, WebView } from '@tarojs/components/lib/react';
|
|
2
2
|
export { default as Button } from './components/button/index.js';
|
|
3
3
|
export { default as Icon } from './components/icon/index.js';
|
|
4
4
|
export { default as Image } from './components/image/index.js';
|
|
@@ -10,6 +10,7 @@ export { Refresher } from './components/refresher/index.js';
|
|
|
10
10
|
export { ScrollElementContext } from './contexts/ScrollElementContext.js';
|
|
11
11
|
export { default as ScrollView } from './components/scroll-view/index.js';
|
|
12
12
|
export { Swiper, SwiperItem } from './components/swiper/index.js';
|
|
13
|
+
export { default as Switch } from './components/switch/index.js';
|
|
13
14
|
export { default as Text } from './components/text/index.js';
|
|
14
15
|
export { default as View } from './components/view/index.js';
|
|
15
16
|
export { createMapContext } from './components/map/createMapContext.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.react.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { DraggableSheet } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { GridView } from '@tarojs/components/lib/react'\nexport { GridBuilder } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { ListBuilder } from '@tarojs/components/lib/react'\nexport { ListView } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { default as Map, type MapProps } from './components/map'\nexport { createMapContext } from './components/map'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { NestedScrollBody } from '@tarojs/components/lib/react'\nexport { NestedScrollHeader } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { OpenContainer } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { default as Picker } from './components/picker'\nexport { PickerView, PickerViewColumn } from '@tarojs/components/lib/react'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { default as Refresher, type RefresherProps } from './components/refresher'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { Script } from '@tarojs/components/lib/react'\nexport { ScrollElementContext, type ScrollElementContextValue } from './contexts/ScrollElementContext'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { Snapshot } from '@tarojs/components/lib/react'\nexport { Span } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { Switch } from '
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.react.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { DraggableSheet } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { GridView } from '@tarojs/components/lib/react'\nexport { GridBuilder } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { ListBuilder } from '@tarojs/components/lib/react'\nexport { ListView } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { default as Map, type MapProps } from './components/map'\nexport { createMapContext } from './components/map'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { NestedScrollBody } from '@tarojs/components/lib/react'\nexport { NestedScrollHeader } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { OpenContainer } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { default as Picker } from './components/picker'\nexport { PickerView, PickerViewColumn } from '@tarojs/components/lib/react'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { default as Refresher, type RefresherProps } from './components/refresher'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { Script } from '@tarojs/components/lib/react'\nexport { ScrollElementContext, type ScrollElementContextValue } from './contexts/ScrollElementContext'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { Snapshot } from '@tarojs/components/lib/react'\nexport { Span } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { default as Switch } from './components/switch'\nexport { Tabs } from '@tarojs/components/lib/react'\nexport { default as Text } from './components/text'\nexport { Textarea } from '@tarojs/components/lib/react'\nexport { Video } from '@tarojs/components/lib/react'\nexport { default as View } from './components/view'\nexport { VoipRoom } from '@tarojs/components/lib/react'\nexport { WebView } from '@tarojs/components/lib/react'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import './style/index.scss';
|
|
3
|
+
import { View } from '@tarojs/components';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { omit, createForwardRefComponent } from '../../utils/index.js';
|
|
6
|
+
import { useState, useCallback } from '../../utils/hooks.react.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function Switch(props) {
|
|
10
|
+
const {
|
|
11
|
+
type = 'switch',
|
|
12
|
+
checked: controlledChecked,
|
|
13
|
+
defaultChecked = false,
|
|
14
|
+
disabled = false,
|
|
15
|
+
color = '#04BE02',
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
beforeChange,
|
|
19
|
+
nativeProps = {},
|
|
20
|
+
onChange,
|
|
21
|
+
forwardedRef,
|
|
22
|
+
className,
|
|
23
|
+
style
|
|
24
|
+
} = props,
|
|
25
|
+
rest = __rest(props, ["type", "checked", "defaultChecked", "disabled", "color", "width", "height", "beforeChange", "nativeProps", "onChange", "forwardedRef", "className", "style"]);
|
|
26
|
+
const [innerChecked, setInnerChecked] = useState(defaultChecked);
|
|
27
|
+
const [loading, setLoading] = useState(false);
|
|
28
|
+
const isChecked = controlledChecked !== undefined ? controlledChecked : innerChecked;
|
|
29
|
+
const applyChange = useCallback(value => {
|
|
30
|
+
if (controlledChecked === undefined) {
|
|
31
|
+
setInnerChecked(value);
|
|
32
|
+
}
|
|
33
|
+
const e = {
|
|
34
|
+
detail: {
|
|
35
|
+
value
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
onChange && onChange(e);
|
|
39
|
+
}, [controlledChecked, onChange]);
|
|
40
|
+
const handleToggle = useCallback(newValue => {
|
|
41
|
+
if (disabled || loading) return;
|
|
42
|
+
if (beforeChange) {
|
|
43
|
+
const result = beforeChange(newValue);
|
|
44
|
+
if (result === false) return;
|
|
45
|
+
if (result instanceof Promise) {
|
|
46
|
+
setLoading(true);
|
|
47
|
+
result.then(asyncResult => {
|
|
48
|
+
setLoading(false);
|
|
49
|
+
if (asyncResult === false) return;
|
|
50
|
+
applyChange(newValue);
|
|
51
|
+
}, () => {
|
|
52
|
+
setLoading(false);
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
applyChange(newValue);
|
|
58
|
+
}, [disabled, loading, beforeChange, applyChange]);
|
|
59
|
+
const isSwitch = type === 'switch';
|
|
60
|
+
const sw = width !== null && width !== void 0 ? width : isSwitch ? 52 : 20;
|
|
61
|
+
const sh = height !== null && height !== void 0 ? height : isSwitch ? 32 : 20;
|
|
62
|
+
const dynamicStyle = isSwitch ? {
|
|
63
|
+
width: `${sw}px`,
|
|
64
|
+
height: `${sh}px`,
|
|
65
|
+
borderRadius: `${sh / 2}px`,
|
|
66
|
+
backgroundColor: isChecked ? color : '#DFDFDF',
|
|
67
|
+
borderColor: isChecked ? color : '#DFDFDF'
|
|
68
|
+
} : {
|
|
69
|
+
width: `${sh}px`,
|
|
70
|
+
height: `${sh}px`,
|
|
71
|
+
borderRadius: '4px',
|
|
72
|
+
backgroundColor: isChecked ? color : 'transparent',
|
|
73
|
+
borderColor: isChecked ? color : '#c9c9c9'
|
|
74
|
+
};
|
|
75
|
+
const cls = classNames('taro-switch', `taro-switch--type-${type}`, {
|
|
76
|
+
'taro-switch--checked': isChecked,
|
|
77
|
+
'taro-switch--disabled': disabled
|
|
78
|
+
}, className);
|
|
79
|
+
const rootStyle = Object.assign(Object.assign({}, dynamicStyle), style);
|
|
80
|
+
const onClick = e => {
|
|
81
|
+
e.stopPropagation();
|
|
82
|
+
handleToggle(!isChecked);
|
|
83
|
+
};
|
|
84
|
+
if (isSwitch) {
|
|
85
|
+
const thumbStyle = {
|
|
86
|
+
width: `${sh - 4}px`,
|
|
87
|
+
height: `${sh - 4}px`,
|
|
88
|
+
transform: isChecked ? `translateX(${sw - sh}px)` : undefined
|
|
89
|
+
};
|
|
90
|
+
return /*#__PURE__*/jsx(View, {
|
|
91
|
+
className: cls,
|
|
92
|
+
style: rootStyle,
|
|
93
|
+
ref: forwardedRef,
|
|
94
|
+
onClick: onClick,
|
|
95
|
+
...omit(rest, ['forwardedRef']),
|
|
96
|
+
...nativeProps,
|
|
97
|
+
children: /*#__PURE__*/jsx(View, {
|
|
98
|
+
className: "taro-switch__thumb",
|
|
99
|
+
style: thumbStyle
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return /*#__PURE__*/jsx(View, {
|
|
104
|
+
className: cls,
|
|
105
|
+
style: rootStyle,
|
|
106
|
+
ref: forwardedRef,
|
|
107
|
+
onClick: onClick,
|
|
108
|
+
...omit(rest, ['forwardedRef']),
|
|
109
|
+
...nativeProps,
|
|
110
|
+
children: /*#__PURE__*/jsx(View, {
|
|
111
|
+
className: "taro-switch__checkmark",
|
|
112
|
+
style: {
|
|
113
|
+
width: `${Math.round(sh * 0.3)}px`,
|
|
114
|
+
height: `${Math.round(sh * 0.5)}px`,
|
|
115
|
+
borderRight: `${Math.round(sh * 0.1)}px solid #fff`,
|
|
116
|
+
borderBottom: `${Math.round(sh * 0.1)}px solid #fff`,
|
|
117
|
+
transform: isChecked ? `translate(-50%, -65%) rotate(45deg) scale(1)` : `translate(-50%, -65%) rotate(45deg) scale(0)`
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
var index = createForwardRefComponent(Switch);
|
|
123
|
+
|
|
124
|
+
export { index as default };
|
|
125
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/switch/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport { View } from '@tarojs/components'\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\nimport { useCallback, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\nexport type BeforeChange = (value: boolean) => boolean | Promise<boolean>\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n type?: 'switch' | 'checkbox'\n checked?: boolean\n defaultChecked?: boolean\n disabled?: boolean\n color?: string\n width?: number\n height?: number\n beforeChange?: BeforeChange\n nativeProps?: Record<string, any>\n onChange?: (e: any) => void\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\nfunction Switch (props: IProps) {\n const {\n type = 'switch',\n checked: controlledChecked,\n defaultChecked = false,\n disabled = false,\n color = '#04BE02',\n width,\n height,\n beforeChange,\n nativeProps = {},\n onChange,\n forwardedRef,\n className,\n style,\n ...rest\n } = props\n\n const [innerChecked, setInnerChecked] = useState(defaultChecked)\n const [loading, setLoading] = useState(false)\n\n const isChecked = controlledChecked !== undefined\n ? controlledChecked\n : innerChecked\n\n const applyChange = useCallback((value: boolean) => {\n if (controlledChecked === undefined) {\n setInnerChecked(value)\n }\n\n const e = { detail: { value } }\n onChange && onChange(e)\n }, [controlledChecked, onChange])\n\n const handleToggle = useCallback((newValue: boolean) => {\n if (disabled || loading) return\n\n if (beforeChange) {\n const result = beforeChange(newValue)\n\n if (result === false) return\n\n if (result instanceof Promise) {\n setLoading(true)\n result\n .then((asyncResult) => {\n setLoading(false)\n if (asyncResult === false) return\n applyChange(newValue)\n }, () => {\n setLoading(false)\n })\n return\n }\n }\n\n applyChange(newValue)\n }, [disabled, loading, beforeChange, applyChange])\n\n const isSwitch = type === 'switch'\n const sw = width ?? (isSwitch ? 52 : 20)\n const sh = height ?? (isSwitch ? 32 : 20)\n\n const dynamicStyle: React.CSSProperties = isSwitch ? {\n width: `${sw}px`,\n height: `${sh}px`,\n borderRadius: `${sh / 2}px`,\n backgroundColor: isChecked ? color : '#DFDFDF',\n borderColor: isChecked ? color : '#DFDFDF'\n } : {\n width: `${sh}px`,\n height: `${sh}px`,\n borderRadius: '4px',\n backgroundColor: isChecked ? color : 'transparent',\n borderColor: isChecked ? color : '#c9c9c9'\n }\n\n const cls = classNames(\n 'taro-switch',\n `taro-switch--type-${type}`,\n {\n 'taro-switch--checked': isChecked,\n 'taro-switch--disabled': disabled\n },\n className\n )\n\n const rootStyle = {\n ...dynamicStyle,\n ...style\n } as unknown as React.CSSProperties\n\n const onClick = (e: React.MouseEvent) => {\n e.stopPropagation()\n handleToggle(!isChecked)\n }\n\n if (isSwitch) {\n const thumbStyle: React.CSSProperties = {\n width: `${sh - 4}px`,\n height: `${sh - 4}px`,\n transform: isChecked ? `translateX(${sw - sh}px)` : undefined\n }\n return (\n <View\n className={cls}\n style={rootStyle}\n ref={forwardedRef}\n onClick={onClick}\n {...omit(rest, ['forwardedRef'])}\n {...nativeProps}\n >\n <View className='taro-switch__thumb' style={thumbStyle} />\n </View>\n )\n }\n\n return (\n <View\n className={cls}\n style={rootStyle}\n ref={forwardedRef}\n onClick={onClick}\n {...omit(rest, ['forwardedRef'])}\n {...nativeProps}\n >\n <View\n className='taro-switch__checkmark'\n style={{\n width: `${Math.round(sh * 0.3)}px`,\n height: `${Math.round(sh * 0.5)}px`,\n borderRight: `${Math.round(sh * 0.1)}px solid #fff`,\n borderBottom: `${Math.round(sh * 0.1)}px solid #fff`,\n transform: isChecked\n ? `translate(-50%, -65%) rotate(45deg) scale(1)`\n : `translate(-50%, -65%) rotate(45deg) scale(0)`\n }}\n />\n </View>\n )\n}\n\nexport default createForwardRefComponent(Switch)\n"],"names":["Switch","props","type","checked","controlledChecked","defaultChecked","disabled","color","width","height","beforeChange","nativeProps","onChange","forwardedRef","className","style","rest","innerChecked","setInnerChecked","useState","loading","setLoading","isChecked","undefined","applyChange","useCallback","value","e","detail","handleToggle","newValue","result","Promise","then","asyncResult","isSwitch","sw","sh","dynamicStyle","borderRadius","backgroundColor","borderColor","cls","classNames","rootStyle","Object","assign","onClick","stopPropagation","thumbStyle","transform","_jsx","View","ref","omit","children","Math","round","borderRight","borderBottom","createForwardRefComponent"],"mappings":";;;;;;;;AA0BA,SAASA,MAAMA,CAAEC,KAAa,EAAA;EAC5B,MAAM;AACJC,MAAAA,IAAI,GAAG,QAAQ;AACfC,MAAAA,OAAO,EAAEC,iBAAiB;AAC1BC,MAAAA,cAAc,GAAG,KAAK;AACtBC,MAAAA,QAAQ,GAAG,KAAK;AAChBC,MAAAA,KAAK,GAAG,SAAS;MACjBC,KAAK;MACLC,MAAM;MACNC,YAAY;MACZC,WAAW,GAAG,EAAE;MAChBC,QAAQ;MACRC,YAAY;MACZC,SAAS;AACTC,MAAAA;AAAK,KAAA,GAEHd,KAAK;AADJe,IAAAA,IAAI,UACLf,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Q;AAAA,IAAA,GACbO,IAAI,CAACtC,IAAI,EAAE,CAAC,cAAc,CAAC,CAAC;AAAA,IAAA,GAC5BL,WAAW;IAAA4C,QAAA,eAEfJ,GAAA,CAACC,IAAI,EAAA;AACHtC,MAAAA,SAAS,EAAC,wBAAwB;AAClCC,MAAAA,KAAK,EAAE;QACLP,KAAK,EAAE,CAAGgD,EAAAA,IAAI,CAACC,KAAK,CAACpB,EAAE,GAAG,GAAG,CAAC,CAAI,EAAA,CAAA;QAClC5B,MAAM,EAAE,CAAG+C,EAAAA,IAAI,CAACC,KAAK,CAACpB,EAAE,GAAG,GAAG,CAAC,CAAI,EAAA,CAAA;QACnCqB,WAAW,EAAE,CAAGF,EAAAA,IAAI,CAACC,KAAK,CAACpB,EAAE,GAAG,GAAG,CAAC,CAAe,aAAA,CAAA;QACnDsB,YAAY,EAAE,CAAGH,EAAAA,IAAI,CAACC,KAAK,CAACpB,EAAE,GAAG,GAAG,CAAC,CAAe,aAAA,CAAA;AACpDa,QAAAA,SAAS,EAAE5B,SAAS,GAChB,CAAA,4CAAA,CAA8C,GAC9C,CAAA,4CAAA;AACL;KAEL;AAAA,GAAM,CAAC;AAEX;AAEA,YAAesC,yBAAyB,CAAC5D,MAAM,CAAC;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.taro-switch {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
|
|
6
|
+
&--disabled {
|
|
7
|
+
opacity: 0.5;
|
|
8
|
+
cursor: not-allowed;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&--type-switch {
|
|
12
|
+
border: 1px solid #DFDFDF;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&--type-switch &__thumb {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 1px;
|
|
19
|
+
left: 1px;
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
background-color: #fff;
|
|
22
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--type-checkbox {
|
|
26
|
+
border: 1px solid #c9c9c9;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--type-checkbox &__checkmark {
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 50%;
|
|
33
|
+
left: 50%;
|
|
34
|
+
}
|
|
35
|
+
}
|
package/dist/original/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, DraggableSheet, Editor, FollowSwan, Form, FunctionalPageNavigator, GridBuilder, GridView, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, ListBuilder, ListView, LivePlayer, LivePusher, Login, Lottie, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, NestedScrollBody, NestedScrollHeader, OfficialAccount, OpenContainer, OpenData, PageContainer, PageMeta, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span,
|
|
1
|
+
export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, DraggableSheet, Editor, FollowSwan, Form, FunctionalPageNavigator, GridBuilder, GridView, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, ListBuilder, ListView, LivePlayer, LivePusher, Login, Lottie, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, NestedScrollBody, NestedScrollHeader, OfficialAccount, OpenContainer, OpenData, PageContainer, PageMeta, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span, Tabs, Textarea, Video, VoipRoom, WebView } from '@tarojs/components/lib/react';
|
|
2
2
|
export { default as Button } from './components/button/index.js';
|
|
3
3
|
export { default as Icon } from './components/icon/index.js';
|
|
4
4
|
export { default as Image } from './components/image/index.js';
|
|
@@ -10,6 +10,7 @@ export { Refresher } from './components/refresher/index.js';
|
|
|
10
10
|
export { ScrollElementContext } from './contexts/ScrollElementContext.js';
|
|
11
11
|
export { default as ScrollView } from './components/scroll-view/index.js';
|
|
12
12
|
export { Swiper, SwiperItem } from './components/swiper/index.js';
|
|
13
|
+
export { default as Switch } from './components/switch/index.js';
|
|
13
14
|
export { default as Text } from './components/text/index.js';
|
|
14
15
|
export { default as View } from './components/view/index.js';
|
|
15
16
|
export { createMapContext } from './components/map/createMapContext.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.react.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { DraggableSheet } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { GridView } from '@tarojs/components/lib/react'\nexport { GridBuilder } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { ListBuilder } from '@tarojs/components/lib/react'\nexport { ListView } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { default as Map, type MapProps } from './components/map'\nexport { createMapContext } from './components/map'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { NestedScrollBody } from '@tarojs/components/lib/react'\nexport { NestedScrollHeader } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { OpenContainer } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { default as Picker } from './components/picker'\nexport { PickerView, PickerViewColumn } from '@tarojs/components/lib/react'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { default as Refresher, type RefresherProps } from './components/refresher'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { Script } from '@tarojs/components/lib/react'\nexport { ScrollElementContext, type ScrollElementContextValue } from './contexts/ScrollElementContext'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { Snapshot } from '@tarojs/components/lib/react'\nexport { Span } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { Switch } from '
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.react.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { DraggableSheet } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { GridView } from '@tarojs/components/lib/react'\nexport { GridBuilder } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { ListBuilder } from '@tarojs/components/lib/react'\nexport { ListView } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { default as Map, type MapProps } from './components/map'\nexport { createMapContext } from './components/map'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { NestedScrollBody } from '@tarojs/components/lib/react'\nexport { NestedScrollHeader } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { OpenContainer } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { default as Picker } from './components/picker'\nexport { PickerView, PickerViewColumn } from '@tarojs/components/lib/react'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { default as Refresher, type RefresherProps } from './components/refresher'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { Script } from '@tarojs/components/lib/react'\nexport { ScrollElementContext, type ScrollElementContextValue } from './contexts/ScrollElementContext'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { Snapshot } from '@tarojs/components/lib/react'\nexport { Span } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { default as Switch } from './components/switch'\nexport { Tabs } from '@tarojs/components/lib/react'\nexport { default as Text } from './components/text'\nexport { Textarea } from '@tarojs/components/lib/react'\nexport { Video } from '@tarojs/components/lib/react'\nexport { default as View } from './components/view'\nexport { VoipRoom } from '@tarojs/components/lib/react'\nexport { WebView } from '@tarojs/components/lib/react'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/components-react",
|
|
3
|
-
"version": "4.1.12-beta.
|
|
3
|
+
"version": "4.1.12-beta.40",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main:h5": "dist/index.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"swiper": "11.1.15",
|
|
31
31
|
"tlbs-map-react": "^1.1.1",
|
|
32
32
|
"tslib": "^2.6.2",
|
|
33
|
-
"@tarojs/components": "4.1.12-beta.
|
|
34
|
-
"@tarojs/shared": "4.1.12-beta.
|
|
35
|
-
"@tarojs/taro": "4.1.12-beta.
|
|
33
|
+
"@tarojs/components": "4.1.12-beta.40",
|
|
34
|
+
"@tarojs/shared": "4.1.12-beta.40",
|
|
35
|
+
"@tarojs/taro": "4.1.12-beta.40"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@babel/plugin-transform-runtime": "^7.24.1",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"solid-js": "^1.8.16",
|
|
50
50
|
"ts-jest": "^29.1.1",
|
|
51
51
|
"tmap-gl-types": "^0.1.8",
|
|
52
|
-
"@tarojs/helper": "4.1.12-beta.
|
|
53
|
-
"@tarojs/runtime": "4.1.12-beta.
|
|
52
|
+
"@tarojs/helper": "4.1.12-beta.40",
|
|
53
|
+
"@tarojs/runtime": "4.1.12-beta.40"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": "*",
|