@dorsk/tsumikit 0.68.0 → 0.68.1
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.
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
value: string;
|
|
4
4
|
/** Visible text. Optional in `icon` mode where the icon carries the meaning. */
|
|
5
5
|
label?: string;
|
|
6
|
-
/** Optional count badge rendered after the label (filter-pill use).
|
|
7
|
-
|
|
6
|
+
/** Optional count badge rendered after the label (filter-pill use). Numbers
|
|
7
|
+
* get thousands separators (`11178` → `11,178`, fixed en-US so SSR and
|
|
8
|
+
* hydration agree); strings render verbatim (`'99+'`, another locale). */
|
|
9
|
+
count?: number | string;
|
|
8
10
|
/** Icon glyph — required for icon-toggle mode, optional alongside a label. */
|
|
9
11
|
icon?: import('../atoms/Icon.svelte').IconName;
|
|
10
12
|
/** Greyed out, not selectable, skipped by keyboard navigation. */
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
// Space/Enter (or click) activate. `value` is bindable.
|
|
24
26
|
import type { Snippet } from 'svelte';
|
|
25
27
|
import Icon from '../atoms/Icon.svelte';
|
|
28
|
+
import { formatSegmentCount } from './segmented-control-count.js';
|
|
26
29
|
import { nextEnabledSegment } from './segmented-control-keyboard.js';
|
|
27
30
|
|
|
28
31
|
let {
|
|
@@ -143,7 +146,7 @@
|
|
|
143
146
|
{:else}
|
|
144
147
|
{#if o.icon}<Icon name={o.icon} />{/if}
|
|
145
148
|
{#if o.label}<span class="seg-label">{o.label}</span>{/if}
|
|
146
|
-
{#if o.count !== undefined}<span class="seg-count">{o.count}</span>{/if}
|
|
149
|
+
{#if o.count !== undefined}<span class="seg-count">{formatSegmentCount(o.count)}</span>{/if}
|
|
147
150
|
{/if}
|
|
148
151
|
</button>
|
|
149
152
|
{/each}
|
|
@@ -2,8 +2,10 @@ export interface SegmentOption {
|
|
|
2
2
|
value: string;
|
|
3
3
|
/** Visible text. Optional in `icon` mode where the icon carries the meaning. */
|
|
4
4
|
label?: string;
|
|
5
|
-
/** Optional count badge rendered after the label (filter-pill use).
|
|
6
|
-
|
|
5
|
+
/** Optional count badge rendered after the label (filter-pill use). Numbers
|
|
6
|
+
* get thousands separators (`11178` → `11,178`, fixed en-US so SSR and
|
|
7
|
+
* hydration agree); strings render verbatim (`'99+'`, another locale). */
|
|
8
|
+
count?: number | string;
|
|
7
9
|
/** Icon glyph — required for icon-toggle mode, optional alongside a label. */
|
|
8
10
|
icon?: import('../atoms/Icon.svelte').IconName;
|
|
9
11
|
/** Greyed out, not selectable, skipped by keyboard navigation. */
|
package/package.json
CHANGED