@yanqirenshi/table.wbs 0.0.15 → 0.0.17

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.
@@ -0,0 +1,17 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(node -e \"console.log\\(require\\('./node_modules/react/package.json'\\).version\\)\")",
5
+ "Bash(npm install *)",
6
+ "Bash(npm test *)",
7
+ "Bash(git stash *)",
8
+ "Bash(npm view *)",
9
+ "Bash(npx react-scripts *)",
10
+ "Bash(SKIP_PREFLIGHT_CHECK=true CI=true npx react-scripts test --watchAll=false)",
11
+ "Bash(SKIP_PREFLIGHT_CHECK=true CI=true npx react-scripts build)",
12
+ "Bash(SKIP_PREFLIGHT_CHECK=true BROWSER=none npx react-scripts start)",
13
+ "Bash(kill %1)",
14
+ "Bash(wait)"
15
+ ]
16
+ }
17
+ }
package/README.md CHANGED
@@ -1,3 +1,103 @@
1
1
  # table.WBS
2
2
 
3
+ ## Usage
4
+
3
5
  See: examples/
6
+
7
+ ### (1) Code
8
+
9
+ ```
10
+ import React from 'react';
11
+
12
+ import WBSTable from '@yanqirenshi/table.wbs';
13
+
14
+ import * as WBS_DATA from './data.js';
15
+
16
+ export default function Example() {
17
+ const columns = [
18
+ {
19
+ label: 'Code',
20
+ leveling: true,
21
+ required: true,
22
+ contents: (c, d) => {
23
+ return <>{d._id}</>;
24
+ }
25
+ },
26
+ {
27
+ label: 'Name',
28
+ required: true,
29
+ contents: (c, d) => {
30
+ return <span>{d.label}</span>;
31
+ },
32
+ },
33
+ {
34
+ label: 'Description',
35
+ contents: (c, d) => {
36
+ return d.description;
37
+ }
38
+ },
39
+ ];
40
+
41
+ const wbs_source = {
42
+ projects: WBS_DATA.PROJECTS,
43
+ wbs: WBS_DATA.WBS,
44
+ workpackages: WBS_DATA.WORKPACKAGES,
45
+ edges: WBS_DATA.EDGES,
46
+ };
47
+
48
+ const options = {}; // or null
49
+ const style_table = { fontSize: '16px' }; // or null
50
+ return (
51
+ <div style={{padding: '33px'}}>
52
+ <WBSTable source={wbs_source}
53
+ columns={columns}
54
+ options={options}
55
+ style={style_table}/>
56
+ </div>
57
+ );
58
+ }
59
+ ```
60
+
61
+ ### (2) Data
62
+
63
+ ```
64
+ export const PROJECTS = [
65
+ {
66
+ _id: 1,
67
+ _class: 'PROJECT',
68
+ label: 'a',
69
+ }
70
+ ];
71
+ export const WBS = [
72
+ {
73
+ _id: 10,
74
+ _class: 'WBS',
75
+ label: 'b',
76
+ }
77
+ ];
78
+ export const WORKPACKAGES = [
79
+ {
80
+ _id: 100,
81
+ _class: 'WORKPACKAGE',
82
+ label: 'c',
83
+ }
84
+ ];
85
+
86
+ let i = 10000000;
87
+ export const EDGES = [
88
+ {
89
+ _id: i++,
90
+ from_id: 1,
91
+ from_class: 'PROJECT',
92
+ to_id: 10,
93
+ to_class: 'WBS',
94
+ },
95
+ {
96
+ _id: i++,
97
+ from_id: 10,
98
+ from_class: 'WBS',
99
+ to_id: 100,
100
+ to_class: 'WORKPACKAGE',
101
+ },
102
+ ];
103
+ ```
@@ -78,7 +78,8 @@ function Controller(props) {
78
78
  }), /*#__PURE__*/_react["default"].createElement("span", {
79
79
  className: "icon is-small is-left"
80
80
  }, /*#__PURE__*/_react["default"].createElement(_reactFontawesome.FontAwesomeIcon, {
81
- icon: _freeSolidSvgIcons.faFilter
81
+ icon: _freeSolidSvgIcons.faFilter,
82
+ className: ""
82
83
  })))))), /*#__PURE__*/_react["default"].createElement("div", {
83
84
  style: style_right
84
85
  }, /*#__PURE__*/_react["default"].createElement("button", {
@@ -91,6 +92,7 @@ function Controller(props) {
91
92
  onClick: xxx
92
93
  }, /*#__PURE__*/_react["default"].createElement(_reactFontawesome.FontAwesomeIcon, {
93
94
  icon: _freeSolidSvgIcons.faDownload,
95
+ className: "",
94
96
  style: {
95
97
  fontSize: 14
96
98
  }
@@ -51,12 +51,14 @@ function opener(row, column, closed_wbs, callback) {
51
51
  style: {
52
52
  color: '#888084'
53
53
  },
54
- icon: _freeSolidSvgIcons.faCaretRight
54
+ icon: _freeSolidSvgIcons.faCaretRight,
55
+ className: ""
55
56
  }), !x && /*#__PURE__*/_react["default"].createElement(_reactFontawesome.FontAwesomeIcon, {
56
57
  style: {
57
58
  color: '#dddcd6'
58
59
  },
59
- icon: _freeSolidSvgIcons.faCaretDown
60
+ icon: _freeSolidSvgIcons.faCaretDown,
61
+ className: ""
60
62
  }));
61
63
  }
62
64