design-zystem 1.0.277 → 1.0.279
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 +0 -158
- package/dist/index.js +232 -92
- package/dist/index.mjs +232 -92
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -277,161 +277,3 @@
|
|
|
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.js
CHANGED
|
@@ -6181,7 +6181,170 @@ var Timeline = ({
|
|
|
6181
6181
|
};
|
|
6182
6182
|
|
|
6183
6183
|
// src/Components/Gantt/Gantt.tsx
|
|
6184
|
+
var import_styled_components52 = __toESM(require("styled-components"));
|
|
6184
6185
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6186
|
+
var Root = import_styled_components52.default.div`
|
|
6187
|
+
--dz-gantt-label-w: ${(p) => p.$labelWidth}px;
|
|
6188
|
+
--dz-gantt-max-h: ${(p) => p.$maxHeight}px;
|
|
6189
|
+
border: 1px solid ${colors.grey_300};
|
|
6190
|
+
border-radius: 10px;
|
|
6191
|
+
overflow: hidden;
|
|
6192
|
+
background: ${colors.white};
|
|
6193
|
+
color: ${colors.dark};
|
|
6194
|
+
width: 100%;
|
|
6195
|
+
`;
|
|
6196
|
+
var gridColumns = `grid-template-columns: var(--dz-gantt-label-w) minmax(0, 1fr);`;
|
|
6197
|
+
var Axis = import_styled_components52.default.div`
|
|
6198
|
+
display: grid;
|
|
6199
|
+
${gridColumns}
|
|
6200
|
+
border-bottom: 1px solid ${colors.grey_300};
|
|
6201
|
+
background: ${colors.grey_100};
|
|
6202
|
+
`;
|
|
6203
|
+
var AxisLabel = import_styled_components52.default.div`
|
|
6204
|
+
display: flex;
|
|
6205
|
+
align-items: center;
|
|
6206
|
+
height: 30px;
|
|
6207
|
+
padding: 0 12px;
|
|
6208
|
+
border-right: 1px solid ${colors.grey_300};
|
|
6209
|
+
font-size: 10px;
|
|
6210
|
+
font-weight: 700;
|
|
6211
|
+
letter-spacing: 0.05em;
|
|
6212
|
+
color: ${colors.grey_500};
|
|
6213
|
+
`;
|
|
6214
|
+
var AxisDays = import_styled_components52.default.div`
|
|
6215
|
+
position: relative;
|
|
6216
|
+
height: 30px;
|
|
6217
|
+
`;
|
|
6218
|
+
var AxisDay = import_styled_components52.default.div`
|
|
6219
|
+
position: absolute;
|
|
6220
|
+
top: 0;
|
|
6221
|
+
height: 100%;
|
|
6222
|
+
left: ${(p) => p.$leftPct}%;
|
|
6223
|
+
width: ${(p) => p.$widthPct}%;
|
|
6224
|
+
display: flex;
|
|
6225
|
+
align-items: center;
|
|
6226
|
+
padding-left: 8px;
|
|
6227
|
+
border-right: 1px solid ${colors.grey_200};
|
|
6228
|
+
box-sizing: border-box;
|
|
6229
|
+
font-size: 10px;
|
|
6230
|
+
font-weight: 600;
|
|
6231
|
+
color: ${colors.grey_500};
|
|
6232
|
+
white-space: nowrap;
|
|
6233
|
+
`;
|
|
6234
|
+
var Body = import_styled_components52.default.div`
|
|
6235
|
+
display: grid;
|
|
6236
|
+
${gridColumns}
|
|
6237
|
+
max-height: var(--dz-gantt-max-h);
|
|
6238
|
+
overflow-y: auto;
|
|
6239
|
+
overflow-x: hidden;
|
|
6240
|
+
`;
|
|
6241
|
+
var Labels = import_styled_components52.default.div`
|
|
6242
|
+
min-width: 0;
|
|
6243
|
+
border-right: 1px solid ${colors.grey_300};
|
|
6244
|
+
`;
|
|
6245
|
+
var LabelRow = import_styled_components52.default.div`
|
|
6246
|
+
height: ${(p) => p.$rowHeight}px;
|
|
6247
|
+
padding: 0 12px;
|
|
6248
|
+
display: flex;
|
|
6249
|
+
flex-direction: column;
|
|
6250
|
+
justify-content: center;
|
|
6251
|
+
gap: 2px;
|
|
6252
|
+
min-width: 0;
|
|
6253
|
+
overflow: hidden;
|
|
6254
|
+
box-sizing: border-box;
|
|
6255
|
+
transition: background 0.12s ease;
|
|
6256
|
+
background: ${(p) => p.$alt ? colors.grey_100 : "transparent"};
|
|
6257
|
+
cursor: ${(p) => p.$clickable ? "pointer" : "default"};
|
|
6258
|
+
|
|
6259
|
+
&:hover {
|
|
6260
|
+
background: ${(p) => p.$clickable ? colors.grey_200 : void 0};
|
|
6261
|
+
}
|
|
6262
|
+
`;
|
|
6263
|
+
var TimelineCol = import_styled_components52.default.div`
|
|
6264
|
+
min-width: 0;
|
|
6265
|
+
overflow: hidden;
|
|
6266
|
+
`;
|
|
6267
|
+
var Timeline2 = import_styled_components52.default.div`
|
|
6268
|
+
position: relative;
|
|
6269
|
+
width: 100%;
|
|
6270
|
+
height: ${(p) => p.$height}px;
|
|
6271
|
+
`;
|
|
6272
|
+
var Day = import_styled_components52.default.div`
|
|
6273
|
+
position: absolute;
|
|
6274
|
+
top: 0;
|
|
6275
|
+
bottom: 0;
|
|
6276
|
+
left: ${(p) => p.$leftPct}%;
|
|
6277
|
+
width: ${(p) => p.$widthPct}%;
|
|
6278
|
+
background: ${(p) => p.$alt ? colors.grey_100 : colors.white};
|
|
6279
|
+
border-right: 1px solid ${colors.grey_200};
|
|
6280
|
+
box-sizing: border-box;
|
|
6281
|
+
`;
|
|
6282
|
+
var Band = import_styled_components52.default.div`
|
|
6283
|
+
position: absolute;
|
|
6284
|
+
top: 0;
|
|
6285
|
+
bottom: 0;
|
|
6286
|
+
left: ${(p) => p.$leftPct}%;
|
|
6287
|
+
width: ${(p) => p.$widthPct}%;
|
|
6288
|
+
background: ${colors.red_50};
|
|
6289
|
+
border-left: 1.5px solid ${colors.red};
|
|
6290
|
+
border-right: 1.5px solid ${colors.red};
|
|
6291
|
+
box-sizing: border-box;
|
|
6292
|
+
pointer-events: none;
|
|
6293
|
+
`;
|
|
6294
|
+
var Track3 = import_styled_components52.default.div`
|
|
6295
|
+
position: absolute;
|
|
6296
|
+
left: 0;
|
|
6297
|
+
right: 0;
|
|
6298
|
+
top: ${(p) => p.$top}px;
|
|
6299
|
+
height: ${(p) => p.$rowHeight}px;
|
|
6300
|
+
box-sizing: border-box;
|
|
6301
|
+
border-top: ${(p) => p.$first ? "none" : `1px solid ${colors.grey_200}`};
|
|
6302
|
+
`;
|
|
6303
|
+
var Bar = import_styled_components52.default.div`
|
|
6304
|
+
position: absolute;
|
|
6305
|
+
top: 50%;
|
|
6306
|
+
transform: translateY(-50%);
|
|
6307
|
+
left: ${(p) => p.$leftPct}%;
|
|
6308
|
+
width: ${(p) => p.$widthPct}%;
|
|
6309
|
+
height: 22px;
|
|
6310
|
+
min-width: 8px;
|
|
6311
|
+
border-radius: 6px;
|
|
6312
|
+
display: flex;
|
|
6313
|
+
align-items: center;
|
|
6314
|
+
padding: 0 8px;
|
|
6315
|
+
box-sizing: border-box;
|
|
6316
|
+
overflow: hidden;
|
|
6317
|
+
background: ${(p) => p.$color};
|
|
6318
|
+
border: 1.5px ${(p) => p.$dashed ? "dashed" : "solid"} ${(p) => p.$color};
|
|
6319
|
+
opacity: ${(p) => p.$dashed ? 0.9 : 1};
|
|
6320
|
+
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
|
|
6321
|
+
`;
|
|
6322
|
+
var BarLabel = import_styled_components52.default.span`
|
|
6323
|
+
font-size: 10px;
|
|
6324
|
+
font-weight: 600;
|
|
6325
|
+
color: ${(p) => p.$textColor};
|
|
6326
|
+
white-space: nowrap;
|
|
6327
|
+
overflow: hidden;
|
|
6328
|
+
text-overflow: ellipsis;
|
|
6329
|
+
`;
|
|
6330
|
+
var Dot3 = import_styled_components52.default.span`
|
|
6331
|
+
display: inline-block;
|
|
6332
|
+
width: 9px;
|
|
6333
|
+
height: 9px;
|
|
6334
|
+
border-radius: 3px;
|
|
6335
|
+
flex-shrink: 0;
|
|
6336
|
+
background: ${(p) => p.$color};
|
|
6337
|
+
`;
|
|
6338
|
+
var Swatch2 = import_styled_components52.default.span`
|
|
6339
|
+
display: inline-block;
|
|
6340
|
+
width: 18px;
|
|
6341
|
+
height: 12px;
|
|
6342
|
+
border-radius: 3px;
|
|
6343
|
+
flex-shrink: 0;
|
|
6344
|
+
box-sizing: border-box;
|
|
6345
|
+
background: ${(p) => p.$filled ? p.$color : "transparent"};
|
|
6346
|
+
border: 1.5px solid ${(p) => p.$color};
|
|
6347
|
+
`;
|
|
6185
6348
|
var Gantt = ({
|
|
6186
6349
|
days,
|
|
6187
6350
|
rows,
|
|
@@ -6195,105 +6358,82 @@ var Gantt = ({
|
|
|
6195
6358
|
}) => {
|
|
6196
6359
|
const bodyHeight = rows.length * rowHeight;
|
|
6197
6360
|
const clickable = Boolean(onRowClick);
|
|
6198
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
))
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Root, { $labelWidth: labelWidth, $maxHeight: maxHeight, children: [
|
|
6362
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Axis, { children: [
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(AxisLabel, { children: labelHeader }),
|
|
6364
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(AxisDays, { children: days.map((day) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6365
|
+
AxisDay,
|
|
6366
|
+
{
|
|
6367
|
+
$leftPct: day.leftPct,
|
|
6368
|
+
$widthPct: day.widthPct,
|
|
6369
|
+
children: day.label
|
|
6370
|
+
},
|
|
6371
|
+
day.key
|
|
6372
|
+
)) })
|
|
6373
|
+
] }),
|
|
6374
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Body, { children: [
|
|
6375
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Labels, { children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6376
|
+
LabelRow,
|
|
6377
|
+
{
|
|
6378
|
+
$rowHeight: rowHeight,
|
|
6379
|
+
$alt: i % 2 === 1,
|
|
6380
|
+
$clickable: clickable,
|
|
6381
|
+
onClick: onRowClick ? () => onRowClick(row, i) : void 0,
|
|
6382
|
+
children: renderLabel(row, i)
|
|
6383
|
+
},
|
|
6384
|
+
row.key
|
|
6385
|
+
)) }),
|
|
6386
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TimelineCol, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Timeline2, { $height: bodyHeight, children: [
|
|
6387
|
+
days.map((day, i) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6388
|
+
Day,
|
|
6389
|
+
{
|
|
6390
|
+
$leftPct: day.leftPct,
|
|
6391
|
+
$widthPct: day.widthPct,
|
|
6392
|
+
$alt: i % 2 === 1
|
|
6393
|
+
},
|
|
6394
|
+
day.key
|
|
6395
|
+
)),
|
|
6396
|
+
bands.map((band) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6397
|
+
Band,
|
|
6398
|
+
{
|
|
6399
|
+
title: band.title,
|
|
6400
|
+
$leftPct: band.leftPct,
|
|
6401
|
+
$widthPct: band.widthPct
|
|
6402
|
+
},
|
|
6403
|
+
band.key
|
|
6404
|
+
)),
|
|
6405
|
+
rows.map((row, i) => {
|
|
6406
|
+
var _a, _b, _c;
|
|
6407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6408
|
+
Track3,
|
|
6223
6409
|
{
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6410
|
+
$top: i * rowHeight,
|
|
6411
|
+
$rowHeight: rowHeight,
|
|
6412
|
+
$first: i === 0,
|
|
6413
|
+
children: row.bar && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6414
|
+
Bar,
|
|
6415
|
+
{
|
|
6416
|
+
title: (_b = (_a = row.bar.title) != null ? _a : row.bar.label) != null ? _b : void 0,
|
|
6417
|
+
$leftPct: row.bar.leftPct,
|
|
6418
|
+
$widthPct: row.bar.widthPct,
|
|
6419
|
+
$color: row.bar.color,
|
|
6420
|
+
$dashed: Boolean(row.bar.dashed),
|
|
6421
|
+
children: row.bar.label && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(BarLabel, { $textColor: (_c = row.bar.textColor) != null ? _c : colors.white, children: row.bar.label })
|
|
6422
|
+
}
|
|
6423
|
+
)
|
|
6231
6424
|
},
|
|
6232
6425
|
row.key
|
|
6233
|
-
)
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
className: `dz-gantt__day ${i % 2 === 1 ? "dz-gantt__day--alt" : ""}`,
|
|
6239
|
-
style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` }
|
|
6240
|
-
},
|
|
6241
|
-
day.key
|
|
6242
|
-
)),
|
|
6243
|
-
bands.map((band) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6244
|
-
"div",
|
|
6245
|
-
{
|
|
6246
|
-
className: "dz-gantt__band",
|
|
6247
|
-
title: band.title,
|
|
6248
|
-
style: { left: `${band.leftPct}%`, width: `${band.widthPct}%` }
|
|
6249
|
-
},
|
|
6250
|
-
band.key
|
|
6251
|
-
)),
|
|
6252
|
-
rows.map((row, i) => {
|
|
6253
|
-
var _a, _b, _c;
|
|
6254
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6255
|
-
"div",
|
|
6256
|
-
{
|
|
6257
|
-
className: "dz-gantt__track",
|
|
6258
|
-
style: { top: i * rowHeight, height: rowHeight },
|
|
6259
|
-
children: row.bar && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6260
|
-
"div",
|
|
6261
|
-
{
|
|
6262
|
-
className: `dz-gantt__bar ${row.bar.dashed ? "dz-gantt__bar--approx" : ""}`,
|
|
6263
|
-
title: (_b = (_a = row.bar.title) != null ? _a : row.bar.label) != null ? _b : void 0,
|
|
6264
|
-
style: {
|
|
6265
|
-
left: `${row.bar.leftPct}%`,
|
|
6266
|
-
width: `${row.bar.widthPct}%`,
|
|
6267
|
-
["--dz-gantt-bar-color"]: row.bar.color,
|
|
6268
|
-
["--dz-gantt-bar-text"]: (_c = row.bar.textColor) != null ? _c : "#fff"
|
|
6269
|
-
},
|
|
6270
|
-
children: row.bar.label && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "dz-gantt__bar-label", children: row.bar.label })
|
|
6271
|
-
}
|
|
6272
|
-
)
|
|
6273
|
-
},
|
|
6274
|
-
row.key
|
|
6275
|
-
);
|
|
6276
|
-
})
|
|
6277
|
-
] }) })
|
|
6278
|
-
] })
|
|
6279
|
-
]
|
|
6280
|
-
}
|
|
6281
|
-
);
|
|
6426
|
+
);
|
|
6427
|
+
})
|
|
6428
|
+
] }) })
|
|
6429
|
+
] })
|
|
6430
|
+
] });
|
|
6282
6431
|
};
|
|
6283
|
-
var GanttDot = ({ color }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6432
|
+
var GanttDot = ({ color }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Dot3, { $color: color });
|
|
6284
6433
|
var GanttSwatch = ({
|
|
6285
6434
|
color,
|
|
6286
6435
|
filled = true
|
|
6287
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6288
|
-
"span",
|
|
6289
|
-
{
|
|
6290
|
-
className: "dz-gantt__swatch",
|
|
6291
|
-
style: {
|
|
6292
|
-
background: filled ? color : "transparent",
|
|
6293
|
-
border: `1.5px solid ${color}`
|
|
6294
|
-
}
|
|
6295
|
-
}
|
|
6296
|
-
);
|
|
6436
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Swatch2, { $color: color, $filled: filled });
|
|
6297
6437
|
|
|
6298
6438
|
// src/data/globalMethods.ts
|
|
6299
6439
|
var formatDate = (dateString, type = "date", language = "en") => {
|
package/dist/index.mjs
CHANGED
|
@@ -6062,7 +6062,170 @@ var Timeline = ({
|
|
|
6062
6062
|
};
|
|
6063
6063
|
|
|
6064
6064
|
// src/Components/Gantt/Gantt.tsx
|
|
6065
|
+
import styled52 from "styled-components";
|
|
6065
6066
|
import { jsx as jsx63, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6067
|
+
var Root = styled52.div`
|
|
6068
|
+
--dz-gantt-label-w: ${(p) => p.$labelWidth}px;
|
|
6069
|
+
--dz-gantt-max-h: ${(p) => p.$maxHeight}px;
|
|
6070
|
+
border: 1px solid ${colors.grey_300};
|
|
6071
|
+
border-radius: 10px;
|
|
6072
|
+
overflow: hidden;
|
|
6073
|
+
background: ${colors.white};
|
|
6074
|
+
color: ${colors.dark};
|
|
6075
|
+
width: 100%;
|
|
6076
|
+
`;
|
|
6077
|
+
var gridColumns = `grid-template-columns: var(--dz-gantt-label-w) minmax(0, 1fr);`;
|
|
6078
|
+
var Axis = styled52.div`
|
|
6079
|
+
display: grid;
|
|
6080
|
+
${gridColumns}
|
|
6081
|
+
border-bottom: 1px solid ${colors.grey_300};
|
|
6082
|
+
background: ${colors.grey_100};
|
|
6083
|
+
`;
|
|
6084
|
+
var AxisLabel = styled52.div`
|
|
6085
|
+
display: flex;
|
|
6086
|
+
align-items: center;
|
|
6087
|
+
height: 30px;
|
|
6088
|
+
padding: 0 12px;
|
|
6089
|
+
border-right: 1px solid ${colors.grey_300};
|
|
6090
|
+
font-size: 10px;
|
|
6091
|
+
font-weight: 700;
|
|
6092
|
+
letter-spacing: 0.05em;
|
|
6093
|
+
color: ${colors.grey_500};
|
|
6094
|
+
`;
|
|
6095
|
+
var AxisDays = styled52.div`
|
|
6096
|
+
position: relative;
|
|
6097
|
+
height: 30px;
|
|
6098
|
+
`;
|
|
6099
|
+
var AxisDay = styled52.div`
|
|
6100
|
+
position: absolute;
|
|
6101
|
+
top: 0;
|
|
6102
|
+
height: 100%;
|
|
6103
|
+
left: ${(p) => p.$leftPct}%;
|
|
6104
|
+
width: ${(p) => p.$widthPct}%;
|
|
6105
|
+
display: flex;
|
|
6106
|
+
align-items: center;
|
|
6107
|
+
padding-left: 8px;
|
|
6108
|
+
border-right: 1px solid ${colors.grey_200};
|
|
6109
|
+
box-sizing: border-box;
|
|
6110
|
+
font-size: 10px;
|
|
6111
|
+
font-weight: 600;
|
|
6112
|
+
color: ${colors.grey_500};
|
|
6113
|
+
white-space: nowrap;
|
|
6114
|
+
`;
|
|
6115
|
+
var Body = styled52.div`
|
|
6116
|
+
display: grid;
|
|
6117
|
+
${gridColumns}
|
|
6118
|
+
max-height: var(--dz-gantt-max-h);
|
|
6119
|
+
overflow-y: auto;
|
|
6120
|
+
overflow-x: hidden;
|
|
6121
|
+
`;
|
|
6122
|
+
var Labels = styled52.div`
|
|
6123
|
+
min-width: 0;
|
|
6124
|
+
border-right: 1px solid ${colors.grey_300};
|
|
6125
|
+
`;
|
|
6126
|
+
var LabelRow = styled52.div`
|
|
6127
|
+
height: ${(p) => p.$rowHeight}px;
|
|
6128
|
+
padding: 0 12px;
|
|
6129
|
+
display: flex;
|
|
6130
|
+
flex-direction: column;
|
|
6131
|
+
justify-content: center;
|
|
6132
|
+
gap: 2px;
|
|
6133
|
+
min-width: 0;
|
|
6134
|
+
overflow: hidden;
|
|
6135
|
+
box-sizing: border-box;
|
|
6136
|
+
transition: background 0.12s ease;
|
|
6137
|
+
background: ${(p) => p.$alt ? colors.grey_100 : "transparent"};
|
|
6138
|
+
cursor: ${(p) => p.$clickable ? "pointer" : "default"};
|
|
6139
|
+
|
|
6140
|
+
&:hover {
|
|
6141
|
+
background: ${(p) => p.$clickable ? colors.grey_200 : void 0};
|
|
6142
|
+
}
|
|
6143
|
+
`;
|
|
6144
|
+
var TimelineCol = styled52.div`
|
|
6145
|
+
min-width: 0;
|
|
6146
|
+
overflow: hidden;
|
|
6147
|
+
`;
|
|
6148
|
+
var Timeline2 = styled52.div`
|
|
6149
|
+
position: relative;
|
|
6150
|
+
width: 100%;
|
|
6151
|
+
height: ${(p) => p.$height}px;
|
|
6152
|
+
`;
|
|
6153
|
+
var Day = styled52.div`
|
|
6154
|
+
position: absolute;
|
|
6155
|
+
top: 0;
|
|
6156
|
+
bottom: 0;
|
|
6157
|
+
left: ${(p) => p.$leftPct}%;
|
|
6158
|
+
width: ${(p) => p.$widthPct}%;
|
|
6159
|
+
background: ${(p) => p.$alt ? colors.grey_100 : colors.white};
|
|
6160
|
+
border-right: 1px solid ${colors.grey_200};
|
|
6161
|
+
box-sizing: border-box;
|
|
6162
|
+
`;
|
|
6163
|
+
var Band = styled52.div`
|
|
6164
|
+
position: absolute;
|
|
6165
|
+
top: 0;
|
|
6166
|
+
bottom: 0;
|
|
6167
|
+
left: ${(p) => p.$leftPct}%;
|
|
6168
|
+
width: ${(p) => p.$widthPct}%;
|
|
6169
|
+
background: ${colors.red_50};
|
|
6170
|
+
border-left: 1.5px solid ${colors.red};
|
|
6171
|
+
border-right: 1.5px solid ${colors.red};
|
|
6172
|
+
box-sizing: border-box;
|
|
6173
|
+
pointer-events: none;
|
|
6174
|
+
`;
|
|
6175
|
+
var Track3 = styled52.div`
|
|
6176
|
+
position: absolute;
|
|
6177
|
+
left: 0;
|
|
6178
|
+
right: 0;
|
|
6179
|
+
top: ${(p) => p.$top}px;
|
|
6180
|
+
height: ${(p) => p.$rowHeight}px;
|
|
6181
|
+
box-sizing: border-box;
|
|
6182
|
+
border-top: ${(p) => p.$first ? "none" : `1px solid ${colors.grey_200}`};
|
|
6183
|
+
`;
|
|
6184
|
+
var Bar = styled52.div`
|
|
6185
|
+
position: absolute;
|
|
6186
|
+
top: 50%;
|
|
6187
|
+
transform: translateY(-50%);
|
|
6188
|
+
left: ${(p) => p.$leftPct}%;
|
|
6189
|
+
width: ${(p) => p.$widthPct}%;
|
|
6190
|
+
height: 22px;
|
|
6191
|
+
min-width: 8px;
|
|
6192
|
+
border-radius: 6px;
|
|
6193
|
+
display: flex;
|
|
6194
|
+
align-items: center;
|
|
6195
|
+
padding: 0 8px;
|
|
6196
|
+
box-sizing: border-box;
|
|
6197
|
+
overflow: hidden;
|
|
6198
|
+
background: ${(p) => p.$color};
|
|
6199
|
+
border: 1.5px ${(p) => p.$dashed ? "dashed" : "solid"} ${(p) => p.$color};
|
|
6200
|
+
opacity: ${(p) => p.$dashed ? 0.9 : 1};
|
|
6201
|
+
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
|
|
6202
|
+
`;
|
|
6203
|
+
var BarLabel = styled52.span`
|
|
6204
|
+
font-size: 10px;
|
|
6205
|
+
font-weight: 600;
|
|
6206
|
+
color: ${(p) => p.$textColor};
|
|
6207
|
+
white-space: nowrap;
|
|
6208
|
+
overflow: hidden;
|
|
6209
|
+
text-overflow: ellipsis;
|
|
6210
|
+
`;
|
|
6211
|
+
var Dot3 = styled52.span`
|
|
6212
|
+
display: inline-block;
|
|
6213
|
+
width: 9px;
|
|
6214
|
+
height: 9px;
|
|
6215
|
+
border-radius: 3px;
|
|
6216
|
+
flex-shrink: 0;
|
|
6217
|
+
background: ${(p) => p.$color};
|
|
6218
|
+
`;
|
|
6219
|
+
var Swatch2 = styled52.span`
|
|
6220
|
+
display: inline-block;
|
|
6221
|
+
width: 18px;
|
|
6222
|
+
height: 12px;
|
|
6223
|
+
border-radius: 3px;
|
|
6224
|
+
flex-shrink: 0;
|
|
6225
|
+
box-sizing: border-box;
|
|
6226
|
+
background: ${(p) => p.$filled ? p.$color : "transparent"};
|
|
6227
|
+
border: 1.5px solid ${(p) => p.$color};
|
|
6228
|
+
`;
|
|
6066
6229
|
var Gantt = ({
|
|
6067
6230
|
days,
|
|
6068
6231
|
rows,
|
|
@@ -6076,105 +6239,82 @@ var Gantt = ({
|
|
|
6076
6239
|
}) => {
|
|
6077
6240
|
const bodyHeight = rows.length * rowHeight;
|
|
6078
6241
|
const clickable = Boolean(onRowClick);
|
|
6079
|
-
return /* @__PURE__ */ jsxs36(
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
))
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6242
|
+
return /* @__PURE__ */ jsxs36(Root, { $labelWidth: labelWidth, $maxHeight: maxHeight, children: [
|
|
6243
|
+
/* @__PURE__ */ jsxs36(Axis, { children: [
|
|
6244
|
+
/* @__PURE__ */ jsx63(AxisLabel, { children: labelHeader }),
|
|
6245
|
+
/* @__PURE__ */ jsx63(AxisDays, { children: days.map((day) => /* @__PURE__ */ jsx63(
|
|
6246
|
+
AxisDay,
|
|
6247
|
+
{
|
|
6248
|
+
$leftPct: day.leftPct,
|
|
6249
|
+
$widthPct: day.widthPct,
|
|
6250
|
+
children: day.label
|
|
6251
|
+
},
|
|
6252
|
+
day.key
|
|
6253
|
+
)) })
|
|
6254
|
+
] }),
|
|
6255
|
+
/* @__PURE__ */ jsxs36(Body, { children: [
|
|
6256
|
+
/* @__PURE__ */ jsx63(Labels, { children: rows.map((row, i) => /* @__PURE__ */ jsx63(
|
|
6257
|
+
LabelRow,
|
|
6258
|
+
{
|
|
6259
|
+
$rowHeight: rowHeight,
|
|
6260
|
+
$alt: i % 2 === 1,
|
|
6261
|
+
$clickable: clickable,
|
|
6262
|
+
onClick: onRowClick ? () => onRowClick(row, i) : void 0,
|
|
6263
|
+
children: renderLabel(row, i)
|
|
6264
|
+
},
|
|
6265
|
+
row.key
|
|
6266
|
+
)) }),
|
|
6267
|
+
/* @__PURE__ */ jsx63(TimelineCol, { children: /* @__PURE__ */ jsxs36(Timeline2, { $height: bodyHeight, children: [
|
|
6268
|
+
days.map((day, i) => /* @__PURE__ */ jsx63(
|
|
6269
|
+
Day,
|
|
6270
|
+
{
|
|
6271
|
+
$leftPct: day.leftPct,
|
|
6272
|
+
$widthPct: day.widthPct,
|
|
6273
|
+
$alt: i % 2 === 1
|
|
6274
|
+
},
|
|
6275
|
+
day.key
|
|
6276
|
+
)),
|
|
6277
|
+
bands.map((band) => /* @__PURE__ */ jsx63(
|
|
6278
|
+
Band,
|
|
6279
|
+
{
|
|
6280
|
+
title: band.title,
|
|
6281
|
+
$leftPct: band.leftPct,
|
|
6282
|
+
$widthPct: band.widthPct
|
|
6283
|
+
},
|
|
6284
|
+
band.key
|
|
6285
|
+
)),
|
|
6286
|
+
rows.map((row, i) => {
|
|
6287
|
+
var _a, _b, _c;
|
|
6288
|
+
return /* @__PURE__ */ jsx63(
|
|
6289
|
+
Track3,
|
|
6104
6290
|
{
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6291
|
+
$top: i * rowHeight,
|
|
6292
|
+
$rowHeight: rowHeight,
|
|
6293
|
+
$first: i === 0,
|
|
6294
|
+
children: row.bar && /* @__PURE__ */ jsx63(
|
|
6295
|
+
Bar,
|
|
6296
|
+
{
|
|
6297
|
+
title: (_b = (_a = row.bar.title) != null ? _a : row.bar.label) != null ? _b : void 0,
|
|
6298
|
+
$leftPct: row.bar.leftPct,
|
|
6299
|
+
$widthPct: row.bar.widthPct,
|
|
6300
|
+
$color: row.bar.color,
|
|
6301
|
+
$dashed: Boolean(row.bar.dashed),
|
|
6302
|
+
children: row.bar.label && /* @__PURE__ */ jsx63(BarLabel, { $textColor: (_c = row.bar.textColor) != null ? _c : colors.white, children: row.bar.label })
|
|
6303
|
+
}
|
|
6304
|
+
)
|
|
6112
6305
|
},
|
|
6113
6306
|
row.key
|
|
6114
|
-
)
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
className: `dz-gantt__day ${i % 2 === 1 ? "dz-gantt__day--alt" : ""}`,
|
|
6120
|
-
style: { left: `${day.leftPct}%`, width: `${day.widthPct}%` }
|
|
6121
|
-
},
|
|
6122
|
-
day.key
|
|
6123
|
-
)),
|
|
6124
|
-
bands.map((band) => /* @__PURE__ */ jsx63(
|
|
6125
|
-
"div",
|
|
6126
|
-
{
|
|
6127
|
-
className: "dz-gantt__band",
|
|
6128
|
-
title: band.title,
|
|
6129
|
-
style: { left: `${band.leftPct}%`, width: `${band.widthPct}%` }
|
|
6130
|
-
},
|
|
6131
|
-
band.key
|
|
6132
|
-
)),
|
|
6133
|
-
rows.map((row, i) => {
|
|
6134
|
-
var _a, _b, _c;
|
|
6135
|
-
return /* @__PURE__ */ jsx63(
|
|
6136
|
-
"div",
|
|
6137
|
-
{
|
|
6138
|
-
className: "dz-gantt__track",
|
|
6139
|
-
style: { top: i * rowHeight, height: rowHeight },
|
|
6140
|
-
children: row.bar && /* @__PURE__ */ jsx63(
|
|
6141
|
-
"div",
|
|
6142
|
-
{
|
|
6143
|
-
className: `dz-gantt__bar ${row.bar.dashed ? "dz-gantt__bar--approx" : ""}`,
|
|
6144
|
-
title: (_b = (_a = row.bar.title) != null ? _a : row.bar.label) != null ? _b : void 0,
|
|
6145
|
-
style: {
|
|
6146
|
-
left: `${row.bar.leftPct}%`,
|
|
6147
|
-
width: `${row.bar.widthPct}%`,
|
|
6148
|
-
["--dz-gantt-bar-color"]: row.bar.color,
|
|
6149
|
-
["--dz-gantt-bar-text"]: (_c = row.bar.textColor) != null ? _c : "#fff"
|
|
6150
|
-
},
|
|
6151
|
-
children: row.bar.label && /* @__PURE__ */ jsx63("span", { className: "dz-gantt__bar-label", children: row.bar.label })
|
|
6152
|
-
}
|
|
6153
|
-
)
|
|
6154
|
-
},
|
|
6155
|
-
row.key
|
|
6156
|
-
);
|
|
6157
|
-
})
|
|
6158
|
-
] }) })
|
|
6159
|
-
] })
|
|
6160
|
-
]
|
|
6161
|
-
}
|
|
6162
|
-
);
|
|
6307
|
+
);
|
|
6308
|
+
})
|
|
6309
|
+
] }) })
|
|
6310
|
+
] })
|
|
6311
|
+
] });
|
|
6163
6312
|
};
|
|
6164
|
-
var GanttDot = ({ color }) => /* @__PURE__ */ jsx63(
|
|
6313
|
+
var GanttDot = ({ color }) => /* @__PURE__ */ jsx63(Dot3, { $color: color });
|
|
6165
6314
|
var GanttSwatch = ({
|
|
6166
6315
|
color,
|
|
6167
6316
|
filled = true
|
|
6168
|
-
}) => /* @__PURE__ */ jsx63(
|
|
6169
|
-
"span",
|
|
6170
|
-
{
|
|
6171
|
-
className: "dz-gantt__swatch",
|
|
6172
|
-
style: {
|
|
6173
|
-
background: filled ? color : "transparent",
|
|
6174
|
-
border: `1.5px solid ${color}`
|
|
6175
|
-
}
|
|
6176
|
-
}
|
|
6177
|
-
);
|
|
6317
|
+
}) => /* @__PURE__ */ jsx63(Swatch2, { $color: color, $filled: filled });
|
|
6178
6318
|
|
|
6179
6319
|
// src/data/globalMethods.ts
|
|
6180
6320
|
var formatDate = (dateString, type = "date", language = "en") => {
|