Skip to content

Commit

Permalink
refactor: remove base-teleport & base-lazy-teleport
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Nov 27, 2020
1 parent e5f94fa commit f73da1f
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 125 deletions.
3 changes: 2 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = {
'vueuc',
'vooks',
'evtd',
'vdirs'
'vdirs',
'seemly'
])
}
2 changes: 0 additions & 2 deletions src/_base/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export { default as NIconSwitchTransition } from './icon-switch-transition'
export { default as NFadeInExpandTransition } from './fade-in-expand-transition'
export { default as NBaseTeleport } from './teleport'
export { default as NBaseLazyTeleport } from './lazy-teleport'
export { default as NBaseFocusDetector } from './focus-detector'
export { default as NBaseLoading } from './loading'
export { default as NBaseSelectMenu } from './select-menu'
Expand Down
52 changes: 0 additions & 52 deletions src/_base/lazy-teleport/index.js

This file was deleted.

1 change: 0 additions & 1 deletion src/_base/teleport/index.js

This file was deleted.

34 changes: 0 additions & 34 deletions src/_base/teleport/src/Teleport.vue

This file was deleted.

8 changes: 4 additions & 4 deletions src/back-top/src/BackTop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
style="display: none;"
aria-hidden
>
<n-base-lazy-teleport
<v-lazy-teleport
:to="to"
:show="mergedShow"
>
Expand Down Expand Up @@ -36,12 +36,13 @@
</slot>
</div>
</transition>
</n-base-lazy-teleport>
</v-lazy-teleport>
</div>
</template>

<script>
import { ref, computed, toRef, watch, nextTick } from 'vue'
import { VLazyTeleport } from 'vueuc'
import { useIsMounted, useMergedState } from 'vooks'
import { getScrollParent, unwrapElement } from 'seemly'
import {
Expand All @@ -51,13 +52,12 @@ import {
} from '../../_mixins'
import { formatLength, warn } from '../../_utils'
import styles from './styles'
import { NBaseLazyTeleport } from '../../_base'
import BackTopIcon from './BackTopIcon.vue'
export default {
name: 'BackTop',
components: {
NBaseLazyTeleport,
VLazyTeleport,
BackTopIcon
},
mixins: [
Expand Down
12 changes: 6 additions & 6 deletions src/drawer/src/Drawer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<n-base-lazy-teleport
<v-lazy-teleport
:to="to"
:show="show"
>
Expand Down Expand Up @@ -33,26 +33,26 @@
<slot />
</n-drawer-body-wrapper>
</div>
</n-base-lazy-teleport>
</v-lazy-teleport>
</template>

<script>
import { VLazyTeleport } from 'vueuc'
import { zindexable } from 'vdirs'
import { useCompitable, useIsMounted } from 'vooks'
import {
configurable,
themeable,
withCssr
} from '../../_mixins'
import { zindexable } from 'vdirs'
import { warn, formatLength } from '../../_utils'
import { useCompitable, useIsMounted } from 'vooks'
import { NBaseLazyTeleport } from '../../_base'
import NDrawerBodyWrapper from './DrawerBodyWrapper.vue'
import styles from './styles/index'
export default {
name: 'Drawer',
components: {
NBaseLazyTeleport,
VLazyTeleport,
NDrawerBodyWrapper
},
directives: {
Expand Down
13 changes: 6 additions & 7 deletions src/loading-bar/src/LoadingBarProvider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Fragment, h, ref } from 'vue'
import { Fragment, h, ref, Teleport } from 'vue'
import { useIsMounted } from 'vooks'
import { NBaseTeleport } from '../../_base'
import NLoadingBar from './LoadingBar.vue'

export default {
Expand Down Expand Up @@ -68,13 +67,13 @@ export default {
},
render () {
return h(Fragment, null, [
h(NBaseTeleport, {
to: this.to
}, {
default: () => h(NLoadingBar, {
h(Teleport, {
to: this.to ?? 'body'
}, [
h(NLoadingBar, {
ref: 'loadingBarRef'
})
}),
]),
this.$slots.default()
])
}
Expand Down
13 changes: 6 additions & 7 deletions src/message/src/MessageProvider.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Fragment, ref, h, reactive } from 'vue'
import { Fragment, ref, h, reactive, Teleport } from 'vue'
import { createId } from 'seemly'
import { omit } from '../../_utils'
import { NBaseTeleport } from '../../_base'
import MessageEnvironment from './MessageEnvironment.js'

export default {
Expand Down Expand Up @@ -66,10 +65,10 @@ export default {
render () {
return h(Fragment, null,
[
this.messageList.length ? h(NBaseTeleport, {
to: this.to
}, {
default: () => h('div', {
this.messageList.length ? h(Teleport, {
to: this.to ?? 'body'
}, [
h('div', {
class: 'n-message-container',
key: 'n-message-container'
}, this.messageList.map(
Expand All @@ -79,7 +78,7 @@ export default {
onInternalAfterLeave: this.handleAfterLeave
})
))
}) : null,
]) : null,
this.$slots.default()
]
)
Expand Down
6 changes: 3 additions & 3 deletions src/modal/src/Modal.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { h, withDirectives, Transition, ref, computed } from 'vue'
import { zindexable } from 'vdirs'
import { useIsMounted, useClicked, useClickPosition } from 'vooks'
import { VLazyTeleport } from 'vueuc'
import { configurable, themeable, withCssr } from '../../_mixins'
import presetProps from './presetProps'
import { useIsMounted, useClicked, useClickPosition } from 'vooks'
import { warn, omit } from '../../_utils'
import { NBaseLazyTeleport } from '../../_base'
import NModalBodyWrapper from './BodyWrapper.vue'
import styles from './styles'

Expand Down Expand Up @@ -138,7 +138,7 @@ export default {
}
},
render () {
return h(NBaseLazyTeleport, {
return h(VLazyTeleport, {
to: this.to,
show: this.show
}, {
Expand Down
13 changes: 6 additions & 7 deletions src/notification/src/NotificationProvider.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Fragment, h, reactive, ref } from 'vue'
import { Fragment, h, reactive, ref, Teleport } from 'vue'
import { createId } from 'seemly'
import { omit } from '../../_utils'
import { NBaseTeleport } from '../../_base'
import NotificationContainer from './NotificationContainer.vue'
import NotificationEnvironment from './NotificationEnvironment'

Expand Down Expand Up @@ -70,10 +69,10 @@ export default {
},
render () {
return h(Fragment, null, [
h(NBaseTeleport, {
to: this.to
}, {
default: () => this.notificationList.length ? h(NotificationContainer, {
h(Teleport, {
to: this.to ?? 'body'
}, [
this.notificationList.length ? h(NotificationContainer, {
scrollable: this.scrollable
}, {
default: () => {
Expand All @@ -86,7 +85,7 @@ export default {
)
}
}) : null
}),
]),
this.$slots.default()
])
}
Expand Down
2 changes: 1 addition & 1 deletion src/time-picker/src/styles/themed-base.cssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default c([
})
])
]),
cB('time-picker-panel', {
cTB('time-picker-panel', {
raw: `
outline: none;
font-size: 12px;
Expand Down

0 comments on commit f73da1f

Please sign in to comment.