Skip to content

Commit

Permalink
revert: 项目整体大幅度重构,发布新版本 0.5.0-bate.1 (2022-08-08) 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Aug 8, 2022
1 parent 5f88505 commit d4efadb
Show file tree
Hide file tree
Showing 85 changed files with 300 additions and 315 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"build:css": "vite build --config vite.config.css.ts",
"build:lib": "vite build --config vite.config.lib.ts",
"build:umd": "vite build --config vite.config.umd.ts",
"build:demo": "vite build --config vite.config.demo.ts",
"build:docs": "pnpm run -C docs build",
"serve:docs": "pnpm run -C docs serve",
"build:start": "pnpm run -C start build",
Expand All @@ -35,7 +36,6 @@
"@commitlint/config-conventional": "^17.0.0",
"@fighting-design/fighting-components": "workspace:*",
"@fighting-design/fighting-theme": "workspace:*",
"@fighting-design/fighting-utils": "workspace:*",
"@vitejs/plugin-vue": "^2.3.1",
"@vue/runtime-core": "^3.2.37",
"@vue/test-utils": "^2.0.0-rc.18",
Expand Down Expand Up @@ -78,4 +78,4 @@
"git add"
]
}
}
}
2 changes: 1 addition & 1 deletion packages/fighting-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const fun: a = (a: number, b: number): number => {
```ts
import FButton from './src/button.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FButton, FButton.name)

Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions packages/fighting-components/_interface/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="vite/client" />

declare module '*.vue' {
import type { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { changeColorInterface } from './type'
import type { changeColorInterface } from '../_interface'

/**
* 根据传入的 hex 计算出加深和减淡的颜色
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { installInterface, mainVNodeInterface } from './type'
import type { installInterface, mainVNodeInterface } from '../_interface'
import type { App } from 'vue'

/**
Expand All @@ -15,6 +15,11 @@ export const install: installInterface = (
}
}

/**
* 注册内置组件
* @param main 组件实例
* @param name 组件名
*/
export const installFn: installInterface = (
main: mainVNodeInterface,
name: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
loadImageInterface,
propsInterface,
callbackInterface
} from './type'
} from '../_interface'

/**
* 图片加载
Expand All @@ -26,7 +26,9 @@ class Load implements LoadInterface {
this.emit = emit
this.callback = callback
}
// 加载当前的 src 地址图片
/**
* 加载当前的 src 地址图片
*/
loadCreateImg = (): void => {
this.img.src = this.props.src

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RipplesInterface, buttonEventInterface } from './type'
import type { buttonType } from '../fighting-components/button/src/interface'
import type { RipplesInterface, buttonEventInterface } from '../_interface'
import type { buttonType } from '../button/src/interface'

const colorList = {
default: '#f0f0f0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
getTypeInterface as c,
pastTimeInterface as d,
pastTimeConfigInterface as e
} from './type'
} from '../_interface'

/**
* 保留小数点后 n 位
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { createBase64Interface as a } from './type'
import type { createBase64Interface as a } from '../_interface'

/**
* 将 canvas 转换成 base64 图片格式
Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-components/alert/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FAlert from './src/alert.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FAlert, FAlert.name)

export { FAlert }
export default FAlert
4 changes: 2 additions & 2 deletions packages/fighting-components/aside/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FAside from './src/aside.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FAside, FAside.name)

export { FAside }
export default FAside
4 changes: 2 additions & 2 deletions packages/fighting-components/avatar/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FAvatar from './src/avatar.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FAvatar, FAvatar.name)

export { FAvatar }
export default FAvatar
6 changes: 1 addition & 5 deletions packages/fighting-components/avatar/src/avatar.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<script lang="ts" setup name="FAvatar">
import { Props, Emits } from './avatar'
import { computed, ref, onMounted } from 'vue'
import {
loadImage,
isNumber,
isString
} from '@fighting-design/fighting-utils'
import { loadImage, isNumber, isString } from '../../_utils'
import { FIcon } from '@fighting-design/fighting-components'
import type { ComputedRef, Ref, CSSProperties } from 'vue'
Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-components/back-top/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FBackTop from './src/back-top.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FBackTop, FBackTop.name)

export { FBackTop }
export default FBackTop
2 changes: 1 addition & 1 deletion packages/fighting-components/back-top/src/back-top.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup name="FBackTop">
import { Emits, Props } from './back-top'
import { onMounted, ref } from 'vue'
import { debounce } from '@fighting-design/fighting-utils'
import { debounce } from '../../_utils'
import type { Ref } from 'vue'
import type {
handleScrollInterface as a,
Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-components/badge/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FBadge from './src/badge.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FBadge, FBadge.name)

export { FBadge }
export default FBadge
4 changes: 2 additions & 2 deletions packages/fighting-components/breadcrumb-item/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FBreadcrumbItem from './src/breadcrumb-item.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FBreadcrumbItem, FBreadcrumbItem.name)

export { FBreadcrumbItem }
export default FBreadcrumbItem
4 changes: 2 additions & 2 deletions packages/fighting-components/breadcrumb/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FBreadcrumb from './src/breadcrumb.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FBreadcrumb, FBreadcrumb.name)

export { FBreadcrumb }
export default FBreadcrumb
4 changes: 2 additions & 2 deletions packages/fighting-components/button-group/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FButtonGroup from './src/button-group.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FButtonGroup, FButtonGroup.name)

export { FButtonGroup }
export default FButtonGroup
4 changes: 2 additions & 2 deletions packages/fighting-components/button/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FButton from './src/button.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FButton, FButton.name)

export { FButton }
export default FButton
2 changes: 1 addition & 1 deletion packages/fighting-components/button/src/button.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup name="FButton">
import { computed, ref, onMounted } from 'vue'
import { Props, Emits } from './button'
import { Ripples, ChangeColor } from '@fighting-design/fighting-utils'
import { Ripples, ChangeColor } from '../../_utils'
import { FIcon } from '@fighting-design/fighting-components'
import type { ComputedRef, Ref, CSSProperties } from 'vue'
import type {
Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-components/card/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FCard from './src/card.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FCard, FCard.name)

export { FCard }
export default FCard
70 changes: 34 additions & 36 deletions packages/fighting-components/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
import '@vue/runtime-core'
import type F from './index'

declare module '@vue/runtime-core' {
export interface GlobalComponents {
// FButton: typeof import('./button/src/button.vue')['default']
FButton: typeof F.FButton
FButtonGroup: typeof F.FButtonGroup
FIcon: typeof F.FIcon
FLink: typeof F.FLink
FImage: typeof F.FImage
FCard: typeof F.FCard
FTag: typeof F.FTag
FDivider: typeof F.FDivider
FFooter: typeof F.FFooter
FHeader: typeof F.FHeader
FAside: typeof F.FAside
FMain: typeof F.FMain
FLayout: typeof F.FLayout
FSwitch: typeof F.FSwitch
FBadge: typeof F.FBadge
FAvatar: typeof F.FAvatar
FBackTop: typeof F.FBackTop
FBreadcrumbItem: typeof F.FBreadcrumbItem
FBreadcrumb: typeof F.FBreadcrumb
FText: typeof F.FText
FLoading: typeof F.FLoading
FProgress: typeof F.FProgress
FSpace: typeof F.FSpace
FDialog: typeof F.FDialog
FTooltip: typeof F.FTooltip
FDrawer: typeof F.FDrawer
FPageHeader: typeof F.FPageHeader
FRate: typeof F.FRate
FAlert: typeof F.FAlert
FNovelCoronavirus: typeof F.FNovelCoronavirus
FList: typeof F.FList
FListItem: typeof F.FListItem
FToolbar: typeof F.FToolbar
FToolbarItem: typeof F.FToolbarItem
FButton: typeof import('./button/src/button.vue')['default']
FButtonGroup: typeof import('./button-group/src/button-group.vue')['default']
FIcon: typeof import('./icon/src/icon.vue')['default']
FLink: typeof import('./link/src/link.vue')['default']
FImage: typeof import('./image/src/image.vue')['default']
FCard: typeof import('./card/src/card.vue')['default']
FTag: typeof import('./tag/src/tag.vue')['default']
FDivider: typeof import('./divider/src/divider.vue')['default']
FFooter: typeof import('./footer/src/footer.vue')['default']
FHeader: typeof import('./header/src/header.vue')['default']
FAside: typeof import('./aside/src/aside.vue')['default']
FMain: typeof import('./main/src/main.vue')['default']
FLayout: typeof import('./layout/src/layout.vue')['default']
FSwitch: typeof import('./switch/src/switch.vue')['default']
FBadge: typeof import('./badge/src/badge.vue')['default']
FAvatar: typeof import('./avatar/src/avatar.vue')['default']
FBackTop: typeof import('./back-top/src/back-top.vue')['default']
FBreadcrumbItem: typeof import('./breadcrumb-item/src/breadcrumb-item.vue')['default']
FBreadcrumb: typeof import('./breadcrumb/src/breadcrumb.vue')['default']
FText: typeof import('./text/src/text.vue')['default']
FLoading: typeof import('./loading/src/loading.vue')['default']
FProgress: typeof import('./progress/src/progress.vue')['default']
FSpace: typeof import('./space/src/space.vue')['default']
FDialog: typeof import('./dialog/src/dialog.vue')['default']
FTooltip: typeof import('./tooltip/src/tooltip.vue')['default']
FDrawer: typeof import('./drawer/src/drawer.vue')['default']
FPageHeader: typeof import('./page-header/src/page-header.vue')['default']
FAlert: typeof import('./alert/src/alert.vue')['default']
FNovelCoronavirus: typeof import('./novel-coronavirus/src/novel-coronavirus.vue')['default']
FList: typeof import('./list/src/list.vue')['default']
FListItem: typeof import('./list-item/src/list-item.vue')['default']
FToolbar: typeof import('./toolbar/src/toolbar.vue')['default']
FToolbarItem: typeof import('./toolbar-item/src/toolbar-item.vue')['default']
FWatermark: typeof import('./watermark/src/watermark.vue')['default']
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-components/dialog/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FDialog from './src/dialog.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FDialog, FDialog.name)

export { FDialog }
export default FDialog
4 changes: 2 additions & 2 deletions packages/fighting-components/divider/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FDivider from './src/divider.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FDivider, FDivider.name)

export { FDivider }
export default FDivider
4 changes: 2 additions & 2 deletions packages/fighting-components/drawer/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FDrawer from './src/drawer.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FDrawer, FDrawer.name)

export { FDrawer }
export default FDrawer
4 changes: 2 additions & 2 deletions packages/fighting-components/footer/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FFooter from './src/footer.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FFooter, FFooter.name)

export { FFooter }
export default FFooter
4 changes: 2 additions & 2 deletions packages/fighting-components/header/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FHeader from './src/header.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FHeader, FHeader.name)

export { FHeader }
export default FHeader
4 changes: 2 additions & 2 deletions packages/fighting-components/icon/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FIcon from './src/icon.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FIcon, FIcon.name)

export { FIcon }
export default FIcon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup name="FPreviewList">
import { ref, inject, toRefs } from 'vue'
import { FIcon } from '@fighting-design/fighting-components'
import { keepDecimal } from '@fighting-design/fighting-utils'
import { keepDecimal } from '../../_utils'
import { ImagePropsKey } from '../src/image'
import type { Ref } from 'vue'
import type {
Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-components/image/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FImage from './src/image.vue'

import { install } from '@fighting-design/fighting-utils'
import { install } from '../_utils'

install(FImage, FImage.name)

export { FImage }
export default FImage
Loading

0 comments on commit d4efadb

Please sign in to comment.