mn-angular-lib 0.0.49 → 0.0.50

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.
@@ -1066,12 +1066,13 @@ class MnInputField {
1066
1066
  */
1067
1067
  resolveErrorMessageForKey(errorKey, errors) {
1068
1068
  const errorArgs = errors[errorKey];
1069
- // Priority: custom > built-in > fallback > default
1069
+ // Priority: custom (props) > config > built-in > fallback > default
1070
1070
  const customMsg = this.props.errorMessages?.[errorKey];
1071
+ const configMsg = this.uiConfig.errorMessages?.[errorKey];
1071
1072
  const useBuiltIn = this.props.useBuiltInErrorMessages !== false;
1072
1073
  const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;
1073
1074
  const fallbackMsg = this.props.defaultErrorMessage;
1074
- const msgDef = customMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
1075
+ const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
1075
1076
  // If the message is a function, call it with error arguments
1076
1077
  if (typeof msgDef === 'function') {
1077
1078
  return msgDef(errorArgs, errors);
@@ -1519,10 +1520,11 @@ class MnTextarea {
1519
1520
  resolveErrorMessageForKey(errorKey, errors) {
1520
1521
  const errorArgs = errors[errorKey];
1521
1522
  const customMsg = this.props.errorMessages?.[errorKey];
1523
+ const configMsg = this.uiConfig.errorMessages?.[errorKey];
1522
1524
  const useBuiltIn = this.props.useBuiltInErrorMessages !== false;
1523
1525
  const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;
1524
1526
  const fallbackMsg = this.props.defaultErrorMessage;
1525
- const msgDef = customMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
1527
+ const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
1526
1528
  if (typeof msgDef === 'function') {
1527
1529
  return msgDef(errorArgs, errors);
1528
1530
  }
@@ -1694,10 +1696,11 @@ class MnCheckbox {
1694
1696
  resolveErrorMessageForKey(errorKey, errors) {
1695
1697
  const errorArgs = errors[errorKey];
1696
1698
  const customMsg = this.props.errorMessages?.[errorKey];
1699
+ const configMsg = this.uiConfig.errorMessages?.[errorKey];
1697
1700
  const useBuiltIn = this.props.useBuiltInErrorMessages !== false;
1698
1701
  const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;
1699
1702
  const fallbackMsg = this.props.defaultErrorMessage;
1700
- const msgDef = customMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
1703
+ const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
1701
1704
  if (typeof msgDef === 'function') {
1702
1705
  return msgDef(errorArgs, errors);
1703
1706
  }
@@ -1864,10 +1867,11 @@ class MnDatetime {
1864
1867
  resolveErrorMessageForKey(errorKey, errors) {
1865
1868
  const errorArgs = errors[errorKey];
1866
1869
  const customMsg = this.props.errorMessages?.[errorKey];
1870
+ const configMsg = this.uiConfig.errorMessages?.[errorKey];
1867
1871
  const useBuiltIn = this.props.useBuiltInErrorMessages !== false;
1868
1872
  const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;
1869
1873
  const fallbackMsg = this.props.defaultErrorMessage;
1870
- const msgDef = customMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
1874
+ const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
1871
1875
  if (typeof msgDef === 'function') {
1872
1876
  return msgDef(errorArgs, errors);
1873
1877
  }
@@ -2093,10 +2097,11 @@ class MnMultiSelect {
2093
2097
  resolveErrorMessageForKey(errorKey, errors) {
2094
2098
  const errorArgs = errors[errorKey];
2095
2099
  const customMsg = this.props.errorMessages?.[errorKey];
2100
+ const configMsg = this.uiConfig.errorMessages?.[errorKey];
2096
2101
  const useBuiltIn = this.props.useBuiltInErrorMessages !== false;
2097
2102
  const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;
2098
2103
  const fallbackMsg = this.props.defaultErrorMessage;
2099
- const msgDef = customMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
2104
+ const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';
2100
2105
  if (typeof msgDef === 'function') {
2101
2106
  return msgDef(errorArgs, errors);
2102
2107
  }