cynx-ui 1.2.41 → 1.2.43
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/components/DatePicker.jsx +7 -6
- package/components/Select.jsx +36 -9
- package/package.json +1 -1
|
@@ -376,21 +376,22 @@ export function DatePicker({ value, onChange, placeholder = 'Select date', badge
|
|
|
376
376
|
);
|
|
377
377
|
|
|
378
378
|
const actualPos = stepperPosition || localStepperPos || 'around';
|
|
379
|
+
const showStepperEffective = showStepper && actualPos !== 'off';
|
|
379
380
|
const posMode = actualPos === 'left' || actualPos === 'start' ? 'left'
|
|
380
381
|
: actualPos === 'right' || actualPos === 'end' ? 'right'
|
|
381
382
|
: 'around';
|
|
382
383
|
|
|
383
384
|
return (
|
|
384
385
|
<div ref={ref} style={{ position: 'relative', display: 'inline-flex', alignItems: 'center', gap: 4, ...style }}>
|
|
385
|
-
{
|
|
386
|
-
{
|
|
387
|
-
{
|
|
386
|
+
{showStepperEffective && posMode === 'around' && renderPrevBtn()}
|
|
387
|
+
{showStepperEffective && posMode === 'left' && renderPrevBtn()}
|
|
388
|
+
{showStepperEffective && posMode === 'left' && renderNextBtn()}
|
|
388
389
|
|
|
389
390
|
{renderTriggerBtn()}
|
|
390
391
|
|
|
391
|
-
{
|
|
392
|
-
{
|
|
393
|
-
{
|
|
392
|
+
{showStepperEffective && posMode === 'around' && renderNextBtn()}
|
|
393
|
+
{showStepperEffective && posMode === 'right' && renderPrevBtn()}
|
|
394
|
+
{showStepperEffective && posMode === 'right' && renderNextBtn()}
|
|
394
395
|
|
|
395
396
|
{/* Dropdown via portal */}
|
|
396
397
|
{open && createPortal(
|
package/components/Select.jsx
CHANGED
|
@@ -22,6 +22,8 @@ export default function Select({
|
|
|
22
22
|
disabled = false,
|
|
23
23
|
multi = false,
|
|
24
24
|
searchable = false,
|
|
25
|
+
clearable = false,
|
|
26
|
+
onClear,
|
|
25
27
|
style = {},
|
|
26
28
|
}) {
|
|
27
29
|
const [open, setOpen] = useState(false);
|
|
@@ -186,15 +188,40 @@ export default function Select({
|
|
|
186
188
|
<span style={{ color: 'var(--t3,var(--grey-3))', fontWeight: 400 }}>{placeholder}</span>
|
|
187
189
|
)}
|
|
188
190
|
</div>
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
191
|
+
{!multi && selectedValues.length > 0 && selectedValues[0] !== '' && selectedValues[0] !== null && (clearable || !!onClear) ? (
|
|
192
|
+
<span
|
|
193
|
+
onClick={(e) => {
|
|
194
|
+
e.stopPropagation();
|
|
195
|
+
if (onClear) onClear();
|
|
196
|
+
else onChange?.('');
|
|
197
|
+
}}
|
|
198
|
+
title="Сбросить выбор"
|
|
199
|
+
style={{
|
|
200
|
+
display: 'inline-flex',
|
|
201
|
+
alignItems: 'center',
|
|
202
|
+
justifyContent: 'center',
|
|
203
|
+
cursor: 'pointer',
|
|
204
|
+
color: 'var(--muted, #64748b)',
|
|
205
|
+
padding: '0 2px',
|
|
206
|
+
flexShrink: 0,
|
|
207
|
+
borderRadius: 'var(--radxs, 4px)',
|
|
208
|
+
}}
|
|
209
|
+
onMouseEnter={(e) => { e.currentTarget.style.color = 'var(--danger, #ef4444)'; }}
|
|
210
|
+
onMouseLeave={(e) => { e.currentTarget.style.color = 'var(--muted, #64748b)'; }}
|
|
211
|
+
>
|
|
212
|
+
<X size={13} />
|
|
213
|
+
</span>
|
|
214
|
+
) : (
|
|
215
|
+
<ChevronDown
|
|
216
|
+
size={13}
|
|
217
|
+
style={{
|
|
218
|
+
flexShrink: 0,
|
|
219
|
+
color: 'var(--t3,var(--grey-3))',
|
|
220
|
+
transition: 'transform .2s ease',
|
|
221
|
+
transform: open ? 'rotate(180deg)' : undefined,
|
|
222
|
+
}}
|
|
223
|
+
/>
|
|
224
|
+
)}
|
|
198
225
|
</div>
|
|
199
226
|
|
|
200
227
|
{open && createPortal(
|