@sixbell-telco/sdk 2.1.0 → 3.1.0
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 +82 -1
- package/README.md +323 -84
- package/_index.css +17 -3
- package/components/card/card-actions/card-actions.component.d.ts +4 -4
- package/components/card/card-body/card-body.component.d.ts +5 -0
- package/components/card/card-context.d.ts +8 -0
- package/components/card/card-footer/card-footer.component.d.ts +7 -0
- package/components/card/card-header/card-header.component.d.ts +5 -0
- package/components/card/card-header-aside/card-header-aside.component.d.ts +5 -0
- package/components/card/card-section/card-section.component.d.ts +5 -0
- package/components/card/card-section-body/card-section-body.component.d.ts +13 -0
- package/components/card/card-section-footer/card-section-footer.component.d.ts +5 -0
- package/components/card/card-section-group/card-section-group.component.d.ts +16 -0
- package/components/card/card-section-header/card-section-header.component.d.ts +5 -0
- package/components/card/card-section-header-aside/card-section-header-aside.component.d.ts +5 -0
- package/components/card/card-subtitle/card-subtitle.component.d.ts +34 -0
- package/components/card/card-title/card-title.component.d.ts +23 -14
- package/components/card/public-api.d.ts +12 -1
- package/components/card/src/card.component.d.ts +5 -1
- package/components/data-table/actions/actions.component.d.ts +67 -0
- package/components/data-table/actions/actions.types.d.ts +38 -0
- package/components/data-table/public-api.d.ts +2 -0
- package/components/data-table/sortable-header/sortable-header.component.d.ts +2 -0
- package/components/data-table/src/data-table.component.d.ts +14 -5
- package/{directives/typography → components/divider}/index.d.ts +1 -1
- package/components/divider/public-api.d.ts +1 -0
- package/components/divider/src/divider.component.d.ts +13 -0
- package/components/forms/date-picker/src/date-picker.component.d.ts +3 -0
- package/components/forms/form-error/src/form-error.component.d.ts +8 -1
- package/components/forms/input/src/input.component.d.ts +1 -12
- package/components/forms/textarea/src/textarea.component.d.ts +1 -6
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +10 -1
- package/components/paginator/src/paginator.component.d.ts +7 -1
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table.component.d.ts +37 -4
- package/components/table/table-action/table-action.component.d.ts +2 -6
- package/components/table/table-actions/table-actions.component.d.ts +52 -6
- package/components/table/table-actions/table-actions.types.d.ts +28 -0
- package/components/{toast → text}/index.d.ts +1 -1
- package/components/text/public-api.d.ts +2 -0
- package/components/text/src/text.component.d.ts +38 -0
- package/directives/only-numbers/public-api.d.ts +0 -5
- package/directives/only-numbers/src/only-numbers.directive.d.ts +1 -13
- package/directives/text/index.d.ts +5 -0
- package/directives/text/public-api.d.ts +1 -0
- package/directives/text/src/text.directive.d.ts +87 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +10 -11
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +428 -47
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +202 -51
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs +44 -0
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +6 -6
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +21 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +12 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +3 -15
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +5 -11
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +46 -18
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +439 -47
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-text.mjs +308 -0
- package/fesm2022/sixbell-telco-sdk-components-text.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +12 -12
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +5 -22
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs +160 -0
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-formatting.mjs +490 -0
- package/fesm2022/sixbell-telco-sdk-utils-formatting.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +49 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/package.json +100 -92
- package/utils/formatting/README.md +100 -0
- package/utils/formatting/index.d.ts +5 -0
- package/utils/formatting/public-api.d.ts +9 -0
- package/utils/formatting/src/constants/constants.d.ts +18 -0
- package/utils/formatting/src/models/formatting.d.ts +33 -0
- package/utils/formatting/src/pipes/currency/st-currency.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/date/st-date.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/decimal/st-decimal.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/percent/st-percent.pipe.d.ts +9 -0
- package/utils/formatting/src/service/formatting.service.d.ts +13 -0
- package/utils/formatting/src/utils/date-format/date-format.d.ts +9 -0
- package/utils/formatting/src/utils/number-format/number-format.d.ts +12 -0
- package/utils/logger/README.md +8 -19
- package/utils/runtime-config/README.md +1 -1
- package/utils/theme/README.md +21 -2
- package/utils/translation/README.md +40 -10
- package/utils/translation/public-api.d.ts +1 -1
- package/utils/translation/src/constants.d.ts +9 -2
- package/utils/translation/src/models/translation.d.ts +11 -0
- package/utils/translation/src/providers/translation.provider.d.ts +1 -1
- package/utils/translation/src/translation.service.d.ts +6 -1
- package/assets/styles/toast.css +0 -63
- package/components/card/card-content/card-content.component.d.ts +0 -30
- package/components/toast/public-api.d.ts +0 -12
- package/components/toast/services/toast.service.d.ts +0 -35
- package/components/toast/toast-message/toast-message.component.d.ts +0 -70
- package/components/toast/toasts-container/toasts-container.component.d.ts +0 -21
- package/directives/typography/public-api.d.ts +0 -1
- package/directives/typography/src/typography.directive.d.ts +0 -68
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +0 -250
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +0 -1
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +0 -126
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +0 -1
package/utils/logger/README.md
CHANGED
|
@@ -58,31 +58,20 @@ import { AppComponent } from './app.component';
|
|
|
58
58
|
bootstrapApplication(AppComponent, {
|
|
59
59
|
providers: [
|
|
60
60
|
provideLogger({
|
|
61
|
-
enableLogging:
|
|
62
|
-
logLevel: 'debug',
|
|
61
|
+
enableLogging: isDevMode(),
|
|
62
|
+
logLevel: isDevMode() ? 'debug' : 'warn',
|
|
63
63
|
showTimestamp: true,
|
|
64
|
-
|
|
64
|
+
showDate: true,
|
|
65
|
+
persistToIndexedDB: true,
|
|
66
|
+
idbRetentionDays: 7,
|
|
67
|
+
idbMaxLogs: 5000,
|
|
68
|
+
silentMode: !isDevMode(),
|
|
65
69
|
}),
|
|
66
70
|
],
|
|
67
71
|
});
|
|
68
72
|
```
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
import { NgModule } from '@angular/core';
|
|
74
|
-
import { provideLogger } from '@sixbell-telco/sdk/utils/logger';
|
|
75
|
-
|
|
76
|
-
@NgModule({
|
|
77
|
-
providers: [
|
|
78
|
-
provideLogger({
|
|
79
|
-
enableLogging: true,
|
|
80
|
-
logLevel: 'info',
|
|
81
|
-
}),
|
|
82
|
-
],
|
|
83
|
-
})
|
|
84
|
-
export class AppModule {}
|
|
85
|
-
```
|
|
74
|
+
Showcase reference: `projects/showcase/src/app/app.config.ts`
|
|
86
75
|
|
|
87
76
|
## Log Levels
|
|
88
77
|
|
|
@@ -227,7 +227,7 @@ const flags = result.data.flags;
|
|
|
227
227
|
|
|
228
228
|
- Fetch uses `cache: 'no-store'` to avoid stale responses.
|
|
229
229
|
- Dexie cache is last-known-good only, not an aggressive cache.
|
|
230
|
-
-
|
|
230
|
+
- `meta.hash` is required. If it is missing, the loader treats the config as invalid and falls back.
|
|
231
231
|
|
|
232
232
|
## Related Utilities
|
|
233
233
|
|
package/utils/theme/README.md
CHANGED
|
@@ -64,6 +64,7 @@ The theme system is config-based:
|
|
|
64
64
|
1. App loads a config (`themes.json`) containing a list of theme paths.
|
|
65
65
|
2. The selected theme file is loaded blocking (fonts + assets are ready before paint).
|
|
66
66
|
3. Remaining themes are prefetched non-blocking so switching is instant later.
|
|
67
|
+
4. Optional SSE or polling streams can mark `updateAvailable()` and let the app call `refreshTheme()`.
|
|
67
68
|
|
|
68
69
|
### Mermaid: Boot Flow
|
|
69
70
|
|
|
@@ -104,9 +105,8 @@ sequenceDiagram
|
|
|
104
105
|
```json
|
|
105
106
|
{
|
|
106
107
|
"meta": {
|
|
107
|
-
"name": "themes",
|
|
108
108
|
"updatedAt": "2026-02-02T00:00:00Z",
|
|
109
|
-
"hash": "showcase-themes-
|
|
109
|
+
"hash": "showcase-themes-v1",
|
|
110
110
|
"schemaVersion": "2"
|
|
111
111
|
},
|
|
112
112
|
"themes": ["/assets/themes/catalog/sixbell_telco.json", "/assets/themes/catalog/wom.json"],
|
|
@@ -199,6 +199,8 @@ Theme file rules:
|
|
|
199
199
|
- `resolvedScheme()` - resolved to `light | dark`
|
|
200
200
|
- `isDarkTheme()` - boolean
|
|
201
201
|
- `finalTheme()` - string like `sixbell_telco__dark`
|
|
202
|
+
- `updateAvailable()` - true when a runtime update is pending
|
|
203
|
+
- `lastRefreshFailed()` - true when the last refresh attempt failed
|
|
202
204
|
|
|
203
205
|
### Common methods
|
|
204
206
|
|
|
@@ -207,6 +209,7 @@ themeService.setTheme('wom');
|
|
|
207
209
|
themeService.setScheme('dark');
|
|
208
210
|
themeService.getAvailableThemes();
|
|
209
211
|
themeService.getDefaultTheme();
|
|
212
|
+
await themeService.refreshTheme();
|
|
210
213
|
```
|
|
211
214
|
|
|
212
215
|
---
|
|
@@ -397,6 +400,22 @@ bootstrapApplication(AppComponent, {
|
|
|
397
400
|
});
|
|
398
401
|
```
|
|
399
402
|
|
|
403
|
+
### Showcase runtime mode wiring
|
|
404
|
+
|
|
405
|
+
The showcase switches between static assets, polling, and SSE in `projects/showcase/src/app/app.config.ts`:
|
|
406
|
+
|
|
407
|
+
```ts
|
|
408
|
+
provideRuntimeTheme('/assets/themes/themes.json');
|
|
409
|
+
|
|
410
|
+
provideRuntimeTheme(`${environment.runtime.apiBaseUrl}/api/runtime/theme/config`, {
|
|
411
|
+
updateStream: runtimeUpdateStream$,
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
provideRuntimeTheme(`${environment.runtime.apiBaseUrl}/api/runtime/theme/config`, {
|
|
415
|
+
sse: { url: `${environment.runtime.apiBaseUrl}/api/runtime/updates?resource=theme`, eventType: 'message' },
|
|
416
|
+
});
|
|
417
|
+
```
|
|
418
|
+
|
|
400
419
|
### React to Update Availability
|
|
401
420
|
|
|
402
421
|
```ts
|
|
@@ -22,6 +22,8 @@ bootstrapApplication(AppComponent, {
|
|
|
22
22
|
});
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
The runtime `translation.json` locale block keeps SDK formatting in sync with the active translation language. Use it together with `@sixbell-telco/sdk/utils/formatting` pipes and `FormattingService`.
|
|
26
|
+
|
|
25
27
|
In a component:
|
|
26
28
|
|
|
27
29
|
```typescript
|
|
@@ -45,7 +47,7 @@ export class LanguageStatusComponent {
|
|
|
45
47
|
|
|
46
48
|
## Runtime Model Overview
|
|
47
49
|
|
|
48
|
-
Translation config is a
|
|
50
|
+
Translation config is a JSON file that lists available languages, translation paths, and locale mappings. The loader:
|
|
49
51
|
|
|
50
52
|
- Loads the config at boot.
|
|
51
53
|
- Applies selected language and updates ngx-translate.
|
|
@@ -86,15 +88,22 @@ sequenceDiagram
|
|
|
86
88
|
```json
|
|
87
89
|
{
|
|
88
90
|
"meta": {
|
|
89
|
-
"version": "2026-02-02T00:00:00Z",
|
|
90
91
|
"updatedAt": "2026-02-02T00:00:00Z",
|
|
91
|
-
"hash": "showcase-translations-
|
|
92
|
-
"schemaVersion": "
|
|
92
|
+
"hash": "showcase-translations-v2",
|
|
93
|
+
"schemaVersion": "3"
|
|
93
94
|
},
|
|
94
|
-
"additionalLanguages": [
|
|
95
|
+
"additionalLanguages": [],
|
|
95
96
|
"defaultLang": "es",
|
|
96
|
-
"excludeLanguages": [
|
|
97
|
-
"translationPaths": ["/assets/i18n/", "/assets/i18n/sdk/", "/assets/themes/i18n
|
|
97
|
+
"excludeLanguages": [],
|
|
98
|
+
"translationPaths": ["/assets/i18n/", "/assets/i18n/sdk/", "/assets/themes/i18n"],
|
|
99
|
+
"locale": {
|
|
100
|
+
"defaultLocale": "en-US",
|
|
101
|
+
"languageToLocale": {
|
|
102
|
+
"en": "en-US",
|
|
103
|
+
"es": "es-CL",
|
|
104
|
+
"pt": "pt-BR"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
98
107
|
}
|
|
99
108
|
```
|
|
100
109
|
|
|
@@ -102,6 +111,8 @@ sequenceDiagram
|
|
|
102
111
|
|
|
103
112
|
- `translationPaths` should contain directories; each path loads `{lang}.json`.
|
|
104
113
|
- `defaultLang` must exist in available languages (base + additional - excluded).
|
|
114
|
+
- `locale.defaultLocale` is the final formatting fallback.
|
|
115
|
+
- `locale.languageToLocale` maps translation language codes to formatting locales.
|
|
105
116
|
- `meta.schemaVersion` is required and invalidates cached configs when bumped.
|
|
106
117
|
- `meta.hash` is required and drives update detection.
|
|
107
118
|
- Runtime admin tooling should bump `meta.hash` when translation files change.
|
|
@@ -113,14 +124,17 @@ sequenceDiagram
|
|
|
113
124
|
### Signals
|
|
114
125
|
|
|
115
126
|
- `currentLanguage()` - active language code
|
|
127
|
+
- `currentLocale()` - locale resolved from the active language
|
|
116
128
|
- `ready()` - true when current language files are loaded
|
|
117
129
|
- `updateAvailable()` - set by optional update checks
|
|
130
|
+
- `lastRefreshFailed()` - true when the last refresh attempt failed
|
|
118
131
|
|
|
119
132
|
### Key Methods
|
|
120
133
|
|
|
121
134
|
```ts
|
|
122
135
|
translationService.setLanguage('es');
|
|
123
|
-
translationService.
|
|
136
|
+
translationService.getAvailableLanguagesConfig();
|
|
137
|
+
translationService.getCurrentLocale();
|
|
124
138
|
translationService.getDefaultLanguage();
|
|
125
139
|
translationService.withTranslationsReady(() => doWork());
|
|
126
140
|
```
|
|
@@ -167,7 +181,8 @@ When editing translation files manually, always update the runtime config `meta.
|
|
|
167
181
|
|
|
168
182
|
```ts
|
|
169
183
|
// projects/sdk/utils/translation/src/constants.ts
|
|
170
|
-
export const TRANSLATION_SCHEMA_VERSION = '
|
|
184
|
+
export const TRANSLATION_SCHEMA_VERSION = '3' as const;
|
|
185
|
+
export const TRANSLATION_SCHEMA_VERSION = '3' as const;
|
|
171
186
|
```
|
|
172
187
|
|
|
173
188
|
```ts
|
|
@@ -205,13 +220,28 @@ Translation update events must include `lang` so clients refresh only the change
|
|
|
205
220
|
```json
|
|
206
221
|
{
|
|
207
222
|
"resource": "translation",
|
|
208
|
-
"version": "translation-update",
|
|
209
223
|
"hash": "translations-1700000000000",
|
|
210
224
|
"url": "/api/runtime/translation/config",
|
|
211
225
|
"lang": "es"
|
|
212
226
|
}
|
|
213
227
|
```
|
|
214
228
|
|
|
229
|
+
### Showcase runtime mode wiring
|
|
230
|
+
|
|
231
|
+
The showcase uses all three runtime modes in `projects/showcase/src/app/app.config.ts`:
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
provideRuntimeTranslation('/assets/translation/translation.json');
|
|
235
|
+
|
|
236
|
+
provideRuntimeTranslation(`${environment.runtime.apiBaseUrl}/api/runtime/translation/config`, {
|
|
237
|
+
updateStream: runtimeUpdateStream$,
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
provideRuntimeTranslation(`${environment.runtime.apiBaseUrl}/api/runtime/translation/config`, {
|
|
241
|
+
sse: { url: `${environment.runtime.apiBaseUrl}/api/runtime/updates?resource=translation`, eventType: 'message' },
|
|
242
|
+
});
|
|
243
|
+
```
|
|
244
|
+
|
|
215
245
|
### Disable Prefetch
|
|
216
246
|
|
|
217
247
|
```ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './src/translation.service';
|
|
2
|
-
export type { LanguageDefinition, TranslationConfig, TranslationStateConfig } from './src/models/translation';
|
|
2
|
+
export type { LanguageDefinition, TranslationConfig, TranslationLocaleConfig, TranslationStateConfig } from './src/models/translation';
|
|
3
3
|
export { DEFAULT_BASE_LANGUAGE, DEFAULT_LANGUAGES_LIST, DEFAULT_LANGUAGE_CODES, FALLBACK_RUNTIME_TRANSLATION_CONFIG, LANGUAGE_ATTRIBUTE_NAME, TRANSLATION_SCHEMA_VERSION, TRANSLATION_STORAGE_LANGUAGE_KEY, TRANSLATION_STORAGE_NAMESPACE, } from './src/constants';
|
|
4
4
|
export { provideRuntimeTranslation } from './src/providers/translation.provider';
|
|
5
5
|
export type { RuntimeTranslationProviderOptions } from './src/providers/translation.provider.types';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Translation Constants and Injection Tokens
|
|
3
3
|
* Centralized configuration values and DI tokens following Single Responsibility Principle
|
|
4
4
|
*/
|
|
5
|
-
import { LanguageDefinition, TranslationConfig } from './models/translation';
|
|
5
|
+
import { LanguageDefinition, TranslationConfig, TranslationLocaleConfig } from './models/translation';
|
|
6
6
|
/**
|
|
7
7
|
* Default base language - always available unless explicitly excluded
|
|
8
8
|
* This is the foundational language that comes with the SDK
|
|
@@ -44,7 +44,14 @@ export declare const TRANSLATION_INDEXED_DB_NAME: "sixbell-translation";
|
|
|
44
44
|
* Schema version for runtime translation configuration payloads.
|
|
45
45
|
* Bump this when the JSON structure changes in a breaking way.
|
|
46
46
|
*/
|
|
47
|
-
export declare const TRANSLATION_SCHEMA_VERSION: "
|
|
47
|
+
export declare const TRANSLATION_SCHEMA_VERSION: "3";
|
|
48
48
|
export declare const DEFAULT_LANGUAGES: readonly LanguageDefinition[];
|
|
49
49
|
export declare const DEFAULT_LANGUAGE_CODE: "en";
|
|
50
|
+
export declare const DEFAULT_TRANSLATION_LOCALE: "en";
|
|
51
|
+
export declare const DEFAULT_TRANSLATION_LANGUAGE_TO_LOCALE: {
|
|
52
|
+
readonly en: "en";
|
|
53
|
+
readonly es: "es";
|
|
54
|
+
readonly pt: "pt";
|
|
55
|
+
};
|
|
56
|
+
export declare const DEFAULT_TRANSLATION_LOCALE_CONFIG: TranslationLocaleConfig;
|
|
50
57
|
export declare const FALLBACK_RUNTIME_TRANSLATION_CONFIG: TranslationConfig;
|
|
@@ -13,6 +13,15 @@ export interface LanguageDefinition {
|
|
|
13
13
|
/** Display name for the language */
|
|
14
14
|
name: string;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Locale configuration used by SDK formatting utilities.
|
|
18
|
+
*/
|
|
19
|
+
export interface TranslationLocaleConfig {
|
|
20
|
+
/** Final fallback locale used when no active language is available */
|
|
21
|
+
defaultLocale?: string;
|
|
22
|
+
/** Maps translation language codes to output locales */
|
|
23
|
+
languageToLocale?: Record<string, string>;
|
|
24
|
+
}
|
|
16
25
|
/**
|
|
17
26
|
* Main translation configuration interface
|
|
18
27
|
*/
|
|
@@ -46,6 +55,8 @@ export interface TranslationConfig {
|
|
|
46
55
|
defaultLang?: string;
|
|
47
56
|
/** Translation file paths */
|
|
48
57
|
translationPaths?: string[];
|
|
58
|
+
/** Locale mapping used by SDK formatting utilities */
|
|
59
|
+
locale?: TranslationLocaleConfig;
|
|
49
60
|
}
|
|
50
61
|
/**
|
|
51
62
|
* Internal state configuration for translation service
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EnvironmentProviders } from '@angular/core';
|
|
2
2
|
import { TranslateLoader, TranslationObject } from '@ngx-translate/core';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
3
|
+
import type { Observable } from 'rxjs';
|
|
4
4
|
import { RuntimeTranslationProviderOptions } from './translation.provider.types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MissingTranslationHandler, MissingTranslationHandlerParams, TranslateLoader } from '@ngx-translate/core';
|
|
2
2
|
import { RuntimeConfigLoader, RuntimeConfigLoadResult, RuntimeUpdateEvent } from '@sixbell-telco/sdk/utils/runtime-config';
|
|
3
|
-
import { LanguageDefinition, TranslationConfig } from './models/translation';
|
|
3
|
+
import { LanguageDefinition, TranslationConfig, TranslationLocaleConfig } from './models/translation';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare function createLanguage(config: LanguageDefinition): LanguageDefinition;
|
|
6
6
|
export declare function extendDefaultLanguages(additionalLanguages: LanguageDefinition[]): LanguageDefinition[];
|
|
@@ -26,10 +26,12 @@ export declare class TranslationService {
|
|
|
26
26
|
private pendingUpdatedLanguages;
|
|
27
27
|
private bootstrapValidated;
|
|
28
28
|
private readonly translationTick;
|
|
29
|
+
private readonly localeConfig;
|
|
29
30
|
readonly updateAvailable: import("@angular/core").WritableSignal<boolean>;
|
|
30
31
|
readonly lastRefreshFailed: import("@angular/core").WritableSignal<boolean>;
|
|
31
32
|
private config;
|
|
32
33
|
readonly currentLanguage: import("@angular/core").WritableSignal<string>;
|
|
34
|
+
readonly currentLocale: import("@angular/core").Signal<string>;
|
|
33
35
|
readonly onLanguageChange$: import("rxjs").Observable<import("@ngx-translate/core").LangChangeEvent>;
|
|
34
36
|
readonly onLanguageChange: import("@angular/core").WritableSignal<number>;
|
|
35
37
|
readonly ready: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -50,6 +52,9 @@ export declare class TranslationService {
|
|
|
50
52
|
private applyLanguage;
|
|
51
53
|
setLanguage(lang: string): void;
|
|
52
54
|
getCurrentLanguage(): string;
|
|
55
|
+
getCurrentLocale(): string;
|
|
56
|
+
getLocaleConfig(): TranslationLocaleConfig;
|
|
57
|
+
resolveLocale(language?: string | null): string;
|
|
53
58
|
getAvailableLanguages(): string[];
|
|
54
59
|
getDefaultLanguage(): string;
|
|
55
60
|
instant(key: string, params?: object | undefined): string;
|
package/assets/styles/toast.css
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/* DEPRECATED: Legacy toast system styles
|
|
2
|
-
* --------------------------------------------------
|
|
3
|
-
* Retained for backward compatibility while migrating
|
|
4
|
-
* to ngx-sonner based toasts. Do not modify stacking
|
|
5
|
-
* logic; new styling lives inside Sonner component via
|
|
6
|
-
* Tailwind utility classes. Remove this file only when
|
|
7
|
-
* all consumers have switched to the new API.
|
|
8
|
-
*/
|
|
9
|
-
@use 'tailwindcss/base';
|
|
10
|
-
|
|
11
|
-
.toast-container > st-toast-message:nth-child(n + 4) > .toast-message {
|
|
12
|
-
bottom: 1.6rem;
|
|
13
|
-
scale: 0.9;
|
|
14
|
-
z-index: 11;
|
|
15
|
-
opacity: 0;
|
|
16
|
-
visibility: hidden;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.toast-container > * > .toast-message {
|
|
20
|
-
position: absolute;
|
|
21
|
-
right: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.toast-container > *:nth-child(1) > .toast-message {
|
|
25
|
-
bottom: 0;
|
|
26
|
-
scale: 1;
|
|
27
|
-
z-index: 13;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.toast-container > *:nth-child(2) > .toast-message {
|
|
31
|
-
bottom: 0.8rem;
|
|
32
|
-
scale: 0.95;
|
|
33
|
-
z-index: 12;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.toast-container > *:nth-child(3) > .toast-message {
|
|
37
|
-
bottom: 1.6rem;
|
|
38
|
-
scale: 0.9;
|
|
39
|
-
z-index: 11;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.toast-container[aria-expanded='true'] > *:nth-child(1) > .toast-message {
|
|
43
|
-
bottom: 0;
|
|
44
|
-
position: absolute;
|
|
45
|
-
scale: 1;
|
|
46
|
-
z-index: 13;
|
|
47
|
-
margin: 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.toast-container[aria-expanded='true'] > *:nth-child(2) > .toast-message {
|
|
51
|
-
bottom: 6rem;
|
|
52
|
-
position: absolute;
|
|
53
|
-
scale: 1;
|
|
54
|
-
z-index: 13;
|
|
55
|
-
margin: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.toast-container[aria-expanded='true'] > *:nth-child(3) > .toast-message {
|
|
59
|
-
bottom: 12rem;
|
|
60
|
-
position: absolute;
|
|
61
|
-
scale: 1;
|
|
62
|
-
margin: 0;
|
|
63
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
/**
|
|
3
|
-
* A content container component designed for use within cards
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* Part of the card component ecosystem. Provides consistent spacing
|
|
7
|
-
* and styling for card content. Should be used inside `<st-card>` components
|
|
8
|
-
* following the `<st-card-title>` element.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```html
|
|
12
|
-
* <st-card>
|
|
13
|
-
* <st-card-title>Card Header</st-card-title>
|
|
14
|
-
* <st-card-content>
|
|
15
|
-
* <p>Main card content here</p>
|
|
16
|
-
* </st-card-content>
|
|
17
|
-
* </st-card>
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```html
|
|
22
|
-
* <st-card-content class="custom-content-style">
|
|
23
|
-
* Custom styled content area
|
|
24
|
-
* </st-card-content>
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare class CardContentComponent {
|
|
28
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CardContentComponent, never>;
|
|
29
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CardContentComponent, "st-card-content", never, {}, {}, never, ["*"], true, never>;
|
|
30
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
3
|
-
*/
|
|
4
|
-
export * from './services/toast.service';
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
7
|
-
*/
|
|
8
|
-
export * from './toast-message/toast-message.component';
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
11
|
-
*/
|
|
12
|
-
export * from './toasts-container/toasts-container.component';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare enum ToastTypes {
|
|
3
|
-
SUCCESS = "toast-success",
|
|
4
|
-
ERROR = "toast-error",
|
|
5
|
-
INFO = "toast-info",
|
|
6
|
-
WARNING = "toast-warning"
|
|
7
|
-
}
|
|
8
|
-
export type Toast = {
|
|
9
|
-
id: string;
|
|
10
|
-
type: ToastTypes;
|
|
11
|
-
message: string;
|
|
12
|
-
title: string;
|
|
13
|
-
duration: number;
|
|
14
|
-
animate: 'enter' | 'leave';
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated This toast service is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
18
|
-
*/
|
|
19
|
-
export declare class ToastService {
|
|
20
|
-
private toastsSignal;
|
|
21
|
-
private expandedSignal;
|
|
22
|
-
readonly toasts: import("@angular/core").Signal<Toast[]>;
|
|
23
|
-
readonly expanded: import("@angular/core").Signal<boolean>;
|
|
24
|
-
readonly isEmpty: import("@angular/core").Signal<boolean>;
|
|
25
|
-
notify(type: ToastTypes, message: string, title?: string, duration?: number): void;
|
|
26
|
-
scheduleDismiss(toast: Toast): void;
|
|
27
|
-
animateRemoval(toast: Toast): void;
|
|
28
|
-
remove(toast: Toast): void;
|
|
29
|
-
clear(): void;
|
|
30
|
-
toggle(): void;
|
|
31
|
-
collapse(): void;
|
|
32
|
-
expand(): void;
|
|
33
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
|
|
34
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ToastService>;
|
|
35
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Toast, ToastTypes } from '../services/toast.service';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare const toastComponent: (props?: ({
|
|
4
|
-
variant?: "info" | "success" | "warning" | "error" | null | undefined;
|
|
5
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
export type ToastVariantProps = 'info' | 'success' | 'warning' | 'error' | null | undefined;
|
|
7
|
-
export type ToastProps = {
|
|
8
|
-
variant?: ToastVariantProps;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated This component is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
12
|
-
*/
|
|
13
|
-
export declare class ToastMessageComponent {
|
|
14
|
-
variant: import("@angular/core").InputSignal<ToastVariantProps>;
|
|
15
|
-
classes: import("@angular/core").InputSignal<string>;
|
|
16
|
-
types: typeof ToastTypes;
|
|
17
|
-
toast: import("@angular/core").InputSignal<Toast>;
|
|
18
|
-
toastAmount: import("@angular/core").InputSignal<number>;
|
|
19
|
-
toastIndex: import("@angular/core").InputSignal<number>;
|
|
20
|
-
clicked: import("@angular/core").OutputEmitterRef<Toast>;
|
|
21
|
-
/**
|
|
22
|
-
* Stop event propagation for activation events
|
|
23
|
-
* @defaultValue false
|
|
24
|
-
*/
|
|
25
|
-
stopPropagation: import("@angular/core").InputSignal<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
* Event emitted on pointer down
|
|
28
|
-
*/
|
|
29
|
-
pointerDown: import("@angular/core").OutputEmitterRef<PointerEvent>;
|
|
30
|
-
/**
|
|
31
|
-
* Event emitted on Enter keydown
|
|
32
|
-
*/
|
|
33
|
-
keyDownEnter: import("@angular/core").OutputEmitterRef<KeyboardEvent>;
|
|
34
|
-
/**
|
|
35
|
-
* Event emitted on Space keydown
|
|
36
|
-
*/
|
|
37
|
-
keyDownSpace: import("@angular/core").OutputEmitterRef<KeyboardEvent>;
|
|
38
|
-
/**
|
|
39
|
-
* Event emitted on activation (click or keyboard)
|
|
40
|
-
*/
|
|
41
|
-
triggered: import("@angular/core").OutputEmitterRef<void>;
|
|
42
|
-
iconCheckCircle: string;
|
|
43
|
-
iconWarning: string;
|
|
44
|
-
iconError: string;
|
|
45
|
-
iconInfo: string;
|
|
46
|
-
componentClass: import("@angular/core").Signal<string>;
|
|
47
|
-
handleClose(): void;
|
|
48
|
-
/**
|
|
49
|
-
* @internal
|
|
50
|
-
* Handle click activation
|
|
51
|
-
*/
|
|
52
|
-
handleClick(event: MouseEvent): void;
|
|
53
|
-
/**
|
|
54
|
-
* @internal
|
|
55
|
-
* Handle pointer down activation
|
|
56
|
-
*/
|
|
57
|
-
handlePointerDown(event: PointerEvent): void;
|
|
58
|
-
/**
|
|
59
|
-
* @internal
|
|
60
|
-
* Handle Enter key activation
|
|
61
|
-
*/
|
|
62
|
-
handleKeyDownEnter(event: Event): void;
|
|
63
|
-
/**
|
|
64
|
-
* @internal
|
|
65
|
-
* Handle Space key activation
|
|
66
|
-
*/
|
|
67
|
-
handleKeyDownSpace(event: Event): void;
|
|
68
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ToastMessageComponent, never>;
|
|
69
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ToastMessageComponent, "st-toast-message", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; "toast": { "alias": "toast"; "required": true; "isSignal": true; }; "toastAmount": { "alias": "toastAmount"; "required": true; "isSignal": true; }; "toastIndex": { "alias": "toastIndex"; "required": true; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; "pointerDown": "pointerDown"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; "triggered": "triggered"; }, never, never, true, never>;
|
|
70
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Toast, ToastService } from '../services/toast.service';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated This component is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ToastsContainerComponent {
|
|
7
|
-
toastService: ToastService;
|
|
8
|
-
protected containerClasses: import("@angular/core").Signal<{
|
|
9
|
-
'min-h-64': boolean;
|
|
10
|
-
'min-h-48': boolean;
|
|
11
|
-
'h-24 min-h-24': boolean;
|
|
12
|
-
'h-28 min-h-28': boolean;
|
|
13
|
-
'h-0 min-h-0': boolean;
|
|
14
|
-
}>;
|
|
15
|
-
handleExpand(): void;
|
|
16
|
-
handleCollapse(): void;
|
|
17
|
-
handleRemove(toast: Toast): void;
|
|
18
|
-
getToastIndex(toast: Toast): number;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ToastsContainerComponent, never>;
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ToastsContainerComponent, "st-toasts-container", never, {}, {}, never, never, true, never>;
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/typography.directive';
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
/** Available typography heading and body variants */
|
|
3
|
-
export type TypographyVariantProps = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'body-sm' | 'body-xs' | 'body-xxs' | 'inherit' | null | undefined;
|
|
4
|
-
/** Text color variants for typography */
|
|
5
|
-
export type TypographyColorProps = 'base' | 'base-placeholder' | 'inherit' | null | undefined;
|
|
6
|
-
/** Font weight options for typography */
|
|
7
|
-
export type TypographyFontWeightProps = 'bold' | 'semibold' | 'medium' | 'normal' | 'inherit' | null | undefined;
|
|
8
|
-
/** Text overflow handling methods */
|
|
9
|
-
export type TypographyTextOverflowProps = 'clip' | 'ellipsis' | 'truncate' | null | undefined;
|
|
10
|
-
/** Configuration object for typography styles */
|
|
11
|
-
export type TypographyProps = {
|
|
12
|
-
variant?: TypographyVariantProps;
|
|
13
|
-
color?: TypographyColorProps;
|
|
14
|
-
fontWeight?: TypographyFontWeightProps;
|
|
15
|
-
textOverflow?: TypographyTextOverflowProps;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* A directive for applying consistent typography styles using Tailwind CSS
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* Applies text styling based on variant, color, weight, and overflow properties.
|
|
22
|
-
* Uses Angular's signal-based inputs for reactive style updates.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```html
|
|
26
|
-
* <h1 typography tyVariant="h2" tyColor="base" tyFontWeight="bold">
|
|
27
|
-
* Heading with custom typography
|
|
28
|
-
* </h1>
|
|
29
|
-
*
|
|
30
|
-
* <p typography tyVariant="body-sm" tyTextOverflow="ellipsis">
|
|
31
|
-
* Small body text with ellipsis overflow
|
|
32
|
-
* </p>
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export declare class TypographyDirective {
|
|
36
|
-
/**
|
|
37
|
-
* Typography variant style (heading level or body type)
|
|
38
|
-
* @alias tyVariant
|
|
39
|
-
* @defaultValue 'body'
|
|
40
|
-
*/
|
|
41
|
-
variant: import("@angular/core").InputSignal<TypographyVariantProps>;
|
|
42
|
-
/**
|
|
43
|
-
* Text color variant
|
|
44
|
-
* @alias tyColor
|
|
45
|
-
* @defaultValue 'inherit'
|
|
46
|
-
*/
|
|
47
|
-
color: import("@angular/core").InputSignal<TypographyColorProps>;
|
|
48
|
-
/**
|
|
49
|
-
* Font weight variant
|
|
50
|
-
* @alias tyFontWeight
|
|
51
|
-
* @defaultValue 'normal'
|
|
52
|
-
*/
|
|
53
|
-
fontWeight: import("@angular/core").InputSignal<TypographyFontWeightProps>;
|
|
54
|
-
/**
|
|
55
|
-
* Text overflow handling method
|
|
56
|
-
* @alias tyTextOverflow
|
|
57
|
-
* @defaultValue 'clip'
|
|
58
|
-
*/
|
|
59
|
-
textOverflow: import("@angular/core").InputSignal<TypographyTextOverflowProps>;
|
|
60
|
-
/** @internal Reference to host element */
|
|
61
|
-
private element;
|
|
62
|
-
/** @internal Angular renderer instance */
|
|
63
|
-
private renderer;
|
|
64
|
-
/** @internal Effect to update classes when inputs change */
|
|
65
|
-
classListEffect: import("@angular/core").EffectRef;
|
|
66
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TypographyDirective, never>;
|
|
67
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TypographyDirective, "[typography]", never, { "variant": { "alias": "tyVariant"; "required": false; "isSignal": true; }; "color": { "alias": "tyColor"; "required": false; "isSignal": true; }; "fontWeight": { "alias": "tyFontWeight"; "required": false; "isSignal": true; }; "textOverflow": { "alias": "tyTextOverflow"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
68
|
-
}
|