nillud-data-table 1.3.1 → 1.3.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.
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/styles.css +10 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -18,6 +18,7 @@ type Column = {
|
|
18
18
|
selectable?: boolean;
|
19
19
|
filterPlaceholder?: string;
|
20
20
|
};
|
21
|
+
type Columns = Column[];
|
21
22
|
type TableProps = {
|
22
23
|
tableData: TableData;
|
23
24
|
columns: Array<Column>;
|
@@ -43,4 +44,4 @@ type DataTableRef = {
|
|
43
44
|
|
44
45
|
declare const DataTable: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<DataTableRef>>;
|
45
46
|
|
46
|
-
export { type Column, DataTable, type DataTableRef, type TableElement, type TableProps };
|
47
|
+
export { type Column, type Columns, DataTable, type DataTableRef, type TableData, type TableElement, type TableProps };
|
package/dist/index.js
CHANGED
@@ -125,7 +125,7 @@ var Cell = ({
|
|
125
125
|
children: content
|
126
126
|
}
|
127
127
|
);
|
128
|
-
const renderSelectableCell = () => /* @__PURE__ */ jsx5("
|
128
|
+
const renderSelectableCell = () => /* @__PURE__ */ jsx5("label", { className: "ndt-cell ndt-checkbox-cell", children: /* @__PURE__ */ jsx5("input", { type: "checkbox", checked: !!isRowSelected, onChange: onRowSelect }) });
|
129
129
|
return /* @__PURE__ */ jsx5(Fragment3, { children: column.selectable ? renderSelectableCell() : renderCell() });
|
130
130
|
};
|
131
131
|
var Cell_default = Cell;
|
@@ -142,7 +142,8 @@ var Row = ({
|
|
142
142
|
isRowSelected,
|
143
143
|
onRowSelect
|
144
144
|
}) => {
|
145
|
-
|
145
|
+
const isSelectable = columns.find((element) => element.selectable);
|
146
|
+
return /* @__PURE__ */ jsx6("div", { className: `ndt-table-row ${isSelectable && "ndt-table-row-selectable"} ${isRowSelected && "ndt-table-row-selected"}`, style: { gridTemplateColumns: widths }, onClick: onRowSelect, children: columns.map((column, id) => /* @__PURE__ */ jsx6(
|
146
147
|
Cell_default,
|
147
148
|
{
|
148
149
|
row,
|
package/dist/styles.css
CHANGED
@@ -89,7 +89,16 @@
|
|
89
89
|
border-bottom: 1px solid #ddd;
|
90
90
|
}
|
91
91
|
.ndt-table-container .ndt-table .ndt-table-body .ndt-table-row:nth-child(2n) {
|
92
|
-
background-color: rgba(0, 0, 0, 0.
|
92
|
+
background-color: rgba(0, 0, 0, 0.04);
|
93
|
+
}
|
94
|
+
.ndt-table-container .ndt-table .ndt-table-body .ndt-table-row:hover {
|
95
|
+
background-color: rgba(144, 202, 249, 0.04);
|
96
|
+
}
|
97
|
+
.ndt-table-container .ndt-table .ndt-table-body .ndt-table-row .ndt-table-row-selectable {
|
98
|
+
cursor: pointer;
|
99
|
+
}
|
100
|
+
.ndt-table-container .ndt-table .ndt-table-body .ndt-table-row .ndt-table-row-selected {
|
101
|
+
background-color: rgb(144, 202, 249);
|
93
102
|
}
|
94
103
|
.ndt-table-container .ndt-table .ndt-table-body .ndt-table-row .ndt-cell {
|
95
104
|
display: flex;
|
package/dist/styles.css.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../components/data-table/styles/data-table.scss"],"names":[],"mappings":";AACI;EACI;EACA;;AAEA;AAAA;EAEI;;AAGJ;AAAA;EAEI;;AAGJ;EACI;;AAEA;EACI;;AAEA;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAMR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAMhB;EACI;;AAEA;EACI;EACA;EACA;;AAGA;EACI;AACA;;AAGJ;EACI;AACA;EACA;AACA;;AAGJ;EACI;AACA;EACA;AACA;;AAGJ;EACI;AACA;;AAKJ;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAMhB;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EACI;;AAGI;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AAIR;EACI;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EAGI;;AAGJ;EACI;EACA;;AAIR;EACI;EACA;;AAEA;EACI;;AAEA;EACI;EACA;EACA;;;AAUhC;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAEA;EAGI;EACA;EACA;;AAIR;EACI;;AAEA;EAGI;EACA;EACA;;;AAKZ;EACI;EACA;EACA;EACA;EACA;;AAIA;EACI","file":"styles.css"}
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../components/data-table/styles/data-table.scss"],"names":[],"mappings":";AACI;EACI;EACA;;AAEA;AAAA;EAEI;;AAGJ;AAAA;EAEI;;AAGJ;EACI;;AAEA;EACI;;AAEA;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAMR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAMhB;EACI;;AAEA;EACI;EACA;EACA;;AAGA;EACI;AACA;;AAGJ;EACI;AACA;EACA;AACA;;AAGJ;EACI;AACA;EACA;AACA;;AAGJ;EACI;AACA;;AAKJ;EACI;;AAGJ;EACI;;AAGJ;EACI;;AAGJ;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAMhB;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EACI;;AAGI;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AAIR;EACI;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EAGI;;AAGJ;EACI;EACA;;AAIR;EACI;EACA;;AAEA;EACI;;AAEA;EACI;EACA;EACA;;;AAUhC;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAEA;EAGI;EACA;EACA;;AAIR;EACI;;AAEA;EAGI;EACA;EACA;;;AAKZ;EACI;EACA;EACA;EACA;EACA;;AAIA;EACI","file":"styles.css"}
|