ywana-core8 0.0.518 → 0.0.519
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 +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +12 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +8 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +8 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/css/html.css +12 -0
- package/src/html/table.js +12 -3
- package/src/html/table.test.js +16 -2
package/package.json
CHANGED
package/src/css/html.css
CHANGED
@@ -42,4 +42,16 @@ td.actions {
|
|
42
42
|
*/
|
43
43
|
body > iframe[style*="2147483647"]:not([id="webpack-dev-server-client-overlay"]) {
|
44
44
|
display: none;
|
45
|
+
}
|
46
|
+
|
47
|
+
.empty-message {
|
48
|
+
width: 100%;
|
49
|
+
height: 100%;
|
50
|
+
min-height: 10rem;
|
51
|
+
flex: 1;
|
52
|
+
display: flex;
|
53
|
+
flex-direction: column;
|
54
|
+
justify-content: center;
|
55
|
+
align-items: center;
|
56
|
+
color: var(--text-color-lighter)
|
45
57
|
}
|
package/src/html/table.js
CHANGED
@@ -110,10 +110,19 @@ export const DataTable = (props) => {
|
|
110
110
|
</tr>
|
111
111
|
</thead>
|
112
112
|
<tbody>
|
113
|
-
{
|
113
|
+
{rows.length > 0 ?
|
114
114
|
multiSort(rows, sortDir).map(row => (
|
115
115
|
<DataTableRow key={row.id} row={row} columns={columns} onSelect={select} onDrop={moveRow} editable={editable} expanded={expanded} />
|
116
|
-
))
|
116
|
+
)) : (
|
117
|
+
<tr>
|
118
|
+
<td colSpan={columns.length+1}>
|
119
|
+
<div className='empty-message'>
|
120
|
+
<Icon icon="search_off" />
|
121
|
+
<Text>No Result Found</Text>
|
122
|
+
</div>
|
123
|
+
</td>
|
124
|
+
</tr>
|
125
|
+
)
|
117
126
|
}
|
118
127
|
</tbody>
|
119
128
|
</table>
|
@@ -194,7 +203,7 @@ const EntityCellViewer = ({ id, item, value }) => {
|
|
194
203
|
|
195
204
|
const fields = Object.values(item).filter(field => field.column === true)
|
196
205
|
const locale = window.navigator.userLanguage || window.navigator.language;
|
197
|
-
|
206
|
+
|
198
207
|
return fields.map(field => {
|
199
208
|
|
200
209
|
let text = value[field.id]
|
package/src/html/table.test.js
CHANGED
@@ -35,7 +35,7 @@ export const TableTest = (prop) => {
|
|
35
35
|
setRows(next)
|
36
36
|
}
|
37
37
|
|
38
|
-
const
|
38
|
+
const table1 = {
|
39
39
|
className: "xxx",
|
40
40
|
editable: true,
|
41
41
|
columns : [
|
@@ -49,9 +49,23 @@ export const TableTest = (prop) => {
|
|
49
49
|
rows
|
50
50
|
}
|
51
51
|
|
52
|
+
const table2 = {
|
53
|
+
className: "xxx",
|
54
|
+
editable: true,
|
55
|
+
columns : [
|
56
|
+
{ id: "checked", onChange: check },
|
57
|
+
{ id: "name", label: "Name", type: "String", onChange: editCell },
|
58
|
+
{ id: "name", label: "Name", type: "String", sortable: true },
|
59
|
+
{ id: "thumb", label: "Thumb", type: "String", format: FORMATS.IMG },
|
60
|
+
{ id: "color", label: "Color", type: "String", format: FORMATS.COLOR },
|
61
|
+
{ id: "date", label: "Date", type: "String", format: FORMATS.DATE },
|
62
|
+
],
|
63
|
+
rows: []
|
64
|
+
}
|
65
|
+
|
52
66
|
return (
|
53
67
|
<div style={{ maxHeight: "20rem", overflow: "hidden", border: "solid 1px red", margin: "2rem" }}>
|
54
|
-
<DataTable {...
|
68
|
+
<DataTable {...table2} onRowSelection={select} onCheckAll={checkAll}/>
|
55
69
|
</div>
|
56
70
|
)
|
57
71
|
}
|