primevue-mirror/components/lib/orderlist/BaseOrderList.vue

149 lines
3.1 KiB
Vue
Raw Normal View History

2023-06-02 09:10:49 +00:00
<script>
import BaseComponent from 'primevue/basecomponent';
import { useStyle } from 'primevue/usestyle';
const styles = `
2023-09-26 06:40:02 +00:00
@layer primevue.core {
2023-09-25 19:11:55 +00:00
.p-orderlist {
display: flex;
}
.p-orderlist-controls {
display: flex;
flex-direction: column;
justify-content: center;
}
.p-orderlist-list-container {
flex: 1 1 auto;
}
.p-orderlist-list {
list-style-type: none;
margin: 0;
padding: 0;
overflow: auto;
min-height: 12rem;
max-height: 24rem;
}
.p-orderlist-item {
cursor: pointer;
overflow: hidden;
position: relative;
}
.p-orderlist.p-state-disabled .p-orderlist-item,
.p-orderlist.p-state-disabled .p-button {
cursor: default;
}
.p-orderlist.p-state-disabled .p-orderlist-list {
overflow: hidden;
}
2023-06-02 09:10:49 +00:00
}
`;
const classes = {
root: ({ props }) => [
'p-orderlist p-component',
{
'p-orderlist-striped': props.stripedRows
}
],
controls: 'p-orderlist-controls',
header: 'p-orderlist-header',
container: 'p-orderlist-list-container',
list: 'p-orderlist-list',
2023-06-06 13:20:55 +00:00
item: ({ instance, item, id }) => [
2023-06-02 09:10:49 +00:00
'p-orderlist-item',
{
2023-06-06 13:20:55 +00:00
'p-highlight': instance.isSelected(item),
'p-focus': id === instance.focusedOptionId
2023-06-02 09:10:49 +00:00
}
]
};
const { load: loadStyle } = useStyle(styles, { name: 'orderlist', manual: true });
2023-06-02 09:10:49 +00:00
export default {
2023-06-02 15:43:30 +00:00
name: 'BaseOrderList',
2023-06-02 09:10:49 +00:00
extends: BaseComponent,
props: {
modelValue: {
type: Array,
default: null
},
selection: {
type: Array,
default: null
},
dataKey: {
type: String,
default: null
},
listStyle: {
type: null,
default: null
},
metaKeySelection: {
type: Boolean,
default: true
},
responsive: {
type: Boolean,
default: true
},
breakpoint: {
type: String,
default: '960px'
},
stripedRows: {
type: Boolean,
default: false
},
tabindex: {
type: Number,
default: 0
},
listProps: {
type: null,
default: null
},
moveUpButtonProps: {
type: null,
default: null
},
moveTopButtonProps: {
type: null,
default: null
},
moveDownButtonProps: {
type: null,
default: null
},
moveBottomButtonProps: {
type: null,
default: null
},
'aria-labelledby': {
type: String,
default: null
},
'aria-label': {
type: String,
default: null
}
},
css: {
classes,
loadStyle
},
provide() {
return {
$parentInstance: this
};
}
};
</script>