ywana-core8 0.0.851 → 0.0.852
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.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +5 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +5 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.css +5 -0
- package/src/html/table.js +3 -2
- package/src/html/table.test.js +2 -2
package/package.json
CHANGED
package/src/html/table.css
CHANGED
package/src/html/table.js
CHANGED
@@ -92,11 +92,12 @@ export const DataTable = (props) => {
|
|
92
92
|
<table>
|
93
93
|
<thead>
|
94
94
|
<tr>
|
95
|
-
{columns.map(({ id, label, type, item, sortable }) => {
|
95
|
+
{columns.map(({ id, label, type, item, sortable, resizable = false }) => {
|
96
|
+
const resizableStyle = resizable ? "resizable-column" : ""
|
96
97
|
const sort = sortDir[id] ? sortDir[id] : null
|
97
98
|
const [rowspan, colspan] = type === TYPES.ENTITY ? [1, Object.values(item).filter(v => v.column === true).length] : [2, 1]
|
98
99
|
return (
|
99
|
-
<th key={id} rowSpan={rowspan} colSpan={colspan}>
|
100
|
+
<th key={id} className={resizableStyle} rowSpan={rowspan} colSpan={colspan}>
|
100
101
|
<div>
|
101
102
|
{id === "checked" && onCheckAll ? <CheckBox onChange={checkAll} value={allChecked} /> : <Text key={`th_${id}`}>{label}</Text>}
|
102
103
|
{sortable ? <SortIcon sortDir={sortDir[id]} onChange={() => changeSort(id)} /> : null}
|
package/src/html/table.test.js
CHANGED
@@ -43,7 +43,7 @@ export const TableTest = (prop) => {
|
|
43
43
|
columns: [
|
44
44
|
{ id: "index" , label: "#" , type: "INDEX" },
|
45
45
|
{ id: "checked" , onChange: check },
|
46
|
-
{ id: "name" , label: "Name" , type: "String", sortable: true, filtrable: true },
|
46
|
+
{ id: "name" , label: "Name" , type: "String", sortable: true, filtrable: true, resizable: true },
|
47
47
|
{ id: "description", label: "Description", type: "String", sortable: true },
|
48
48
|
{ id: "color" , label: "Color" , type: "String", format: FORMATS.COLOR },
|
49
49
|
{ id: "date" , label: "Date" , type: "String", format: FORMATS.DATE },
|
@@ -55,7 +55,7 @@ export const TableTest = (prop) => {
|
|
55
55
|
return (
|
56
56
|
<>
|
57
57
|
<div style={{ maxHeight: "20rem", overflow: "auto", margin: "2rem", display: "flex" }}>
|
58
|
-
|
58
|
+
<DataTable {...table1} onRowSelection={select} outlined multisort={true}/>
|
59
59
|
</div>
|
60
60
|
<div style={{ maxHeight: "20rem", overflow: "auto", margin: "2rem" }}>
|
61
61
|
<DataTable {...table1} onRowSelection={select} onCheckAll={checkAll} />
|