funda-ui 1.0.406 → 1.0.408

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.
@@ -620,7 +620,7 @@ var RangeSlider = function RangeSlider(props) {
620
620
  type: "text",
621
621
  id: idRes + '-min',
622
622
  name: minName,
623
- value: minValue.toString() // Convert to a string to ensure that 0 can also be filled
623
+ value: typeof minValue !== 'undefined' ? minValue.toString() : min // Convert to a string to ensure that 0 can also be filled
624
624
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((funda_input__WEBPACK_IMPORTED_MODULE_1___default()), {
625
625
  ref: valMaxRef,
626
626
  wrapperClassName: wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative",
@@ -629,7 +629,7 @@ var RangeSlider = function RangeSlider(props) {
629
629
  type: "text",
630
630
  id: idRes + '-max',
631
631
  name: maxName,
632
- value: maxValue.toString() // Convert to a string to ensure that 0 can also be filled
632
+ value: typeof maxValue !== 'undefined' ? maxValue.toString() : max // Convert to a string to ensure that 0 can also be filled
633
633
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
634
634
  className: "range-slider__control-wrapper ".concat(disabled ? 'disabled' : '')
635
635
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
@@ -343,21 +343,14 @@ var Scrollbar = function Scrollbar(props) {
343
343
  var thumb = scrollThumbRef.current;
344
344
  thumb.style.top = "".concat(newTop, "px");
345
345
  }, []);
346
- var handleThumbMousedown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
346
+ var handleThumbMouseDown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
347
347
  e.preventDefault();
348
348
  e.stopPropagation();
349
349
  setScrollStartPosition(e.clientY);
350
350
  if (contentRef.current) setInitialScrollTop(contentRef.current.scrollTop);
351
351
  setIsDragging(true);
352
352
  }, []);
353
- var handleThumbMouseup = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
354
- e.preventDefault();
355
- e.stopPropagation();
356
- if (isDragging) {
357
- setIsDragging(false);
358
- }
359
- }, [isDragging]);
360
- var handleThumbMousemove = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
353
+ var handleThumbMouseMove = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
361
354
  e.preventDefault();
362
355
  e.stopPropagation();
363
356
  if (isDragging && contentRef.current && scrollStartPosition) {
@@ -369,6 +362,13 @@ var Scrollbar = function Scrollbar(props) {
369
362
  contentRef.current.scrollTop = newScrollTop;
370
363
  }
371
364
  }, [isDragging, scrollStartPosition, thumbHeight]);
365
+ var handleThumbMouseUp = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
366
+ e.preventDefault();
367
+ e.stopPropagation();
368
+ if (isDragging) {
369
+ setIsDragging(false);
370
+ }
371
+ }, [isDragging]);
372
372
 
373
373
  // Horizontal --> functions
374
374
  //========================================
@@ -440,21 +440,21 @@ var Scrollbar = function Scrollbar(props) {
440
440
  var thumb = scrollThumbHorizontalRef.current;
441
441
  thumb.style.left = "".concat(newLeft, "px");
442
442
  }, []);
443
- var handleHorizontalThumbMousedown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
443
+ var handleHorizontalThumbMouseDown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
444
444
  e.preventDefault();
445
445
  e.stopPropagation();
446
446
  setScrollHorizontalStartPosition(e.clientX);
447
447
  if (contentRef.current) setInitialScrollLeft(contentRef.current.scrollLeft);
448
448
  setIsHorizontalDragging(true);
449
449
  }, []);
450
- var handleHorizontalThumbMouseup = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
450
+ var handleHorizontalThumbMouseUp = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
451
451
  e.preventDefault();
452
452
  e.stopPropagation();
453
453
  if (isHorizontalDragging) {
454
454
  setIsHorizontalDragging(false);
455
455
  }
456
456
  }, [isHorizontalDragging]);
457
- var handleHorizontalThumbMousemove = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
457
+ var handleHorizontalThumbMouseMove = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
458
458
  e.preventDefault();
459
459
  e.stopPropagation();
460
460
  if (isHorizontalDragging && contentRef.current && scrollHorizontalStartPosition) {
@@ -510,13 +510,6 @@ var Scrollbar = function Scrollbar(props) {
510
510
 
511
511
  // Listen for mouse events to handle scrolling by dragging the thumb
512
512
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
513
- document.addEventListener('mousemove', handleThumbMousemove);
514
- document.addEventListener('mouseup', handleThumbMouseup);
515
- document.addEventListener('mouseleave', handleThumbMouseup);
516
- document.addEventListener('mousemove', handleHorizontalThumbMousemove);
517
- document.addEventListener('mouseup', handleHorizontalThumbMouseup);
518
- document.addEventListener('mouseleave', handleHorizontalThumbMouseup);
519
-
520
513
  // Add function to the element that should be used as the scrollable area.
521
514
  if (contentRef.current) {
522
515
  contentRef.current.removeEventListener('wheel', contentAreaScrollUpdate);
@@ -524,17 +517,11 @@ var Scrollbar = function Scrollbar(props) {
524
517
  contentAreaScrollUpdate();
525
518
  }
526
519
  return function () {
527
- document.removeEventListener('mousemove', handleThumbMousemove);
528
- document.removeEventListener('mouseup', handleThumbMouseup);
529
- document.removeEventListener('mouseleave', handleThumbMouseup);
530
- document.removeEventListener('mousemove', handleHorizontalThumbMousemove);
531
- document.removeEventListener('mouseup', handleHorizontalThumbMouseup);
532
- document.removeEventListener('mouseleave', handleHorizontalThumbMouseup);
533
520
  if (contentRef.current) {
534
521
  contentRef.current.removeEventListener('wheel', contentAreaScrollUpdate);
535
522
  }
536
523
  };
537
- }, [handleThumbMousemove, handleThumbMouseup, handleHorizontalThumbMousemove, handleHorizontalThumbMouseup]);
524
+ }, [handleThumbMouseMove, handleThumbMouseUp, handleHorizontalThumbMouseMove, handleHorizontalThumbMouseUp]);
538
525
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
539
526
  id: idRes,
