@khanacademy/math-input 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/components/input/math-wrapper.d.ts +1 -1
- package/dist/components/input/math-wrapper.js.flow +1 -1
- package/dist/components/input/mathquill-instance.d.ts +14 -3
- package/dist/components/input/mathquill-instance.js.flow +18 -3
- package/dist/components/input/mathquill-types.d.ts +28 -6
- package/dist/components/input/mathquill-types.js.flow +31 -7
- package/dist/components/key-handlers/handle-arrow.d.ts +3 -0
- package/dist/components/{input/key-handlers → key-handlers}/handle-arrow.js.flow +2 -2
- package/dist/components/{input/key-handlers → key-handlers}/handle-backspace.d.ts +1 -1
- package/dist/components/{input/key-handlers → key-handlers}/handle-backspace.js.flow +1 -1
- package/dist/components/key-handlers/handle-exponent.d.ts +3 -0
- package/dist/components/{input/key-handlers → key-handlers}/handle-exponent.js.flow +2 -2
- package/dist/components/{input/key-handlers → key-handlers}/handle-jump-out.d.ts +2 -2
- package/dist/components/{input/key-handlers → key-handlers}/handle-jump-out.js.flow +2 -2
- package/dist/components/key-handlers/key-translator.d.ts +4 -0
- package/dist/components/{key-translator.js.flow → key-handlers/key-translator.js.flow} +3 -3
- package/dist/components/keypad/geometry-page/index.d.ts +2 -1
- package/dist/components/keypad/geometry-page/index.js.flow +2 -1
- package/dist/components/keypad/index.d.ts +2 -1
- package/dist/components/keypad/index.js.flow +2 -1
- package/dist/components/keypad/keypad-page-items.d.ts +8 -16
- package/dist/components/keypad/keypad-page-items.js.flow +11 -16
- package/dist/components/keypad/numbers-page/index.d.ts +2 -1
- package/dist/components/keypad/numbers-page/index.js.flow +2 -1
- package/dist/components/keypad/operators-page/advanced-relations-buttons.d.ts +2 -1
- package/dist/components/keypad/operators-page/advanced-relations-buttons.js.flow +2 -1
- package/dist/components/keypad/operators-page/basic-relations-buttons.d.ts +2 -1
- package/dist/components/keypad/operators-page/basic-relations-buttons.js.flow +2 -1
- package/dist/components/keypad/operators-page/index.d.ts +2 -1
- package/dist/components/keypad/operators-page/index.js.flow +2 -1
- package/dist/components/keypad/operators-page/logarithms-buttons.d.ts +2 -1
- package/dist/components/keypad/operators-page/logarithms-buttons.js.flow +2 -1
- package/dist/components/keypad/operators-page/pre-algebra-buttons.d.ts +2 -1
- package/dist/components/keypad/operators-page/pre-algebra-buttons.js.flow +2 -1
- package/dist/es/index.js +395 -366
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +398 -367
- package/dist/index.js.flow +6 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.js.flow +1 -0
- package/package.json +1 -1
- package/src/components/input/math-input.tsx +10 -14
- package/src/components/input/math-wrapper.ts +23 -49
- package/src/components/input/mathquill-helpers.ts +11 -11
- package/src/components/input/mathquill-instance.ts +57 -2
- package/src/components/input/mathquill-types.ts +37 -7
- package/src/components/{input/key-handlers → key-handlers}/handle-arrow.ts +6 -6
- package/src/components/{input/key-handlers → key-handlers}/handle-backspace.ts +19 -17
- package/src/components/{input/key-handlers → key-handlers}/handle-exponent.ts +8 -5
- package/src/components/{input/key-handlers → key-handlers}/handle-jump-out.ts +15 -10
- package/src/components/{key-translator.ts → key-handlers/key-translator.ts} +43 -28
- package/src/components/keypad/__tests__/Button.test.tsx +51 -0
- package/src/components/keypad/__tests__/keypad-button.test.tsx +41 -0
- package/src/components/keypad/__tests__/keypad-v2-mathquill.test.tsx +231 -0
- package/src/components/keypad/__tests__/keypad-v2.cypress.ts +46 -0
- package/src/components/keypad/geometry-page/index.tsx +2 -1
- package/src/components/keypad/index.tsx +2 -1
- package/src/components/keypad/keypad-mathquill.stories.tsx +15 -23
- package/src/components/keypad/keypad-page-items.tsx +10 -19
- package/src/components/keypad/numbers-page/index.tsx +2 -1
- package/src/components/keypad/operators-page/advanced-relations-buttons.tsx +2 -1
- package/src/components/keypad/operators-page/basic-relations-buttons.tsx +2 -1
- package/src/components/keypad/operators-page/index.tsx +2 -1
- package/src/components/keypad/operators-page/logarithms-buttons.tsx +2 -1
- package/src/components/keypad/operators-page/pre-algebra-buttons.tsx +2 -1
- package/src/index.ts +6 -1
- package/src/types.ts +2 -0
- package/tsconfig-build.json +1 -2
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/components/input/__tests__/test-math-wrapper.d.ts +0 -8
- package/dist/components/input/__tests__/test-math-wrapper.js.flow +0 -14
- package/dist/components/input/key-handlers/handle-arrow.d.ts +0 -3
- package/dist/components/input/key-handlers/handle-exponent.d.ts +0 -3
- package/dist/components/key-translator.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @khanacademy/math-input
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d497118e: MathInput exports tools for generating MathFields, replacing the need for direct MathQuill access
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- e7d21b67: Add keypress logic from MathInput to key translator
|
|
12
|
+
- eceb4510: Updated aria-labels to be more descriptive and tests that used aria-labels.
|
|
13
|
+
|
|
14
|
+
## 4.1.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 31ed8380: Add math-input v2 keypad tests
|
|
19
|
+
- 937d2308: Added basic Cypress testing for the v2 math-input keypad
|
|
20
|
+
|
|
3
21
|
## 4.1.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -9,7 +9,7 @@ import { MathFieldInterface, MathFieldCursor } from "./mathquill-types";
|
|
|
9
9
|
declare class MathWrapper {
|
|
10
10
|
mathField: MathFieldInterface;
|
|
11
11
|
callbacks: any;
|
|
12
|
-
constructor(element: any,
|
|
12
|
+
constructor(element: any, callbacks?: {});
|
|
13
13
|
focus(): void;
|
|
14
14
|
blur(): void;
|
|
15
15
|
/**
|
|
@@ -17,7 +17,7 @@ import { MathFieldInterface, MathFieldCursor } from "./mathquill-types";
|
|
|
17
17
|
declare class MathWrapper {
|
|
18
18
|
mathField: MathFieldInterface;
|
|
19
19
|
callbacks: any;
|
|
20
|
-
constructor(element: any,
|
|
20
|
+
constructor(element: any, callbacks?: {||}): this;
|
|
21
21
|
focus(): void;
|
|
22
22
|
blur(): void;
|
|
23
23
|
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import { MathQuillInterface } from "./mathquill-types";
|
|
2
|
-
declare const
|
|
3
|
-
|
|
1
|
+
import { MathQuillInterface, MathFieldConfig } from "./mathquill-types";
|
|
2
|
+
export declare const mathQuillInstance: MathQuillInterface;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new [MathField](http://docs.mathquill.com/en/latest/Api_Methods/#mqmathfieldhtml_element-config)
|
|
5
|
+
* instance within the given `container`.
|
|
6
|
+
*
|
|
7
|
+
* An optional configuration callback can be provided to customize
|
|
8
|
+
* the created MathField. A default configuration is passed to this
|
|
9
|
+
* callback which can then be adjusted as needed. The configuration
|
|
10
|
+
* returned from this callback is used to create the MathField.
|
|
11
|
+
* This allows callers to do minimal configuration as only configs
|
|
12
|
+
* that vary from the default need to be provided.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createMathField(container: HTMLDivElement | HTMLSpanElement, configCallback?: (baseConfig: MathFieldConfig) => MathFieldConfig): import("./mathquill-types").MathFieldInterface;
|
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
declare export
|
|
7
|
+
import * as $Flowgen$Import$_2e__2f_mathquill_2d_types from "./mathquill-types";
|
|
8
|
+
import { MathQuillInterface, MathFieldConfig } from "./mathquill-types";
|
|
9
|
+
declare export var mathQuillInstance: MathQuillInterface;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new [MathField](http://docs.mathquill.com/en/latest/Api_Methods/#mqmathfieldhtml_element-config)
|
|
12
|
+
* instance within the given `container`.
|
|
13
|
+
*
|
|
14
|
+
* An optional configuration callback can be provided to customize
|
|
15
|
+
* the created MathField. A default configuration is passed to this
|
|
16
|
+
* callback which can then be adjusted as needed. The configuration
|
|
17
|
+
* returned from this callback is used to create the MathField.
|
|
18
|
+
* This allows callers to do minimal configuration as only configs
|
|
19
|
+
* that vary from the default need to be provided.
|
|
20
|
+
*/
|
|
21
|
+
declare export function createMathField(
|
|
22
|
+
container: HTMLDivElement | HTMLSpanElement,
|
|
23
|
+
configCallback?: (baseConfig: MathFieldConfig) => MathFieldConfig
|
|
24
|
+
): $Flowgen$Import$_2e__2f_mathquill_2d_types.MathFieldInterface;
|
|
@@ -2,13 +2,34 @@ import Key from "../../data/keys";
|
|
|
2
2
|
export interface MathQuillInterface {
|
|
3
3
|
L: "L";
|
|
4
4
|
R: "R";
|
|
5
|
-
MathField: (mount: HTMLDivElement,
|
|
5
|
+
MathField: (mount: HTMLDivElement | HTMLSpanElement, config: MathFieldConfig) => MathFieldInterface;
|
|
6
6
|
}
|
|
7
|
+
type MathQuillDir = "L" | "R";
|
|
8
|
+
export type MathFieldConfig = {
|
|
9
|
+
spaceBehavesLikeTab?: boolean;
|
|
10
|
+
leftRightIntoCmdGoes?: string;
|
|
11
|
+
restrictMismatchedBrackets?: boolean;
|
|
12
|
+
sumStartsWithNEquals?: boolean;
|
|
13
|
+
supSubsRequireOperand?: boolean;
|
|
14
|
+
charsThatBreakOutOfSupSub?: string;
|
|
15
|
+
autoSubscriptNumerals?: boolean;
|
|
16
|
+
autoCommands?: string;
|
|
17
|
+
autoOperatorNames?: string;
|
|
18
|
+
maxDepth?: number;
|
|
19
|
+
substituteTextarea?: () => HTMLElement;
|
|
20
|
+
handlers?: {
|
|
21
|
+
edit?: (mathField: MathFieldInterface) => void;
|
|
22
|
+
upOutOf?: (mathField: MathFieldInterface) => void;
|
|
23
|
+
moveOutOf?: (dir: MathQuillDir, mathField: MathFieldInterface) => void;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
7
26
|
export interface MathFieldInterface {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
27
|
+
focus: () => MathFieldInterface;
|
|
28
|
+
blur: () => MathFieldInterface;
|
|
29
|
+
write: (input: string) => MathFieldInterface;
|
|
30
|
+
cmd: (input: string) => MathFieldInterface;
|
|
31
|
+
keystroke: (input: string) => MathFieldInterface;
|
|
32
|
+
typedText: (input: string) => MathFieldInterface;
|
|
12
33
|
latex: (input?: string) => string;
|
|
13
34
|
moveToDirEnd: (direction: "L" | "R") => void;
|
|
14
35
|
select: () => void;
|
|
@@ -22,4 +43,5 @@ export declare enum MathFieldActionType {
|
|
|
22
43
|
MQ_END = 0
|
|
23
44
|
}
|
|
24
45
|
export type MathFieldCursor = any;
|
|
25
|
-
export type
|
|
46
|
+
export type MathFieldUpdaterCallback = (mathField: MathFieldInterface, key: Key) => void;
|
|
47
|
+
export {};
|
|
@@ -8,13 +8,37 @@ import Key from "../../data/keys";
|
|
|
8
8
|
export interface MathQuillInterface {
|
|
9
9
|
L: "L";
|
|
10
10
|
R: "R";
|
|
11
|
-
MathField: (
|
|
11
|
+
MathField: (
|
|
12
|
+
mount: HTMLDivElement | HTMLSpanElement,
|
|
13
|
+
config: MathFieldConfig
|
|
14
|
+
) => MathFieldInterface;
|
|
12
15
|
}
|
|
16
|
+
declare type MathQuillDir = "L" | "R";
|
|
17
|
+
export type MathFieldConfig = {|
|
|
18
|
+
spaceBehavesLikeTab?: boolean,
|
|
19
|
+
leftRightIntoCmdGoes?: string,
|
|
20
|
+
restrictMismatchedBrackets?: boolean,
|
|
21
|
+
sumStartsWithNEquals?: boolean,
|
|
22
|
+
supSubsRequireOperand?: boolean,
|
|
23
|
+
charsThatBreakOutOfSupSub?: string,
|
|
24
|
+
autoSubscriptNumerals?: boolean,
|
|
25
|
+
autoCommands?: string,
|
|
26
|
+
autoOperatorNames?: string,
|
|
27
|
+
maxDepth?: number,
|
|
28
|
+
substituteTextarea?: () => HTMLElement,
|
|
29
|
+
handlers?: {|
|
|
30
|
+
edit?: (mathField: MathFieldInterface) => void,
|
|
31
|
+
upOutOf?: (mathField: MathFieldInterface) => void,
|
|
32
|
+
moveOutOf?: (dir: MathQuillDir, mathField: MathFieldInterface) => void,
|
|
33
|
+
|},
|
|
34
|
+
|};
|
|
13
35
|
export interface MathFieldInterface {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
36
|
+
focus: () => MathFieldInterface;
|
|
37
|
+
blur: () => MathFieldInterface;
|
|
38
|
+
write: (input: string) => MathFieldInterface;
|
|
39
|
+
cmd: (input: string) => MathFieldInterface;
|
|
40
|
+
keystroke: (input: string) => MathFieldInterface;
|
|
41
|
+
typedText: (input: string) => MathFieldInterface;
|
|
18
42
|
latex: (input?: string) => string;
|
|
19
43
|
moveToDirEnd: (direction: "L" | "R") => void;
|
|
20
44
|
select: () => void;
|
|
@@ -28,7 +52,7 @@ declare export var MathFieldActionType: {|
|
|
|
28
52
|
+MQ_END: 0, // 0
|
|
29
53
|
|};
|
|
30
54
|
export type MathFieldCursor = any;
|
|
31
|
-
export type
|
|
32
|
-
|
|
55
|
+
export type MathFieldUpdaterCallback = (
|
|
56
|
+
mathField: MathFieldInterface,
|
|
33
57
|
key: Key
|
|
34
58
|
) => void;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import Key from "
|
|
8
|
-
import { MathFieldInterface } from "../mathquill-types";
|
|
7
|
+
import Key from "../../data/keys";
|
|
8
|
+
import { MathFieldInterface } from "../input/mathquill-types";
|
|
9
9
|
declare export default function handleArrow(
|
|
10
10
|
mathField: MathFieldInterface,
|
|
11
11
|
key: Key
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import Key from "
|
|
8
|
-
import { MathFieldInterface } from "../mathquill-types";
|
|
7
|
+
import Key from "../../data/keys";
|
|
8
|
+
import { MathFieldInterface } from "../input/mathquill-types";
|
|
9
9
|
declare export default function handleExponent(
|
|
10
10
|
mathField: MathFieldInterface,
|
|
11
11
|
key: Key
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import Key from "
|
|
8
|
-
import { MathFieldInterface } from "../mathquill-types";
|
|
7
|
+
import Key from "../../data/keys";
|
|
8
|
+
import { MathFieldInterface } from "../input/mathquill-types";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Advances the cursor to the next logical position.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import Key from "
|
|
8
|
-
import {
|
|
9
|
-
declare var keyToMathquillMap: { [key: Key]:
|
|
7
|
+
import Key from "../../data/keys";
|
|
8
|
+
import { MathFieldUpdaterCallback } from "../input/mathquill-types";
|
|
9
|
+
declare var keyToMathquillMap: { [key: Key]: MathFieldUpdaterCallback };
|
|
10
10
|
declare export default typeof keyToMathquillMap;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
};
|
|
5
6
|
export default class GeometryPage extends React.Component<Props> {
|
|
6
7
|
render(): React.ReactNode;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
|};
|
|
11
12
|
declare export default class GeometryPage extends React.Component<Props> {
|
|
12
13
|
render(): React.Node;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import Key from "../../data/keys";
|
|
3
|
+
import { ClickKeyCallback } from "../../types";
|
|
3
4
|
import { TabbarItemType } from "../tabbar/types";
|
|
4
5
|
import { NumbersPageOptions } from "./numbers-page/types";
|
|
5
6
|
import { OperatorsButtonSets } from "./operators-page/types";
|
|
6
7
|
export type Props = {
|
|
7
|
-
onClickKey:
|
|
8
|
+
onClickKey: ClickKeyCallback;
|
|
8
9
|
trigonometry?: boolean;
|
|
9
10
|
extraKeys: ReadonlyArray<Key>;
|
|
10
11
|
} & OperatorsButtonSets & NumbersPageOptions;
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import Key from "../../data/keys";
|
|
9
|
+
import { ClickKeyCallback } from "../../types";
|
|
9
10
|
import { TabbarItemType } from "../tabbar/types";
|
|
10
11
|
import { NumbersPageOptions } from "./numbers-page/types";
|
|
11
12
|
import { OperatorsButtonSets } from "./operators-page/types";
|
|
12
13
|
export type Props = {|
|
|
13
14
|
...{|
|
|
14
|
-
onClickKey:
|
|
15
|
+
onClickKey: ClickKeyCallback,
|
|
15
16
|
trigonometry?: boolean,
|
|
16
17
|
extraKeys: $ReadOnlyArray<Key>,
|
|
17
18
|
|},
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { KeyConfig } from "../../types";
|
|
2
|
+
import { KeyConfig, ClickKeyCallback } from "../../types";
|
|
3
3
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
4
4
|
type KeypadPageContainerProps = {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
};
|
|
7
7
|
export declare const KeypadPageContainer: ({ children, }: KeypadPageContainerProps) => React.ReactElement;
|
|
8
|
-
|
|
9
|
-
keyConfig: KeyConfig;
|
|
10
|
-
tintColor?: string;
|
|
11
|
-
style?: StyleType;
|
|
12
|
-
onClickKey: (keyConfig: string) => void;
|
|
13
|
-
};
|
|
14
|
-
export declare const KeypadButton: ({ keyConfig, onClickKey, tintColor, style, }: KeypadButtonProps) => React.ReactElement;
|
|
15
|
-
type SecondaryKeypadButtonProps = {
|
|
8
|
+
type SharedButtonProps = {
|
|
16
9
|
keyConfig: KeyConfig;
|
|
17
10
|
style?: StyleType;
|
|
18
|
-
onClickKey:
|
|
11
|
+
onClickKey: ClickKeyCallback;
|
|
19
12
|
};
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
keyConfig: KeyConfig;
|
|
23
|
-
style?: StyleType;
|
|
24
|
-
onClickKey: (keyConfig: string) => void;
|
|
13
|
+
export type KeypadButtonProps = SharedButtonProps & {
|
|
14
|
+
tintColor?: string;
|
|
25
15
|
};
|
|
26
|
-
export declare const
|
|
16
|
+
export declare const KeypadButton: ({ keyConfig, onClickKey, tintColor, style, }: KeypadButtonProps) => React.ReactElement;
|
|
17
|
+
export declare const SecondaryKeypadButton: ({ keyConfig, onClickKey, style, }: SharedButtonProps) => React.ReactElement;
|
|
18
|
+
export declare const KeypadActionButton: ({ keyConfig, onClickKey, style, }: SharedButtonProps) => React.ReactElement;
|
|
27
19
|
/**
|
|
28
20
|
* A placeholder button for the keypad. Optional count prop to render multiple
|
|
29
21
|
* buttons. Defaults to 1.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
-
import { KeyConfig } from "../../types";
|
|
8
|
+
import { KeyConfig, ClickKeyCallback } from "../../types";
|
|
9
9
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
10
10
|
declare type KeypadPageContainerProps = {|
|
|
11
11
|
children: React.Node,
|
|
@@ -13,28 +13,23 @@ declare type KeypadPageContainerProps = {|
|
|
|
13
13
|
declare export var KeypadPageContainer: (
|
|
14
14
|
x: KeypadPageContainerProps
|
|
15
15
|
) => React.Element<any>;
|
|
16
|
-
|
|
16
|
+
declare type SharedButtonProps = {|
|
|
17
17
|
keyConfig: KeyConfig,
|
|
18
|
-
tintColor?: string,
|
|
19
18
|
style?: StyleType,
|
|
20
|
-
onClickKey:
|
|
19
|
+
onClickKey: ClickKeyCallback,
|
|
21
20
|
|};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
export type KeypadButtonProps = {|
|
|
22
|
+
...SharedButtonProps,
|
|
23
|
+
...{|
|
|
24
|
+
tintColor?: string,
|
|
25
|
+
|},
|
|
27
26
|
|};
|
|
27
|
+
declare export var KeypadButton: (x: KeypadButtonProps) => React.Element<any>;
|
|
28
28
|
declare export var SecondaryKeypadButton: (
|
|
29
|
-
x:
|
|
29
|
+
x: SharedButtonProps
|
|
30
30
|
) => React.Element<any>;
|
|
31
|
-
declare type KeypadActionButtonProps = {|
|
|
32
|
-
keyConfig: KeyConfig,
|
|
33
|
-
style?: StyleType,
|
|
34
|
-
onClickKey: (keyConfig: string) => void,
|
|
35
|
-
|};
|
|
36
31
|
declare export var KeypadActionButton: (
|
|
37
|
-
x:
|
|
32
|
+
x: SharedButtonProps
|
|
38
33
|
) => React.Element<any>;
|
|
39
34
|
/**
|
|
40
35
|
* A placeholder button for the keypad. Optional count prop to render multiple
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
import { NumbersPageOptions } from "./types";
|
|
3
4
|
type Props = {
|
|
4
|
-
onClickKey:
|
|
5
|
+
onClickKey: ClickKeyCallback;
|
|
5
6
|
} & NumbersPageOptions;
|
|
6
7
|
export default class NumbersPage extends React.Component<Props> {
|
|
7
8
|
render(): React.ReactNode;
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
import { NumbersPageOptions } from "./types";
|
|
9
10
|
declare type Props = {|
|
|
10
11
|
...{|
|
|
11
|
-
onClickKey:
|
|
12
|
+
onClickKey: ClickKeyCallback,
|
|
12
13
|
|},
|
|
13
14
|
...NumbersPageOptions,
|
|
14
15
|
|};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
placeholder?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const AdvancedRelations: ({ onClickKey, placeholder, }: Props) => React.ReactElement;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
placeholder?: boolean,
|
|
11
12
|
|};
|
|
12
13
|
declare export var AdvancedRelations: (x: Props) => React.ReactElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
placeholder?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const BasicRelations: ({ onClickKey, placeholder, }: Props) => React.ReactElement;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
placeholder?: boolean,
|
|
11
12
|
|};
|
|
12
13
|
declare export var BasicRelations: (x: Props) => React.ReactElement;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
import { OperatorsButtonSets } from "./types";
|
|
3
4
|
type Props = {
|
|
4
|
-
onClickKey:
|
|
5
|
+
onClickKey: ClickKeyCallback;
|
|
5
6
|
} & OperatorsButtonSets;
|
|
6
7
|
export default class OperatorsPage extends React.Component<Props> {
|
|
7
8
|
render(): React.ReactNode;
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
import { OperatorsButtonSets } from "./types";
|
|
9
10
|
declare type Props = {|
|
|
10
11
|
...{|
|
|
11
|
-
onClickKey:
|
|
12
|
+
onClickKey: ClickKeyCallback,
|
|
12
13
|
|},
|
|
13
14
|
...OperatorsButtonSets,
|
|
14
15
|
|};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
placeholder?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const Logarithms: ({ onClickKey, placeholder, }: Props) => React.ReactElement;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
placeholder?: boolean,
|
|
11
12
|
|};
|
|
12
13
|
declare export var Logarithms: (x: Props) => React.ReactElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
placeholder?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const PreAlgebra: ({ onClickKey, placeholder, }: Props) => React.ReactElement;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
placeholder?: boolean,
|
|
11
12
|
|};
|
|
12
13
|
declare export var PreAlgebra: (x: Props) => React.ReactElement;
|