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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.851",
3
+ "version": "0.0.852",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -87,3 +87,8 @@
87
87
  .datatable8 .string-viewer img {
88
88
  height: 5rem;
89
89
  }
90
+
91
+ .datatable8 th.resizable-column {
92
+ resize: horizontal;
93
+ overflow: hidden;
94
+ }
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}
@@ -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
- z<DataTable {...table1} onRowSelection={select} outlined multisort={true}/>
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} />