cx 23.4.4 → 23.5.0
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 +16 -4
- package/dist/data.js +2 -9
- package/dist/manifest.js +709 -709
- package/dist/widgets.js +33 -11
- package/package.json +1 -1
- package/src/charts/Legend.d.ts +13 -13
- package/src/charts/Legend.js +11 -5
- package/src/charts/PieChart.js +16 -18
- package/src/data/Binding.js +2 -12
- package/src/data/Binding.spec.js +48 -38
- package/src/data/createAccessorModelProxy.spec.tsx +6 -0
- package/src/ui/Restate.js +158 -158
- package/src/widgets/form/DateTimeField.d.ts +86 -83
- package/src/widgets/form/DateTimeField.js +572 -571
- package/src/widgets/grid/Grid.js +22 -11
package/src/widgets/grid/Grid.js
CHANGED
|
@@ -42,6 +42,7 @@ import { StaticText } from "../../ui/StaticText";
|
|
|
42
42
|
import { unfocusElement } from "../../ui/FocusManager";
|
|
43
43
|
import { tooltipMouseMove, tooltipMouseLeave } from "../overlay/tooltip-ops";
|
|
44
44
|
import { Container } from "../../ui/Container";
|
|
45
|
+
import { findFirstChild } from "../../util/DOM";
|
|
45
46
|
|
|
46
47
|
export class Grid extends Container {
|
|
47
48
|
declareData(...args) {
|
|
@@ -510,13 +511,16 @@ export class Grid extends Container {
|
|
|
510
511
|
onClick={(e) => {
|
|
511
512
|
e.stopPropagation();
|
|
512
513
|
}}
|
|
514
|
+
data-unique-col-id={hdwidget.uniqueColumnId}
|
|
513
515
|
onMouseDown={(e) => {
|
|
514
516
|
if (e.buttons != 1) return;
|
|
515
517
|
let resizeOverlayEl = document.createElement("div");
|
|
516
|
-
|
|
517
|
-
|
|
518
|
+
|
|
519
|
+
let headerTBody = e.target.parentElement.parentElement.parentElement;
|
|
520
|
+
let uniqueColId = e.currentTarget.dataset.uniqueColId;
|
|
518
521
|
|
|
519
|
-
let
|
|
522
|
+
let headerCell = findFirstChild(headerTBody, el => el.tagName == 'TH' && el.dataset?.uniqueColId == uniqueColId);
|
|
523
|
+
let scrollAreaEl = headerTBody.parentElement.parentElement;
|
|
520
524
|
let gridEl = scrollAreaEl.parentElement;
|
|
521
525
|
let initialWidth = headerCell.offsetWidth;
|
|
522
526
|
let initialPosition = getCursorPos(e);
|
|
@@ -640,15 +644,17 @@ export class Grid extends Container {
|
|
|
640
644
|
}
|
|
641
645
|
}
|
|
642
646
|
|
|
647
|
+
let uniqueColumnId = header.data.colSpan > 1 ? null : hdwidget.uniqueColumnId;
|
|
648
|
+
|
|
643
649
|
style = header.data.style;
|
|
644
650
|
let customWidth =
|
|
645
651
|
header.data.width ||
|
|
646
|
-
instance.state.colWidth[
|
|
652
|
+
instance.state.colWidth[uniqueColumnId] ||
|
|
647
653
|
header.data.defaultWidth ||
|
|
648
|
-
instance.state.lockedColWidth[
|
|
654
|
+
instance.state.lockedColWidth[uniqueColumnId];
|
|
649
655
|
if (customWidth) {
|
|
650
|
-
if (instance.state.colWidth[
|
|
651
|
-
instance.state.colWidth[
|
|
656
|
+
if (instance.state.colWidth[uniqueColumnId] != customWidth)
|
|
657
|
+
instance.state.colWidth[uniqueColumnId] = customWidth;
|
|
652
658
|
let s = `${customWidth}px`;
|
|
653
659
|
style = {
|
|
654
660
|
...style,
|
|
@@ -686,10 +692,15 @@ export class Grid extends Container {
|
|
|
686
692
|
|
|
687
693
|
if (colIndex > 0) {
|
|
688
694
|
let hdinstPrev = line.children[colIndex - 1];
|
|
689
|
-
let
|
|
695
|
+
let prevLine = 3;
|
|
696
|
+
let headerPrev;
|
|
697
|
+
while (!headerPrev && prevLine >= 0) {
|
|
698
|
+
headerPrev = hdinstPrev.components[`header${prevLine + 1}`];
|
|
699
|
+
prevLine--;
|
|
700
|
+
}
|
|
690
701
|
if (
|
|
691
|
-
(hdinstPrev.widget.resizable ||
|
|
692
|
-
headerPrev
|
|
702
|
+
(hdinstPrev.widget.resizable || headerPrev?.data?.resizable) &&
|
|
703
|
+
headerPrev?.data?.colSpan < 2
|
|
693
704
|
) {
|
|
694
705
|
prevColumnResizer = this.renderResizer(instance, hdinstPrev, headerPrev, colIndex - 1, true);
|
|
695
706
|
}
|
|
@@ -714,7 +725,7 @@ export class Grid extends Container {
|
|
|
714
725
|
onMouseLeave={(e) => this.onHeaderMouseLeave(e, hdinst, l)}
|
|
715
726
|
onClick={(e) => this.onHeaderClick(e, hdwidget, instance, l)}
|
|
716
727
|
onContextMenu={onContextMenu}
|
|
717
|
-
data-unique-col-id={hdwidget.uniqueColumnId}
|
|
728
|
+
data-unique-col-id={colSpan > 1 ? null: hdwidget.uniqueColumnId}
|
|
718
729
|
>
|
|
719
730
|
{getContent(content)}
|
|
720
731
|
{sortIcon}
|