pi-kiosk-shared 1.0.1 → 1.0.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.
@@ -3,7 +3,7 @@ export interface ValidationResult {
3
3
  errors: Record<string, string>;
4
4
  }
5
5
  export declare const validators: {
6
- required: (value: any, fieldName: string) => string | null;
6
+ required: (value: any) => string | null;
7
7
  email: (value: string) => string | null;
8
8
  minLength: (value: string, min: number, fieldName: string) => string | null;
9
9
  maxLength: (value: string, max: number, fieldName: string) => string | null;
@@ -5,9 +5,9 @@ exports.validationSchemas = exports.validateSchema = exports.validators = void 0
5
5
  // ValidationError is imported but not used directly in this file
6
6
  const constants_1 = require("./constants");
7
7
  exports.validators = {
8
- required: (value, fieldName) => {
8
+ required: (value) => {
9
9
  if (value === null || value === undefined || value === '') {
10
- return `${fieldName} ${constants_1.UI_MESSAGES.REQUIRED_FIELD.toLowerCase()}`;
10
+ return constants_1.UI_MESSAGES.REQUIRED_FIELD;
11
11
  }
12
12
  return null;
13
13
  },
@@ -86,28 +86,28 @@ exports.validateSchema = validateSchema;
86
86
  exports.validationSchemas = {
87
87
  login: {
88
88
  username: [
89
- (value) => exports.validators.required(value, 'Uživatelské jméno'),
89
+ (value) => exports.validators.required(value),
90
90
  exports.validators.username
91
91
  ],
92
92
  password: [
93
- (value) => exports.validators.required(value, 'Heslo'),
93
+ (value) => exports.validators.required(value),
94
94
  exports.validators.password
95
95
  ]
96
96
  },
97
97
  customerEmail: {
98
98
  email: [
99
- (value) => exports.validators.required(value, 'Email'),
99
+ (value) => exports.validators.required(value),
100
100
  exports.validators.email
101
101
  ]
102
102
  },
103
103
  product: {
104
104
  name: [
105
- (value) => exports.validators.required(value, 'Název produktu'),
105
+ (value) => exports.validators.required(value),
106
106
  (value) => exports.validators.minLength(value, 2, 'Název produktu'),
107
107
  (value) => exports.validators.maxLength(value, constants_1.APP_CONFIG.MAX_PRODUCT_NAME_LENGTH, 'Název produktu')
108
108
  ],
109
109
  price: [
110
- (value) => exports.validators.required(value, 'Cena'),
110
+ (value) => exports.validators.required(value),
111
111
  (value) => exports.validators.positiveNumber(value, 'Cena')
112
112
  ],
113
113
  description: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-kiosk-shared",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "description": "Shared components and utilities for Pi Kiosk system",
6
6
  "keywords": ["kiosk", "react", "typescript", "components"],