Skip to content

Commit

Permalink
releases 4.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Nov 28, 2024
1 parent 4616684 commit 34af44d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 105 deletions.
93 changes: 4 additions & 89 deletions examples/views/password-input/PasswordInputTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</p>

<p>
<vxe-password-input v-model="demo1.value302" placeholder="密码类型" type="password"></vxe-password-input>
<vxe-password-input v-model="demo1.value303" placeholder="可清除" type="password" clearable></vxe-password-input>
<vxe-password-input v-model="demo1.value104" placeholder="密码类型" type="password"></vxe-password-input>
<vxe-password-input v-model="demo1.value105" placeholder="可清除" type="password" clearable></vxe-password-input>
</p>
</div>
</template>
Expand All @@ -22,92 +22,7 @@ const demo1 = reactive({
value101: '',
value102: '',
value103: '',
value200: '',
value201: '',
value202: '',
value203: '',
value300: '',
value301: '',
value302: '',
value303: '',
value400: '',
value401: '',
value402: '',
value403: '',
value404: '',
value405: '',
value406: '',
value407: '',
value408: '2020-10-01',
value409: '2020-10-01',
value500: '22',
value501: '',
value502: '',
value503: '33.33',
value504: '',
value505: '',
value506: '44',
value507: '',
value508: '',
value509: '1e+2',
value600: '',
value601: '',
value602: '',
value603: '',
value701: '2017-12-18',
value702: '2017-12-18',
value703: '2017-12-18',
value704: '2017-12-18',
value705: '2017-12-18',
value706: '2017-12-18',
value707: '2017-12-18',
value800: '',
value801: '',
value802: '',
value803: '',
value804: '',
value805: ''
value104: '',
value105: ''
})
</script>

