This commit is contained in:
lingdocs 2021-11-03 17:57:13 -04:00
parent 9cfbfa3e09
commit 1e4d5b5618
4 changed files with 14 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@lingdocs/pashto-inflector",
"version": "1.4.0",
"version": "1.4.1",
"author": "lingdocs.com",
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
"homepage": "https://verbs.lingdocs.com",

View File

@ -263,9 +263,7 @@ function App() {
{ label: "irregular", value: "irregular" },
]}
value={regularIrregular}
handleChange={(p) => {
setRegularIrregular(p as "regular" | "irregular");
}}
handleChange={setRegularIrregular}
/>
</div>
}
@ -313,7 +311,7 @@ function App() {
handleChange={(p) => {
setTextOptions({
...textOptions,
spelling: p as T.Spelling,
spelling: p,
});
}}
/>
@ -334,7 +332,7 @@ function App() {
{ label: "X-Large", value: "largest" },
]}
value={textOptions.pTextSize}
handleChange={(p) => setTextOptions({ ...textOptions, pTextSize: p as "normal" | "larger" | "largest" })}
handleChange={(p) => setTextOptions({ ...textOptions, pTextSize: p })}
/>
<h6 className="mt-3">Phonetics</h6>
<ButtonSelect
@ -345,7 +343,7 @@ function App() {
{ label: "None", value: "none" },
]}
value={textOptions.phonetics}
handleChange={(p) => setTextOptions({ ...textOptions, phonetics: p as "lingdocs" | "ipa" | "none" | "alalc" })}
handleChange={(p) => setTextOptions({ ...textOptions, phonetics: p })}
/>
</Modal.Body>
<Modal.Footer>

View File

@ -8,15 +8,15 @@
import classNames from "classnames";
type PickerProps = {
options: { label: any, value: string, color?: string }[],
value: string,
handleChange: (payload: string) => void,
type PickerProps<T extends string> = {
options: { label: any, value: T, color?: string }[],
value: T,
handleChange: (payload: T) => void,
small?: boolean,
xSmall?: boolean,
}
function ButtonSelect(props: PickerProps) {
function ButtonSelect<L extends string>(props: PickerProps<L>) {
return (
<div className="d-inline-flex flex-row justify-content-center">
<div className="btn-group">

View File

@ -248,7 +248,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight
},
]}
value={state.transitivitySelected}
handleChange={(p) => dispatch({ type: "setTransitivitySelected", payload: p as "transitive" | "grammatically transitive" })}
handleChange={(p) => dispatch({ type: "setTransitivitySelected", payload: p })}
/>
</div>
</div>}
@ -264,7 +264,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight
},
]}
value={state.compoundTypeSelected}
handleChange={(p) => dispatch({ type: "choose compound type", payload: p as "dynamic" | "stative" })}
handleChange={(p) => dispatch({ type: "choose compound type", payload: p })}
/>
</div>
</div>}
@ -280,7 +280,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight
{ label: `Plur. ${verbConj1.info.objComplement.plural.p}`, value: "plur" },
]}
value={state.compoundComplementVersionSelected}
handleChange={(p) => dispatch({ type: "set compound complement version", payload: p as "sing" | "plur" })}
handleChange={(p) => dispatch({ type: "set compound complement version", payload: p })}
/>
</div>
</div>}
@ -301,7 +301,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight
{ label: `Sentences`, value: "sentence" },
]}
value={state.mode}
handleChange={(p) => dispatch({ type: "setMode", payload: p as "chart" | "sentence" })}
handleChange={(p) => dispatch({ type: "setMode", payload: p })}
/>
</div>}
{!limitTo && <>