diff --git a/examples/sites/demos/pc/app/statistic/basic-usage.spec.ts b/examples/sites/demos/pc/app/statistic/basic-usage.spec.ts
index 2498e0328..74656c1ae 100644
--- a/examples/sites/demos/pc/app/statistic/basic-usage.spec.ts
+++ b/examples/sites/demos/pc/app/statistic/basic-usage.spec.ts
@@ -3,18 +3,6 @@ import { test, expect } from '@playwright/test'
test('基本用法', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('statistic#basic-usage')
- await page
- .locator('div')
- .filter({ hasText: /123\/100$/ })
- .first()
- .click()
- await page
- .locator('div')
- .filter({ hasText: /^基本用法$/ })
- .first()
- .click()
- await page
- .locator('div')
- .filter({ hasText: /^306,526\.23$/ })
- .click()
+ await page.locator('#basic-usage').getByText('306,526', { exact: true })
+ await page.getByText('306,526.23')
})
diff --git a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot-composition-api.vue b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot-composition-api.vue
index 028c004b8..0e22a2788 100644
--- a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot-composition-api.vue
+++ b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot-composition-api.vue
@@ -2,15 +2,21 @@
-
-
-
-
+
- 已使用容量(GB)
- GB
+ 已使用容量(GB)
+ GB
+
+
+ ¥
+ /年
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.spec.ts b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.spec.ts
new file mode 100644
index 000000000..1ef74f5e5
--- /dev/null
+++ b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.spec.ts
@@ -0,0 +1,19 @@
+import { test, expect } from '@playwright/test'
+
+test('前后缀', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('statistic#prefix-suffix-slot')
+ await page
+ .locator('div')
+ .filter({ hasText: /^已使用容量\(GB\)306GB$/ })
+ .first()
+ await page
+ .locator('div')
+ .filter({ hasText: /^¥1,280\.00\/年$/ })
+ .first()
+ await page
+ .locator('div')
+ .filter({ hasText: /^300GB$/ })
+ .first()
+ await expect(page.getByText(/^¥1,280\.00\/年$/)).toHaveClass(/tiny-statistic__slots/)
+})
diff --git a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.vue b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.vue
index aaf3f7a9c..fbfe4db28 100644
--- a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.vue
+++ b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.vue
@@ -2,15 +2,21 @@
-
-
-
-
+
- 已使用容量(GB)
- GB
+ 已使用容量(GB)
+ GB
+
+
+ ¥
+ /年
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/statistic/statistic-slot-composition-api.vue b/examples/sites/demos/pc/app/statistic/statistic-slot-composition-api.vue
index fd1ec6348..2b3b8054b 100644
--- a/examples/sites/demos/pc/app/statistic/statistic-slot-composition-api.vue
+++ b/examples/sites/demos/pc/app/statistic/statistic-slot-composition-api.vue
@@ -3,7 +3,10 @@
-
+
+ 已使用容量(GB)
+ GB
+
diff --git a/examples/sites/demos/pc/app/statistic/statistic-slot.spec.ts b/examples/sites/demos/pc/app/statistic/statistic-slot.spec.ts
index d6179bc93..b86b41de2 100644
--- a/examples/sites/demos/pc/app/statistic/statistic-slot.spec.ts
+++ b/examples/sites/demos/pc/app/statistic/statistic-slot.spec.ts
@@ -3,11 +3,9 @@ import { test, expect } from '@playwright/test'
test('插槽用法', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('statistic#statistic-slot')
- await page.locator('div').filter({ hasText: /^10,010,258$/ })
await page
.locator('div')
- .filter({ hasText: /^306,526\.23$/ })
+ .filter({ hasText: /^存储总量已使用容量\(GB\)10,010,258GB$/ })
.first()
- await page.getByText('Like:306,526').click()
- await page.getByText('600/').click()
+ await page.getByText('306,526存储平均值').click()
})
diff --git a/examples/sites/demos/pc/app/statistic/statistic-slot.vue b/examples/sites/demos/pc/app/statistic/statistic-slot.vue
index c0cc4395a..e8d11ab14 100644
--- a/examples/sites/demos/pc/app/statistic/statistic-slot.vue
+++ b/examples/sites/demos/pc/app/statistic/statistic-slot.vue
@@ -3,7 +3,10 @@
-
+
+ 已使用容量(GB)
+ GB
+
diff --git a/examples/sites/demos/pc/app/statistic/statistic-style-composition-api.vue b/examples/sites/demos/pc/app/statistic/statistic-style-composition-api.vue
index 228a0eeca..9a441ab7c 100644
--- a/examples/sites/demos/pc/app/statistic/statistic-style-composition-api.vue
+++ b/examples/sites/demos/pc/app/statistic/statistic-style-composition-api.vue
@@ -2,7 +2,7 @@
-
+
-
+
@@ -32,8 +32,9 @@ import { Statistic as TinyStatistic, Layout as TinyLayout, Row as TinyRow, Col a
diff --git a/examples/sites/demos/pc/app/statistic/statistic-style.spec.ts b/examples/sites/demos/pc/app/statistic/statistic-style.spec.ts
index aabb4b3cf..a1778c408 100644
--- a/examples/sites/demos/pc/app/statistic/statistic-style.spec.ts
+++ b/examples/sites/demos/pc/app/statistic/statistic-style.spec.ts
@@ -3,5 +3,10 @@ import { test, expect } from '@playwright/test'
test('样式用法', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('statistic#statistic-style')
- await expect(page.getByText('Like:306,526').first()).toHaveClass(/tiny-statistic__slots/)
+ await page
+ .locator('div')
+ .filter({ hasText: /^进行中306,526$/ })
+ .first()
+ await page.getByText('306,526失败').click()
+ await expect(page.getByText(/^进行中306,526$/).first()).toHaveClass(/tiny-statistic/)
})
diff --git a/examples/sites/demos/pc/app/statistic/statistic-style.vue b/examples/sites/demos/pc/app/statistic/statistic-style.vue
index f87239d85..004222216 100644
--- a/examples/sites/demos/pc/app/statistic/statistic-style.vue
+++ b/examples/sites/demos/pc/app/statistic/statistic-style.vue
@@ -2,7 +2,7 @@
-
+
-
+
@@ -41,8 +41,9 @@ export default {
diff --git a/examples/sites/demos/pc/app/statistic/webdoc/statistic.js b/examples/sites/demos/pc/app/statistic/webdoc/statistic.js
index 1f7155eb8..91cacdca5 100644
--- a/examples/sites/demos/pc/app/statistic/webdoc/statistic.js
+++ b/examples/sites/demos/pc/app/statistic/webdoc/statistic.js
@@ -1,5 +1,5 @@
export default {
- column: '2',
+ column: '1',
owner: '',
demos: [
{
diff --git a/internals/vue-test-utils/src/index.ts b/internals/vue-test-utils/src/index.ts
index ab78ed40d..1382007f6 100644
--- a/internals/vue-test-utils/src/index.ts
+++ b/internals/vue-test-utils/src/index.ts
@@ -5,7 +5,7 @@ const mount = (inputComponent: any, options: MountingOptions = {}) => {
let mount$ = _mount
if (isVue2) {
- ; (options as any).localVue = createLocalVue()
+ ;(options as any).localVue = createLocalVue()
if (options.props) {
options.propsData = options.props
diff --git a/packages/renderless/src/statistic/index.ts b/packages/renderless/src/statistic/index.ts
index b7308a4c5..9e4422015 100644
--- a/packages/renderless/src/statistic/index.ts
+++ b/packages/renderless/src/statistic/index.ts
@@ -18,5 +18,14 @@ export const getIntegerAndDecimal =
let displayValue = props.value ? String(props.value).split('.') : ''
let integer = displayValue[0]?.replace(/\B(?=(\d{3})+(?!\d))/g, props.groupSeparator)
let decimal = displayValue[1]?.padEnd(props.precision, '0').slice(0, props.precision > 0 ? props.precision : 0)
+ // 处理当数字为0的情况
+ if (!displayValue) {
+ integer = '0'
+ }
+ // 当无小数点值且传入精度值,须默认用 0 补充精度值
+ if (!decimal && props.precision) {
+ let display = '0'
+ decimal = display.padEnd(props.precision, '0')
+ }
return [integer, decimal].join(decimal ? '.' : '')
}
diff --git a/packages/theme-saas/src/grid/table.less b/packages/theme-saas/src/grid/table.less
index 2ec4e98bb..3363d63b0 100644
--- a/packages/theme-saas/src/grid/table.less
+++ b/packages/theme-saas/src/grid/table.less
@@ -989,6 +989,7 @@
&__title:has(.tiny-grid-tree__indent:nth-last-child(2):first-child),
&__ellipsis:has(.tiny-grid-tree__indent:nth-last-child(2):first-child) {
@apply inline-block;
+ @apply max-w-full;
}
}
}
diff --git a/packages/theme/package.json b/packages/theme/package.json
index 4bddbc189..7d58ed4c0 100644
--- a/packages/theme/package.json
+++ b/packages/theme/package.json
@@ -1,6 +1,6 @@
{
"name": "@opentiny/vue-theme",
- "version": "3.16.2",
+ "version": "3.16.4",
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
"main": "index.css",
"homepage": "https://opentiny.design/tiny-vue",
diff --git a/packages/theme/src/alert/index.less b/packages/theme/src/alert/index.less
index 404fa4844..fff2bb956 100644
--- a/packages/theme/src/alert/index.less
+++ b/packages/theme/src/alert/index.less
@@ -79,7 +79,7 @@
}
&&--success {
- .alert-variant(var(--ti-alert-title-text-color);
+ .alert-variant(var(--ti-alert-success-title-text-color);
var(--ti-alert-success-border-color);
var(--ti-alert-success-icon-color);
var(--ti-alert-success-link-text-color);
@@ -92,7 +92,7 @@
}
&&--info {
- .alert-variant(var(--ti-alert-title-text-color);
+ .alert-variant(var(--ti-alert-info-title-text-color);
var(--ti-alert-info-border-color);
var(--ti-alert-info-icon-color);
var(--ti-alert-info-link-text-color);
@@ -105,7 +105,7 @@
}
&&--warning {
- .alert-variant(var(--ti-alert-title-text-color);
+ .alert-variant(var(--ti-alert-warning-title-text-color);
var(--ti-alert-warning-border-color);
var(--ti-alert-warning-icon-color);
var(--ti-alert-warning-link-text-color);
@@ -118,7 +118,7 @@
}
&&--error {
- .alert-variant(var(--ti-alert-title-text-color);
+ .alert-variant(var(--ti-alert-error-title-text-color);
var(--ti-alert-error-border-color);
var(--ti-alert-error-icon-color);
var(--ti-alert-error-link-text-color);
@@ -131,7 +131,7 @@
}
&&--simple {
- .alert-variant(var(--ti-alert-title-text-color);
+ .alert-variant(var(--ti-alert-simple-title-text-color);
var(--ti-alert-simple-border-color);
var(--ti-alert-simple-icon-color);
var(--ti-alert-simple-link-text-color);
diff --git a/packages/theme/src/alert/vars.less b/packages/theme/src/alert/vars.less
index 3c20db34d..7a8fffaeb 100644
--- a/packages/theme/src/alert/vars.less
+++ b/packages/theme/src/alert/vars.less
@@ -36,6 +36,16 @@
--ti-alert-border-radius: var(--ti-common-border-radius-normal, 2px);
// 标题文本色
--ti-alert-title-text-color: var(--ti-common-color-text-primary, #252b3a);
+ // success类型标题文本色
+ --ti-alert-success-title-text-color: var(--ti-common-color-text-primary, #252b3a);
+ // info类型标题文本色
+ --ti-alert-info-title-text-color: var(--ti-common-color-text-primary, #252b3a);
+ // warning类型标题文本色
+ --ti-alert-warning-title-text-color: var(--ti-common-color-text-primary, #252b3a);
+ // error类型标题文本色
+ --ti-alert-error-title-text-color: var(--ti-common-color-text-primary, #252b3a);
+ // simple类型标题文本色
+ --ti-alert-simple-title-text-color: var(--ti-common-color-text-primary, #252b3a);
// 标题字号
--ti-alert-title-font-size: var(--ti-common-font-size-1, 14px);
// 标题图标顶部外边距
diff --git a/packages/theme/src/grid/header.less b/packages/theme/src/grid/header.less
index 3efc07550..dc701250d 100644
--- a/packages/theme/src/grid/header.less
+++ b/packages/theme/src/grid/header.less
@@ -74,6 +74,7 @@
line-height: 14px;
font-size: var(--ti-common-font-size-1);
align-self: baseline;
+ display: inline-block;
&:before {
content: '*';
diff --git a/packages/theme/src/grid/table.less b/packages/theme/src/grid/table.less
index e22bdb36c..7dc1a1582 100644
--- a/packages/theme/src/grid/table.less
+++ b/packages/theme/src/grid/table.less
@@ -833,6 +833,7 @@
&__title:has(.tiny-grid-tree__indent:nth-last-child(2):first-child),
&__ellipsis:has(.tiny-grid-tree__indent:nth-last-child(2):first-child) {
display: inline-block;
+ max-width: 100%;
}
}
}
diff --git a/packages/theme/src/statistic/aurora-theme.js b/packages/theme/src/statistic/aurora-theme.js
new file mode 100644
index 000000000..8615f6a29
--- /dev/null
+++ b/packages/theme/src/statistic/aurora-theme.js
@@ -0,0 +1,3 @@
+export const tinyStatisticAuroraTheme = {
+ 'ti-statistic-font-color': 'var(--ti-common-color-text-primary)'
+}
diff --git a/packages/theme/src/statistic/index.less b/packages/theme/src/statistic/index.less
index b1d9b04de..456596362 100644
--- a/packages/theme/src/statistic/index.less
+++ b/packages/theme/src/statistic/index.less
@@ -13,36 +13,31 @@
color: var(--ti-statistic-font-color);
font-weight: var(--ti-statistic-title-font-weight);
line-height: var(--ti-statistic-title-line-height);
- // margin-top: var(--ti-statistic-title-margin-top);
margin-bottom: var(--ti-statistic-title-margin-bottom);
- margin-left: var(--ti-statistic-description-margin-left);
}
&__slots {
font-weight: var(--ti-statistic-font-weight);
font-size: var(--ti-statistic-title-font-size);
color: var(--ti-statistic-font-color);
+ display: flex;
+ align-items: baseline;
}
&__prefix {
- margin-right: var(--ti-statistic-prefix-margin-right);
font-weight: var(--ti-statistic-prefix-font-weight);
- display: inline-block;
font-size: var(--ti-statistic-font-size);
- vertical-align: middle;
}
&__description {
font-size: var(--ti-statistic-description-font-size);
- display: inline-block;
- margin-left: var(--ti-statistic-description-margin-left);
+ font-weight: var(--ti-statistic-description-font-weight);
}
&__suffix {
- font-size: var(--ti-statistic-suffix-font-size);
margin-left: var(--ti-statistic-suffix-margin-left);
+ font-size: var(--ti-statistic-suffix-font-size);
font-weight: var(--ti-statistic-suffix-font-weight);
- display: inline-block;
}
&__description-margin {
diff --git a/packages/theme/src/statistic/smb-theme.js b/packages/theme/src/statistic/smb-theme.js
index 26b5c78ef..7fb62a1f2 100644
--- a/packages/theme/src/statistic/smb-theme.js
+++ b/packages/theme/src/statistic/smb-theme.js
@@ -1,5 +1,6 @@
export const tinyStatisticSmbTheme = {
'ti-statistic-description-font-size': 'var(--ti-common-font-size-5)',
'ti-statistic-font-color': 'var(--ti-common-color-primary-normal)',
- 'ti-statistic-suffix-font-size': 'var(--ti-common-font-size-0)'
+ 'ti-statistic-suffix-font-size': 'var(--ti-common-font-size-0)',
+ 'ti-statistic-description-font-weight': 'var(--ti-common-font-weight-normal)'
}
diff --git a/packages/theme/src/statistic/vars.less b/packages/theme/src/statistic/vars.less
index 89ac53724..3289e3112 100644
--- a/packages/theme/src/statistic/vars.less
+++ b/packages/theme/src/statistic/vars.less
@@ -5,8 +5,6 @@
--ti-statistic-suffix-font-size: var(--ti-common-font-size-base);
// 标题内容字体大小
--ti-statistic-title-font-size: var(--ti-common-font-size-6);
- // 标题内容左间距
- --ti-statistic-description-margin-left: var(--ti-common-space-4x);
// 标题字体颜色
--ti-statistic-font-color: var(--ti-common-color-info-text);
// 标题字体粗细
@@ -23,14 +21,14 @@
--ti-statistic-title-line-height: var(ti-common-line-height-4);
// 前缀插槽字体粗细
--ti-statistic-font-weight: var(--ti-common-font-weight-5);
- // 前缀插槽间距值
- --ti-statistic-prefix-margin-right: var(--ti-common-space-6);
// 前缀字体粗细
--ti-statistic-prefix-font-weight: var(--ti-common-font-weight-5);
- // 后缀插槽间距值
- --ti-statistic-suffix-margin-left: var(--ti-common-space-6);
// 后缀字体粗细
--ti-statistic-suffix-font-weight: var(--ti-common-font-weight-5);
+ // 数字内容字体粗细
+ --ti-statistic-description-font-weight: var(--ti-common-font-weight-normal);
+ // 后缀左边距
+ --ti-statistic-suffix-margin-left: var(--ti-common-space-base);
// 数字内容字体
--ti-statistic-description-font-size: var(--ti-common-font-size-6);
}
diff --git a/packages/vue/src/grid/package.json b/packages/vue/src/grid/package.json
index 1e628294c..15ba61822 100644
--- a/packages/vue/src/grid/package.json
+++ b/packages/vue/src/grid/package.json
@@ -1,6 +1,6 @@
{
"name": "@opentiny/vue-grid",
- "version": "3.16.0",
+ "version": "3.16.1",
"description": "",
"main": "lib/index.js",
"module": "index.ts",
diff --git a/packages/vue/src/grid/src/grid/grid.ts b/packages/vue/src/grid/src/grid/grid.ts
index 9f4ad2ecf..ae91c18f8 100644
--- a/packages/vue/src/grid/src/grid/grid.ts
+++ b/packages/vue/src/grid/src/grid/grid.ts
@@ -447,7 +447,9 @@ export default defineComponent({
if (type === 'pageSizeChangeCallback') {
this._pageSizeChangeCallback = callback
} else if (type === 'updateCustomsCallback') {
- this._updateCustomsCallback = callback
+ // 表格可能有多个工具栏,因此工具栏个性化配置的回调应该是个数组
+ this._updateCustomsCallback = this._updateCustomsCallback || []
+ this._updateCustomsCallback.push(callback)
}
},
// 从缓存获取实例
@@ -460,8 +462,10 @@ export default defineComponent({
handleColumnInitReady() {
// 如果存在更新工具栏动态列回调,就执行
if (this._updateCustomsCallback) {
- this._updateCustomsCallback()
- this._updateCustomsCallback = null
+ this._updateCustomsCallback.forEach((fn) => {
+ fn()
+ })
+ this._updateCustomsCallback = []
}
},
handleRowClassName(params) {
diff --git a/packages/vue/src/modal/package.json b/packages/vue/src/modal/package.json
index 0c2edf573..9545c00b9 100644
--- a/packages/vue/src/modal/package.json
+++ b/packages/vue/src/modal/package.json
@@ -1,6 +1,6 @@
{
"name": "@opentiny/vue-modal",
- "version": "3.16.0",
+ "version": "3.16.1",
"description": "",
"main": "lib/index.js",
"module": "index.ts",
diff --git a/packages/vue/src/modal/src/pc.vue b/packages/vue/src/modal/src/pc.vue
index a15522986..0a5e7de0e 100644
--- a/packages/vue/src/modal/src/pc.vue
+++ b/packages/vue/src/modal/src/pc.vue
@@ -166,7 +166,7 @@ export default defineComponent({
}
},
[
- status && state.theme === 'saas'
+ status
? h(
'div',
{
@@ -188,18 +188,7 @@ export default defineComponent({
{
class: 'tiny-modal__title'
},
- [
- typeof status === 'string'
- ? h(STATUS_MAPPING_COMPINENT[status.toUpperCase()], {
- class: [constants.STATUS_MAPPING_CLASSS[status.toUpperCase()]],
- style: 'display: inline-block; margin-right: 5px;'
- })
- : h(status, {
- class: ['tiny-modal__status-icon'],
- style: 'display: inline-block; margin-right: 5px;'
- }),
- h('span', title || t('ui.alert.title'))
- ]
+ title || t('ui.alert.title')
),
resize
? h(zoomLocat ? iconMinscreenLeft() : iconFullscreenLeft(), {
@@ -224,14 +213,14 @@ export default defineComponent({
class: ['tiny-modal__body', type === 'message' ? 'is-message' : '']
},
[
- status && state.theme !== 'saas'
+ type === 'message'
? h(
'div',
{
class: 'tiny-modal__status-wrapper'
},
[
- typeof status === 'string' && type === 'message'
+ typeof status === 'string'
? h(STATUS_MAPPING_COMPINENT[status.toUpperCase()], {
class: [constants.STATUS_MAPPING_CLASSS[status.toUpperCase()]]
})
@@ -310,6 +299,18 @@ export default defineComponent({
)
]
: [
+ type === 'confirm'
+ ? h(
+ Button,
+ {
+ on: {
+ click: this.cancelEvent
+ },
+ props: { ...cancelButtonProps }
+ },
+ cancelButtonText
+ )
+ : null,
h(
Button,
{
@@ -322,19 +323,7 @@ export default defineComponent({
}
},
confirmButtonText
- ),
- type === 'confirm'
- ? h(
- Button,
- {
- on: {
- click: this.cancelEvent
- },
- props: { ...cancelButtonProps }
- },
- cancelButtonText
- )
- : null
+ )
]
)
: null,
diff --git a/packages/vue/src/select/package.json b/packages/vue/src/select/package.json
index dc040faa8..f39d27957 100644
--- a/packages/vue/src/select/package.json
+++ b/packages/vue/src/select/package.json
@@ -1,6 +1,6 @@
{
"name": "@opentiny/vue-select",
- "version": "3.16.1",
+ "version": "3.16.2",
"description": "",
"main": "lib/index.js",
"module": "index.ts",
diff --git a/packages/vue/src/select/src/pc.vue b/packages/vue/src/select/src/pc.vue
index 9469fa604..6c780035d 100644
--- a/packages/vue/src/select/src/pc.vue
+++ b/packages/vue/src/select/src/pc.vue
@@ -26,7 +26,6 @@
clickExpand ? 'is-click-expand' : '',
state.showCollapseTag ? 'collapse-tag-clicked' : '',
state.selectDisabled ? 'is-disabled' : '',
- $parent.$attrs.class,
inputBoxType === 'underline' ? 'tiny-select__underline' : ''
]"
@mouseleave.self="
@@ -43,7 +42,6 @@
"
@click="toggleMenu"
v-clickoutside="handleClose"
- v-bind="a($attrs, ['class', 'style'], true)"
>
{
}
export default defineComponent({
- inheritAttrs: false,
emits: [
'update:modelValue',
'change',
diff --git a/packages/vue/src/statistic/src/pc.vue b/packages/vue/src/statistic/src/pc.vue
index 43d2fd526..f1497c80f 100644
--- a/packages/vue/src/statistic/src/pc.vue
+++ b/packages/vue/src/statistic/src/pc.vue
@@ -2,7 +2,7 @@