<style lang="scss" scoped>
.my-red {
color: red;
}
.my-green {
color: green;
}
.my-domain.vxe-input {
height: 34px;
width: 300px;
}
.my-domain.vxe-input:deep() .vxe-input--prefix {
width: 60px;
height: 32px;
top: 1px;
text-align: center;
border-right: 1px solid #dcdfe6;
background-color: #f5f7fa;
}
.my-domain.vxe-input:deep() .vxe-input--inner {
padding-left: 72px;
border: 1px solid #dcdfe6;
}
.my-search.vxe-input {
height: 34px;
width: 300px;
}
.my-search.vxe-input:deep() .vxe-input--suffix {
width: 60px;
height: 32px;
top: 1px;
text-align: center;
border-left: 1px solid #dcdfe6;
background-color: #f5f7fa;
cursor: pointer;
}
.my-search.vxe-input:deep() .vxe-input--inner {
padding-right: 72px;
border: 1px solid #dcdfe6;
}
</style>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-pc-ui",
"version": "4.3.6",
"version": "4.3.7",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down Expand Up @@ -63,7 +63,7 @@
"vue": "3.5.5",
"vue-i18n": "^9.13.1",
"vue-router": "^4.3.2",
"vxe-table": "^4.9.4"
"vxe-table": "^4.9.8"
},
"vetur": {
"tags": "helper/vetur/tags.json",
Expand Down
16 changes: 15 additions & 1 deletion packages/password-input/src/password-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export default defineComponent({
name: 'VxePasswordInput',
props: {
modelValue: String as PropType<VxePasswordInputPropTypes.ModelValue>,
immediate: {
type: Boolean as PropType<VxePasswordInputPropTypes.Immediate>,
default: true
},
name: String as PropType<VxePasswordInputPropTypes.Name>,
clearable: {
type: Boolean as PropType<VxePasswordInputPropTypes.Clearable>,
Expand Down Expand Up @@ -112,14 +116,24 @@ export default defineComponent({
return 'password'
})

const computeInpImmediate = computed(() => {
const { immediate } = props
return immediate
})

const triggerEvent = (evnt: Event & { type: 'input' | 'change' | 'click' | 'focus' | 'blur' }) => {
const { inputValue } = reactData
passwordInputMethods.dispatchEvent(evnt.type, { value: inputValue }, evnt)
}

const emitInputEvent = (value: any, evnt: Event) => {
const inpImmediate = computeInpImmediate.value
reactData.inputValue = value
passwordInputMethods.dispatchEvent('input', { value }, evnt)
if (inpImmediate) {
handleChange(value, evnt)
} else {
passwordInputMethods.dispatchEvent('input', { value }, evnt)
}
}

const inputEvent = (evnt: Event & { type: 'input' }) => {
Expand Down
29 changes: 16 additions & 13 deletions packages/tree/src/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export default defineComponent({
return nextTick()
},
setAllCheckboxNode (checked) {
const selectMaps: Record<string, boolean> = Object.assign(reactData.selectCheckboxMaps)
const selectMaps: Record<string, boolean> = Object.assign({}, reactData.selectCheckboxMaps)
const childrenField = computeChildrenField.value
if (checked) {
XEUtils.eachTree(reactData.treeList, (node) => {
Expand All @@ -404,7 +404,7 @@ export default defineComponent({
return nextTick()
},
setExpandByNodeId (nodeids, expanded) {
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
if (nodeids) {
if (!XEUtils.isArray(nodeids)) {
nodeids = [nodeids]
Expand All @@ -417,7 +417,7 @@ export default defineComponent({
return nextTick()
},
setExpandNode (nodes, expanded) {
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
if (nodes) {
if (!XEUtils.isArray(nodes)) {
nodes = [nodes]
Expand All @@ -431,7 +431,7 @@ export default defineComponent({
return nextTick()
},
toggleExpandByNodeId (nodeids) {
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
if (nodeids) {
if (!XEUtils.isArray(nodeids)) {
nodeids = [nodeids]
Expand All @@ -444,7 +444,7 @@ export default defineComponent({
return nextTick()
},
toggleExpandNode (nodes) {
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
if (nodes) {
if (!XEUtils.isArray(nodes)) {
nodes = [nodes]
Expand All @@ -458,7 +458,7 @@ export default defineComponent({
return nextTick()
},
setAllExpandNode () {
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
const childrenField = computeChildrenField.value
XEUtils.eachTree(reactData.treeList, (node) => {
const nodeid = getNodeId(node)
Expand Down Expand Up @@ -639,27 +639,30 @@ export default defineComponent({
const { checkStrictly } = checkboxOpts
return new Promise(resolve => {
if (loadMethod) {
const { treeExpandLazyLoadedMaps } = reactData
const tempExpandLazyLoadedMaps = Object.assign({}, reactData.treeExpandLazyLoadedMaps)
const { nodeMaps } = reactData
const nodeid = getNodeId(node)
const nodeItem = nodeMaps[nodeid]
treeExpandLazyLoadedMaps[nodeid] = true
tempExpandLazyLoadedMaps[nodeid] = true
reactData.treeExpandLazyLoadedMaps = tempExpandLazyLoadedMaps
Promise.resolve(
loadMethod({ $tree: $xeTree, node })
).then((childRecords: any) => {
const { treeExpandLazyLoadedMaps } = reactData
nodeItem.treeLoaded = true
if (treeExpandLazyLoadedMaps[nodeid]) {
delete treeExpandLazyLoadedMaps[nodeid]
treeExpandLazyLoadedMaps[nodeid] = false
}
if (!XEUtils.isArray(childRecords)) {
childRecords = []
}
if (childRecords) {
return treeMethods.loadChildrenNode(node, childRecords).then(childRows => {
const { treeExpandedMaps } = reactData
if (childRows.length && !treeExpandedMaps[nodeid]) {
treeExpandedMaps[nodeid] = true
const tempExpandedMaps = Object.assign({}, reactData.treeExpandedMaps)
if (childRows.length && !tempExpandedMaps[nodeid]) {
tempExpandedMaps[nodeid] = true
}
reactData.treeExpandedMaps = tempExpandedMaps
// 如果当前节点已选中,则展开后子节点也被选中
if (!checkStrictly && treeMethods.isCheckedByCheckboxNodeId(nodeid)) {
handleCheckedCheckboxNode(childRows.map((item: any) => getNodeId(item)), true)
Expand All @@ -676,7 +679,7 @@ export default defineComponent({
const { treeExpandLazyLoadedMaps } = reactData
nodeItem.treeLoaded = false
if (treeExpandLazyLoadedMaps[nodeid]) {
delete treeExpandLazyLoadedMaps[nodeid]
treeExpandLazyLoadedMaps[nodeid] = false
}
updateNodeLine(node)
dispatchEvent('load-error', { node, data: e }, new Event('load-error'))
Expand Down
2 changes: 2 additions & 0 deletions types/components/password-input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface VxePasswordInputPrivateRef extends PasswordInputPrivateRef { }
export namespace VxePasswordInputPropTypes {
export type Size = VxeComponentSizeType
export type ModelValue = string | null
export type Immediate = boolean
export type ClassName = string
export type Name = string
export type Clearable = boolean
Expand All @@ -46,6 +47,7 @@ export namespace VxePasswordInputPropTypes {
export interface VxePasswordInputProps {
size?: VxePasswordInputPropTypes.Size
modelValue?: VxePasswordInputPropTypes.ModelValue
immediate?: VxePasswordInputPropTypes.Immediate
className?: VxePasswordInputPropTypes.ClassName
name?: VxePasswordInputPropTypes.Name
clearable?: VxePasswordInputPropTypes.Clearable
Expand Down

0 comments on commit 34af44d

Please sign in to comment.