diff --git a/src/components.d.ts b/src/components.d.ts index f0f60b6..b0586c7 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -31,6 +31,7 @@ export namespace Components { interface WcElixirUtilsNewService { "apiUrl": string; "authToken": string; + "description": "icon"|"text"|"none"; "schema": string; } interface WcElixirUtilsServiceList { @@ -153,6 +154,7 @@ declare namespace LocalJSX { interface WcElixirUtilsNewService { "apiUrl"?: string; "authToken"?: string; + "description"?: "icon"|"text"|"none"; "schema"?: string; } interface WcElixirUtilsServiceList { diff --git a/src/components/wc-elixir-utils-new-service/wc-elixir-utils-new-service.css b/src/components/wc-elixir-utils-new-service/wc-elixir-utils-new-service.css index 5d4e87f..01b5a27 100644 --- a/src/components/wc-elixir-utils-new-service/wc-elixir-utils-new-service.css +++ b/src/components/wc-elixir-utils-new-service/wc-elixir-utils-new-service.css @@ -1,3 +1,40 @@ :host { display: block; } +.tooltip { + position: relative; + display: inline-block; +} + +.tooltip .tooltiptext { + visibility: hidden; + width: 50vw; + background-color: black; + color: #fff; + text-align: center; + border-radius: 6px; + padding: 5px 0; + position: absolute; + z-index: 1; + bottom: 100%; + left: 0vw; + margin-left: -60px; + + /* Fade in tooltip - takes 1 second to go from 0% to 100% opac: */ + opacity: 0; + transition: opacity 1s; +} +.tooltip .tooltiptext::after { + content: ""; + position: absolute; + top: 50%; + right: 100%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: black transparent transparent transparent; +} +.tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; +} diff --git a/src/components/wc-elixir-utils-new-service/wc-elixir-utils-new-service.tsx b/src/components/wc-elixir-utils-new-service/wc-elixir-utils-new-service.tsx index 0f718d1..a1700d4 100644 --- a/src/components/wc-elixir-utils-new-service/wc-elixir-utils-new-service.tsx +++ b/src/components/wc-elixir-utils-new-service/wc-elixir-utils-new-service.tsx @@ -10,6 +10,7 @@ export class WcElixirUtilsNewService { @Prop() apiUrl: string; @Prop() schema: string; @Prop() authToken: string; + @Prop() description: "icon"|"text"|"none" = "icon"; @State() fields: any; @State() data: string = "loading"; @@ -73,8 +74,18 @@ export class WcElixirUtilsNewService {