File

src/lib/inbox/inbox.component.ts

Description

Main Component of the Inbox Library, gives an example layout and functionality for an inbox workspace.

Important: The usePagination and useProgressiveLoader inputs are mutually exclusive. If both are enabled, neither feature will be active and warnings will be logged.

Example :
<talenra-inbox
  class="talenra-inbox"
  [dataItems]="dataItems"
  [loading]="false"
  [attributes]="attributes"
  [customShortcuts]="customShortcuts"
  [detailViewTabs]="detailViewTabs"
  [presets]="presets"
  [activePresetName]="activePresetName"
  usePagination
  [paginatorState]="paginatorState"
  (paginatorStateChange)="onPaginatorStateChange($event)"
  (presetAction)="onPresetAction($event)"
  (presetsChange)="newPresets($event)"
  (clickedDataItemEmitter)="onClickedDataItem($event)"
  (dataItemsInteractions)="onDataItemsInteractions($event)"
  (virtualScrollerPosition)="onVirtualScrollerPosition($event)"
></talenra-inbox>
Example :
<talenra-inbox
  class="talenra-inbox"
  [dataItems]="dataItems"
  [loading]="false"
  [attributes]="attributes"
  useProgressiveLoader
  [progressiveLoaderState]="progressiveLoaderState"
  (progressiveLoaderStateChange)="onProgressiveLoaderStateChange($event)"
  (clickedDataItemEmitter)="onClickedDataItem($event)"
  (dataItemsInteractions)="onDataItemsInteractions($event)"
></talenra-inbox>

Implements

OnInit OnChanges OnDestroy

Metadata

Index

Properties
Methods
Inputs
Outputs

Inputs

activePresetName
Type : string[]
Default value : []

Input activePresetName is used to let the inbox know which group or preset was clicked in the app. As the inbox needs to know which group or preset is currently active, activePresetName is provided as an input.

If a group is active, then only the group name is filled in the activePresetName input.

If a preset is active, then the group name and preset name is filled in the activePresetName input.

Most of the time, the active state of the main navigation also have to be set in the consuming app.

Important Information:

  1. In many cases, activePresetName has to be updated after presets have been changed. The consuming app receives information about what happened to the presets via the presetAction emitter.
  2. Also note that the reset button will not work properly if activePresetName is not set correctly.

Usage

Example :
<talenra-inbox [attributes]="attributes" [presets]="presets" [activePresetName]="activePresetName"></talenra-inbox>

Configuration

