Skclusive.Material.Component icon indicating copy to clipboard operation
Skclusive.Material.Component copied to clipboard

Missing component: Tooltip

Open esso23 opened this issue 5 years ago • 5 comments

Can't find the Tooltip component. I wanna make sure it's not just me being unable to find it. If it's not the case I would try implementing it.

esso23 avatar Apr 06 '20 22:04 esso23

great. it is not yet available. please go ahead and implement.

currently components support title attribute which can be used to get native Tooltip.

we would need to implement the way implemented in material-ui https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Tooltip/Tooltip.js

I guess the Tooltip component depends on one more important component https://github.com/mui-org/material-ui/tree/master/packages/material-ui/src/Popper. so we would need to implement this also.

And finally we would like to create demos and documentation as here.

https://material-ui.com/components/tooltips/

I am glad that you are interest to contribute. thanks. please proceed.

skclusive avatar Apr 07 '20 01:04 skclusive

@skclusive Hi, I'm currently working on this, but I have a problem. I'm not a JSInterop guru and I can't figure out how you include JS files without manually including them in _Host.cshtml. I currently have some JS bundled with popper.js source using rollup as it's done in Script project, but I don't know how to send that script to the client.

Any advice would be appreciated Thanks

esso23 avatar May 27 '20 19:05 esso23

@esso23 great. you can bundle popper.js and custom scripts and componentize the script content as component.

ex:

https://github.com/skclusive/Skclusive.Material.Component/blob/master/Script/src/ScriptHelpers/ScriptHelpersScript.cs

TooltipHelpersScript.cs

public class TooltipHelpersScript : Scripted
{
      public TooltipHelpersScript(): base("TooltipHelpersScript")
      {
      }

      protected override string GetScript()
      {
          return
            @"!function(){console.log('popper.js and custom introp minified bundled code')}();";
      }
}

then we could all the Tooltip related script component here.

https://github.com/skclusive/Skclusive.Material.Component/blob/master/Material/src/MaterialScripts.razor

MaterialScripts.razor

<ScriptHelpersScript />
<DomHelpersScript />
<TooltipHelpersScript />

this way it would be included by default. for standalone installation, we could document the 'TooltipHelpersScript' import.

let me know, if you require more details. excited and looking forward.

skclusive avatar May 28 '20 02:05 skclusive

Do you have some build tool to copy the script to the .cs file?

esso23 avatar May 28 '20 14:05 esso23

no. that would be good. but i used to manually copy.

skclusive avatar May 29 '20 02:05 skclusive