Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/number input original type #2040

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<ul v-if="item.children" v-show="item.expand" class="nav-child-menu">
<li v-for="(child, cIndex) in item.children" :key="cIndex" :class="{'is-donation': ['Donation'].includes(child.locat.name)}">
<a class="nav-link disabled" v-if="child.disabled" :title="$t('app.body.other.newFunc')" v-html="child.label"></a>
<!--eslint-disable-next-line-->
<router-link v-else class="nav-link" :to="child.locat" :title="child.label" v-html="child.label"></router-link>
</li>
</ul>
Expand All @@ -99,7 +100,7 @@
<vxe-button class="oper-btn" :icon="appData.showLeft ? 'vxe-icon-arrow-left' : 'vxe-icon-arrow-right'" @click="appData.showLeft = !appData.showLeft"></vxe-button>
</div>
<div class="body">
<div class="content" :class="{full: ['VXEAPI', 'Donation', 'Run'].includes($route.name)}">
<div class="content" :class="{full: ['VXEAPI', 'Donation', 'Run'].includes($route.name as string)}">
<template v-if="!/\/start|\/module|\/api/.test($route.path)">
<a v-if="demoLink" class="link todemo" :href="demoLink" target="_blank"><i class="fa fa-bug"></i>{{ $t('app.body.button.runDemo') }}</a>
</template>
Expand Down
2 changes: 1 addition & 1 deletion examples/views/input/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default defineComponent({
value500: '22',
value501: '',
value502: '',
value503: '33.33',
value503: 33.33,
value504: '',
value505: '',
value506: '44',
Expand Down
8 changes: 5 additions & 3 deletions examples/views/table/edit/Upload.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div>
<p class="tip">文件上传,可以通过调用 <table-api-link prop="readFile"/> 读取本地文件<span class="red">(具体请自行实现,该示例仅供参考)</span></p>
<p class="tip">文件上传,可以通过调用
<table-api-link prop="readFile"/>
读取本地文件<span class="red">(具体请自行实现,该示例仅供参考)</span></p>

<vxe-toolbar ref="xToolbar">
<template #buttons>
Expand Down Expand Up @@ -54,9 +56,9 @@ export default defineComponent({
const name = ns.slice(0, ns.length - 1).join('')
const type = ns[ns.length - 1]
return {
name: name,
name,
size: file.size,
type: type,
type,
date: XEUtils.toDateString(new Date())
}
})
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@
"@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/eslint-config-standard": "^6.1.0",
"@vue/eslint-config-typescript": "^9.1.0",
"@vue/eslint-config-standard": "^8.0.1",
"@vue/eslint-config-typescript": "^11.0.3",
"@types/node": "^18.16.0",
"core-js": "^3.8.3",
"del": "^6.1.1",
"eslint": "^7.32.0",
"eslint": "^8.39.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^8.0.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.11.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^6.1.0",
"gulp-babel": "^8.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/input/src/input.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineComponent, h, Teleport, ref, Ref, computed, reactive, inject, nextTick, watch, onUnmounted, PropType } from 'vue'
import XEUtils from 'xe-utils'
import XEUtils, { toNumber } from 'xe-utils'
import GlobalConfig from '../../v-x-e-table/src/conf'
import { useSize } from '../../hooks/size'
import { getFuncText, getLastZIndex, nextZIndex } from '../../tools/utils'
Expand Down Expand Up @@ -666,7 +666,7 @@ export default defineComponent({

const emitModel = (value: string, evnt: Event | { type: string }) => {
reactData.inputValue = value
emit('update:modelValue', value)
emit('update:modelValue', (['number', 'integer', 'float'].includes(props.type) ? toNumber(value) : value))
inputMethods.dispatchEvent('input', { value }, evnt)
if (XEUtils.toValueString(props.modelValue) !== value) {
inputMethods.dispatchEvent('change', { value }, evnt)
Expand Down
2 changes: 1 addition & 1 deletion packages/modal/src/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ export default defineComponent({
}, ['wl', 'wr', 'swst', 'sest', 'st', 'swlb', 'selb', 'sb'].map(type => {
return h('span', {
class: `${type}-resize`,
type: type,
type,
onMousedown: dragEvent
})
}))
Expand Down
6 changes: 3 additions & 3 deletions packages/select/src/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ export default defineComponent({
'is--hover': currentValue === optionValue
}],
// attrs
optid: optid,
optid,
// event
onMousedown: (evnt: MouseEvent) => {
const isLeftBtn = evnt.button === 0
Expand Down Expand Up @@ -764,7 +764,7 @@ export default defineComponent({
'is--disabled': isGroupDisabled
}],
// attrs
optid: optid
optid
}, [
h('div', {
class: 'vxe-optgroup--title'
Expand Down Expand Up @@ -925,7 +925,7 @@ export default defineComponent({
clearable: props.clearable,
placeholder: props.placeholder,
readonly: true,
disabled: disabled,
disabled,
type: 'text',
prefixIcon: props.prefixIcon,
suffixIcon: loading ? GlobalConfig.icon.SELECT_LOADED : (visiblePanel ? GlobalConfig.icon.SELECT_OPEN : GlobalConfig.icon.SELECT_CLOSE),
Expand Down
2 changes: 1 addition & 1 deletion packages/table/src/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export default defineComponent({
},
getPropClass(rowClassName, params)
],
rowid: rowid,
rowid,
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
key: (rowKey || rowOpts.useKey) || treeConfig ? rowid : $rowIndex,
...trOn
Expand Down
4 changes: 2 additions & 2 deletions packages/table/src/columnInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ColumnInfo {
className: _vm.className,
headerClassName: _vm.headerClassName,
footerClassName: _vm.footerClassName,
formatter: formatter,
formatter,
sortable: _vm.sortable,
sortBy: _vm.sortBy,
sortType: _vm.sortType,
Expand Down Expand Up @@ -121,7 +121,7 @@ export class ColumnInfo {
renderHeader: renderHeader || _vm.renderHeader,
renderCell: renderCell || _vm.renderCell,
renderFooter: renderFooter || _vm.renderFooter,
renderData: renderData,
renderData,
// 单元格插槽,只对 grid 有效
slots: _vm.slots
})
Expand Down
2 changes: 1 addition & 1 deletion packages/tools/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function getEventTargetNode (evnt: any, container: any, queryCls?: string
if (queryCls && hasClass(target, queryCls) && (!queryMethod || queryMethod(target))) {
targetElem = target
} else if (target === container) {
return { flag: queryCls ? !!targetElem : true, container, targetElem: targetElem }
return { flag: queryCls ? !!targetElem : true, container, targetElem }
}
target = target.parentNode
}
Expand Down
Loading