@limetech/lime-elements 38.19.5 → 38.19.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [38.19.6](https://github.com/Lundalogik/lime-elements/compare/v38.19.5...v38.19.6) (2025-07-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+
7
+ * **form:** array item reordering now works correctly ([64b9afe](https://github.com/Lundalogik/lime-elements/commit/64b9afeb13e01bb27589dba6aa576a16bbbd8049))
8
+ * **form:** resolve warnings for disabled prop modification ([e7a16ab](https://github.com/Lundalogik/lime-elements/commit/e7a16ab579939d3279096047025feac3647389d1))
9
+
1
10
  ## [38.19.5](https://github.com/Lundalogik/lime-elements/compare/v38.19.4...v38.19.5) (2025-07-17)
2
11
 
3
12
 
@@ -39343,23 +39343,28 @@ class SimpleItemTemplate extends react.Component {
39343
39343
  constructor(props) {
39344
39344
  super(props);
39345
39345
  this.props = props;
39346
+ this.handleRemove = (event) => {
39347
+ const { item, index } = this.props;
39348
+ item.onDropIndexClick(index)(event);
39349
+ };
39350
+ this.handleMoveUp = (event) => {
39351
+ const { item, index } = this.props;
39352
+ item.onReorderClick(index, index - 1)(event);
39353
+ };
39354
+ this.handleMoveDown = (event) => {
39355
+ const { item, index } = this.props;
39356
+ item.onReorderClick(index, index + 1)(event);
39357
+ };
39346
39358
  }
39347
39359
  componentDidMount() {
39348
- const { item, index } = this.props;
39349
- const removeButton = this.removeButton;
39350
- this.removeHandler = item.onDropIndexClick(index);
39351
- removeButton.addEventListener('click', this.removeHandler);
39352
- const upButton = this.moveUpButton;
39353
- this.moveUpHandler = item.onReorderClick(index, index - 1);
39354
- upButton.addEventListener('click', this.moveUpHandler);
39355
- const downButton = this.moveDownButton;
39356
- this.moveDownHandler = item.onReorderClick(index, index + 1);
39357
- downButton.addEventListener('click', this.moveDownHandler);
39360
+ this.removeButton.addEventListener('click', this.handleRemove);
39361
+ this.moveUpButton.addEventListener('click', this.handleMoveUp);
39362
+ this.moveDownButton.addEventListener('click', this.handleMoveDown);
39358
39363
  }
39359
39364
  componentWillUnmount() {
39360
- this.removeButton.removeEventListener('click', this.removeHandler);
39361
- this.moveUpButton.removeEventListener('click', this.moveUpHandler);
39362
- this.moveDownButton.removeEventListener('click', this.moveDownHandler);
39365
+ this.removeButton.removeEventListener('click', this.handleRemove);
39366
+ this.moveUpButton.removeEventListener('click', this.handleMoveUp);
39367
+ this.moveDownButton.removeEventListener('click', this.handleMoveDown);
39363
39368
  }
39364
39369
  render() {
39365
39370
  const { item } = this.props;
@@ -39370,37 +39375,31 @@ class SimpleItemTemplate extends react.Component {
39370
39375
  renderRemoveButton(item) {
39371
39376
  const props = {
39372
39377
  icon: 'trash',
39378
+ disabled: !item.hasRemove,
39373
39379
  ref: (button) => {
39374
39380
  this.removeButton = button;
39375
39381
  },
39376
39382
  };
39377
- if (!item.hasRemove) {
39378
- props.disabled = true;
39379
- }
39380
39383
  return react.createElement(LIMEL_ICON_BUTTON, props);
39381
39384
  }
39382
39385
  renderMoveUpButton(item) {
39383
39386
  const props = {
39384
39387
  icon: 'up_arrow',
39388
+ disabled: !item.hasMoveUp,
39385
39389
  ref: (button) => {
39386
39390
  this.moveUpButton = button;
39387
39391
  },
39388
39392
  };
39389
- if (!item.hasMoveUp) {
39390
- props.disabled = true;
39391
- }
39392
39393
  return react.createElement(LIMEL_ICON_BUTTON, props);
39393
39394
  }
39394
39395
  renderMoveDownButton(item) {
39395
39396
  const props = {
39396
39397
  icon: 'down_arrow',
39398
+ disabled: !item.hasMoveDown,
39397
39399
  ref: (button) => {
39398
39400
  this.moveDownButton = button;
39399
39401
  },
39400
39402
  };
39401
- if (!item.hasMoveDown) {
39402
- props.disabled = true;
39403
- }
39404
39403
  return react.createElement(LIMEL_ICON_BUTTON, props);
39405
39404
  }
39406
39405
  }