|
457 | 457 | <!-- CHART MODAL -->
|
458 | 458 | <div class="vue-ui-table-chart-modal" v-if="showChart && canChart"
|
459 | 459 | :style="`width: ${modalWidth}px;top:${clientY}px; left:${clientX}px;background:${FINAL_CONFIG.style.chart.modal.backgroundColor};color:${FINAL_CONFIG.style.chart.modal.color}`">
|
| 460 | + <div class="modal-drag-handle" @mousedown="dragMouseDown"> |
| 461 | + <!-- Your modal title or drag icon here --> |
| 462 | + <span v-html="icons.grip"/> |
| 463 | + <button class="close-chart-modal" @click="showChart = false">✖</button> |
| 464 | + </div> |
460 | 465 | <button style="z-index: 1" class="close-chart-modal" @click="showChart = false"
|
461 | 466 | :style="`background:${FINAL_CONFIG.style.closeButtons.backgroundColor};color:${FINAL_CONFIG.style.closeButtons.color};border-radius:${FINAL_CONFIG.style.closeButtons.borderRadius}`">
|
462 | 467 | ✖
|
|
474 | 479 | :style="`background:${chart.type === constants.BAR && !showDonutOptions ? FINAL_CONFIG.style.chart.modal.buttons.selected.backgroundColor : FINAL_CONFIG.style.chart.modal.buttons.unselected.backgroundColor};color:${chart.type === constants.BAR && !showDonutOptions ? FINAL_CONFIG.style.chart.modal.buttons.selected.color : FINAL_CONFIG.style.chart.modal.buttons.unselected.color}`" />
|
475 | 480 | </div>
|
476 | 481 |
|
477 |
| - <div style="width:100%; height: fit-content; cursor:move" ref="chartModal"> |
| 482 | + <div style="width:100%; height: fit-content" ref="chartModal"> |
478 | 483 | <!-- DONUT OPTIONS -->
|
479 | 484 | <div v-if="showDonutOptions && availableDonutCategories.length"
|
480 | 485 | :style="`background:${FINAL_CONFIG.style.chart.modal.backgroundColor};color:${FINAL_CONFIG.style.chart.modal.color}`">
|
@@ -685,8 +690,6 @@ export default {
|
685 | 690 | if (hasChart) {
|
686 | 691 | this.$nextTick(() => {
|
687 | 692 | this.closeDragElement();
|
688 |
| - const chart = this.$refs.chartModal; |
689 |
| - chart.onmousedown = this.dragMouseDown; |
690 | 693 | })
|
691 | 694 | }
|
692 | 695 | },
|
@@ -817,6 +820,7 @@ export default {
|
817 | 820 | grid: {
|
818 | 821 | stroke: lightenHexColor(textColor, 0.5),
|
819 | 822 | labels: {
|
| 823 | + color: textColor, |
820 | 824 | xAxisLabels: { show: false },
|
821 | 825 | }
|
822 | 826 | },
|
@@ -1009,7 +1013,8 @@ export default {
|
1009 | 1013 | sortZA: `<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 21v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4" /><path d="M19 10h-4l4 -7h-4" /><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /></svg>`,
|
1010 | 1014 | sum: `<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>`,
|
1011 | 1015 | table: `<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" fill="white" d="M 10 2, 21 2, 21 21, 10 21Z"/><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" /><path d="M3 10h18" /><path d="M10 3v18" /></svg>`,
|
1012 |
| - warning: `<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize * 0.8}" height="${this.iconSize * 0.8}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z" /><path d="M12 9v4" /><path d="M12 17h.01" /></svg>` |
| 1016 | + warning: `<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize * 0.8}" height="${this.iconSize * 0.8}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z" /><path d="M12 9v4" /><path d="M12 17h.01" /></svg>`, |
| 1017 | + grip: `<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M5 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M5 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg>` |
1013 | 1018 | }
|
1014 | 1019 | },
|
1015 | 1020 | pages() {
|
@@ -1750,7 +1755,7 @@ export default {
|
1750 | 1755 | const chartModal = this.$refs.chartModal;
|
1751 | 1756 | const rect = chartModal.getBoundingClientRect();
|
1752 | 1757 | this.clientX = e.clientX - this.dragOffsetX;
|
1753 |
| - this.clientY = e.clientY - this.dragOffsetY; |
| 1758 | + this.clientY = e.clientY - this.dragOffsetY - 40; |
1754 | 1759 | if (this.clientX < 0) this.clientX = 0;
|
1755 | 1760 | if (this.clientX + rect.width > window.innerWidth) this.clientX = window.innerWidth - rect.width - 48
|
1756 | 1761 | if (this.clientY < 0) this.clientY = 0;
|
@@ -2376,6 +2381,14 @@ button.th-reset:not(:disabled) {
|
2376 | 2381 | color: white;
|
2377 | 2382 | }
|
2378 | 2383 |
|
| 2384 | +.vue-ui-table-chart-modal .modal-drag-handle { |
| 2385 | + cursor: move; |
| 2386 | + user-select: none; |
| 2387 | + display: flex; |
| 2388 | + align-items: center; |
| 2389 | + justify-content: space-between; |
| 2390 | +} |
| 2391 | +
|
2379 | 2392 | @keyframes open-dropdown {
|
2380 | 2393 | 0% {
|
2381 | 2394 | transform: scale(1, 0.9);
|
|
0 commit comments