@plesk/ui-library 3.40.7 → 3.40.9

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.
Files changed (113) hide show
  1. package/cjs/components/Action/Action.js +1 -1
  2. package/cjs/components/Badge/Badge.js +1 -1
  3. package/cjs/components/Button/Button.js +1 -1
  4. package/cjs/components/Card/Card.js +3 -3
  5. package/cjs/components/CardList/CardListToolbar.js +1 -1
  6. package/cjs/components/CodeEditor/CodeEditor.js +1 -1
  7. package/cjs/components/ComboBox/ComboBox.js +1 -1
  8. package/cjs/components/ComboBoxDropdown/ComboBoxDropdown.js +2 -2
  9. package/cjs/components/Cuttable/Cuttable.js +59 -88
  10. package/cjs/components/Cuttable/useContentOverflow.js +35 -0
  11. package/cjs/components/Dialog/Dialog.js +2 -2
  12. package/cjs/components/Drawer/Drawer.js +1 -1
  13. package/cjs/components/Dropdown/Dropdown.js +1 -1
  14. package/cjs/components/Form/Form.js +1 -1
  15. package/cjs/components/Icon/utils.js +1 -1
  16. package/cjs/components/Item/Item.js +1 -1
  17. package/cjs/components/ItemList/ItemList.js +3 -3
  18. package/cjs/components/Layer/Layer.js +2 -2
  19. package/cjs/components/List/List.js +4 -4
  20. package/cjs/components/List/ListActions.js +2 -2
  21. package/cjs/components/LocaleProvider/LocaleProvider.js +1 -1
  22. package/cjs/components/Media/Media.js +1 -1
  23. package/cjs/components/Menu/Menu.js +1 -1
  24. package/cjs/components/Overlay/Overlay.js +1 -1
  25. package/cjs/components/Progress/Progress.js +1 -1
  26. package/cjs/components/SegmentedControl/ButtonGroupControl.js +65 -0
  27. package/cjs/components/SegmentedControl/DropdownControl.js +46 -0
  28. package/cjs/components/SegmentedControl/SegmentedControl.js +70 -265
  29. package/cjs/components/SegmentedControl/getSelectedValues.js +18 -0
  30. package/cjs/components/SegmentedControl/useResponsive.js +29 -0
  31. package/cjs/components/SegmentedControl/useSelected.js +55 -0
  32. package/cjs/components/Select/Select.js +2 -2
  33. package/cjs/components/Squeezer/Squeezer.js +10 -88
  34. package/cjs/components/Tabs/Tabs.js +1 -1
  35. package/cjs/components/Toaster/Toaster.js +1 -1
  36. package/cjs/components/Toolbar/RegistryContext.js +13 -8
  37. package/cjs/components/Toolbar/ToolbarMenu.js +2 -2
  38. package/cjs/components/Tour/Tour.js +1 -1
  39. package/cjs/components/Translate/isLikeText.js +1 -1
  40. package/cjs/hooks/index.js +7 -0
  41. package/cjs/hooks/useSqueeze.js +2 -1
  42. package/cjs/index.js +1 -1
  43. package/dist/plesk-ui-library-rtl.css +1 -1
  44. package/dist/plesk-ui-library-rtl.css.map +1 -1
  45. package/dist/plesk-ui-library.css +1 -1
  46. package/dist/plesk-ui-library.css.map +1 -1
  47. package/dist/plesk-ui-library.js +519 -500
  48. package/dist/plesk-ui-library.js.map +1 -1
  49. package/dist/plesk-ui-library.min.js +4 -4
  50. package/dist/plesk-ui-library.min.js.map +1 -1
  51. package/esm/components/Action/Action.js +1 -1
  52. package/esm/components/Badge/Badge.js +1 -1
  53. package/esm/components/Button/Button.js +1 -1
  54. package/esm/components/Card/Card.js +3 -3
  55. package/esm/components/CardList/CardListToolbar.js +1 -1
  56. package/esm/components/CodeEditor/CodeEditor.js +1 -1
  57. package/esm/components/ComboBox/ComboBox.js +1 -1
  58. package/esm/components/ComboBoxDropdown/ComboBoxDropdown.js +2 -2
  59. package/esm/components/Cuttable/Cuttable.js +60 -89
  60. package/esm/components/Cuttable/useContentOverflow.js +28 -0
  61. package/esm/components/Dialog/Dialog.js +2 -2
  62. package/esm/components/Drawer/Drawer.js +1 -1
  63. package/esm/components/Dropdown/Dropdown.js +1 -1
  64. package/esm/components/Form/Form.js +1 -1
  65. package/esm/components/Icon/utils.js +1 -1
  66. package/esm/components/Item/Item.js +1 -1
  67. package/esm/components/ItemList/ItemList.js +3 -3
  68. package/esm/components/Layer/Layer.js +2 -2
  69. package/esm/components/List/List.js +4 -4
  70. package/esm/components/List/ListActions.js +2 -2
  71. package/esm/components/LocaleProvider/LocaleProvider.js +1 -1
  72. package/esm/components/Media/Media.js +1 -1
  73. package/esm/components/Menu/Menu.js +1 -1
  74. package/esm/components/Overlay/Overlay.js +1 -1
  75. package/esm/components/Progress/Progress.js +1 -1
  76. package/esm/components/SegmentedControl/ButtonGroupControl.js +58 -0
  77. package/esm/components/SegmentedControl/DropdownControl.js +37 -0
  78. package/esm/components/SegmentedControl/SegmentedControl.js +71 -264
  79. package/esm/components/SegmentedControl/getSelectedValues.js +11 -0
  80. package/esm/components/SegmentedControl/useResponsive.js +21 -0
  81. package/esm/components/SegmentedControl/useSelected.js +48 -0
  82. package/esm/components/Select/Select.js +2 -2
  83. package/esm/components/Squeezer/Squeezer.js +11 -88
  84. package/esm/components/Tabs/Tabs.js +1 -1
  85. package/esm/components/Toaster/Toaster.js +1 -1
  86. package/esm/components/Toolbar/RegistryContext.js +13 -8
  87. package/esm/components/Toolbar/ToolbarMenu.js +2 -2
  88. package/esm/components/Tour/Tour.js +1 -1
  89. package/esm/components/Translate/isLikeText.js +1 -1
  90. package/esm/hooks/index.js +1 -0
  91. package/esm/hooks/useSqueeze.js +2 -1
  92. package/esm/index.js +1 -1
  93. package/package.json +19 -19
  94. package/styleguide/build/bundle.56f21860.js +2 -0
  95. package/styleguide/index.html +2 -2
  96. package/types/src/components/Cuttable/Cuttable.d.ts +3 -25
  97. package/types/src/components/Cuttable/useContentOverflow.d.ts +8 -0
  98. package/types/src/components/List/List.d.ts +1 -0
  99. package/types/src/components/SegmentedControl/ButtonGroupControl.d.ts +12 -0
  100. package/types/src/components/SegmentedControl/DropdownControl.d.ts +8 -0
  101. package/types/src/components/SegmentedControl/SegmentedControl.d.ts +6 -50
  102. package/types/src/components/SegmentedControl/getSelectedValues.d.ts +1 -0
  103. package/types/src/components/SegmentedControl/index.d.ts +1 -1
  104. package/types/src/components/SegmentedControl/types.d.ts +11 -0
  105. package/types/src/components/SegmentedControl/useResponsive.d.ts +6 -0
  106. package/types/src/components/SegmentedControl/useSelected.d.ts +17 -0
  107. package/types/src/components/Squeezer/Squeezer.d.ts +5 -21
  108. package/types/src/components/Toolbar/RegistryContext.d.ts +2 -2
  109. package/types/src/components/index.d.ts +1 -1
  110. package/types/src/hooks/index.d.ts +2 -0
  111. package/types/src/hooks/useSqueeze.d.ts +1 -4
  112. package/styleguide/build/bundle.52d1d9a1.js +0 -2
  113. /package/styleguide/build/{bundle.52d1d9a1.js.LICENSE.txt → bundle.56f21860.js.LICENSE.txt} +0 -0
@@ -768,7 +768,7 @@ const Action = _ref => {
768
768
  size: _Icon.ICON_SIZE_16
769
769
  });
770
770
  let size = _Icon.ICON_SIZE_16;
771
- if ( /*#__PURE__*/(0, _react.isValidElement)(icon) && icon.props.size) {
771
+ if (/*#__PURE__*/(0, _react.isValidElement)(icon) && icon.props.size) {
772
772
  ({
773
773
  size
774
774
  } = icon.props);
@@ -1158,7 +1158,7 @@ const Badge = _ref => {
1158
1158
  children: label
1159
1159
  });
1160
1160
  }
