mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Refactor #3965 - For Inplace
This commit is contained in:
parent
6cce144ab9
commit
033c7304f3
3 changed files with 86 additions and 58 deletions
75
components/lib/inplace/BaseInplace.vue
Normal file
75
components/lib/inplace/BaseInplace.vue
Normal file
|
@ -0,0 +1,75 @@
|
|||
<script>
|
||||
import BaseComponent from 'primevue/basecomponent';
|
||||
import { useStyle } from 'primevue/usestyle';
|
||||
|
||||
const styles = `
|
||||
.p-inplace .p-inplace-display {
|
||||
display: inline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.p-inplace .p-inplace-content {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.p-fluid .p-inplace.p-inplace-closable .p-inplace-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.p-fluid .p-inplace.p-inplace-closable .p-inplace-content > .p-inputtext {
|
||||
flex: 1 1 auto;
|
||||
width: 1%;
|
||||
}
|
||||
`;
|
||||
|
||||
const classes = {
|
||||
root: ({ props }) => ['p-inplace p-component', { 'p-inplace-closable': props.closable }],
|
||||
display: ({ props }) => ['p-inplace-display', { 'p-disabled': props.disabled }],
|
||||
content: 'p-inplace-content',
|
||||
closeButton: ({ props }) => props.closeIcon
|
||||
};
|
||||
|
||||
const { load: loadStyle } = useStyle(styles, { id: 'primevue_divider_style', manual: true });
|
||||
|
||||
export default {
|
||||
name: 'BaseAvatar',
|
||||
extends: BaseComponent,
|
||||
props: {
|
||||
closable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
active: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
closeIcon: {
|
||||
type: String,
|
||||
default: undefined
|
||||
},
|
||||
displayProps: {
|
||||
type: null,
|
||||
default: null
|
||||
},
|
||||
closeButtonProps: {
|
||||
type: null,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
css: {
|
||||
classes
|
||||
},
|
||||
watch: {
|
||||
isUnstyled: {
|
||||
immediate: true,
|
||||
handler(newValue) {
|
||||
!newValue && loadStyle();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue