funda-ui 4.5.37 → 4.5.512

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/Date/index.js CHANGED
@@ -1736,7 +1736,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1736
1736
  var remainingText = getRemainingText(currentSuggestion);
1737
1737
  if (remainingText) {
1738
1738
  // Only the second half of the text is added
1739
- setChangedVal(changedVal + remainingText);
1739
+ handleChange(e, changedVal + remainingText);
1740
1740
  setCurrentSuggestion('');
1741
1741
  }
1742
1742
  };
@@ -1781,19 +1781,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1781
1781
  //
1782
1782
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
1783
1783
  }
1784
- function handleChange(event) {
1785
- var val = event.target.value;
1786
- setChangedVal(val);
1784
+ function handleChange(event, curVal) {
1785
+ setChangedVal(curVal);
1787
1786
 
1788
1787
  //----
1789
1788
  //remove focus style
1790
- if (val === '') {
1789
+ if (curVal === '') {
1791
1790
  var _rootRef$current2;
1792
1791
  (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1793
1792
  }
1794
1793
 
1795
1794
  //
1796
- onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current);
1795
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current, curVal);
1797
1796
 
1798
1797
  // It fires in real time as the user enters
1799
1798
  if (typeof onInputCallback === 'function') {
@@ -1950,7 +1949,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1950
1949
  onFocus: handleFocus,
1951
1950
  onBlur: handleBlur,
1952
1951
  onChange: function onChange(e) {
1953
- handleChange(e);
1952
+ handleChange(e, e.target.value);
1954
1953
 
1955
1954
  // AI Predict
1956
1955
  if (aiPredict) {
@@ -5447,12 +5447,23 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5447
5447
  function outerWrapperInit() {
5448
5448
  var _rootRef$current$pare;
5449
5449
  if (rootRef.current === null) return;
5450
+ var hasInlineHeightOrMaxHeight = function hasInlineHeightOrMaxHeight(element) {
5451
+ if (!element) return false;
5452
+ return element.style.height !== '' || element.style.maxHeight !== '';
5453
+ };
5450
5454
 
5451
- // calculate wrapper width
5455
+ // calculate wrapper width & height
5452
5456
  var wrapperWidth = ((_rootRef$current$pare = rootRef.current.parentElement) === null || _rootRef$current$pare === void 0 ? void 0 : _rootRef$current$pare.offsetWidth) || 0;
5453
5457
  if (rootRef.current && wrapperWidth > 0 && rootWidth.current === 0) {
5458
+ var _rootRef$current$pare2;
5454
5459
  rootWidth.current = wrapperWidth;
5455
5460
  rootRef.current.style.width = wrapperWidth + 'px';
5461
+
5462
+ // height
5463
+ var wrapperHeight = ((_rootRef$current$pare2 = rootRef.current.parentElement) === null || _rootRef$current$pare2 === void 0 ? void 0 : _rootRef$current$pare2.offsetHeight) || 0;
5464
+ if (hasInlineHeightOrMaxHeight(rootRef.current.parentElement) && wrapperHeight > 0) {
5465
+ rootRef.current.style.height = wrapperHeight + 'px';
5466
+ }
5456
5467
  }
5457
5468
  }
5458
5469
  function tableGridInit() {
package/Input/index.d.ts CHANGED
@@ -48,7 +48,7 @@ export declare type InputProps = {
48
48
  onChangeCallback?: (e: any, el: any) => void;
49
49
  onInputCallback?: (e: any, el: any) => void;
50
50
  onKeyPressedCallback?: (e: any, el: any) => void;
51
- onChange?: (e: any, param: any, el: any) => void;
51
+ onChange?: (e: any, param: any, el: any, value: string) => void;
52
52
  onBlur?: (e: any, param: any, el: any) => void;
53
53
  onFocus?: (e: any, param: any, el: any) => void;
54
54
  onPressEnter?: (e: any, el: any) => void;
package/Input/index.js CHANGED
@@ -1182,7 +1182,7 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1182
1182
  var remainingText = getRemainingText(currentSuggestion);
1183
1183
  if (remainingText) {
1184
1184
  // Only the second half of the text is added
1185
- setChangedVal(changedVal + remainingText);
1185
+ handleChange(e, changedVal + remainingText);
1186
1186
  setCurrentSuggestion('');
1187
1187
  }
1188
1188
  };
@@ -1227,19 +1227,18 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1227
1227
  //
1228
1228
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
1229
1229
  }
1230
- function handleChange(event) {
1231
- var val = event.target.value;
1232
- setChangedVal(val);
1230
+ function handleChange(event, curVal) {
1231
+ setChangedVal(curVal);
1233
1232
 
1234
1233
  //----
1235
1234
  //remove focus style
1236
- if (val === '') {
1235
+ if (curVal === '') {
1237
1236
  var _rootRef$current2;
1238
1237
  (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1239
1238
  }
1240
1239
 
1241
1240
  //
1242
- onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current);
1241
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current, curVal);
1243
1242
 
1244
1243
  // It fires in real time as the user enters
1245
1244
  if (typeof onInputCallback === 'function') {
@@ -1396,7 +1395,7 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1396
1395
  onFocus: handleFocus,
1397
1396
  onBlur: handleBlur,
1398
1397
  onChange: function onChange(e) {
1399
- handleChange(e);
1398
+ handleChange(e, e.target.value);
1400
1399
 
1401
1400
  // AI Predict
1402
1401
  if (aiPredict) {
@@ -1702,7 +1702,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1702
1702
  var remainingText = getRemainingText(currentSuggestion);
1703
1703
  if (remainingText) {
1704
1704
  // Only the second half of the text is added
1705
- setChangedVal(changedVal + remainingText);
1705
+ handleChange(e, changedVal + remainingText);
1706
1706
  setCurrentSuggestion('');
1707
1707
  }
1708
1708
  };
@@ -1747,19 +1747,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1747
1747
  //
1748
1748
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
1749
1749
  }
1750
- function handleChange(event) {
1751
- var val = event.target.value;
1752
- setChangedVal(val);
1750
+ function handleChange(event, curVal) {
1751
+ setChangedVal(curVal);
1753
1752
 
1754
1753
  //----
1755
1754
  //remove focus style
1756
- if (val === '') {
1755
+ if (curVal === '') {
1757
1756
  var _rootRef$current2;
1758
1757
  (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1759
1758
  }
1760
1759
 
1761
1760
  //
1762
- onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current);
1761
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current, curVal);
1763
1762
 
1764
1763
  // It fires in real time as the user enters
1765
1764
  if (typeof onInputCallback === 'function') {
@@ -1916,7 +1915,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1916
1915
  onFocus: handleFocus,
1917
1916
  onBlur: handleBlur,
1918
1917
  onChange: function onChange(e) {
1919
- handleChange(e);
1918
+ handleChange(e, e.target.value);
1920
1919
 
1921
1920
  // AI Predict
1922
1921
  if (aiPredict) {
@@ -37,7 +37,7 @@ export declare type TextareaProps = {
37
37
  onChangeCallback?: (e: any, el: any) => void;
38
38
  onInputCallback?: (e: any, el: any) => void;
39
39
  onKeyPressedCallback?: (e: any, el: any) => void;
40
- onChange?: (e: any, el: any) => void;
40
+ onChange?: (e: any, el: any, value: string) => void;
41
41
  onBlur?: (e: any, el: any) => void;
42
42
  onFocus?: (e: any, el: any) => void;
43
43
  onPressEnter?: (e: any, el: any) => void;
package/Textarea/index.js CHANGED
@@ -1460,7 +1460,7 @@ var Textarea = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
1460
1460
  var remainingText = getRemainingText(currentSuggestion);
1461
1461
  if (remainingText) {
1462
1462
  // Only the second half of the text is added
1463
- setChangedVal(changedVal + remainingText);
1463
+ handleChange(e, changedVal + remainingText);
1464
1464
  setCurrentSuggestion('');
1465
1465
  }
1466
1466
  };
@@ -1507,19 +1507,18 @@ var Textarea = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
1507
1507
  //
1508
1508
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, valRef.current);
1509
1509
  }
1510
- function handleChange(event) {
1511
- var val = event.target.value;
1512
- setChangedVal(val);
1510
+ function handleChange(event, curVal) {
1511
+ setChangedVal(curVal);
1513
1512
 
1514
1513
  //----
1515
1514
  //remove focus style
1516
- if (val === '') {
1515
+ if (curVal === '') {
1517
1516
  var _rootRef$current2;
1518
1517
  (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1519
1518
  }
1520
1519
 
1521
1520
  //
1522
- onChange === null || onChange === void 0 ? void 0 : onChange(event, valRef.current);
1521
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, valRef.current, curVal);
1523
1522
 
1524
1523
  // It fires in real time as the user enters
1525
1524
  if (typeof onInputCallback === 'function') {
@@ -1686,7 +1685,7 @@ var Textarea = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
1686
1685
  onFocus: handleFocus,
1687
1686
  onBlur: handleBlur,
1688
1687
  onChange: function onChange(e) {
1689
- handleChange(e);
1688
+ handleChange(e, e.target.value);
1690
1689
 
1691
1690
  // AI Predict
1692
1691
  if (aiPredict) {
@@ -1736,7 +1736,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1736
1736
  var remainingText = getRemainingText(currentSuggestion);
1737
1737
  if (remainingText) {
1738
1738
  // Only the second half of the text is added
1739
- setChangedVal(changedVal + remainingText);
1739
+ handleChange(e, changedVal + remainingText);
1740
1740
  setCurrentSuggestion('');
1741
1741
  }
1742
1742
  };
@@ -1781,19 +1781,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1781
1781
  //
1782
1782
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
1783
1783
  }
1784
- function handleChange(event) {
1785
- var val = event.target.value;
1786
- setChangedVal(val);
1784
+ function handleChange(event, curVal) {
1785
+ setChangedVal(curVal);
1787
1786
 
1788
1787
  //----
1789
1788
  //remove focus style
1790
- if (val === '') {
1789
+ if (curVal === '') {
1791
1790
  var _rootRef$current2;
1792
1791
  (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1793
1792
  }
1794
1793
 
1795
1794
  //
1796
- onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current);
1795
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current, curVal);
1797
1796
 
1798
1797
  // It fires in real time as the user enters
1799
1798
  if (typeof onInputCallback === 'function') {
@@ -1950,7 +1949,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1950
1949
  onFocus: handleFocus,
1951
1950
  onBlur: handleBlur,
1952
1951
  onChange: function onChange(e) {
1953
- handleChange(e);
1952
+ handleChange(e, e.target.value);
1954
1953
 
1955
1954
  // AI Predict
1956
1955
  if (aiPredict) {
@@ -5447,12 +5447,23 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5447
5447
  function outerWrapperInit() {
5448
5448
  var _rootRef$current$pare;
5449
5449
  if (rootRef.current === null) return;
5450
+ var hasInlineHeightOrMaxHeight = function hasInlineHeightOrMaxHeight(element) {
5451
+ if (!element) return false;
5452
+ return element.style.height !== '' || element.style.maxHeight !== '';
5453
+ };
5450
5454
 
5451
- // calculate wrapper width
5455
+ // calculate wrapper width & height
5452
5456
  var wrapperWidth = ((_rootRef$current$pare = rootRef.current.parentElement) === null || _rootRef$current$pare === void 0 ? void 0 : _rootRef$current$pare.offsetWidth) || 0;
5453
5457
  if (rootRef.current && wrapperWidth > 0 && rootWidth.current === 0) {
5458
+ var _rootRef$current$pare2;
5454
5459
  rootWidth.current = wrapperWidth;
5455
5460
  rootRef.current.style.width = wrapperWidth + 'px';
5461
+
5462
+ // height
5463
+ var wrapperHeight = ((_rootRef$current$pare2 = rootRef.current.parentElement) === null || _rootRef$current$pare2 === void 0 ? void 0 : _rootRef$current$pare2.offsetHeight) || 0;
5464
+ if (hasInlineHeightOrMaxHeight(rootRef.current.parentElement) && wrapperHeight > 0) {
5465
+ rootRef.current.style.height = wrapperHeight + 'px';
5466
+ }
5456
5467
  }
5457
5468
  }
5458
5469
  function tableGridInit() {
@@ -48,7 +48,7 @@ export declare type InputProps = {
48
48
  onChangeCallback?: (e: any, el: any) => void;
49
49
  onInputCallback?: (e: any, el: any) => void;
50
50
  onKeyPressedCallback?: (e: any, el: any) => void;
51
- onChange?: (e: any, param: any, el: any) => void;
51
+ onChange?: (e: any, param: any, el: any, value: string) => void;
52
52
  onBlur?: (e: any, param: any, el: any) => void;
53
53
  onFocus?: (e: any, param: any, el: any) => void;
54
54
  onPressEnter?: (e: any, el: any) => void;
@@ -1182,7 +1182,7 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1182
1182
  var remainingText = getRemainingText(currentSuggestion);
1183
1183
  if (remainingText) {
1184
1184
  // Only the second half of the text is added
1185
- setChangedVal(changedVal + remainingText);
1185
+ handleChange(e, changedVal + remainingText);
1186
1186
  setCurrentSuggestion('');
1187
1187
  }
1188
1188
  };
@@ -1227,19 +1227,18 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1227
1227
  //
1228
1228
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
1229
1229
  }
1230
- function handleChange(event) {
1231
- var val = event.target.value;
1232
- setChangedVal(val);
1230
+ function handleChange(event, curVal) {
1231
+ setChangedVal(curVal);
1233
1232
 
1234
1233
  //----
1235
1234
  //remove focus style
1236
- if (val === '') {
1235
+ if (curVal === '') {
1237
1236
  var _rootRef$current2;
1238
1237
  (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1239
1238
  }
1240
1239
 
1241
1240
  //
1242
- onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current);
1241
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current, curVal);
1243
1242
 
1244
1243
  // It fires in real time as the user enters
1245
1244
  if (typeof onInputCallback === 'function') {
@@ -1396,7 +1395,7 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1396
1395
  onFocus: handleFocus,
1397
1396
  onBlur: handleBlur,
1398
1397
  onChange: function onChange(e) {
1399
- handleChange(e);
1398
+ handleChange(e, e.target.value);
1400
1399
 
1401
1400
  // AI Predict
1402
1401
  if (aiPredict) {
@@ -1702,7 +1702,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1702
1702
  var remainingText = getRemainingText(currentSuggestion);
1703
1703
  if (remainingText) {
1704
1704
  // Only the second half of the text is added
1705
- setChangedVal(changedVal + remainingText);
1705
+ handleChange(e, changedVal + remainingText);
1706
1706
  setCurrentSuggestion('');
1707
1707
  }
1708
1708
  };
@@ -1747,19 +1747,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1747
1747
  //
1748
1748
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
1749
1749
  }
1750
- function handleChange(event) {
1751
- var val = event.target.value;
1752
- setChangedVal(val);
1750
+ function handleChange(event, curVal) {
1751
+ setChangedVal(curVal);
1753
1752
 
1754
1753
  //----
1755
1754
  //remove focus style
1756
- if (val === '') {
1755
+ if (curVal === '') {
1757
1756
  var _rootRef$current2;
1758
1757
  (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1759
1758
  }
1760
1759
 
1761
1760
  //
1762
- onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current);
1761
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current, curVal);
1763
1762
 
1764
1763
  // It fires in real time as the user enters
1765
1764
  if (typeof onInputCallback === 'function') {
@@ -1916,7 +1915,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1916
1915
  onFocus: handleFocus,
1917
1916
  onBlur: handleBlur,
1918
1917
  onChange: function onChange(e) {
1919
- handleChange(e);
1918
+ handleChange(e, e.target.value);
1920
1919
 
1921
1920
  // AI Predict
1922
1921
  if (aiPredict) {
@@ -37,7 +37,7 @@ export declare type TextareaProps = {
37
37
  onChangeCallback?: (e: any, el: any) => void;
38
38
  onInputCallback?: (e: any, el: any) => void;
39
39
  onKeyPressedCallback?: (e: any, el: any) => void;
40
- onChange?: (e: any, el: any) => void;
40
+ onChange?: (e: any, el: any, value: string) => void;
41
41
  onBlur?: (e: any, el: any) => void;
42
42
  onFocus?: (e: any, el: any) => void;
43
43
  onPressEnter?: (e: any, el: any) => void;
@@ -1460,7 +1460,7 @@ var Textarea = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
1460
1460
  var remainingText = getRemainingText(currentSuggestion);
1461
1461
  if (remainingText) {
1462
1462
  // Only the second half of the text is added
1463
- setChangedVal(changedVal + remainingText);
1463
+ handleChange(e, changedVal + remainingText);
1464
1464
  setCurrentSuggestion('');
1465
1465
  }
1466
1466
  };
@@ -1507,19 +1507,18 @@ var Textarea = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
1507
1507
  //
1508
1508
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, valRef.current);
1509
1509
  }
1510
- function handleChange(event) {
1511
- var val = event.target.value;
1512
- setChangedVal(val);
1510
+ function handleChange(event, curVal) {
1511
+ setChangedVal(curVal);
1513
1512
 
1514
1513
  //----
1515
1514
  //remove focus style
1516
- if (val === '') {
1515
+ if (curVal === '') {
1517
1516
  var _rootRef$current2;
1518
1517
  (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1519
1518
  }
1520
1519
 
1521
1520
  //
1522
- onChange === null || onChange === void 0 ? void 0 : onChange(event, valRef.current);
1521
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, valRef.current, curVal);
1523
1522
 
1524
1523
  // It fires in real time as the user enters
1525
1524
  if (typeof onInputCallback === 'function') {
@@ -1686,7 +1685,7 @@ var Textarea = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
1686
1685
  onFocus: handleFocus,
1687
1686
  onBlur: handleBlur,
1688
1687
  onChange: function onChange(e) {
1689
- handleChange(e);
1688
+ handleChange(e, e.target.value);
1690
1689
 
1691
1690
  // AI Predict
1692
1691
  if (aiPredict) {
@@ -1826,11 +1826,23 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
1826
1826
  function outerWrapperInit() {
1827
1827
  if (rootRef.current === null) return;
1828
1828
 
1829
- // calculate wrapper width
1829
+ const hasInlineHeightOrMaxHeight = (element: HTMLElement) => {
1830
+ if (!element) return false;
1831
+ return element.style.height !== '' || element.style.maxHeight !== '';
1832
+ };
1833
+
1834
+ // calculate wrapper width & height
1830
1835
  const wrapperWidth = rootRef.current.parentElement?.offsetWidth || 0;
1831
1836
  if (rootRef.current && wrapperWidth > 0 && rootWidth.current === 0) {
1832
1837
  rootWidth.current = wrapperWidth;
1833
1838
  rootRef.current.style.width = wrapperWidth + 'px';
1839
+
1840
+ // height
1841
+ const wrapperHeight = rootRef.current.parentElement?.offsetHeight || 0;
1842
+ if (hasInlineHeightOrMaxHeight(rootRef.current.parentElement) && wrapperHeight > 0) {
1843
+ rootRef.current.style.height = wrapperHeight + 'px';
1844
+ }
1845
+
1834
1846
  }
1835
1847
  }
1836
1848
 
@@ -57,7 +57,7 @@ export type InputProps = {
57
57
  onChangeCallback?: (e: any, el: any) => void;
58
58
  onInputCallback?: (e: any, el: any) => void;
59
59
  onKeyPressedCallback?: (e: any, el: any) => void;
60
- onChange?: (e: any, param: any, el: any) => void;
60
+ onChange?: (e: any, param: any, el: any, value: string) => void;
61
61
  onBlur?: (e: any, param: any, el: any) => void;
62
62
  onFocus?: (e: any, param: any, el: any) => void;
63
63
  onPressEnter?: (e: any, el: any) => void;
@@ -286,7 +286,7 @@ const Input = forwardRef((props: InputProps, externalRef: any) => {
286
286
  const remainingText = getRemainingText(currentSuggestion);
287
287
  if (remainingText) {
288
288
  // Only the second half of the text is added
289
- setChangedVal(changedVal + remainingText);
289
+ handleChange(e, changedVal + remainingText);
290
290
  setCurrentSuggestion('');
291
291
  }
292
292
  };
@@ -338,20 +338,18 @@ const Input = forwardRef((props: InputProps, externalRef: any) => {
338
338
  onFocus?.(event, onComposition, valRef.current);
339
339
  }
340
340
 
341
- function handleChange(event: ChangeEvent<HTMLInputElement>) {
342
- const val = event.target.value;
343
-
344
- setChangedVal(val);
341
+ function handleChange(event: ChangeEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement> | null, curVal: string) {
342
+ setChangedVal(curVal);
345
343
 
346
-
344
+
347
345
  //----
348
346
  //remove focus style
349
- if (val === '') {
347
+ if (curVal === '') {
350
348
  rootRef.current?.classList.remove('focus');
351
349
  }
352
350
 
353
351
  //
354
- onChange?.(event, onComposition, valRef.current);
352
+ onChange?.(event, onComposition, valRef.current, curVal);
355
353
 
356
354
  // It fires in real time as the user enters
357
355
  if (typeof (onInputCallback) === 'function') {
@@ -537,7 +535,7 @@ const Input = forwardRef((props: InputProps, externalRef: any) => {
537
535
  onFocus={handleFocus}
538
536
  onBlur={handleBlur}
539
537
  onChange={(e: any) => {
540
- handleChange(e);
538
+ handleChange(e, e.target.value);
541
539
 
542
540
  // AI Predict
543
541
  if (aiPredict) {
@@ -13,6 +13,7 @@ import {
13
13
  } from 'funda-utils/dist/cjs/bodyScrollLock';
14
14
 
15
15
 
16
+
16
17
  declare global {
17
18
  interface Window {
18
19
  curVideo?: any;
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect, useRef, forwardRef, KeyboardEvent, useImperativeHandle } from 'react';
1
+ import React, { useState, useEffect, useRef, forwardRef, ChangeEvent, KeyboardEvent, useImperativeHandle } from 'react';
2
2
 
3
3
 
4
4
  import useComId from 'funda-utils/dist/cjs/useComId';
@@ -46,7 +46,7 @@ export type TextareaProps = {
46
46
  onChangeCallback?: (e: any, el: any) => void;
47
47
  onInputCallback?: (e: any, el: any) => void;
48
48
  onKeyPressedCallback?: (e: any, el: any) => void;
49
- onChange?: (e: any, el: any) => void;
49
+ onChange?: (e: any, el: any, value: string) => void;
50
50
  onBlur?: (e: any, el: any) => void;
51
51
  onFocus?: (e: any, el: any) => void;
52
52
  onPressEnter?: (e: any, el: any) => void;
@@ -262,7 +262,7 @@ const Textarea = forwardRef((props: TextareaProps, externalRef: any) => {
262
262
  const remainingText = getRemainingText(currentSuggestion);
263
263
  if (remainingText) {
264
264
  // Only the second half of the text is added
265
- setChangedVal(changedVal + remainingText);
265
+ handleChange(e, changedVal + remainingText);
266
266
  setCurrentSuggestion('');
267
267
  }
268
268
  };
@@ -318,19 +318,18 @@ const Textarea = forwardRef((props: TextareaProps, externalRef: any) => {
318
318
  }
319
319
 
320
320
 
321
- function handleChange(event: any) {
322
- const val = event.target.value;
321
+ function handleChange(event: ChangeEvent<HTMLTextAreaElement> | KeyboardEvent<HTMLTextAreaElement> | null, curVal: string) {
323
322
 
324
- setChangedVal(val);
323
+ setChangedVal(curVal);
325
324
 
326
325
  //----
327
326
  //remove focus style
328
- if (val === '') {
327
+ if (curVal === '') {
329
328
  rootRef.current?.classList.remove('focus');
330
329
  }
331
330
 
332
331
  //
333
- onChange?.(event, valRef.current);
332
+ onChange?.(event, valRef.current, curVal);
334
333
 
335
334
  // It fires in real time as the user enters
336
335
  if (typeof (onInputCallback) === 'function') {
@@ -527,7 +526,7 @@ const Textarea = forwardRef((props: TextareaProps, externalRef: any) => {
527
526
  onFocus={handleFocus}
528
527
  onBlur={handleBlur}
529
528
  onChange={(e: any) => {
530
- handleChange(e);
529
+ handleChange(e, e.target.value);
531
530
 
532
531
  // AI Predict
533
532
  if (aiPredict) {
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": "4.5.37",
5
+ "version": "4.5.512",
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",