Skip to content

Commit af940e3

Browse files
authored
Merge pull request #3 from geohyd/develop
feat: adding renderer fix: Compile to ES2015 fix: merge standardColumns
2 parents 22bdf27 + 9d682fd commit af940e3

15 files changed

+16899
-16772
lines changed

.gitlab-ci.yml

-18
This file was deleted.

README.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ You can provide Datatable native configuration in the main object. It works prop
6363

6464
If you want more info about the base configuration, please refer to the official documentation.
6565

66-
If you want to add the specific Lyxea custom object, you need to add the key `lxConfig`.
66+
If you want to add the specific Lyxea custom object, you need to add the key `lxConfig`. Then you can add your own custom configuration depend on your needs.
6767

6868
The following sections are dedicated to this configuration.
6969

@@ -146,6 +146,23 @@ If you want to add an action on each row of the datatable, we need to implement
146146

147147
To do it, simply add the key `actions` on the LyxaDatatable specific config object.
148148

149+
### Renderer
150+
151+
| name | description | example |
152+
| ------------------ | ------------------------------------------------------------------------------------------ | ---------------------------------------------------- | --- | --- |
153+
| DATE*TO_FORMAT* | parse date to defined format | {render: 'DATE_TO_FORMAT_YYYY'} => '2024' |
154+
| DATE | parse date to predefined date format | '23/04/2024 12:23' |
155+
| DATE_DAY | parse date with year, month and day only | '23/04/2024' |
156+
| DATE_WITH_SECOND | parse date to predefined date format | '23/04/2024 12:23:34' |
157+
| LOCAL_NUMBER | parse number to string with correct format | 1300 => '1 300' |
158+
| BOOLEAN_YESNO | return a string 'Yes' / 'No' depend on the bool value | true => "Yes" or false => "No" |
159+
| NUMBER_FIXED_2 | fix the number value to two digit | 1.3443 => 1.34, 1 => 1.00 |
160+
| NUMBER_2_DIGIT_MAX | fix the number value to two digit max | 1.3443 => 1.34, 1 => 1 |
161+
| CUT_LONG_TEXT | In case of a long text, prevent the overflow by cutting the text and replace it with '...' | "a very long text" => "a very ..." |
162+
| PARSE_INT | parse a string to integer | "3" => 3 |
163+
| CHECKBOX | add a checkbox at the first columns of the table | |
164+
| UPPERCASE | convert a string to uppercase | "this must be uppercase" => "THIS MUST BE UPPERCASE" | | |
165+
149166
## Architecture
150167

151168
### Project structure

dist/dto/Renderer.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@ export type RendederConfig = {};
33
declare class LxRenderer {
44
renderers: Array<RendederConfig>;
55
constructor(config: LxConfigObject);
6+
number2DigitMax(data: any | null): any;
7+
booleanString: (data: boolean) => "Oui" | "Non";
8+
cutLongText: (data: any) => any;
9+
uppercase: (data: any) => any;
10+
numberToFixed: (data: any) => string | undefined;
611
}
712
export default LxRenderer;

0 commit comments

Comments
 (0)