@tarojs/components-react 4.1.4-beta.13 → 4.1.4-beta.14
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 +87 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/button/style/index.scss.js +4 -0
- package/dist/components/button/style/index.scss.js.map +1 -0
- package/dist/components/icon/index.js +36 -0
- package/dist/components/icon/index.js.map +1 -0
- package/dist/components/icon/style/index.scss.js +4 -0
- package/dist/components/icon/style/index.scss.js.map +1 -0
- package/dist/components/image/index.js +86 -0
- package/dist/components/image/index.js.map +1 -0
- package/dist/components/image/style/index.css.js +4 -0
- package/dist/components/image/style/index.css.js.map +1 -0
- package/dist/components/input/index.js +233 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input/style/index.scss.js +4 -0
- package/dist/components/input/style/index.scss.js.map +1 -0
- package/dist/components/picker/index.js +13 -7
- package/dist/components/picker/index.js.map +1 -1
- package/dist/components/pull-down-refresh/index.js +320 -0
- package/dist/components/pull-down-refresh/index.js.map +1 -0
- package/dist/components/pull-down-refresh/style/index.css.js +4 -0
- package/dist/components/pull-down-refresh/style/index.css.js.map +1 -0
- package/dist/components/scroll-view/index.js +184 -0
- package/dist/components/scroll-view/index.js.map +1 -0
- package/dist/components/scroll-view/style/index.css.js +4 -0
- package/dist/components/scroll-view/style/index.css.js.map +1 -0
- package/dist/components/swiper/index.js +461 -0
- package/dist/components/swiper/index.js.map +1 -0
- package/dist/components/swiper/style/index.css.js +4 -0
- package/dist/components/swiper/style/index.css.js.map +1 -0
- package/dist/components/text/index.js +28 -0
- package/dist/components/text/index.js.map +1 -0
- package/dist/components/text/style/index.css.js +4 -0
- package/dist/components/text/style/index.css.js.map +1 -0
- package/dist/components/view/index.js +80 -0
- package/dist/components/view/index.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +12 -79
- package/dist/index.js.map +1 -1
- package/dist/solid/components/button/index.js +95 -0
- package/dist/solid/components/button/index.js.map +1 -0
- package/dist/solid/components/button/style/index.scss.js +4 -0
- package/dist/solid/components/button/style/index.scss.js.map +1 -0
- package/dist/solid/components/icon/index.js +39 -0
- package/dist/solid/components/icon/index.js.map +1 -0
- package/dist/solid/components/icon/style/index.scss.js +4 -0
- package/dist/solid/components/icon/style/index.scss.js.map +1 -0
- package/dist/solid/components/image/index.js +94 -0
- package/dist/solid/components/image/index.js.map +1 -0
- package/dist/solid/components/image/style/index.css.js +4 -0
- package/dist/solid/components/image/style/index.css.js.map +1 -0
- package/dist/solid/components/picker/index.js +15 -7
- package/dist/solid/components/picker/index.js.map +1 -1
- package/dist/solid/components/scroll-view/index.js +188 -0
- package/dist/solid/components/scroll-view/index.js.map +1 -0
- package/dist/solid/components/scroll-view/style/index.css.js +4 -0
- package/dist/solid/components/scroll-view/style/index.css.js.map +1 -0
- package/dist/solid/components/text/index.js +32 -0
- package/dist/solid/components/text/index.js.map +1 -0
- package/dist/solid/components/text/style/index.css.js +4 -0
- package/dist/solid/components/text/style/index.css.js.map +1 -0
- package/dist/solid/components/view/index.js +88 -0
- package/dist/solid/components/view/index.js.map +1 -0
- package/dist/solid/index.css +1 -1
- package/dist/solid/index.js +9 -79
- package/dist/solid/index.js.map +1 -1
- package/dist/styles/picker-styles.css +1 -1
- package/dist/styles/picker-styles.css.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { useState, useEffect } from '../../utils/hooks.react.js';
|
|
4
|
+
import { createForwardRefComponent } from '../../utils/index.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function View(_a) {
|
|
8
|
+
var {
|
|
9
|
+
className,
|
|
10
|
+
hoverClass,
|
|
11
|
+
forwardedRef,
|
|
12
|
+
onTouchStart,
|
|
13
|
+
onTouchEnd,
|
|
14
|
+
onTouchMove,
|
|
15
|
+
hoverStartTime = 50,
|
|
16
|
+
hoverStayTime = 400
|
|
17
|
+
} = _a,
|
|
18
|
+
other = __rest(_a, ["className", "hoverClass", "forwardedRef", "onTouchStart", "onTouchEnd", "onTouchMove", "hoverStartTime", "hoverStayTime"]);
|
|
19
|
+
let timeoutEvent;
|
|
20
|
+
let startTime = 0;
|
|
21
|
+
const [hover, setHover] = useState(false);
|
|
22
|
+
const [touch, setTouch] = useState(false);
|
|
23
|
+
const [cls, setCls] = useState(classNames('', {
|
|
24
|
+
[`${hoverClass}`]: "react" === 'solid' ? hover() : hover
|
|
25
|
+
}, className));
|
|
26
|
+
const _onTouchStart = e => {
|
|
27
|
+
if (hoverClass) {
|
|
28
|
+
setTouch(true);
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
if ("react" === 'solid' ? touch() : touch) {
|
|
31
|
+
setHover(true);
|
|
32
|
+
}
|
|
33
|
+
}, hoverStartTime);
|
|
34
|
+
}
|
|
35
|
+
onTouchStart && onTouchStart(e);
|
|
36
|
+
if (other.onLongPress) {
|
|
37
|
+
timeoutEvent = setTimeout(() => {
|
|
38
|
+
other.onLongPress();
|
|
39
|
+
}, 350);
|
|
40
|
+
startTime = new Date().getTime();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const _onTouchMove = e => {
|
|
44
|
+
clearTimeout(timeoutEvent);
|
|
45
|
+
onTouchMove && onTouchMove(e);
|
|
46
|
+
};
|
|
47
|
+
const _onTouchEnd = e => {
|
|
48
|
+
const spanTime = new Date().getTime() - startTime;
|
|
49
|
+
if (spanTime < 350) {
|
|
50
|
+
clearTimeout(timeoutEvent);
|
|
51
|
+
}
|
|
52
|
+
if (hoverClass) {
|
|
53
|
+
setTouch(false);
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
if ("react" === 'solid' ? touch() : touch) {
|
|
56
|
+
setHover(false);
|
|
57
|
+
}
|
|
58
|
+
}, hoverStayTime);
|
|
59
|
+
}
|
|
60
|
+
onTouchEnd && onTouchEnd(e);
|
|
61
|
+
};
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
setCls(classNames('', {
|
|
64
|
+
[`${hoverClass}`]: "react" === 'solid' ? hover() : hover
|
|
65
|
+
}, className));
|
|
66
|
+
}, [hover, className]);
|
|
67
|
+
return /*#__PURE__*/jsx("div", {
|
|
68
|
+
ref: forwardedRef,
|
|
69
|
+
className: "react" === 'solid' ? cls() : cls,
|
|
70
|
+
onTouchStart: _onTouchStart,
|
|
71
|
+
onTouchEnd: _onTouchEnd,
|
|
72
|
+
onTouchMove: _onTouchMove,
|
|
73
|
+
...other,
|
|
74
|
+
children: other.children
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
var index = createForwardRefComponent(View);
|
|
78
|
+
|
|
79
|
+
export { index as default };
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/view/index.tsx"],"sourcesContent":["import classNames from 'classnames'\n\nimport { useEffect, useState } from '../../utils/hooks'\nimport { createForwardRefComponent } from '../../utils/index'\n\nimport type { TFunc } from '@tarojs/runtime/dist/runtime.esm'\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n onTouchStart?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchEnd?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchMove?(e: React.TouchEvent<HTMLDivElement>): void\n onLongPress?(): void\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\nfunction View ({\n className,\n hoverClass,\n forwardedRef,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n hoverStartTime = 50,\n hoverStayTime = 400,\n ...other\n}: IProps) {\n let timeoutEvent: ReturnType<typeof setTimeout>\n let startTime = 0\n const [hover, setHover] = useState<boolean>(false)\n const [touch, setTouch] = useState<boolean>(false)\n\n const [cls, setCls] = useState<string>(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as unknown as TFunc)() : hover\n },\n className\n ))\n\n const _onTouchStart = e => {\n if (hoverClass) {\n setTouch(true)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as unknown as TFunc)() : touch) {\n setHover(true)\n }\n }, hoverStartTime)\n }\n onTouchStart && onTouchStart(e)\n if (other.onLongPress) {\n timeoutEvent = setTimeout(() => {\n other.onLongPress!()\n }, 350)\n startTime = new Date().getTime()\n }\n }\n\n const _onTouchMove = e => {\n clearTimeout(timeoutEvent)\n onTouchMove && onTouchMove(e)\n }\n\n const _onTouchEnd = e => {\n const spanTime = new Date().getTime() - startTime\n if (spanTime < 350) {\n clearTimeout(timeoutEvent)\n }\n if (hoverClass) {\n setTouch(false)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as unknown as TFunc)() : touch) {\n setHover(false)\n }\n }, hoverStayTime)\n }\n onTouchEnd && onTouchEnd(e)\n }\n\n useEffect(() => {\n setCls(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as unknown as TFunc)() : hover\n },\n className\n ))\n }, [hover, className])\n\n return (\n <div\n ref={forwardedRef}\n className={process.env.FRAMEWORK === 'solid' ? (cls as unknown as TFunc)() : cls as string}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n onTouchMove={_onTouchMove}\n {...other}\n >\n {other.children}\n </div>\n )\n}\n\n\nexport default createForwardRefComponent(View)\n"],"names":["View","_a","className","hoverClass","forwardedRef","onTouchStart","onTouchEnd","onTouchMove","hoverStartTime","hoverStayTime","other","__rest","timeoutEvent","startTime","hover","setHover","useState","touch","setTouch","cls","setCls","classNames","process","_onTouchStart","e","setTimeout","onLongPress","Date","getTime","_onTouchMove","clearTimeout","_onTouchEnd","spanTime","useEffect","_jsx","ref","children","createForwardRefComponent"],"mappings":";;;;;;AAmBA,SAASA,IAAIA,CAAEC,EAUN,EAAA;MA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AA,EAER1B,KAAK,CAAC0B;AAAQ,GACZ,CAAC;AAEV;AAGA,YAAeC,yBAAyB,CAACrC,IAAI,CAAC;;;;"}
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.taro-picker__overlay{z-index:1000}.taro-picker__mask-overlay,.taro-picker__overlay{bottom:0;height:100%;left:0;position:relative;right:0;top:0;width:100%}.taro-picker__mask-overlay{background-color:rgba(0,0,0,.6);z-index:1001}.taro-picker{background-color:#e5e5e5;bottom:0;left:0;position:relative;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:#1aad19;flex:0 0 auto;font-size:16px;height:44px;line-height:44px;padding:0 10px}.taro-picker__action:first-child{color:#888}.taro-picker__title{color:#000;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) 50%,hsla(0,0%,100%,0) 0,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:#1aad19;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-picker,.taro-picker__hd{font-size:12px}
|
|
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{z-index:1000}.taro-picker__mask-overlay,.taro-picker__overlay{bottom:0;height:100%;left:0;position:relative;right:0;top:0;width:100%}.taro-picker__mask-overlay{background-color:rgba(0,0,0,.6);z-index:1001}.taro-picker{background-color:#e5e5e5;bottom:0;left:0;position:relative;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:#1aad19;flex:0 0 auto;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) 50%,hsla(0,0%,100%,0) 0,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:#1aad19;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-picker,.taro-picker__hd{font-size:14px}.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::-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}
|
package/dist/index.js
CHANGED
|
@@ -1,81 +1,14 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, DraggableSheet, Editor, FollowSwan, Form, FunctionalPageNavigator, GridBuilder, GridView, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, ListBuilder, ListView, LivePlayer, LivePusher, Login, Lottie, Map, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, NestedScrollBody, NestedScrollHeader, OfficialAccount, OpenContainer, OpenData, PageContainer, PageMeta, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span, StickyHeader, StickySection, Switch, Tabs, Textarea, Video, VoipRoom, WebView } from '@tarojs/components/lib/react';
|
|
2
|
+
export { default as Button } from './components/button/index.js';
|
|
3
|
+
export { default as Icon } from './components/icon/index.js';
|
|
4
|
+
export { default as Image } from './components/image/index.js';
|
|
5
|
+
export { default as Input } from './components/input/index.js';
|
|
6
|
+
export { default as Picker } from './components/picker/index.js';
|
|
7
|
+
export { default as PullDownRefresh } from './components/pull-down-refresh/index.js';
|
|
8
|
+
export { default as ScrollView } from './components/scroll-view/index.js';
|
|
9
|
+
export { Swiper, SwiperItem } from './components/swiper/index.js';
|
|
10
|
+
export { default as Text } from './components/text/index.js';
|
|
11
|
+
export { default as View } from './components/view/index.js';
|
|
2
12
|
|
|
3
|
-
|
|
4
|
-
// export { Ad } from '@tarojs/components/lib/react'
|
|
5
|
-
// export { AdCustom } from '@tarojs/components/lib/react'
|
|
6
|
-
// export { AnimationVideo } from '@tarojs/components/lib/react'
|
|
7
|
-
// export { AnimationView } from '@tarojs/components/lib/react'
|
|
8
|
-
// export { ArCamera } from '@tarojs/components/lib/react'
|
|
9
|
-
// export { Audio } from '@tarojs/components/lib/react'
|
|
10
|
-
// export { AwemeData } from '@tarojs/components/lib/react'
|
|
11
|
-
// export { Block } from '@tarojs/components/lib/react'
|
|
12
|
-
// export { default as Button } from './components/button'
|
|
13
|
-
// export { Camera } from '@tarojs/components/lib/react'
|
|
14
|
-
// export { Canvas } from '@tarojs/components/lib/react'
|
|
15
|
-
// export { ChannelLive } from '@tarojs/components/lib/react'
|
|
16
|
-
// export { ChannelVideo } from '@tarojs/components/lib/react'
|
|
17
|
-
// export { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'
|
|
18
|
-
// export { CommentDetail, CommentList } from '@tarojs/components/lib/react'
|
|
19
|
-
// export { ContactButton } from '@tarojs/components/lib/react'
|
|
20
|
-
// export { CoverImage } from '@tarojs/components/lib/react'
|
|
21
|
-
// export { CoverView } from '@tarojs/components/lib/react'
|
|
22
|
-
// export { CustomWrapper } from '@tarojs/components/lib/react'
|
|
23
|
-
// export { DraggableSheet } from '@tarojs/components/lib/react'
|
|
24
|
-
// export { Editor } from '@tarojs/components/lib/react'
|
|
25
|
-
// export { FollowSwan } from '@tarojs/components/lib/react'
|
|
26
|
-
// export { Form } from '@tarojs/components/lib/react'
|
|
27
|
-
// export { FunctionalPageNavigator } from '@tarojs/components/lib/react'
|
|
28
|
-
// export { GridView } from '@tarojs/components/lib/react'
|
|
29
|
-
// export { GridBuilder } from '@tarojs/components/lib/react'
|
|
30
|
-
// export { default as Icon } from './components/icon'
|
|
31
|
-
// export { default as Image } from './components/image'
|
|
32
|
-
// export { InlinePaymentPanel } from '@tarojs/components/lib/react'
|
|
33
|
-
// export { default as Input } from './components/input'
|
|
34
|
-
// export { KeyboardAccessory } from '@tarojs/components/lib/react'
|
|
35
|
-
// export { Label } from '@tarojs/components/lib/react'
|
|
36
|
-
// export { Lifestyle } from '@tarojs/components/lib/react'
|
|
37
|
-
// export { Like } from '@tarojs/components/lib/react'
|
|
38
|
-
// export { LivePlayer } from '@tarojs/components/lib/react'
|
|
39
|
-
// export { LivePusher } from '@tarojs/components/lib/react'
|
|
40
|
-
// export { ListBuilder } from '@tarojs/components/lib/react'
|
|
41
|
-
// export { ListView } from '@tarojs/components/lib/react'
|
|
42
|
-
// export { Login } from '@tarojs/components/lib/react'
|
|
43
|
-
// export { Lottie } from '@tarojs/components/lib/react'
|
|
44
|
-
// export { Map } from '@tarojs/components/lib/react'
|
|
45
|
-
// export { MatchMedia } from '@tarojs/components/lib/react'
|
|
46
|
-
// export { MovableArea, MovableView } from '@tarojs/components/lib/react'
|
|
47
|
-
// export { NavigationBar } from '@tarojs/components/lib/react'
|
|
48
|
-
// export { Navigator } from '@tarojs/components/lib/react'
|
|
49
|
-
// export { NestedScrollBody } from '@tarojs/components/lib/react'
|
|
50
|
-
// export { NestedScrollHeader } from '@tarojs/components/lib/react'
|
|
51
|
-
// export { OfficialAccount } from '@tarojs/components/lib/react'
|
|
52
|
-
// export { OpenData } from '@tarojs/components/lib/react'
|
|
53
|
-
// export { OpenContainer } from '@tarojs/components/lib/react'
|
|
54
|
-
// export { PageContainer } from '@tarojs/components/lib/react'
|
|
55
|
-
// export { PageMeta } from '@tarojs/components/lib/react'
|
|
56
|
-
// export { Progress } from '@tarojs/components/lib/react'
|
|
57
|
-
// export { default as PullDownRefresh } from './components/pull-down-refresh'
|
|
58
|
-
// // export { PullToRefresh } from '@tarojs/components/lib/react'
|
|
59
|
-
// export { Radio, RadioGroup } from '@tarojs/components/lib/react'
|
|
60
|
-
// export { RichText } from '@tarojs/components/lib/react'
|
|
61
|
-
// export { RootPortal } from '@tarojs/components/lib/react'
|
|
62
|
-
// export { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'
|
|
63
|
-
// export { Script } from '@tarojs/components/lib/react'
|
|
64
|
-
// export { default as ScrollView } from './components/scroll-view'
|
|
65
|
-
// export { ShareElement } from '@tarojs/components/lib/react'
|
|
66
|
-
// export { Slider } from '@tarojs/components/lib/react'
|
|
67
|
-
// export { Snapshot } from '@tarojs/components/lib/react'
|
|
68
|
-
// export { Span } from '@tarojs/components/lib/react'
|
|
69
|
-
// export { StickyHeader } from '@tarojs/components/lib/react'
|
|
70
|
-
// export { StickySection } from '@tarojs/components/lib/react'
|
|
71
|
-
// export { NativeSlot, Slot } from '@tarojs/components/lib/react'
|
|
72
|
-
// export { Swiper, SwiperItem } from './components/swiper'
|
|
73
|
-
// export { Switch } from '@tarojs/components/lib/react'
|
|
74
|
-
// export { Tabs } from '@tarojs/components/lib/react'
|
|
75
|
-
// export { default as Text } from './components/text'
|
|
76
|
-
// export { Textarea } from '@tarojs/components/lib/react'
|
|
77
|
-
// export { Video } from '@tarojs/components/lib/react'
|
|
78
|
-
// export { default as View } from './components/view'
|
|
79
|
-
// export { VoipRoom } from '@tarojs/components/lib/react'
|
|
80
|
-
// export { WebView } from '@tarojs/components/lib/react'
|
|
13
|
+
/* eslint-disable simple-import-sort/exports */
|
|
81
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.react.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.react.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { DraggableSheet } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { GridView } from '@tarojs/components/lib/react'\nexport { GridBuilder } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { ListBuilder } from '@tarojs/components/lib/react'\nexport { ListView } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { Map } from '@tarojs/components/lib/react'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { NestedScrollBody } from '@tarojs/components/lib/react'\nexport { NestedScrollHeader } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { OpenContainer } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { default as Picker } from './components/picker'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { Script } from '@tarojs/components/lib/react'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { Snapshot } from '@tarojs/components/lib/react'\nexport { Span } from '@tarojs/components/lib/react'\nexport { StickyHeader } from '@tarojs/components/lib/react'\nexport { StickySection } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { Switch } from '@tarojs/components/lib/react'\nexport { Tabs } from '@tarojs/components/lib/react'\nexport { default as Text } from './components/text'\nexport { Textarea } from '@tarojs/components/lib/react'\nexport { Video } from '@tarojs/components/lib/react'\nexport { default as View } from './components/view'\nexport { VoipRoom } from '@tarojs/components/lib/react'\nexport { WebView } from '@tarojs/components/lib/react'\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { template, use, spread, mergeProps, insert } from 'solid-js/web';
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import './style/index.scss.js';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { omit, createForwardRefComponent } from '../../utils/index.js';
|
|
6
|
+
import { useRef, useState, useEffect } from '../../utils/hooks.solid.js';
|
|
7
|
+
|
|
8
|
+
var _tmpl$ = /*#__PURE__*/template(`<button>`),
|
|
9
|
+
_tmpl$2 = /*#__PURE__*/template(`<i class=weui-loading>`);
|
|
10
|
+
function Button(props) {
|
|
11
|
+
const startTimer = useRef();
|
|
12
|
+
const endTimer = useRef();
|
|
13
|
+
const [state, setState] = useState({
|
|
14
|
+
hover: false,
|
|
15
|
+
touch: false
|
|
16
|
+
});
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
return () => {
|
|
19
|
+
startTimer.current && clearTimeout(startTimer.current);
|
|
20
|
+
endTimer.current && clearTimeout(endTimer.current);
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
const _onTouchStart = e => {
|
|
24
|
+
setState(e => Object.assign(Object.assign({}, e), {
|
|
25
|
+
touch: true
|
|
26
|
+
}));
|
|
27
|
+
if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {
|
|
28
|
+
startTimer.current = setTimeout(() => {
|
|
29
|
+
if (state.touch) {
|
|
30
|
+
setState(e => Object.assign(Object.assign({}, e), {
|
|
31
|
+
hover: true
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
}, props.hoverStartTime || 20);
|
|
35
|
+
}
|
|
36
|
+
props.onTouchStart && props.onTouchStart(e);
|
|
37
|
+
};
|
|
38
|
+
const _onTouchEnd = e => {
|
|
39
|
+
setState(e => Object.assign(Object.assign({}, e), {
|
|
40
|
+
touch: false
|
|
41
|
+
}));
|
|
42
|
+
if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {
|
|
43
|
+
endTimer.current = setTimeout(() => {
|
|
44
|
+
if (!state.touch) {
|
|
45
|
+
setState(e => Object.assign(Object.assign({}, e), {
|
|
46
|
+
hover: false
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
}, props.hoverStayTime || 70);
|
|
50
|
+
}
|
|
51
|
+
props.onTouchEnd && props.onTouchEnd(e);
|
|
52
|
+
};
|
|
53
|
+
const {
|
|
54
|
+
forwardedRef,
|
|
55
|
+
plain = false,
|
|
56
|
+
children,
|
|
57
|
+
disabled = false,
|
|
58
|
+
className,
|
|
59
|
+
style,
|
|
60
|
+
onClick,
|
|
61
|
+
hoverClass = 'button-hover',
|
|
62
|
+
loading = false,
|
|
63
|
+
type
|
|
64
|
+
} = props,
|
|
65
|
+
restProps = __rest(props, ["forwardedRef", "plain", "children", "disabled", "className", "style", "onClick", "hoverClass", "loading", "type"]);
|
|
66
|
+
const cls = classNames(className, 'taro-button-core', {
|
|
67
|
+
[`${hoverClass}`]: state.hover && !disabled
|
|
68
|
+
});
|
|
69
|
+
return (() => {
|
|
70
|
+
var _el$ = _tmpl$();
|
|
71
|
+
use(forwardedRef, _el$);
|
|
72
|
+
spread(_el$, mergeProps(() => omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef']), {
|
|
73
|
+
"type": type,
|
|
74
|
+
"className": cls,
|
|
75
|
+
"style": style,
|
|
76
|
+
"onClick": onClick,
|
|
77
|
+
"disabled": disabled,
|
|
78
|
+
"onTouchStart": _onTouchStart,
|
|
79
|
+
"onTouchEnd": _onTouchEnd,
|
|
80
|
+
get loading() {
|
|
81
|
+
return loading.toString();
|
|
82
|
+
},
|
|
83
|
+
get plain() {
|
|
84
|
+
return plain.toString();
|
|
85
|
+
}
|
|
86
|
+
}), false, true);
|
|
87
|
+
insert(_el$, !!loading && _tmpl$2(), null);
|
|
88
|
+
insert(_el$, children, null);
|
|
89
|
+
return _el$;
|
|
90
|
+
})();
|
|
91
|
+
}
|
|
92
|
+
var index = createForwardRefComponent(Button);
|
|
93
|
+
|
|
94
|
+
export { index as default };
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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={onClick}\n disabled={disabled}\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","restProps","__rest","cls","classNames","_el$","_tmpl$","_$use","_$spread","_$mergeProps","omit","toString","_$insert","_tmpl$2","createForwardRefComponent"],"mappings":";;;;;;;;;AA2BA,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,Q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AA,CAAA,MAAA;IAAA,IAAAmB,IAAA,GAAAC,MAAA,EAAA;IAAAC,GAAA,CAISd,YAAY,EAAAY,IAAA,CAAA;IAAAG,MAAA,CAAAH,IAAA,EAAAI,UAAA,OAFbC,IAAI,CAACT,SAAS,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,EAAA;AAAA,MAAA,MAAA,EAC9FD,IAAI;AAAA,MAAA,WAAA,EAECG,GAAG;AAAA,MAAA,OAAA,EACPN,KAAK;AAAA,MAAA,SAAA,EACHC,OAAO;AAAA,MAAA,UAAA,EACNZ,QAAQ;AAAA,MAAA,cAAA,EACJL,aAAa;AAAA,MAAA,YAAA,EACfS,WAAW;AAAA,MAAA,IACvBS,OAAOA,GAAA;AAAA,QAAA,OAAEA,OAAO,CAACY,QAAQ,EAAE;AAAA,OAAA;AAAA,MAAA,IAC3BjB,KAAKA,GAAA;AAAA,QAAA,OAAEA,KAAK,CAACiB,QAAQ,EAAE;AAAA;AAAA,KAAA,CAAA,EAAA,KAAA,EAAA,IAAA,CAAA;IAAAC,MAAA,CAAAP,IAAA,EAEtB,CAAC,CAACN,OAAO,IAAAc,OAAA,EAAkC,EAAA,IAAA,CAAA;IAAAD,MAAA,CAAAP,IAAA,EAC3CV,QAAQ,EAAA,IAAA,CAAA;AAAA,IAAA,OAAAU,IAAA;AAAA,GAAA,GAAA;AAGf;AAEA,YAAeS,yBAAyB,CAAC9C,MAAM,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { template, use, spread, mergeProps } from 'solid-js/web';
|
|
2
|
+
import './style/index.scss.js';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { omit, createForwardRefComponent } from '../../utils/index.js';
|
|
5
|
+
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/template(`<i>`);
|
|
7
|
+
const Icon = props => {
|
|
8
|
+
let {
|
|
9
|
+
type,
|
|
10
|
+
className = '',
|
|
11
|
+
size = '23',
|
|
12
|
+
color,
|
|
13
|
+
forwardedRef
|
|
14
|
+
} = props;
|
|
15
|
+
if (type) type = type.replace(/_/g, '-');
|
|
16
|
+
const cls = classNames({
|
|
17
|
+
[`weui-icon-${type}`]: true
|
|
18
|
+
}, className);
|
|
19
|
+
const style = {
|
|
20
|
+
'font-size': size + 'px',
|
|
21
|
+
color: color
|
|
22
|
+
};
|
|
23
|
+
return (// eslint-disable-next-line react/react-in-jsx-scope
|
|
24
|
+
(() => {
|
|
25
|
+
var _el$ = _tmpl$();
|
|
26
|
+
var _ref$ = forwardedRef;
|
|
27
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : forwardedRef = _el$;
|
|
28
|
+
spread(_el$, mergeProps(() => omit(props, ['type', 'className', 'forwardedRef']), {
|
|
29
|
+
"className": cls,
|
|
30
|
+
"style": style
|
|
31
|
+
}), false, false);
|
|
32
|
+
return _el$;
|
|
33
|
+
})()
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
var index = createForwardRefComponent(Icon);
|
|
37
|
+
|
|
38
|
+
export { index as default };
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/icon/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\n\ninterface IProps {\n type: string\n color: string\n size?: number | string\n className?: string\n forwardedRef?: React.MutableRefObject<HTMLLIElement>\n}\n\nconst Icon = (props: IProps) => {\n let { type, className = '', size = '23', color, forwardedRef } = props\n if (type) type = type.replace(/_/g, '-')\n const cls = classNames(\n {\n [`weui-icon-${type}`]: true\n },\n className\n )\n const style = { 'font-size': size + 'px', color: color }\n\n return (\n // eslint-disable-next-line react/react-in-jsx-scope\n <i ref={forwardedRef} {...omit(props, ['type', 'className', 'forwardedRef'])} className={cls} style={style} />\n )\n}\nexport default createForwardRefComponent(Icon)\n"],"names":["Icon","props","type","className","size","color","forwardedRef","replace","cls","classNames","style","_el$","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","omit","createForwardRefComponent"],"mappings":";;;;;;AAcA,MAAMA,IAAI,GAAIC,KAAa,IAAI;EAC7B,IAAI;IAAEC,IAAI;AAAEC,IAAAA,SAAS,GAAG,EAAE;AAAEC,IAAAA,IAAI,GAAG,IAAI;IAAEC,KAAK;AAAEC,IAAAA;AAAc,GAAA,GAAGL,KAAK;EACtE,IAAIC,IAAI,EAAEA,IAAI,GAAGA,IAAI,CAACK,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;EACxC,MAAMC,GAAG,GAAGC,UAAU,CACpB;IACE,CAAC,CAAA,UAAA,EAAaP,IAAI,CAAA,CAAE,GAAG;GACxB,EACDC,SAAS,CACV;AACD,EAAA,MAAMO,KAAK,GAAG;IAAE,WAAW,EAAEN,IAAI,GAAG,IAAI;AAAEC,IAAAA,KAAK,EAAEA;GAAO;EAExD;AACE,IAAA,CAAA,MAAA;MAAA,IAAAM,IAAA,GAAAC,MAAA,EAAA;MAAA,IAAAC,KAAA,GACQP,YAAY;MAAA,OAAAO,KAAA,KAAAC,UAAAA,GAAAA,GAAA,CAAAD,KAAA,EAAAF,IAAA,CAAA,GAAZL,YAAY,GAAAK,IAAA;AAAAI,MAAAA,MAAA,CAAAJ,IAAA,EAAAK,UAAA,CAAA,MAAMC,IAAI,CAAChB,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,EAAA;AAAA,QAAA,WAAA,EAAaO,GAAG;QAAA,OAASE,EAAAA;AAAK,OAAA,CAAA,EAAA,KAAA,EAAA,KAAA,CAAA;AAAA,MAAA,OAAAC,IAAA;AAAA,KAAA;AAAA;AAE9G,CAAC;AACD,YAAeO,yBAAyB,CAAClB,IAAI,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { template, use, spread, insert, addEventListener, setAttribute, effect, style } from 'solid-js/web';
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import './style/index.css.js';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { createForwardRefComponent } from '../../utils/index.js';
|
|
6
|
+
import { useRef, useState, useCallback, useEffect } from '../../utils/hooks.solid.js';
|
|
7
|
+
|
|
8
|
+
var _tmpl$ = /*#__PURE__*/template(`<div>`),
|
|
9
|
+
_tmpl$2 = /*#__PURE__*/template(`<img>`);
|
|
10
|
+
function Image(props) {
|
|
11
|
+
const imgRef = useRef(null);
|
|
12
|
+
const observer = useRef({});
|
|
13
|
+
const [, setIsLoaded] = useState(false);
|
|
14
|
+
const {
|
|
15
|
+
className,
|
|
16
|
+
style: style$1 = {},
|
|
17
|
+
src,
|
|
18
|
+
mode,
|
|
19
|
+
onError,
|
|
20
|
+
lazyLoad,
|
|
21
|
+
imgProps,
|
|
22
|
+
forwardedRef
|
|
23
|
+
} = props,
|
|
24
|
+
reset = __rest(props, ["className", "style", "src", "mode", "onError", "lazyLoad", "imgProps", "forwardedRef"]);
|
|
25
|
+
const cls = classNames('taro-img', {
|
|
26
|
+
'taro-img__widthfix': mode === 'widthFix'
|
|
27
|
+
}, className);
|
|
28
|
+
const imgCls = classNames('taro-img__mode-' + (mode || 'scaleToFill').toLowerCase().replace(/\s/g, ''));
|
|
29
|
+
const imageOnLoad = useCallback(e => {
|
|
30
|
+
const {
|
|
31
|
+
onLoad
|
|
32
|
+
} = props;
|
|
33
|
+
Object.defineProperty(e, 'detail', {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: {
|
|
37
|
+
width: e.target.width,
|
|
38
|
+
height: e.target.height
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
onLoad && onLoad(e);
|
|
42
|
+
}, [props]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
if (lazyLoad) {
|
|
46
|
+
observer.current = new IntersectionObserver(entries => {
|
|
47
|
+
// 异步 api 关系
|
|
48
|
+
if (entries[entries.length - 1].isIntersecting) {
|
|
49
|
+
setIsLoaded(true);
|
|
50
|
+
// findDOMNode(this).children[0].src = src
|
|
51
|
+
imgRef.current.src = src;
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
rootMargin: '300px 0px'
|
|
55
|
+
});
|
|
56
|
+
(_b = (_a = observer.current).observe) === null || _b === void 0 ? void 0 : _b.call(_a, imgRef.current);
|
|
57
|
+
}
|
|
58
|
+
return () => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
(_b = (_a = observer.current) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
61
|
+
};
|
|
62
|
+
}, [lazyLoad, src]);
|
|
63
|
+
return (() => {
|
|
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;
|
|
77
|
+
})() : (() => {
|
|
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;
|
|
86
|
+
})());
|
|
87
|
+
effect(_$p => style(_el$, style$1, _$p));
|
|
88
|
+
return _el$;
|
|
89
|
+
})();
|
|
90
|
+
}
|
|
91
|
+
var index = createForwardRefComponent(Image);
|
|
92
|
+
|
|
93
|
+
export { index as default };
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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\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"],"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;aACTC,OAAK,GAAG,EAAE;MACVC,GAAG;MACHC,IAAI;MACJC,OAAO;MACPC,QAAQ;MACRC,QAAQ;AACRC,MAAAA;AAAY,KAAA,GAEVb,KAAK;IADJc,KAAK,GAAAC,MAAA,CACNf,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OAAAsC,KAAA;AAAA,KAAA,GAAA,GAAA,CAAA,MAAA;MAAA,IAAAK,KAAA,GAAAJ,OAAA,EAAA;MAAAC,gBAAA,CAAAG,KAAA,EAAA,OAAA,EAQH7C,OAAO,CAAA;MAAA0C,gBAAA,CAAAG,KAAA,EAAA,MAAA,EADRlC,WAAW,CAAA;MAAA0B,GAAA,CAHdM,GAAG,IAAKpD,MAAM,CAACiC,OAAO,GAAGmB,GAAI,EAAAE,KAAA,CAAA;MAAAA,KAAA,CAAAjD,SAAA,GACvBY,MAAM;MAAAoC,YAAA,CAAAC,KAAA,EAAA,KAAA,EACZ/C,GAAG,CAAA;MAAAwC,MAAA,CAAAO,KAAA,EAGJ3C,QAAQ,EAAA,KAAA,EAAA,KAAA,CAAA;AAAA,MAAA,OAAA2C,KAAA;KAEf,GAAA,CAAA;IAAAC,MAAA,CAAAC,GAAA,IAAAC,KAAA,CAAAb,IAAA,EAnByBtC,OAAK,EAAAkD,GAAA,CAAA,CAAA;AAAA,IAAA,OAAAZ,IAAA;AAAA,GAAA,GAAA;AAsBrC;AAEA,YAAec,yBAAyB,CAAC5D,KAAK,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -95,7 +95,7 @@ function getRegionColumnsCount(level) {
|
|
|
95
95
|
// 默认显示省市区/县三列
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
const Picker = React.forwardRef((props, ref) => {
|
|
99
99
|
var _a, _b;
|
|
100
100
|
const {
|
|
101
101
|
mode = 'selector',
|
|
@@ -115,10 +115,9 @@ function Picker(props) {
|
|
|
115
115
|
onCancel,
|
|
116
116
|
children,
|
|
117
117
|
style,
|
|
118
|
-
forwardedRef,
|
|
119
118
|
formType
|
|
120
119
|
} = props,
|
|
121
|
-
restProps = __rest(props, ["mode", "disabled", "range", "rangeKey", "value", "start", "end", "fields", "headerText", "level", "regionData", "textProps", "onChange", "onColumnChange", "onCancel", "children", "style", "
|
|
120
|
+
restProps = __rest(props, ["mode", "disabled", "range", "rangeKey", "value", "start", "end", "fields", "headerText", "level", "regionData", "textProps", "onChange", "onColumnChange", "onCancel", "children", "style", "formType"]);
|
|
122
121
|
const indexRef = React.useRef([]);
|
|
123
122
|
const pickerDateRef = React.useRef();
|
|
124
123
|
const [state, setState] = React.useState({
|
|
@@ -720,12 +719,20 @@ function Picker(props) {
|
|
|
720
719
|
const clsSlider = classNames('taro-picker', 'taro-picker__animate-slide-up', {
|
|
721
720
|
'taro-picker__animate-slide-down': state.fadeOut
|
|
722
721
|
});
|
|
722
|
+
// 暴露方法给外部
|
|
723
|
+
React.useImperativeHandle(ref, () => ({
|
|
724
|
+
showPicker,
|
|
725
|
+
hidePicker
|
|
726
|
+
}));
|
|
723
727
|
return createComponent(View, mergeProps({
|
|
724
|
-
ref
|
|
728
|
+
ref(r$) {
|
|
729
|
+
var _ref$ = ref;
|
|
730
|
+
typeof _ref$ === "function" ? _ref$(r$) : ref = r$;
|
|
731
|
+
},
|
|
725
732
|
style: style
|
|
726
733
|
}, formType ? {
|
|
727
734
|
'data-form-type': formType
|
|
728
|
-
} : {}, () => omit(restProps, ['mode', 'disabled', 'range', 'rangeKey', 'value', 'start', 'end', 'fields', 'name', 'textProps', 'onChange', 'onColumnChange', 'onCancel', 'children', 'style', '
|
|
735
|
+
} : {}, () => omit(restProps, ['mode', 'disabled', 'range', 'rangeKey', 'value', 'start', 'end', 'fields', 'name', 'textProps', 'onChange', 'onColumnChange', 'onCancel', 'children', 'style', 'formType']), {
|
|
729
736
|
get children() {
|
|
730
737
|
return [createComponent(View, {
|
|
731
738
|
onClick: showPicker,
|
|
@@ -769,7 +776,8 @@ function Picker(props) {
|
|
|
769
776
|
}))];
|
|
770
777
|
}
|
|
771
778
|
}));
|
|
772
|
-
}
|
|
779
|
+
});
|
|
780
|
+
Picker.displayName = 'Picker';
|
|
773
781
|
|
|
774
|
-
export { Picker
|
|
782
|
+
export { Picker as default };
|
|
775
783
|
//# sourceMappingURL=index.js.map
|