@fluid-topics/ft-tooltip 1.3.48 → 1.3.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,12 @@
1
1
  import { PropertyValues } from "lit";
2
- import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
2
+ import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
3
3
  import { FtTooltipProperties, Position } from "./ft-tooltip.properties";
4
- export declare class FtTooltip extends FtLitElement implements FtTooltipProperties {
4
+ import { I18nAttributeValue } from "@fluid-topics/ft-i18n/build/decorators/i18nAttribute";
5
+ import { FtLitElementWithI18n } from "@fluid-topics/ft-i18n";
6
+ export declare class FtTooltip extends FtLitElementWithI18n implements FtTooltipProperties {
5
7
  static elementDefinitions: ElementDefinitionsMap;
6
8
  static styles: import("lit").CSSResult;
7
- text: string;
9
+ text?: I18nAttributeValue;
8
10
  manual: boolean;
9
11
  inline: boolean;
10
12
  delay: number;
@@ -6,14 +6,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html } from "lit";
8
8
  import { property, query, queryAssignedNodes, state } from "lit/decorators.js";
9
- import { Debouncer, designSystemVariables, eventPathContainsMatchingElement, FtLitElement, jsonProperty, numberProperty } from "@fluid-topics/ft-wc-utils";
10
- import { FtTypography } from "@fluid-topics/ft-typography";
9
+ import { Debouncer, designSystemVariables, eventPathContainsMatchingElement, jsonProperty, numberProperty } from "@fluid-topics/ft-wc-utils";
10
+ import { FtTypography, FtTypographyVariants } from "@fluid-topics/ft-typography";
11
11
  import { styles } from "./ft-tooltip.styles";
12
12
  import { computeOffsetPosition } from "@fluid-topics/ft-wc-utils/build/floating";
13
- class FtTooltip extends FtLitElement {
13
+ import { i18nAttribute } from "@fluid-topics/ft-i18n/build/decorators/i18nAttribute";
14
+ import { FtLitElementWithI18n } from "@fluid-topics/ft-i18n";
15
+ class FtTooltip extends FtLitElementWithI18n {
14
16
  constructor() {
15
17
  super(...arguments);
16
- this.text = "";
17
18
  this.manual = false;
18
19
  this.inline = false;
19
20
  this.delay = 500;
@@ -60,6 +61,7 @@ class FtTooltip extends FtLitElement {
60
61
  return this.validPositions.has(this.position) ? this.position : "bottom";
61
62
  }
62
63
  render() {
64
+ var _a, _b;
63
65
  return html `
64
66
  <div part="container"
65
67
  class="ft-tooltip--container ${this.inline ? "ft-tooltip--inline" : ""}">
@@ -69,7 +71,9 @@ class FtTooltip extends FtLitElement {
69
71
  ?hidden=${!this.visible}>
70
72
  <div part="tooltip-content" class="ft-tooltip--content">
71
73
  <slot name="text"></slot>
72
- <ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
74
+ <ft-typography variant="${FtTypographyVariants.caption}" ?hidden=${!((_a = this.text) === null || _a === void 0 ? void 0 : _a.message)}>
75
+ ${(_b = this.text) === null || _b === void 0 ? void 0 : _b.message}
76
+ </ft-typography>
73
77
  </div>
74
78
  </div>
75
79
  </div>
@@ -139,7 +143,7 @@ class FtTooltip extends FtLitElement {
139
143
  const manualCurrentValue = this.manual;
140
144
  this.manual = true;
141
145
  const currentText = this.text;
142
- this.text = text;
146
+ this.text = { message: text };
143
147
  await this.show(duration);
144
148
  this.text = currentText;
145
149
  this.manual = manualCurrentValue;
@@ -211,7 +215,7 @@ FtTooltip.elementDefinitions = {
211
215
  };
212
216
  FtTooltip.styles = styles;
213
217
  __decorate([
214
- property()
218
+ i18nAttribute()
215
219
  ], FtTooltip.prototype, "text", void 0);
216
220
  __decorate([
217
221
  property({ type: Boolean })