@helpdice/ui 2.2.7 → 2.3.1

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.
@@ -119,6 +119,9 @@ function _nonIterableRest() {
119
119
  function _nonIterableSpread() {
120
120
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
121
121
  }
122
+ function _objectDestructuringEmpty(t) {
123
+ if (null == t) throw new TypeError("Cannot destructure " + t);
124
+ }
122
125
  function ownKeys(e, r) {
123
126
  var t = Object.keys(e);
124
127
  if (Object.getOwnPropertySymbols) {
@@ -977,7 +980,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
977
980
  return getAllScaleProps;
978
981
  };
979
982
 
980
- var _excluded$k = ["children"];
983
+ var _excluded$j = ["children"];
981
984
  var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
982
985
  if (scale === 1) return scale;
983
986
  var diff = Math.abs((scale - 1) / 2);
@@ -987,7 +990,7 @@ var withScale = function withScale(Render) {
987
990
  var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
988
991
  var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
989
992
  var children = _ref.children,
990
- props = _objectWithoutProperties(_ref, _excluded$k);
993
+ props = _objectWithoutProperties(_ref, _excluded$j);
991
994
  var _useTheme = theme.useTheme(),
992
995
  layout = _useTheme.layout;
993
996
  var paddingLeft = props.paddingLeft,
@@ -1070,7 +1073,7 @@ var withScale = function withScale(Render) {
1070
1073
  return ScaleFC;
1071
1074
  };
1072
1075
 
1073
- var _excluded$j = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
1076
+ var _excluded$i = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
1074
1077
  var simulateChangeEvent = function simulateChangeEvent(el, event) {
1075
1078
  return _objectSpread2(_objectSpread2({}, event), {}, {
1076
1079
  target: el,
@@ -1115,7 +1118,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1115
1118
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1116
1119
  _ref$fullWidth = _ref.fullWidth,
1117
1120
  fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
1118
- props = _objectWithoutProperties(_ref, _excluded$j);
1121
+ props = _objectWithoutProperties(_ref, _excluded$i);
1119
1122
  var theme$1 = theme.useTheme();
1120
1123
  var _useScale = useScale(),
1121
1124
  SCALES = _useScale.SCALES;
@@ -1259,7 +1262,7 @@ tuple('hover', 'click');
1259
1262
  tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1260
1263
  tuple('start', 'center', 'end', 'left', 'right');
1261
1264
 
1262
- var _excluded$i = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1265
+ var _excluded$h = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1263
1266
  tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
1264
1267
  var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1265
1268
  var _ref$type = _ref.type,
@@ -1279,7 +1282,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1279
1282
  placeholder = _ref.placeholder,
1280
1283
  _ref$resize = _ref.resize,
1281
1284
  resize = _ref$resize === void 0 ? 'none' : _ref$resize,
1282
- props = _objectWithoutProperties(_ref, _excluded$i);
1285
+ props = _objectWithoutProperties(_ref, _excluded$h);
1283
1286
  var theme$1 = theme.useTheme();
1284
1287
  var _useScale = useScale(),
1285
1288
  SCALES = _useScale.SCALES;
@@ -1379,11 +1382,11 @@ var PasswordIcon = function PasswordIcon(_ref) {
1379
1382
  };
1380
1383
  var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
1381
1384
 
1382
- var _excluded$h = ["hideToggle", "children"];
1385
+ var _excluded$g = ["hideToggle", "children"];
1383
1386
  var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1384
1387
  var hideToggle = _ref.hideToggle,
1385
1388
  children = _ref.children,
1386
- props = _objectWithoutProperties(_ref, _excluded$h);
1389
+ props = _objectWithoutProperties(_ref, _excluded$g);
1387
1390
  var _useScale = useScale(),
1388
1391
  getAllScaleProps = _useScale.getAllScaleProps;
1389
1392
  var inputRef = React.useRef(null);
@@ -3219,7 +3222,7 @@ var repositionCursor = function repositionCursor(_ref) {
3219
3222
  };
3220
3223
  };
3221
3224
 
3222
- var _excluded$g = ["allowDecimals", "allowNegativeValue", "id", "name", "className", "customInput", "decimalsLimit", "defaultValue", "disabled", "maxLength", "value", "onValueChange", "fixedDecimalLength", "placeholder", "decimalScale", "prefix", "suffix", "intlConfig", "fullWidth", "step", "min", "max", "disableGroupSeparators", "disableAbbreviations", "decimalSeparator", "groupSeparator", "onChange", "onFocus", "onBlur", "onKeyDown", "onKeyUp", "transformRawValue", "formatValueOnBlur", "children"];
3225
+ var _excluded$f = ["allowDecimals", "allowNegativeValue", "id", "name", "className", "customInput", "decimalsLimit", "defaultValue", "disabled", "maxLength", "value", "onValueChange", "fixedDecimalLength", "placeholder", "decimalScale", "prefix", "suffix", "intlConfig", "fullWidth", "step", "min", "max", "disableGroupSeparators", "disableAbbreviations", "decimalSeparator", "groupSeparator", "onChange", "onFocus", "onBlur", "onKeyDown", "onKeyUp", "transformRawValue", "formatValueOnBlur", "children"];
3223
3226
  var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3224
3227
  var _ref$allowDecimals = _ref.allowDecimals,
3225
3228
  allowDecimals = _ref$allowDecimals === void 0 ? true : _ref$allowDecimals,
@@ -3261,7 +3264,7 @@ var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3261
3264
  _ref$formatValueOnBlu = _ref.formatValueOnBlur,
3262
3265
  formatValueOnBlur = _ref$formatValueOnBlu === void 0 ? true : _ref$formatValueOnBlu,
3263
3266
  children = _ref.children,
3264
- props = _objectWithoutProperties(_ref, _excluded$g);
3267
+ props = _objectWithoutProperties(_ref, _excluded$f);
3265
3268
  var _useScale = useScale(),
3266
3269
  SCALES = _useScale.SCALES;
3267
3270
  var theme$1 = theme.useTheme();
@@ -3582,7 +3585,7 @@ var hasRequiredLodash;
3582
3585
  function requireLodash () {
3583
3586
  if (hasRequiredLodash) return lodash$1.exports;
3584
3587
  hasRequiredLodash = 1;
3585
- (function (module, exports) {
3588
+ (function (module, exports$1) {
3586
3589
  (function() {
3587
3590
 
3588
3591
  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
@@ -4013,7 +4016,7 @@ function requireLodash () {
4013
4016
  var root = freeGlobal || freeSelf || Function('return this')();
4014
4017
 
4015
4018
  /** Detect free variable `exports`. */
4016
- var freeExports = exports && !exports.nodeType && exports;
4019
+ var freeExports = exports$1 && !exports$1.nodeType && exports$1;
4017
4020
 
4018
4021
  /** Detect free variable `module`. */
4019
4022
  var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
@@ -20840,7 +20843,7 @@ var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef)
20840
20843
  });
20841
20844
  SelectDropdown.displayName = 'SelectDropdown';
20842
20845
 
20843
- var _excluded$f = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
20846
+ var _excluded$e = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
20844
20847
  var getItemLayout = function getItemLayout(val) {
20845
20848
  var display = val === 0 ? 'display: none;' : 'display: inherit;';
20846
20849
  if (typeof val === 'number') {
@@ -20878,7 +20881,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
20878
20881
  children = _ref.children,
20879
20882
  _ref$className = _ref.className,
20880
20883
  className = _ref$className === void 0 ? '' : _ref$className,
20881
- props = _objectWithoutProperties(_ref, _excluded$f);
20884
+ props = _objectWithoutProperties(_ref, _excluded$e);
20882
20885
  var theme$1 = theme.useTheme();
20883
20886
  var _useScale = useScale(),
20884
20887
  SCALES = _useScale.SCALES;
@@ -20918,12 +20921,12 @@ var GridBasicItem = function GridBasicItem(_ref) {
20918
20921
  };
20919
20922
  GridBasicItem.displayName = 'GridBasicItem';
20920
20923
 
20921
- var _excluded$e = ["children", "className"];
20924
+ var _excluded$d = ["children", "className"];
20922
20925
  var GridComponent = function GridComponent(_ref) {
20923
20926
  var children = _ref.children,
20924
20927
  _ref$className = _ref.className,
20925
20928
  className = _ref$className === void 0 ? '' : _ref$className,
20926
- props = _objectWithoutProperties(_ref, _excluded$e);
20929
+ props = _objectWithoutProperties(_ref, _excluded$d);
20927
20930
  var _useScale = useScale(),
20928
20931
  SCALES = _useScale.SCALES;
20929
20932
  var _styles$className = {
@@ -20943,7 +20946,7 @@ var GridComponent = function GridComponent(_ref) {
20943
20946
  GridComponent.displayName = 'Grid';
20944
20947
  var Grid = withScale(GridComponent);
20945
20948
 
20946
- var _excluded$d = ["gap", "wrap", "children", "className"];
20949
+ var _excluded$c = ["gap", "wrap", "children", "className"];
20947
20950
  var GridContainerComponent = function GridContainerComponent(_ref) {
20948
20951
  var _ref$gap = _ref.gap,
20949
20952
  gap = _ref$gap === void 0 ? 0 : _ref$gap,
@@ -20952,7 +20955,7 @@ var GridContainerComponent = function GridContainerComponent(_ref) {
20952
20955
  children = _ref.children,
20953
20956
  _ref$className = _ref.className,
20954
20957
  className = _ref$className === void 0 ? '' : _ref$className,
20955
- props = _objectWithoutProperties(_ref, _excluded$d);
20958
+ props = _objectWithoutProperties(_ref, _excluded$c);
20956
20959
  var _useScale = useScale(),
20957
20960
  unit = _useScale.unit,
20958
20961
  SCALES = _useScale.SCALES;
@@ -21096,7 +21099,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
21096
21099
  });
21097
21100
  SelectInput.displayName = 'SelectInput';
21098
21101
 
21099
- var _excluded$c = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
21102
+ var _excluded$b = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
21100
21103
  var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
21101
21104
  var children = _ref.children,
21102
21105
  label = _ref.label,
@@ -21125,7 +21128,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
21125
21128
  getPopupContainer = _ref.getPopupContainer,
21126
21129
  _ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
21127
21130
  onDropdownVisibleChange = _ref$onDropdownVisibl === void 0 ? function () {} : _ref$onDropdownVisibl,
21128
- props = _objectWithoutProperties(_ref, _excluded$c);
21131
+ props = _objectWithoutProperties(_ref, _excluded$b);
21129
21132
  var theme$1 = theme.useTheme();
21130
21133
  var _useScale = useScale(),
21131
21134
  SCALES = _useScale.SCALES;
@@ -21311,7 +21314,7 @@ var useWarning = function useWarning(message, component) {
21311
21314
  console.warn(log);
21312
21315
  };
21313
21316
 
21314
- var _excluded$b = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
21317
+ var _excluded$a = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
21315
21318
  var SelectOptionComponent = function SelectOptionComponent(_ref) {
21316
21319
  var identValue = _ref.value,
21317
21320
  _ref$className = _ref.className,
@@ -21325,7 +21328,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
21325
21328
  label = _ref$label === void 0 ? false : _ref$label,
21326
21329
  _ref$preventAllEvents = _ref.preventAllEvents,
21327
21330
  preventAllEvents = _ref$preventAllEvents === void 0 ? false : _ref$preventAllEvents,
21328
- props = _objectWithoutProperties(_ref, _excluded$b);
21331
+ props = _objectWithoutProperties(_ref, _excluded$a);
21329
21332
  var theme$1 = theme.useTheme();
21330
21333
  var _useScale = useScale(),
21331
21334
  SCALES = _useScale.SCALES;
@@ -21520,19 +21523,19 @@ var TableHead = function TableHead(props) {
21520
21523
  className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
21521
21524
  }, /*#__PURE__*/React.createElement("tr", {
21522
21525
  style: {
21523
- backgroundColor: theme$1.palette.background
21526
+ backgroundColor: theme$1.palette.accents_2
21524
21527
  },
21525
21528
  className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
21526
21529
  }, columns.map(function (column, _index) {
21527
21530
  var _String2;
21528
- var dataName = (_String2 = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
21531
+ var dataName = (_String2 = String(column === null || column === void 0 ? void 0 : column.prop)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
21529
21532
  return /*#__PURE__*/React.createElement("th", {
21530
21533
  style: _objectSpread2({
21531
21534
  // textAlign: `${column?.align} !important`,
21532
21535
  // paddingLeft: '0.3rem',
21533
21536
  // paddingRight: '0.3rem',
21534
- backgroundColor: theme$1.type == 'dark' ? theme$1.palette.accents_1 : theme$1.palette.background,
21535
- color: "".concat(column !== null && column !== void 0 && column.color ? column === null || column === void 0 ? void 0 : column.color : '#333'),
21537
+ backgroundColor: theme$1.palette.accents_2,
21538
+ color: "".concat(column !== null && column !== void 0 && column.color ? column === null || column === void 0 ? void 0 : column.color : theme$1.palette.accents_6),
21536
21539
  whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
21537
21540
  }, column === null || column === void 0 ? void 0 : column.style),
21538
21541
  "data-column": dataName,
@@ -21556,7 +21559,8 @@ var TableHead = function TableHead(props) {
21556
21559
  };
21557
21560
  TableHead.displayName = 'TableHead';
21558
21561
 
21559
- function Empty() {
21562
+ var Empty = function Empty(_ref) {
21563
+ _objectDestructuringEmpty(_ref);
21560
21564
  return /*#__PURE__*/React.createElement("svg", {
21561
21565
  xmlns: "http://www.w3.org/2000/svg",
21562
21566
  width: "10em",
@@ -21855,9 +21859,9 @@ function Empty() {
21855
21859
  opacity: "0.2",
21856
21860
  transform: "translate(-95.23 -55.03)"
21857
21861
  }));
21858
- }
21862
+ };
21859
21863
 
21860
- var _excluded$a = ["children", "tag", "className", "color"];
21864
+ var _excluded$9 = ["children", "tag", "className", "color"];
21861
21865
  var getTypeColor = function getTypeColor(type, palette) {
21862
21866
  var colors = {
21863
21867
  "default": 'inherit',
@@ -21875,7 +21879,7 @@ var TextChild = function TextChild(_ref) {
21875
21879
  className = _ref$className === void 0 ? '' : _ref$className,
21876
21880
  _ref$color = _ref.color,
21877
21881
  color = _ref$color === void 0 ? 'default' : _ref$color,
21878
- props = _objectWithoutProperties(_ref, _excluded$a);
21882
+ props = _objectWithoutProperties(_ref, _excluded$9);
21879
21883
  var Component = tag;
21880
21884
  var theme$1 = theme.useTheme();
21881
21885
  var _useScale = useScale(),
@@ -21975,7 +21979,7 @@ var ButtonDrip = function ButtonDrip(_ref) {
21975
21979
  };
21976
21980
  ButtonDrip.displayName = 'ButtonDrip';
21977
21981
 
21978
- var _excluded$9 = ["children", "type", "color", "className", "spaceRatio"];
21982
+ var _excluded$8 = ["children", "type", "color", "className", "spaceRatio"];
21979
21983
  var getIconBgColor = function getIconBgColor(type, palette, color) {
21980
21984
  var colors = {
21981
21985
  "default": palette.accents_6,
@@ -21995,7 +21999,7 @@ var LoadingComponent = function LoadingComponent(_ref) {
21995
21999
  className = _ref$className === void 0 ? '' : _ref$className,
21996
22000
  _ref$spaceRatio = _ref.spaceRatio,
21997
22001
  spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
21998
- props = _objectWithoutProperties(_ref, _excluded$9);
22002
+ props = _objectWithoutProperties(_ref, _excluded$8);
21999
22003
  var theme$1 = theme.useTheme();
22000
22004
  var _useScale = useScale(),
22001
22005
  SCALES = _useScale.SCALES;
@@ -22035,7 +22039,7 @@ var ButtonLoading = function ButtonLoading(_ref) {
22035
22039
  };
22036
22040
  ButtonLoading.displayName = 'ButtonLoading';
22037
22041
 
22038
- var _excluded$8 = ["isRight", "isSingle", "children", "className"];
22042
+ var _excluded$7 = ["isRight", "isSingle", "children", "className"];
22039
22043
  var ButtonIcon = function ButtonIcon(_ref) {
22040
22044
  var _ref$isRight = _ref.isRight,
22041
22045
  isRight = _ref$isRight === void 0 ? false : _ref$isRight,
@@ -22043,7 +22047,7 @@ var ButtonIcon = function ButtonIcon(_ref) {
22043
22047
  children = _ref.children,
22044
22048
  _ref$className = _ref.className,
22045
22049
  className = _ref$className === void 0 ? '' : _ref$className,
22046
- props = _objectWithoutProperties(_ref, _excluded$8);
22050
+ props = _objectWithoutProperties(_ref, _excluded$7);
22047
22051
  var classes = theme.useClasses('icon', {
22048
22052
  right: isRight,
22049
22053
  single: isSingle
@@ -22336,7 +22340,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
22336
22340
  return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
22337
22341
  };
22338
22342
 
22339
- var _excluded$7 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
22343
+ var _excluded$6 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
22340
22344
  var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
22341
22345
  var theme$1 = theme.useTheme();
22342
22346
  var _useScale = useScale(),
@@ -22385,7 +22389,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
22385
22389
  _filteredProps$classN = filteredProps.className,
22386
22390
  className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
22387
22391
  filteredProps.crossOrigin;
22388
- var props = _objectWithoutProperties(filteredProps, _excluded$7);
22392
+ var props = _objectWithoutProperties(filteredProps, _excluded$6);
22389
22393
  /* eslint-enable @typescript-eslint/no-unused-vars */
22390
22394
 
22391
22395
  var _useMemo = React.useMemo(function () {
@@ -22500,7 +22504,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
22500
22504
  ButtonComponent.displayName = 'Button';
22501
22505
  var Button = withScale(ButtonComponent);
22502
22506
 
22503
- var _excluded$6 = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "collapse", "children", "className"];
22507
+ var _excluded$5 = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "collapse", "children", "className"];
22504
22508
  var _getModifierChild = function getModifierChild(tags, children) {
22505
22509
  if (!tags.length) return children;
22506
22510
  var nextTag = tags.slice(1, tags.length);
@@ -22544,7 +22548,7 @@ var TextComponent = function TextComponent(_ref) {
22544
22548
  children = _ref.children,
22545
22549
  _ref$className = _ref.className,
22546
22550
  className = _ref$className === void 0 ? '' : _ref$className,
22547
- props = _objectWithoutProperties(_ref, _excluded$6);
22551
+ props = _objectWithoutProperties(_ref, _excluded$5);
22548
22552
  var elements = {
22549
22553
  h1: h1,
22550
22554
  h2: h2,
@@ -22796,9 +22800,7 @@ var TableBody = function TableBody(_ref) {
22796
22800
  newSelected = newSelected.concat(selected.slice(0, selectedIndex), selected.slice(selectedIndex + 1));
22797
22801
  }
22798
22802
  setSelected(newSelected);
22799
- if (newSelected.length > 0 && onSelected) {
22800
- onSelected(newSelected);
22801
- }
22803
+ onSelected && onSelected(newSelected);
22802
22804
  };
22803
22805
 
22804
22806
  // const handleSelectAllClick = (event: { target: { checked: any } }) => {
@@ -22834,7 +22836,7 @@ var TableBody = function TableBody(_ref) {
22834
22836
  // ) as unknown as TableDataItem
22835
22837
  // console.log(frow);
22836
22838
  var isRowSelected = selected.indexOf(row) !== -1;
22837
- var hoverColor = theme$1.type == 'dark' ? theme$1.palette.accents_1 : theme$1.palette.background;
22839
+ var hoverColor = theme$1.palette.accents_1;
22838
22840
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", {
22839
22841
  draggable: rowDraggable,
22840
22842
  role: "checkbox",
@@ -23028,13 +23030,13 @@ var TableColumn = function TableColumn(columnProps) {
23028
23030
  };
23029
23031
  TableColumn.displayName = 'TableColumn';
23030
23032
 
23031
- var _excluded$5 = ["active", "children", "disabled", "onClick"];
23033
+ var _excluded$4 = ["active", "children", "disabled", "onClick"];
23032
23034
  var PaginationItem = function PaginationItem(_ref) {
23033
23035
  var active = _ref.active,
23034
23036
  children = _ref.children,
23035
23037
  disabled = _ref.disabled,
23036
23038
  onClick = _ref.onClick,
23037
- props = _objectWithoutProperties(_ref, _excluded$5);
23039
+ props = _objectWithoutProperties(_ref, _excluded$4);
23038
23040
  var theme$1 = theme.useTheme();
23039
23041
  var _useMemo = React.useMemo(function () {
23040
23042
  return [addColorAlpha(theme$1.palette.success, 0.1), addColorAlpha(theme$1.palette.success, 0.8)];
@@ -23072,10 +23074,10 @@ var usePaginationContext = function usePaginationContext() {
23072
23074
  return React.useContext(PaginationContext);
23073
23075
  };
23074
23076
 
23075
- var _excluded$4 = ["children"];
23077
+ var _excluded$3 = ["children"];
23076
23078
  var PaginationPrevious = function PaginationPrevious(_ref) {
23077
23079
  var children = _ref.children,
23078
- props = _objectWithoutProperties(_ref, _excluded$4);
23080
+ props = _objectWithoutProperties(_ref, _excluded$3);
23079
23081
  var _usePaginationContext = usePaginationContext(),
23080
23082
  update = _usePaginationContext.update,
23081
23083
  isFirst = _usePaginationContext.isFirst;
@@ -23088,10 +23090,10 @@ var PaginationPrevious = function PaginationPrevious(_ref) {
23088
23090
  };
23089
23091
  PaginationPrevious.displayName = 'PaginationPrevious';
23090
23092
 
23091
- var _excluded$3 = ["children"];
23093
+ var _excluded$2 = ["children"];
23092
23094
  var PaginationNext = function PaginationNext(_ref) {
23093
23095
  var children = _ref.children,
23094
- props = _objectWithoutProperties(_ref, _excluded$3);
23096
+ props = _objectWithoutProperties(_ref, _excluded$2);
23095
23097
  var _usePaginationContext = usePaginationContext(),
23096
23098
  update = _usePaginationContext.update,
23097
23099
  isLast = _usePaginationContext.isLast;
@@ -23250,7 +23252,7 @@ var PaginationPages = function PaginationPages(_ref) {
23250
23252
  };
23251
23253
  PaginationPages.displayName = 'PaginationPages';
23252
23254
 
23253
- var _excluded$2 = ["page", "initialPage", "count", "limit", "children", "onChange", "className"];
23255
+ var _excluded$1 = ["page", "initialPage", "count", "limit", "children", "onChange", "className"];
23254
23256
  var PaginationComponent = function PaginationComponent(_ref) {
23255
23257
  var customPage = _ref.page,
23256
23258
  _ref$initialPage = _ref.initialPage,
@@ -23263,7 +23265,7 @@ var PaginationComponent = function PaginationComponent(_ref) {
23263
23265
  onChange = _ref.onChange,
23264
23266
  _ref$className = _ref.className,
23265
23267
  className = _ref$className === void 0 ? '' : _ref$className,
23266
- props = _objectWithoutProperties(_ref, _excluded$2);
23268
+ props = _objectWithoutProperties(_ref, _excluded$1);
23267
23269
  var _useScale = useScale(),
23268
23270
  SCALES = _useScale.SCALES;
23269
23271
  var _useCurrentState = theme.useCurrentState(initialPage),
@@ -23478,6 +23480,108 @@ var getPosition = function getPosition(placement, rect, offset) {
23478
23480
  };
23479
23481
  return positions[placement] || positions.top;
23480
23482
  };
23483
+
23484
+ // export const getPosition = (
23485
+ // placement: Placement,
23486
+ // rect: ParentDomRect,
23487
+ // offset: number,
23488
+ // ): TooltipPosition => {
23489
+ // // console.log(rect);
23490
+ // if (
23491
+ // !rect ||
23492
+ // rect.width <= 0 ||
23493
+ // rect.height <= 0 ||
23494
+ // Number.isNaN(rect.top) ||
23495
+ // Number.isNaN(rect.left)
23496
+ // ) {
23497
+ // return {
23498
+ // top: '0px',
23499
+ // left: '0px',
23500
+ // // move tooltip out of viewport safely until rect is valid
23501
+ // transform: 'translate(-9999px, -9999px)',
23502
+ // }
23503
+ // }
23504
+
23505
+ // const viewportWidth = window.innerWidth
23506
+ // const viewportHeight = window.innerHeight
23507
+
23508
+ // const clamp = (value: number, min: number, max: number) =>
23509
+ // Math.min(Math.max(value, min), max)
23510
+
23511
+ // const centerX = rect.left + rect.width / 2
23512
+ // const centerY = rect.top + rect.height / 2
23513
+
23514
+ // const safeTop = clamp(rect.top, 8, viewportHeight - 8)
23515
+ // const safeBottom = clamp(rect.bottom, 8, viewportHeight - 8)
23516
+ // const safeLeft = clamp(rect.left, 8, viewportWidth - 8)
23517
+ // const safeRight = clamp(rect.right, 8, viewportWidth - 8)
23518
+
23519
+ // const positions: Record<Placement, TooltipPosition> = {
23520
+ // top: {
23521
+ // top: `${clamp(rect.top - offset, 8, viewportHeight - 8)}px`,
23522
+ // left: `${clamp(centerX, 8, viewportWidth - 8)}px`,
23523
+ // transform: 'translate(-50%, -100%)',
23524
+ // },
23525
+ // topStart: {
23526
+ // top: `${clamp(rect.top - offset, 8, viewportHeight - 8)}px`,
23527
+ // left: `${safeLeft}px`,
23528
+ // transform: 'translate(0, -100%)',
23529
+ // },
23530
+ // topEnd: {
23531
+ // top: `${clamp(rect.top - offset, 8, viewportHeight - 8)}px`,
23532
+ // left: `${safeRight}px`,
23533
+ // transform: 'translate(-100%, -100%)',
23534
+ // },
23535
+ // bottom: {
23536
+ // top: `${clamp(rect.bottom + offset, 8, viewportHeight - 8)}px`,
23537
+ // left: `${clamp(centerX, 8, viewportWidth - 8)}px`,
23538
+ // transform: 'translate(-50%, 0)',
23539
+ // },
23540
+ // bottomStart: {
23541
+ // top: `${clamp(rect.bottom + offset, 8, viewportHeight - 8)}px`,
23542
+ // left: `${safeLeft}px`,
23543
+ // transform: 'translate(0, 0)',
23544
+ // },
23545
+ // bottomEnd: {
23546
+ // top: `${clamp(rect.bottom + offset, 8, viewportHeight - 8)}px`,
23547
+ // left: `${safeRight}px`,
23548
+ // transform: 'translate(-100%, 0)',
23549
+ // },
23550
+ // left: {
23551
+ // top: `${clamp(centerY, 8, viewportHeight - 8)}px`,
23552
+ // left: `${clamp(rect.left - offset, 8, viewportWidth - 8)}px`,
23553
+ // transform: 'translate(-100%, -50%)',
23554
+ // },
23555
+ // leftStart: {
23556
+ // top: `${safeTop}px`,
23557
+ // left: `${clamp(rect.left - offset, 8, viewportWidth - 8)}px`,
23558
+ // transform: 'translate(-100%, 0)',
23559
+ // },
23560
+ // leftEnd: {
23561
+ // top: `${safeBottom}px`,
23562
+ // left: `${clamp(rect.left - offset, 8, viewportWidth - 8)}px`,
23563
+ // transform: 'translate(-100%, -100%)',
23564
+ // },
23565
+ // right: {
23566
+ // top: `${clamp(centerY, 8, viewportHeight - 8)}px`,
23567
+ // left: `${clamp(rect.right + offset, 8, viewportWidth - 8)}px`,
23568
+ // transform: 'translate(0, -50%)',
23569
+ // },
23570
+ // rightStart: {
23571
+ // top: `${safeTop}px`,
23572
+ // left: `${clamp(rect.right + offset, 8, viewportWidth - 8)}px`,
23573
+ // transform: 'translate(0, 0)',
23574
+ // },
23575
+ // rightEnd: {
23576
+ // top: `${safeBottom}px`,
23577
+ // left: `${clamp(rect.right + offset, 8, viewportWidth - 8)}px`,
23578
+ // transform: 'translate(0, -100%)',
23579
+ // },
23580
+ // }
23581
+
23582
+ // return positions[placement] || positions.top
23583
+ // }
23584
+
23481
23585
  var getIconPosition = function getIconPosition(placement, offsetX, offsetY) {
23482
23586
  var offsetAbsolute = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '3px';
23483
23587
  var positions = {
@@ -23614,6 +23718,24 @@ var getRect = function getRect(ref) {
23614
23718
  });
23615
23719
  };
23616
23720
 
23721
+ // export const getRect = (
23722
+ // ref: RefObject<HTMLElement | null>
23723
+ // ): ReactiveDomReact => {
23724
+ // console.log('Parent Current', ref?.current);
23725
+ // if (!ref?.current) return defaultRect
23726
+
23727
+ // const rect = ref.current.getBoundingClientRect()
23728
+
23729
+ // return {
23730
+ // top: rect.top,
23731
+ // left: rect.left,
23732
+ // right: rect.right,
23733
+ // bottom: rect.bottom,
23734
+ // width: rect.width,
23735
+ // height: rect.height,
23736
+ // }
23737
+ // }
23738
+
23617
23739
  var TooltipContent = function TooltipContent(_ref) {
23618
23740
  var children = _ref.children,
23619
23741
  parent = _ref.parent,
@@ -23638,6 +23760,9 @@ var TooltipContent = function TooltipContent(_ref) {
23638
23760
  }, [type, theme$1.palette]);
23639
23761
  var hasShadow = type === 'default';
23640
23762
  var classes = theme.useClasses('tooltip-content', className);
23763
+
23764
+ // console.log('Having Parent', parent);
23765
+
23641
23766
  if (!parent) return null;
23642
23767
  var updateRect = function updateRect() {
23643
23768
  var position = getPosition(placement, getRect(parent), offset);
@@ -23648,7 +23773,15 @@ var TooltipContent = function TooltipContent(_ref) {
23648
23773
  return updateRect();
23649
23774
  });
23650
23775
  React.useEffect(function () {
23651
- updateRect();
23776
+ window.addEventListener('scroll', updateRect, true);
23777
+ return function () {
23778
+ return window.removeEventListener('scroll', updateRect, true);
23779
+ };
23780
+ }, []);
23781
+ React.useEffect(function () {
23782
+ if (visible && parent !== null && parent !== void 0 && parent.current) {
23783
+ updateRect();
23784
+ }
23652
23785
  }, [visible]);
23653
23786
  var preventHandler = function preventHandler(event) {
23654
23787
  event.stopPropagation();
@@ -23692,7 +23825,6 @@ var useClickAway = function useClickAway(ref, handler) {
23692
23825
  }, [ref]);
23693
23826
  };
23694
23827
 
23695
- var _excluded$1 = ["children", "initialVisible", "text", "offset", "placement", "portalClassName", "enterDelay", "leaveDelay", "trigger", "type", "className", "onVisibleChange", "hideArrow", "visible"];
23696
23828
  var TooltipComponent = function TooltipComponent(_ref) {
23697
23829
  var children = _ref.children,
23698
23830
  _ref$initialVisible = _ref.initialVisible,
@@ -23718,8 +23850,7 @@ var TooltipComponent = function TooltipComponent(_ref) {
23718
23850
  onVisibleChange = _ref$onVisibleChange === void 0 ? function () {} : _ref$onVisibleChange,
23719
23851
  _ref$hideArrow = _ref.hideArrow,
23720
23852
  hideArrow = _ref$hideArrow === void 0 ? false : _ref$hideArrow,
23721
- customVisible = _ref.visible,
23722
- props = _objectWithoutProperties(_ref, _excluded$1);
23853
+ customVisible = _ref.visible;
23723
23854
  var timer = React.useRef(undefined);
23724
23855
  var ref = React.useRef(null);
23725
23856
  var _useState = React.useState(initialVisible),
@@ -23782,7 +23913,7 @@ var TooltipComponent = function TooltipComponent(_ref) {
23782
23913
  if (customVisible === undefined) return;
23783
23914
  changeVisible(customVisible);
23784
23915
  }, [customVisible]);
23785
- return /*#__PURE__*/React.createElement("div", _extends({
23916
+ return /*#__PURE__*/React.createElement("div", {
23786
23917
  ref: ref,
23787
23918
  onClick: clickEventHandler,
23788
23919
  onMouseEnter: function onMouseEnter() {
@@ -23791,9 +23922,10 @@ var TooltipComponent = function TooltipComponent(_ref) {
23791
23922
  onMouseLeave: function onMouseLeave() {
23792
23923
  return mouseEventHandler(false);
23793
23924
  }
23794
- }, props, {
23795
- className: "jsx-418573366" + " " + (props && props.className != null && props.className || theme.useClasses('tooltip', className) || "")
23796
- }), children, /*#__PURE__*/React.createElement(TooltipContent, contentProps, text), /*#__PURE__*/React.createElement(_JSXStyle, {
23925
+ // {...props}
23926
+ ,
23927
+ className: "jsx-418573366" + " " + (theme.useClasses('tooltip', className) || "")
23928
+ }, children, /*#__PURE__*/React.createElement(TooltipContent, contentProps, text), /*#__PURE__*/React.createElement(_JSXStyle, {
23797
23929
  id: "418573366"
23798
23930
  }, ".tooltip.jsx-418573366{width:-webkit-max-content;width:-moz-max-content;width:max-content;display:inline-block;}"));
23799
23931
  };
@@ -1,4 +1,4 @@
1
- import { MutableRefObject } from 'react';
1
+ import { RefObject } from 'react';
2
2
  export interface ReactiveDomReact {
3
3
  top: number;
4
4
  bottom: number;
@@ -7,4 +7,4 @@ export interface ReactiveDomReact {
7
7
  width: number;
8
8
  height: number;
9
9
  }
10
- export declare const getRect: (ref: MutableRefObject<HTMLElement | null>) => ReactiveDomReact;
10
+ export declare const getRect: (ref: RefObject<HTMLElement | null>) => ReactiveDomReact;