valtech-components 2.0.715 → 2.0.717

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.
@@ -45,6 +45,22 @@ export declare class I18nService {
45
45
  * i18n.t('welcome', 'Login', {name}); // con interpolación
46
46
  */
47
47
  t(key: string, namespace?: string, data?: Record<string, string>): string;
48
+ /**
49
+ * Returns a time-of-day greeting in the current language.
50
+ *
51
+ * Uses bundled keys `goodMorning` / `goodAfternoon` / `goodEvening` from `_global`.
52
+ * Reactive to `lang()` when called inside a `computed()`.
53
+ *
54
+ * @param name Optional name to append: "Buenos días, Juan"
55
+ * @param date Optional date to evaluate (defaults to now)
56
+ *
57
+ * @example
58
+ * greeting = computed(() => {
59
+ * this.i18n.lang();
60
+ * return this.i18n.greeting(this.auth.user()?.name);
61
+ * });
62
+ */
63
+ greeting(name?: string, date?: Date): string;
48
64
  /**
49
65
  * Obtiene texto traducido
50
66
  *
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Time-of-day greeting key.
3
+ * Maps to bundled i18n keys in `_global` namespace: goodMorning / goodAfternoon / goodEvening.
4
+ */
5
+ export type TimeOfDayKey = 'goodMorning' | 'goodAfternoon' | 'goodEvening';
6
+ /**
7
+ * Returns the i18n key for a time-of-day greeting based on the given date's hour.
8
+ *
9
+ * - 00:00 - 11:59 → 'goodMorning'
10
+ * - 12:00 - 17:59 → 'goodAfternoon'
11
+ * - 18:00 - 23:59 → 'goodEvening'
12
+ *
13
+ * Pure function (testable). Defaults to current local time.
14
+ *
15
+ * @example
16
+ * import { getTimeOfDayKey } from 'valtech-components';
17
+ *
18
+ * const key = getTimeOfDayKey(); // 'goodMorning' | 'goodAfternoon' | 'goodEvening'
19
+ * const text = i18n.t(key); // 'Buenos días' | 'Buenas tardes' | 'Buenas noches'
20
+ */
21
+ export declare function getTimeOfDayKey(date?: Date): TimeOfDayKey;
package/lib/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "2.0.715";
5
+ export declare const VERSION = "2.0.717";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.715",
3
+ "version": "2.0.717",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
package/public-api.d.ts CHANGED
@@ -281,6 +281,7 @@ export * from './lib/components/templates/docs-shell/types';
281
281
  export * from './lib/services/docs/docs-navigation.service';
282
282
  export * from './lib/components/types';
283
283
  export * from './lib/shared/pipes/process-links.pipe';
284
+ export * from './lib/shared/utils/datetime';
284
285
  export * from './lib/shared/utils/dom';
285
286
  export * from './lib/shared/utils/form-defaults';
286
287
  export * from './lib/shared/utils/styles';