Skip to content

Commit

Permalink
fix(notify): [notify, split] Dev update notifycrop split (#2020)
Browse files Browse the repository at this point in the history
* fix(notify): fix title bold

* fix(split): update split's handler for smb design
  • Loading branch information
shenjunjian authored Aug 31, 2024
1 parent 506a842 commit 56e8819
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 10 deletions.
2 changes: 2 additions & 0 deletions packages/design/smb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Time from './src/time-spinner'
import UploadList from './src/upload-list'
import BreadcrumbItem from './src/breadcrumb-item'
import Milestone from './src/milestone'
import Split from './src/Split'
import TransferPanel from './src/transfer-panel'
import { version } from './package.json'

Expand All @@ -39,6 +40,7 @@ export default {
BreadcrumbItem,
UploadList,
Milestone,
Split,
TransferPanel
}
}
4 changes: 4 additions & 0 deletions packages/design/smb/src/split/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
// smb 风格的拖动dom为2条线。 左右面板为 右侧竖线, 上下面板为 下方横线
triggerBarConWithLine: true
}
3 changes: 2 additions & 1 deletion packages/renderless/src/split/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { on, off } from '../common/deps/dom'

export const api = ['state', 'handleMousedown', 'buttonMousedown', 'buttonLeftTopClick', 'buttonRightBottomClick']

export const renderless = (props, hooks, { vm, nextTick, emit, constants }) => {
export const renderless = (props, hooks, { vm, nextTick, emit, constants, designConfig }) => {
const api = {}
const { computed, reactive } = hooks
const getUseOffset = useOffset({ nextTick, props, vm, constants, hooks })
Expand All @@ -51,6 +51,7 @@ export const renderless = (props, hooks, { vm, nextTick, emit, constants }) => {
`${state.prefix}-pane ${props.scrollable ? 'tiny-split-scroll' : ''}`,
{ [`${state.prefix}-pane-moving`]: state.isMoving }
]),
triggerBarConWithLine: !!designConfig?.triggerBarConWithLine, // smb 风格的拖动块是线条
...getUseOffset.state
})

Expand Down
1 change: 1 addition & 0 deletions packages/theme/src/notify/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
margin: var(--ti-notify-title-margin-top) var(--ti-notify-title-margin-horizontal)
var(--ti-notify-title-margin-bottom);
line-height: 1.5;
font-weight: var(--ti-notify-title-font-weight);
}

&__message-zone &__content-wrapper {
Expand Down
12 changes: 11 additions & 1 deletion packages/theme/src/split/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,28 @@

&-bar-con {
position: absolute;
background: #fff;
background: transparent;

&.vertical {
top: 50%;
height: 28px;
transform: translate(0, -50%);

svg {
transform: translateX(5px);
fill: #d5d5d5;
}
}

&.horizontal {
left: 50%;
width: 28px;
transform: translate(-50%, 0);

svg {
transform: translateY(5px);
fill: #d5d5d5;
}
}
}

Expand Down
32 changes: 24 additions & 8 deletions packages/vue/src/split/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@
>
<slot name="trigger">
<div :class="[`${state.prefix}-trigger`, `${state.prefix}-trigger-vertical`]">
<div v-if="!triggerSimple" :class="[`${state.prefix}-trigger-bar-con`, 'vertical']">
<i v-for="i in 3" v-once :class="`${state.prefix}-trigger-bar`" :key="`trigger-${i}`"></i>
</div>
<template v-if="!state.triggerBarConWithLine">
<div v-if="!triggerSimple" :class="[`${state.prefix}-trigger-bar-con`, 'vertical']">
<i v-for="i in 3" v-once :class="`${state.prefix}-trigger-bar`" :key="`trigger-${i}`"></i>
</div>
</template>
<template v-else>
<div v-if="!triggerSimple" :class="[`${state.prefix}-trigger-bar-con`, 'vertical']">
<IconStretchUpright />
</div>
</template>
</div>
</slot>
<div
Expand Down Expand Up @@ -104,9 +111,16 @@
>
<slot name="trigger">
<div :class="[`${state.prefix}-trigger`, `${state.prefix}-trigger-horizontal`]">
<div v-if="!triggerSimple" :class="[`${state.prefix}-trigger-bar-con`, 'horizontal']">
<i v-for="i in 3" v-once :class="`${state.prefix}-trigger-bar`" :key="`trigger-${i}`"></i>
</div>
<template v-if="!state.triggerBarConWithLine">
<div v-if="!triggerSimple" :class="[`${state.prefix}-trigger-bar-con`, 'horizontal']">
<i v-for="i in 3" v-once :class="`${state.prefix}-trigger-bar`" :key="`trigger-${i}`"></i>
</div>
</template>
<template v-else>
<div v-if="!triggerSimple" :class="[`${state.prefix}-trigger-bar-con`, 'horizontal']">
<IconStretchCrosswise />
</div>
</template>
</div>
</slot>
<div
Expand Down Expand Up @@ -153,12 +167,14 @@
<script lang="ts">
import { renderless, api } from '@opentiny/vue-renderless/split/vue'
import { props, setup, defineComponent } from '@opentiny/vue-common'
import { IconLeftWard, IconRightward } from '@opentiny/vue-icon'
import { IconLeftWard, IconRightward, IconStretchUpright, IconStretchCrosswise } from '@opentiny/vue-icon'

export default defineComponent({
components: {
IconLeftWard: IconLeftWard(),
IconRightWard: IconRightward()
IconRightWard: IconRightward(),
IconStretchUpright: IconStretchUpright(), // 纵向
IconStretchCrosswise: IconStretchCrosswise() // 横向
},
emits: [
'moving',
Expand Down

0 comments on commit 56e8819

Please sign in to comment.