genesys-react-components 0.4.0 → 0.4.1-devengage-1573-implementing-tables.246
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/build/datatable/DataTable.d.ts +13 -0
- package/build/index.d.ts +12 -1
- package/build/index.js +6013 -32
- package/build/index.js.map +1 -1
- package/package.json +56 -52
- package/src/datatable/DataTable.scss +199 -0
- package/src/datatable/DataTable.tsx +431 -0
- package/src/index.ts +14 -0
package/package.json
CHANGED
|
@@ -1,53 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
2
|
+
"name": "genesys-react-components",
|
|
3
|
+
"version": "0.4.1-devengage-1573-implementing-tables.246",
|
|
4
|
+
"description": "A React component library containing standardized form elements.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "build/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
"require": "./src/index.ts",
|
|
9
|
+
"default": "./build/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"build",
|
|
13
|
+
"src"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "rm -rf build && rollup -c rollup.config.js",
|
|
17
|
+
"localbuild": "npm i && npm run build && rm -rf node_modules",
|
|
18
|
+
"test": "echo \"0/0 tests passed. That's technically a perfect score. Keep up the great work!\""
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+ssh://git@github.com/purecloudlabs/genesys-react-components.git"
|
|
23
|
+
},
|
|
24
|
+
"author": "Genesys",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/purecloudlabs/genesys-react-components/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://purecloudlabs.github.io/genesys-react-components",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@rollup/plugin-commonjs": "^21.0.1",
|
|
32
|
+
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
33
|
+
"@types/react": "^16",
|
|
34
|
+
"genesys-dev-icons": "^0.3.0",
|
|
35
|
+
"react": "^16",
|
|
36
|
+
"react-dom": "^16",
|
|
37
|
+
"rollup": "^2.60.2",
|
|
38
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
39
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
40
|
+
"rollup-plugin-typescript2": "^0.31.1",
|
|
41
|
+
"sass": "^1.44.0",
|
|
42
|
+
"typescript": "^4.5.2",
|
|
43
|
+
"uuid": "^9.0.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"genesys-dev-icons": "0.x",
|
|
47
|
+
"postcss": "^8.4.6",
|
|
48
|
+
"react": ">=16",
|
|
49
|
+
"react-dom": ">=16",
|
|
50
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
51
|
+
"uuid": "^9.0.0"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"moment": "^2.29.4",
|
|
55
|
+
"postcss": "^8.4.6"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
@import '../theme/variables.scss';
|
|
2
|
+
|
|
3
|
+
$cellWidthPadding: 10px;
|
|
4
|
+
|
|
5
|
+
.table-container {
|
|
6
|
+
margin: 40px 0;
|
|
7
|
+
|
|
8
|
+
.filter-container {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-flow: row nowrap;
|
|
11
|
+
gap: 8px;
|
|
12
|
+
width: 100%;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
|
|
15
|
+
.filter-toggle {
|
|
16
|
+
color: var($--theme-core-link-color);
|
|
17
|
+
font-size: 12px;
|
|
18
|
+
line-height: 0;
|
|
19
|
+
margin: 6px 0 0 10px;
|
|
20
|
+
// padding: 2px;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
align-self: flex-start;
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
color: var($--theme-core-link-hover-color);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.table {
|
|
31
|
+
width: 100%;
|
|
32
|
+
margin: 0 30px 0 0;
|
|
33
|
+
color: var($--theme-datatable-text-color);
|
|
34
|
+
background-color: var($--theme-datatable-background-color);
|
|
35
|
+
|
|
36
|
+
// Remove paragraph padding from all cells
|
|
37
|
+
td {
|
|
38
|
+
border-width: 0 0 1px 0;
|
|
39
|
+
border-style: solid;
|
|
40
|
+
border-color: var($--theme-datatable-border-color);
|
|
41
|
+
vertical-align: top;
|
|
42
|
+
min-width: 80px;
|
|
43
|
+
|
|
44
|
+
& p {
|
|
45
|
+
margin: 0;
|
|
46
|
+
min-width: 10%;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
thead {
|
|
51
|
+
tr {
|
|
52
|
+
color: var($--theme-datatable-text-color);
|
|
53
|
+
font-weight: bold;
|
|
54
|
+
font-size: 14px;
|
|
55
|
+
line-height: 24px;
|
|
56
|
+
|
|
57
|
+
td {
|
|
58
|
+
padding: 0 $cellWidthPadding;
|
|
59
|
+
|
|
60
|
+
.header-container {
|
|
61
|
+
margin: 0;
|
|
62
|
+
padding: 0;
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-flow: row nowrap;
|
|
65
|
+
justify-content: flex-start;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 6px;
|
|
68
|
+
width: 100%;
|
|
69
|
+
|
|
70
|
+
&.align-center {
|
|
71
|
+
justify-content: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&.align-right {
|
|
75
|
+
justify-content: flex-end;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.sort-numeric {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-flow: row nowrap;
|
|
82
|
+
gap: 8px;
|
|
83
|
+
align-items: center;
|
|
84
|
+
|
|
85
|
+
.dx-label {
|
|
86
|
+
max-width: 70px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.sort-date {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-flow: row nowrap;
|
|
93
|
+
gap: 8px;
|
|
94
|
+
align-items: center;
|
|
95
|
+
|
|
96
|
+
.date-filter {
|
|
97
|
+
max-width: 155px;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.filter-spacer {
|
|
103
|
+
height: 10px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.filter-row {
|
|
107
|
+
background-color: var($--theme-datatable-filter-background-color);
|
|
108
|
+
|
|
109
|
+
td {
|
|
110
|
+
border-width: 1px 0;
|
|
111
|
+
vertical-align: middle;
|
|
112
|
+
}
|
|
113
|
+
td:first-child {
|
|
114
|
+
border-width: 1px 0 1px 1px;
|
|
115
|
+
border-radius: 4px 0 0 4px;
|
|
116
|
+
}
|
|
117
|
+
td:last-child {
|
|
118
|
+
border-width: 1px 1px 1px 0;
|
|
119
|
+
border-radius: 0 4px 4px 0;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
tbody {
|
|
126
|
+
tr {
|
|
127
|
+
font-size: 12px;
|
|
128
|
+
line-height: 20px;
|
|
129
|
+
|
|
130
|
+
td {
|
|
131
|
+
padding: 16px $cellWidthPadding;
|
|
132
|
+
|
|
133
|
+
& > div {
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-flow: row nowrap;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: flex-start;
|
|
138
|
+
gap: 10px;
|
|
139
|
+
|
|
140
|
+
&.align-center {
|
|
141
|
+
justify-content: center;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&.align-right {
|
|
145
|
+
justify-content: flex-end;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.copy-button {
|
|
149
|
+
color: unset;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.icon {
|
|
153
|
+
line-height: 0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Reduce outside edge padding
|
|
161
|
+
tr {
|
|
162
|
+
td:first-child {
|
|
163
|
+
padding-left: 12px;
|
|
164
|
+
}
|
|
165
|
+
td:last-child {
|
|
166
|
+
padding-right: 12px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&.paginated {
|
|
172
|
+
.table {
|
|
173
|
+
margin-bottom: 10px;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&.sortable {
|
|
178
|
+
.table {
|
|
179
|
+
thead tr {
|
|
180
|
+
td {
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
|
|
183
|
+
.sort-icon,
|
|
184
|
+
.filter-active-icon {
|
|
185
|
+
color: var($--theme-core-link-color);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&.unsorted .sort-icon {
|
|
189
|
+
visibility: hidden;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&:hover .sort-icon {
|
|
193
|
+
visibility: visible;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|