Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix(one): 导出 remax/one 组件 props type 定义
Browse files Browse the repository at this point in the history
  • Loading branch information
Darmody committed May 7, 2020
1 parent ea5308b commit 482ec49
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,6 @@ function (_super) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _createHostComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13);
/* eslint-disable @typescript-eslint/camelcase */

var View = Object(_createHostComponent__WEBPACK_IMPORTED_MODULE_0__["default"])('view');
/* harmony default export */ __webpack_exports__["default"] = (View);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@ function (_super) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _createHostComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13);
/* eslint-disable @typescript-eslint/camelcase */

var View = Object(_createHostComponent__WEBPACK_IMPORTED_MODULE_0__["default"])('view');
/* harmony default export */ __webpack_exports__["default"] = (View);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@ function (_super) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _createHostComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13);
/* eslint-disable @typescript-eslint/camelcase */

var View = Object(_createHostComponent__WEBPACK_IMPORTED_MODULE_0__["default"])('view');
/* harmony default export */ __webpack_exports__["default"] = (View);
Expand Down
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Button/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { ButtonWebProps } from './props';
import { filterProps } from '../../utils/isPlatformSpecifyProp';
import useWebTouch from '../useWebTouch';

export type ButtonProps = ButtonWebProps;

const Button: React.FC<ButtonWebProps> = props => {
const {
hoverClassName,
Expand Down
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Form/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import createHostComponent from '../../createHostComponent';
import { FormProps } from './props';

export type { FormProps };

const Form = createHostComponent<FormProps>('form');

export default Form;
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Form/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as React from 'react';
import { FormWebProps } from './props';
import { filterProps } from '../../utils/isPlatformSpecifyProp';

export type FormProps = FormWebProps;

const Form: React.FC<FormWebProps> = props => <form {...filterProps(props)} />;

export default Form;
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Image/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import createHostComponent from '../../createHostComponent';
import ImageProps from './props';

export type { ImageProps };

const Image = createHostComponent<ImageProps>('image');

export default Image;
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Image/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { filterProps } from '../../utils/isPlatformSpecifyProp';
import modeStyle from './modeStyle';
import clsx from 'clsx';

export type ImageProps = ImageWebProps;

const Image: React.FC<ImageWebProps> = props => {
const { className, src, style, mode, onTap, onLoad, onError, ...restProps } = filterProps<ImageWebProps>(props);
const isWidthFixMode = mode === 'widthFix';
Expand Down
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { InputEvent } from '../../types';
import { createCallback, createInputEvent } from '../../createHostComponent';
import { InputProps } from './props';

export type { InputProps };

export interface InputState {
value?: string;
controlled: boolean;
Expand Down
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Input/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { filterProps } from '../../utils/isPlatformSpecifyProp';
import useWebPlaceholderStyle from '../../useWebPlaceholderStyle';
import clsx from 'clsx';

export type InputProps = InputWebProps;

const Input: React.FC<InputWebProps> = props => {
const { password, type, onConfirm, onKeyPress, placeholderStyle, className, ...restProps } = filterProps(props);
const [placeholderStyleClassName] = useWebPlaceholderStyle(placeholderStyle);
Expand Down
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Label/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import createHostComponent from '../../createHostComponent';
import { LabelProps } from './props';

export type { LabelProps };

export default createHostComponent<LabelProps>('label');
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Label/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as React from 'react';
import { LabelProps } from './props';
import { filterProps } from '../../utils/isPlatformSpecifyProp';

export type { LabelProps };

const Label: React.FC<LabelProps> = props => <label {...filterProps(props)} />;

export default Label;
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Navigator/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import createHostComponent from '../../createHostComponent';
import { NavigatorProps } from './props';

export type { NavigatorProps };

export default createHostComponent<NavigatorProps>('navigator');
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Navigator/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { history } from '@remax/router/web';
import { NavigatorProps } from './props';
import { filterProps } from '../../utils/isPlatformSpecifyProp';

export type { NavigatorProps };

const Navigator: React.FC<NavigatorProps> = props => {
const { className, url, action, hoverClassName, hoverStartTime, hoverStayTime, ...restProps } = filterProps(props);

Expand Down
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Text/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import createHostComponent from '../../createHostComponent';
import TextProps from './props';

export type { TextProps };

const Text = createHostComponent<TextProps>('text');

export default Text;
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Text/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import clsx from 'clsx';
import { TextWebProps } from './props';
import { filterProps } from '../../utils/isPlatformSpecifyProp';

export type TextProps = TextWebProps;

const Text: React.FC<TextWebProps> = props => {
const {
onTap,
Expand Down
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Textarea/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { InputEvent } from '../../types';
import { createCallback, createInputEvent } from '../../createHostComponent';
import { TextareaProps } from './props';

export type { TextareaProps };

export interface TextareaState {
value?: string;
controlled: boolean;
Expand Down
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/Textarea/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import useWebPlaceholderStyle from '../../useWebPlaceholderStyle';
import { filterProps } from '../../utils/isPlatformSpecifyProp';
import clsx from 'clsx';

export type TextareaProps = TextareaWebProps;

const Textarea: React.FC<TextareaWebProps> = props => {
const { onConfirm, onKeyPress, autoHeight, className, placeholderStyle, ...restProps } = filterProps(props);
const [placeholderStyleClassName] = useWebPlaceholderStyle(placeholderStyle);
Expand Down
3 changes: 2 additions & 1 deletion packages/remax-one/src/hostComponents/View/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable @typescript-eslint/camelcase */
import createHostComponent from '../../createHostComponent';
import ViewProps from './props';

export type { ViewProps };

const View = createHostComponent<ViewProps>('view');

export default View;
2 changes: 2 additions & 0 deletions packages/remax-one/src/hostComponents/View/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { ViewWebProps } from './props';
import { filterProps } from '../../utils/isPlatformSpecifyProp';
import useWebTouch from '../useWebTouch';

export type ViewProps = ViewWebProps;

const View: React.FC<ViewWebProps> = props => {
const {
hoverClassName,
Expand Down

0 comments on commit 482ec49

Please sign in to comment.