1161
- if ( /*#__PURE__*/(0, _react.isValidElement)(label)) {
1161
+ if (/*#__PURE__*/(0, _react.isValidElement)(label)) {
1162
1162
  const cloneProps = {
1163
1163
  className: (0, _classnames.default)(`${baseClassName}__value`, {
1164
1164
  [`${baseClassName}__value--dot`]: isEmpty
@@ -1345,7 +1345,7 @@ const renderCaret = _ref2 => {
1345
1345
  } else {
1346
1346
  caretElement = caret;
1347
1347
  }
1348
- if ( /*#__PURE__*/(0, _react.isValidElement)(caretElement)) {
1348
+ if (/*#__PURE__*/(0, _react.isValidElement)(caretElement)) {
1349
1349
  caretElement = /*#__PURE__*/(0, _react.cloneElement)(caretElement, {
1350
1350
  className: (0, _classnames.default)(`${baseClassName}__caret`, caretElement.props.className)
1351
1351
  });
@@ -1813,13 +1813,13 @@ class Card extends _react.Component {
1813
1813
  const result = [];
1814
1814
  if (!this.isRow()) {
1815
1815
  buttons.forEach((btn, index) => {
1816
- result.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardButton.default, {
1816
+ result.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_CardButton.default, {
1817
1817
  ...btn
1818
1818
  }, btn.key || index));
1819
1819
  });
1820
1820
  }
1821
1821
  if (menu) {
1822
- result.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default, {
1822
+ result.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default, {
1823
1823
  menu: menu,
1824
1824
  menuPlacement: 'bottom-end',
1825
1825
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardButton.default, {
@@ -1828,7 +1828,7 @@ class Card extends _react.Component {
1828
1828
  }, "menu"));
1829
1829
  }
1830
1830
  if (rowContent && !this.isTile()) {
1831
- result.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardButton.default, {
1831
+ result.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_CardButton.default, {
1832
1832
  icon: {
1833
1833
  name: 'chevron-down',
1834
1834
  flipVertical: this.isExtended()
@@ -2951,7 +2951,7 @@ const CardListToolbar = _ref2 => {
2951
2951
  if (onViewChange && currentView !== _CardList.VIEW_RESPONSIVE) {
2952
2952
  const hasExpander = groups.filter(isToolbarExpander).length > 0;
2953
2953
  if (!hasExpander) {
2954
- toolbar.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toolbar.ToolbarExpander, {}, "expander"));
2954
+ toolbar.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toolbar.ToolbarExpander, {}, "expander"));
2955
2955
  }
2956
2956
  toolbar.push(renderView(onViewChange, currentView));
2957
2957
  }
@@ -3696,7 +3696,7 @@ class CodeEditor extends _react.Component {
3696
3696
  };
3697
3697
  }
3698
3698
  componentDidMount() {
3699
- Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__( /* webpackChunkName: "codemirror" *//*! ./CodeMirror */ "./components/CodeEditor/CodeMirror.tsx"))).then(_ref2 => {
3699
+ Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/* webpackChunkName: "codemirror" *//*! ./CodeMirror */ "./components/CodeEditor/CodeMirror.tsx"))).then(_ref2 => {
3700
3700
  let {
3701
3701
  CodeMirror
3702
3702
  } = _ref2;
@@ -4107,7 +4107,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
4107
4107
  const collect = function (children) {
4108
4108
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
4109
4109
  _react.Children.forEach(children, child => {
4110
- if ( /*#__PURE__*/(0, _react.isValidElement)(child) && child.type === _ComboBoxOption.default) {
4110
+ if (/*#__PURE__*/(0, _react.isValidElement)(child) && child.type === _ComboBoxOption.default) {
4111
4111
  // eslint-disable-next-line prefer-const
4112
4112
  let {
4113
4113
  disabled,
@@ -4503,7 +4503,7 @@ const ComboBoxDropdown = _ref => {
4503
4503
  className: `${baseClassName}__menu`,
4504
4504
  children: [groups.reduce((acc, group) => {
4505
4505
  if (group.label) {
4506
- acc.push( /*#__PURE__*/(0, _react.createElement)(_Menu.MenuHeader, {
4506
+ acc.push(/*#__PURE__*/(0, _react.createElement)(_Menu.MenuHeader, {
4507
4507
  ...group.props,
4508
4508
  key: `group_${group.label}`
4509
4509
  }, group.label));
@@ -4538,7 +4538,7 @@ const ComboBoxDropdown = _ref => {
4538
4538
  onMouseDown,
4539
4539
  'data-index': optionIndex
4540
4540
  };
4541
- acc.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.MenuItem, {
4541
+ acc.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.MenuItem, {
4542
4542
  ...menuItemProps,
4543
4543
  children: option.children
4544
4544
  }, `option_${option.value}`));
@@ -4952,108 +4952,79 @@ Object.defineProperty(exports, "__esModule", ({
4952
4952
  exports["default"] = void 0;
4953
4953
  var _react = __webpack_require__(/*! react */ "react");
4954
4954
  var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../node_modules/classnames/index.js"));
4955
- var _reactMeasure = _interopRequireDefault(__webpack_require__(/*! react-measure */ "../node_modules/react-measure/dist/index.esm.js"));
4956
4955
  var _constants = __webpack_require__(/*! ../../constants */ "./constants.js");
4957
4956
  var _Translate = _interopRequireDefault(__webpack_require__(/*! ../Translate */ "./components/Translate/index.tsx"));
4958
4957
  var _Link = _interopRequireDefault(__webpack_require__(/*! ../Link */ "./components/Link/index.tsx"));
4958
+ var _useContentOverflow = __webpack_require__(/*! ./useContentOverflow */ "./components/Cuttable/useContentOverflow.tsx");
4959
4959
  __webpack_require__(/*! ./Cuttable.less */ "./components/Cuttable/Cuttable.less");
4960
4960
  var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
4961
4961
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
4962
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4963
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4964
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
4962
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
4963
+
4965
4964
  /**
4966
4965
  * `Cuttable` component is used for showing and hiding part of content.
4967
4966
  * @since 0.0.42
4968
4967
  */
4969
- class Cuttable extends _react.Component {
4970
- constructor() {
4971
- super(...arguments);
4972
- _defineProperty(this, "state", {
4973
- collapsed: undefined,
4974
- autofit: true
4975
- });
4976
- _defineProperty(this, "contentRef", /*#__PURE__*/(0, _react.createRef)());
4977
- _defineProperty(this, "handleToggle", () => {
4978
- this.setState(_ref => {
4979
- let {
4980
- collapsed
4981
- } = _ref;
4982
- return {
4983
- collapsed: !collapsed,
4984
- autofit: false
4985
- };
4986
- });
4987
- });
4988
- _defineProperty(this, "handleResize", () => {
4989
- if (!this.state.autofit) {
4990
- return;
4991
- }
4992
- const content = this.contentRef.current;
4993
- if (content && content.scrollHeight > content.clientHeight) {
4994
- this.setState({
4995
- collapsed: this.props.collapsed
4996
- });
4997
- }
4998
- });
4999
- }
5000
- render() {
5001
- const {
5002
- baseClassName,
5003
- className,
5004
- children,
5005
- collapsed,
5006
- maxHeight,
5007
- locale,
5008
- ...props
5009
- } = this.props;
5010
- const showMoreLessKey = this.state.collapsed ? 'showMore' : 'showLess';
5011
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
5012
- className: (0, _classnames.default)(baseClassName, {
5013
- [`${baseClassName}--collapse`]: this.state.collapsed === true,
5014
- [`${baseClassName}--expand`]: this.state.collapsed === false
5015
- }, className),
5016
- ...props,
5017
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactMeasure.default, {
5018
- onResize: this.handleResize,
5019
- innerRef: el => {
5020
- this.contentRef.current = el;
5021
- },
5022
- children: _ref2 => {
5023
- let {
5024
- measureRef
5025
- } = _ref2;
5026
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
5027
- className: `${baseClassName}__content`,
5028
- style: {
5029
- maxHeight
5030
- },
5031
- ref: measureRef,
5032
- children: children
5033
- });
5034
- }
5035
- }), this.state.collapsed !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
5036
- className: `${baseClassName}__action`,
5037
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Link.default, {
5038
- onClick: this.handleToggle,
5039
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Translate.default, {
5040
- content: `Cuttable.${showMoreLessKey}`,
5041
- fallback: locale[showMoreLessKey]
5042
- })
4968
+ const Cuttable = _ref => {
4969
+ let {
4970
+ children,
4971
+ collapsed: externalCollapsed = true,
4972
+ maxHeight = '7rem',
4973
+ locale = {
4974
+ showMore: 'Show more',
4975
+ showLess: 'Show less'
4976
+ },
4977
+ className,
4978
+ baseClassName = `${_constants.CLS_PREFIX}cuttable`,
4979
+ ...props
4980
+ } = _ref;
4981
+ const contentRef = (0, _react.useRef)(null);
4982
+ const hiddenElementRef = (0, _react.useRef)(null);
4983
+ const [collapsed, setCollapsed] = (0, _react.useState)(externalCollapsed);
4984
+ const [prevExternalCollapsed, setPrevExternalCollapsed] = (0, _react.useState)(externalCollapsed);
4985
+ if (prevExternalCollapsed !== externalCollapsed) {
4986
+ setPrevExternalCollapsed(externalCollapsed);
4987
+ setCollapsed(externalCollapsed);
4988
+ }
4989
+ const actionLocaleKey = collapsed ? 'showMore' : 'showLess';
4990
+ const isContentOverflowing = (0, _useContentOverflow.useContentOverflow)({
4991
+ contentRef,
4992
+ hiddenElementRef,
4993
+ maxHeight
4994
+ });
4995
+ const toggle = () => setCollapsed(!collapsed);
4996
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
4997
+ className: (0, _classnames.default)(baseClassName, {
4998
+ [`${baseClassName}--collapse`]: collapsed,
4999
+ [`${baseClassName}--expand`]: !collapsed
5000
+ }, className),
5001
+ ...props,
5002
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
5003
+ ref: contentRef,
5004
+ className: `${baseClassName}__content`,
5005
+ style: {
5006
+ maxHeight
5007
+ },
5008
+ children: children
5009
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
5010
+ ref: hiddenElementRef,
5011
+ className: `${baseClassName}__height-meter `,
5012
+ style: {
5013
+ height: maxHeight
5014
+ },
5015
+ "aria-hidden": true
5016
+ }), isContentOverflowing && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
5017
+ className: `${baseClassName}__action`,
5018
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Link.default, {
5019
+ onClick: toggle,
5020
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Translate.default, {
5021
+ content: `Cuttable.${actionLocaleKey}`,
5022
+ fallback: locale[actionLocaleKey]
5043
5023
  })
5044
- })]
5045
- });
5046
- }
5047
- }
5048
- _defineProperty(Cuttable, "defaultProps", {
5049
- collapsed: true,
5050
- maxHeight: '7rem',
5051
- locale: {
5052
- showMore: 'Show more',
5053
- showLess: 'Show less'
5054
- },
5055
- baseClassName: `${_constants.CLS_PREFIX}cuttable`
5056
- });
5024
+ })
5025
+ })]
5026
+ });
5027
+ };
5057
5028
  var _default = exports["default"] = Cuttable;
5058
5029
 
5059
5030
  /***/ }),
@@ -5081,6 +5052,51 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
5081
5052
 
5082
5053
  /***/ }),
5083
5054
 
5055
+ /***/ "./components/Cuttable/useContentOverflow.tsx":
5056
+ /*!****************************************************!*\
5057
+ !*** ./components/Cuttable/useContentOverflow.tsx ***!
5058
+ \****************************************************/
5059
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5060
+
5061
+ "use strict";
5062
+
5063
+
5064
+ Object.defineProperty(exports, "__esModule", ({
5065
+ value: true
5066
+ }));
5067
+ exports.useContentOverflow = void 0;
5068
+ var _react = __webpack_require__(/*! react */ "react");
5069
+ var _hooks = __webpack_require__(/*! ../../hooks */ "./hooks/index.tsx");
5070
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
5071
+
5072
+ const useContentOverflow = _ref => {
5073
+ let {
5074
+ contentRef,
5075
+ hiddenElementRef,
5076
+ maxHeight
5077
+ } = _ref;
5078
+ const [isOverflowing, setIsOverflowing] = (0, _react.useState)(false);
5079
+ const checkHeight = () => {
5080
+ const contentElement = contentRef.current;
5081
+ const hiddenElement = hiddenElementRef.current;
5082
+ if (!contentElement || !hiddenElement) return;
5083
+ setIsOverflowing(contentElement.scrollHeight > hiddenElement.getBoundingClientRect().height);
5084
+ };
5085
+ const checkHeightRef = (0, _react.useRef)(checkHeight);
5086
+ checkHeightRef.current = checkHeight;
5087
+ (0, _react.useLayoutEffect)(() => {
5088
+ checkHeightRef.current();
5089
+ }, [maxHeight]);
5090
+ (0, _hooks.useResizeObserver)({
5091
+ ref: contentRef,
5092
+ onResize: checkHeight
5093
+ });
5094
+ return isOverflowing;
5095
+ };
5096
+ exports.useContentOverflow = useContentOverflow;
5097
+
5098
+ /***/ }),
5099
+
5084
5100
  /***/ "./components/Dialog/Dialog.tsx":
5085
5101
  /*!**************************************!*\
5086
5102
  !*** ./components/Dialog/Dialog.tsx ***!
@@ -5157,7 +5173,7 @@ const Dialog = _ref => {
5157
5173
  }, [isOpen]);
5158
5174
  const renderImage = (image, block) => {
5159
5175
  const classPrefix = `${baseClassName}__${block}`;
5160
- if ( /*#__PURE__*/(0, _react.isValidElement)(image)) {
5176
+ if (/*#__PURE__*/(0, _react.isValidElement)(image)) {
5161
5177
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
5162
5178
  className: classPrefix,
5163
5179
  children: image
@@ -5232,7 +5248,7 @@ const Dialog = _ref => {
5232
5248
  };
5233
5249
  let childrenElement;
5234
5250
  if (form) {
5235
- if ( /*#__PURE__*/(0, _react.isValidElement)(form)) {
5251
+ if (/*#__PURE__*/(0, _react.isValidElement)(form)) {
5236
5252
  childrenElement = /*#__PURE__*/(0, _react.cloneElement)(form, {
5237
5253
  cancelButton: getCancelButtonProps(form.props),
5238
5254
  footerClassName: (0, _classnames.default)(form.props.footerClassName, `${baseClassName}__form-footer`)
@@ -5456,7 +5472,7 @@ const Drawer = _ref => {
5456
5472
  });
5457
5473
  }
5458
5474
  if (form) {
5459
- if ( /*#__PURE__*/(0, _react.isValidElement)(form)) {
5475
+ if (/*#__PURE__*/(0, _react.isValidElement)(form)) {
5460
5476
  return /*#__PURE__*/(0, _react.cloneElement)(form, {
5461
5477
  className: (0, _classnames.default)(`${baseClassName}__form`, form.props.className),
5462
5478
  cancelButton: form.props.cancelButton === false ? false : {
@@ -5902,7 +5918,7 @@ const createTarget = (node, _ref) => {
5902
5918
  onToggle,
5903
5919
  targetRef
5904
5920
  } = _ref;
5905
- if (!( /*#__PURE__*/(0, _react.isValidElement)(node) && node.type !== _Translate.default)) {
5921
+ if (!(/*#__PURE__*/(0, _react.isValidElement)(node) && node.type !== _Translate.default)) {
5906
5922
  node = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
5907
5923
  caret: true,
5908
5924
  children: node
@@ -7037,7 +7053,7 @@ class Form extends _react.Component {
7037
7053
  } = this.props;
7038
7054
  if (Array.isArray(additionalButtons)) {
7039
7055
  return additionalButtons.map(element => {
7040
- if ( /*#__PURE__*/(0, _react.isValidElement)(element)) {
7056
+ if (/*#__PURE__*/(0, _react.isValidElement)(element)) {
7041
7057
  const props = {
7042
7058
  className: (0, _classnames.default)(element.props.className, `${baseClassName}__additional-button`)
7043
7059
  };
@@ -9476,7 +9492,7 @@ const create = function (icon) {
9476
9492
  if (!icon) {
9477
9493
  return icon;
9478
9494
  }
9479
- if ( /*#__PURE__*/(0, _react.isValidElement)(icon)) {
9495
+ if (/*#__PURE__*/(0, _react.isValidElement)(icon)) {
9480
9496
  const {
9481
9497
  className,
9482
9498
  ...props
@@ -10235,7 +10251,7 @@ const Item = _ref => {
10235
10251
  children: title
10236
10252
  });
10237
10253
  }
10238
- if ( /*#__PURE__*/(0, _react.isValidElement)(title)) {
10254
+ if (/*#__PURE__*/(0, _react.isValidElement)(title)) {
10239
10255
  title = /*#__PURE__*/(0, _react.cloneElement)(title, {
10240
10256
  className: (0, _classnames.default)(`${baseClassName}__title`, title.props.className)
10241
10257
  });
@@ -10546,7 +10562,7 @@ class ItemList extends _react.Component {
10546
10562
  } = this.props;
10547
10563
  if (reorderable) {
10548
10564
  // @ts-ignore
10549
- Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__( /* webpackChunkName: "react-sortable-hoc" *//*! react-sortable-hoc */ "../node_modules/react-sortable-hoc/dist/commonjs/index.js"))).then(_ref2 => {
10565
+ Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/* webpackChunkName: "react-sortable-hoc" *//*! react-sortable-hoc */ "../node_modules/react-sortable-hoc/dist/commonjs/index.js"))).then(_ref2 => {
10550
10566
  let {
10551
10567
  sortableContainer,
10552
10568
  sortableElement
@@ -10568,7 +10584,7 @@ class ItemList extends _react.Component {
10568
10584
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
10569
10585
  ...props,
10570
10586
  children: _react.Children.map(children, child => {
10571
- if ( /*#__PURE__*/(0, _react.isValidElement)(child)) {
10587
+ if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
10572
10588
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridCol.default, {
10573
10589
  className: (0, _classnames.default)(`${baseClassName}__col`),
10574
10590
  children: /*#__PURE__*/(0, _react.cloneElement)(child, this.createItemProps(child))
@@ -10637,7 +10653,7 @@ class ItemList extends _react.Component {
10637
10653
  onSortEnd: onReorderEnd,
10638
10654
  ...props,
10639
10655
  children: _react.Children.map(children, (child, index) => {
10640
- if ( /*#__PURE__*/(0, _react.isValidElement)(child)) {
10656
+ if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
10641
10657
  const {
10642
10658
  disabled
10643
10659
  } = child.props;
@@ -10848,7 +10864,7 @@ const Layer = _ref => {
10848
10864
  const parentLevel = (0, _react.useContext)(LevelContext);
10849
10865
  const container = (0, _react.useContext)(PortalContext) || document.body;
10850
10866
  const renderChildren = () => {
10851
- if ( /*#__PURE__*/(0, _react.isValidElement)(children)) {
10867
+ if (/*#__PURE__*/(0, _react.isValidElement)(children)) {
10852
10868
  return /*#__PURE__*/(0, _react.cloneElement)(children, {
10853
10869
  style: {
10854
10870
  ...children.props.style,
@@ -10858,7 +10874,7 @@ const Layer = _ref => {
10858
10874
  }
10859
10875
  return children;
10860
10876
  };
10861
- return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/(0, _jsxRuntime.jsx)(LevelContext.Provider, {
10877
+ return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsx)(LevelContext.Provider, {
10862
10878
  value: parentLevel + level,
10863
10879
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
10864
10880
  className: (0, _classnames.default)(baseClassName, className),
@@ -11554,7 +11570,7 @@ const getHumanTotalRows = _ref2 => {
11554
11570
  });
11555
11571
  switch (mode) {
11556
11572
  case 'totalRows':
11557
- return wrapToText( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Translate.default, {
11573
+ return wrapToText(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Translate.default, {
11558
11574
  namespace: "List",
11559
11575
  content: "totalRows",
11560
11576
  fallback: "%%totalRows%% items total",
@@ -11564,7 +11580,7 @@ const getHumanTotalRows = _ref2 => {
11564
11580
  translators: translators
11565
11581
  }));
11566
11582
  case 'selectedRows':
11567
- return wrapToText( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Translate.default, {
11583
+ return wrapToText(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Translate.default, {
11568
11584
  namespace: "List",
11569
11585
  content: "selectedRows",
11570
11586
  fallback: "%%selectedRows%% of %%totalRows%% items selected",
@@ -11578,7 +11594,7 @@ const getHumanTotalRows = _ref2 => {
11578
11594
  translators: translators
11579
11595
  }));
11580
11596
  case 'selectedAllRows':
11581
- return wrapToText( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Translate.default, {
11597
+ return wrapToText(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Translate.default, {
11582
11598
  namespace: "List",
11583
11599
  content: "selectedRows",
11584
11600
  fallback: "%%selectedRows%% of %%totalRows%% items selected",
@@ -11864,7 +11880,7 @@ class List extends _react.Component {
11864
11880
  }
11865
11881
  }
11866
11882
  applyReorderableList() {
11867
- Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__( /* webpackChunkName: "react-movable" *//*! @plesk/react-movable */ "../node_modules/@plesk/react-movable/lib/index.js"))).then(_ref6 => {
11883
+ Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/* webpackChunkName: "react-movable" *//*! @plesk/react-movable */ "../node_modules/@plesk/react-movable/lib/index.js"))).then(_ref6 => {
11868
11884
  let {
11869
11885
  List: ReorderableList
11870
11886
  } = _ref6;
@@ -12920,7 +12936,7 @@ const ListActions = _ref => {
12920
12936
  const secondaryItems = [];
12921
12937
  let secondaryCount = 0;
12922
12938
  _react.Children.toArray(children).forEach((node, index) => {
12923
- if ( /*#__PURE__*/(0, _react.isValidElement)(node) && node.type === _ListAction.default) {
12939
+ if (/*#__PURE__*/(0, _react.isValidElement)(node) && node.type === _ListAction.default) {
12924
12940
  const {
12925
12941
  primary,
12926
12942
  hidden
@@ -12933,7 +12949,7 @@ const ListActions = _ref => {
12933
12949
  } else {
12934
12950
  secondaryCount++;
12935
12951
  if (!hidden) {
12936
- secondaryItems.push( /*#__PURE__*/(0, _react.cloneElement)(node, {
12952
+ secondaryItems.push(/*#__PURE__*/(0, _react.cloneElement)(node, {
12937
12953
  primary: false
12938
12954
  }));
12939
12955
  }
@@ -13385,7 +13401,7 @@ const applyParams = function (message) {
13385
13401
  if (param === undefined) {
13386
13402
  result.push(m[0]);
13387
13403
  } else if (typeof param === 'object' && /*#__PURE__*/(0, _react.isValidElement)(param)) {
13388
- result.push( /*#__PURE__*/(0, _react.cloneElement)(param, {
13404
+ result.push(/*#__PURE__*/(0, _react.cloneElement)(param, {
13389
13405
  key: m[1]
13390
13406
  }));
13391
13407
  hasElements = true;
@@ -13664,7 +13680,7 @@ const Media = _ref => {
13664
13680
  children: title
13665
13681
  });
13666
13682
  }
13667
- if ( /*#__PURE__*/(0, _react.isValidElement)(title)) {
13683
+ if (/*#__PURE__*/(0, _react.isValidElement)(title)) {
13668
13684
  return /*#__PURE__*/(0, _react.cloneElement)(title, {
13669
13685
  className: (0, _classnames.default)(`${baseClassName}__title`, title.props.className)
13670
13686
  });
@@ -13802,7 +13818,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
13802
13818
  const hasIconItem = children => {
13803
13819
  let result = false;
13804
13820
  _react.Children.forEach(children, child => {
13805
- if ( /*#__PURE__*/(0, _react.isValidElement)(child) && (child.type === _MenuSelectableItem.default || child.props.icon)) {
13821
+ if (/*#__PURE__*/(0, _react.isValidElement)(child) && (child.type === _MenuSelectableItem.default || child.props.icon)) {
13806
13822
  result = true;
13807
13823
  }
13808
13824
  });
@@ -14431,7 +14447,7 @@ const OverlayCore = _ref => {
14431
14447
  const renderImage = sideBanner => {
14432
14448
  const classPrefix = `${baseClassName}__side`;
14433
14449
  let element = null;
14434
- if ( /*#__PURE__*/(0, _react.isValidElement)(sideBanner)) {
14450
+ if (/*#__PURE__*/(0, _react.isValidElement)(sideBanner)) {
14435
14451
  element = sideBanner;
14436
14452
  } else if (typeof sideBanner === 'string') {
14437
14453
  element = /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -15730,7 +15746,7 @@ class Progress extends _react.Component {
15730
15746
  let isFailed = false;
15731
15747
  if (children) {
15732
15748
  _react.Children.forEach(children, child => {
15733
- if ( /*#__PURE__*/(0, _react.isValidElement)(child)) {
15749
+ if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
15734
15750
  const status = child.props.status ?? _ProgressStep.PROGRESS_STEP_DEFAULT_STATUS;
15735
15751
  isNotStarted = isNotStarted && status === _ProgressStep.STATUS_NOT_STARTED;
15736
15752
  isFinished = isFinished && status === _ProgressStep.STATUS_DONE;
@@ -16996,6 +17012,137 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
16996
17012
 
16997
17013
  /***/ }),
16998
17014
 
17015
+ /***/ "./components/SegmentedControl/ButtonGroupControl.tsx":
17016
+ /*!************************************************************!*\
17017
+ !*** ./components/SegmentedControl/ButtonGroupControl.tsx ***!
17018
+ \************************************************************/
17019
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
17020
+
17021
+ "use strict";
17022
+
17023
+
17024
+ Object.defineProperty(exports, "__esModule", ({
17025
+ value: true
17026
+ }));
17027
+ exports["default"] = void 0;
17028
+ var _react = __webpack_require__(/*! react */ "react");
17029
+ var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../node_modules/classnames/index.js"));
17030
+ var _Button = _interopRequireDefault(__webpack_require__(/*! ../Button */ "./components/Button/index.tsx"));
17031
+ var _ButtonGroup = _interopRequireDefault(__webpack_require__(/*! ../ButtonGroup */ "./components/ButtonGroup/index.tsx"));
17032
+ var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
17033
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17034
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
17035
+
17036
+ const ButtonGroupControl = _ref => {
17037
+ let {
17038
+ buttons,
17039
+ selectedValues,
17040
+ onClick,
17041
+ ghost,
17042
+ monospaced,
17043
+ isResponsive,
17044
+ baseClassName
17045
+ } = _ref;
17046
+ const buttonsRef = (0, _react.useRef)([]);
17047
+ const [monoWidth, setMonoWidth] = (0, _react.useState)(0);
17048
+ (0, _react.useLayoutEffect)(() => {
17049
+ if (!monospaced) return;
17050
+ const widths = buttonsRef.current.map(button => button.getBoundingClientRect().width);
17051
+ const maxWidth = Math.max(...widths);
17052
+ if (monoWidth !== maxWidth) {
17053
+ setMonoWidth(maxWidth);
17054
+ }
17055
+ }, [monospaced, monoWidth]);
17056
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroup.default, {
17057
+ className: `${baseClassName}__button-group`,
17058
+ children: buttons.map((_ref2, index) => {
17059
+ let {
17060
+ value,
17061
+ title,
17062
+ style = {},
17063
+ ...buttonProps
17064
+ } = _ref2;
17065
+ const shouldApplyMonoWidth = !isResponsive && monospaced && monoWidth;
17066
+ const buttonStyle = {
17067
+ width: shouldApplyMonoWidth ? monoWidth : style.width,
17068
+ ...style
17069
+ };
17070
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
17071
+ ref: node => {
17072
+ index === 0 && (buttonsRef.current = []);
17073
+ node && buttonsRef.current.push(node);
17074
+ },
17075
+ selected: selectedValues.includes(value),
17076
+ ghost: ghost,
17077
+ onClick: () => onClick(value),
17078
+ ...buttonProps,
17079
+ className: (0, _classnames.default)(buttonProps.className, `${baseClassName}__button`),
17080
+ style: buttonStyle,
17081
+ children: title
17082
+ }, `${value}`);
17083
+ })
17084
+ });
17085
+ };
17086
+ var _default = exports["default"] = ButtonGroupControl;
17087
+
17088
+ /***/ }),
17089
+
17090
+ /***/ "./components/SegmentedControl/DropdownControl.tsx":
17091
+ /*!*********************************************************!*\
17092
+ !*** ./components/SegmentedControl/DropdownControl.tsx ***!
17093
+ \*********************************************************/
17094
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
17095
+
17096
+ "use strict";
17097
+
17098
+
17099
+ Object.defineProperty(exports, "__esModule", ({
17100
+ value: true
17101
+ }));
17102
+ exports["default"] = void 0;
17103
+ var _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../Dropdown */ "./components/Dropdown/index.tsx"));
17104
+ var _Menu = _interopRequireWildcard(__webpack_require__(/*! ../Menu */ "./components/Menu/index.tsx"));
17105
+ var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
17106
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17107
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17108
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17109
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
17110
+
17111
+ const DropdownControl = _ref => {
17112
+ let {
17113
+ buttons,
17114
+ selected,
17115
+ onClick
17116
+ } = _ref;
17117
+ const {
17118
+ title = ''
17119
+ } = buttons.find(button => button.value === selected) || {};
17120
+ const menu = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
17121
+ children: buttons.map(_ref2 => {
17122
+ let {
17123
+ title,
17124
+ value,
17125
+ ...buttonProps
17126
+ } = _ref2;
17127
+ const handleClick = () => {
17128
+ onClick(value);
17129
+ };
17130
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.MenuItem, {
17131
+ ...buttonProps,
17132
+ onClick: handleClick,
17133
+ children: title
17134
+ }, `${value}`);
17135
+ })
17136
+ });
17137
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default, {
17138
+ menu: menu,
17139
+ children: title
17140
+ });
17141
+ };
17142
+ var _default = exports["default"] = DropdownControl;
17143
+
17144
+ /***/ }),
17145
+
16999
17146
  /***/ "./components/SegmentedControl/SegmentedControl.tsx":
17000
17147
  /*!**********************************************************!*\
17001
17148
  !*** ./components/SegmentedControl/SegmentedControl.tsx ***!
@@ -17012,297 +17159,130 @@ exports["default"] = exports.SEGMENTED_CONTROL_BASE_CLASS_NAME = void 0;
17012
17159
  var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../node_modules/classnames/index.js"));
17013
17160
  var _react = __webpack_require__(/*! react */ "react");
17014
17161
  var _constants = __webpack_require__(/*! ../../constants */ "./constants.js");
17015
- var _Button = _interopRequireDefault(__webpack_require__(/*! ../Button */ "./components/Button/index.tsx"));
17016
- var _ButtonGroup = _interopRequireDefault(__webpack_require__(/*! ../ButtonGroup */ "./components/ButtonGroup/index.tsx"));
17017
- var _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../Dropdown */ "./components/Dropdown/index.tsx"));
17018
- var _Menu = _interopRequireWildcard(__webpack_require__(/*! ../Menu */ "./components/Menu/index.tsx"));
17019
17162
  var _ResponsiveContext = _interopRequireDefault(__webpack_require__(/*! ../ResponsiveContext */ "./components/ResponsiveContext/index.tsx"));
17020
17163
  var _Squeezer = _interopRequireDefault(__webpack_require__(/*! ../Squeezer */ "./components/Squeezer/index.tsx"));
17164
+ var _DropdownControl = _interopRequireDefault(__webpack_require__(/*! ./DropdownControl */ "./components/SegmentedControl/DropdownControl.tsx"));
17165
+ var _ButtonGroupControl = _interopRequireDefault(__webpack_require__(/*! ./ButtonGroupControl */ "./components/SegmentedControl/ButtonGroupControl.tsx"));
17166
+ var _useResponsive = __webpack_require__(/*! ./useResponsive */ "./components/SegmentedControl/useResponsive.tsx");
17167
+ var _useSelected = __webpack_require__(/*! ./useSelected */ "./components/SegmentedControl/useSelected.tsx");
17021
17168
  __webpack_require__(/*! ../../helpers/base.less */ "./helpers/base.less");
17022
17169
  __webpack_require__(/*! ./SegmentedControl.less */ "./components/SegmentedControl/SegmentedControl.less");
17023
17170
  var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
17024
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17025
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17026
17171
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17027
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17028
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
17029
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
17030
- const alphaSort = (a, b) => a > b ? 1 : -1;
17172
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
17173
+
17031
17174
  const SEGMENTED_CONTROL_BASE_CLASS_NAME = exports.SEGMENTED_CONTROL_BASE_CLASS_NAME = `${_constants.CLS_PREFIX}segmented-control`;
17032
17175
 
17033
17176
  /**
17034
- * `Segmented Control` is a group of several [Buttons](#!/Button)
17177
+ * `Segmented Control` is a group of several [Buttons](#!/Button)
17035
17178
  * each of which functions as a mutually exclusive option.
17036
17179
  * @since 0.0.68
17037
17180
  */
17038
- class SegmentedControl extends _react.Component {
17039
- constructor() {
17040
- super(...arguments);
17041
- _defineProperty(this, "state", {
17042
- selected: this.props.selected,
17043
- monoWidth: 0
17044
- });
17045
- _defineProperty(this, "context", void 0);
17046
- _defineProperty(this, "isCompact", false);
17047
- _defineProperty(this, "rootRef", /*#__PURE__*/(0, _react.createRef)());
17048
- _defineProperty(this, "adjustMonospaced", () => {
17049
- const {
17050
- baseClassName,
17051
- monospaced
17052
- } = this.props;
17053
- if (monospaced) {
17054
- let monoWidth = 0;
17055
- this.rootRef.current?.querySelectorAll(`.${baseClassName}__button`).forEach(el => {
17056
- monoWidth = Math.max(monoWidth, el.getBoundingClientRect().width);
17057
- });
17058
- if (monoWidth !== this.state.monoWidth) {
17059
- this.setState({
17060
- monoWidth
17061
- });
17062
- }
17063
- }
17064
- });
17065
- _defineProperty(this, "handleChange", value => () => {
17066
- const {
17067
- multiple,
17068
- onChange
17069
- } = this.props;
17070
- const {
17071
- selected
17072
- } = this.state;
17073
- let prevSelected = selected;
17074
- let newSelected;
17075
- if (multiple) {
17076
- const isSelectedArray = Array.isArray(selected);
17077
- newSelected = isSelectedArray ? [...selected] : [];
17078
- if (!isSelectedArray || selected.indexOf(value) === -1) {
17079
- newSelected.push(value);
17080
- } else {
17081
- newSelected.splice(selected.indexOf(value), 1);
17082
- }
17083
- newSelected.sort(alphaSort);
17084
- if (isSelectedArray) {
17085
- prevSelected = [...selected].sort(alphaSort);
17086
- }
17087
- } else {
17088
- newSelected = value;
17089
- }
17090
- if (JSON.stringify(prevSelected) !== JSON.stringify(newSelected)) {
17091
- this.setState({
17092
- selected: newSelected
17093
- });
17094
- onChange?.(newSelected);
17095
- }
17096
- });
17097
- _defineProperty(this, "compact", () => {
17098
- if (this.isCompact) {
17099
- return false;
17100
- }
17101
- this.isCompact = true;
17102
- this.forceUpdate();
17103
- return true;
17104
- });
17105
- _defineProperty(this, "uncompact", () => {
17106
- if (!this.isCompact) {
17107
- return false;
17108
- }
17109
- this.isCompact = false;
17110
- this.forceUpdate();
17111
- return true;
17112
- });
17113
- }
17114
- static getDerivedStateFromProps(props, state) {
17115
- const {
17116
- selected,
17117
- multiple
17118
- } = props;
17119
- const {
17120
- prevSelected
17121
- } = state;
17122
- const nextState = {
17123
- selected: state.selected
17124
- };
17125
- if (selected !== prevSelected) {
17126
- nextState.selected = selected;
17127
- }
17128
- if (multiple && nextState.selected && !(nextState.selected instanceof Array)) {
17129
- nextState.selected = [nextState.selected];
17130
- }
17131
- nextState.prevSelected = selected;
17132
- return nextState;
17133
- }
17134
- componentDidMount() {
17135
- this.adjustMonospaced();
17136
- }
17137
- componentDidUpdate() {
17138
- this.adjustMonospaced();
17139
- }
17140
- isResponsive() {
17141
- return this.context === undefined ? this.isCompact : this.context;
17142
- }
17143
- renderControl() {
17144
- const {
17145
- buttons,
17146
- multiple
17147
- } = this.props;
17148
- const hasIcons = buttons.some(_ref => {
17181
+ const SegmentedControl = _ref => {
17182
+ let {
17183
+ label,
17184
+ labelPlacement = 'top',
17185
+ buttons,
17186
+ monospaced = false,
17187
+ multiple = false,
17188
+ selected: externalSelected,
17189
+ onChange,
17190
+ inline = false,
17191
+ ghost = false,
17192
+ className,
17193
+ baseClassName = SEGMENTED_CONTROL_BASE_CLASS_NAME,
17194
+ ...props
17195
+ } = _ref;
17196
+ const rootRef = (0, _react.useRef)(null);
17197
+ const {
17198
+ isResponsive,
17199
+ isInResponsiveContext,
17200
+ ...squeezerProps
17201
+ } = (0, _useResponsive.useResponsive)();
17202
+ const {
17203
+ selectedValues,
17204
+ handleChange
17205
+ } = (0, _useSelected.useSelected)({
17206
+ multiple,
17207
+ externalSelected,
17208
+ onChange
17209
+ });
17210
+ const renderControl = () => {
17211
+ const hasIcons = buttons.some(_ref2 => {
17149
17212
  let {
17150
17213
  icon
17151
- } = _ref;
17214
+ } = _ref2;
17152
17215
  return !!icon;
17153
17216
  });
17154
- if (!hasIcons && !multiple && this.isResponsive()) {
17155
- return this.renderDropdown();
17217
+ if (!hasIcons && !multiple && isResponsive) {
17218
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DropdownControl.default, {
17219
+ buttons: buttons,
17220
+ selected: selectedValues[0],
17221
+ onClick: handleChange
17222
+ });
17156
17223
  }
17157
- return this.renderButtonGroup();
17158
- }
17159
- renderDropdown() {
17160
- const {
17161
- buttons,
17162
- onChange
17163
- } = this.props;
17164
- const {
17165
- selected
17166
- } = this.state;
17167
- const {
17168
- title = ''
17169
- } = buttons.find(button => button.value === selected) || {};
17170
- const menu = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
17171
- children: buttons.map(_ref2 => {
17172
- let {
17173
- title,
17174
- value,
17175
- ...buttonProps
17176
- } = _ref2;
17177
- const menuItemProps = {};
17178
- if (onChange !== null) {
17179
- menuItemProps.onClick = this.handleChange(value);
17180
- }
17181
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.MenuItem, {
17182
- ...buttonProps,
17183
- ...menuItemProps,
17184
- children: title
17185
- }, `${value}`);
17186
- })
17187
- });
17188
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default, {
17189
- menu: menu,
17190
- children: title
17191
- });
17192
- }
17193
- renderButtonGroup() {
17194
- const {
17195
- buttons,
17196
- monospaced,
17197
- multiple,
17198
- onChange,
17199
- ghost,
17200
- baseClassName
17201
- } = this.props;
17202
- const {
17203
- selected,
17204
- monoWidth
17205
- } = this.state;
17206
- const isCollapsed = this.state.compact;
17207
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroup.default, {
17208
- className: `${baseClassName}__button-group`,
17209
- children: buttons.map(_ref3 => {
17210
- let {
17211
- value,
17212
- title,
17213
- ...buttonProps
17214
- } = _ref3;
17215
- // uncontrolled
17216
- const handler = {};
17217
- if (onChange !== null) {
17218
- handler.onClick = this.handleChange(value);
17219
- }
17220
- let buttonSelected = false;
17221
- if (multiple && selected && selected instanceof Array && selected.indexOf(value) !== -1) {
17222
- buttonSelected = true;
17223
- } else if (!multiple && selected === value) {
17224
- buttonSelected = true;
17225
- }
17226
- buttonProps.className = (0, _classnames.default)(buttonProps.className, `${baseClassName}__button`);
17227
- if (!isCollapsed && monospaced && monoWidth) {
17228
- buttonProps.style = {
17229
- width: monoWidth,
17230
- ...buttonProps.style
17231
- };
17232
- }
17233
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
17234
- selected: buttonSelected,
17235
- ghost: ghost,
17236
- ...handler,
17237
- ...buttonProps,
17238
- children: title
17239
- }, `${value}`);
17240
- })
17241
- });
17242
- }
17243
- render() {
17244
- const {
17245
- label,
17246
- labelPlacement,
17247
- buttons,
17248
- monospaced,
17249
- multiple,
17250
- selected: selectedProp,
17251
- onChange,
17252
- inline,
17253
- ghost,
17254
- className,
17255
- baseClassName,
17256
- ...props
17257
- } = this.props;
17258
- const isCollapsed = this.isResponsive();
17259
17224
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResponsiveContext.default.Provider, {
17260
- value: isCollapsed,
17261
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Squeezer.default, {
17262
- compact: this.compact,
17263
- uncompact: this.uncompact,
17264
- innerRef: el => {
17265
- // @ts-ignore
17266
- this.rootRef.current = el;
17267
- },
17268
- children: _ref4 => {
17269
- let {
17270
- ref
17271
- } = _ref4;
17272
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
17273
- ref: ref,
17274
- className: (0, _classnames.default)(baseClassName, {
17275
- [`${baseClassName}--inline`]: inline,
17276
- [`${baseClassName}--collapsed`]: isCollapsed,
17277
- [`${baseClassName}--vertical`]: label && labelPlacement === 'top'
17278
- }, className),
17279
- ...props,
17280
- children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
17281
- className: `${baseClassName}__label`,
17282
- children: label
17283
- }), this.renderControl()]
17284
- });
17285
- }
17225
+ value: isResponsive,
17226
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroupControl.default, {
17227
+ buttons: buttons,
17228
+ selectedValues: selectedValues,
17229
+ onClick: handleChange,
17230
+ ghost: ghost,
17231
+ isResponsive: isResponsive,
17232
+ monospaced: monospaced,
17233
+ baseClassName: baseClassName
17286
17234
  })
17287
17235
  });
17288
- }
17289
- }
17290
- _defineProperty(SegmentedControl, "defaultProps", {
17291
- label: null,
17292
- labelPlacement: 'top',
17293
- monospaced: false,
17294
- multiple: false,
17295
- onChange: null,
17296
- inline: false,
17297
- ghost: false,
17298
- className: null,
17299
- baseClassName: SEGMENTED_CONTROL_BASE_CLASS_NAME
17300
- });
17301
- _defineProperty(SegmentedControl, "contextType", _ResponsiveContext.default);
17236
+ };
17237
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
17238
+ ref: rootRef,
17239
+ className: (0, _classnames.default)(baseClassName, {
17240
+ [`${baseClassName}--inline`]: inline,
17241
+ [`${baseClassName}--collapsed`]: isResponsive,
17242
+ [`${baseClassName}--vertical`]: label && labelPlacement === 'top'
17243
+ }, className),
17244
+ ...props,
17245
+ children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
17246
+ className: `${baseClassName}__label`,
17247
+ children: label
17248
+ }), renderControl(), !isInResponsiveContext && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Squeezer.default, {
17249
+ ref: rootRef,
17250
+ ...squeezerProps
17251
+ })]
17252
+ });
17253
+ };
17302
17254
  var _default = exports["default"] = SegmentedControl;
17303
17255
 
17304
17256
  /***/ }),
17305
17257
 
17258
+ /***/ "./components/SegmentedControl/getSelectedValues.tsx":
17259
+ /*!***********************************************************!*\
17260
+ !*** ./components/SegmentedControl/getSelectedValues.tsx ***!
17261
+ \***********************************************************/
17262
+ /***/ ((__unused_webpack_module, exports) => {
17263
+
17264
+ "use strict";
17265
+
17266
+
17267
+ Object.defineProperty(exports, "__esModule", ({
17268
+ value: true
17269
+ }));
17270
+ exports.getSelectedValues = void 0;
17271
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
17272
+
17273
+ const getSelectedValues = selected => {
17274
+ if (selected === undefined) {
17275
+ return [];
17276
+ }
17277
+ if (Array.isArray(selected)) {
17278
+ return selected;
17279
+ }
17280
+ return [selected];
17281
+ };
17282
+ exports.getSelectedValues = getSelectedValues;
17283
+
17284
+ /***/ }),
17285
+
17306
17286
  /***/ "./components/SegmentedControl/index.tsx":
17307
17287
  /*!***********************************************!*\
17308
17288
  !*** ./components/SegmentedControl/index.tsx ***!
@@ -17333,6 +17313,110 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
17333
17313
 
17334
17314
  /***/ }),
17335
17315
 
17316
+ /***/ "./components/SegmentedControl/useResponsive.tsx":
17317
+ /*!*******************************************************!*\
17318
+ !*** ./components/SegmentedControl/useResponsive.tsx ***!
17319
+ \*******************************************************/
17320
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
17321
+
17322
+ "use strict";
17323
+
17324
+
17325
+ Object.defineProperty(exports, "__esModule", ({
17326
+ value: true
17327
+ }));
17328
+ exports.useResponsive = void 0;
17329
+ var _react = __webpack_require__(/*! react */ "react");
17330
+ var _ResponsiveContext = _interopRequireDefault(__webpack_require__(/*! ../ResponsiveContext */ "./components/ResponsiveContext/index.tsx"));
17331
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17332
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
17333
+
17334
+ const useResponsive = () => {
17335
+ const isResponsive = (0, _react.useContext)(_ResponsiveContext.default);
17336
+ const isInResponsiveContext = typeof isResponsive === 'boolean';
17337
+ const [isResponsiveInternal, setIsResponsiveInternal] = (0, _react.useState)(false);
17338
+ return {
17339
+ isResponsive: isInResponsiveContext ? isResponsive : isResponsiveInternal,
17340
+ isInResponsiveContext,
17341
+ compact: () => {
17342
+ setIsResponsiveInternal(true);
17343
+ return false;
17344
+ },
17345
+ expand: () => {
17346
+ setIsResponsiveInternal(false);
17347
+ return false;
17348
+ }
17349
+ };
17350
+ };
17351
+ exports.useResponsive = useResponsive;
17352
+
17353
+ /***/ }),
17354
+
17355
+ /***/ "./components/SegmentedControl/useSelected.tsx":
17356
+ /*!*****************************************************!*\
17357
+ !*** ./components/SegmentedControl/useSelected.tsx ***!
17358
+ \*****************************************************/
17359
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
17360
+
17361
+ "use strict";
17362
+
17363
+
17364
+ Object.defineProperty(exports, "__esModule", ({
17365
+ value: true
17366
+ }));
17367
+ exports.useSelected = void 0;
17368
+ var _react = __webpack_require__(/*! react */ "react");
17369
+ var _getSelectedValues = __webpack_require__(/*! ./getSelectedValues */ "./components/SegmentedControl/getSelectedValues.tsx");
17370
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
17371
+
17372
+ const alphaSort = (a, b) => a > b ? 1 : -1;
17373
+ const useSelected = _ref => {
17374
+ let {
17375
+ multiple,
17376
+ externalSelected,
17377
+ onChange
17378
+ } = _ref;
17379
+ const getExternal = () => multiple ? (0, _getSelectedValues.getSelectedValues)(externalSelected) : externalSelected;
17380
+ const [selected, setSelected] = (0, _react.useState)(getExternal());
17381
+ const [prevExternalSelected, setPrevExternalSelected] = (0, _react.useState)(externalSelected);
17382
+ if (prevExternalSelected !== externalSelected) {
17383
+ setPrevExternalSelected(externalSelected);
17384
+ if (selected !== externalSelected) {
17385
+ setSelected(getExternal());
17386
+ }
17387
+ }
17388
+ const handleChange = value => {
17389
+ let prevSelected = selected;
17390
+ let newSelected;
17391
+ if (multiple) {
17392
+ const isSelectedArray = Array.isArray(selected);
17393
+ newSelected = isSelectedArray ? [...selected] : [];
17394
+ if (!isSelectedArray || selected.indexOf(value) === -1) {
17395
+ newSelected.push(value);
17396
+ } else {
17397
+ newSelected.splice(selected.indexOf(value), 1);
17398
+ }
17399
+ newSelected.sort(alphaSort);
17400
+ if (isSelectedArray) {
17401
+ prevSelected = [...selected].sort(alphaSort);
17402
+ }
17403
+ } else {
17404
+ newSelected = value;
17405
+ }
17406
+ if (JSON.stringify(prevSelected) !== JSON.stringify(newSelected)) {
17407
+ setSelected(newSelected);
17408
+ onChange?.(newSelected);
17409
+ }
17410
+ };
17411
+ return {
17412
+ selectedValues: (0, _getSelectedValues.getSelectedValues)(selected),
17413
+ handleChange
17414
+ };
17415
+ };
17416
+ exports.useSelected = useSelected;
17417
+
17418
+ /***/ }),
17419
+
17336
17420
  /***/ "./components/Select/MultiValue.tsx":
17337
17421
  /*!******************************************!*\
17338
17422
  !*** ./components/Select/MultiValue.tsx ***!
@@ -17433,7 +17517,7 @@ const collect = function (children) {
17433
17517
  let group = arguments.length > 2 ? arguments[2] : undefined;
17434
17518
  const groups = [];
17435
17519
  _react.Children.forEach(children, child => {
17436
- if ( /*#__PURE__*/(0, _react.isValidElement)(child) && (child.type === _SelectOptionGroup.default || child.type === 'optgroup')) {
17520
+ if (/*#__PURE__*/(0, _react.isValidElement)(child) && (child.type === _SelectOptionGroup.default || child.type === 'optgroup')) {
17437
17521
  const {
17438
17522
  label,
17439
17523
  children,
@@ -17446,7 +17530,7 @@ const collect = function (children) {
17446
17530
  };
17447
17531
  groups.push(group);
17448
17532
  collect(children, options, group);
17449
- } else if ( /*#__PURE__*/(0, _react.isValidElement)(child) && (child.type === _SelectOption.default || child.type === 'option')) {
17533
+ } else if (/*#__PURE__*/(0, _react.isValidElement)(child) && (child.type === _SelectOption.default || child.type === 'option')) {
17450
17534
  // eslint-disable-next-line prefer-const
17451
17535
  let {
17452
17536
  value,
@@ -18829,96 +18913,18 @@ Object.defineProperty(exports, "__esModule", ({
18829
18913
  }));
18830
18914
  exports["default"] = void 0;
18831
18915
  var _react = __webpack_require__(/*! react */ "react");
18832
- var _reactMeasure = _interopRequireDefault(__webpack_require__(/*! react-measure */ "../node_modules/react-measure/dist/index.esm.js"));
18833
- var _utils = __webpack_require__(/*! ../utils */ "./components/utils.tsx");
18834
- var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
18835
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18836
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18837
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
18838
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
18839
- class Squeezer extends _react.Component {
18840
- constructor() {
18841
- super(...arguments);
18842
- _defineProperty(this, "rootRef", /*#__PURE__*/(0, _react.createRef)());
18843
- _defineProperty(this, "measuring", false);
18844
- _defineProperty(this, "measurements", []);
18845
- _defineProperty(this, "minWidth", 0);
18846
- _defineProperty(this, "handleResize", () => {
18847
- this.measure();
18848
- });
18849
- }
18850
- addMeasurement(width) {
18851
- this.measurements.push(width);
18852
- if (this.measurements.length > 2) {
18853
- this.measurements.shift();
18854
- }
18855
- }
18856
- measure() {
18857
- let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
18858
- const {
18859
- compact,
18860
- uncompact
18861
- } = this.props;
18862
- if (this.measuring && !force) {
18863
- return;
18864
- }
18865
- this.measuring = true;
18866
- const root = this.rootRef.current;
18867
- const width = Math.ceil(root.getBoundingClientRect().width);
18868
- const scrollWidth = Math.ceil(root.scrollWidth);
18869
- let checkForce = false;
18870
- if (width < scrollWidth) {
18871
- if (compact()) {
18872
- this.minWidth = scrollWidth;
18873
- checkForce = true;
18874
- }
18875
- } else if (width > this.minWidth) {
18876
- if (uncompact()) {
18877
- this.minWidth = width;
18878
- checkForce = true;
18879
- }
18880
- }
18881
- this.addMeasurement(width);
18882
- this.check(checkForce);
18883
- }
18884
- check() {
18885
- let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
18886
- if (!force && this.measurements.length === 2 && this.measurements[0] === this.measurements[1]) {
18887
- this.measuring = false;
18888
- } else {
18889
- this.setState({}, () => {
18890
- this.measure(true);
18891
- });
18892
- }
18893
- }
18894
- render() {
18895
- const {
18896
- children,
18897
- innerRef,
18898
- innerMeasure
18899
- } = this.props;
18900
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactMeasure.default, {
18901
- onResize: this.handleResize,
18902
- innerRef: el => {
18903
- if (el) {
18904
- this.rootRef.current = el;
18905
- (0, _utils.safeInvoke)(innerRef, el);
18906
- (0, _utils.safeInvoke)(innerMeasure, () => {
18907
- this.measure(true);
18908
- });
18909
- }
18910
- },
18911
- children: _ref => {
18912
- let {
18913
- measureRef
18914
- } = _ref;
18915
- return children({
18916
- ref: measureRef
18917
- });
18918
- }
18919
- });
18920
- }
18921
- }
18916
+ var _hooks = __webpack_require__(/*! ../../hooks */ "./hooks/index.tsx");
18917
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
18918
+
18919
+ /** Render-less useSqueeze wrapper */
18920
+ const Squeezer = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
18921
+ (0, _hooks.useSqueeze)({
18922
+ ref: ref,
18923
+ ...props
18924
+ });
18925
+ return null;
18926
+ });
18927
+ Squeezer.displayName = 'Squeezer';
18922
18928
  var _default = exports["default"] = Squeezer;
18923
18929
 
18924
18930
  /***/ }),
@@ -20333,7 +20339,7 @@ class Tabs extends _react.Component {
20333
20339
  children: label
20334
20340
  });
20335
20341
  }
20336
- if ( /*#__PURE__*/(0, _react.isValidElement)(label)) {
20342
+ if (/*#__PURE__*/(0, _react.isValidElement)(label)) {
20337
20343
  return /*#__PURE__*/(0, _react.cloneElement)(label, {
20338
20344
  className: (0, _classnames.default)(`${baseClassName}__${tabMode}-label`, label.props.className)
20339
20345
  });
@@ -21342,7 +21348,7 @@ _defineProperty(Toaster, "create", function () {
21342
21348
  let container = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.body;
21343
21349
  const containerElement = document.createElement('div');
21344
21350
  container.appendChild(containerElement);
21345
- return (0, _reactDom.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toaster, {
21351
+ return (0, _reactDom.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toaster, {
21346
21352
  ...props
21347
21353
  }), containerElement);
21348
21354
  });
@@ -21417,7 +21423,7 @@ class Registry {
21417
21423
  expand() {
21418
21424
  let changed = false;
21419
21425
  for (const item of this.items) {
21420
- if (this.checkItemIsCompactOrHasCompactItems(item)) {
21426
+ if (item.isExpandable) {
21421
21427
  item.expand();
21422
21428
  changed = true;
21423
21429
  break;
@@ -21433,18 +21439,20 @@ class Registry {
21433
21439
  return isCompact;
21434
21440
  });
21435
21441
  }
21436
- get hasCompactItems() {
21437
- return this.items.some(this.checkItemIsCompactOrHasCompactItems);
21438
- }
21439
- checkItemIsCompactOrHasCompactItems(item) {
21440
- return item.isCompact || 'hasCompactItems' in item && item.hasCompactItems;
21442
+ get isExpandable() {
21443
+ return this.items.some(_ref2 => {
21444
+ let {
21445
+ isExpandable
21446
+ } = _ref2;
21447
+ return isExpandable;
21448
+ });
21441
21449
  }
21442
21450
  }
21443
21451
  class RegistryItem {
21444
- constructor(_ref2) {
21452
+ constructor(_ref3) {
21445
21453
  let {
21446
21454
  onCompactStateChange
21447
- } = _ref2;
21455
+ } = _ref3;
21448
21456
  _defineProperty(this, "_isCompact", false);
21449
21457
  _defineProperty(this, "onCompactStateChange", void 0);
21450
21458
  this.onCompactStateChange = onCompactStateChange;
@@ -21460,6 +21468,9 @@ class RegistryItem {
21460
21468
  get isCompact() {
21461
21469
  return this._isCompact;
21462
21470
  }
21471
+ get isExpandable() {
21472
+ return this._isCompact;
21473
+ }
21463
21474
  }
21464
21475
  const useRegistry = () => {
21465
21476
  const parentRegistry = useRegistryContext();
@@ -21857,7 +21868,7 @@ const toMenuItem = (child, isLast, onItemClick) => {
21857
21868
  case _Dropdown.default:
21858
21869
  {
21859
21870
  let onMenuItemClick;
21860
- if ( /*#__PURE__*/(0, _react.isValidElement)(child.props.menu)) {
21871
+ if (/*#__PURE__*/(0, _react.isValidElement)(child.props.menu)) {
21861
21872
  ({
21862
21873
  onItemClick: onMenuItemClick
21863
21874
  } = child.props.menu.props);
@@ -21869,7 +21880,7 @@ const toMenuItem = (child, isLast, onItemClick) => {
21869
21880
  case _List.ListOperation:
21870
21881
  {
21871
21882
  const menuItem = toMenuItem(child.props.children, true, onItemClick);
21872
- if ( /*#__PURE__*/(0, _react.isValidElement)(menuItem)) {
21883
+ if (/*#__PURE__*/(0, _react.isValidElement)(menuItem)) {
21873
21884
  return /*#__PURE__*/(0, _react.cloneElement)(child, {
21874
21885
  children: /*#__PURE__*/(0, _react.cloneElement)(menuItem, {
21875
21886
  onClick: e => {
@@ -22245,7 +22256,7 @@ const Tour = _ref => {
22245
22256
  const spots = _react.Children.toArray(children);
22246
22257
  if (current !== undefined && current in spots) {
22247
22258
  const spot = spots[current];
22248
- if ( /*#__PURE__*/(0, _react.isValidElement)(spot)) {
22259
+ if (/*#__PURE__*/(0, _react.isValidElement)(spot)) {
22249
22260
  let popup;
22250
22261
  if (onClose && spot.props.popup) {
22251
22262
  popup = {
@@ -22411,7 +22422,7 @@ const isLikeText = node => {
22411
22422
  if (typeof node === 'string') {
22412
22423
  return true;
22413
22424
  }
22414
- if ( /*#__PURE__*/(0, _react.isValidElement)(node) && node.type === _Translate.default) {
22425
+ if (/*#__PURE__*/(0, _react.isValidElement)(node) && node.type === _Translate.default) {
22415
22426
  const {
22416
22427
  component,
22417
22428
  children
@@ -23714,12 +23725,19 @@ module.exports = {
23714
23725
  Object.defineProperty(exports, "__esModule", ({
23715
23726
  value: true
23716
23727
  }));
23728
+ Object.defineProperty(exports, "useResizeObserver", ({
23729
+ enumerable: true,
23730
+ get: function () {
23731
+ return _useResizeObserver.useResizeObserver;
23732
+ }
23733
+ }));
23717
23734
  Object.defineProperty(exports, "useSqueeze", ({
23718
23735
  enumerable: true,
23719
23736
  get: function () {
23720
23737
  return _useSqueeze.useSqueeze;
23721
23738
  }
23722
23739
  }));
23740
+ var _useResizeObserver = __webpack_require__(/*! ./useResizeObserver */ "./hooks/useResizeObserver.tsx");
23723
23741
  var _useSqueeze = __webpack_require__(/*! ./useSqueeze */ "./hooks/useSqueeze.tsx");
23724
23742
 
23725
23743
  /***/ }),
@@ -23823,7 +23841,8 @@ var _useMutationObserver = __webpack_require__(/*! ./useMutationObserver */ "./h
23823
23841
 
23824
23842
  const MUTATION_OBSERVER_OPTIONS = {
23825
23843
  subtree: true,
23826
- childList: true
23844
+ childList: true,
23845
+ characterData: true
23827
23846
  };
23828
23847
  const useSqueeze = _ref => {
23829
23848
  let {
@@ -87642,7 +87661,7 @@ function _setPrototypeOf(t, e) {
87642
87661
  /***/ ((module) => {
87643
87662
 
87644
87663
  "use strict";
87645
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.40.7","description":"Plesk UI Library","main":"index.js","module":"esm/index.js","types":"./types/src","sideEffects":["cjs/index.js","esm/index.js","dist/*.js","dist/*.css"],"scripts":{"pretest":"yarn lint","test":"jest --ci --coverage --coverageReporters text-summary","test:vr":"cross-env VISUAL_REGRESSION=true jest","build":"yarn build:types && yarn build:umd && yarn build:esm && yarn build:cjs","build:umd":"webpack --config ./configs/build.config.js","build:esm":"cross-env NODE_ENV=esm node ./scripts/build.js","build:cjs":"cross-env NODE_ENV=cjs node ./scripts/build.js","build:types":"rimraf ./types && tsc --project ./configs/types-generator.config.json","create-svg-sprite":"node ./scripts/create-svg-sprite.js","lint":"yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check","lint:es":"eslint --ext js,md,tsx src configs scripts styleguidist","lint:types":"tsc","lint:style":"stylelint \\"{src,styleguidist}/**/*.less\\"","format:check":"prettier --check src","format":"prettier --write src","styleguide":"styleguidist server --config ./configs/styleguide.config.js","styleguide:build":"rimraf ./styleguide && styleguidist build --config ./configs/styleguide.config.js","prepublishOnly":"yarn install && yarn test && yarn build && yarn styleguide:build","storybook":"webpack serve --config ./configs/storybook.config.js --allowed-hosts all","postinstall":"node ./scripts/postinstall.js"},"files":["esm","cjs","dist","styleguide","types","/scripts/postinstall.js","/index.js"],"dependencies":{"@babel/runtime":"^7.25.0","@plesk/react-movable":"^2.7.1","classnames":"^2.5.1","codemirror":"5.58.2","marked":"4.2.12","memoize-one":"^5.2.1","popper.js":"1.16.1","prop-types":"^15.8.1","react-measure":"2.5.2","react-sortable-hoc":"0.6.8","react-transition-group":"^4.4.5","scroll-into-view-if-needed":"^2.2.31","svg4everybody":"2.1.9","use-focus-visible":"^1.0.2"},"devDependencies":{"@babel/core":"^7.24.9","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-runtime":"^7.24.7","@babel/preset-env":"^7.25.0","@babel/preset-react":"^7.24.7","@babel/preset-typescript":"^7.24.7","@babel/types":"^7.25.0","@csstools/postcss-logical-float-and-clear":"^2.0.1","@plesk/eslint-config":"^3.0.0","@plesk/stylelint-config":"^2.0.0","@testing-library/dom":"^9.3.4","@testing-library/jest-dom":"^6.4.8","@testing-library/react":"^14.3.1","@testing-library/user-event":"^14.5.2","@types/buble":"^0.20.5","@types/classnames":"2.3.1","@types/codemirror":"^5.60.15","@types/doctrine":"^0.0.5","@types/jest":"^29.5.12","@types/jest-image-snapshot":"^6.4.0","@types/marked":"^4.3.2","@types/node":"^22.1.0","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@types/react-measure":"2.0.9","@types/react-transition-group":"^4.4.10","@types/svg4everybody":"2.1.2","@types/webpack-env":"^1.18.5","@typescript-eslint/eslint-plugin":"^6.21.0","@typescript-eslint/parser":"^6.21.0","autoprefixer":"^10.4.19","babel-loader":"^8.3.0","babel-plugin-transform-require-ignore":"^0.1.1","cross-env":"^7.0.3","css-loader":"^7.1.2","css-minimizer-webpack-plugin":"^7.0.0","eslint":"^8.57.0","eslint-config-prettier":"^8.10.0","eslint-plugin-markdown":"^3.0.1","html-webpack-plugin":"^5.6.0","jest":"^29.7.0","jest-dev-server":"^10.0.0","jest-environment-jsdom":"^29.7.0","jest-image-snapshot":"^6.4.0","less":"^4.2.0","less-loader":"^12.2.0","mini-css-extract-plugin":"^2.9.0","postcss":"^8.4.40","postcss-less":"^6.0.0","postcss-loader":"^8.1.1","postcss-logical":"^7.0.1","prettier":"^2.8.8","puppeteer-core":"22.8.2","react":"^18.3.1","react-docgen-typescript":"^2.2.2","react-dom":"^18.3.1","react-styleguidist":"^13.1.3","rimraf":"^6.0.1","rtlcss":"^4.2.0","style-loader":"^4.0.0","stylelint":"^15.11.0","stylelint-declaration-block-no-ignored-properties":"^2.8.0","stylelint-no-unsupported-browser-features":"^6.1.0","stylelint-prettier":"^3.0.0","stylelint-use-logical-spec":"^5.0.1","svg-mixer":"^2.3.14","terser-webpack-plugin":"^5.3.10","typescript":"5.2.2","webpack":"^5.93.0","webpack-cli":"^5.1.4"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"resolutions":{"trim":">=0.0.3"},"browserslist":["defaults","not op_mini all","not kaios > 0"],"author":"Plesk Developers <plesk-dev-leads@plesk.com> (https://www.plesk.com/)","license":"Apache-2.0"}');
87664
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.40.9","description":"Plesk UI Library","main":"index.js","module":"esm/index.js","types":"./types/src","sideEffects":["cjs/index.js","esm/index.js","dist/*.js","dist/*.css"],"scripts":{"pretest":"yarn lint","test":"jest --ci --coverage --coverageReporters text-summary","test:vr":"cross-env VISUAL_REGRESSION=true jest","build":"yarn build:types && yarn build:umd && yarn build:esm && yarn build:cjs","build:umd":"webpack --config ./configs/build.config.js","build:esm":"cross-env NODE_ENV=esm node ./scripts/build.js","build:cjs":"cross-env NODE_ENV=cjs node ./scripts/build.js","build:types":"rimraf ./types && tsc --project ./configs/types-generator.config.json","create-svg-sprite":"node ./scripts/create-svg-sprite.js","lint":"yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check","lint:es":"eslint --ext js,md,tsx src configs scripts styleguidist","lint:types":"tsc","lint:style":"stylelint \\"{src,styleguidist}/**/*.less\\"","format:check":"prettier --check src","format":"prettier --write src","styleguide":"styleguidist server --config ./configs/styleguide.config.js","styleguide:build":"rimraf ./styleguide && styleguidist build --config ./configs/styleguide.config.js","prepublishOnly":"yarn install && yarn test && yarn build && yarn styleguide:build","storybook":"webpack serve --config ./configs/storybook.config.js --allowed-hosts all","postinstall":"node ./scripts/postinstall.js"},"files":["esm","cjs","dist","styleguide","types","/scripts/postinstall.js","/index.js"],"dependencies":{"@babel/runtime":"^7.25.6","@plesk/react-movable":"^2.7.1","classnames":"^2.5.1","codemirror":"5.58.2","marked":"4.2.12","memoize-one":"^5.2.1","popper.js":"1.16.1","prop-types":"^15.8.1","react-measure":"2.5.2","react-sortable-hoc":"0.6.8","react-transition-group":"^4.4.5","scroll-into-view-if-needed":"^2.2.31","svg4everybody":"2.1.9","use-focus-visible":"^1.0.2"},"devDependencies":{"@babel/core":"^7.25.2","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-runtime":"^7.25.4","@babel/preset-env":"^7.25.4","@babel/preset-react":"^7.24.7","@babel/preset-typescript":"^7.24.7","@babel/types":"^7.25.6","@csstools/postcss-logical-float-and-clear":"^2.0.1","@plesk/eslint-config":"^3.0.0","@plesk/stylelint-config":"^2.0.0","@testing-library/dom":"^9.3.4","@testing-library/jest-dom":"^6.5.0","@testing-library/react":"^14.3.1","@testing-library/user-event":"^14.5.2","@types/buble":"^0.20.5","@types/classnames":"2.3.1","@types/codemirror":"^5.60.15","@types/doctrine":"^0.0.5","@types/jest":"^29.5.13","@types/jest-image-snapshot":"^6.4.0","@types/marked":"^4.3.2","@types/node":"^22.5.5","@types/react":"^18.3.8","@types/react-dom":"^18.3.0","@types/react-measure":"2.0.9","@types/react-transition-group":"^4.4.11","@types/svg4everybody":"2.1.2","@types/webpack-env":"^1.18.5","@typescript-eslint/eslint-plugin":"^6.21.0","@typescript-eslint/parser":"^6.21.0","autoprefixer":"^10.4.20","babel-loader":"^8.4.1","babel-plugin-transform-require-ignore":"^0.1.1","cross-env":"^7.0.3","css-loader":"^7.1.2","css-minimizer-webpack-plugin":"^7.0.0","eslint":"^8.57.1","eslint-config-prettier":"^8.10.0","eslint-plugin-markdown":"^3.0.1","html-webpack-plugin":"^5.6.0","jest":"^29.7.0","jest-dev-server":"^10.1.1","jest-environment-jsdom":"^29.7.0","jest-image-snapshot":"^6.4.0","less":"^4.2.0","less-loader":"^12.2.0","mini-css-extract-plugin":"^2.9.1","postcss":"^8.4.47","postcss-less":"^6.0.0","postcss-loader":"^8.1.1","postcss-logical":"^7.0.1","prettier":"^2.8.8","puppeteer-core":"22.8.2","react":"^18.3.1","react-docgen-typescript":"^2.2.2","react-dom":"^18.3.1","react-styleguidist":"^13.1.3","rimraf":"^6.0.1","rtlcss":"^4.3.0","style-loader":"^4.0.0","stylelint":"^15.11.0","stylelint-declaration-block-no-ignored-properties":"^2.8.0","stylelint-no-unsupported-browser-features":"^6.1.0","stylelint-prettier":"^3.0.0","stylelint-use-logical-spec":"^5.0.1","svg-mixer":"^2.3.14","terser-webpack-plugin":"^5.3.10","typescript":"5.2.2","webpack":"^5.94.0","webpack-cli":"^5.1.4"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"resolutions":{"trim":">=0.0.3"},"browserslist":["defaults","not op_mini all","not kaios > 0"],"author":"Plesk Developers <plesk-dev-leads@plesk.com> (https://www.plesk.com/)","license":"Apache-2.0"}');
87646
87665
 
87647
87666
  /***/ }),
87648
87667