diff --git a/examples/sites/demos/apis/dialog-select.js b/examples/sites/demos/apis/dialog-select.js
index 652492222..c59d30a0d 100644
--- a/examples/sites/demos/apis/dialog-select.js
+++ b/examples/sites/demos/apis/dialog-select.js
@@ -434,6 +434,20 @@ export default {
mode: ['pc'],
pcDemo: ''
},
+ {
+ name: 'footer-buttons',
+ type: 'Slot',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义弹窗底部按钮',
+ 'en-US': 'Custom Pop Up Bottom buttons'
+ },
+ metaData: {
+ new: '3.18.0'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
{
name: 'option',
type: 'Slot',
diff --git a/examples/sites/demos/apis/dropdown.js b/examples/sites/demos/apis/dropdown.js
index eb85d5092..87624dcdf 100644
--- a/examples/sites/demos/apis/dropdown.js
+++ b/examples/sites/demos/apis/dropdown.js
@@ -228,6 +228,22 @@ export default {
},
mode: ['pc'],
pcDemo: 'visible-arrow'
+ },
+ {
+ name: 'lazy-show-popper',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否懒加载下拉菜单及内部的项,以优化性能,默认初始全加载菜单及内部项。',
+ 'en-US':
+ 'Indicates whether to lazily load the drop-down menu and internal items to optimize performance. The default value is false. The menu and internal items are loaded initially.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'lazy-show-popper',
+ mfDemo: '',
+ metaData: {
+ experimental: '3.18.0'
+ }
}
],
events: [
diff --git a/examples/sites/demos/apis/file-upload.js b/examples/sites/demos/apis/file-upload.js
index 0b4fa48a1..ced644b7b 100644
--- a/examples/sites/demos/apis/file-upload.js
+++ b/examples/sites/demos/apis/file-upload.js
@@ -262,7 +262,8 @@ export default {
'zh-CN': '限制文件大小,单位为 KB;当为 Number 类型时,小于该值停止上传;为数组时[min,max] 设置上传范围',
'en-US': ''
},
- mode: ['mobile-first'],
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'file-size',
mfDemo: ''
},
{
diff --git a/examples/sites/demos/apis/grid.js b/examples/sites/demos/apis/grid.js
index f883c38d6..d0c60e882 100644
--- a/examples/sites/demos/apis/grid.js
+++ b/examples/sites/demos/apis/grid.js
@@ -1073,6 +1073,19 @@ export default {
}
],
events: [
+ {
+ name: 'after-refresh-column',
+ type: '()=> void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在新增或者删除列后,列配置是异步更新的,列配置刷新后触发的回调',
+ 'en-US':
+ 'After adding or deleting a column, the column configuration is updated asynchronously, and the callback is triggered after the column configuration is refreshed.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'grid-dynamically-columns#column-switching-scroll',
+ mfDemo: ''
+ },
{
name: 'before-page-change',
typeAnchorName: 'IBeforePageChangeArgs',
diff --git a/examples/sites/demos/apis/guide.js b/examples/sites/demos/apis/guide.js
index a8159384c..6d973be0b 100644
--- a/examples/sites/demos/apis/guide.js
+++ b/examples/sites/demos/apis/guide.js
@@ -175,7 +175,7 @@ interface IDomData {
//销毁的回调函数
destroy: () => void
// 完成的回调函数
- completey: () => void
+ complete: () => void
// 需要设置的按钮组
button: {
diff --git a/examples/sites/demos/apis/input.js b/examples/sites/demos/apis/input.js
index 415a6ce86..1c64313ca 100644
--- a/examples/sites/demos/apis/input.js
+++ b/examples/sites/demos/apis/input.js
@@ -396,6 +396,21 @@ export default {
mobileDemo: 'counter',
mfDemo: ''
},
+ {
+ name: 'show-tooltip',
+ type: 'boolean',
+ defaultValue: 'true',
+ metaData: {
+ new: '3.18.0'
+ },
+ desc: {
+ 'zh-CN': '只读状态下,文本超出是否悬浮提示',
+ 'en-US': 'In the read-only state, whether the text exceeds the floating prompt'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'size',
+ mfDemo: ''
+ },
{
name: 'size',
type: "'medium' | 'small' | 'mini'",
diff --git a/examples/sites/demos/apis/tree.js b/examples/sites/demos/apis/tree.js
index bd9ada2b5..b4a762026 100644
--- a/examples/sites/demos/apis/tree.js
+++ b/examples/sites/demos/apis/tree.js
@@ -491,6 +491,17 @@ export default {
},
mode: ['pc'],
pcDemo: 'edit'
+ },
+ {
+ name: 'highlight-query',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '通过 highlightQuery
属性,是否在匹配的节点中,高亮搜索文字。 ',
+ 'en-US': 'Indicates whether to highlight the search text in the matched node.'
+ },
+ mode: ['pc'],
+ pcDemo: 'filter-view'
}
],
events: [
diff --git a/examples/sites/demos/mobile-first/app/file-upload/file-size-array.vue b/examples/sites/demos/mobile-first/app/file-upload/file-size-array.vue
new file mode 100644
index 000000000..68e6ec2cd
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/file-upload/file-size-array.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/file-upload/file-size.vue b/examples/sites/demos/mobile-first/app/file-upload/file-size.vue
new file mode 100644
index 000000000..421ce9c3a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/file-upload/file-size.vue
@@ -0,0 +1,76 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/file-upload/webdoc/file-upload.js b/examples/sites/demos/mobile-first/app/file-upload/webdoc/file-upload.js
index 8d7993fe5..c97bea825 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/webdoc/file-upload.js
+++ b/examples/sites/demos/mobile-first/app/file-upload/webdoc/file-upload.js
@@ -38,6 +38,30 @@ export default {
},
codeFiles: ['file-list.vue']
},
+ {
+ demoId: 'file-size',
+ name: {
+ 'zh-CN': '上传的文件大小限制',
+ 'en-US': 'Uploaded file size limit'
+ },
+ desc: {
+ 'zh-CN': '
通过 file-size
配置上传文件的大小。
',
+ 'en-US': '
Use file-size
to configure the size of the uploaded file.
'
+ },
+ codeFiles: ['file-size.vue']
+ },
+ {
+ demoId: 'file-size-array',
+ name: {
+ 'zh-CN': '上传的文件大小范围',
+ 'en-US': 'Uploaded file size range'
+ },
+ desc: {
+ 'zh-CN': '通过 file-size
配置为数组类型限制上传文件的大小范围。
',
+ 'en-US': '
Set file-size
to an array to limit the size of the file to be uploaded.
'
+ },
+ codeFiles: ['file-size-array.vue']
+ },
{
demoId: 'show-title',
name: {
diff --git a/examples/sites/demos/mobile-first/app/grid/basic-usage.vue b/examples/sites/demos/mobile-first/app/grid/basic-usage.vue
index 98ce58af1..b4c9a2d09 100644
--- a/examples/sites/demos/mobile-first/app/grid/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/grid/basic-usage.vue
@@ -5,6 +5,7 @@
卡片视图
列表视图
甘特视图
+ custom视图
- {{ rows.length }}
+ gantt视图,表格行数{{ rows.length }}
+
+
+ custom视图,表格行数{{ rows.length }}
diff --git a/examples/sites/demos/pc/app/cascader-panel/multiple-composition-api.vue b/examples/sites/demos/pc/app/cascader-panel/multiple-composition-api.vue
new file mode 100644
index 000000000..1e89bcd76
--- /dev/null
+++ b/examples/sites/demos/pc/app/cascader-panel/multiple-composition-api.vue
@@ -0,0 +1,226 @@
+
+
+
+ 选中值:{{ value }}
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/cascader-panel/multiple.spec.ts b/examples/sites/demos/pc/app/cascader-panel/multiple.spec.ts
new file mode 100644
index 000000000..2330c49ba
--- /dev/null
+++ b/examples/sites/demos/pc/app/cascader-panel/multiple.spec.ts
@@ -0,0 +1,15 @@
+import { test, expect } from '@playwright/test'
+
+test('多选', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('cascader-panel#multiple')
+ const multipleText1 = page.getByText(
+ '选中值:[ [ "zhinan", "anzhuang", "xiangmudengji" ], [ "zhinan", "anzhuang", "huanjingzhunbei" ], [ "zhinan", "anzhuang", "anzhuangcli" ], [ "zhinan", "kaifa", "monishuju" ] ]'
+ )
+ await expect(multipleText1).toBeVisible()
+ await page.getByRole('menuitem', { name: '创建项目' }).locator('span').nth(1).click()
+ const multipleText2 = page.getByText(
+ '选中值:[ [ "zhinan", "anzhuang", "xiangmudengji" ], [ "zhinan", "anzhuang", "huanjingzhunbei" ], [ "zhinan", "anzhuang", "anzhuangcli" ], [ "zhinan", "anzhuang", "chuangjianxiangmu" ], [ "zhinan", "kaifa", "monishuju" ] ]'
+ )
+ await expect(multipleText2).toBeVisible()
+})
diff --git a/examples/sites/demos/pc/app/cascader-panel/multiple.vue b/examples/sites/demos/pc/app/cascader-panel/multiple.vue
new file mode 100644
index 000000000..168d0896f
--- /dev/null
+++ b/examples/sites/demos/pc/app/cascader-panel/multiple.vue
@@ -0,0 +1,234 @@
+
+
+
+ 选中值:{{ value }}
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js b/examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js
index ac6059068..d36421abf 100644
--- a/examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js
+++ b/examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js
@@ -30,6 +30,18 @@ export default {
},
codeFiles: ['custom-option-content.vue']
},
+ {
+ demoId: 'multiple',
+ name: {
+ 'zh-CN': '多选',
+ 'en-US': 'Multiple Choices'
+ },
+ desc: {
+ 'zh-CN': '通过 props.multiple = true
来开启多选模式。
\n',
+ 'en-US': 'Use props.multiple = true
to enable the multi-selection mode.
\n'
+ },
+ codeFiles: ['multiple.vue']
+ },
{
demoId: 'cascader-panel-props',
name: {
diff --git a/examples/sites/demos/pc/app/directives/highlight-query/avoid-composition-api.vue b/examples/sites/demos/pc/app/directives/highlight-query/avoid-composition-api.vue
new file mode 100644
index 000000000..fe88e4bc1
--- /dev/null
+++ b/examples/sites/demos/pc/app/directives/highlight-query/avoid-composition-api.vue
@@ -0,0 +1,52 @@
+
+
+
+ 关键字:
+ 修改内容
+
+
+
避免场景1: 直接包含文字节点
+
+ {{ list.join(',') }}
+
+
+
避免场景2:文字节点与其它组件混合
+
+ {{ list.join(',') }}
+
+
+
+
正确的场景1
+
+ {{ list.join(',') }}
+
+
+
正确的场景2
+
+ {{ list.join(',') }}
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/directives/highlight-query/avoid.spec.js b/examples/sites/demos/pc/app/directives/highlight-query/avoid.spec.js
new file mode 100644
index 000000000..27f9058d5
--- /dev/null
+++ b/examples/sites/demos/pc/app/directives/highlight-query/avoid.spec.js
@@ -0,0 +1,15 @@
+import { test, expect } from '@playwright/test'
+
+test('避免用法', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('directives-highlight-query#avoid')
+
+ const input = page.locator('.pc-demo-container .tiny-input-inner').first()
+ const hlNode = page.locator('.pc-demo-container .tiny-hl-query-node')
+ const button = page.locator('.pc-demo-container .tiny-button')
+
+ await expect(hlNode).toHaveCount(12)
+
+ await button.click()
+ await expect(hlNode).toHaveCount(6)
+})
diff --git a/examples/sites/demos/pc/app/directives/highlight-query/avoid.vue b/examples/sites/demos/pc/app/directives/highlight-query/avoid.vue
new file mode 100644
index 000000000..b097af80a
--- /dev/null
+++ b/examples/sites/demos/pc/app/directives/highlight-query/avoid.vue
@@ -0,0 +1,65 @@
+
+
+
+ 关键字:
+ 修改内容
+
+
+
避免场景1: 直接包含文字节点
+
+ {{ list.join(',') }}
+
+
+
避免场景2:文字节点与其它组件混合
+
+ {{ list.join(',') }}
+
+
+
+
正确的场景1
+
+ {{ list.join(',') }}
+
+
+
正确的场景2
+
+ {{ list.join(',') }}
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/directives/highlight-query/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/directives/highlight-query/basic-usage-composition-api.vue
new file mode 100644
index 000000000..e4847734c
--- /dev/null
+++ b/examples/sites/demos/pc/app/directives/highlight-query/basic-usage-composition-api.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/directives/highlight-query/basic-usage.spec.js b/examples/sites/demos/pc/app/directives/highlight-query/basic-usage.spec.js
new file mode 100644
index 000000000..b7bf67f28
--- /dev/null
+++ b/examples/sites/demos/pc/app/directives/highlight-query/basic-usage.spec.js
@@ -0,0 +1,12 @@
+import { test, expect } from '@playwright/test'
+
+test('基本用法', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('directives-highlight-query#basic-usage')
+
+ const input = page.locator('.pc-demo-container .tiny-input__inner')
+ const hlNode = page.locator('.pc-demo-container .tiny-hl-query-node')
+
+ await input.fill('一片')
+ await expect(hlNode).toHaveCount(3)
+})
diff --git a/examples/sites/demos/pc/app/directives/highlight-query/basic-usage.vue b/examples/sites/demos/pc/app/directives/highlight-query/basic-usage.vue
new file mode 100644
index 000000000..d50c55e7b
--- /dev/null
+++ b/examples/sites/demos/pc/app/directives/highlight-query/basic-usage.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/directives/webdoc/directives-highlight-query.cn.md b/examples/sites/demos/pc/app/directives/webdoc/directives-highlight-query.cn.md
new file mode 100644
index 000000000..50714a5a9
--- /dev/null
+++ b/examples/sites/demos/pc/app/directives/webdoc/directives-highlight-query.cn.md
@@ -0,0 +1,7 @@
+---
+title: HighlightQuery 高亮搜索字
+---
+
+# HighlightQuery 高亮搜索字
+
+HighlightQuery 高亮搜索字指令,用于高亮区个区域的匹配字符。
diff --git a/examples/sites/demos/pc/app/directives/webdoc/directives-highlight-query.en.md b/examples/sites/demos/pc/app/directives/webdoc/directives-highlight-query.en.md
new file mode 100644
index 000000000..3805adbbf
--- /dev/null
+++ b/examples/sites/demos/pc/app/directives/webdoc/directives-highlight-query.en.md
@@ -0,0 +1,7 @@
+---
+title: HighlightQuery Highlight search word
+---
+
+# HighlightQuery Highlight search word
+
+HighlightQuery Highlight search word command, which is used to match characters in each area of the highlight area.
diff --git a/examples/sites/demos/pc/app/directives/webdoc/directives-highlight-query.js b/examples/sites/demos/pc/app/directives/webdoc/directives-highlight-query.js
new file mode 100644
index 000000000..7a193dee8
--- /dev/null
+++ b/examples/sites/demos/pc/app/directives/webdoc/directives-highlight-query.js
@@ -0,0 +1,39 @@
+export default {
+ column: '2',
+ owner: '',
+ metaData: {
+ stable: '3.18.0'
+ },
+ versionTipOption: {
+ stages: ['stable']
+ },
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '通过自动高亮搜索字指令,可以自动高亮某个节点下,所有匹配的字符。',
+ 'en-US':
+ 'You can use the automatic highlight search word command to automatically highlight all matched characters under a node.'
+ },
+ codeFiles: ['highlight-query/basic-usage.vue']
+ },
+ {
+ demoId: 'avoid',
+ name: {
+ 'zh-CN': '避免场景',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN':
+ '纯文字节点在Vue
编译时有特殊处理。自动高亮搜索字的指令是直接处理Dom
节点的内容,所以要避免纯文本节点。以下2个场景会造成Vue
更新机制失败。',
+ 'en-US':
+ 'Plain text nodes are specially processed during Vue
compilation. The instruction for automatically highlighting search words is to directly process the contents of the Dom
node, so avoid plain text nodes. The Vue
update mechanism fails in the following scenarios:'
+ },
+ codeFiles: ['highlight-query/avoid.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/pc/app/dropdown/lazy-show-popper-composition-api.vue b/examples/sites/demos/pc/app/dropdown/lazy-show-popper-composition-api.vue
new file mode 100644
index 000000000..509306369
--- /dev/null
+++ b/examples/sites/demos/pc/app/dropdown/lazy-show-popper-composition-api.vue
@@ -0,0 +1,43 @@
+
+
+
场景1:初始全加载
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+
场景2:初始不加载菜单及子项,适合表格等大数量的场景
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/dropdown/lazy-show-popper.spec.ts b/examples/sites/demos/pc/app/dropdown/lazy-show-popper.spec.ts
new file mode 100644
index 000000000..3ea061027
--- /dev/null
+++ b/examples/sites/demos/pc/app/dropdown/lazy-show-popper.spec.ts
@@ -0,0 +1,20 @@
+import { test, expect } from '@playwright/test'
+
+test('基本用法', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('dropdown#lazy-show-popper')
+
+ const wrap = page.locator('#lazy-show-popper')
+ const dropDownLi = wrap.locator('.tiny-dropdown li')
+ const dropDownOnBody = page.locator('body .tiny-dropdown-menu li')
+
+ const dropDown2 = wrap.locator('.tiny-dropdown').nth(1)
+
+ // 2个示例应该是10个菜单项, 懒加载成功的话,应该只加载5个。
+ await expect(dropDownLi).toHaveCount(5)
+
+ // 点击后,应该加载10个, 但展开的5项是 appendToBody的。
+ await dropDown2.click()
+ await expect(dropDownLi).toHaveCount(5)
+ await expect(dropDownOnBody).toHaveCount(5)
+})
diff --git a/examples/sites/demos/pc/app/dropdown/lazy-show-popper.vue b/examples/sites/demos/pc/app/dropdown/lazy-show-popper.vue
new file mode 100644
index 000000000..dd1a4c318
--- /dev/null
+++ b/examples/sites/demos/pc/app/dropdown/lazy-show-popper.vue
@@ -0,0 +1,47 @@
+
+
+
场景1:初始全加载
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+
场景2:初始不加载菜单及子项,适合表格等大数量的场景
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/dropdown/webdoc/dropdown.js b/examples/sites/demos/pc/app/dropdown/webdoc/dropdown.js
index 111b9c106..9cea4ceee 100644
--- a/examples/sites/demos/pc/app/dropdown/webdoc/dropdown.js
+++ b/examples/sites/demos/pc/app/dropdown/webdoc/dropdown.js
@@ -231,6 +231,19 @@ export default {
'button-click
: When the button type is selected, listen for the left button click event.
\nitem-click
: Listens for menu item click events
\nvisible-change
: Listens for changes in the display and hiding of dropdown pop ups.
\n'
},
codeFiles: ['events.vue']
+ },
+ {
+ demoId: 'lazy-show-popper',
+ name: {
+ 'zh-CN': '懒加载菜单和子项',
+ 'en-US': 'Lazy Load Menus and Subitems'
+ },
+ desc: {
+ 'zh-CN': '通过 lazy-show-popper
属性,指定是否懒加载下拉菜单及内部的项',
+ 'en-US':
+ 'The lazy-show-popper
property specifies whether to lazy load the drop-down menu and internal items.'
+ },
+ codeFiles: ['lazy-show-popper.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/file-upload/file-size-array.vue b/examples/sites/demos/pc/app/file-upload/file-size-array.vue
new file mode 100644
index 000000000..3d39344a9
--- /dev/null
+++ b/examples/sites/demos/pc/app/file-upload/file-size-array.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/file-upload/file-size.vue b/examples/sites/demos/pc/app/file-upload/file-size.vue
new file mode 100644
index 000000000..d4cef901f
--- /dev/null
+++ b/examples/sites/demos/pc/app/file-upload/file-size.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/file-upload/webdoc/file-upload.js b/examples/sites/demos/pc/app/file-upload/webdoc/file-upload.js
index 2341f424e..e7f0117ca 100644
--- a/examples/sites/demos/pc/app/file-upload/webdoc/file-upload.js
+++ b/examples/sites/demos/pc/app/file-upload/webdoc/file-upload.js
@@ -189,6 +189,30 @@ export default {
},
codeFiles: ['upload-file-list.vue']
},
+ {
+ demoId: 'file-size',
+ name: {
+ 'zh-CN': '文件大小限制',
+ 'en-US': 'Uploaded file size limit'
+ },
+ desc: {
+ 'zh-CN': '通过 file-size
配置上传文件的大小。
',
+ 'en-US': '
Use file-size
to configure the size of the uploaded file.
'
+ },
+ codeFiles: ['file-size.vue']
+ },
+ {
+ demoId: 'file-size-array',
+ name: {
+ 'zh-CN': '文件大小范围',
+ 'en-US': 'Uploaded file size range'
+ },
+ desc: {
+ 'zh-CN': '通过 file-size
配置为数组类型限制上传文件的大小范围。
',
+ 'en-US': '
Set file-size
to an array to limit the size of the file to be uploaded.
'
+ },
+ codeFiles: ['file-size-array.vue']
+ },
{
demoId: 'upload-file-list-slot',
name: {
diff --git a/examples/sites/demos/pc/app/grid/dynamically-columns/column-switching-scroll-composition-api.vue b/examples/sites/demos/pc/app/grid/dynamically-columns/column-switching-scroll-composition-api.vue
new file mode 100644
index 000000000..a2cdfa035
--- /dev/null
+++ b/examples/sites/demos/pc/app/grid/dynamically-columns/column-switching-scroll-composition-api.vue
@@ -0,0 +1,81 @@
+
+
+ {{ flag ? '隐藏' : '显示' }}最后一列
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/grid/dynamically-columns/column-switching-scroll.spec.js b/examples/sites/demos/pc/app/grid/dynamically-columns/column-switching-scroll.spec.js
new file mode 100644
index 000000000..3a297ce99
--- /dev/null
+++ b/examples/sites/demos/pc/app/grid/dynamically-columns/column-switching-scroll.spec.js
@@ -0,0 +1,14 @@
+import { test, expect } from '@playwright/test'
+
+test('新增列滚动位置', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('grid-dynamically-columns#column-switching-scroll')
+ const demo = page.locator('#column-switching-scroll')
+
+ await demo.locator('.tiny-grid__body-wrapper.body__wrapper').click()
+ await page.mouse.wheel(10000, 0)
+
+ await expect(demo.getByText('地址2')).toBeVisible()
+ await demo.getByText('显示最后一列').click()
+ await expect(demo.getByText('地址2')).toBeVisible()
+})
diff --git a/examples/sites/demos/pc/app/grid/dynamically-columns/column-switching-scroll.vue b/examples/sites/demos/pc/app/grid/dynamically-columns/column-switching-scroll.vue
new file mode 100644
index 000000000..606700043
--- /dev/null
+++ b/examples/sites/demos/pc/app/grid/dynamically-columns/column-switching-scroll.vue
@@ -0,0 +1,89 @@
+
+
+ {{ flag ? '隐藏' : '显示' }}最后一列
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/grid/webdoc/grid-dynamically-columns.js b/examples/sites/demos/pc/app/grid/webdoc/grid-dynamically-columns.js
index b566beda9..d7b25a130 100644
--- a/examples/sites/demos/pc/app/grid/webdoc/grid-dynamically-columns.js
+++ b/examples/sites/demos/pc/app/grid/webdoc/grid-dynamically-columns.js
@@ -14,6 +14,18 @@ export default {
},
'codeFiles': ['dynamically-columns/dynamically-columns.vue']
},
+ {
+ 'demoId': 'column-switching-scroll',
+ 'name': {
+ 'zh-CN': '新增列滚动位置',
+ 'en-US': 'New columns scroll positon'
+ },
+ 'desc': {
+ 'zh-CN': '根据日期范围选择框的日期范围动态的生成表格列。',
+ 'en-US': 'For details, see the following example.'
+ },
+ 'codeFiles': ['dynamically-columns/column-switching-scroll.vue']
+ },
{
'demoId': 'column-columns-dynamic',
'name': { 'zh-CN': '动态列数据', 'en-US': '' },
diff --git a/examples/sites/demos/pc/app/icon/iconGroups.js b/examples/sites/demos/pc/app/icon/iconGroups.js
index 7f52fc36c..dbfb229b6 100644
--- a/examples/sites/demos/pc/app/icon/iconGroups.js
+++ b/examples/sites/demos/pc/app/icon/iconGroups.js
@@ -1,42 +1,249 @@
export const iconGroups = {
- Arrow: [
- 'IconArrowDown',
+ Left: [
+ 'IconAngleLeft',
'IconArrowLeft',
- 'IconArrowRight',
- 'IconArrowUp',
- 'IconAscending',
- 'IconChevronDown',
'IconChevronLeft',
- 'IconChevronRight',
- 'IconChevronUp',
'IconDefault',
- 'IconDeltaDownO',
- 'IconDeltaDown',
'IconDeltaLeftO',
- 'IconDeltaLeft',
- 'IconDeltaRightO',
- 'IconDeltaRight',
- 'IconDeltaUpO',
- 'IconDeltaUp',
'IconDoubleLeft',
- 'IconDoubleRight',
- 'IconDownO',
- 'IconDown',
- 'IconDownWard',
- 'IconEnd',
+ 'IconLeft',
'IconLeftO',
'IconLeftWard',
'IconLeftWardArrow',
- 'IconLeft',
- 'IconPopup',
- 'IconRightO',
+ 'IconDeltaLeft',
+ 'IconPagerFirst',
+ 'IconPagerPrev',
+ 'IconRichTextAlignLeft',
+ 'IconSplitLeft',
+ 'IconUndo'
+ ],
+ Right: [
+ 'IconArrowRight',
+ 'IconAngleRight',
+ 'IconChevronRight',
+ 'IconDeltaRight',
+ 'IconDeltaRightO',
+ 'IconDoubleRight',
+ 'IconEnd',
+ 'IconPagerLast',
+ 'IconPagerNext',
+ 'IconRedo',
'IconRight',
+ 'IconRightO',
+ 'IconRichTextRedo',
+ 'IconRichTextAlignRight',
'IconRightward',
- 'IconTriangleDown',
- 'IconUpO',
+ 'IconSplitRight',
+ 'IconStart',
+ 'IconTransform'
+ ],
+ TextAlign: [
+ 'IconAlignCenter',
+ 'IconAlignLeft',
+ 'IconAlignJustify',
+ 'IconAlignRight',
+ 'IconAlignStretch',
+ 'IconStreamSolid',
+ 'IconRichTextAddColumnAfter',
+ 'IconRichTextAddColumnBefore',
+ 'IconRichTextAddRowAfter',
+ 'IconRichTextAddRowBefore',
+ 'IconRichTextAlignCenter',
+ 'IconRichTextDeleteColumn',
+ 'IconRichTextDeleteRow',
+ 'IconRichTextLineHeight',
+ 'IconRichTextListOrdered',
+ 'IconRichTextListUnordered',
+ 'IconRichTextMergeCells',
+ 'IconRichTextMergeCellsVertical',
+ 'IconRichTextSplitCellsHorizontal',
+ 'IconRichTextSplitCellsVertical',
+ 'IconRichTextTable',
+ 'IconRichTextTaskList',
+ 'IconSplit'
+ ],
+ Upward: [
+ 'IconArrowUp',
+ 'IconChevronUp',
+ 'IconDeltaUp',
+ 'IconDeltaUpO',
+ 'IconFreeze',
'IconUp',
+ 'IconUpO',
'IconUpWard'
],
+ Downward: [
+ 'IconArrowBottom',
+ 'IconArrowDown',
+ 'IconChevronDown',
+ 'IconDeltaDown',
+ 'IconDeltaDownO',
+ 'IconDown',
+ 'IconDownO',
+ 'IconDownWard',
+ 'IconTriangleDown'
+ ],
+ Back: ['IconEditorUndo', 'IconGoBack', 'IconImport', 'IconRichTextUndo'],
+ Cycle: [
+ 'IconConmentRefresh',
+ 'IconDownload',
+ 'IconGenerating',
+ 'IconGroupTransfer',
+ 'IconReplace',
+ 'IconRefres',
+ 'IconRefresh',
+ 'IconRepeat',
+ 'IconUpload'
+ ],
+ Sort: [
+ 'IconAscending',
+ 'IconDescending',
+ 'IconSort',
+ 'IconSortDefault',
+ 'IconSortO',
+ 'IconSortTriangle',
+ 'IconSortTriangleAscending',
+ 'IconSortTriangleDescending'
+ ],
+ Filter: ['IconBefilter', 'IconClearFilter', 'IconDefinedFiltration', 'IconFilter', 'IconFiltered', 'IconUnfilter'],
+ Reduce: [
+ 'IconExpand',
+ 'IconMinus',
+ 'IconMinusCircle',
+ 'IconMinusSquare',
+ 'IconNodeOpen',
+ 'IconPanelMini',
+ 'IconStop',
+ 'IconZoomOut'
+ ],
+ Add: [
+ 'IconAdd',
+ 'IconAddCircle',
+ 'IconNew',
+ 'IconNode',
+ 'IconPlus',
+ 'IconPlusSquare',
+ 'IconPlusCircle',
+ 'IconPutAway',
+ 'IconView',
+ 'IconZoomIn'
+ ],
+ Check: [
+ 'IconCheck',
+ 'IconHalfchecked',
+ 'IconHalfselect',
+ 'IconMobileCheckbox',
+ 'IconMobileCheckboxHalf',
+ 'IconPreChecked'
+ ],
+ Success: [
+ 'IconCheckedLinear',
+ 'IconCheckedSur',
+ 'IconDone',
+ 'IconFinish',
+ 'IconMobileCheckboxSelected',
+ 'IconSubScript',
+ 'IconSuccess',
+ 'IconSuccessful',
+ 'IconYes'
+ ],
+ Fail: [
+ 'IconClose',
+ 'IconCloseCircle',
+ 'IconCloseSquare',
+ 'IconDelete',
+ 'IconError',
+ 'IconOperationfaild',
+ 'IconOperationfaildL',
+ 'IconStepsError'
+ ],
+ Warn: [
+ 'IconCueL',
+ 'IconCueLO',
+ 'IconExceptionO',
+ 'IconExclamation',
+ 'IconWarn',
+ 'IconWarning',
+ 'IconWarningO',
+ 'IconWarningTriangle'
+ ],
+ Question: ['IconHelpCircle', 'IconHelpQuery', 'IconUnknow', 'IconUnknown'],
+ Prompt: [
+ 'IconInfo',
+ 'IconInfoCircle',
+ 'IconInfoSolid',
+ 'IconHelp',
+ 'IconHelpSolid',
+ 'IconPrompt',
+ 'IconPromptExclamation'
+ ],
+ Stretchable: [
+ 'IconFullscreenLeft',
+ 'IconMinscreenLeft',
+ 'IconMinscreenRight',
+ 'IconStretch',
+ 'IconStretchCrosswise',
+ 'IconStretchUpright'
+ ],
+ More: ['IconEllipsis', 'IconMore', 'IconPopup'],
+ Dot: [
+ 'IconDotIpv4',
+ 'IconLeave',
+ 'IconOffLine',
+ 'IconOnLine',
+ 'IconBusy',
+ 'IconDoneMini',
+ 'IconOnGoing',
+ 'IconOnGoingMini',
+ 'IconMobileRadio',
+ 'IconExceptionMiniO',
+ 'IconMobileRadioSelected',
+ 'IconOperation',
+ 'IconRadio',
+ 'IconRadioselected'
+ ],
+ Location: ['IconLocation', 'IconLocationNumber', 'IconMarkOn'],
+ Letter: [
+ 'IconEditorBold',
+ 'IconEditorDeleteline',
+ 'IconEditorItalic',
+ 'IconEditorSub',
+ 'IconEditorSubtitle',
+ 'IconEditorSuper',
+ 'IconEditorTitle',
+ 'IconEditorUnderline',
+ 'IconFontColor',
+ 'IconFontSize',
+ 'IconFontStyle',
+ 'IconFontWeight',
+ 'IconRichTextBold',
+ 'IconRichTextFontSize',
+ 'IconRichTextFormatClear',
+ 'IconRichTextH1',
+ 'IconRichTextH2',
+ 'IconRichTextH3',
+ 'IconRichTextH4',
+ 'IconRichTextH5',
+ 'IconRichTextH6',
+ 'IconRichTextHeading',
+ 'IconRichTextItalic',
+ 'IconRichTextStrikeThrough',
+ 'IconRichTextSubscript',
+ 'IconRichTextSuperscript',
+ 'IconRichTextUnderline',
+ 'IconTextDecoration',
+ 'IconUnderline'
+ ],
+ Mall: [
+ 'IconPurchasePlannedOrder',
+ 'IconShipped',
+ 'IconShoppingCard',
+ 'IconSoldOut',
+ 'IconSurchargeSettled',
+ 'IconSurchargeSettled',
+ 'IconWaitForDeliveryO',
+ 'IconWaitingToPick'
+ ],
Brands: ['IconAngularjs', 'IconEspaceAuto', 'IconEspace', 'IconNodejs', 'IconReactjs', 'IconVuejs'],
Charts: ['IconAreaChart', 'IconDotChart', 'IconLineChart', 'IconPieChart', 'IconStatistics'],
Editor: [
@@ -44,11 +251,8 @@ export const iconGroups = {
'IconEditorAlignLeft',
'IconEditorAlignRight',
'IconEditorBackground',
- 'IconEditorBold',
'IconEditorCode',
- 'IconEditorDeleteline',
'IconEditorEraser',
- 'IconEditorItalic',
'IconEditorLeftBorder',
'IconEditorList',
'IconEditorListDot',
@@ -58,51 +262,64 @@ export const iconGroups = {
'IconEditorQuote',
'IconEditorRedo',
'IconEditorRightBorder',
- 'IconEditorSub',
- 'IconEditorSubtitle',
- 'IconEditorSuper',
'IconEditorTable',
'IconEditorTextcolor',
- 'IconEditorTitle',
- 'IconEditorUnderline',
- 'IconEditorUndo',
+ 'IconExport',
'IconEditorVideo',
- 'IconOperationfaildL',
+ 'IconFilletExternalLink',
'IconOuterLink',
- 'IconTextDecoration',
- 'IconUnderline',
'IconWriting'
],
IT: [
'IconAdministrator',
'IconDataSource',
'IconDesktopView',
- 'IconEmailAdd',
- 'IconEmailCircle',
- 'IconExcel',
'IconException',
- 'IconExclamation',
'IconLanguage',
- 'IconMailContent',
- 'IconMail',
- 'IconMarkOn',
'IconMobileView',
'IconMobile',
'IconPrintPreview',
- 'IconReplies',
- 'IconSent',
'IconShare',
'IconShareArrow',
- 'IconShoppingCard',
'IconTabletView',
'IconUnlock',
- 'IconUnsent',
'IconUser',
'IconVersiontree',
'IconWebPlus',
'IconJs'
],
+ Clock: ['IconClockWork', 'IconProcessing', 'IconTime'],
+ Email: ['IconEmailAdd', 'IconEmailCircle', 'IconMailContent', 'IconMail', 'IconReplies', 'IconSent', 'IconUnsent'],
+ Folder: ['IconFileCloudupload', 'IconFolder', 'IconFolderClosed', 'IconFolderOpened'],
+ File: [
+ 'IconCloudUpload',
+ 'IconDocument',
+ 'IconExcel',
+ 'IconExcelType',
+ 'IconFileExcel',
+ 'IconFile',
+ 'IconFilesCircle',
+ 'IconFiles',
+ 'IconFiletext',
+ 'IconFileType',
+ 'IconFileupload',
+ 'IconFinishO',
+ 'IconHistoryRecord',
+ 'IconOtherType',
+ 'IconPdfType',
+ 'IconPptType',
+ 'IconTextType',
+ 'IconText',
+ 'IconTextAlign',
+ 'IconTextTab',
+ 'IconVideoType',
+ 'IconWordType',
+ 'IconXml',
+ 'IconZipType'
+ ],
+ Image: ['IconAddPicture', 'IconImageAdd', 'IconPicture', 'IconPictureType', 'IconRichTextImage'],
Media: [
+ 'IconAudio',
'IconCourse',
'IconCustom',
'IconCustomerService',
@@ -110,161 +327,89 @@ export const iconGroups = {
'IconDialog2',
'IconInformation',
'IconMessageCircle',
- 'IconPagerFirst',
- 'IconPagerLast',
- 'IconPagerNext',
- 'IconPagerPrev',
+ 'IconMic',
'IconPauseCircle',
'IconPause',
- 'IconPicture',
'IconStartCircle',
- 'IconStart',
- 'IconTime'
+ 'IconStartO',
+ 'IconTurnOn'
],
- Objects: [
+ Object: [
'IconBoat',
'IconCalculator',
'IconCalendar',
- 'IconClockWork',
'IconCloudDownload',
- 'IconCloudUpload',
'IconCoin',
'IconTaskCooperation',
'IconTelephoneCircle',
'IconTelephone'
],
- Symbols: [
- 'IconBusy',
- 'IconCheck',
- 'IconCheckedLinear',
- 'IconCheckedSur',
- 'IconCloseCircle',
- 'IconCloseSquare',
+ Symbol: [
'IconCode',
'IconCommission',
- 'IconCueL',
'IconCrop',
- 'IconDotIpv4',
- 'IconEllipsis',
- 'IconError',
'IconEyeclose',
'IconEyeopen',
'IconFrownO',
'IconFrown',
'IconGroup',
'IconHeartempty',
- 'IconHelpCircle',
- 'IconHelpQuery',
- 'IconHelpSolid',
- 'IconHelp',
'IconHelpful',
- 'IconLeave',
'IconLoading',
'IconLock',
'IconMale',
'IconMeh',
- 'IconMore',
- 'IconPlus',
- 'IconNodeOpen',
- 'IconNode',
'IconNone',
- 'IconOffLine',
- 'IconOnLine',
'IconPanelMax',
- 'IconPanelMini',
'IconPanelNormal',
- 'IconRadio',
- 'IconRadioselected',
'IconSmileO',
'IconSmile',
'IconStarActive',
'IconStarDisable',
- 'IconStarO',
- 'IconStop',
- 'IconSuccess',
- 'IconSuccessful',
- 'IconInfoSolid',
- 'IconInfoCircle',
- 'IconInfo',
- 'IconOperationfaild',
- 'IconUnknow',
- 'IconUnknown',
- 'IconWarning',
- 'IconWarningTriangle',
- 'IconClose',
- 'IconYes'
+ 'IconStarO'
],
- Tools: [
- 'IconAdd',
- 'IconAddPicture',
+ Tool: [
+ 'IconConfig',
+ 'IconSetting',
'IconAlignBaseline',
- 'IconAlignCenter',
'IconAlignFlexCenter',
'IconAlignFlexEnd',
'IconAlignFlexStart',
- 'IconAlignJustify',
- 'IconAlignLeft',
- 'IconAlignRight',
- 'IconAlignStretch',
'IconApp',
'IconApplication',
'IconAssociation',
'IconAttachment',
'IconBarChart',
- 'IconBefilter',
'IconBoxSolid',
'IconCheckOut',
'IconCheckedTrue',
- 'IconClearFilter',
- 'IconConmentRefresh',
'IconCopySolid',
'IconCopy',
- 'IconDefinedFiltration',
'IconDel',
+ 'IconDeleteL',
'IconDeleted',
'IconDerive',
'IconDeletePage',
- 'IconDescending',
'IconColReverse',
'IconDirectionCol',
'IconDirectionRow',
'IconRowReverse',
'IconDownloadCloud',
'IconDownloadLink',
- 'IconDownload',
'IconDraft',
'IconEdit',
+ 'IconEditor',
'IconEditorTab',
- 'IconExport',
'IconExpressSearch',
- 'IconFileCloudupload',
- 'IconFileExcel',
- 'IconFile',
- 'IconFilesCircle',
- 'IconFiles',
- 'IconFiletext',
- 'IconFileupload',
- 'IconFiltered',
'IconFlag',
- 'IconFolderClosed',
- 'IconFolderOpened',
- 'IconFontColor',
'IconFontFamily',
- 'IconFontSize',
- 'IconFontStyle',
- 'IconFontWeight',
'IconFreezeLeft',
'IconFreezeRight',
'IconFullscreen',
- 'IconFullscreenLeft',
'IconGrade',
- 'IconGroupTransfer',
- 'IconHalfchecked',
- 'IconHalfselect',
'IconHideLeft',
'IconHideRight',
'IconHideTopleft',
- 'IconImport',
'IconJusitfyCenter',
'IconJusitfyFlexEnd',
'IconJusitfySpaceAround',
@@ -274,24 +419,13 @@ export const iconGroups = {
'IconLineHeight',
'IconLineThrought',
'IconLink',
- 'IconMinscreenLeft',
'IconMinscreen',
- 'IconMinusCircle',
- 'IconMinusSquare',
- 'IconMinus',
- 'IconNew',
'IconNoPremission',
'IconPagelink',
- 'IconPlusCircle',
- 'IconPlusSquare',
- 'IconPreChecked',
'IconPushpin',
- 'IconRedo',
- 'IconRefres',
'IconRenew',
- 'IconRepeat',
- 'IconReplace',
'IconRightFrozen',
+ 'IconRichTextNodeDelete',
'IconSandwichCollapse',
'IconSandwichExpand',
'IconSave',
@@ -299,21 +433,8 @@ export const iconGroups = {
'IconSearch',
'IconSelect',
'IconSeparate',
- 'IconSetting',
- 'IconSortDefault',
- 'IconSort',
- 'IconStreamSolid',
- 'IconTextAlign',
- 'IconTextTab',
- 'IconText',
'IconTotal',
'IconUndelete',
- 'IconUndo',
- 'IconUnfilter',
- 'IconUnfreeze',
- 'IconUpload',
- 'IconView',
- 'IconZoomIn',
- 'IconZoomOut'
+ 'IconUnfreeze'
]
}
diff --git a/examples/sites/demos/pc/app/input/basic-usage.spec.ts b/examples/sites/demos/pc/app/input/basic-usage.spec.ts
index 9834b3796..1f843459d 100644
--- a/examples/sites/demos/pc/app/input/basic-usage.spec.ts
+++ b/examples/sites/demos/pc/app/input/basic-usage.spec.ts
@@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test'
test('[Input]basic-usage: placeholder, focus-style, v-model', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('input#basic-usage')
- const input = await page.locator('.demo-input > .tiny-input > .tiny-input-display-only > input')
+ const input = page.locator('.demo-input > .tiny-input > .tiny-input-display-only > input')
await expect(input).toBeVisible()
await expect(input).toHaveAttribute('placeholder', 'Please input')
diff --git a/examples/sites/demos/pc/app/input/show-tooltip-composition-api.vue b/examples/sites/demos/pc/app/input/show-tooltip-composition-api.vue
new file mode 100644
index 000000000..c5f57e8ff
--- /dev/null
+++ b/examples/sites/demos/pc/app/input/show-tooltip-composition-api.vue
@@ -0,0 +1,27 @@
+
+
+ 是否悬浮提示:
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/input/show-tooltip.spec.ts b/examples/sites/demos/pc/app/input/show-tooltip.spec.ts
new file mode 100644
index 000000000..14a7438ab
--- /dev/null
+++ b/examples/sites/demos/pc/app/input/show-tooltip.spec.ts
@@ -0,0 +1,10 @@
+import { test, expect } from '@playwright/test'
+
+test('只读态悬浮提示', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('input#show-tooltip')
+
+ const demo = page.locator('#show-tooltip')
+ await demo.locator('.tiny-input .tiny-input-display-only__content').hover()
+ await expect(page.locator('.tiny-tooltip.tiny-tooltip__popper')).not.toBeVisible()
+})
diff --git a/examples/sites/demos/pc/app/input/show-tooltip.vue b/examples/sites/demos/pc/app/input/show-tooltip.vue
new file mode 100644
index 000000000..f89132f86
--- /dev/null
+++ b/examples/sites/demos/pc/app/input/show-tooltip.vue
@@ -0,0 +1,34 @@
+
+
+ 是否悬浮提示:
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/input/webdoc/input.js b/examples/sites/demos/pc/app/input/webdoc/input.js
index 5050d0127..f6faeca12 100644
--- a/examples/sites/demos/pc/app/input/webdoc/input.js
+++ b/examples/sites/demos/pc/app/input/webdoc/input.js
@@ -41,6 +41,19 @@ export default {
},
codeFiles: ['show-password.vue']
},
+ {
+ demoId: 'show-tooltip',
+ name: {
+ 'zh-CN': '只读态悬浮提示',
+ 'en-US': 'Show Tooltip'
+ },
+ desc: {
+ 'zh-CN': '通过 show-tooltip
配置当文本超长时,是否显示悬浮提示。
\n',
+ 'en-US':
+ 'Use show-tooltip
to configure whether to display a floating tip when the text is too long.
\n'
+ },
+ codeFiles: ['show-tooltip.vue']
+ },
{
demoId: 'size',
name: {
diff --git a/examples/sites/demos/pc/app/select/popup-style-position-composition-api.vue b/examples/sites/demos/pc/app/select/popup-style-position-composition-api.vue
index 562a57393..0b4b8847a 100644
--- a/examples/sites/demos/pc/app/select/popup-style-position-composition-api.vue
+++ b/examples/sites/demos/pc/app/select/popup-style-position-composition-api.vue
@@ -12,8 +12,7 @@ const options = reactive([
{ value: '选项1', label: '北京' },
{ value: '选项2', label: '上海' },
{ value: '选项3', label: '天津' },
- { value: '选项4', label: '重庆' },
- { value: '选项5', label: '深圳' }
+ { value: '选项4', label: '重庆' }
])
const value = ref('')
diff --git a/examples/sites/demos/pc/app/select/popup-style-position.vue b/examples/sites/demos/pc/app/select/popup-style-position.vue
index 886ad3f95..ada2fc539 100644
--- a/examples/sites/demos/pc/app/select/popup-style-position.vue
+++ b/examples/sites/demos/pc/app/select/popup-style-position.vue
@@ -18,8 +18,7 @@ export default {
{ value: '选项1', label: '北京' },
{ value: '选项2', label: '上海' },
{ value: '选项3', label: '天津' },
- { value: '选项4', label: '重庆' },
- { value: '选项5', label: '深圳' }
+ { value: '选项4', label: '重庆' }
],
value: ''
}
diff --git a/examples/sites/demos/pc/app/slider/about-step-composition-api.vue b/examples/sites/demos/pc/app/slider/about-step-composition-api.vue
index 2a3836f06..290b52347 100644
--- a/examples/sites/demos/pc/app/slider/about-step-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/about-step-composition-api.vue
@@ -8,3 +8,9 @@ import { Slider as TinySlider } from '@opentiny/vue'
const value = ref(20)
+
+
diff --git a/examples/sites/demos/pc/app/slider/about-step.vue b/examples/sites/demos/pc/app/slider/about-step.vue
index 752af2a1f..869964318 100644
--- a/examples/sites/demos/pc/app/slider/about-step.vue
+++ b/examples/sites/demos/pc/app/slider/about-step.vue
@@ -16,3 +16,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/slider/basic-usage-composition-api.vue
index 91ed87a95..bf292a6f7 100644
--- a/examples/sites/demos/pc/app/slider/basic-usage-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/basic-usage-composition-api.vue
@@ -15,3 +15,9 @@ function setValue() {
value.value = 50
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/basic-usage.vue b/examples/sites/demos/pc/app/slider/basic-usage.vue
index c96fc93b9..4444c4262 100644
--- a/examples/sites/demos/pc/app/slider/basic-usage.vue
+++ b/examples/sites/demos/pc/app/slider/basic-usage.vue
@@ -25,3 +25,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/dynamic-disable-composition-api.vue b/examples/sites/demos/pc/app/slider/dynamic-disable-composition-api.vue
index 022af5108..7e9e86f92 100644
--- a/examples/sites/demos/pc/app/slider/dynamic-disable-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/dynamic-disable-composition-api.vue
@@ -8,3 +8,9 @@ import { Slider as TinySlider } from '@opentiny/vue'
const value = ref(40)
+
+
diff --git a/examples/sites/demos/pc/app/slider/dynamic-disable.vue b/examples/sites/demos/pc/app/slider/dynamic-disable.vue
index e862f29e8..fb59a3f18 100644
--- a/examples/sites/demos/pc/app/slider/dynamic-disable.vue
+++ b/examples/sites/demos/pc/app/slider/dynamic-disable.vue
@@ -16,3 +16,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/format-tooltip-composition-api.vue b/examples/sites/demos/pc/app/slider/format-tooltip-composition-api.vue
index ffe7bbfa8..ef3b194dd 100644
--- a/examples/sites/demos/pc/app/slider/format-tooltip-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/format-tooltip-composition-api.vue
@@ -12,3 +12,9 @@ function format(value) {
return '当前值为:' + value
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/format-tooltip.vue b/examples/sites/demos/pc/app/slider/format-tooltip.vue
index cebda2f12..55c1ac07b 100644
--- a/examples/sites/demos/pc/app/slider/format-tooltip.vue
+++ b/examples/sites/demos/pc/app/slider/format-tooltip.vue
@@ -21,3 +21,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/marks-composition-api.vue b/examples/sites/demos/pc/app/slider/marks-composition-api.vue
index 45e0849fb..5442d31df 100644
--- a/examples/sites/demos/pc/app/slider/marks-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/marks-composition-api.vue
@@ -1,9 +1,5 @@
-
+
+
+
diff --git a/examples/sites/demos/pc/app/slider/marks.vue b/examples/sites/demos/pc/app/slider/marks.vue
index ff6632dbf..0411ee2f7 100644
--- a/examples/sites/demos/pc/app/slider/marks.vue
+++ b/examples/sites/demos/pc/app/slider/marks.vue
@@ -1,9 +1,5 @@
-
+
+
+
diff --git a/examples/sites/demos/pc/app/slider/max-min-composition-api.vue b/examples/sites/demos/pc/app/slider/max-min-composition-api.vue
index 08fa5a12a..bc690e7a8 100644
--- a/examples/sites/demos/pc/app/slider/max-min-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/max-min-composition-api.vue
@@ -8,3 +8,9 @@ import { Slider as TinySlider } from '@opentiny/vue'
const value = ref(30)
+
+
diff --git a/examples/sites/demos/pc/app/slider/max-min.vue b/examples/sites/demos/pc/app/slider/max-min.vue
index 7a8794640..62224e20f 100644
--- a/examples/sites/demos/pc/app/slider/max-min.vue
+++ b/examples/sites/demos/pc/app/slider/max-min.vue
@@ -16,3 +16,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/range-select-composition-api.vue b/examples/sites/demos/pc/app/slider/range-select-composition-api.vue
index 0d6f30ce9..f5f363df3 100644
--- a/examples/sites/demos/pc/app/slider/range-select-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/range-select-composition-api.vue
@@ -8,3 +8,9 @@ import { Slider as TinySlider } from '@opentiny/vue'
const value = ref([20, 40])
+
+
diff --git a/examples/sites/demos/pc/app/slider/range-select.vue b/examples/sites/demos/pc/app/slider/range-select.vue
index 60f0d8ea8..1adb435da 100644
--- a/examples/sites/demos/pc/app/slider/range-select.vue
+++ b/examples/sites/demos/pc/app/slider/range-select.vue
@@ -16,3 +16,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/shortcut-operation-composition-api.vue b/examples/sites/demos/pc/app/slider/shortcut-operation-composition-api.vue
index f467ca89f..44884cf6c 100644
--- a/examples/sites/demos/pc/app/slider/shortcut-operation-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/shortcut-operation-composition-api.vue
@@ -8,3 +8,9 @@ import { Slider as TinySlider } from '@opentiny/vue'
const value = ref(40)
+
+
diff --git a/examples/sites/demos/pc/app/slider/shortcut-operation.vue b/examples/sites/demos/pc/app/slider/shortcut-operation.vue
index 21d8dcad0..80ec67961 100644
--- a/examples/sites/demos/pc/app/slider/shortcut-operation.vue
+++ b/examples/sites/demos/pc/app/slider/shortcut-operation.vue
@@ -16,3 +16,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/show-input-composition-api.vue b/examples/sites/demos/pc/app/slider/show-input-composition-api.vue
index 02f72a3de..0426936bc 100644
--- a/examples/sites/demos/pc/app/slider/show-input-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/show-input-composition-api.vue
@@ -10,3 +10,9 @@ import { Slider as TinySlider } from '@opentiny/vue'
const value = ref(40)
const value2 = ref([40, 60])
+
+
diff --git a/examples/sites/demos/pc/app/slider/show-iput.spec.ts b/examples/sites/demos/pc/app/slider/show-input.spec.ts
similarity index 100%
rename from examples/sites/demos/pc/app/slider/show-iput.spec.ts
rename to examples/sites/demos/pc/app/slider/show-input.spec.ts
diff --git a/examples/sites/demos/pc/app/slider/show-input.vue b/examples/sites/demos/pc/app/slider/show-input.vue
index 49f509aa7..c087d6f3f 100644
--- a/examples/sites/demos/pc/app/slider/show-input.vue
+++ b/examples/sites/demos/pc/app/slider/show-input.vue
@@ -18,3 +18,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/show-tip-composition-api.vue b/examples/sites/demos/pc/app/slider/show-tip-composition-api.vue
index 101184e18..0d71e28ec 100644
--- a/examples/sites/demos/pc/app/slider/show-tip-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/show-tip-composition-api.vue
@@ -12,3 +12,9 @@ function format(value) {
return '当前值为:' + value
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/show-tip.vue b/examples/sites/demos/pc/app/slider/show-tip.vue
index 836778149..66873a80f 100644
--- a/examples/sites/demos/pc/app/slider/show-tip.vue
+++ b/examples/sites/demos/pc/app/slider/show-tip.vue
@@ -21,3 +21,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/slider-event-composition-api.vue b/examples/sites/demos/pc/app/slider/slider-event-composition-api.vue
index fc4e6ce10..33b879955 100644
--- a/examples/sites/demos/pc/app/slider/slider-event-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/slider-event-composition-api.vue
@@ -32,3 +32,9 @@ function stop(val) {
})
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/slider-event.vue b/examples/sites/demos/pc/app/slider/slider-event.vue
index b56f83225..270c0fccd 100644
--- a/examples/sites/demos/pc/app/slider/slider-event.vue
+++ b/examples/sites/demos/pc/app/slider/slider-event.vue
@@ -39,3 +39,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/slider-slot-composition-api.vue b/examples/sites/demos/pc/app/slider/slider-slot-composition-api.vue
index c2ee5234e..f2e26dbdf 100644
--- a/examples/sites/demos/pc/app/slider/slider-slot-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/slider-slot-composition-api.vue
@@ -12,3 +12,9 @@ import { Slider as TinySlider } from '@opentiny/vue'
const value = ref(40)
+
+
diff --git a/examples/sites/demos/pc/app/slider/slider-slot.vue b/examples/sites/demos/pc/app/slider/slider-slot.vue
index f0934b619..fe37ccd69 100644
--- a/examples/sites/demos/pc/app/slider/slider-slot.vue
+++ b/examples/sites/demos/pc/app/slider/slider-slot.vue
@@ -20,3 +20,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/slider/vertical-mode-composition-api.vue b/examples/sites/demos/pc/app/slider/vertical-mode-composition-api.vue
index 11bbba780..ff5ba6404 100644
--- a/examples/sites/demos/pc/app/slider/vertical-mode-composition-api.vue
+++ b/examples/sites/demos/pc/app/slider/vertical-mode-composition-api.vue
@@ -8,3 +8,9 @@ import { Slider as TinySlider } from '@opentiny/vue'
const value = ref(30)
+
+
diff --git a/examples/sites/demos/pc/app/slider/vertical-mode.vue b/examples/sites/demos/pc/app/slider/vertical-mode.vue
index 06219b040..5dc72b3a4 100644
--- a/examples/sites/demos/pc/app/slider/vertical-mode.vue
+++ b/examples/sites/demos/pc/app/slider/vertical-mode.vue
@@ -16,3 +16,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/time-picker/default-value.spec.ts b/examples/sites/demos/pc/app/time-picker/default-value.spec.ts
index 888141cb2..b833042ac 100644
--- a/examples/sites/demos/pc/app/time-picker/default-value.spec.ts
+++ b/examples/sites/demos/pc/app/time-picker/default-value.spec.ts
@@ -9,7 +9,7 @@ test('选择器打开时默认时间设置', async ({ page }) => {
const minute = page.getByRole('listitem').filter({ hasText: '40' }).first()
const second = page.getByRole('listitem').filter({ hasText: '00' }).nth(2)
- await page.locator('#default-value input[type="text"]').click()
+ await page.locator('#default-value input[type="text"]').nth(0).click()
await expect(hour).toHaveClass(/active/)
await expect(minute).toHaveClass(/active/)
await expect(second).toHaveClass(/active/)
diff --git a/examples/sites/demos/pc/app/time-picker/picker-options.spec.ts b/examples/sites/demos/pc/app/time-picker/picker-options.spec.ts
index 31fc33c4d..9a5f57cf9 100644
--- a/examples/sites/demos/pc/app/time-picker/picker-options.spec.ts
+++ b/examples/sites/demos/pc/app/time-picker/picker-options.spec.ts
@@ -5,6 +5,7 @@ test('固定时间范围', async ({ page }) => {
await page.goto('time-picker#picker-options')
const selectTime = page.getByRole('textbox', { name: '18:40:00' })
+ const selectTime1 = page.getByRole('textbox', { name: '19:40:00' })
// 点击17点,点击确定,关闭选择框后,查看input 时间是否仍是18:40:00
await selectTime.click()
await page.waitForTimeout(100)
@@ -12,11 +13,11 @@ test('固定时间范围', async ({ page }) => {
await page.getByRole('button', { name: '确定' }).click()
await page.waitForTimeout(100)
await expect(selectTime).toBeVisible()
- // 点击21点,点击确定,关闭选择框后,查看input 时间是否仍是18:40:00
+ // 点击19点,点击确定,关闭选择框后,查看input 时间是19:40:00
await selectTime.click()
await page.waitForTimeout(100)
- await page.getByRole('listitem').filter({ hasText: '21' }).first().click()
+ await page.getByRole('listitem').filter({ hasText: '19' }).first().click()
await page.getByRole('button', { name: '确定' }).click()
await page.waitForTimeout(100)
- await expect(selectTime).toBeVisible()
+ await expect(selectTime1).toBeVisible()
})
diff --git a/examples/sites/demos/pc/app/tree/filter-view-composition-api.vue b/examples/sites/demos/pc/app/tree/filter-view-composition-api.vue
index 6951e0382..fe8cb9b38 100644
--- a/examples/sites/demos/pc/app/tree/filter-view-composition-api.vue
+++ b/examples/sites/demos/pc/app/tree/filter-view-composition-api.vue
@@ -14,6 +14,13 @@
隐藏
+
+ 搜索后是否高亮关键字:
+
+ 高亮
+ 默认不变
+
+
搜索值:
@@ -23,6 +30,7 @@
ref="treeRef"
:data="data"
:view-type="viewType"
+ :highlight-query="highlightQuery === 'show'"
:filter-node-method="filterNodeMethod"
:show-auxi="showAuxi === 'show'"
default-expand-all
@@ -41,6 +49,7 @@ import { Tree as TinyTree, RadioGroup as TinyRadioGroup, Radio as TinyRadio, Inp
const treeRef = ref()
const viewType = ref('tree')
+const highlightQuery = ref('hide')
const showAuxi = ref('hide')
const filterText = ref('')
const data = ref([
diff --git a/examples/sites/demos/pc/app/tree/filter-view.spec.ts b/examples/sites/demos/pc/app/tree/filter-view.spec.ts
index b30dac9ce..b8c2e94f9 100644
--- a/examples/sites/demos/pc/app/tree/filter-view.spec.ts
+++ b/examples/sites/demos/pc/app/tree/filter-view.spec.ts
@@ -7,15 +7,23 @@ test('测试过滤视图', async ({ page }) => {
const preview = page.locator('.pc-demo-container')
const tree = preview.locator('.tiny-tree').nth(0)
const btnPlain = preview.getByText('平铺视图 plain')
+ const btnHighlight = preview.getByRole('radio', { name: '高亮' })
const checkboxs = tree.locator('.tiny-tree__plain-node .tiny-checkbox')
+ const highlightNodes = tree.locator('.tiny-tree__plain-node .tiny-hl-query-node')
const input = preview.locator('.tiny-input input')
await expect(tree.getByText('数据 1-1-1')).toHaveCount(1)
+ // 测试平铺视图
await btnPlain.click()
await expect(checkboxs).toHaveCount(9)
await page.waitForTimeout(20)
+ // 测试过滤
await input.fill('1-1')
await expect(checkboxs).toHaveCount(3)
+
+ // 测试高亮
+ await btnHighlight.click()
+ await expect(highlightNodes).toHaveCount(2)
})
diff --git a/examples/sites/demos/pc/app/tree/filter-view.vue b/examples/sites/demos/pc/app/tree/filter-view.vue
index 70f0d62b2..2bfc65185 100644
--- a/examples/sites/demos/pc/app/tree/filter-view.vue
+++ b/examples/sites/demos/pc/app/tree/filter-view.vue
@@ -14,6 +14,13 @@
隐藏
+
+ 搜索后是否高亮关键字:
+
+ 高亮
+ 默认不变
+
+
搜索值:
@@ -23,6 +30,7 @@
ref="treeRef"
:data="data"
:view-type="viewType"
+ :highlight-query="highlightQuery === 'show'"
:filter-node-method="filterNodeMethod"
:show-auxi="showAuxi === 'show'"
default-expand-all
@@ -49,6 +57,7 @@ export default {
return {
viewType: 'tree',
showAuxi: 'hide',
+ highlightQuery: 'hide',
filterText: '',
data: [
{
diff --git a/examples/sites/demos/pc/app/tree/webdoc/tree.js b/examples/sites/demos/pc/app/tree/webdoc/tree.js
index 6b6b2f535..131948422 100644
--- a/examples/sites/demos/pc/app/tree/webdoc/tree.js
+++ b/examples/sites/demos/pc/app/tree/webdoc/tree.js
@@ -312,6 +312,7 @@ export default {
'zh-CN': `
通过
filter-node-method
属性, 指定过滤节点时的函数,函数返回
true
时节点显示,否则节点隐藏。
通过
filter
组件方法,触发组件进行过滤。
+ 通过
highlightQuery
属性,是否在匹配的节点中,高亮搜索文字。
通过
view-type
属性,设置组件的视图模式,可选值为
tree
和
plain
,默认为
tree
。
通过
show-auxi
属性,设置在平铺视图时,是否显示节点的辅助信息,默认为
true
。
@@ -321,6 +322,7 @@ export default {
`,
'en-US': `The
filter-node-method
property is used to specify the function for filtering nodes. The function returns
true
to display the nodes.
Run the
filter
component method to trigger the component to filter.
+ Use the
highlightQuery
attribute to determine whether to highlight the search text in the matched node.
Use the
view-type
property to set the component view mode. The optional values are
tree
and
plain
. The default value is
tree
.
The
show-auxi
property is used to set whether to display auxiliary node information in tiled view. The default is
true
.
diff --git a/examples/sites/demos/pc/menus.js b/examples/sites/demos/pc/menus.js
index 31f44dbcf..c08f405aa 100644
--- a/examples/sites/demos/pc/menus.js
+++ b/examples/sites/demos/pc/menus.js
@@ -320,7 +320,10 @@ export const cmpMenus = [
'label': '自定义指令',
'labelEn': 'Custom Instruction',
'key': 'directives-custom-instruction',
- 'children': [{ 'nameCn': '超出隐藏', 'name': 'AutoTip', 'key': 'directives-auto-tip' }]
+ 'children': [
+ { 'nameCn': '超出隐藏', 'name': 'AutoTip', 'key': 'directives-auto-tip' },
+ { 'nameCn': '高亮搜索字', 'name': 'HighlightQuery', 'key': 'directives-highlight-query' }
+ ]
}
]
diff --git a/examples/sites/src/assets/images/Infinitely-icon.png b/examples/sites/src/assets/images/Infinitely-icon.png
new file mode 100644
index 000000000..08c7ea479
Binary files /dev/null and b/examples/sites/src/assets/images/Infinitely-icon.png differ
diff --git a/examples/sites/src/assets/images/Infinitely.png b/examples/sites/src/assets/images/Infinitely.png
new file mode 100644
index 000000000..3d5aa2062
Binary files /dev/null and b/examples/sites/src/assets/images/Infinitely.png differ
diff --git a/examples/sites/src/assets/images/glaciers-icon.png b/examples/sites/src/assets/images/glaciers-icon.png
new file mode 100644
index 000000000..a9e551768
Binary files /dev/null and b/examples/sites/src/assets/images/glaciers-icon.png differ
diff --git a/examples/sites/src/assets/images/glaciers.png b/examples/sites/src/assets/images/glaciers.png
new file mode 100644
index 000000000..7b8b236be
Binary files /dev/null and b/examples/sites/src/assets/images/glaciers.png differ
diff --git a/examples/sites/src/assets/images/oceanic-icon.png b/examples/sites/src/assets/images/oceanic-icon.png
new file mode 100644
index 000000000..12d7a3c3f
Binary files /dev/null and b/examples/sites/src/assets/images/oceanic-icon.png differ
diff --git a/examples/sites/src/assets/images/oceanic.png b/examples/sites/src/assets/images/oceanic.png
new file mode 100644
index 000000000..9f68f94aa
Binary files /dev/null and b/examples/sites/src/assets/images/oceanic.png differ
diff --git a/examples/sites/src/assets/images/starry-sky-icon.png b/examples/sites/src/assets/images/starry-sky-icon.png
new file mode 100644
index 000000000..3849298ac
Binary files /dev/null and b/examples/sites/src/assets/images/starry-sky-icon.png differ
diff --git a/examples/sites/src/assets/images/starry-sky.png b/examples/sites/src/assets/images/starry-sky.png
new file mode 100644
index 000000000..04b49a01a
Binary files /dev/null and b/examples/sites/src/assets/images/starry-sky.png differ
diff --git a/examples/sites/src/i18n/en.json b/examples/sites/src/i18n/en.json
index 8579b59d3..b4e15c681 100644
--- a/examples/sites/src/i18n/en.json
+++ b/examples/sites/src/i18n/en.json
@@ -1,5 +1,7 @@
{
- "language": "EN",
+ "zh-cn": "Chinese",
+ "en-us": "English",
+ "localeType": "Language Selection",
"dark": "Dark",
"light": "Light",
"searchPlaceholder": "Search",
@@ -39,4 +41,4 @@
"demoModeMultiple": "Multiple",
"contributor": "Contributors",
"noData": "No Data"
-}
+}
\ No newline at end of file
diff --git a/examples/sites/src/i18n/zh.json b/examples/sites/src/i18n/zh.json
index 852d3ab32..68ed387cc 100644
--- a/examples/sites/src/i18n/zh.json
+++ b/examples/sites/src/i18n/zh.json
@@ -1,5 +1,7 @@
{
- "language": "中",
+ "zh-cn": "中文",
+ "en-us": "英文",
+ "localeType": "语言选择",
"dark": "深色",
"light": "浅色",
"searchPlaceholder": "搜索",
@@ -39,4 +41,4 @@
"demoModeMultiple": "多示例",
"contributor": "贡献者",
"noData": "暂无数据"
-}
+}
\ No newline at end of file
diff --git a/examples/sites/src/tools/appData.js b/examples/sites/src/tools/appData.js
index 689a98848..7b2c68b6a 100644
--- a/examples/sites/src/tools/appData.js
+++ b/examples/sites/src/tools/appData.js
@@ -11,17 +11,14 @@ const appData = reactive({
bpState: useMediaQuery([640, 1024, 1280]).matches // 3点4区间, bp0,bp1,bp2,bp3
})
const isZhCn = computed(() => appData.lang === ZH_CN_LANG)
-let appFn = {
- toggleLang() {
- let url = location.href
- if (appData.lang === ZH_CN_LANG) {
- url = location.href.replace(zhPath, enPath)
- } else {
- url = location.href.replace(enPath, zhPath)
+const appFn = {
+ toggleLang(name) {
+ if (name !== appData.lang) {
+ let url = location.href
+ url = location.href.replace(LANG_PATH_MAP[appData.lang], LANG_PATH_MAP[name])
+ appData.lang = name
+ location.replace(url)
}
- appData.lang = appData.lang === ZH_CN_LANG ? EN_US_LANG : ZH_CN_LANG
- // router.push(url)
- location.replace(url)
},
toggleTheme() {
appData.theme = appData.theme === 'light' ? 'dark' : 'light'
diff --git a/examples/sites/src/tools/useApiMode.js b/examples/sites/src/tools/useApiMode.js
index bed22f044..9f19cedd8 100644
--- a/examples/sites/src/tools/useApiMode.js
+++ b/examples/sites/src/tools/useApiMode.js
@@ -1,9 +1,11 @@
import { reactive } from 'vue'
import { $local } from './storage'
+import { appFn } from './appData'
const _modeKey = 'tiny-vue-api-mode'
const _demoModeKey = 'tiny-vue-demo-mode'
const apiModeState = reactive({
+ localeMode: location.href.includes('en-US') ? 'enUS' : 'zhCN',
apiMode: $local[_modeKey] || 'Composition', // 示例风格: Options: 组合式; Composition: 选项式
demoMode: $local[_demoModeKey] || 'default' // 示例展示: default:多示例, single:单示例
})
@@ -12,6 +14,9 @@ const apiModeFn = {
getDemoName: (name) => {
return name.replace(/\.vue$/, `${apiModeState.apiMode === 'Options' ? '' : '-composition-api'}.vue`)
},
+ changeLocaleMode: (name) => {
+ appFn.toggleLang(name)
+ },
changeApiMode: (name) => {
$local[_modeKey] = name
},
diff --git a/examples/sites/src/tools/useStyleSettings.js b/examples/sites/src/tools/useStyleSettings.js
index 92234f0f5..88f729ba1 100644
--- a/examples/sites/src/tools/useStyleSettings.js
+++ b/examples/sites/src/tools/useStyleSettings.js
@@ -1,6 +1,22 @@
/** 文档显示风格设置 */
const getStyleSettings = (i18nByKey) => {
const styleSettings = [
+ {
+ // 语言选择
+ name: 'localeMode',
+ defaultValue: 'zhCN',
+ title: i18nByKey('localeType'),
+ options: [
+ {
+ value: 'zhCN',
+ text: i18nByKey('zh-cn')
+ },
+ {
+ value: 'enUS',
+ text: i18nByKey('en-us')
+ }
+ ]
+ },
{
// 示例代码风格
name: 'apiMode',
diff --git a/examples/sites/src/tools/useTheme.js b/examples/sites/src/tools/useTheme.js
index 442d320d4..9e0907ecc 100644
--- a/examples/sites/src/tools/useTheme.js
+++ b/examples/sites/src/tools/useTheme.js
@@ -16,6 +16,17 @@ import {
INFINITY_THEME,
getKeyByValue
} from '../const'
+import glaciers from '@/assets/images/glaciers.png'
+import glaciersIcon from '@/assets/images/glaciers-icon.png'
+
+import infinitely from '@/assets/images/Infinitely.png'
+import infinitelyIcon from '@/assets/images/Infinitely-icon.png'
+
+import oceanic from '@/assets/images/oceanic.png'
+import oceanicIcon from '@/assets/images/oceanic-icon.png'
+
+import starrySky from '@/assets/images/starry-sky.png'
+import starrySkyIcon from '@/assets/images/starry-sky-icon.png'
const themeMap = {
[DEFAULT_THEME]: null,
@@ -27,10 +38,34 @@ const themeMap = {
const isEn = appData.lang === 'enUS'
const themeData = [
- { value: [DEFAULT_THEME], label: isEn ? 'Default Theme' : '默认主题' },
- { value: [INFINITY_THEME], label: isEn ? 'Infinity Theme' : '无限主题' },
- { value: [AURORA_THEME], label: isEn ? 'Aurora Theme' : 'Aurora 主题' },
- { value: [SMB_THEME], label: isEn ? 'SMB Theme' : 'SMB 主题' }
+ {
+ value: [DEFAULT_THEME],
+ label: isEn ? 'Default Theme' : '冰川主题',
+ tips: isEn ? 'Accurate, Efficient, Distinct' : '精准、高效、清晰',
+ icon: glaciersIcon,
+ bgImage: glaciers
+ },
+ {
+ value: [SMB_THEME],
+ label: isEn ? 'Star Theme' : '星空主题',
+ tips: isEn ? 'Leading, Innovative, Reliable' : '领先、创新、信赖',
+ icon: starrySkyIcon,
+ bgImage: starrySky
+ },
+ {
+ value: [AURORA_THEME],
+ label: isEn ? 'Ocean Theme' : '海洋主题',
+ tips: isEn ? 'Simple, Agile, Delightful' : '简约、敏捷、愉悦',
+ icon: oceanicIcon,
+ bgImage: oceanic
+ },
+ {
+ value: [INFINITY_THEME],
+ label: isEn ? 'Infinity Theme' : '无限主题',
+ tips: isEn ? 'Creative, Scientific, Efficient' : '创造、科学、高效',
+ icon: infinitelyIcon,
+ bgImage: infinitely
+ }
]
const designConfigMap = {
diff --git a/examples/sites/src/views/components/float-settings.vue b/examples/sites/src/views/components/float-settings.vue
index b4703b158..1115c0d07 100644
--- a/examples/sites/src/views/components/float-settings.vue
+++ b/examples/sites/src/views/components/float-settings.vue
@@ -5,69 +5,70 @@
:style="settingsStyle"
>
-
toggleMenuShow(visible, 'theme')">
-
-
-
-
-
-
-
-
-
{{ item.text }}
+
+
+
+
+
+
-
+
-
toggleMenuShow(visible, 'style')"
+ width="180"
+ placement="left-end"
+ trigger="manual"
+ :visible-arrow="false"
+ v-model="demoStyleVisible"
+ popper-class="opt-menu style-settings-menu theme-settings-popover"
>
-
-
-
+
+
{{ item.title }}
+
+ {{ option.text }}
+
+
+
+
+
-
-
-
-
-
{{ item.title }}
-
- {{
- option.text
- }}
-
-
-
-
+
@@ -87,7 +88,7 @@
diff --git a/packages/vue/src/grid/src/mobile-first/index.vue b/packages/vue/src/grid/src/mobile-first/index.vue
index 8cc24a6fc..9af2ebfea 100644
--- a/packages/vue/src/grid/src/mobile-first/index.vue
+++ b/packages/vue/src/grid/src/mobile-first/index.vue
@@ -15,6 +15,9 @@
+
+
+
= config?.tableVm?.tableColumn
const { primaryField, contentFields, selectable, renderLink, operable, few = 4 } = cardConfig as CardConfig
const { renderList } = listConfig
const { renderGantt } = ganttConfig
+ const { renderCustom } = customConfig
let fieldName: string = ''
let fieldNames: Array = []
let propCols: Array = firstFewPropertyColumn(tableColumn, few)
@@ -200,6 +222,7 @@ export default defineComponent({
let slotLink: Function
let slotList: Function
let slotGantt: Function
+ let slotCustom: Function
if (primaryField) {
fieldName = fnField(primaryField)
@@ -232,9 +255,10 @@ export default defineComponent({
slotLink = config?.tableVm?.$grid?.slots?.link || renderLink
slotList = config?.tableVm?.$grid?.slots?.list || renderList
slotGantt = config?.tableVm?.$grid?.slots?.gantt || renderGantt
+ slotCustom = config?.tableVm?.$grid?.slots?.custom || renderCustom
Object.assign(this, { primaryColumn, contentColumns, operationColumn, selectionColumn })
- Object.assign(this, { slotLink, slotList, slotGantt })
+ Object.assign(this, { slotLink, slotList, slotGantt, slotCustom })
},
typeColumns(columns: Array, types: Array, field?: string) {
const cols = types.map((type) => columns.find((column) => column.visible && column[field || 'property'] === type))
diff --git a/packages/vue/src/grid/src/pager/src/methods.ts b/packages/vue/src/grid/src/pager/src/methods.ts
index fd48d47fa..85a08c6d1 100644
--- a/packages/vue/src/grid/src/pager/src/methods.ts
+++ b/packages/vue/src/grid/src/pager/src/methods.ts
@@ -37,12 +37,12 @@ export default {
renderPager({ $slots, _vm, loading, pager, pagerConfig, tableLoading, vSize }) {
let res = null
- const { isThemeSaas, isModeMobileFirst, isViewGantt, currentBreakpoint, fetchData } = _vm
+ const { isThemeSaas, isModeMobileFirst, isViewGantt, currentBreakpoint, fetchData, isViewCustom } = _vm
const style = { display: 'none' }
- // 使用saas主题和多端模式时,内置Pager使用多端模板。在非gantt视图或gantt视图大屏下显示多端Pager
+ // 使用saas主题和多端模式时,内置Pager使用多端模板。在非gantt/custom视图或gantt/custom视图大屏下显示多端Pager
if (isThemeSaas && isModeMobileFirst) {
- if (!isViewGantt || (isViewGantt && currentBreakpoint !== 'default')) {
+ if (!(isViewGantt || isViewCustom) || ((isViewGantt || isViewCustom) && currentBreakpoint !== 'default')) {
style.display = 'flex'
style.justifyContent = 'flex-end'
}
diff --git a/packages/vue/src/grid/src/table/src/methods.ts b/packages/vue/src/grid/src/table/src/methods.ts
index 2a2296f57..ede5071c9 100644
--- a/packages/vue/src/grid/src/table/src/methods.ts
+++ b/packages/vue/src/grid/src/table/src/methods.ts
@@ -159,10 +159,10 @@ const sortMultiple = (rows, columns, _vm) => {
}
// 创建快速缓存
-const buildCache = (tableData, treeConfig = {}) => {
+const buildCache = (tableData, { treeConfig, treeOrdered }) => {
const backupMap = new WeakMap()
- const { children, ordered, temporaryIndex = '_$index_' } = treeConfig || {}
- const isTreeOrderedFalse = treeConfig && !ordered
+ const { children, temporaryIndex = '_$index_' } = treeConfig || {}
+ const isTreeOrderedFalse = treeConfig && !treeOrdered
const traverse = (arr, rowLevel, parentIndex) => {
const backup = []
@@ -210,10 +210,24 @@ const Methods = {
},
clearAll(silent) {
const { fetchOption = {} } = this.$grid
- const { isReloadFilter } = fetchOption
+ const { isReloadFilter, isReloadScroll = false } = fetchOption
- run(['clearScroll', 'clearSort', 'clearCurrentRow', 'clearCurrentColumn'], this)
- run(['clearSelection', 'clearRowExpand', 'clearTreeExpand'], this)
+ let functionNames = [
+ 'clearScroll',
+ 'clearSort',
+ 'clearCurrentRow',
+ 'clearCurrentColumn',
+ 'clearSelection',
+ 'clearRowExpand',
+ 'clearTreeExpand'
+ ]
+
+ // 存在配置时,移除 clearScroll, 重载数据时不清除滚动位置
+ if (isReloadScroll) {
+ functionNames = functionNames.filter((i) => i !== 'clearScroll')
+ }
+
+ run(functionNames, this)
if (typeof isReloadFilter === 'undefined' ? TINYGrid._filter : !isReloadFilter) {
this.clearFilter(silent)
@@ -266,9 +280,11 @@ const Methods = {
},
// 全量加载表格数据
loadTableData(datas, notRefresh) {
- let { $refs, editStore, height, maxHeight, treeConfig } = this as any
- let { lastScrollLeft, lastScrollTop } = this as any
- let { scrollY } = this.optimizeOpts
+ let { $grid, $refs, editStore, height, maxHeight, treeConfig, lastScrollLeft, lastScrollTop, optimizeOpts } =
+ this as any
+ let { fetchOption = {} } = $grid
+ let { isReloadScroll = false } = fetchOption
+ let { scrollY } = optimizeOpts
// 浅拷贝原始全量数据
let tableFullData = isArray(datas) ? datas.slice(0) : []
// 是否开启纵向的虚拟滚动,默认大于等于500条开启纵向的虚拟滚动
@@ -282,7 +298,7 @@ const Methods = {
// 缓存数据
this.updateCache(true)
// 深拷贝原始数据,并建立表格行数据和行数据对应的原始数据的映射关系,可以极大的提高检查编辑态单元格status和还原行数据的速度
- const { backupData, backupMap } = buildCache(tableFullData, treeConfig)
+ const { backupData, backupMap } = buildCache(tableFullData, this)
// tableSynchData:用户传递拖来的原始数据,tableSourceData:深拷贝用户传递过来的初始原始数据
Object.assign(this, { tableSynchData: datas, tableSourceData: backupData, backupMap, scrollYLoad })
@@ -291,7 +307,7 @@ const Methods = {
}
// 如果notRefresh为true表示不刷新表格状态,所以也不需要清除滚动状态
- if (!notRefresh) {
+ if (!notRefresh && !isReloadScroll) {
this.clearScroll()
}
@@ -303,7 +319,7 @@ const Methods = {
let second = () => {
// 让表格滚动条滚动到最后一次滚动到的位置
if (lastScrollLeft || lastScrollTop) {
- return this.scrollTo(lastScrollLeft, lastScrollTop)
+ return this.attemptRestoreScoll({ lastScrollLeft, lastScrollTop })
} else {
// 重置表头滚动条位置
let headerElem = $refs.tableHeader ? $refs.tableHeader.$el : null
@@ -894,10 +910,19 @@ const Methods = {
this.visibleColumnChanged = true
this.columnAnchor && this.$grid.buildColumnAnchorParams()
- return this.$nextTick().then(() => {
- this.updateFooter()
- this.recalculate()
- })
+ return this.$nextTick()
+ .then(() => {
+ this.updateFooter()
+ this.recalculate()
+ })
+ .then(() => {
+ // 在列初始化、列动态改变后都会抛出
+ this.$emit('after-refresh-column')
+ // 在列动态改变后都会尝试恢复滚动位置
+ if (this.isColumnReady) {
+ this.attemptRestoreScoll()
+ }
+ })
},
// 指定列宽的列进行拆分
analyColumnWidth() {
@@ -1075,12 +1100,13 @@ const Methods = {
end && end()
},
blurOutside({ row, args, column }, event) {
+ const { editConfig, getEventTargetNode, $el } = this
if (column && row) {
const { editor } = column
if (typeof editor.blurOutside === 'function') {
- return !!editor.blurOutside({ cell: args.cell, event })
+ return Boolean(editor.blurOutside({ cell: args.cell, event }))
}
- const blurClassConfig = editor.blurClass || this.editConfig.blurClass
+ const blurClassConfig = editor.blurClass || editConfig.blurClass
if (blurClassConfig) {
let blurClass = []
if (typeof blurClassConfig === 'string') {
@@ -1088,10 +1114,14 @@ const Methods = {
} else if (isArray(blurClassConfig)) {
blurClass = blurClassConfig.slice(0)
}
- return (
- (args.cell && args.cell.contains(event.target)) ||
- blurClass.some((cls) => !this.getEventTargetNode(event, document.body, cls).flag)
- )
+
+ if (args?.cell.contains(event.target)) {
+ return true
+ }
+ if (editConfig.mode === 'row' && getEventTargetNode(event, $el, 'tiny-grid-body__column').flag) {
+ return true
+ }
+ return blurClass.every((cls) => !getEventTargetNode(event, document.body, cls).flag)
}
}
},
@@ -2017,6 +2047,36 @@ const Methods = {
traverse(this.childColumns)
return columnIds.join(',')
+ },
+ // 获取多选数据状态,避免用户侧很长的调用 this.$refs.grid.$refs.auiTable.selection
+ getStateSelection() {
+ return this.selection
+ },
+ // 尝试恢复滚动位置,规范了最大滚动位置的取值
+ attemptRestoreScoll(options) {
+ let { lastScrollTop, lastScrollLeft } = options || this
+
+ const { scrollXLoad, scrollYLoad, elemStore } = this
+ const tableBodyElem = elemStore['main-body-wrapper']
+
+ if ((lastScrollTop || lastScrollLeft) && tableBodyElem) {
+ fastdom.measure(() => {
+ const maxScrollTop = tableBodyElem.scrollHeight - tableBodyElem.offsetHeight
+ const maxScrollLeft = tableBodyElem.scrollWidth - tableBodyElem.offsetWidth
+
+ lastScrollTop = Math.min(lastScrollTop, maxScrollTop)
+ lastScrollLeft = Math.min(lastScrollLeft, maxScrollLeft)
+
+ fastdom.mutate(() => {
+ this.scrollTo(lastScrollLeft, lastScrollTop)
+
+ scrollXLoad && this.triggerScrollXEvent()
+ scrollYLoad && this.triggerScrollYEvent({ target: { scrollTop: lastScrollTop } })
+ })
+ })
+ }
+
+ return this.$nextTick()
}
}
funcs.forEach((name) => {
diff --git a/packages/vue/src/grid/src/table/src/table.ts b/packages/vue/src/grid/src/table/src/table.ts
index b2580408b..e6379d34a 100644
--- a/packages/vue/src/grid/src/table/src/table.ts
+++ b/packages/vue/src/grid/src/table/src/table.ts
@@ -98,10 +98,7 @@ function loadStatic(data, _vm) {
function mergeTreeConfig(_vm) {
if (_vm.treeConfig) {
const { ordered } = _vm.treeConfig
-
- if (isNull(ordered)) {
- _vm.treeConfig.ordered = true
- }
+ _vm.treeOrdered = isNull(ordered) ? true : Boolean(ordered)
}
}
@@ -318,7 +315,7 @@ const renderFooterBorder = (_vm) => {
// 设置表格最外层元素类名
function getTableAttrs(tableVm) {
- const { vSize, editConfig, showHeader, showFooter, overflowY, overflowX, showOverflow } = tableVm
+ const { isShapeTable, vSize, editConfig, showHeader, showFooter, overflowY, overflowX, showOverflow } = tableVm
const { showHeaderOverflow, highlightCell, optimizeOpts, stripe, border, isGroup, mouseConfig = {} } = tableVm
const { maxHeight, loading, highlightHoverRow, highlightHoverColumn, validOpts } = tableVm
const { stripeSaas, borderSaas, borderVertical, isThemeSaas, rowSpan, dropConfig = {} } = tableVm
@@ -335,7 +332,8 @@ function getTableAttrs(tableVm) {
const style = {}
- if (maxHeight) {
+ // 多端表格的最大高度在多端模板中处理,此处仅处理pc端表格逻辑
+ if (isShapeTable && maxHeight) {
style.maxHeight = isScale(maxHeight) ? maxHeight : toNumber(maxHeight) + 'px'
}
@@ -550,7 +548,9 @@ const getTableData = () => {
// 是否是标签式用法场景
isTagUsageSence: false,
// 收集列信息(列数量和列顺序)
- columnCollectKey: ''
+ columnCollectKey: '',
+ // treeConfig.ordered的取值处理
+ treeOrdered: true
}
return tableData
}
@@ -754,6 +754,8 @@ export default defineComponent({
listConfig: Object,
// 多端甘特配置
ganttConfig: Object,
+ // 多端custom配置
+ customConfig: Object,
// 数据预取配置
prefetch: [Boolean, Array],
// 相交配置
@@ -940,12 +942,12 @@ export default defineComponent({
mergeScrollDirStore(scrollX, scrollXStore)
mergeScrollDirStore(scrollY, scrollYStore)
- // 初始化表格渲染数据
- loadStatic(data, this)
-
// 合并树表配置项
mergeTreeConfig(this)
+ // 初始化表格渲染数据
+ loadStatic(data, this)
+
bindEvent(this)
// vue3下额外监控数组长度改变,解决push无响应等问题
@@ -1086,11 +1088,11 @@ export default defineComponent({
isShapeTable,
rowSpan
} = this as any
- let { borderVertical, cardConfig, listConfig, ganttConfig } = this
+ let { borderVertical, cardConfig, listConfig, ganttConfig, customConfig } = this
let { leftList, rightList } = columnStore
const props = { tableData, tableColumn, visibleColumn, collectColumn, size: vSize, isGroup }
- Object.assign(props, { cardConfig, listConfig, ganttConfig })
+ Object.assign(props, { cardConfig, listConfig, ganttConfig, customConfig })
let args = { $slots: slots, _vm: this, leftList, optimizeOpts, overflowX, props, rightList }
Object.assign(args, { showFooter, showHeader, tableColumn, tableData, vSize, visibleColumn })
diff --git a/packages/vue/src/grid/src/table/src/utils/computeScrollLoad.ts b/packages/vue/src/grid/src/table/src/utils/computeScrollLoad.ts
index e35c6c873..7fbfe10f5 100644
--- a/packages/vue/src/grid/src/table/src/utils/computeScrollLoad.ts
+++ b/packages/vue/src/grid/src/table/src/utils/computeScrollLoad.ts
@@ -35,7 +35,10 @@ export function computeScrollYLoad({ _vm, scrollLoad, scrollY, scrollYLoad, scro
if (scrollYLoad) {
// scrollY.vSize用户配置的可视区域渲染行数
- let visibleYSize = toNumber(scrollY.vSize || Math.ceil(tableBodyElem.clientHeight / scrollYStore.rowHeight))
+ const bodyHeight = toNumber(
+ tableBodyElem.style?.height || tableBodyElem.style?.maxHeight || tableBodyElem.clientHeight
+ )
+ let visibleYSize = toNumber(scrollY.vSize || Math.ceil(bodyHeight / scrollYStore.rowHeight))
scrollYStore.visibleSize = visibleYSize
@@ -67,10 +70,9 @@ export function computeScrollXLoad({ _vm, scrollX, scrollXLoad, scrollXStore, ta
let width = 0
let visibleXSize = 0
const len = visibleColumn.length
+ const colsWidth = visibleColumn?.map((i) => i.renderWidth).sort((a, b) => a - b) || []
for (let i = 0; i < len; i++) {
- const column = visibleColumn[i]
-
- width += column.renderWidth
+ width += colsWidth[i]
// 当虚拟滚动可见列宽度大于表格宽度或者循环结束,保存可见列大小
if (width > clientWidth || i === len - 1) {
visibleXSize = i + 1
diff --git a/packages/vue/src/input/src/index.ts b/packages/vue/src/input/src/index.ts
index aca13a3e5..ceda15e54 100644
--- a/packages/vue/src/input/src/index.ts
+++ b/packages/vue/src/input/src/index.ts
@@ -153,6 +153,10 @@ export const inputProps = {
},
width: {
type: [String, Number] as PropType
+ },
+ showTooltip: {
+ type: Boolean,
+ default: true
}
}
diff --git a/packages/vue/src/input/src/mobile-first.vue b/packages/vue/src/input/src/mobile-first.vue
index 63329d031..9274f700f 100644
--- a/packages/vue/src/input/src/mobile-first.vue
+++ b/packages/vue/src/input/src/mobile-first.vue
@@ -42,9 +42,9 @@
>
+
-
import { renderless, api } from '@opentiny/vue-renderless/input/vue'
-import { props, setup, defineComponent } from '@opentiny/vue-common'
+import { props, setup, defineComponent, directive } from '@opentiny/vue-common'
+import Clickoutside from '@opentiny/vue-renderless/common/deps/clickoutside'
import TinyTallStorage from './tall-storage.vue'
import { IconClose, IconEyeopen, IconEyeclose } from '@opentiny/vue-icon'
import Tooltip from '@opentiny/vue-tooltip'
@@ -268,6 +273,7 @@ export default defineComponent({
'click',
'input'
],
+ directives: directive({ Clickoutside }),
components: {
IconClose: IconClose(),
IconEyeopen: IconEyeopen(),
@@ -307,7 +313,8 @@ export default defineComponent({
'frontClearIcon',
'showEmptyValue',
'hoverExpand',
- 'popupMore'
+ 'popupMore',
+ 'showTooltip'
],
setup(props, context) {
return setup({ props, context, renderless, api })
diff --git a/packages/vue/src/option/package.json b/packages/vue/src/option/package.json
index da014e4e5..4b8abbe63 100644
--- a/packages/vue/src/option/package.json
+++ b/packages/vue/src/option/package.json
@@ -1,24 +1,25 @@
{
"name": "@opentiny/vue-option",
+ "type": "module",
"version": "3.17.0",
"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-common": "workspace:~",
+ "@opentiny/vue-directive": "workspace:~",
"@opentiny/vue-icon": "workspace:~",
+ "@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-theme": "workspace:~"
},
- "license": "MIT"
-}
\ No newline at end of file
+ "devDependencies": {
+ "@opentiny-internal/vue-test-utils": "workspace:*",
+ "vitest": "^0.31.0"
+ }
+}
diff --git a/packages/vue/src/option/src/mobile-first.vue b/packages/vue/src/option/src/mobile-first.vue
index 1688e4ec3..5565e4b0e 100644
--- a/packages/vue/src/option/src/mobile-first.vue
+++ b/packages/vue/src/option/src/mobile-first.vue
@@ -1,7 +1,6 @@
{{ state.currentLabel }}
@@ -52,9 +52,11 @@
diff --git a/packages/vue/src/tabs/src/mobile-first.vue b/packages/vue/src/tabs/src/mobile-first.vue
index a01924be5..4739d8686 100644
--- a/packages/vue/src/tabs/src/mobile-first.vue
+++ b/packages/vue/src/tabs/src/mobile-first.vue
@@ -21,7 +21,7 @@ export default defineComponent({
'beforeClose',
'swipeable'
],
- emits: ['update:activeName', 'update:modelValue', 'click', 'edit', 'close', 'add'],
+ emits: ['update:activeName', 'update:modelValue', 'click', 'edit', 'close'],
components: { TabBar },
setup(props, context): any {
return setup({ props, context, renderless, api }) as unknown as ITabsApi
diff --git a/packages/vue/src/tabs/src/mobile-first/tab-nav-item.vue b/packages/vue/src/tabs/src/mobile-first/tab-nav-item.vue
index 7bf80d316..8947fda19 100644
--- a/packages/vue/src/tabs/src/mobile-first/tab-nav-item.vue
+++ b/packages/vue/src/tabs/src/mobile-first/tab-nav-item.vue
@@ -12,7 +12,8 @@ export default defineComponent({
selected: Boolean,
navItem: Object
},
- setup(props: any, context: any) {
+ components: { IconClose: IconClose() },
+ setup(props, context): any {
return setup({ props, context, renderless, api, mono: true })
},
render() {
diff --git a/packages/vue/src/tabs/src/mobile-first/tab-swipe.vue b/packages/vue/src/tabs/src/mobile-first/tab-swipe.vue
index 5369ee596..a015a8b78 100644
--- a/packages/vue/src/tabs/src/mobile-first/tab-swipe.vue
+++ b/packages/vue/src/tabs/src/mobile-first/tab-swipe.vue
@@ -13,56 +13,21 @@
diff --git a/packages/vue/src/time/src/pc.vue b/packages/vue/src/time/src/pc.vue
index 4b8da6122..59b394d78 100644
--- a/packages/vue/src/time/src/pc.vue
+++ b/packages/vue/src/time/src/pc.vue
@@ -12,6 +12,16 @@
@@ -46,11 +58,15 @@
import { renderless, api } from '@opentiny/vue-renderless/time/vue'
import { props, setup, defineComponent } from '@opentiny/vue-common'
import TimeSpinner from '@opentiny/vue-time-spinner'
+import Input from '@opentiny/vue-input'
+import Button from '@opentiny/vue-button'
export default defineComponent({
emits: ['dodestroy', 'pick', 'select-range'],
components: {
- TimeSpinner
+ TimeSpinner,
+ TinyInput: Input,
+ TinyButton: Button
},
props: [...props, 'show', 'timeArrowControl', 'emitter', 'value', 'step'],
setup(props, context) {
diff --git a/packages/vue/src/tooltip/src/pc.vue b/packages/vue/src/tooltip/src/pc.vue
index 233f1c2ca..a46df1a33 100644
--- a/packages/vue/src/tooltip/src/pc.vue
+++ b/packages/vue/src/tooltip/src/pc.vue
@@ -22,7 +22,9 @@ import {
defineComponent,
$props,
isEmptyVnode,
- hooks
+ hooks,
+ stringifyCssClass,
+ deduplicateCssClass
} from '@opentiny/vue-common'
import type { ITinyVm } from '@opentiny/vue-renderless/types/shared.type'
import '@opentiny/vue-theme/tooltip/index.less'
@@ -201,34 +203,6 @@ export default defineComponent({
}
})
}
- const stringifyClassObj = (classObj: Record) =>
- Object.keys(classObj)
- .filter((key) => classObj[key])
- .join(' ')
-
- const stringifyClassArr = (classArr: string[]) =>
- classArr
- .filter((item) => item)
- .map((item) =>
- typeof item === 'string' ? item.trim() : typeof item === 'object' ? stringifyClassObj(item) : ''
- )
- .join(' ')
-
- const addTooltipClass = (bindClass: string | Record | string[]) => {
- let className = ''
-
- if (bindClass) {
- if (typeof bindClass === 'string') {
- className = bindClass.trim()
- } else if (Array.isArray(bindClass)) {
- className = stringifyClassArr(bindClass)
- } else if (typeof bindClass === 'object') {
- className = stringifyClassObj(bindClass)
- }
- }
-
- return 'tiny-tooltip ' + className.replace(/\btiny-tooltip\b/g, '').trim()
- }
// 查找默认的slots, 并把它渲染到组件所在位置上。
const getFirstElement = () => {
@@ -256,7 +230,7 @@ export default defineComponent({
const data = firstElement.data || firstElement.props || (firstElement.props = {})
- data.class = addTooltipClass(data.class)
+ data.class = deduplicateCssClass('tiny-tooltip ' + stringifyCssClass(data.class))
return firstElement
}
diff --git a/packages/vue/src/tree/package.json b/packages/vue/src/tree/package.json
index acabbb957..4b61a954e 100644
--- a/packages/vue/src/tree/package.json
+++ b/packages/vue/src/tree/package.json
@@ -1,31 +1,32 @@
{
"name": "@opentiny/vue-tree",
+ "type": "module",
"version": "3.17.0",
"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-common": "workspace:~",
- "@opentiny/vue-collapse-transition": "workspace:~",
- "@opentiny/vue-icon": "workspace:~",
- "@opentiny/vue-checkbox": "workspace:~",
- "@opentiny/vue-radio": "workspace:~",
- "@opentiny/vue-input": "workspace:~",
- "@opentiny/vue-switch": "workspace:~",
- "@opentiny/vue-popover": "workspace:~",
"@opentiny/vue-button": "workspace:~",
+ "@opentiny/vue-checkbox": "workspace:~",
+ "@opentiny/vue-collapse-transition": "workspace:~",
+ "@opentiny/vue-common": "workspace:~",
+ "@opentiny/vue-directive": "workspace:~",
+ "@opentiny/vue-icon": "workspace:~",
+ "@opentiny/vue-input": "workspace:~",
+ "@opentiny/vue-popover": "workspace:~",
+ "@opentiny/vue-radio": "workspace:~",
+ "@opentiny/vue-renderless": "workspace:~",
+ "@opentiny/vue-switch": "workspace:~",
"@opentiny/vue-theme": "workspace:~"
},
- "license": "MIT"
-}
\ No newline at end of file
+ "devDependencies": {
+ "@opentiny-internal/vue-test-utils": "workspace:*",
+ "vitest": "^0.31.0"
+ }
+}
diff --git a/packages/vue/src/tree/src/index.ts b/packages/vue/src/tree/src/index.ts
index 720072c01..b791478e8 100644
--- a/packages/vue/src/tree/src/index.ts
+++ b/packages/vue/src/tree/src/index.ts
@@ -158,7 +158,17 @@ export default defineComponent({
default: () => ({})
},
// tiny 新增
- showLine: Boolean
+ showLine: Boolean,
+ // tiny 新增,是否显示树节点聚焦时的背景颜色
+ isShowFocusBg: {
+ type: Boolean,
+ default: true
+ },
+ // 是否在匹配的节点中,高亮搜索文字
+ highlightQuery: {
+ type: Boolean,
+ default: false
+ }
},
setup(props, context) {
return $setup({ props, context, template })
diff --git a/packages/vue/src/tree/src/pc.vue b/packages/vue/src/tree/src/pc.vue
index 5b13b32e7..834f96b4b 100644
--- a/packages/vue/src/tree/src/pc.vue
+++ b/packages/vue/src/tree/src/pc.vue
@@ -26,10 +26,12 @@
- {{ plainNode.title }}
+ {{
+ plainNode.title
+ }}
@@ -160,9 +164,10 @@ import Checkbox from '@opentiny/vue-checkbox'
import Clickoutside from '@opentiny/vue-renderless/common/deps/clickoutside'
import TreeNode from './tree-node.vue'
import Radio from '@opentiny/vue-radio'
+import { HighlightQuery } from '@opentiny/vue-directive'
export default defineComponent({
- directives: directive({ Clickoutside }),
+ directives: { ...directive({ Clickoutside }), HighlightQuery },
props: [
...props,
'data',
@@ -222,7 +227,9 @@ export default defineComponent({
'deleteNodeMethod',
'showCheckedMark',
'willChangeView',
- 'editConfig'
+ 'editConfig',
+ 'isShowFocusBg',
+ 'highlightQuery'
],
components: {
TreeNode,
diff --git a/packages/vue/src/tree/src/tree-node.vue b/packages/vue/src/tree/src/tree-node.vue
index 5482865f0..5f62e1f1c 100644
--- a/packages/vue/src/tree/src/tree-node.vue
+++ b/packages/vue/src/tree/src/tree-node.vue
@@ -26,6 +26,7 @@
'is-disabled': node.disabled,
'is-leaf': node.isLeaf,
'is-root': node.level === 1,
+ 'is-show-focus-bg': isShowFocusBg,
'show-line': showLine,
'show-checkbox': showCheckbox
}"
@@ -148,10 +149,10 @@
>
-
+ >
{tipSlot}
)}
- handleClick($event, sourceType)}
- onKeydown={handleKeydown}
- tabindex="0">
- {listType === 'drag-single' ? (
-
- {defaultSlot}
-
- ) : (
- defaultSlot
- )}
-
- {operateSlot}
- {state.currentBreakpoint !== 'default' && tipSlot && (
- {tipSlot}
+ {state.currentBreakpoint === 'default' && (
+ handleClick($event, sourceType)}
+ onKeydown={handleKeydown}
+ tabindex="0">
+ {listType === 'drag-single' ? (
+
+ {defaultSlot}
+
+ ) : (
+ defaultSlot
+ )}
+
)}
+ {state.currentBreakpoint !== 'default' && (
+
+ handleClick($event, sourceType)}
+ onKeydown={handleKeydown}
+ tabindex="0">
+ {listType === 'drag-single' ? (
+
+ {defaultSlot}
+
+ ) : (
+ defaultSlot
+ )}
+
+
+ )}
+ {operateSlot}
= limit
@@ -107,7 +106,6 @@ export default defineComponent({
)}
{operateSlot}
- {tipSlot}
- {{ option.userCN }}
+ {{ option[state.textField] }}
{{ option.dept }}