@cardenelabs/cdl 0.66.0 → 0.67.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
@@ -14489,6 +14489,7 @@ function GanttNode({
14489
14489
  const \u5E2F\u306E\u5DE6 = (idx) => xAt(idx) + \u5E2F\u306E\u4F59\u767D / 2;
14490
14490
  const \u5E2F\u306E\u53F3 = (idx) => xAt(idx) + cellW - \u5E2F\u306E\u4F59\u767D / 2;
14491
14491
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
14492
+ const \u884C\u306E\u4F38\u3073 = (row) => \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, row + 1, rowCount);
14492
14493
  const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
14493
14494
  const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
14494
14495
  return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
@@ -14563,12 +14564,13 @@ function GanttNode({
14563
14564
  const bx = \u5E2F\u306E\u5DE6(t.startIdx);
14564
14565
  const by = yAt(row);
14565
14566
  const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
14566
- return /* @__PURE__ */ jsxs(
14567
- "g",
14568
- {
14569
- ...drawing ? { transform: `translate(${bx} 0) scale(${\u4F38\u3073} 1) translate(${-bx} 0)` } : {},
14570
- children: [
14571
- /* @__PURE__ */ jsx(
14567
+ const \u3053\u306E\u884C = \u884C\u306E\u4F38\u3073(row);
14568
+ return /* @__PURE__ */ jsxs("g", { children: [
14569
+ /* @__PURE__ */ jsx(
14570
+ "g",
14571
+ {
14572
+ ...drawing ? { transform: `translate(${bx} 0) scale(${\u3053\u306E\u884C} 1) translate(${-bx} 0)` } : {},
14573
+ children: /* @__PURE__ */ jsx(
14572
14574
  "rect",
14573
14575
  {
14574
14576
  "data-cdl-role": "gantt-bar",
@@ -14582,22 +14584,23 @@ function GanttNode({
14582
14584
  fill: toneColor4(t.tone),
14583
14585
  fillOpacity: 0.9
14584
14586
  }
14585
- ),
14586
- t.owner && rowH >= 22 && /* @__PURE__ */ jsx(
14587
- "text",
14588
- {
14589
- x: bx + 8,
14590
- y: by + rowH / 2 + 4,
14591
- fontSize: 11,
14592
- fill: "var(--cdl-node-fill, #ffffff)",
14593
- fontWeight: 600,
14594
- children: t.owner
14595
- }
14596
14587
  )
14597
- ]
14598
- },
14599
- `bar-${t.id}`
14600
- );
14588
+ }
14589
+ ),
14590
+ t.owner && rowH >= 22 && \u3053\u306E\u884C >= 1 && /* @__PURE__ */ jsx(
14591
+ "text",
14592
+ {
14593
+ "data-cdl-role": "gantt-owner",
14594
+ x: bx + bw / 2,
14595
+ y: by + rowH / 2 + 4,
14596
+ fontSize: 11,
14597
+ textAnchor: "middle",
14598
+ fill: "var(--cdl-node-fill, #ffffff)",
14599
+ fontWeight: 600,
14600
+ children: t.owner
14601
+ }
14602
+ )
14603
+ ] }, `bar-${t.id}`);
14601
14604
  }),
14602
14605
  \u6574\u3048\u305F.filter((t) => t.dependsOn && taskById.has(t.dependsOn)).map((t) => {
14603
14606
  const parent = taskById.get(t.dependsOn);
@@ -14617,33 +14620,30 @@ function GanttNode({
14617
14620
  const hasRoom = enterX - startX >= elbowGap;
14618
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}`;
14619
14622
  const arrowHeadPath = `M ${tipX + arrowHeadSize} ${tipY} L ${tipX} ${tipY - arrowHeadSize / 2} L ${tipX} ${tipY + arrowHeadSize / 2} Z`;
14620
- return (
14621
- // 矢印は両端の帯が出てから描く。 帯が無い場所へ矢印だけが伸びると、
14622
- // 指す先の無い線になる (cdl#521)
14623
- drawing && \u4F38\u3073 < 1 ? null : /* @__PURE__ */ jsxs("g", { "data-cdl-role": "gantt-arrow", children: [
14624
- /* @__PURE__ */ jsx(
14625
- "path",
14626
- {
14627
- d: path,
14628
- fill: "none",
14629
- stroke: "var(--cdl-text-mute, #8a8678)",
14630
- strokeWidth: 1.75,
14631
- strokeLinejoin: "round",
14632
- strokeLinecap: "round"
14633
- }
14634
- ),
14635
- /* @__PURE__ */ jsx(
14636
- "path",
14637
- {
14638
- d: arrowHeadPath,
14639
- fill: "var(--cdl-text-mute, #8a8678)",
14640
- stroke: "var(--cdl-text-mute, #8a8678)",
14641
- strokeWidth: 0.5,
14642
- strokeLinejoin: "round"
14643
- }
14644
- )
14645
- ] }, `dep-${parent.id}-${t.id}`)
14646
- );
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: [
14625
+ /* @__PURE__ */ jsx(
14626
+ "path",
14627
+ {
14628
+ d: path,
14629
+ fill: "none",
14630
+ stroke: "var(--cdl-text-mute, #8a8678)",
14631
+ strokeWidth: 1.75,
14632
+ strokeLinejoin: "round",
14633
+ strokeLinecap: "round"
14634
+ }
14635
+ ),
14636
+ /* @__PURE__ */ jsx(
14637
+ "path",
14638
+ {
14639
+ d: arrowHeadPath,
14640
+ fill: "var(--cdl-text-mute, #8a8678)",
14641
+ stroke: "var(--cdl-text-mute, #8a8678)",
14642
+ strokeWidth: 0.5,
14643
+ strokeLinejoin: "round"
14644
+ }
14645
+ )
14646
+ ] }, `dep-${parent.id}-${t.id}`);
14647
14647
  })
14648
14648
  ] });
14649
14649
  }