react-hook-form-rules 1.7.1 → 1.7.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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [1.7.2](https://github.com/chopperqt/react-hook-form-rules/compare/v1.7.1...v1.7.2) (2025-12-27)
2
+
3
+ ### 🔥 Code Refactoring
4
+
5
+ * обновление локалей ([5f5d2d2](https://github.com/chopperqt/react-hook-form-rules/commit/5f5d2d2f01ea733c9ee54de20332ff1c51d0f116))
6
+
1
7
  ## [1.7.1](https://github.com/chopperqt/react-hook-form-rules/compare/v1.7.0...v1.7.1) (2025-12-27)
2
8
 
3
9
  ### 📄 Documentation
package/dist/i18n.js CHANGED
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.translate = exports.setLanguage = void 0;
7
+ const en_json_1 = __importDefault(require("./locales/en.json"));
8
+ const ru_json_1 = __importDefault(require("./locales/ru.json"));
4
9
  const translataions = {
5
- en: require("./locales/en.json"),
6
- ru: require("./locales/ru.json"),
10
+ en: en_json_1.default,
11
+ ru: ru_json_1.default,
7
12
  };
8
13
  let currentLang = 'en';
9
14
  const setLanguage = (lang) => {
@@ -0,0 +1,11 @@
1
+ {
2
+ "required": "This field is required.",
3
+ "maxArrayLength": "Maximum number of values - {{max}}.",
4
+ "minArrayLength": "Minimum number of values - {{min}}.",
5
+ "min": "Minimum value - {{min}}.",
6
+ "max": "Maximum value - {{max}}.",
7
+ "minLength": "Minimum length - {{min}}.",
8
+ "maxLength": "Maximum length - {{max}}.",
9
+ "email": "Please check the correctness of the entered email address.",
10
+ "url": "The URL does not match the format."
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "required": "Поле объязательное.",
3
+ "maxArrayLength": "Максимальное количество значений - {{max}}.",
4
+ "minArrayLength": "Минимальное количество значений - {{min}}.",
5
+ "min": "Минимальное значение - {{min}}.",
6
+ "max": "Максимальное значение - {{max}}.",
7
+ "minLength": "Минимальная длина - {{min}}.",
8
+ "maxLength": "Максимальная длина - {{max}}.",
9
+ "email": "Проверьте правильность введенного адреса электронной почты.",
10
+ "url": "URL не соответствует формату."
11
+ }
@@ -8,7 +8,7 @@ interface EmailRule {
8
8
  * @param {string} options.pattern - Regular expression.
9
9
  * @param {string} options.message - Custom message.
10
10
  *
11
- * @example rules: { pattern: getEmailRule() }
11
+ * @example rules: { pattern: getEmailRule({}) }
12
12
  */
13
13
  export declare const getEmailRule: ({ pattern, message, }: EmailRule) => {
14
14
  value: RegExp;
@@ -10,7 +10,7 @@ const DEFAULT_PATTERN = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
10
10
  * @param {string} options.pattern - Regular expression.
11
11
  * @param {string} options.message - Custom message.
12
12
  *
13
- * @example rules: { pattern: getEmailRule() }
13
+ * @example rules: { pattern: getEmailRule({}) }
14
14
  */
15
15
  const getEmailRule = ({ pattern = DEFAULT_PATTERN, message = (0, i18n_1.translate)('email'), }) => (0, get_pattern_rule_1.getPatternRule)(pattern, message);
16
16
  exports.getEmailRule = getEmailRule;
package/i18n.ts CHANGED
@@ -1,6 +1,9 @@
1
+ import en from './locales/en.json'
2
+ import ru from './locales/ru.json'
3
+
1
4
  const translataions = {
2
- en: require("./locales/en.json"),
3
- ru: require("./locales/ru.json"),
5
+ en,
6
+ ru,
4
7
  };
5
8
 
6
9
  let currentLang = 'en'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-hook-form-rules",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/tsconfig.json CHANGED
@@ -6,6 +6,7 @@
6
6
  "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
7
7
  "strict": true /* Enable all strict type-checking options. */,
8
8
  "skipLibCheck": true /* Skip type checking all .d.ts files. */,
9
- "outDir": "./dist"
9
+ "outDir": "./dist",
10
+ "resolveJsonModule": true
10
11
  }
11
12
  }