@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.
@@ -3178,6 +3178,32 @@ function isUuidValue(value) {
3178
3178
  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);
3179
3179
  }
3180
3180
 
3181
+ // src/data-table/filter-engine.ts
3182
+ function stringifyCellValue(value) {
3183
+ if (value == null) return "";
3184
+ if (typeof value === "string") return value;
3185
+ if (typeof value === "number" || typeof value === "boolean") {
3186
+ return String(value);
3187
+ }
3188
+ if (value instanceof Date) return value.toISOString();
3189
+ try {
3190
+ return JSON.stringify(value);
3191
+ } catch {
3192
+ return String(value);
3193
+ }
3194
+ }
3195
+
3196
+ // src/data-table/display-value.ts
3197
+ function formatTableDisplayValue(value) {
3198
+ if (typeof value === "number") return value.toLocaleString(void 0, { maximumFractionDigits: 12 });
3199
+ if (value instanceof Date) return value.toLocaleString();
3200
+ if (typeof value === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(value) && !Number.isNaN(Date.parse(value))) {
3201
+ return new Date(value).toLocaleString();
3202
+ }
3203
+ if (typeof value === "boolean") return value ? "Yes" : "No";
3204
+ return stringifyCellValue(value) || "\u2014";
3205
+ }
3206
+
3181
3207
  // src/data-table/DataRowInspector.tsx
3182
3208
  var import_jsx_runtime18 = require("react/jsx-runtime");
3183
3209
  var noFieldToken = () => null;
@@ -3250,7 +3276,7 @@ function DataRowInspector({
3250
3276
  key
3251
3277
  );
3252
3278
  }
3253
- const formatted = formatValue(value);
3279
+ const formatted = value !== null && typeof value === "object" && !(value instanceof Date) ? formatValue(value) : formatTableDisplayValue(value);
3254
3280
  const multiline = formatted.includes("\n") || formatted.length > 80;
3255
3281
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3256
3282
  "div",