@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/index.js CHANGED
@@ -26972,15 +26972,16 @@ function GanttNode({
26972
26972
  const x0 = node.cx - node.w / 2;
26973
26973
  const y0 = node.cy - node.h / 2;
26974
26974
  const tasks = resolveGanttData(node.ganttData ?? [], stateValues);
26975
- const PAD_TOP2 = 32;
26975
+ const PAD_TOP2 = 46;
26976
26976
  const PAD_RIGHT2 = 48;
26977
- const PAD_BOTTOM2 = 44;
26977
+ const PAD_BOTTOM2 = 26;
26978
26978
  const PAD_LEFT2 = 156;
26979
26979
  const canvasW = node.w - PAD_LEFT2 - PAD_RIGHT2;
26980
26980
  const canvasH = node.h - PAD_TOP2 - PAD_BOTTOM2;
26981
26981
  const rowGap = 20;
26982
26982
  const rowCount = tasks.length || 1;
26983
26983
  const rowH = Math.max(28, (canvasH - rowGap * (rowCount + 1)) / rowCount);
26984
+ const \u5E2F\u306E\u9AD8\u3055 = Math.min(rowH, 30);
26984
26985
  const \u4F4D\u7F6E\u306E\u4E0A\u9650 = 1e6;
26985
26986
  const \u53CE\u3081\u305F = tasks.map((t) => {
26986
26987
  const \u59CB = Math.min(\u4F4D\u7F6E\u306E\u4E0A\u9650, Math.max(0, Number.isFinite(t.startIdx) ? t.startIdx : 0));
@@ -27006,6 +27007,7 @@ function GanttNode({
27006
27007
  const \u76EE\u76DB\u308A\u306E\u672C\u6570 = Math.ceil(maxIdx / \u76EE\u76DB\u308A\u306E\u9593\u9694);
27007
27008
  const xAt = (idx) => PAD_LEFT2 + idx * cellW;
27008
27009
  const yAt = (row) => PAD_TOP2 + rowGap + row * (rowH + rowGap);
27010
+ const \u5E2F\u306E\u4E0A = (row) => yAt(row) + (rowH - \u5E2F\u306E\u9AD8\u3055) / 2;
27009
27011
  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() };
27010
27012
  const \u7F6E\u304F = (\u8868, \u4F4D\u7F6E, label) => {
27011
27013
  if (label !== "" && Number.isFinite(\u4F4D\u7F6E) && !\u8868.has(\u4F4D\u7F6E)) \u8868.set(\u4F4D\u7F6E, label);
@@ -27030,6 +27032,27 @@ function GanttNode({
27030
27032
  const \u884C\u306E\u4F38\u3073 = (row) => \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, row + 1, rowCount);
27031
27033
  const taskById = new Map(\u6574\u3048\u305F.map((t) => [t.id, t]));
27032
27034
  const rowOf = new Map(\u6574\u3048\u305F.map((t, i) => [t.id, i]));
27035
+ const \u7DDA\u306E\u53D6\u308A\u5206 = 0.35;
27036
+ const \u533A\u5207\u308B = (v) => Math.min(1, Math.max(0, v));
27037
+ const \u4E0A\u304B\u3089\u6765\u308B\u7DDA = (row) => {
27038
+ const t = \u6574\u3048\u305F[row];
27039
+ if (t === void 0 || t.dependsOn === void 0) return false;
27040
+ const \u89AA = taskById.get(t.dependsOn);
27041
+ if (\u89AA === void 0) return false;
27042
+ const \u89AA\u306E\u884C = rowOf.get(\u89AA.id);
27043
+ return \u89AA\u306E\u884C !== void 0 && \u89AA\u306E\u884C < row;
27044
+ };
27045
+ const \u5E2F\u306E\u4F38\u3073 = (row) => {
27046
+ const r = \u884C\u306E\u4F38\u3073(row);
27047
+ return \u4E0A\u304B\u3089\u6765\u308B\u7DDA(row) ? \u533A\u5207\u308B((r - \u7DDA\u306E\u53D6\u308A\u5206) / (1 - \u7DDA\u306E\u53D6\u308A\u5206)) : r;
27048
+ };
27049
+ const \u7DDA\u306E\u4F38\u3073 = (\u89AA\u306E\u884C, \u5B50\u306E\u884C) => {
27050
+ if (!drawing) return 1;
27051
+ if (\u89AA\u306E\u884C >= \u5B50\u306E\u884C) {
27052
+ return \u884C\u306E\u4F38\u3073(\u89AA\u306E\u884C) >= 1 && \u884C\u306E\u4F38\u3073(\u5B50\u306E\u884C) >= 1 ? 1 : 0;
27053
+ }
27054
+ return \u533A\u5207\u308B(\u884C\u306E\u4F38\u3073(\u5B50\u306E\u884C) / \u7DDA\u306E\u53D6\u308A\u5206);
27055
+ };
27033
27056
  return /* @__PURE__ */ jsxs("g", { transform: `translate(${x0} ${y0})`, children: [
27034
27057
  /* @__PURE__ */ jsx(
27035
27058
  "rect",
@@ -27045,6 +27068,43 @@ function GanttNode({
27045
27068
  strokeWidth: active ? 3 : 1.25
27046
27069
  }
27047
27070
  ),
27071
+ \u6574\u3048\u305F.map(
27072
+ (t, row) => row % 2 === 0 ? null : /* @__PURE__ */ jsx(
27073
+ "rect",
27074
+ {
27075
+ "data-cdl-role": "gantt-row",
27076
+ x: PAD_LEFT2,
27077
+ y: yAt(row) - rowGap / 2,
27078
+ width: canvasW,
27079
+ height: rowH + rowGap,
27080
+ fill: "var(--cdl-surface-sunken, #f4f2ed)",
27081
+ opacity: 0.55
27082
+ },
27083
+ `band-${t.id}`
27084
+ )
27085
+ ),
27086
+ /* @__PURE__ */ jsx(
27087
+ "line",
27088
+ {
27089
+ x1: PAD_LEFT2,
27090
+ y1: PAD_TOP2,
27091
+ x2: PAD_LEFT2 + canvasW,
27092
+ y2: PAD_TOP2,
27093
+ stroke: "var(--cdl-divider, #d4d4d8)",
27094
+ strokeWidth: 1
27095
+ }
27096
+ ),
27097
+ /* @__PURE__ */ jsx(
27098
+ "line",
27099
+ {
27100
+ x1: PAD_LEFT2,
27101
+ y1: PAD_TOP2,
27102
+ x2: PAD_LEFT2,
27103
+ y2: PAD_TOP2 + canvasH,
27104
+ stroke: "var(--cdl-divider, #d4d4d8)",
27105
+ strokeWidth: 1
27106
+ }
27107
+ ),
27048
27108
  gridLabels.map(({ \u4F4D\u7F6E: i, label }) => /* @__PURE__ */ jsxs("g", { children: [
27049
27109
  /* @__PURE__ */ jsx(
27050
27110
  "line",
@@ -27055,9 +27115,8 @@ function GanttNode({
27055
27115
  x2: xAt(i),
27056
27116
  y2: PAD_TOP2 + canvasH,
27057
27117
  stroke: "var(--cdl-divider, #d4d4d8)",
27058
- strokeWidth: 0.75,
27059
- strokeDasharray: "3 3",
27060
- opacity: 0.5
27118
+ strokeWidth: 1,
27119
+ opacity: 0.45
27061
27120
  }
27062
27121
  ),
27063
27122
  label === "" ? null : /* @__PURE__ */ jsx(
@@ -27065,7 +27124,7 @@ function GanttNode({
27065
27124
  {
27066
27125
  "data-cdl-role": "gantt-tick",
27067
27126
  x: xAt(i) + cellW / 2,
27068
- y: PAD_TOP2 + canvasH + 18,
27127
+ y: PAD_TOP2 - 16,
27069
27128
  fontSize: 11,
27070
27129
  textAnchor: "middle",
27071
27130
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -27081,14 +27140,14 @@ function GanttNode({
27081
27140
  x2: xAt(maxIdx),
27082
27141
  y2: PAD_TOP2 + canvasH,
27083
27142
  stroke: "var(--cdl-divider, #d4d4d8)",
27084
- strokeWidth: 0.75,
27085
- opacity: 0.5
27143
+ strokeWidth: 1,
27144
+ opacity: 0.45
27086
27145
  }
27087
27146
  ),
27088
27147
  \u6574\u3048\u305F.map((t, row) => /* @__PURE__ */ jsx(
27089
27148
  "text",
27090
27149
  {
27091
- x: PAD_LEFT2 - 12,
27150
+ x: PAD_LEFT2 - 16,
27092
27151
  y: yAt(row) + rowH / 2 + 4,
27093
27152
  fontSize: 12,
27094
27153
  textAnchor: "end",
@@ -27100,37 +27159,33 @@ function GanttNode({
27100
27159
  )),
27101
27160
  \u6574\u3048\u305F.map((t, row) => {
27102
27161
  const bx = \u5E2F\u306E\u5DE6(t.startIdx);
27103
- const by = yAt(row);
27162
+ const by = \u5E2F\u306E\u4E0A(row);
27104
27163
  const bw = Math.max(0, \u5E2F\u306E\u53F3(t.endIdx) - bx);
27105
- const \u3053\u306E\u884C = \u884C\u306E\u4F38\u3073(row);
27164
+ const \u3053\u306E\u884C = \u5E2F\u306E\u4F38\u3073(row);
27165
+ const \u4ECA\u306E\u5E45 = drawing ? bw * \u3053\u306E\u884C : bw;
27106
27166
  return /* @__PURE__ */ jsxs("g", { children: [
27107
27167
  /* @__PURE__ */ jsx(
27108
- "g",
27168
+ "rect",
27109
27169
  {
27110
- ...drawing ? { transform: `translate(${bx} 0) scale(${\u3053\u306E\u884C} 1) translate(${-bx} 0)` } : {},
27111
- children: /* @__PURE__ */ jsx(
27112
- "rect",
27113
- {
27114
- "data-cdl-role": "gantt-bar",
27115
- "data-cdl-unresolved": t.unresolved ? "true" : void 0,
27116
- "data-cdl-clipped": "clipped" in t && t.clipped ? "true" : void 0,
27117
- x: bx,
27118
- y: by,
27119
- width: bw,
27120
- height: rowH,
27121
- rx: 4,
27122
- fill: toneColor4(t.tone),
27123
- fillOpacity: 0.9
27124
- }
27125
- )
27170
+ "data-cdl-role": "gantt-bar",
27171
+ "data-cdl-unresolved": t.unresolved ? "true" : void 0,
27172
+ "data-cdl-clipped": "clipped" in t && t.clipped ? "true" : void 0,
27173
+ x: bx,
27174
+ y: by,
27175
+ width: \u4ECA\u306E\u5E45,
27176
+ height: \u5E2F\u306E\u9AD8\u3055,
27177
+ rx: \u5E2F\u306E\u9AD8\u3055 / 2,
27178
+ ry: \u5E2F\u306E\u9AD8\u3055 / 2,
27179
+ fill: toneColor4(t.tone),
27180
+ fillOpacity: 0.9
27126
27181
  }
27127
27182
  ),
27128
- t.owner && rowH >= 22 && \u3053\u306E\u884C >= 1 && /* @__PURE__ */ jsx(
27183
+ t.owner && \u5E2F\u306E\u9AD8\u3055 >= 22 && \u3053\u306E\u884C >= 1 && /* @__PURE__ */ jsx(
27129
27184
  "text",
27130
27185
  {
27131
27186
  "data-cdl-role": "gantt-owner",
27132
27187
  x: bx + bw / 2,
27133
- y: by + rowH / 2 + 4,
27188
+ y: by + \u5E2F\u306E\u9AD8\u3055 / 2 + 4,
27134
27189
  fontSize: 11,
27135
27190
  textAnchor: "middle",
27136
27191
  fill: "var(--cdl-node-fill, #ffffff)",
@@ -27145,33 +27200,36 @@ function GanttNode({
27145
27200
  const parentRow = rowOf.get(parent.id);
27146
27201
  const childRow = rowOf.get(t.id);
27147
27202
  const parentBarRight = \u5E2F\u306E\u53F3(parent.endIdx);
27148
- const parentMidY = yAt(parentRow) + rowH / 2;
27149
27203
  const childBarLeft = \u5E2F\u306E\u5DE6(t.startIdx);
27150
- const childMidY = yAt(childRow) + rowH / 2;
27151
- const arrowHeadSize = 8;
27152
- const arrowHeadTipGap = 10;
27153
- const tipX = childBarLeft - arrowHeadTipGap - arrowHeadSize;
27154
- const tipY = childMidY;
27155
- const startX = parentBarRight + 4;
27156
- const elbowGap = 6;
27157
- const enterX = tipX - elbowGap;
27158
- const hasRoom = enterX - startX >= elbowGap;
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}`;
27160
- const arrowHeadPath = `M ${tipX + arrowHeadSize} ${tipY} L ${tipX} ${tipY - arrowHeadSize / 2} L ${tipX} ${tipY + arrowHeadSize / 2} Z`;
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: [
27204
+ const \u77E2\u3058\u308A\u306E\u5E45 = 11;
27205
+ const \u77E2\u3058\u308A\u306E\u9AD8\u3055 = 7;
27206
+ const \u4E38\u307F = \u5E2F\u306E\u9AD8\u3055 / 2;
27207
+ const \u89AA\u306E\u5DE6 = \u5E2F\u306E\u5DE6(parent.startIdx);
27208
+ const \u5B50\u306E\u53F3 = \u5E2F\u306E\u53F3(t.endIdx);
27209
+ const \u5BC4\u305B = (\u5DE6, \u53F3) => Math.min(\u4E38\u307F, (\u53F3 - \u5DE6) / 2);
27210
+ const \u51FA\u767AX = parentBarRight - \u5BC4\u305B(\u89AA\u306E\u5DE6, parentBarRight);
27211
+ const \u51FA\u767AY = \u5E2F\u306E\u4E0A(parentRow) + \u5E2F\u306E\u9AD8\u3055;
27212
+ const \u7740\u5730X = childBarLeft + \u5BC4\u305B(childBarLeft, \u5B50\u306E\u53F3);
27213
+ const \u7740\u5730Y = \u5E2F\u306E\u4E0A(childRow);
27214
+ const \u7E26\u306E\u7D42\u308F\u308AY = \u7740\u5730Y - \u77E2\u3058\u308A\u306E\u9AD8\u3055;
27215
+ const \u624B = Math.max(6, (\u7E26\u306E\u7D42\u308F\u308AY - \u51FA\u767AY) * 0.55);
27216
+ 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}`;
27217
+ 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`;
27218
+ const \u5F15\u3051\u305F = \u7DDA\u306E\u4F38\u3073(parentRow, childRow);
27219
+ return \u5F15\u3051\u305F <= 0 ? null : /* @__PURE__ */ jsxs("g", { "data-cdl-role": "gantt-arrow", children: [
27163
27220
  /* @__PURE__ */ jsx(
27164
27221
  "path",
27165
27222
  {
27166
27223
  d: path,
27167
27224
  fill: "none",
27168
27225
  stroke: "var(--cdl-text-mute, #8a8678)",
27169
- strokeWidth: 1.75,
27226
+ strokeWidth: 2.4,
27170
27227
  strokeLinejoin: "round",
27171
- strokeLinecap: "round"
27228
+ strokeLinecap: "round",
27229
+ ...\u4F38\u3070\u3059dash(drawing, \u5F15\u3051\u305F)
27172
27230
  }
27173
27231
  ),
27174
- /* @__PURE__ */ jsx(
27232
+ \u5F15\u3051\u305F < 1 ? null : /* @__PURE__ */ jsx(
27175
27233
  "path",
27176
27234
  {
27177
27235
  d: arrowHeadPath,