@seanyeh77/ui 0.47.0 → 0.47.1

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.
@@ -608,13 +608,19 @@ function DataTable(p) {
608
608
  const onerow = onerowState && !narrow;
609
609
  const hasTitle = shownCols.some((c) => c.mobile === "title");
610
610
  const mobileClass = (c, ci) => {
611
- const m = c.mobile || (!hasTitle && ci === 0 ? "title" : null);
611
+ const m = c.mobile || (ci === titleIdx() ? "title" : null);
612
612
  return m ? "is-m-" + m : null;
613
613
  };
614
614
  const longCols = shownCols.filter((c) => c.long || c.fullText);
615
615
  const expander = longCols.length > 0 && !narrow && (clipped !== false || longCols.some((c) => c.fullText) || visIds.some((id) => opened[id]));
616
616
  const EXP = 40;
617
617
  const mainKey = shownCols.find((c) => !isShort(c) && !c.long && !c.mono && c.grow !== 0)?.key;
618
+ const titleIdx = () => {
619
+ if (hasTitle) return -1;
620
+ if (!shownCols[0]?.mono) return 0;
621
+ const main = shownCols.findIndex((c) => c.key === mainKey && !c.mobile);
622
+ return main < 0 ? 0 : main;
623
+ };
618
624
  const grows = (c) => c.grow != null ? c.grow > 0 : c.long || c.key === mainKey;
619
625
  const minOf = (c) => {
620
626
  if (grows(c)) return Math.max(c.width || (isNum(c) ? 96 : 120), fit[c.key] || 0, roomy ? want[c.key] || 0 : 0);
@@ -1242,7 +1248,7 @@ function DataTable(p) {
1242
1248
  date: 128,
1243
1249
  dateTime: 184,
1244
1250
  datetime: 184,
1245
- relative: 72,
1251
+ relative: 184,
1246
1252
  duration: 64,
1247
1253
  money: 96,
1248
1254
  percent: 56