@jsenv/navi 0.15.4 → 0.15.5

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.
@@ -11401,10 +11401,9 @@ import.meta.css = /* css */ `
11401
11401
 
11402
11402
  .navi_callout_message {
11403
11403
  position: relative;
11404
- display: inline-flex;
11404
+ display: block;
11405
11405
  box-sizing: border-box;
11406
11406
  box-decoration-break: clone;
11407
- min-width: 0;
11408
11407
  align-self: center;
11409
11408
  word-break: break-word;
11410
11409
  overflow-wrap: anywhere;
@@ -13044,11 +13043,13 @@ const TYPE_NUMBER_CONSTRAINT = {
13044
13043
  if (field.type !== "number") {
13045
13044
  return null;
13046
13045
  }
13047
- if (field.value === "" && !field.required) {
13046
+ if (field.validity.valueMissing) {
13047
+ // let required handle that
13048
13048
  return null;
13049
13049
  }
13050
- const value = field.valueAsNumber;
13051
- if (isNaN(value)) {
13050
+ const valueAsNumber = field.valueAsNumber;
13051
+ const valueAsNumberIsNaN = isNaN(valueAsNumber);
13052
+ if (valueAsNumberIsNaN) {
13052
13053
  return generateFieldInvalidMessage(`{field} doit être un nombre.`, {
13053
13054
  field,
13054
13055
  });
@@ -13132,7 +13133,7 @@ const MAX_CONSTRAINT = {
13132
13133
  }
13133
13134
  if (valueAsNumber > maxNumber) {
13134
13135
  return generateFieldInvalidMessage(
13135
- `{field} être <strong>${maxAttribute}</strong> ou plus.`,
13136
+ `{field} doit être <strong>${maxAttribute}</strong> ou moins.`,
13136
13137
  { field },
13137
13138
  );
13138
13139
  }
@@ -19700,6 +19701,9 @@ const InputTextualBasic = props => {
19700
19701
  let inputValue;
19701
19702
  if (type === "number") {
19702
19703
  inputValue = e.target.valueAsNumber;
19704
+ if (isNaN(inputValue)) {
19705
+ inputValue = e.target.value;
19706
+ }
19703
19707
  } else if (type === "datetime-local") {
19704
19708
  inputValue = convertToUTCTimezone(e.target.value);
19705
19709
  } else {
@@ -20170,8 +20174,8 @@ const FormBasic = props => {
20170
20174
  const defaultRef = useRef();
20171
20175
  const ref = props.ref || defaultRef;
20172
20176
 
20173
- // instantiation validation to:
20174
- // - receive "requestsubmit" custom event ensure submit is prevented
20177
+ // instantiate validation via useConstraints hook:
20178
+ // - receive "actionrequested" custom event ensure submit is prevented
20175
20179
  // (and also execute action without validation if form.submit() is ever called)
20176
20180
  const remainingProps = useConstraints(ref, rest);
20177
20181
  const innerReadOnly = readOnly || loading;