540
527
  ref: rootRef,
@@ -567,7 +554,9 @@ var Scrollbar = function Scrollbar(props) {
567
554
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
568
555
  className: "custom-scrollbars__thumb",
569
556
  ref: scrollThumbRef,
570
- onMouseDown: handleThumbMousedown,
557
+ onMouseDown: handleThumbMouseDown,
558
+ onMouseMove: handleThumbMouseMove,
559
+ onMouseUp: handleThumbMouseUp,
571
560
  style: {
572
561
  height: "".concat(thumbHeight, "px"),
573
562
  cursor: isDragging ? 'grabbing' : 'grab'
@@ -604,7 +593,9 @@ var Scrollbar = function Scrollbar(props) {
604
593
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
605
594
  className: "custom-scrollbars__thumb",
606
595
  ref: scrollThumbHorizontalRef,
607
- onMouseDown: handleHorizontalThumbMousedown,
596
+ onMouseDown: handleHorizontalThumbMouseDown,
597
+ onMouseMove: handleHorizontalThumbMouseMove,
598
+ onMouseUp: handleHorizontalThumbMouseUp,
608
599
  style: {
609
600
  width: "".concat(thumbWidth, "px"),
610
601
  cursor: isHorizontalDragging ? 'grabbing' : 'grab'
package/Tooltip/index.css CHANGED
@@ -85,17 +85,17 @@
85
85
  content: "";
86
86
  }
87
87
  .tooltip__wrapper.active::before,
88
- .tooltip__wrapper.active .tooltip__content {
88
+ .tooltip__wrapper.active > .tooltip__content {
89
89
  opacity: 1;
90
90
  pointer-events: auto;
91
91
  }
92
92
  .tooltip__wrapper:focus::before,
93
- .tooltip__wrapper:focus .tooltip__content {
93
+ .tooltip__wrapper:focus > .tooltip__content {
94
94
  opacity: 1;
95
95
  pointer-events: auto;
96
96
  }
97
97
  .tooltip__wrapper::before,
98
- .tooltip__wrapper .tooltip__content {
98
+ .tooltip__wrapper > .tooltip__content {
99
99
  backface-visibility: hidden;
100
100
  will-change: transform;
101
101
  opacity: 0;
@@ -107,7 +107,7 @@
107
107
  box-shadow: var(--tooltip-box-shadow);
108
108
  transition: 0.1s ease-in-out;
109
109
  }
110
- .tooltip__wrapper .tooltip__content {
110
+ .tooltip__wrapper > .tooltip__content {
111
111
  background: var(--tooltip-content-bg);
112
112
  border-radius: 4px;
113
113
  color: var(--tooltip-content-color);
@@ -120,7 +120,7 @@
120
120
  box-sizing: content-box;
121
121
  line-height: var(--tooltip-content-line-height);
122
122
  }
123
- .tooltip__wrapper .tooltip__content img {
123
+ .tooltip__wrapper > .tooltip__content img {
124
124
  height: auto !important;
125
125
  margin: 0.5rem 0;
126
126
  }
@@ -129,24 +129,24 @@
129
129
  height: var(--tooltip-arrow-height);
130
130
  width: var(--tooltip-arrow-width);
131
131
  }
132
- .tooltip__wrapper[data-microtip-position|=top] .tooltip__content {
132
+ .tooltip__wrapper[data-microtip-position|=top] > .tooltip__content {
133
133
  margin-bottom: var(--tooltip-arrow-height);
134
134
  }
135
135
  .tooltip__wrapper[data-microtip-position|=top]::before {
136
136
  bottom: calc(100% + var(--tooltip-arrow-height));
137
137
  left: calc(50% - var(--tooltip-arrow-width) / 2);
138
138
  }
139
- .tooltip__wrapper[data-microtip-position|=top] .tooltip__content {
139
+ .tooltip__wrapper[data-microtip-position|=top] > .tooltip__content {
140
140
  bottom: calc(100% + var(--tooltip-arrow-height));
141
141
  left: 50%;
142
142
  transform: translateX(-50%);
143
143
  }
144
- .tooltip__wrapper[data-microtip-position=top-left] .tooltip__content {
144
+ .tooltip__wrapper[data-microtip-position=top-left] > .tooltip__content {
145
145
  bottom: calc(100% + var(--tooltip-arrow-height));
146
146
  left: 50%;
147
147
  transform: translateX(calc(-100% + var(--tooltip-arrow-width)));
148
148
  }
149
- .tooltip__wrapper[data-microtip-position=top-right] .tooltip__content {
149
+ .tooltip__wrapper[data-microtip-position=top-right] > .tooltip__content {
150
150
  bottom: calc(100% + var(--tooltip-arrow-height));
151
151
  left: 50%;
152
152
  transform: translateX(calc(0% - var(--tooltip-arrow-width)));
@@ -158,7 +158,7 @@
158
158
  margin-top: 5px;
159
159
  margin-bottom: 0;
160
160
  }
161
- .tooltip__wrapper[data-microtip-position|=bottom] .tooltip__content {
161
+ .tooltip__wrapper[data-microtip-position|=bottom] > .tooltip__content {
162
162
  margin-top: var(--tooltip-arrow-height);
163
163
  }
164
164
  .tooltip__wrapper[data-microtip-position|=bottom]::before {
@@ -166,26 +166,26 @@
166
166
  top: calc(100% + 1px);
167
167
  left: calc(50% - var(--tooltip-arrow-width) / 2);
168
168
  }
169
- .tooltip__wrapper[data-microtip-position|=bottom] .tooltip__content {
169
+ .tooltip__wrapper[data-microtip-position|=bottom] > .tooltip__content {
170
170
  bottom: auto;
171
171
  top: calc(100% + var(--tooltip-arrow-height));
172
172
  left: 50%;
173
173
  transform: translateX(-50%);
174
174
  }
175
- .tooltip__wrapper[data-microtip-position=bottom-left] .tooltip__content {
175
+ .tooltip__wrapper[data-microtip-position=bottom-left] > .tooltip__content {
176
176
  bottom: auto;
177
177
  top: calc(100% + var(--tooltip-arrow-height));
178
178
  left: 50%;
179
179
  transform: translateX(calc(-100% + var(--tooltip-arrow-width)));
180
180
  }
181
- .tooltip__wrapper[data-microtip-position=bottom-right] .tooltip__content {
181
+ .tooltip__wrapper[data-microtip-position=bottom-right] > .tooltip__content {
182
182
  bottom: auto;
183
183
  top: calc(100% + var(--tooltip-arrow-height));
184
184
  left: 50%;
185
185
  transform: translateX(calc(0% - var(--tooltip-arrow-width)));
186
186
  }
187
187
  .tooltip__wrapper[data-microtip-position=left]::before,
188
- .tooltip__wrapper[data-microtip-position=left] .tooltip__content {
188
+ .tooltip__wrapper[data-microtip-position=left] > .tooltip__content {
189
189
  bottom: auto;
190
190
  left: auto;
191
191
  right: 100%;
@@ -199,11 +199,11 @@
199
199
  margin-right: 5px;
200
200
  margin-bottom: 0;
201
201
  }
202
- .tooltip__wrapper[data-microtip-position=left] .tooltip__content {
202
+ .tooltip__wrapper[data-microtip-position=left] > .tooltip__content {
203
203
  margin-right: 10px;
204
204
  }
205
205
  .tooltip__wrapper[data-microtip-position=right]::before,
206
- .tooltip__wrapper[data-microtip-position=right] .tooltip__content {
206
+ .tooltip__wrapper[data-microtip-position=right] > .tooltip__content {
207
207
  bottom: auto;
208
208
  left: 100%;
209
209
  top: 50%;
@@ -216,7 +216,7 @@
216
216
  margin-bottom: 0;
217
217
  margin-left: 5px;
218
218
  }
219
- .tooltip__wrapper[data-microtip-position=right] .tooltip__content {
219
+ .tooltip__wrapper[data-microtip-position=right] > .tooltip__content {
220
220
  margin-left: 10px;
221
221
  }
222
222
  .tooltip__wrapper[data-microtip-size=auto].tooltip__content {
@@ -620,7 +620,7 @@ var RangeSlider = function RangeSlider(props) {
620
620
  type: "text",
621
621
  id: idRes + '-min',
622
622
  name: minName,
623
- value: minValue.toString() // Convert to a string to ensure that 0 can also be filled
623
+ value: typeof minValue !== 'undefined' ? minValue.toString() : min // Convert to a string to ensure that 0 can also be filled
624
624
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((funda_input__WEBPACK_IMPORTED_MODULE_1___default()), {
625
625
  ref: valMaxRef,
626
626
  wrapperClassName: wrapperClassName || wrapperClassName === '' ? wrapperClassName : "mb-3 position-relative",
@@ -629,7 +629,7 @@ var RangeSlider = function RangeSlider(props) {
629
629
  type: "text",
630
630
  id: idRes + '-max',
631
631
  name: maxName,
632
- value: maxValue.toString() // Convert to a string to ensure that 0 can also be filled
632
+ value: typeof maxValue !== 'undefined' ? maxValue.toString() : max // Convert to a string to ensure that 0 can also be filled
633
633
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
634
634
  className: "range-slider__control-wrapper ".concat(disabled ? 'disabled' : '')
635
635
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
@@ -343,21 +343,14 @@ var Scrollbar = function Scrollbar(props) {
343
343
  var thumb = scrollThumbRef.current;
344
344
  thumb.style.top = "".concat(newTop, "px");
345
345
  }, []);
346
- var handleThumbMousedown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
346
+ var handleThumbMouseDown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
347
347
  e.preventDefault();
348
348
  e.stopPropagation();
349
349
  setScrollStartPosition(e.clientY);
350
350
  if (contentRef.current) setInitialScrollTop(contentRef.current.scrollTop);
351
351
  setIsDragging(true);
352
352
  }, []);
353
- var handleThumbMouseup = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
354
- e.preventDefault();
355
- e.stopPropagation();
356
- if (isDragging) {
357
- setIsDragging(false);
358
- }
359
- }, [isDragging]);
360
- var handleThumbMousemove = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
353
+ var handleThumbMouseMove = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
361
354
  e.preventDefault();
362
355
  e.stopPropagation();
363
356
  if (isDragging && contentRef.current && scrollStartPosition) {
@@ -369,6 +362,13 @@ var Scrollbar = function Scrollbar(props) {
369
362
  contentRef.current.scrollTop = newScrollTop;
370
363
  }
371
364
  }, [isDragging, scrollStartPosition, thumbHeight]);
365
+ var handleThumbMouseUp = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
366
+ e.preventDefault();
367
+ e.stopPropagation();
368
+ if (isDragging) {
369
+ setIsDragging(false);
370
+ }
371
+ }, [isDragging]);
372
372
 
373
373
  // Horizontal --> functions
374
374
  //========================================
@@ -440,21 +440,21 @@ var Scrollbar = function Scrollbar(props) {
440
440
  var thumb = scrollThumbHorizontalRef.current;
441
441
  thumb.style.left = "".concat(newLeft, "px");
442
442
  }, []);
443
- var handleHorizontalThumbMousedown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
443
+ var handleHorizontalThumbMouseDown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
444
444
  e.preventDefault();
445
445
  e.stopPropagation();
446
446
  setScrollHorizontalStartPosition(e.clientX);
447
447
  if (contentRef.current) setInitialScrollLeft(contentRef.current.scrollLeft);
448
448
  setIsHorizontalDragging(true);
449
449
  }, []);
450
- var handleHorizontalThumbMouseup = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
450
+ var handleHorizontalThumbMouseUp = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
451
451
  e.preventDefault();
452
452
  e.stopPropagation();
453
453
  if (isHorizontalDragging) {
454
454
  setIsHorizontalDragging(false);
455
455
  }
456
456
  }, [isHorizontalDragging]);
457
- var handleHorizontalThumbMousemove = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
457
+ var handleHorizontalThumbMouseMove = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (e) {
458
458
  e.preventDefault();
459
459
  e.stopPropagation();
460
460
  if (isHorizontalDragging && contentRef.current && scrollHorizontalStartPosition) {
@@ -510,13 +510,6 @@ var Scrollbar = function Scrollbar(props) {
510
510
 
511
511
  // Listen for mouse events to handle scrolling by dragging the thumb
512
512
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
513
- document.addEventListener('mousemove', handleThumbMousemove);
514
- document.addEventListener('mouseup', handleThumbMouseup);
515
- document.addEventListener('mouseleave', handleThumbMouseup);
516
- document.addEventListener('mousemove', handleHorizontalThumbMousemove);
517
- document.addEventListener('mouseup', handleHorizontalThumbMouseup);
518
- document.addEventListener('mouseleave', handleHorizontalThumbMouseup);
519
-
520
513
  // Add function to the element that should be used as the scrollable area.
521
514
  if (contentRef.current) {
522
515
  contentRef.current.removeEventListener('wheel', contentAreaScrollUpdate);
@@ -524,17 +517,11 @@ var Scrollbar = function Scrollbar(props) {
524
517
  contentAreaScrollUpdate();
525
518
  }
526
519
  return function () {
527
- document.removeEventListener('mousemove', handleThumbMousemove);
528
- document.removeEventListener('mouseup', handleThumbMouseup);
529
- document.removeEventListener('mouseleave', handleThumbMouseup);
530
- document.removeEventListener('mousemove', handleHorizontalThumbMousemove);
531
- document.removeEventListener('mouseup', handleHorizontalThumbMouseup);
532
- document.removeEventListener('mouseleave', handleHorizontalThumbMouseup);
533
520
  if (contentRef.current) {
534
521
  contentRef.current.removeEventListener('wheel', contentAreaScrollUpdate);
535
522
  }
536
523
  };
537
- }, [handleThumbMousemove, handleThumbMouseup, handleHorizontalThumbMousemove, handleHorizontalThumbMouseup]);
524
+ }, [handleThumbMouseMove, handleThumbMouseUp, handleHorizontalThumbMouseMove, handleHorizontalThumbMouseUp]);
538
525
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
539
526
  id: idRes,
540
527
  ref: rootRef,
@@ -567,7 +554,9 @@ var Scrollbar = function Scrollbar(props) {
567
554
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
568
555
  className: "custom-scrollbars__thumb",
569
556
  ref: scrollThumbRef,
570
- onMouseDown: handleThumbMousedown,
557
+ onMouseDown: handleThumbMouseDown,
558
+ onMouseMove: handleThumbMouseMove,
559
+ onMouseUp: handleThumbMouseUp,
571
560
  style: {
572
561
  height: "".concat(thumbHeight, "px"),
573
562
  cursor: isDragging ? 'grabbing' : 'grab'
@@ -604,7 +593,9 @@ var Scrollbar = function Scrollbar(props) {
604
593
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
605
594
  className: "custom-scrollbars__thumb",
606
595
  ref: scrollThumbHorizontalRef,
607
- onMouseDown: handleHorizontalThumbMousedown,
596
+ onMouseDown: handleHorizontalThumbMouseDown,
597
+ onMouseMove: handleHorizontalThumbMouseMove,
598
+ onMouseUp: handleHorizontalThumbMouseUp,
608
599
  style: {
609
600
  width: "".concat(thumbWidth, "px"),
610
601
  cursor: isHorizontalDragging ? 'grabbing' : 'grab'
@@ -85,17 +85,17 @@
85
85
  content: "";
86
86
  }
87
87
  .tooltip__wrapper.active::before,
88
- .tooltip__wrapper.active .tooltip__content {
88
+ .tooltip__wrapper.active > .tooltip__content {
89
89
  opacity: 1;
90
90
  pointer-events: auto;
91
91
  }
92
92
  .tooltip__wrapper:focus::before,
93
- .tooltip__wrapper:focus .tooltip__content {
93
+ .tooltip__wrapper:focus > .tooltip__content {
94
94
  opacity: 1;
95
95
  pointer-events: auto;
96
96
  }
97
97
  .tooltip__wrapper::before,
98
- .tooltip__wrapper .tooltip__content {
98
+ .tooltip__wrapper > .tooltip__content {
99
99
  backface-visibility: hidden;
100
100
  will-change: transform;
101
101
  opacity: 0;
@@ -107,7 +107,7 @@
107
107
  box-shadow: var(--tooltip-box-shadow);
108
108
  transition: 0.1s ease-in-out;
109
109
  }
110
- .tooltip__wrapper .tooltip__content {
110
+ .tooltip__wrapper > .tooltip__content {
111
111
  background: var(--tooltip-content-bg);
112
112
  border-radius: 4px;
113
113
  color: var(--tooltip-content-color);
@@ -120,7 +120,7 @@
120
120
  box-sizing: content-box;
121
121
  line-height: var(--tooltip-content-line-height);
122
122
  }
123
- .tooltip__wrapper .tooltip__content img {
123
+ .tooltip__wrapper > .tooltip__content img {
124
124
  height: auto !important;
125
125
  margin: 0.5rem 0;
126
126
  }
@@ -129,24 +129,24 @@
129
129
  height: var(--tooltip-arrow-height);
130
130
  width: var(--tooltip-arrow-width);
131
131
  }
132
- .tooltip__wrapper[data-microtip-position|=top] .tooltip__content {
132
+ .tooltip__wrapper[data-microtip-position|=top] > .tooltip__content {
133
133
  margin-bottom: var(--tooltip-arrow-height);
134
134
  }
135
135
  .tooltip__wrapper[data-microtip-position|=top]::before {
136
136
  bottom: calc(100% + var(--tooltip-arrow-height));
137
137
  left: calc(50% - var(--tooltip-arrow-width) / 2);
138
138
  }
139
- .tooltip__wrapper[data-microtip-position|=top] .tooltip__content {
139
+ .tooltip__wrapper[data-microtip-position|=top] > .tooltip__content {
140
140
  bottom: calc(100% + var(--tooltip-arrow-height));
141
141
  left: 50%;
142
142
  transform: translateX(-50%);
143
143
  }
144
- .tooltip__wrapper[data-microtip-position=top-left] .tooltip__content {
144
+ .tooltip__wrapper[data-microtip-position=top-left] > .tooltip__content {
145
145
  bottom: calc(100% + var(--tooltip-arrow-height));
146
146
  left: 50%;
147
147
  transform: translateX(calc(-100% + var(--tooltip-arrow-width)));
148
148
  }
149
- .tooltip__wrapper[data-microtip-position=top-right] .tooltip__content {
149
+ .tooltip__wrapper[data-microtip-position=top-right] > .tooltip__content {
150
150
  bottom: calc(100% + var(--tooltip-arrow-height));
151
151
  left: 50%;
152
152
  transform: translateX(calc(0% - var(--tooltip-arrow-width)));
@@ -158,7 +158,7 @@
158
158
  margin-top: 5px;
159
159
  margin-bottom: 0;
160
160
  }
161
- .tooltip__wrapper[data-microtip-position|=bottom] .tooltip__content {
161
+ .tooltip__wrapper[data-microtip-position|=bottom] > .tooltip__content {
162
162
  margin-top: var(--tooltip-arrow-height);
163
163
  }
164
164
  .tooltip__wrapper[data-microtip-position|=bottom]::before {
@@ -166,26 +166,26 @@
166
166
  top: calc(100% + 1px);
167
167
  left: calc(50% - var(--tooltip-arrow-width) / 2);
168
168
  }
169
- .tooltip__wrapper[data-microtip-position|=bottom] .tooltip__content {
169
+ .tooltip__wrapper[data-microtip-position|=bottom] > .tooltip__content {
170
170
  bottom: auto;
171
171
  top: calc(100% + var(--tooltip-arrow-height));
172
172
  left: 50%;
173
173
  transform: translateX(-50%);
174
174
  }
175
- .tooltip__wrapper[data-microtip-position=bottom-left] .tooltip__content {
175
+ .tooltip__wrapper[data-microtip-position=bottom-left] > .tooltip__content {
176
176
  bottom: auto;
177
177
  top: calc(100% + var(--tooltip-arrow-height));
178
178
  left: 50%;
179
179
  transform: translateX(calc(-100% + var(--tooltip-arrow-width)));
180
180
  }
181
- .tooltip__wrapper[data-microtip-position=bottom-right] .tooltip__content {
181
+ .tooltip__wrapper[data-microtip-position=bottom-right] > .tooltip__content {
182
182
  bottom: auto;
183
183
  top: calc(100% + var(--tooltip-arrow-height));
184
184
  left: 50%;
185
185
  transform: translateX(calc(0% - var(--tooltip-arrow-width)));
186
186
  }
187
187
  .tooltip__wrapper[data-microtip-position=left]::before,
188
- .tooltip__wrapper[data-microtip-position=left] .tooltip__content {
188
+ .tooltip__wrapper[data-microtip-position=left] > .tooltip__content {
189
189
  bottom: auto;
190
190
  left: auto;
191
191
  right: 100%;
@@ -199,11 +199,11 @@
199
199
  margin-right: 5px;
200
200
  margin-bottom: 0;
201
201
  }
202
- .tooltip__wrapper[data-microtip-position=left] .tooltip__content {
202
+ .tooltip__wrapper[data-microtip-position=left] > .tooltip__content {
203
203
  margin-right: 10px;
204
204
  }
205
205
  .tooltip__wrapper[data-microtip-position=right]::before,
206
- .tooltip__wrapper[data-microtip-position=right] .tooltip__content {
206
+ .tooltip__wrapper[data-microtip-position=right] > .tooltip__content {
207
207
  bottom: auto;
208
208
  left: 100%;
209
209
  top: 50%;
@@ -216,7 +216,7 @@
216
216
  margin-bottom: 0;
217
217
  margin-left: 5px;
218
218
  }
219
- .tooltip__wrapper[data-microtip-position=right] .tooltip__content {
219
+ .tooltip__wrapper[data-microtip-position=right] > .tooltip__content {
220
220
  margin-left: 10px;
221
221
  }
222
222
  .tooltip__wrapper[data-microtip-size=auto].tooltip__content {
@@ -2,7 +2,6 @@ import React, { useId, useEffect, useState, useRef } from 'react';
2
2
 
3
3
  import Input from 'funda-input';
4
4
 
5
-
6
5
  type RangeSliderProps = {
7
6
  wrapperClassName?: string;
8
7
  controlClassName?: string;
@@ -131,7 +130,7 @@ const RangeSlider = (props: RangeSliderProps) => {
131
130
  type="text"
132
131
  id={idRes + '-min'}
133
132
  name={minName}
134
- value={minValue.toString()} // Convert to a string to ensure that 0 can also be filled
133
+ value={typeof minValue !== 'undefined' ? minValue.toString() : min} // Convert to a string to ensure that 0 can also be filled
135
134
  />
136
135
 
137
136
  <Input
@@ -142,7 +141,7 @@ const RangeSlider = (props: RangeSliderProps) => {
142
141
  type="text"
143
142
  id={idRes + '-max'}
144
143
  name={maxName}
145
- value={maxValue.toString()} // Convert to a string to ensure that 0 can also be filled
144
+ value={typeof maxValue !== 'undefined' ? maxValue.toString() : max} // Convert to a string to ensure that 0 can also be filled
146
145
  />
147
146
 
148
147
 
@@ -175,7 +175,7 @@ const Scrollbar = (props: ScrollbarProps) => {
175
175
  thumb.style.top = `${newTop}px`;
176
176
  }, []);
177
177
 
178
- const handleThumbMousedown = useCallback((e: React.MouseEvent) => {
178
+ const handleThumbMouseDown = useCallback((e: React.MouseEvent) => {
179
179
  e.preventDefault();
180
180
  e.stopPropagation();
181
181
  setScrollStartPosition(e.clientY);
@@ -183,40 +183,37 @@ const Scrollbar = (props: ScrollbarProps) => {
183
183
  setIsDragging(true);
184
184
  }, []);
185
185
 
186
- const handleThumbMouseup = useCallback(
187
- (e: React.MouseEvent) => {
188
- e.preventDefault();
189
- e.stopPropagation();
190
- if (isDragging) {
191
- setIsDragging(false);
192
- }
193
- },
194
- [isDragging]
195
- ) as any;
186
+ const handleThumbMouseMove = useCallback((e: React.MouseEvent) => {
187
+ e.preventDefault();
188
+ e.stopPropagation();
189
+ if (isDragging && contentRef.current && scrollStartPosition) {
190
+ const {
191
+ scrollHeight: contentScrollHeight,
192
+ offsetHeight: contentOffsetHeight,
193
+ } = contentRef.current;
194
+
195
+ const deltaY =
196
+ (e.clientY - scrollStartPosition) *
197
+ (contentOffsetHeight / thumbHeight);
198
+ const newScrollTop = Math.min(
199
+ initialScrollTop + deltaY,
200
+ contentScrollHeight - contentOffsetHeight
201
+ );
202
+
203
+ contentRef.current.scrollTop = newScrollTop;
204
+ }
205
+ }, [isDragging, scrollStartPosition, thumbHeight]);
196
206
 
197
- const handleThumbMousemove = useCallback(
198
- (e: React.MouseEvent) => {
199
- e.preventDefault();
200
- e.stopPropagation();
201
- if (isDragging && contentRef.current && scrollStartPosition) {
202
- const {
203
- scrollHeight: contentScrollHeight,
204
- offsetHeight: contentOffsetHeight,
205
- } = contentRef.current;
206
207
 
207
- const deltaY =
208
- (e.clientY - scrollStartPosition) *
209
- (contentOffsetHeight / thumbHeight);
210
- const newScrollTop = Math.min(
211
- initialScrollTop + deltaY,
212
- contentScrollHeight - contentOffsetHeight
213
- );
208
+ const handleThumbMouseUp = useCallback((e: React.MouseEvent) => {
209
+ e.preventDefault();
210
+ e.stopPropagation();
211
+ if (isDragging) {
212
+ setIsDragging(false);
213
+ }
214
+ }, [isDragging]);
215
+
214
216
 
215
- contentRef.current.scrollTop = newScrollTop;
216
- }
217
- },
218
- [isDragging, scrollStartPosition, thumbHeight]
219
- ) as any;
220
217
 
221
218
 
222
219
  // Horizontal --> functions
@@ -300,7 +297,7 @@ const Scrollbar = (props: ScrollbarProps) => {
300
297
  thumb.style.left = `${newLeft}px`;
301
298
  }, []);
302
299
 
303
- const handleHorizontalThumbMousedown = useCallback((e: React.MouseEvent) => {
300
+ const handleHorizontalThumbMouseDown = useCallback((e: React.MouseEvent) => {
304
301
  e.preventDefault();
305
302
  e.stopPropagation();
306
303
  setScrollHorizontalStartPosition(e.clientX);
@@ -308,7 +305,7 @@ const Scrollbar = (props: ScrollbarProps) => {
308
305
  setIsHorizontalDragging(true);
309
306
  }, []);
310
307
 
311
- const handleHorizontalThumbMouseup = useCallback(
308
+ const handleHorizontalThumbMouseUp = useCallback(
312
309
  (e: React.MouseEvent) => {
313
310
  e.preventDefault();
314
311
  e.stopPropagation();
@@ -317,9 +314,9 @@ const Scrollbar = (props: ScrollbarProps) => {
317
314
  }
318
315
  },
319
316
  [isHorizontalDragging]
320
- ) as any;
317
+ );
321
318
 
322
- const handleHorizontalThumbMousemove = useCallback(
319
+ const handleHorizontalThumbMouseMove = useCallback(
323
320
  (e: React.MouseEvent) => {
324
321
  e.preventDefault();
325
322
  e.stopPropagation();
@@ -341,7 +338,7 @@ const Scrollbar = (props: ScrollbarProps) => {
341
338
  }
342
339
  },
343
340
  [isHorizontalDragging, scrollHorizontalStartPosition, thumbWidth]
344
- ) as any;
341
+ );
345
342
 
346
343
 
347
344
 
@@ -405,13 +402,6 @@ const Scrollbar = (props: ScrollbarProps) => {
405
402
 
406
403
  // Listen for mouse events to handle scrolling by dragging the thumb
407
404
  useEffect(() => {
408
- document.addEventListener('mousemove', handleThumbMousemove);
409
- document.addEventListener('mouseup', handleThumbMouseup);
410
- document.addEventListener('mouseleave', handleThumbMouseup);
411
-
412
- document.addEventListener('mousemove', handleHorizontalThumbMousemove);
413
- document.addEventListener('mouseup', handleHorizontalThumbMouseup);
414
- document.addEventListener('mouseleave', handleHorizontalThumbMouseup);
415
405
 
416
406
 
417
407
  // Add function to the element that should be used as the scrollable area.
@@ -422,15 +412,7 @@ const Scrollbar = (props: ScrollbarProps) => {
422
412
  }
423
413
 
424
414
 
425
-
426
415
  return () => {
427
- document.removeEventListener('mousemove', handleThumbMousemove);
428
- document.removeEventListener('mouseup', handleThumbMouseup);
429
- document.removeEventListener('mouseleave', handleThumbMouseup);
430
-
431
- document.removeEventListener('mousemove', handleHorizontalThumbMousemove);
432
- document.removeEventListener('mouseup', handleHorizontalThumbMouseup);
433
- document.removeEventListener('mouseleave', handleHorizontalThumbMouseup);
434
416
 
435
417
  if (contentRef.current) {
436
418
  contentRef.current.removeEventListener('wheel', contentAreaScrollUpdate);
@@ -440,7 +422,7 @@ const Scrollbar = (props: ScrollbarProps) => {
440
422
  };
441
423
 
442
424
 
443
- }, [handleThumbMousemove, handleThumbMouseup, handleHorizontalThumbMousemove, handleHorizontalThumbMouseup]);
425
+ }, [handleThumbMouseMove, handleThumbMouseUp, handleHorizontalThumbMouseMove, handleHorizontalThumbMouseUp]);
444
426
 
445
427
 
446
428
  return (
@@ -455,6 +437,7 @@ const Scrollbar = (props: ScrollbarProps) => {
455
437
  {children}
456
438
  </div>
457
439
 
440
+
458
441
  {/* SCROLLBAR */}
459
442
  {/*
460
443
  !!! IMPORTANT:
@@ -479,7 +462,9 @@ const Scrollbar = (props: ScrollbarProps) => {
479
462
  <div
480
463
  className="custom-scrollbars__thumb"
481
464
  ref={scrollThumbRef}
482
- onMouseDown={handleThumbMousedown}
465
+ onMouseDown={handleThumbMouseDown}
466
+ onMouseMove={handleThumbMouseMove}
467
+ onMouseUp={handleThumbMouseUp}
483
468
  style={{
484
469
  height: `${thumbHeight}px`,
485
470
  cursor: isDragging ? 'grabbing' : 'grab',
@@ -520,7 +505,9 @@ const Scrollbar = (props: ScrollbarProps) => {
520
505
  <div
521
506
  className="custom-scrollbars__thumb"
522
507
  ref={scrollThumbHorizontalRef}
523
- onMouseDown={handleHorizontalThumbMousedown}
508
+ onMouseDown={handleHorizontalThumbMouseDown}
509
+ onMouseMove={handleHorizontalThumbMouseMove}
510
+ onMouseUp={handleHorizontalThumbMouseUp}
524
511
  style={{
525
512
  width: `${thumbWidth}px`,
526
513
  cursor: isHorizontalDragging ? 'grabbing' : 'grab',
@@ -46,7 +46,7 @@
46
46
  &.active {
47
47
 
48
48
  &::before,
49
- .tooltip__content {
49
+ > .tooltip__content {
50
50
  opacity: 1;
51
51
  pointer-events: auto;
52
52
  }
@@ -55,7 +55,7 @@
55
55
  &:focus {
56
56
 
57
57
  &::before,
58
- .tooltip__content {
58
+ > .tooltip__content {
59
59
  opacity: 1;
60
60
  pointer-events: auto;
61
61
  }
@@ -63,7 +63,7 @@
63
63
 
64
64
 
65
65
  &::before,
66
- .tooltip__content {
66
+ > .tooltip__content {
67
67
  backface-visibility: hidden;
68
68
  will-change: transform;
69
69
  opacity: 0;
@@ -85,7 +85,7 @@
85
85
  ---------------------------
86
86
  */
87
87
 
88
- .tooltip__content {
88
+ > .tooltip__content {
89
89
  background: var(--tooltip-content-bg);
90
90
  border-radius: 4px;
91
91
  color: var(--tooltip-content-color);
@@ -120,7 +120,7 @@
120
120
  width: var(--tooltip-arrow-width);
121
121
  }
122
122
 
123
- .tooltip__content {
123
+ > .tooltip__content {
124
124
  margin-bottom: var(--tooltip-arrow-height);
125
125
  }
126
126
 
@@ -129,7 +129,7 @@
129
129
  left: calc(50% - var(--tooltip-arrow-width)/2);
130
130
  }
131
131
 
132
- .tooltip__content {
132
+ > .tooltip__content {
133
133
  bottom: calc(100% + var(--tooltip-arrow-height));
134
134
  left: 50%;
135
135
  transform: translateX(-50%);
@@ -144,7 +144,7 @@
144
144
  */
145
145
 
146
146
  &[data-microtip-position="top-left"] {
147
- .tooltip__content {
147
+ > .tooltip__content {
148
148
  bottom: calc(100% + var(--tooltip-arrow-height));
149
149
  left: 50%;
150
150
  transform: translateX(calc(-100% + var(--tooltip-arrow-width)));
@@ -161,7 +161,7 @@
161
161
  */
162
162
 
163
163
  &[data-microtip-position="top-right"] {
164
- .tooltip__content {
164
+ > .tooltip__content {
165
165
  bottom: calc(100% + var(--tooltip-arrow-height));
166
166
  left: 50%;
167
167
  transform: translateX(calc(0% - var(--tooltip-arrow-width)));
@@ -184,7 +184,7 @@
184
184
  margin-bottom: 0;
185
185
  }
186
186
 
187
- .tooltip__content {
187
+ > .tooltip__content {
188
188
  margin-top: var(--tooltip-arrow-height);
189
189
  }
190
190
 
@@ -194,7 +194,7 @@
194
194
  left: calc(50% - var(--tooltip-arrow-width)/2);
195
195
  }
196
196
 
197
- .tooltip__content {
197
+ > .tooltip__content {
198
198
  bottom: auto;
199
199
  top: calc(100% + var(--tooltip-arrow-height));
200
200
  left: 50%;
@@ -211,7 +211,7 @@
211
211
 
212
212
 
213
213
  &[data-microtip-position="bottom-left"] {
214
- .tooltip__content {
214
+ > .tooltip__content {
215
215
  bottom: auto;
216
216
  top: calc(100% + var(--tooltip-arrow-height));
217
217
  left: 50%;
@@ -227,7 +227,7 @@
227
227
 
228
228
 
229
229
  &[data-microtip-position="bottom-right"] {
230
- .tooltip__content {
230
+ > .tooltip__content {
231
231
  bottom: auto;
232
232
  top: calc(100% + var(--tooltip-arrow-height));
233
233
  left: 50%;
@@ -244,7 +244,7 @@
244
244
  &[data-microtip-position="left"] {
245
245
 
246
246
  &::before,
247
- .tooltip__content {
247
+ > .tooltip__content {
248
248
  bottom: auto;
249
249
  left: auto;
250
250
  right: 100%;
@@ -260,7 +260,7 @@
260
260
  margin-bottom: 0;
261
261
  }
262
262
 
263
- .tooltip__content {
263
+ > .tooltip__content {
264
264
  margin-right: 10px;
265
265
  }
266
266
  }
@@ -275,7 +275,7 @@
275
275
  &[data-microtip-position="right"] {
276
276
 
277
277
  &::before,
278
- .tooltip__content {
278
+ > .tooltip__content {
279
279
  bottom: auto;
280
280
  left: 100%;
281
281
  top: 50%;
@@ -290,7 +290,7 @@
290
290
  margin-left: 5px;
291
291
  }
292
292
 
293
- .tooltip__content {
293
+ > .tooltip__content {
294
294
  margin-left: 10px;
295
295
  }
296
296
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "UIUX Lab",
3
3
  "email": "uiuxlab@gmail.com",
4
4
  "name": "funda-ui",
5
- "version": "1.0.406",
5
+ "version": "1.0.408",
6
6
  "description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
7
7
  "repository": {
8
8
  "type": "git",