Browse Source

fix(nc-gui): btn

pull/7611/head
DarkPhoenix2704 7 months ago
parent
commit
932153ec71
  1. 18
      packages/nc-gui/components/nc/Button.vue
  2. 6
      packages/nc-gui/components/smartsheet/calendar/index.vue

18
packages/nc-gui/components/nc/Button.vue

@ -73,10 +73,6 @@ useEventListener(NcButton, 'mousedown', () => {
<template> <template>
<a-button <a-button
ref="NcButton" ref="NcButton"
:disabled="props.disabled"
:loading="loading"
:type="type"
class="nc-button"
:class="{ :class="{
small: size === 'small', small: size === 'small',
medium: size === 'medium', medium: size === 'medium',
@ -84,34 +80,38 @@ useEventListener(NcButton, 'mousedown', () => {
xxsmall: size === 'xxsmall', xxsmall: size === 'xxsmall',
focused: isFocused, focused: isFocused,
}" }"
:disabled="props.disabled"
:loading="loading"
:tabindex="props.disabled ? -1 : 0" :tabindex="props.disabled ? -1 : 0"
@focus="onFocus" :type="type"
class="nc-button"
@blur="onBlur" @blur="onBlur"
@focus="onFocus"
> >
<div <div
class="flex flex-row gap-x-2.5 w-full"
:class="{ :class="{
'justify-center': props.centered, 'justify-center': props.centered,
'justify-start': !props.centered, 'justify-start': !props.centered,
}" }"
class="flex flex-row gap-x-2.5 w-full"
> >
<GeneralLoader <GeneralLoader
v-if="loading" v-if="loading"
size="medium"
class="flex !bg-inherit"
:class="{ :class="{
'!text-white': type === 'primary' || type === 'danger', '!text-white': type === 'primary' || type === 'danger',
'!text-gray-800': type !== 'primary' && type !== 'danger', '!text-gray-800': type !== 'primary' && type !== 'danger',
}" }"
class="flex !bg-inherit"
size="medium"
/> />
<slot v-else name="icon" /> <slot v-else name="icon" />
<div <div
v-if="!(size === 'xxsmall' && loading) && !props.iconOnly" v-if="!(size === 'xxsmall' && loading) && !props.iconOnly"
class="flex flex-row items-center"
:class="{ :class="{
'font-medium': type === 'primary' || type === 'danger', 'font-medium': type === 'primary' || type === 'danger',
}" }"
class="flex flex-row items-center w-full"
> >
<slot v-if="loading && slots.loading" name="loading" /> <slot v-if="loading && slots.loading" name="loading" />

6
packages/nc-gui/components/smartsheet/calendar/index.vue

@ -169,8 +169,10 @@ const headerText = computed(() => {
size="small" size="small"
type="secondary" type="secondary"
> >
<span class="font-bold text-center text-brand-500">{{ headerText }}</span> <div class="flex w-full px-3 py-1 items-center justify-between">
<component :is="iconMap.arrowDown" class="h-4 w-4 text-gray-700" /> <span class="font-bold text-center text-brand-500">{{ headerText }}</span>
<component :is="iconMap.arrowDown" class="h-4 w-4 text-gray-700" />
</div>
</NcButton> </NcButton>
<template #overlay> <template #overlay>

Loading…
Cancel
Save