design-zystem 1.0.273 → 1.0.274
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/dist/index.css +158 -0
- package/dist/index.d.mts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +121 -0
- package/dist/index.mjs +118 -0
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -277,3 +277,161 @@
|
|
|
277
277
|
color: #646b73;
|
|
278
278
|
border-color: #cbd5e1;
|
|
279
279
|
}
|
|
280
|
+
|
|
281
|
+
/* src/Components/Gantt/Gantt.css */
|
|
282
|
+
.dz-gantt {
|
|
283
|
+
border: 1px solid #e2e8f0;
|
|
284
|
+
border-radius: 10px;
|
|
285
|
+
overflow: hidden;
|
|
286
|
+
background: #fff;
|
|
287
|
+
color: #343a40;
|
|
288
|
+
width: 100%;
|
|
289
|
+
}
|
|
290
|
+
.dz-gantt__axis {
|
|
291
|
+
display: grid;
|
|
292
|
+
grid-template-columns: var(--dz-gantt-label-w) minmax(0, 1fr);
|
|
293
|
+
border-bottom: 1px solid #e2e8f0;
|
|
294
|
+
background: #f8fafc;
|
|
295
|
+
}
|
|
296
|
+
.dz-gantt__axis-label {
|
|
297
|
+
display: flex;
|
|
298
|
+
align-items: center;
|
|
299
|
+
height: 30px;
|
|
300
|
+
padding: 0 12px;
|
|
301
|
+
border-right: 1px solid #e2e8f0;
|
|
302
|
+
font-size: 10px;
|
|
303
|
+
font-weight: 700;
|
|
304
|
+
letter-spacing: 0.05em;
|
|
305
|
+
color: #94a3b8;
|
|
306
|
+
}
|
|
307
|
+
.dz-gantt__axis-days {
|
|
308
|
+
position: relative;
|
|
309
|
+
height: 30px;
|
|
310
|
+
}
|
|
311
|
+
.dz-gantt__axis-day {
|
|
312
|
+
position: absolute;
|
|
313
|
+
top: 0;
|
|
314
|
+
height: 100%;
|
|
315
|
+
display: flex;
|
|
316
|
+
align-items: center;
|
|
317
|
+
padding-left: 8px;
|
|
318
|
+
border-right: 1px solid #f1f5f9;
|
|
319
|
+
box-sizing: border-box;
|
|
320
|
+
font-size: 10px;
|
|
321
|
+
font-weight: 600;
|
|
322
|
+
color: #94a3b8;
|
|
323
|
+
white-space: nowrap;
|
|
324
|
+
}
|
|
325
|
+
.dz-gantt__body {
|
|
326
|
+
display: grid;
|
|
327
|
+
grid-template-columns: var(--dz-gantt-label-w) minmax(0, 1fr);
|
|
328
|
+
max-height: var(--dz-gantt-max-h);
|
|
329
|
+
overflow-y: auto;
|
|
330
|
+
overflow-x: hidden;
|
|
331
|
+
}
|
|
332
|
+
.dz-gantt__labels {
|
|
333
|
+
min-width: 0;
|
|
334
|
+
border-right: 1px solid #e2e8f0;
|
|
335
|
+
}
|
|
336
|
+
.dz-gantt__dot {
|
|
337
|
+
display: inline-block;
|
|
338
|
+
width: 9px;
|
|
339
|
+
height: 9px;
|
|
340
|
+
border-radius: 3px;
|
|
341
|
+
flex-shrink: 0;
|
|
342
|
+
}
|
|
343
|
+
.dz-gantt__labelrow {
|
|
344
|
+
height: var(--dz-gantt-row-h);
|
|
345
|
+
padding: 0 12px;
|
|
346
|
+
display: flex;
|
|
347
|
+
flex-direction: column;
|
|
348
|
+
justify-content: center;
|
|
349
|
+
gap: 2px;
|
|
350
|
+
min-width: 0;
|
|
351
|
+
overflow: hidden;
|
|
352
|
+
box-sizing: border-box;
|
|
353
|
+
transition: background 0.12s ease;
|
|
354
|
+
}
|
|
355
|
+
.dz-gantt__labelrow--alt {
|
|
356
|
+
background: #f8fafc;
|
|
357
|
+
}
|
|
358
|
+
.dz-gantt__labelrow--clickable {
|
|
359
|
+
cursor: pointer;
|
|
360
|
+
}
|
|
361
|
+
.dz-gantt__labelrow--clickable:hover {
|
|
362
|
+
background: #f1f5f9;
|
|
363
|
+
}
|
|
364
|
+
.dz-gantt__timeline-col {
|
|
365
|
+
min-width: 0;
|
|
366
|
+
overflow: hidden;
|
|
367
|
+
}
|
|
368
|
+
.dz-gantt__timeline {
|
|
369
|
+
position: relative;
|
|
370
|
+
width: 100%;
|
|
371
|
+
}
|
|
372
|
+
.dz-gantt__day {
|
|
373
|
+
position: absolute;
|
|
374
|
+
top: 0;
|
|
375
|
+
bottom: 0;
|
|
376
|
+
background: #fff;
|
|
377
|
+
border-right: 1px solid #f1f5f9;
|
|
378
|
+
box-sizing: border-box;
|
|
379
|
+
}
|
|
380
|
+
.dz-gantt__day--alt {
|
|
381
|
+
background: #f8fafc;
|
|
382
|
+
}
|
|
383
|
+
.dz-gantt__band {
|
|
384
|
+
position: absolute;
|
|
385
|
+
top: 0;
|
|
386
|
+
bottom: 0;
|
|
387
|
+
background: rgba(244, 70, 73, 0.1);
|
|
388
|
+
border-left: 1.5px solid #f44649;
|
|
389
|
+
border-right: 1.5px solid #f44649;
|
|
390
|
+
box-sizing: border-box;
|
|
391
|
+
pointer-events: none;
|
|
392
|
+
}
|
|
393
|
+
.dz-gantt__track {
|
|
394
|
+
position: absolute;
|
|
395
|
+
left: 0;
|
|
396
|
+
right: 0;
|
|
397
|
+
box-sizing: border-box;
|
|
398
|
+
}
|
|
399
|
+
.dz-gantt__track:not(:first-child) {
|
|
400
|
+
border-top: 1px solid #f1f5f9;
|
|
401
|
+
}
|
|
402
|
+
.dz-gantt__bar {
|
|
403
|
+
position: absolute;
|
|
404
|
+
top: 50%;
|
|
405
|
+
transform: translateY(-50%);
|
|
406
|
+
height: 22px;
|
|
407
|
+
min-width: 8px;
|
|
408
|
+
border-radius: 6px;
|
|
409
|
+
display: flex;
|
|
410
|
+
align-items: center;
|
|
411
|
+
padding: 0 8px;
|
|
412
|
+
box-sizing: border-box;
|
|
413
|
+
overflow: hidden;
|
|
414
|
+
background: var(--dz-gantt-bar-color, #94a3b8);
|
|
415
|
+
border: 1.5px solid var(--dz-gantt-bar-color, #94a3b8);
|
|
416
|
+
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
|
|
417
|
+
}
|
|
418
|
+
.dz-gantt__bar--approx {
|
|
419
|
+
border-style: dashed;
|
|
420
|
+
opacity: 0.9;
|
|
421
|
+
}
|
|
422
|
+
.dz-gantt__bar-label {
|
|
423
|
+
font-size: 10px;
|
|
424
|
+
font-weight: 600;
|
|
425
|
+
color: var(--dz-gantt-bar-text, #fff);
|
|
426
|
+
white-space: nowrap;
|
|
427
|
+
overflow: hidden;
|
|
428
|
+
text-overflow: ellipsis;
|
|
429
|
+
}
|
|
430
|
+
.dz-gantt__swatch {
|
|
431
|
+
display: inline-block;
|
|
432
|
+
width: 18px;
|
|
433
|
+
height: 12px;
|
|
434
|
+
border-radius: 3px;
|
|
435
|
+
flex-shrink: 0;
|
|
436
|
+
box-sizing: border-box;
|
|
437
|
+
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1070,6 +1070,52 @@ interface TimelineProps {
|
|
|
1070
1070
|
*/
|
|
1071
1071
|
declare const Timeline: ({ items, lineColor, emptyLabel, }: TimelineProps) => react_jsx_runtime.JSX.Element;
|
|
1072
1072
|
|
|
1073
|
+
interface GanttDay {
|
|
1074
|
+
key: string | number;
|
|
1075
|
+
leftPct: number;
|
|
1076
|
+
widthPct: number;
|
|
1077
|
+
label: string;
|
|
1078
|
+
}
|
|
1079
|
+
interface GanttBar {
|
|
1080
|
+
leftPct: number;
|
|
1081
|
+
widthPct: number;
|
|
1082
|
+
color: string;
|
|
1083
|
+
textColor?: string;
|
|
1084
|
+
label?: string | null;
|
|
1085
|
+
title?: string;
|
|
1086
|
+
dashed?: boolean;
|
|
1087
|
+
}
|
|
1088
|
+
interface GanttRow<T = unknown> {
|
|
1089
|
+
key: string | number;
|
|
1090
|
+
bar?: GanttBar | null;
|
|
1091
|
+
data: T;
|
|
1092
|
+
}
|
|
1093
|
+
interface GanttBand {
|
|
1094
|
+
key: string | number;
|
|
1095
|
+
leftPct: number;
|
|
1096
|
+
widthPct: number;
|
|
1097
|
+
title?: string;
|
|
1098
|
+
}
|
|
1099
|
+
interface GanttProps<T = unknown> {
|
|
1100
|
+
days: GanttDay[];
|
|
1101
|
+
rows: GanttRow<T>[];
|
|
1102
|
+
bands?: GanttBand[];
|
|
1103
|
+
labelHeader?: string;
|
|
1104
|
+
renderLabel: (row: GanttRow<T>, index: number) => ReactNode;
|
|
1105
|
+
onRowClick?: (row: GanttRow<T>, index: number) => void;
|
|
1106
|
+
labelWidth?: number;
|
|
1107
|
+
rowHeight?: number;
|
|
1108
|
+
maxHeight?: number;
|
|
1109
|
+
}
|
|
1110
|
+
declare const Gantt: <T>({ days, rows, bands, labelHeader, renderLabel, onRowClick, labelWidth, rowHeight, maxHeight, }: GanttProps<T>) => react_jsx_runtime.JSX.Element;
|
|
1111
|
+
declare const GanttDot: ({ color }: {
|
|
1112
|
+
color: string;
|
|
1113
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1114
|
+
declare const GanttSwatch: ({ color, filled, }: {
|
|
1115
|
+
color: string;
|
|
1116
|
+
filled?: boolean;
|
|
1117
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1118
|
+
|
|
1073
1119
|
/**
|
|
1074
1120
|
* formatDate(date, type?, language?)
|
|
1075
1121
|
* - language : fr/en/es/... (locale inferred), default "en"
|
|
@@ -1199,4 +1245,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
|
|
|
1199
1245
|
|
|
1200
1246
|
declare const parseAmount: (value: string) => number | null;
|
|
1201
1247
|
|
|
1202
|
-
export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, ProgressBar, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
|
|
1248
|
+
export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Gantt, type GanttBand, type GanttBar, type GanttDay, GanttDot, type GanttProps, type GanttRow, GanttSwatch, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, ProgressBar, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
|
package/dist/index.d.ts
CHANGED
|
@@ -1070,6 +1070,52 @@ interface TimelineProps {
|
|
|
1070
1070
|
*/
|
|
1071
1071
|
declare const Timeline: ({ items, lineColor, emptyLabel, }: TimelineProps) => react_jsx_runtime.JSX.Element;
|
|
1072
1072
|
|
|
1073
|
+
interface GanttDay {
|
|
1074
|
+
key: string | number;
|
|
1075
|
+
leftPct: number;
|
|
1076
|
+
widthPct: number;
|
|
1077
|
+
label: string;
|
|
1078
|
+
}
|
|
1079
|
+
interface GanttBar {
|
|
1080
|
+
leftPct: number;
|
|
1081
|
+
widthPct: number;
|
|
1082
|
+
color: string;
|
|
1083
|
+
textColor?: string;
|
|
1084
|
+
label?: string | null;
|
|
1085
|
+
title?: string;
|
|
1086
|
+
dashed?: boolean;
|
|
1087
|
+
}
|
|
1088
|
+
interface GanttRow<T = unknown> {
|
|
1089
|
+
key: string | number;
|
|
1090
|
+
bar?: GanttBar | null;
|
|
1091
|
+
data: T;
|
|
1092
|
+
}
|
|
1093
|
+
interface GanttBand {
|
|
1094
|
+
key: string | number;
|
|
1095
|
+
leftPct: number;
|
|
1096
|
+
widthPct: number;
|
|
1097
|
+
title?: string;
|
|
1098
|
+
}
|
|
1099
|
+
interface GanttProps<T = unknown> {
|
|
1100
|
+
days: GanttDay[];
|
|
1101
|
+
rows: GanttRow<T>[];
|
|
1102
|
+
bands?: GanttBand[];
|
|
1103
|
+
labelHeader?: string;
|
|
1104
|
+
renderLabel: (row: GanttRow<T>, index: number) => ReactNode;
|
|
1105
|
+
onRowClick?: (row: GanttRow<T>, index: number) => void;
|
|
1106
|
+
labelWidth?: number;
|
|
1107
|
+
rowHeight?: number;
|
|
1108
|
+
maxHeight?: number;
|
|
1109
|
+
}
|
|
1110
|
+
declare const Gantt: <T>({ days, rows, bands, labelHeader, renderLabel, onRowClick, labelWidth, rowHeight, maxHeight, }: GanttProps<T>) => react_jsx_runtime.JSX.Element;
|
|
1111
|
+
declare const GanttDot: ({ color }: {
|
|
1112
|
+
color: string;
|
|
1113
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1114
|
+
declare const GanttSwatch: ({ color, filled, }: {
|
|
1115
|
+
color: string;
|
|
1116
|
+
filled?: boolean;
|
|
1117
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1118
|
+
|
|
1073
1119
|
/**
|
|
1074
1120
|
* formatDate(date, type?, language?)
|
|
1075
1121
|
* - language : fr/en/es/... (locale inferred), default "en"
|
|
@@ -1199,4 +1245,4 @@ declare const formatKM: (value: string | number | null | undefined) => string;
|
|
|
1199
1245
|
|
|
1200
1246
|
declare const parseAmount: (value: string) => number | null;
|
|
1201
1247
|
|
|
1202
|
-
export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, ProgressBar, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
|
|
1248
|
+
export { Accordion, type AccordionItem, Avatar, Banner, type BannerAction, type BannerProps, Box, Bubble, Bulk, Button, Card, type CardProps, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, type DatePickerProps, type DatePreset, Divider, Drawer, EmptyState, FileUploadZone, type FloatingAction, FloatingButton, type FloatingButtonProps, Gantt, type GanttBand, type GanttBar, type GanttDay, GanttDot, type GanttProps, type GanttRow, GanttSwatch, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, ProgressBar, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Timeline, type TimelineItem, type ToastOptions, type ToastType, Toaster, Tooltip, addBusinessDays, appendCacheBuster, appendQueryParam, capitalizeFirstLetter, colors, easterDate, formatAddress, formatCityFromFormattedAddress, formatCityWithPostalCode, formatDate, formatDateWithTime, formatDistance, formatDuration, formatEuro, formatKM, formatLocality, formatName, formatNameWithInitial, formatPhoneNumber, formatPlate, formatPlateWithoutDashes, formatPostalCodeFromFormattedAddress, formatRegionCode, formatTime, formatVin, generateHexColor, getAvatarColor, getCleanFileName, getFileIconByMimeType, getFileKind, getFileNameFromUrl, getInitials, getMimeCategory, getRelativeTime, isHoliday, isSameDay, isolateCity, optimizeImage, parseAmount, parseIsoDate, toast, truncateFileName, truncateText };
|
package/dist/index.js
CHANGED
|
@@ -78,6 +78,9 @@ __export(index_exports, {
|
|
|
78
78
|
EmptyState: () => EmptyState,
|
|
79
79
|
FileUploadZone: () => FileUploadZone,
|
|
80
80
|
FloatingButton: () => FloatingButton,
|
|
81
|
+
Gantt: () => Gantt,
|
|
82
|
+
GanttDot: () => GanttDot,
|
|
83
|
+
GanttSwatch: () => GanttSwatch,
|
|
81
84
|
Grid: () => Grid,
|
|
82
85
|
Icon: () => Icon,
|
|
83
86
|
IconTabs: () => IconTabs,
|
|
@@ -6108,6 +6111,121 @@ var Timeline = ({
|
|
|
6108
6111
|
}) });
|
|
6109
6112
|
};
|
|
6110
6113
|
|
|
6114
|
+
// src/Components/Gantt/Gantt.tsx
|
|
6115
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6116
|
+
var Gantt = ({
|
|
6117
|
+
days,
|
|
6118
|
+
rows,
|
|
6119
|
+
bands = [],
|
|
6120
|
+
labelHeader,
|
|
6121
|
+
renderLabel,
|
|
6122
|
+
onRowClick,
|
|
6123
|
+
labelWidth = 220,
|
|
6124
|
+
rowHeight = 44,
|
|
6125
|
+
maxHeight = 380
|
|
6126
|
+
}) => {
|
|
6127
|
+
const bodyHeight = rows.length * rowHeight;
|
|
6128
|
+
const clickable = Boolean(onRowClick);
|
|
6129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
6130
|
+
"div",
|
|
6131
|
+
{
|
|
6132
|
+
className: "dz-gantt",
|
|
6133
|
+
style: {
|
|
6134
|
+
["--dz-gantt-label-w"]: `${labelWidth}px`,
|
|
6135
|
+
["--dz-gantt-row-h"]: `${rowHeight}px`,
|
|
6136
|
+
["--dz-gantt-max-h"]: `${maxHeight}px`
|
|
6137
|
+
},
|
|
6138
|
+
children: [
|
|
6139
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "dz-gantt__axis", children: [
|
|
6140
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "dz-gantt__axis-label", children: labelHeader }),
|
|
6141
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "dz-gantt__axis-days", children: days.map((day) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6142
|
+
"div",
|
|
6143
|
+
{
|
|
6144
|
+
className: "dz-gantt__axis-day",
|
|
6145
|
+
style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` },
|
|
6146
|
+
children: day.label
|
|
6147
|
+
},
|
|
6148
|
+
day.key
|
|
6149
|
+
)) })
|
|
6150
|
+
] }),
|
|
6151
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "dz-gantt__body", children: [
|
|
6152
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "dz-gantt__labels", children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6153
|
+
"div",
|
|
6154
|
+
{
|
|
6155
|
+
className: [
|
|
6156
|
+
"dz-gantt__labelrow",
|
|
6157
|
+
i % 2 === 1 ? "dz-gantt__labelrow--alt" : "",
|
|
6158
|
+
clickable ? "dz-gantt__labelrow--clickable" : ""
|
|
6159
|
+
].filter(Boolean).join(" "),
|
|
6160
|
+
onClick: onRowClick ? () => onRowClick(row, i) : void 0,
|
|
6161
|
+
children: renderLabel(row, i)
|
|
6162
|
+
},
|
|
6163
|
+
row.key
|
|
6164
|
+
)) }),
|
|
6165
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "dz-gantt__timeline-col", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "dz-gantt__timeline", style: { height: bodyHeight }, children: [
|
|
6166
|
+
days.map((day, i) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6167
|
+
"div",
|
|
6168
|
+
{
|
|
6169
|
+
className: `dz-gantt__day ${i % 2 === 1 ? "dz-gantt__day--alt" : ""}`,
|
|
6170
|
+
style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` }
|
|
6171
|
+
},
|
|
6172
|
+
day.key
|
|
6173
|
+
)),
|
|
6174
|
+
bands.map((band) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6175
|
+
"div",
|
|
6176
|
+
{
|
|
6177
|
+
className: "dz-gantt__band",
|
|
6178
|
+
title: band.title,
|
|
6179
|
+
style: { left: `${band.leftPct}%`, width: `${band.widthPct}%` }
|
|
6180
|
+
},
|
|
6181
|
+
band.key
|
|
6182
|
+
)),
|
|
6183
|
+
rows.map((row, i) => {
|
|
6184
|
+
var _a, _b, _c;
|
|
6185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6186
|
+
"div",
|
|
6187
|
+
{
|
|
6188
|
+
className: "dz-gantt__track",
|
|
6189
|
+
style: { top: i * rowHeight, height: rowHeight },
|
|
6190
|
+
children: row.bar && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6191
|
+
"div",
|
|
6192
|
+
{
|
|
6193
|
+
className: `dz-gantt__bar ${row.bar.dashed ? "dz-gantt__bar--approx" : ""}`,
|
|
6194
|
+
title: (_b = (_a = row.bar.title) != null ? _a : row.bar.label) != null ? _b : void 0,
|
|
6195
|
+
style: {
|
|
6196
|
+
left: `${row.bar.leftPct}%`,
|
|
6197
|
+
width: `${row.bar.widthPct}%`,
|
|
6198
|
+
["--dz-gantt-bar-color"]: row.bar.color,
|
|
6199
|
+
["--dz-gantt-bar-text"]: (_c = row.bar.textColor) != null ? _c : "#fff"
|
|
6200
|
+
},
|
|
6201
|
+
children: row.bar.label && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "dz-gantt__bar-label", children: row.bar.label })
|
|
6202
|
+
}
|
|
6203
|
+
)
|
|
6204
|
+
},
|
|
6205
|
+
row.key
|
|
6206
|
+
);
|
|
6207
|
+
})
|
|
6208
|
+
] }) })
|
|
6209
|
+
] })
|
|
6210
|
+
]
|
|
6211
|
+
}
|
|
6212
|
+
);
|
|
6213
|
+
};
|
|
6214
|
+
var GanttDot = ({ color }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "dz-gantt__dot", style: { background: color } });
|
|
6215
|
+
var GanttSwatch = ({
|
|
6216
|
+
color,
|
|
6217
|
+
filled = true
|
|
6218
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6219
|
+
"span",
|
|
6220
|
+
{
|
|
6221
|
+
className: "dz-gantt__swatch",
|
|
6222
|
+
style: {
|
|
6223
|
+
background: filled ? color : "transparent",
|
|
6224
|
+
border: `1.5px solid ${color}`
|
|
6225
|
+
}
|
|
6226
|
+
}
|
|
6227
|
+
);
|
|
6228
|
+
|
|
6111
6229
|
// src/data/globalMethods.ts
|
|
6112
6230
|
var formatDate = (dateString, type = "date", language = "en") => {
|
|
6113
6231
|
if (!dateString) return "";
|
|
@@ -6762,6 +6880,9 @@ var parseAmount = (value) => {
|
|
|
6762
6880
|
EmptyState,
|
|
6763
6881
|
FileUploadZone,
|
|
6764
6882
|
FloatingButton,
|
|
6883
|
+
Gantt,
|
|
6884
|
+
GanttDot,
|
|
6885
|
+
GanttSwatch,
|
|
6765
6886
|
Grid,
|
|
6766
6887
|
Icon,
|
|
6767
6888
|
IconTabs,
|
package/dist/index.mjs
CHANGED
|
@@ -5992,6 +5992,121 @@ var Timeline = ({
|
|
|
5992
5992
|
}) });
|
|
5993
5993
|
};
|
|
5994
5994
|
|
|
5995
|
+
// src/Components/Gantt/Gantt.tsx
|
|
5996
|
+
import { jsx as jsx63, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5997
|
+
var Gantt = ({
|
|
5998
|
+
days,
|
|
5999
|
+
rows,
|
|
6000
|
+
bands = [],
|
|
6001
|
+
labelHeader,
|
|
6002
|
+
renderLabel,
|
|
6003
|
+
onRowClick,
|
|
6004
|
+
labelWidth = 220,
|
|
6005
|
+
rowHeight = 44,
|
|
6006
|
+
maxHeight = 380
|
|
6007
|
+
}) => {
|
|
6008
|
+
const bodyHeight = rows.length * rowHeight;
|
|
6009
|
+
const clickable = Boolean(onRowClick);
|
|
6010
|
+
return /* @__PURE__ */ jsxs36(
|
|
6011
|
+
"div",
|
|
6012
|
+
{
|
|
6013
|
+
className: "dz-gantt",
|
|
6014
|
+
style: {
|
|
6015
|
+
["--dz-gantt-label-w"]: `${labelWidth}px`,
|
|
6016
|
+
["--dz-gantt-row-h"]: `${rowHeight}px`,
|
|
6017
|
+
["--dz-gantt-max-h"]: `${maxHeight}px`
|
|
6018
|
+
},
|
|
6019
|
+
children: [
|
|
6020
|
+
/* @__PURE__ */ jsxs36("div", { className: "dz-gantt__axis", children: [
|
|
6021
|
+
/* @__PURE__ */ jsx63("div", { className: "dz-gantt__axis-label", children: labelHeader }),
|
|
6022
|
+
/* @__PURE__ */ jsx63("div", { className: "dz-gantt__axis-days", children: days.map((day) => /* @__PURE__ */ jsx63(
|
|
6023
|
+
"div",
|
|
6024
|
+
{
|
|
6025
|
+
className: "dz-gantt__axis-day",
|
|
6026
|
+
style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` },
|
|
6027
|
+
children: day.label
|
|
6028
|
+
},
|
|
6029
|
+
day.key
|
|
6030
|
+
)) })
|
|
6031
|
+
] }),
|
|
6032
|
+
/* @__PURE__ */ jsxs36("div", { className: "dz-gantt__body", children: [
|
|
6033
|
+
/* @__PURE__ */ jsx63("div", { className: "dz-gantt__labels", children: rows.map((row, i) => /* @__PURE__ */ jsx63(
|
|
6034
|
+
"div",
|
|
6035
|
+
{
|
|
6036
|
+
className: [
|
|
6037
|
+
"dz-gantt__labelrow",
|
|
6038
|
+
i % 2 === 1 ? "dz-gantt__labelrow--alt" : "",
|
|
6039
|
+
clickable ? "dz-gantt__labelrow--clickable" : ""
|
|
6040
|
+
].filter(Boolean).join(" "),
|
|
6041
|
+
onClick: onRowClick ? () => onRowClick(row, i) : void 0,
|
|
6042
|
+
children: renderLabel(row, i)
|
|
6043
|
+
},
|
|
6044
|
+
row.key
|
|
6045
|
+
)) }),
|
|
6046
|
+
/* @__PURE__ */ jsx63("div", { className: "dz-gantt__timeline-col", children: /* @__PURE__ */ jsxs36("div", { className: "dz-gantt__timeline", style: { height: bodyHeight }, children: [
|
|
6047
|
+
days.map((day, i) => /* @__PURE__ */ jsx63(
|
|
6048
|
+
"div",
|
|
6049
|
+
{
|
|
6050
|
+
className: `dz-gantt__day ${i % 2 === 1 ? "dz-gantt__day--alt" : ""}`,
|
|
6051
|
+
style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` }
|
|
6052
|
+
},
|
|
6053
|
+
day.key
|
|
6054
|
+
)),
|
|
6055
|
+
bands.map((band) => /* @__PURE__ */ jsx63(
|
|
6056
|
+
"div",
|
|
6057
|
+
{
|
|
6058
|
+
className: "dz-gantt__band",
|
|
6059
|
+
title: band.title,
|
|
6060
|
+
style: { left: `${band.leftPct}%`, width: `${band.widthPct}%` }
|
|
6061
|
+
},
|
|
6062
|
+
band.key
|
|
6063
|
+
)),
|
|
6064
|
+
rows.map((row, i) => {
|
|
6065
|
+
var _a, _b, _c;
|
|
6066
|
+
return /* @__PURE__ */ jsx63(
|
|
6067
|
+
"div",
|
|
6068
|
+
{
|
|
6069
|
+
className: "dz-gantt__track",
|
|
6070
|
+
style: { top: i * rowHeight, height: rowHeight },
|
|
6071
|
+
children: row.bar && /* @__PURE__ */ jsx63(
|
|
6072
|
+
"div",
|
|
6073
|
+
{
|
|
6074
|
+
className: `dz-gantt__bar ${row.bar.dashed ? "dz-gantt__bar--approx" : ""}`,
|
|
6075
|
+
title: (_b = (_a = row.bar.title) != null ? _a : row.bar.label) != null ? _b : void 0,
|
|
6076
|
+
style: {
|
|
6077
|
+
left: `${row.bar.leftPct}%`,
|
|
6078
|
+
width: `${row.bar.widthPct}%`,
|
|
6079
|
+
["--dz-gantt-bar-color"]: row.bar.color,
|
|
6080
|
+
["--dz-gantt-bar-text"]: (_c = row.bar.textColor) != null ? _c : "#fff"
|
|
6081
|
+
},
|
|
6082
|
+
children: row.bar.label && /* @__PURE__ */ jsx63("span", { className: "dz-gantt__bar-label", children: row.bar.label })
|
|
6083
|
+
}
|
|
6084
|
+
)
|
|
6085
|
+
},
|
|
6086
|
+
row.key
|
|
6087
|
+
);
|
|
6088
|
+
})
|
|
6089
|
+
] }) })
|
|
6090
|
+
] })
|
|
6091
|
+
]
|
|
6092
|
+
}
|
|
6093
|
+
);
|
|
6094
|
+
};
|
|
6095
|
+
var GanttDot = ({ color }) => /* @__PURE__ */ jsx63("span", { className: "dz-gantt__dot", style: { background: color } });
|
|
6096
|
+
var GanttSwatch = ({
|
|
6097
|
+
color,
|
|
6098
|
+
filled = true
|
|
6099
|
+
}) => /* @__PURE__ */ jsx63(
|
|
6100
|
+
"span",
|
|
6101
|
+
{
|
|
6102
|
+
className: "dz-gantt__swatch",
|
|
6103
|
+
style: {
|
|
6104
|
+
background: filled ? color : "transparent",
|
|
6105
|
+
border: `1.5px solid ${color}`
|
|
6106
|
+
}
|
|
6107
|
+
}
|
|
6108
|
+
);
|
|
6109
|
+
|
|
5995
6110
|
// src/data/globalMethods.ts
|
|
5996
6111
|
var formatDate = (dateString, type = "date", language = "en") => {
|
|
5997
6112
|
if (!dateString) return "";
|
|
@@ -6645,6 +6760,9 @@ export {
|
|
|
6645
6760
|
EmptyState,
|
|
6646
6761
|
FileUploadZone,
|
|
6647
6762
|
FloatingButton,
|
|
6763
|
+
Gantt,
|
|
6764
|
+
GanttDot,
|
|
6765
|
+
GanttSwatch,
|
|
6648
6766
|
Grid,
|
|
6649
6767
|
Icon,
|
|
6650
6768
|
IconTabs,
|