Skip to content

Commit bf1595c

Browse files
zzcrgimmyhehekagol
authored
Sync 3.18.0 to dev (#2253)
* 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 <[email protected]> Co-authored-by: Kagol <[email protected]>
1 parent 98246dd commit bf1595c

File tree

8 files changed

+73
-28
lines changed

8 files changed

+73
-28
lines changed

packages/renderless/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opentiny/vue-renderless",
3-
"version": "3.18.0",
3+
"version": "3.18.4",
44
"private": true,
55
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
66
"author": "OpenTiny Team",
@@ -43,4 +43,4 @@
4343
"esno": "^4.7.0",
4444
"tsup": "7.2.0"
4545
}
46-
}
46+
}

packages/renderless/src/anchor/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ export const handleScroll = (state: IAnchorRenderlessParams['state']) => () => {
124124

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

packages/renderless/src/fluent-editor/options.ts

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
import { isNull } from '../common/type'
22

3+
const fontFamilyConfig = [
4+
'songti',
5+
'yahei',
6+
'kaiti',
7+
'heiti',
8+
'lishu',
9+
'mono',
10+
'arial',
11+
'arialblack',
12+
'comic',
13+
'impact',
14+
'times'
15+
]
16+
17+
const fontSizeConfig = [
18+
'12px',
19+
'13px',
20+
'14px',
21+
'15px',
22+
'16px',
23+
'17px',
24+
'18px',
25+
'19px',
26+
'20px',
27+
'22px',
28+
'24px',
29+
'26px',
30+
'29px',
31+
'32px',
32+
'36px',
33+
'40px',
34+
'48px',
35+
'72px'
36+
]
37+
38+
const lineHeightConfig = ['1', '1.2', '1.5', '2', '2.5', '3', '4', '5']
39+
340
const betterTable = {
441
operationMenu: {
542
items: {
@@ -20,7 +57,7 @@ const betterTable = {
2057
}
2158
}
2259

23-
const toolbar = (FluentEditor) => {
60+
const toolbar = () => {
2461
const underline = ['bold', 'italic', 'underline', 'strike']
2562
const list = [{ list: 'ordered' }, { list: 'bullet' }]
2663
const script = [{ script: 'sub' }, { script: 'super' }]
@@ -29,9 +66,9 @@ const toolbar = (FluentEditor) => {
2966
container: [
3067
['undo', 'redo', 'clean'],
3168
[
32-
{ font: FluentEditor.imports['formats/font'].whitelist },
33-
{ size: FluentEditor.imports['formats/size'].whitelist },
34-
{ lineheight: FluentEditor.imports['formats/lineheight'].whitelist },
69+
{ font: fontFamilyConfig },
70+
{ size: fontSizeConfig },
71+
{ lineheight: lineHeightConfig },
3572
{ header: [1, 2, 3, 4, 5, 6, false] }
3673
],
3774
underline,
@@ -170,7 +207,7 @@ const defaultOption = ({ FluentEditor, state, mentionObj }) => {
170207
file: true, // 上传文件需开启
171208
image: FluentEditor.imports['modules/image-spec'],
172209
counter: false,
173-
toolbar: toolbar(FluentEditor),
210+
toolbar: toolbar(),
174211
'better-table': betterTable,
175212
mention: mention(mentionObj),
176213
keyboard: keyboard({ FluentEditor, state })

packages/theme/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "@opentiny/vue-theme",
3-
"type": "module",
4-
"version": "3.18.1",
3+
"version": "3.18.2",
54
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
65
"author": "OpenTiny Team",
76
"license": "MIT",
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
22
"name": "@opentiny/vue-form-item",
3-
"version": "3.18.0",
3+
"type": "module",
4+
"version": "3.18.1",
45
"description": "",
6+
"license": "MIT",
7+
"sideEffects": false,
58
"main": "lib/index.js",
69
"module": "index.ts",
7-
"sideEffects": false,
8-
"type": "module",
9-
"devDependencies": {
10-
"@opentiny-internal/vue-test-utils": "workspace:*",
11-
"vitest": "^0.31.0"
12-
},
1310
"scripts": {
1411
"build": "pnpm -w build:ui $npm_package_name",
1512
"//postversion": "pnpm build"
1613
},
1714
"dependencies": {
18-
"@opentiny/vue-tooltip": "workspace:~",
1915
"@opentiny/vue-common": "workspace:~",
16+
"@opentiny/vue-icon": "workspace:~",
2017
"@opentiny/vue-renderless": "workspace:~",
21-
"@opentiny/vue-icon": "workspace:~"
18+
"@opentiny/vue-tooltip": "workspace:~"
2219
},
23-
"license": "MIT"
24-
}
20+
"devDependencies": {
21+
"@opentiny-internal/vue-test-utils": "workspace:*",
22+
"vitest": "^0.31.0"
23+
}
24+
}

packages/vue/src/form-item/src/pc.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export default defineComponent({
183183
// 兼容 2.0 组件 validation 是否有 required
184184
state.validationRequired = propsData.validation && !!propsData.validation.required
185185
}
186-
// 如果为 2.0 的验证 不会使用 toolltip 组件
186+
// 如果为 2.0 的验证 不会使用 tooltip 组件
187187
if (propsData.validation) {
188188
return item
189189
}
@@ -223,7 +223,8 @@ export default defineComponent({
223223
}
224224
data = item.props
225225
}
226-
data.class = deduplicateCssClass('tiny-tooltip' + stringifyCssClass(data.class))
226+
const mergeClass = `tiny-tooltip ${stringifyCssClass(data.class)}`
227+
data.class = deduplicateCssClass(mergeClass)
227228
return item
228229
})
229230
: null

packages/vue/src/grid/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@opentiny/vue-grid",
3-
"version": "3.18.0",
3+
"type": "module",
4+
"version": "3.18.3",
45
"description": "",
56
"main": "lib/index.js",
67
"module": "index.ts",
78
"sideEffects": false,
8-
"type": "module",
99
"devDependencies": {
1010
"@opentiny-internal/vue-test-utils": "workspace:*",
1111
"vitest": "^0.31.0"
@@ -31,4 +31,4 @@
3131
"@opentiny/vue-common": "workspace:~"
3232
},
3333
"license": "MIT"
34-
}
34+
}

packages/vue/src/grid/src/dragger/src/methods.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,16 @@ export default {
6565
},
6666
// 处理行拖拽
6767
rowDrop(bodyEl) {
68-
const { plugin, onBeforeMove, filter, refresh = true, rowHandle } = this.dropConfig
68+
const { plugin, onBeforeMove, filter, refresh = true, rowHandle, trigger } = this.dropConfig
6969
const rowDropContainer = bodyEl.querySelector('.tiny-grid__body tbody')
70-
70+
// 拖拽触发源,默认是行
71+
let handle = trigger || '.tiny-grid-body__row'
72+
// 配置了 rowHandle === 'index'则忽略trigger
73+
if (rowHandle === 'index') {
74+
handle = '.tiny-grid-body__row>td.col__index>.row__drop-handle'
75+
}
7176
const rowDropOptions = {
72-
handle: rowHandle === 'index' ? '.tiny-grid-body__row>td.col__index>.row__drop-handle' : '.tiny-grid-body__row',
77+
handle,
7378
filter,
7479
onEnd: createHandlerOnEnd({ _vm: this, refresh }),
7580
onStart: (event) => {

0 commit comments

Comments
 (0)