Closed aripddev closed 4 years ago
PF Extensions is meant as a proving grounds for useful components so this seems like a good candidate.
Since I am not good at creating advanced component, I will need your help. :)
Well the advice i can give is look at a component "like" it in PF or PFE and try to model it after that.
I added the component to PFE showcase in local and try to test it using it. Component pages are working well however component itself is not working due to RES_NOT_FOUND (fuzzysort.js and primefaces.fuzzysort.js)? Do you accept commits for PFE showcase?
@aripddev Look at how Calculator works. the files in resoures are 0-1- 2- 3-calculator.js.
Then in the pom.xml I have this...
<include>calculator/**</include>
Then in my Component I just reference 1 file called calculator.js
@ResourceDependency(library = "primefaces-extensions", name = "calculator/calculator.js")
We combine all JS files in order that is why we use 0- and 1- to order then and they will get put into 1 file.
And yes we accept PR's for Showcase as we will need examples of your new component!
Some notes on your showcase example. It doesn't show them being styled as these styles...
resultStyleClass="resultStyleClass1234" resultStyle="resultStyle1234"
don't exist? It should highlight what was "fuzzy" about this result.
The fuzzysort example i think should also be provided as an "Advanced Example"
Also my IDE is reporting that buttonStyle
is never used in the code. Can you confirm?
String buttonStyle = HTML.BUTTON_TEXT_ONLY_BUTTON_FLAT_CLASS;
if (size == 1) {
buttonStyle = buttonStyle + " ui-corner-all";
}
else if (idx == 0) {
buttonStyle = buttonStyle + " ui-corner-left";
}
else if (idx == (size - 1)) {
buttonStyle = buttonStyle + " ui-corner-right";
}
buttonStyle = selected ? buttonStyle + " ui-state-active" : buttonStyle;
buttonStyle = disabled ? buttonStyle + " ui-state-disabled" : buttonStyle;
I did not implement highlighting, and yes buttonStyle is not used.
OK i removed button styles...
OK I added highlighting as a new attribute. Updated Showcase example. Also added a new example of searching Timezones which are just Strings with no converters.
Also got the Input box styled to match PF theme.
Hi @melloware , I try to implement fuzzysort (https://github.com/farzher/fuzzysort) as PF component. It is a very fast javascript based search component for json data. Other alternatives are Lunr (http://lunrjs.com) and Fuse.js (https://fusejs.io). Do you think that this feature is appropriate for PF extensions?