cx 24.3.5 → 24.3.7
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/dist/charts.js +1 -0
- package/dist/manifest.js +757 -757
- package/dist/widgets.js +35 -37
- package/package.json +1 -1
- package/src/charts/Swimlanes.d.ts +3 -3
- package/src/charts/Swimlanes.js +2 -0
- package/src/core.d.ts +1 -0
- package/src/widgets/form/Field.d.ts +1 -1
- package/src/widgets/form/Label.d.ts +8 -10
- package/src/widgets/form/Label.js +89 -88
- package/src/widgets/form/LabeledContainer.d.ts +3 -11
- package/src/widgets/form/ValidationGroup.d.ts +1 -1
- package/src/widgets/grid/Grid.d.ts +4 -2
- package/src/widgets/grid/Grid.js +19 -7
- package/src/widgets/grid/Grid.scss +680 -680
- package/src/widgets/grid/variables.scss +88 -88
package/dist/widgets.js
CHANGED
|
@@ -6348,6 +6348,7 @@ var Label = /*#__PURE__*/ (function (_HtmlElement) {
|
|
|
6348
6348
|
required: undefined,
|
|
6349
6349
|
disabled: undefined,
|
|
6350
6350
|
htmlFor: undefined,
|
|
6351
|
+
asterisk: undefined,
|
|
6351
6352
|
},
|
|
6352
6353
|
]),
|
|
6353
6354
|
);
|
|
@@ -6368,7 +6369,7 @@ var Label = /*#__PURE__*/ (function (_HtmlElement) {
|
|
|
6368
6369
|
data._disabled,
|
|
6369
6370
|
context.parentDisabled,
|
|
6370
6371
|
);
|
|
6371
|
-
data.asterisk = context.parentAsterisk ||
|
|
6372
|
+
data.asterisk = context.parentAsterisk || data.asterisk;
|
|
6372
6373
|
if (instance.cache("disabled", data.disabled) || instance.cache("asterisk", data.asterisk)) {
|
|
6373
6374
|
instance.markShouldUpdate(context);
|
|
6374
6375
|
this.prepareCSS(context, instance);
|
|
@@ -16636,6 +16637,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
16636
16637
|
dragged: isDragged,
|
|
16637
16638
|
cursor: widget.selectable && index == cursor,
|
|
16638
16639
|
over: dropTarget == "row" && dropInsertionIndex === index,
|
|
16640
|
+
alternate: index % 2 == 1,
|
|
16639
16641
|
};
|
|
16640
16642
|
if (isRecordSelectable) {
|
|
16641
16643
|
var selectable = isRecordSelectable(record.data, {});
|
|
@@ -16919,44 +16921,32 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
16919
16921
|
},
|
|
16920
16922
|
"dropzone",
|
|
16921
16923
|
);
|
|
16924
|
+
var isDataRecord = widget.buffered
|
|
16925
|
+
? function (item) {
|
|
16926
|
+
var _item$props;
|
|
16927
|
+
return (
|
|
16928
|
+
((_item$props = item.props) == null ||
|
|
16929
|
+
(_item$props = _item$props.instance) == null ||
|
|
16930
|
+
(_item$props = _item$props.data) == null
|
|
16931
|
+
? void 0
|
|
16932
|
+
: _item$props["class"]) == "cxe-grid-data"
|
|
16933
|
+
);
|
|
16934
|
+
}
|
|
16935
|
+
: function (item) {
|
|
16936
|
+
var _item$props2;
|
|
16937
|
+
return (_item$props2 = item.props) == null || (_item$props2 = _item$props2.record) == null
|
|
16938
|
+
? void 0
|
|
16939
|
+
: _item$props2.type;
|
|
16940
|
+
};
|
|
16922
16941
|
var index = 0;
|
|
16923
|
-
while (
|
|
16924
|
-
index < children.length &&
|
|
16925
|
-
((_children$index = children[index]) == null ||
|
|
16926
|
-
(_children$index = _children$index.props) == null ||
|
|
16927
|
-
(_children$index = _children$index.record) == null
|
|
16928
|
-
? void 0
|
|
16929
|
-
: _children$index.type) != "data"
|
|
16930
|
-
) {
|
|
16931
|
-
var _children$index;
|
|
16932
|
-
index++;
|
|
16933
|
-
}
|
|
16942
|
+
while (index < children.length && !isDataRecord(children[index])) index++;
|
|
16934
16943
|
var count = 0;
|
|
16935
|
-
while (count < this.state.dropInsertionIndex) {
|
|
16936
|
-
|
|
16937
|
-
if (
|
|
16938
|
-
((_children$index2 = children[index]) == null ||
|
|
16939
|
-
(_children$index2 = _children$index2.props) == null ||
|
|
16940
|
-
(_children$index2 = _children$index2.record) == null
|
|
16941
|
-
? void 0
|
|
16942
|
-
: _children$index2.type) == "data"
|
|
16943
|
-
)
|
|
16944
|
-
count++;
|
|
16944
|
+
while (index < children.length && count < this.state.dropInsertionIndex) {
|
|
16945
|
+
if (isDataRecord(children[index])) count++;
|
|
16945
16946
|
index++;
|
|
16946
16947
|
}
|
|
16947
16948
|
var savedIndexPos = index;
|
|
16948
|
-
if (!this.state.dropNextToTheRowAbove)
|
|
16949
|
-
while (
|
|
16950
|
-
index < children.length &&
|
|
16951
|
-
((_children$index3 = children[index]) == null ||
|
|
16952
|
-
(_children$index3 = _children$index3.props) == null ||
|
|
16953
|
-
(_children$index3 = _children$index3.record) == null
|
|
16954
|
-
? void 0
|
|
16955
|
-
: _children$index3.type) != "data"
|
|
16956
|
-
) {
|
|
16957
|
-
var _children$index3;
|
|
16958
|
-
index++;
|
|
16959
|
-
}
|
|
16949
|
+
if (!this.state.dropNextToTheRowAbove) while (index < children.length && !isDataRecord(children[index])) index++;
|
|
16960
16950
|
|
|
16961
16951
|
// do not allow insertion after the last group footer
|
|
16962
16952
|
if (savedIndexPos < index && index == children.length) index = savedIndexPos;
|
|
@@ -17351,15 +17341,15 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
17351
17341
|
if (dropTarget == "grid" && widget.onDrop && dropInsertionIndex != null) {
|
|
17352
17342
|
e.target = {
|
|
17353
17343
|
insertionIndex: start + dropInsertionIndex,
|
|
17354
|
-
recordBefore: this.
|
|
17355
|
-
recordAfter: this.
|
|
17344
|
+
recordBefore: this.getDataRecordAt(start + dropInsertionIndex - 1),
|
|
17345
|
+
recordAfter: this.getDataRecordAt(start + dropInsertionIndex),
|
|
17356
17346
|
dropNextToTheRowAbove: dropNextToTheRowAbove,
|
|
17357
17347
|
};
|
|
17358
17348
|
instance.invoke("onDrop", e, instance);
|
|
17359
17349
|
} else if (dropTarget == "row") {
|
|
17360
17350
|
e.target = {
|
|
17361
17351
|
index: start + dropInsertionIndex,
|
|
17362
|
-
record: this.
|
|
17352
|
+
record: this.getDataRecordAt(start + dropInsertionIndex),
|
|
17363
17353
|
};
|
|
17364
17354
|
instance.invoke("onRowDrop", e, instance);
|
|
17365
17355
|
} else if (dropTarget == "column" && widget.onColumnDrop) {
|
|
@@ -18032,6 +18022,14 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
18032
18022
|
}
|
|
18033
18023
|
widget.selection.selectMultiple(instance.store, selection, indexes, options);
|
|
18034
18024
|
};
|
|
18025
|
+
_proto2.getDataRecordAt = function getDataRecordAt(index) {
|
|
18026
|
+
var records = this.props.instance.records;
|
|
18027
|
+
if (!records) return this.getRecordAt(index);
|
|
18028
|
+
var dataRecords = records.filter(function (r) {
|
|
18029
|
+
return r.type == "data";
|
|
18030
|
+
});
|
|
18031
|
+
return dataRecords[index];
|
|
18032
|
+
};
|
|
18035
18033
|
_proto2.getRecordAt = function getRecordAt(cursor) {
|
|
18036
18034
|
var _this$props7 = this.props,
|
|
18037
18035
|
instance = _this$props7.instance,
|
package/package.json
CHANGED
|
@@ -20,19 +20,19 @@ interface SwimlanesProps extends BoundedObjectProps {
|
|
|
20
20
|
baseClass?: string;
|
|
21
21
|
|
|
22
22
|
/** Represents a swimlane size. */
|
|
23
|
-
size?:
|
|
23
|
+
size?: Cx.NumberProp;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Represents a swimlane step. Define a step on which a swimlane will be rendered. (eg. step 2 will render
|
|
27
27
|
* every second swimlane in the chart.)
|
|
28
28
|
*/
|
|
29
|
-
step?:
|
|
29
|
+
step?: Cx.NumberProp;
|
|
30
30
|
|
|
31
31
|
/** Switch to vertical swimlanes. */
|
|
32
32
|
vertical?: boolean;
|
|
33
33
|
|
|
34
34
|
/**The laneOffset property adjusts the positioning of lane elements, enhancing their alignment and readability. */
|
|
35
|
-
laneOffset?:
|
|
35
|
+
laneOffset?: Cx.NumberProp;
|
|
36
36
|
|
|
37
37
|
/** Style object applied to the swimlanes. */
|
|
38
38
|
laneStyle?: StyleProp;
|
package/src/charts/Swimlanes.js
CHANGED
package/src/core.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export interface FieldProps extends Cx.StyledContainerProps {
|
|
|
59
59
|
requiredText?: string;
|
|
60
60
|
|
|
61
61
|
/** Append asterisk to the label to indicate a required field. */
|
|
62
|
-
asterisk?:
|
|
62
|
+
asterisk?: Cx.BooleanProp;
|
|
63
63
|
|
|
64
64
|
/** Text displayed to the user to indicate that server-side validation is in progress. */
|
|
65
65
|
validatingText?: string;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import * as Cx from
|
|
1
|
+
import * as Cx from "../../core";
|
|
2
2
|
|
|
3
3
|
interface LabelProps extends Cx.HtmlElementProps {
|
|
4
|
-
|
|
5
4
|
/** Used in combination with `asterisk` to indicate required fields. */
|
|
6
|
-
required?: Cx.BooleanProp
|
|
5
|
+
required?: Cx.BooleanProp;
|
|
7
6
|
|
|
8
7
|
/** Set to true to disable the label. */
|
|
9
|
-
disabled?: Cx.BooleanProp
|
|
8
|
+
disabled?: Cx.BooleanProp;
|
|
10
9
|
|
|
11
10
|
/** Id of the field. */
|
|
12
|
-
htmlFor?: Cx.StringProp
|
|
13
|
-
|
|
11
|
+
htmlFor?: Cx.StringProp;
|
|
12
|
+
|
|
14
13
|
/** Base CSS class to be applied to the element. No class is applied by default. */
|
|
15
|
-
baseClass?: string
|
|
14
|
+
baseClass?: string;
|
|
16
15
|
|
|
17
16
|
/** Set to `true` to add red asterisk for required fields. */
|
|
18
|
-
asterisk?:
|
|
17
|
+
asterisk?: Cx.BooleanProp;
|
|
19
18
|
|
|
20
19
|
/** Name of the HTML element to be rendered. Default is `div`. */
|
|
21
|
-
tag?: string
|
|
22
|
-
|
|
20
|
+
tag?: string;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
export class Label extends Cx.Widget<LabelProps> {}
|
|
@@ -1,88 +1,89 @@
|
|
|
1
|
-
import { Widget, VDOM } from "../../ui/Widget";
|
|
2
|
-
import { HtmlElement } from "../HtmlElement";
|
|
3
|
-
import { FocusManager } from "../../ui/FocusManager";
|
|
4
|
-
import { isArray } from "../../util/isArray";
|
|
5
|
-
import { coalesce } from "../../util/coalesce";
|
|
6
|
-
|
|
7
|
-
export class Label extends HtmlElement {
|
|
8
|
-
declareData() {
|
|
9
|
-
super.declareData(...arguments, {
|
|
10
|
-
required: undefined,
|
|
11
|
-
disabled: undefined,
|
|
12
|
-
htmlFor: undefined,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
data
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
case "
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
props.children.
|
|
77
|
-
props.children.push(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Label.prototype.
|
|
88
|
-
Label.prototype.
|
|
1
|
+
import { Widget, VDOM } from "../../ui/Widget";
|
|
2
|
+
import { HtmlElement } from "../HtmlElement";
|
|
3
|
+
import { FocusManager } from "../../ui/FocusManager";
|
|
4
|
+
import { isArray } from "../../util/isArray";
|
|
5
|
+
import { coalesce } from "../../util/coalesce";
|
|
6
|
+
|
|
7
|
+
export class Label extends HtmlElement {
|
|
8
|
+
declareData() {
|
|
9
|
+
super.declareData(...arguments, {
|
|
10
|
+
required: undefined,
|
|
11
|
+
disabled: undefined,
|
|
12
|
+
htmlFor: undefined,
|
|
13
|
+
asterisk: undefined,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
prepareData(context, instance) {
|
|
18
|
+
let { data } = instance;
|
|
19
|
+
data.stateMods = {
|
|
20
|
+
...data.stateMods,
|
|
21
|
+
disabled: data.disabled,
|
|
22
|
+
};
|
|
23
|
+
data._disabled = data.disabled;
|
|
24
|
+
super.prepareData(context, instance);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
explore(context, instance) {
|
|
28
|
+
let { data } = instance;
|
|
29
|
+
|
|
30
|
+
if (!data.htmlFor) data.htmlFor = context.lastFieldId;
|
|
31
|
+
|
|
32
|
+
data.disabled = data.stateMods.disabled = coalesce(
|
|
33
|
+
context.parentStrict ? context.parentDisabled : null,
|
|
34
|
+
data._disabled,
|
|
35
|
+
context.parentDisabled
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
data.asterisk = context.parentAsterisk || data.asterisk;
|
|
39
|
+
|
|
40
|
+
if (instance.cache("disabled", data.disabled) || instance.cache("asterisk", data.asterisk)) {
|
|
41
|
+
instance.markShouldUpdate(context);
|
|
42
|
+
this.prepareCSS(context, instance);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
super.explore(context, instance);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
isValidHtmlAttribute(attrName) {
|
|
49
|
+
switch (attrName) {
|
|
50
|
+
case "asterisk":
|
|
51
|
+
case "required":
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return super.isValidHtmlAttribute(attrName);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
attachProps(context, instance, props) {
|
|
58
|
+
super.attachProps(context, instance, props);
|
|
59
|
+
|
|
60
|
+
let { data } = instance;
|
|
61
|
+
|
|
62
|
+
if (data.htmlFor) {
|
|
63
|
+
props.htmlFor = data.htmlFor;
|
|
64
|
+
|
|
65
|
+
if (!props.onClick)
|
|
66
|
+
props.onClick = () => {
|
|
67
|
+
//additional focus for LookupFields which are not input based
|
|
68
|
+
let el = document.getElementById(instance.data.htmlFor);
|
|
69
|
+
if (el) FocusManager.focusFirst(el);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!props.id && data.htmlFor) props.id = `${data.htmlFor}-label`;
|
|
74
|
+
|
|
75
|
+
if (data.required && data.asterisk) {
|
|
76
|
+
if (!isArray(props.children)) props.children = [props.children];
|
|
77
|
+
props.children.push(" ");
|
|
78
|
+
props.children.push(
|
|
79
|
+
<span key="asterisk" className={this.CSS.element(this.baseClass, "asterisk")}>
|
|
80
|
+
*
|
|
81
|
+
</span>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Label.prototype.baseClass = "label";
|
|
88
|
+
Label.prototype.tag = "label";
|
|
89
|
+
Label.prototype.asterisk = false;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import * as Cx from
|
|
2
|
-
import { FieldGroupProps } from
|
|
1
|
+
import * as Cx from "../../core";
|
|
2
|
+
import { FieldGroupProps } from "./FieldGroup";
|
|
3
3
|
|
|
4
4
|
interface LabeledContainerProps extends FieldGroupProps {
|
|
5
|
-
|
|
6
5
|
/** The label. */
|
|
7
|
-
label?: Cx.StringProp | Cx.Config
|
|
8
|
-
|
|
9
|
-
/** Set to true to disable all fields inside the container. */
|
|
10
|
-
disabled?: boolean,
|
|
11
|
-
|
|
12
|
-
/** Apply asterisk to the label. */
|
|
13
|
-
asterisk?: boolean
|
|
14
|
-
|
|
6
|
+
label?: Cx.StringProp | Cx.Config;
|
|
15
7
|
}
|
|
16
8
|
|
|
17
9
|
export class LabeledContainer extends Cx.Widget<LabeledContainerProps> {}
|
|
@@ -35,7 +35,7 @@ export interface ValidationGroupProps extends Cx.PureContainerProps {
|
|
|
35
35
|
strict?: Cx.BooleanProp;
|
|
36
36
|
|
|
37
37
|
/** Set to `true` to add red asterisk for all required fields inside the group. */
|
|
38
|
-
asterisk?:
|
|
38
|
+
asterisk?: Cx.BooleanProp;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export class ValidationGroup extends Cx.Widget<ValidationGroupProps> {}
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
StructuredProp,
|
|
18
18
|
StyledContainerProps,
|
|
19
19
|
StyleProp,
|
|
20
|
+
UnknownProp,
|
|
20
21
|
Widget,
|
|
21
22
|
} from "../../core";
|
|
22
23
|
import { DataAdapterRecord } from "../../ui/adapter/DataAdapter";
|
|
@@ -108,6 +109,7 @@ interface GridColumnConfig {
|
|
|
108
109
|
aggregate?: "min" | "max" | "count" | "sum" | "distinct" | "avg";
|
|
109
110
|
aggregateAlias?: string;
|
|
110
111
|
aggregateField?: string;
|
|
112
|
+
aggregateValue?: UnknownProp;
|
|
111
113
|
caption?: StringProp;
|
|
112
114
|
class?: ClassProp;
|
|
113
115
|
className?: ClassProp;
|
|
@@ -319,7 +321,7 @@ interface GridProps<T = unknown> extends StyledContainerProps {
|
|
|
319
321
|
sortField?: string;
|
|
320
322
|
sortDirection?: string;
|
|
321
323
|
},
|
|
322
|
-
instance?: Instance
|
|
324
|
+
instance?: Instance
|
|
323
325
|
) => FetchRecordsResult | Promise<FetchRecordsResult>;
|
|
324
326
|
|
|
325
327
|
/** Callback function to be executed when a row is double-clicked. */
|
|
@@ -352,7 +354,7 @@ interface GridProps<T = unknown> extends StyledContainerProps {
|
|
|
352
354
|
/** Callback to create a function that can be used to check whether a record is selectable. */
|
|
353
355
|
onCreateIsRecordSelectable?: (
|
|
354
356
|
params: any,
|
|
355
|
-
instance: Instance
|
|
357
|
+
instance: Instance
|
|
356
358
|
) => (record: T, options?: { range?: boolean; toggle?: boolean }) => boolean;
|
|
357
359
|
|
|
358
360
|
/** Parameters whose change will cause scroll to be reset. */
|
package/src/widgets/grid/Grid.js
CHANGED
|
@@ -1324,6 +1324,7 @@ class GridComponent extends VDOM.Component {
|
|
|
1324
1324
|
dragged: isDragged,
|
|
1325
1325
|
cursor: widget.selectable && index == cursor,
|
|
1326
1326
|
over: dropTarget == "row" && dropInsertionIndex === index,
|
|
1327
|
+
alternate: index % 2 == 1,
|
|
1327
1328
|
};
|
|
1328
1329
|
|
|
1329
1330
|
if (isRecordSelectable) {
|
|
@@ -1593,19 +1594,23 @@ class GridComponent extends VDOM.Component {
|
|
|
1593
1594
|
</tbody>
|
|
1594
1595
|
);
|
|
1595
1596
|
|
|
1597
|
+
let isDataRecord = widget.buffered
|
|
1598
|
+
? (item) => item.props?.instance?.data?.class == "cxe-grid-data"
|
|
1599
|
+
: (item) => item.props?.record?.type;
|
|
1600
|
+
|
|
1596
1601
|
let index = 0;
|
|
1597
|
-
while (index < children.length && children[index]
|
|
1602
|
+
while (index < children.length && !isDataRecord(children[index])) index++;
|
|
1598
1603
|
|
|
1599
1604
|
let count = 0;
|
|
1600
|
-
while (count < this.state.dropInsertionIndex) {
|
|
1601
|
-
if (children[index]
|
|
1605
|
+
while (index < children.length && count < this.state.dropInsertionIndex) {
|
|
1606
|
+
if (isDataRecord(children[index])) count++;
|
|
1602
1607
|
index++;
|
|
1603
1608
|
}
|
|
1604
1609
|
|
|
1605
1610
|
let savedIndexPos = index;
|
|
1606
1611
|
|
|
1607
1612
|
if (!this.state.dropNextToTheRowAbove)
|
|
1608
|
-
while (index < children.length && children[index]
|
|
1613
|
+
while (index < children.length && !isDataRecord(children[index])) index++;
|
|
1609
1614
|
|
|
1610
1615
|
// do not allow insertion after the last group footer
|
|
1611
1616
|
if (savedIndexPos < index && index == children.length) index = savedIndexPos;
|
|
@@ -2001,15 +2006,15 @@ class GridComponent extends VDOM.Component {
|
|
|
2001
2006
|
if (dropTarget == "grid" && widget.onDrop && dropInsertionIndex != null) {
|
|
2002
2007
|
e.target = {
|
|
2003
2008
|
insertionIndex: start + dropInsertionIndex,
|
|
2004
|
-
recordBefore: this.
|
|
2005
|
-
recordAfter: this.
|
|
2009
|
+
recordBefore: this.getDataRecordAt(start + dropInsertionIndex - 1),
|
|
2010
|
+
recordAfter: this.getDataRecordAt(start + dropInsertionIndex),
|
|
2006
2011
|
dropNextToTheRowAbove,
|
|
2007
2012
|
};
|
|
2008
2013
|
instance.invoke("onDrop", e, instance);
|
|
2009
2014
|
} else if (dropTarget == "row") {
|
|
2010
2015
|
e.target = {
|
|
2011
2016
|
index: start + dropInsertionIndex,
|
|
2012
|
-
record: this.
|
|
2017
|
+
record: this.getDataRecordAt(start + dropInsertionIndex),
|
|
2013
2018
|
};
|
|
2014
2019
|
instance.invoke("onRowDrop", e, instance);
|
|
2015
2020
|
} else if (dropTarget == "column" && widget.onColumnDrop) {
|
|
@@ -2729,6 +2734,13 @@ class GridComponent extends VDOM.Component {
|
|
|
2729
2734
|
widget.selection.selectMultiple(instance.store, selection, indexes, options);
|
|
2730
2735
|
}
|
|
2731
2736
|
|
|
2737
|
+
getDataRecordAt(index) {
|
|
2738
|
+
let { records } = this.props.instance;
|
|
2739
|
+
if (!records) return this.getRecordAt(index);
|
|
2740
|
+
let dataRecords = records.filter((r) => r.type == "data");
|
|
2741
|
+
return dataRecords[index];
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2732
2744
|
getRecordAt(cursor) {
|
|
2733
2745
|
let { instance, data } = this.props;
|
|
2734
2746
|
let { records, widget } = instance;
|