droplinked-editor-configs 1.9.15 → 1.9.17
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "droplinked-editor-configs",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.17",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/droplinked-editor.umd.js",
|
|
7
7
|
"module": "dist/droplinked-editor.es.js",
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"build": "tsc -b && vite build",
|
|
12
12
|
"lint": "eslint .",
|
|
13
13
|
"preview": "vite preview",
|
|
14
|
-
"findDeadCodes": "ts-prune --ignore src/assets/icon"
|
|
15
|
-
"publish": "npm run build && npm publish --access public"
|
|
14
|
+
"findDeadCodes": "ts-prune --ignore src/assets/icon"
|
|
16
15
|
},
|
|
17
16
|
"dependencies": {
|
|
18
17
|
"@chakra-ui/icons": "^2.0.19",
|
package/src/components/productGrid/components/FilterPanel/PriceRangeFilter/PriceRangeFilter.tsx
CHANGED
|
@@ -31,13 +31,35 @@ export default function PriceRangeFilter() {
|
|
|
31
31
|
const debouncedMaxPrice = useDebounce(maxPrice, 300)
|
|
32
32
|
|
|
33
33
|
useEffect(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
let changed = false
|
|
35
|
+
let newMin = debouncedMinPrice
|
|
36
|
+
let newMax = debouncedMaxPrice
|
|
37
|
+
|
|
38
|
+
if (typeof newMin === 'number') {
|
|
39
|
+
if (newMin < min) { newMin = min; changed = true; }
|
|
40
|
+
if (newMin > max) { newMin = max; changed = true; }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (typeof newMax === 'number') {
|
|
44
|
+
if (newMax > max) { newMax = max; changed = true; }
|
|
45
|
+
if (newMax < min) { newMax = min; changed = true; }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (typeof newMin === 'number' && typeof newMax === 'number' && newMin > newMax) {
|
|
49
|
+
const temp = newMin
|
|
50
|
+
newMin = newMax
|
|
51
|
+
newMax = temp
|
|
52
|
+
changed = true
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (changed) {
|
|
56
|
+
if (newMin !== debouncedMinPrice) setStagedProductQuery('minPrice', newMin)
|
|
57
|
+
if (newMax !== debouncedMaxPrice) setStagedProductQuery('maxPrice', newMax)
|
|
37
58
|
return
|
|
38
59
|
}
|
|
60
|
+
|
|
39
61
|
applyStagedFilters()
|
|
40
|
-
}, [debouncedMinPrice, debouncedMaxPrice, applyStagedFilters, setStagedProductQuery])
|
|
62
|
+
}, [debouncedMinPrice, debouncedMaxPrice, applyStagedFilters, setStagedProductQuery, min, max])
|
|
41
63
|
|
|
42
64
|
const handleMinChange = (newMin: number | string) => {
|
|
43
65
|
if (newMin === '') {
|
|
@@ -64,14 +86,12 @@ export default function PriceRangeFilter() {
|
|
|
64
86
|
value={minPrice ?? ''}
|
|
65
87
|
placeholder={min.toString()}
|
|
66
88
|
onValueChange={handleMinChange}
|
|
67
|
-
min={min}
|
|
68
89
|
/>
|
|
69
90
|
<PLPIcons.Separator className="shrink-0" />
|
|
70
91
|
<PriceInput
|
|
71
92
|
value={maxPrice ?? ''}
|
|
72
93
|
placeholder={max.toString()}
|
|
73
94
|
onValueChange={handleMaxChange}
|
|
74
|
-
max={max}
|
|
75
95
|
/>
|
|
76
96
|
</div>
|
|
77
97
|
<ReactSlider
|