primevue-mirror/components/lib/terminal/BaseTerminal.vue

68 lines
1.3 KiB
Vue
Raw Normal View History

2023-05-24 12:53:29 +00:00
<script>
import BaseComponent from 'primevue/basecomponent';
import { useStyle } from 'primevue/usestyle';
const styles = `
2023-09-26 09:14:27 +00:00
@layer primevue {
2023-09-25 19:11:55 +00:00
.p-terminal {
height: 18rem;
overflow: auto;
}
.p-terminal-prompt-container {
display: flex;
align-items: center;
}
.p-terminal-input {
flex: 1 1 auto;
border: 0 none;
background-color: transparent;
color: inherit;
padding: 0;
outline: 0 none;
}
.p-terminal-input::-ms-clear {
display: none;
}
2023-05-24 12:53:29 +00:00
}
`;
const classes = {
root: 'p-terminal p-component',
content: 'p-terminal-content',
prompt: 'p-terminal-prompt',
command: 'p-terminal-command',
response: 'p-terminal-response',
container: 'p-terminal-prompt-container',
commandText: 'p-terminal-input'
};
const { load: loadStyle } = useStyle(styles, { name: 'terminal', manual: true });
2023-05-24 12:53:29 +00:00
export default {
name: 'BaseTerminal',
extends: BaseComponent,
props: {
welcomeMessage: {
type: String,
default: null
},
prompt: {
type: String,
default: null
}
},
css: {
classes,
loadStyle
2023-05-24 12:53:29 +00:00
},
provide() {
return {
$parentInstance: this
};
2023-05-24 12:53:29 +00:00
}
};
</script>