UNPKG

primevue

Version:

PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBloc

1 lines 53.2 kB
{"version":3,"file":"index.mjs","sources":["../../src/splitter/BaseSplitter.vue","../../src/splitter/Splitter.vue","../../src/splitter/Splitter.vue?vue&type=template&id=4b1de5d4&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')\" :style=\"sx('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 = panelInitialSize || 100 / this.panels.length;\n\n _panelSizes[i] = panelSize;\n children[i].style.flexBasis = 'calc(' + panelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';\n });\n\n this.panelSizes = _panelSizes;\n this.prevSize = parseFloat(_panelSizes[0]).toFixed(4);\n }\n }\n },\n onResizeStart(event, index, isKeyDown) {\n this.gutterElement = event.currentTarget || event.target.parentElement;\n this.size = this.horizontal ? getWidth(this.$el) : getHeight(this.$el);\n\n if (!isKeyDown) {\n this.dragging = true;\n this.startPos = this.layout === 'horizontal' ? event.pageX || event.changedTouches[0].pageX : event.pageY || event.changedTouches[0].pageY;\n }\n\n this.prevPanelElement = this.gutterElement.previousElementSibling;\n this.nextPanelElement = this.gutterElement.nextElementSibling;\n\n if (isKeyDown) {\n this.prevPanelSize = this.horizontal ? getOuterWidth(this.prevPanelElement, true) : getOuterHeight(this.prevPanelElement, true);\n this.nextPanelSize = this.horizontal ? getOuterWidth(this.nextPanelElement, true) : getOuterHeight(this.nextPanelElement, true);\n } else {\n this.prevPanelSize = (100 * (this.horizontal ? getOuterWidth(this.prevPanelElement, true) : getOuterHeight(this.prevPanelElement, true))) / this.size;\n this.nextPanelSize = (100 * (this.horizontal ? getOuterWidth(this.nextPanelElement, true) : getOuterHeight(this.nextPanelElement, true))) / this.size;\n }\n\n this.prevPanelIndex = index;\n this.$emit('resizestart', { originalEvent: event, sizes: this.panelSizes });\n this.$refs.gutter[index].setAttribute('data-p-gutter-resizing', true);\n this.$el.setAttribute('data-p-resizing', true);\n },\n onResize(event, step, isKeyDown) {\n let newPos, newPrevPanelSize, newNextPanelSize;\n\n if (isKeyDown) {\n if (this.horizontal) {\n newPrevPanelSize = (100 * (this.prevPanelSize + step)) / this.size;\n newNextPanelSize = (100 * (this.nextPanelSize - step)) / this.size;\n } else {\n newPrevPanelSize = (100 * (this.prevPanelSize - step)) / this.size;\n newNextPanelSize = (100 * (this.nextPanelSize + step)) / this.size;\n }\n } else {\n if (this.horizontal) {\n if (isRTL(this.$el)) {\n newPos = ((this.startPos - event.pageX) * 100) / this.size;\n } else {\n newPos = ((event.pageX - this.startPos) * 100) / this.size;\n }\n } else {\n newPos = ((event.pageY - this.startPos) * 100) / this.size;\n }\n\n newPrevPanelSize = this.prevPanelSize + newPos;\n newNextPanelSize = this.nextPanelSize - newPos;\n }\n\n if (!this.validateResize(newPrevPanelSize, newNextPanelSize)) {\n newPrevPanelSize = Math.min(Math.max(this.prevPanelMinSize, newPrevPanelSize), 100 - this.nextPanelMinSize);\n newNextPanelSize = Math.min(Math.max(this.nextPanelMinSize, newNextPanelSize), 100 - this.prevPanelMinSize);\n }\n\n this.prevPanelElement.style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';\n this.nextPanelElement.style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';\n this.panelSizes[this.prevPanelIndex] = newPrevPanelSize;\n this.panelSizes[this.prevPanelIndex + 1] = newNextPanelSize;\n this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);\n\n this.$emit('resize', { originalEvent: event, sizes: this.panelSizes });\n },\n onResizeEnd(event) {\n if (this.isStateful()) {\n this.saveState();\n }\n\n this.$emit('resizeend', { originalEvent: event, sizes: this.panelSizes });\n this.$refs.gutter.forEach((gutter) => gutter.setAttribute('data-p-gutter-resizing', false));\n this.$el.setAttribute('data-p-resizing', false);\n this.clear();\n },\n repeat(event, index, step) {\n this.onResizeStart(event, index, true);\n this.onResize(event, step, true);\n },\n setTimer(event, index, step) {\n if (!this.timer) {\n this.timer = setInterval(() => {\n this.repeat(event, index, step);\n }, 40);\n }\n },\n clearTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n },\n onGutterKeyUp() {\n this.clearTimer();\n this.onResizeEnd();\n },\n onGutterKeyDown(event, index) {\n switch (event.code) {\n case 'ArrowLeft': {\n if (this.layout === 'horizontal') {\n this.setTimer(event, index, this.step * -1);\n }\n\n event.preventDefault();\n break;\n }\n\n case 'ArrowRight': {\n if (this.layout === 'horizontal') {\n this.setTimer(event, index, this.step);\n }\n\n event.preventDefault();\n break;\n }\n\n case 'ArrowDown': {\n if (this.layout === 'vertical') {\n this.setTimer(event, index, this.step * -1);\n }\n\n event.preventDefault();\n break;\n }\n\n case 'ArrowUp': {\n if (this.layout === 'vertical') {\n this.setTimer(event, index, this.step);\n }\n\n event.preventDefault();\n break;\n }\n\n default:\n //no op\n break;\n }\n },\n onGutterMouseDown(event, index) {\n this.onResizeStart(event, index);\n this.bindMouseListeners();\n },\n onGutterTouchStart(event, index) {\n this.onResizeStart(event, index);\n this.bindTouchListeners();\n event.preventDefault();\n },\n onGutterTouchMove(event) {\n this.onResize(event);\n event.preventDefault();\n },\n onGutterTouchEnd(event) {\n this.onResizeEnd(event);\n this.unbindTouchListeners();\n event.preventDefault();\n },\n bindMouseListeners() {\n if (!this.mouseMoveListener) {\n this.mouseMoveListener = (event) => this.onResize(event);\n document.addEventListener('mousemove', this.mouseMoveListener);\n }\n\n if (!this.mouseUpListener) {\n this.mouseUpListener = (event) => {\n this.onResizeEnd(event);\n this.unbindMouseListeners();\n };\n\n document.addEventListener('mouseup', this.mouseUpListener);\n }\n },\n bindTouchListeners() {\n if (!this.touchMoveListener) {\n this.touchMoveListener = (event) => this.onResize(event.changedTouches[0]);\n document.addEventListener('touchmove', this.touchMoveListener);\n }\n\n if (!this.touchEndListener) {\n this.touchEndListener = (event) => {\n this.resizeEnd(event);\n this.unbindTouchListeners();\n };\n\n document.addEventListener('touchend', this.touchEndListener);\n }\n },\n validateResize(newPrevPanelSize, newNextPanelSize) {\n if (newPrevPanelSize > 100 || newPrevPanelSize < 0) return false;\n if (newNextPanelSize > 100 || newNextPanelSize < 0) return false;\n\n if (this.prevPanelMinSize > newPrevPanelSize) {\n return false;\n }\n\n if (this.nextPanelMinSize > newNextPanelSize) {\n return false;\n }\n\n return true;\n },\n unbindMouseListeners() {\n if (this.mouseMoveListener) {\n document.removeEventListener('mousemove', this.mouseMoveListener);\n this.mouseMoveListener = null;\n }\n\n if (this.mouseUpListener) {\n document.removeEventListener('mouseup', this.mouseUpListener);\n this.mouseUpListener = null;\n }\n },\n unbindTouchListeners() {\n if (this.touchMoveListener) {\n document.removeEventListener('touchmove', this.touchMoveListener);\n this.touchMoveListener = null;\n }\n\n if (this.touchEndListener) {\n document.removeEventListener('touchend', this.touchEndListener);\n this.touchEndListener = null;\n }\n },\n clear() {\n this.dragging = false;\n this.size = null;\n this.startPos = null;\n this.prevPanelElement = null;\n this.nextPanelElement = null;\n this.prevPanelSize = null;\n this.nextPanelSize = null;\n this.gutterElement = null;\n this.prevPanelIndex = null;\n },\n isStateful() {\n return this.stateKey != null;\n },\n getStorage() {\n switch (this.stateStorage) {\n case 'local':\n return window.localStorage;\n\n case 'session':\n return window.sessionStorage;\n\n default:\n throw new Error(this.stateStorage + ' is not a valid value for the state storage, supported values are \"local\" and \"session\".');\n }\n },\n saveState() {\n if (isArray(this.panelSizes)) {\n this.getStorage().setItem(this.stateKey, JSON.stringify(this.panelSizes));\n }\n },\n restoreState() {\n const storage = this.getStorage();\n const stateString = storage.getItem(this.stateKey);\n\n if (stateString) {\n this.panelSizes = JSON.parse(stateString);\n let children = [...this.$el.children].filter((child) => child.getAttribute('data-pc-name') === 'splitterpanel');\n\n children.forEach((child, i) => {\n child.style.flexBasis = 'calc(' + this.panelSizes[i] + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';\n });\n\n return true;\n }\n\n return false;\n },\n resetState() {\n this.initializePanels();\n }\n },\n computed: {\n panels() {\n const panels = [];\n\n this.$slots.default().forEach((child) => {\n if (this.isSplitterPanel(child)) {\n panels.push(child);\n } else if (child.children instanceof Array) {\n child.children.forEach((nestedChild) => {\n if (this.isSplitterPanel(nestedChild)) {\n panels.push(nestedChild);\n }\n });\n }\n });\n\n return panels;\n },\n gutterStyle() {\n if (this.horizontal) return { width: this.gutterSize + 'px' };\n else return { height: this.gutterSize + 'px' };\n },\n horizontal() {\n return this.layout === 'horizontal';\n },\n getPTOptions() {\n return {\n context: {\n nested: this.$parentInstance?.nestedState\n }\n };\n },\n prevPanelMinSize() {\n const prevPanelMinSize = getVNodeProp(this.panels[this.prevPanelIndex], 'minSize');\n\n if (this.panels[this.prevPanelIndex].props && prevPanelMinSize) {\n return prevPanelMinSize;\n }\n\n return 0;\n },\n nextPanelMinSize() {\n const nextPanelMinSize = getVNodeProp(this.panels[this.prevPanelIndex + 1], 'minSize');\n\n if (this.panels[this.prevPanelIndex + 1].props && nextPanelMinSize) {\n return nextPanelMinSize;\n }\n\n return 0;\n },\n dataP() {\n return cn({\n [this.layout]: this.layout,\n nested: this.$parentInstance?.nestedState != null\n });\n }\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :style=\"sx('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 = panelInitialSize || 100 / this.panels.length;\n\n _panelSizes[i] = panelSize;\n children[i].style.flexBasis = 'calc(' + panelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';\n });\n\n this.panelSizes = _panelSizes;\n this.prevSize = parseFloat(_panelSizes[0]).toFixed(4);\n }\n }\n },\n onResizeStart(event, index, isKeyDown) {\n this.gutterElement = event.currentTarget || event.target.parentElement;\n this.size = this.horizontal ? getWidth(this.$el) : getHeight(this.$el);\n\n if (!isKeyDown) {\n this.dragging = true;\n this.startPos = this.layout === 'horizontal' ? event.pageX || event.changedTouches[0].pageX : event.pageY || event.changedTouches[0].pageY;\n }\n\n this.prevPanelElement = this.gutterElement.previousElementSibling;\n this.nextPanelElement = this.gutterElement.nextElementSibling;\n\n if (isKeyDown) {\n this.prevPanelSize = this.horizontal ? getOuterWidth(this.prevPanelElement, true) : getOuterHeight(this.prevPanelElement, true);\n this.nextPanelSize = this.horizontal ? getOuterWidth(this.nextPanelElement, true) : getOuterHeight(this.nextPanelElement, true);\n } else {\n this.prevPanelSize = (100 * (this.horizontal ? getOuterWidth(this.prevPanelElement, true) : getOuterHeight(this.prevPanelElement, true))) / this.size;\n this.nextPanelSize = (100 * (this.horizontal ? getOuterWidth(this.nextPanelElement, true) : getOuterHeight(this.nextPanelElement, true))) / this.size;\n }\n\n this.prevPanelIndex = index;\n this.$emit('resizestart', { originalEvent: event, sizes: this.panelSizes });\n this.$refs.gutter[index].setAttribute('data-p-gutter-resizing', true);\n this.$el.setAttribute('data-p-resizing', true);\n },\n onResize(event, step, isKeyDown) {\n let newPos, newPrevPanelSize, newNextPanelSize;\n\n if (isKeyDown) {\n if (this.horizontal) {\n newPrevPanelSize = (100 * (this.prevPanelSize + step)) / this.size;\n newNextPanelSize = (100 * (this.nextPanelSize - step)) / this.size;\n } else {\n newPrevPanelSize = (100 * (this.prevPanelSize - step)) / this.size;\n newNextPanelSize = (100 * (this.nextPanelSize + step)) / this.size;\n }\n } else {\n if (this.horizontal) {\n if (isRTL(this.$el)) {\n newPos = ((this.startPos - event.pageX) * 100) / this.size;\n } else {\n newPos = ((event.pageX - this.startPos) * 100) / this.size;\n }\n } else {\n newPos = ((event.pageY - this.startPos) * 100) / this.size;\n }\n\n newPrevPanelSize = this.prevPanelSize + newPos;\n newNextPanelSize = this.nextPanelSize - newPos;\n }\n\n if (!this.validateResize(newPrevPanelSize, newNextPanelSize)) {\n newPrevPanelSize = Math.min(Math.max(this.prevPanelMinSize, newPrevPanelSize), 100 - this.nextPanelMinSize);\n newNextPanelSize = Math.min(Math.max(this.nextPanelMinSize, newNextPanelSize), 100 - this.prevPanelMinSize);\n }\n\n this.prevPanelElement.style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';\n this.nextPanelElement.style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';\n this.panelSizes[this.prevPanelIndex] = newPrevPanelSize;\n this.panelSizes[this.prevPanelIndex + 1] = newNextPanelSize;\n this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);\n\n this.$emit('resize', { originalEvent: event, sizes: this.panelSizes });\n },\n onResizeEnd(event) {\n if (this.isStateful()) {\n this.saveState();\n }\n\n this.$emit('resizeend', { originalEvent: event, sizes: this.panelSizes });\n this.$refs.gutter.forEach((gutter) => gutter.setAttribute('data-p-gutter-resizing', false));\n this.$el.setAttribute('data-p-resizing', false);\n this.clear();\n },\n repeat(event, index, step) {\n this.onResizeStart(event, index, true);\n this.onResize(event, step, true);\n },\n setTimer(event, index, step) {\n if (!this.timer) {\n this.timer = setInterval(() => {\n this.repeat(event, index, step);\n }, 40);\n }\n },\n clearTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n },\n onGutterKeyUp() {\n this.clearTimer();\n this.onResizeEnd();\n },\n onGutterKeyDown(event, index) {\n switch (event.code) {\n case 'ArrowLeft': {\n if (this.layout === 'horizontal') {\n this.setTimer(event, index, this.step * -1);\n }\n\n event.preventDefault();\n break;\n }\n\n case 'ArrowRight': {\n if (this.layout === 'horizontal') {\n this.setTimer(event, index, this.step);\n }\n\n event.preventDefault();\n break;\n }\n\n case 'ArrowDown': {\n if (this.layout === 'vertical') {\n this.setTimer(event, index, this.step * -1);\n }\n\n event.preventDefault();\n break;\n }\n\n case 'ArrowUp': {\n if (this.layout === 'vertical') {\n this.setTimer(event, index, this.step);\n }\n\n event.preventDefault();\n break;\n }\n\n default:\n //no op\n break;\n }\n },\n onGutterMouseDown(event, index) {\n this.onResizeStart(event, index);\n this.bindMouseListeners();\n },\n onGutterTouchStart(event, index) {\n this.onResizeStart(event, index);\n this.bindTouchListeners();\n event.preventDefault();\n },\n onGutterTouchMove(event) {\n this.onResize(event);\n event.preventDefault();\n },\n onGutterTouchEnd(event) {\n this.onResizeEnd(event);\n this.unbindTouchListeners();\n event.preventDefault();\n },\n bindMouseListeners() {\n if (!this.mouseMoveListener) {\n this.mouseMoveListener = (event) => this.onResize(event);\n document.addEventListener('mousemove', this.mouseMoveListener);\n }\n\n if (!this.mouseUpListener) {\n this.mouseUpListener = (event) => {\n this.onResizeEnd(event);\n this.unbindMouseListeners();\n };\n\n document.addEventListener('mouseup', this.mouseUpListener);\n }\n },\n bindTouchListeners() {\n if (!this.touchMoveListener) {\n this.touchMoveListener = (event) => this.onResize(event.changedTouches[0]);\n document.addEventListener('touchmove', this.touchMoveListener);\n }\n\n if (!this.touchEndListener) {\n this.touchEndListener = (event) => {\n this.resizeEnd(event);\n this.unbindTouchListeners();\n };\n\n document.addEventListener('touchend', this.touchEndListener);\n }\n },\n validateResize(newPrevPanelSize, newNextPanelSize) {\n if (newPrevPanelSize > 100 || newPrevPanelSize < 0) return false;\n if (newNextPanelSize > 100 || newNextPanelSize < 0) return false;\n\n if (this.prevPanelMinSize > newPrevPanelSize) {\n return false;\n }\n\n if (this.nextPanelMinSize > newNextPanelSize) {\n return false;\n }\n\n return true;\n },\n unbindMouseListeners() {\n if (this.mouseMoveListener) {\n document.removeEventListener('mousemove', this.mouseMoveListener);\n this.mouseMoveListener = null;\n }\n\n if (this.mouseUpListener) {\n document.removeEventListener('mouseup', this.mouseUpListener);\n this.mouseUpListener = null;\n }\n },\n unbindTouchListeners() {\n if (this.touchMoveListener) {\n document.removeEventListener('touchmove', this.touchMoveListener);\n this.touchMoveListener = null;\n }\n\n if (this.touchEndListener) {\n document.removeEventListener('touchend', this.touchEndListener);\n this.touchEndListener = null;\n }\n },\n clear() {\n this.dragging = false;\n this.size = null;\n this.startPos = null;\n this.prevPanelElement = null;\n this.nextPanelElement = null;\n this.prevPanelSize = null;\n this.nextPanelSize = null;\n this.gutterElement = null;\n this.prevPanelIndex = null;\n },\n isStateful() {\n return this.stateKey != null;\n },\n getStorage() {\n switch (this.stateStorage) {\n case 'local':\n return window.localStorage;\n\n case 'session':\n return window.sessionStorage;\n\n default:\n throw new Error(this.stateStorage + ' is not a valid value for the state storage, supported values are \"local\" and \"session\".');\n }\n },\n saveState() {\n if (isArray(this.panelSizes)) {\n this.getStorage().setItem(this.stateKey, JSON.stringify(this.panelSizes));\n }\n },\n restoreState() {\n const storage = this.getStorage();\n const stateString = storage.getItem(this.stateKey);\n\n if (stateString) {\n this.panelSizes = JSON.parse(stateString);\n let children = [...this.$el.children].filter((child) => child.getAttribute('data-pc-name') === 'splitterpanel');\n\n children.forEach((child, i) => {\n child.style.flexBasis = 'calc(' + this.panelSizes[i] + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';\n });\n\n return true;\n }\n\n return false;\n },\n resetState() {\n this.initializePanels();\n }\n },\n computed: {\n panels() {\n const panels = [];\n\n this.$slots.default().forEach((child) => {\n if (this.isSplitterPanel(child)) {\n panels.push(child);\n } else if (child.children instanceof Array) {\n child.children.forEach((nestedChild) => {\n if (this.isSplitterPanel(nestedChild)) {\n panels.push(nestedChild);\n }\n });\n }\n });\n\n return panels;\n },\n gutterStyle() {\n if (this.horizontal) return { width: this.gutterSize + 'px' };\n else return { height: this.gutterSize + 'px' };\n },\n horizontal() {\n return this.layout === 'horizontal';\n },\n getPTOptions() {\n return {\n context: {\n nested: this.$parentInstance?.nestedState\n }\n };\n },\n prevPanelMinSize() {\n const prevPanelMinSize = getVNodeProp(this.panels[this.prevPanelIndex], 'minSize');\n\n if (this.panels[this.prevPanelIndex].props && prevPanelMinSize) {\n return prevPanelMinSize;\n }\n\n return 0;\n },\n nextPanelMinSize() {\n const nextPanelMinSize = getVNodeProp(this.panels[this.prevPanelIndex + 1], 'minSize');\n\n if (this.panels[this.prevPanelIndex + 1].props && nextPanelMinSize) {\n return nextPanelMinSize;\n }\n\n return 0;\n },\n dataP() {\n return cn({\n [this.layout]: this.layout,\n nested: this.$parentInstance?.nestedState != null\n });\n }\n }\n};\n</script>\n"],"names":["name","BaseComponent","props","layout","type","String","gutterSize","Number","stateKey","stateStorage","step","style","SplitterStyle","provide","$pcSplitter","$parentInstance","BaseSplitter","inheritAttrs","emits","dragging","mouseMoveListener","mouseUpListener","touchMoveListener","touchEndListener","size","gutterElement","startPos","prevPanelElement","nextPanelElement","nextPanelSize","prevPanelSize","panelSizes","prevPanelIndex","timer","data","prevSize","mounted","initializePanels","beforeUnmount","clear","unbindMouseListeners","methods","isSplitterPanel","child","_this","panels","length","initialized","isStateful","restoreState","children","_toConsumableArray","$el","filter","getAttribute","_panelSizes","map","panel","i","panelInitialSize","isNotEmpty","panelSize","flexBasis","parseFloat","toFixed","onResizeStart","event","index","isKeyDown","currentTarget","target","parentElement","horizontal","getWidth","getHeight","pageX","changedTouches","pageY","previousElementSibling","nextElementSibling","getOuterWidth","getOuterHeight","$emit","originalEvent","sizes","$refs","gutter","setAttribute","onResize","newPos","newPrevPanelSize","newNextPanelSize","isRTL","validateResize","Math","min","max","prevPanelMinSize","nextPanelMinSize","onResizeEnd","saveState","forEach","repeat","setTimer","_this2","setInterval","clearTimer","clearInterval","onGutterKeyUp","onGutterKeyDown","code","preventDefault","onGutterMouseDown","bindMouseListeners","onGutterTouchStart","bindTouchListeners","onGutterTouchMove","onGutterTouchEnd","unbindTouchListeners","_this3","document","addEventListener","_this4","resizeEnd","removeEventListener","getStorage","window","localStorage","sessionStorage","Error","isArray","setItem","JSON","stringify","_this5","storage","stateString","getItem","parse","resetState","computed","_this6","$slots","push","Array","nestedChild","gutterStyle","width","height","getPTOptions","_this$$parentInstance","context","nested","nestedState","getVNodeProp","dataP","_this$$parentInstance2","cn","_defineProperty","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","sx","$options","ptmi","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","tabindex","ref","role","onMousedown","$event","onTouchstart","onTouchmove","onTouchend","ptm","_createElementVNode","$data","onKeyup","apply","arguments","onKeydown","_hoisted_3"],"mappings":";;;;;;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,cAAc;AACpB,EAAA,SAAA,EAASC,aAAa;AACtBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,MAAM,EAAE;AACJC,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDC,IAAAA,UAAU,EAAE;AACRF,MAAAA,IAAI,EAAEG,MAAM;MACZ,SAAS,EAAA;KACZ;AACDC,IAAAA,QAAQ,EAAE;AACNJ,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDI,IAAAA,YAAY,EAAE;AACVL,MAAAA,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