-
-
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.
Merge branch 'master' of https://github.com/centerofci/mathesar into …
…pr/nk183/1211-2
- Loading branch information
Showing
76 changed files
with
698 additions
and
547 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
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
13 changes: 12 additions & 1 deletion
13
mathesar_ui/src/component-library/common/types/ComponentAndPropsTypes.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 |
---|---|---|
@@ -1,6 +1,17 @@ | ||
import type { SvelteComponent } from 'svelte'; | ||
|
||
export interface ComponentAndProps<T = Record<string, unknown>> { | ||
/** | ||
* Why `T = unknown` here? | ||
* | ||
* This was previously `T = Record<string, unknown>` which seemed to make more | ||
* sense at first because props must be objects. But then we ran into some TS | ||
* errors that appeared to be related to this [open TS issue][1]. Using | ||
* `unknown` sacrifices some type safety but it obviates weird hacks to get | ||
* around that TS issue. | ||
* | ||
* [1]: https://github.com/microsoft/TypeScript/issues/37491 | ||
*/ | ||
export interface ComponentAndProps<T = unknown> { | ||
component: typeof SvelteComponent; | ||
props?: T; | ||
} |
4 changes: 2 additions & 2 deletions
4
...library/dynamic-input/BooleanInput.svelte → ...data-type-based-input/BooleanInput.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
4 changes: 2 additions & 2 deletions
4
...-library/dynamic-input/StringInput.svelte → .../data-type-based-input/StringInput.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
24 changes: 24 additions & 0 deletions
24
..._ui/src/component-library/data-type-based-input/__meta__/DataTypeBasedInput.mdx
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,24 @@ | ||
import { Story, Canvas, ArgsTable, Source } from '@storybook/addon-docs/blocks'; | ||
import DataTypeBasedInput from '../DataTypeBasedInput.svelte'; | ||
|
||
# DataTypeBasedInput | ||
|
||
DataTypeBasedInput system design specification. | ||
|
||
## Usage | ||
|
||
### Boolean type | ||
|
||
<Canvas> | ||
<Story name="boolean" id="components-datatypebasedinput--boolean" /> | ||
</Canvas> | ||
|
||
### String type | ||
|
||
<Canvas> | ||
<Story name="string" id="components-datatypebasedinput--string" /> | ||
</Canvas> | ||
|
||
## Arguments | ||
|
||
<ArgsTable of={DataTypeBasedInput} /> |
31 changes: 31 additions & 0 deletions
31
...ui/src/component-library/data-type-based-input/__meta__/DataTypeBasedInput.stories.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import { Meta, Story } from '@storybook/addon-svelte-csf'; | ||
import Docs from './DataTypeBasedInput.mdx'; | ||
import DataTypeBasedInput from '../DataTypeBasedInput.svelte'; | ||
const meta = { | ||
title: 'Components/DataTypeBasedInput', | ||
parameters: { | ||
docs: { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
page: Docs, | ||
source: { | ||
type: 'code', | ||
}, | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<Meta {...meta} /> | ||
|
||
<Story name="Boolean"> | ||
<DataTypeBasedInput dataType="boolean" /> | ||
<DataTypeBasedInput dataType="boolean" interfaceType="select" /> | ||
</Story> | ||
|
||
<Story name="String"> | ||
<DataTypeBasedInput dataType="string" /> | ||
<DataTypeBasedInput dataType="string" interfaceType="textarea" /> | ||
<DataTypeBasedInput dataType="string" enum={['Pichu', 'Pikachu', 'Raichu']} /> | ||
</Story> |
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
24 changes: 0 additions & 24 deletions
24
mathesar_ui/src/component-library/dynamic-input/__meta__/DynamicInput.mdx
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
mathesar_ui/src/component-library/dynamic-input/__meta__/DynamicInput.stories.svelte
This file was deleted.
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
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
Oops, something went wrong.