@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.
@@ -4,23 +4,28 @@ export class SimpleItemTemplate extends React.Component {
4
4
  constructor(props) {
5
5
  super(props);
6
6
  this.props = props;
7
+ this.handleRemove = (event) => {
8
+ const { item, index } = this.props;
9
+ item.onDropIndexClick(index)(event);
10
+ };
11
+ this.handleMoveUp = (event) => {
12
+ const { item, index } = this.props;
13
+ item.onReorderClick(index, index - 1)(event);
14
+ };
15
+ this.handleMoveDown = (event) => {
16
+ const { item, index } = this.props;
17
+ item.onReorderClick(index, index + 1)(event);
18
+ };
7
19
  }
8
20
  componentDidMount() {
9
- const { item, index } = this.props;
10
- const removeButton = this.removeButton;
11
- this.removeHandler = item.onDropIndexClick(index);
12
- removeButton.addEventListener('click', this.removeHandler);
13
- const upButton = this.moveUpButton;
14
- this.moveUpHandler = item.onReorderClick(index, index - 1);
15
- upButton.addEventListener('click', this.moveUpHandler);
16
- const downButton = this.moveDownButton;
17
- this.moveDownHandler = item.onReorderClick(index, index + 1);
18
- downButton.addEventListener('click', this.moveDownHandler);
21
+ this.removeButton.addEventListener('click', this.handleRemove);
22
+ this.moveUpButton.addEventListener('click', this.handleMoveUp);
23
+ this.moveDownButton.addEventListener('click', this.handleMoveDown);
19
24
  }
20
25
  componentWillUnmount() {
21
- this.removeButton.removeEventListener('click', this.removeHandler);
22
- this.moveUpButton.removeEventListener('click', this.moveUpHandler);
23
- this.moveDownButton.removeEventListener('click', this.moveDownHandler);
26
+ this.removeButton.removeEventListener('click', this.handleRemove);
27
+ this.moveUpButton.removeEventListener('click', this.handleMoveUp);
28
+ this.moveDownButton.removeEventListener('click', this.handleMoveDown);
24
29
  }
25
30
  render() {
26
31
  const { item } = this.props;
@@ -31,37 +36,31 @@ export class SimpleItemTemplate extends React.Component {
31
36
  renderRemoveButton(item) {
32
37
  const props = {
33
38
  icon: 'trash',
39
+ disabled: !item.hasRemove,
34
40
  ref: (button) => {
35
41
  this.removeButton = button;
36
42
  },
37
43
  };
38
- if (!item.hasRemove) {
39
- props.disabled = true;
40
- }
41
44
  return React.createElement(LIMEL_ICON_BUTTON, props);
42
45
  }
43
46
  renderMoveUpButton(item) {
44
47
  const props = {
45
48
  icon: 'up_arrow',
49
+ disabled: !item.hasMoveUp,
46
50
  ref: (button) => {
47
51
  this.moveUpButton = button;
48
52
  },
49
53
  };
50
- if (!item.hasMoveUp) {
51
- props.disabled = true;
52
- }
53
54
  return React.createElement(LIMEL_ICON_BUTTON, props);
54
55
  }
55
56
  renderMoveDownButton(item) {
56
57
  const props = {
57
58
  icon: 'down_arrow',
59
+ disabled: !item.hasMoveDown,
58
60
  ref: (button) => {
59
61
  this.moveDownButton = button;
60
62
  },
61
63
  };
62
- if (!item.hasMoveDown) {
63
- props.disabled = true;
64
- }
65
64
  return React.createElement(LIMEL_ICON_BUTTON, props);
66
65
  }
67
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"array-field-simple-item.js","sourceRoot":"","sources":["../../../../src/components/form/templates/array-field-simple-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAE9C,MAAM,OAAO,kBAAmB,SAAQ,KAAK,CAAC,SAAS;EACnD,YAAmB,KAAsB;IACrC,KAAK,CAAC,KAAK,CAAC,CAAC;IADE,UAAK,GAAL,KAAK,CAAiB;EAEzC,CAAC;EAUM,iBAAiB;IACpB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;IACnC,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACvC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAClD,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAE3D,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AAC,YAAY,GAAG,MAAM,CAAC;MAC/B,CAAC;KACJ,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;MACjB,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;KACzB;IAED,OAAO,KAAK,CAAC,aAAa,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;EACzD,CAAC;EAEO,kBAAkB,CAAC,IAAoB;IAC3C,MAAM,KAAK,GAAQ;MACf,IAAI,EAAE,UAAU;MAChB,GAAG,EAAE,CAAC,MAA8B,EAAE,EAAE;QACpC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;MAC/B,CAAC;KACJ,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;MACjB,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;KACzB;IAED,OAAO,KAAK,CAAC,aAAa,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;EACzD,CAAC;EAEO,oBAAoB,CAAC,IAAoB;IAC7C,MAAM,KAAK,GAAQ;MACf,IAAI,EAAE,YAAY;MAClB,GAAG,EAAE,CAAC,MAA8B,EAAE,EAAE;QACpC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;MACjC,CAAC;KACJ,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;MACnB,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;KACzB;IAED,OAAO,KAAK,CAAC,aAAa,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;EACzD,CAAC;CACJ","sourcesContent":["import React from 'react';\nimport { ArrayFieldItem } from './types';\n\ninterface SimpleItemProps {\n item: ArrayFieldItem;\n index: number;\n}\n\nconst LIMEL_ICON_BUTTON = 'limel-icon-button';\n\nexport class SimpleItemTemplate extends React.Component {\n constructor(public props: SimpleItemProps) {\n super(props);\n }\n\n private removeButton: HTMLLimelButtonElement;\n private moveUpButton: HTMLLimelButtonElement;\n private moveDownButton: HTMLLimelButtonElement;\n\n private removeHandler: (event: any) => void;\n private moveUpHandler: (event: any) => void;\n private moveDownHandler: (event: any) => void;\n\n public componentDidMount() {\n const { item, index } = this.props;\n const removeButton = this.removeButton;\n this.removeHandler = item.onDropIndexClick(index);\n removeButton.addEventListener('click', this.removeHandler);\n\n const upButton = this.moveUpButton;\n this.moveUpHandler = item.onReorderClick(index, index - 1);\n upButton.addEventListener('click', this.moveUpHandler);\n\n const downButton = this.moveDownButton;\n this.moveDownHandler = item.onReorderClick(index, index + 1);\n downButton.addEventListener('click', this.moveDownHandler);\n }\n\n public componentWillUnmount() {\n this.removeButton.removeEventListener('click', this.removeHandler);\n\n this.moveUpButton.removeEventListener('click', this.moveUpHandler);\n\n this.moveDownButton.removeEventListener('click', this.moveDownHandler);\n }\n\n public render() {\n const { item } = this.props;\n\n return React.createElement(\n 'div',\n {\n className: 'limel-form-array-item--simple',\n },\n this.props.item.children,\n this.renderRemoveButton(item),\n this.renderMoveUpButton(item),\n this.renderMoveDownButton(item)\n );\n }\n\n private renderRemoveButton(item: ArrayFieldItem) {\n const props: any = {\n icon: 'trash',\n ref: (button: HTMLLimelButtonElement) => {\n this.removeButton = button;\n },\n };\n if (!item.hasRemove) {\n props.disabled = true;\n }\n\n return React.createElement(LIMEL_ICON_BUTTON, props);\n }\n\n private renderMoveUpButton(item: ArrayFieldItem) {\n const props: any = {\n icon: 'up_arrow',\n ref: (button: HTMLLimelButtonElement) => {\n this.moveUpButton = button;\n },\n };\n if (!item.hasMoveUp) {\n props.disabled = true;\n }\n\n return React.createElement(LIMEL_ICON_BUTTON, props);\n }\n\n private renderMoveDownButton(item: ArrayFieldItem) {\n const props: any = {\n icon: 'down_arrow',\n ref: (button: HTMLLimelButtonElement) => {\n this.moveDownButton = button;\n },\n };\n if (!item.hasMoveDown) {\n props.disabled = true;\n }\n\n return React.createElement(LIMEL_ICON_BUTTON, props);\n }\n}\n"]}
1
+ {"version":3,"file":"array-field-simple-item.js","sourceRoot":"","sources":["../../../../src/components/form/templates/array-field-simple-item.ts"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AEO,oBAAoB,CAAC,IAAoB;IAC7C,MAAM,KAAK,GAAQ;MACf,IAAI,EAAE,YAAY;MAClB,QAAQ,EAAE,CAAC,IAAI,CAAC,WAAW;MAC3B,GAAG,EAAE,CAAC,MAA8B,EAAE,EAAE;QACpC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;MACjC,CAAC;KACJ,CAAC;IAEF,OAAO,KAAK,CAAC,aAAa,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;EACzD,CAAC;CAgBJ","sourcesContent":["import React from 'react';\nimport { ArrayFieldItem } from './types';\n\ninterface SimpleItemProps {\n item: ArrayFieldItem;\n index: number;\n}\n\nconst LIMEL_ICON_BUTTON = 'limel-icon-button';\n\nexport class SimpleItemTemplate extends React.Component {\n constructor(public props: SimpleItemProps) {\n super(props);\n }\n\n private removeButton: HTMLLimelButtonElement;\n private moveUpButton: HTMLLimelButtonElement;\n private moveDownButton: HTMLLimelButtonElement;\n\n public componentDidMount() {\n this.removeButton.addEventListener('click', this.handleRemove);\n this.moveUpButton.addEventListener('click', this.handleMoveUp);\n this.moveDownButton.addEventListener('click', this.handleMoveDown);\n }\n\n public componentWillUnmount() {\n this.removeButton.removeEventListener('click', this.handleRemove);\n this.moveUpButton.removeEventListener('click', this.handleMoveUp);\n this.moveDownButton.removeEventListener('click', this.handleMoveDown);\n }\n\n public render() {\n const { item } = this.props;\n\n return React.createElement(\n 'div',\n {\n className: 'limel-form-array-item--simple',\n },\n this.props.item.children,\n this.renderRemoveButton(item),\n this.renderMoveUpButton(item),\n this.renderMoveDownButton(item)\n );\n }\n\n private renderRemoveButton(item: ArrayFieldItem) {\n const props: any = {\n icon: 'trash',\n disabled: !item.hasRemove,\n ref: (button: HTMLLimelButtonElement) => {\n this.removeButton = button;\n },\n };\n\n return React.createElement(LIMEL_ICON_BUTTON, props);\n }\n\n private renderMoveUpButton(item: ArrayFieldItem) {\n const props: any = {\n icon: 'up_arrow',\n disabled: !item.hasMoveUp,\n ref: (button: HTMLLimelButtonElement) => {\n this.moveUpButton = button;\n },\n };\n\n return React.createElement(LIMEL_ICON_BUTTON, props);\n }\n\n private renderMoveDownButton(item: ArrayFieldItem) {\n const props: any = {\n icon: 'down_arrow',\n disabled: !item.hasMoveDown,\n ref: (button: HTMLLimelButtonElement) => {\n this.moveDownButton = button;\n },\n };\n\n return React.createElement(LIMEL_ICON_BUTTON, props);\n }\n\n private handleRemove = (event: PointerEvent): void => {\n const { item, index } = this.props;\n item.onDropIndexClick(index)(event);\n };\n\n private handleMoveUp = (event: PointerEvent): void => {\n const { item, index } = this.props;\n item.onReorderClick(index, index - 1)(event);\n };\n\n private handleMoveDown = (event: PointerEvent): void => {\n const { item, index } = this.props;\n item.onReorderClick(index, index + 1)(event);\n };\n}\n"]}
@@ -39339,23 +39339,28 @@ class SimpleItemTemplate extends react.Component {
39339
39339
  constructor(props) {
39340
39340
  super(props);
39341
39341
  this.props = props;
39342
+ this.handleRemove = (event) => {
39343
+ const { item, index } = this.props;
39344
+ item.onDropIndexClick(index)(event);
39345
+ };
39346
+ this.handleMoveUp = (event) => {
39347
+ const { item, index } = this.props;
39348
+ item.onReorderClick(index, index - 1)(event);
39349
+ };
39350
+ this.handleMoveDown = (event) => {
39351
+ const { item, index } = this.props;
39352
+ item.onReorderClick(index, index + 1)(event);
39353
+ };
39342
39354
  }
39343
39355
  componentDidMount() {
39344
- const { item, index } = this.props;
39345
- const removeButton = this.removeButton;
39346
- this.removeHandler = item.onDropIndexClick(index);
39347
- removeButton.addEventListener('click', this.removeHandler);
39348
- const upButton = this.moveUpButton;
39349
- this.moveUpHandler = item.onReorderClick(index, index - 1);
39350
- upButton.addEventListener('click', this.moveUpHandler);
39351
- const downButton = this.moveDownButton;
39352
- this.moveDownHandler = item.onReorderClick(index, index + 1);
39353
- downButton.addEventListener('click', this.moveDownHandler);
39356
+ this.removeButton.addEventListener('click', this.handleRemove);
39357
+ this.moveUpButton.addEventListener('click', this.handleMoveUp);
39358
+ this.moveDownButton.addEventListener('click', this.handleMoveDown);
39354
39359
  }
39355
39360
  componentWillUnmount() {
39356
- this.removeButton.removeEventListener('click', this.removeHandler);
39357
- this.moveUpButton.removeEventListener('click', this.moveUpHandler);
39358
- this.moveDownButton.removeEventListener('click', this.moveDownHandler);
39361
+ this.removeButton.removeEventListener('click', this.handleRemove);
39362
+ this.moveUpButton.removeEventListener('click', this.handleMoveUp);
39363
+ this.moveDownButton.removeEventListener('click', this.handleMoveDown);
39359
39364
  }
39360
39365
  render() {
39361
39366
  const { item } = this.props;
@@ -39366,37 +39371,31 @@ class SimpleItemTemplate extends react.Component {
39366
39371
  renderRemoveButton(item) {
39367
39372
  const props = {
39368
39373
  icon: 'trash',
39374
+ disabled: !item.hasRemove,
39369
39375
  ref: (button) => {
39370
39376
  this.removeButton = button;
39371
39377
  },
39372
39378
  };
39373
- if (!item.hasRemove) {
39374
- props.disabled = true;
39375
- }
39376
39379
  return react.createElement(LIMEL_ICON_BUTTON, props);
39377
39380
  }
39378
39381
  renderMoveUpButton(item) {
39379
39382
  const props = {
39380
39383
  icon: 'up_arrow',
39384
+ disabled: !item.hasMoveUp,
39381
39385
  ref: (button) => {
39382
39386
  this.moveUpButton = button;
39383
39387
  },
39384
39388
  };
39385
- if (!item.hasMoveUp) {
39386
- props.disabled = true;
39387
- }
39388
39389
  return react.createElement(LIMEL_ICON_BUTTON, props);
39389
39390
  }
39390
39391
  renderMoveDownButton(item) {
39391
39392
  const props = {
39392
39393
  icon: 'down_arrow',
39394
+ disabled: !item.hasMoveDown,
39393
39395
  ref: (button) => {
39394
39396
  this.moveDownButton = button;
39395
39397
  },
39396
39398
  };
39397
- if (!item.hasMoveDown) {
39398
- props.disabled = true;
39399
- }
39400
39399
  return react.createElement(LIMEL_ICON_BUTTON, props);
39401
39400
  }
39402
39401
  }