@fagon/ngx-intellitoolx 16.0.1

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.
Files changed (49) hide show
  1. package/LICENSE +5 -0
  2. package/README.md +959 -0
  3. package/esm2022/fagon-ngx-intellitoolx.mjs +5 -0
  4. package/esm2022/lib/directives/required-marker/required-marker.config.mjs +2 -0
  5. package/esm2022/lib/directives/required-marker/required-marker.defaults.mjs +9 -0
  6. package/esm2022/lib/directives/required-marker/required-marker.directive.mjs +79 -0
  7. package/esm2022/lib/directives/required-marker/required-marker.token.mjs +3 -0
  8. package/esm2022/lib/form-errors/form-errors.component.mjs +110 -0
  9. package/esm2022/lib/form-update/confirm-handler.type.mjs +2 -0
  10. package/esm2022/lib/form-update/form-update-message-config.interface.mjs +2 -0
  11. package/esm2022/lib/form-update/form-update-message.component.mjs +53 -0
  12. package/esm2022/lib/form-update/unsaved-changes.guard.mjs +19 -0
  13. package/esm2022/lib/form-validators/index.mjs +6 -0
  14. package/esm2022/lib/form-validators/max-amount.validator.mjs +18 -0
  15. package/esm2022/lib/form-validators/max-words.validator.mjs +11 -0
  16. package/esm2022/lib/form-validators/min-amount.validator.mjs +18 -0
  17. package/esm2022/lib/form-validators/password-mismatch.validator.mjs +16 -0
  18. package/esm2022/lib/form-validators/unique-email.validators.mjs +40 -0
  19. package/esm2022/lib/helpers/intellitoolx.helper.mjs +156 -0
  20. package/esm2022/lib/ngx-intellitoolx.component.mjs +11 -0
  21. package/esm2022/lib/ngx-intellitoolx.module.mjs +17 -0
  22. package/esm2022/lib/pipes/json-parse.pipe.mjs +18 -0
  23. package/esm2022/lib/regex/regex.utils.mjs +7 -0
  24. package/esm2022/public-api.mjs +27 -0
  25. package/fesm2022/fagon-ngx-intellitoolx.mjs +576 -0
  26. package/fesm2022/fagon-ngx-intellitoolx.mjs.map +1 -0
  27. package/index.d.ts +5 -0
  28. package/lib/directives/required-marker/required-marker.config.d.ts +9 -0
  29. package/lib/directives/required-marker/required-marker.defaults.d.ts +2 -0
  30. package/lib/directives/required-marker/required-marker.directive.d.ts +17 -0
  31. package/lib/directives/required-marker/required-marker.token.d.ts +3 -0
  32. package/lib/form-errors/form-errors.component.d.ts +29 -0
  33. package/lib/form-update/confirm-handler.type.d.ts +1 -0
  34. package/lib/form-update/form-update-message-config.interface.d.ts +11 -0
  35. package/lib/form-update/form-update-message.component.d.ts +14 -0
  36. package/lib/form-update/unsaved-changes.guard.d.ts +11 -0
  37. package/lib/form-validators/index.d.ts +5 -0
  38. package/lib/form-validators/max-amount.validator.d.ts +2 -0
  39. package/lib/form-validators/max-words.validator.d.ts +2 -0
  40. package/lib/form-validators/min-amount.validator.d.ts +2 -0
  41. package/lib/form-validators/password-mismatch.validator.d.ts +2 -0
  42. package/lib/form-validators/unique-email.validators.d.ts +2 -0
  43. package/lib/helpers/intellitoolx.helper.d.ts +16 -0
  44. package/lib/ngx-intellitoolx.component.d.ts +5 -0
  45. package/lib/ngx-intellitoolx.module.d.ts +7 -0
  46. package/lib/pipes/json-parse.pipe.d.ts +7 -0
  47. package/lib/regex/regex.utils.d.ts +6 -0
  48. package/package.json +29 -0
  49. package/public-api.d.ts +14 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fagon-ngx-intellitoolx.mjs","sources":["../../src/lib/ngx-intellitoolx.module.ts","../../src/lib/helpers/intellitoolx.helper.ts","../../src/lib/pipes/json-parse.pipe.ts","../../src/lib/ngx-intellitoolx.component.ts","../../src/lib/form-update/form-update-message.component.ts","../../src/lib/form-errors/form-errors.component.ts","../../src/lib/form-validators/max-amount.validator.ts","../../src/lib/form-validators/max-words.validator.ts","../../src/lib/form-validators/min-amount.validator.ts","../../src/lib/form-validators/password-mismatch.validator.ts","../../src/lib/form-validators/unique-email.validators.ts","../../src/lib/regex/regex.utils.ts","../../src/lib/directives/required-marker/required-marker.token.ts","../../src/lib/directives/required-marker/required-marker.defaults.ts","../../src/lib/directives/required-marker/required-marker.directive.ts","../../src/lib/form-update/unsaved-changes.guard.ts","../../src/public-api.ts","../../src/fagon-ngx-intellitoolx.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\n@NgModule({\n declarations: [],\n imports: [CommonModule],\n exports: [],\n})\nexport class NgxIntellitoolxModule {}\n","import {\n AbstractControl,\n FormArray,\n FormControl,\n FormGroup,\n} from '@angular/forms';\nimport { ConfirmHandler } from '../form-update/confirm-handler.type';\n\nexport class IntelliToolxHelper {\n static captureInitialValue(form: AbstractControl): any {\n const initialValue = (form as any).getRawValue?.() ?? form.value;\n form.markAsPristine();\n return this.clone(initialValue);\n }\n\n static trimFormGroup(control: AbstractControl): void {\n if (control instanceof FormGroup) {\n Object.keys(control.controls).forEach((key) =>\n this.trimFormGroup(control.controls[key]),\n );\n return;\n }\n\n if (control instanceof FormArray) {\n control.controls.forEach((ctrl) => this.trimFormGroup(ctrl));\n return;\n }\n\n if (control instanceof FormControl) {\n const value = control.value;\n if (typeof value === 'string') {\n control.setValue(value.trim(), { emitEvent: false });\n }\n }\n }\n\n static deepEqual(obj1: any, obj2: any): boolean {\n // treat null, undefined, and empty string as equal\n if (this.isEmpty(obj1) && this.isEmpty(obj2)) {\n return true;\n }\n\n // normalize numeric values\n if (typeof obj1 === 'number' && typeof obj2 === 'number') {\n return Number(obj1) === Number(obj2);\n }\n\n // strict equality shortcut\n if (obj1 === obj2) return true;\n\n // File comparison\n if (obj1 instanceof File && obj2 instanceof File) {\n return (\n obj1.name === obj2.name &&\n obj1.size === obj2.size &&\n obj1.type === obj2.type &&\n obj1.lastModified === obj2.lastModified\n );\n }\n\n // if not objects → not equal\n if (\n typeof obj1 !== 'object' ||\n typeof obj2 !== 'object' ||\n obj1 === null ||\n obj2 === null\n ) {\n return false;\n }\n\n // arrays\n if (Array.isArray(obj1) && Array.isArray(obj2)) {\n if (obj1.length !== obj2.length) return false;\n return obj1.every((v, i) => this.deepEqual(v, obj2[i]));\n }\n\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n\n if (keys1.length !== keys2.length) return false;\n\n for (const key of keys1) {\n if (!keys2.includes(key)) return false;\n if (!this.deepEqual(obj1[key], obj2[key])) return false;\n }\n\n return true;\n }\n\n static isEmpty(value: any): boolean {\n return (\n value === null ||\n value === undefined ||\n (typeof value === 'string' && value.trim() === '')\n );\n }\n\n static clone(value: any): any {\n return structuredClone(value); // Angular 14+ safe\n }\n\n static formHasChanges(initialValue: any, form: AbstractControl): boolean {\n if (!form) return false;\n\n const current = form.getRawValue();\n return !this.deepEqual(initialValue, current);\n }\n\n static async confirmIfChanged(\n hasChanges: boolean,\n confirmHandler?: ConfirmHandler,\n ): Promise<boolean> {\n if (!hasChanges) return true;\n\n if (confirmHandler) {\n const result = confirmHandler();\n return typeof result === 'boolean' ? result : await result;\n }\n\n // fallback (only if handler not provided)\n return confirm('You have unsaved changes. Continue?');\n }\n\n static registerBeforeUnload(shouldBlock: () => boolean, message?: string) {\n const handler = (event: BeforeUnloadEvent) => {\n if (!shouldBlock()) return;\n\n event.preventDefault();\n event.returnValue = message || '';\n };\n\n window.addEventListener('beforeunload', handler);\n\n return () => window.removeEventListener('beforeunload', handler);\n }\n\n static getFormControl<T = any>(\n form: AbstractControl,\n path: string,\n ): FormControl<T> | null {\n if (!form || !path) return null;\n\n const segments = path.split('.');\n let current: AbstractControl | null = form;\n\n for (const segment of segments) {\n if (!current) return null;\n\n // Treat numeric segment as FormArray index\n const index = Number(segment);\n if (!isNaN(index) && current instanceof FormArray) {\n current = current.at(index);\n } else if (current instanceof FormGroup) {\n current = current.get(segment);\n } else {\n return null;\n }\n }\n\n return current instanceof FormControl ? (current as FormControl<T>) : null;\n }\n\n static convertImageToBase64(file: File): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n\n reader.readAsDataURL(file);\n\n reader.onload = () => {\n const base64String = reader.result as string;\n const base64StringArray = base64String.split(',');\n resolve(base64StringArray[1]);\n };\n\n reader.onerror = (error) => {\n reject(error);\n };\n });\n }\n\n static replaceCharacter(\n text: any,\n replaceChar: string,\n replaceWithChar: string,\n ): string {\n return text?.replaceAll(replaceChar, replaceWithChar) || '';\n }\n\n static convertJsonStringToJson<T = any>(\n value: T | string | null | undefined,\n ): T | null {\n if (!value) {\n return null;\n }\n\n if (typeof value === 'string') {\n try {\n return JSON.parse(value) as T;\n } catch {\n return null;\n }\n }\n\n return value as T;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { IntelliToolxHelper } from '../helpers/intellitoolx.helper';\n\n@Pipe({\n name: 'jsonParse',\n standalone: true,\n})\nexport class JsonParsePipe implements PipeTransform {\n transform<T = any>(value: T | string | null | undefined): T | null {\n return IntelliToolxHelper.convertJsonStringToJson(value);\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'lib-ngx-intellitoolx',\n standalone: true,\n template: ` <p>ngx-intellitoolx works!</p> `,\n styles: [],\n})\nexport class NgxIntellitoolxComponent {}\n","import { Component, Input } from '@angular/core';\nimport { IntellitoolxFormUpdateMessageConfig } from './form-update-message-config.interface';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'itx-form-update-message',\n standalone: true,\n imports: [CommonModule],\n styleUrls: ['./form-update-message.component.css'],\n template: `\n <div class=\"form-update-message\" role=\"alert\" [ngStyle]=\"containerStyles\">\n <span class=\"form-update-icon\" aria-hidden=\"true\" [ngStyle]=\"iconStyles\"\n >⚠</span\n >\n <span>\n {{ itxFormUpdateMessageConfig?.message || defaultMessage }}\n </span>\n </div>\n `,\n})\nexport class IntellitoolxFormUpdateMessage {\n @Input() itxFormUpdateMessageConfig?: IntellitoolxFormUpdateMessageConfig;\n defaultMessage =\n 'There are no changes to save. Please modify a field to continue.';\n\n get containerStyles(): { [key: string]: string } {\n return {\n padding: this.itxFormUpdateMessageConfig?.padding || '1rem',\n gap: this.itxFormUpdateMessageConfig?.iconAndMessageGap || '0.5rem',\n color: this.itxFormUpdateMessageConfig?.textColor || '#963C00',\n border:\n '1px solid ' +\n (this.itxFormUpdateMessageConfig?.borderColor || '#f3cd5a'),\n 'background-color':\n this.itxFormUpdateMessageConfig?.backgroundColor || '#fff3cd',\n 'font-weight': String(this.itxFormUpdateMessageConfig?.fontWeight || 400),\n 'border-radius':\n this.itxFormUpdateMessageConfig?.borderRadius || '0.5rem',\n };\n }\n\n get iconStyles(): { [key: string]: string } {\n return {\n 'font-size': this.itxFormUpdateMessageConfig?.iconSize || '1rem',\n };\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n UntypedFormControl,\n} from '@angular/forms';\n\nexport interface ErrorMessages {\n [key: string]: string;\n required: string;\n email: string;\n minlength: string;\n maxlength: string;\n pattern: string;\n passwordMismatch: string;\n futureDate: string;\n exceededAllowedDateDifference: string;\n exceededLeastDateAllowed: string;\n duplicateEmail: string;\n maxWords: string;\n maxMonthYear: string;\n minMonthYear: string;\n}\n\n@Component({\n selector: 'itx-form-errors',\n standalone: true,\n imports: [CommonModule],\n template: `\n <ng-container *ngIf=\"control?.touched && control?.invalid\">\n <ng-container *ngFor=\"let error of control?.errors | keyvalue\">\n {{ getErrorMessage(error?.key ?? '', error?.value) }}\n </ng-container>\n </ng-container>\n `,\n})\nexport class IntellitoolxFormErrors {\n @Input() control: FormControl | UntypedFormControl | AbstractControl | null =\n null;\n @Input() componentValidation: Record<string, { message: string }> = {};\n @Input() controlLabel: string | null = null;\n\n errorMessages: ErrorMessages = {\n required: 'This field is required',\n email: 'The email entered is invalid',\n minlength: 'You must enter at least {length} characters',\n maxlength: 'You must not enter more than {length} characters',\n pattern: 'Your entry must match the required pattern',\n passwordMismatch: 'Password and confirm password do not match.',\n futureDate: 'Future date is not allowed.',\n exceededAllowedDateDifference: 'Date difference can only be one month.',\n exceededLeastDateAllowed: 'Start date cannot be greater than end date',\n duplicateEmail: 'Each email must be unique.',\n maxWords: 'Exceeded maximum number of words.',\n maxMonthYear: 'Date is later than allowed.',\n minMonthYear: 'Date is earlier than allowed.',\n };\n\n getErrorMessage(key: string, value: any): string {\n if (!this.control) return '';\n\n const customMessage = this.componentValidation?.[key]?.message;\n\n if (typeof value === 'boolean') {\n return customMessage || this.errorMessages[key] || '';\n }\n\n if (typeof value === 'string') {\n return customMessage || value;\n }\n\n if (typeof value === 'object') {\n switch (key) {\n case 'pattern':\n return (\n customMessage ||\n `Please provide a valid ${this.controlLabel || 'data'}.`\n );\n case 'min':\n return customMessage\n ? customMessage\n : this.controlLabel\n ? `${this.controlLabel} cannot be less than ${value.min}.`\n : `Number cannot be less than ${value.min}`;\n case 'max':\n return customMessage\n ? customMessage\n : this.controlLabel\n ? `${this.controlLabel} cannot be greater than ${value.max}.`\n : `Number cannot be greater than ${value.max}`;\n case 'minlength':\n return (\n customMessage ||\n this.errorMessages.minlength.replace(\n '{length}',\n value?.requiredLength || '',\n )\n );\n case 'maxlength':\n return (\n customMessage ||\n this.errorMessages.maxlength.replace(\n '{length}',\n value?.requiredLength || '',\n )\n );\n case 'customMinValue':\n case 'customMaxValue':\n return customMessage || value?.message || '';\n case 'ngbDate':\n return (\n customMessage ||\n (this.control.value ? 'Invalid date format provided' : '')\n );\n case 'passwordMismatch':\n case 'futureDate':\n case 'duplicateEmail':\n case 'maxWords':\n case 'maxMonthYear':\n case 'minMonthYear':\n case 'exceededAllowedDateDifference':\n case 'exceededLeastDateAllowed':\n return customMessage || this.errorMessages[key];\n default:\n return customMessage || '';\n }\n }\n\n return '';\n }\n}\n","import { ValidatorFn, AbstractControl, ValidationErrors } from \"@angular/forms\";\n\nexport function customMaxAmountValidator(maxValue: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value !== null && control.value > maxValue) {\n control.setErrors({ exceededMaximumValue: true });\n const maxValueToFloat = maxValue.toFixed(2);\n return {\n customMaxValue: {\n requiredMin: maxValue,\n actual: control.value,\n message: `The value must not exceed ${maxValueToFloat}`,\n },\n };\n }\n\n control.setErrors(null);\n return null;\n };\n}\n","import { AbstractControl, ValidationErrors, ValidatorFn } from \"@angular/forms\";\n\nexport function MaxWordsValidator(maxWords: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!control.value) return null;\n\n const wordCount = control.value.trim().split(/\\s+/).length;\n return wordCount > maxWords\n ? { maxWords: { actual: wordCount, max: maxWords } }\n : null;\n };\n}\n","import { ValidatorFn, AbstractControl, ValidationErrors } from \"@angular/forms\";\n\nexport function customMinAmountValidator(minValue: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control.value !== null && control.value < minValue) {\n control.setErrors({ exceededMinimumValue: true });\n const minValueToFloat = minValue.toFixed(2);\n return {\n customMinValue: {\n requiredMin: minValue,\n actual: control.value,\n message: `The value must be at least ${minValueToFloat}`,\n },\n };\n }\n\n control.setErrors(null);\n return null;\n };\n}\n","import { UntypedFormGroup } from '@angular/forms';\n\nexport function PasswordMismatchValidator(\n controlName: string,\n matchingControlName: string,\n) {\n return (formGroup: UntypedFormGroup) => {\n const control = formGroup.controls[controlName];\n const matchingControl = formGroup.controls[matchingControlName];\n if (matchingControl.errors && !matchingControl.errors['passwordMismatch']) {\n return;\n }\n if (control.value !== matchingControl.value) {\n matchingControl.setErrors({ passwordMismatch: true });\n } else {\n matchingControl.setErrors(null);\n }\n };\n}\n","import {\n AbstractControl,\n ValidationErrors,\n ValidatorFn,\n FormArray,\n FormGroup,\n} from '@angular/forms';\n\nexport function uniqueEmailsValidator(): ValidatorFn {\n return (formArray: AbstractControl): ValidationErrors | null => {\n if (!(formArray instanceof FormArray)) {\n return null;\n }\n\n const controls = formArray.controls as FormGroup[];\n\n // Collect all email values safely\n const emails = controls.map((control: FormGroup) => {\n const value = control.get('email')?.value;\n return typeof value === 'string' ? value.toLowerCase().trim() : '';\n });\n\n // Count occurrences\n const emailCounts: Record<string, number> = {};\n emails.forEach((email: string) => {\n if (email) {\n emailCounts[email] = (emailCounts[email] || 0) + 1;\n }\n });\n\n // Update each control's errors\n controls.forEach((control: FormGroup) => {\n const emailControl = control.get('email');\n const email = emailControl?.value?.toLowerCase()?.trim();\n\n if (emailControl) {\n const currentErrors = emailControl.errors || {};\n\n if (email && emailCounts[email] > 1) {\n emailControl.setErrors({ ...currentErrors, duplicateEmail: true });\n } else if (currentErrors?.['duplicateEmail']) {\n delete currentErrors['duplicateEmail'];\n const hasOtherErrors = Object.keys(currentErrors)?.length > 0;\n emailControl.setErrors(hasOtherErrors ? currentErrors : null);\n }\n }\n });\n\n const hasDuplicates = Object.values(emailCounts)?.some(\n (count) => count > 1,\n );\n return hasDuplicates ? { duplicateEmails: true } : null;\n };\n}\n","export const IntellitoolxRegExps = {\n EMAIL_REGEX: /^(?=.{1,50}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[A-Za-z]{2,}$/,\n NUMBER_REGEX: /^\\d+$/,\n AMOUNT_REGEX: /^\\d+(\\.\\d{1,2})?$/,\n DOMAIN_REGEX:\n /^(?=.{1,255}$)(https?|ftp):\\/\\/([\\w.-]+)\\.([a-z\\.]{2,6})(:[0-9]{1,5})?(\\/\\S*)?$/,\n};\n","import { InjectionToken } from '@angular/core';\nimport { RequiredMarkerConfig } from './required-marker.config';\n\nexport const REQUIRED_MARKER_GLOBAL_CONFIG =\n new InjectionToken<RequiredMarkerConfig>('Required Marker Global Config');\n","import { ResolvedRequiredMarkerConfig } from './required-marker.config';\n\nexport const DEFAULT_REQUIRED_MARKER_CONFIG: ResolvedRequiredMarkerConfig = {\n sign: '*',\n color: 'red',\n position: 'after',\n spacing: '2px',\n className: '',\n showIfOptional: false,\n};\n","import {\n Directive,\n ElementRef,\n Renderer2,\n AfterViewInit,\n OnDestroy,\n inject,\n} from '@angular/core';\nimport {\n FormGroupDirective,\n AbstractControl,\n Validators,\n} from '@angular/forms';\nimport { merge, Subscription } from 'rxjs';\n\nimport { ResolvedRequiredMarkerConfig } from './required-marker.config';\nimport { REQUIRED_MARKER_GLOBAL_CONFIG } from './required-marker.token';\nimport { DEFAULT_REQUIRED_MARKER_CONFIG } from './required-marker.defaults';\n\n@Directive({\n selector: 'label[itxRequired]',\n standalone: true,\n})\nexport class RequiredMarkerDirective implements AfterViewInit, OnDestroy {\n private subscription?: Subscription;\n\n private globalConfig = inject(REQUIRED_MARKER_GLOBAL_CONFIG, {\n optional: true,\n });\n\n constructor(\n private el: ElementRef<HTMLLabelElement>,\n private renderer: Renderer2,\n private parentForm: FormGroupDirective,\n ) {}\n\n private resolveConfig(): ResolvedRequiredMarkerConfig {\n return {\n ...DEFAULT_REQUIRED_MARKER_CONFIG,\n ...this.globalConfig,\n };\n }\n\n ngAfterViewInit() {\n const label = this.el.nativeElement;\n const controlId = label.getAttribute('for');\n if (!controlId) return;\n\n const control = this.parentForm.form.get(controlId);\n if (!control) return;\n\n this.updateLabel(label, control);\n\n this.subscription = merge(\n control.valueChanges,\n control.statusChanges,\n ).subscribe(() => this.updateLabel(label, control));\n }\n\n private updateLabel(label: HTMLLabelElement, control: AbstractControl) {\n const config = this.resolveConfig();\n const isRequired = control.hasValidator?.(Validators.required);\n\n const original =\n label.getAttribute('data-original') || label.textContent || '';\n\n if (!label.getAttribute('data-original')) {\n label.setAttribute('data-original', original.trim());\n }\n\n const match = original.match(/^([^\\(]+)(.*)$/);\n const mainText = match ? match[1].trim() : original;\n const extraText = match ? match[2] : '';\n\n this.renderer.setProperty(label, 'textContent', '');\n\n const main = this.renderer.createText(mainText);\n\n const marker = this.renderer.createElement('span');\n this.renderer.setStyle(marker, 'color', config.color);\n this.renderer.setStyle(marker, 'margin-left', config.spacing);\n\n this.renderer.appendChild(marker, this.renderer.createText(config.sign));\n\n if (isRequired) {\n if (config.position === 'before') {\n this.renderer.appendChild(label, marker);\n this.renderer.appendChild(label, main);\n } else {\n this.renderer.appendChild(label, main);\n this.renderer.appendChild(label, marker);\n }\n } else {\n this.renderer.appendChild(label, main);\n }\n\n const extra = this.renderer.createText(extraText);\n this.renderer.appendChild(label, extra);\n }\n\n ngOnDestroy() {\n this.subscription?.unsubscribe();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { CanDeactivate } from '@angular/router';\n\nexport interface CanComponentDeactivate {\n hasUnsavedChanges: () => boolean;\n getUnsavedMessage?: () => string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class UnsavedChangesGuard implements CanDeactivate<CanComponentDeactivate> {\n canDeactivate(component: CanComponentDeactivate): boolean {\n if (!component.hasUnsavedChanges()) {\n return true;\n }\n\n const message =\n component.getUnsavedMessage?.() ||\n 'You have unsaved changes. Leave without saving?';\n\n return confirm(message);\n }\n}\n","/*\n * Public API Surface of ngx-intellitoolx\n */\n\n// Moddules\nexport * from './lib/ngx-intellitoolx.module';\n\n// Helpers\nexport * from './lib/helpers/intellitoolx.helper';\n\n// Pipes\nexport * from './lib/pipes/json-parse.pipe';\n\n// Components\nexport * from './lib/ngx-intellitoolx.component';\nexport * from './lib/form-update/form-update-message.component';\nexport * from './lib/form-errors/form-errors.component';\n\n// Validators\nexport * from './lib/form-validators';\n\n// Regular expressions\nexport * from './lib/regex/regex.utils';\n\n// Models/Interfaces\nexport * from './lib/form-update/form-update-message-config.interface';\n\n// Required marker directive\nexport * from './lib/directives/required-marker/required-marker.directive';\nexport * from './lib/directives/required-marker/required-marker.config';\nexport * from './lib/directives/required-marker/required-marker.token';\nexport * from './lib/directives/required-marker/required-marker.defaults';\n\n// Guards\nexport * from './lib/form-update/unsaved-changes.guard';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;MAQa,qBAAqB,CAAA;+GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAA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,EAAA,IAAA,EAAA,mBAAmB,cADN,MAAM,EAAA,CAAA,CAAA,EAAA;;4FACnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACRlC;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@fagon/ngx-intellitoolx" />
5
+ export * from './public-api';
@@ -0,0 +1,9 @@
1
+ export interface RequiredMarkerConfig {
2
+ sign?: string;
3
+ color?: string;
4
+ position?: 'before' | 'after';
5
+ spacing?: string;
6
+ className?: string;
7
+ showIfOptional?: boolean;
8
+ }
9
+ export type ResolvedRequiredMarkerConfig = Required<RequiredMarkerConfig>;
@@ -0,0 +1,2 @@
1
+ import { ResolvedRequiredMarkerConfig } from './required-marker.config';
2
+ export declare const DEFAULT_REQUIRED_MARKER_CONFIG: ResolvedRequiredMarkerConfig;
@@ -0,0 +1,17 @@
1
+ import { ElementRef, Renderer2, AfterViewInit, OnDestroy } from '@angular/core';
2
+ import { FormGroupDirective } from '@angular/forms';
3
+ import * as i0 from "@angular/core";
4
+ export declare class RequiredMarkerDirective implements AfterViewInit, OnDestroy {
5
+ private el;
6
+ private renderer;
7
+ private parentForm;
8
+ private subscription?;
9
+ private globalConfig;
10
+ constructor(el: ElementRef<HTMLLabelElement>, renderer: Renderer2, parentForm: FormGroupDirective);
11
+ private resolveConfig;
12
+ ngAfterViewInit(): void;
13
+ private updateLabel;
14
+ ngOnDestroy(): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<RequiredMarkerDirective, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RequiredMarkerDirective, "label[itxRequired]", never, {}, {}, never, never, true, never>;
17
+ }
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { RequiredMarkerConfig } from './required-marker.config';
3
+ export declare const REQUIRED_MARKER_GLOBAL_CONFIG: InjectionToken<RequiredMarkerConfig>;
@@ -0,0 +1,29 @@
1
+ import { AbstractControl, FormControl, UntypedFormControl } from '@angular/forms';
2
+ import * as i0 from "@angular/core";
3
+ export interface ErrorMessages {
4
+ [key: string]: string;
5
+ required: string;
6
+ email: string;
7
+ minlength: string;
8
+ maxlength: string;
9
+ pattern: string;
10
+ passwordMismatch: string;
11
+ futureDate: string;
12
+ exceededAllowedDateDifference: string;
13
+ exceededLeastDateAllowed: string;
14
+ duplicateEmail: string;
15
+ maxWords: string;
16
+ maxMonthYear: string;
17
+ minMonthYear: string;
18
+ }
19
+ export declare class IntellitoolxFormErrors {
20
+ control: FormControl | UntypedFormControl | AbstractControl | null;
21
+ componentValidation: Record<string, {
22
+ message: string;
23
+ }>;
24
+ controlLabel: string | null;
25
+ errorMessages: ErrorMessages;
26
+ getErrorMessage(key: string, value: any): string;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<IntellitoolxFormErrors, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<IntellitoolxFormErrors, "itx-form-errors", never, { "control": { "alias": "control"; "required": false; }; "componentValidation": { "alias": "componentValidation"; "required": false; }; "controlLabel": { "alias": "controlLabel"; "required": false; }; }, {}, never, never, true, never>;
29
+ }
@@ -0,0 +1 @@
1
+ export type ConfirmHandler = () => boolean | Promise<boolean>;
@@ -0,0 +1,11 @@
1
+ export interface IntellitoolxFormUpdateMessageConfig {
2
+ message?: string;
3
+ backgroundColor?: string;
4
+ textColor?: string;
5
+ borderColor?: string;
6
+ fontWeight?: number;
7
+ borderRadius?: string;
8
+ padding?: string;
9
+ iconAndMessageGap?: string;
10
+ iconSize?: string;
11
+ }
@@ -0,0 +1,14 @@
1
+ import { IntellitoolxFormUpdateMessageConfig } from './form-update-message-config.interface';
2
+ import * as i0 from "@angular/core";
3
+ export declare class IntellitoolxFormUpdateMessage {
4
+ itxFormUpdateMessageConfig?: IntellitoolxFormUpdateMessageConfig;
5
+ defaultMessage: string;
6
+ get containerStyles(): {
7
+ [key: string]: string;
8
+ };
9
+ get iconStyles(): {
10
+ [key: string]: string;
11
+ };
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<IntellitoolxFormUpdateMessage, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<IntellitoolxFormUpdateMessage, "itx-form-update-message", never, { "itxFormUpdateMessageConfig": { "alias": "itxFormUpdateMessageConfig"; "required": false; }; }, {}, never, never, true, never>;
14
+ }
@@ -0,0 +1,11 @@
1
+ import { CanDeactivate } from '@angular/router';
2
+ import * as i0 from "@angular/core";
3
+ export interface CanComponentDeactivate {
4
+ hasUnsavedChanges: () => boolean;
5
+ getUnsavedMessage?: () => string;
6
+ }
7
+ export declare class UnsavedChangesGuard implements CanDeactivate<CanComponentDeactivate> {
8
+ canDeactivate(component: CanComponentDeactivate): boolean;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<UnsavedChangesGuard, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<UnsavedChangesGuard>;
11
+ }
@@ -0,0 +1,5 @@
1
+ export * from './max-amount.validator';
2
+ export * from './max-words.validator';
3
+ export * from './min-amount.validator';
4
+ export * from './password-mismatch.validator';
5
+ export * from './unique-email.validators';
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from "@angular/forms";
2
+ export declare function customMaxAmountValidator(maxValue: number): ValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from "@angular/forms";
2
+ export declare function MaxWordsValidator(maxWords: number): ValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from "@angular/forms";
2
+ export declare function customMinAmountValidator(minValue: number): ValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { UntypedFormGroup } from '@angular/forms';
2
+ export declare function PasswordMismatchValidator(controlName: string, matchingControlName: string): (formGroup: UntypedFormGroup) => void;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ export declare function uniqueEmailsValidator(): ValidatorFn;
@@ -0,0 +1,16 @@
1
+ import { AbstractControl, FormControl } from '@angular/forms';
2
+ import { ConfirmHandler } from '../form-update/confirm-handler.type';
3
+ export declare class IntelliToolxHelper {
4
+ static captureInitialValue(form: AbstractControl): any;
5
+ static trimFormGroup(control: AbstractControl): void;
6
+ static deepEqual(obj1: any, obj2: any): boolean;
7
+ static isEmpty(value: any): boolean;
8
+ static clone(value: any): any;
9
+ static formHasChanges(initialValue: any, form: AbstractControl): boolean;
10
+ static confirmIfChanged(hasChanges: boolean, confirmHandler?: ConfirmHandler): Promise<boolean>;
11
+ static registerBeforeUnload(shouldBlock: () => boolean, message?: string): () => void;
12
+ static getFormControl<T = any>(form: AbstractControl, path: string): FormControl<T> | null;
13
+ static convertImageToBase64(file: File): Promise<string>;
14
+ static replaceCharacter(text: any, replaceChar: string, replaceWithChar: string): string;
15
+ static convertJsonStringToJson<T = any>(value: T | string | null | undefined): T | null;
16
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class NgxIntellitoolxComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxIntellitoolxComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxIntellitoolxComponent, "lib-ngx-intellitoolx", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ export declare class NgxIntellitoolxModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxIntellitoolxModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxIntellitoolxModule, never, [typeof i1.CommonModule], never>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgxIntellitoolxModule>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class JsonParsePipe implements PipeTransform {
4
+ transform<T = any>(value: T | string | null | undefined): T | null;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<JsonParsePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<JsonParsePipe, "jsonParse", true>;
7
+ }
@@ -0,0 +1,6 @@
1
+ export declare const IntellitoolxRegExps: {
2
+ EMAIL_REGEX: RegExp;
3
+ NUMBER_REGEX: RegExp;
4
+ AMOUNT_REGEX: RegExp;
5
+ DOMAIN_REGEX: RegExp;
6
+ };
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@fagon/ngx-intellitoolx",
3
+ "version": "16.0.1",
4
+ "description": "Ngx-IntelliToolX is a smart, reusable Angular utility library that provides intelligent tools for form state management, deep data comparison, and customizable UI messaging. Designed for Angular 14+, it enables developers to build cleaner, more maintainable applications with minimal boilerplate and fully configurable components and helpers.",
5
+ "author": "Kingsley Darko Asomaning",
6
+ "license": "MIT",
7
+ "peerDependencies": {
8
+ "@angular/common": ">=16 <20",
9
+ "@angular/core": ">=16 <20",
10
+ "@angular/forms": ">=16 <20"
11
+ },
12
+ "dependencies": {
13
+ "tslib": "^2.3.0"
14
+ },
15
+ "sideEffects": false,
16
+ "module": "fesm2022/fagon-ngx-intellitoolx.mjs",
17
+ "typings": "index.d.ts",
18
+ "exports": {
19
+ "./package.json": {
20
+ "default": "./package.json"
21
+ },
22
+ ".": {
23
+ "types": "./index.d.ts",
24
+ "esm2022": "./esm2022/fagon-ngx-intellitoolx.mjs",
25
+ "esm": "./esm2022/fagon-ngx-intellitoolx.mjs",
26
+ "default": "./fesm2022/fagon-ngx-intellitoolx.mjs"
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,14 @@
1
+ export * from './lib/ngx-intellitoolx.module';
2
+ export * from './lib/helpers/intellitoolx.helper';
3
+ export * from './lib/pipes/json-parse.pipe';
4
+ export * from './lib/ngx-intellitoolx.component';
5
+ export * from './lib/form-update/form-update-message.component';
6
+ export * from './lib/form-errors/form-errors.component';
7
+ export * from './lib/form-validators';
8
+ export * from './lib/regex/regex.utils';
9
+ export * from './lib/form-update/form-update-message-config.interface';
10
+ export * from './lib/directives/required-marker/required-marker.directive';
11
+ export * from './lib/directives/required-marker/required-marker.config';
12
+ export * from './lib/directives/required-marker/required-marker.token';
13
+ export * from './lib/directives/required-marker/required-marker.defaults';
14
+ export * from './lib/form-update/unsaved-changes.guard';