-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: memo table cell for performance
- Loading branch information
Showing
5 changed files
with
237 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import Orchestrator from '../../utils/orchestrator'; | ||
import source from './source.json'; | ||
import { generateData } from '../../../../tests/utils/lunatic'; | ||
import { times } from '../../../utils/array'; | ||
|
||
const stories = { | ||
title: 'Behaviour/Performance', | ||
component: Orchestrator, | ||
}; | ||
|
||
export default stories; | ||
|
||
const Template = (args) => <Orchestrator {...args} />; | ||
export const Default = Template.bind({}); | ||
Default.args = { | ||
id: 'performance-default', | ||
pagination: true, | ||
source, | ||
data: generateData({ | ||
PRENOM: times(200, (k) => `John${k}`), | ||
NOM: times(200, (k) => `Doe${k}`), | ||
AGE: times(200, (k) => k + 1), | ||
BIRTHDAY: times(200, (k) => `2${k.toString().padStart(3, '0')}-01-01`), | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
{ | ||
"maxPage": "3", | ||
"components": [ | ||
{ | ||
"id": "seq", | ||
"componentType": "Sequence", | ||
"label": { | ||
"value": "\"Description des individus de votre logement\"", | ||
"type": "VTL|MD" | ||
}, | ||
"conditionFilter": { "value": "true", "type": "VTL" }, | ||
"page": "1" | ||
}, | ||
{ | ||
"id": "loop-prenom", | ||
"componentType": "RosterForLoop", | ||
"header": [ | ||
{ "headerCell": true, "label": "Prénom" }, | ||
{ "headerCell": true, "label": "Nom" }, | ||
{ "headerCell": true, "label": "Date de naissance" }, | ||
{ "headerCell": true, "label": "Age" } | ||
], | ||
"label": { "value": "\"Ajouter un individu\"", "type": "VTL|MD" }, | ||
"conditionFilter": { "value": "true", "type": "VTL" }, | ||
"bindingDependencies": ["PRENOM", "AGE"], | ||
"lines": { | ||
"min": { "value": 1, "type": "VTL" }, | ||
"max": { "value": 10, "type": "VTL" } | ||
}, | ||
"page": "1", | ||
"components": [ | ||
{ | ||
"componentType": "Input", | ||
"conditionFilter": { "value": "true", "type": "VTL" }, | ||
"maxLength": 30, | ||
"bindingDependencies": ["PRENOM"], | ||
"id": "prenom", | ||
"response": { | ||
"name": "PRENOM" | ||
} | ||
}, | ||
{ | ||
"componentType": "Input", | ||
"conditionFilter": { "value": "true", "type": "VTL" }, | ||
"maxLength": 30, | ||
"bindingDependencies": ["NOM"], | ||
"id": "nom", | ||
"response": { | ||
"name": "NOM" | ||
} | ||
}, | ||
{ | ||
"componentType": "Datepicker", | ||
"conditionFilter": { "value": "true", "type": "VTL" }, | ||
"maxLength": 30, | ||
"bindingDependencies": ["BIRTHDAY"], | ||
"id": "birthday", | ||
"dateFormat": "YYYY-MM-DD", | ||
"response": { | ||
"name": "BIRTHDAY" | ||
} | ||
}, | ||
{ | ||
"componentType": "Input", | ||
"conditionFilter": { "value": "true", "type": "VTL" }, | ||
"maxLength": 30, | ||
"bindingDependencies": ["AGE"], | ||
"id": "age", | ||
"response": { | ||
"name": "AGE" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "loop", | ||
"componentType": "Loop", | ||
|
||
"loopDependencies": ["PRENOM"], | ||
"iterations": { "value": "count(PRENOM)", "type": "VTL" }, | ||
"page": "2", | ||
"maxPage": "1", | ||
"depth": 1, | ||
"paginatedLoop": true, | ||
"conditionFilter": { | ||
"value": "true", | ||
"type": "VTL" | ||
}, | ||
"components": [ | ||
{ | ||
"id": "age", | ||
"label": { | ||
"value": "PRENOM || \", quel est vôtre âge ?\"", | ||
"type": "VTL" | ||
}, | ||
"conditionFilter": { | ||
"value": "true", | ||
"type": "VTL" | ||
}, | ||
"page": "2.1", | ||
"componentType": "InputNumber", | ||
"min": 0, | ||
"max": 120, | ||
"decimals": 0, | ||
"response": { "name": "AGE" } | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "seq-end", | ||
"componentType": "Sequence", | ||
"label": { | ||
"value": "\"End\"", | ||
"type": "VTL|MD" | ||
}, | ||
"conditionFilter": { "value": "true", "type": "VTL" }, | ||
"page": "3" | ||
} | ||
], | ||
"resizing": { | ||
"PRENOM": { | ||
"size": "count(PRENOM)", | ||
"variables": ["AGE"] | ||
} | ||
}, | ||
"variables": [ | ||
{ | ||
"variableType": "COLLECTED", | ||
"name": "PRENOM", | ||
"values": { | ||
"PREVIOUS": [null], | ||
"COLLECTED": [null], | ||
"FORCED": [null], | ||
"EDITED": [null], | ||
"INPUTED": [null] | ||
} | ||
}, | ||
{ | ||
"variableType": "COLLECTED", | ||
"name": "NOM", | ||
"values": { | ||
"PREVIOUS": [null], | ||
"COLLECTED": [null], | ||
"FORCED": [null], | ||
"EDITED": [null], | ||
"INPUTED": [null] | ||
} | ||
}, | ||
{ | ||
"variableType": "COLLECTED", | ||
"name": "BIRTHDAY", | ||
"values": { | ||
"PREVIOUS": [null], | ||
"COLLECTED": [null], | ||
"FORCED": [null], | ||
"EDITED": [null], | ||
"INPUTED": [null] | ||
} | ||
}, | ||
{ | ||
"variableType": "COLLECTED", | ||
"name": "AGE", | ||
"values": { | ||
"PREVIOUS": [null], | ||
"COLLECTED": [null], | ||
"FORCED": [null], | ||
"EDITED": [null], | ||
"INPUTED": [null] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters