@massimo-cassandro/minimo 1.32.1 → 1.32.2
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/package.json
CHANGED
|
@@ -119,52 +119,18 @@ export function parseCols(col_obj){
|
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
} else if(col_obj._renderMode === 'numeric'
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// console.log(value);
|
|
127
|
-
if(value == null || isNaN(value)) {
|
|
128
|
-
cell.attributes['data-order'] = '';
|
|
129
|
-
return '\u2014';
|
|
130
|
-
|
|
131
|
-
} else {
|
|
132
|
-
cell.attributes['data-order'] = value;
|
|
133
|
-
return Number(value).toLocaleString('it-IT', {
|
|
134
|
-
useGrouping: 'always',
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
// le classi definite dall'utente vengono unite, non sostituite
|
|
139
|
-
cellClass: classnames('text-end text-numeric', col_obj.cellClass),
|
|
140
|
-
headerClass: classnames('text-end text-numeric', col_obj.headerClass), // NB: usata anche per il footer
|
|
141
|
-
};
|
|
122
|
+
} else if( col_obj._renderMode === 'numeric' ||
|
|
123
|
+
col_obj._renderMode === 'euro' ||
|
|
124
|
+
col_obj._renderMode === 'euro_currency' ||
|
|
125
|
+
col_obj._renderMode === 'euro_no_dec') {
|
|
142
126
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if(value == null || isNaN(value)) {
|
|
149
|
-
cell.attributes['data-order'] = '';
|
|
150
|
-
return '\u2014';
|
|
127
|
+
const digits = col_obj._renderMode === 'numeric'
|
|
128
|
+
? undefined
|
|
129
|
+
: col_obj._renderMode === 'euro_no_dec'
|
|
130
|
+
? 0
|
|
131
|
+
: 2;
|
|
151
132
|
|
|
152
|
-
} else {
|
|
153
|
-
cell.attributes['data-order'] = value;
|
|
154
|
-
return Number(value).toLocaleString('it-IT', {
|
|
155
|
-
minimumFractionDigits: 2,
|
|
156
|
-
maximumFractionDigits: 2,
|
|
157
|
-
useGrouping: 'always',
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
// le classi definite dall'utente vengono unite, non sostituite
|
|
162
|
-
cellClass: classnames('text-nowrap text-end text-numeric', col_obj.cellClass),
|
|
163
|
-
headerClass: classnames('text-nowrap text-end text-numeric', col_obj.headerClass), // NB: usata anche per il footer
|
|
164
|
-
type: 'number'
|
|
165
|
-
};
|
|
166
133
|
|
|
167
|
-
} else if(col_obj._renderMode === 'euro_no_dec') {
|
|
168
134
|
return {
|
|
169
135
|
...col_obj,
|
|
170
136
|
render: (value, cell) => {
|
|
@@ -176,9 +142,11 @@ export function parseCols(col_obj){
|
|
|
176
142
|
} else {
|
|
177
143
|
cell.attributes['data-order'] = value;
|
|
178
144
|
return Number(value).toLocaleString('it-IT', {
|
|
179
|
-
minimumFractionDigits:
|
|
180
|
-
maximumFractionDigits:
|
|
145
|
+
minimumFractionDigits: digits,
|
|
146
|
+
maximumFractionDigits: digits,
|
|
181
147
|
useGrouping: 'always',
|
|
148
|
+
style: col_obj._renderMode === 'euro_currency' ? 'currency' : 'decimal',
|
|
149
|
+
currency: col_obj._renderMode === 'euro_currency' ? 'EUR' : undefined
|
|
182
150
|
});
|
|
183
151
|
}
|
|
184
152
|
},
|