Skip to content

Commit

Permalink
Merge pull request #117 from qianmoQ/feature-dev
Browse files Browse the repository at this point in the history
chore(release): 2024.5.0
  • Loading branch information
qianmoQ authored Dec 3, 2024
2 parents ebb30f4 + 8c0df58 commit ade3c1f
Show file tree
Hide file tree
Showing 18 changed files with 354 additions and 55 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## 2024.5.0 (2024-12-03)

### 🐛 Bug Fixes

* **button:** fix slot ([d7f795c](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/d7f795c2b34c57becc3463f64cf9f593040b60a3))
* **core:** fix ci ([5daea84](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/5daea84a47bb3c7ce891cc22b3097d475727717c))
* **button:** fix the missing content in loading status ([ba29ece](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/ba29ecede2d744178f72123405da3370429ed7dd))
* **button:** fixed the icon abnormality caused by setting the size in the loading state ([6d4bd4f](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/6d4bd4f5035444c318e3a6f08e6043809548a7e7))
* **toggle:** fixed click events not being blocked correctly ([fa13012](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/fa13012f0899cc0c3e0899583650eaee2f629fef))

### ✨ Features

* **data builder:** fit all field ([e25d9e9](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/e25d9e9feb455fa3e686fa42a2e5ea045780a5c0))
* **data builder:** support bigscreen ([17acd5f](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/17acd5f517a8cdbc99538e9c0f3f14f804697475))
* **data builder:** support editor ([3d17865](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/3d1786513f259d7e7e51dc2fbaf4f8bff69c9042))
* **data builder:** support ruler ([ab5218d](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/ab5218d72cc865a60897da136dbe90b6fd793b4a))
* **data builder:** supports starting position 0 ([2842f2b](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/2842f2b7fe947c216a85f6d7ed225cae84b4ad81))
* **data builder:** adapter basic configure component ([96dccfc](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/96dccfc9920a8343171b6c066fa0e1ad679dda38))
* **data builder:** adapter component configuration ([d9a2ebb](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/d9a2ebb14a569aa066d60fe35ae7765d55dbd9b8))
* **data builder:** fixed component being able to go outside the canvas ([927d099](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/927d09903c156d204b0183953d3d13f847eed663))
* **data builder:** support canvas center ([d4fdd35](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/d4fdd358f0fe8f66ded7ee5aaf5636627fa4e451))
* **data builder:** support canvas style ([8069f57](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/8069f57149ecebcd6b579901598c5181992e63eb))
* **data builder:** support clicking on the canvas to deselect components ([e4e561f](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/e4e561f1efb69ed354f32c7df7ae605e5bf7ea56))
* **data builder:** support component remove ([9e5f4c9](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/9e5f4c971067a86917cfe2d62c6d6c62e9c3f5c6))
* **data builder:** support component resize ([1370271](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/1370271652c198c8e7669b87aefa2f48351f5042))
* **data builder:** support component slot ([c8789d2](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/c8789d22efd1679b71c08b8fb710338a2e1861fa))
* **data builder:** support editor ([61930df](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/61930df55ce2fe574dbac1ab3fbcb01fbaf2d8cc))
* **data builder:** support guideline ([6c03c63](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/6c03c630afbc5133d077097885a55873a5622dce))
* **data builder:** support panel label slot ([63d0644](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/63d0644a3f83532f8d771778972541d4a8a12833))
* **data builder:** support show toolbar ([bc27bc2](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/bc27bc2c6b157db046e6da6559ca40b69252e3c7))
* **data builder:** support view ([307ec7e](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/307ec7e4b2280603f05aaf838cc80a9f0c38c7bc))
* **data builder:** support width and height ([627d582](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/627d58209d90f58bdce1b2d068c568cae3315bb2))
* **upload:** support upload ([65720c2](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/65720c2ba9a15cdaf4d355406723ef8001327e94))
* **core:** replace `npm` to `pnpm` ([e8ba631](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/e8ba63157968c445cd1ac0b41340aa1323c867c1))
* **core:** support i18n ([371932c](https://github.com/devlive-community/view-shadcn-ui/commit/371932c3a6755071b41445c5c4ff32033618e43c))

## 2024.4.0 (2024-11-17)

### 🐛 Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export default {
activeMatch: '/components'
},
{
text: '2024.5.0 <span class="VPBadge danger" style="margin-left: -18px; position: absolute; bottom: 38px;">Alpha</span>',
text: '2024.5.0 <span class="VPBadge danger" style="margin-left: -18px; position: absolute; bottom: 38px;">Latest</span>',
items: [
{
text: 'CHANGELOG <span class="VPBadge tip">2024.4.0</span>',
text: 'CHANGELOG <span class="VPBadge tip">2024.5.0</span>',
link: '/changelog',
activeMatch: '/changelog'
},
Expand Down
36 changes: 36 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@ title: "Release Notes"

# Changelog

## 2024.5.0 (2024-12-03)

### 🐛 Bug Fixes

* **button:** fix slot ([d7f795c](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/d7f795c2b34c57becc3463f64cf9f593040b60a3))
* **core:** fix ci ([5daea84](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/5daea84a47bb3c7ce891cc22b3097d475727717c))
* **button:** fix the missing content in loading status ([ba29ece](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/ba29ecede2d744178f72123405da3370429ed7dd))
* **button:** fixed the icon abnormality caused by setting the size in the loading state ([6d4bd4f](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/6d4bd4f5035444c318e3a6f08e6043809548a7e7))
* **toggle:** fixed click events not being blocked correctly ([fa13012](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/fa13012f0899cc0c3e0899583650eaee2f629fef))

### ✨ Features

* **data builder:** fit all field ([e25d9e9](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/e25d9e9feb455fa3e686fa42a2e5ea045780a5c0))
* **data builder:** support bigscreen ([17acd5f](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/17acd5f517a8cdbc99538e9c0f3f14f804697475))
* **data builder:** support editor ([3d17865](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/3d1786513f259d7e7e51dc2fbaf4f8bff69c9042))
* **data builder:** support ruler ([ab5218d](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/ab5218d72cc865a60897da136dbe90b6fd793b4a))
* **data builder:** supports starting position 0 ([2842f2b](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/2842f2b7fe947c216a85f6d7ed225cae84b4ad81))
* **data builder:** adapter basic configure component ([96dccfc](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/96dccfc9920a8343171b6c066fa0e1ad679dda38))
* **data builder:** adapter component configuration ([d9a2ebb](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/d9a2ebb14a569aa066d60fe35ae7765d55dbd9b8))
* **data builder:** fixed component being able to go outside the canvas ([927d099](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/927d09903c156d204b0183953d3d13f847eed663))
* **data builder:** support canvas center ([d4fdd35](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/d4fdd358f0fe8f66ded7ee5aaf5636627fa4e451))
* **data builder:** support canvas style ([8069f57](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/8069f57149ecebcd6b579901598c5181992e63eb))
* **data builder:** support clicking on the canvas to deselect components ([e4e561f](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/e4e561f1efb69ed354f32c7df7ae605e5bf7ea56))
* **data builder:** support component remove ([9e5f4c9](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/9e5f4c971067a86917cfe2d62c6d6c62e9c3f5c6))
* **data builder:** support component resize ([1370271](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/1370271652c198c8e7669b87aefa2f48351f5042))
* **data builder:** support component slot ([c8789d2](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/c8789d22efd1679b71c08b8fb710338a2e1861fa))
* **data builder:** support editor ([61930df](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/61930df55ce2fe574dbac1ab3fbcb01fbaf2d8cc))
* **data builder:** support guideline ([6c03c63](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/6c03c630afbc5133d077097885a55873a5622dce))
* **data builder:** support panel label slot ([63d0644](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/63d0644a3f83532f8d771778972541d4a8a12833))
* **data builder:** support show toolbar ([bc27bc2](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/bc27bc2c6b157db046e6da6559ca40b69252e3c7))
* **data builder:** support view ([307ec7e](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/307ec7e4b2280603f05aaf838cc80a9f0c38c7bc))
* **data builder:** support width and height ([627d582](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/627d58209d90f58bdce1b2d068c568cae3315bb2))
* **upload:** support upload ([65720c2](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/65720c2ba9a15cdaf4d355406723ef8001327e94))
* **core:** replace `npm` to `pnpm` ([e8ba631](https://github.com/devlive-community/shadcn-ui-vue-admin/commit/e8ba63157968c445cd1ac0b41340aa1323c867c1))
* **core:** support i18n ([371932c](https://github.com/devlive-community/view-shadcn-ui/commit/371932c3a6755071b41445c5c4ff32033618e43c))

## 2024.4.0 (2024-11-17)

### 🐛 Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"author": "devlive-community",
"homepage": "https://view-shadcn-ui.devlive.org",
"private": false,
"version": "2024.5.0-alpha.1732962695",
"version": "2024.5.0",
"license": "MIT",
"main": "./dist/view-shadcn.umd.ts",
"module": "./dist/view-shadcn.es.ts",
Expand Down
19 changes: 18 additions & 1 deletion packages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { App } from 'vue'
import Message from './setup/message.ts'
import Spin from './setup/spin.ts'

import { Language, setLocale } from '@/utils/locale.ts'

import ShadcnButton from '@/ui/button'
import ShadcnButtonGroup from '@/ui/button/group'
import ShadcnCard from '@/ui/card'
Expand Down Expand Up @@ -159,14 +161,26 @@ let components = [
ShadcnUpload
]

const install = (Vue: App) => {
interface InstallOptions
{
locale?: Language
}

const install = (Vue: App, options: InstallOptions = {}) => {
// 设置语言
// Set language
if (options.locale) {
setLocale(options.locale)
}

components.map((component: any) => {
Vue.component(component.__name as string, component)
})

// Support global import
Vue.config.globalProperties.$Message = Message
Vue.config.globalProperties.$Spin = Spin
Vue.config.globalProperties.$setLocale = setLocale
}

let windowObj = window as any
Expand Down Expand Up @@ -262,5 +276,8 @@ export { ShadcnUpload } from '@/ui/upload'
// Export functions
export { fnToString, fnToFunction } from '@/utils/formatter'

// Export locale
export { setLocale }

// Support global import
export default install
81 changes: 81 additions & 0 deletions src/locales/en-US.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
export default {
upload: {
text: {
placeholder: '<span class="text-blue-600"> Click upload</span> or drag and drop the file here',
description: 'Support for a single or bulk upload.',
success: 'Upload successfully',
error: 'Upload failed'
}
},
toolbar: {
text: {
ok: 'OK',
cancel: 'Cancel'
}
},
modal: {
text: {
ok: 'OK',
cancel: 'Cancel'
}
},
exception: {
text: {
401: {
title: 'Not logged in',
description: 'Sorry, you need to login first to access this page.'
},
403: {
title: 'No permission to access this page',
description: 'Sorry, you do not have permission to access this page.'
},
404: {
title: 'The visited page does not exist',
description: 'The page you are looking for does not exist.'
},
500: {
title: 'There was an error on the server',
description: 'Sorry, there was an error on the server.'
}
},
action: {
backHome: 'Back Home'
}
},
select: {
text: {
placeholder: 'Please select a option'
}
},
pagination: {
text: {
total: 'Total {{ total }} items',
previous: 'Prev page',
next: 'Next page',
item: '{{ item }} items'
}
},
dataBuilder: {
placeholder: {
width: 'Width',
height: 'Height',
backgroundImage: 'Background image'
},
text: {
showGrid: 'Show grid',
snapToGrid: 'Snap to grid',
showRuler: 'Show ruler',
dragResize: 'Drag resize',
showGuidelines: 'Show guidelines',
configureCenter: 'Configure center',
basicConfigure: 'Basic configure',
backgroundColor: 'Background color',
backgroundImage: 'Background image',
opacity: 'Opacity',
xCoordinate: 'X Coordinate',
yCoordinate: 'Y Coordinate',
width: 'Width',
height: 'Height'
}
}
}
81 changes: 81 additions & 0 deletions src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
export default {
upload: {
text: {
placeholder: '<span class="text-blue-600">点击上传</span> 或拖拽文件到这里',
description: '支持单文件或批量上传',
success: '上传成功',
error: '上传失败'
}
},
toolbar: {
text: {
ok: '确定',
cancel: '取消'
}
},
modal: {
text: {
ok: '确定',
cancel: '取消'
}
},
exception: {
text: {
401: {
title: '未登录',
description: '抱歉,您需要先登录才能访问此页面。'
},
403: {
title: '无权限访问此页面',
description: '抱歉,您没有访问此页面的权限。'
},
404: {
title: '找不到页面',
description: '抱歉,找不到您要访问的页面。'
},
500: {
title: '服务器错误',
description: '抱歉,服务器出现了错误。'
}
},
action: {
backHome: '返回首页'
}
},
select: {
text: {
placeholder: '请选择一个选项'
}
},
pagination: {
text: {
total: '共 {{ total }} 条',
previous: '上一页',
next: '下一页',
item: '{{ item }} 条'
}
},
dataBuilder: {
placeholder: {
width: '宽度',
height: '高度',
backgroundImage: '背景图'
},
text: {
showGrid: '显示网格',
snapToGrid: '网格对齐',
showRuler: '显示尺子',
dragResize: '拖拽调整大小',
showGuidelines: '显示参考线',
configureCenter: '配置中心',
basicConfigure: '基础配置',
backgroundColor: '背景颜色',
backgroundImage: '背景图',
opacity: '透明度',
xCoordinate: 'X 坐标',
yCoordinate: 'Y 坐标',
width: '宽度',
height: '高度'
}
}
}
15 changes: 8 additions & 7 deletions src/ui/data-builder/ShadcnDataBuilderCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<!-- 画布尺寸调整 -->
<!-- Canvas size adjustment -->
<div class="flex items-center space-x-2">
<ShadcnNumber v-model="canvasSize.width" class="w-32" placeholder="宽度"/>
<ShadcnNumber v-model="canvasSize.width" class="w-32" :placeholder="t('dataBuilder.placeholder.width')"/>
<span class="text-gray-400">x</span>
<ShadcnNumber v-model="canvasSize.height" class="w-32" placeholder="高度"/>
<ShadcnNumber v-model="canvasSize.height" class="w-32" :placeholder="t('dataBuilder.placeholder.height')"/>
</div>

<!-- 缩放控制 -->
Expand All @@ -27,17 +27,17 @@
<div class="flex items-center space-x-4">
<!-- 网格控制 -->
<!-- Grid control -->
<ShadcnCheckbox v-model="showGrid" :value="true">显示网格</ShadcnCheckbox>
<ShadcnCheckbox v-model="snapToGrid" :value="true">网格吸附</ShadcnCheckbox>
<ShadcnCheckbox v-model="showGrid" :value="true">{{ t('dataBuilder.text.showGrid') }}</ShadcnCheckbox>
<ShadcnCheckbox v-model="snapToGrid" :value="true">{{ t('dataBuilder.text.snapToGrid') }}</ShadcnCheckbox>

<!-- 组件控制 -->
<!-- Component control -->
<ShadcnCheckbox v-model="showRuler" :value="true">显示标尺</ShadcnCheckbox>
<ShadcnCheckbox v-model="resize" :value="true">拖拽调整尺寸</ShadcnCheckbox>
<ShadcnCheckbox v-model="showRuler" :value="true">{{ t('dataBuilder.text.showRuler') }}</ShadcnCheckbox>
<ShadcnCheckbox v-model="resize" :value="true">{{ t('dataBuilder.text.dragResize') }}</ShadcnCheckbox>

<!-- 辅助线控制 -->
<!-- Helper line control -->
<ShadcnCheckbox v-model="showGuidelines" :value="true">显示辅助线</ShadcnCheckbox>
<ShadcnCheckbox v-model="showGuidelines" :value="true">{{ t('dataBuilder.text.showGuidelines') }}</ShadcnCheckbox>
</div>
</div>

Expand Down Expand Up @@ -222,6 +222,7 @@

<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import { t } from '@/utils/locale'
import { calcSize } from '@/utils/common'
import { ShadcnDataBuilderCanvasEmits, ShadcnDataBuilderCanvasProps, ShadcnDataBuilderPanelChildProps } from './types'
import ShadcnDataBuilderRenderer from './ShadcnDataBuilderRenderer.vue'
Expand Down
Loading

0 comments on commit ade3c1f

Please sign in to comment.