ywana-core8 0.0.912 → 0.0.913
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 +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +12 -5
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +12 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.js +5 -2
- package/src/html/table.test.js +8 -3
package/package.json
CHANGED
package/src/html/table.js
CHANGED
@@ -148,10 +148,13 @@ export const DataTable = (props) => {
|
|
148
148
|
const DataTableFiltersRow = ({ columns }) => {
|
149
149
|
return (
|
150
150
|
<tr className="filters-row">
|
151
|
-
{columns.map(({ id, filterable, onFilter }) => {
|
151
|
+
{columns.map(({ id, filterable, onFilter, options }) => {
|
152
|
+
|
153
|
+
const field = options ? <DropDown id={id} options={options} onChange={onFilter} outlined /> : <TextField id={id} onChange={onFilter} outlined />
|
154
|
+
|
152
155
|
return (
|
153
156
|
<td className='filter-cell'>
|
154
|
-
{filterable ?
|
157
|
+
{filterable ? field : null}
|
155
158
|
</td>
|
156
159
|
)
|
157
160
|
})}
|
package/src/html/table.test.js
CHANGED
@@ -43,8 +43,13 @@ 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,
|
47
|
-
{ id: "
|
46
|
+
{ id: "name" , label: "Name" , type: "String", sortable: true, filterable: true, resizable: true },
|
47
|
+
{ id: "category" , label: "Category" , type: "String", sortable: true, filterable: true, resizable: false, options: [
|
48
|
+
{ label: "A", value: "A" },
|
49
|
+
{ label: "B", value: "B" },
|
50
|
+
{ label: "C", value: "C" },
|
51
|
+
]},
|
52
|
+
{ id: "description", label: "Description", type: "String", sortable: true },
|
48
53
|
{ id: "color" , label: "Color" , type: "String", format: FORMATS.COLOR },
|
49
54
|
{ id: "date" , label: "Date" , type: "String", format: FORMATS.DATE },
|
50
55
|
{ id: "num" , label: "Num" , type: "Number", maxDecimals: 2, sortable: true},
|
@@ -58,7 +63,7 @@ export const TableTest = (prop) => {
|
|
58
63
|
<DataTable {...table1} onRowSelection={select} outlined multisort={true}/>
|
59
64
|
</div>
|
60
65
|
<div style={{ maxHeight: "20rem", overflow: "auto", margin: "2rem" }}>
|
61
|
-
<DataTable {...table1} onRowSelection={select} onCheckAll={checkAll} />
|
66
|
+
<DataTable {...table1} onRowSelection={select} onCheckAll={checkAll} filterable={true} />
|
62
67
|
</div>
|
63
68
|
</>
|
64
69
|
)
|