diff --git a/packages/renderless/package.json b/packages/renderless/package.json index 4556a42025..e922636ff9 100644 --- a/packages/renderless/package.json +++ b/packages/renderless/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/vue-renderless", - "version": "3.18.0", + "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", @@ -43,4 +43,4 @@ "esno": "^4.7.0", "tsup": "7.2.0" } -} \ No newline at end of file +} 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 } 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 }) diff --git a/packages/theme/package.json b/packages/theme/package.json index a1a5eb1835..0b428faa84 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -1,7 +1,6 @@ { "name": "@opentiny/vue-theme", - "type": "module", - "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", 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 918851c0e7..e026f3fe31 100644 --- a/packages/vue/src/form-item/src/pc.vue +++ b/packages/vue/src/form-item/src/pc.vue @@ -183,7 +183,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 } @@ -223,7 +223,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 diff --git a/packages/vue/src/grid/package.json b/packages/vue/src/grid/package.json index 038b973d8b..0ca64d07e4 100644 --- a/packages/vue/src/grid/package.json +++ b/packages/vue/src/grid/package.json @@ -1,11 +1,11 @@ { "name": "@opentiny/vue-grid", - "version": "3.18.0", + "type": "module", + "version": "3.18.3", "description": "", "main": "lib/index.js", "module": "index.ts", "sideEffects": false, - "type": "module", "devDependencies": { "@opentiny-internal/vue-test-utils": "workspace:*", "vitest": "^0.31.0" @@ -31,4 +31,4 @@ "@opentiny/vue-common": "workspace:~" }, "license": "MIT" -} \ No newline at end of file +} 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) => {