@softheon/armature 19.10.3 → 19.11.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.
@@ -16,12 +16,26 @@ export declare class SofCalloutComponent {
16
16
  * @note Can be a translation key
17
17
  */
18
18
  text: string;
19
+ /**
20
+ * The callout text translation params object
21
+ * @optional
22
+ */
23
+ textParams?: {
24
+ [key: string]: string;
25
+ };
19
26
  /**
20
27
  * The callout extended message
21
28
  * @optional
22
29
  * @note Can be a translation key
23
30
  */
24
31
  extendedText?: string;
32
+ /**
33
+ * The callout extended message translation params object
34
+ * @optional
35
+ */
36
+ extendedTextParams?: {
37
+ [key: string]: string;
38
+ };
25
39
  /**
26
40
  * The text size
27
41
  * @optional
@@ -63,7 +77,7 @@ export declare class SofCalloutComponent {
63
77
  /** Emit event when action button is clicked */
64
78
  actionButtonClick(): void;
65
79
  static ɵfac: i0.ɵɵFactoryDeclaration<SofCalloutComponent, never>;
66
- static ɵcmp: i0.ɵɵComponentDeclaration<SofCalloutComponent, "sof-callout", never, { "id": { "alias": "id"; "required": false; }; "type": { "alias": "type"; "required": true; }; "text": { "alias": "text"; "required": true; }; "extendedText": { "alias": "extendedText"; "required": false; }; "textSize": { "alias": "textSize"; "required": false; }; "iconOverrideClass": { "alias": "iconOverrideClass"; "required": false; }; "canDismiss": { "alias": "canDismiss"; "required": false; }; "actionButtonConfig": { "alias": "actionButtonConfig"; "required": false; }; }, { "actionButtonClicked": "actionButtonClicked"; "dismissEvent": "dismissEvent"; }, never, ["[callout-custom-content]"], true, never>;
80
+ static ɵcmp: i0.ɵɵComponentDeclaration<SofCalloutComponent, "sof-callout", never, { "id": { "alias": "id"; "required": false; }; "type": { "alias": "type"; "required": true; }; "text": { "alias": "text"; "required": true; }; "textParams": { "alias": "textParams"; "required": false; }; "extendedText": { "alias": "extendedText"; "required": false; }; "extendedTextParams": { "alias": "extendedTextParams"; "required": false; }; "textSize": { "alias": "textSize"; "required": false; }; "iconOverrideClass": { "alias": "iconOverrideClass"; "required": false; }; "canDismiss": { "alias": "canDismiss"; "required": false; }; "actionButtonConfig": { "alias": "actionButtonConfig"; "required": false; }; }, { "actionButtonClicked": "actionButtonClicked"; "dismissEvent": "dismissEvent"; }, never, ["[callout-custom-content]"], true, never>;
67
81
  }
