react-data-matrix 0.1.9 → 0.3.1
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/README.md +229 -164
- package/dist/components/MatrixHeaders.tsx +92 -0
- package/dist/components/MatrixRows.tsx +135 -0
- package/dist/components/ReactMatrix.tsx +47 -0
- package/dist/components/TableData.tsx +48 -0
- package/dist/context/index.tsx +66 -0
- package/dist/helpers/getStyles.ts +77 -0
- package/dist/index.ts +1 -0
- package/dist/types/index.d.ts +106 -0
- package/dist/utils/data.ts +346 -0
- package/dist/utils/functions.ts +33 -0
- package/package.json +16 -8
- package/dist/components/matrixHeaders.js +0 -78
- package/dist/components/matrixRows.js +0 -84
- package/dist/components/reactMatrix.js +0 -106
- package/dist/components/tableData.js +0 -63
- package/dist/context/index.js +0 -37
- package/dist/helpers/getStyles.js +0 -54
- package/dist/index.js +0 -13
- package/dist/utils/data.js +0 -315
- package/dist/utils/functions.js +0 -35
package/dist/utils/data.js
DELETED
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.data = void 0;
|
|
7
|
-
const data = {
|
|
8
|
-
id: 1,
|
|
9
|
-
matrix_size: 5,
|
|
10
|
-
matrix_name: "React Matrix",
|
|
11
|
-
primary_header_title: "Consequence",
|
|
12
|
-
primary_row_header_title: "Likelihood",
|
|
13
|
-
matrix_description: "Risk Matrix Template",
|
|
14
|
-
matrix_details: [{
|
|
15
|
-
id: 1,
|
|
16
|
-
likelihood: "E",
|
|
17
|
-
consequence: 1,
|
|
18
|
-
header_title: "Minor",
|
|
19
|
-
header_sub_title: "Header sub-title/description.",
|
|
20
|
-
row_header_title: "Rare",
|
|
21
|
-
row_header_sub_title: "Row Header sub-title/description."
|
|
22
|
-
}, {
|
|
23
|
-
id: 2,
|
|
24
|
-
position: 5,
|
|
25
|
-
matrix_type: "Risk",
|
|
26
|
-
likelihood: "D",
|
|
27
|
-
consequence: 2,
|
|
28
|
-
header_title: "Moderate",
|
|
29
|
-
header_sub_title: "Header sub-title/description.",
|
|
30
|
-
row_header_title: "Unlikely",
|
|
31
|
-
row_header_sub_title: "Row Header sub-title/description."
|
|
32
|
-
}, {
|
|
33
|
-
id: 3,
|
|
34
|
-
position: 5,
|
|
35
|
-
matrix_type: "Risk",
|
|
36
|
-
likelihood: "C",
|
|
37
|
-
consequence: 3,
|
|
38
|
-
header_title: "Significant",
|
|
39
|
-
header_sub_title: "Header sub-title/description.",
|
|
40
|
-
row_header_title: "Possible",
|
|
41
|
-
row_header_sub_title: "Row Header sub-title/description."
|
|
42
|
-
}, {
|
|
43
|
-
id: 4,
|
|
44
|
-
position: 5,
|
|
45
|
-
matrix_type: "Risk",
|
|
46
|
-
likelihood: "B",
|
|
47
|
-
consequence: 4,
|
|
48
|
-
header_title: "Critical",
|
|
49
|
-
header_sub_title: "Header sub-title/description.",
|
|
50
|
-
row_header_title: "Likely",
|
|
51
|
-
row_header_sub_title: "Row Header sub-title/description."
|
|
52
|
-
}, {
|
|
53
|
-
id: 5,
|
|
54
|
-
position: 5,
|
|
55
|
-
matrix_type: "Risk",
|
|
56
|
-
likelihood: "A",
|
|
57
|
-
consequence: 5,
|
|
58
|
-
header_title: "Catastrophic",
|
|
59
|
-
header_sub_title: "Header sub-title/description.",
|
|
60
|
-
row_header_title: "Almost Certain",
|
|
61
|
-
row_header_sub_title: "Row Header sub-title/description."
|
|
62
|
-
}],
|
|
63
|
-
matrix_values: [{
|
|
64
|
-
id: 26,
|
|
65
|
-
matrix_id: 1,
|
|
66
|
-
description: "low",
|
|
67
|
-
score_value: 1,
|
|
68
|
-
colour: "green",
|
|
69
|
-
position: 1,
|
|
70
|
-
likelihood_descriptor: "E",
|
|
71
|
-
consequence_descriptor: 1,
|
|
72
|
-
response: "Business as usual"
|
|
73
|
-
}, {
|
|
74
|
-
id: 27,
|
|
75
|
-
matrix_id: 1,
|
|
76
|
-
description: "low",
|
|
77
|
-
score_value: 2,
|
|
78
|
-
colour: "green",
|
|
79
|
-
position: 6,
|
|
80
|
-
likelihood_descriptor: "D",
|
|
81
|
-
consequence_descriptor: 1,
|
|
82
|
-
response: "Business as usual"
|
|
83
|
-
}, {
|
|
84
|
-
id: 28,
|
|
85
|
-
matrix_id: 1,
|
|
86
|
-
description: "low",
|
|
87
|
-
score_value: 3,
|
|
88
|
-
colour: "green",
|
|
89
|
-
position: 2,
|
|
90
|
-
likelihood_descriptor: "E",
|
|
91
|
-
consequence_descriptor: 2,
|
|
92
|
-
response: "Business as usual"
|
|
93
|
-
}, {
|
|
94
|
-
id: 29,
|
|
95
|
-
matrix_id: 1,
|
|
96
|
-
description: "low",
|
|
97
|
-
score_value: 4,
|
|
98
|
-
colour: "green",
|
|
99
|
-
position: 11,
|
|
100
|
-
likelihood_descriptor: "C",
|
|
101
|
-
consequence_descriptor: 1,
|
|
102
|
-
response: "Business as usual"
|
|
103
|
-
}, {
|
|
104
|
-
id: 30,
|
|
105
|
-
matrix_id: 1,
|
|
106
|
-
description: "low",
|
|
107
|
-
score_value: 5,
|
|
108
|
-
colour: "green",
|
|
109
|
-
position: 7,
|
|
110
|
-
likelihood_descriptor: "D",
|
|
111
|
-
consequence_descriptor: 2,
|
|
112
|
-
response: "Business as usual"
|
|
113
|
-
}, {
|
|
114
|
-
id: 31,
|
|
115
|
-
matrix_id: 1,
|
|
116
|
-
description: "low",
|
|
117
|
-
score_value: 6,
|
|
118
|
-
colour: "green",
|
|
119
|
-
position: 3,
|
|
120
|
-
likelihood_descriptor: "E",
|
|
121
|
-
consequence_descriptor: 3,
|
|
122
|
-
response: "Business as usual"
|
|
123
|
-
}, {
|
|
124
|
-
id: 32,
|
|
125
|
-
matrix_id: 1,
|
|
126
|
-
description: "medium",
|
|
127
|
-
score_value: 7,
|
|
128
|
-
colour: "yellow",
|
|
129
|
-
position: 16,
|
|
130
|
-
likelihood_descriptor: "B",
|
|
131
|
-
consequence_descriptor: 1,
|
|
132
|
-
response: "Requires routine to periodic monitoring"
|
|
133
|
-
}, {
|
|
134
|
-
id: 33,
|
|
135
|
-
matrix_id: 1,
|
|
136
|
-
description: "medium",
|
|
137
|
-
score_value: 8,
|
|
138
|
-
colour: "yellow",
|
|
139
|
-
position: 12,
|
|
140
|
-
likelihood_descriptor: "C",
|
|
141
|
-
consequence_descriptor: 2,
|
|
142
|
-
response: "Requires routine to periodic monitoring"
|
|
143
|
-
}, {
|
|
144
|
-
id: 34,
|
|
145
|
-
matrix_id: 1,
|
|
146
|
-
description: "medium",
|
|
147
|
-
score_value: 9,
|
|
148
|
-
colour: "yellow",
|
|
149
|
-
position: 8,
|
|
150
|
-
likelihood_descriptor: "D",
|
|
151
|
-
consequence_descriptor: 3,
|
|
152
|
-
response: "Requires routine to periodic monitoring"
|
|
153
|
-
}, {
|
|
154
|
-
id: 35,
|
|
155
|
-
matrix_id: 1,
|
|
156
|
-
description: "medium",
|
|
157
|
-
score_value: 10,
|
|
158
|
-
colour: "yellow",
|
|
159
|
-
position: 4,
|
|
160
|
-
likelihood_descriptor: "E",
|
|
161
|
-
consequence_descriptor: 4,
|
|
162
|
-
response: "Requires routine to periodic monitoring"
|
|
163
|
-
}, {
|
|
164
|
-
id: 36,
|
|
165
|
-
matrix_id: 1,
|
|
166
|
-
description: "medium",
|
|
167
|
-
score_value: 11,
|
|
168
|
-
colour: "yellow",
|
|
169
|
-
position: 21,
|
|
170
|
-
likelihood_descriptor: "A",
|
|
171
|
-
consequence_descriptor: 1,
|
|
172
|
-
response: "Requires routine to periodic monitoring"
|
|
173
|
-
}, {
|
|
174
|
-
id: 37,
|
|
175
|
-
matrix_id: 1,
|
|
176
|
-
description: "high",
|
|
177
|
-
score_value: 12,
|
|
178
|
-
colour: "orange",
|
|
179
|
-
position: 17,
|
|
180
|
-
likelihood_descriptor: "B",
|
|
181
|
-
consequence_descriptor: 2,
|
|
182
|
-
response: "Risk requires targeted management plan"
|
|
183
|
-
}, {
|
|
184
|
-
id: 38,
|
|
185
|
-
matrix_id: 1,
|
|
186
|
-
description: "high",
|
|
187
|
-
score_value: 13,
|
|
188
|
-
colour: "orange",
|
|
189
|
-
position: 13,
|
|
190
|
-
likelihood_descriptor: "C",
|
|
191
|
-
consequence_descriptor: 3,
|
|
192
|
-
response: "Risk requires targeted management plan"
|
|
193
|
-
}, {
|
|
194
|
-
id: 39,
|
|
195
|
-
matrix_id: 1,
|
|
196
|
-
description: "high",
|
|
197
|
-
score_value: 14,
|
|
198
|
-
colour: "orange",
|
|
199
|
-
position: 9,
|
|
200
|
-
likelihood_descriptor: "D",
|
|
201
|
-
consequence_descriptor: 4,
|
|
202
|
-
response: "Risk requires targeted management plan"
|
|
203
|
-
}, {
|
|
204
|
-
id: 40,
|
|
205
|
-
matrix_id: 1,
|
|
206
|
-
description: "high",
|
|
207
|
-
score_value: 15,
|
|
208
|
-
colour: "orange",
|
|
209
|
-
position: 5,
|
|
210
|
-
likelihood_descriptor: "E",
|
|
211
|
-
consequence_descriptor: 5,
|
|
212
|
-
response: "Risk requires targeted management plan"
|
|
213
|
-
}, {
|
|
214
|
-
id: 41,
|
|
215
|
-
matrix_id: 1,
|
|
216
|
-
description: "high",
|
|
217
|
-
score_value: 16,
|
|
218
|
-
colour: "orange",
|
|
219
|
-
position: 22,
|
|
220
|
-
likelihood_descriptor: "A",
|
|
221
|
-
consequence_descriptor: 2,
|
|
222
|
-
response: "Risk requires targeted management plan"
|
|
223
|
-
}, {
|
|
224
|
-
id: 42,
|
|
225
|
-
matrix_id: 1,
|
|
226
|
-
description: "high",
|
|
227
|
-
score_value: 17,
|
|
228
|
-
colour: "orange",
|
|
229
|
-
position: 18,
|
|
230
|
-
likelihood_descriptor: "B",
|
|
231
|
-
consequence_descriptor: 3,
|
|
232
|
-
response: "Risk requires targeted management plan"
|
|
233
|
-
}, {
|
|
234
|
-
id: 43,
|
|
235
|
-
matrix_id: 1,
|
|
236
|
-
description: "high",
|
|
237
|
-
score_value: 18,
|
|
238
|
-
colour: "orange",
|
|
239
|
-
position: 14,
|
|
240
|
-
likelihood_descriptor: "C",
|
|
241
|
-
consequence_descriptor: 4,
|
|
242
|
-
response: "Risk requires targeted management plan"
|
|
243
|
-
}, {
|
|
244
|
-
id: 44,
|
|
245
|
-
matrix_id: 1,
|
|
246
|
-
description: "high",
|
|
247
|
-
score_value: 19,
|
|
248
|
-
colour: "orange",
|
|
249
|
-
position: 10,
|
|
250
|
-
likelihood_descriptor: "D",
|
|
251
|
-
consequence_descriptor: 5,
|
|
252
|
-
response: "Risk requires targeted management plan"
|
|
253
|
-
}, {
|
|
254
|
-
id: 45,
|
|
255
|
-
matrix_id: 1,
|
|
256
|
-
description: "extreme",
|
|
257
|
-
score_value: 20,
|
|
258
|
-
colour: "red",
|
|
259
|
-
position: 23,
|
|
260
|
-
likelihood_descriptor: "A",
|
|
261
|
-
consequence_descriptor: 3,
|
|
262
|
-
response: "Activity should not commence"
|
|
263
|
-
}, {
|
|
264
|
-
id: 46,
|
|
265
|
-
matrix_id: 1,
|
|
266
|
-
description: "extreme",
|
|
267
|
-
score_value: 21,
|
|
268
|
-
colour: "red",
|
|
269
|
-
position: 19,
|
|
270
|
-
likelihood_descriptor: "B",
|
|
271
|
-
consequence_descriptor: 4,
|
|
272
|
-
response: "Activity should not commence"
|
|
273
|
-
}, {
|
|
274
|
-
id: 47,
|
|
275
|
-
matrix_id: 1,
|
|
276
|
-
description: "extreme",
|
|
277
|
-
score_value: 22,
|
|
278
|
-
colour: "red",
|
|
279
|
-
position: 15,
|
|
280
|
-
likelihood_descriptor: "C",
|
|
281
|
-
consequence_descriptor: 5,
|
|
282
|
-
response: "Activity should not commence"
|
|
283
|
-
}, {
|
|
284
|
-
id: 48,
|
|
285
|
-
matrix_id: 1,
|
|
286
|
-
description: "extreme",
|
|
287
|
-
score_value: 23,
|
|
288
|
-
colour: "red",
|
|
289
|
-
position: 24,
|
|
290
|
-
likelihood_descriptor: "A",
|
|
291
|
-
consequence_descriptor: 4,
|
|
292
|
-
response: "Activity should not commence"
|
|
293
|
-
}, {
|
|
294
|
-
id: 49,
|
|
295
|
-
matrix_id: 1,
|
|
296
|
-
description: "extreme",
|
|
297
|
-
score_value: 24,
|
|
298
|
-
colour: "red",
|
|
299
|
-
position: 20,
|
|
300
|
-
likelihood_descriptor: "B",
|
|
301
|
-
consequence_descriptor: 5,
|
|
302
|
-
response: "Activity should not commence"
|
|
303
|
-
}, {
|
|
304
|
-
id: 50,
|
|
305
|
-
matrix_id: 1,
|
|
306
|
-
description: "extreme",
|
|
307
|
-
score_value: 25,
|
|
308
|
-
colour: "red",
|
|
309
|
-
position: 25,
|
|
310
|
-
likelihood_descriptor: "A",
|
|
311
|
-
consequence_descriptor: 5,
|
|
312
|
-
response: "Activity should not commence"
|
|
313
|
-
}]
|
|
314
|
-
};
|
|
315
|
-
exports.data = data;
|
package/dist/utils/functions.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.groupObjectsByProp = exports.capitaliseString = exports.capitaliseFirstCharacter = exports.callAll = void 0;
|
|
7
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
8
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
9
|
-
require("core-js/modules/es.string.replace.js");
|
|
10
|
-
const groupObjectsByProp = (array, prop) => {
|
|
11
|
-
const map = new Map(Array.from(array, obj => [obj[prop], []]));
|
|
12
|
-
array.forEach(obj => map.get(obj[prop]).push(obj));
|
|
13
|
-
return Array.from(map.values());
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// capitalises first character of each word
|
|
17
|
-
exports.groupObjectsByProp = groupObjectsByProp;
|
|
18
|
-
const capitaliseFirstCharacter = stringValue => stringValue.replace(/\b([a-z\s])/g, string => string.toUpperCase());
|
|
19
|
-
|
|
20
|
-
// capitalizes entire word
|
|
21
|
-
exports.capitaliseFirstCharacter = capitaliseFirstCharacter;
|
|
22
|
-
const capitaliseString = stringValue => stringValue.toUpperCase();
|
|
23
|
-
exports.capitaliseString = capitaliseString;
|
|
24
|
-
const callAll = function callAll() {
|
|
25
|
-
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
-
fns[_key] = arguments[_key];
|
|
27
|
-
}
|
|
28
|
-
return function () {
|
|
29
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
30
|
-
args[_key2] = arguments[_key2];
|
|
31
|
-
}
|
|
32
|
-
return fns.forEach(fn => fn && fn(...args));
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
exports.callAll = callAll;
|