From ce35aef9c365641a4be6d2824fe11996bea0ef56 Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Fri, 20 Sep 2024 09:29:16 +0800 Subject: [PATCH 01/11] fix(form): [form] fix form tooltip class name (#2154) --- packages/vue/src/form-item/package.json | 22 +++++++++++----------- packages/vue/src/form-item/src/pc.vue | 5 +++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/vue/src/form-item/package.json b/packages/vue/src/form-item/package.json index cafd09d940..e692337e31 100644 --- a/packages/vue/src/form-item/package.json +++ b/packages/vue/src/form-item/package.json @@ -1,24 +1,24 @@ { "name": "@opentiny/vue-form-item", - "version": "3.18.0", + "type": "module", + "version": "3.18.1", "description": "", + "license": "MIT", + "sideEffects": false, "main": "lib/index.js", "module": "index.ts", - "sideEffects": false, - "type": "module", - "devDependencies": { - "@opentiny-internal/vue-test-utils": "workspace:*", - "vitest": "^0.31.0" - }, "scripts": { "build": "pnpm -w build:ui $npm_package_name", "//postversion": "pnpm build" }, "dependencies": { - "@opentiny/vue-tooltip": "workspace:~", "@opentiny/vue-common": "workspace:~", + "@opentiny/vue-icon": "workspace:~", "@opentiny/vue-renderless": "workspace:~", - "@opentiny/vue-icon": "workspace:~" + "@opentiny/vue-tooltip": "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/form-item/src/pc.vue b/packages/vue/src/form-item/src/pc.vue index fd0ad4d24b..1418238d76 100644 --- a/packages/vue/src/form-item/src/pc.vue +++ b/packages/vue/src/form-item/src/pc.vue @@ -181,7 +181,7 @@ export default defineComponent({ // 兼容 2.0 组件 validation 是否有 required state.validationRequired = propsData.validation && !!propsData.validation.required } - // 如果为 2.0 的验证 不会使用 toolltip 组件 + // 如果为 2.0 的验证 不会使用 tooltip 组件 if (propsData.validation) { return item } @@ -221,7 +221,8 @@ export default defineComponent({ } data = item.props } - data.class = deduplicateCssClass('tiny-tooltip' + stringifyCssClass(data.class)) + const mergeClass = `tiny-tooltip ${stringifyCssClass(data.class)}` + data.class = deduplicateCssClass(mergeClass) return item }) : null From 1d6b6bd7de2cad4e40117430952c70508607fab1 Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Fri, 20 Sep 2024 09:29:38 +0800 Subject: [PATCH 02/11] fix(anchor): [anchor] fix anchor error when links is empty (#2155) * fix(anchor): [anchor] fix anchor error when links is empty * fix(anchor): [anchor] fix anchor error when links is empty --- packages/renderless/package.json | 2 +- packages/renderless/src/anchor/index.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/renderless/package.json b/packages/renderless/package.json index b6e1a5434a..dfe40ae80c 100644 --- a/packages/renderless/package.json +++ b/packages/renderless/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/vue-renderless", - "version": "3.18.2", + "version": "3.18.3", "private": true, "description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.", "author": "OpenTiny Team", diff --git a/packages/renderless/src/anchor/index.ts b/packages/renderless/src/anchor/index.ts index 6157e7661f..8e268069d3 100644 --- a/packages/renderless/src/anchor/index.ts +++ b/packages/renderless/src/anchor/index.ts @@ -124,6 +124,9 @@ export const handleScroll = (state: IAnchorRenderlessParams['state']) => () => { // 设置滚动偏移量 const setChildOffsetTop = ({ state, props }: Pick) => { + if (!props.links?.length) { + return + } state.offsetTop = document.querySelector(props.links[0].link)?.offsetTop || 0 } From 30384d09842c2822a92251ad0f498c41c5f08a8f Mon Sep 17 00:00:00 2001 From: Kagol Date: Fri, 20 Sep 2024 10:37:59 +0800 Subject: [PATCH 03/11] fix(fluent-editor): fix link/img render error (#2156) --- packages/renderless/src/common/xss.ts | 4 ++-- packages/theme/src/fluent-editor/index.less | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/renderless/src/common/xss.ts b/packages/renderless/src/common/xss.ts index 3ba14d943c..7f573decc2 100644 --- a/packages/renderless/src/common/xss.ts +++ b/packages/renderless/src/common/xss.ts @@ -22,7 +22,7 @@ let xssOptions = { enableUrl: true, html: { whiteList: { - a: ['class', 'style', 'contenteditable', 'data-id', 'data-title', 'data-size', 'data-last-modified'], + a: ['class', 'style', 'contenteditable', 'data-id', 'data-title', 'data-size', 'data-last-modified', 'href'], address: ['class', 'style'], area: ['class', 'style'], article: ['class', 'style'], @@ -74,7 +74,7 @@ let xssOptions = { header: ['class', 'style'], hr: ['class', 'style'], i: ['class', 'style', 'data-image-id', 'data-image'], - img: ['class', 'style', 'devui-editorx-image', 'style', 'data-image-id'], + img: ['class', 'style', 'devui-editorx-image', 'style', 'data-image-id', 'src'], input: ['class', 'style', 'data-formula', 'data-link', 'data-video'], ins: ['class', 'style'], li: ['class', 'style'], diff --git a/packages/theme/src/fluent-editor/index.less b/packages/theme/src/fluent-editor/index.less index d127b2481e..f9a2b33488 100644 --- a/packages/theme/src/fluent-editor/index.less +++ b/packages/theme/src/fluent-editor/index.less @@ -183,6 +183,7 @@ margin-right: 8px; svg { + width: 16px; font-size: 16px; } From 4c1a62890f9e220c8762dfd07462c0a6bd19880d Mon Sep 17 00:00:00 2001 From: Kagol Date: Fri, 20 Sep 2024 10:49:03 +0800 Subject: [PATCH 04/11] chore(theme): release 3.18.2 --- packages/theme/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/theme/package.json b/packages/theme/package.json index 9254b71402..6d69e9ec7b 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/vue-theme", - "version": "3.18.1", + "version": "3.18.2", "description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.", "author": "OpenTiny Team", "license": "MIT", From 2e0e14b38ea8703f4bddd8b8981cf9fd294477bc Mon Sep 17 00:00:00 2001 From: Kagol Date: Fri, 20 Sep 2024 16:37:59 +0800 Subject: [PATCH 05/11] fix(fluent-editor): fix font/size/line-height whitelist --- packages/renderless/package.json | 2 +- .../renderless/src/fluent-editor/options.ts | 47 +++++++++++++++++-- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/packages/renderless/package.json b/packages/renderless/package.json index dfe40ae80c..e922636ff9 100644 --- a/packages/renderless/package.json +++ b/packages/renderless/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/vue-renderless", - "version": "3.18.3", + "version": "3.18.4", "private": true, "description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.", "author": "OpenTiny Team", diff --git a/packages/renderless/src/fluent-editor/options.ts b/packages/renderless/src/fluent-editor/options.ts index 1cd20d12e0..408116ae01 100644 --- a/packages/renderless/src/fluent-editor/options.ts +++ b/packages/renderless/src/fluent-editor/options.ts @@ -1,5 +1,42 @@ import { isNull } from '../common/type' +const fontFamilyConfig = [ + 'songti', + 'yahei', + 'kaiti', + 'heiti', + 'lishu', + 'mono', + 'arial', + 'arialblack', + 'comic', + 'impact', + 'times' +] + +const fontSizeConfig = [ + '12px', + '13px', + '14px', + '15px', + '16px', + '17px', + '18px', + '19px', + '20px', + '22px', + '24px', + '26px', + '29px', + '32px', + '36px', + '40px', + '48px', + '72px' +] + +const lineHeightConfig = ['1', '1.2', '1.5', '2', '2.5', '3', '4', '5'] + const betterTable = { operationMenu: { items: { @@ -20,7 +57,7 @@ const betterTable = { } } -const toolbar = (FluentEditor) => { +const toolbar = () => { const underline = ['bold', 'italic', 'underline', 'strike'] const list = [{ list: 'ordered' }, { list: 'bullet' }] const script = [{ script: 'sub' }, { script: 'super' }] @@ -29,9 +66,9 @@ const toolbar = (FluentEditor) => { container: [ ['undo', 'redo', 'clean'], [ - { font: FluentEditor.imports['formats/font'].whitelist }, - { size: FluentEditor.imports['formats/size'].whitelist }, - { lineheight: FluentEditor.imports['formats/lineheight'].whitelist }, + { font: fontFamilyConfig }, + { size: fontSizeConfig }, + { lineheight: lineHeightConfig }, { header: [1, 2, 3, 4, 5, 6, false] } ], underline, @@ -170,7 +207,7 @@ const defaultOption = ({ FluentEditor, state, mentionObj }) => { file: true, // 上传文件需开启 image: FluentEditor.imports['modules/image-spec'], counter: false, - toolbar: toolbar(FluentEditor), + toolbar: toolbar(), 'better-table': betterTable, mention: mention(mentionObj), keyboard: keyboard({ FluentEditor, state }) From 4f9683fc112864b6c02df6ed04bb679780751b6f Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Tue, 24 Sep 2024 19:27:52 +0800 Subject: [PATCH 06/11] fix(grid): [grid] fix drop-config trigger don't work (#2178) --- packages/vue/src/grid/package.json | 2 +- packages/vue/src/grid/src/dragger/src/methods.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/vue/src/grid/package.json b/packages/vue/src/grid/package.json index 0c68e3655a..cdbc2d7a81 100644 --- a/packages/vue/src/grid/package.json +++ b/packages/vue/src/grid/package.json @@ -1,7 +1,7 @@ { "name": "@opentiny/vue-grid", "type": "module", - "version": "3.18.2", + "version": "3.18.3", "description": "", "license": "MIT", "sideEffects": false, diff --git a/packages/vue/src/grid/src/dragger/src/methods.ts b/packages/vue/src/grid/src/dragger/src/methods.ts index 4055b6fecd..a794b95e4d 100644 --- a/packages/vue/src/grid/src/dragger/src/methods.ts +++ b/packages/vue/src/grid/src/dragger/src/methods.ts @@ -65,11 +65,16 @@ export default { }, // 处理行拖拽 rowDrop(bodyEl) { - const { plugin, onBeforeMove, filter, refresh = true, rowHandle } = this.dropConfig + const { plugin, onBeforeMove, filter, refresh = true, rowHandle, trigger } = this.dropConfig const rowDropContainer = bodyEl.querySelector('.tiny-grid__body tbody') - + // 拖拽触发源,默认是行 + let handle = trigger || '.tiny-grid-body__row' + // 配置了 rowHandle === 'index'则忽略trigger + if (rowHandle === 'index') { + handle = '.tiny-grid-body__row>td.col__index>.row__drop-handle' + } const rowDropOptions = { - handle: rowHandle === 'index' ? '.tiny-grid-body__row>td.col__index>.row__drop-handle' : '.tiny-grid-body__row', + handle, filter, onEnd: createHandlerOnEnd({ _vm: this, refresh }), onStart: (event) => { From 7561208cc37a3ba929cabae6b1928e4e7b12f95c Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Wed, 16 Oct 2024 16:13:12 +0800 Subject: [PATCH 07/11] fix(grid): [grid] toolbar simple setting fix (#2268) * fix(grid): [grid] toolbar simple setting fix * fix(grid): [grid] toolbar simple setting not sync --- packages/vue/src/grid-toolbar/package.json | 62 +++++++++---------- packages/vue/src/grid-toolbar/src/index.ts | 4 +- packages/vue/src/grid/package.json | 2 +- .../vue/src/grid/src/table/src/methods.ts | 6 ++ 4 files changed, 41 insertions(+), 33 deletions(-) diff --git a/packages/vue/src/grid-toolbar/package.json b/packages/vue/src/grid-toolbar/package.json index 9e04f3227d..2470e9a2c9 100644 --- a/packages/vue/src/grid-toolbar/package.json +++ b/packages/vue/src/grid-toolbar/package.json @@ -1,50 +1,50 @@ { "name": "@opentiny/vue-grid-toolbar", - "version": "3.18.0", + "type": "module", + "version": "3.18.1", "description": "", + "license": "MIT", + "sideEffects": false, "main": "lib/index.js", "module": "index.ts", - "sideEffects": false, - "type": "module", - "devDependencies": { - "@opentiny-internal/vue-test-utils": "workspace:*", - "vitest": "^0.31.0" - }, "scripts": { "build": "pnpm -w build:ui $npm_package_name", "//postversion": "pnpm build" }, "dependencies": { - "@opentiny/vue-button": "workspace:~", - "@opentiny/vue-select": "workspace:~", - "@opentiny/vue-option": "workspace:~", - "@opentiny/vue-locale": "workspace:~", - "@opentiny/vue-modal": "workspace:~", - "@opentiny/vue-icon": "workspace:~", - "@opentiny/vue-grid": "workspace:~", - "@opentiny/vue-common": "workspace:~", - "@opentiny/vue-layout": "workspace:~", - "@opentiny/vue-row": "workspace:~", - "@opentiny/vue-col": "workspace:~", "@opentiny/vue-alert": "workspace:~", - "@opentiny/vue-dialog-box": "workspace:~", - "@opentiny/vue-renderless": "workspace:~", - "@opentiny/vue-split": "workspace:~", + "@opentiny/vue-button": "workspace:~", "@opentiny/vue-checkbox": "workspace:~", - "@opentiny/vue-radio": "workspace:~", "@opentiny/vue-checkbox-group": "workspace:~", - "@opentiny/vue-radio-group": "workspace:~", - "@opentiny/vue-search": "workspace:~", + "@opentiny/vue-col": "workspace:~", + "@opentiny/vue-common": "workspace:~", + "@opentiny/vue-dialog-box": "workspace:~", "@opentiny/vue-dropdown": "workspace:~", - "@opentiny/vue-dropdown-menu": "workspace:~", "@opentiny/vue-dropdown-item": "workspace:~", - "@opentiny/vue-tooltip": "workspace:~", - "@opentiny/vue-theme": "workspace:~", - "@opentiny/vue-tabs": "workspace:~", - "@opentiny/vue-tab-item": "workspace:~", + "@opentiny/vue-dropdown-menu": "workspace:~", + "@opentiny/vue-grid": "workspace:~", + "@opentiny/vue-icon": "workspace:~", "@opentiny/vue-input": "workspace:~", + "@opentiny/vue-layout": "workspace:~", + "@opentiny/vue-locale": "workspace:~", + "@opentiny/vue-modal": "workspace:~", + "@opentiny/vue-option": "workspace:~", "@opentiny/vue-popover": "workspace:~", + "@opentiny/vue-radio": "workspace:~", + "@opentiny/vue-radio-group": "workspace:~", + "@opentiny/vue-renderless": "workspace:~", + "@opentiny/vue-row": "workspace:~", + "@opentiny/vue-search": "workspace:~", + "@opentiny/vue-select": "workspace:~", + "@opentiny/vue-split": "workspace:~", + "@opentiny/vue-tab-item": "workspace:~", + "@opentiny/vue-tabs": "workspace:~", + "@opentiny/vue-theme": "workspace:~", + "@opentiny/vue-tooltip": "workspace:~", "@opentiny/vue-tree": "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/grid-toolbar/src/index.ts b/packages/vue/src/grid-toolbar/src/index.ts index 73787586bb..bdc65f2bd6 100644 --- a/packages/vue/src/grid-toolbar/src/index.ts +++ b/packages/vue/src/grid-toolbar/src/index.ts @@ -423,6 +423,9 @@ export default defineComponent({ custom && custom.updateSelectedTemplate(val) }, settingBtnClick() { + if (this.setting?.simple) { + return + } return this.setting && this.setting.customSetting ? this.setting.settingBtnClickFn() : this.handleClickCustomEvent() @@ -540,7 +543,6 @@ export default defineComponent({ }) } }, - // NEXT 未用到 updateColumn(fullColumn) { this.tableFullColumn = fullColumn }, diff --git a/packages/vue/src/grid/package.json b/packages/vue/src/grid/package.json index cdbc2d7a81..855df10be2 100644 --- a/packages/vue/src/grid/package.json +++ b/packages/vue/src/grid/package.json @@ -1,7 +1,7 @@ { "name": "@opentiny/vue-grid", "type": "module", - "version": "3.18.3", + "version": "3.18.4", "description": "", "license": "MIT", "sideEffects": false, diff --git a/packages/vue/src/grid/src/table/src/methods.ts b/packages/vue/src/grid/src/table/src/methods.ts index ede5071c95..a0500aa9ec 100644 --- a/packages/vue/src/grid/src/table/src/methods.ts +++ b/packages/vue/src/grid/src/table/src/methods.ts @@ -772,6 +772,12 @@ const Methods = { }) this.collectColumn = collectColumn } + + const toolbarVm = this.getVm('toolbar') + // 合并更新toolbar的Column配置 + if (toolbarVm) { + toolbarVm.updateColumn(fullColumn) + } this.$emit('update:customs', fullColumn) }, resetAll() { From cf5f8eacba61226b95d772c9fafbe4bb58c2c9c6 Mon Sep 17 00:00:00 2001 From: MomoPoppy <125256456+MomoPoppy@users.noreply.github.com> Date: Wed, 16 Oct 2024 18:29:36 -0700 Subject: [PATCH 08/11] fix(dropdown-item): [dropdown] fix issues for v-auto-tip and add effect attr (#2283) * fix(dropdown-item): [dropdown] fix issues for v-auto-tip and add effect attr * fix(dropdown-item): [dropdown] Modify version for dropdown-item --- packages/vue/src/dropdown-item/package.json | 4 ++-- packages/vue/src/dropdown-item/src/index.ts | 4 ++++ packages/vue/src/dropdown-item/src/pc.vue | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/vue/src/dropdown-item/package.json b/packages/vue/src/dropdown-item/package.json index c6b98be360..601a06c553 100644 --- a/packages/vue/src/dropdown-item/package.json +++ b/packages/vue/src/dropdown-item/package.json @@ -1,7 +1,7 @@ { "name": "@opentiny/vue-dropdown-item", "type": "module", - "version": "3.18.0", + "version": "3.18.1", "description": "", "license": "MIT", "sideEffects": false, @@ -25,4 +25,4 @@ "@opentiny-internal/vue-test-utils": "workspace:*", "vitest": "^0.31.0" } -} \ No newline at end of file +} diff --git a/packages/vue/src/dropdown-item/src/index.ts b/packages/vue/src/dropdown-item/src/index.ts index 5fc593a640..b3673dc977 100644 --- a/packages/vue/src/dropdown-item/src/index.ts +++ b/packages/vue/src/dropdown-item/src/index.ts @@ -84,6 +84,10 @@ export const dropdownItemProps = { tipPosition: { type: String, default: 'right' + }, + effect: { + type: String, + default: 'light' } } diff --git a/packages/vue/src/dropdown-item/src/pc.vue b/packages/vue/src/dropdown-item/src/pc.vue index 377462159a..5db7193e55 100644 --- a/packages/vue/src/dropdown-item/src/pc.vue +++ b/packages/vue/src/dropdown-item/src/pc.vue @@ -13,7 +13,7 @@