@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 +9 -0
- package/dist/cjs/limel-form.cjs.entry.js +21 -22
- package/dist/cjs/limel-form.cjs.entry.js.map +1 -1
- package/dist/collection/components/form/templates/array-field-simple-item.js +21 -22
- package/dist/collection/components/form/templates/array-field-simple-item.js.map +1 -1
- package/dist/esm/limel-form.entry.js +21 -22
- package/dist/esm/limel-form.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-22ffde58.entry.js → p-bfd947aa.entry.js} +2 -2
- package/dist/lime-elements/p-bfd947aa.entry.js.map +1 -0
- package/dist/types/components/form/templates/array-field-simple-item.d.ts +3 -3
- package/package.json +1 -1
- package/dist/lime-elements/p-22ffde58.entry.js.map +0 -1
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
this.
|
|
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.
|
|
22
|
-
this.moveUpButton.removeEventListener('click', this.
|
|
23
|
-
this.moveDownButton.removeEventListener('click', this.
|
|
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;
|
|
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;IAuEjC,iBAAY,GAAG,CAAC,KAAmB,EAAQ,EAAE;MACjD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;MACnC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC;IAEM,iBAAY,GAAG,CAAC,KAAmB,EAAQ,EAA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AAI,CAAC,EAC7B,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAC7B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAClC,CAAC;EACN,CAAC;EAEO,kBAAkB,CAAC,IAAoB;IAC3C,MAAM,KAAK,GAAQ;MACf,IAAI,EAAE,OAAO;MACb,QAAQ,EAAE,CAAC,IAAI,CAAC,SAAS;MACzB,GAAG,EAAE,CAAC,MAA8B,EAAE,EAAE;QACpC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;MAC/B,CAAC;KACJ,CAAC;IAEF,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,QAAQ,EAAE,CAAC,IAAI,CAAC,SAAS;MACzB,GAAG,EAAE,CAAC,MAA8B,EAAE,EAAE;QACpC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;MAC/B,CAAC;KACJ,CAAC;IAEF,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,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
|
-
|
|
39345
|
-
|
|
39346
|
-
this.
|
|
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.
|
|
39357
|
-
this.moveUpButton.removeEventListener('click', this.
|
|
39358
|
-
this.moveDownButton.removeEventListener('click', this.
|
|
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
|
}
|