cx 26.9.0 → 26.9.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/build/data/index.d.ts +1 -0
- package/build/data/index.d.ts.map +1 -1
- package/build/data/index.js +1 -0
- package/build/widgets/grid/Grid.d.ts +4 -1
- package/build/widgets/grid/Grid.d.ts.map +1 -1
- package/build/widgets/grid/Grid.js +36 -10
- package/dist/data.js +1 -0
- package/dist/manifest.js +788 -788
- package/dist/widgets.js +46 -11
- package/package.json +1 -1
- package/src/data/index.ts +31 -30
- package/src/ui/Cx.tsx +505 -505
- package/src/ui/DataProxy.ts +55 -55
- package/src/ui/Rescope.ts +50 -50
- package/src/ui/exprHelpers.ts +96 -96
- package/src/widgets/Sandbox.ts +104 -104
- package/src/widgets/form/ColorField.scss +112 -112
- package/src/widgets/form/DateTimeField.scss +111 -111
- package/src/widgets/form/LookupField.maps.scss +26 -26
- package/src/widgets/form/MonthField.scss +113 -113
- package/src/widgets/form/Select.scss +104 -104
- package/src/widgets/form/TextField.scss +66 -66
- package/src/widgets/grid/Grid.tsx +62 -14
- package/src/widgets/index.ts +41 -41
package/dist/widgets.js
CHANGED
|
@@ -18271,7 +18271,7 @@ class Grid extends ContainerBase$1 {
|
|
|
18271
18271
|
},
|
|
18272
18272
|
});
|
|
18273
18273
|
}
|
|
18274
|
-
renderHeader(context, instance, key, fixed, fixedColumns) {
|
|
18274
|
+
renderHeader(context, instance, key, fixed, fixedColumns, repeated) {
|
|
18275
18275
|
let { data, widget, header } = instance;
|
|
18276
18276
|
let { CSS, baseClass } = widget;
|
|
18277
18277
|
let headerRows = [];
|
|
@@ -18427,13 +18427,15 @@ class Grid extends ContainerBase$1 {
|
|
|
18427
18427
|
}
|
|
18428
18428
|
});
|
|
18429
18429
|
if (headerRows.length == 0) return null;
|
|
18430
|
-
|
|
18431
|
-
|
|
18430
|
+
//headers repeated for each group sit between the data rows, where a second thead
|
|
18431
|
+
//would not be allowed
|
|
18432
|
+
return VDOM$2.createElement(
|
|
18433
|
+
repeated ? "tbody" : "thead",
|
|
18432
18434
|
{
|
|
18435
|
+
key: "h" + key,
|
|
18433
18436
|
className: CSS.element(baseClass, "header"),
|
|
18434
|
-
children: headerRows,
|
|
18435
18437
|
},
|
|
18436
|
-
|
|
18438
|
+
headerRows,
|
|
18437
18439
|
);
|
|
18438
18440
|
}
|
|
18439
18441
|
onHeaderMouseMove(e, column, columnInstance, gridInstance, headerLine) {
|
|
@@ -18541,6 +18543,7 @@ class Grid extends ContainerBase$1 {
|
|
|
18541
18543
|
children: jsx("tr", {
|
|
18542
18544
|
children: jsx("td", {
|
|
18543
18545
|
colSpan: 1000,
|
|
18546
|
+
role: "columnheader",
|
|
18544
18547
|
children: caption,
|
|
18545
18548
|
}),
|
|
18546
18549
|
}),
|
|
@@ -18605,6 +18608,7 @@ class Grid extends ContainerBase$1 {
|
|
|
18605
18608
|
{
|
|
18606
18609
|
className: cls,
|
|
18607
18610
|
colSpan: colSpan,
|
|
18611
|
+
role: c.caption ? "columnheader" : undefined,
|
|
18608
18612
|
style: style,
|
|
18609
18613
|
children: v,
|
|
18610
18614
|
},
|
|
@@ -18771,9 +18775,9 @@ class Grid extends ContainerBase$1 {
|
|
|
18771
18775
|
),
|
|
18772
18776
|
);
|
|
18773
18777
|
if (g.showHeader) {
|
|
18774
|
-
record.vdom.push(this.renderHeader(context, instance, record.key + "-header", false, false));
|
|
18778
|
+
record.vdom.push(this.renderHeader(context, instance, record.key + "-header", false, false, true));
|
|
18775
18779
|
if (hasFixedColumns)
|
|
18776
|
-
record.fixedVdom.push(this.renderHeader(context, instance, record.key + "-header", false, true));
|
|
18780
|
+
record.fixedVdom.push(this.renderHeader(context, instance, record.key + "-header", false, true, true));
|
|
18777
18781
|
}
|
|
18778
18782
|
}
|
|
18779
18783
|
if (record.type == "group-footer") {
|
|
@@ -19107,6 +19111,29 @@ class GridComponent extends VDOM$2.Component {
|
|
|
19107
19111
|
);
|
|
19108
19112
|
};
|
|
19109
19113
|
}
|
|
19114
|
+
groupLooseRows(items) {
|
|
19115
|
+
let { CSS, baseClass } = this.props.instance.widget;
|
|
19116
|
+
let result = [];
|
|
19117
|
+
for (let i = 0; i < items.length; i++) {
|
|
19118
|
+
if (!items[i]?.props?.useTrTag) {
|
|
19119
|
+
result.push(items[i]);
|
|
19120
|
+
continue;
|
|
19121
|
+
}
|
|
19122
|
+
let start = i;
|
|
19123
|
+
while (i + 1 < items.length && items[i + 1]?.props?.useTrTag) i++;
|
|
19124
|
+
result.push(
|
|
19125
|
+
jsx(
|
|
19126
|
+
"tbody",
|
|
19127
|
+
{
|
|
19128
|
+
className: CSS.element(baseClass, "row-group"),
|
|
19129
|
+
children: items.slice(start, i + 1),
|
|
19130
|
+
},
|
|
19131
|
+
`rows-${items[start].key}`,
|
|
19132
|
+
),
|
|
19133
|
+
);
|
|
19134
|
+
}
|
|
19135
|
+
return result;
|
|
19136
|
+
}
|
|
19110
19137
|
render() {
|
|
19111
19138
|
let { instance, data, fixedFooter, fixedColumnsFixedFooter } = this.props;
|
|
19112
19139
|
let { widget, hasFixedColumns } = instance;
|
|
@@ -19353,6 +19380,12 @@ class GridComponent extends VDOM$2.Component {
|
|
|
19353
19380
|
if (hasFixedColumns) fixedChildren.push(fixedColumnsFixedFooter);
|
|
19354
19381
|
}
|
|
19355
19382
|
}
|
|
19383
|
+
//grids with merged cells render rows as tr elements, as rowspan cannot cross row group
|
|
19384
|
+
//boundaries, so consecutive rows have to share a tbody instead of getting one each
|
|
19385
|
+
if (instance.row.hasMergedCells) {
|
|
19386
|
+
children = this.groupLooseRows(children);
|
|
19387
|
+
if (hasFixedColumns) fixedChildren = this.groupLooseRows(fixedChildren);
|
|
19388
|
+
}
|
|
19356
19389
|
let shouldRenderFixedFooter = widget.scrollable && (fixedFooter || fixedColumnsFixedFooter);
|
|
19357
19390
|
if (hasFixedColumns) {
|
|
19358
19391
|
fixedColumnsContent.push(
|
|
@@ -20250,16 +20283,18 @@ class GridComponent extends VDOM$2.Component {
|
|
|
20250
20283
|
if (this.state.focused && !this.state.cellEdit && wasCellEditing) FocusManager.focus(this.dom.el);
|
|
20251
20284
|
if (scrollIntoView) {
|
|
20252
20285
|
let record = this.getRecordAt(index);
|
|
20253
|
-
|
|
20286
|
+
//rows are tbody elements, except in grids with merged cells, where they are tr
|
|
20287
|
+
let cellsOf = (rowEl) => (rowEl.tagName == "TR" ? rowEl : rowEl.firstChild).children;
|
|
20288
|
+
let item = record && this.dom.table.querySelector(`[data-record-key="${record.key}"]`);
|
|
20254
20289
|
let hscroll = false;
|
|
20255
20290
|
if (item) {
|
|
20256
20291
|
if (widget.cellEditable)
|
|
20257
20292
|
if (this.state.cursorCellIndex >= this.props.instance.fixedColumnCount) {
|
|
20258
20293
|
hscroll = true;
|
|
20259
|
-
item = item
|
|
20294
|
+
item = cellsOf(item)[this.state.cursorCellIndex - this.props.instance.fixedColumnCount];
|
|
20260
20295
|
} else {
|
|
20261
|
-
let fixedItem = this.dom.fixedTable.querySelector(`
|
|
20262
|
-
let cell = fixedItem && fixedItem
|
|
20296
|
+
let fixedItem = this.dom.fixedTable.querySelector(`[data-record-key="${record.key}"]`);
|
|
20297
|
+
let cell = fixedItem && cellsOf(fixedItem)[this.state.cursorCellIndex];
|
|
20263
20298
|
if (cell) scrollElementIntoView(cell, false, true, 10);
|
|
20264
20299
|
}
|
|
20265
20300
|
scrollElementIntoView(item, true, hscroll, widget.cellEditable ? 10 : 0);
|
package/package.json
CHANGED
package/src/data/index.ts
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
export * from "./Binding";
|
|
2
|
-
export * from "./Expression";
|
|
3
|
-
export * from "./StringTemplate";
|
|
4
|
-
export * from "./View";
|
|
5
|
-
export * from "./SubscribableView";
|
|
6
|
-
export * from "./Store";
|
|
7
|
-
export * from "./ExposedRecordView";
|
|
8
|
-
export * from "./ExposedValueView";
|
|
9
|
-
export * from "./ReadOnlyDataView";
|
|
10
|
-
export * from "./ZoomIntoPropertyView";
|
|
11
|
-
export * from "./StructuredSelector";
|
|
12
|
-
export * from "./computable";
|
|
13
|
-
export * from "./getSelector";
|
|
14
|
-
export * from "./isSelector";
|
|
15
|
-
export * from "./Grouper";
|
|
16
|
-
export * from "./comparer";
|
|
17
|
-
export * from "./enableFatArrowExpansion";
|
|
18
|
-
export * from "./ops/index";
|
|
19
|
-
export * from "./diff/index";
|
|
20
|
-
export * from "./Ref";
|
|
21
|
-
export * from "./ArrayRef";
|
|
22
|
-
export * from "./StoreProxy";
|
|
23
|
-
export * from "./AugmentedViewBase";
|
|
24
|
-
export * from "./ArrayElementView";
|
|
25
|
-
export * from "./getAccessor";
|
|
26
|
-
export * from "./defaultCompare";
|
|
27
|
-
export * from "./NestedDataView";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export * from "./
|
|
1
|
+
export * from "./Binding";
|
|
2
|
+
export * from "./Expression";
|
|
3
|
+
export * from "./StringTemplate";
|
|
4
|
+
export * from "./View";
|
|
5
|
+
export * from "./SubscribableView";
|
|
6
|
+
export * from "./Store";
|
|
7
|
+
export * from "./ExposedRecordView";
|
|
8
|
+
export * from "./ExposedValueView";
|
|
9
|
+
export * from "./ReadOnlyDataView";
|
|
10
|
+
export * from "./ZoomIntoPropertyView";
|
|
11
|
+
export * from "./StructuredSelector";
|
|
12
|
+
export * from "./computable";
|
|
13
|
+
export * from "./getSelector";
|
|
14
|
+
export * from "./isSelector";
|
|
15
|
+
export * from "./Grouper";
|
|
16
|
+
export * from "./comparer";
|
|
17
|
+
export * from "./enableFatArrowExpansion";
|
|
18
|
+
export * from "./ops/index";
|
|
19
|
+
export * from "./diff/index";
|
|
20
|
+
export * from "./Ref";
|
|
21
|
+
export * from "./ArrayRef";
|
|
22
|
+
export * from "./StoreProxy";
|
|
23
|
+
export * from "./AugmentedViewBase";
|
|
24
|
+
export * from "./ArrayElementView";
|
|
25
|
+
export * from "./getAccessor";
|
|
26
|
+
export * from "./defaultCompare";
|
|
27
|
+
export * from "./NestedDataView";
|
|
28
|
+
export * from "./AggregateFunction";
|
|
29
|
+
|
|
30
|
+
export * from "./createAccessorModelProxy";
|
|
31
|
+
export * from "./Selector";
|