Skip to content

Commit

Permalink
add lib
Browse files Browse the repository at this point in the history
  • Loading branch information
cangshudada committed Mar 2, 2021
1 parent ebfd207 commit c956161
Show file tree
Hide file tree
Showing 38 changed files with 48,434 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,3 @@
.DS_Store
node_modules
.cache
dist
10 changes: 10 additions & 0 deletions dist/components/default/index.d.ts
@@ -0,0 +1,10 @@
import './default.less';
import React from 'react';
import { IKeyCode } from '../..';
export interface IProps {
change: (value: string) => void;
trigger: (parmas: IKeyCode) => void;
translate: (value: string) => void;
}
declare const _default: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
export default _default;
7 changes: 7 additions & 0 deletions dist/components/dragHandleBar/dragHandle.d.ts
@@ -0,0 +1,7 @@
import React from 'react';
export interface IProps {
color?: string;
dargHandleText?: string;
}
declare const DragHandle: React.FC<IProps>;
export default DragHandle;
6 changes: 6 additions & 0 deletions dist/components/handWrite/handPaintBoard.d.ts
@@ -0,0 +1,6 @@
import React from 'react';
export interface IProps {
lib: 'CN' | 'EN';
}
declare const HandBoard: React.FC<IProps>;
export default HandBoard;
8 changes: 8 additions & 0 deletions dist/components/handWrite/index.d.ts
@@ -0,0 +1,8 @@
import './handwrite.less';
import { IKeyCode } from '../..';
import React from 'react';
export interface Iprops {
trigger?: (parmas: IKeyCode) => void;
}
declare const HandBoard: React.FC<Iprops>;
export default HandBoard;
14 changes: 14 additions & 0 deletions dist/components/keyCodeButton/index.d.ts
@@ -0,0 +1,14 @@
import './keyCodeButton.less';
import React from 'react';
import { IKeyCode } from '../../index';
export interface IProps {
type: string;
data: string;
isCn?: boolean;
isNum?: boolean;
isUpper?: boolean;
isSymbol?: boolean;
click?: (parmas: IKeyCode) => void;
}
declare const KeyCodeButton: React.FC<IProps>;
export default KeyCodeButton;
9 changes: 9 additions & 0 deletions dist/components/result/index.d.ts
@@ -0,0 +1,9 @@
import './result.less';
import { IValue } from '../..';
import React from 'react';
export interface IProps {
resultVal: IValue;
change?: (word: string) => void;
}
declare const Result: React.FC<IProps>;
export default Result;
15 changes: 15 additions & 0 deletions dist/constants/key_code.d.ts
@@ -0,0 +1,15 @@
export declare const SYMBOL_CODE: {
line1: string[];
line2: string[];
line3: string[];
};
export declare const DEFAULT_CODE: {
line1: string[];
line2: string[];
line3: string[];
};
export declare const NUMBER_CODE: {
line1: string[];
line2: string[];
line3: string[];
};
5 changes: 5 additions & 0 deletions dist/constants/pinyin_dict_note.d.ts
@@ -0,0 +1,5 @@
import { IDictionary } from "../";
/**
* 收录常用汉字6763个,不支持声调,支持多音字,并按照汉字使用频率由低到高排序
*/
export declare const pinYinNote: IDictionary<string>;
5 changes: 5 additions & 0 deletions dist/helper/axiosConfig.d.ts
@@ -0,0 +1,5 @@
/**
* @description axiso 配置
* @param {string} url
*/
export declare const axiosConfig: (url: string) => void;
6 changes: 6 additions & 0 deletions dist/hooks/useDeepCopy.d.ts
@@ -0,0 +1,6 @@
/**
* @description 深拷贝数组或者对象
* @param {T} target
* @returns
*/
export default function useDeepCopy<T extends unknown>(sourceData: T): T;
5 changes: 5 additions & 0 deletions dist/hooks/useDrag.d.ts
@@ -0,0 +1,5 @@
/**
* @description 句柄拖拽事件
* @param {HTMLElement} target
*/
export default function handleDragEvent(target: HTMLElement): void;
9 changes: 9 additions & 0 deletions dist/hooks/useEventEmitter.d.ts
@@ -0,0 +1,9 @@
declare class EventEmitter {
private listeners;
constructor();
on(type: string, cb: (...args: any[]) => void): () => void;
emit(type: string, ...args: any[]): void;
remove(type: string, cb?: (...args: any[]) => void): void;
}
declare const _default: EventEmitter;
export default _default;
3 changes: 3 additions & 0 deletions dist/icons/back.d.ts
@@ -0,0 +1,3 @@
import * as React from 'react';
declare function SvgBack(props: React.SVGProps<SVGSVGElement>): JSX.Element;
export default SvgBack;
3 changes: 3 additions & 0 deletions dist/icons/close.d.ts
@@ -0,0 +1,3 @@
import * as React from 'react';
declare function SvgClose(props: React.SVGProps<SVGSVGElement>): JSX.Element;
export default SvgClose;
3 changes: 3 additions & 0 deletions dist/icons/delete.d.ts
@@ -0,0 +1,3 @@
import * as React from 'react';
declare function SvgDelete(props: React.SVGProps<SVGSVGElement>): JSX.Element;
export default SvgDelete;
3 changes: 3 additions & 0 deletions dist/icons/drag.d.ts
@@ -0,0 +1,3 @@
import * as React from 'react';
declare function SvgDrag(props: React.SVGProps<SVGSVGElement>): JSX.Element;
export default SvgDrag;
3 changes: 3 additions & 0 deletions dist/icons/handwrite.d.ts
@@ -0,0 +1,3 @@
import * as React from 'react';
declare function SvgHandwrite(props: React.SVGProps<SVGSVGElement>): JSX.Element;
export default SvgHandwrite;
3 changes: 3 additions & 0 deletions dist/icons/upper.d.ts
@@ -0,0 +1,3 @@
import * as React from 'react';
declare function SvgUpper(props: React.SVGProps<SVGSVGElement>): JSX.Element;
export default SvgUpper;
53 changes: 53 additions & 0 deletions dist/index.d.ts
@@ -0,0 +1,53 @@
import './libs/flexible.js';
import './assets/css/_BASE_.less';
import React from 'react';
export interface IDictionary<T> {
[key: string]: T;
}
export declare type IKeyCode = Record<'data' | 'type', string>;
export declare type IValue = {
code?: string;
value?: string;
};
export interface IOptions {
/** value auto change */
autoChange?: boolean;
/** theme color - support rgb or hex - default("#eaa050") */
color?: string;
/** mode list - support symbol or handwrite keyboard - default(["handwrite", "symbol"]) */
modeList?: ('handwrite' | 'symbol')[];
/** is blur status hide - default(true) */
blurHide?: boolean;
/** Whether to show the drag handle - default(true) */
showHandleBar?: boolean;
/** handwrite interface */
handApi?: string;
/** transition className */
animateClass?: string;
/** transition time */
transitionTime?: number;
/** darg Handle text */
dargHandleText?: string;
/** modal exist status */
modal?: boolean;
/** modal can hide when click modal */
closeOnClickModal?: boolean;
/** key change */
keyChange?: (value: string) => void;
/** value change */
onChange?: (value: string) => void;
/** keyboard close hook */
closed?: () => void;
/** keyboard modal click hook */
modalClick?: () => void;
}
export declare const KeyBoardContext: React.Context<{
color: string;
modeList: ('handwrite' | 'symbol')[];
handApi?: string | undefined;
transitionTime: number;
closeKeyBoard: () => void;
changeDefaultBoard: () => void;
}>;
declare const KeyBoard: React.FC<IOptions>;
export default KeyBoard;
8 changes: 8 additions & 0 deletions dist/index.js
@@ -0,0 +1,8 @@

'use strict'

if (process.env.NODE_ENV === 'production') {
module.exports = require('./react-keyboard.cjs.production.min.js')
} else {
module.exports = require('./react-keyboard.cjs.development.js')
}
5 changes: 5 additions & 0 deletions dist/keyboard.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c956161

Please sign in to comment.