@nvidia-elements/core 0.0.11 → 0.1.0
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/CHANGELOG.md +40 -0
- package/dist/accordion/accordion2.js +4 -4
- package/dist/alert/alert-group2.js +1 -1
- package/dist/alert/alert2.js +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar2.js +1 -1
- package/dist/badge/badge2.js +1 -1
- package/dist/breadcrumb/breadcrumb2.js +1 -1
- package/dist/bundle.d.ts +1 -0
- package/dist/bundles/index.d.ts +86 -0
- package/dist/bundles/index.js +4 -4
- package/dist/button/button2.js +1 -1
- package/dist/button-group/button-group.d.ts +1 -1
- package/dist/button-group/button-group2.js +1 -1
- package/dist/button-group/button-group2.js.map +1 -1
- package/dist/card/card2.js +4 -4
- package/dist/chat-message/chat-message2.js +1 -1
- package/dist/checkbox/checkbox-group2.js +1 -1
- package/dist/checkbox/checkbox2.js +1 -1
- package/dist/color/color2.js +1 -1
- package/dist/combobox/combobox2.js +1 -1
- package/dist/copy-button/copy-button2.js +1 -1
- package/dist/custom-elements-jsx.d.ts +51 -1
- package/dist/custom-elements-vue.d.ts +51 -1
- package/dist/custom-elements.json +790 -4
- package/dist/data.html.json +121 -3
- package/dist/data.snippets.json +2 -2
- package/dist/date/date2.js +1 -1
- package/dist/datetime/datetime2.js +1 -1
- package/dist/dialog/dialog-footer2.js +1 -1
- package/dist/dialog/dialog-header2.js +1 -1
- package/dist/dialog/dialog2.js +1 -1
- package/dist/divider/divider2.js +1 -1
- package/dist/dot/dot2.js +1 -1
- package/dist/drawer/drawer-content2.js +1 -1
- package/dist/drawer/drawer-footer2.js +1 -1
- package/dist/drawer/drawer-header2.js +1 -1
- package/dist/drawer/drawer2.js +1 -1
- package/dist/dropdown/dropdown-footer2.js +1 -1
- package/dist/dropdown/dropdown-header2.js +1 -1
- package/dist/dropdown/dropdown2.js +1 -1
- package/dist/dropdown-group/dropdown-group.js +1 -1
- package/dist/dropzone/dropzone2.js +1 -1
- package/dist/file/file2.js +1 -1
- package/dist/format-datetime/format-datetime2.js +1 -1
- package/dist/format-number/define.d.ts +6 -0
- package/dist/format-number/define.js +7 -0
- package/dist/format-number/define.js.map +1 -0
- package/dist/format-number/format-number.d.ts +87 -0
- package/dist/format-number/format-number.examples.js +6 -0
- package/dist/format-number/format-number.examples.js.map +1 -0
- package/dist/format-number/format-number.examples.json +87 -0
- package/dist/format-number/format-number.js +6 -0
- package/dist/format-number/format-number.js.map +1 -0
- package/dist/format-number/format-number2.js +111 -0
- package/dist/format-number/format-number2.js.map +1 -0
- package/dist/format-number/index.d.ts +1 -0
- package/dist/format-number/index.js +2 -0
- package/dist/format-relative-time/format-relative-time2.js +73 -53
- package/dist/format-relative-time/format-relative-time2.js.map +1 -1
- package/dist/forms/control/control2.js +1 -1
- package/dist/forms/control-group/control-group2.js +1 -1
- package/dist/forms/control-message/control-message2.js +1 -1
- package/dist/forms/validation.examples.js.map +1 -1
- package/dist/grid/cell/cell2.js +1 -1
- package/dist/grid/column/column2.js +1 -1
- package/dist/grid/footer/footer2.js +1 -1
- package/dist/grid/grid2.js +1 -1
- package/dist/grid/header/header2.js +1 -1
- package/dist/grid/placeholder/placeholder2.js +1 -1
- package/dist/grid/row/row2.js +1 -1
- package/dist/icon/icon2.js +2 -2
- package/dist/icon-button/icon-button2.js +1 -1
- package/dist/index.js +1 -1
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +1 -1
- package/dist/internal/services/global.service.js +1 -1
- package/dist/internal/utils/objects.js +17 -9
- package/dist/internal/utils/objects.js.map +1 -1
- package/dist/logo/logo.examples.js.map +1 -1
- package/dist/logo/logo.examples.json +4 -4
- package/dist/logo/logo2.js +1 -1
- package/dist/menu/menu-item2.js +1 -1
- package/dist/menu/menu.examples.js.map +1 -1
- package/dist/menu/menu.examples.json +3 -3
- package/dist/menu/menu2.js +1 -1
- package/dist/month/month2.js +1 -1
- package/dist/notification/notification-group2.js +1 -1
- package/dist/notification/notification2.js +1 -1
- package/dist/page/page-panel/page-panel-content2.js +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +1 -1
- package/dist/page/page-panel/page-panel-header2.js +1 -1
- package/dist/page/page-panel/page-panel2.js +1 -1
- package/dist/page/page.examples.js.map +1 -1
- package/dist/page/page.examples.json +1 -1
- package/dist/page/page2.js +1 -1
- package/dist/page-header/page-header2.js +1 -1
- package/dist/page-loader/page-loader2.js +1 -1
- package/dist/pagination/pagination2.js +1 -1
- package/dist/panel/panel2.js +4 -4
- package/dist/password/password2.js +1 -1
- package/dist/preferences-input/preferences-input.examples.js.map +1 -1
- package/dist/preferences-input/preferences-input.examples.json +1 -1
- package/dist/preferences-input/preferences-input2.js +1 -1
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-ring/progress-ring2.js +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +1 -1
- package/dist/pulse/pulse2.js +1 -1
- package/dist/radio/radio-group2.js +1 -1
- package/dist/radio/radio2.js +1 -1
- package/dist/range/range2.js +1 -1
- package/dist/resize-handle/resize-handle2.js +1 -1
- package/dist/search/search2.js +1 -1
- package/dist/select/select2.js +1 -1
- package/dist/skeleton/skeleton2.js +1 -1
- package/dist/sort-button/sort-button2.js +1 -1
- package/dist/sparkline/sparkline2.js +1 -1
- package/dist/star-rating/star-rating2.js +1 -1
- package/dist/steps/steps2.js +2 -2
- package/dist/switch/switch-group2.js +1 -1
- package/dist/switch/switch2.js +1 -1
- package/dist/tabs/tabs-group2.js +1 -1
- package/dist/tabs/tabs2.js +2 -2
- package/dist/tag/tag2.js +1 -1
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time2.js +1 -1
- package/dist/toast/toast2.js +1 -1
- package/dist/toggletip/toggletip-footer2.js +1 -1
- package/dist/toggletip/toggletip-header2.js +1 -1
- package/dist/toggletip/toggletip2.js +1 -1
- package/dist/toolbar/toolbar2.js +1 -1
- package/dist/tooltip/tooltip2.js +1 -1
- package/dist/tree/tree-node2.js +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/week/week2.js +1 -1
- package/package.json +16 -4
package/dist/button/button2.js
CHANGED
|
@@ -2,7 +2,7 @@ import { PropertyValues, LitElement } from 'lit';
|
|
|
2
2
|
import { KeynavListConfig, Interaction, Size } from '../internal';
|
|
3
3
|
/**
|
|
4
4
|
* @element nve-button-group
|
|
5
|
-
* @description A button group
|
|
5
|
+
* @description A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.
|
|
6
6
|
* @since 0.16.0
|
|
7
7
|
* @entrypoint \@nvidia-elements/core/button-group
|
|
8
8
|
* @slot - default slot for `nve-button` or `nve-icon-button`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group2.js","names":["#buttons","#syncStyleStates","#onClick","#selectButton"],"sources":["../../src/button-group/button-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues } from 'lit';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport type { KeynavListConfig, Interaction, Size } from '@nvidia-elements/core/internal';\nimport {\n attachInternals,\n keyNavigationList,\n useStyles,\n audit,\n appendRootNodeStyle\n} from '@nvidia-elements/core/internal';\nimport type { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { Button } from '@nvidia-elements/core/button';\nimport type { Divider } from '@nvidia-elements/core/divider';\nimport styles from './button-group.css?inline';\nimport globalStyles from './button-group.global.css?inline';\n\n/**\n * @element nve-button-group\n * @description A button group
|
|
1
|
+
{"version":3,"file":"button-group2.js","names":["#buttons","#syncStyleStates","#onClick","#selectButton"],"sources":["../../src/button-group/button-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues } from 'lit';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport type { KeynavListConfig, Interaction, Size } from '@nvidia-elements/core/internal';\nimport {\n attachInternals,\n keyNavigationList,\n useStyles,\n audit,\n appendRootNodeStyle\n} from '@nvidia-elements/core/internal';\nimport type { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { Button } from '@nvidia-elements/core/button';\nimport type { Divider } from '@nvidia-elements/core/divider';\nimport styles from './button-group.css?inline';\nimport globalStyles from './button-group.global.css?inline';\n\n/**\n * @element nve-button-group\n * @description A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.\n * @since 0.16.0\n * @entrypoint \\@nvidia-elements/core/button-group\n * @slot - default slot for `nve-button` or `nve-icon-button`\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --padding\n * @cssprop --gap\n * @cssprop --width\n * @cssprop --height\n * @cssprop --color\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/group_role\n */\n@audit()\n@keyNavigationList<ButtonGroup>()\nexport class ButtonGroup extends LitElement {\n /** @private */\n get keynavListConfig(): KeynavListConfig {\n return {\n items: this.#buttons,\n layout: this.orientation\n };\n }\n\n /** By default the button group is stateless. Add the `behavior-select` attribute and set to `single` or `multi` to enable stateful selction handling. */\n @property({ type: String, attribute: 'behavior-select' }) behaviorSelect: 'single' | 'multi';\n\n /** Set the style of the button group using the `container` property. Options are the default display when omitting the attribute, `flat` or `rounded`. */\n @property({ type: String, reflect: true }) container?: 'flat' | 'rounded';\n\n /** Determines the orientation direction of the group. Vertical groups support icon buttons only. */\n @property({ type: String, reflect: true }) orientation?: 'horizontal' | 'vertical' = 'horizontal';\n\n /** Use the `interaction` property on `button-group` in combination with `divider` for color-coded split buttons */\n @property({ type: String, reflect: true }) interaction: Interaction;\n\n /** Determines size of button */\n @property({ type: String, reflect: true }) size?: Size;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-button-group',\n version: '0.0.0',\n children: ['nve-button', 'nve-icon-button', 'nve-divider']\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n @queryAssignedElements({ selector: 'nve-divider' }) private dividers!: Divider[];\n\n @queryAssignedElements({ selector: 'nve-icon-button' }) private iconButtons!: IconButton[];\n\n @queryAssignedElements({ selector: 'nve-button' }) private buttons!: Button[];\n\n get #buttons() {\n return [...this.iconButtons, ...this.buttons];\n }\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${this.#syncStyleStates}></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n appendRootNodeStyle(this, globalStyles);\n this._internals.role = 'group';\n this.addEventListener('click', this.#onClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#onClick);\n }\n\n #onClick = (e: Event) => this.#selectButton(e.target as HTMLElement & { pressed?: boolean });\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n this.#syncStyleStates();\n }\n\n #syncStyleStates() {\n if (this.container === 'flat') {\n this.#buttons.forEach(btn => (btn.container = 'flat'));\n }\n\n if (this.interaction) {\n this.#buttons.forEach(btn => (btn.interaction = this.interaction));\n }\n\n this.dividers.length ? this._internals.states.add('split') : this._internals.states.delete('split');\n }\n\n #selectButton(button: HTMLElement & { pressed?: boolean }) {\n if (!button.matches?.('nve-button, nve-icon-button')) {\n return;\n }\n\n if (this.behaviorSelect === 'single') {\n this.#buttons.forEach(i => (i.pressed = false));\n button.pressed = true;\n } else if (this.behaviorSelect === 'multi') {\n button.pressed = !button.pressed;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAsCO,IAAA,IAAA,cAA0B,EAAW;;kCAgB2C;;CAdrF,IAAI,mBAAqC;AACvC,SAAO;GACL,OAAO,MAAA;GACP,QAAQ,KAAK;GACd;;;gBAkBa,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACT,UAAU;IAAC;IAAc;IAAmB;;GAC7C;;CAWD,KAAA,IAAe;AACb,SAAO,CAAC,GAAG,KAAK,aAAa,GAAG,KAAK,QAAQ;;CAG/C,SAAS;AACP,SAAO,CAAI,yCAEa,MAAA,EAAsB;;CAKhD,oBAAoB;AAKlB,EAJA,MAAM,mBAAmB,EACzB,EAAgB,KAAK,EACrB,EAAoB,MAAM,EAAa,EACvC,KAAK,WAAW,OAAO,SACvB,KAAK,iBAAiB,SAAS,MAAA,EAAc;;CAG/C,uBAAuB;AAErB,EADA,MAAM,sBAAsB,EAC5B,KAAK,oBAAoB,SAAS,MAAA,EAAc;;CAGlD,MAAY,MAAa,MAAA,EAAmB,EAAE,OAA8C;CAE5F,QAAQ,GAA6B;AAEnC,EADA,MAAM,QAAQ,EAAM,EACpB,MAAA,GAAuB;;CAGzB,KAAmB;AASjB,EARI,KAAK,cAAc,UACrB,MAAA,EAAc,SAAQ,MAAQ,EAAI,YAAY,OAAQ,EAGpD,KAAK,eACP,MAAA,EAAc,SAAQ,MAAQ,EAAI,cAAc,KAAK,YAAa,EAGpE,KAAK,SAAS,SAAS,KAAK,WAAW,OAAO,IAAI,QAAQ,GAAG,KAAK,WAAW,OAAO,OAAO,QAAQ;;CAGrG,GAAc,GAA6C;AACpD,IAAO,UAAU,8BAA8B,KAIhD,KAAK,mBAAmB,YAC1B,MAAA,EAAc,SAAQ,MAAM,EAAE,UAAU,GAAO,EAC/C,EAAO,UAAU,MACR,KAAK,mBAAmB,YACjC,EAAO,UAAU,CAAC,EAAO;;;GApF5B,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAmB,CAAC,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA,KAGxD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,aAAA,KAAA,EAAA,KAGzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAGzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAGzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAazC,EAAsB,EAAE,UAAU,eAAe,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAElD,EAAsB,EAAE,UAAU,mBAAmB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAEtD,EAAsB,EAAE,UAAU,cAAc,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,SAzCnD,GAAO,EACP,GAAgC,CAAA,EAAA,EAAA"}
|
package/dist/card/card2.js
CHANGED
|
@@ -16,7 +16,7 @@ var d = class extends c {
|
|
|
16
16
|
static {
|
|
17
17
|
this.metadata = {
|
|
18
18
|
tag: "nve-card",
|
|
19
|
-
version: "0.0
|
|
19
|
+
version: "0.1.0"
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
@@ -37,7 +37,7 @@ var f = class extends c {
|
|
|
37
37
|
static {
|
|
38
38
|
this.metadata = {
|
|
39
39
|
tag: "nve-card-header",
|
|
40
|
-
version: "0.0
|
|
40
|
+
version: "0.1.0",
|
|
41
41
|
parents: ["nve-card"]
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -53,7 +53,7 @@ var p = class extends c {
|
|
|
53
53
|
static {
|
|
54
54
|
this.metadata = {
|
|
55
55
|
tag: "nve-card-content",
|
|
56
|
-
version: "0.0
|
|
56
|
+
version: "0.1.0",
|
|
57
57
|
parents: ["nve-card"]
|
|
58
58
|
};
|
|
59
59
|
}
|
|
@@ -72,7 +72,7 @@ var m = class extends c {
|
|
|
72
72
|
static {
|
|
73
73
|
this.metadata = {
|
|
74
74
|
tag: "nve-card-footer",
|
|
75
|
-
version: "0.0
|
|
75
|
+
version: "0.1.0",
|
|
76
76
|
parents: ["nve-card"]
|
|
77
77
|
};
|
|
78
78
|
}
|
package/dist/color/color2.js
CHANGED
|
@@ -1249,6 +1249,45 @@ Preset styles take precedence over granular date and time part options. */
|
|
|
1249
1249
|
"nve-text"?: string;
|
|
1250
1250
|
};
|
|
1251
1251
|
|
|
1252
|
+
export type FormatNumberProps = {
|
|
1253
|
+
/** Optional numeric string for values supplied by JavaScript or bound data.
|
|
1254
|
+
By default, the component formats the element's text content, which also serves as the SSR fallback.
|
|
1255
|
+
When both are present, this property takes precedence. */
|
|
1256
|
+
number?: string | "default";
|
|
1257
|
+
/** Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default. */
|
|
1258
|
+
locale?: string | "default";
|
|
1259
|
+
/** Formatting style: 'decimal' | 'currency' | 'percent' | 'unit'. */
|
|
1260
|
+
"format-style"?: "decimal" | "currency" | "percent" | "unit";
|
|
1261
|
+
/** ISO 4217 currency code (such as USD or EUR). Required when formatStyle is currency. */
|
|
1262
|
+
currency?: string | "default";
|
|
1263
|
+
/** Currency sign style: 'standard' | 'accounting'. */
|
|
1264
|
+
"currency-sign"?: "standard" | "accounting" | "default";
|
|
1265
|
+
/** Currency display style: 'symbol' | 'code' | 'name' | 'narrowSymbol'. */
|
|
1266
|
+
"currency-display"?: "symbol" | "code" | "name" | "narrowSymbol" | "default";
|
|
1267
|
+
/** Unit identifier (such as kilometer or byte). Required when formatStyle is unit. */
|
|
1268
|
+
unit?: string | "default";
|
|
1269
|
+
/** Unit display style: 'short' | 'long' | 'narrow'. */
|
|
1270
|
+
"unit-display"?: "short" | "long" | "narrow" | "default";
|
|
1271
|
+
/** Number notation: 'standard' | 'scientific' | 'engineering' | 'compact'. */
|
|
1272
|
+
notation?: "standard" | "scientific" | "engineering" | "compact" | "default";
|
|
1273
|
+
/** Compact notation display: 'short' | 'long'. Only applies when notation is compact. */
|
|
1274
|
+
"compact-display"?: "short" | "long" | "default";
|
|
1275
|
+
/** Sign display: 'auto' | 'never' | 'always' | 'exceptZero'. */
|
|
1276
|
+
"sign-display"?: "auto" | "never" | "always" | "exceptZero" | "default";
|
|
1277
|
+
/** Grouping separators: 'auto' | 'always' | 'min2' | 'true' | 'false'. */
|
|
1278
|
+
"use-grouping"?: string | "default";
|
|
1279
|
+
/** Pad fraction output to at least this many digits (0-20). */
|
|
1280
|
+
"minimum-fraction-digits"?: number | "default";
|
|
1281
|
+
/** Round fraction output to at most this many digits (0-20). */
|
|
1282
|
+
"maximum-fraction-digits"?: number | "default";
|
|
1283
|
+
/** Pad integer output to at least this many digits (1-21). */
|
|
1284
|
+
"minimum-integer-digits"?: number | "default";
|
|
1285
|
+
/** @deprecated - not supported on custom element tags */
|
|
1286
|
+
"nve-layout"?: string;
|
|
1287
|
+
/** @deprecated - not supported on custom element tags */
|
|
1288
|
+
"nve-text"?: string;
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1252
1291
|
export type FormatRelativeTimeProps = {
|
|
1253
1292
|
/** Optional date string for values supplied by JavaScript or bound data.
|
|
1254
1293
|
By default, the component formats the element's text content, which also serves as the SSR fallback.
|
|
@@ -4053,7 +4092,7 @@ export type CustomElements = {
|
|
|
4053
4092
|
"nve-breadcrumb": Partial<BreadcrumbProps & BaseProps & BaseEvents>;
|
|
4054
4093
|
|
|
4055
4094
|
/**
|
|
4056
|
-
* A button group
|
|
4095
|
+
* A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.
|
|
4057
4096
|
* ---
|
|
4058
4097
|
*
|
|
4059
4098
|
*
|
|
@@ -4765,6 +4804,17 @@ export type CustomElements = {
|
|
|
4765
4804
|
*/
|
|
4766
4805
|
"nve-format-datetime": Partial<FormatDatetimeProps & BaseProps & BaseEvents>;
|
|
4767
4806
|
|
|
4807
|
+
/**
|
|
4808
|
+
* A localized number formatter for currencies, percentages, units, and compact notation, backed by Intl.NumberFormat.
|
|
4809
|
+
* Provide a `currency` attribute when `formatStyle` is `currency`, and a `unit` attribute when `formatStyle` is `unit`.
|
|
4810
|
+
* ---
|
|
4811
|
+
*
|
|
4812
|
+
*
|
|
4813
|
+
* ### **Slots:**
|
|
4814
|
+
* - _default_ - Numeric string to format (such as 1234567 or 1234.56). Serves as fallback before hydration.
|
|
4815
|
+
*/
|
|
4816
|
+
"nve-format-number": Partial<FormatNumberProps & BaseProps & BaseEvents>;
|
|
4817
|
+
|
|
4768
4818
|
/**
|
|
4769
4819
|
* Formats a date/time value as localized relative text using the Intl.RelativeTimeFormat API. Renders inside a semantic time element.
|
|
4770
4820
|
* Options mirror the Intl.RelativeTimeFormat API. When unit is 'auto', the component selects the best unit based on the time difference.
|
|
@@ -1176,6 +1176,45 @@ Preset styles take precedence over granular date and time part options. */
|
|
|
1176
1176
|
"nve-text"?: string;
|
|
1177
1177
|
};
|
|
1178
1178
|
|
|
1179
|
+
type FormatNumberProps = {
|
|
1180
|
+
/** Optional numeric string for values supplied by JavaScript or bound data.
|
|
1181
|
+
By default, the component formats the element's text content, which also serves as the SSR fallback.
|
|
1182
|
+
When both are present, this property takes precedence. */
|
|
1183
|
+
number?: string | "default";
|
|
1184
|
+
/** Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default. */
|
|
1185
|
+
locale?: string | "default";
|
|
1186
|
+
/** Formatting style: 'decimal' | 'currency' | 'percent' | 'unit'. */
|
|
1187
|
+
"format-style"?: "decimal" | "currency" | "percent" | "unit";
|
|
1188
|
+
/** ISO 4217 currency code (such as USD or EUR). Required when formatStyle is currency. */
|
|
1189
|
+
currency?: string | "default";
|
|
1190
|
+
/** Currency sign style: 'standard' | 'accounting'. */
|
|
1191
|
+
"currency-sign"?: "standard" | "accounting" | "default";
|
|
1192
|
+
/** Currency display style: 'symbol' | 'code' | 'name' | 'narrowSymbol'. */
|
|
1193
|
+
"currency-display"?: "symbol" | "code" | "name" | "narrowSymbol" | "default";
|
|
1194
|
+
/** Unit identifier (such as kilometer or byte). Required when formatStyle is unit. */
|
|
1195
|
+
unit?: string | "default";
|
|
1196
|
+
/** Unit display style: 'short' | 'long' | 'narrow'. */
|
|
1197
|
+
"unit-display"?: "short" | "long" | "narrow" | "default";
|
|
1198
|
+
/** Number notation: 'standard' | 'scientific' | 'engineering' | 'compact'. */
|
|
1199
|
+
notation?: "standard" | "scientific" | "engineering" | "compact" | "default";
|
|
1200
|
+
/** Compact notation display: 'short' | 'long'. Only applies when notation is compact. */
|
|
1201
|
+
"compact-display"?: "short" | "long" | "default";
|
|
1202
|
+
/** Sign display: 'auto' | 'never' | 'always' | 'exceptZero'. */
|
|
1203
|
+
"sign-display"?: "auto" | "never" | "always" | "exceptZero" | "default";
|
|
1204
|
+
/** Grouping separators: 'auto' | 'always' | 'min2' | 'true' | 'false'. */
|
|
1205
|
+
"use-grouping"?: string | "default";
|
|
1206
|
+
/** Pad fraction output to at least this many digits (0-20). */
|
|
1207
|
+
"minimum-fraction-digits"?: number | "default";
|
|
1208
|
+
/** Round fraction output to at most this many digits (0-20). */
|
|
1209
|
+
"maximum-fraction-digits"?: number | "default";
|
|
1210
|
+
/** Pad integer output to at least this many digits (1-21). */
|
|
1211
|
+
"minimum-integer-digits"?: number | "default";
|
|
1212
|
+
/** @deprecated - not supported on custom element tags */
|
|
1213
|
+
"nve-layout"?: string;
|
|
1214
|
+
/** @deprecated - not supported on custom element tags */
|
|
1215
|
+
"nve-text"?: string;
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1179
1218
|
type FormatRelativeTimeProps = {
|
|
1180
1219
|
/** Optional date string for values supplied by JavaScript or bound data.
|
|
1181
1220
|
By default, the component formats the element's text content, which also serves as the SSR fallback.
|
|
@@ -3980,7 +4019,7 @@ export type CustomElements = {
|
|
|
3980
4019
|
"nve-breadcrumb": DefineComponent<BreadcrumbProps>;
|
|
3981
4020
|
|
|
3982
4021
|
/**
|
|
3983
|
-
* A button group
|
|
4022
|
+
* A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.
|
|
3984
4023
|
* ---
|
|
3985
4024
|
*
|
|
3986
4025
|
*
|
|
@@ -4692,6 +4731,17 @@ export type CustomElements = {
|
|
|
4692
4731
|
*/
|
|
4693
4732
|
"nve-format-datetime": DefineComponent<FormatDatetimeProps>;
|
|
4694
4733
|
|
|
4734
|
+
/**
|
|
4735
|
+
* A localized number formatter for currencies, percentages, units, and compact notation, backed by Intl.NumberFormat.
|
|
4736
|
+
* Provide a `currency` attribute when `formatStyle` is `currency`, and a `unit` attribute when `formatStyle` is `unit`.
|
|
4737
|
+
* ---
|
|
4738
|
+
*
|
|
4739
|
+
*
|
|
4740
|
+
* ### **Slots:**
|
|
4741
|
+
* - _default_ - Numeric string to format (such as 1234567 or 1234.56). Serves as fallback before hydration.
|
|
4742
|
+
*/
|
|
4743
|
+
"nve-format-number": DefineComponent<FormatNumberProps>;
|
|
4744
|
+
|
|
4695
4745
|
/**
|
|
4696
4746
|
* Formats a date/time value as localized relative text using the Intl.RelativeTimeFormat API. Renders inside a semantic time element.
|
|
4697
4747
|
* Options mirror the Intl.RelativeTimeFormat API. When unit is 'auto', the component selects the best unit based on the time difference.
|