-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update jest, svelte-jest, ts-jest. Install svelte2tsx for better it's…
… type defintions. Moves types from component module to ts files. Reasoning: Unit tests fail when types are imported in a ts file from a component directly. See sveltejs/svelte#5817.
- Loading branch information
Showing
25 changed files
with
3,228 additions
and
1,150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 1 addition & 10 deletions
11
mathesar_ui/src/component-library/common/base-components/BaseInput.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
mathesar_ui/src/component-library/common/base-components/BaseInputTypes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { LabelController } from '@mathesar-component-library-dir/label/LabelController'; | ||
|
||
export interface BaseInputProps { | ||
id?: string; | ||
labelController?: LabelController; | ||
disabled?: boolean; | ||
focusOnMount?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export type Appearance = | ||
| 'default' | ||
| 'primary' | ||
| 'secondary' | ||
| 'plain' | ||
| 'ghost'; | ||
|
||
export type Size = 'small' | 'medium' | 'large'; | ||
|
||
type InputProps = svelte.JSX.HTMLAttributes<HTMLInputElement>; | ||
export type SimplifiedInputProps = Omit< | ||
InputProps, | ||
'disabled' | 'id' | 'class' | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 1 addition & 13 deletions
14
mathesar_ui/src/component-library/formatted-input/FormattedInput.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
mathesar_ui/src/component-library/number-input/NumberInputTypes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { FormattedInputProps } from '@mathesar-component-library-dir/formatted-input/FormattedInputTypes'; | ||
import type { NumberFormatterOptions } from './number-formatter/types'; | ||
|
||
export interface NumberInputProps extends Partial<NumberFormatterOptions> { | ||
value?: number; | ||
element?: HTMLInputElement; | ||
} | ||
|
||
export interface StringifiedNumberInputProps | ||
extends Partial<NumberFormatterOptions>, | ||
Omit<FormattedInputProps<string>, 'formatter'> { | ||
value?: string | null; | ||
element?: HTMLInputElement; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
mathesar_ui/src/component-library/number-input/number-formatter/AbstractNumberFormatter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
mathesar_ui/src/component-library/number-input/number-formatter/NumberFormatter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...esar_ui/src/component-library/number-input/number-formatter/StringifiedNumberFormatter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
mathesar_ui/src/component-library/number-input/number-formatter/parsers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { BaseInputProps } from '@mathesar-component-library-dir/common/base-components/BaseInputTypes'; | ||
import type { LabelGetter } from '@mathesar-component-library-dir/common/utils/formatUtils'; | ||
import type { Appearance } from '@mathesar-component-library-dir/commonTypes'; | ||
import type { ListBoxProps } from '@mathesar-component-library-dir/list-box/ListBoxTypes'; | ||
|
||
export interface SelectProps<Option> extends BaseInputProps { | ||
options: Option[]; | ||
value?: Option; | ||
labelKey?: string; | ||
getLabel?: LabelGetter<Option | undefined>; | ||
prependBlank?: boolean; | ||
contentClass?: string; | ||
triggerClass?: string; | ||
triggerAppearance?: Appearance; | ||
ariaLabel?: string; | ||
valuesAreEqual?: ListBoxProps<Option | undefined>['checkEquality']; | ||
} |
15 changes: 1 addition & 14 deletions
15
mathesar_ui/src/component-library/text-area/TextArea.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { BaseInputProps } from '@mathesar-component-library-dir/common/base-components/BaseInputTypes'; | ||
import type { SimplifiedInputProps } from '@mathesar-component-library-dir/commonTypes'; | ||
|
||
export interface TextAreaProps extends SimplifiedInputProps, BaseInputProps { | ||
value?: string | null; | ||
class?: string; | ||
element?: HTMLTextAreaElement; | ||
} |
16 changes: 1 addition & 15 deletions
16
mathesar_ui/src/component-library/text-input/TextInput.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
mathesar_ui/src/component-library/text-input/TextInputTypes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { BaseInputProps } from '@mathesar-component-library-dir/common/base-components/BaseInputTypes'; | ||
import type { SimplifiedInputProps } from '@mathesar-component-library-dir/commonTypes'; | ||
|
||
export interface TextInputProps extends SimplifiedInputProps, BaseInputProps { | ||
value?: string | null; | ||
class?: string; | ||
element?: HTMLInputElement; | ||
hasError?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters