Skip to content

Commit c0acafd

Browse files
committed
fix: fix conflict
2 parents 85e6737 + 10c65c8 commit c0acafd

File tree

15 files changed

+64
-194
lines changed

15 files changed

+64
-194
lines changed

commitlint.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
module.exports = { extends: ['@commitlint/config-conventional'] }
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'header-max-length': [1, 'always', 150]
5+
}
6+
}

examples/sites/demos/apis/input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default {
129129
type: 'string',
130130
defaultValue: '',
131131
desc: {
132-
'zh-CN': '设置只读态时的文本内容区,如果没有则会使用 modelVale 的值作为只读文本',
132+
'zh-CN': '设置只读态时的文本内容区,如果没有则会使用 modelValue 的值作为只读文本',
133133
'en-US':
134134
"Sets the text content area in the read-only state, if not, modelVale's value is used as the read-only text"
135135
},
@@ -416,7 +416,7 @@ export default {
416416
type: "'medium' | 'small' | 'mini'",
417417
defaultValue: '',
418418
desc: {
419-
'zh-CN': '输入框尺寸,只在 type!="textarea" 时有效',
419+
'zh-CN': '输入框尺寸,只在 type"textarea" 时有效',
420420
'en-US': 'Size of the text box. This parameter is valid only when type!="textarea". '
421421
},
422422
mode: ['pc', 'mobile-first'],

examples/sites/demos/pc/app/base-select/size.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ test('mini 尺寸', async ({ page }) => {
5454

5555
await expect(input).toHaveClass(/tiny-input-mini/)
5656
await expect(tag.nth(0)).toHaveClass(/tiny-tag--mini tiny-tag--light/)
57-
expect(height).toBeCloseTo(27, 1)
57+
expect(height).toBeCloseTo(28, 1)
5858
})

packages/renderless/src/base-select/index.ts

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -61,51 +61,6 @@ export const showTip =
6161
}
6262
}
6363

64-
export const gridOnQueryChange =
65-
({ props, vm, constants, state }) =>
66-
(value) => {
67-
const { multiple, valueField, filterMethod, filterable, remote, remoteMethod } = props
68-
69-
if (filterable && typeof filterMethod === 'function') {
70-
const table = vm.$refs.selectGrid.$refs.tinyTable
71-
const fullData = table.afterFullData
72-
73-
vm.$refs.selectGrid.scrollTo(null, 0)
74-
75-
table.afterFullData = filterMethod(value, fullData) || []
76-
77-
vm.$refs.selectGrid
78-
.handleTableData(!value)
79-
.then(() => state.selectEmitter.emit(constants.EVENT_NAME.updatePopper))
80-
81-
state.previousQuery = value
82-
} else if (remote && typeof remoteMethod === 'function') {
83-
state.previousQuery = value
84-
remoteMethod(value, props.extraQueryParams).then((data) => {
85-
// 多选时取远端数据与当前已选数据的并集
86-
if (multiple) {
87-
const selectedIds = state.selected.map((sel) => sel[valueField])
88-
vm.$refs.selectGrid.clearSelection()
89-
vm.$refs.selectGrid.setSelection(
90-
data.filter((row) => ~selectedIds.indexOf(row[valueField])),
91-
true
92-
)
93-
state.remoteData = data.filter((row) => !~selectedIds.indexOf(row[valueField])).concat(state.selected)
94-
} else {
95-
vm.$refs.selectGrid.clearRadioRow()
96-
vm.$refs.selectGrid.setRadioRow(find(data, (item) => props.modelValue === item[props.valueField]))
97-
state.remoteData = data
98-
}
99-
100-
vm.$refs.selectGrid.$refs.tinyTable.lastScrollTop = 0
101-
vm.$refs.selectGrid.loadData(data)
102-
vm.$refs.selectGrid
103-
.handleTableData(!value)
104-
.then(() => state.selectEmitter.emit(constants.EVENT_NAME.updatePopper))
105-
})
106-
}
107-
}
108-
10964
export const defaultOnQueryChange =
11065
({ props, state, constants, api, nextTick }) =>
11166
(value, isInput) => {
@@ -366,7 +321,6 @@ export const setSelected =
366321
}
367322
state.selected.length && (state.selectedLabel = '')
368323

369-
vm.$refs.selectTree && vm.$refs.selectTree.setCheckedNodes && vm.$refs.selectTree.setCheckedNodes(state.selected)
370324
state.tips = state.selected.map((item) => (item.state ? item.state.currentLabel : item.currentLabel)).join(',')
371325

372326
setFilteredSelectCls(nextTick, state, props)
@@ -1247,10 +1201,6 @@ export const toVisible =
12471201
if (vm.$refs.input && vm.$refs.input.value === '' && state.selected.length === 0) {
12481202
state.currentPlaceholder = state.cachedPlaceHolder
12491203
}
1250-
1251-
if (vm.$refs.selectGrid) {
1252-
vm.$refs.selectGrid.clearScroll()
1253-
}
12541204
})
12551205

12561206
postOperOfToVisible({ props, state, constants })
@@ -1284,31 +1234,6 @@ export const toHide =
12841234
}
12851235
}
12861236
}
1287-
1288-
if (vm.$refs.selectGrid) {
1289-
let { fullData } = vm.$refs.selectGrid.getTableData()
1290-
if (multiple) {
1291-
const selectedIds = state.selected.map((sel) => sel[valueField])
1292-
vm.$refs.selectGrid.clearSelection()
1293-
vm.$refs.selectGrid.setSelection(
1294-
fullData.filter((row) => ~selectedIds.indexOf(row[valueField])),
1295-
true
1296-
)
1297-
} else {
1298-
vm.$refs.selectGrid.clearRadioRow()
1299-
vm.$refs.selectGrid.setRadioRow(find(fullData, (item) => props.modelValue === item[valueField]))
1300-
}
1301-
1302-
if (filterable && typeof props.filterMethod === 'function') {
1303-
vm.$refs.selectGrid.handleTableData(true)
1304-
} else if (
1305-
filterable &&
1306-
remote &&
1307-
(typeof props.remoteMethod === 'function' || typeof props.initQuery === 'function')
1308-
) {
1309-
vm.$refs.selectGrid.handleTableData()
1310-
}
1311-
}
13121237
}
13131238

13141239
export const watchVisible =
@@ -1426,23 +1351,6 @@ export const handleCopyClick =
14261351
parent.$el.removeChild(input)
14271352
}
14281353

