@seanyeh77/ui 0.47.0 → 0.47.2

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);
@@ -1207,12 +1213,19 @@ function DataTable(p) {
1207
1213
  unit: unitOf(selIds.length)
1208
1214
  }),
1209
1215
  children: [
1210
- /* @__PURE__ */ jsx("span", {
1211
- className: "ui-dt-bulk-count",
1212
- children: monoNums(tr("已選 {n} {unit}", {
1213
- n: "",
1214
- unit: unitOf(selIds.length)
1215
- }), [format.number(selIds.length)])
1216
+ /* @__PURE__ */ jsxs("span", {
1217
+ className: "ui-dt-bulk-lead",
1218
+ children: [narrow ? /* @__PURE__ */ jsx(RowCheck, {
1219
+ v: allOn ? true : mixed ? "mixed" : false,
1220
+ label: tr("全選"),
1221
+ onClick: () => toggle(visIds, !allOn)
1222
+ }) : null, /* @__PURE__ */ jsx("span", {
1223
+ className: "ui-dt-bulk-count",
1224
+ children: monoNums(tr("已選 {n} {unit}", {
1225
+ n: "",
1226
+ unit: unitOf(selIds.length)
1227
+ }), [format.number(selIds.length)])
1228
+ })]
1216
1229
  }),
1217
1230
  /* @__PURE__ */ jsx("span", {
1218
1231
  className: "ui-dt-bulk-actions",
@@ -1242,7 +1255,7 @@ function DataTable(p) {
1242
1255
  date: 128,
1243
1256
  dateTime: 184,
1244
1257
  datetime: 184,
1245
- relative: 72,
1258
+ relative: 184,
1246
1259
  duration: 64,
1247
1260
  money: 96,
1248
1261
  percent: 56