@lukso/transaction-view-core 0.5.0-dev.a98e9bc → 0.5.0-dev.c21633f

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,5 +1,5 @@
1
1
  import * as lit from 'lit';
2
- import { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
2
+ import { LitElement, ReactiveController, ReactiveControllerHost, TemplateResult } from 'lit';
3
3
  import { CoreLitElement } from '../styles/index.cjs';
4
4
  import { ImageResult, ImageLoadOptions, AddressImageData, UseTransactionViewOptions, ViewMatch } from '@lukso/transaction-view-headless';
5
5
  import { Signal } from '@preact/signals-core';
@@ -780,7 +780,7 @@ declare class ValueView extends CoreLitElement {
780
780
  * The value to display (required)
781
781
  * Can be string, number, boolean, or bigint
782
782
  */
783
- value?: string | number | boolean | bigint | null;
783
+ value?: TemplateResult | string | number | boolean | bigint | null;
784
784
  /**
785
785
  * The key name (used for special formatting logic)
786
786
  */
@@ -813,7 +813,7 @@ declare class ValueView extends CoreLitElement {
813
813
  /**
814
814
  * Optional label to show in card header
815
815
  */
816
- label?: string;
816
+ label?: string | TemplateResult;
817
817
  /**
818
818
  * Maximum width for truncation
819
819
  */
@@ -860,7 +860,7 @@ declare class ValueView extends CoreLitElement {
860
860
  * Handle value click
861
861
  */
862
862
  private handleClick;
863
- render(): lit.TemplateResult<1>;
863
+ render(): TemplateResult<1>;
864
864
  /** Whether to use monospace font for the value content */
865
865
  private getUseMonospace;
866
866
  /** Map size to a typography class for the label */
@@ -1,5 +1,5 @@
1
1
  import * as lit from 'lit';
2
- import { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
2
+ import { LitElement, ReactiveController, ReactiveControllerHost, TemplateResult } from 'lit';
3
3
  import { CoreLitElement } from '../styles/index.js';
4
4
  import { ImageResult, ImageLoadOptions, AddressImageData, UseTransactionViewOptions, ViewMatch } from '@lukso/transaction-view-headless';
5
5
  import { Signal } from '@preact/signals-core';
@@ -780,7 +780,7 @@ declare class ValueView extends CoreLitElement {
780
780
  * The value to display (required)
781
781
  * Can be string, number, boolean, or bigint
782
782
  */
783
- value?: string | number | boolean | bigint | null;
783
+ value?: TemplateResult | string | number | boolean | bigint | null;
784
784
  /**
785
785
  * The key name (used for special formatting logic)
786
786
  */
@@ -813,7 +813,7 @@ declare class ValueView extends CoreLitElement {
813
813
  /**
814
814
  * Optional label to show in card header
815
815
  */
816
- label?: string;
816
+ label?: string | TemplateResult;
817
817
  /**
818
818
  * Maximum width for truncation
819
819
  */
@@ -860,7 +860,7 @@ declare class ValueView extends CoreLitElement {
860
860
  * Handle value click
861
861
  */
862
862
  private handleClick;
863
- render(): lit.TemplateResult<1>;
863
+ render(): TemplateResult<1>;
864
864
  /** Whether to use monospace font for the value content */
865
865
  private getUseMonospace;
866
866
  /** Map size to a typography class for the label */
@@ -1995,6 +1995,8 @@ import { useAddressResolver as useAddressResolver4 } from "@lukso/transaction-vi
1995
1995
  import { html as html11 } from "lit";
1996
1996
  import { property as property11, state as state4 } from "lit/decorators.js";
1997
1997
  import { when } from "lit/directives/when.js";
1998
+
1999
+ // src/utils.ts
1998
2000
  function formatUnits(value, decimals = 18) {
1999
2001
  const divisor = 10n ** BigInt(decimals);
2000
2002
  const quotient = value / divisor;
@@ -2006,6 +2008,8 @@ function formatUnits(value, decimals = 18) {
2006
2008
  const trimmed = remainderStr.replace(/0+$/, "");
2007
2009
  return `${quotient}.${trimmed}`;
2008
2010
  }
2011
+
2012
+ // src/shared/value-view.ts
2009
2013
  var ValueView = class extends CoreLitElement {
2010
2014
  constructor() {
2011
2015
  super(...arguments);
@@ -2238,7 +2242,7 @@ var ValueView = class extends CoreLitElement {
2238
2242
  `;
2239
2243
  if (effectiveType === "currency") {
2240
2244
  const { numeric, symbol } = this.getCurrencyParts();
2241
- if (this.label && this.label.trim() !== "") {
2245
+ if (this.label) {
2242
2246
  headerText = this.label;
2243
2247
  contentTemplate = html11`
2244
2248
  <span class="inline-block overflow-hidden text-ellipsis whitespace-nowrap min-w-0 ${this.getNumericClass()}">${numeric}</span>