vibe-design-system 2.5.35 → 2.5.37
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/package.json
CHANGED
|
@@ -76,6 +76,7 @@ Kullanıcının her projede ayrı ayrı provider eklemesi, manuel story düzeltm
|
|
|
76
76
|
| **Failed to fetch dynamically imported module: …/X.stories.tsx** | Story dosyası yüklenemiyor. En güncel VDS template’i kullanıp story’leri yeniden üretin: `npm run vds:stories`. Eski template’te statik import vardı; yeni sürümde dinamik import + catch kullanılıyor. |
|
|
77
77
|
| **Cannot read properties of undefined (reading 'dateRange')** (örn. TimeFilterPanel) | `filters` / `dateRange` varsayılanı generator’da var. `npm run vds:stories` tekrar çalıştırın; hâlâ olursa ilgili story’de `args.filters` veya `args.dateRange` manuel ekleyin. |
|
|
78
78
|
| **Cannot read properties of undefined (reading 'toString')** (örn. TaskEstimateInput) | `estimate` / sayısal proplar için varsayılan eklendi. `npm run vds:stories` ile story’leri yenileyin. |
|
|
79
|
+
| **RangeError: Invalid time value** (örn. TimeTable) | entries/rows/logs için mock öğelere geçerli ISO tarih eklendi. `npm run vds:stories` ile yenileyin. |
|
|
79
80
|
| **Başlık/component boş** (örn. UnlockModuleModal) | Modal/drawer için `isOpen` veya `open: true` varsayılanı veriliyor. Story’leri yeniden üretin; gerekirse o story’de `args.open = true` veya `args.isOpen = true` kontrol edin. |
|
|
80
81
|
|
|
81
82
|
Genel adım: `vibe-design-system` güncel olsun, sonra proje kökünde **`npm run vds:stories`** çalıştırıp Storybook’u yeniden başlatın.
|
|
@@ -552,7 +552,11 @@ function isDateLikeField(name) {
|
|
|
552
552
|
/** Build 2-3 mock items for array prop from component source (item type fields). Uses valid ISO date strings for date-like fields to avoid "Invalid time value". */
|
|
553
553
|
function buildMockArrayItems(componentSource, itemTypeName, propName) {
|
|
554
554
|
const fields = getItemTypeFieldsFromSource(componentSource, itemTypeName);
|
|
555
|
-
const
|
|
555
|
+
const propLower = (propName || "").toLowerCase();
|
|
556
|
+
const looksLikeTimeEntries = /entries|rows|logs|data|items|times/.test(propLower) || /time|table|log/.test(propLower);
|
|
557
|
+
const defaultFields = looksLikeTimeEntries
|
|
558
|
+
? ["id", "date", "start", "end", "title", "value"]
|
|
559
|
+
: ["label", "value", "title", "id", "name", "description"];
|
|
556
560
|
const useFields = fields.length ? fields : defaultFields;
|
|
557
561
|
const items = [];
|
|
558
562
|
const baseDate = new Date("2024-01-15T12:00:00.000Z").getTime();
|
|
@@ -562,6 +566,7 @@ function buildMockArrayItems(componentSource, itemTypeName, propName) {
|
|
|
562
566
|
if (f === "id") item[f] = String(i);
|
|
563
567
|
else if (f === "value") item[f] = String(100 - i * 25);
|
|
564
568
|
else if (isDateLikeField(f)) item[f] = new Date(baseDate + i * 86400000).toISOString();
|
|
569
|
+
else if (looksLikeTimeEntries && /date|time|start|end/.test((f || "").toLowerCase())) item[f] = new Date(baseDate + i * 86400000).toISOString();
|
|
565
570
|
else item[f] = `Example ${i}`;
|
|
566
571
|
}
|
|
567
572
|
items.push(item);
|
|
@@ -682,7 +687,7 @@ function buildDefaultArgsForRequiredProps(props, usageFromPages = null, componen
|
|
|
682
687
|
}
|
|
683
688
|
}
|
|
684
689
|
// Optional props that often cause "reading X of undefined" or "reading 'toString'" in Storybook if missing
|
|
685
|
-
const NUMBER_LIKE_OPTIONAL = new Set(["value", "amount", "total", "count", "hours", "minutes", "progress", "percent", "visibility", "estimate"]);
|
|
690
|
+
const NUMBER_LIKE_OPTIONAL = new Set(["value", "amount", "total", "count", "hours", "minutes", "progress", "percent", "visibility", "estimate", "initialValue", "defaultValue", "currentValue", "initialEstimate", "defaultEstimate"]);
|
|
686
691
|
const DATE_RANGE_DEFAULT = `{ dateRange: { from: new Date().toISOString(), to: new Date().toISOString() } }`;
|
|
687
692
|
for (const p of props) {
|
|
688
693
|
const type = String(p.type || "").trim();
|
|
@@ -720,6 +725,15 @@ function buildDefaultArgsForRequiredProps(props, usageFromPages = null, componen
|
|
|
720
725
|
added.add(name);
|
|
721
726
|
}
|
|
722
727
|
}
|
|
728
|
+
// TaskEstimateInput etc.: ensure task, estimate, value always have safe defaults (avoid .toString() on undefined)
|
|
729
|
+
if (componentName && /Task|Estimate|Input/i.test(componentName)) {
|
|
730
|
+
for (const key of ["task", "estimate", "value"]) {
|
|
731
|
+
if (added.has(key)) continue;
|
|
732
|
+
if (key === "task") argLines.push(` task: { id: "1", title: "Example", estimate: 0 },`);
|
|
733
|
+
else argLines.push(` ${key}: 0,`);
|
|
734
|
+
added.add(key);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
723
737
|
}
|
|
724
738
|
for (const name of Object.keys(fromPages)) {
|
|
725
739
|
if (added.has(name)) continue;
|