@thebuoyant-tsdev/mui-ts-library 3.27.0 → 3.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.de.md +25 -1
- package/README.md +25 -1
- package/dist/components/gantt-chart/GanttChart.js +127 -127
- package/dist/components/gantt-chart/GanttTaskPanel.js +2 -0
- package/dist/components/sql-editor/SqlEditor.js +65 -37
- package/dist/components/sql-editor/SqlEditorContent.d.ts +2 -1
- package/dist/components/sql-editor/SqlEditorContent.js +66 -60
- package/dist/components/sql-editor/SqlEditorToolbar.js +4 -4
- package/dist/index.cjs +2 -2
- package/package.json +1 -1
package/README.de.md
CHANGED
|
@@ -191,7 +191,7 @@ import { RichTextEditor } from '@thebuoyant-tsdev/mui-ts-library';
|
|
|
191
191
|
|
|
192
192
|
### SqlEditor
|
|
193
193
|
|
|
194
|
-
SQL-Code-Editor mit Syntax-Highlighting, dialektbewusstem Autocomplete und Inline-Linting. Konzipiert für Developer-Tools, Datenbank-Clients und Admin-Panels — mit `Cmd+Enter
|
|
194
|
+
SQL-Code-Editor mit Syntax-Highlighting, dialektbewusstem Autocomplete und Inline-Linting. Konzipiert für Developer-Tools, Datenbank-Clients und Admin-Panels — mit `Cmd+Enter` (Ausführen) und `Shift+Alt+F` (SQL formatieren) als Tastenkürzel, Multi-Dialekt-Support (MySQL, PostgreSQL, SQLite, MSSQL) und Schema-basiertem Autocomplete.
|
|
195
195
|
|
|
196
196
|
```tsx
|
|
197
197
|
import { SqlEditor } from '@thebuoyant-tsdev/mui-ts-library';
|
|
@@ -483,6 +483,30 @@ Dieses Projekt folgt [Semantic Versioning](https://semver.org/):
|
|
|
483
483
|
|
|
484
484
|
## Changelog
|
|
485
485
|
|
|
486
|
+
### [Unveröffentlicht]
|
|
487
|
+
|
|
488
|
+
**Hinzugefügt**
|
|
489
|
+
- `SqlEditor`: `Shift+Alt+F` Tastenkürzel — löst den vorhandenen SQL-Format-Button direkt aus dem Editor heraus aus (respektiert `readonly` und `toolbarConfig.showFormat`). Keine API-Änderung.
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
|
|
493
|
+
### [3.27.1] — 2026-07-14
|
|
494
|
+
|
|
495
|
+
**Behoben**
|
|
496
|
+
- `GanttChart`: Das linke Task-Panel kann nicht mehr so schmal gezogen werden, dass Spalten-Header überlappen oder Inhalte überlaufen. Der Trenner erzwingt nun eine spaltenbasierte Mindestbreite (Status + Aktionen + optionaler Assignee + 80 px für den Namen). Zeilen- und Header-Container schneiden Inhalte sauber mit `overflow: hidden` ab. Keine API-Änderung.
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
500
|
+
### [3.27.0] — 2026-07-14
|
|
501
|
+
|
|
502
|
+
**Hinzugefügt**
|
|
503
|
+
- Hover-Callbacks für alle 6 D3-Charts (`onSegmentHover`, `onGroupHover`, `onChordHover`, `onNodeHover`, `onCircleHover`, `onBarHover`) — feuern mit typisiertem Info-Objekt bei `mouseenter`, `null` bei `mouseleave`. Ermöglicht Linked-View-Muster. Alle Props optional, vollständig abwärtskompatibel.
|
|
504
|
+
|
|
505
|
+
**Behoben**
|
|
506
|
+
- `GanttChart`: `showAssigneeColumn={true}` lässt die Name-Spalte nicht mehr auf ~24 px zusammenfallen. Die initiale Panel-Breite addiert nun automatisch `ASSIGNEE_COL_WIDTH` (110 px) wenn die Spalte aktiviert ist.
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
486
510
|
### [3.26.1] — 2026-07-13
|
|
487
511
|
|
|
488
512
|
**Behoben**
|
package/README.md
CHANGED
|
@@ -191,7 +191,7 @@ import { RichTextEditor } from '@thebuoyant-tsdev/mui-ts-library';
|
|
|
191
191
|
|
|
192
192
|
### SqlEditor
|
|
193
193
|
|
|
194
|
-
SQL code editor with syntax highlighting, dialect-aware autocomplete, and inline linting. Designed for developer tools, database clients, and admin panels where users write and execute SQL queries — with `Cmd+Enter`
|
|
194
|
+
SQL code editor with syntax highlighting, dialect-aware autocomplete, and inline linting. Designed for developer tools, database clients, and admin panels where users write and execute SQL queries — with `Cmd+Enter` (Execute) and `Shift+Alt+F` (Format SQL) shortcuts, multi-dialect support (MySQL, PostgreSQL, SQLite, MSSQL), and schema-based autocomplete.
|
|
195
195
|
|
|
196
196
|
```tsx
|
|
197
197
|
import { SqlEditor } from '@thebuoyant-tsdev/mui-ts-library';
|
|
@@ -483,6 +483,30 @@ This project follows [Semantic Versioning](https://semver.org/):
|
|
|
483
483
|
|
|
484
484
|
## Changelog
|
|
485
485
|
|
|
486
|
+
### [Unreleased]
|
|
487
|
+
|
|
488
|
+
**Added**
|
|
489
|
+
- `SqlEditor`: `Shift+Alt+F` keyboard shortcut — triggers the existing SQL Format button directly from the editor (respects `readonly` and `toolbarConfig.showFormat`). No API change.
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
|
|
493
|
+
### [3.27.1] — 2026-07-14
|
|
494
|
+
|
|
495
|
+
**Fixed**
|
|
496
|
+
- `GanttChart`: The left task panel can no longer be dragged so narrow that column headers overlap or content overflows. The divider now enforces a column-aware minimum width (Status + Actions + optional Assignee + 80 px for the name). Row and header containers clip cleanly with `overflow: hidden`. No API change.
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
500
|
+
### [3.27.0] — 2026-07-14
|
|
501
|
+
|
|
502
|
+
**Added**
|
|
503
|
+
- Hover callbacks for all 6 D3 charts (`onSegmentHover`, `onGroupHover`, `onChordHover`, `onNodeHover`, `onCircleHover`, `onBarHover`) — fire with typed info on `mouseenter`, `null` on `mouseleave`. Enables linked-view patterns. All props optional, fully backwards compatible.
|
|
504
|
+
|
|
505
|
+
**Fixed**
|
|
506
|
+
- `GanttChart`: `showAssigneeColumn={true}` no longer collapses the name column to ~24 px. Initial panel width now auto-adds `ASSIGNEE_COL_WIDTH` (110 px) when the column is enabled.
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
486
510
|
### [3.26.1] — 2026-07-13
|
|
487
511
|
|
|
488
512
|
**Fixed**
|
|
@@ -4,39 +4,39 @@ import { DEFAULT_GANTT_TRANSLATIONS as r } from "./GanttChart.types.js";
|
|
|
4
4
|
import { GanttTaskPanel as i } from "./GanttTaskPanel.js";
|
|
5
5
|
import { GanttTimeline as a } from "./GanttTimeline.js";
|
|
6
6
|
import { GanttToolbar as o } from "./GanttToolbar.js";
|
|
7
|
-
import { createContext as s, useCallback as c, useContext as l, useEffect as u, useMemo as d, useRef as f, useState as
|
|
8
|
-
import { Box as
|
|
9
|
-
import { jsx as
|
|
10
|
-
import { useStore as
|
|
7
|
+
import { createContext as s, useCallback as c, useContext as l, useEffect as u, useMemo as d, useRef as f, useState as ee } from "react";
|
|
8
|
+
import { Box as p } from "@mui/material";
|
|
9
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
+
import { useStore as g } from "zustand";
|
|
11
11
|
//#region src/components/gantt-chart/GanttChart.tsx
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
let t = l(
|
|
12
|
+
var _ = s(null);
|
|
13
|
+
function v(e) {
|
|
14
|
+
let t = l(_);
|
|
15
15
|
if (!t) throw Error("GanttChartStoreContext is missing.");
|
|
16
|
-
return
|
|
16
|
+
return g(t, e);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
let e = l(
|
|
18
|
+
function y() {
|
|
19
|
+
let e = l(_);
|
|
20
20
|
if (!e) throw Error("GanttChartStoreContext is missing.");
|
|
21
21
|
return e;
|
|
22
22
|
}
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
return l(
|
|
23
|
+
var b = s(r);
|
|
24
|
+
function x() {
|
|
25
|
+
return l(b);
|
|
26
26
|
}
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return l(
|
|
27
|
+
var S = s({});
|
|
28
|
+
function C() {
|
|
29
|
+
return l(S);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function w(e, t) {
|
|
32
32
|
return e === void 0 ? t : e === "auto" ? "100%" : typeof e == "string" && /^\d+$/.test(e) ? Number(e) : e;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var T = [
|
|
35
35
|
"days",
|
|
36
36
|
"weeks",
|
|
37
37
|
"months",
|
|
38
38
|
"quarters"
|
|
39
|
-
],
|
|
39
|
+
], E = {
|
|
40
40
|
showScaleDays: !0,
|
|
41
41
|
showScaleWeeks: !0,
|
|
42
42
|
showScaleMonths: !0,
|
|
@@ -49,12 +49,12 @@ var E = [
|
|
|
49
49
|
showExportCSV: !1,
|
|
50
50
|
showAssigneeFilter: !1
|
|
51
51
|
};
|
|
52
|
-
function
|
|
53
|
-
let
|
|
54
|
-
...
|
|
52
|
+
function D({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEditTask: l, onDeleteTask: g, onStatusChange: _, onTasksChange: b, enableBuiltinDialogs: x = !0, onTaskCreated: S, onTaskUpdated: C, onTaskDeleted: D, showToolbar: O = !0, toolbarConfig: k, height: A, width: j, minPanelWidth: M = 200, maxPanelWidth: N = 600, zoomable: P = !1, draggable: F = !1, resizable: te = !1, inlineEdit: ne = !1, progressDraggable: re = !1, showCriticalPath: ie = !1, virtualizeRows: I = !1, showAssigneeColumn: L = !1, onExportCSV: R, onDragStart: z, onTaskMoved: B, onTaskResized: V }) {
|
|
53
|
+
let H = w(A, 400), U = d(() => ({
|
|
54
|
+
...E,
|
|
55
55
|
...k
|
|
56
|
-
}), [k]),
|
|
57
|
-
let e =
|
|
56
|
+
}), [k]), W = w(j, "100%"), G = v((e) => e.setTasks), K = v((e) => e.timeScale), q = v((e) => e.setTimeScale), J = v((e) => e.timelineRange), Y = f(null), X = f(null), Z = f(!1), [Q, ae] = ee(320 + (L ? 110 : 0)), oe = Math.max(M, 90 + (x || s || l || g ? 96 : 0) + (L ? 110 : 0) + 80), $ = y(), se = c(() => {
|
|
57
|
+
let e = $.getState().tasks, t = [[
|
|
58
58
|
"id",
|
|
59
59
|
"name",
|
|
60
60
|
"status",
|
|
@@ -79,93 +79,93 @@ function ee({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEdi
|
|
|
79
79
|
(e.dependencies ?? []).join(";"),
|
|
80
80
|
e.color ?? ""
|
|
81
81
|
].join(","))].join("\n");
|
|
82
|
-
if (
|
|
82
|
+
if (R) R(t, e);
|
|
83
83
|
else {
|
|
84
84
|
let e = new Blob([t], { type: "text/csv;charset=utf-8;" }), n = URL.createObjectURL(e), r = document.createElement("a");
|
|
85
85
|
r.href = n, r.download = "gantt-tasks.csv", r.click(), URL.revokeObjectURL(n);
|
|
86
86
|
}
|
|
87
|
-
}, [
|
|
87
|
+
}, [$, R]);
|
|
88
88
|
u(() => {
|
|
89
|
-
|
|
90
|
-
}, [t,
|
|
91
|
-
let
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
if (!
|
|
97
|
-
let t = e(
|
|
98
|
-
|
|
99
|
-
}, [
|
|
89
|
+
G(t);
|
|
90
|
+
}, [t, G]);
|
|
91
|
+
let ce = () => {
|
|
92
|
+
Z.current ||= (Z.current = !0, X.current && Y.current && (X.current.scrollTop = Y.current.scrollTop), !1);
|
|
93
|
+
}, le = () => {
|
|
94
|
+
Z.current ||= (Z.current = !0, Y.current && X.current && (Y.current.scrollTop = X.current.scrollTop), !1);
|
|
95
|
+
}, ue = c(() => {
|
|
96
|
+
if (!X.current) return;
|
|
97
|
+
let t = e(J, K), n = Date.now(), r = t.start.getTime(), i = t.end.getTime(), a = (n - r) / (i - r) * X.current.scrollWidth;
|
|
98
|
+
X.current.scrollLeft = Math.max(0, a - X.current.clientWidth / 2);
|
|
99
|
+
}, [J, K]);
|
|
100
100
|
u(() => {
|
|
101
|
-
if (!
|
|
102
|
-
let e =
|
|
101
|
+
if (!P || !X.current) return;
|
|
102
|
+
let e = X.current, t = (e) => {
|
|
103
103
|
if (!e.ctrlKey) return;
|
|
104
104
|
e.preventDefault();
|
|
105
|
-
let t =
|
|
106
|
-
e.deltaY < 0 && t > 0 ?
|
|
105
|
+
let t = T.indexOf(K);
|
|
106
|
+
e.deltaY < 0 && t > 0 ? q(T[t - 1]) : e.deltaY > 0 && t < T.length - 1 && q(T[t + 1]);
|
|
107
107
|
};
|
|
108
108
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
109
109
|
}, [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
P,
|
|
111
|
+
K,
|
|
112
|
+
q
|
|
113
113
|
]);
|
|
114
|
-
let
|
|
114
|
+
let de = c((e) => {
|
|
115
115
|
e.preventDefault();
|
|
116
|
-
let t = e.clientX, n =
|
|
116
|
+
let t = e.clientX, n = Q, r = (e) => {
|
|
117
117
|
let r = e.clientX - t;
|
|
118
|
-
|
|
118
|
+
ae(Math.max(oe, Math.min(N, n + r)));
|
|
119
119
|
}, i = () => {
|
|
120
120
|
document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
121
121
|
};
|
|
122
122
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
123
123
|
}, [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
Q,
|
|
125
|
+
oe,
|
|
126
|
+
N
|
|
127
127
|
]);
|
|
128
|
-
return /* @__PURE__ */
|
|
128
|
+
return /* @__PURE__ */ h(p, {
|
|
129
129
|
sx: {
|
|
130
130
|
display: "flex",
|
|
131
131
|
flexDirection: "column",
|
|
132
|
-
height:
|
|
133
|
-
width:
|
|
132
|
+
height: H,
|
|
133
|
+
width: W,
|
|
134
134
|
border: "1px solid",
|
|
135
135
|
borderColor: "divider",
|
|
136
136
|
borderRadius: 1,
|
|
137
137
|
overflow: "hidden"
|
|
138
138
|
},
|
|
139
|
-
children: [O && /* @__PURE__ */
|
|
140
|
-
onScrollToToday:
|
|
141
|
-
config:
|
|
142
|
-
onExportCSV:
|
|
143
|
-
}), /* @__PURE__ */
|
|
139
|
+
children: [O && /* @__PURE__ */ m(o, {
|
|
140
|
+
onScrollToToday: ue,
|
|
141
|
+
config: U,
|
|
142
|
+
onExportCSV: U.showExportCSV ? se : void 0
|
|
143
|
+
}), /* @__PURE__ */ h(p, {
|
|
144
144
|
sx: {
|
|
145
145
|
display: "flex",
|
|
146
146
|
flex: 1,
|
|
147
147
|
overflow: "hidden"
|
|
148
148
|
},
|
|
149
149
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
scrollRef:
|
|
152
|
-
onScroll:
|
|
153
|
-
panelWidth:
|
|
150
|
+
/* @__PURE__ */ m(i, {
|
|
151
|
+
scrollRef: Y,
|
|
152
|
+
onScroll: ce,
|
|
153
|
+
panelWidth: Q,
|
|
154
154
|
onTaskClick: n,
|
|
155
155
|
onAddTask: s,
|
|
156
156
|
onEditTask: l,
|
|
157
|
-
onDeleteTask:
|
|
158
|
-
onStatusChange:
|
|
159
|
-
onTasksChange:
|
|
160
|
-
enableBuiltinDialogs:
|
|
161
|
-
onTaskCreated:
|
|
162
|
-
onTaskUpdated:
|
|
163
|
-
onTaskDeleted:
|
|
164
|
-
inlineEdit:
|
|
165
|
-
virtualizeRows:
|
|
166
|
-
showAssigneeColumn:
|
|
157
|
+
onDeleteTask: g,
|
|
158
|
+
onStatusChange: _,
|
|
159
|
+
onTasksChange: b,
|
|
160
|
+
enableBuiltinDialogs: x,
|
|
161
|
+
onTaskCreated: S,
|
|
162
|
+
onTaskUpdated: C,
|
|
163
|
+
onTaskDeleted: D,
|
|
164
|
+
inlineEdit: ne,
|
|
165
|
+
virtualizeRows: I,
|
|
166
|
+
showAssigneeColumn: L
|
|
167
167
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ m(p, {
|
|
169
169
|
"data-testid": "gantt-panel-divider",
|
|
170
170
|
sx: {
|
|
171
171
|
width: 4,
|
|
@@ -174,88 +174,88 @@ function ee({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEdi
|
|
|
174
174
|
cursor: "col-resize",
|
|
175
175
|
"&:hover": { bgcolor: "action.hover" }
|
|
176
176
|
},
|
|
177
|
-
onMouseDown:
|
|
177
|
+
onMouseDown: de
|
|
178
178
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
scrollRef:
|
|
181
|
-
onScroll:
|
|
179
|
+
/* @__PURE__ */ m(a, {
|
|
180
|
+
scrollRef: X,
|
|
181
|
+
onScroll: le,
|
|
182
182
|
onTaskClick: n,
|
|
183
183
|
onMilestoneClick: r,
|
|
184
|
-
draggable:
|
|
185
|
-
resizable:
|
|
186
|
-
progressDraggable:
|
|
187
|
-
showCriticalPath:
|
|
188
|
-
virtualizeRows:
|
|
189
|
-
onDragStart:
|
|
190
|
-
onTaskMoved:
|
|
191
|
-
onTaskResized:
|
|
192
|
-
onTasksChange:
|
|
193
|
-
onStatusChange:
|
|
184
|
+
draggable: F,
|
|
185
|
+
resizable: te,
|
|
186
|
+
progressDraggable: re,
|
|
187
|
+
showCriticalPath: ie,
|
|
188
|
+
virtualizeRows: I,
|
|
189
|
+
onDragStart: z,
|
|
190
|
+
onTaskMoved: B,
|
|
191
|
+
onTaskResized: V,
|
|
192
|
+
onTasksChange: b,
|
|
193
|
+
onStatusChange: _
|
|
194
194
|
})
|
|
195
195
|
]
|
|
196
196
|
})]
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
|
-
function O({ tasks: e, timeScale: i = "months", initialExpandAll: a = !1, showToolbar: o = !0, defaultRangeStart: s, defaultRangeEnd: c, translations: l, enableBuiltinDialogs: u = !0, toolbarConfig: f, zoomable:
|
|
200
|
-
let
|
|
199
|
+
function O({ tasks: e, timeScale: i = "months", initialExpandAll: a = !1, showToolbar: o = !0, defaultRangeStart: s, defaultRangeEnd: c, translations: l, enableBuiltinDialogs: u = !0, toolbarConfig: f, zoomable: p = !1, draggable: h = !1, resizable: g = !1, inlineEdit: v = !1, progressDraggable: y = !1, showCriticalPath: x = !1, virtualizeRows: C = !1, showAssigneeColumn: w = !1, cascadeDependencies: T = !1, statusColors: E, ganttTheme: O, onExportCSV: k, onDragStart: A, onTaskClick: j, onMilestoneClick: M, onAddTask: N, onEditTask: P, onDeleteTask: F, onStatusChange: te, onTasksChange: ne, onTaskMoved: re, onTaskResized: ie, onTaskCreated: I, onTaskUpdated: L, onTaskDeleted: R, height: z, width: B, minPanelWidth: V, maxPanelWidth: H }) {
|
|
200
|
+
let U = d(() => ({
|
|
201
201
|
...r,
|
|
202
202
|
...l
|
|
203
|
-
}), [l]), [
|
|
204
|
-
if (!(s !== void 0 || c !== void 0)) return n(e, i, a, void 0,
|
|
203
|
+
}), [l]), [W] = ee(() => {
|
|
204
|
+
if (!(s !== void 0 || c !== void 0)) return n(e, i, a, void 0, T);
|
|
205
205
|
let r = t(e);
|
|
206
206
|
return n(e, i, a, {
|
|
207
207
|
start: s ?? r.start,
|
|
208
208
|
end: c ?? r.end
|
|
209
|
-
},
|
|
210
|
-
}),
|
|
209
|
+
}, T);
|
|
210
|
+
}), G = d(() => ({
|
|
211
211
|
...O,
|
|
212
212
|
statusColors: {
|
|
213
|
-
...
|
|
213
|
+
...E,
|
|
214
214
|
...O?.statusColors
|
|
215
215
|
}
|
|
216
|
-
}), [
|
|
217
|
-
return /* @__PURE__ */
|
|
218
|
-
value:
|
|
219
|
-
children: /* @__PURE__ */
|
|
220
|
-
value:
|
|
221
|
-
children: /* @__PURE__ */
|
|
222
|
-
value:
|
|
223
|
-
children: /* @__PURE__ */
|
|
216
|
+
}), [E, O]);
|
|
217
|
+
return /* @__PURE__ */ m(b.Provider, {
|
|
218
|
+
value: U,
|
|
219
|
+
children: /* @__PURE__ */ m(S.Provider, {
|
|
220
|
+
value: G,
|
|
221
|
+
children: /* @__PURE__ */ m(_.Provider, {
|
|
222
|
+
value: W,
|
|
223
|
+
children: /* @__PURE__ */ m(D, {
|
|
224
224
|
tasks: e,
|
|
225
225
|
timeScale: i,
|
|
226
226
|
enableBuiltinDialogs: u,
|
|
227
227
|
showToolbar: o,
|
|
228
228
|
toolbarConfig: f,
|
|
229
|
-
zoomable:
|
|
230
|
-
draggable:
|
|
231
|
-
resizable:
|
|
232
|
-
inlineEdit:
|
|
233
|
-
progressDraggable:
|
|
234
|
-
showCriticalPath:
|
|
235
|
-
virtualizeRows:
|
|
236
|
-
showAssigneeColumn:
|
|
229
|
+
zoomable: p,
|
|
230
|
+
draggable: h,
|
|
231
|
+
resizable: g,
|
|
232
|
+
inlineEdit: v,
|
|
233
|
+
progressDraggable: y,
|
|
234
|
+
showCriticalPath: x,
|
|
235
|
+
virtualizeRows: C,
|
|
236
|
+
showAssigneeColumn: w,
|
|
237
237
|
onExportCSV: k,
|
|
238
238
|
onDragStart: A,
|
|
239
|
-
onTaskClick:
|
|
240
|
-
onMilestoneClick:
|
|
241
|
-
onAddTask:
|
|
242
|
-
onEditTask:
|
|
243
|
-
onDeleteTask:
|
|
244
|
-
onStatusChange:
|
|
245
|
-
onTasksChange:
|
|
246
|
-
onTaskMoved:
|
|
247
|
-
onTaskResized:
|
|
248
|
-
onTaskCreated:
|
|
249
|
-
onTaskUpdated:
|
|
250
|
-
onTaskDeleted:
|
|
251
|
-
height:
|
|
252
|
-
width:
|
|
253
|
-
minPanelWidth:
|
|
254
|
-
maxPanelWidth:
|
|
239
|
+
onTaskClick: j,
|
|
240
|
+
onMilestoneClick: M,
|
|
241
|
+
onAddTask: N,
|
|
242
|
+
onEditTask: P,
|
|
243
|
+
onDeleteTask: F,
|
|
244
|
+
onStatusChange: te,
|
|
245
|
+
onTasksChange: ne,
|
|
246
|
+
onTaskMoved: re,
|
|
247
|
+
onTaskResized: ie,
|
|
248
|
+
onTaskCreated: I,
|
|
249
|
+
onTaskUpdated: L,
|
|
250
|
+
onTaskDeleted: R,
|
|
251
|
+
height: z,
|
|
252
|
+
width: B,
|
|
253
|
+
minPanelWidth: V,
|
|
254
|
+
maxPanelWidth: H
|
|
255
255
|
})
|
|
256
256
|
})
|
|
257
257
|
})
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
|
-
export { O as GanttChart,
|
|
261
|
+
export { O as GanttChart, v as useGanttChartStore, C as useGanttTheme, x as useGanttTranslations, y as useRawGanttChartStore };
|
|
@@ -31,6 +31,7 @@ function T({ task: e, expandedIds: t, toggleExpand: i, hasActionsColumn: a, show
|
|
|
31
31
|
height: 40,
|
|
32
32
|
display: "flex",
|
|
33
33
|
alignItems: "center",
|
|
34
|
+
overflow: "hidden",
|
|
34
35
|
borderBottom: "1px solid",
|
|
35
36
|
borderRight: "1px solid",
|
|
36
37
|
borderColor: "divider",
|
|
@@ -312,6 +313,7 @@ function E({ scrollRef: n, onScroll: r, panelWidth: ee, onTaskClick: f, onAddTas
|
|
|
312
313
|
height: 40,
|
|
313
314
|
display: "flex",
|
|
314
315
|
alignItems: "center",
|
|
316
|
+
overflow: "hidden",
|
|
315
317
|
borderBottom: P === "days" ? "1px solid" : void 0,
|
|
316
318
|
borderColor: P === "days" ? "divider" : void 0
|
|
317
319
|
},
|
|
@@ -2,78 +2,105 @@ import { normalizeSize as e } from "../shared/normalizeSize.js";
|
|
|
2
2
|
import { DEFAULT_SQL_EDITOR_TOOLBAR_CONFIG as t, DEFAULT_SQL_EDITOR_TRANSLATION as n } from "./SqlEditor.types.js";
|
|
3
3
|
import { SqlEditorContent as r } from "./SqlEditorContent.js";
|
|
4
4
|
import { SqlEditorToolbar as i } from "./SqlEditorToolbar.js";
|
|
5
|
-
import { SqlEditorFooter as
|
|
6
|
-
import { useSqlQueryHistory as
|
|
7
|
-
import { useCallback as s, useRef as c, useState as l } from "react";
|
|
8
|
-
import { Box as u, Divider as d, Paper as
|
|
9
|
-
import { Fragment as
|
|
5
|
+
import { SqlEditorFooter as ee } from "./SqlEditorFooter.js";
|
|
6
|
+
import { useSqlQueryHistory as a } from "./useSqlQueryHistory.js";
|
|
7
|
+
import { useCallback as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
8
|
+
import { Box as u, Divider as d, Paper as te } from "@mui/material";
|
|
9
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
import { format as h } from "sql-formatter";
|
|
10
11
|
//#region src/components/sql-editor/SqlEditor.tsx
|
|
11
|
-
|
|
12
|
+
var ne = {
|
|
13
|
+
standard: "sql",
|
|
14
|
+
mysql: "mysql",
|
|
15
|
+
postgresql: "postgresql",
|
|
16
|
+
sqlite: "sqlite",
|
|
17
|
+
mssql: "tsql"
|
|
18
|
+
};
|
|
19
|
+
function g({ value: g, onChange: _, placeholder: re, height: v, width: y, disabled: b = !1, readonly: x = !1, error: S = !1, helperText: C, name: w, dialect: T = "standard", showLineNumbers: E = !0, showLineColumn: D = !0, showErrorCount: O = !1, toolbarConfig: k, translation: A, highlightColors: j, schema: M, queryHistoryKey: N = "sql-editor-query-history", queryHistoryMaxEntries: P = 20, onExecute: F, onLint: I, onBlur: L, onFocus: R }) {
|
|
12
20
|
let z = {
|
|
13
21
|
...n,
|
|
14
22
|
...A
|
|
15
23
|
}, B = {
|
|
16
24
|
...t,
|
|
17
25
|
...k
|
|
18
|
-
}, { history:
|
|
26
|
+
}, { history: V, addEntry: H, clearHistory: U } = a(N, P), W = e(v), G = e(y), K = W === "auto", q = K ? void 0 : W ?? 300, J = c(null), [Y, X] = l(null), [Z, ie] = l({
|
|
19
27
|
line: 1,
|
|
20
28
|
col: 1
|
|
21
|
-
}), [
|
|
22
|
-
|
|
23
|
-
}, []),
|
|
24
|
-
|
|
29
|
+
}), [ae, Q] = l(0), oe = o((e) => {
|
|
30
|
+
J.current = e, X(e);
|
|
31
|
+
}, []), se = o((e, t) => {
|
|
32
|
+
ie({
|
|
25
33
|
line: e,
|
|
26
34
|
col: t
|
|
27
35
|
});
|
|
28
|
-
}, []),
|
|
29
|
-
|
|
36
|
+
}, []), ce = o((e) => {
|
|
37
|
+
Q(e);
|
|
30
38
|
}, []), $ = F ? (e) => {
|
|
31
|
-
|
|
32
|
-
} : void 0,
|
|
33
|
-
|
|
39
|
+
H(e), F(e);
|
|
40
|
+
} : void 0, le = s(() => {
|
|
41
|
+
if (!(x || !B.showFormat)) return () => {
|
|
42
|
+
let e = J.current;
|
|
43
|
+
if (!e) return;
|
|
44
|
+
let t = e.state.doc.toString();
|
|
45
|
+
try {
|
|
46
|
+
let n = h(t, { language: ne[T] });
|
|
47
|
+
e.dispatch({ changes: {
|
|
48
|
+
from: 0,
|
|
49
|
+
to: e.state.doc.length,
|
|
50
|
+
insert: n
|
|
51
|
+
} });
|
|
52
|
+
} catch {}
|
|
53
|
+
e.focus();
|
|
54
|
+
};
|
|
55
|
+
}, [
|
|
56
|
+
T,
|
|
57
|
+
x,
|
|
58
|
+
B.showFormat
|
|
59
|
+
]), ue = o((e) => {
|
|
60
|
+
let t = J.current;
|
|
34
61
|
t && (t.dispatch({ changes: {
|
|
35
62
|
from: 0,
|
|
36
63
|
to: t.state.doc.length,
|
|
37
64
|
insert: e
|
|
38
65
|
} }), t.focus()), _?.(e);
|
|
39
|
-
}, [_]),
|
|
40
|
-
return /* @__PURE__ */
|
|
66
|
+
}, [_]), de = D || O || !!C;
|
|
67
|
+
return /* @__PURE__ */ m(u, {
|
|
41
68
|
sx: {
|
|
42
|
-
width:
|
|
43
|
-
...
|
|
69
|
+
width: G ?? "100%",
|
|
70
|
+
...K ? {
|
|
44
71
|
display: "flex",
|
|
45
72
|
flexDirection: "column",
|
|
46
73
|
flex: 1
|
|
47
74
|
} : {}
|
|
48
75
|
},
|
|
49
76
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ m(te, {
|
|
51
78
|
variant: "outlined",
|
|
52
79
|
sx: {
|
|
53
80
|
display: "flex",
|
|
54
81
|
flexDirection: "column",
|
|
55
82
|
overflow: "hidden",
|
|
56
|
-
...
|
|
83
|
+
...K ? { flex: 1 } : { height: q },
|
|
57
84
|
borderColor: S ? "error.main" : void 0,
|
|
58
85
|
"&:focus-within": {
|
|
59
86
|
borderColor: S ? "error.main" : "primary.main",
|
|
60
87
|
borderWidth: 2
|
|
61
88
|
}
|
|
62
89
|
},
|
|
63
|
-
children: [!x && /* @__PURE__ */
|
|
64
|
-
editorView:
|
|
90
|
+
children: [!x && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(i, {
|
|
91
|
+
editorView: Y,
|
|
65
92
|
toolbarConfig: B,
|
|
66
93
|
translation: z,
|
|
67
94
|
dialect: T,
|
|
68
95
|
disabled: b,
|
|
69
96
|
onExecute: $,
|
|
70
|
-
queryHistory:
|
|
71
|
-
onSelectHistoryEntry:
|
|
72
|
-
onClearHistory:
|
|
73
|
-
}), /* @__PURE__ */
|
|
97
|
+
queryHistory: V,
|
|
98
|
+
onSelectHistoryEntry: ue,
|
|
99
|
+
onClearHistory: U
|
|
100
|
+
}), /* @__PURE__ */ p(d, {})] }), /* @__PURE__ */ p(r, {
|
|
74
101
|
value: g,
|
|
75
102
|
onChange: _,
|
|
76
|
-
placeholder:
|
|
103
|
+
placeholder: re,
|
|
77
104
|
disabled: b,
|
|
78
105
|
readonly: x,
|
|
79
106
|
showLineNumbers: E,
|
|
@@ -83,25 +110,26 @@ function g({ value: g, onChange: _, placeholder: ee, height: v, width: y, disabl
|
|
|
83
110
|
identifierColor: j?.identifier,
|
|
84
111
|
schema: M,
|
|
85
112
|
onExecute: $,
|
|
113
|
+
onFormat: le,
|
|
86
114
|
onLint: I,
|
|
87
|
-
onDiagnosticsChange: I ?
|
|
88
|
-
onViewReady:
|
|
89
|
-
onCursorChange:
|
|
115
|
+
onDiagnosticsChange: I ? ce : void 0,
|
|
116
|
+
onViewReady: oe,
|
|
117
|
+
onCursorChange: se,
|
|
90
118
|
onBlur: L,
|
|
91
119
|
onFocus: R
|
|
92
120
|
})]
|
|
93
121
|
}),
|
|
94
|
-
|
|
122
|
+
de && /* @__PURE__ */ p(ee, {
|
|
95
123
|
helperText: C,
|
|
96
124
|
error: S,
|
|
97
125
|
showLineColumn: D,
|
|
98
126
|
showErrorCount: O,
|
|
99
|
-
diagnosticsCount:
|
|
100
|
-
cursorLine:
|
|
101
|
-
cursorCol:
|
|
127
|
+
diagnosticsCount: ae,
|
|
128
|
+
cursorLine: Z.line,
|
|
129
|
+
cursorCol: Z.col,
|
|
102
130
|
translation: z
|
|
103
131
|
}),
|
|
104
|
-
w && /* @__PURE__ */
|
|
132
|
+
w && /* @__PURE__ */ p("input", {
|
|
105
133
|
type: "hidden",
|
|
106
134
|
name: w,
|
|
107
135
|
value: g ?? ""
|
|
@@ -13,6 +13,7 @@ type SqlEditorContentProps = {
|
|
|
13
13
|
identifierColor?: string;
|
|
14
14
|
schema?: SqlSchema;
|
|
15
15
|
onExecute?: (sql: string) => void;
|
|
16
|
+
onFormat?: () => void;
|
|
16
17
|
onLint?: (sql: string) => Promise<SqlLintError[]> | SqlLintError[];
|
|
17
18
|
onDiagnosticsChange?: (count: number) => void;
|
|
18
19
|
onViewReady: (view: EditorView | null) => void;
|
|
@@ -20,5 +21,5 @@ type SqlEditorContentProps = {
|
|
|
20
21
|
onBlur?: () => void;
|
|
21
22
|
onFocus?: () => void;
|
|
22
23
|
};
|
|
23
|
-
export declare function SqlEditorContent({ value, onChange, placeholder, disabled, readonly, showLineNumbers, dialect, keywordColor, stringColor, identifierColor, schema, onExecute, onLint, onDiagnosticsChange, onViewReady, onCursorChange, onBlur, onFocus, }: SqlEditorContentProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function SqlEditorContent({ value, onChange, placeholder, disabled, readonly, showLineNumbers, dialect, keywordColor, stringColor, identifierColor, schema, onExecute, onFormat, onLint, onDiagnosticsChange, onViewReady, onCursorChange, onBlur, onFocus, }: SqlEditorContentProps): import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export {};
|