-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Filter-type-group component created #1210
base: master
Are you sure you want to change the base?
Conversation
|
--STORYBOOK-PREVIEW--
|
--EXAMPLE-APPS-PREVIEW--
|
It looks good. Just a new notes/issues;
|
|
|
|
|
|
@Event() ifxFilterSearchChange: EventEmitter; | ||
|
||
|
||
@Watch('value') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this? There is no prop called "value"
, so this @Watch
decorator is not listening to anything.
|
||
@Listen('ifxChange') | ||
handleFilterEntryChange(event: CustomEvent) { | ||
this.value = event.detail; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… within (but also as standalone)
… within (but also as standalone)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 - cursor mouse is still default when hover over the "+" icon that expands the filter. Pic related:
2 - when you type in the search, the 'delete all' icon does not appear. show-delete-icon
prop should be set to true
.
3 - I am not sure if there is a point in emitting the filter-name
from the ifx-filter-search
, and filter-group-name
from ifx-filter-accordion
since both of these names are manually set by the user, and not dynamically changed.
@State() showMore = false; | ||
@State() selectedCount: number = 0; | ||
@State() totalItems = 0; | ||
@Prop() name = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, the Prop is called "list", but in the Storybook snippet, it's called "list-name".
<div class="wrapper"> | ||
{this.type === 'checkbox' ? ( | ||
<div class="list-entry"> | ||
<ifx-checkbox size="s" value={this.value}>{this.label}</ifx-checkbox> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the value in both @listen and @watch is necessary because they react to different triggers and perform different actions:
@watch('value'):
The valueChanged method is a watcher for the value prop.
Whenever the value prop changes, regardless of how the change occurred, this watcher will run.
It's responsible for reflecting the new value prop to the host element's attribute, which might be important for CSS styling or other JS that queries the host element for its value attribute.
@listen('ifxChange'):
The handleFilterEntryChange method is an event listener for the ifxChange event.
When ifxChange is emitted, presumably by the ifx-checkbox or ifx-radio-button, this method updates the value prop and emits a new event (ifxListEntryChange) to inform parent components of the change.
componentDidLoad() { | ||
// Dispatch the ifxListUpdate event after the component has been fully loaded | ||
const selectedItems = getInitiallySelectedItems(this.el); | ||
this.count = selectedItems.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Prop should not be updated inside componentDidLoad
. It triggers an error warning in the console. It should be updated inside componentWillLoad()
lifecycle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to update it in ComponentDidLoad(), because access to the DOM is required to determine the selected items.
The update to this.count depends on the selected items that are obtained from the DOM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also dont get any warnings. Can you send a screenshot here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flex: 1 0 0; | ||
border-bottom: 1px solid tokens.$ifxColorEngineering200; | ||
|
||
&.expanded { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of this borders causes a movement. I am not sure if this should be prevented or not. If yes, then one solution is to add a transparent border.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(y) will look into this today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the borders are described like this in the figma file though. Which movement do they cause? Can you send a screenshot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean the filterGroupName? or the label of the filter? They neeed to be emitted to be used within tihe table. Cause the table columns need to be mapped to the filters |
1 - remove the The other issues are fixed 👍 |
By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---
CONTRIBUTING.md also tells you what to expect in the PR process.
Description
Filter Type Group component + related sub components added
To be used inside the advanced table
📦 Published PR as canary version:
21.10.0--canary.1210.9f5143c2fbd5e614f57580d3b34852bfe6ffa12e.0
✨ Test out this PR locally via:
npm install @infineon/infineon-design-system-stencil@21.10.0--canary.1210.9f5143c2fbd5e614f57580d3b34852bfe6ffa12e.0 # or yarn add @infineon/infineon-design-system-stencil@21.10.0--canary.1210.9f5143c2fbd5e614f57580d3b34852bfe6ffa12e.0