1 line
52 KiB
Plaintext
1 line
52 KiB
Plaintext
|
|
{"version":3,"file":"index.mjs","sources":["../../src/splitter/BaseSplitter.vue","../../src/splitter/Splitter.vue","../../src/splitter/Splitter.vue?vue&type=template&id=92aa5fd8&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport SplitterStyle from 'primevue/splitter/style';\n\nexport default {\n name: 'BaseSplitter',\n extends: BaseComponent,\n props: {\n layout: {\n type: String,\n default: 'horizontal'\n },\n gutterSize: {\n type: Number,\n default: 4\n },\n stateKey: {\n type: String,\n default: null\n },\n stateStorage: {\n type: String,\n default: 'session'\n },\n step: {\n type: Number,\n default: 5\n }\n },\n style: SplitterStyle,\n provide() {\n return {\n $pcSplitter: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :data-p-resizing=\"false\" :data-p=\"dataP\" v-bind=\"ptmi('root', getPTOptions)\">\n <template v-for=\"(panel, i) of panels\" :key=\"i\">\n <component :is=\"panel\" tabindex=\"-1\"></component>\n <div\n v-if=\"i !== panels.length - 1\"\n ref=\"gutter\"\n :class=\"cx('gutter')\"\n role=\"separator\"\n tabindex=\"-1\"\n @mousedown=\"onGutterMouseDown($event, i)\"\n @touchstart=\"onGutterTouchStart($event, i)\"\n @touchmove=\"onGutterTouchMove($event, i)\"\n @touchend=\"onGutterTouchEnd($event, i)\"\n :data-p-gutter-resizing=\"false\"\n :data-p=\"dataP\"\n v-bind=\"ptm('gutter')\"\n >\n <div :class=\"cx('gutterHandle')\" tabindex=\"0\" :style=\"[gutterStyle]\" :aria-orientation=\"layout\" :aria-valuenow=\"prevSize\" @keyup=\"onGutterKeyUp\" @keydown=\"onGutterKeyDown($event, i)\" :data-p=\"dataP\" v-bind=\"ptm('gutterHandle')\"></div>\n </div>\n </template>\n </div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport { getHeight, getOuterHeight, getOuterWidth, getWidth, isRTL } from '@primeuix/utils/dom';\nimport { isArray, isNotEmpty } from '@primeuix/utils/object';\nimport { getVNodeProp } from '@primevue/core/utils';\nimport BaseSplitter from './BaseSplitter.vue';\n\nexport default {\n name: 'Splitter',\n extends: BaseSplitter,\n inheritAttrs: false,\n emits: ['resizestart', 'resizeend', 'resize'],\n dragging: false,\n mouseMoveListener: null,\n mouseUpListener: null,\n touchMoveListener: null,\n touchEndListener: null,\n size: null,\n gutterElement: null,\n startPos: null,\n prevPanelElement: null,\n nextPanelElement: null,\n nextPanelSize: null,\n prevPanelSize: null,\n panelSizes: null,\n prevPanelIndex: null,\n timer: null,\n data() {\n return {\n prevSize: null\n };\n },\n mounted() {\n this.initializePanels();\n },\n beforeUnmount() {\n this.clear();\n this.unbindMouseListeners();\n },\n methods: {\n isSplitterPanel(child) {\n return child.type.name === 'SplitterPanel';\n },\n initializePanels() {\n if (this.panels && this.panels.length) {\n let initialized = false;\n\n if (this.isStateful()) {\n initialized = this.restoreState();\n }\n\n if (!initialized) {\n let children = [...this.$el.children].filter((child) => child.getAttribute('data-pc-name') === 'splitterpanel');\n let _panelSizes = [];\n\n this.panels.map((panel, i) => {\n let panelInitialSize = panel.props && isNotEmpty(panel.props.size) ? panel.props.size : null;\n let panelSize = p
|