68
82
  export interface CalloutActionButtonConfig {
69
83
  id?: string;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @property `type!` 'success' | 'error' | 'info' | 'warning' | 'help'
3
+ * @property `message!` the message
4
+ * @property `messageParams?` the message translation key params {...params}
5
+ * @property `extendedMessage?` the extended message
6
+ * @property `extendedMessageParams?` the extended message translation key params {...params}
7
+ * @property `actionLabel?` label for the optional action button
8
+ * @note _all action buttons will be displayed as neutral mini buttons with no icon_
9
+ * @property `onAction?` method for the action button (disables auto-dismiss)
10
+ * @property `onDismiss?` method to call when dismissed
11
+ * @property `iconClassOverride?` icon class to override the default icon
12
+ * @example
13
+ const helpSnackbarSimple: SnackBar = {
14
+ type: "help",
15
+ message: "Important message"
16
+ };
17
+ * @example
18
+ const helpSnackbarFull: SnackBar = {
19
+ type: "help",
20
+ message: "important.message",
21
+ messageParams: {name: 'Armature'},
22
+ extendedMessage: "more.info",
23
+ extendedMessageParams: {ex: 'Example', id: id},
24
+ actionLabel: "Action",
25
+ onAction: () => this.takeAction(anyParams),
26
+ onDismiss: () => this.dismissEvent(anyParams),
27
+ iconClassOverride: "ph-bold ph-angular-logo"
28
+ };
29
+ */
30
+ export interface Snackbar {
31
+ type: 'success' | 'error' | 'info' | 'warning' | 'help';
32
+ message: string;
33
+ messageParams?: {
34
+ [key: string]: string;
35
+ };
36
+ extendedMessage?: string;
37
+ extendedMessageParams?: {
38
+ [key: string]: string;
39
+ };
40
+ actionLabel?: string;
41
+ onAction?: () => void;
42
+ onDismiss?: () => void;
43
+ iconClassOverride?: string;
44
+ }
45
+ /**
46
+ * Snackbar interface ⚠️ FOR INTERNAL USE ONLY
47
+ * @note Adds the id & duration which are not configurable
48
+ */
49
+ export interface _SnackbarInternal extends Snackbar {
50
+ id?: number;
51
+ duration?: number;
52
+ }
@@ -0,0 +1,50 @@
1
+ import { Signal } from '@angular/core';
2
+ import { Snackbar, _SnackbarInternal } from './snackbar';
3
+ import * as i0 from "@angular/core";
4
+ /** Snackbar service */
5
+ export declare class SnackbarService {
6
+ /** ( _private_ ) snackbar array signal */
7
+ private _snackbars;
8
+ /** ( _public readonly_ ) snackbar array signal */
9
+ readonly snackbars: Signal<Array<_SnackbarInternal>>;
10
+ /** ( _private readonly_ ) map snackbar dismiss duration based on type in milliseconds */
11
+ private readonly _durationMap;
12
+ /** ( _private_ ) saves all the snackbar duration timeouts to a Map */
13
+ private _timeouts;
14
+ /** ( _private_ ) internal use id to track the snackbars */
15
+ private _nextId;
16
+ /**
17
+ * ( _private_ ) set the snackbar timeout to the timeouts Map
18
+ * @param id snackbar id
19
+ */
20
+ private _setTimeout;
21
+ /**
22
+ * ( _private_ ) delete the snackbar timeout from the timeouts Map
23
+ * @param id snackbar id
24
+ */
25
+ private _deleteTimeout;
26
+ /**
27
+ * Show a snackbar
28
+ * @param snackbarInput the snackbar config
29
+ * @returns snackbar id, for testing
30
+ */
31
+ show(snackbarInput: Snackbar): number;
32
+ /**
33
+ * Dismiss a snackbar
34
+ * @param id the snackbar id to dismiss
35
+ */
36
+ dismiss(id: number): void;
37
+ /**
38
+ * Temporarily remove the snackbar timeout
39
+ * @param id snackbar id to pause dismissal timeout
40
+ */
41
+ pause(id: number): void;
42
+ /**
43
+ * Add back the snackbar timeout
44
+ * @param id snackbar id to resume dismissal timeout
45
+ * @param duration snackbar id to resume dismissal timeout
46
+ */
47
+ resume(id: number, duration: number): void;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<SnackbarService, never>;
49
+ static ɵprov: i0.ɵɵInjectableDeclaration<SnackbarService>;
50
+ }
@@ -0,0 +1,39 @@
1
+ import { Signal } from '@angular/core';
2
+ import { _SnackbarInternal } from '../snackbar';
3
+ import * as i0 from "@angular/core";
4
+ /** Snackbar component */
5
+ export declare class SofSnackbarComponent {
6
+ /** Snackbar service */
7
+ private _snackbarService;
8
+ /** Snackbars array signal */
9
+ snackbars: Signal<Array<_SnackbarInternal>>;
10
+ /** Live announcer for screen reader wcag */
11
+ private _liveAnnouncerService;
12
+ /** Translation service */
13
+ private _translateService;
14
+ /**
15
+ * Dismiss a snackbar, calls onDismiss() if provided and not handleAction event
16
+ * @param snackbar the snackbar to dismiss
17
+ * @param skipCallback should we skip onDismiss if action button is clicked
18
+ * @note Screen reader will announce the dismissal
19
+ */
20
+ dismiss(snackbar: _SnackbarInternal, skipCallback?: boolean): void;
21
+ /**
22
+ * Pauses the snackbar dismiss duration on mouseenter
23
+ * @param id snackbar id to pause dismissal timeout
24
+ */
25
+ pause(id: number): void;
26
+ /**
27
+ * Resumes the snackbar dismiss duration on mouseleave
28
+ * @param id snackbar id to resume dismissal timeout
29
+ * @param duration snackbar id to resume dismissal timeout
30
+ */
31
+ resume(id: number, duration: number): void;
32
+ /**
33
+ * Call the onAction
34
+ * @param snackbar snackbar to act on
35
+ */
36
+ handleAction(snackbar: _SnackbarInternal): void;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<SofSnackbarComponent, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<SofSnackbarComponent, "sof-snackbar", never, {}, {}, never, never, true, never>;
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softheon/armature",
3
- "version": "19.10.3",
3
+ "version": "19.11.0",
4
4
  "dependencies": {
5
5
  "tslib": "^2.5.0"
6
6
  },
package/public-api.d.ts CHANGED
@@ -47,6 +47,9 @@ export * from './lib/component-save-print/sof-ar-component-save-print.module';
47
47
  export * from './lib/component-save-print/components/component-save-print/component-save-print.component';
48
48
  export * from './lib/component-save-print/services/component-save-print.service';
49
49
  export * from './lib/rbac/services/tokens';
50
+ export { Snackbar } from './lib/snackbar/snackbar';
51
+ export * from './lib/snackbar/snackbar.service';
52
+ export * from './lib/snackbar/sof-snackbar/sof-snackbar.component';
50
53
  export * from './lib/mfe/mfe.module';
51
54
  export * from './lib/mfe/services/entity-helper.service';
52
55
  export * from './lib/mfe/components/entity-base/entity-base.component';
@@ -1,3 +0,0 @@
1
- {
2
- "module": "../fesm2022/softheon-armature-ag-grid-components.mjs"
3
- }