@openmfp/ngx 0.18.13 → 0.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmfp/ngx",
3
- "version": "0.18.13",
3
+ "version": "0.19.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/openmfp/webcomponents.git"
@@ -141,11 +141,13 @@ interface FieldDefinition {
141
141
  requirePermission?: string;
142
142
  }
143
143
 
144
- type DashboardLanguage = 'en' | 'de';
145
144
  declare const DASHBOARD_I18N_KEYS: {
145
+ readonly TITLE: "title";
146
+ readonly DESCRIPTION: "description";
147
+ readonly EDIT_HOME_BUTTON: "editHomeButton";
148
+ readonly EDIT_CARDS_BUTTON: "editCardsButton";
146
149
  readonly UNSAVED_CHANGES: "unsavedChanges";
147
150
  readonly EDIT_CARDS: "editCards";
148
- readonly EDIT_VIEW: "editView";
149
151
  readonly ACTIONS: "actions";
150
152
  readonly SAVE: "save";
151
153
  readonly CANCEL: "cancel";
@@ -159,17 +161,34 @@ declare const DASHBOARD_I18N_KEYS: {
159
161
  readonly RESIZABLE: "resizable";
160
162
  };
161
163
  type DashboardI18nKey = (typeof DASHBOARD_I18N_KEYS)[keyof typeof DASHBOARD_I18N_KEYS];
164
+ /**
165
+ * The full set of dashboard chrome strings (toolbar buttons, dialogs, a11y
166
+ * labels). Client applications provide translated values through
167
+ * `DashboardConfig.i18n`; any key they omit falls back to `EN_DEFAULTS`.
168
+ */
169
+ type DashboardTranslations = Record<DashboardI18nKey, string>;
170
+ /**
171
+ * Built-in English strings. This is the only translation the library ships and
172
+ * the fallback used whenever a key is not supplied by the client through
173
+ * `DashboardConfig.i18n`.
174
+ */
175
+ declare const EN_DEFAULTS: DashboardTranslations;
162
176
 
163
177
  /**
164
- * Holds the dashboard's current language and resolves translation keys for
165
- * the dashboard chrome (toolbar buttons, dialogs, a11y labels). Provided at
166
- * the `Dashboard` component level so every nested dashboard component shares
167
- * the same language signal child components inject the same instance and
168
- * react to language changes automatically because `getTranslation` reads the
169
- * signal on every call.
178
+ * Resolves translation keys for the dashboard chrome (toolbar buttons,
179
+ * dialogs, a11y labels). Provided at the `Dashboard` component level so every
180
+ * nested dashboard component shares the same instance child components
181
+ * inject it and react to translation changes automatically because
182
+ * `getTranslation` reads the `overrides` signal on every call.
183
+ *
184
+ * The library ships English only (`EN_DEFAULTS`). Client applications supply
185
+ * translated strings through `DashboardConfig.i18n`, which the `Dashboard`
186
+ * component pushes into `overrides`; switching language is just the client
187
+ * swapping that object. Any key not present in the overrides falls back to the
188
+ * English default, and finally to the key itself.
170
189
  */
171
190
  declare class DashboardI18nService {
172
- readonly language: _angular_core.WritableSignal<DashboardLanguage>;
191
+ readonly overrides: _angular_core.WritableSignal<Partial<DashboardTranslations>>;
173
192
  getTranslation(key: DashboardI18nKey): string;
174
193
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DashboardI18nService, never>;
175
194
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DashboardI18nService>;
@@ -241,16 +260,10 @@ interface DashboardButtonsSettings {
241
260
  }
242
261
  /** Top-level configuration for the `<mfp-dashboard>` component. */
243
262
  interface DashboardConfig {
244
- /** Dashboard title rendered in the toolbar. */
245
- title: string;
246
- /** Optional subtitle shown below the title. */
247
- description?: string;
248
263
  /** URL of the background image applied to the dashboard host element. */
249
264
  backgroundImageUrl?: string;
250
265
  /** Overrides for the built-in Edit View and Edit Cards toolbar buttons. */
251
266
  buttonsSettings?: DashboardButtonsSettings;
252
- /** Extra action buttons rendered in the toolbar alongside the built-in ones. */
253
- customActions?: ButtonSettings[];
254
267
  /** When `true`, shows the Edit View button in the toolbar, allowing the user to enter edit mode. */
255
268
  editable?: boolean;
256
269
  /** When `true`, the Edit View button is rendered before the custom actions instead of after. Defaults to `false`. */
@@ -291,12 +304,22 @@ declare class Dashboard implements OnInit, OnDestroy {
291
304
  private readonly hostEl;
292
305
  private readonly injector;
293
306
  private readonly sanitizer;
294
- protected readonly i18n: DashboardI18nService;
307
+ protected readonly i18nService: DashboardI18nService;
295
308
  config: _angular_core.InputSignal<DashboardConfig>;
296
309
  sections: _angular_core.ModelSignal<SectionConfig[]>;
297
310
  cards: _angular_core.ModelSignal<CardConfig[]>;
298
311
  availableCards: _angular_core.InputSignal<CardConfig[]>;
299
- language: _angular_core.InputSignal<DashboardLanguage>;
312
+ /** Extra action buttons rendered in the toolbar alongside the built-in ones. */
313
+ customActions: _angular_core.InputSignal<ButtonSettings[]>;
314
+ /**
315
+ * Full set of dashboard-chrome translations (title, description, toolbar
316
+ * buttons, dialogs, a11y labels). The library ships English only. Provide a
317
+ * complete `DashboardTranslations` to render the dashboard in another
318
+ * language, and swap it to switch language. When `null`, `undefined`, or an
319
+ * empty object, the built-in English defaults (`EN_DEFAULTS`) are used. See
320
+ * `DashboardTranslations` / `DashboardI18nKey` for the full key contract.
321
+ */
322
+ i18n: _angular_core.InputSignal<DashboardTranslations | null | undefined>;
300
323
  readonly saved: _angular_core.OutputEmitterRef<{
301
324
  sections: SectionConfig[];
302
325
  cards: CardConfig[];
@@ -307,9 +330,12 @@ declare class Dashboard implements OnInit, OnDestroy {
307
330
  }>;
308
331
  readonly unsavedChangesChange: _angular_core.OutputEmitterRef<boolean>;
309
332
  protected readonly i18nKeys: {
333
+ readonly TITLE: "title";
334
+ readonly DESCRIPTION: "description";
335
+ readonly EDIT_HOME_BUTTON: "editHomeButton";
336
+ readonly EDIT_CARDS_BUTTON: "editCardsButton";
310
337
  readonly UNSAVED_CHANGES: "unsavedChanges";
311
338
  readonly EDIT_CARDS: "editCards";
312
- readonly EDIT_VIEW: "editView";
313
339
  readonly ACTIONS: "actions";
314
340
  readonly SAVE: "save";
315
341
  readonly CANCEL: "cancel";
@@ -352,7 +378,6 @@ declare class Dashboard implements OnInit, OnDestroy {
352
378
  '--dashboard-cols-lg': number;
353
379
  '--dashboard-cols-xl': number;
354
380
  }>;
355
- protected customActions: _angular_core.Signal<ButtonSettings[]>;
356
381
  protected addedCardsIds: _angular_core.Signal<Set<string>>;
357
382
  protected editViewButton: _angular_core.Signal<{
358
383
  text: string;
@@ -448,7 +473,7 @@ declare class Dashboard implements OnInit, OnDestroy {
448
473
  private updateCardsForBreakpoint;
449
474
  private changeCardSettingsForXlPage;
450
475
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Dashboard, never>;
451
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<Dashboard, "mfp-dashboard", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "sections": { "alias": "sections"; "required": false; "isSignal": true; }; "cards": { "alias": "cards"; "required": false; "isSignal": true; }; "availableCards": { "alias": "availableCards"; "required": false; "isSignal": true; }; "language": { "alias": "language"; "required": false; "isSignal": true; }; }, { "sections": "sectionsChange"; "cards": "cardsChange"; "saved": "saved"; "actionButtonClick": "actionButtonClick"; "unsavedChangesChange": "unsavedChangesChange"; }, never, ["[slot=dashboard-subheader]"], true, never>;
476
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<Dashboard, "mfp-dashboard", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "sections": { "alias": "sections"; "required": false; "isSignal": true; }; "cards": { "alias": "cards"; "required": false; "isSignal": true; }; "availableCards": { "alias": "availableCards"; "required": false; "isSignal": true; }; "customActions": { "alias": "customActions"; "required": false; "isSignal": true; }; "i18n": { "alias": "i18n"; "required": false; "isSignal": true; }; }, { "sections": "sectionsChange"; "cards": "cardsChange"; "saved": "saved"; "actionButtonClick": "actionButtonClick"; "unsavedChangesChange": "unsavedChangesChange"; }, never, ["[slot=dashboard-subheader]"], true, never>;
452
477
  }
453
478
 
454
479
  /**
@@ -1503,5 +1528,5 @@ declare class MockCard {
1503
1528
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<MockCard, "mfp-mock-card", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1504
1529
  }
1505
1530
 
1506
- export { BooleanValue, CARD_TYPES, Dashboard, DeclarativeForm, DeclarativeTable, DeclarativeTableCard, DeleteConfirmationDialog, Favorites, LinkValue, MockCard, ResourceField, ResourceFormDialog, SanitizeHtmlPipe, SecretValue, ServiceStatusCard, TagListValue, VisitedServiceCard, WhatsNew, defineDashboardElementMethods };
1507
- export type { ButtonSettings, CardConfig, CardsType, CssRule, DashboardButtonsSettings, DashboardConfig, DeleteResourceConfirmationConfig, FieldDefinition, FieldFilterDefinition, FormFieldChangeEvent, FormFieldDefinition, FormFieldErrors, GenericResource, IconDesignType, ModalSettings, MountCfg, PropertyField, ResourceFieldButtonClickEvent, ResourceFormConfig, RuleCondition, SectionConfig, ServiceStatusItem, ServiceStatusValue, TableCardButtonSettings, TableCardConfig, TableCardFormState, TableCardSearchConfig, TableConfig, TableFieldDefinition, TagSettings, TransformType, UiSettings, ValueRule };
1531
+ export { BooleanValue, CARD_TYPES, DASHBOARD_I18N_KEYS, Dashboard, DashboardI18nService, DeclarativeForm, DeclarativeTable, DeclarativeTableCard, DeleteConfirmationDialog, EN_DEFAULTS, Favorites, LinkValue, MockCard, ResourceField, ResourceFormDialog, SanitizeHtmlPipe, SecretValue, ServiceStatusCard, TagListValue, VisitedServiceCard, WhatsNew, defineDashboardElementMethods };
1532
+ export type { ButtonSettings, CardConfig, CardsType, CssRule, DashboardButtonsSettings, DashboardConfig, DashboardI18nKey, DashboardTranslations, DeleteResourceConfirmationConfig, FieldDefinition, FieldFilterDefinition, FormFieldChangeEvent, FormFieldDefinition, FormFieldErrors, GenericResource, IconDesignType, ModalSettings, MountCfg, PropertyField, ResourceFieldButtonClickEvent, ResourceFormConfig, RuleCondition, SectionConfig, ServiceStatusItem, ServiceStatusValue, TableCardButtonSettings, TableCardConfig, TableCardFormState, TableCardSearchConfig, TableConfig, TableFieldDefinition, TagSettings, TransformType, UiSettings, ValueRule };