-
Notifications
You must be signed in to change notification settings - Fork 137
Platform: Select Component Technical Design
Dropdown component with various attributes:
<fdp-select
[btnType]='default|noborder|regular'
[glyph]='filter'
[compact]='true|false'
[(value)]="selectedvalue"
[disabled]='true|false'
[maxHeight]="'250px'"
[dropDownValues]="options">
</fdp-select>Property Bindings
btnType: string
The "btnType" property allows the user to set the type of select button from the 3 options available.
glyph: string
The "glyph" property accepts a strings as input, and uses these values to populate the type of icon which is dynamically defined.
compact: string
The "compact" property accepts a boolean as input, property set the select box to compact size.
value: any
The "value" property accepts any data type as input from the based on the clicked item from the options given.
maxHeight: string
The "maxHeight" property sets the vertical height of the search input component. The size. can be configured according to the user preference.
This is an optional field. when in default it takes 250px as height.
disabled: boolean
The "disabled" property is an bolean which are used to disable or enable the select dropdown for selection.
If the "disabled" property is set, then the select button and dropdown menu will be disabled by default the select box will be enabled.
Event Bindings
isOpenChangeHandle(isOpen: boolean): void
The "isOpenChangeHandle" event binding emits an event with a Select payload, whenever the user clicks on the select dropwon isopen value is changed to true and reset the value after the option is clicked.
The following components and/or directives from @fundamental-ngx/core will be used:
Frank:
-
Besides having instantiable component we want to also hide as much as we can inside. So the expection is we pass list of choices and dropdown will render
-
What is button Type binding?
-
Each input will have a
valuewhich you have and those one that accept list of choices will have also binding[list]to pass list of object to work with- we can have more contentual naming so for this case we can have
[options]
- we can have more contentual naming so for this case we can have
-
We should not only support
string[]but also complex object to be passed in.- Try to think you are able to pass list of e.g.
Invoicesand how you can set initial object how you can match with list of items - When you click on item you will pass the selected object
- Try to think you are able to pass list of e.g.
-
Since the
ngForwith option items will be hidden inside we need to emit selection event -
We should also allow to customize the rendering item in the LIST, as well as the actuall selected item
- we can use
<ng-tamplate>for this
- we can use
-
Dropdown (selects) usually needs to support no-option support, where you either have only list of option to pick from or also some
--empty value -
Select usually represent single selection of a few options, what about multiselection? How are we going to handle those ?
-
Since this is input we need to support
id -
I woudl support event emmiting not only on selection but also on opening/closing
-
Also support programatic approach like
coremake sure we have the methods close/open - simple toggle -
Why do we need to set
maxHeightheigh must stay- we should have a
scrollHeightthat tells how the overlay is high when you should scrolling
- we should have a
-
You should not call
isOpenChangeHandle- thehandleis usually the one who is handling this event- For this you want more
openedChange: EventEmitter<boolean>
- For this you want more
-
just like with the other controls we dont need to say
[compact]='true|falseas this does not scale for hte future as we have only 2 sizes, let's have bindingsizewith two sizes -
Let's think about
zIndexsometimes we show inputs fields inside some context where has already hight zIndex and shown overlay might be hidden