ywana-core8 0.0.524 → 0.0.527
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 +18 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +18 -7
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +18 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +3 -3
- package/src/html/table.js +6 -5
- package/src/html/table.test.js +2 -1
- package/src/widgets/planner/Planner.js +1 -1
package/package.json
CHANGED
@@ -68,7 +68,7 @@ export const CollectionPage = (props) => {
|
|
68
68
|
<Header title={<Text>Lista de {name}</Text>} >
|
69
69
|
</Header>
|
70
70
|
{canFilter ? <CollectionFilters schema={schema}/> : null }
|
71
|
-
{levels ? <CollectionTree levels={levels} onSelect={onSelect} sorter={sorter}/> : <CollectionList groupBy={groupBy} onSelect={onSelect}/>}
|
71
|
+
{levels ? <CollectionTree icon={icon} levels={levels} onSelect={onSelect} sorter={sorter}/> : <CollectionList groupBy={groupBy} onSelect={onSelect}/>}
|
72
72
|
</menu>
|
73
73
|
<main key={id} className="collection-page">
|
74
74
|
<CollectionEditor icon={icon} schema={schema} layout={editor} autosave={autosave} delay={delay} />
|
@@ -166,7 +166,7 @@ const CollectionList = (props) => {
|
|
166
166
|
*/
|
167
167
|
export const CollectionTree = (props) => {
|
168
168
|
|
169
|
-
const { levels, onSelect, sorter } = props
|
169
|
+
const { icon="description", levels, onSelect, sorter } = props
|
170
170
|
const [pageContext, setPageContext] = useContext(PageContext)
|
171
171
|
const { all = [] } = pageContext
|
172
172
|
|
@@ -207,7 +207,7 @@ export const CollectionTree = (props) => {
|
|
207
207
|
const title = typeof node.name === 'boolean' ? `${node.field} = ${node.name}` : node.name
|
208
208
|
return (
|
209
209
|
<TreeNode key={node.name} icon={null} label={title} open={true}>
|
210
|
-
{node.nodes ? renderNodes(node.nodes) : node.items.map(item => <TreeItem key={item.id} id={item.id} label={item.name} onSelect={select}>item</TreeItem>)}
|
210
|
+
{node.nodes ? renderNodes(node.nodes) : node.items.map(item => <TreeItem icon={icon} key={item.id} id={item.id} label={item.name} onSelect={select}>item</TreeItem>)}
|
211
211
|
</TreeNode>
|
212
212
|
)
|
213
213
|
})
|
package/src/html/table.js
CHANGED
@@ -111,8 +111,8 @@ export const DataTable = (props) => {
|
|
111
111
|
</thead>
|
112
112
|
<tbody>
|
113
113
|
{rows.length > 0 ?
|
114
|
-
multiSort(rows, sortDir).map(row => (
|
115
|
-
<DataTableRow key={row.id} row={row} columns={columns} onSelect={select} onDrop={moveRow} editable={editable} expanded={expanded} />
|
114
|
+
multiSort(rows, sortDir).map((row,index) => (
|
115
|
+
<DataTableRow key={row.id} index={index} row={row} columns={columns} onSelect={select} onDrop={moveRow} editable={editable} expanded={expanded} />
|
116
116
|
)) : (
|
117
117
|
<tr>
|
118
118
|
<td colSpan={1000}>
|
@@ -135,7 +135,7 @@ export const DataTable = (props) => {
|
|
135
135
|
*/
|
136
136
|
const DataTableRow = (props) => {
|
137
137
|
|
138
|
-
const { row, columns = [], onSelect, editable, expanded = false } = props
|
138
|
+
const { index, row, columns = [], onSelect, editable, expanded = false } = props
|
139
139
|
const { className } = row
|
140
140
|
const [isInfoOpen, toggleInfo] = useState(expanded)
|
141
141
|
const infoIcon = isInfoOpen ? 'expand_more' : 'expand_less'
|
@@ -143,7 +143,7 @@ const DataTableRow = (props) => {
|
|
143
143
|
return (
|
144
144
|
<Fragment>
|
145
145
|
<tr className={className} onClick={ev => onSelect(row, ev)}>
|
146
|
-
{columns.map((column,
|
146
|
+
{columns.map((column, cindex) => <DataTableCell key={`${column.id}_${cindex}`} index={index} row={row} column={column} cell={row[column.id]} editable={editable} />)}
|
147
147
|
{row.info ? <td><Icon icon={infoIcon} clickable action={() => toggleInfo(!isInfoOpen)} /></td> : <td></td>}
|
148
148
|
</tr>
|
149
149
|
{row.info && isInfoOpen ? (
|
@@ -160,7 +160,7 @@ const DataTableRow = (props) => {
|
|
160
160
|
/**
|
161
161
|
* DataTable Cell
|
162
162
|
*/
|
163
|
-
const DataTableCell = ({ row, column, cell, editable }) => {
|
163
|
+
const DataTableCell = ({ index, row, column, cell, editable }) => {
|
164
164
|
|
165
165
|
const render = (type) => {
|
166
166
|
const { id, disabled = false, min, max, onChange, format, options, item } = column
|
@@ -181,6 +181,7 @@ const DataTableCell = ({ row, column, cell, editable }) => {
|
|
181
181
|
}
|
182
182
|
} else {
|
183
183
|
switch (type) {
|
184
|
+
case "INDEX": return <span>{index}</span>
|
184
185
|
case "ICON": return <Icon icon={cell} />
|
185
186
|
case "Boolean": return <BooleanCellViewer id={id} value={cell} />
|
186
187
|
case "String": return <StringCellViewer id={id} value={cell} format={format} options={options} />
|
package/src/html/table.test.js
CHANGED
@@ -39,6 +39,7 @@ export const TableTest = (prop) => {
|
|
39
39
|
className: "xxx",
|
40
40
|
editable: true,
|
41
41
|
columns : [
|
42
|
+
{ id: "index", type: "INDEX", label: "#"},
|
42
43
|
{ id: "checked", onChange: check },
|
43
44
|
{ id: "name", label: "Name", type: "String", onChange: editCell },
|
44
45
|
{ id: "name", label: "Name", type: "String", sortable: true },
|
@@ -65,7 +66,7 @@ export const TableTest = (prop) => {
|
|
65
66
|
|
66
67
|
return (
|
67
68
|
<div style={{ maxHeight: "20rem", overflow: "hidden", border: "solid 1px red", margin: "2rem" }}>
|
68
|
-
<DataTable {...
|
69
|
+
<DataTable {...table1} onRowSelection={select} onCheckAll={checkAll}/>
|
69
70
|
</div>
|
70
71
|
)
|
71
72
|
}
|
@@ -93,7 +93,7 @@ export const Planner = ({ title, events = [], lanes = [], navigation = true, onS
|
|
93
93
|
{navigation ? (
|
94
94
|
<Header title={label}>
|
95
95
|
|
96
|
-
<Button label="
|
96
|
+
<Button label="This Week" outlined action={showThisWeek}/>
|
97
97
|
<Icon icon="chevron_right" clickable action={next} />
|
98
98
|
<TextField id="to" type="date" label="To" value={to} onChange={(id, value) => setTo(value)} />
|
99
99
|
<div className="expand"></div>
|