@tarojs/components-react 4.1.6-beta.1 → 4.1.7-alpha.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/components/button/index.js +20 -7
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/image/index.js +2 -60
- package/dist/components/image/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/solid/components/button/index.js +20 -7
- package/dist/solid/components/button/index.js.map +1 -1
- package/dist/solid/components/image/index.js +28 -95
- package/dist/solid/components/image/index.js.map +1 -1
- package/dist/solid/index.css +1 -1
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import './style/index.scss.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { omit, createForwardRefComponent } from '../../utils/index.js';
|
|
5
|
-
import { useRef, useState, useEffect } from '../../utils/hooks.react.js';
|
|
5
|
+
import { useRef, useState, useEffect, useCallback } from '../../utils/hooks.react.js';
|
|
6
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
function Button(props) {
|
|
@@ -58,20 +58,33 @@ function Button(props) {
|
|
|
58
58
|
onClick,
|
|
59
59
|
hoverClass = 'button-hover',
|
|
60
60
|
loading = false,
|
|
61
|
-
type
|
|
61
|
+
type = 'default',
|
|
62
|
+
size
|
|
62
63
|
} = props,
|
|
63
|
-
restProps = __rest(props, ["forwardedRef", "plain", "children", "disabled", "className", "style", "onClick", "hoverClass", "loading", "type"]);
|
|
64
|
+
restProps = __rest(props, ["forwardedRef", "plain", "children", "disabled", "className", "style", "onClick", "hoverClass", "loading", "type", "size"]);
|
|
65
|
+
const handleClick = useCallback(e => {
|
|
66
|
+
if (disabled) return; // 如果按钮不可用,直接返回
|
|
67
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e); // 否则执行点击回调
|
|
68
|
+
}, [disabled, onClick]);
|
|
64
69
|
const cls = classNames(className, 'taro-button-core', {
|
|
65
|
-
[`${hoverClass}`]: state.hover && !disabled
|
|
70
|
+
[`${hoverClass}`]: state.hover && !disabled,
|
|
71
|
+
'taro-btn-disabled': disabled,
|
|
72
|
+
'taro-btn-loading': loading,
|
|
73
|
+
'taro-btn-plain': plain,
|
|
74
|
+
'taro-btn-mini': size === 'mini',
|
|
75
|
+
'taro-btn-default': type === 'default',
|
|
76
|
+
'taro-btn-primary': type === 'primary',
|
|
77
|
+
'taro-btn-warn': type === 'warn'
|
|
66
78
|
});
|
|
67
79
|
return /*#__PURE__*/jsxs("button", {
|
|
68
|
-
...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef']),
|
|
80
|
+
...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef', 'size', 'plain', 'disabled', 'onClick']),
|
|
69
81
|
type: type,
|
|
82
|
+
size: size,
|
|
83
|
+
disabled: disabled,
|
|
70
84
|
ref: forwardedRef,
|
|
71
85
|
className: cls,
|
|
72
86
|
style: style,
|
|
73
|
-
onClick:
|
|
74
|
-
disabled: disabled,
|
|
87
|
+
onClick: handleClick,
|
|
75
88
|
onTouchStart: _onTouchStart,
|
|
76
89
|
onTouchEnd: _onTouchEnd,
|
|
77
90
|
loading: loading.toString(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/button/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\nimport { useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n size?: string\n plain?: boolean\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n disabled?: boolean\n loading?: boolean\n type?: string\n className?: string\n forwardedRef?: React.MutableRefObject<HTMLButtonElement>\n}\n\ninterface IState {\n hover:boolean\n touch: boolean\n}\n\nfunction Button (props: IProps) {\n const startTimer = useRef<ReturnType<typeof setTimeout>>()\n const endTimer = useRef<ReturnType<typeof setTimeout>>()\n const [state, setState] = useState<IState>({\n hover: false,\n touch: false\n })\n\n useEffect(() => {\n return () => {\n startTimer.current && clearTimeout(startTimer.current)\n endTimer.current && clearTimeout(endTimer.current)\n }\n }, [])\n\n const _onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: true\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n startTimer.current = setTimeout(() => {\n if ((state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: true\n }))\n }\n }, props.hoverStartTime || 20)\n }\n props.onTouchStart && props.onTouchStart(e)\n }\n\n const _onTouchEnd = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: false\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n endTimer.current = setTimeout(() => {\n if (!(state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: false\n }))\n }\n }, props.hoverStayTime || 70)\n }\n props.onTouchEnd && props.onTouchEnd(e)\n }\n\n const { forwardedRef, plain = false, children, disabled = false, className, style, onClick, hoverClass = 'button-hover', loading = false, type, ...restProps } = props\n\n const cls = classNames(\n className,\n 'taro-button-core',\n {\n [`${hoverClass}`]: (state as IState).hover && !disabled\n }\n )\n\n return (\n <button\n {...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef'])}\n type={type}\n ref={forwardedRef}\n className={cls}\n style={style}\n onClick={
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/button/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\nimport { useCallback, useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n size?: string\n plain?: boolean\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n disabled?: boolean\n loading?: boolean\n type?: string\n className?: string\n forwardedRef?: React.MutableRefObject<HTMLButtonElement>\n onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void\n}\n\ninterface IState {\n hover: boolean\n touch: boolean\n}\n\nfunction Button (props: IProps) {\n const startTimer = useRef<ReturnType<typeof setTimeout>>()\n const endTimer = useRef<ReturnType<typeof setTimeout>>()\n const [state, setState] = useState<IState>({\n hover: false,\n touch: false\n })\n\n useEffect(() => {\n return () => {\n startTimer.current && clearTimeout(startTimer.current)\n endTimer.current && clearTimeout(endTimer.current)\n }\n }, [])\n\n const _onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: true\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n startTimer.current = setTimeout(() => {\n if ((state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: true\n }))\n }\n }, props.hoverStartTime || 20)\n }\n props.onTouchStart && props.onTouchStart(e)\n }\n\n const _onTouchEnd = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: false\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n endTimer.current = setTimeout(() => {\n if (!(state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: false\n }))\n }\n }, props.hoverStayTime || 70)\n }\n props.onTouchEnd && props.onTouchEnd(e)\n }\n\n const { forwardedRef, plain = false, children, disabled = false, className, style, onClick, hoverClass = 'button-hover', loading = false, type = 'default', size, ...restProps } = props\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) return // 如果按钮不可用,直接返回\n onClick?.(e) // 否则执行点击回调\n },\n [disabled, onClick]\n )\n\n const cls = classNames(\n className,\n 'taro-button-core',\n {\n [`${hoverClass}`]: (state as IState).hover && !disabled,\n 'taro-btn-disabled': disabled,\n 'taro-btn-loading': loading,\n 'taro-btn-plain': plain,\n 'taro-btn-mini': size === 'mini',\n 'taro-btn-default': type === 'default',\n 'taro-btn-primary': type === 'primary',\n 'taro-btn-warn': type === 'warn'\n }\n )\n\n return (\n <button\n {...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef', 'size', 'plain', 'disabled', 'onClick'])}\n type={type}\n size={size}\n disabled={disabled}\n ref={forwardedRef}\n className={cls}\n style={style}\n onClick={handleClick}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n loading={loading.toString()}\n plain={plain.toString()}\n >\n {!!loading && <i className='weui-loading' />}\n {children}\n </button>\n )\n}\n\nexport default createForwardRefComponent(Button)\n"],"names":["Button","props","startTimer","useRef","endTimer","state","setState","useState","hover","touch","useEffect","current","clearTimeout","_onTouchStart","e","Object","assign","hoverClass","disabled","setTimeout","hoverStartTime","onTouchStart","_onTouchEnd","hoverStayTime","onTouchEnd","forwardedRef","plain","children","className","style","onClick","loading","type","size","restProps","__rest","handleClick","useCallback","cls","classNames","_jsxs","omit","ref","toString","_jsx","createForwardRefComponent"],"mappings":";;;;;;;AA4BA,SAASA,MAAMA,CAAEC,KAAa,EAAA;AAC5B,EAAA,MAAMC,UAAU,GAAGC,MAAM,EAAiC;AAC1D,EAAA,MAAMC,QAAQ,GAAGD,MAAM,EAAiC;AACxD,EAAA,MAAM,CAACE,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAS;AACzCC,IAAAA,KAAK,EAAE,KAAK;AACZC,IAAAA,KAAK,EAAE;AACR,GAAA,CAAC;AAEFC,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,OAAO,MAAK;MACVR,UAAU,CAACS,OAAO,IAAIC,YAAY,CAACV,UAAU,CAACS,OAAO,CAAC;MACtDP,QAAQ,CAACO,OAAO,IAAIC,YAAY,CAACR,QAAQ,CAACO,OAAO,CAAC;KACnD;GACF,EAAE,EAAE,CAAC;EAEN,MAA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AA,kBAAkB,EAAEa,OAAO;AAC3B,IAAA,gBAAgB,EAAEL,KAAK;IACvB,eAAe,EAAEO,IAAI,KAAK,MAAM;IAChC,kBAAkB,EAAED,IAAI,KAAK,SAAS;IACtC,kBAAkB,EAAEA,IAAI,KAAK,SAAS;IACtC,eAAe,EAAEA,IAAI,KAAK;AAC3B,GAAA,CACF;AAED,EAAA,oBACEQ,IAAA,CAAA,QAAA,EAAA;IAAA,GACMC,IAAI,CAACP,SAAS,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AAC5IF,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,IAAI,EAAEA,IAAK;AACXf,IAAAA,QAAQ,EAAEA,QAAS;AACnBwB,IAAAA,GAAG,EAAEjB,YAAa;AAClBG,IAAAA,SAAS,EAAEU,GAAI;AACfT,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,OAAO,EAAEM,WAAY;AACrBf,IAAAA,YAAY,EAAER,aAAc;AAC5BW,IAAAA,UAAU,EAAEF,WAAY;AACxBS,IAAAA,OAAO,EAAEA,OAAO,CAACY,QAAQ,EAAG;AAC5BjB,IAAAA,KAAK,EAAEA,KAAK,CAACiB,QAAQ,EAAG;AAAAhB,IAAAA,QAAA,EAEvB,CAAA,CAAC,CAACI,OAAO,iBAAIa,GAAA,CAAA,GAAA,EAAA;AAAGhB,MAAAA,SAAS,EAAC;KAAc,CAAG,EAC3CD,QAAQ;AAAA,GACH,CAAC;AAEb;AAEA,YAAekB,yBAAyB,CAAC7C,MAAM,CAAC;;;;"}
|
|
@@ -2,41 +2,9 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import './style/index.css.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { createForwardRefComponent } from '../../utils/index.js';
|
|
5
|
-
import { useRef, useState,
|
|
5
|
+
import { useRef, useState, useCallback, useEffect } from '../../utils/hooks.react.js';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
const LEGO_CDN_URL = 'http://ossin.jd.com/swm-plus/h5Tag/tag.js';
|
|
9
|
-
// 检查CDN脚本是否已加载
|
|
10
|
-
const isLegoScriptLoaded = () => {
|
|
11
|
-
return document.querySelector(`script[src="${LEGO_CDN_URL}"]`) !== null;
|
|
12
|
-
};
|
|
13
|
-
// 插入CDN脚本
|
|
14
|
-
const insertLegoScript = () => {
|
|
15
|
-
if (isLegoScriptLoaded()) return;
|
|
16
|
-
const script = document.createElement('script');
|
|
17
|
-
script.type = 'module';
|
|
18
|
-
script.src = LEGO_CDN_URL;
|
|
19
|
-
document.head.appendChild(script);
|
|
20
|
-
};
|
|
21
|
-
// 解析lego协议URL
|
|
22
|
-
const parseLegoUrl = src => {
|
|
23
|
-
if (!src.startsWith('lego://')) return null;
|
|
24
|
-
try {
|
|
25
|
-
// 移除 'lego://' 前缀
|
|
26
|
-
const urlWithoutProtocol = src.substring(7);
|
|
27
|
-
// 分割tagId和参数
|
|
28
|
-
const [tagId, params] = urlWithoutProtocol.split('?');
|
|
29
|
-
// 解析参数
|
|
30
|
-
const text = params ? new URLSearchParams(params).get('text') || '' : '';
|
|
31
|
-
return {
|
|
32
|
-
tagId,
|
|
33
|
-
text
|
|
34
|
-
};
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.warn('Failed to parse lego URL:', src, error);
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
8
|
function Image(props) {
|
|
41
9
|
const imgRef = useRef(null);
|
|
42
10
|
const observer = useRef({});
|
|
@@ -51,18 +19,7 @@ function Image(props) {
|
|
|
51
19
|
imgProps,
|
|
52
20
|
forwardedRef
|
|
53
21
|
} = props,
|
|
54
|
-
reset = __rest(props
|
|
55
|
-
// 检查是否为lego模式
|
|
56
|
-
, ["className", "style", "src", "mode", "onError", "lazyLoad", "imgProps", "forwardedRef"]);
|
|
57
|
-
// 检查是否为lego模式
|
|
58
|
-
const legoData = parseLegoUrl(src);
|
|
59
|
-
const isLegoMode = legoData !== null;
|
|
60
|
-
// 如果是lego模式,确保CDN脚本已加载
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (isLegoMode) {
|
|
63
|
-
insertLegoScript();
|
|
64
|
-
}
|
|
65
|
-
}, [isLegoMode]);
|
|
22
|
+
reset = __rest(props, ["className", "style", "src", "mode", "onError", "lazyLoad", "imgProps", "forwardedRef"]);
|
|
66
23
|
const cls = classNames('taro-img', {
|
|
67
24
|
'taro-img__widthfix': mode === 'widthFix'
|
|
68
25
|
}, className);
|
|
@@ -101,21 +58,6 @@ function Image(props) {
|
|
|
101
58
|
(_b = (_a = observer.current) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
102
59
|
};
|
|
103
60
|
}, [lazyLoad, src]);
|
|
104
|
-
// 如果是lego模式,渲染canvas-tag
|
|
105
|
-
if (isLegoMode && legoData) {
|
|
106
|
-
return /*#__PURE__*/jsx("div", {
|
|
107
|
-
className: cls,
|
|
108
|
-
style: style,
|
|
109
|
-
ref: forwardedRef,
|
|
110
|
-
...reset,
|
|
111
|
-
children: /*#__PURE__*/jsx("canvas-tag", {
|
|
112
|
-
tagId: legoData.tagId,
|
|
113
|
-
text: legoData.text,
|
|
114
|
-
...imgProps
|
|
115
|
-
})
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
// 普通图片模式
|
|
119
61
|
return /*#__PURE__*/jsx("div", {
|
|
120
62
|
className: cls,
|
|
121
63
|
style: style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/image/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent } from '../../utils'\nimport { useCallback, useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n src: string\n mode: string\n onError: () => void\n onLoad: (e) => void\n lazyLoad?: boolean\n imgProps?: Record<string, any>\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/image/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent } from '../../utils'\nimport { useCallback, useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n src: string\n mode: string\n onError: () => void\n onLoad: (e) => void\n lazyLoad?: boolean\n imgProps?: Record<string, any>\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\nfunction Image (props: IProps) {\n const imgRef = useRef<HTMLImageElement | null>(null)\n const observer = useRef<Partial<IntersectionObserver>>({})\n const [, setIsLoaded] = useState(false)\n const {\n className,\n style = {},\n src,\n mode,\n onError,\n lazyLoad,\n imgProps,\n forwardedRef,\n ...reset\n } = props\n const cls = classNames(\n 'taro-img',\n {\n 'taro-img__widthfix': mode === 'widthFix'\n },\n className\n )\n const imgCls = classNames(\n 'taro-img__mode-' +\n (mode || 'scaleToFill').toLowerCase().replace(/\\s/g, '')\n )\n\n const imageOnLoad = useCallback((e) => {\n const { onLoad } = props\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n writable: true,\n value: {\n width: e.target.width,\n height: e.target.height\n }\n })\n\n onLoad && onLoad(e)\n }, [props])\n\n useEffect(() => {\n if (lazyLoad) {\n observer.current = new IntersectionObserver(\n entries => {\n // 异步 api 关系\n if (entries[entries.length - 1].isIntersecting) {\n setIsLoaded(true)\n // findDOMNode(this).children[0].src = src\n imgRef.current!.src = src\n }\n },\n {\n rootMargin: '300px 0px'\n }\n )\n observer.current.observe?.(imgRef.current!)\n }\n\n return () => {\n observer.current?.disconnect?.()\n }\n }, [lazyLoad, src])\n\n return (\n <div className={cls} style={style} ref={forwardedRef} {...reset}>\n {lazyLoad ? (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n data-src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n ) : (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n )}\n </div>\n )\n}\n\nexport default createForwardRefComponent(Image)\n"],"names":["Image","props","imgRef","useRef","observer","setIsLoaded","useState","className","style","src","mode","onError","lazyLoad","imgProps","forwardedRef","reset","__rest","cls","classNames","imgCls","toLowerCase","replace","imageOnLoad","useCallback","e","onLoad","Object","defineProperty","enumerable","writable","value","width","target","height","useEffect","current","IntersectionObserver","entries","length","isIntersecting","rootMargin","_b","_a","observe","call","disconnect","_jsx","ref","children","img","createForwardRefComponent"],"mappings":";;;;;;;AAmBA,SAASA,KAAKA,CAAEC,KAAa,EAAA;AAC3B,EAAA,MAAMC,MAAM,GAAGC,MAAM,CAA0B,IAAI,CAAC;AACpD,EAAA,MAAMC,QAAQ,GAAGD,MAAM,CAAgC,EAAE,CAAC;AAC1D,EAAA,MAAM,GAAGE,WAAW,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EACvC,MAAM;MACJC,SAAS;MACTC,KAAK,GAAG,EAAE;MACVC,GAAG;MACHC,IAAI;MACJC,OAAO;MACPC,QAAQ;MACRC,QAAQ;AACRC,MAAAA;AAAY,KAAA,GAEVb,KAAK;IADJc,KAAK,GAAAC,MAAA,CACNf,KAAK,EAVH,CAUL,WAAA,EAAA,OAAA,EAAA,KAAA,EAAA,MAAA,EAAA,SAAA,EAAA,UAAA,EAAA,UAAA,EAAA,cAAA,CAAA,CAAQ;AACT,EAAA,MAAMgB,GAAG,GAAGC,UAAU,CACpB,UAAU,EACV;IACE,oBAAoB,EAAER,IAAI,KAAK;GAChC,EACDH,SAAS,CACV;EACD,MAAMY,MAAM,GAAGD,UAAU,CACvB,iBAAiB,GACf,CAACR,IAAI,IAAI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,EAAA,GAAA,MAAArC,QAAQ,CAAC+B,OAAO,MAAE,IAAA,IAAAO,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAAA,EAAA,CAAAG,UAAU,kDAAI;KACjC;AACH,GAAC,EAAE,CAACjC,QAAQ,EAAEH,GAAG,CAAC,CAAC;AAEnB,EAAA,oBACEqC,GAAA,CAAA,KAAA,EAAA;AAAKvC,IAAAA,SAAS,EAAEU,GAAI;AAACT,IAAAA,KAAK,EAAEA,KAAM;AAACuC,IAAAA,GAAG,EAAEjC,YAAa;AAAA,IAAA,GAAKC,KAAK;IAAAiC,QAAA,EAC5DpC,QAAQ,gBACPkC,GAAA,CAAA,KAAA,EAAA;AACEC,MAAAA,GAAG,EAAEE,GAAG,IAAK/C,MAAM,CAACiC,OAAO,GAAGc,GAAK;AACnC1C,MAAAA,SAAS,EAAEY,MAAO;AAClB,MAAA,UAAA,EAAUV,GAAI;AACdgB,MAAAA,MAAM,EAAEH,WAAY;AACpBX,MAAAA,OAAO,EAAEA,OAAQ;MAAA,GACbE;KAAS,CACb,gBAEFiC,GAAA,CAAA,KAAA,EAAA;AACEC,MAAAA,GAAG,EAAEE,GAAG,IAAK/C,MAAM,CAACiC,OAAO,GAAGc,GAAK;AACnC1C,MAAAA,SAAS,EAAEY,MAAO;AAClBV,MAAAA,GAAG,EAAEA,GAAI;AACTgB,MAAAA,MAAM,EAAEH,WAAY;AACpBX,MAAAA,OAAO,EAAEA,OAAQ;MAAA,GACbE;KACJ;AACH,GACE,CAAC;AAEV;AAEA,YAAeqC,yBAAyB,CAAClD,KAAK,CAAC;;;;"}
|
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[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border-radius:5px;border-width:0;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core:after{border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;content:" ";height:200%;left:0;position:absolute;top:0;transform:scale(.5);transform-origin:0 0;width:200%}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core[type=default]{background-color:#f8f8f8;color:#000}.taro-button-core[type=default]:not([disabled]):visited{color:#000}.taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core[size=mini]{display:inline-block;font-size:13px;line-height:2.3;padding:0 1.32em;width:auto}.taro-button-core[plain=true],.taro-button-core[plain=true][type=default],.taro-button-core[plain=true][type=primary]{background-color:transparent;border-width:1px}.taro-button-core[disabled]{color:hsla(0,0%,100%,.6)}.taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core[disabled][type=primary]{background-color:#9ed99d}.taro-button-core[disabled][type=warn]{background-color:#ec8b89}.taro-button-core[loading] .weui-loading{margin:-.2em .34em 0 0}.taro-button-core[loading][type=primary],.taro-button-core[loading][type=warn]{color:hsla(0,0%,100%,.6)}.taro-button-core[loading][type=primary]{background-color:#179b16}.taro-button-core[loading][type=warn]{background-color:#ce3c39}.taro-button-core[plain=true][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain=true][type=primary]:not([disabled]):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core[plain=true][type=primary]:after{border-width:0}.taro-button-core[plain=true][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain=true][type=warn]:not([disabled]):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core[plain=true][type=warn]:after{border-width:0}.taro-button-core[plain=true],.taro-button-core[plain=true][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain=true]:not([disabled]):active,.taro-button-core[plain=true][type=default]:not([disabled]):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core[plain=true]:after,.taro-button-core[plain=true][type=default]:after{border-width:0}.taro-button-core[type=primary]{background-color:#1aad19;color:#fff}.taro-button-core[type=primary]:not([disabled]):visited{color:#fff}.taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core[type=warn]{background-color:#e64340;color:#fff}.taro-button-core[type=warn]:not([disabled]):visited{color:#fff}.taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core[plain=true][disabled],.taro-button-core[plain=true][disabled][type=primary]{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;height:240px;overflow:hidden;position:relative;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{background-color:rgba(0,0,0,.6);position:absolute;z-index:1001}.taro-picker{background-color:#e5e5e5;bottom:0;font-size:14px;left:0;position:absolute;width:100%;z-index:1002}.taro-picker__hd{align-items:center;background-color:#fff;display:flex;font-size:17px;height:44px;justify-content:space-between;padding:0;position:relative}.taro-picker__hd:after{background-color:#e5e5e5;bottom:0;content:"";height:1px;left:0;position:absolute;transform:scaleY(.5);width:100%}.taro-picker__action{color:#ff0f23;flex:0 0 auto;font-size:14px;height:44px;line-height:44px;padding:0 10px}.taro-picker__action:first-child{color:#888}.taro-picker__title{color:#000;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{background-color:#fff;height:238px;overflow:hidden;width:100%}.taro-picker__bd,.taro-picker__group{box-sizing:border-box;display:flex;flex:1}.taro-picker__group{align-items:center;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{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));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__indicator:after,.taro-picker__indicator:before{background-color:#e5e5e5;content:"";height:1px;left:0;position:absolute;right:0;transform:scaleY(.5)}.taro-picker__indicator:before{top:0}.taro-picker__indicator:after{bottom:0}.taro-picker__content{box-sizing:border-box;height:100%;width:100%}.taro-picker__item{align-items:center;box-sizing:border-box;color:#000;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{color:#ff0f23;font-weight:500}.taro-picker__item--disabled{color:#999}.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[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;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;line-height:2.3;padding:0 1.32em;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 .weui-loading{margin:-.2em .34em 0 0}.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;height:240px;overflow:hidden;position:relative;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{background-color:rgba(0,0,0,.6);position:absolute;z-index:1001}.taro-picker{background-color:#e5e5e5;bottom:0;font-size:14px;left:0;position:absolute;width:100%;z-index:1002}.taro-picker__hd{align-items:center;background-color:#fff;display:flex;font-size:17px;height:44px;justify-content:space-between;padding:0;position:relative}.taro-picker__hd:after{background-color:#e5e5e5;bottom:0;content:"";height:1px;left:0;position:absolute;transform:scaleY(.5);width:100%}.taro-picker__action{color:#ff0f23;flex:0 0 auto;font-size:14px;height:44px;line-height:44px;padding:0 10px}.taro-picker__action:first-child{color:#888}.taro-picker__title{color:#000;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{background-color:#fff;height:238px;overflow:hidden;width:100%}.taro-picker__bd,.taro-picker__group{box-sizing:border-box;display:flex;flex:1}.taro-picker__group{align-items:center;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{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));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__indicator:after,.taro-picker__indicator:before{background-color:#e5e5e5;content:"";height:1px;left:0;position:absolute;right:0;transform:scaleY(.5)}.taro-picker__indicator:before{top:0}.taro-picker__indicator:after{bottom:0}.taro-picker__content{box-sizing:border-box;height:100%;width:100%}.taro-picker__item{align-items:center;box-sizing:border-box;color:#000;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{color:#ff0f23;font-weight:500}.taro-picker__item--disabled{color:#999}.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}
|
|
@@ -3,7 +3,7 @@ import { __rest } from 'tslib';
|
|
|
3
3
|
import './style/index.scss.js';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { omit, createForwardRefComponent } from '../../utils/index.js';
|
|
6
|
-
import { useRef, useState, useEffect } from '../../utils/hooks.solid.js';
|
|
6
|
+
import { useRef, useState, useEffect, useCallback } from '../../utils/hooks.solid.js';
|
|
7
7
|
|
|
8
8
|
var _tmpl$ = /*#__PURE__*/template(`<button>`),
|
|
9
9
|
_tmpl$2 = /*#__PURE__*/template(`<i class=weui-loading>`);
|
|
@@ -60,21 +60,34 @@ function Button(props) {
|
|
|
60
60
|
onClick,
|
|
61
61
|
hoverClass = 'button-hover',
|
|
62
62
|
loading = false,
|
|
63
|
-
type
|
|
63
|
+
type = 'default',
|
|
64
|
+
size
|
|
64
65
|
} = props,
|
|
65
|
-
restProps = __rest(props, ["forwardedRef", "plain", "children", "disabled", "className", "style", "onClick", "hoverClass", "loading", "type"]);
|
|
66
|
+
restProps = __rest(props, ["forwardedRef", "plain", "children", "disabled", "className", "style", "onClick", "hoverClass", "loading", "type", "size"]);
|
|
67
|
+
const handleClick = useCallback(e => {
|
|
68
|
+
if (disabled) return; // 如果按钮不可用,直接返回
|
|
69
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e); // 否则执行点击回调
|
|
70
|
+
}, [disabled, onClick]);
|
|
66
71
|
const cls = classNames(className, 'taro-button-core', {
|
|
67
|
-
[`${hoverClass}`]: state.hover && !disabled
|
|
72
|
+
[`${hoverClass}`]: state.hover && !disabled,
|
|
73
|
+
'taro-btn-disabled': disabled,
|
|
74
|
+
'taro-btn-loading': loading,
|
|
75
|
+
'taro-btn-plain': plain,
|
|
76
|
+
'taro-btn-mini': size === 'mini',
|
|
77
|
+
'taro-btn-default': type === 'default',
|
|
78
|
+
'taro-btn-primary': type === 'primary',
|
|
79
|
+
'taro-btn-warn': type === 'warn'
|
|
68
80
|
});
|
|
69
81
|
return (() => {
|
|
70
82
|
var _el$ = _tmpl$();
|
|
71
83
|
use(forwardedRef, _el$);
|
|
72
|
-
spread(_el$, mergeProps(() => omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef']), {
|
|
84
|
+
spread(_el$, mergeProps(() => omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef', 'size', 'plain', 'disabled', 'onClick']), {
|
|
73
85
|
"type": type,
|
|
86
|
+
"size": size,
|
|
87
|
+
"disabled": disabled,
|
|
74
88
|
"className": cls,
|
|
75
89
|
"style": style,
|
|
76
|
-
"onClick":
|
|
77
|
-
"disabled": disabled,
|
|
90
|
+
"onClick": handleClick,
|
|
78
91
|
"onTouchStart": _onTouchStart,
|
|
79
92
|
"onTouchEnd": _onTouchEnd,
|
|
80
93
|
get loading() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/button/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\nimport { useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n size?: string\n plain?: boolean\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n disabled?: boolean\n loading?: boolean\n type?: string\n className?: string\n forwardedRef?: React.MutableRefObject<HTMLButtonElement>\n}\n\ninterface IState {\n hover:boolean\n touch: boolean\n}\n\nfunction Button (props: IProps) {\n const startTimer = useRef<ReturnType<typeof setTimeout>>()\n const endTimer = useRef<ReturnType<typeof setTimeout>>()\n const [state, setState] = useState<IState>({\n hover: false,\n touch: false\n })\n\n useEffect(() => {\n return () => {\n startTimer.current && clearTimeout(startTimer.current)\n endTimer.current && clearTimeout(endTimer.current)\n }\n }, [])\n\n const _onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: true\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n startTimer.current = setTimeout(() => {\n if ((state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: true\n }))\n }\n }, props.hoverStartTime || 20)\n }\n props.onTouchStart && props.onTouchStart(e)\n }\n\n const _onTouchEnd = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: false\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n endTimer.current = setTimeout(() => {\n if (!(state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: false\n }))\n }\n }, props.hoverStayTime || 70)\n }\n props.onTouchEnd && props.onTouchEnd(e)\n }\n\n const { forwardedRef, plain = false, children, disabled = false, className, style, onClick, hoverClass = 'button-hover', loading = false, type, ...restProps } = props\n\n const cls = classNames(\n className,\n 'taro-button-core',\n {\n [`${hoverClass}`]: (state as IState).hover && !disabled\n }\n )\n\n return (\n <button\n {...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef'])}\n type={type}\n ref={forwardedRef}\n className={cls}\n style={style}\n onClick={
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/button/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\nimport { useCallback, useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n size?: string\n plain?: boolean\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n disabled?: boolean\n loading?: boolean\n type?: string\n className?: string\n forwardedRef?: React.MutableRefObject<HTMLButtonElement>\n onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void\n}\n\ninterface IState {\n hover: boolean\n touch: boolean\n}\n\nfunction Button (props: IProps) {\n const startTimer = useRef<ReturnType<typeof setTimeout>>()\n const endTimer = useRef<ReturnType<typeof setTimeout>>()\n const [state, setState] = useState<IState>({\n hover: false,\n touch: false\n })\n\n useEffect(() => {\n return () => {\n startTimer.current && clearTimeout(startTimer.current)\n endTimer.current && clearTimeout(endTimer.current)\n }\n }, [])\n\n const _onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: true\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n startTimer.current = setTimeout(() => {\n if ((state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: true\n }))\n }\n }, props.hoverStartTime || 20)\n }\n props.onTouchStart && props.onTouchStart(e)\n }\n\n const _onTouchEnd = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: false\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n endTimer.current = setTimeout(() => {\n if (!(state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: false\n }))\n }\n }, props.hoverStayTime || 70)\n }\n props.onTouchEnd && props.onTouchEnd(e)\n }\n\n const { forwardedRef, plain = false, children, disabled = false, className, style, onClick, hoverClass = 'button-hover', loading = false, type = 'default', size, ...restProps } = props\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) return // 如果按钮不可用,直接返回\n onClick?.(e) // 否则执行点击回调\n },\n [disabled, onClick]\n )\n\n const cls = classNames(\n className,\n 'taro-button-core',\n {\n [`${hoverClass}`]: (state as IState).hover && !disabled,\n 'taro-btn-disabled': disabled,\n 'taro-btn-loading': loading,\n 'taro-btn-plain': plain,\n 'taro-btn-mini': size === 'mini',\n 'taro-btn-default': type === 'default',\n 'taro-btn-primary': type === 'primary',\n 'taro-btn-warn': type === 'warn'\n }\n )\n\n return (\n <button\n {...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef', 'size', 'plain', 'disabled', 'onClick'])}\n type={type}\n size={size}\n disabled={disabled}\n ref={forwardedRef}\n className={cls}\n style={style}\n onClick={handleClick}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n loading={loading.toString()}\n plain={plain.toString()}\n >\n {!!loading && <i className='weui-loading' />}\n {children}\n </button>\n )\n}\n\nexport default createForwardRefComponent(Button)\n"],"names":["Button","props","startTimer","useRef","endTimer","state","setState","useState","hover","touch","useEffect","current","clearTimeout","_onTouchStart","e","Object","assign","hoverClass","disabled","setTimeout","hoverStartTime","onTouchStart","_onTouchEnd","hoverStayTime","onTouchEnd","forwardedRef","plain","children","className","style","onClick","loading","type","size","restProps","__rest","handleClick","useCallback","cls","classNames","_el$","_tmpl$","_$use","_$spread","_$mergeProps","omit","toString","_$insert","_tmpl$2","createForwardRefComponent"],"mappings":";;;;;;;;;AA4BA,SAASA,MAAMA,CAAEC,KAAa,EAAA;AAC5B,EAAA,MAAMC,UAAU,GAAGC,MAAM,EAAiC;AAC1D,EAAA,MAAMC,QAAQ,GAAGD,MAAM,EAAiC;AACxD,EAAA,MAAM,CAACE,KAAK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AAE;AAAA,OAAA;AAAA,MAAA,IAC3BpB,KAAKA,GAAA;AAAA,QAAA,OAAEA,KAAK,CAACoB,QAAQ,EAAE;AAAA;AAAA,KAAA,CAAA,EAAA,KAAA,EAAA,IAAA,CAAA;IAAAC,MAAA,CAAAP,IAAA,EAEtB,CAAC,CAACT,OAAO,IAAAiB,OAAA,EAAkC,EAAA,IAAA,CAAA;IAAAD,MAAA,CAAAP,IAAA,EAC3Cb,QAAQ,EAAA,IAAA,CAAA;AAAA,IAAA,OAAAa,IAAA;AAAA,GAAA,GAAA;AAGf;AAEA,YAAeS,yBAAyB,CAACjD,MAAM,CAAC;;;;"}
|
|
@@ -1,46 +1,12 @@
|
|
|
1
|
-
import { template, use, spread,
|
|
1
|
+
import { template, use, spread, insert, addEventListener, setAttribute, effect, style } from 'solid-js/web';
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import './style/index.css.js';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { createForwardRefComponent } from '../../utils/index.js';
|
|
6
|
-
import { useRef, useState,
|
|
6
|
+
import { useRef, useState, useCallback, useEffect } from '../../utils/hooks.solid.js';
|
|
7
7
|
|
|
8
|
-
var _tmpl$ = /*#__PURE__*/template(`<div
|
|
9
|
-
_tmpl$2 = /*#__PURE__*/template(`<
|
|
10
|
-
_tmpl$3 = /*#__PURE__*/template(`<img>`);
|
|
11
|
-
// CDN脚本URL
|
|
12
|
-
const LEGO_CDN_URL = 'http://ossin.jd.com/swm-plus/h5Tag/tag.js';
|
|
13
|
-
// 检查CDN脚本是否已加载
|
|
14
|
-
const isLegoScriptLoaded = () => {
|
|
15
|
-
return document.querySelector(`script[src="${LEGO_CDN_URL}"]`) !== null;
|
|
16
|
-
};
|
|
17
|
-
// 插入CDN脚本
|
|
18
|
-
const insertLegoScript = () => {
|
|
19
|
-
if (isLegoScriptLoaded()) return;
|
|
20
|
-
const script = document.createElement('script');
|
|
21
|
-
script.type = 'module';
|
|
22
|
-
script.src = LEGO_CDN_URL;
|
|
23
|
-
document.head.appendChild(script);
|
|
24
|
-
};
|
|
25
|
-
// 解析lego协议URL
|
|
26
|
-
const parseLegoUrl = src => {
|
|
27
|
-
if (!src.startsWith('lego://')) return null;
|
|
28
|
-
try {
|
|
29
|
-
// 移除 'lego://' 前缀
|
|
30
|
-
const urlWithoutProtocol = src.substring(7);
|
|
31
|
-
// 分割tagId和参数
|
|
32
|
-
const [tagId, params] = urlWithoutProtocol.split('?');
|
|
33
|
-
// 解析参数
|
|
34
|
-
const text = params ? new URLSearchParams(params).get('text') || '' : '';
|
|
35
|
-
return {
|
|
36
|
-
tagId,
|
|
37
|
-
text
|
|
38
|
-
};
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.warn('Failed to parse lego URL:', src, error);
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
8
|
+
var _tmpl$ = /*#__PURE__*/template(`<div>`),
|
|
9
|
+
_tmpl$2 = /*#__PURE__*/template(`<img>`);
|
|
44
10
|
function Image(props) {
|
|
45
11
|
const imgRef = useRef(null);
|
|
46
12
|
const observer = useRef({});
|
|
@@ -55,18 +21,7 @@ function Image(props) {
|
|
|
55
21
|
imgProps,
|
|
56
22
|
forwardedRef
|
|
57
23
|
} = props,
|
|
58
|
-
reset = __rest(props
|
|
59
|
-
// 检查是否为lego模式
|
|
60
|
-
, ["className", "style", "src", "mode", "onError", "lazyLoad", "imgProps", "forwardedRef"]);
|
|
61
|
-
// 检查是否为lego模式
|
|
62
|
-
const legoData = parseLegoUrl(src);
|
|
63
|
-
const isLegoMode = legoData !== null;
|
|
64
|
-
// 如果是lego模式,确保CDN脚本已加载
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
if (isLegoMode) {
|
|
67
|
-
insertLegoScript();
|
|
68
|
-
}
|
|
69
|
-
}, [isLegoMode]);
|
|
24
|
+
reset = __rest(props, ["className", "style", "src", "mode", "onError", "lazyLoad", "imgProps", "forwardedRef"]);
|
|
70
25
|
const cls = classNames('taro-img', {
|
|
71
26
|
'taro-img__widthfix': mode === 'widthFix'
|
|
72
27
|
}, className);
|
|
@@ -105,54 +60,32 @@ function Image(props) {
|
|
|
105
60
|
(_b = (_a = observer.current) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
106
61
|
};
|
|
107
62
|
}, [lazyLoad, src]);
|
|
108
|
-
// 如果是lego模式,渲染canvas-tag
|
|
109
|
-
if (isLegoMode && legoData) {
|
|
110
|
-
return (() => {
|
|
111
|
-
var _el$ = _tmpl$(),
|
|
112
|
-
_el$2 = _el$.firstChild;
|
|
113
|
-
use(forwardedRef, _el$);
|
|
114
|
-
_el$.className = cls;
|
|
115
|
-
spread(_el$, reset, false, true);
|
|
116
|
-
spread(_el$2, mergeProps({
|
|
117
|
-
get tagId() {
|
|
118
|
-
return legoData.tagId;
|
|
119
|
-
},
|
|
120
|
-
get text() {
|
|
121
|
-
return legoData.text;
|
|
122
|
-
}
|
|
123
|
-
}, imgProps), false, false);
|
|
124
|
-
_el$2._$owner = getOwner();
|
|
125
|
-
effect(_$p => style(_el$, style$1, _$p));
|
|
126
|
-
return _el$;
|
|
127
|
-
})();
|
|
128
|
-
}
|
|
129
|
-
// 普通图片模式
|
|
130
63
|
return (() => {
|
|
131
|
-
var _el$
|
|
132
|
-
use(forwardedRef, _el$
|
|
133
|
-
_el
|
|
134
|
-
spread(_el
|
|
135
|
-
insert(_el
|
|
136
|
-
var _el$
|
|
137
|
-
addEventListener(_el$
|
|
138
|
-
addEventListener(_el$
|
|
139
|
-
use(img => imgRef.current = img, _el$
|
|
140
|
-
_el$
|
|
141
|
-
setAttribute(_el$
|
|
142
|
-
spread(_el$
|
|
143
|
-
return _el$
|
|
64
|
+
var _el$ = _tmpl$();
|
|
65
|
+
use(forwardedRef, _el$);
|
|
66
|
+
_el$.className = cls;
|
|
67
|
+
spread(_el$, reset, false, true);
|
|
68
|
+
insert(_el$, lazyLoad ? (() => {
|
|
69
|
+
var _el$2 = _tmpl$2();
|
|
70
|
+
addEventListener(_el$2, "error", onError);
|
|
71
|
+
addEventListener(_el$2, "load", imageOnLoad);
|
|
72
|
+
use(img => imgRef.current = img, _el$2);
|
|
73
|
+
_el$2.className = imgCls;
|
|
74
|
+
setAttribute(_el$2, "data-src", src);
|
|
75
|
+
spread(_el$2, imgProps, false, false);
|
|
76
|
+
return _el$2;
|
|
144
77
|
})() : (() => {
|
|
145
|
-
var _el$
|
|
146
|
-
addEventListener(_el$
|
|
147
|
-
addEventListener(_el$
|
|
148
|
-
use(img => imgRef.current = img, _el$
|
|
149
|
-
_el$
|
|
150
|
-
setAttribute(_el$
|
|
151
|
-
spread(_el$
|
|
152
|
-
return _el$
|
|
78
|
+
var _el$3 = _tmpl$2();
|
|
79
|
+
addEventListener(_el$3, "error", onError);
|
|
80
|
+
addEventListener(_el$3, "load", imageOnLoad);
|
|
81
|
+
use(img => imgRef.current = img, _el$3);
|
|
82
|
+
_el$3.className = imgCls;
|
|
83
|
+
setAttribute(_el$3, "src", src);
|
|
84
|
+
spread(_el$3, imgProps, false, false);
|
|
85
|
+
return _el$3;
|
|
153
86
|
})());
|
|
154
|
-
effect(_$p => style(_el
|
|
155
|
-
return _el
|
|
87
|
+
effect(_$p => style(_el$, style$1, _$p));
|
|
88
|
+
return _el$;
|
|
156
89
|
})();
|
|
157
90
|
}
|
|
158
91
|
var index = createForwardRefComponent(Image);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/image/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent } from '../../utils'\nimport { useCallback, useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n src: string\n mode: string\n onError: () => void\n onLoad: (e) => void\n lazyLoad?: boolean\n imgProps?: Record<string, any>\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\n// CDN脚本URL\nconst LEGO_CDN_URL = 'http://ossin.jd.com/swm-plus/h5Tag/tag.js'\n\n// 检查CDN脚本是否已加载\nconst isLegoScriptLoaded = (): boolean => {\n return document.querySelector(`script[src=\"${LEGO_CDN_URL}\"]`) !== null\n}\n\n// 插入CDN脚本\nconst insertLegoScript = (): void => {\n if (isLegoScriptLoaded()) return\n\n const script = document.createElement('script')\n script.type = 'module'\n script.src = LEGO_CDN_URL\n document.head.appendChild(script)\n}\n\n// 解析lego协议URL\nconst parseLegoUrl = (src: string): { tagId: string, text: string } | null => {\n if (!src.startsWith('lego://')) return null\n\n try {\n // 移除 'lego://' 前缀\n const urlWithoutProtocol = src.substring(7)\n\n // 分割tagId和参数\n const [tagId, params] = urlWithoutProtocol.split('?')\n\n // 解析参数\n const text = params ? new URLSearchParams(params).get('text') || '' : ''\n\n return { tagId, text }\n } catch (error) {\n console.warn('Failed to parse lego URL:', src, error)\n return null\n }\n}\n\nfunction Image (props: IProps) {\n const imgRef = useRef<HTMLImageElement | null>(null)\n const observer = useRef<Partial<IntersectionObserver>>({})\n const [, setIsLoaded] = useState(false)\n const {\n className,\n style = {},\n src,\n mode,\n onError,\n lazyLoad,\n imgProps,\n forwardedRef,\n ...reset\n } = props\n\n // 检查是否为lego模式\n const legoData = parseLegoUrl(src)\n const isLegoMode = legoData !== null\n\n // 如果是lego模式,确保CDN脚本已加载\n useEffect(() => {\n if (isLegoMode) {\n insertLegoScript()\n }\n }, [isLegoMode])\n\n const cls = classNames(\n 'taro-img',\n {\n 'taro-img__widthfix': mode === 'widthFix'\n },\n className\n )\n const imgCls = classNames(\n 'taro-img__mode-' +\n (mode || 'scaleToFill').toLowerCase().replace(/\\s/g, '')\n )\n\n const imageOnLoad = useCallback((e) => {\n const { onLoad } = props\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n writable: true,\n value: {\n width: e.target.width,\n height: e.target.height\n }\n })\n\n onLoad && onLoad(e)\n }, [props])\n\n useEffect(() => {\n if (lazyLoad) {\n observer.current = new IntersectionObserver(\n entries => {\n // 异步 api 关系\n if (entries[entries.length - 1].isIntersecting) {\n setIsLoaded(true)\n // findDOMNode(this).children[0].src = src\n imgRef.current!.src = src\n }\n },\n {\n rootMargin: '300px 0px'\n }\n )\n observer.current.observe?.(imgRef.current!)\n }\n\n return () => {\n observer.current?.disconnect?.()\n }\n }, [lazyLoad, src])\n\n // 如果是lego模式,渲染canvas-tag\n if (isLegoMode && legoData) {\n return (\n <div className={cls} style={style} ref={forwardedRef} {...reset}>\n <canvas-tag\n tagId={legoData.tagId}\n text={legoData.text}\n {...imgProps}\n />\n </div>\n )\n }\n\n // 普通图片模式\n return (\n <div className={cls} style={style} ref={forwardedRef} {...reset}>\n {lazyLoad ? (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n data-src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n ) : (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n )}\n </div>\n )\n}\n\nexport default createForwardRefComponent(Image)\n"],"names":["LEGO_CDN_URL","isLegoScriptLoaded","document","querySelector","insertLegoScript","script","createElement","type","src","head","appendChild","parseLegoUrl","startsWith","urlWithoutProtocol","substring","tagId","params","split","text","URLSearchParams","get","error","console","warn","Image","props","imgRef","useRef","observer","setIsLoaded","useState","className","style","mode","onError","lazyLoad","imgProps","forwardedRef","reset","__rest","legoData","isLegoMode","useEffect","cls","classNames","imgCls","toLowerCase","replace","imageOnLoad","useCallback","e","onLoad","Object","defineProperty","enumerable","writable","value","width","target","height","current","IntersectionObserver","entries","length","isIntersecting","rootMargin","_b","_a","observe","call","disconnect","_el$","_tmpl$","_el$2","firstChild","_$use","_$spread","_$mergeProps","_$owner","_$getOwner","_$effect","_$p","_$style","_el$3","_tmpl$2","_$insert","_el$4","_tmpl$3","_$addEventListener","img","_$setAttribute","_el$5","createForwardRefComponent"],"mappings":";;;;;;;;;;AA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AAA,CAAAU,KAAA,EAGTlD,QAAQ,EAAA,KAAA,EAAA,KAAA,CAAA;AAAA,MAAA,OAAAkD,KAAA;AAAA,KAAA,GAAA,GAAA,CAAA,MAAA;MAAA,IAAAK,KAAA,GAAAJ,OAAA,EAAA;MAAAC,gBAAA,CAAAG,KAAA,EAAA,OAAA,EAQHzD,OAAO,CAAA;MAAAsD,gBAAA,CAAAG,KAAA,EAAA,MAAA,EADR3C,WAAW,CAAA;MAAA2B,GAAA,CAHdc,GAAG,IAAK/D,MAAM,CAACkC,OAAO,GAAG6B,GAAI,EAAAE,KAAA,CAAA;MAAAA,KAAA,CAAA5D,SAAA,GACvBc,MAAM;MAAA6C,YAAA,CAAAC,KAAA,EAAA,KAAA,EACZnF,GAAG,CAAA;MAAAoE,MAAA,CAAAe,KAAA,EAGJvD,QAAQ,EAAA,KAAA,EAAA,KAAA,CAAA;AAAA,MAAA,OAAAuD,KAAA;KAEf,GAAA,CAAA;IAAAX,MAAA,CAAAC,GAAA,IAAAC,KAAA,CAAAC,KAAA,EAnByBnD,OAAK,EAAAiD,GAAA,CAAA,CAAA;AAAA,IAAA,OAAAE,KAAA;AAAA,GAAA,GAAA;AAsBrC;AAEA,YAAeS,yBAAyB,CAACpE,KAAK,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/image/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent } from '../../utils'\nimport { useCallback, useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n src: string\n mode: string\n onError: () => void\n onLoad: (e) => void\n lazyLoad?: boolean\n imgProps?: Record<string, any>\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\nfunction Image (props: IProps) {\n const imgRef = useRef<HTMLImageElement | null>(null)\n const observer = useRef<Partial<IntersectionObserver>>({})\n const [, setIsLoaded] = useState(false)\n const {\n className,\n style = {},\n src,\n mode,\n onError,\n lazyLoad,\n imgProps,\n forwardedRef,\n ...reset\n } = props\n const cls = classNames(\n 'taro-img',\n {\n 'taro-img__widthfix': mode === 'widthFix'\n },\n className\n )\n const imgCls = classNames(\n 'taro-img__mode-' +\n (mode || 'scaleToFill').toLowerCase().replace(/\\s/g, '')\n )\n\n const imageOnLoad = useCallback((e) => {\n const { onLoad } = props\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n writable: true,\n value: {\n width: e.target.width,\n height: e.target.height\n }\n })\n\n onLoad && onLoad(e)\n }, [props])\n\n useEffect(() => {\n if (lazyLoad) {\n observer.current = new IntersectionObserver(\n entries => {\n // 异步 api 关系\n if (entries[entries.length - 1].isIntersecting) {\n setIsLoaded(true)\n // findDOMNode(this).children[0].src = src\n imgRef.current!.src = src\n }\n },\n {\n rootMargin: '300px 0px'\n }\n )\n observer.current.observe?.(imgRef.current!)\n }\n\n return () => {\n observer.current?.disconnect?.()\n }\n }, [lazyLoad, src])\n\n return (\n <div className={cls} style={style} ref={forwardedRef} {...reset}>\n {lazyLoad ? (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n data-src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n ) : (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n )}\n </div>\n )\n}\n\nexport default createForwardRefComponent(Image)\n"],"names":["Image","props","imgRef","useRef","observer","setIsLoaded","useState","className","style","src","mode","onError","lazyLoad","imgProps","forwardedRef","reset","__rest","cls","classNames","imgCls","toLowerCase","replace","imageOnLoad","useCallback","e","onLoad","Object","defineProperty","enumerable","writable","value","width","target","height","useEffect","current","IntersectionObserver","entries","length","isIntersecting","rootMargin","_b","_a","observe","call","disconnect","_el$","_tmpl$","_$use","_$spread","_$insert","_el$2","_tmpl$2","_$addEventListener","img","_$setAttribute","_el$3","_$effect","_$p","_$style","createForwardRefComponent"],"m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}to{transform:rotate(1turn)}}@keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.taro-button-core[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border-radius:5px;border-width:0;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core:after{border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;content:" ";height:200%;left:0;position:absolute;top:0;transform:scale(.5);transform-origin:0 0;width:200%}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core[type=default]{background-color:#f8f8f8;color:#000}.taro-button-core[type=default]:not([disabled]):visited{color:#000}.taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core[size=mini]{display:inline-block;font-size:13px;line-height:2.3;padding:0 1.32em;width:auto}.taro-button-core[plain=true],.taro-button-core[plain=true][type=default],.taro-button-core[plain=true][type=primary]{background-color:transparent;border-width:1px}.taro-button-core[disabled]{color:hsla(0,0%,100%,.6)}.taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core[disabled][type=primary]{background-color:#9ed99d}.taro-button-core[disabled][type=warn]{background-color:#ec8b89}.taro-button-core[loading] .weui-loading{margin:-.2em .34em 0 0}.taro-button-core[loading][type=primary],.taro-button-core[loading][type=warn]{color:hsla(0,0%,100%,.6)}.taro-button-core[loading][type=primary]{background-color:#179b16}.taro-button-core[loading][type=warn]{background-color:#ce3c39}.taro-button-core[plain=true][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain=true][type=primary]:not([disabled]):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core[plain=true][type=primary]:after{border-width:0}.taro-button-core[plain=true][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain=true][type=warn]:not([disabled]):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core[plain=true][type=warn]:after{border-width:0}.taro-button-core[plain=true],.taro-button-core[plain=true][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain=true]:not([disabled]):active,.taro-button-core[plain=true][type=default]:not([disabled]):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core[plain=true]:after,.taro-button-core[plain=true][type=default]:after{border-width:0}.taro-button-core[type=primary]{background-color:#1aad19;color:#fff}.taro-button-core[type=primary]:not([disabled]):visited{color:#fff}.taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core[type=warn]{background-color:#e64340;color:#fff}.taro-button-core[type=warn]:not([disabled]):visited{color:#fff}.taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core[plain=true][disabled],.taro-button-core[plain=true][disabled][type=primary]{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;height:240px;overflow:hidden;position:relative;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-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{background-color:rgba(0,0,0,.6);position:absolute;z-index:1001}.taro-picker{background-color:#e5e5e5;bottom:0;font-size:14px;left:0;position:absolute;width:100%;z-index:1002}.taro-picker__hd{align-items:center;background-color:#fff;display:flex;font-size:17px;height:44px;justify-content:space-between;padding:0;position:relative}.taro-picker__hd:after{background-color:#e5e5e5;bottom:0;content:"";height:1px;left:0;position:absolute;transform:scaleY(.5);width:100%}.taro-picker__action{color:#ff0f23;flex:0 0 auto;font-size:14px;height:44px;line-height:44px;padding:0 10px}.taro-picker__action:first-child{color:#888}.taro-picker__title{color:#000;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{background-color:#fff;height:238px;overflow:hidden;width:100%}.taro-picker__bd,.taro-picker__group{box-sizing:border-box;display:flex;flex:1}.taro-picker__group{align-items:center;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{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));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__indicator:after,.taro-picker__indicator:before{background-color:#e5e5e5;content:"";height:1px;left:0;position:absolute;right:0;transform:scaleY(.5)}.taro-picker__indicator:before{top:0}.taro-picker__indicator:after{bottom:0}.taro-picker__content{box-sizing:border-box;height:100%;width:100%}.taro-picker__item{align-items:center;box-sizing:border-box;color:#000;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{color:#ff0f23;font-weight:500}.taro-picker__item--disabled{color:#999}.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}}.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}.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[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;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;line-height:2.3;padding:0 1.32em;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 .weui-loading{margin:-.2em .34em 0 0}.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;height:240px;overflow:hidden;position:relative;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-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{background-color:rgba(0,0,0,.6);position:absolute;z-index:1001}.taro-picker{background-color:#e5e5e5;bottom:0;font-size:14px;left:0;position:absolute;width:100%;z-index:1002}.taro-picker__hd{align-items:center;background-color:#fff;display:flex;font-size:17px;height:44px;justify-content:space-between;padding:0;position:relative}.taro-picker__hd:after{background-color:#e5e5e5;bottom:0;content:"";height:1px;left:0;position:absolute;transform:scaleY(.5);width:100%}.taro-picker__action{color:#ff0f23;flex:0 0 auto;font-size:14px;height:44px;line-height:44px;padding:0 10px}.taro-picker__action:first-child{color:#888}.taro-picker__title{color:#000;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{background-color:#fff;height:238px;overflow:hidden;width:100%}.taro-picker__bd,.taro-picker__group{box-sizing:border-box;display:flex;flex:1}.taro-picker__group{align-items:center;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{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));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__indicator:after,.taro-picker__indicator:before{background-color:#e5e5e5;content:"";height:1px;left:0;position:absolute;right:0;transform:scaleY(.5)}.taro-picker__indicator:before{top:0}.taro-picker__indicator:after{bottom:0}.taro-picker__content{box-sizing:border-box;height:100%;width:100%}.taro-picker__item{align-items:center;box-sizing:border-box;color:#000;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{color:#ff0f23;font-weight:500}.taro-picker__item--disabled{color:#999}.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}}.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}.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/components-react",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.7-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main:h5": "dist/index.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"identity-obj-proxy": "^3.0.0",
|
|
30
30
|
"swiper": "11.1.15",
|
|
31
31
|
"tslib": "^2.6.2",
|
|
32
|
-
"@tarojs/components": "4.1.
|
|
33
|
-
"@tarojs/shared": "4.1.
|
|
34
|
-
"@tarojs/taro": "4.1.
|
|
32
|
+
"@tarojs/components": "4.1.7-alpha.0",
|
|
33
|
+
"@tarojs/shared": "4.1.7-alpha.0",
|
|
34
|
+
"@tarojs/taro": "4.1.7-alpha.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/plugin-transform-runtime": "^7.24.1",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"jest-environment-jsdom": "^29.7.0",
|
|
48
48
|
"solid-js": "^1.8.16",
|
|
49
49
|
"ts-jest": "^29.1.1",
|
|
50
|
-
"@tarojs/helper": "4.1.
|
|
51
|
-
"@tarojs/runtime": "4.1.
|
|
50
|
+
"@tarojs/helper": "4.1.7-alpha.0",
|
|
51
|
+
"@tarojs/runtime": "4.1.7-alpha.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"react": "*",
|