fui-material 2.8.5 → 2.8.7

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.
@@ -713,38 +713,39 @@ const FPaper = ({
713
713
  );
714
714
  };
715
715
  const TableControlsContext = createContext({ query: "", sort: null });
716
- const left$1 = "_left_1qyr1_62";
717
- const center = "_center_1qyr1_65";
718
- const right = "_right_1qyr1_68";
719
- const justify = "_justify_1qyr1_71";
720
- const more = "_more_1qyr1_135";
716
+ const left$1 = "_left_jup4u_79";
717
+ const center = "_center_jup4u_82";
718
+ const right = "_right_jup4u_85";
719
+ const justify = "_justify_jup4u_88";
720
+ const more = "_more_jup4u_196";
721
721
  const styles$t = {
722
- "f-table-component": "_f-table-component_1qyr1_1",
723
- "f-table-component__table": "_f-table-component__table_1qyr1_12",
724
- "f-table-component__table_header": "_f-table-component__table_header_1qyr1_21",
725
- "is-sticky": "_is-sticky_1qyr1_25",
726
- "f-table-component__table_header-cell": "_f-table-component__table_header-cell_1qyr1_30",
727
- "f-table-component__table_body-cell": "_f-table-component__table_body-cell_1qyr1_30",
728
- "f-table-component__table_body": "_f-table-component__table_body_1qyr1_30",
729
- "f-table-component__table_row": "_f-table-component__table_row_1qyr1_47",
730
- "f-table-component__table_row_no-hover": "_f-table-component__table_row_no-hover_1qyr1_47",
731
- "f-table-component__table_footer": "_f-table-component__table_footer_1qyr1_53",
722
+ "f-table-component": "_f-table-component_jup4u_1",
723
+ "f-table-component__table": "_f-table-component__table_jup4u_13",
724
+ "f-table-component__table_header": "_f-table-component__table_header_jup4u_23",
725
+ "is-sticky": "_is-sticky_jup4u_27",
726
+ "f-table-component__table_header-cell": "_f-table-component__table_header-cell_jup4u_33",
727
+ "f-table-component__table_body-cell": "_f-table-component__table_body-cell_jup4u_33",
728
+ "f-table-component__table_body": "_f-table-component__table_body_jup4u_33",
729
+ "f-table-component__table_row": "_f-table-component__table_row_jup4u_62",
730
+ "f-table-component__table_row_no-hover": "_f-table-component__table_row_no-hover_jup4u_62",
731
+ "f-table-component__table_footer": "_f-table-component__table_footer_jup4u_68",
732
732
  left: left$1,
733
733
  center,
734
734
  right,
735
735
  justify,
736
- "cell-text": "_cell-text_1qyr1_75",
737
- "cell-preview": "_cell-preview_1qyr1_99",
738
- "cell-reveal": "_cell-reveal_1qyr1_110",
736
+ "cell-text": "_cell-text_jup4u_92",
737
+ "cell-preview-text": "_cell-preview-text_jup4u_113",
738
+ "cell-preview": "_cell-preview_jup4u_113",
739
+ "cell-reveal": "_cell-reveal_jup4u_170",
739
740
  more,
740
- "row-menu": "_row-menu_1qyr1_164",
741
- "table-tools": "_table-tools_1qyr1_251",
742
- "table-search": "_table-search_1qyr1_257",
743
- "table-sort": "_table-sort_1qyr1_286",
744
- "table-empty": "_table-empty_1qyr1_313",
745
- "cell-tooltip-anchor": "_cell-tooltip-anchor_1qyr1_319",
746
- "cell-tooltip": "_cell-tooltip_1qyr1_319",
747
- "cell-tooltip-in": "_cell-tooltip-in_1qyr1_1"
741
+ "row-menu": "_row-menu_jup4u_227",
742
+ "table-tools": "_table-tools_jup4u_319",
743
+ "table-search": "_table-search_jup4u_325",
744
+ "table-sort": "_table-sort_jup4u_360",
745
+ "table-empty": "_table-empty_jup4u_388",
746
+ "cell-tooltip-anchor": "_cell-tooltip-anchor_jup4u_395",
747
+ "cell-tooltip": "_cell-tooltip_jup4u_395",
748
+ "cell-tooltip-in": "_cell-tooltip-in_jup4u_1"
748
749
  };
749
750
  const FTableHead = ({
750
751
  st,
@@ -1225,9 +1226,7 @@ const FTableDataCell = ({
1225
1226
  col,
1226
1227
  children,
1227
1228
  textAlignment,
1228
- // По умолчанию выравнивания нет
1229
1229
  height = "auto",
1230
- // По умолчанию высота автоматическая
1231
1230
  truncate,
1232
1231
  sortKey: _sortKey,
1233
1232
  sortValue: _sortValue,
@@ -1237,11 +1236,9 @@ const FTableDataCell = ({
1237
1236
  const truncateAt = useContext(TruncateContext);
1238
1237
  const [expanded, setExpanded] = useState(false);
1239
1238
  const textId = useId();
1240
- const limit = truncateAt !== void 0 && Number.isFinite(truncateAt) && truncateAt >= 1 ? Math.floor(truncateAt) : void 0;
1241
1239
  const text = typeof children === "string" || typeof children === "number" ? String(children) : null;
1242
- const characters = text === null ? [] : Array.from(text);
1243
- const threshold = limit ?? 80;
1244
- const collapsible = truncate !== false && (truncate === true || limit !== void 0) && characters.length > threshold;
1240
+ const limit = truncateAt !== void 0 && Number.isFinite(truncateAt) && truncateAt >= 1 ? Math.floor(truncateAt) : truncate ? 40 : void 0;
1241
+ const collapsible = truncate !== false && limit !== void 0 && text !== null && text.length > limit;
1245
1242
  const style = {
1246
1243
  textAlign: textAlignment,
1247
1244
  height,
@@ -1253,7 +1250,7 @@ const FTableDataCell = ({
1253
1250
  rowSpan: row && row > 1 ? row : void 0,
1254
1251
  colSpan: col && col > 1 ? col : void 0,
1255
1252
  ...props,
1256
- className: `${styles$t["f-table-component__table_body-cell"]} ${props.className || ""}`,
1253
+ className: `${styles$t["f-table-component__table_body-cell"]} ${props.className || ""}`.trim(),
1257
1254
  style,
1258
1255
  children: collapsible ? /* @__PURE__ */ jsx(FTableTextTooltip, { text, enabled: !expanded, children: /* @__PURE__ */ jsxs(
1259
1256
  "button",
@@ -1265,10 +1262,7 @@ const FTableDataCell = ({
1265
1262
  "data-expanded": expanded,
1266
1263
  onClick: () => setExpanded((value) => !value),
1267
1264
  children: [
1268
- /* @__PURE__ */ jsxs("span", { className: styles$t["cell-preview"], "aria-hidden": "true", children: [
1269
- characters.slice(0, threshold).join(""),
1270
- "…"
1271
- ] }),
1265
+ /* @__PURE__ */ jsx("span", { className: styles$t["cell-preview"], "aria-hidden": "true", children: /* @__PURE__ */ jsx("span", { className: styles$t["cell-preview-text"], children: text }) }),
1272
1266
  /* @__PURE__ */ jsx("span", { className: styles$t["cell-reveal"], children: /* @__PURE__ */ jsx("span", { id: textId, children: text }) })
1273
1267
  ]
1274
1268
  }