ywana-core8 0.0.285 → 0.0.288
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 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +8 -99
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +8 -99
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +1 -1
- package/src/html/checkbox.js +2 -0
- package/src/html/table.js +3 -1
- package/src/html/table.test.js +31 -0
package/package.json
CHANGED
@@ -5,7 +5,7 @@ import { PageContext } from '../site'
|
|
5
5
|
import { Button, Header, Icon, List, Menu, MenuIcon, MenuItem, Text, Tree, TreeItem, TreeNode } from '../html'
|
6
6
|
import { Content } from './ContentType'
|
7
7
|
import { ContentEditor, TabbedContentEditor, TreededContentEditor } from './ContentEditor'
|
8
|
-
import { CreateContentDialog } from './
|
8
|
+
import { CreateContentDialog } from './CreateContentDialog'
|
9
9
|
import { SiteContext } from '../site/siteContext'
|
10
10
|
import "./CollectionPage.css"
|
11
11
|
|
package/src/html/checkbox.js
CHANGED
@@ -10,6 +10,8 @@ export const CheckBox = (props) => {
|
|
10
10
|
const { id, label, placeholder, value, onChange } = props
|
11
11
|
|
12
12
|
function change(event) {
|
13
|
+
event.stopPropagation()
|
14
|
+
event.preventDefault()
|
13
15
|
const value = event.target.checked
|
14
16
|
if (onChange) onChange(id, value)
|
15
17
|
}
|
package/src/html/table.js
CHANGED
@@ -54,7 +54,9 @@ export const DataTable = (props) => {
|
|
54
54
|
}
|
55
55
|
|
56
56
|
function select(row, event) {
|
57
|
-
if (
|
57
|
+
if (event.target.id !== "checked") {
|
58
|
+
if (onRowSelection) onRowSelection(row, event)
|
59
|
+
}
|
58
60
|
}
|
59
61
|
|
60
62
|
function sort(dragged, dropped) {
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { DataTable } from './table'
|
3
|
+
|
4
|
+
const TableTest = (prop) => {
|
5
|
+
|
6
|
+
function select(row) {
|
7
|
+
console.log('select',row)
|
8
|
+
}
|
9
|
+
|
10
|
+
function check(id,checked, c) {
|
11
|
+
console.log('check', id, checked, c)
|
12
|
+
}
|
13
|
+
|
14
|
+
const table = {
|
15
|
+
columns : [
|
16
|
+
{ id: "checked", onChange: check },
|
17
|
+
{ id: "name", label: "Name" },
|
18
|
+
|
19
|
+
],
|
20
|
+
rows: [
|
21
|
+
{ checked: true, name: "John Smith"},
|
22
|
+
{ checked: false, name: "Ann Martin"},
|
23
|
+
]
|
24
|
+
}
|
25
|
+
|
26
|
+
return (
|
27
|
+
<>
|
28
|
+
<DataTable {...table} onRowSelection={select}/>
|
29
|
+
</>
|
30
|
+
)
|
31
|
+
}
|