@thebuoyant-tsdev/mui-ts-library 1.3.1 → 1.4.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 +5 -34
- package/README.md +6 -35
- package/dist/components/confirm-dialog/ConfirmDialog.types.d.ts +4 -4
- package/dist/components/gantt-chart/GanttBarRow.d.ts +24 -0
- package/dist/components/gantt-chart/GanttChart.constants.d.ts +4 -0
- package/dist/components/gantt-chart/GanttChart.types.d.ts +23 -23
- package/dist/components/gantt-chart/GanttDependencyArrows.d.ts +22 -0
- package/dist/components/gantt-chart/GanttStatusContextMenu.d.ts +19 -0
- package/dist/components/gantt-chart/GanttWeekendStrips.d.ts +17 -0
- package/dist/components/gantt-chart/hooks/useGanttDrag.d.ts +44 -0
- package/dist/components/json-editor/JsonEditor.types.d.ts +13 -13
- package/dist/components/password-strength-meter/PasswordStrengthBar.d.ts +12 -0
- package/dist/components/password-strength-meter/PasswordStrengthMeter.types.d.ts +9 -9
- package/dist/components/rich-text-editor/RichTextEditor.d.ts +1 -1
- package/dist/components/rich-text-editor/RichTextEditor.types.d.ts +23 -13
- package/dist/components/rich-text-editor/RichTextEditorFooter.d.ts +3 -1
- package/dist/components/rich-text-editor/RichTextEditorToolbar.d.ts +3 -1
- package/dist/components/shared/ToolbarButton.d.ts +13 -0
- package/dist/components/shared/normalizeSize.d.ts +11 -0
- package/dist/components/sql-editor/SqlEditor.types.d.ts +15 -15
- package/dist/components/tag-selection/TagSelection.types.d.ts +11 -11
- package/dist/index.cjs +1 -1
- package/dist/index.js +1174 -1066
- package/package.json +1 -1
package/README.de.md
CHANGED
|
@@ -14,7 +14,7 @@ Eine typsichere React-Komponentenbibliothek auf Basis von **TypeScript** und **M
|
|
|
14
14
|
| [`GanttChart`](#ganttchart) | Projekt-Timeline mit hierarchischen Aufgaben, Meilensteinen, Drag & Drop, Zoom und integrierten CRUD-Dialogen | [Vollständiges Manual →](user-manuals/GanttChart.de.md) |
|
|
15
15
|
| [`TagSelection`](#tagselection) | Multi-Tag-Auswahlfeld mit Autocomplete, freier Tag-Erstellung, Overflow-Chips und MUI-Theme-Farben | [Vollständiges Manual →](user-manuals/TagSelection.de.md) |
|
|
16
16
|
| [`PasswordStrengthMeter`](#passwordstrengthmeter) | Passwort-Eingabe mit animiertem Stärke-Meter und Anforderungsliste | [Vollständiges Manual →](user-manuals/PasswordStrengthMeter.de.md) |
|
|
17
|
-
| [`RichTextEditor`](#richtexteditor) | WYSIWYG-Editor (TipTap v3) mit Toolbar, Link-Dialog, Textfarbe, Hervorhebung und Markdown-Einfügen | [Vollständiges Manual →](user-manuals/RichTextEditor.de.md) |
|
|
17
|
+
| [`RichTextEditor`](#richtexteditor) | WYSIWYG-Editor (TipTap v3) mit Toolbar, Link-Dialog, Textfarbe, Hervorhebung, Wörter-Zähler, Vollbild-Modus und Markdown-Einfügen | [Vollständiges Manual →](user-manuals/RichTextEditor.de.md) |
|
|
18
18
|
| [`SqlEditor`](#sqleditor) | SQL-Code-Editor (CodeMirror 6) mit Syntax-Highlighting, Multi-Dialekt, Autocomplete und Linting | [Vollständiges Manual →](user-manuals/SqlEditor.de.md) |
|
|
19
19
|
| [`JsonEditor`](#jsoneditor) | JSON-Code-Editor (CodeMirror 6) mit Echtzeit-Validierung, Format- und Komprimieren-Schaltfläche | [Vollständiges Manual →](user-manuals/JsonEditor.de.md) |
|
|
20
20
|
|
|
@@ -22,42 +22,13 @@ Eine typsichere React-Komponentenbibliothek auf Basis von **TypeScript** und **M
|
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
24
24
|
|
|
25
|
-
### Schritt 1 —
|
|
26
|
-
|
|
27
|
-
Dieses Repository klonen und ausführen:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm install
|
|
31
|
-
npm run pack-release
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Dieser Befehl baut die Bibliothek und legt eine fertige Paketdatei im Ordner `releases/` ab:
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
releases/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Diese Datei per Slack, E-Mail oder Netzlaufwerk an das Team weitergeben.
|
|
41
|
-
|
|
42
|
-
### Schritt 2 — Im eigenen Projekt installieren
|
|
43
|
-
|
|
44
|
-
Ein Terminal im **eigenen React-Projekt** öffnen und ausführen:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm install /pfad/zur/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Beispiele:**
|
|
25
|
+
### Schritt 1 — Bibliothek installieren
|
|
51
26
|
|
|
52
27
|
```bash
|
|
53
|
-
|
|
54
|
-
npm install ~/Downloads/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
|
|
55
|
-
|
|
56
|
-
# Datei liegt im Nachbarordner des Projekts
|
|
57
|
-
npm install ../thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
|
|
28
|
+
npm install @thebuoyant-tsdev/mui-ts-library
|
|
58
29
|
```
|
|
59
30
|
|
|
60
|
-
### Schritt
|
|
31
|
+
### Schritt 2 — Peer-Dependencies installieren
|
|
61
32
|
|
|
62
33
|
Falls MUI noch nicht im Projekt vorhanden ist:
|
|
63
34
|
|
|
@@ -65,7 +36,7 @@ Falls MUI noch nicht im Projekt vorhanden ist:
|
|
|
65
36
|
npm install react@^19 react-dom@^19 @mui/material@^9 @emotion/react @emotion/styled @mui/icons-material@^9
|
|
66
37
|
```
|
|
67
38
|
|
|
68
|
-
### Schritt
|
|
39
|
+
### Schritt 3 — Fertig
|
|
69
40
|
|
|
70
41
|
Beliebige Komponente importieren — TypeScript-Typen sind automatisch verfügbar:
|
|
71
42
|
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ A type-safe React component library built on **TypeScript** and **MUI (Material
|
|
|
14
14
|
| [`GanttChart`](#ganttchart) | Project timeline with hierarchical tasks, milestones, drag & drop, zoom, and built-in CRUD dialogs | [Full Manual →](user-manuals/GanttChart.md) |
|
|
15
15
|
| [`TagSelection`](#tagselection) | Multi-tag selector with autocomplete, free tag creation, overflow chips, and MUI theme colors | [Full Manual →](user-manuals/TagSelection.md) |
|
|
16
16
|
| [`PasswordStrengthMeter`](#passwordstrengthmeter) | Password input with animated strength meter and requirements checklist | [Full Manual →](user-manuals/PasswordStrengthMeter.md) |
|
|
17
|
-
| [`RichTextEditor`](#richtexteditor) | WYSIWYG editor (TipTap v3) with toolbar, link dialog, text color, highlight, and Markdown paste | [Full Manual →](user-manuals/RichTextEditor.md) |
|
|
17
|
+
| [`RichTextEditor`](#richtexteditor) | WYSIWYG editor (TipTap v3) with toolbar, link dialog, text color, highlight, word count, fullscreen mode, and Markdown paste | [Full Manual →](user-manuals/RichTextEditor.md) |
|
|
18
18
|
| [`SqlEditor`](#sqleditor) | SQL code editor (CodeMirror 6) with syntax highlighting, multi-dialect, autocomplete, and linting | [Full Manual →](user-manuals/SqlEditor.md) |
|
|
19
19
|
| [`JsonEditor`](#jsoneditor) | JSON code editor (CodeMirror 6) with real-time validation, Format, and Compact buttons | [Full Manual →](user-manuals/JsonEditor.md) |
|
|
20
20
|
|
|
@@ -22,42 +22,13 @@ A type-safe React component library built on **TypeScript** and **MUI (Material
|
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
24
24
|
|
|
25
|
-
### Step 1 —
|
|
26
|
-
|
|
27
|
-
Clone this repository and run:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm install
|
|
31
|
-
npm run pack-release
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
This builds the library and places a ready-to-use package file in the `releases/` folder:
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
releases/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Share this file with your team via Slack, email, or a network drive.
|
|
41
|
-
|
|
42
|
-
### Step 2 — Install in your project
|
|
43
|
-
|
|
44
|
-
Open a terminal in **your own React project** and run:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm install /path/to/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Examples:**
|
|
25
|
+
### Step 1 — Install the library
|
|
51
26
|
|
|
52
27
|
```bash
|
|
53
|
-
|
|
54
|
-
npm install ~/Downloads/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
|
|
55
|
-
|
|
56
|
-
# File is next to your project folder
|
|
57
|
-
npm install ../thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
|
|
28
|
+
npm install @thebuoyant-tsdev/mui-ts-library
|
|
58
29
|
```
|
|
59
30
|
|
|
60
|
-
### Step
|
|
31
|
+
### Step 2 — Install peer dependencies
|
|
61
32
|
|
|
62
33
|
If your project doesn't have MUI set up yet:
|
|
63
34
|
|
|
@@ -65,9 +36,9 @@ If your project doesn't have MUI set up yet:
|
|
|
65
36
|
npm install react@^19 react-dom@^19 @mui/material@^9 @emotion/react @emotion/styled @mui/icons-material@^9
|
|
66
37
|
```
|
|
67
38
|
|
|
68
|
-
### Step
|
|
39
|
+
### Step 3 — Done
|
|
69
40
|
|
|
70
|
-
Import any component
|
|
41
|
+
Import any component — TypeScript types are included automatically:
|
|
71
42
|
|
|
72
43
|
```tsx
|
|
73
44
|
import { GanttChart, JsonEditor, useConfirm } from '@thebuoyant-tsdev/mui-ts-library';
|
|
@@ -6,14 +6,14 @@ export type ConfirmDialogTranslation = {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const DEFAULT_CONFIRM_DIALOG_TRANSLATION: ConfirmDialogTranslation;
|
|
8
8
|
export type ConfirmDialogOptions = {
|
|
9
|
-
title?: string;
|
|
10
|
-
description?: string | React.ReactNode;
|
|
11
|
-
confirmLabel?: string;
|
|
12
9
|
cancelLabel?: string;
|
|
13
|
-
|
|
10
|
+
confirmLabel?: string;
|
|
11
|
+
description?: string | React.ReactNode;
|
|
14
12
|
hideCancelButton?: boolean;
|
|
15
13
|
maxWidth?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
14
|
+
severity?: ConfirmDialogSeverity;
|
|
16
15
|
showIcon?: boolean;
|
|
16
|
+
title?: string;
|
|
17
17
|
};
|
|
18
18
|
export type ConfirmDialogProviderProps = {
|
|
19
19
|
children: React.ReactNode;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GanttTask, GanttTaskNode } from "./GanttChart.types";
|
|
2
|
+
import type { TimelineRange } from "./util/gantt-chart.util";
|
|
3
|
+
import type { ActiveDrag, DragType } from "./hooks/useGanttDrag";
|
|
4
|
+
type GanttBarRowProps = {
|
|
5
|
+
task: GanttTaskNode;
|
|
6
|
+
virtualTop?: number;
|
|
7
|
+
activeDrag: ActiveDrag | null;
|
|
8
|
+
displayRange: TimelineRange;
|
|
9
|
+
totalWidth: number;
|
|
10
|
+
gridColumnWidth: number;
|
|
11
|
+
criticalTaskIds: Set<string>;
|
|
12
|
+
draggable?: boolean;
|
|
13
|
+
resizable?: boolean;
|
|
14
|
+
progressDraggable?: boolean;
|
|
15
|
+
onTaskClick?: (task: GanttTask) => void;
|
|
16
|
+
onMilestoneClick?: (task: GanttTask) => void;
|
|
17
|
+
onContextMenu: (task: GanttTaskNode, mouseX: number, mouseY: number) => void;
|
|
18
|
+
suppressClickRef: React.MutableRefObject<boolean>;
|
|
19
|
+
handleBarMouseDown: (e: React.MouseEvent, task: GanttTaskNode, type: DragType) => void;
|
|
20
|
+
handleProgressMouseDown: (e: React.MouseEvent, task: GanttTaskNode, initialProgress: number, barWidthPx: number) => void;
|
|
21
|
+
formatDragDate: (d: Date) => string;
|
|
22
|
+
};
|
|
23
|
+
export declare function GanttBarRow({ task, virtualTop, activeDrag, displayRange, totalWidth, gridColumnWidth, criticalTaskIds, draggable, resizable, progressDraggable, onTaskClick, onMilestoneClick, onContextMenu, suppressClickRef, handleBarMouseDown, handleProgressMouseDown, formatDragDate, }: GanttBarRowProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -9,3 +9,7 @@ export declare const BAR_HEIGHT = 16;
|
|
|
9
9
|
export declare const STATUS_COL_WIDTH = 90;
|
|
10
10
|
export declare const ACTIONS_COL_WIDTH = 96;
|
|
11
11
|
export declare const DIVIDER_WIDTH = 4;
|
|
12
|
+
/** MUI-Farb-Token für Balken und Status-Punkte (bgcolor-kompatibel) */
|
|
13
|
+
export declare const STATUS_BAR_COLOR: Record<string, string>;
|
|
14
|
+
/** MUI-Chip-Color-Werte für den Status-Chip im Task-Panel */
|
|
15
|
+
export declare const STATUS_CHIP_COLOR: Record<string, "default" | "warning" | "info" | "success" | "error">;
|
|
@@ -79,41 +79,41 @@ export type GanttToolbarConfig = {
|
|
|
79
79
|
showResetView?: boolean;
|
|
80
80
|
};
|
|
81
81
|
export type GanttChartProps = {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
cascadeDependencies?: boolean;
|
|
83
|
+
defaultRangeEnd?: Date;
|
|
84
|
+
defaultRangeStart?: Date;
|
|
85
|
+
draggable?: boolean;
|
|
86
|
+
enableBuiltinDialogs?: boolean;
|
|
87
|
+
ganttTheme?: GanttTheme;
|
|
84
88
|
/** Höhe des Charts. "auto" = 100 % des Eltern-Containers. Standard: 400. */
|
|
85
89
|
height?: number | string;
|
|
86
|
-
/** Breite des Charts. "auto" = 100 % des Eltern-Containers. Standard: "100%". */
|
|
87
|
-
width?: number | string;
|
|
88
90
|
initialExpandAll?: boolean;
|
|
89
|
-
|
|
90
|
-
toolbarConfig?: GanttToolbarConfig;
|
|
91
|
-
defaultRangeStart?: Date;
|
|
92
|
-
defaultRangeEnd?: Date;
|
|
93
|
-
translations?: Partial<GanttTranslations>;
|
|
94
|
-
minPanelWidth?: number;
|
|
91
|
+
inlineEdit?: boolean;
|
|
95
92
|
maxPanelWidth?: number;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
draggable?: boolean;
|
|
93
|
+
minPanelWidth?: number;
|
|
94
|
+
progressDraggable?: boolean;
|
|
99
95
|
resizable?: boolean;
|
|
100
|
-
cascadeDependencies?: boolean;
|
|
101
96
|
showCriticalPath?: boolean;
|
|
102
|
-
|
|
103
|
-
progressDraggable?: boolean;
|
|
104
|
-
virtualizeRows?: boolean;
|
|
97
|
+
showToolbar?: boolean;
|
|
105
98
|
statusColors?: GanttStatusColors;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
tasks: GanttTask[];
|
|
100
|
+
timeScale?: GanttTimeScale;
|
|
101
|
+
toolbarConfig?: GanttToolbarConfig;
|
|
102
|
+
translations?: Partial<GanttTranslations>;
|
|
103
|
+
virtualizeRows?: boolean;
|
|
104
|
+
/** Breite des Charts. "auto" = 100 % des Eltern-Containers. Standard: "100%". */
|
|
105
|
+
width?: number | string;
|
|
106
|
+
zoomable?: boolean;
|
|
109
107
|
onAddTask?: (parentTask?: GanttTask) => void;
|
|
110
|
-
onEditTask?: (task: GanttTask) => void;
|
|
111
108
|
onDeleteTask?: (task: GanttTask) => void;
|
|
109
|
+
onEditTask?: (task: GanttTask) => void;
|
|
110
|
+
onMilestoneClick?: (task: GanttTask) => void;
|
|
112
111
|
onStatusChange?: (task: GanttTask, status: GanttTaskStatus) => void;
|
|
112
|
+
onTaskClick?: (task: GanttTask) => void;
|
|
113
|
+
onTaskCreated?: (task: GanttTask) => void;
|
|
114
|
+
onTaskDeleted?: (taskId: string) => void;
|
|
113
115
|
onTaskMoved?: (task: GanttTask, newStart: Date, newEnd: Date) => void;
|
|
114
116
|
onTaskResized?: (task: GanttTask, newEnd: Date) => void;
|
|
115
117
|
onTasksChange?: (tasks: GanttTask[]) => void;
|
|
116
|
-
onTaskCreated?: (task: GanttTask) => void;
|
|
117
118
|
onTaskUpdated?: (task: GanttTask) => void;
|
|
118
|
-
onTaskDeleted?: (taskId: string) => void;
|
|
119
119
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type DependencyLine = {
|
|
2
|
+
key: string;
|
|
3
|
+
d: string;
|
|
4
|
+
};
|
|
5
|
+
type GanttDependencyArrowsProps = {
|
|
6
|
+
dependencyLines: DependencyLine[];
|
|
7
|
+
todayX: number | null;
|
|
8
|
+
totalWidth: number;
|
|
9
|
+
height: number;
|
|
10
|
+
top: number;
|
|
11
|
+
arrowMarkerId: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* SVG-Layer über allen Gantt-Balken. Zeichnet:
|
|
15
|
+
* - Z-förmige Abhängigkeitspfeile zwischen Vorgänger und Nachfolger
|
|
16
|
+
* - Vertikale Today-Line am heutigen Datum
|
|
17
|
+
*
|
|
18
|
+
* pointerEvents: none — Klicks auf Balken und Zeilen gehen durch.
|
|
19
|
+
* Farben werden intern via useTheme() / useGanttTheme() gelesen.
|
|
20
|
+
*/
|
|
21
|
+
export declare function GanttDependencyArrows({ dependencyLines, todayX, totalWidth, height, top, arrowMarkerId, }: GanttDependencyArrowsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GanttTaskNode, GanttTaskStatus } from "./GanttChart.types";
|
|
2
|
+
type ContextMenuState = {
|
|
3
|
+
task: GanttTaskNode;
|
|
4
|
+
mouseX: number;
|
|
5
|
+
mouseY: number;
|
|
6
|
+
};
|
|
7
|
+
type GanttStatusContextMenuProps = {
|
|
8
|
+
contextMenu: ContextMenuState | null;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/** Wird aufgerufen wenn der User einen Status wählt. Business-Logik (Store-Update,
|
|
11
|
+
* Callbacks) bleibt in GanttTimeline — diese Komponente ist rein präsentational. */
|
|
12
|
+
onSelect: (task: GanttTaskNode, status: GanttTaskStatus) => void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Rechtsklick-Kontextmenü für schnellen Statuswechsel eines Gantt-Balkens.
|
|
16
|
+
* Übersetzungen werden intern via useGanttTranslations() gelesen.
|
|
17
|
+
*/
|
|
18
|
+
export declare function GanttStatusContextMenu({ contextMenu, onClose, onSelect }: GanttStatusContextMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type WeekendStrip = {
|
|
2
|
+
key: string;
|
|
3
|
+
left: number;
|
|
4
|
+
};
|
|
5
|
+
type GanttWeekendStripsProps = {
|
|
6
|
+
strips: WeekendStrip[];
|
|
7
|
+
totalWidth: number;
|
|
8
|
+
height: number;
|
|
9
|
+
top: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Zeichnet halbtransparente Hintergrundstreifen für Wochenend-Spalten
|
|
13
|
+
* in der Tages-Skala. Eigener Layer (pointerEvents: none) damit Klicks
|
|
14
|
+
* auf Balken und Zeilen durchgehen.
|
|
15
|
+
*/
|
|
16
|
+
export declare function GanttWeekendStrips({ strips, totalWidth, height, top }: GanttWeekendStripsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useGanttDrag — Kapselt die gesamte Drag & Drop / Resize / Progress-Logik des GanttCharts.
|
|
3
|
+
*
|
|
4
|
+
* Muster für komplexe Interaktions-Hooks (auch für zukünftige Komponenten):
|
|
5
|
+
*
|
|
6
|
+
* 1. STABLE CALLBACK REFS — Callbacks (onTaskMoved, onTaskResized, …) werden in Refs
|
|
7
|
+
* gespiegelt. So können document-Event-Listener immer die aktuellen Props lesen,
|
|
8
|
+
* ohne bei jeder Prop-Änderung neu registriert werden zu müssen.
|
|
9
|
+
*
|
|
10
|
+
* 2. ZWEI-EBENEN STATE — dragInitRef + activeDragRef halten stabile Werte (kein Re-render),
|
|
11
|
+
* setActiveDrag(state) löst nur dann einen Re-render aus wenn die UI aktualisiert
|
|
12
|
+
* werden soll (Balken-Position während des Ziehens). Dadurch kein unnötiges Rendering.
|
|
13
|
+
*
|
|
14
|
+
* 3. DOCUMENT-LEVEL LISTENERS — mousemove/mouseup auf document statt auf dem Element,
|
|
15
|
+
* damit Drag auch funktioniert wenn der Mauszeiger den Balken verlässt.
|
|
16
|
+
*
|
|
17
|
+
* 4. SUPPRESS-CLICK — suppressClickRef verhindert dass ein onClick ausgelöst wird
|
|
18
|
+
* wenn der User eigentlich gezogen hat (≥ 5px Bewegung).
|
|
19
|
+
*/
|
|
20
|
+
import type { GanttTask, GanttTaskNode } from "../GanttChart.types";
|
|
21
|
+
import type { TimelineRange } from "../util/gantt-chart.util";
|
|
22
|
+
export type DragType = "move" | "resize" | "progress";
|
|
23
|
+
export type ActiveDrag = {
|
|
24
|
+
taskId: string;
|
|
25
|
+
type: DragType;
|
|
26
|
+
deltaDays: number;
|
|
27
|
+
newProgress?: number;
|
|
28
|
+
};
|
|
29
|
+
type UseGanttDragOptions = {
|
|
30
|
+
totalWidth: number;
|
|
31
|
+
displayRange: TimelineRange;
|
|
32
|
+
onTaskMoved?: (task: GanttTask, newStart: Date, newEnd: Date) => void;
|
|
33
|
+
onTaskResized?: (task: GanttTask, newEnd: Date) => void;
|
|
34
|
+
onTasksChange?: (tasks: GanttTask[]) => void;
|
|
35
|
+
};
|
|
36
|
+
type UseGanttDragReturn = {
|
|
37
|
+
activeDrag: ActiveDrag | null;
|
|
38
|
+
suppressClickRef: React.MutableRefObject<boolean>;
|
|
39
|
+
handleBarMouseDown: (e: React.MouseEvent, task: GanttTaskNode, type: DragType) => void;
|
|
40
|
+
handleProgressMouseDown: (e: React.MouseEvent, task: GanttTaskNode, initialProgress: number, barWidthPx: number) => void;
|
|
41
|
+
formatDragDate: (d: Date) => string;
|
|
42
|
+
};
|
|
43
|
+
export declare function useGanttDrag({ totalWidth, displayRange, onTaskMoved, onTaskResized, onTasksChange, }: UseGanttDragOptions): UseGanttDragReturn;
|
|
44
|
+
export {};
|
|
@@ -32,29 +32,29 @@ export type JsonEditorHighlightColors = {
|
|
|
32
32
|
null?: string;
|
|
33
33
|
};
|
|
34
34
|
export type JsonEditorProps = {
|
|
35
|
-
value?: string;
|
|
36
|
-
onChange?: (json: string) => void;
|
|
37
|
-
onValidChange?: (isValid: boolean) => void;
|
|
38
|
-
placeholder?: string;
|
|
39
|
-
/** Total height (toolbar + content). Numbers → px. "auto" → fills surrounding flex container. */
|
|
40
|
-
height?: number | string;
|
|
41
|
-
/** Width. Numbers → px. Default → 100%. */
|
|
42
|
-
width?: number | string;
|
|
43
35
|
disabled?: boolean;
|
|
44
|
-
readonly?: boolean;
|
|
45
36
|
error?: boolean;
|
|
37
|
+
/** Total height (toolbar + content). Numbers → px. "auto" → fills surrounding flex container. */
|
|
38
|
+
height?: number | string;
|
|
46
39
|
helperText?: string;
|
|
47
|
-
|
|
48
|
-
name?: string;
|
|
40
|
+
highlightColors?: JsonEditorHighlightColors;
|
|
49
41
|
/** Indentation spaces used by the Format button. Default: 2. */
|
|
50
42
|
indent?: number;
|
|
51
|
-
|
|
43
|
+
/** Name for native form submission via hidden input. */
|
|
44
|
+
name?: string;
|
|
45
|
+
placeholder?: string;
|
|
46
|
+
readonly?: boolean;
|
|
52
47
|
showLineColumn?: boolean;
|
|
48
|
+
showLineNumbers?: boolean;
|
|
53
49
|
/** Shows a Valid / Invalid JSON indicator in the footer. */
|
|
54
50
|
showValidation?: boolean;
|
|
55
51
|
toolbarConfig?: JsonEditorToolbarConfig;
|
|
56
52
|
translation?: Partial<JsonEditorTranslation>;
|
|
57
|
-
|
|
53
|
+
value?: string;
|
|
54
|
+
/** Width. Numbers → px. Default → 100%. */
|
|
55
|
+
width?: number | string;
|
|
58
56
|
onBlur?: () => void;
|
|
57
|
+
onChange?: (json: string) => void;
|
|
59
58
|
onFocus?: () => void;
|
|
59
|
+
onValidChange?: (isValid: boolean) => void;
|
|
60
60
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type PasswordStrengthBarProps = {
|
|
2
|
+
percent: number;
|
|
3
|
+
color: string;
|
|
4
|
+
ariaLabel: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Visuelle Fortschrittsleiste für die Passwortstärke.
|
|
8
|
+
* role="progressbar" macht die Anzeige für Screenreader zugänglich —
|
|
9
|
+
* ohne aria-Attribute wäre sie für assistive Technologien unsichtbar.
|
|
10
|
+
*/
|
|
11
|
+
export declare function PasswordStrengthBar({ percent, color, ariaLabel }: PasswordStrengthBarProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -37,20 +37,20 @@ export declare const DEFAULT_PASSWORD_TRANSLATIONS: PasswordStrengthMeterTransla
|
|
|
37
37
|
export declare const DEFAULT_METER_COLORS: MeterColors;
|
|
38
38
|
export declare const DEFAULT_CHECK_COLORS: CheckColors;
|
|
39
39
|
export type PasswordStrengthMeterProps = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
40
|
+
autoComplete?: string;
|
|
41
|
+
checkColors?: CheckColors;
|
|
43
42
|
disabled?: boolean;
|
|
44
43
|
error?: boolean;
|
|
45
44
|
helperText?: string;
|
|
46
|
-
|
|
47
|
-
showPasswordAdornment?: boolean;
|
|
48
|
-
showMeter?: boolean;
|
|
49
|
-
showSummary?: boolean;
|
|
45
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
50
46
|
inputSize?: "small" | "medium";
|
|
51
|
-
translation?: Partial<PasswordStrengthMeterTranslation>;
|
|
52
47
|
meterColors?: Partial<MeterColors>;
|
|
48
|
+
name?: string;
|
|
53
49
|
passwordMinLength?: number;
|
|
54
|
-
|
|
50
|
+
showMeter?: boolean;
|
|
51
|
+
showPasswordAdornment?: boolean;
|
|
52
|
+
showSummary?: boolean;
|
|
53
|
+
translation?: Partial<PasswordStrengthMeterTranslation>;
|
|
54
|
+
value?: string;
|
|
55
55
|
onPasswordChange?: (password: string, strengthResult: StrengthResult) => void;
|
|
56
56
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RichTextEditorProps } from "./RichTextEditor.types";
|
|
2
|
-
export declare function RichTextEditor({
|
|
2
|
+
export declare function RichTextEditor({ disabled, error, height, helperText, maxCharacters, name, placeholder, readonly, showCharacterCount, showToolbar, showWordCount, toolbarConfig, translation, value, width, onBlur, onChange, onFocus, }: RichTextEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type RichTextEditorOutputFormat = "html" | "json";
|
|
2
1
|
export type RichTextEditorToolbarConfig = {
|
|
3
2
|
showBold?: boolean;
|
|
4
3
|
showItalic?: boolean;
|
|
@@ -17,6 +16,8 @@ export type RichTextEditorToolbarConfig = {
|
|
|
17
16
|
showHighlight?: boolean;
|
|
18
17
|
showUndoRedo?: boolean;
|
|
19
18
|
showClearFormat?: boolean;
|
|
19
|
+
/** Fullscreen-Button in der Toolbar — standardmäßig deaktiviert (opt-in) */
|
|
20
|
+
showFullscreenButton?: boolean;
|
|
20
21
|
};
|
|
21
22
|
export declare const DEFAULT_RICH_TEXT_EDITOR_TOOLBAR_CONFIG: Required<RichTextEditorToolbarConfig>;
|
|
22
23
|
export type RichTextEditorTranslation = {
|
|
@@ -47,26 +48,35 @@ export type RichTextEditorTranslation = {
|
|
|
47
48
|
linkDialogRemove: string;
|
|
48
49
|
characterCount: string;
|
|
49
50
|
characterCountMax: string;
|
|
51
|
+
/** Wörter-Zähler im Footer, z.B. "{count} words" */
|
|
52
|
+
wordCount: string;
|
|
53
|
+
/** Tooltip für den Fullscreen-Button */
|
|
54
|
+
fullscreen: string;
|
|
55
|
+
/** Tooltip für den Exit-Fullscreen-Button */
|
|
56
|
+
exitFullscreen: string;
|
|
50
57
|
};
|
|
51
58
|
export declare const DEFAULT_RICH_TEXT_EDITOR_TRANSLATION: RichTextEditorTranslation;
|
|
52
59
|
export type RichTextEditorProps = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
placeholder?: string;
|
|
56
|
-
outputFormat?: RichTextEditorOutputFormat;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
error?: boolean;
|
|
57
62
|
/** Gesamthöhe des Editors (Toolbar + Inhalt). Zahlen → px. "auto" → füllt den umgebenden Flex-Container. */
|
|
58
63
|
height?: number | string;
|
|
59
|
-
|
|
60
|
-
width?: number | string;
|
|
61
|
-
showCharacterCount?: boolean;
|
|
64
|
+
helperText?: string;
|
|
62
65
|
maxCharacters?: number;
|
|
63
|
-
toolbarConfig?: RichTextEditorToolbarConfig;
|
|
64
|
-
disabled?: boolean;
|
|
65
|
-
readonly?: boolean;
|
|
66
66
|
name?: string;
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
placeholder?: string;
|
|
68
|
+
readonly?: boolean;
|
|
69
|
+
showCharacterCount?: boolean;
|
|
70
|
+
/** Blendet die Toolbar aus ohne den Editor in den readonly-Modus zu versetzen */
|
|
71
|
+
showToolbar?: boolean;
|
|
72
|
+
/** Zeigt einen Wörter-Zähler im Footer an */
|
|
73
|
+
showWordCount?: boolean;
|
|
74
|
+
toolbarConfig?: RichTextEditorToolbarConfig;
|
|
69
75
|
translation?: Partial<RichTextEditorTranslation>;
|
|
76
|
+
value?: string;
|
|
77
|
+
/** Breite des Editors. Zahlen → px. "auto" oder leer → 100% des Elternelements. */
|
|
78
|
+
width?: number | string;
|
|
70
79
|
onBlur?: () => void;
|
|
80
|
+
onChange?: (value: string) => void;
|
|
71
81
|
onFocus?: () => void;
|
|
72
82
|
};
|
|
@@ -5,7 +5,9 @@ type RichTextEditorFooterProps = {
|
|
|
5
5
|
showCharacterCount?: boolean;
|
|
6
6
|
charCount: number;
|
|
7
7
|
maxCharacters?: number;
|
|
8
|
+
showWordCount?: boolean;
|
|
9
|
+
wordCount: number;
|
|
8
10
|
translation: RichTextEditorTranslation;
|
|
9
11
|
};
|
|
10
|
-
export declare function RichTextEditorFooter({ helperText, error, showCharacterCount, charCount, maxCharacters, translation: t, }: RichTextEditorFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function RichTextEditorFooter({ helperText, error, showCharacterCount, charCount, maxCharacters, showWordCount, wordCount, translation: t, }: RichTextEditorFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -5,6 +5,8 @@ type RichTextEditorToolbarProps = {
|
|
|
5
5
|
toolbarConfig: Required<RichTextEditorToolbarConfig>;
|
|
6
6
|
translation: RichTextEditorTranslation;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
isFullscreen: boolean;
|
|
9
|
+
onToggleFullscreen: () => void;
|
|
8
10
|
};
|
|
9
|
-
export declare function RichTextEditorToolbar({ editor, toolbarConfig: tc, translation: t, disabled, }: RichTextEditorToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function RichTextEditorToolbar({ editor, toolbarConfig: tc, translation: t, disabled, isFullscreen, onToggleFullscreen, }: RichTextEditorToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ToolbarButtonProps = {
|
|
2
|
+
label: string;
|
|
3
|
+
icon: React.ReactNode;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Gemeinsamer Toolbar-Button für SqlEditor, JsonEditor und RichTextEditor.
|
|
10
|
+
* Tooltip mit Arrow, kleines Icon-Format, optionaler Active-State (primary color).
|
|
11
|
+
* onMouseDown preventDefault verhindert Fokus-Verlust im Editor beim Klick.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ToolbarButton({ label, icon, onClick, active, disabled }: ToolbarButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wandelt numerische Strings in Zahlen um (für Storybook-Controls),
|
|
3
|
+
* lässt alle anderen Werte unverändert durch.
|
|
4
|
+
*
|
|
5
|
+
* Beispiele:
|
|
6
|
+
* "300" → 300
|
|
7
|
+
* "auto" → "auto"
|
|
8
|
+
* 300 → 300
|
|
9
|
+
* undefined → undefined
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalizeSize(val: number | string | undefined): number | string | undefined;
|
|
@@ -45,29 +45,29 @@ export type SqlEditorHighlightColors = {
|
|
|
45
45
|
identifier?: string;
|
|
46
46
|
};
|
|
47
47
|
export type SqlEditorProps = {
|
|
48
|
-
|
|
49
|
-
onChange?: (sql: string) => void;
|
|
50
|
-
placeholder?: string;
|
|
51
|
-
/** Total height (toolbar + content). Numbers → px. "auto" → fills surrounding flex container. */
|
|
52
|
-
height?: number | string;
|
|
53
|
-
/** Width. Numbers → px. Default → 100%. */
|
|
54
|
-
width?: number | string;
|
|
48
|
+
dialect?: SqlEditorDialect;
|
|
55
49
|
disabled?: boolean;
|
|
56
|
-
readonly?: boolean;
|
|
57
50
|
error?: boolean;
|
|
51
|
+
/** Total height (toolbar + content). Numbers → px. "auto" → fills surrounding flex container. */
|
|
52
|
+
height?: number | string;
|
|
58
53
|
helperText?: string;
|
|
54
|
+
highlightColors?: SqlEditorHighlightColors;
|
|
59
55
|
/** Name for native form submission via hidden input. */
|
|
60
56
|
name?: string;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
readonly?: boolean;
|
|
59
|
+
schema?: SqlSchema;
|
|
64
60
|
showErrorCount?: boolean;
|
|
61
|
+
showLineColumn?: boolean;
|
|
62
|
+
showLineNumbers?: boolean;
|
|
65
63
|
toolbarConfig?: SqlEditorToolbarConfig;
|
|
66
64
|
translation?: Partial<SqlEditorTranslation>;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
onLint?: (sql: string) => Promise<SqlLintError[]> | SqlLintError[];
|
|
65
|
+
value?: string;
|
|
66
|
+
/** Width. Numbers → px. Default → 100%. */
|
|
67
|
+
width?: number | string;
|
|
71
68
|
onBlur?: () => void;
|
|
69
|
+
onChange?: (sql: string) => void;
|
|
70
|
+
onExecute?: (sql: string) => void;
|
|
72
71
|
onFocus?: () => void;
|
|
72
|
+
onLint?: (sql: string) => Promise<SqlLintError[]> | SqlLintError[];
|
|
73
73
|
};
|
|
@@ -19,23 +19,23 @@ export type TagSelectionTranslation = {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const DEFAULT_TAG_SELECTION_TRANSLATION: TagSelectionTranslation;
|
|
21
21
|
export type TagSelectionProps = {
|
|
22
|
-
|
|
23
|
-
showSelectedTags?: boolean;
|
|
24
|
-
showSelectedTagsLabel?: boolean;
|
|
25
|
-
showAutoComplete?: boolean;
|
|
26
|
-
translation?: Partial<TagSelectionTranslation>;
|
|
27
|
-
inputSize?: "small" | "medium";
|
|
22
|
+
allowCreate?: boolean;
|
|
28
23
|
chipSize?: "small" | "medium";
|
|
29
24
|
disabled?: boolean;
|
|
25
|
+
inputSize?: "small" | "medium";
|
|
26
|
+
listboxMaxHeight?: number;
|
|
30
27
|
loading?: boolean;
|
|
31
28
|
maxTags?: number;
|
|
32
|
-
allowCreate?: boolean;
|
|
33
29
|
maxVisibleChips?: number;
|
|
34
30
|
popoverPlacement?: "top" | "bottom";
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
showAutoComplete?: boolean;
|
|
32
|
+
showSelectedTags?: boolean;
|
|
33
|
+
showSelectedTagsLabel?: boolean;
|
|
34
|
+
tags: TagSelectionItem[];
|
|
35
|
+
translation?: Partial<TagSelectionTranslation>;
|
|
39
36
|
onSearchChange?: (searchValue: string) => void;
|
|
40
37
|
onTagCreate?: (label: string, color: TagColor) => void;
|
|
38
|
+
onTagDelete?: (tag: TagSelectionItem, selectedTags: TagSelectionItem[], allTags: TagSelectionItem[]) => void;
|
|
39
|
+
onTagSelect?: (tag: TagSelectionItem, selectedTags: TagSelectionItem[], allTags: TagSelectionItem[]) => void;
|
|
40
|
+
onTagsChange?: (selectedTags: TagSelectionItem[], allTags: TagSelectionItem[]) => void;
|
|
41
41
|
};
|