-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: many additions for new table structure (#425)
- Loading branch information
Showing
25 changed files
with
1,227 additions
and
187 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
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,50 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue' | ||
import { useCardBlockSize } from '../composables/Card' | ||
import { type ControlSize, provideControlSize } from '../composables/Control' | ||
export type { ControlSize as Size } | ||
const props = defineProps<{ | ||
size?: ControlSize | ||
}>() | ||
const cardSize = useCardBlockSize() | ||
const sizeDict = { | ||
xsmall: 'small', | ||
small: 'small', | ||
medium: 'small', | ||
large: 'medium', | ||
xlarge: 'medium', | ||
null: null | ||
} as const | ||
const _size = computed(() => { | ||
return props.size ?? sizeDict[cardSize.value ?? 'null'] ?? 'small' | ||
}) | ||
const classes = computed(() => [ | ||
_size.value, | ||
cardSize.value ? `card-size-${cardSize.value}` : null | ||
]) | ||
provideControlSize(_size) | ||
</script> | ||
|
||
<template> | ||
<div class="SControl" :class="classes"> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="postcss"> | ||
.SControl { | ||
display: flex; | ||
align-items: center; | ||
flex-grow: 1; | ||
} | ||
.SControl.small { gap: 8px; height: 32px; } | ||
.SControl.medium { gap: 12px; height: 40px; } | ||
</style> |
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,45 @@ | ||
<script setup lang="ts"> | ||
import { useControlSize } from '../composables/Control' | ||
import SButton, { type Mode, type Tooltip, type Type } from './SButton.vue' | ||
defineProps<{ | ||
tag?: string | ||
type?: Type | ||
mode?: Mode | ||
icon?: any | ||
iconMode?: Mode | ||
label?: string | ||
labelMode?: Mode | ||
href?: string | ||
loading?: boolean | ||
disabled?: boolean | ||
tooltip?: Tooltip | ||
}>() | ||
defineEmits<{ | ||
(e: 'click'): void | ||
}>() | ||
const size = useControlSize() | ||
</script> | ||
|
||
<template> | ||
<div class="SControlButton"> | ||
<SButton | ||
:tag="tag" | ||
:size="size" | ||
:type="type" | ||
:mode="mode" | ||
:icon="icon" | ||
:icon-mode="iconMode" | ||
:label="label" | ||
:label-mode="labelMode" | ||
:href="href" | ||
:tooltip="tooltip" | ||
block | ||
:loading="loading" | ||
:disabled="disabled" | ||
@click="$emit('click')" | ||
/> | ||
</div> | ||
</template> |
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 @@ | ||
<script setup lang="ts"> | ||
import { provideControlPosition } from '../composables/Control' | ||
provideControlPosition('center') | ||
</script> | ||
|
||
<template> | ||
<div class="SControlCenter"> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="postcss"> | ||
.SControlCenter { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-grow: 1; | ||
flex-shrink: 0; | ||
} | ||
.SControl.small .SControlCenter { gap: 8px; } | ||
.SControl.medium .SControlCenter { gap: 12px; } | ||
</style> |
Oops, something went wrong.