1.0.1 • Published 1 year ago

ifx-f2p2 v1.0.1

Weekly downloads
-
License
-
Repository
gitlab
Last release
1 year ago

IFX-F2P2 Component

Overview

The ifx-f2p2 (Infineon Freaking Fast People Picker) is a reusable web component built with Stencil.js. It provides a user-friendly interface for searching and selecting people within Infineon's directory.

IFX-F2P2 Component Screenshot

Features

  • Accessible design
  • Circular navigation and search term match highlight
  • Fast, asynchronous search functionality
  • Keyboard navigation support
  • Lazy-loaded profile images

Installation

To use the IFX-F2P2 component in your project, install it via npm:

npm install ifx-f2p2

Usage

Basic Integration

  1. Import the component in your JavaScript/TypeScript file:
import 'ifx-f2p2';
  1. Use the component in your HTML/JSX:
<!-- html -->
<ifx-f2p2 min-search-chars="0"></ifx-f2p2>
// jsx
<ifx-f2p2 minSearchChars={0}></ifx-f2p2>
  1. Event Handling - The component emits several events that you can listen to:
const f2p2 = document.querySelector('ifx-f2p2');

f2p2.addEventListener('ifxF2P2PersonSelected', event => {
  console.log('Person selected:', event.detail);
});

f2p2.addEventListener('ifxF2P2PersonRemoved', event => {
  console.log('Person removed:', event.detail);
});

f2p2.addEventListener('ifxF2P2SelectionChange', event => {
  console.log('Selection changed:', event.detail);
});

Configuration

PropertyAttributeDescriptionTypeDefault
debounceTimedebounce-timeThe time to wait before calling the search function after the user stops typing (in milliseconds).number300
maxSelectionsmax-selectionsThe maximum number of people that can be selected.numberInfinity
minSearchCharsmin-search-charsThe minimum number of characters to type before searching for people.number2
placeholderplaceholderThe placeholder text for the search input.string'Search people...'

Events

EventDescriptionType
ifxF2P2PersonRemovedEmitted when a person is removed. The removed person is passed as an event detail.CustomEvent<{ lastName: string; firstName: string; deptName: string; userid: string; ifxUserName: string; location: string; email: string; imageUrl: string; }>
ifxF2P2PersonSelectedEmitted when a person is selected. The selected person is passed as an event detail.CustomEvent<{ lastName: string; firstName: string; deptName: string; userid: string; ifxUserName: string; location: string; email: string; imageUrl: string; }>
ifxF2P2SelectionChangeEmitted when the selected people change. The updated list of selected people is passed as an event detail.CustomEvent<Person[]>
1.0.1

1 year ago

1.0.0

1 year ago

0.0.1

1 year ago