@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
117 lines • 4.99 kB
TypeScript
export interface ValidationRules {
pattern?: RegExp;
message?: string;
maxLength?: number;
minLength?: number;
}
export declare enum DatapointLibraryValidationErrors {
IS_REQUIRED = "required",
PATTERN = "pattern",
SHOULD_CONTAIN_NUMBER = "number",
SHOULD_BE_DEFINED = "should-be-defined",
GREATER_THAN_SCALE_MAX = "greater-than-scale-max",
LESS_THAN_SCALE_MIN = "less-than-scale-min",
GREATER_THAN_RANGE_MAX = "greater-than-range-max",
LESS_THAN_RANGE_MIN = "less-than-range-min",
MIN_ACTIVE_COUNT = "minActiveCount",
MAX_ACTIVE_COUNT = "maxActiveCount"
}
export declare class ValidationPattern {
static readonly messages: {
readonly deviceId: "Device ID must not contain spaces or slashes (\"/\").";
readonly domain: string;
readonly email: "Invalid email address.";
readonly emails: "Invalid email addresses.";
readonly internationalPhoneNumber: "Must be a valid phone number (only digits, spaces, slashes (\"/\"), dashes (\"-\"), and plus (\"+\") allowed, for example: +49 9 876 543 210).";
readonly loginAlias: "Login alias must not contain slashes (\"/\", \"\\\") nor (\"+\"), (\":\"), (\"$\") signs.";
readonly invalidColor: "Invalid color \"{{ currentValue }}\".";
readonly max: "Max value: {{ max }}";
readonly min: "Min value: {{ min }}";
readonly minLength: "Should have at least {{ minLength }} characters.";
readonly minlength: "Should have at least {{ requiredLength }} characters.";
readonly maxLength: "Should have at most {{ maxLength }} characters.";
readonly maxlength: "Should have at most {{ requiredLength }} characters.";
readonly pattern: "Does not match pattern {{ requiredPattern }}.";
readonly opcuaBrowsePath: "Invalid OPC UA URI.";
readonly password: "Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/";
readonly passwordConfirm: "Passwords do not match.";
readonly passwordStrength: "Password is not strong enough, use a stronger password.";
readonly passwordStrengthChecklist: "Password is not strong enough, use a stronger password. Check the requirements listed on the right.";
readonly required: "This field is required.";
readonly tenantId: string;
readonly urlSegment: "Slash, single or double dots and white space not allowed.";
readonly user: "Username must not contain spaces nor slashes (\"/\", \"\\\") nor (\"+\"), (\":\"), (\"$\") signs.";
readonly httpUrl: "Must be a valid HTTP(S) URL.";
readonly colonedHexNumber: "Must be a valid hexadecimal number. Must contain only the following characters: 0-9, a-f, A-F, :.";
readonly noWhiteSpaceOnly: "This field must not contain only whitespaces";
readonly noLeadingOrTrailingWhitespaces: "Must not contain any leading or trailing whitespaces.";
readonly noDots: "Dots not allowed.";
readonly integer: "Invalid type, expected integer.";
readonly simpleJsonPath: "Must be a valid JSON path";
readonly number: "This field must contain a number.";
readonly "should-be-defined": "Value must be defined.";
readonly "greater-than-scale-max": "Value must be less than scale maximum.";
readonly "less-than-scale-min": "Value must be greater than scale minimum.";
readonly "greater-than-range-max": "Value must be less than respective maximum.";
readonly "less-than-range-min": "Value must be greater than respective minimum.";
readonly quickLinkUrl: "Value must be a full or relative URL.";
};
static readonly rules: {
deviceId: {
pattern: RegExp;
};
domain: {
pattern: RegExp;
};
groupName: {
maxLength: number;
};
hostname: {
pattern: RegExp;
};
ip: {
pattern: RegExp;
};
opcuaBrowsePath: {
pattern: RegExp;
};
password: {
pattern: RegExp;
};
tenantId: {
pattern: RegExp;
};
user: {
pattern: RegExp;
};
urlSegment: {
pattern: RegExp;
};
loginAlias: {
pattern: RegExp;
};
noWhiteSpaceOnly: {
pattern: RegExp;
};
noLeadingOrTrailingWhitespaces: {
pattern: RegExp;
};
noDots: {
pattern: RegExp;
};
httpUrl: {
pattern: RegExp;
};
colonedHexNumber: {
pattern: RegExp;
};
integer: {
pattern: RegExp;
};
quickLinkUrl: {
pattern: RegExp;
};
};
static get(key: string): ValidationRules;
}
//# sourceMappingURL=validation-pattern.d.ts.map