@ai-matrx/design-system 0.20.2 → 0.20.5
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 +16 -0
- package/dist/data-table/data-row-inspector.cjs +27 -1
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +27 -1
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +27 -1
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +27 -1
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/index.cjs +34 -33
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +34 -33
- package/dist/data-table/index.js.map +1 -1
- package/dist/styles.css +1 -19
- package/package.json +1 -1
|
@@ -3185,6 +3185,32 @@ function isUuidValue(value) {
|
|
|
3185
3185
|
return typeof value === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
|
|
3186
3186
|
}
|
|
3187
3187
|
|
|
3188
|
+
// src/data-table/filter-engine.ts
|
|
3189
|
+
function stringifyCellValue(value) {
|
|
3190
|
+
if (value == null) return "";
|
|
3191
|
+
if (typeof value === "string") return value;
|
|
3192
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
3193
|
+
return String(value);
|
|
3194
|
+
}
|
|
3195
|
+
if (value instanceof Date) return value.toISOString();
|
|
3196
|
+
try {
|
|
3197
|
+
return JSON.stringify(value);
|
|
3198
|
+
} catch {
|
|
3199
|
+
return String(value);
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3203
|
+
// src/data-table/display-value.ts
|
|
3204
|
+
function formatTableDisplayValue(value) {
|
|
3205
|
+
if (typeof value === "number") return value.toLocaleString(void 0, { maximumFractionDigits: 12 });
|
|
3206
|
+
if (value instanceof Date) return value.toLocaleString();
|
|
3207
|
+
if (typeof value === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(value) && !Number.isNaN(Date.parse(value))) {
|
|
3208
|
+
return new Date(value).toLocaleString();
|
|
3209
|
+
}
|
|
3210
|
+
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
3211
|
+
return stringifyCellValue(value) || "\u2014";
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3188
3214
|
// src/data-table/DataRowInspector.tsx
|
|
3189
3215
|
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3190
3216
|
var noFieldToken = () => null;
|
|
@@ -3257,7 +3283,7 @@ function DataRowInspector({
|
|
|
3257
3283
|
key
|
|
3258
3284
|
);
|
|
3259
3285
|
}
|
|
3260
|
-
const formatted = formatValue(value);
|
|
3286
|
+
const formatted = value !== null && typeof value === "object" && !(value instanceof Date) ? formatValue(value) : formatTableDisplayValue(value);
|
|
3261
3287
|
const multiline = formatted.includes("\n") || formatted.length > 80;
|
|
3262
3288
|
return /* @__PURE__ */ jsxs11(
|
|
3263
3289
|
"div",
|