@lukso/transaction-view-core 0.5.0-dev.a98e9bc → 0.5.0-dev.f500300
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.
- package/.turbo/turbo-build.log +15 -15
- package/dist/index.cjs +85 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +85 -54
- package/dist/index.js.map +1 -1
- package/dist/shared/index.cjs +5 -1
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.d.cts +4 -4
- package/dist/shared/index.d.ts +4 -4
- package/dist/shared/index.js +5 -1
- package/dist/shared/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/asset-card.ts +61 -58
- package/src/shared/image-list.ts +0 -1
- package/src/shared/value-view.ts +5 -19
- package/src/utils.test.ts +47 -0
- package/src/utils.ts +82 -0
package/dist/shared/index.d.cts
CHANGED
|
@@ -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():
|
|
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 */
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -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():
|
|
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 */
|
package/dist/shared/index.js
CHANGED
|
@@ -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
|
|
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>
|