@oliasoft-open-source/react-ui-library 4.19.2 → 4.19.3-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1989,6 +1989,7 @@ The `Table` component renders tabular data with various customization options.
1989
1989
  | Prop | Description | Default Value |
1990
1990
  |-----------------------|--------------------------------------------------------------------------------------------------|---------------|
1991
1991
  | `onListReorder` | Function called when rows are reordered. | `() => {}` |
1992
+ | `canListReorder` | Function to compare `from` and `to` to determine if reordering is allowed. | `() => true` |
1992
1993
  | `table` | An object containing table configuration. | |
1993
1994
  | `table.name` | Name or title of the table. | |
1994
1995
  | `table.actionsRight` | Determines if actions should be displayed on the right side of the table. | `false` |
package/dist/global.css CHANGED
@@ -9375,14 +9375,14 @@ tbody:after {
9375
9375
  justify-content: space-between;
9376
9376
  border-top: 1px solid var(--color-border);
9377
9377
  }
9378
- ._clickableRow_10f34_1 {
9378
+ ._clickableRow_kqvtd_1 {
9379
9379
  cursor: pointer;
9380
9380
  }
9381
- ._hoverableRow_10f34_4:not(._rowActive_10f34_4):hover,
9382
- ._clickableRow_10f34_1:not(._rowActive_10f34_4):hover {
9381
+ ._hoverableRow_kqvtd_4:not(._rowActive_kqvtd_4):hover,
9382
+ ._clickableRow_kqvtd_1:not(._rowActive_kqvtd_4):hover {
9383
9383
  background-color: var(--color-background-listitem-hover) !important;
9384
9384
  }
9385
- ._expandableRow_10f34_8._flush_10f34_8 {
9385
+ ._expandableRow_kqvtd_8._flush_kqvtd_8 {
9386
9386
  padding: 0 !important;
9387
9387
  height: auto !important;
9388
9388
  }
@@ -9392,11 +9392,11 @@ tr[data-warning] {
9392
9392
  tr[data-error] {
9393
9393
  background-color: var(--color-background-error-muted) !important;
9394
9394
  }
9395
- ._rowActive_10f34_4 {
9395
+ ._rowActive_kqvtd_4 {
9396
9396
  position: relative;
9397
9397
  background-color: var(--color-background-listitem-active) !important;
9398
9398
  }
9399
- ._rowActive_10f34_4:after {
9399
+ ._rowActive_kqvtd_4:after {
9400
9400
  content: '';
9401
9401
  position: absolute;
9402
9402
  left: 0;
@@ -9408,12 +9408,12 @@ tr[data-error] {
9408
9408
  transition: background 0.3s;
9409
9409
  background: var(--color-background-primary);
9410
9410
  }
9411
- ._dragIconCell_10f34_34 {
9411
+ ._dragIconCell_kqvtd_34 {
9412
9412
  width: var(--size);
9413
9413
  min-width: var(--size);
9414
9414
  position: relative;
9415
9415
  }
9416
- ._dragIcon_10f34_34 {
9416
+ ._dragIcon_kqvtd_34 {
9417
9417
  display: flex;
9418
9418
  align-items: center;
9419
9419
  justify-content: center;
@@ -9422,13 +9422,16 @@ tr[data-error] {
9422
9422
  color: var(--color-text-faint);
9423
9423
  cursor: grab;
9424
9424
  }
9425
- ._dragIcon_10f34_34:hover {
9425
+ ._dragIcon_kqvtd_34:hover {
9426
9426
  color: var(--color-text-primary-hover);
9427
9427
  }
9428
- ._dragIcon_10f34_34:active {
9428
+ ._dragIcon_kqvtd_34:active {
9429
9429
  cursor: grabbing;
9430
9430
  color: var(--color-text-primary-active);
9431
9431
  }
9432
+ ._dragIcon_kqvtd_34._dragIconDisabled_kqvtd_55 {
9433
+ cursor: not-allowed;
9434
+ }
9432
9435
  ._inputInTable_ie6ng_1 {
9433
9436
  background-color: transparent;
9434
9437
  border-radius: inherit !important;
package/dist/index.d.ts CHANGED
@@ -1346,6 +1346,10 @@ export declare interface ITableProps {
1346
1346
  from: number;
1347
1347
  to: number;
1348
1348
  }) => void;
1349
+ canListReorder?: (obj: {
1350
+ from: number;
1351
+ to: number;
1352
+ }) => boolean;
1349
1353
  table: ITableTableProps;
1350
1354
  }
1351
1355
 
package/dist/index.js CHANGED
@@ -199,27 +199,21 @@ function _objectWithoutPropertiesLoose$5(r2, e2) {
199
199
  }
200
200
  return t;
201
201
  }
202
- var _extends$6 = { exports: {} };
203
- var hasRequired_extends;
204
- function require_extends() {
205
- if (hasRequired_extends) return _extends$6.exports;
206
- hasRequired_extends = 1;
207
- (function(module) {
208
- function _extends3() {
209
- return module.exports = _extends3 = Object.assign ? Object.assign.bind() : function(n2) {
210
- for (var e2 = 1; e2 < arguments.length; e2++) {
211
- var t = arguments[e2];
212
- for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n2[r2] = t[r2]);
213
- }
214
- return n2;
215
- }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends3.apply(null, arguments);
202
+ function _extends$4() {
203
+ return _extends$4 = Object.assign ? Object.assign.bind() : function(n2) {
204
+ for (var e2 = 1; e2 < arguments.length; e2++) {
205
+ var t = arguments[e2];
206
+ for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n2[r2] = t[r2]);
216
207
  }
217
- module.exports = _extends3, module.exports.__esModule = true, module.exports["default"] = module.exports;
218
- })(_extends$6);
219
- return _extends$6.exports;
208
+ return n2;
209
+ }, _extends$4.apply(null, arguments);
220
210
  }
221
- var _extendsExports = require_extends();
222
- const _extends$5 = /* @__PURE__ */ getDefaultExportFromCjs(_extendsExports);
211
+ const _extends$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
212
+ __proto__: null,
213
+ get default() {
214
+ return _extends$4;
215
+ }
216
+ }, Symbol.toStringTag, { value: "Module" }));
223
217
  function _setPrototypeOf$3(t, e2) {
224
218
  return _setPrototypeOf$3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e3) {
225
219
  return t2.__proto__ = e3, t2;
@@ -798,7 +792,7 @@ var ReactSVG = /* @__PURE__ */ function(_React$Component) {
798
792
  };
799
793
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
800
794
  var _this3 = this;
801
- if (shallowDiffers(_extends$5({}, prevProps), this.props)) {
795
+ if (shallowDiffers(_extends$4({}, prevProps), this.props)) {
802
796
  this.setState(function() {
803
797
  return _this3.initialState;
804
798
  }, function() {
@@ -826,7 +820,7 @@ var ReactSVG = /* @__PURE__ */ function(_React$Component) {
826
820
  _this$props2.useRequestCache;
827
821
  var wrapper2 = _this$props2.wrapper, rest = _objectWithoutPropertiesLoose$5(_this$props2, _excluded$8);
828
822
  var Wrapper2 = wrapper2;
829
- return /* @__PURE__ */ React$4.createElement(Wrapper2, _extends$5({}, rest, {
823
+ return /* @__PURE__ */ React$4.createElement(Wrapper2, _extends$4({}, rest, {
830
824
  ref: this.refCallback
831
825
  }, wrapper2 === "svg" ? {
832
826
  xmlns: svgNamespace,
@@ -2241,8 +2235,8 @@ function _createClass(Constructor, protoProps, staticProps) {
2241
2235
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
2242
2236
  return Constructor;
2243
2237
  }
2244
- function _extends$4() {
2245
- _extends$4 = Object.assign || function(target) {
2238
+ function _extends$3() {
2239
+ _extends$3 = Object.assign || function(target) {
2246
2240
  for (var i = 1; i < arguments.length; i++) {
2247
2241
  var source = arguments[i];
2248
2242
  for (var key2 in source) {
@@ -2253,7 +2247,7 @@ function _extends$4() {
2253
2247
  }
2254
2248
  return target;
2255
2249
  };
2256
- return _extends$4.apply(this, arguments);
2250
+ return _extends$3.apply(this, arguments);
2257
2251
  }
2258
2252
  function _inheritsLoose$2(subClass, superClass) {
2259
2253
  subClass.prototype = Object.create(superClass.prototype);
@@ -2577,7 +2571,7 @@ function useTrackElements(_ref) {
2577
2571
  var layerRef = useTrackRef(useCallback(function(layer2) {
2578
2572
  var _get3 = get3(), previousLayer = _get3.layer;
2579
2573
  set2(function(state) {
2580
- return _extends$4({}, state, {
2574
+ return _extends$3({}, state, {
2581
2575
  layer: layer2
2582
2576
  });
2583
2577
  });
@@ -2600,7 +2594,7 @@ function useTrackElements(_ref) {
2600
2594
  var scrollContainers = getScrollContainers(trigger2);
2601
2595
  var _get4 = get3(), previousTrigger = _get4.trigger;
2602
2596
  set2(function(state) {
2603
- return _extends$4({}, state, {
2597
+ return _extends$3({}, state, {
2604
2598
  trigger: trigger2,
2605
2599
  scrollContainers
2606
2600
  });
@@ -2613,7 +2607,7 @@ function useTrackElements(_ref) {
2613
2607
  return;
2614
2608
  }
2615
2609
  set2(function(state) {
2616
- return _extends$4({}, state, {
2610
+ return _extends$3({}, state, {
2617
2611
  scrollContainers: getScrollContainers(triggerOptionParent)
2618
2612
  });
2619
2613
  });
@@ -2780,7 +2774,7 @@ var BoundSide = {
2780
2774
  left: /* @__PURE__ */ createSide("left"),
2781
2775
  right: /* @__PURE__ */ createSide("right")
2782
2776
  };
2783
- var Side = /* @__PURE__ */ _extends$4({}, BoundSide, {
2777
+ var Side = /* @__PURE__ */ _extends$3({}, BoundSide, {
2784
2778
  center: /* @__PURE__ */ createSide("center")
2785
2779
  });
2786
2780
  var SIDES = ["top", "left", "bottom", "right"];
@@ -2876,7 +2870,7 @@ var Bounds = /* @__PURE__ */ function() {
2876
2870
  var _environment$getCompu = environment2.getComputedStyle(element), width2 = _environment$getCompu.width, height2 = _environment$getCompu.height, boxSizing = _environment$getCompu.boxSizing, borderLeft = _environment$getCompu.borderLeft, borderRight = _environment$getCompu.borderRight, borderTop = _environment$getCompu.borderTop, borderBottom = _environment$getCompu.borderBottom, paddingLeft = _environment$getCompu.paddingLeft, paddingRight = _environment$getCompu.paddingRight, paddingTop = _environment$getCompu.paddingTop, paddingBottom = _environment$getCompu.paddingBottom;
2877
2871
  var boxWidth = boxSizing === "border-box" ? getPixelValue(width2) : sumOfPropertyValues(width2, borderLeft, borderRight, paddingLeft, paddingRight);
2878
2872
  var boxHeight = boxSizing === "border-box" ? getPixelValue(height2) : sumOfPropertyValues(height2, borderTop, borderBottom, paddingTop, paddingBottom);
2879
- bounds = new Bounds2(_extends$4({}, bounds, {
2873
+ bounds = new Bounds2(_extends$3({}, bounds, {
2880
2874
  width: boxWidth,
2881
2875
  height: boxHeight
2882
2876
  }));
@@ -2923,7 +2917,7 @@ var Bounds = /* @__PURE__ */ function() {
2923
2917
  };
2924
2918
  _proto.merge = function merge(partialBoundsOrMergeFn) {
2925
2919
  var current = this.toObject();
2926
- return new Bounds2(_extends$4({}, current, typeof partialBoundsOrMergeFn === "function" ? partialBoundsOrMergeFn(current) : partialBoundsOrMergeFn));
2920
+ return new Bounds2(_extends$3({}, current, typeof partialBoundsOrMergeFn === "function" ? partialBoundsOrMergeFn(current) : partialBoundsOrMergeFn));
2927
2921
  };
2928
2922
  _proto.substract = function substract(bounds) {
2929
2923
  var result = this.toObject();
@@ -2990,7 +2984,7 @@ var Placement = /* @__PURE__ */ function() {
2990
2984
  typeof layerDimensions === "function" ? layerDimensions(this.primary.prop) : layerDimensions
2991
2985
  );
2992
2986
  this.subjectsBounds = subjectBounds.merge({
2993
- layer: _extends$4({}, subjectBounds.layer, dimensions)
2987
+ layer: _extends$3({}, subjectBounds.layer, dimensions)
2994
2988
  });
2995
2989
  };
2996
2990
  _proto.getLayerBounds = function getLayerBounds(secondaryOffset) {
@@ -3165,7 +3159,7 @@ function getArrowStyle(subjectsBounds, placement, arrowOffset) {
3165
3159
  var primarySide = placement.primary.prop;
3166
3160
  var secondarySide = placement.primary.oppositeCssProp;
3167
3161
  var secondaryValue = triggerIsBigger ? layer2[sizeProperty] / 2 + negativeOffset : trigger2[secondarySide] + trigger2[sizeProperty] / 2 - layer2[secondarySide];
3168
- return _extends$4({}, STYLE_BASE, (_extends22 = {}, _extends22[primarySide] = "100%", _extends22[secondarySide] = limit(secondaryValue, min, max), _extends22));
3162
+ return _extends$3({}, STYLE_BASE, (_extends22 = {}, _extends22[primarySide] = "100%", _extends22[secondarySide] = limit(secondaryValue, min, max), _extends22));
3169
3163
  }
3170
3164
  var Placements = /* @__PURE__ */ function() {
3171
3165
  function Placements2(placements, config, subjectsBounds) {
@@ -3294,11 +3288,11 @@ var Placements = /* @__PURE__ */ function() {
3294
3288
  var arrow2 = getArrowStyle(this.subjectsBounds.merge({
3295
3289
  layer: layerBounds
3296
3290
  }), placement, this.config.arrowOffset);
3297
- var layer2 = this.config.overflowContainer ? _extends$4({}, layerStyleBase, {
3291
+ var layer2 = this.config.overflowContainer ? _extends$3({}, layerStyleBase, {
3298
3292
  position: "fixed",
3299
3293
  top: layerBounds.top,
3300
3294
  left: layerBounds.left
3301
- }) : _extends$4({}, layerStyleBase, {
3295
+ }) : _extends$3({}, layerStyleBase, {
3302
3296
  position: "absolute",
3303
3297
  top: layerBounds.top - this.subjectsBounds.parent.top + scrollOffsets.top - borderOffsets.top,
3304
3298
  left: layerBounds.left - this.subjectsBounds.parent.left + scrollOffsets.left - borderOffsets.left
@@ -3373,7 +3367,7 @@ var SubjectsBounds = /* @__PURE__ */ function() {
3373
3367
  };
3374
3368
  var _proto = SubjectsBounds2.prototype;
3375
3369
  _proto.merge = function merge(subjectsBounds) {
3376
- return new SubjectsBounds2(_extends$4({}, this, subjectsBounds), this.overflowContainer);
3370
+ return new SubjectsBounds2(_extends$3({}, this, subjectsBounds), this.overflowContainer);
3377
3371
  };
3378
3372
  _proto.offsetsToScrollContainers = function offsetsToScrollContainers(subject, allContainers) {
3379
3373
  if (allContainers === void 0) {
@@ -3608,10 +3602,10 @@ var Arrow = /* @__PURE__ */ forwardRef(function Arrow2(_ref2, ref) {
3608
3602
  var sizeA = size2;
3609
3603
  var sizeB = getWidthBasedOnAngle(angle, size2) * 2;
3610
3604
  var maxSize = Math.max(sizeA, sizeB);
3611
- return createElement("svg", _extends$4({
3605
+ return createElement("svg", _extends$3({
3612
3606
  ref
3613
3607
  }, rest, {
3614
- style: _extends$4({}, style, {
3608
+ style: _extends$3({}, style, {
3615
3609
  transform: "translate" + (side.isHorizontal ? "Y" : "X") + "(-50%)"
3616
3610
  }),
3617
3611
  width: maxSize,
@@ -8275,8 +8269,8 @@ function _interopRequireWildcard$2(obj, nodeInterop) {
8275
8269
  }
8276
8270
  return newObj;
8277
8271
  }
8278
- function _extends$3() {
8279
- _extends$3 = Object.assign ? Object.assign.bind() : function(target) {
8272
+ function _extends$2() {
8273
+ _extends$2 = Object.assign ? Object.assign.bind() : function(target) {
8280
8274
  for (var i = 1; i < arguments.length; i++) {
8281
8275
  var source = arguments[i];
8282
8276
  for (var key2 in source) {
@@ -8287,7 +8281,7 @@ function _extends$3() {
8287
8281
  }
8288
8282
  return target;
8289
8283
  };
8290
- return _extends$3.apply(this, arguments);
8284
+ return _extends$2.apply(this, arguments);
8291
8285
  }
8292
8286
  function _objectWithoutPropertiesLoose$3(source, excluded) {
8293
8287
  if (source == null) return {};
@@ -8492,7 +8486,7 @@ var Resizable$1 = /* @__PURE__ */ function(_React$Component) {
8492
8486
  children: [].concat(children.props.children, resizeHandles.map(function(handleAxis) {
8493
8487
  var _this3$handleRefs$han;
8494
8488
  var ref = (_this3$handleRefs$han = _this3.handleRefs[handleAxis]) != null ? _this3$handleRefs$han : _this3.handleRefs[handleAxis] = /* @__PURE__ */ React$2.createRef();
8495
- return /* @__PURE__ */ React$2.createElement(_reactDraggable.DraggableCore, _extends$3({}, draggableOpts, {
8489
+ return /* @__PURE__ */ React$2.createElement(_reactDraggable.DraggableCore, _extends$2({}, draggableOpts, {
8496
8490
  nodeRef: ref,
8497
8491
  key: "resizableHandle-" + handleAxis,
8498
8492
  onStop: _this3.resizeHandler("onResizeStop", handleAxis),
@@ -8563,8 +8557,8 @@ function _interopRequireWildcard$1(obj, nodeInterop) {
8563
8557
  }
8564
8558
  return newObj;
8565
8559
  }
8566
- function _extends$2() {
8567
- _extends$2 = Object.assign ? Object.assign.bind() : function(target) {
8560
+ function _extends$1() {
8561
+ _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
8568
8562
  for (var i = 1; i < arguments.length; i++) {
8569
8563
  var source = arguments[i];
8570
8564
  for (var key2 in source) {
@@ -8575,7 +8569,7 @@ function _extends$2() {
8575
8569
  }
8576
8570
  return target;
8577
8571
  };
8578
- return _extends$2.apply(this, arguments);
8572
+ return _extends$1.apply(this, arguments);
8579
8573
  }
8580
8574
  function ownKeys$1(object2, enumerableOnly) {
8581
8575
  var keys2 = Object.keys(object2);
@@ -8706,7 +8700,7 @@ var ResizableBox = /* @__PURE__ */ function(_React$Component) {
8706
8700
  resizeHandles,
8707
8701
  transformScale,
8708
8702
  width: this.state.width
8709
- }, /* @__PURE__ */ React$1.createElement("div", _extends$2({}, props, {
8703
+ }, /* @__PURE__ */ React$1.createElement("div", _extends$1({}, props, {
8710
8704
  style: _objectSpread$5(_objectSpread$5({}, style), {}, {
8711
8705
  width: this.state.width + "px",
8712
8706
  height: this.state.height + "px"
@@ -15698,15 +15692,6 @@ const useWindowWidth = () => {
15698
15692
  }, []);
15699
15693
  return width2;
15700
15694
  };
15701
- function _extends$1() {
15702
- return _extends$1 = Object.assign ? Object.assign.bind() : function(n2) {
15703
- for (var e2 = 1; e2 < arguments.length; e2++) {
15704
- var t = arguments[e2];
15705
- for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n2[r2] = t[r2]);
15706
- }
15707
- return n2;
15708
- }, _extends$1.apply(null, arguments);
15709
- }
15710
15695
  function _assertThisInitialized(e2) {
15711
15696
  if (void 0 === e2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
15712
15697
  return e2;
@@ -16079,7 +16064,7 @@ function createListComponent(_ref) {
16079
16064
  className,
16080
16065
  onScroll,
16081
16066
  ref: this._outerRefSetter,
16082
- style: _extends$1({
16067
+ style: _extends$4({
16083
16068
  position: "relative",
16084
16069
  height: height2,
16085
16070
  width: width2,
@@ -48167,6 +48152,7 @@ var interopRequireDefault = { exports: {} };
48167
48152
  module.exports = _interopRequireDefault2, module.exports.__esModule = true, module.exports["default"] = module.exports;
48168
48153
  })(interopRequireDefault);
48169
48154
  var interopRequireDefaultExports = interopRequireDefault.exports;
48155
+ const require$$2 = /* @__PURE__ */ getAugmentedNamespace(_extends$5);
48170
48156
  const richTextToolbar = "_richTextToolbar_1gbkk_1";
48171
48157
  const richTextToolbarContainer = "_richTextToolbarContainer_1gbkk_5";
48172
48158
  const styles$h = {
@@ -49467,7 +49453,7 @@ var Handle$2 = /* @__PURE__ */ React$4.forwardRef(function(props, ref) {
49467
49453
  }
49468
49454
  };
49469
49455
  var positionStyle = getDirectionStyle(direction, value, min, max);
49470
- var handleNode = /* @__PURE__ */ React$4.createElement("div", _extends$1({
49456
+ var handleNode = /* @__PURE__ */ React$4.createElement("div", _extends$4({
49471
49457
  ref,
49472
49458
  className: cx$2(handlePrefixCls, (_classNames = {}, _defineProperty$7(_classNames, "".concat(handlePrefixCls, "-").concat(valueIndex + 1), range2), _defineProperty$7(_classNames, "".concat(handlePrefixCls, "-dragging"), dragging), _classNames)),
49473
49459
  style: _objectSpread2$1(_objectSpread2$1({}, positionStyle), style),
@@ -49511,7 +49497,7 @@ var Handles = /* @__PURE__ */ React$4.forwardRef(function(props, ref) {
49511
49497
  };
49512
49498
  });
49513
49499
  return /* @__PURE__ */ React$4.createElement(React$4.Fragment, null, values2.map(function(value, index2) {
49514
- return /* @__PURE__ */ React$4.createElement(Handle$2, _extends$1({
49500
+ return /* @__PURE__ */ React$4.createElement(Handle$2, _extends$4({
49515
49501
  ref: function ref2(node2) {
49516
49502
  if (!node2) {
49517
49503
  delete handlesRef.current[index2];
@@ -50881,7 +50867,7 @@ Object.defineProperty(Handle$1, "__esModule", {
50881
50867
  value: true
50882
50868
  });
50883
50869
  var default_1 = Handle$1.default = void 0;
50884
- var _extends2 = _interopRequireDefault(require_extends());
50870
+ var _extends2 = _interopRequireDefault(require$$2);
50885
50871
  var _objectSpread2 = _interopRequireDefault(requireObjectSpread2());
50886
50872
  var _defineProperty2 = _interopRequireDefault(requireDefineProperty());
50887
50873
  var _objectWithoutProperties2 = _interopRequireDefault(requireObjectWithoutProperties());
@@ -51277,13 +51263,14 @@ const hasActions = (rows) => rows.reduce(
51277
51263
  const hasRowActions = (rows, headers) => {
51278
51264
  return hasActions(headers) > 0 || hasActions(rows) > 0;
51279
51265
  };
51280
- const clickableRow = "_clickableRow_10f34_1";
51281
- const hoverableRow = "_hoverableRow_10f34_4";
51282
- const rowActive = "_rowActive_10f34_4";
51283
- const expandableRow = "_expandableRow_10f34_8";
51284
- const flush = "_flush_10f34_8";
51285
- const dragIconCell = "_dragIconCell_10f34_34";
51286
- const dragIcon = "_dragIcon_10f34_34";
51266
+ const clickableRow = "_clickableRow_kqvtd_1";
51267
+ const hoverableRow = "_hoverableRow_kqvtd_4";
51268
+ const rowActive = "_rowActive_kqvtd_4";
51269
+ const expandableRow = "_expandableRow_kqvtd_8";
51270
+ const flush = "_flush_kqvtd_8";
51271
+ const dragIconCell = "_dragIconCell_kqvtd_34";
51272
+ const dragIcon = "_dragIcon_kqvtd_34";
51273
+ const dragIconDisabled = "_dragIconDisabled_kqvtd_55";
51287
51274
  const styles$9 = {
51288
51275
  clickableRow,
51289
51276
  hoverableRow,
@@ -51291,7 +51278,8 @@ const styles$9 = {
51291
51278
  expandableRow,
51292
51279
  flush,
51293
51280
  dragIconCell,
51294
- dragIcon
51281
+ dragIcon,
51282
+ dragIconDisabled
51295
51283
  };
51296
51284
  const ExpandedContentRow = ({
51297
51285
  colSpan,
@@ -51988,6 +51976,7 @@ const Row = ({
51988
51976
  hasRowActions: hasRowActions2,
51989
51977
  draggableTable = false,
51990
51978
  columnWidths,
51979
+ dropDisabled = false,
51991
51980
  height: height2,
51992
51981
  testId
51993
51982
  //TODO: add testId
@@ -52045,8 +52034,8 @@ const Row = ({
52045
52034
  animateLayoutChanges: () => false
52046
52035
  });
52047
52036
  const style = {
52037
+ transform: !dropDisabled ? CSS.Translate.toString(transform) : void 0,
52048
52038
  height: height2,
52049
- transform: CSS.Transform.toString(transform),
52050
52039
  transition,
52051
52040
  opacity: isDragging ? 0 : void 0
52052
52041
  };
@@ -52054,7 +52043,18 @@ const Row = ({
52054
52043
  if (row2.noDrag) {
52055
52044
  return /* @__PURE__ */ jsx("td", { "aria-labelledby": "unique-label-id" });
52056
52045
  }
52057
- return /* @__PURE__ */ jsx("td", { className: styles$9.dragIconCell, children: /* @__PURE__ */ jsx("div", { className: styles$9.dragIcon, ...attributes, ...listeners, children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG }) }) });
52046
+ return /* @__PURE__ */ jsx("td", { className: styles$9.dragIconCell, children: /* @__PURE__ */ jsx(
52047
+ "div",
52048
+ {
52049
+ className: cx$2(
52050
+ styles$9.dragIcon,
52051
+ dropDisabled ? styles$9.dragIconDisabled : ""
52052
+ ),
52053
+ ...attributes,
52054
+ ...listeners,
52055
+ children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG })
52056
+ }
52057
+ ) });
52058
52058
  };
52059
52059
  return isHeader ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
52060
52060
  /* @__PURE__ */ jsxs(
@@ -52135,11 +52135,13 @@ const TableDragWrapper = (props) => {
52135
52135
  draggable,
52136
52136
  onListReorder = () => {
52137
52137
  },
52138
+ canListReorder = () => true,
52138
52139
  rowActions,
52139
52140
  rows = [],
52140
52141
  tbodyRef
52141
52142
  } = props;
52142
52143
  const [dragIndex, setDragIndex] = useState(null);
52144
+ const [dropDisabled, setDropDisabled] = useState(false);
52143
52145
  const itemIds = useMemo(
52144
52146
  () => rows.map((_2, index2) => index2.toString()),
52145
52147
  [rows]
@@ -52149,34 +52151,53 @@ const TableDragWrapper = (props) => {
52149
52151
  };
52150
52152
  const handleDragEnd = (event) => {
52151
52153
  setDragIndex(null);
52154
+ setDropDisabled(false);
52152
52155
  const { active: active2, over } = event;
52153
- if (!active2 || !over) return;
52154
- if (active2.id !== over.id) {
52155
- onListReorder({
52156
- from: Number(active2.id),
52157
- to: Number(over.id)
52158
- });
52156
+ if (!active2 || !over || active2.id === over.id) {
52157
+ return;
52158
+ }
52159
+ const from3 = Number(active2.id);
52160
+ const to2 = Number(over == null ? void 0 : over.id);
52161
+ if (!canListReorder({ from: from3, to: to2 })) {
52162
+ return;
52159
52163
  }
52164
+ onListReorder({ from: from3, to: to2 });
52165
+ };
52166
+ const handleDragOver = (event) => {
52167
+ const { active: active2, over } = event;
52168
+ const from3 = Number(active2.id);
52169
+ const to2 = Number(over == null ? void 0 : over.id);
52170
+ const disabled2 = from3 !== to2 && !canListReorder({ from: from3, to: to2 });
52171
+ setDropDisabled(disabled2);
52160
52172
  };
52161
52173
  const getCalculatedWidths = () => {
52162
- if (!(tbodyRef == null ? void 0 : tbodyRef.current)) return [];
52174
+ if (!(tbodyRef == null ? void 0 : tbodyRef.current)) {
52175
+ return [];
52176
+ }
52163
52177
  const rows2 = tbodyRef.current.querySelectorAll("tr");
52164
52178
  const activeRow = rows2[Number(dragIndex)];
52165
52179
  const cells = activeRow == null ? void 0 : activeRow.querySelectorAll("td");
52166
- if (!cells) return [];
52167
- const widths = Array.from(cells).map((cell2) => `${cell2.offsetWidth}px`);
52180
+ if (!cells) {
52181
+ return [];
52182
+ }
52183
+ const widths = Array.from(cells).map(
52184
+ (cell2) => `${cell2.getBoundingClientRect().width}px`
52185
+ );
52168
52186
  widths.shift();
52169
52187
  return widths;
52170
52188
  };
52171
- if (!draggable) return children;
52189
+ if (!draggable) {
52190
+ return children({});
52191
+ }
52172
52192
  return /* @__PURE__ */ jsxs(
52173
52193
  DndContext$1,
52174
52194
  {
52175
52195
  collisionDetection: closestCenter,
52176
52196
  onDragStart: handleDragStart2,
52177
52197
  onDragEnd: handleDragEnd,
52198
+ onDragOver: handleDragOver,
52178
52199
  children: [
52179
- /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy: verticalListSortingStrategy, children }),
52200
+ /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy: verticalListSortingStrategy, children: children({ dropDisabled }) }),
52180
52201
  !!dragIndex && createPortal(
52181
52202
  /* @__PURE__ */ jsx(DragOverlay, { dropAnimation: null, children: /* @__PURE__ */ jsx("table", { className: cx$2(styles$c.table, styles$c.dragOverlay), children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx(
52182
52203
  Row,
@@ -52188,7 +52209,8 @@ const TableDragWrapper = (props) => {
52188
52209
  colSpan,
52189
52210
  hasRowActions: rowActions,
52190
52211
  columnAlignment,
52191
- draggableTable: draggable
52212
+ draggableTable: draggable,
52213
+ dropDisabled
52192
52214
  }
52193
52215
  ) }) }) }),
52194
52216
  document.body
@@ -52237,8 +52259,12 @@ const TableScrollWrapper = ({
52237
52259
  };
52238
52260
  const Table = (props) => {
52239
52261
  var _a2, _b, _c, _d, _e2, _f, _g;
52240
- const { onListReorder = () => {
52241
- }, table: propTable } = props;
52262
+ const {
52263
+ onListReorder = () => {
52264
+ },
52265
+ canListReorder = () => true,
52266
+ table: propTable
52267
+ } = props;
52242
52268
  const {
52243
52269
  columnWidths,
52244
52270
  footer: footer2,
@@ -52330,64 +52356,65 @@ const Table = (props) => {
52330
52356
  rowActions,
52331
52357
  rows,
52332
52358
  tbodyRef,
52333
- children: /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, theadRef, children: ({ virtualizer, tableStyle }) => {
52334
- return /* @__PURE__ */ jsxs(
52335
- "table",
52336
- {
52337
- className: cx$2(styles$c.table, striped2 ? styles$c.striped : ""),
52338
- "data-testid": testId,
52339
- style: tableStyle,
52340
- children: [
52341
- /* @__PURE__ */ jsx("thead", { ref: theadRef, children: headers.map((row2, rowIndex) => {
52342
- return /* @__PURE__ */ jsx(
52343
- Row,
52344
- {
52345
- rowIndex,
52346
- isHeader: true,
52347
- row: row2,
52348
- columnCount,
52349
- columnWidths,
52350
- colSpan,
52351
- hasRowActions: rowActions,
52352
- columnAlignment,
52353
- columnHeaderAlignments,
52354
- draggableTable: draggable
52355
- },
52356
- `0_${rowIndex}`
52357
- );
52358
- }) }),
52359
- /* @__PURE__ */ jsx("tbody", { ref: tbodyRef, children: virtualizer ? virtualizer.getVirtualItems().map((virtualRow2) => /* @__PURE__ */ jsx(
52360
- Row,
52361
- {
52362
- rowIndex: virtualRow2.index,
52363
- row: rows[virtualRow2.index],
52364
- columnCount,
52365
- columnWidths,
52366
- colSpan,
52367
- hasRowActions: rowActions,
52368
- columnAlignment,
52369
- draggableTable: draggable,
52370
- height: virtualRow2.size
52371
- },
52372
- `1_${virtualRow2.index}`
52373
- )) : rows.map((row2, index2) => /* @__PURE__ */ jsx(
52359
+ canListReorder,
52360
+ children: ({ dropDisabled }) => /* @__PURE__ */ jsx(TableScrollWrapper, { table: table2, theadRef, children: ({ virtualizer, tableStyle }) => /* @__PURE__ */ jsxs(
52361
+ "table",
52362
+ {
52363
+ className: cx$2(styles$c.table, striped2 ? styles$c.striped : ""),
52364
+ "data-testid": testId,
52365
+ style: tableStyle,
52366
+ children: [
52367
+ /* @__PURE__ */ jsx("thead", { ref: theadRef, children: headers.map((row2, rowIndex) => {
52368
+ return /* @__PURE__ */ jsx(
52374
52369
  Row,
52375
52370
  {
52376
- rowIndex: index2,
52371
+ rowIndex,
52372
+ isHeader: true,
52377
52373
  row: row2,
52378
52374
  columnCount,
52379
52375
  columnWidths,
52380
52376
  colSpan,
52381
52377
  hasRowActions: rowActions,
52382
52378
  columnAlignment,
52379
+ columnHeaderAlignments,
52383
52380
  draggableTable: draggable
52384
52381
  },
52385
- `1_${index2}`
52386
- )) })
52387
- ]
52388
- }
52389
- );
52390
- } })
52382
+ `0_${rowIndex}`
52383
+ );
52384
+ }) }),
52385
+ /* @__PURE__ */ jsx("tbody", { ref: tbodyRef, children: virtualizer ? virtualizer.getVirtualItems().map((virtualRow2) => /* @__PURE__ */ jsx(
52386
+ Row,
52387
+ {
52388
+ rowIndex: virtualRow2.index,
52389
+ row: rows[virtualRow2.index],
52390
+ columnCount,
52391
+ columnWidths,
52392
+ colSpan,
52393
+ hasRowActions: rowActions,
52394
+ columnAlignment,
52395
+ draggableTable: draggable,
52396
+ height: virtualRow2.size,
52397
+ dropDisabled
52398
+ },
52399
+ `1_${virtualRow2.index}`
52400
+ )) : rows.map((row2, index2) => /* @__PURE__ */ jsx(
52401
+ Row,
52402
+ {
52403
+ rowIndex: index2,
52404
+ row: row2,
52405
+ columnCount,
52406
+ columnWidths,
52407
+ colSpan,
52408
+ hasRowActions: rowActions,
52409
+ columnAlignment,
52410
+ draggableTable: draggable,
52411
+ dropDisabled
52412
+ },
52413
+ `1_${index2}`
52414
+ )) })
52415
+ ]
52416
+ }
52417
+ ) })
52391
52418
  }
52392
52419
  ),
52393
52420
  footer2 && /* @__PURE__ */ jsx(