lecom-ui 5.3.44 → 5.3.46

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.
@@ -185,10 +185,7 @@ function DataTable({
185
185
  "bg-white rounded-[8px] p-2 transition-all duration-500",
186
186
  className
187
187
  ),
188
- style: {
189
- contain: "layout",
190
- ...noScroll ? {} : { width: styleDataTableContainer.width }
191
- }
188
+ style: noScroll ? void 0 : { width: styleDataTableContainer.width }
192
189
  },
193
190
  noScroll ? renderTable() : /* @__PURE__ */ React.createElement(ScrollArea, { type: "always", className: "p-2" }, /* @__PURE__ */ React.createElement(
194
191
  "div",
@@ -46,7 +46,7 @@ function Table({
46
46
  }
47
47
  )));
48
48
  }
49
- return /* @__PURE__ */ React.createElement("table", { id: "data-table", className: "w-full", style: { tableLayout: "fixed" } }, /* @__PURE__ */ React.createElement("thead", { className: "sticky top-0 z-10 bg-white" }, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React.createElement("tr", { key: headerGroup.id }, headerGroup.headers.map((header) => /* @__PURE__ */ React.createElement(
49
+ return /* @__PURE__ */ React.createElement("table", { id: "data-table", className: "w-full" }, /* @__PURE__ */ React.createElement("thead", { className: "sticky top-0 z-10 bg-white" }, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React.createElement("tr", { key: headerGroup.id }, headerGroup.headers.map((header) => /* @__PURE__ */ React.createElement(
50
50
  "th",
51
51
  {
52
52
  key: header.id,
@@ -67,44 +67,37 @@ function Table({
67
67
  header.column.columnDef.header,
68
68
  header.getContext()
69
69
  )
70
- ))))), /* @__PURE__ */ React.createElement(
71
- "tbody",
70
+ ))))), /* @__PURE__ */ React.createElement("tbody", { className: "[&_tr:last-child]:border-0 [&_tr:last-child_td]:shadow-none" }, table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ React.createElement(React.Fragment, { key: row.id }, /* @__PURE__ */ React.createElement(
71
+ "tr",
72
72
  {
73
- className: "[&_tr:last-child]:border-0 [&_tr:last-child_td]:shadow-none",
74
- style: { willChange: "transform" }
73
+ "data-state": onIsSelected?.(row) ? "selected" : "",
74
+ className: "[&_td]:hover:bg-grey-100 [&_td]:data-[state=selected]:bg-grey-100"
75
75
  },
76
- table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ React.createElement(React.Fragment, { key: row.id }, /* @__PURE__ */ React.createElement(
77
- "tr",
78
- {
79
- "data-state": onIsSelected?.(row) ? "selected" : "",
80
- className: "[&_td]:hover:bg-grey-100 [&_td]:data-[state=selected]:bg-grey-100"
81
- },
82
- row.getVisibleCells().map((cell) => /* @__PURE__ */ React.createElement(
83
- "td",
84
- {
85
- key: cell.id,
86
- className: cn(
87
- "p-4 py-0 h-10 [&:has([role=checkbox])]:pr-0 transition-colors shadow-[0_-0.5px_0px_0px_#c9c9c9_inset] text-left",
88
- cell.column.columnDef.meta?.cellClassName
89
- ),
90
- "data-column": cell.column.id,
91
- "data-fixed": getFixed(cell.column.columnDef.meta),
92
- style: styleColumn(
93
- cell.column.columnDef.meta,
94
- "td"
95
- )
96
- },
97
- flexRender(cell.column.columnDef.cell, cell.getContext())
98
- ))
99
- ), row.getIsExpanded() && expandedContent && /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("td", { colSpan: columns.length, className: "p-0" }, expandedContent(row))))) : /* @__PURE__ */ React.createElement("tr", { className: "border-b-[0.5px] [&_td]:hover:bg-grey-100 [&_td]:data-[state=selected]:bg-grey-100" }, /* @__PURE__ */ React.createElement(
76
+ row.getVisibleCells().map((cell) => /* @__PURE__ */ React.createElement(
100
77
  "td",
101
78
  {
102
- colSpan: columns.length,
103
- className: "p-4 py-0 h-10 align-middle [&:has([role=checkbox])]:pr-0 transition-colors"
79
+ key: cell.id,
80
+ className: cn(
81
+ "p-4 py-0 h-10 [&:has([role=checkbox])]:pr-0 transition-colors shadow-[0_-0.5px_0px_0px_#c9c9c9_inset] text-left",
82
+ cell.column.columnDef.meta?.cellClassName
83
+ ),
84
+ "data-column": cell.column.id,
85
+ "data-fixed": getFixed(cell.column.columnDef.meta),
86
+ style: styleColumn(
87
+ cell.column.columnDef.meta,
88
+ "td"
89
+ )
104
90
  },
105
- noResults ?? /* @__PURE__ */ React.createElement("div", { className: "text-center" }, "-")
91
+ flexRender(cell.column.columnDef.cell, cell.getContext())
106
92
  ))
107
- ));
93
+ ), row.getIsExpanded() && expandedContent && /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("td", { colSpan: columns.length, className: "p-0" }, expandedContent(row))))) : /* @__PURE__ */ React.createElement("tr", { className: "border-b-[0.5px] [&_td]:hover:bg-grey-100 [&_td]:data-[state=selected]:bg-grey-100" }, /* @__PURE__ */ React.createElement(
94
+ "td",
95
+ {
96
+ colSpan: columns.length,
97
+ className: "p-4 py-0 h-10 align-middle [&:has([role=checkbox])]:pr-0 transition-colors"
98
+ },
99
+ noResults ?? /* @__PURE__ */ React.createElement("div", { className: "text-center" }, "-")
100
+ ))));
108
101
  }
109
102
  Table.displayName = "Table";
110
103
 
@@ -11,13 +11,29 @@ import { varsTheme } from './varsTheme';
11
11
 
12
12
  const buildPlugin = (publicPath) =>
13
13
  Plugin(
14
- ({ addBase, addComponents }) => {
14
+ ({ addBase, addComponents, addUtilities }) => {
15
15
  addBase(varsTheme);
16
16
  fontFaces(publicPath).map((fontFace) =>
17
17
  addBase({ '@font-face': fontFace })
18
18
  );
19
19
  addBase(general);
20
20
  addComponents(typographies);
21
+
22
+ addUtilities({
23
+ '.datatable-optimize': {
24
+ contain: 'layout',
25
+ },
26
+ '.datatable-optimize *': {
27
+ contain: 'layout style',
28
+ 'will-change': 'auto',
29
+ },
30
+ '.datatable-table-fixed': {
31
+ 'table-layout': 'fixed',
32
+ },
33
+ '.datatable-body-transform': {
34
+ 'will-change': 'transform',
35
+ },
36
+ });
21
37
  },
22
38
  {
23
39
  theme: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "5.3.44",
3
+ "version": "5.3.46",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",