Example :
// if group is active
const activePresetName = ['Meine Inbox', #idOfPreset];

// if preset in group is active
const activePresetName = ['Meine Inbox', 'View 1', #idOfPreset];
attributes
Type : IAttributeItemInput[]
Required :  true

Data items attributes which are used to configure the specific attribute of the data items and the behavior for the chosen attributes. The inbox focuses on the configuration and display of specific attributes for each data item. The attributes parameter allows for the customization of attributes and their presentation within the inbox. The IAttributeItemInput interface is utilized to define the specific attributes of each item.

Important information:

  1. The naming of the input type has changed: current AttributeItemInput to IAttributeItemInput. The AttributeItemInput has the same properties as the IAttributeItemInput.

Usage

Example :
<talenra-inbox [attributes]="attributes"></talenra-inbox>

Configuration

Example :
import { IAttributeItemInput } from '@talenra/inbox';

const attributes: IAttributeItemInput[] = [
  {
    identifier: 'caseFlags',   // required
    displayedName: 'Hinweise', // required
    defaultAttribute: 'detail', // optional
    iconFilter: { // optional
      identifier: 'caseFlags',
      icon: 'error',
      activeIconColor: 'primary',
      iconTooltip: 'Hinweis',
      displayedString: (elem) => {
        return 'Beinhaltet die Rolle MA' + elem['caseFlags'].filter((s: string | string[]) => s.includes('MA')).length;
      },
      assignmentCondition: (elem) => {
        return elem['caseFlags'].filter((s: string | string[]) => s.includes('MA')).length != 0;
      },
    },
  },
  // attribute for complex data structure (see section `dataItems`)
  {
    identifier: 'workflowCase.pvRoles',   // required
    displayedName: 'Hinweise', // required
    filterable: 'multi-select', // optional
    defaultAttribute: 'detail', // optional
    singleMultiSelectOptions: ['Mitglied prüfen', 'Lohndeklaration erfassen', 'Partner prüfen'], // optional
  },
  {
    identifier: 'workflowCase.initialElements.partnerFlag',   // required
    displayedName: 'Hinweise', // required
    filterable: 'multi-select', // optional
    allowEmptyDataItemFilter: false, // optional
  },
];
dataItems
Type : any[]
Default value : []

Different data items which are used in data items list items and data item information. The data which should be displayed in the inbox.

Important information:

  1. The Input type is "any[]" so that the inbox can be used with any flattened data structure: The keys will be used as displayed identifiers for the attributes of the items (the displayedName is able to be customized with the attributes input).

  2. The items are not required to have the same data structure: Attributes of individual items (see example "attribute2 / attribute3") may be missing from item to item. Missing attributes will be displayed as an "–" value.

  3. Attributes with the same key (identifier) have to be of the same type: Attributes which have the same key (identifier) have to contain the same type of data (e.g. string, number, date). For example attribute1 are of the same type, here string.

  4. The data-items-list has a limited number of attributes for each item: The attributes input can be used to define which attributes should be displayed in the data-items-list or in the detail-view. Default: 12, customizable in the inboxConfiguration of by the presets.

  5. The list items are displayed in a Virtual Scroller: That means that only the list items which are visible are rendered. This is done to improve the performance of the inbox.

  6. Use attributes input for the complex structure: If the data has a 'complex' structure and is not flattened, the input attributes has to define the identifier to the attribute (see section attributes).

  7. If new dataItems have to be inputted: The "refresh" input has be used (set to true) to show the skeleton loading. Otherwise, the new data will not be shown correctly. After the new data is loaded and inputed, the "refresh" input has to be set to false.

  8. The data items are used to fill the single- and multi-select filters: If not otherwise specified in the attributes input, the data items are used to fill the single- and multi-select filters options.

Usage

Example :
<talenra-inbox [attributes]="attributes" [dataItems]="dataItems"></talenra-inbox>

Flattened structure

Example :
dataItems = [{
  attribute1: 'Direkt eingegangene Beschwerde',
  attribute2: 'ZH-20230510-0014648',
  ...,
},
  {
    attribute1: 'Direkt eingegangene Beschwerde',
    attribute3: 'Janssens Mila',
    ...,
  },
];

Complex structure

Example :
dataItems = [{
  attribute1: 'Direkt eingegangene Beschwerde',
  attribute2: 'ZH-20230510-0014648',
  attribute3: {
    attribute4: 'Janssens Mila',
    attribute5: '756.8396.7741.70',
  },
  ...,
},
  {
    attribute1: 'Direkt eingegangene Beschwerde',
    attribute2: 'Janssens Mila',
    ...,
  },
];
loading
Type : boolean
Default value : false

Boolean to show if skeleton loading is to be shown.

Important information:

  1. The inbox can not detect the loading state of the data items, so the "refresh" input has to be used.
noteBoxItems
Type : INoteBoxItem[]

The NoteBoxItems input is used to show a custom note box items in style of the default note box.

It is changeable in runtime by the consuming app to show different content in the note box.

Important information:

  1. The naming of the input type has changed: current NoteBoxItem to INoteBoxItem. The NoteBoxItem has the same properties as the INoteBoxItem.

Usage

Example :
<talenra-inbox [attributes]="attributes" [noteBoxItems]="noteBoxItems"></talenra-inbox>

Configuration

Example :
import { INoteBoxItem } from '@talenra/inbox';

noteBoxItems: INoteBoxItem[] = [
  {
    identifier: 'Note 1',
    icon: 'info',
    iconColor: 'primary',
    content: 'This is a note box item.',
  },
  {
    identifier: 'Note 2',
    icon: 'beach-access',
    iconColor: 'status-red',
    content: 'This is another note box item.',
  }
];
paginatorState
Type : PaginatorState
Default value : { currentPage: 1, itemsPerPage: 10, totalItems: 1, itemsPerPageOptions: [5, 10, 20, 50], }

The number of items per page in the pagination.

Usage

Example :
<talenra-inbox [attributes]="attributes" [paginatorState]="paginatorState" usePagination></talenra-inbox>
pairingAttributes
Type : IPairingAttributes[]
Default value : []

The pairing attributes which combine two attributes to one attribute.

The pairingAttributes input is used to combine two attributes to one attribute.

Important information:

  1. The naming of the input type has changed: current PairingAttributesModel to IPairingAttributes. The PairingAttributesModel has the same properties as the IPairingAttributes.

Usage

Example :
<talenra-inbox [attributes]="attributes" [pairingAttributes]="pairingAttributes"></talenra-inbox>

Configuration

Example :
import { IPairingAttributes } from '@talenra/inbox';

pairingAttributes: IPairingAttributes[] = [
  {
    identifier: 'combinedName',
    displayedName: 'First/Last Name',
    firstAttribute: 'firstNameOrgNameAddOn',
    secondAttribute: 'lastNameOrgName',
    commaSeparation: false,
  },
  {
    identifier: 'member.combinedName',
    displayedName: 'Member First/Last Name',
    firstAttribute: 'member.lastNameOrgName',
    secondAttribute: 'member.firstNameOrgNameAddOn',
    commaSeparation: true,
  },
];
presets
Type : IPreset[]
Default value : []

The presets input is necessary to create and show different presets in the inbox. The user has the possibility to choose between the presets. If the consuming application used the app without the presets input, the inbox won't be able to save or manipulate new presets and existing presets.

Important information:

  1. The naming of the input type has changed: current Preset to IPreset. The Preset has the same properties as the IPreset.

  2. Minimum one preset has to be defined with changeable: false. That is the default view.

Usage

Example :
<talenra-inbox [attributes]="attributes" [presets]="presets" [activePresetName]="activePresetName"></talenra-inbox>

Active preset name

Example :
const activePresetName = ['Meine Inbox', 'View 1'];

Configuration

Example :
import { IPreset } from '@talenra/inbox';

const presets: IPreset[] = [{
  identifier: '121bd936-ce20-4ea9-9dc1-6cdaf61f9c3d',
  name:
    'Meine Inbox',
  changeable:
    false,
  selectedAttributes:
    [
      { identifier: 'case.caseTypeName', defaultAttribute: 'main' },
      { identifier: 'case.caseID', defaultAttribute: 'main' },
      { identifier: 'processStep', defaultAttribute: 'main' },
      { identifier: 'insuree.partnerFlags', defaultAttribute: 'detail' },
      { identifier: 'insuree.pvRoles', defaultAttribute: 'detail' },
      { identifier: 'case.leadingKpvPartID', defaultAttribute: 'detail' },
      { identifier: 'insuree.kpvPartID', defaultAttribute: 'detail' },
    ],
  children:
    [
      {
        name: 'View 1',
        numberMainAttributesChosenByUser: 4,
        selectedAttributes: [
          { identifier: 'case.caseTypeName', defaultAttribute: 'main' },
          { identifier: 'case.caseID', defaultAttribute: 'main' },
          { identifier: 'processStep', defaultAttribute: 'detail' },
          { identifier: 'insuree.lastNameOrgName', defaultAttribute: 'detail' },
          { identifier: 'case.caseStartDate', defaultAttribute: 'detail' },
          { identifier: 'member.lastNameOrgName', defaultAttribute: 'detail' },
          { identifier: 'insuree.socialSecurityNumber', defaultAttribute: 'detail' },
          { identifier: 'case.casePriority', defaultAttribute: 'main' },
        ],
        sortAttributes: [
          { identifier: 'case.caseTypeName', sort: 'asc' },
          { identifier: 'insuree.socialSecurityNumber', sort: 'desc' },
        ],
        filterAttributes: [
          {
            identifier: 'case.caseTypeName',
            value: ['Direkt eingegangene Beschwerde'],
          },
          {
            identifier: 'case.caseStartDate',
            value: [new Date('01.15.2020'), new Date('12.30.2023')],
          },
          { identifier: 'case.casePriority', value: [1, 2] },
        ],
        iconAttributes: [],
      },
      {
        name: 'View 2',
        numberMainAttributesChosenByUser: 4,
        selectedAttributes: [
          { identifier: 'case.caseTypeName', defaultAttribute: 'main' },
          { identifier: 'case.caseID', defaultAttribute: 'main' },
          { identifier: 'processStep', defaultAttribute: 'detail' },
          { identifier: 'insuree.lastNameOrgName', defaultAttribute: 'detail' },
          { identifier: 'case.caseStartDate', defaultAttribute: 'detail' },
          { identifier: 'member.lastNameOrgName', defaultAttribute: 'detail' },
        ],
        sortAttributes: [{ identifier: 'case.caseTypeName', sort: 'asc' }],
        filterAttributes: [
          {
            identifier: 'case.caseTypeName',
            value: ['Direkt eingegangene Beschwerde'],
          },
        ],
        iconAttributes: [],
      },
    ],
}];
refreshing
Type : boolean
Default value : false

The refreshing input boolean allows the consuming application to set the inbox into a refreshing state. If the value true is injected and the inbox is filled with data (data items), the skeleton loading will be shown. The consuming app can now load new data (dataItems) and input it to the inbox. After the refreshing value can be set to false again. Set, if necessary, the selectedDataItem input to the data item which was selected before the refresh. The new data (dataItems) will be shown and all filter and sort will be reset to the default value.

Important information

  1. The consuming app has to save the selected data Item (clickedDataItemEmitter Output) and set it again after the refresh with the selectedDataItem Input.
selectDataItem
Type : IDataItemId

The input is used to select a data item in the inbox. The input is an object of DataItemIdModel. The identifier is the key in the data item which to get the value of the data item. The value is the compared value which is to be compared.

Important information:

  1. The naming of the input type has changed: current DataItemIdModel to IDataItemId. The DataItemIdModel has the same properties as the IDataItemId.

Usage

Example :
<talenra-inbox [attributes]="attributes" [selectedDataItem]="selectedDataItem"></talenra-inbox>

Configuration

Example :
import { IDataItemId } from '@talenra/inbox';

selectedDataItem: IDataItemId = {
  identifier: 'case.caseID',
  value: 'ZH-20230510-0014648',
};
usePagination
Type : boolean
Default value : false

If true, the pagination feature is enabled.

Usage

Example :
<talenra-inbox [attributes]="attributes" usePagination>
  ...
</talenra-inbox>
detailViewTabs
Type : IInboxTabBarItem[]
Default value : []

The detailViewTabs input is used to add tabs to the detail-view.

Important information:

  1. The naming of the input type has changed: current DetailViewItemModel[] to IInboxTabBarItem[]. The IInboxTabBarItem has the same properties as the DetailViewItemModel.

  2. The "detailViewTabs" will not be displayed in the inbox, if the html tag of the inbox is contained in an *ngIf statement.

  3. The counter attribute has to be a behavior subject, because the counter is updated in the inbox component and the detail view component.

  4. The counter has a maximum value of 99. If the counter is higher than 99, the badge will display "99+".

  5. Because of the Angular lifecycle, the detailViewTabs input has a special declaration in the consuming application. The IInboxTabBarItem has a TemplateRef as a property, which is only initialized in afterViewInit of the consuming app The consuming application has to declare the TemplateRef as a ViewChild and pass it to the detailViewTabs in the ngAfterViewInit method For more information about the Angular lifecycle, please visit the Angular documentation The input property icon is limited by the talenra-icon library (https://gitlab.svanet.ch/talenra/talenra-workspace)

  6. The useScroll attribute is used to define if the content of the tab should be scrollable or not. If a custom scroll container should be used, the useScroll attribute should be set to false. And the style of the scroll container should be set like in the example.

  7. The recommended number of custom tabs are 5. Otherwise, it would mess with the design.

Example :
<talenra-inbox [attributes]="attributes" [detailViewTabs]="detailViewTabs"></talenra-inbox>

<ng-template #talenraInboxDocuments>
  <talenra-scroll-container class="custom-scroll">
    <h1 class="panel-title">Dokumente</h1>
    <div [formGroup]="exampleCheckboxForm" class="inline-documents">
      <talenra-checkbox fcn="check_1" size="s" />
      <p class="pair">
        <span class="documents">Lohnbescheinigung</span>
        <span class="documents-entry">hinzugefügt am 12.03.2021</span>
      </p>
    </div>
  </talenra-scroll-container>
</ng-template>
<ng-template #talenraInboxComments>
  ...
</ng-template>
<ng-template #talenraInboxHistory>
  ...
</ng-template>
Example :
import { IInboxTabBarItem } from '@talenra/inbox';

@ViewChild('talenraInboxDocuments', { read: TemplateRef }) talenraInboxDocuments!: TemplateRef<any>;
@ViewChild('talenraInboxComments', { read: TemplateRef }) talenraInboxComments!: TemplateRef<any>;
@ViewChild('talenraInboxHistory', { read: TemplateRef }) talenraInboxHistory!: TemplateRef<any>;

public detailViewTabs: IInboxTabBarItem[] = [];

ngAfterViewInit(): void {
    // get the template in the next lifecycle hook, because the viewChild is not available yet
    Promise.resolve().then(() => {
      // create the detail view tabs
      this.detailViewTabs: IInboxTabBarItem[] = [
        {
          label: 'documents',
          icon: 'description',
          counter: new BehaviorSubject<number>(8),
          useScroll: false,
          detailViewTabContentTemplate: this.talenraInboxDocuments,
        },
        {
          label: 'comments',
          icon: 'chat-bubble-outline',
          counter: new BehaviorSubject<number>(100),
          useScroll: true,
          detailViewTabContentTemplate: this.talenraInboxComments,
        },
        {
          label: 'history',
          icon: 'history',
          useScroll: false,
          detailViewTabContentTemplate: this.talenraInboxHistory,
        },
      ];
    });
  }
Example :
.custom-scroll {
 position: absolute;
 inset: 0;
}
inboxConfigurationPanelTabs
Type : IInboxTabBarItem[]
Default value : []

The inboxConfigurationPanelTabs input is used to add tabs to the inboxConfigurationPanel.

Important information:

  1. The "inboxConfigurationPanelTabs" will not be displayed in the inbox, if the html tag of the inbox is contained in an *ngIf statement.

  2. The counter attribute has to be a behavior subject, because the counter is updated in the inbox component and the inbox-configuration-panel component.

  3. The counter has a maximum value of 99. If the counter is higher than 99, the badge will display "99+".

  4. Because of the Angular lifecycle, the inboxConfigurationPanelTabs input has a special declaration in the consuming application. The IInboxTabBarItem has a TemplateRef as a property, which is only initialized in afterViewInit of the consuming app The consuming application has to declare the TemplateRef as a ViewChild and pass it to the inboxConfigurationPanelTabs in the ngAfterViewInit method For more information about the Angular lifecycle, please visit the Angular documentation The input property icon is limited by the talenra-icon library (https://gitlab.svanet.ch/talenra/talenra-workspace)

  5. The useScroll attribute is used to define if the content of the tab should be scrollable or not. If a custom scroll container should be used, the useScroll attribute should be set to false. And the style of the scroll container should be set like in the example.

Example :
<talenra-inbox [attributes]="attributes" [inboxConfigurationPanelTabs]="inboxConfigurationPanelTabs"></talenra-inbox>

<ng-template #talenraInboxEnhancedConfiguration>
  <talenra-scroll-container class="custom-scroll">
    <h1 class="panel-title">Further Configuration</h1>
    <div [formGroup]="exampleCheckboxForm" class="inline-documents">
      <talenra-checkbox fcn="check_1" size="s" />
      <p class="pair">
        <span class="documents">Set name</span>
        <span class="documents-entry">Enhance Priority Levels</span>
      </p>
    </div>
  </talenra-scroll-container>
</ng-template>
Example :
import { IInboxTabBarItem } from '@talenra/inbox';

@ViewChild('talenraInboxEnhancedConfiguration', { read: TemplateRef }) talenraInboxEnhancedConfiguration!: TemplateRef<any>;

public inboxConfigurationPanelTabs: IInboxTabBarItem[] = [];

ngAfterViewInit(): void {
    // get the template in the next lifecycle hook, because the viewChild is not available yet
    Promise.resolve().then(() => {
      // create the inboxConfigurationPanelTabs
      this.detailViewTabs: IInboxTabBarItem[] = [
        {
          label: 'documents',
          icon: 'description',
          counter: new BehaviorSubject<number>(8),
          useScroll: false,
          detailViewTabContentTemplate: this.talenraInboxEnhancedConfiguration,
        },
        ...
      ];
    });
  }
Example :
.custom-scroll {
 position: absolute;
 inset: 0;
}
lockedDataItems
Type : IDataItemId[]
Default value : []

The input is used to lock specific data items in the inbox. The input is an array of IDataItemId. The items will be locked visually in the inbox and the user can not interact with them. Additionally, because the data item is not selectable the detail view will not show any information of the data item.

Error Information (Infotip):

When errorTitle is provided, the lock icon becomes clickable and displays an infotip with the error information. Use \n (backslash-n) for line breaks in the description. If no errorTitle is provided, a static lock icon is displayed.

Important information:

  1. The naming of the input type has changed: current DataItemIdModel to IDataItemId. The DataItemIdModel has the same properties as the IDataItemId.

Usage

Example :
<talenra-inbox [attributes]="attributes" [lockedDataItems]="lockedDataItems"></talenra-inbox>

Basic locked items (static lock icon)

Example :
import { IDataItemId } from '@talenra/inbox';

lockedDataItems: IDataItemId[] = [
  {
    identifier: 'case.caseID',
    value: 'ZH-20230510-0014648',
  },
  {
    identifier: 'case.caseID',
    value: 'ZH-20230510-0014649',
  },
];

Locked items with error info (clickable lock icon with infotip)

Example :
import { IDataItemId } from '@talenra/inbox';

lockedDataItems: IDataItemId[] = [
  {
    identifier: 'case.caseID',
    value: 'ZH-20230510-0014648',
    errorTitle: 'Validation Error',
    errorDescription: 'Line 1\nLine 2\nLine 3',
  },
];
possibleOptions
Type : IQueryBuilderValueOptions[]

The values that can be selected in connection to each rule identifier.

progressiveLoaderState
Type : ProgressiveLoaderState
Default value : { currentIteration: 1, iterationSize: 25, iterationEnd: 100, totalItems: 1000, }

The state configuration for the progressive loader. Only used when useProgressiveLoader is true and usePagination is false.

Usage

Example :
<talenra-inbox [attributes]="attributes" [progressiveLoaderState]="progressiveLoaderState" useProgressiveLoader></talenra-inbox>
useProgressiveLoader
Default value : false, { transform: booleanAttribute }

If true, the progressive loader feature is enabled. This input is mutually exclusive with usePagination. If both are true, neither feature will be active.

Usage

Example :
<talenra-inbox [attributes]="attributes" useProgressiveLoader></talenra-inbox>

Outputs

clickedDataItemEmitter
Type : EventEmitter<any>

Emits the active item, enables the consuming app to call appropriate api calls etc. (e.g. to change the content of the detail-view tabs).

The clickedDataItemEmitter is used to get the clicked/active item, which is emitted as an object. The intended purpose is to allow the consuming app get detail-view-data of the specific item.

Important information:

  1. If the emitter returns the value undefined no data item is selected (no data item for selection available).
  2. The consuming application should adjust the detail view accordingly.
dataItemsInteractions
Type : EventEmitter<IInteractedDataItems>

The event which is emitted when a dataItems is interacted with by the further-actions and the proceed button.

The Messages correlate with the buttons in the toolbar and the list view. Process: The process button was clicked (arrow-right icon). More: The further actions button was clicked (three-dots icon).

The More message is intended to allow the consuming app to customize the further actions menu and specify which item opened the menu.

Important information:

  1. The naming of the input type has changed: current InteractedDataItemsModel to IInteractedDataItems. The InteractedDataItemsModel has the same properties as the IInteractedDataItems.
filterSortSearchEmitter
Type : EventEmitter

The event which is emitted when the filter, sort or the search input changes

The consuming application receives information about which filter, sort or search input is used.

Important information:

  1. The naming of the input type has changed: current FilterSortSearchModel to IFilterSortSearch. The FilterSortSearchModel has the same properties as the IFilterSortSearch.
paginatorStateChange
Type : EventEmitter

The event which is emitted when the page changes in the pagination. The consuming application receives information about which page is selected. The consuming application can load the data for the selected page by using the refresh.

presetAction
Type : EventEmitter<IPresetAction>

The event which is emitted when a preset is created, updated or deleted.

The consuming application receives information about which operation is used with the preset and the modified presets. The consuming app should save the presets and make the preset accessible through SidenavItems in the app.component (talenra-app-frame).

Important information:

  1. The naming of the input type has changed: current PresetAction to IPresetAction. The PresetAction has the same properties as the IPresetAction.

  2. The consuming app has to input the modified presets to the inbox.

  3. activePresetName input has to be updated in following cases.

  • create --> switch to the new preset (presetName sent in the presetAction emitter)
  • update --> switch to the updated preset (presetName sent in the presetAction emitter)
  • update & rename --> switch to the updated preset (presetName sent in the presetAction emitter)
  • delete --> switch to the first unchangeable preset of the presets. For example, activate group of the preset.
  • visibility-off --> switch to the first unchangeable preset of the presets. For example, activate group of the preset.
refreshingChange
Type : EventEmitter

The value that the refresh button is clicked.

It will emit the value true when the refresh button is clicked. The consuming application can load the data and set the value to false again.

selectedAllAttributesEmitter
Type : EventEmitter

The event which is emitted when the all selected attributes changes

The consuming application receives information about which attributes have been selected.

selectedDetailAttributesEmitter
Type : EventEmitter

The event which is emitted when the selected detail attributes changes

The consuming application receives information about which detail attributes (the ones below the line in the attribute-settings). The attributes are emitted as an array of strings with the correct order as chosen by the user. The strings are the identifiers of the attributes.

selectedMainAttributesEmitter
Type : EventEmitter

The event which is emitted when the selected main attributes change

The consuming application receives information about which main attributes (the ones above the line in the attribute-settings). The attributes are emitted as an array of strings with the correct order as chosen by the user. The strings are the identifiers of the attributes.

virtualScrollerPosition
Type : EventEmitter<number>

The event which is emitted when the virtual scroller position changes.

The virtualScrollerPosition is used to get the position of the virtual scroll. The position is emitted as a number value ranging from -2 to x.

  • Values from 1 to x are the position of the virtual scroll.
  • The value 0 indicates that the virtual scroll is at the top.
  • The value -1 indicates that the virtual scroll has no scrollable content.
  • The value -2 indicates that the virtual scroll has detected a buggy behaviour (loop scroll).
  • If the value -2 the consuming app hast to stop the possible resizing of the inbox.

Usage

Example :
<talenra-workspace-simple>
  <div class="inbox-app">
    <talenra-workspace-header
      [path]="workspacePath"
      [title]="workspaceTitle"
      class="page-header"
      [class.header-hidden]="!headerEdgeCase && headerHidden && !noScroll" />
    <talenra-inbox [attributes]="attributes" class="talenra-inbox" (virtualScrollerPosition)="onVirtualScrollerPosition($event)"></talenra-inbox>
  </div>
</talenra-workspace-simple>

Styles

Example :
.inbox-app {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.page-header {
  margin-left: 20px;
  opacity: 1;
  height: 92px;

  transition: height 0.3s, opacity 0.3s;

  &.header-hidden {
    opacity: 0;
    height: 0;
  }
}

.talenra-inbox {
  position: relative;
  flex-grow: 1;
}

Handler

Example :
headerHidden = false;
noScroll = false;
headerEdgeCase = false;

onVirtualScrollerPosition(event: number): void {
  switch (event) {
    case -2:
      // if the value -2 is emitted, the inbox has a buggy loop, the header should be fixed and not be trying to hide for the remaining usage
      this.headerEdgeCase = true;
      break;
    default:
      // if the value -1 is emitted, the inbox has a buggy loop, the header should be fixed because the inbox is not scrollable (to few items)
      this.noScroll = event === -1;
      // if the value 0 is emitted, the inbox is at the top and the header should be fixed
      // if the value > 0 is emitted, the inbox is not at the top and the header should be hidden
      this.headerHidden = event > 0;
      break;
  }
}
progressiveLoaderStateChange
Type : ProgressiveLoaderState

The event which is emitted when the progressive loader state changes. The consuming application receives information about the current loader state. The consuming application can load more data by using the refresh with updated data.

Methods

clickedDataItemFunction
clickedDataItemFunction(dataItem: any)

Handler for the clicked data item.

Parameters :
Name Type Optional Description
dataItem any No

The clicked data item.

Returns : void
handleChangesOnPreset
handleChangesOnPreset(btn: string)

Handles the changes in the preset.

Parameters :
Name Type Optional Description
btn string No

The performed action.

Returns : void
iconBtnFunction
iconBtnFunction(btn: string)

Main function to handle interactions with clicked icon buttons.

Parameters :
Name Type Optional Description
btn string No

The clicked button.

Returns : void
initializeComponent
initializeComponent()

Functions to initialize the component.

Returns : void
initializeComponentForViewUsage
initializeComponentForViewUsage()

Initializes the component for the view usage.

Returns : void
numberMainAttributesChosenByUserHandler
numberMainAttributesChosenByUserHandler($event: number)

Sets the number of main attributes chosen by the user.-

Parameters :
Name Type Optional Description
$event number No

The number value that is chosen by the user to show the main attributes.

Returns : void
numberMarkedDataItemsChange
numberMarkedDataItemsChange($event: number)

Handler for the change of number of marked data items.

Parameters :
Name Type Optional
$event number No
Returns : void
onDataItemsInteractions
onDataItemsInteractions(event: IInteractedDataItems)

Depending on the clicked data item button the corresponding event actions will be shown.

Parameters :
Name Type Optional Description
event IInteractedDataItems No

The interacted data items event.

Returns : void
onIconFilterChange
onIconFilterChange(icons: IIconInput[])

Handler for changes in the icon filter state.

Parameters :
Name Type Optional Description
icons IIconInput[] No

All the icons with the updated active state.

Returns : void
onInboxConfigurationPanelButtonAction
onInboxConfigurationPanelButtonAction(action: TConfigurationPanelBottomBarActions, fromPresetChange?: boolean)

Actions performed on button action. Should emit filterSearchSort event.

Parameters :
Name Type Optional Description
action TConfigurationPanelBottomBarActions No

The performed action.

fromPresetChange boolean Yes

If the action is from preset change.

Returns : void
onPaginatorStateChange
onPaginatorStateChange(paginatorState: PaginatorState)

Handler for the paginator state change.

Parameters :
Name Type Optional Description
paginatorState PaginatorState No

The paginator state.

Returns : void
onSelectedFilters
onSelectedFilters(filterAttributes: IQueryBuilderQuery)

The action that is to be performed in for the items.

Parameters :
Name Type Optional Description
filterAttributes IQueryBuilderQuery No

The selected filter attributes.

Returns : void
onSelectedSorts
onSelectedSorts(sorts: ISortAttributesInput[])

Handles the selected sorts.

Parameters :
Name Type Optional
sorts ISortAttributesInput[] No
Returns : void
recognizeChangesInInbox
recognizeChangesInInbox()

Subscribes to the changes in the inbox. Values are provided by the changed values service.

Returns : void
resetPresetEmitterHandler
resetPresetEmitterHandler()

Handler if the inbox is to be reset.

Returns : void
selectedAllAttributesHandler
selectedAllAttributesHandler(selectedAllAttributes: IAttributeItem[])

Handler for the selected all attributes.

Parameters :
Name Type Optional Description
selectedAllAttributes IAttributeItem[] No

Selected all attributes.

Returns : void
selectedDetailAttributesEmitterHandler
selectedDetailAttributesEmitterHandler(selectedDetailAttributes: IAttributeItem[])

Handler for the selected detail attributes.

Parameters :
Name Type Optional Description
selectedDetailAttributes IAttributeItem[] No

Selected detail attributes.

Returns : void
selectedMainAttributesEmitterHandler
selectedMainAttributesEmitterHandler(selectedMainAttributes: IAttributeItem[])

Handler for the selected main attributes.

Parameters :
Name Type Optional Description
selectedMainAttributes IAttributeItem[] No

Selected main attributes.

Returns : void
setInboxStateChangedState
setInboxStateChangedState()

Auxiliary method to set the state that the inbox state changed.

Returns : void

Properties

Public changedValuesInPresetGroups
Type : unknown
Default value : new Map<string, boolean>()

information if in attributes, attributesDetails, numberMainAttributesChosenByUser, sortFilter or filter changes are made. string: attributes, attributesDetails, numberMainAttributesChosenByUser, sortFilter or filter boolean: true if changes are made, false if no changes are made

changedValuesService
Type : unknown
Default value : inject(ChangedPresetValuesService)

Injected changed values service.

csvService
Type : unknown
Default value : inject(CsvService)

Injected csv service.

Public dataItemsClass
Type : DataItemsClass
Default value : new DataItemsClass()

Class to interact with data items.

dataItemsService
Type : unknown
Default value : inject(DataItemsService)

Injected inbox data items service.

filterState
Type : unknown
Default value : inject(FilterStateService)

Injected filter state.

filterToolbarService
Type : unknown
Default value : inject(FilterToolbarService)

Injected filter toolbar service.

inboxDetailViewService
Type : unknown
Default value : inject(InboxDetailViewService)

Injected inbox detail view service.

inboxHelperService
Type : unknown
Default value : inject(InboxHelperService)

Injected inbox helper service.

inboxState
Type : unknown
Default value : inject(InboxState)

Injected inbox state.

inboxToolbarService
Type : unknown
Default value : inject(InboxToolbarService)

Injected inbox toolbar service.

keyboardService
Type : unknown
Default value : inject(KeyboardService)

Injected keyboard service.

Public mainCheckboxState
Type : unknown
Default value : CheckboxState.Outline

Number of marked data items in data items list.

mainFacadeSetterService
Type : unknown
Default value : inject(MainFacadeSetterService)

Injected set inbox configuration service.

Public numberMarkedDataItems
Type : number
Default value : 0

Number of marked data items in data items list.

updatePresetsService
Type : unknown
Default value : inject(UpdatePresetsService)

Injected update preset service.

results matching ""

    No results matching ""