arengibook 2.0.3-table → 2.0.5-table
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.js +26 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44014,6 +44014,21 @@ var Table = function Table(_ref) {
|
|
|
44014
44014
|
return (_rowData$col$field = rowData[col.field]) !== null && _rowData$col$field !== void 0 ? _rowData$col$field : '';
|
|
44015
44015
|
};
|
|
44016
44016
|
}, []);
|
|
44017
|
+
var colorTextTemplate = useCallback(function (col) {
|
|
44018
|
+
return function (rowData) {
|
|
44019
|
+
var text = rowData[col.field];
|
|
44020
|
+
var color = rowData[col.field + 'Color'];
|
|
44021
|
+
console.log(rowData);
|
|
44022
|
+
if (!color) return text !== null && text !== void 0 ? text : '';
|
|
44023
|
+
return /*#__PURE__*/React__default.createElement("span", {
|
|
44024
|
+
className: "tab_label",
|
|
44025
|
+
style: {
|
|
44026
|
+
backgroundColor: color,
|
|
44027
|
+
color: textColorForBg(color)
|
|
44028
|
+
}
|
|
44029
|
+
}, text);
|
|
44030
|
+
};
|
|
44031
|
+
}, []);
|
|
44017
44032
|
var selectMultipleTemplate = useCallback(function (col) {
|
|
44018
44033
|
return function (rowData) {
|
|
44019
44034
|
var vals = rowData[col.field];
|
|
@@ -44122,11 +44137,13 @@ var Table = function Table(_ref) {
|
|
|
44122
44137
|
return selectTemplate(col);
|
|
44123
44138
|
case 'selectMultiple':
|
|
44124
44139
|
return selectMultipleTemplate(col);
|
|
44140
|
+
case 'colorText':
|
|
44141
|
+
return colorTextTemplate(col);
|
|
44125
44142
|
case 'text':
|
|
44126
44143
|
default:
|
|
44127
44144
|
return col.textTemplate ? textTemplate(col) : undefined;
|
|
44128
44145
|
}
|
|
44129
|
-
}, [linkTemplate, dateTemplate, selectTemplate, selectMultipleTemplate, textTemplate]);
|
|
44146
|
+
}, [linkTemplate, dateTemplate, selectTemplate, selectMultipleTemplate, colorTextTemplate, textTemplate]);
|
|
44130
44147
|
var getSortField = useCallback(function (col) {
|
|
44131
44148
|
return col.field;
|
|
44132
44149
|
}, []);
|
|
@@ -44262,16 +44279,6 @@ var statutOptions = [{
|
|
|
44262
44279
|
label: 'Archivé',
|
|
44263
44280
|
color: '#95A5A6'
|
|
44264
44281
|
}];
|
|
44265
|
-
var categorieOptions = [{
|
|
44266
|
-
value: 'client',
|
|
44267
|
-
label: 'Client'
|
|
44268
|
-
}, {
|
|
44269
|
-
value: 'prospect',
|
|
44270
|
-
label: 'Prospect'
|
|
44271
|
-
}, {
|
|
44272
|
-
value: 'partenaire',
|
|
44273
|
-
label: 'Partenaire'
|
|
44274
|
-
}];
|
|
44275
44282
|
var competencesOptions = [{
|
|
44276
44283
|
value: 'react',
|
|
44277
44284
|
label: 'React',
|
|
@@ -44300,6 +44307,7 @@ var dataTyped = [{
|
|
|
44300
44307
|
dateNaissance: '1990-07-22',
|
|
44301
44308
|
statut: 'actif',
|
|
44302
44309
|
categorie: 'client',
|
|
44310
|
+
categorieColor: '#2980B9',
|
|
44303
44311
|
competences: ['react', 'symfony']
|
|
44304
44312
|
}, {
|
|
44305
44313
|
id: 2,
|
|
@@ -44308,6 +44316,7 @@ var dataTyped = [{
|
|
|
44308
44316
|
dateNaissance: '1985-11-03',
|
|
44309
44317
|
statut: 'inactif',
|
|
44310
44318
|
categorie: 'prospect',
|
|
44319
|
+
categorieColor: '#E67E22',
|
|
44311
44320
|
competences: ['sql']
|
|
44312
44321
|
}, {
|
|
44313
44322
|
id: 3,
|
|
@@ -44316,6 +44325,7 @@ var dataTyped = [{
|
|
|
44316
44325
|
dateNaissance: '1995-02-14',
|
|
44317
44326
|
statut: 'actif',
|
|
44318
44327
|
categorie: 'partenaire',
|
|
44328
|
+
categorieColor: '#8E44AD',
|
|
44319
44329
|
competences: ['design', 'react']
|
|
44320
44330
|
}, {
|
|
44321
44331
|
id: 4,
|
|
@@ -44324,6 +44334,7 @@ var dataTyped = [{
|
|
|
44324
44334
|
dateNaissance: '1978-06-01',
|
|
44325
44335
|
statut: 'archive',
|
|
44326
44336
|
categorie: 'client',
|
|
44337
|
+
categorieColor: '#2980B9',
|
|
44327
44338
|
competences: ['devops', 'sql', 'symfony']
|
|
44328
44339
|
}, {
|
|
44329
44340
|
id: 5,
|
|
@@ -44332,6 +44343,7 @@ var dataTyped = [{
|
|
|
44332
44343
|
dateNaissance: '2001-12-09',
|
|
44333
44344
|
statut: 'actif',
|
|
44334
44345
|
categorie: 'prospect',
|
|
44346
|
+
categorieColor: '#E67E22',
|
|
44335
44347
|
competences: []
|
|
44336
44348
|
}, {
|
|
44337
44349
|
id: 6,
|
|
@@ -44340,6 +44352,7 @@ var dataTyped = [{
|
|
|
44340
44352
|
dateNaissance: '1969-08-27',
|
|
44341
44353
|
statut: 'inactif',
|
|
44342
44354
|
categorie: 'client',
|
|
44355
|
+
categorieColor: '#2980B9',
|
|
44343
44356
|
competences: ['react', 'devops', 'design']
|
|
44344
44357
|
}, {
|
|
44345
44358
|
id: 7,
|
|
@@ -44348,6 +44361,7 @@ var dataTyped = [{
|
|
|
44348
44361
|
dateNaissance: '1993-03-18',
|
|
44349
44362
|
statut: 'actif',
|
|
44350
44363
|
categorie: 'partenaire',
|
|
44364
|
+
categorieColor: '#8E44AD',
|
|
44351
44365
|
competences: ['symfony', 'sql']
|
|
44352
44366
|
}];
|
|
44353
44367
|
var columnsTyped = [{
|
|
@@ -44374,8 +44388,7 @@ var columnsTyped = [{
|
|
|
44374
44388
|
}, {
|
|
44375
44389
|
field: 'categorie',
|
|
44376
44390
|
header: 'Catégorie',
|
|
44377
|
-
type: '
|
|
44378
|
-
options: categorieOptions
|
|
44391
|
+
type: 'colorText'
|
|
44379
44392
|
}, {
|
|
44380
44393
|
field: 'competences',
|
|
44381
44394
|
header: 'Compétences',
|