@rsmax/one 1.0.1
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/CHANGELOG.md +6 -0
- package/README.md +3 -0
- package/cjs/api/index.ali.d.ts +1 -0
- package/cjs/api/index.ali.js +9 -0
- package/cjs/api/index.d.ts +1 -0
- package/cjs/api/index.js +9 -0
- package/cjs/api/index.toutiao.d.ts +1 -0
- package/cjs/api/index.toutiao.js +9 -0
- package/cjs/api/index.wechat.d.ts +5 -0
- package/cjs/api/index.wechat.js +9 -0
- package/cjs/components/Modal.d.ts +2 -0
- package/cjs/components/Modal.js +8 -0
- package/cjs/components/Modal.web.d.ts +2 -0
- package/cjs/components/Modal.web.js +41 -0
- package/cjs/constants.d.ts +1 -0
- package/cjs/constants.js +4 -0
- package/cjs/createHostComponent.d.ts +18 -0
- package/cjs/createHostComponent.js +205 -0
- package/cjs/hostComponents/Button/index.d.ts +24 -0
- package/cjs/hostComponents/Button/index.js +10 -0
- package/cjs/hostComponents/Button/index.web.d.ts +5 -0
- package/cjs/hostComponents/Button/index.web.js +57 -0
- package/cjs/hostComponents/Button/props/alias/index.d.ts +4 -0
- package/cjs/hostComponents/Button/props/alias/index.js +5 -0
- package/cjs/hostComponents/Button/props/default/index.d.ts +2 -0
- package/cjs/hostComponents/Button/props/default/index.js +3 -0
- package/cjs/hostComponents/Button/props/default/index.wechat.d.ts +6 -0
- package/cjs/hostComponents/Button/props/default/index.wechat.js +7 -0
- package/cjs/hostComponents/Button/props/index.d.ts +27 -0
- package/cjs/hostComponents/Button/props/index.js +10 -0
- package/cjs/hostComponents/Form/index.d.ts +5 -0
- package/cjs/hostComponents/Form/index.js +9 -0
- package/cjs/hostComponents/Form/index.web.d.ts +5 -0
- package/cjs/hostComponents/Form/index.web.js +29 -0
- package/cjs/hostComponents/Form/props/default/index.d.ts +2 -0
- package/cjs/hostComponents/Form/props/default/index.js +3 -0
- package/cjs/hostComponents/Form/props/default/index.wechat.d.ts +5 -0
- package/cjs/hostComponents/Form/props/default/index.wechat.js +6 -0
- package/cjs/hostComponents/Form/props/index.d.ts +15 -0
- package/cjs/hostComponents/Form/props/index.js +8 -0
- package/cjs/hostComponents/Image/index.d.ts +5 -0
- package/cjs/hostComponents/Image/index.js +9 -0
- package/cjs/hostComponents/Image/index.web.d.ts +5 -0
- package/cjs/hostComponents/Image/index.web.js +54 -0
- package/cjs/hostComponents/Image/modeStyle.d.ts +46 -0
- package/cjs/hostComponents/Image/modeStyle.js +47 -0
- package/cjs/hostComponents/Image/props/default/index.d.ts +2 -0
- package/cjs/hostComponents/Image/props/default/index.js +3 -0
- package/cjs/hostComponents/Image/props/default/index.wechat.d.ts +7 -0
- package/cjs/hostComponents/Image/props/default/index.wechat.js +8 -0
- package/cjs/hostComponents/Image/props/index.d.ts +27 -0
- package/cjs/hostComponents/Image/props/index.js +8 -0
- package/cjs/hostComponents/Input/index.d.ts +27 -0
- package/cjs/hostComponents/Input/index.js +86 -0
- package/cjs/hostComponents/Input/index.web.d.ts +5 -0
- package/cjs/hostComponents/Input/index.web.js +58 -0
- package/cjs/hostComponents/Input/props/alias/index.d.ts +4 -0
- package/cjs/hostComponents/Input/props/alias/index.js +5 -0
- package/cjs/hostComponents/Input/props/index.d.ts +35 -0
- package/cjs/hostComponents/Input/props/index.js +2 -0
- package/cjs/hostComponents/Label/index.d.ts +5 -0
- package/cjs/hostComponents/Label/index.js +8 -0
- package/cjs/hostComponents/Label/index.web.d.ts +5 -0
- package/cjs/hostComponents/Label/index.web.js +29 -0
- package/cjs/hostComponents/Label/props.d.ts +9 -0
- package/cjs/hostComponents/Label/props.js +2 -0
- package/cjs/hostComponents/Navigator/index.d.ts +5 -0
- package/cjs/hostComponents/Navigator/index.js +9 -0
- package/cjs/hostComponents/Navigator/index.web.d.ts +5 -0
- package/cjs/hostComponents/Navigator/index.web.js +64 -0
- package/cjs/hostComponents/Navigator/props/default/index.d.ts +2 -0
- package/cjs/hostComponents/Navigator/props/default/index.js +3 -0
- package/cjs/hostComponents/Navigator/props/default/index.wechat.d.ts +10 -0
- package/cjs/hostComponents/Navigator/props/default/index.wechat.js +11 -0
- package/cjs/hostComponents/Navigator/props/index.d.ts +22 -0
- package/cjs/hostComponents/Navigator/props/index.js +8 -0
- package/cjs/hostComponents/Text/index.d.ts +5 -0
- package/cjs/hostComponents/Text/index.js +9 -0
- package/cjs/hostComponents/Text/index.web.d.ts +5 -0
- package/cjs/hostComponents/Text/index.web.js +74 -0
- package/cjs/hostComponents/Text/props/default/index.d.ts +2 -0
- package/cjs/hostComponents/Text/props/default/index.js +3 -0
- package/cjs/hostComponents/Text/props/default/index.wechat.d.ts +5 -0
- package/cjs/hostComponents/Text/props/default/index.wechat.js +6 -0
- package/cjs/hostComponents/Text/props/index.d.ts +18 -0
- package/cjs/hostComponents/Text/props/index.js +8 -0
- package/cjs/hostComponents/Textarea/index.d.ts +29 -0
- package/cjs/hostComponents/Textarea/index.js +80 -0
- package/cjs/hostComponents/Textarea/index.web.d.ts +4 -0
- package/cjs/hostComponents/Textarea/index.web.js +64 -0
- package/cjs/hostComponents/Textarea/props/alias.d.ts +4 -0
- package/cjs/hostComponents/Textarea/props/alias.js +5 -0
- package/cjs/hostComponents/Textarea/props/index.d.ts +30 -0
- package/cjs/hostComponents/Textarea/props/index.js +8 -0
- package/cjs/hostComponents/View/index.d.ts +5 -0
- package/cjs/hostComponents/View/index.js +9 -0
- package/cjs/hostComponents/View/index.web.d.ts +5 -0
- package/cjs/hostComponents/View/index.web.js +57 -0
- package/cjs/hostComponents/View/props/default/index.d.ts +2 -0
- package/cjs/hostComponents/View/props/default/index.js +3 -0
- package/cjs/hostComponents/View/props/default/index.wechat.d.ts +7 -0
- package/cjs/hostComponents/View/props/default/index.wechat.js +8 -0
- package/cjs/hostComponents/View/props/index.d.ts +27 -0
- package/cjs/hostComponents/View/props/index.js +8 -0
- package/cjs/hostComponents/WebView/index.d.ts +9 -0
- package/cjs/hostComponents/WebView/index.js +8 -0
- package/cjs/hostComponents/WebView/index.web.d.ts +10 -0
- package/cjs/hostComponents/WebView/index.web.js +56 -0
- package/cjs/hostComponents/index.d.ts +20 -0
- package/cjs/hostComponents/index.js +50 -0
- package/cjs/hostComponents/useWebTouch.d.ts +18 -0
- package/cjs/hostComponents/useWebTouch.js +95 -0
- package/cjs/index.d.ts +4 -0
- package/cjs/index.js +25 -0
- package/cjs/types/event.d.ts +64 -0
- package/cjs/types/event.js +2 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +17 -0
- package/cjs/useWebPlaceholderStyle/index.d.ts +2 -0
- package/cjs/useWebPlaceholderStyle/index.js +50 -0
- package/cjs/useWebPlaceholderStyle/plainStyle/CSSProperty.d.ts +6 -0
- package/cjs/useWebPlaceholderStyle/plainStyle/CSSProperty.js +71 -0
- package/cjs/useWebPlaceholderStyle/plainStyle/index.d.ts +3 -0
- package/cjs/useWebPlaceholderStyle/plainStyle/index.js +48 -0
- package/cjs/utils/isPlatformSpecifyProp.d.ts +3 -0
- package/cjs/utils/isPlatformSpecifyProp.js +22 -0
- package/cjs/utils/literalText.d.ts +2 -0
- package/cjs/utils/literalText.js +20 -0
- package/esm/api/index.ali.d.ts +1 -0
- package/esm/api/index.ali.js +1 -0
- package/esm/api/index.d.ts +1 -0
- package/esm/api/index.js +1 -0
- package/esm/api/index.toutiao.d.ts +1 -0
- package/esm/api/index.toutiao.js +1 -0
- package/esm/api/index.wechat.d.ts +5 -0
- package/esm/api/index.wechat.js +6 -0
- package/esm/components/Modal.d.ts +2 -0
- package/esm/components/Modal.js +5 -0
- package/esm/components/Modal.web.d.ts +2 -0
- package/esm/components/Modal.web.js +12 -0
- package/esm/constants.d.ts +1 -0
- package/esm/constants.js +1 -0
- package/esm/createHostComponent.d.ts +18 -0
- package/esm/createHostComponent.js +166 -0
- package/esm/hostComponents/Button/index.d.ts +24 -0
- package/esm/hostComponents/Button/index.js +5 -0
- package/esm/hostComponents/Button/index.web.d.ts +5 -0
- package/esm/hostComponents/Button/index.web.js +29 -0
- package/esm/hostComponents/Button/props/alias/index.d.ts +4 -0
- package/esm/hostComponents/Button/props/alias/index.js +3 -0
- package/esm/hostComponents/Button/props/default/index.d.ts +2 -0
- package/esm/hostComponents/Button/props/default/index.js +1 -0
- package/esm/hostComponents/Button/props/default/index.wechat.d.ts +6 -0
- package/esm/hostComponents/Button/props/default/index.wechat.js +5 -0
- package/esm/hostComponents/Button/props/index.d.ts +27 -0
- package/esm/hostComponents/Button/props/index.js +2 -0
- package/esm/hostComponents/Form/index.d.ts +5 -0
- package/esm/hostComponents/Form/index.js +4 -0
- package/esm/hostComponents/Form/index.web.d.ts +5 -0
- package/esm/hostComponents/Form/index.web.js +4 -0
- package/esm/hostComponents/Form/props/default/index.d.ts +2 -0
- package/esm/hostComponents/Form/props/default/index.js +1 -0
- package/esm/hostComponents/Form/props/default/index.wechat.d.ts +5 -0
- package/esm/hostComponents/Form/props/default/index.wechat.js +4 -0
- package/esm/hostComponents/Form/props/index.d.ts +15 -0
- package/esm/hostComponents/Form/props/index.js +1 -0
- package/esm/hostComponents/Image/index.d.ts +5 -0
- package/esm/hostComponents/Image/index.js +4 -0
- package/esm/hostComponents/Image/index.web.d.ts +5 -0
- package/esm/hostComponents/Image/index.web.js +26 -0
- package/esm/hostComponents/Image/modeStyle.d.ts +46 -0
- package/esm/hostComponents/Image/modeStyle.js +45 -0
- package/esm/hostComponents/Image/props/default/index.d.ts +2 -0
- package/esm/hostComponents/Image/props/default/index.js +1 -0
- package/esm/hostComponents/Image/props/default/index.wechat.d.ts +7 -0
- package/esm/hostComponents/Image/props/default/index.wechat.js +6 -0
- package/esm/hostComponents/Image/props/index.d.ts +27 -0
- package/esm/hostComponents/Image/props/index.js +1 -0
- package/esm/hostComponents/Input/index.d.ts +27 -0
- package/esm/hostComponents/Input/index.js +80 -0
- package/esm/hostComponents/Input/index.web.d.ts +5 -0
- package/esm/hostComponents/Input/index.web.js +30 -0
- package/esm/hostComponents/Input/props/alias/index.d.ts +4 -0
- package/esm/hostComponents/Input/props/alias/index.js +3 -0
- package/esm/hostComponents/Input/props/index.d.ts +35 -0
- package/esm/hostComponents/Input/props/index.js +1 -0
- package/esm/hostComponents/Label/index.d.ts +5 -0
- package/esm/hostComponents/Label/index.js +3 -0
- package/esm/hostComponents/Label/index.web.d.ts +5 -0
- package/esm/hostComponents/Label/index.web.js +4 -0
- package/esm/hostComponents/Label/props.d.ts +9 -0
- package/esm/hostComponents/Label/props.js +1 -0
- package/esm/hostComponents/Navigator/index.d.ts +5 -0
- package/esm/hostComponents/Navigator/index.js +4 -0
- package/esm/hostComponents/Navigator/index.web.d.ts +5 -0
- package/esm/hostComponents/Navigator/index.web.js +36 -0
- package/esm/hostComponents/Navigator/props/default/index.d.ts +2 -0
- package/esm/hostComponents/Navigator/props/default/index.js +1 -0
- package/esm/hostComponents/Navigator/props/default/index.wechat.d.ts +10 -0
- package/esm/hostComponents/Navigator/props/default/index.wechat.js +9 -0
- package/esm/hostComponents/Navigator/props/index.d.ts +22 -0
- package/esm/hostComponents/Navigator/props/index.js +1 -0
- package/esm/hostComponents/Text/index.d.ts +5 -0
- package/esm/hostComponents/Text/index.js +4 -0
- package/esm/hostComponents/Text/index.web.d.ts +5 -0
- package/esm/hostComponents/Text/index.web.js +46 -0
- package/esm/hostComponents/Text/props/default/index.d.ts +2 -0
- package/esm/hostComponents/Text/props/default/index.js +1 -0
- package/esm/hostComponents/Text/props/default/index.wechat.d.ts +5 -0
- package/esm/hostComponents/Text/props/default/index.wechat.js +4 -0
- package/esm/hostComponents/Text/props/index.d.ts +18 -0
- package/esm/hostComponents/Text/props/index.js +1 -0
- package/esm/hostComponents/Textarea/index.d.ts +29 -0
- package/esm/hostComponents/Textarea/index.js +74 -0
- package/esm/hostComponents/Textarea/index.web.d.ts +4 -0
- package/esm/hostComponents/Textarea/index.web.js +36 -0
- package/esm/hostComponents/Textarea/props/alias.d.ts +4 -0
- package/esm/hostComponents/Textarea/props/alias.js +3 -0
- package/esm/hostComponents/Textarea/props/index.d.ts +30 -0
- package/esm/hostComponents/Textarea/props/index.js +1 -0
- package/esm/hostComponents/View/index.d.ts +5 -0
- package/esm/hostComponents/View/index.js +4 -0
- package/esm/hostComponents/View/index.web.d.ts +5 -0
- package/esm/hostComponents/View/index.web.js +29 -0
- package/esm/hostComponents/View/props/default/index.d.ts +2 -0
- package/esm/hostComponents/View/props/default/index.js +1 -0
- package/esm/hostComponents/View/props/default/index.wechat.d.ts +7 -0
- package/esm/hostComponents/View/props/default/index.wechat.js +6 -0
- package/esm/hostComponents/View/props/index.d.ts +27 -0
- package/esm/hostComponents/View/props/index.js +1 -0
- package/esm/hostComponents/WebView/index.d.ts +9 -0
- package/esm/hostComponents/WebView/index.js +3 -0
- package/esm/hostComponents/WebView/index.web.d.ts +10 -0
- package/esm/hostComponents/WebView/index.web.js +28 -0
- package/esm/hostComponents/index.d.ts +20 -0
- package/esm/hostComponents/index.js +20 -0
- package/esm/hostComponents/useWebTouch.d.ts +18 -0
- package/esm/hostComponents/useWebTouch.js +70 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +4 -0
- package/esm/types/event.d.ts +64 -0
- package/esm/types/event.js +1 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/useWebPlaceholderStyle/index.d.ts +2 -0
- package/esm/useWebPlaceholderStyle/index.js +21 -0
- package/esm/useWebPlaceholderStyle/plainStyle/CSSProperty.d.ts +6 -0
- package/esm/useWebPlaceholderStyle/plainStyle/CSSProperty.js +68 -0
- package/esm/useWebPlaceholderStyle/plainStyle/index.d.ts +3 -0
- package/esm/useWebPlaceholderStyle/plainStyle/index.js +46 -0
- package/esm/utils/isPlatformSpecifyProp.d.ts +3 -0
- package/esm/utils/isPlatformSpecifyProp.js +18 -0
- package/esm/utils/literalText.d.ts +2 -0
- package/esm/utils/literalText.js +15 -0
- package/node.js +1 -0
- package/package.json +45 -0
- package/scripts/postbuild.js +17 -0
- package/typings/index.d.ts +0 -0
- package/vitest.config.js +7 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'wechat-target': string;
|
|
3
|
+
'wechat-open-type': string;
|
|
4
|
+
'wechat-delta': number;
|
|
5
|
+
hoverClassName: string;
|
|
6
|
+
'wechat-hover-stop-propagation': boolean;
|
|
7
|
+
hoverStartTime: number;
|
|
8
|
+
hoverStayTime: number;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
'wechat-target': 'self',
|
|
5
|
+
'wechat-open-type': 'navigate',
|
|
6
|
+
'wechat-delta': 1,
|
|
7
|
+
hoverClassName: 'navigator-hover',
|
|
8
|
+
'wechat-hover-stop-propagation': false,
|
|
9
|
+
hoverStartTime: 50,
|
|
10
|
+
hoverStayTime: 600,
|
|
11
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export { default as defaults } from './default';
|
|
3
|
+
export interface NavigatorProps {
|
|
4
|
+
readonly dataset?: DOMStringMap;
|
|
5
|
+
id?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
url: string;
|
|
9
|
+
action: 'navigate' | 'redirect' | 'switchTab' | 'reLaunch';
|
|
10
|
+
/**
|
|
11
|
+
* 指定点击时的样式类
|
|
12
|
+
*/
|
|
13
|
+
hoverClassName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 按住后多久出现点击态,单位毫秒
|
|
16
|
+
*/
|
|
17
|
+
hoverStartTime?: number;
|
|
18
|
+
/**
|
|
19
|
+
* 手指松开后点击态保留时间,单位毫秒
|
|
20
|
+
*/
|
|
21
|
+
hoverStayTime?: number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.defaults = void 0;
|
|
7
|
+
var default_1 = require("./default");
|
|
8
|
+
Object.defineProperty(exports, "defaults", { enumerable: true, get: function () { return __importDefault(default_1).default; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const createHostComponent_1 = __importDefault(require("../../createHostComponent"));
|
|
7
|
+
const default_1 = __importDefault(require("./props/default"));
|
|
8
|
+
const Text = (0, createHostComponent_1.default)('text', null, default_1.default);
|
|
9
|
+
exports.default = Text;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
|
|
43
|
+
const Text = (props, ref) => {
|
|
44
|
+
const _a = (0, isPlatformSpecifyProp_1.filterProps)(props), { onTap, onTouchStart, onTouchMove, onTouchEnd, onTouchCancel, className, selectable } = _a, restProps = __rest(_a, ["onTap", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "className", "selectable"]);
|
|
45
|
+
const hoveringRef = React.useRef(false);
|
|
46
|
+
function handleTouchStart(e) {
|
|
47
|
+
hoveringRef.current = true;
|
|
48
|
+
if (typeof onTouchStart === 'function') {
|
|
49
|
+
return onTouchStart(e);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function handleTouchMove(e) {
|
|
53
|
+
hoveringRef.current = false;
|
|
54
|
+
if (typeof onTouchMove === 'function') {
|
|
55
|
+
return onTouchMove(e);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function handleTouchEnd(e) {
|
|
59
|
+
hoveringRef.current = false;
|
|
60
|
+
if (typeof onTouchEnd === 'function') {
|
|
61
|
+
return onTouchEnd(e);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function handleTouchCancel(e) {
|
|
65
|
+
hoveringRef.current = false;
|
|
66
|
+
if (typeof onTouchCancel === 'function') {
|
|
67
|
+
return onTouchCancel(e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return (React.createElement("span", Object.assign({}, restProps, { className: (0, clsx_1.default)(className, {
|
|
71
|
+
'remax-text-selectable': selectable,
|
|
72
|
+
}), ref: ref, onClick: onTap, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, onTouchCancel: handleTouchCancel })));
|
|
73
|
+
};
|
|
74
|
+
exports.default = React.forwardRef(Text);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TapEvent } from '../../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export { default as defaults } from './default';
|
|
4
|
+
interface CommonProps {
|
|
5
|
+
readonly dataset?: DOMStringMap;
|
|
6
|
+
id?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
/** 文本是否可选 */
|
|
10
|
+
selectable?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export default interface TextProps extends CommonProps, React.AriaAttributes {
|
|
14
|
+
onTap?: (event: TapEvent) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface TextWebProps extends CommonProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
17
|
+
onTap?: (event: React.MouseEvent<HTMLSpanElement>) => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.defaults = void 0;
|
|
7
|
+
var default_1 = require("./default");
|
|
8
|
+
Object.defineProperty(exports, "defaults", { enumerable: true, get: function () { return __importDefault(default_1).default; } });
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputEvent } from '../../types';
|
|
3
|
+
import { TextareaProps } from './props';
|
|
4
|
+
export type { TextareaProps };
|
|
5
|
+
export interface TextareaState {
|
|
6
|
+
value?: string;
|
|
7
|
+
controlled: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default class Textarea extends React.Component<TextareaProps, TextareaState> {
|
|
10
|
+
static defaultProps: {
|
|
11
|
+
'toutiao-selection-end': number;
|
|
12
|
+
'toutiao-selection-start': number;
|
|
13
|
+
'wechat-selection-end': number;
|
|
14
|
+
'wechat-selection-start': number;
|
|
15
|
+
'wechat-fixed': boolean;
|
|
16
|
+
'wechat-placeholder-class': string;
|
|
17
|
+
'wechat-cursor-spacing': number;
|
|
18
|
+
'wechat-cursor': number;
|
|
19
|
+
'wechat-show-confirm-bar': boolean;
|
|
20
|
+
'wechat-adjust-position': boolean;
|
|
21
|
+
'wechat-hold-keyboard': boolean;
|
|
22
|
+
'wechat-disable-default-padding': boolean;
|
|
23
|
+
};
|
|
24
|
+
state: TextareaState;
|
|
25
|
+
constructor(props: TextareaProps);
|
|
26
|
+
componentDidUpdate(): void;
|
|
27
|
+
handleInput: (e: InputEvent) => any;
|
|
28
|
+
render(): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const createHostComponent_1 = require("../../createHostComponent");
|
|
8
|
+
const alias_1 = __importDefault(require("./props/alias"));
|
|
9
|
+
class Textarea extends react_1.default.Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.state = {
|
|
13
|
+
value: '',
|
|
14
|
+
// 阿里
|
|
15
|
+
controlled: false,
|
|
16
|
+
};
|
|
17
|
+
this.handleInput = (e) => {
|
|
18
|
+
const { controlled } = this.state;
|
|
19
|
+
if (!controlled) {
|
|
20
|
+
this.setState({ value: e.target.value });
|
|
21
|
+
}
|
|
22
|
+
if (typeof this.props.onInput === 'function') {
|
|
23
|
+
return this.props.onInput(e);
|
|
24
|
+
}
|
|
25
|
+
// 微信
|
|
26
|
+
// 注意,微信要对 input 受控,必须要在 onInput 方法返回值
|
|
27
|
+
return controlled ? this.props.value : e.target.value;
|
|
28
|
+
};
|
|
29
|
+
const controlled = props.value !== undefined;
|
|
30
|
+
const value = controlled ? props.value : props.defaultValue;
|
|
31
|
+
this.state = {
|
|
32
|
+
value,
|
|
33
|
+
controlled,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
componentDidUpdate() {
|
|
37
|
+
if (this.props.value !== undefined && this.props.value !== this.state.value) {
|
|
38
|
+
this.setState({ value: this.props.value });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
var _a, _b, _c, _d, _e;
|
|
43
|
+
const inputProps = Object.assign(Object.assign({}, this.props), { onInput: (0, createHostComponent_1.createCallback)(this.handleInput, createHostComponent_1.createInputEvent) });
|
|
44
|
+
if (inputProps.onConfirm) {
|
|
45
|
+
inputProps.onConfirm = (0, createHostComponent_1.createCallback)(this.props.onConfirm, createHostComponent_1.createInputEvent);
|
|
46
|
+
}
|
|
47
|
+
if (inputProps.onFocus) {
|
|
48
|
+
inputProps.onFocus = (0, createHostComponent_1.createCallback)(this.props.onFocus, createHostComponent_1.createInputEvent);
|
|
49
|
+
}
|
|
50
|
+
if (inputProps.onBlur) {
|
|
51
|
+
inputProps.onBlur = (0, createHostComponent_1.createCallback)(this.props.onBlur, createHostComponent_1.createInputEvent);
|
|
52
|
+
}
|
|
53
|
+
if (process.env.RSMAX_PLATFORM === 'toutiao') {
|
|
54
|
+
inputProps.maxLength = (_a = inputProps.maxLength) !== null && _a !== void 0 ? _a : 140;
|
|
55
|
+
}
|
|
56
|
+
if (process.env.RSMAX_PLATFORM === 'wechat') {
|
|
57
|
+
inputProps.maxLength = (_b = inputProps.maxLength) !== null && _b !== void 0 ? _b : 140;
|
|
58
|
+
inputProps.disabled = (_c = inputProps.disabled) !== null && _c !== void 0 ? _c : false;
|
|
59
|
+
inputProps.focus = (_d = inputProps.focus) !== null && _d !== void 0 ? _d : false;
|
|
60
|
+
inputProps.autoHeight = (_e = inputProps.autoHeight) !== null && _e !== void 0 ? _e : false;
|
|
61
|
+
}
|
|
62
|
+
const nextProps = (0, createHostComponent_1.aliasProps)(Object.assign(Object.assign({}, inputProps), this.state), alias_1.default);
|
|
63
|
+
return react_1.default.createElement('textarea', nextProps);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.default = Textarea;
|
|
67
|
+
Textarea.defaultProps = {
|
|
68
|
+
'toutiao-selection-end': 999,
|
|
69
|
+
'toutiao-selection-start': 999,
|
|
70
|
+
'wechat-selection-end': -1,
|
|
71
|
+
'wechat-selection-start': -1,
|
|
72
|
+
'wechat-fixed': false,
|
|
73
|
+
'wechat-placeholder-class': 'textarea-placeholder',
|
|
74
|
+
'wechat-cursor-spacing': 0,
|
|
75
|
+
'wechat-cursor': -1,
|
|
76
|
+
'wechat-show-confirm-bar': true,
|
|
77
|
+
'wechat-adjust-position': true,
|
|
78
|
+
'wechat-hold-keyboard': false,
|
|
79
|
+
'wechat-disable-default-padding': false,
|
|
80
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const react_autosize_textarea_1 = __importDefault(require("react-autosize-textarea"));
|
|
42
|
+
const useWebPlaceholderStyle_1 = __importDefault(require("../../useWebPlaceholderStyle"));
|
|
43
|
+
const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
|
|
44
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
45
|
+
const Textarea = (props, ref) => {
|
|
46
|
+
const _a = (0, isPlatformSpecifyProp_1.filterProps)(props), { onConfirm, onKeyPress, autoHeight, className, placeholderStyle } = _a, restProps = __rest(_a, ["onConfirm", "onKeyPress", "autoHeight", "className", "placeholderStyle"]);
|
|
47
|
+
const [placeholderStyleClassName] = (0, useWebPlaceholderStyle_1.default)(placeholderStyle);
|
|
48
|
+
function handleKeyPress(e) {
|
|
49
|
+
if (e.key === 'Enter' && typeof onConfirm === 'function') {
|
|
50
|
+
onConfirm(e);
|
|
51
|
+
}
|
|
52
|
+
if (typeof onKeyPress === 'function') {
|
|
53
|
+
onKeyPress(e);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const textareaClassName = (0, clsx_1.default)('remax-textarea', className, placeholderStyleClassName);
|
|
57
|
+
if (autoHeight) {
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
// todo 需要修正这里
|
|
60
|
+
return React.createElement(react_autosize_textarea_1.default, Object.assign({}, restProps, { className: textareaClassName, ref: ref, onKeyPress: handleKeyPress }));
|
|
61
|
+
}
|
|
62
|
+
return React.createElement("textarea", Object.assign({}, restProps, { className: textareaClassName, ref: ref, onKeyPress: handleKeyPress }));
|
|
63
|
+
};
|
|
64
|
+
exports.default = React.forwardRef(Textarea);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputEvent } from '../../../types';
|
|
3
|
+
export { default as alias } from './alias';
|
|
4
|
+
interface CommonProps {
|
|
5
|
+
readonly dataset?: DOMStringMap;
|
|
6
|
+
id?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
name?: string;
|
|
10
|
+
value?: any;
|
|
11
|
+
defaultValue?: any;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
placeholderStyle?: React.CSSProperties;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** 最大输入长度,设置为 -1 的时候不限制最大长度 */
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
focus?: boolean;
|
|
18
|
+
/** 是否自动增高,设置auto-height时,style.height不生效 */
|
|
19
|
+
autoHeight?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface TextareaProps extends CommonProps {
|
|
22
|
+
onInput?: (event: InputEvent) => any;
|
|
23
|
+
onFocus?: (event: InputEvent) => void;
|
|
24
|
+
onBlur?: (event: InputEvent) => void;
|
|
25
|
+
onConfirm?: (event: InputEvent) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface TextareaWebProps extends Omit<CommonProps, 'defaultValue'>, React.HTMLAttributes<HTMLTextAreaElement> {
|
|
28
|
+
onConfirm?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.alias = void 0;
|
|
7
|
+
var alias_1 = require("./alias");
|
|
8
|
+
Object.defineProperty(exports, "alias", { enumerable: true, get: function () { return __importDefault(alias_1).default; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const createHostComponent_1 = __importDefault(require("../../createHostComponent"));
|
|
7
|
+
const default_1 = __importDefault(require("./props/default"));
|
|
8
|
+
const View = (0, createHostComponent_1.default)('view', null, default_1.default);
|
|
9
|
+
exports.default = View;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
|
|
43
|
+
const useWebTouch_1 = __importDefault(require("../useWebTouch"));
|
|
44
|
+
const View = (props, ref) => {
|
|
45
|
+
const _a = (0, isPlatformSpecifyProp_1.filterProps)(props), { hoverClassName, hoverStartTime = 50, hoverStayTime = 400, className, onTouchStart, onTouchMove, onTouchEnd, onTouchCancel, onTap, onLongTap } = _a, restProps = __rest(_a, ["hoverClassName", "hoverStartTime", "hoverStayTime", "className", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "onTap", "onLongTap"]);
|
|
46
|
+
const [touching, handleTouchStart, handleTouchMove, handleTouchEnd, handleTouchCancel] = (0, useWebTouch_1.default)({
|
|
47
|
+
hoverDelay: hoverStartTime,
|
|
48
|
+
hoverDuration: hoverStayTime,
|
|
49
|
+
onLongTap,
|
|
50
|
+
onTouchStart,
|
|
51
|
+
onTouchMove,
|
|
52
|
+
onTouchEnd,
|
|
53
|
+
onTouchCancel,
|
|
54
|
+
});
|
|
55
|
+
return (React.createElement("div", Object.assign({}, restProps, { ref: ref, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, onTouchCancel: handleTouchCancel, className: (0, clsx_1.default)(className, { [hoverClassName || '']: touching }), onClick: onTap })));
|
|
56
|
+
};
|
|
57
|
+
exports.default = React.forwardRef(View);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TapEvent, TouchStartEvent, TouchEndEvent, TouchMoveEvent, TouchCancelEvent } from '../../../types';
|
|
3
|
+
export { default as defaults } from './default';
|
|
4
|
+
interface CommonProps {
|
|
5
|
+
readonly dataset?: DOMStringMap;
|
|
6
|
+
id?: string;
|
|
7
|
+
slot?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
hoverClassName?: string;
|
|
11
|
+
hoverStartTime?: number;
|
|
12
|
+
hoverStayTime?: number;
|
|
13
|
+
role?: string;
|
|
14
|
+
}
|
|
15
|
+
export default interface ViewProps extends CommonProps, React.AriaAttributes {
|
|
16
|
+
onTap?: (event: TapEvent) => void;
|
|
17
|
+
onTouchStart?: (event: TouchStartEvent) => void;
|
|
18
|
+
onTouchMove?: (e: TouchMoveEvent) => void;
|
|
19
|
+
onTouchEnd?: (e: TouchEndEvent) => void;
|
|
20
|
+
onTouchCancel?: (e: TouchCancelEvent) => void;
|
|
21
|
+
onLongTap?: (e: TapEvent) => void;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export interface ViewWebProps extends CommonProps, React.HTMLAttributes<HTMLDivElement> {
|
|
25
|
+
onTap?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
26
|
+
onLongTap?: (event: React.TouchEvent<HTMLDivElement>) => void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.defaults = void 0;
|
|
7
|
+
var default_1 = require("./default");
|
|
8
|
+
Object.defineProperty(exports, "defaults", { enumerable: true, get: function () { return __importDefault(default_1).default; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Event } from '../../types';
|
|
3
|
+
export interface WebViewProps extends React.AriaAttributes {
|
|
4
|
+
id?: string;
|
|
5
|
+
src: string;
|
|
6
|
+
onMessage?: (event: Event) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const WebView: React.ComponentType<WebViewProps>;
|
|
9
|
+
export default WebView;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const createHostComponent_1 = __importDefault(require("../../createHostComponent"));
|
|
7
|
+
const WebView = (0, createHostComponent_1.default)('web-view', null);
|
|
8
|
+
exports.default = WebView;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface WebViewProps extends React.AriaAttributes {
|
|
3
|
+
id?: string;
|
|
4
|
+
src: string;
|
|
5
|
+
onMessage?: (event: Event) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<WebViewProps & React.RefAttributes<any>>;
|
|
10
|
+
export default _default;
|