@imaginario27/air-ui-utils 1.2.1 → 1.2.3
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 +23 -0
- package/nuxt.config.ts +12 -12
- package/package.json +1 -1
- package/tsconfig.json +7 -7
- package/utils/counters.ts +2 -0
- package/utils/data.ts +2 -1
- package/utils/formValidation.ts +11 -1
- package/utils/numbers.ts +30 -0
- package/utils/pages.ts +2 -0
- package/models/constants/app.ts +0 -8
- package/models/constants/form.ts +0 -22
- package/models/constants/notifications.ts +0 -4
- package/models/enums/counters.ts +0 -4
- package/models/enums/pages.ts +0 -4
- package/models/types/pdfExportTable.ts +0 -6
- package/models/types/selects.ts +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,29 @@ All notable changes to this package are documented in this file.
|
|
|
5
5
|
Historical releases were reconstructed from git history (GitHub repository) and npm publish dates.
|
|
6
6
|
Future releases will include detailed entries generated with Changesets.
|
|
7
7
|
|
|
8
|
+
## 1.2.2 - 2026-04-07
|
|
9
|
+
|
|
10
|
+
Release type: patch.
|
|
11
|
+
Commits found in range: 1.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
1. add formatNumberWithThousands number util ([1c66034](https://github.com/imaginario27/air-ui/commit/1c660343c4718947e43c5393af2dc079f0ed176a))
|
|
16
|
+
|
|
17
|
+
- Package: @imaginario27/air-ui-utils.
|
|
18
|
+
|
|
19
|
+
## 1.2.1 - 2026-03-21
|
|
20
|
+
|
|
21
|
+
Release type: patch.
|
|
22
|
+
Commits found in range: 2.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
1. update package versions ([c5a01a1](https://github.com/imaginario27/air-ui/commit/c5a01a186b047bceca41d6cf50d1f9da4e1aa15e))
|
|
27
|
+
2. add new TagsField and RulesField components + component fixes ([c8c125e](https://github.com/imaginario27/air-ui/commit/c8c125eb110eedc16f29706778578514bc28eb4f))
|
|
28
|
+
|
|
29
|
+
- Package: @imaginario27/air-ui-utils.
|
|
30
|
+
|
|
8
31
|
## 1.2.0 - 2026-03-18
|
|
9
32
|
|
|
10
33
|
Release type: minor.
|
package/nuxt.config.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
|
-
|
|
3
|
-
export default defineNuxtConfig({
|
|
4
|
-
compatibilityDate: "2024-11-01",
|
|
5
|
-
devtools: { enabled: false },
|
|
6
|
-
ssr: false,
|
|
7
|
-
|
|
8
|
-
imports: {
|
|
9
|
-
dirs: [
|
|
10
|
-
"models/**"
|
|
11
|
-
],
|
|
12
|
-
},
|
|
1
|
+
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
|
+
|
|
3
|
+
export default defineNuxtConfig({
|
|
4
|
+
compatibilityDate: "2024-11-01",
|
|
5
|
+
devtools: { enabled: false },
|
|
6
|
+
ssr: false,
|
|
7
|
+
|
|
8
|
+
imports: {
|
|
9
|
+
dirs: [
|
|
10
|
+
"models/**"
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
13
|
})
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
// https://nuxt.com/docs/guide/concepts/typescript
|
|
3
|
-
"extends": "./.nuxt/tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"types": ["vitest/globals"],
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
// https://nuxt.com/docs/guide/concepts/typescript
|
|
3
|
+
"extends": "./.nuxt/tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"types": ["vitest/globals"],
|
|
6
|
+
}
|
|
7
|
+
}
|
package/utils/counters.ts
CHANGED
package/utils/data.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SelectOption } from '../../air-ui-ds/models/types/selects'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Creates a delay for a specified number of milliseconds.
|
|
3
5
|
*
|
|
@@ -42,7 +44,6 @@ export function getPaginatedData<T>(
|
|
|
42
44
|
return result.slice(start, end)
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
|
|
46
47
|
/**
|
|
47
48
|
* Converts an array of objects into SelectOption[] by mapping specified keys or transformation functions.
|
|
48
49
|
*
|
package/utils/formValidation.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import { FieldError } from '../models/constants/form'
|
|
3
2
|
import type {
|
|
4
3
|
ArrayValidator,
|
|
5
4
|
CreateRulesFieldValidatorOptions,
|
|
@@ -7,6 +6,17 @@ import type {
|
|
|
7
6
|
RuleValidationValue,
|
|
8
7
|
} from '../models/types/formValidation'
|
|
9
8
|
|
|
9
|
+
// Centralized error messages for form validation
|
|
10
|
+
const FieldError = {
|
|
11
|
+
REQUIRED_FIELD: 'This field is required.',
|
|
12
|
+
REQUIRED_EMAIL: 'Email is required.',
|
|
13
|
+
INVALID_EMAIL: 'Invalid email address.',
|
|
14
|
+
REQUIRED_OPTION: 'Please select an option.',
|
|
15
|
+
INVALID_DATE_RANGE: 'Start date must be before or equal to end date',
|
|
16
|
+
PASSWORDS_DO_NOT_MATCH: 'Passwords do not match.',
|
|
17
|
+
INVALID_URL: 'Invalid URL.',
|
|
18
|
+
}
|
|
19
|
+
|
|
10
20
|
/**
|
|
11
21
|
* Validates a field value to ensure it is not empty, null, or undefined.
|
|
12
22
|
*
|
package/utils/numbers.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a number into a string with thousands separators using Intl locale rules.
|
|
3
|
+
*
|
|
4
|
+
* @param value - Number to format
|
|
5
|
+
* @param locale - Optional locale (default: 'es-ES')
|
|
6
|
+
* @returns Formatted string with thousands separators
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* formatNumberWithThousands(1234567)
|
|
10
|
+
* // "1.234.567"
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* formatNumberWithThousands(1234567.89, 'en-US')
|
|
14
|
+
* // "1,234,567.89"
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* formatNumberWithThousands(1234.56, 'de-DE')
|
|
18
|
+
* // "1.234,56"
|
|
19
|
+
*/
|
|
20
|
+
export const formatNumberWithThousands = (
|
|
21
|
+
value: number,
|
|
22
|
+
locale: string = 'en-GB'
|
|
23
|
+
): string => {
|
|
24
|
+
if (!Number.isFinite(value)) return 'Not a valid number'
|
|
25
|
+
|
|
26
|
+
return value.toLocaleString(locale, {
|
|
27
|
+
minimumFractionDigits: 0,
|
|
28
|
+
maximumFractionDigits: 20
|
|
29
|
+
})
|
|
30
|
+
}
|
package/utils/pages.ts
CHANGED
package/models/constants/app.ts
DELETED
package/models/constants/form.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export const FieldMaxLength = {
|
|
3
|
-
FULLNAME: 80,
|
|
4
|
-
LASTNAME: 80,
|
|
5
|
-
EMAIL: 254,
|
|
6
|
-
PHONE: 15,
|
|
7
|
-
SUBJECT: 100,
|
|
8
|
-
MESSAGE: 500,
|
|
9
|
-
PASSWORD: 64,
|
|
10
|
-
SEARCH: 80,
|
|
11
|
-
DESCRIPTION: 400,
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const FieldError = {
|
|
15
|
-
REQUIRED_FIELD: 'This field is required.',
|
|
16
|
-
REQUIRED_EMAIL: 'Email is required.',
|
|
17
|
-
INVALID_EMAIL: 'Invalid email address.',
|
|
18
|
-
REQUIRED_OPTION: 'Please select an option.',
|
|
19
|
-
INVALID_DATE_RANGE: 'Start date must be before or equal to end date',
|
|
20
|
-
PASSWORDS_DO_NOT_MATCH: 'Passwords do not match.',
|
|
21
|
-
INVALID_URL: 'Invalid URL.',
|
|
22
|
-
}
|
package/models/enums/counters.ts
DELETED
package/models/enums/pages.ts
DELETED
package/models/types/selects.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface SelectOption {
|
|
2
|
-
id?: string | number
|
|
3
|
-
value: string | number
|
|
4
|
-
text?: string
|
|
5
|
-
icon?: any
|
|
6
|
-
customIcon?: string
|
|
7
|
-
userDisplayName?: string
|
|
8
|
-
userProfileImg?: string
|
|
9
|
-
imgUrl?: string
|
|
10
|
-
alt?: string
|
|
11
|
-
helpText?: string
|
|
12
|
-
to?: string
|
|
13
|
-
isExternal?: boolean
|
|
14
|
-
}
|