Skip to content

Commit

Permalink
feat: adapt input date-picker to the old theme style
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcr committed Nov 15, 2024
1 parent 500302f commit 8e5b120
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
10 changes: 7 additions & 3 deletions packages/theme-saas/src/picker/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@apply fill-color-icon-primary;
}
}

.@{input-prefix-cls}__icon-container {
align-items: center;
display: flex;
Expand Down Expand Up @@ -58,6 +59,11 @@
.@{input-prefix-cls}__icon {
@apply cursor-pointer;

.baseClearicon {
@apply mr-2;
@apply !transform-none;
}

&:not(.@{range-prefix-cls}__icon) {
@apply flex;
}
Expand Down Expand Up @@ -106,15 +112,13 @@
@apply absolute;
@apply ~'right-1.5';
@apply text-base;
@apply w-4;
width: 25px;
float: right;
@apply leading-8;
@apply mr-5;
@apply flex;
@apply justify-center;
@apply items-center;
@apply h-5;
@apply mr-6;
}
}

Expand Down
26 changes: 17 additions & 9 deletions packages/theme/src/picker/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,27 @@
}

.@{range-prefix-cls}__close-icon {
width: 16px;
height: 16px;
cursor: pointer;
fill: var(--tv-Picker-icon-color);
position: absolute;
right: 12px;
display: flex;
align-items: center;
height: 100%;

& + .@{range-prefix-cls}__icon {
display: none;
}
svg {
width: var(--tv-Picker-icon-size);
height: var(--tv-Picker-icon-size);
cursor: pointer;
fill: var(--tv-Picker-icon-color);

&:hover {
fill: var(--tv-Picker-icon-color-hover);
&:hover {
fill: var(--tv-Picker-icon-color-hover);
}
}
}

.@{range-prefix-cls}__close-icon:has(> svg) + .@{range-prefix-cls}__icon {
display: none;
}
}
}

Expand Down
13 changes: 5 additions & 8 deletions packages/vue/src/picker/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,13 @@
@focus="handleFocus"
class="tiny-range-input"
/>
<i class="tiny-input__icon tiny-input__suffix">
<i @click="handleClickIcon" v-if="state.haveTrigger" class="tiny-input__icon tiny-range__close-icon">
<transition name="tiny-transition-icon-scale-in">
<component
v-if="state.haveTrigger"
:is="state.showClose ? clearIcon : null"
@click="handleClickIcon"
class="tiny-range__close-icon"
/>
<component :is="state.showClose ? clearIcon : null" />
</transition>
<component v-if="!state.isDisplayOnly" :is="state.triggerClass" class="tiny-range__icon" />
</i>
<i v-if="!state.isDisplayOnly" class="tiny-input__icon tiny-range__icon tiny-input__suffix">
<component :is="state.triggerClass" />
</i>
<tiny-tooltip
class="tiny-range-editor-display-only"
Expand Down

0 comments on commit 8e5b120

Please sign in to comment.