@molecule/app-price-range-slider-svelte 1.1.0 → 1.1.2
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/README.md +10 -4
- package/dist/PriceRangeSlider.svelte +11 -3
- package/dist/PriceRangeSlider.svelte.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-21T12:46:58.491Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-price-range-slider-svelte
|
|
@@ -110,6 +110,12 @@ Peer dependencies:
|
|
|
110
110
|
- `svelte`
|
|
111
111
|
|
|
112
112
|
The default `formatValue` renders US-style dollars (`$1,000`) — always pass
|
|
113
|
-
your own formatter for non-USD apps. The two sliders
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
your own formatter for non-USD apps. The two sliders' aria-labels
|
|
114
|
+
("Minimum"/"Maximum") translate through `t()`
|
|
115
|
+
(`priceRangeSlider.aria.minimum`/`priceRangeSlider.aria.maximum`), so they
|
|
116
|
+
follow the active locale. Requires a wired ClassMap bond (`getClassMap()`).
|
|
117
|
+
The optional `label` is a snippet.
|
|
118
|
+
|
|
119
|
+
## Translations
|
|
120
|
+
|
|
121
|
+
Translation strings are provided by `@molecule/app-locales-price-range-slider`.
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
`low <= high` always holds. The optional `label` is a snippet.
|
|
7
7
|
-->
|
|
8
8
|
<script lang="ts">
|
|
9
|
+
import { useTranslation } from '@molecule/app-svelte'
|
|
9
10
|
import { getClassMap } from '@molecule/app-ui'
|
|
10
11
|
|
|
11
12
|
import type { PriceRangeSliderProps } from './types.js'
|
|
@@ -22,8 +23,15 @@
|
|
|
22
23
|
}: PriceRangeSliderProps = $props()
|
|
23
24
|
|
|
24
25
|
const cm = $derived(getClassMap())
|
|
26
|
+
const { t } = useTranslation()
|
|
25
27
|
const low = $derived(value[0])
|
|
26
28
|
const high = $derived(value[1])
|
|
29
|
+
const minLabel = $derived(
|
|
30
|
+
t('priceRangeSlider.aria.minimum', undefined, { defaultValue: 'Minimum' }),
|
|
31
|
+
)
|
|
32
|
+
const maxLabel = $derived(
|
|
33
|
+
t('priceRangeSlider.aria.maximum', undefined, { defaultValue: 'Maximum' }),
|
|
34
|
+
)
|
|
27
35
|
|
|
28
36
|
/**
|
|
29
37
|
* Formats an endpoint label: the caller's `formatValue`, else the USD
|
|
@@ -67,7 +75,7 @@
|
|
|
67
75
|
|
|
68
76
|
<div class={cm.cn(cm.stack(2), className)}>
|
|
69
77
|
{#if label}
|
|
70
|
-
<span class={cm.cn(cm.textSize('xs'), cm.fontWeight('semibold'))}>{@render label()}</span>
|
|
78
|
+
<span class={cm.cn(cm.textSize('xs'), cm.fontWeight('semibold'))}>{@render label?.()}</span>
|
|
71
79
|
{/if}
|
|
72
80
|
<div class={cm.flex({ align: 'center', gap: 'sm' })}>
|
|
73
81
|
<span class={cm.textSize('sm')}>{fmt(low)}</span>
|
|
@@ -79,7 +87,7 @@
|
|
|
79
87
|
use:rangeValue={low}
|
|
80
88
|
oninput={handleMin}
|
|
81
89
|
class={cm.flex1}
|
|
82
|
-
aria-label=
|
|
90
|
+
aria-label={minLabel}
|
|
83
91
|
/>
|
|
84
92
|
<input
|
|
85
93
|
type="range"
|
|
@@ -89,7 +97,7 @@
|
|
|
89
97
|
use:rangeValue={high}
|
|
90
98
|
oninput={handleMax}
|
|
91
99
|
class={cm.flex1}
|
|
92
|
-
aria-label=
|
|
100
|
+
aria-label={maxLabel}
|
|
93
101
|
/>
|
|
94
102
|
<span class={cm.textSize('sm')}>{fmt(high)}</span>
|
|
95
103
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PriceRangeSlider.svelte.d.ts","sourceRoot":"","sources":["../src/PriceRangeSlider.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PriceRangeSlider.svelte.d.ts","sourceRoot":"","sources":["../src/PriceRangeSlider.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAqFxD,QAAA,MAAM,gBAAgB,2DAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
34
|
* The default `formatValue` renders US-style dollars (`$1,000`) — always pass
|
|
35
|
-
* your own formatter for non-USD apps. The two sliders
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* your own formatter for non-USD apps. The two sliders' aria-labels
|
|
36
|
+
* ("Minimum"/"Maximum") translate through `t()`
|
|
37
|
+
* (`priceRangeSlider.aria.minimum`/`priceRangeSlider.aria.maximum`), so they
|
|
38
|
+
* follow the active locale. Requires a wired ClassMap bond (`getClassMap()`).
|
|
39
|
+
* The optional `label` is a snippet.
|
|
38
40
|
*
|
|
39
41
|
* @module
|
|
40
42
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
34
|
* The default `formatValue` renders US-style dollars (`$1,000`) — always pass
|
|
35
|
-
* your own formatter for non-USD apps. The two sliders
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* your own formatter for non-USD apps. The two sliders' aria-labels
|
|
36
|
+
* ("Minimum"/"Maximum") translate through `t()`
|
|
37
|
+
* (`priceRangeSlider.aria.minimum`/`priceRangeSlider.aria.maximum`), so they
|
|
38
|
+
* follow the active locale. Requires a wired ClassMap bond (`getClassMap()`).
|
|
39
|
+
* The optional `label` is a snippet.
|
|
38
40
|
*
|
|
39
41
|
* @module
|
|
40
42
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-price-range-slider-svelte",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Single- or dual-handle range slider with formatted labels",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-price-range-slider-svelte",
|
|
6
6
|
"type": "module",
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
58
58
|
"@molecule/app-i18n": "1.2.2",
|
|
59
59
|
"@molecule/app-icons": "1.0.4",
|
|
60
|
-
"@molecule/app-svelte": "3.
|
|
61
|
-
"@molecule/app-ui": "1.
|
|
62
|
-
"@molecule/app-ui-svelte": "1.1
|
|
60
|
+
"@molecule/app-svelte": "3.13.0",
|
|
61
|
+
"@molecule/app-ui": "1.5.0",
|
|
62
|
+
"@molecule/app-ui-svelte": "1.4.1",
|
|
63
63
|
"@sveltejs/package": "3.0.2",
|
|
64
64
|
"@sveltejs/vite-plugin-svelte": "7.1.2",
|
|
65
65
|
"@types/node": "26.6.5",
|
|
66
|
-
"jsdom": "
|
|
66
|
+
"jsdom": "31.0.1",
|
|
67
67
|
"svelte": "5.57.2",
|
|
68
68
|
"svelte-check": "4.7.7",
|
|
69
69
|
"typescript": "6.0.3",
|