Skip to content

Commit

Permalink
Sync 3.18.0 to dev (#2253)
Browse files Browse the repository at this point in the history
* fix(form): [form] fix form tooltip class name (#2154)

* 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

* fix(fluent-editor): fix link/img render error (#2156)

* chore(theme): release 3.18.2

* fix(fluent-editor): fix font/size/line-height whitelist

* fix(grid): [grid] fix drop-config trigger don't work (#2178)

---------

Co-authored-by: gimmyhehe <975402925@qq.com>
Co-authored-by: Kagol <kagol@sina.com>
  • Loading branch information
3 people authored Oct 12, 2024
1 parent 98246dd commit bf1595c
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 28 deletions.
4 changes: 2 additions & 2 deletions packages/renderless/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -43,4 +43,4 @@
"esno": "^4.7.0",
"tsup": "7.2.0"
}
}
}
3 changes: 3 additions & 0 deletions packages/renderless/src/anchor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ export const handleScroll = (state: IAnchorRenderlessParams['state']) => () => {

// 设置滚动偏移量
const setChildOffsetTop = ({ state, props }: Pick<IAnchorRenderlessParams, 'state' | 'props'>) => {
if (!props.links?.length) {
return
}
state.offsetTop = document.querySelector(props.links[0].link)?.offsetTop || 0
}

Expand Down
47 changes: 42 additions & 5 deletions packages/renderless/src/fluent-editor/options.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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' }]
Expand All @@ -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,
Expand Down Expand Up @@ -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 })
Expand Down
3 changes: 1 addition & 2 deletions packages/theme/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
22 changes: 11 additions & 11 deletions packages/vue/src/form-item/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
"devDependencies": {
"@opentiny-internal/vue-test-utils": "workspace:*",
"vitest": "^0.31.0"
}
}
5 changes: 3 additions & 2 deletions packages/vue/src/form-item/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions packages/vue/src/grid/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -31,4 +31,4 @@
"@opentiny/vue-common": "workspace:~"
},
"license": "MIT"
}
}
11 changes: 8 additions & 3 deletions packages/vue/src/grid/src/dragger/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit bf1595c

Please sign in to comment.