@cardenelabs/cdl 0.67.0 → 0.69.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/dist/react.js CHANGED
@@ -14434,15 +14434,16 @@ function GanttNode({
14434
14434
  const x0 = node.cx - node.w / 2;
14435
14435
  const y0 = node.cy - node.h / 2;
14436
14436
  const tasks = resolveGanttData(node.ganttData ?? [], stateValues);
14437
- const PAD_TOP2 = 32;
14437
+ const PAD_TOP2 = 46;
14438
14438
  const PAD_RIGHT2 = 48;
14439
- const PAD_BOTTOM2 = 44;
14439
+ const PAD_BOTTOM2 = 26;
14440
14440
  const PAD_LEFT2 = 156;
14441
14441
  const canvasW = node.w - PAD_LEFT2 - PAD_RIGHT2;
14442
14442
  const canvasH = node.h - PAD_TOP2 - PAD_BOTTOM2;
14443
14443
  const rowGap = 20;
14444
14444
  const rowCount = tasks.length || 1;
14445
14445
  const rowH = Math.max(28, (canvasH - rowGap * (rowCount + 1)) / rowCount);
14446
+ const \u5E2F\u306E\u9AD8\u3055 = Math.min(rowH, 30);
14446
14447
  const \u4F4D\u7F6E\u306E\u4E0A\u9650 = 1e6;
14447
14448
  const \u53CE\u3081\u305F = tasks.map((t) => {
14448
14449
  const \u59CB = Math.min(\u4F4D\u7F6E\u306E\u4E0A\u9650, Math.max(0, Number.isFinite(t.startIdx) ? t.startIdx : 0));
@@ -14468,6 +14469,7 @@ function GanttNode({
14468
14469
  const \u76EE\u76DB\u308A\u306E\u672C\u6570 = Math.ceil(maxIdx / \u76EE\u76DB\u308A\u306E\u9593\u9694);
14469
14470
  const xAt = (idx) => PAD_LEFT2 + idx * cellW;
14470
14471
  const yAt = (row) => PAD_TOP2 + rowGap + row * (rowH + rowGap);
14472
+ const \u5E2F\u306E\u4E0A = (row) => yAt(row) + (rowH - \u5E2F\u306E\u9AD8\u3055) / 2;
14471
14473
  const \u540D\u524D = { \u6574\u6570\u306E\u958B\u59CB: /* @__PURE__ */ new Map(), \u6574\u6570\u306E\u7D42\u4E86: /* @__PURE__ */ new Map(), \u7AEF\u6570\u306E\u958B\u59CB: /* @__PURE__ */ new Map(), \u7AEF\u6570\u306E\u7D42\u4E86: /* @__PURE__ */ new Map() };
14472
14474
  const \u7F6E\u304F = (\u8868, \u4F4D\u7F6E, label) => {
14473
14475
  if (label !== "" && Number.isFinite(\u4F4D\u7F6E) && !\u8868.has(\u4F4D\u7F6E)) \u8868.set(\u4F4D\u7F6E, label);
@@ -14492,6 +14494,27 @@ function GanttNode({
14492
14494
  const \u884C\u306E\u4F38\u3073 = (row) => \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, row + 1, rowCount);
14493
14495
  const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
14494
14496
  const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
14497
+ const \u7DDA\u306E\u53D6\u308A\u5206 = 0.35;
14498
+ const \u533A\u5207\u308B = (v) => Math.min(1, Math.max(0, v));
14499
+ const \u4E0A\u304B\u3089\u6765\u308B\u7DDA = (row) => {
14500
+ const t = \u6574\u3048\u305F[row];
14501
+ if (t === void 0 || t.dependsOn === void 0) return false;
14502
+ const \u89AA = taskById.get(t.dependsOn);
14503
+ if (\u89AA === void 0) return false;
14504
+ const \u89AA\u306E\u884C = rowOf.get(\u89AA.id);
14505
+ return \u89AA\u306E\u884C !== void 0 && \u89AA\u306E\u884C < row;
14506
+ };
14507
+ const \u5E2F\u306E\u4F38\u3073 = (row) => {
14508
+ const r = \u884C\u306E\u4F38\u3073(row);
14509
+ return \u4E0A\u304B\u3089\u6765\u308B\u7DDA(row) ? \u533A\u5207\u308B((r - \u7DDA\u306E\u53D6\u308A\u5206) / (1 - \u7DDA\u306E\u53D6\u308A\u5206)) : r;
14510
+ };
14511
+ const \u7DDA\u306E\u4F38\u3073 = (\u89AA\u306E\u884C, \u5B50\u306E\u884C) => {
14512
+ if (!drawing) return 1;
14513
+ if (\u89AA\u306E\u884C >= \u5B50\u306E\u884C) {
14514
+ return \u884C\u306E\u4F38\u3073(\u89AA\u306E\u884C) >= 1 && \u884C\u306E\u4F38\u3073(\u5B50\u306E\u884C) >= 1 ? 1 : 0;
14515
+ }
14516
+ return \u533A\u5207\u308B(\u884C\u306E\u4F38\u3073(\u5B50\u306E\u884C) / \u7DDA\u306E\u53D6\u308A\u5206);
14517
+ };
14495
14518
  return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
14496
14519
  /* @__PURE__ */ jsx(
14497
14520
  "rect",
@@ -14507,6 +14530,43 @@ function GanttNode({
14507
14530
  strokeWidth: active ? 3 : 1.25
14508
14531
  }
14509
14532
  ),
14533
+ \u6574\u3048\u305F.map(
14534
+ (t, row) => row % 2 === 0 ? null : /* @__PURE__ */ jsx(
14535
+ "rect",
14536
+ {
14537
+ "data-cdl-role": "gantt-row",
14538
+ x: PAD_LEFT2,
14539
+ y: yAt(row) - rowGap / 2,
14540
+ width: canvasW,
14541
+ height: rowH + rowGap,
14542
+ fill: "var(--cdl-surface-sunken, #f4f2ed)",
14543
+ opacity: 0.55
14544
+ },
14545
+ `band-${t.id}`
14546
+ )
14547
+ ),
14548
+ /* @__PURE__ */ jsx(
14549
+ "line",
14550
+ {
14551
+ x1: PAD_LEFT2,
14552
+ y1: PAD_TOP2,
14553
+ x2: PAD_LEFT2 + canvasW,
14554
+ y2: PAD_TOP2,
14555
+ stroke: "var(--cdl-divider, #d4d4d8)",
14556
+ strokeWidth: 1
14557
+ }
14558
+ ),
14559
+ /* @__PURE__ */ jsx(
14560
+ "line",
14561
+ {
14562
+ x1: PAD_LEFT2,
14563
+ y1: PAD_TOP2,
14564
+ x2: PAD_LEFT2,
14565
+ y2: PAD_TOP2 + canvasH,
14566
+ stroke: "var(--cdl-divider, #d4d4d8)",
14567
+ strokeWidth: 1
14568
+ }
14569
+ ),
14510
14570
  gridLabels.map(({ \u4F4D\u7F6E: i, label }) => /* @__PURE__ */ jsxs("g", { children: [
14511
14571
  /* @__PURE__ */ jsx(
14512
14572
  "line",
@@ -14517,9 +14577,8 @@ function GanttNode({
14517
14577
  x2: xAt(i),
14518
14578
  y2: PAD_TOP2 + canvasH,
14519
14579
  stroke: "var(--cdl-divider, #d4d4d8)",
14520
- strokeWidth: 0.75,
14521
- strokeDasharray: "3 3",
14522
- opacity: 0.5
14580
+ strokeWidth: 1,
14581
+ opacity: 0.45
14523
14582
  }
14524
14583
  ),
14525
14584
  label === "" ? null : /* @__PURE__ */ jsx(
@@ -14527,7 +14586,7 @@ function GanttNode({
14527
14586
  {
14528
14587
  "data-cdl-role": "gantt-tick",
14529
14588
  x: xAt(i) + cellW / 2,
14530
- y: PAD_TOP2 + canvasH + 18,
14589
+ y: PAD_TOP2 - 16,
14531
14590
  fontSize: 11,
14532
14591
  textAnchor: "middle",
14533
14592
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -14543,14 +14602,14 @@ function GanttNode({
14543
14602
  x2: xAt(maxIdx),
14544
14603
  y2: PAD_TOP2 + canvasH,
14545
14604
  stroke: "var(--cdl-divider, #d4d4d8)",
14546
- strokeWidth: 0.75,
14547
- opacity: 0.5
14605
+ strokeWidth: 1,
14606
+ opacity: 0.45
14548
14607
  }
14549
14608
  ),
14550
14609
  \u6574\u3048\u305F.map((t, row) => /* @__PURE__ */ jsx(
14551
14610
  "text",
14552
14611
  {
14553
- x: PAD_LEFT2 - 12,
14612
+ x: PAD_LEFT2 - 16,
14554
14613
  y: yAt(row) + rowH / 2 + 4,
14555
14614
  fontSize: 12,
14556
14615
  textAnchor: "end",
@@ -14562,37 +14621,33 @@ function GanttNode({
14562
14621
  )),
14563
14622
  \u6574\u3048\u305F.map((t, row) => {
14564
14623
  const bx = \u5E2F\u306E\u5DE6(t.startIdx);
14565
- const by = yAt(row);
14624
+ const by = \u5E2F\u306E\u4E0A(row);
14566
14625
  const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
14567
- const \u3053\u306E\u884C = \u884C\u306E\u4F38\u3073(row);
14626
+ const \u3053\u306E\u884C = \u5E2F\u306E\u4F38\u3073(row);
14627
+ const \u4ECA\u306E\u5E45 = drawing ? bw * \u3053\u306E\u884C : bw;
14568
14628
  return /* @__PURE__ */ jsxs("g", { children: [
14569
14629
  /* @__PURE__ */ jsx(
14570
- "g",
14630
+ "rect",
14571
14631
  {
14572
- ...drawing ? { transform: `translate(${bx} 0) scale(${\u3053\u306E\u884C} 1) translate(${-bx} 0)` } : {},
14573
- children: /* @__PURE__ */ jsx(
14574
- "rect",
14575
- {
14576
- "data-cdl-role": "gantt-bar",
14577
- "data-cdl-unresolved": t.unresolved ? "true" : void 0,
14578
- "data-cdl-clipped": "clipped" in t && t.clipped ? "true" : void 0,
14579
- x: bx,
14580
- y: by,
14581
- width: bw,
14582
- height: rowH,
14583
- rx: 4,
14584
- fill: toneColor4(t.tone),
14585
- fillOpacity: 0.9
14586
- }
14587
- )
14632
+ "data-cdl-role": "gantt-bar",
14633
+ "data-cdl-unresolved": t.unresolved ? "true" : void 0,
14634
+ "data-cdl-clipped": "clipped" in t && t.clipped ? "true" : void 0,
14635
+ x: bx,
14636
+ y: by,
14637
+ width: \u4ECA\u306E\u5E45,
14638
+ height: \u5E2F\u306E\u9AD8\u3055,
14639
+ rx: \u5E2F\u306E\u9AD8\u3055 / 2,
14640
+ ry: \u5E2F\u306E\u9AD8\u3055 / 2,
14641
+ fill: toneColor4(t.tone),
14642
+ fillOpacity: 0.9
14588
14643
  }
14589
14644
  ),
14590
- t.owner && rowH >= 22 && \u3053\u306E\u884C >= 1 && /* @__PURE__ */ jsx(
14645
+ t.owner && \u5E2F\u306E\u9AD8\u3055 >= 22 && \u3053\u306E\u884C >= 1 && /* @__PURE__ */ jsx(
14591
14646
  "text",
14592
14647
  {
14593
14648
  "data-cdl-role": "gantt-owner",
14594
14649
  x: bx + bw / 2,
14595
- y: by + rowH / 2 + 4,
14650
+ y: by + \u5E2F\u306E\u9AD8\u3055 / 2 + 4,
14596
14651
  fontSize: 11,
14597
14652
  textAnchor: "middle",
14598
14653
  fill: "var(--cdl-node-fill, #ffffff)",
@@ -14607,33 +14662,36 @@ function GanttNode({
14607
14662
  const parentRow = rowOf.get(parent.id);
14608
14663
  const childRow = rowOf.get(t.id);
14609
14664
  const parentBarRight = \u5E2F\u306E\u53F3(parent.endIdx);
14610
- const parentMidY = yAt(parentRow) + rowH / 2;
14611
14665
  const childBarLeft = \u5E2F\u306E\u5DE6(t.startIdx);
14612
- const childMidY = yAt(childRow) + rowH / 2;
14613
- const arrowHeadSize = 8;
14614
- const arrowHeadTipGap = 10;
14615
- const tipX = childBarLeft - arrowHeadTipGap - arrowHeadSize;
14616
- const tipY = childMidY;
14617
- const startX = parentBarRight + 4;
14618
- const elbowGap = 6;
14619
- const enterX = tipX - elbowGap;
14620
- const hasRoom = enterX - startX >= elbowGap;
14621
- const path = hasRoom ? `M ${startX} ${parentMidY} L ${enterX} ${parentMidY} L ${enterX} ${tipY} L ${tipX} ${tipY}` : `M ${startX} ${parentMidY} L ${startX + elbowGap} ${parentMidY} L ${startX + elbowGap} ${(parentMidY + tipY) / 2} L ${enterX} ${(parentMidY + tipY) / 2} L ${enterX} ${tipY} L ${tipX} ${tipY}`;
14622
- const arrowHeadPath = `M ${tipX + arrowHeadSize} ${tipY} L ${tipX} ${tipY - arrowHeadSize / 2} L ${tipX} ${tipY + arrowHeadSize / 2} Z`;
14623
- const \u4E21\u7AEF\u304C\u51FA\u305F = \u884C\u306E\u4F38\u3073(parentRow) >= 1 && \u884C\u306E\u4F38\u3073(childRow) >= 1;
14624
- return drawing && !\u4E21\u7AEF\u304C\u51FA\u305F ? null : /* @__PURE__ */ jsxs("g", { "data-cdl-role": "gantt-arrow", children: [
14666
+ const \u77E2\u3058\u308A\u306E\u5E45 = 11;
14667
+ const \u77E2\u3058\u308A\u306E\u9AD8\u3055 = 7;
14668
+ const \u4E38\u307F = \u5E2F\u306E\u9AD8\u3055 / 2;
14669
+ const \u89AA\u306E\u5DE6 = \u5E2F\u306E\u5DE6(parent.startIdx);
14670
+ const \u5B50\u306E\u53F3 = \u5E2F\u306E\u53F3(t.endIdx);
14671
+ const \u5BC4\u305B = (\u5DE6, \u53F3) => Math.min(\u4E38\u307F, (\u53F3 - \u5DE6) / 2);
14672
+ const \u51FA\u767AX = parentBarRight - \u5BC4\u305B(\u89AA\u306E\u5DE6, parentBarRight);
14673
+ const \u51FA\u767AY = \u5E2F\u306E\u4E0A(parentRow) + \u5E2F\u306E\u9AD8\u3055;
14674
+ const \u7740\u5730X = childBarLeft + \u5BC4\u305B(childBarLeft, \u5B50\u306E\u53F3);
14675
+ const \u7740\u5730Y = \u5E2F\u306E\u4E0A(childRow);
14676
+ const \u7E26\u306E\u7D42\u308F\u308AY = \u7740\u5730Y - \u77E2\u3058\u308A\u306E\u9AD8\u3055;
14677
+ const \u624B = Math.max(6, (\u7E26\u306E\u7D42\u308F\u308AY - \u51FA\u767AY) * 0.55);
14678
+ const path = `M ${\u51FA\u767AX} ${\u51FA\u767AY} C ${\u51FA\u767AX} ${\u51FA\u767AY + \u624B}, ${\u7740\u5730X} ${\u7E26\u306E\u7D42\u308F\u308AY - \u624B}, ${\u7740\u5730X} ${\u7E26\u306E\u7D42\u308F\u308AY}`;
14679
+ const arrowHeadPath = `M ${\u7740\u5730X} ${\u7740\u5730Y} L ${\u7740\u5730X - \u77E2\u3058\u308A\u306E\u5E45 / 2} ${\u7E26\u306E\u7D42\u308F\u308AY} L ${\u7740\u5730X + \u77E2\u3058\u308A\u306E\u5E45 / 2} ${\u7E26\u306E\u7D42\u308F\u308AY} Z`;
14680
+ const \u5F15\u3051\u305F = \u7DDA\u306E\u4F38\u3073(parentRow, childRow);
14681
+ return \u5F15\u3051\u305F <= 0 ? null : /* @__PURE__ */ jsxs("g", { "data-cdl-role": "gantt-arrow", children: [
14625
14682
  /* @__PURE__ */ jsx(
14626
14683
  "path",
14627
14684
  {
14628
14685
  d: path,
14629
14686
  fill: "none",
14630
14687
  stroke: "var(--cdl-text-mute, #8a8678)",
14631
- strokeWidth: 1.75,
14688
+ strokeWidth: 2.4,
14632
14689
  strokeLinejoin: "round",
14633
- strokeLinecap: "round"
14690
+ strokeLinecap: "round",
14691
+ ...\u4F38\u3070\u3059dash(drawing, \u5F15\u3051\u305F)
14634
14692
  }
14635
14693
  ),
14636
- /* @__PURE__ */ jsx(
14694
+ \u5F15\u3051\u305F < 1 ? null : /* @__PURE__ */ jsx(
14637
14695
  "path",
14638
14696
  {
14639
14697
  d: arrowHeadPath,