1429-
export const getcheckedData =
1430-
({ props, state }) =>
1431-
() => {
1432-
const checkedKey = []
1433-
1434-
if (!Array.isArray(state.selected)) {
1435-
return props.modelValue ? [props.modelValue] : [state.selected[props.valueField]]
1436-
} else {
1437-
state.selected.length > 0 &&
1438-
state.selected.forEach((item) => {
1439-
checkedKey.push(item[props.valueField])
1440-
})
1441-
1442-
return checkedKey
1443-
}
1444-
}
1445-
14461354
export const debouncRquest = ({ api, state, props }) =>
14471355
debounce(props.delay, () => {
14481356
if (props.filterable && state.query !== state.selectedLabel) {
@@ -1668,14 +1576,12 @@ export const initQuery =
16681576
return new Promise((resolve) => {
16691577
initData.then((selected) => {
16701578
state.remoteData = selected
1671-
vm.$refs.selectGrid.loadData(selected)
16721579
resolve(selected)
16731580
})
16741581
})
16751582
}
16761583
selected = initData
16771584
state.remoteData = selected
1678-
vm.$refs.selectGrid.loadData(selected)
16791585
}
16801586

16811587
return Promise.resolve(selected)
@@ -1684,7 +1590,6 @@ export const initQuery =
16841590
export const mounted =
16851591
({ api, parent, state, props, vm, designConfig }) =>
16861592
() => {
1687-
state.defaultCheckedKeys = state.gridCheckedData
16881593
const parentEl = parent.$el
16891594
const inputEl = parentEl.querySelector('input[data-tag="tiny-input-inner"]')
16901595

packages/renderless/src/base-select/vue.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
debouncRquest,
33
getChildValue,
4-
getcheckedData,
54
calcOverFlow,
65
toggleCheckAll,
76
handleCopyClick,
@@ -55,7 +54,6 @@ import {
5554
onMouseenterNative,
5655
onMouseleaveNative,
5756
onCopying,
58-
gridOnQueryChange,
5957
defaultOnQueryChange,
6058
queryChange,
6159
toVisible,
@@ -263,8 +261,6 @@ const initStateAdd = ({ computed, props, api, parent }) => {
263261
initialInputHeight: 0,
264262
currentPlaceholder: props.placeholder,
265263
filteredOptionsCount: 0,
266-
gridData: [],
267-
treeData: [],
268264
remoteData: [],
269265
currentKey: props.modelValue,
270266
updateId: '',
@@ -277,12 +273,10 @@ const initStateAdd = ({ computed, props, api, parent }) => {
277273
isDisplayOnly: computed(() => props.displayOnly || (parent.form || {}).displayOnly),
278274
isDisabled: computed(() => props.disabled || (parent.form || {}).disabled),
279275
isShowTagText: computed(() => api.computedShowTagText()),
280-
gridCheckedData: computed(() => api.getcheckedData()),
281276
searchSingleCopy: computed(() => props.allowCopy && !props.multiple && props.filterable),
282277
childrenName: computed(() => 'children'),
283278
tooltipContent: {},
284279
isHidden: false,
285-
defaultCheckedKeys: [],
286280
optionIndexArr: [],
287281
showCollapseTag: false,
288282
exceedMaxVisibleRow: false, // 是否超出默认最大显示行数
@@ -323,7 +317,6 @@ const initApi = ({
323317
showTip: showTip({ props, state, vm }),
324318
onOptionDestroy: onOptionDestroy(state),
325319
setSoftFocus: setSoftFocus({ vm, state }),
326-
getcheckedData: getcheckedData({ props, state }),
327320
resetInputWidth: resetInputWidth({ vm, state }),
328321
resetHoverIndex: resetHoverIndex({ props, state }),
329322
resetDatas: resetDatas({ props, state }),
@@ -344,7 +337,6 @@ const initApi = ({
344337
onMouseenterNative: onMouseenterNative({ state }),
345338
onMouseleaveNative: onMouseleaveNative({ state }),
346339
onCopying: onCopying({ state, vm }),
347-
gridOnQueryChange: gridOnQueryChange({ props, vm, constants, state }),
348340
watchHoverIndex: watchHoverIndex({ state }),
349341
computeOptimizeOpts: computeOptimizeOpts({ props, designConfig }),
350342
computeCollapseTags: computeCollapseTags(props),

packages/renderless/src/input/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export const resizeTextarea =
270270

271271
const { autosize, type } = parent
272272

273-
if (type !== 'textarea') {
273+
if (type !== 'textarea' || !vm.$refs.textarea) {
274274
return
275275
}
276276

packages/theme-saas/src/picker/index.less

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
@apply fill-color-icon-primary;
2323
}
2424
}
25+
2526
.@{input-prefix-cls}__icon-container {
2627
align-items: center;
2728
display: flex;
@@ -58,6 +59,11 @@
5859
.@{input-prefix-cls}__icon {
5960
@apply cursor-pointer;
6061

62+
.baseClearicon {
63+
@apply mr-2;
64+
@apply !transform-none;
65+
}
66+
6167
&:not(.@{range-prefix-cls}__icon) {
6268
@apply flex;
6369
}
@@ -106,15 +112,13 @@
106112
@apply absolute;
107113
@apply ~'right-1.5';
108114
@apply text-base;
109-
@apply w-4;
115+
width: 25px;
110116
float: right;
111117
@apply leading-8;
112118
@apply mr-5;
113119
@apply flex;
114120
@apply justify-center;
115121
@apply items-center;
116-
@apply h-5;
117-
@apply mr-6;
118122
}
119123
}
120124

packages/theme/src/base-select/index.less

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,6 @@
308308
&__inner {
309309
padding-right: 12px;
310310
}
311-
312-
&__suffix {
313-
display: inline-block;
314-
}
315311
}
316312

317313
.@{base-select-prefix-cls}__tags {
@@ -359,8 +355,6 @@
359355
}
360356

361357
.@{input-prefix-cls}__suffix {
362-
top: var(--tv-BaseSelect-suffix-top);
363-
364358
&-inner {
365359
font-size: 0;
366360
}
@@ -370,19 +364,6 @@
370364
overflow: hidden;
371365
}
372366

373-
&-medium .@{input-prefix-cls}__suffix {
374-
top: var(--tv-BaseSelect-suffix-top-medium);
375-
}
376-
377-
// TODO: 尾部按钮应垂直居中,待优化
378-
&-small .@{input-prefix-cls}__suffix {
379-
top: var(--tv-BaseSelect-suffix-top-small);
380-
}
381-
382-
&-mini .@{input-prefix-cls}__suffix {
383-
top: var(--tv-BaseSelect-suffix-top-mini);
384-
}
385-
386367
&.is-disabled {
387368
.@{base-select-prefix-cls}__caret {
388369
fill: var(--tv-BaseSelect-icon-color-disabled);

packages/theme/src/base/index.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212

1313
@import './reset.less';
1414
@import './vars.less';
15+
// @import './old-theme.less';
1516
@import './transition.less';

packages/theme/src/base/old-theme.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@
411411
--tv-size-height-xs: 24px; // mini 尺寸
412412
--tv-size-height-sm: 28px; // small 尺寸
413413
--tv-size-height-md: 32px; // medium 尺寸 - 默认
414-
--tv-size-height-lg: 40px; // large 尺寸
415-
--tv-size-height-xl: 48px; // xLarge 尺寸
416-
--tv-size-height-default:var(--tv-size-height-sm);
414+
--tv-size-height-lg: 36px; // large 尺寸
415+
--tv-size-height-xl: 42px; // xLarge 尺寸
416+
--tv-size-height-default: var(--tv-size-height-sm);
417417

418418
/** 7.2 图标大小 width, height **/
419419
--tv-icon-size: 14px;

0 commit comments

Comments
 (0)