-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b752ba6
commit 6b3fe54
Showing
6 changed files
with
180 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<script> | ||
import BaseComponent from 'primevue/basecomponent'; | ||
import { useStyle } from 'primevue/usestyle'; | ||
const styles = ` | ||
.p-splitter { | ||
display: flex; | ||
flex-wrap: nowrap; | ||
} | ||
.p-splitter-vertical { | ||
flex-direction: column; | ||
} | ||
.p-splitter-gutter { | ||
flex-grow: 0; | ||
flex-shrink: 0; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
cursor: col-resize; | ||
} | ||
.p-splitter-horizontal.p-splitter-resizing { | ||
cursor: col-resize; | ||
user-select: none; | ||
} | ||
.p-splitter-horizontal > .p-splitter-gutter > .p-splitter-gutter-handle { | ||
height: 24px; | ||
width: 100%; | ||
} | ||
.p-splitter-horizontal > .p-splitter-gutter { | ||
cursor: col-resize; | ||
} | ||
.p-splitter-vertical.p-splitter-resizing { | ||
cursor: row-resize; | ||
user-select: none; | ||
} | ||
.p-splitter-vertical > .p-splitter-gutter { | ||
cursor: row-resize; | ||
} | ||
.p-splitter-vertical > .p-splitter-gutter > .p-splitter-gutter-handle { | ||
width: 24px; | ||
height: 100%; | ||
} | ||
`; | ||
const classes = { | ||
root: ({ props }) => ['p-splitter p-component', 'p-splitter-' + props.layout], | ||
gutter: 'p-splitter-gutter', | ||
gutterHandler: 'p-splitter-gutter-handle' | ||
}; | ||
const inlineStyles = { | ||
root: ({ props }) => [{ display: 'flex', 'flex-wrap': 'nowrap' }, props.layout === 'vertical' ? { 'flex-direction': 'column' } : ''] | ||
}; | ||
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_splitter_style', manual: true }); | ||
export default { | ||
name: 'BaseSplitter', | ||
extends: BaseComponent, | ||
props: { | ||
layout: { | ||
type: String, | ||
default: 'horizontal' | ||
}, | ||
gutterSize: { | ||
type: Number, | ||
default: 4 | ||
}, | ||
stateKey: { | ||
type: String, | ||
default: null | ||
}, | ||
stateStorage: { | ||
type: String, | ||
default: 'session' | ||
}, | ||
step: { | ||
type: Number, | ||
default: 5 | ||
} | ||
}, | ||
css: { | ||
classes, | ||
inlineStyles | ||
}, | ||
watch: { | ||
isUnstyled: { | ||
immediate: true, | ||
handler(newValue) { | ||
!newValue && loadStyle(); | ||
} | ||
} | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<script> | ||
import BaseComponent from 'primevue/basecomponent'; | ||
import { useStyle } from 'primevue/usestyle'; | ||
const styles = ` | ||
.p-splitter-panel { | ||
flex-grow: 1; | ||
} | ||
.p-splitter-panel-nested { | ||
display: flex; | ||
} | ||
.p-splitter-panel .p-splitter { | ||
flex-grow: 1; | ||
border: 0 none; | ||
} | ||
`; | ||
const classes = { | ||
root: ({ instance }) => ['p-splitter-panel', { 'p-splitter-panel-nested': instance.isNested }] | ||
}; | ||
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_splitterpanel_style', manual: true }); | ||
export default { | ||
name: 'BaseSplitterPanel', | ||
extends: BaseComponent, | ||
props: { | ||
size: { | ||
type: Number, | ||
default: null | ||
}, | ||
minSize: { | ||
type: Number, | ||
default: null | ||
} | ||
}, | ||
css: { | ||
classes | ||
}, | ||
watch: { | ||
isUnstyled: { | ||
immediate: true, | ||
handler(newValue) { | ||
!newValue && loadStyle(); | ||
} | ||
} | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters