forked from opentiny/tiny-vue
Merge pull request #2068 from opentiny/sync-3.18.0-to-dev
Sync 3.18.0 to dev
This commit is contained in:
commit
98b8a384a3
|
@ -1,12 +1,16 @@
|
|||
<template>
|
||||
<div>
|
||||
<tiny-link>默认链接</tiny-link>
|
||||
<tiny-link @click="handleClick">默认链接</tiny-link>
|
||||
<tiny-link value="默认链接2"></tiny-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { Link as TinyLink } from '@opentiny/vue'
|
||||
|
||||
function handleClick() {
|
||||
console.log('clicked')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
@ -10,4 +10,15 @@ test('基础用法', async ({ page }) => {
|
|||
await expect(link.nth(1)).toHaveText('默认链接2')
|
||||
await link.first().hover()
|
||||
await expect(link.first()).toHaveCSS('color', 'rgb(82, 110, 204)')
|
||||
|
||||
// 测试点击
|
||||
const values = [] as string[]
|
||||
page.on('console', async (msg) => {
|
||||
for (const arg of msg.args()) {
|
||||
values.push(await arg.jsonValue())
|
||||
}
|
||||
})
|
||||
await link.first().click()
|
||||
|
||||
expect(values[0]).toBe('clicked')
|
||||
})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<tiny-link>默认链接</tiny-link>
|
||||
<tiny-link @click="handleClick">默认链接</tiny-link>
|
||||
<tiny-link value="默认链接2"></tiny-link>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -11,6 +11,11 @@ import { Link } from '@opentiny/vue'
|
|||
export default {
|
||||
components: {
|
||||
TinyLink: Link
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
console.log('clicked')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -9,8 +9,14 @@ export default {
|
|||
'en-US': 'Basic Usage'
|
||||
},
|
||||
desc: {
|
||||
'zh-CN': '<p>通过 <code>value</code> 或者默认插槽设置链接显示内容。</p>',
|
||||
'en-US': '<p>Set the link to display content via <code>value</code> or the default slot. </p></p>'
|
||||
'zh-CN': `
|
||||
通过 <code>value</code> 或者默认插槽设置链接显示内容。<br>
|
||||
绑定 <code>click</code> 事件监听点击。 当禁用或配置 <code>href</code> 属性时, 不会触发<code>click</code>事件!
|
||||
`,
|
||||
'en-US': `
|
||||
Set the link to display content via <code>value</code> or the default slot.
|
||||
Bind the click event to listen for clicks.The click event is not triggered when the href attribute is disabled or configured!
|
||||
`
|
||||
},
|
||||
codeFiles: ['basic-usage.vue']
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="content">
|
||||
<tiny-button @click="visible = !visible" :reset-time="0">自定义底部</tiny-button>
|
||||
<tiny-modal v-model="visible" show-footer>
|
||||
<tiny-modal v-model="visible" footer-dragable show-footer>
|
||||
<template #footer>
|
||||
<tiny-button>自定义底部信息</tiny-button>
|
||||
</template>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="content">
|
||||
<tiny-button @click="visible = !visible" :reset-time="0">自定义底部</tiny-button>
|
||||
<tiny-modal v-model="visible" show-footer>
|
||||
<tiny-modal v-model="visible" footer-dragable show-footer>
|
||||
<template #footer>
|
||||
<tiny-button>自定义底部信息</tiny-button>
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,104 @@
|
|||
# 更新日志
|
||||
|
||||
## v2.18.0/v3.18.0
|
||||
|
||||
`2024/08/20`
|
||||
|
||||
## What's Changed
|
||||
|
||||
### Exciting New Features 🎉
|
||||
|
||||
- feat(tree-select): [tree-select] add tree-select component by @kagol in https://github.com/opentiny/tiny-vue/pull/1683
|
||||
- feat: support solidjs (#1566) by @zzcr in https://github.com/opentiny/tiny-vue/pull/1682
|
||||
- feat(tree-menu)[tree-menu]: clearable by @GaoNeng-wWw in https://github.com/opentiny/tiny-vue/pull/1672
|
||||
- feat(tabs): [tabs] Add new specification function by @chenxi-20 in https://github.com/opentiny/tiny-vue/pull/1762
|
||||
- feat(search): [search] add disabled functionality to the search component and adapt to new specifications by @chenxi-20 in https://github.com/opentiny/tiny-vue/pull/1756
|
||||
- feat(fluent-editor): add mobile-first template by @kagol in https://github.com/opentiny/tiny-vue/pull/1763
|
||||
- feat(Switch): [switch] suppor custom open and close icon. by @AcWrong02 in https://github.com/opentiny/tiny-vue/pull/1551
|
||||
- feat(runtime): add directive runtime by @zzcr in https://github.com/opentiny/tiny-vue/pull/1784
|
||||
- fix(warning): fix all warning , fix dialog-box's visible ,default false by @shenjunjian in https://github.com/opentiny/tiny-vue/pull/1792
|
||||
- feat(fluent-editor): optimize fluent-editor mobile-first by @kagol in https://github.com/opentiny/tiny-vue/pull/1794
|
||||
- feat(file-upload): [file-upload]刷新上传组件新规范 by @chenxi-20 in https://github.com/opentiny/tiny-vue/pull/1811
|
||||
- feat(pager): [pager] add new props total-fixed-left by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1819
|
||||
- develop split for smb-design theme by @shenjunjian in https://github.com/opentiny/tiny-vue/pull/1830
|
||||
- feat(fall-menu): [fall-menu]modify smb-theme by @James-9696 in https://github.com/opentiny/tiny-vue/pull/1842
|
||||
- feat(bulletin-board): [bulletin-board] updata bulletin-board xdesign by @wuyiping0628 in https://github.com/opentiny/tiny-vue/pull/1844
|
||||
- feat(link-menu): [link-menu]modify smb-theme by @James-9696 in https://github.com/opentiny/tiny-vue/pull/1846
|
||||
- feat(nav-menu): [nav-menu] updata nav-menu xdesign by @wuyiping0628 in https://github.com/opentiny/tiny-vue/pull/1849
|
||||
- feat(pop-upload): [pop-upload] 刷新popupload规范,增加uploadTip插槽 by @chenxi-20 in https://github.com/opentiny/tiny-vue/pull/1850
|
||||
- feat(pop-upload): [pop-upload] 刷新popupload规范,表格头部优化,增加上传数据统计能力,修复长度限制bug by @chenxi-20 in https://github.com/opentiny/tiny-vue/pull/1852
|
||||
- feat(toggle-menu): [toggle-menu] add smb theme by @James-9696 in https://github.com/opentiny/tiny-vue/pull/1861
|
||||
- feat(color-select-panel): [color-select-panel]modify smb-theme by @James-9696 in https://github.com/opentiny/tiny-vue/pull/1837
|
||||
- fix(button): [button] add ts declaration for button , and remove hook-updated … by @shenjunjian in https://github.com/opentiny/tiny-vue/pull/1853
|
||||
- fix (anchor): [anchor] Fix the issue that the scrolling response lags after the anchor is clicked. Add a tooltip to adapt to the SaaS theme. by @chenxi-20 in https://github.com/opentiny/tiny-vue/pull/1892
|
||||
|
||||
### Bug Fixes 🐛
|
||||
|
||||
- fix(unplugin-virtual-template): fix build internals error in node v18.19.1 by @gweesin in https://github.com/opentiny/tiny-vue/pull/1676
|
||||
- fix(vue-renderless): [radio] fix handleKeydown blocking default events and bubble logic by @Nowitzki41 in https://github.com/opentiny/tiny-vue/pull/1650
|
||||
- fix: fix pnpm site error by @kagol in https://github.com/opentiny/tiny-vue/pull/1702
|
||||
- chore(fluent-editor): update package.json by @kagol in https://github.com/opentiny/tiny-vue/pull/1721
|
||||
- fix(docs): fix components number by @zzcr in https://github.com/opentiny/tiny-vue/pull/1754
|
||||
- fix(tree-menu): [tree-menu] resolve the issue of disabled treemenu components not taking effect by @wuyiping0628 in https://github.com/opentiny/tiny-vue/pull/1736
|
||||
- fix(auto-tip): [auto-tip] Fix the issue where the placement configuration always has old values by @MomoPoppy in https://github.com/opentiny/tiny-vue/pull/1774
|
||||
- fix(rich-text-editor): [rich-text-editor] fix data binding doen't work by @gweesin in https://github.com/opentiny/tiny-vue/pull/1779
|
||||
- fix(playground): could not open playground as Composition mode by @gweesin in https://github.com/opentiny/tiny-vue/pull/1787
|
||||
- fix(picker): fix mobile breakpoint cannot use pc datepicker and timep… by @gweesin in https://github.com/opentiny/tiny-vue/pull/1678
|
||||
- fix(fluent-editor): fix toolbar icon and undo/redo by @kagol in https://github.com/opentiny/tiny-vue/pull/1786
|
||||
- fix: fix layout asider layer error on mobile mode by @gweesin in https://github.com/opentiny/tiny-vue/pull/1778
|
||||
- fix(color-picker): [color-picker,color-select-panel] fix issue 1684 by @GaoNeng-wWw in https://github.com/opentiny/tiny-vue/pull/1686
|
||||
- fix: fix Vue packages version mismatch by @kagol in https://github.com/opentiny/tiny-vue/pull/1791
|
||||
- fix(fluent-editor): fix better-table module by @kagol in https://github.com/opentiny/tiny-vue/pull/1788
|
||||
- fix(fluent-editor): fix image module and optimize toolbar style by @kagol in https://github.com/opentiny/tiny-vue/pull/1799
|
||||
- fix(form): [form] fix text validation style error in other size form … by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1798
|
||||
- fix(tree-menu): [tree-menu] Delete the prefix-icon attribute of the tree-menu component by @wuyiping0628 in https://github.com/opentiny/tiny-vue/pull/1789
|
||||
- fix(grid): fix grid click menu item jump to blank tab in playground c… by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1802
|
||||
- fix(fluent-editor): fix error when execute pnpm site by @kagol in https://github.com/opentiny/tiny-vue/pull/1815
|
||||
- fix(fluent-editor): fix fluent-editor saas theme by @kagol in https://github.com/opentiny/tiny-vue/pull/1814
|
||||
- fix(form): [form] fix content not aligned when display only close #1698 by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1805
|
||||
- fix(warning): fix unocss version conflicts by @gweesin in https://github.com/opentiny/tiny-vue/pull/1825
|
||||
- fix(playground): fix old version runtime not found close #1817 by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1818
|
||||
- fix(fluent-editor): fix style error by @kagol in https://github.com/opentiny/tiny-vue/pull/1829
|
||||
- fix(fluent-editor): fix style missing by @kagol in https://github.com/opentiny/tiny-vue/pull/1831
|
||||
- fix(fluent-editor): fix console warn by @kagol in https://github.com/opentiny/tiny-vue/pull/1833
|
||||
- fix(select): [select] Adapt to multiple+disabled+displayOnly scenarios with different themes by @MomoPoppy in https://github.com/opentiny/tiny-vue/pull/1835
|
||||
- fix(fluent-editor): fix tasklist format by @kagol in https://github.com/opentiny/tiny-vue/pull/1845
|
||||
- fix(base-select): [base-select] fix check all style by @kagol in https://github.com/opentiny/tiny-vue/pull/1848
|
||||
- fix(form): [form] fix dynamic change size fail in prod mode by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1857
|
||||
- fix(theme): [anchor] Fixed the theme switch bug and the anchor line color under the default theme. by @chenxi-20 in https://github.com/opentiny/tiny-vue/pull/1854
|
||||
- fix(pop-confirm): [pop-confirm] remove m funtion from pc template by @shenjunjian in https://github.com/opentiny/tiny-vue/pull/1863
|
||||
- fix(build): fix some bugs when build components by @zzcr in https://github.com/opentiny/tiny-vue/pull/1873
|
||||
- fix(theme): Fixed the issue that multiple root files are generated when the theme is packaged. by @chenxi-20 in https://github.com/opentiny/tiny-vue/pull/1893
|
||||
|
||||
### Other Changes
|
||||
|
||||
- chore(base-select): [base-select] add mark and metaData by @kagol in https://github.com/opentiny/tiny-vue/pull/1681
|
||||
- chore: update workflow node-version to 20 by @kagol in https://github.com/opentiny/tiny-vue/pull/1742
|
||||
- docs(changelog): update changelog and runtime doc by @zzcr in https://github.com/opentiny/tiny-vue/pull/1749
|
||||
- feat: update site design style by @zzcr in https://github.com/opentiny/tiny-vue/pull/1752
|
||||
- docs(sites): fix docs typo by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1758
|
||||
- docs(tree-select): [tree-select] optimize demo/api docs by @kagol in https://github.com/opentiny/tiny-vue/pull/1743
|
||||
- docs(fluent-editor): optimize demo/api docs by @kagol in https://github.com/opentiny/tiny-vue/pull/1757
|
||||
- docs(grid): add grid-column props docs by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1782
|
||||
- docs(dialog-box): [dialog-box] update document by @James-9696 in https://github.com/opentiny/tiny-vue/pull/1732
|
||||
- docs(numeric): [numeric]optimized docs of numeric component by @James-9696 in https://github.com/opentiny/tiny-vue/pull/1753
|
||||
- docs(button-group): add new slot api version by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1797
|
||||
- docs(fluent-editor): optimize fluent-editor mobile-first docs by @kagol in https://github.com/opentiny/tiny-vue/pull/1804
|
||||
- fix(numeric): modify docs by @James-9696 in https://github.com/opentiny/tiny-vue/pull/1803
|
||||
- feat: update vue-docs by @zzcr in https://github.com/opentiny/tiny-vue/pull/1810
|
||||
- docs(fluent-editor): optimize fluent-editor pc docs by @kagol in https://github.com/opentiny/tiny-vue/pull/1807
|
||||
- docs(theme): add custom cssvar variable prefix documentation by @zzcr in https://github.com/opentiny/tiny-vue/pull/1806
|
||||
- feat(link): add link‘s typescript and docs by @shenjunjian in https://github.com/opentiny/tiny-vue/pull/1816
|
||||
- feat(readme): add readme files to main packages by @zzcr in https://github.com/opentiny/tiny-vue/pull/1826
|
||||
- docs(fluent-editor): add fluent-editor docs by @kagol in https://github.com/opentiny/tiny-vue/pull/1834
|
||||
- docs(fluent-editor): optimize mobile-first demo by @kagol in https://github.com/opentiny/tiny-vue/pull/1836
|
||||
- ci: add automate script to transform demos to add "Tiny" prefix by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/1832
|
||||
|
||||
## New Contributors
|
||||
|
||||
- @Nowitzki41 made their first contribution in https://github.com/opentiny/tiny-vue/pull/1650
|
||||
- @Simon-He95 made their first contribution in https://github.com/opentiny/tiny-vue/pull/1839
|
||||
|
||||
## v2.17.0/v3.17.0
|
||||
|
||||
`2024/07/17`
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@opentiny/vue-docs",
|
||||
"version": "3.18.0",
|
||||
"version": "3.18.5",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
|
@ -59,6 +59,7 @@
|
|||
"@vue/compiler-sfc": "^3.2.37",
|
||||
"chalk": "4.1.2",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"fast-glob": "^3.2.12",
|
||||
"fs-extra": "^10.1.0",
|
||||
"less": "^4.1.3",
|
||||
"markdown-it": "^13.0.1",
|
||||
|
|
|
@ -9,8 +9,8 @@ import 'uno.css'
|
|||
// highlight默认样式
|
||||
import 'highlight.js/styles/default.css'
|
||||
|
||||
// markdown样式引用的是github-markdown.css
|
||||
import 'github-markdown-css/github-markdown.css'
|
||||
// 只使用markdown的亮色主题
|
||||
import 'github-markdown-css/github-markdown-light.css'
|
||||
import './assets/index.less'
|
||||
import './style.css'
|
||||
|
||||
|
|
|
@ -451,7 +451,7 @@ export default defineComponent({
|
|||
})
|
||||
}
|
||||
}
|
||||
}, 600)
|
||||
}, 0)
|
||||
}
|
||||
|
||||
// 在singleDemo情况时,才需要滚动示例区域到顶
|
||||
|
@ -557,7 +557,12 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
// F5刷新加载时,跳到当前示例
|
||||
scrollByHash(hash)
|
||||
// 应当在所有demo渲染完毕后在滚动,否则滚动完位置后,demo渲染会使滚动位置错位
|
||||
setTimeout(() => {
|
||||
nextTick(() => {
|
||||
scrollByHash(hash)
|
||||
})
|
||||
}, 0)
|
||||
})
|
||||
.finally(() => {
|
||||
// 获取组件贡献者
|
||||
|
@ -645,11 +650,12 @@ export default defineComponent({
|
|||
router.push(data.link)
|
||||
} else if (apiModeState.demoMode === 'default' && data.link.startsWith('#')) {
|
||||
// 多示例模式,自动会切到相应的位置。只需要记录singleDemo就好了
|
||||
e.preventDefault()
|
||||
const hash = data.link.slice(1)
|
||||
state.currDemoId = hash
|
||||
state.singleDemo = state.currJson.demos.find((d) => d.demoId === hash)
|
||||
|
||||
e.preventDefault()
|
||||
router.push(data.link)
|
||||
scrollByHash(hash)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
<script>
|
||||
import { defineComponent, reactive, toRefs, onMounted, onUnmounted, watch, nextTick, ref } from 'vue'
|
||||
import { Tooltip, Radio, RadioGroup, Popover } from '@opentiny/vue'
|
||||
import { Tooltip, Radio, RadioGroup, Popover, Notify } from '@opentiny/vue'
|
||||
import { iconUpWard } from '@opentiny/vue-icon'
|
||||
import debounce from '@opentiny/vue-renderless/common/deps/debounce'
|
||||
import { i18nByKey, useApiMode, useTemplateMode } from '@/tools'
|
||||
|
@ -129,6 +129,17 @@ export default defineComponent({
|
|||
initBottomVal: null, // 初始底部偏移
|
||||
isSettingsAside: false // 是否贴边
|
||||
})
|
||||
let isShowTip = false
|
||||
const showTip = () => {
|
||||
Notify({
|
||||
type: 'info',
|
||||
title: '请注意',
|
||||
message: '主题切换成功,如有部分主题样式不生效,请尝试手动刷新页面即可',
|
||||
position: 'bottom-right',
|
||||
duration: 3000
|
||||
})
|
||||
isShowTip = true
|
||||
}
|
||||
|
||||
if (isPlus) {
|
||||
state.styleSettings = state.styleSettings.filter((item) => item.name !== 'apiMode')
|
||||
|
@ -164,6 +175,10 @@ export default defineComponent({
|
|||
themeItemClick(node) {
|
||||
const val = node?.value || 'tiny-smb-theme'
|
||||
changeTheme(val)
|
||||
|
||||
if (!isShowTip) {
|
||||
showTip()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,30 @@ import vue3SvgPlugin from 'vite-svg-loader'
|
|||
import { getAlias, pathFromWorkspaceRoot, getOptimizeDeps } from '../../internals/cli/src/config/vite'
|
||||
import virtualTemplatePlugin from '@opentiny-internal/unplugin-virtual-template/vite'
|
||||
import tailwindCss from 'tailwindcss'
|
||||
import fg from 'fast-glob'
|
||||
import fs from 'fs-extra'
|
||||
|
||||
const delStatic = () => {
|
||||
let config
|
||||
return {
|
||||
name: 'inline-plugin-del-static',
|
||||
apply: 'build',
|
||||
configResolved(_config) {
|
||||
config = _config
|
||||
},
|
||||
async closeBundle() {
|
||||
const targetPath = path.join(config.build.outDir, '@demos')
|
||||
const files = await fg(['**/*.spec.js', '**/*.spec.ts'], {
|
||||
dot: true,
|
||||
cwd: targetPath
|
||||
})
|
||||
files.forEach((filename) => {
|
||||
const filePath = path.join(targetPath, filename)
|
||||
fs.unlink(filePath)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig((config) => {
|
||||
const env = loadEnv(config.mode, process.cwd() + '/env', '')
|
||||
|
@ -23,17 +47,17 @@ export default defineConfig((config) => {
|
|||
const menuPath = isSaas ? path.resolve('./demos/saas') : path.resolve(demosPath)
|
||||
const copyTarget = [
|
||||
{
|
||||
src: `${demosPath}/**`,
|
||||
src: `${demosPath}/*`,
|
||||
dest: '@demos'
|
||||
},
|
||||
{
|
||||
src: `${apisPath}/**`,
|
||||
src: `${apisPath}/*`,
|
||||
dest: '@demos/apis'
|
||||
}
|
||||
]
|
||||
if (isSaas) {
|
||||
copyTarget.push({
|
||||
src: `./demos/mobile-first/**`,
|
||||
src: `./demos/mobile-first/*`,
|
||||
dest: '@demos/mobile-first'
|
||||
})
|
||||
}
|
||||
|
@ -75,7 +99,8 @@ export default defineConfig((config) => {
|
|||
Unocss(UnoCssConfig),
|
||||
viteStaticCopy({
|
||||
targets: copyTarget
|
||||
})
|
||||
}),
|
||||
delStatic()
|
||||
],
|
||||
optimizeDeps: getOptimizeDeps(3),
|
||||
build: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@opentiny/vue-renderless",
|
||||
"version": "3.18.0",
|
||||
"version": "3.18.2",
|
||||
"private": true,
|
||||
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
|
||||
"author": "OpenTiny Team",
|
||||
|
@ -43,4 +43,4 @@
|
|||
"esno": "^4.7.0",
|
||||
"tsup": "7.2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,6 +138,7 @@ export const beforeUnmouted =
|
|||
isMobileFirstMode && off(window, 'resize', api.resetDragStyle)
|
||||
off(document, 'keydown', api.handleGlobalKeydownEvent)
|
||||
off(window, 'hashchange', api.handleHashChange)
|
||||
off(window, 'resize', api.resetModalViewPosition)
|
||||
api.removeMsgQueue()
|
||||
api.hideScrollbar()
|
||||
|
||||
|
@ -292,13 +293,13 @@ export const open =
|
|||
} else {
|
||||
modalBoxElem.style.left = `${clientVisibleWidth / 2 - modalBoxElem.offsetWidth / 2}px`
|
||||
}
|
||||
|
||||
if (
|
||||
modalBoxElem.offsetHeight + modalBoxElem.offsetTop + (props.marginSize as number) >
|
||||
clientVisibleHeight
|
||||
) {
|
||||
modalBoxElem.style.top = `${props.marginSize}px`
|
||||
}
|
||||
on(window, 'resize', api.resetModalViewPosition)
|
||||
}
|
||||
|
||||
if (props.fullscreen) {
|
||||
|
@ -915,3 +916,11 @@ export const showScrollbar = (lockScrollClass) => () => {
|
|||
export const hideScrollbar = (lockScrollClass) => () => {
|
||||
removeClass(document.body, lockScrollClass)
|
||||
}
|
||||
|
||||
export const resetModalViewPosition = (api: IModalApi) => () => {
|
||||
const modalBoxElement = api.getBox()
|
||||
const viewportWindow = getViewportWindow()
|
||||
const clientVisibleWidth =
|
||||
viewportWindow.document.documentElement.clientWidth || viewportWindow.document.body.clientWidth
|
||||
modalBoxElement.style.left = `${clientVisibleWidth / 2 - modalBoxElement.offsetWidth / 2}px`
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ import {
|
|||
cancelEvent,
|
||||
open,
|
||||
resetDragStyle,
|
||||
resetModalViewPosition,
|
||||
computedBoxStyle,
|
||||
handleHashChange,
|
||||
showScrollbar,
|
||||
|
@ -64,7 +65,8 @@ export const api = [
|
|||
'cancelEvent',
|
||||
'open',
|
||||
'beforeUnmouted',
|
||||
'resetDragStyle'
|
||||
'resetDragStyle',
|
||||
'resetModalViewPosition'
|
||||
]
|
||||
|
||||
export const renderless = (
|
||||
|
@ -121,6 +123,7 @@ export const renderless = (
|
|||
mousedownEvent: mousedownEvent({ api, nextTick, props, state, emit, isMobileFirstMode }),
|
||||
dragEvent: dragEvent({ api, emit, parent, props, state }),
|
||||
resetDragStyle: resetDragStyle(api),
|
||||
resetModalViewPosition: resetModalViewPosition(api),
|
||||
computedBoxStyle: computedBoxStyle({ props, isMobileFirstMode }),
|
||||
watchVisible: watchVisible({ api, props }),
|
||||
hideScrollbar: hideScrollbar(lockScrollClass),
|
||||
|
|
|
@ -214,8 +214,8 @@ export const mounted =
|
|||
on(window, 'resize', api.calcWidth)
|
||||
|
||||
if (router) {
|
||||
state.afterEach = () => {
|
||||
api.setActiveMenu(api.getSelectedIndex(router.currentRoute.path))
|
||||
state.afterEach = (to) => {
|
||||
api.setActiveMenu(api.getSelectedIndex(to.path))
|
||||
}
|
||||
|
||||
router.afterEach(state.afterEach)
|
||||
|
@ -240,6 +240,7 @@ export const unMounted =
|
|||
export const getSelectedIndex =
|
||||
(state: INavMenuState) =>
|
||||
(path: string): number => {
|
||||
if (!path) return
|
||||
let length = state.data.length
|
||||
let index = -1
|
||||
|
||||
|
@ -460,6 +461,7 @@ export const clickMenu =
|
|||
export const skip =
|
||||
({ api, router, fields }: Pick<INavMenuRenderlessParams, 'api' | 'router' | 'fields'>) =>
|
||||
(item: menuItemType, flag = false): string | null => {
|
||||
if (!router) return
|
||||
if (item.isFullUrl) {
|
||||
const { urlField = 'url' } = fields || {}
|
||||
const router = item[urlField] || item.route
|
||||
|
@ -472,7 +474,7 @@ export const skip =
|
|||
: `/${item.route || ''}`.replace(/^\/+/, '/').replace('#/', '')
|
||||
|
||||
if (address) {
|
||||
return router.push(address)
|
||||
return router?.push(address)
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
|
|
|
@ -383,7 +383,7 @@ const getOptionOfSetSelected = ({ api, props }) => {
|
|||
}
|
||||
|
||||
// tiny 新增
|
||||
if (!option.currentLabel) {
|
||||
if (!option.state.currentLabel) {
|
||||
api.clearNoMatchValue('')
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ export interface IModalApi {
|
|||
mousedownEvent: (event: MouseEvent) => void
|
||||
dragEvent: (event: MouseEvent) => void
|
||||
resetDragStyle: () => void
|
||||
resetModalViewPosition: () => void
|
||||
}
|
||||
|
||||
export type IModalRenderlessParamUtils = ISharedRenderlessParamUtils<IModalConstants>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"name": "@opentiny/vue-theme",
|
||||
"version": "3.18.0",
|
||||
"type": "module",
|
||||
"version": "3.18.1",
|
||||
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
|
||||
"author": "OpenTiny Team",
|
||||
"license": "MIT",
|
||||
|
@ -88,4 +87,4 @@
|
|||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -224,13 +224,12 @@
|
|||
.@{tree-node-prefix-cls}__children {
|
||||
overflow: visible !important;
|
||||
transition: 0.3s opacity ease-in-out;
|
||||
position: relative;
|
||||
|
||||
&
|
||||
.@{tree-node-prefix-cls}__wrapper:not(:last-child)
|
||||
> .@{tree-node-prefix-cls}
|
||||
> .@{tree-node-prefix-cls}__children {
|
||||
position: relative;
|
||||
|
||||
.@{tree-node-prefix-cls}__children-indent {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
|
|
|
@ -27,7 +27,8 @@ export default defineComponent({
|
|||
<div
|
||||
data-tag="tiny-anchor-link"
|
||||
class={[type === 'line' && 'ml-4 cursor-pointer leading-9', type === 'dot' && 'relative pl-2.5']}
|
||||
key={item.key}>
|
||||
key={item.key}
|
||||
>
|
||||
<a
|
||||
data-tag="tiny-anchor-link-title"
|
||||
href={item.link}
|
||||
|
@ -41,7 +42,8 @@ export default defineComponent({
|
|||
]}
|
||||
onClick={(e) => linkClick(e, item)}
|
||||
ref={item.link}
|
||||
v-auto-tip>
|
||||
v-auto-tip
|
||||
>
|
||||
{item.title}
|
||||
</a>
|
||||
{item.children ? renderLinks(item.children) : null}
|
||||
|
@ -63,11 +65,13 @@ export default defineComponent({
|
|||
<div
|
||||
data-tag="tiny-anchor__wrapper"
|
||||
class={[isAffix ? 'fixed z-10' : '', type === 'line' && '', type === 'dot' && 'w-50']}
|
||||
ref="anchorWrapRef">
|
||||
ref="anchorWrapRef"
|
||||
>
|
||||
<div
|
||||
data-tag="tiny-anchor"
|
||||
class={[type === 'line' && 'w-50 relative text-color-text-primary text-sm', type === 'dot' && 'px-4']}
|
||||
ref="anchorRef">
|
||||
ref="anchorRef"
|
||||
>
|
||||
{type === 'line' && renderMask}
|
||||
{type === 'line' && renderOrbit}
|
||||
{links && renderLinks(links)}
|
||||
|
|
|
@ -59,8 +59,8 @@
|
|||
day.isLast || day.isNext
|
||||
? 'is-next-or-last'
|
||||
: isToday(day) || isSelectedDate(day)
|
||||
? 'is-selected'
|
||||
: '',
|
||||
? 'is-selected'
|
||||
: '',
|
||||
day.disabled ? 'is-disabled' : ''
|
||||
]"
|
||||
>
|
||||
|
|
|
@ -84,7 +84,8 @@ export default defineComponent({
|
|||
indeterminate={!node.checked && node.indeterminate}
|
||||
disabled={state.isDisabled}
|
||||
onChange={this.handleMultiCheckChange}
|
||||
onClick={stopPropagation}></tiny-checkbox>
|
||||
onClick={stopPropagation}
|
||||
></tiny-checkbox>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -101,7 +102,8 @@ export default defineComponent({
|
|||
disabled={isDisabled}
|
||||
label={value}
|
||||
onClick={stopPropagation}
|
||||
onChange={this.handleCheckChange}>
|
||||
onChange={this.handleCheckChange}
|
||||
>
|
||||
<span></span>
|
||||
</tiny-radio>
|
||||
)
|
||||
|
|
|
@ -302,7 +302,8 @@ export default defineComponent({
|
|||
limit: this.limit
|
||||
})}
|
||||
placement="top"
|
||||
popper-options={popperConfig}>
|
||||
popper-options={popperConfig}
|
||||
>
|
||||
<icon-help-query class="-mt-0.5 fill-color-none-hover" />
|
||||
</tiny-tooltip>
|
||||
)
|
||||
|
@ -613,7 +614,8 @@ export default defineComponent({
|
|||
marginwidth="0"
|
||||
marginheight="0"
|
||||
scrolling="no"
|
||||
src={iframeUrl}></iframe>
|
||||
src={iframeUrl}
|
||||
></iframe>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,7 +208,8 @@ export default defineComponent({
|
|||
effect="light"
|
||||
content={(slots.tip && slots.tip()) || tipMsg}
|
||||
placement="right"
|
||||
popper-options={popperConfig}>
|
||||
popper-options={popperConfig}
|
||||
>
|
||||
<div class="prompt-tip">
|
||||
<TinyIconHelpCircle />
|
||||
</div>
|
||||
|
@ -253,7 +254,8 @@ export default defineComponent({
|
|||
return [
|
||||
<TinyIconSuccessful class="thumb-success-icon" />,
|
||||
<span
|
||||
class={['thumb-item-name', !showDel ? 'hide-close-icon' : '', !showDownload ? 'hide-download-icon' : '']}>
|
||||
class={['thumb-item-name', !showDel ? 'hide-close-icon' : '', !showDownload ? 'hide-download-icon' : '']}
|
||||
>
|
||||
{file.name}
|
||||
</span>,
|
||||
getThumIcon(file)
|
||||
|
@ -457,7 +459,8 @@ export default defineComponent({
|
|||
marginwidth="0"
|
||||
marginheight="0"
|
||||
scrolling="no"
|
||||
src={iframeUrl}></iframe>
|
||||
src={iframeUrl}
|
||||
></iframe>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
{
|
||||
"name": "@opentiny/vue-grid",
|
||||
"version": "3.18.0",
|
||||
"type": "module",
|
||||
"version": "3.18.2",
|
||||
"description": "",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"main": "lib/index.js",
|
||||
"module": "index.ts",
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@opentiny-internal/vue-test-utils": "workspace:*",
|
||||
"vitest": "^0.31.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "pnpm -w build:ui $npm_package_name",
|
||||
"//postversion": "pnpm build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@opentiny/vue-renderless": "workspace:~",
|
||||
"@opentiny/vue-locale": "workspace:~",
|
||||
"@opentiny/vue-modal": "workspace:~",
|
||||
"@opentiny/vue-common": "workspace:~",
|
||||
"@opentiny/vue-dropdown": "workspace:~",
|
||||
"@opentiny/vue-dropdown-item": "workspace:~",
|
||||
"@opentiny/vue-dropdown-menu": "workspace:~",
|
||||
"@opentiny/vue-exception": "workspace:~",
|
||||
"@opentiny/vue-pager": "workspace:~",
|
||||
"@opentiny/vue-icon": "workspace:~",
|
||||
"@opentiny/vue-tooltip": "workspace:~",
|
||||
"@opentiny/vue-theme": "workspace:~",
|
||||
"@opentiny/vue-tag": "workspace:~",
|
||||
"@opentiny/vue-loading": "workspace:~",
|
||||
"@opentiny/vue-common": "workspace:~"
|
||||
"@opentiny/vue-locale": "workspace:~",
|
||||
"@opentiny/vue-modal": "workspace:~",
|
||||
"@opentiny/vue-pager": "workspace:~",
|
||||
"@opentiny/vue-renderless": "workspace:~",
|
||||
"@opentiny/vue-tag": "workspace:~",
|
||||
"@opentiny/vue-theme": "workspace:~",
|
||||
"@opentiny/vue-tooltip": "workspace:~"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
"devDependencies": {
|
||||
"@opentiny-internal/vue-test-utils": "workspace:*",
|
||||
"vitest": "^0.31.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -522,7 +522,8 @@ function renderRowGroupData({ $table, virtualRow, row, rowGroup, rowid, rows, ta
|
|||
data-rowid={rowid}
|
||||
onMouseout={() => (row.hover = false)}
|
||||
onMouseover={() => (row.hover = true)}
|
||||
onClick={onClick}>
|
||||
onClick={onClick}
|
||||
>
|
||||
{tds}
|
||||
</tr>
|
||||
)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* eslint-disable vue/no-mutating-props */
|
||||
/* eslint-disable vue/no-use-computed-property-like-method */
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
|
@ -289,20 +288,25 @@ export default defineComponent({
|
|||
}
|
||||
}
|
||||
|
||||
this.popperJS && this.popperJS.destroy() && (this.popperJS = null)
|
||||
this.$nextTick(() => {
|
||||
const { targetElemParentTr, id } = this.filterStore
|
||||
const reference = targetElemParentTr && targetElemParentTr.querySelector(`svg.tiny-grid-filter__btn.${id}`)
|
||||
const popper = this.$el
|
||||
if (this.popperJS) {
|
||||
this.popperJS.destroy()
|
||||
this.popperJS = null
|
||||
}
|
||||
if (this.visible) {
|
||||
this.$nextTick(() => {
|
||||
const { targetElemParentTr, id } = this.filterStore
|
||||
const reference = targetElemParentTr && targetElemParentTr.querySelector(`svg.tiny-grid-filter__btn.${id}`)
|
||||
const popper = this.$el
|
||||
|
||||
popper.style.zIndex = PopupManager.nextZIndex()
|
||||
popper.style.zIndex = PopupManager.nextZIndex()
|
||||
|
||||
if (this.visible) {
|
||||
this.popperJS = new PopperJS(reference, popper, {
|
||||
placement: 'bottom-end'
|
||||
}).update()
|
||||
}
|
||||
})
|
||||
placement: 'bottom-end',
|
||||
gpuAcceleration: false
|
||||
})
|
||||
popper.style.display = 'block'
|
||||
})
|
||||
}
|
||||
}),
|
||||
// 基础清除选项
|
||||
renderBase() {
|
||||
|
|
|
@ -103,7 +103,9 @@ function mergeTreeConfig(_vm) {
|
|||
}
|
||||
|
||||
const renderEmptyPartFn = (opt) => {
|
||||
const { _vm, tableData, $slots, renderEmpty } = opt
|
||||
const { _vm, tableData } = opt
|
||||
const { $grid = {}, renderEmpty } = _vm
|
||||
const { $slots } = $grid
|
||||
return () => {
|
||||
let emptyPartVnode = null
|
||||
let { computerTableBodyHeight } = _vm
|
||||
|
@ -272,21 +274,13 @@ function getRenderer(opt) {
|
|||
visibleColumn
|
||||
} = opt
|
||||
const { $grid, ctxMenuStore, editRules, filterStore, footerData, footerMethod, hasFilter, hasTip, height, id } = _vm
|
||||
const {
|
||||
isCtxMenu,
|
||||
isResizable,
|
||||
renderEmpty,
|
||||
scrollbarHeight,
|
||||
selectToolbarStore,
|
||||
tooltipContentOpts,
|
||||
vaildTipOpts,
|
||||
validOpts
|
||||
} = _vm
|
||||
const { isCtxMenu, isResizable, scrollbarHeight, selectToolbarStore, tooltipContentOpts, vaildTipOpts, validOpts } =
|
||||
_vm
|
||||
const { selectToolbar, renderedToolbar } = $grid
|
||||
|
||||
const renderHeader = () =>
|
||||
showHeader ? h(GridHeader, { ref: 'tableHeader', props, class: _vm.viewCls('tableHeader') }) : [null]
|
||||
const renderEmptyPart = renderEmptyPartFn({ _vm, tableData, $slots, renderEmpty })
|
||||
const renderEmptyPart = renderEmptyPartFn({ _vm, tableData })
|
||||
const renderFooter = renderFooterFn({ _vm, showFooter, footerData, footerMethod, tableColumn, visibleColumn, vSize })
|
||||
const renderResizeBar = renderResizeBarFn({ _vm, isResizable, overflowX, scrollbarHeight })
|
||||
const arg1 = { hasFilter, optimizeOpts, filterStore, isCtxMenu, ctxMenuStore, hasTip, tooltipContentOpts }
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
{
|
||||
"name": "@opentiny/vue-link",
|
||||
"version": "3.18.0",
|
||||
"type": "module",
|
||||
"version": "3.18.1",
|
||||
"description": "",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"main": "lib/index.js",
|
||||
"module": "index.ts",
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@opentiny-internal/vue-test-utils": "workspace:*",
|
||||
"vitest": "^0.31.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "pnpm -w build:ui $npm_package_name",
|
||||
"//postversion": "pnpm build"
|
||||
|
@ -19,5 +16,8 @@
|
|||
"@opentiny/vue-renderless": "workspace:~",
|
||||
"@opentiny/vue-theme": "workspace:~"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
"devDependencies": {
|
||||
"@opentiny-internal/vue-test-utils": "workspace:*",
|
||||
"vitest": "^0.31.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,17 +37,6 @@ export const linkProps = {
|
|||
export default defineComponent({
|
||||
name: $prefix + 'Link',
|
||||
props: linkProps,
|
||||
emits: {
|
||||
click(_ev: MouseEvent) {
|
||||
return true
|
||||
}
|
||||
},
|
||||
slots: Object as SlotsType<{
|
||||
/** 默认插槽 */
|
||||
default: {}
|
||||
/** 图标插槽 */
|
||||
icon: {}
|
||||
}>,
|
||||
setup(props, context) {
|
||||
return $setup({ props, context, template })
|
||||
}
|
||||
|
|
|
@ -193,7 +193,8 @@ export default defineComponent({
|
|||
role="tooltip"
|
||||
aria-hidden={this.disabled || !this.state.showPopper ? 'true' : 'false'}
|
||||
onMouseenter={() => mouseenter()}
|
||||
onMouseleave={() => mouseleave()}>
|
||||
onMouseleave={() => mouseleave()}
|
||||
>
|
||||
{addWrapper ? (
|
||||
<div class="tiny-tooltip__content-wrapper" style={`max-height:${this.contentMaxHeight}`}>
|
||||
{content}
|
||||
|
|
|
@ -97,7 +97,8 @@ export default defineComponent({
|
|||
isBubbleMode ? 'sm:my-0' : !isShowTitle ? 'sm:mt-0 sm:mb-3' : 'sm:my-3'
|
||||
}`
|
||||
: 'h-full'
|
||||
}>
|
||||
}
|
||||
>
|
||||
{state.currentBreakpoint === 'default' && tipSlot && (
|
||||
<div class="flex items-center sm:hidden inline-block text-sm">{tipSlot}</div>
|
||||
)}
|
||||
|
@ -107,7 +108,8 @@ export default defineComponent({
|
|||
class="h-full"
|
||||
onClick={($event) => handleClick($event, sourceType)}
|
||||
onKeydown={handleKeydown}
|
||||
tabindex="0">
|
||||
tabindex="0"
|
||||
>
|
||||
{listType === 'drag-single' ? (
|
||||
<UploadDragger customClass={customClass} disabled={disabled} onFile={uploadFiles}>
|
||||
{defaultSlot}
|
||||
|
@ -124,7 +126,8 @@ export default defineComponent({
|
|||
class="h-full"
|
||||
onClick={($event) => handleClick($event, sourceType)}
|
||||
onKeydown={handleKeydown}
|
||||
tabindex="0">
|
||||
tabindex="0"
|
||||
>
|
||||
{listType === 'drag-single' ? (
|
||||
<UploadDragger customClass={customClass} disabled={disabled} onFile={uploadFiles}>
|
||||
{defaultSlot}
|
||||
|
@ -141,7 +144,8 @@ export default defineComponent({
|
|||
{!promptTip && tipMessage && (
|
||||
<div
|
||||
title={tipMessage}
|
||||
class="hidden sm:block text-xs leading-4 overflow-hidden text-ellipsis whitespace-nowrap text-color-text-placeholder ml-2 cursor-pointer">
|
||||
class="hidden sm:block text-xs leading-4 overflow-hidden text-ellipsis whitespace-nowrap text-color-text-placeholder ml-2 cursor-pointer"
|
||||
>
|
||||
{tipMessage}
|
||||
</div>
|
||||
)}
|
||||
|
|
Loading…
Reference in New Issue