ywana-core8 0.0.523 → 0.0.526
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 +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +14 -7
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +14 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.js +6 -5
- package/src/html/table.test.js +2 -1
- package/src/html/textfield.js +1 -1
- package/src/widgets/planner/Planner.js +1 -1
package/package.json
CHANGED
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
|
}
|
package/src/html/textfield.js
CHANGED
@@ -168,7 +168,7 @@ export const DropDown = (props) => {
|
|
168
168
|
if (canShow) {
|
169
169
|
const filterActive = predictive === true && label && label.length > 0
|
170
170
|
const items = filterActive ? options.filter(option => option.label.toUpperCase().indexOf(label.toUpperCase()) >= 0) : options
|
171
|
-
const lis = items.map(option => <li key={option.value} value={option.value}>{option.label}</li>)
|
171
|
+
const lis = items.map(option => <li key={option.value} value={option.value}><Text>{option.label}</Text></li>)
|
172
172
|
return <menu><ul onMouseDown={select}>{lis}</ul></menu>
|
173
173
|
} else {
|
174
174
|
return null
|
@@ -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>
|