Commit Graph
61 Commits
Author SHA1 Message Date
Luke 36662050ff chore: optimize imports 2023-11-15 15:32:04 +01:00
Luke 882e372895 feat(web): font awesome icon animations 2023-11-15 15:28:21 +01:00
Luke 7816ce7a33 fix(web): cap list menu width for long labeled items
resolves #350
2023-06-11 10:30:21 +02:00
renzuzuandLuke 8eca1698cb feat(web/meu): support images as icons in context and list menu (#230)
* feat: Support image Tag in buttons

in my server. ox_lib is heavily used.
most of sample use cases for this is.
Food image,
Ingredients,
Vehicle Parts,
etc..

i believe font awesome is not enough for some use cases.

i did suggest this on v3 pending PR.
but it seems gets ignored.

here i am gonna try to push this PR.

to use this.
icon must be not existing in the options.

if both icon and image is in options, nothing will appear.

image in metadata will still appear normaly.

* tweak(web/menu): resize render image comparable to FA

* refactor(web/context): use icon prop for images

* refactor(web/list): use icon prop for images

---------

Co-authored-by: Luke <39926192+LukeWasTakenn@users.noreply.github.com>
2023-02-19 13:53:48 +01:00
Luke 829bec2592 refactor(web): move all types into typings folder 2023-02-15 13:25:44 +01:00
Luke e68d8d311c refactor(web/menu): cap tooltip width 2023-01-10 21:44:36 +01:00
Luke d48b5e199b refactor(web/menu): list menu mantine rewrite 2023-01-02 13:45:19 +01:00
JagandLuke 34022ce81e fix(web/menu): combine initial select and first render checks (#172)
* fix(web/menu): Combine initial select and first render

* Combining these checks should fix an issue of having to toggle a checkbox multiple times before it is recognized as being toggled

* Change firstRenderRef current value before first menu movement

* Too many async on change functions are happening let's handle this once the user decides to interact with the menu

* fix(web/menu): remove first render ref check for onSelected

Co-authored-by: Luke <sabolukas03@gmail.com>
2022-12-14 18:59:49 +01:00
Luke e806781dde fix(web/menu): fix onSideScroll getting called on open
Potentially fixes an issue where if your first item in the menu was a side scroll the onSideScroll would get instantly called when opening
2022-12-08 11:23:49 +01:00
ItsANoBrainerandLuke a6f47cfe59 feat(web): context and list menu progress bars (#166)
* Initial Commit

Adds support for progress bars to items in both context and and list menus.

* Default Color Scheme & Description Weight

Added default color scheming, and made the description for context menues a lighter font weight for separating the title vs description better.

* iconColor to Menu & Small Syntax Changes

* Update Item.tsx

* fix(web/context): syntax error

also reformat with prettier

* chore(web/menu): reformat with prettier

Co-authored-by: Luke <sabolukas03@gmail.com>
2022-12-04 10:33:25 +01:00
Luke 39668aa26a fix(web/menu): fix button tooltip not displaying on side scroll button 2022-11-12 13:58:34 +01:00
Luke 765fff3598 fix(web/menu): show values description without requiring button desc 2022-10-30 10:16:28 +01:00
Luke 00465d2e7a perf(web/menu): memoize button and header components
Drops the render times for a 9 button menu down from 12ms to 1.6ms
2022-10-29 16:15:58 +02:00
Luke 6b8cfa990f fix(web/menu): fix vertical icon alignment 2022-10-29 16:00:35 +02:00
Luke 9cc7b9270e refactor(web/menu)!: pass scrollIndex or checked in the same value
If the button is a scroll button then `isScroll` is passed into args, if a button is a checkbox then `isCheck` is passed into args.

Requires `args` to always be of type `table`
2022-10-29 15:55:08 +02:00
Luke c227282ce0 refactor(web/menu): update checkbox styling 2022-10-29 15:55:08 +02:00
BerkieBb 5ba1a3b8f9 feat(interface/menu): checkbox
feat(package/interface/menu): checkbox
feat(web/menu/list): checkbox
feat(web/menu/list): checkbox option for ListItem
feat(web/menu/list): custom checkbox
2022-10-29 15:55:08 +02:00
Jag de23227ea7 fix(web/menu): move firstRengerRef check earlier in the function (#145)
* This fixes a case where, if the first option selected in a menu doesn't have side scroll values, the first time that you *did* side scroll on an item in that menu it would no trigger onSideScroll
2022-10-29 10:11:40 +02:00
Luke 1127108fcd feat(web/menu): add description support on list items 2022-10-27 10:09:48 +02:00
BerkieBbandLuke 5c34948528 fix(web/menu): don't call onSideScroll when opening the menu (#123)
* fix(web/features/menu/list): don't call onSideScroll when opening the menu

* refactor(web/menu): use conventional ref naming

Conventional ref variable names contain the word `ref` or `refs` if it's an array

Co-authored-by: Luke <sabolukas03@gmail.com>
2022-10-11 14:26:59 +02:00
BerkieBb 16aeed6027 fix(web/features/menu/list): force close menu when using the nui event 2022-09-29 16:08:26 +02:00
BerkieBb 6579d52c7c feat(web/menu/list): keyPressed on closeMenu 2022-09-25 14:24:45 +02:00
Jag 47163748d5 feat(menu): Open Menu with specified item index selected
* Allows a user to pass in a start index to have pre-selected when a menu is opening
* Cleaned up whitespace inconsistencies in menu.lua
2022-09-17 11:03:10 -07:00
Luke 5d4eff8cd3 fix(web/menu): fix misalignment on the list buttons in the menu 2022-09-09 13:04:31 +02:00
Luke 336a16baed feat(web): add ability to not be able to close menu 2022-09-08 10:26:35 +02:00
Luke 4a5251b60b chore(web): add prettier and format 2022-08-27 15:58:36 +02:00
Luke 0bc185ef38 feat(web): developer drawer
Move all debug functions into a single developer drawer,

Not the best implementation as there is focus fighting going on between some elements and the drawer but will do for now without state management
2022-08-27 15:40:41 +02:00
Luke 14a04c4b68 fix(web/menu): fix border radius not applying when there is 6 options 2022-08-05 14:00:44 +02:00
Luke 4490b4476c fix(web/menu): offset default index
Linden's amazin' index fix
2022-08-04 15:04:49 +02:00
Luke 32a698c043 feat(menu): lib.hideMenu 2022-08-04 15:04:49 +02:00
Luke cf2c45687a refactor(menu): split side and vertical scroll change handlers
Resolves an issue where changing to the next button while scrolling a horizontal list would not trigger the onChange function for the previous button
2022-08-04 15:04:49 +02:00
Luke 37c10f570b feat(client/interface): menu close arg on button 2022-08-04 15:04:49 +02:00
Luke a4b25bddf0 feat(web/menu): allow passing default index for horizontal lists 2022-08-04 15:04:49 +02:00
Luke 34fe33000f feat(web/menu): display arrow when menu is scrollable 2022-08-04 15:04:49 +02:00
Luke dcce65d472 feat(web/menu): reset indexes on next last item 2022-08-04 15:04:49 +02:00
Luke 95201aba1d fix(web/menu): use same font for tooltip 2022-08-04 15:04:49 +02:00
Luke 2def3ba7b3 fix(web/menu): don't render no label buttons 2022-08-04 15:04:49 +02:00
Luke fd8b3c9862 fix(web/menu): fix scrolling clipping menu items 2022-08-04 15:04:49 +02:00
Luke ed3e7ac733 feat(web/menu): include backspace in close keys 2022-08-04 15:04:49 +02:00
Luke ce0bea3259 fix(web/menu): set selected index to 0 on menu open 2022-08-04 15:04:49 +02:00
Luke 7b147b04fc feat(web/menu): tooltip description support 2022-08-04 15:04:49 +02:00
Luke 4236dd2bfd feat(web/menu): exit listener and onClose function 2022-08-04 15:04:49 +02:00
Luke 6ef17e83f5 feat(web/menu): visibility handling 2022-08-04 15:04:49 +02:00
Luke e97bd98726 fix(web/menu): fix selected value focus getting stuck on another menu 2022-08-04 15:04:49 +02:00
Luke 31d582df9c fix(web/menu): fix not being able to press enter on first button index 2022-08-04 15:04:49 +02:00
Luke d48ca25c7b feat(web/menu): initial list menu Lua api 2022-08-04 15:04:49 +02:00
Luke aa9b1334f2 fix(web/menu): debounce menu item selected callback 2022-08-04 15:04:49 +02:00
Luke a2b5ccb354 feat(web/menu): confirm on enter callback 2022-08-04 15:04:49 +02:00
Luke 6d52ecf985 feat(web/menu): fetchnui on item change 2022-08-04 15:04:49 +02:00
Luke 4744df337f feat(web/menu): add current and max option count into the list button 2022-08-04 15:04:49 +02:00