@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/CHANGELOG.md +40 -1
- package/dist/index.cjs +48 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +48 -48
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +48 -48
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +48 -48
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/kinds/gantt.tsx +57 -24
package/dist/index.js
CHANGED
|
@@ -27027,6 +27027,7 @@ function GanttNode({
|
|
|
27027
27027
|
const \u5E2F\u306E\u5DE6 = (idx) => xAt(idx) + \u5E2F\u306E\u4F59\u767D / 2;
|
|
27028
27028
|
const \u5E2F\u306E\u53F3 = (idx) => xAt(idx) + cellW - \u5E2F\u306E\u4F59\u767D / 2;
|
|
27029
27029
|
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
27030
|
+
const \u884C\u306E\u4F38\u3073 = (row) => \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, row + 1, rowCount);
|
|
27030
27031
|
const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
|
|
27031
27032
|
const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
|
|
27032
27033
|
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
|
|
@@ -27101,12 +27102,13 @@ function GanttNode({
|
|
|
27101
27102
|
const bx = \u5E2F\u306E\u5DE6(t.startIdx);
|
|
27102
27103
|
const by = yAt(row);
|
|
27103
27104
|
const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
|
|
27104
|
-
|
|
27105
|
-
|
|
27106
|
-
|
|
27107
|
-
|
|
27108
|
-
|
|
27109
|
-
|
|
27105
|
+
const \u3053\u306E\u884C = \u884C\u306E\u4F38\u3073(row);
|
|
27106
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
27107
|
+
/* @__PURE__ */ jsx(
|
|
27108
|
+
"g",
|
|
27109
|
+
{
|
|
27110
|
+
...drawing ? { transform: `translate(${bx} 0) scale(${\u3053\u306E\u884C} 1) translate(${-bx} 0)` } : {},
|
|
27111
|
+
children: /* @__PURE__ */ jsx(
|
|
27110
27112
|
"rect",
|
|
27111
27113
|
{
|
|
27112
27114
|
"data-cdl-role": "gantt-bar",
|
|
@@ -27120,22 +27122,23 @@ function GanttNode({
|
|
|
27120
27122
|
fill: toneColor4(t.tone),
|
|
27121
27123
|
fillOpacity: 0.9
|
|
27122
27124
|
}
|
|
27123
|
-
),
|
|
27124
|
-
t.owner && rowH >= 22 && /* @__PURE__ */ jsx(
|
|
27125
|
-
"text",
|
|
27126
|
-
{
|
|
27127
|
-
x: bx + 8,
|
|
27128
|
-
y: by + rowH / 2 + 4,
|
|
27129
|
-
fontSize: 11,
|
|
27130
|
-
fill: "var(--cdl-node-fill, #ffffff)",
|
|
27131
|
-
fontWeight: 600,
|
|
27132
|
-
children: t.owner
|
|
27133
|
-
}
|
|
27134
27125
|
)
|
|
27135
|
-
|
|
27136
|
-
|
|
27137
|
-
|
|
27138
|
-
|
|
27126
|
+
}
|
|
27127
|
+
),
|
|
27128
|
+
t.owner && rowH >= 22 && \u3053\u306E\u884C >= 1 && /* @__PURE__ */ jsx(
|
|
27129
|
+
"text",
|
|
27130
|
+
{
|
|
27131
|
+
"data-cdl-role": "gantt-owner",
|
|
27132
|
+
x: bx + bw / 2,
|
|
27133
|
+
y: by + rowH / 2 + 4,
|
|
27134
|
+
fontSize: 11,
|
|
27135
|
+
textAnchor: "middle",
|
|
27136
|
+
fill: "var(--cdl-node-fill, #ffffff)",
|
|
27137
|
+
fontWeight: 600,
|
|
27138
|
+
children: t.owner
|
|
27139
|
+
}
|
|
27140
|
+
)
|
|
27141
|
+
] }, `bar-${t.id}`);
|
|
27139
27142
|
}),
|
|
27140
27143
|
\u6574\u3048\u305F.filter((t) => t.dependsOn && taskById.has(t.dependsOn)).map((t) => {
|
|
27141
27144
|
const parent = taskById.get(t.dependsOn);
|
|
@@ -27155,33 +27158,30 @@ function GanttNode({
|
|
|
27155
27158
|
const hasRoom = enterX - startX >= elbowGap;
|
|
27156
27159
|
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}`;
|
|
27157
27160
|
const arrowHeadPath = `M ${tipX + arrowHeadSize} ${tipY} L ${tipX} ${tipY - arrowHeadSize / 2} L ${tipX} ${tipY + arrowHeadSize / 2} Z`;
|
|
27158
|
-
|
|
27159
|
-
|
|
27160
|
-
|
|
27161
|
-
|
|
27162
|
-
|
|
27163
|
-
|
|
27164
|
-
|
|
27165
|
-
|
|
27166
|
-
|
|
27167
|
-
|
|
27168
|
-
|
|
27169
|
-
|
|
27170
|
-
|
|
27171
|
-
|
|
27172
|
-
|
|
27173
|
-
|
|
27174
|
-
|
|
27175
|
-
|
|
27176
|
-
|
|
27177
|
-
|
|
27178
|
-
|
|
27179
|
-
|
|
27180
|
-
|
|
27181
|
-
|
|
27182
|
-
)
|
|
27183
|
-
] }, `dep-${parent.id}-${t.id}`)
|
|
27184
|
-
);
|
|
27161
|
+
const \u4E21\u7AEF\u304C\u51FA\u305F = \u884C\u306E\u4F38\u3073(parentRow) >= 1 && \u884C\u306E\u4F38\u3073(childRow) >= 1;
|
|
27162
|
+
return drawing && !\u4E21\u7AEF\u304C\u51FA\u305F ? null : /* @__PURE__ */ jsxs("g", { "data-cdl-role": "gantt-arrow", children: [
|
|
27163
|
+
/* @__PURE__ */ jsx(
|
|
27164
|
+
"path",
|
|
27165
|
+
{
|
|
27166
|
+
d: path,
|
|
27167
|
+
fill: "none",
|
|
27168
|
+
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
27169
|
+
strokeWidth: 1.75,
|
|
27170
|
+
strokeLinejoin: "round",
|
|
27171
|
+
strokeLinecap: "round"
|
|
27172
|
+
}
|
|
27173
|
+
),
|
|
27174
|
+
/* @__PURE__ */ jsx(
|
|
27175
|
+
"path",
|
|
27176
|
+
{
|
|
27177
|
+
d: arrowHeadPath,
|
|
27178
|
+
fill: "var(--cdl-text-mute, #8a8678)",
|
|
27179
|
+
stroke: "var(--cdl-text-mute, #8a8678)",
|
|
27180
|
+
strokeWidth: 0.5,
|
|
27181
|
+
strokeLinejoin: "round"
|
|
27182
|
+
}
|
|
27183
|
+
)
|
|
27184
|
+
] }, `dep-${parent.id}-${t.id}`);
|
|
27185
27185
|
})
|
|
27186
27186
|
] });
|
|
27187
27187
|
}
|