ywana-core8 0.0.519 → 0.0.520
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 +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +5 -0
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +5 -0
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TabbedTablePage.js +21 -13
package/package.json
CHANGED
@@ -36,16 +36,16 @@ export const TabbedTablePage = (props) => {
|
|
36
36
|
const timer = useRef(null)
|
37
37
|
const [form, setForm] = useState(selected)
|
38
38
|
const [tabs, setTabs] = useState([])
|
39
|
-
|
39
|
+
|
40
40
|
useEffect(async () => {
|
41
41
|
const field = Object.values(schema).find(field => field.tab && field.tab === true)
|
42
|
-
const tabs = field.options.map(option => Object.assign({}, option, { field: field.id}))
|
42
|
+
const tabs = field.options.map(option => Object.assign({}, option, { field: field.id }))
|
43
43
|
setTabs(tabs)
|
44
44
|
context.changeTab(tabs[0])
|
45
45
|
setPageContext(context)
|
46
46
|
}, [])
|
47
|
-
|
48
|
-
useEffect(
|
47
|
+
|
48
|
+
useEffect(async () => {
|
49
49
|
if (tab) {
|
50
50
|
const filter = { [tab.field]: tab.value }
|
51
51
|
await pageContext.load(filter, [])
|
@@ -151,7 +151,7 @@ export const TabbedTablePage = (props) => {
|
|
151
151
|
}
|
152
152
|
|
153
153
|
function renderTabs() {
|
154
|
-
const selected = tab ? tab.value : null
|
154
|
+
const selected = tab ? tab.value : null
|
155
155
|
return (
|
156
156
|
<Tabs selected={selected} onChange={changeTab} fillRight={true} fillLeft={false}>
|
157
157
|
{tabs.map(tab => <Tab id={tab.value} label={tab.label} />)}
|
@@ -179,7 +179,7 @@ export const TabbedTablePage = (props) => {
|
|
179
179
|
</menu>
|
180
180
|
) : null}
|
181
181
|
<main key={id} className="table-page">
|
182
|
-
<TableEditor icon={icon} title={name} tabs={renderTabs()} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} actions={tableActions} canDelete={canDelete} className={tableClassName}/>
|
182
|
+
<TableEditor icon={icon} title={name} tabs={renderTabs()} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} actions={tableActions} canDelete={canDelete} className={tableClassName} />
|
183
183
|
{children ? <article>{children}</article> : null}
|
184
184
|
</main>
|
185
185
|
{renderAside()}
|
@@ -326,10 +326,10 @@ const TableFilters = (props) => {
|
|
326
326
|
|
327
327
|
const likes = useMemo(() => {
|
328
328
|
const fields = Object.values(schema)
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
329
|
+
return fields.reduce((likes, field) => {
|
330
|
+
if (field.like === true) likes.push(field.id)
|
331
|
+
return likes
|
332
|
+
}, [])
|
333
333
|
}, [schema])
|
334
334
|
|
335
335
|
useEffect(() => {
|
@@ -453,6 +453,14 @@ export const TableEditor = (props) => {
|
|
453
453
|
groups[groupName].push(item)
|
454
454
|
return groups
|
455
455
|
}, {})
|
456
|
+
|
457
|
+
if (groups.length === 0) return (
|
458
|
+
<div className='empty-message'>
|
459
|
+
<Icon icon="search_off" />
|
460
|
+
<Text>No Result Found</Text>
|
461
|
+
</div>
|
462
|
+
)
|
463
|
+
|
456
464
|
return Object.keys(groups).map(groupName => {
|
457
465
|
const table = {
|
458
466
|
columns: Object.values(schema)
|
@@ -492,7 +500,7 @@ export const TableEditor = (props) => {
|
|
492
500
|
<Header title={title} >
|
493
501
|
<span className="size">{groupSize}</span>
|
494
502
|
</Header>
|
495
|
-
<DataTable {...table} onRowSelection={select} editable={editable} onCheckAll={check} className={className}/>
|
503
|
+
<DataTable {...table} onRowSelection={select} editable={editable} onCheckAll={check} className={className} />
|
496
504
|
</Fragment>
|
497
505
|
)
|
498
506
|
})
|
@@ -550,7 +558,7 @@ const TableContext = (url, field, host, urlQuery) => {
|
|
550
558
|
|
551
559
|
return filters;
|
552
560
|
}, {}) : []
|
553
|
-
|
561
|
+
|
554
562
|
if (this.tab) {
|
555
563
|
filters[this.tab.field] = this.tab.value
|
556
564
|
}
|
@@ -670,7 +678,7 @@ const TableAPI = (url, host) => {
|
|
670
678
|
}, "")
|
671
679
|
return query.concat(param)
|
672
680
|
} else {
|
673
|
-
return like.includes(key) ? query.concat(`${key}=%${filters[key]}%&`) :
|
681
|
+
return like.includes(key) ? query.concat(`${key}=%${filters[key]}%&`) : query.concat(`${key}=${filters[key]}&`)
|
674
682
|
}
|
675
683
|
}, "")
|
676
684
|
queryParams = queryParams.concat(filterQuery)
|