@rsuci/shared-form-components 1.0.71 → 1.0.73
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.
|
@@ -8,7 +8,7 @@ import { applyComponentStyle } from '../../utils/styleUtils';
|
|
|
8
8
|
import { isComponentReadonly, readonlyClasses } from '../../utils/componentStateUtils';
|
|
9
9
|
const NumberInput = ({ variable, value, onChange, onBlur, error, disabled, valeurMin, isConsultationMode = false }) => {
|
|
10
10
|
const props = variable.proprietes;
|
|
11
|
-
const numericValue = value !== null && value !== undefined ? value :
|
|
11
|
+
const numericValue = value !== null && value !== undefined ? value : '';
|
|
12
12
|
const { textStyle, containerStyle } = applyComponentStyle(variable.componentStyle);
|
|
13
13
|
// Déterminer si le composant est en lecture seule
|
|
14
14
|
const isReadonly = isComponentReadonly(variable, isConsultationMode);
|
|
@@ -26,7 +26,7 @@ const NumberInput = ({ variable, value, onChange, onBlur, error, disabled, valeu
|
|
|
26
26
|
return;
|
|
27
27
|
const inputValue = e.target.value;
|
|
28
28
|
if (inputValue === '') {
|
|
29
|
-
onChange(
|
|
29
|
+
onChange(null);
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
const parsedValue = parseFloat(inputValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variableValueConverter.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/variableValueConverter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGlE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,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;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,UAAU,EAAE;;;;;IAUlD;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO;IA4ChE;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"variableValueConverter.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/variableValueConverter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGlE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,sBAAsB;IAEjC;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,YAAY,GAAG,aAAa;IAsEjF;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM;IAgElE,OAAO,CAAC,MAAM,CAAC,YAAY;IAK3B,OAAO,CAAC,MAAM,CAAC,SAAS;IAMxB,OAAO,CAAC,MAAM,CAAC,aAAa;IAqB5B,OAAO,CAAC,MAAM,CAAC,SAAS;IAQxB,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAIjC,OAAO,CAAC,MAAM,CAAC,QAAQ;IAcvB,OAAO,CAAC,MAAM,CAAC,SAAS;IAexB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAKvB,OAAO,CAAC,MAAM,CAAC,aAAa;IA4B5B,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAiElC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAI/B,OAAO,CAAC,MAAM,CAAC,aAAa;IAK5B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAKhC,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAIrC,OAAO,CAAC,MAAM,CAAC,YAAY;IAS3B,OAAO,CAAC,MAAM,CAAC,aAAa;IAU5B,OAAO,CAAC,MAAM,CAAC,YAAY;IAK3B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAWhC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IA2DtC;;OAEG;IACH,MAAM,CAAC,wBAAwB,CAAC,aAAa,EAAE,MAAM,GAAG,UAAU,EAAE;IAuBpE;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,UAAU,EAAE;;;;;IAUlD;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO;IA4ChE;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM;CAsC1E"}
|
|
@@ -468,12 +468,18 @@ export class VariableValueConverter {
|
|
|
468
468
|
break;
|
|
469
469
|
case 'DATEHEURE':
|
|
470
470
|
if (value instanceof Date) {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}
|
|
471
|
+
const dtDate = value.toLocaleDateString('fr-FR');
|
|
472
|
+
const dtH = value.getHours().toString().padStart(2, '0');
|
|
473
|
+
const dtM = value.getMinutes().toString().padStart(2, '0');
|
|
474
|
+
return `${dtDate} ${dtH} H ${dtM} min`;
|
|
475
475
|
}
|
|
476
476
|
break;
|
|
477
|
+
case 'HOUR':
|
|
478
|
+
if (typeof value === 'string' && value.includes(':')) {
|
|
479
|
+
const [h, m] = value.split(':');
|
|
480
|
+
return `${h.padStart(2, '0')} H ${m.padStart(2, '0')} min`;
|
|
481
|
+
}
|
|
482
|
+
return String(value);
|
|
477
483
|
case 'NUMERIQUE':
|
|
478
484
|
if (typeof value === 'number') {
|
|
479
485
|
return value.toLocaleString('fr-FR');
|
package/package.json
CHANGED