@taocompany/magic-grid 0.3.2 → 0.3.4
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/core/grid/gridViewport.d.ts +2 -0
- package/dist/core/grid/gridViewport.d.ts.map +1 -1
- package/dist/core/scroll/virtualScrollMapper.d.ts +6 -0
- package/dist/core/scroll/virtualScrollMapper.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +344 -334
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -18620,7 +18620,10 @@ function TS(e) {
|
|
|
18620
18620
|
function ES(e, t) {
|
|
18621
18621
|
e.classList.toggle("mg-grid--has-v-scrollbar", t.hasVScrollbar), e.classList.toggle("mg-grid--has-h-scrollbar", t.hasHScrollbar), e.classList.toggle("mg-grid--inner-right-closes", t.innerRightClosesTable), e.classList.toggle("mg-grid--inner-bottom-closes", t.innerBottomClosesTable);
|
|
18622
18622
|
}
|
|
18623
|
-
function DS(e, t, n
|
|
18623
|
+
function DS(e, t, n) {
|
|
18624
|
+
return n > 0 && e > 0 && e < t ? Math.floor(t) : e;
|
|
18625
|
+
}
|
|
18626
|
+
function OS(e, t, n, r) {
|
|
18624
18627
|
let i = Math.max(0, e - t);
|
|
18625
18628
|
if (r === 0 || e <= 16777216) return {
|
|
18626
18629
|
totalHeight: e,
|
|
@@ -18628,7 +18631,7 @@ function DS(e, t, n, r) {
|
|
|
18628
18631
|
rowHeight: n,
|
|
18629
18632
|
rowCount: r,
|
|
18630
18633
|
compressed: !1,
|
|
18631
|
-
physicalSpacerHeight: e,
|
|
18634
|
+
physicalSpacerHeight: DS(e, t, r),
|
|
18632
18635
|
physicalMaxScroll: i,
|
|
18633
18636
|
logicalMaxScroll: i
|
|
18634
18637
|
};
|
|
@@ -18644,29 +18647,29 @@ function DS(e, t, n, r) {
|
|
|
18644
18647
|
logicalMaxScroll: i
|
|
18645
18648
|
};
|
|
18646
18649
|
}
|
|
18647
|
-
function OS(e, t) {
|
|
18648
|
-
return t.compressed ? e >= t.physicalMaxScroll ? t.logicalMaxScroll : AS(e * t.rowHeight, 0, t.logicalMaxScroll) : AS(e, 0, t.logicalMaxScroll);
|
|
18649
|
-
}
|
|
18650
18650
|
function kS(e, t) {
|
|
18651
|
-
return t.compressed ? e >= t.
|
|
18651
|
+
return t.compressed ? e >= t.physicalMaxScroll ? t.logicalMaxScroll : jS(e * t.rowHeight, 0, t.logicalMaxScroll) : jS(e, 0, t.logicalMaxScroll);
|
|
18652
18652
|
}
|
|
18653
|
-
function AS(e, t
|
|
18653
|
+
function AS(e, t) {
|
|
18654
|
+
return t.compressed ? e >= t.logicalMaxScroll ? t.physicalMaxScroll : jS(e / t.rowHeight, 0, t.physicalMaxScroll) : jS(e, 0, t.physicalMaxScroll);
|
|
18655
|
+
}
|
|
18656
|
+
function jS(e, t, n) {
|
|
18654
18657
|
return Math.max(t, Math.min(e, n));
|
|
18655
18658
|
}
|
|
18656
18659
|
//#endregion
|
|
18657
18660
|
//#region src/core/scroll/measureScrollbarWidth.ts
|
|
18658
|
-
var
|
|
18659
|
-
function
|
|
18660
|
-
if (
|
|
18661
|
+
var MS = null;
|
|
18662
|
+
function NS(e = document) {
|
|
18663
|
+
if (MS !== null) return MS;
|
|
18661
18664
|
let t = e.createElement("div");
|
|
18662
18665
|
t.style.cssText = "visibility:hidden;overflow:scroll;width:100px;height:100px;position:absolute;top:-9999px", e.body.appendChild(t);
|
|
18663
18666
|
let n = Math.max(0, t.offsetWidth - t.clientWidth);
|
|
18664
|
-
return t.remove(), n === 0 &&
|
|
18667
|
+
return t.remove(), n === 0 && FS(e) ? (MS = 8, MS) : (MS = n, MS);
|
|
18665
18668
|
}
|
|
18666
|
-
function
|
|
18667
|
-
|
|
18669
|
+
function PS() {
|
|
18670
|
+
MS = null;
|
|
18668
18671
|
}
|
|
18669
|
-
function
|
|
18672
|
+
function FS(e = document) {
|
|
18670
18673
|
let t = e.createElement("div");
|
|
18671
18674
|
t.style.cssText = "width:100px;height:100px;overflow:scroll;visibility:hidden;position:absolute;top:-9999px";
|
|
18672
18675
|
let n = e.createElement("div");
|
|
@@ -18676,12 +18679,12 @@ function PS(e = document) {
|
|
|
18676
18679
|
}
|
|
18677
18680
|
//#endregion
|
|
18678
18681
|
//#region src/core/scroll/resolveScrollbarGutter.ts
|
|
18679
|
-
function
|
|
18682
|
+
function IS(e) {
|
|
18680
18683
|
if (!e.hasVScrollbar) return {
|
|
18681
18684
|
layout: 0,
|
|
18682
18685
|
visual: 0
|
|
18683
18686
|
};
|
|
18684
|
-
let t = e.overlayScrollbars ??
|
|
18687
|
+
let t = e.overlayScrollbars ?? FS(), n = e.measuredWidth ?? NS();
|
|
18685
18688
|
if (t) return {
|
|
18686
18689
|
layout: 0,
|
|
18687
18690
|
visual: n
|
|
@@ -18692,8 +18695,8 @@ function FS(e) {
|
|
|
18692
18695
|
visual: r
|
|
18693
18696
|
};
|
|
18694
18697
|
}
|
|
18695
|
-
function
|
|
18696
|
-
let r = Math.max(0, t.offsetWidth - t.clientWidth), i =
|
|
18698
|
+
function LS(e, t, n) {
|
|
18699
|
+
let r = Math.max(0, t.offsetWidth - t.clientWidth), i = IS({
|
|
18697
18700
|
hasVScrollbar: t.scrollHeight > t.clientHeight + 1,
|
|
18698
18701
|
liveGutterWidth: r,
|
|
18699
18702
|
overlayScrollbars: n
|
|
@@ -18704,7 +18707,7 @@ function IS(e, t, n) {
|
|
|
18704
18707
|
}
|
|
18705
18708
|
//#endregion
|
|
18706
18709
|
//#region src/core/grid/gridViewport.ts
|
|
18707
|
-
var
|
|
18710
|
+
var RS = class {
|
|
18708
18711
|
deps;
|
|
18709
18712
|
lastScrollLeft = 0;
|
|
18710
18713
|
onAfterRedraw = null;
|
|
@@ -18728,7 +18731,7 @@ var LS = class {
|
|
|
18728
18731
|
this.deps.viewportEl.removeEventListener("scroll", this.handleScroll), this.resizeObserver?.disconnect(), this.resizeObserver = null;
|
|
18729
18732
|
}
|
|
18730
18733
|
getLogicalScrollTop() {
|
|
18731
|
-
return
|
|
18734
|
+
return kS(this.deps.viewportEl.scrollTop, this.getScrollRange());
|
|
18732
18735
|
}
|
|
18733
18736
|
getRenderViewportHeight() {
|
|
18734
18737
|
return this.getRenderViewportHeightInternal();
|
|
@@ -18780,7 +18783,7 @@ var LS = class {
|
|
|
18780
18783
|
}
|
|
18781
18784
|
syncViewportHeight() {
|
|
18782
18785
|
let e = this.getViewportHeight(), t = this.resolveLogicalScrollTopForSync(), n = this.getScrollRange(e);
|
|
18783
|
-
|
|
18786
|
+
this.applySpacerLayoutFromRange(e, n), this.syncScrollMode(e);
|
|
18784
18787
|
let r = Math.min(t, n.logicalMaxScroll);
|
|
18785
18788
|
this.deps.scrollBridge.syncScrollTop(r), this.applyPhysicalScrollFromLogical(r), this.syncHeaderFooterRowWidth(), this.syncScrollbarGutter(), this.syncBorderClosureState(), this.syncIndexColumnFill();
|
|
18786
18789
|
}
|
|
@@ -18818,15 +18821,12 @@ var LS = class {
|
|
|
18818
18821
|
let n = this.getViewportHeight();
|
|
18819
18822
|
this.syncCompressedLayerHeight(n);
|
|
18820
18823
|
let r = e ?? this.getLogicalScrollTop(), i = t ?? this.deps.viewportEl.scrollLeft, a = this.deps.viewportEl.clientWidth, o = xS(this.deps.columnModel, i, a);
|
|
18821
|
-
|
|
18822
|
-
this.scrollTo(r, o);
|
|
18823
|
-
return;
|
|
18824
|
-
}
|
|
18824
|
+
o !== i && (this.deps.viewportEl.scrollLeft = o, this.lastScrollLeft = o, this.deps.headerScrollEl.scrollLeft = o, this.syncFooterScrollLeft(), this.syncFloatingFilterScrollLeft());
|
|
18825
18825
|
let s = this.getRenderViewportHeightInternal(), c = this.deps.columnViewport.update(o, a), l = this.deps.columnViewport.getWindow();
|
|
18826
18826
|
c && (this.renderHeader(l), this.deps.refreshFooter?.(), this.deps.refreshFloatingFilter?.(), this.deps.applyFocusVisuals()), this.syncFooterScrollLeft(), this.syncFloatingFilterScrollLeft(), this.syncPinnedRows(), this.deps.rowRenderer.redraw(r, s, l, c), this.deps.applyCellRangeVisuals?.(), this.syncIndexColumnFill(), this.onAfterRedraw?.();
|
|
18827
18827
|
}
|
|
18828
18828
|
syncScrollbarGutter() {
|
|
18829
|
-
|
|
18829
|
+
LS({
|
|
18830
18830
|
rootEl: this.deps.rootEl,
|
|
18831
18831
|
headerViewportEl: this.deps.headerViewportEl,
|
|
18832
18832
|
footerViewportEl: this.deps.footerViewportEl,
|
|
@@ -18835,10 +18835,20 @@ var LS = class {
|
|
|
18835
18835
|
}, this.deps.viewportEl, this.getOverlayScrollbars());
|
|
18836
18836
|
}
|
|
18837
18837
|
getOverlayScrollbars() {
|
|
18838
|
-
return this.overlayScrollbars === null && (this.overlayScrollbars =
|
|
18838
|
+
return this.overlayScrollbars === null && (this.overlayScrollbars = FS()), this.overlayScrollbars;
|
|
18839
18839
|
}
|
|
18840
18840
|
handleViewportResize() {
|
|
18841
|
-
this.deps.isDestroyed()
|
|
18841
|
+
if (this.deps.isDestroyed()) return;
|
|
18842
|
+
PS(), this.overlayScrollbars = null;
|
|
18843
|
+
let e = this.getViewportHeight(), t = this.getScrollRange(e);
|
|
18844
|
+
this.applySpacerLayoutFromRange(e, t), this.syncHeaderFooterRowWidth(), this.syncScrollbarGutter(), this.syncBorderClosureState(), this.syncIndexColumnFill();
|
|
18845
|
+
}
|
|
18846
|
+
applySpacerLayoutFromRange(e, t) {
|
|
18847
|
+
if (t.compressed) {
|
|
18848
|
+
this.deps.spacerEl.style.height = "", this.deps.scrollPhantomEl.style.height = `${t.physicalMaxScroll + 1}px`, this.syncCompressedLayerHeight(e);
|
|
18849
|
+
return;
|
|
18850
|
+
}
|
|
18851
|
+
this.deps.spacerEl.style.height = `${t.physicalSpacerHeight}px`, this.deps.scrollPhantomEl.style.height = "0px", this.deps.viewportEl.style.removeProperty("--mg-viewport-px");
|
|
18842
18852
|
}
|
|
18843
18853
|
syncHeaderFooterRowWidth() {
|
|
18844
18854
|
let e = this.deps.columnModel.getTotalWidth();
|
|
@@ -18916,24 +18926,24 @@ var LS = class {
|
|
|
18916
18926
|
e.hidden = !0;
|
|
18917
18927
|
return;
|
|
18918
18928
|
}
|
|
18919
|
-
let r = this.deps.rowModel.getRowCount(), i = this.deps.rowModel.getTotalHeight(), a = this.getViewportHeight(), o = this.getLogicalScrollTop(),
|
|
18920
|
-
if (r === 0 ||
|
|
18929
|
+
let r = this.deps.rowModel.getRowCount(), i = this.deps.rowModel.getTotalHeight(), a = this.getViewportHeight(), o = Math.floor(a), s = this.getLogicalScrollTop(), c = Math.max(0, Math.floor(s + o - i));
|
|
18930
|
+
if (r === 0 || c <= 0) {
|
|
18921
18931
|
e.hidden = !0;
|
|
18922
18932
|
return;
|
|
18923
18933
|
}
|
|
18924
|
-
let
|
|
18925
|
-
e.hidden = !1, t.style.top = `${
|
|
18934
|
+
let l = this.getScrollRange(a).compressed ? i - s : i;
|
|
18935
|
+
e.hidden = !1, t.style.top = `${l}px`, t.style.left = `${n.left}px`, t.style.width = `${n.width}px`, t.style.height = `${c}px`;
|
|
18926
18936
|
}
|
|
18927
18937
|
getScrollRange(e) {
|
|
18928
18938
|
let t = e ?? this.getViewportHeight();
|
|
18929
|
-
return
|
|
18939
|
+
return OS(this.deps.rowModel.getTotalHeight(), t, this.deps.getDefaultRowHeight(), this.deps.rowModel.getRowCount());
|
|
18930
18940
|
}
|
|
18931
18941
|
resolveLogicalScrollTopForSync() {
|
|
18932
18942
|
return Math.max(this.getLogicalScrollTop(), this.deps.scrollBridge.getNextScrollTop(), this.deps.scrollBridge.getScrollTop());
|
|
18933
18943
|
}
|
|
18934
18944
|
applyPhysicalScrollFromLogical(e) {
|
|
18935
18945
|
let t = this.getScrollRange();
|
|
18936
|
-
this.deps.viewportEl.scrollTop =
|
|
18946
|
+
this.deps.viewportEl.scrollTop = AS(e, t);
|
|
18937
18947
|
}
|
|
18938
18948
|
syncScrollMode(e) {
|
|
18939
18949
|
let t = e ?? this.getViewportHeight(), n = this.getScrollRange(t).compressed;
|
|
@@ -18942,7 +18952,7 @@ var LS = class {
|
|
|
18942
18952
|
};
|
|
18943
18953
|
//#endregion
|
|
18944
18954
|
//#region src/core/column/columnSettingsOrderReset.ts
|
|
18945
|
-
function
|
|
18955
|
+
function zS(e) {
|
|
18946
18956
|
let t = [
|
|
18947
18957
|
"left",
|
|
18948
18958
|
"center",
|
|
@@ -18954,10 +18964,10 @@ function RS(e) {
|
|
|
18954
18964
|
}
|
|
18955
18965
|
return n;
|
|
18956
18966
|
}
|
|
18957
|
-
function
|
|
18967
|
+
function BS(e, t) {
|
|
18958
18968
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
18959
18969
|
}
|
|
18960
|
-
function
|
|
18970
|
+
function VS(e, t) {
|
|
18961
18971
|
for (let n = 0; n < t.length; n += 1) {
|
|
18962
18972
|
let r = t[n];
|
|
18963
18973
|
if (!(!r || e[n] === r)) return {
|
|
@@ -18969,7 +18979,7 @@ function BS(e, t) {
|
|
|
18969
18979
|
}
|
|
18970
18980
|
//#endregion
|
|
18971
18981
|
//#region src/core/grid/gridColumnLayout.ts
|
|
18972
|
-
var
|
|
18982
|
+
var HS = class {
|
|
18973
18983
|
deps;
|
|
18974
18984
|
columnMoveOptions;
|
|
18975
18985
|
columnResizeOptions;
|
|
@@ -19093,10 +19103,10 @@ var VS = class {
|
|
|
19093
19103
|
return i !== o && (c.toFixed = o), this.deps.eventBus.emit("columnMoved", c), n && this.deps.clearCellSelection?.(), !0;
|
|
19094
19104
|
}
|
|
19095
19105
|
resetColumnOrder() {
|
|
19096
|
-
let e = this.deps.columnModel.getColumns(), t = e.map((e) => e.colId), n =
|
|
19097
|
-
if (
|
|
19106
|
+
let e = this.deps.columnModel.getColumns(), t = e.map((e) => e.colId), n = zS(e);
|
|
19107
|
+
if (BS(t, n) || !this.deps.columnModel.resetColumnsOrder(n)) return !1;
|
|
19098
19108
|
this.deps.columnViewport.invalidate(), this.deps.viewport.syncHorizontalLayout(), this.deps.viewport.refreshHeader(), this.deps.viewport.redrawImmediately(), this.deps.refreshFooter(), this.deps.refreshFloatingFilter(), this.refreshFlexedColumns();
|
|
19099
|
-
let r =
|
|
19109
|
+
let r = VS(t, n);
|
|
19100
19110
|
return this.deps.eventBus.emit("columnMoved", {
|
|
19101
19111
|
columnOrder: n,
|
|
19102
19112
|
fromColId: r?.fromColId ?? n[0] ?? "",
|
|
@@ -19140,7 +19150,7 @@ var VS = class {
|
|
|
19140
19150
|
syncColumnMovePresentationClasses() {
|
|
19141
19151
|
this.deps.rootEl.classList.toggle("magic-grid--suppress-column-move-animation", this.columnMoveOptions.suppressColumnMoveAnimation);
|
|
19142
19152
|
}
|
|
19143
|
-
},
|
|
19153
|
+
}, US = class {
|
|
19144
19154
|
deps;
|
|
19145
19155
|
constructor(e) {
|
|
19146
19156
|
this.deps = e;
|
|
@@ -19210,48 +19220,48 @@ var VS = class {
|
|
|
19210
19220
|
};
|
|
19211
19221
|
//#endregion
|
|
19212
19222
|
//#region src/core/selection/treeSelectionCascade.ts
|
|
19213
|
-
function
|
|
19223
|
+
function WS(e) {
|
|
19214
19224
|
return e.rowKind == null || e.rowKind === "data";
|
|
19215
19225
|
}
|
|
19216
|
-
function
|
|
19226
|
+
function GS(e, t) {
|
|
19217
19227
|
let n = e[t];
|
|
19218
19228
|
if (!n || !G(n)) return [];
|
|
19219
19229
|
let r = n.treeLevel ?? 0, i = [];
|
|
19220
19230
|
for (let n = t + 1; n < e.length; n += 1) {
|
|
19221
19231
|
let t = e[n];
|
|
19222
19232
|
if ((t.treeLevel ?? 0) <= r) break;
|
|
19223
|
-
|
|
19233
|
+
WS(t) && i.push(t.id);
|
|
19224
19234
|
}
|
|
19225
19235
|
return i;
|
|
19226
19236
|
}
|
|
19227
|
-
function
|
|
19237
|
+
function KS(e, t) {
|
|
19228
19238
|
let n = e.findIndex((e) => e.id === t);
|
|
19229
19239
|
if (n < 0) return [];
|
|
19230
19240
|
let r = e[n].treeLevel ?? 0, i = [];
|
|
19231
19241
|
for (let t = n + 1; t < e.length; t += 1) {
|
|
19232
19242
|
let n = e[t], a = n.treeLevel ?? 0;
|
|
19233
19243
|
if (a <= r) break;
|
|
19234
|
-
a === r + 1 &&
|
|
19244
|
+
a === r + 1 && WS(n) && i.push(n.id);
|
|
19235
19245
|
}
|
|
19236
19246
|
return i;
|
|
19237
19247
|
}
|
|
19238
|
-
function
|
|
19248
|
+
function qS(e, t) {
|
|
19239
19249
|
let n = /* @__PURE__ */ new Set();
|
|
19240
19250
|
for (let r = 0; r < e.length; r += 1) {
|
|
19241
19251
|
let i = e[r];
|
|
19242
19252
|
if (!G(i) || i.treeLeaf === !0) continue;
|
|
19243
|
-
let a =
|
|
19253
|
+
let a = KS(e, i.id);
|
|
19244
19254
|
if (a.length === 0) continue;
|
|
19245
19255
|
let o = a.filter((e) => t.has(e)).length;
|
|
19246
19256
|
o !== 0 && (o < a.length || !t.has(i.id)) && n.add(i.id);
|
|
19247
19257
|
}
|
|
19248
19258
|
return n;
|
|
19249
19259
|
}
|
|
19250
|
-
function
|
|
19260
|
+
function JS(e) {
|
|
19251
19261
|
if (!e.groupSelectsChildren) return !1;
|
|
19252
19262
|
let t = e.displayRows.findIndex((t) => t.id === e.rowId);
|
|
19253
19263
|
if (t < 0) return !1;
|
|
19254
|
-
let n = !1, r =
|
|
19264
|
+
let n = !1, r = GS(e.displayRows, t);
|
|
19255
19265
|
for (let t of r) {
|
|
19256
19266
|
if (e.selected) {
|
|
19257
19267
|
e.selectedIds.has(t) || (e.selectedIds.add(t), n = !0);
|
|
@@ -19261,12 +19271,12 @@ function qS(e) {
|
|
|
19261
19271
|
}
|
|
19262
19272
|
return n;
|
|
19263
19273
|
}
|
|
19264
|
-
function
|
|
19274
|
+
function YS(e, t) {
|
|
19265
19275
|
let n = !1;
|
|
19266
19276
|
for (let r = e.length - 1; r >= 0; --r) {
|
|
19267
19277
|
let i = e[r];
|
|
19268
19278
|
if (!G(i) || i.treeLeaf === !0) continue;
|
|
19269
|
-
let a =
|
|
19279
|
+
let a = KS(e, i.id);
|
|
19270
19280
|
if (a.length === 0) continue;
|
|
19271
19281
|
let o = a.filter((e) => t.has(e)).length, s = o === a.length, c = t.has(i.id);
|
|
19272
19282
|
if (s && !c) {
|
|
@@ -19279,7 +19289,7 @@ function JS(e, t) {
|
|
|
19279
19289
|
}
|
|
19280
19290
|
//#endregion
|
|
19281
19291
|
//#region src/core/grid/gridSelection.ts
|
|
19282
|
-
var
|
|
19292
|
+
var XS = class {
|
|
19283
19293
|
deps;
|
|
19284
19294
|
selectableFn;
|
|
19285
19295
|
reserveSelection;
|
|
@@ -19326,14 +19336,14 @@ var YS = class {
|
|
|
19326
19336
|
syncTreeSelectionCascade(e) {
|
|
19327
19337
|
if (!this.deps.selectionService || !this.deps.isTreeActive?.() || !this.deps.groupSelectsChildren?.()) return;
|
|
19328
19338
|
let t = this.deps.rowModel.rowsToDisplay, n = new Set(this.deps.selectionService.getSelectedRowIds()), r = e == null ? [] : Array.isArray(e) ? [...e] : [e];
|
|
19329
|
-
for (let { rowId: e } of r)
|
|
19339
|
+
for (let { rowId: e } of r) JS({
|
|
19330
19340
|
displayRows: t,
|
|
19331
19341
|
rowId: e,
|
|
19332
19342
|
selected: n.has(e),
|
|
19333
19343
|
groupSelectsChildren: !0,
|
|
19334
19344
|
selectedIds: n
|
|
19335
19345
|
});
|
|
19336
|
-
|
|
19346
|
+
YS(t, n), this.deps.selectionService.replaceWithRowIds([...n], r.length > 0 ? r[r.length - 1].rowIndex : -1);
|
|
19337
19347
|
}
|
|
19338
19348
|
setIndexFocus(e) {
|
|
19339
19349
|
if (!this.deps.indexFocusService) return;
|
|
@@ -19360,7 +19370,7 @@ var YS = class {
|
|
|
19360
19370
|
}
|
|
19361
19371
|
applySelectionVisuals() {
|
|
19362
19372
|
if (!this.deps.selectionService) return;
|
|
19363
|
-
let e = new Set(this.deps.selectionService.getSelectedRowIds()), t = this.deps.isTreeActive?.() ?
|
|
19373
|
+
let e = new Set(this.deps.selectionService.getSelectedRowIds()), t = this.deps.isTreeActive?.() ? qS(this.deps.rowModel.rowsToDisplay, e) : /* @__PURE__ */ new Set();
|
|
19364
19374
|
this.deps.rowRenderer.refreshSelection(e, t), sp(this.deps.mountEl, {
|
|
19365
19375
|
selectionColumnOptions: this.deps.selectionColumnOptions,
|
|
19366
19376
|
selectedIds: e,
|
|
@@ -19411,23 +19421,23 @@ var YS = class {
|
|
|
19411
19421
|
};
|
|
19412
19422
|
//#endregion
|
|
19413
19423
|
//#region src/core/rowModel/rowDataExport.ts
|
|
19414
|
-
function
|
|
19424
|
+
function ZS(e, t) {
|
|
19415
19425
|
let n = { ...e.data };
|
|
19416
19426
|
return e.isTransient && (n[t] = null), n;
|
|
19417
19427
|
}
|
|
19418
|
-
function
|
|
19419
|
-
return e.map((e) =>
|
|
19428
|
+
function QS(e, t) {
|
|
19429
|
+
return e.map((e) => ZS(e, t));
|
|
19420
19430
|
}
|
|
19421
19431
|
//#endregion
|
|
19422
19432
|
//#region src/core/rowMutation/rowMutationService.ts
|
|
19423
|
-
function
|
|
19433
|
+
function $S(e, t) {
|
|
19424
19434
|
let n = e.indexMode ?? "source", r = mh(e.index, n, t);
|
|
19425
19435
|
return { add: e.rows.map((e, t) => ({
|
|
19426
19436
|
data: e.data,
|
|
19427
19437
|
index: r === void 0 ? void 0 : r + t
|
|
19428
19438
|
})) };
|
|
19429
19439
|
}
|
|
19430
|
-
function
|
|
19440
|
+
function eC(e, t) {
|
|
19431
19441
|
let n = new Set(Xl(e.rowIds) ?? []);
|
|
19432
19442
|
if (e.indexes?.length) {
|
|
19433
19443
|
let r = e.indexMode ?? "source";
|
|
@@ -19435,35 +19445,35 @@ function $S(e, t) {
|
|
|
19435
19445
|
}
|
|
19436
19446
|
return n.size === 0 ? {} : { remove: [...n] };
|
|
19437
19447
|
}
|
|
19438
|
-
function
|
|
19448
|
+
function tC(e) {
|
|
19439
19449
|
return e.remove?.length ? e.remove.filter((e) => typeof e == "string") : [];
|
|
19440
19450
|
}
|
|
19441
19451
|
//#endregion
|
|
19442
19452
|
//#region src/core/rowMutation/rowMutationEvents.ts
|
|
19443
|
-
function
|
|
19453
|
+
function nC(e, t, n) {
|
|
19444
19454
|
return { rows: e.map((e) => ({
|
|
19445
19455
|
rowId: e.id,
|
|
19446
19456
|
rowIndex: n(e.id),
|
|
19447
|
-
data:
|
|
19457
|
+
data: ZS(e, t),
|
|
19448
19458
|
isTransient: e.isTransient ?? !1
|
|
19449
19459
|
})) };
|
|
19450
19460
|
}
|
|
19451
|
-
function
|
|
19461
|
+
function rC(e, t) {
|
|
19452
19462
|
return { rows: e.map((e) => ({
|
|
19453
19463
|
rowId: e.id,
|
|
19454
|
-
data:
|
|
19464
|
+
data: ZS(e, t)
|
|
19455
19465
|
})) };
|
|
19456
19466
|
}
|
|
19457
|
-
function
|
|
19467
|
+
function iC(e, t, n) {
|
|
19458
19468
|
return {
|
|
19459
19469
|
oldRowId: e,
|
|
19460
19470
|
newRowId: t.id,
|
|
19461
|
-
data:
|
|
19471
|
+
data: ZS(t, n)
|
|
19462
19472
|
};
|
|
19463
19473
|
}
|
|
19464
19474
|
//#endregion
|
|
19465
19475
|
//#region src/core/rowMutation/asyncRowMutation.ts
|
|
19466
|
-
function
|
|
19476
|
+
function aC(e, t) {
|
|
19467
19477
|
return e.remove?.length ? e.remove.map((e) => {
|
|
19468
19478
|
if (typeof e == "string") return e;
|
|
19469
19479
|
let n = e[t];
|
|
@@ -19471,11 +19481,11 @@ function iC(e, t) {
|
|
|
19471
19481
|
return String(n);
|
|
19472
19482
|
}) : [];
|
|
19473
19483
|
}
|
|
19474
|
-
function
|
|
19484
|
+
function oC(e, t, n, r) {
|
|
19475
19485
|
let i = e[t];
|
|
19476
19486
|
return i == null ? r?.find((t) => t.data === e && t.isTransient) : n(String(i));
|
|
19477
19487
|
}
|
|
19478
|
-
function
|
|
19488
|
+
function sC(e, t, n) {
|
|
19479
19489
|
return !e.add?.length || !n?.rows?.length ? e : {
|
|
19480
19490
|
...e,
|
|
19481
19491
|
add: e.add.map((e, r) => {
|
|
@@ -19492,26 +19502,26 @@ function oC(e, t, n) {
|
|
|
19492
19502
|
})
|
|
19493
19503
|
};
|
|
19494
19504
|
}
|
|
19495
|
-
async function
|
|
19505
|
+
async function cC(e, t) {
|
|
19496
19506
|
try {
|
|
19497
19507
|
return await t();
|
|
19498
19508
|
} catch (t) {
|
|
19499
19509
|
throw t instanceof Zl ? t : new Zl(`${e} persist failed`, t);
|
|
19500
19510
|
}
|
|
19501
19511
|
}
|
|
19502
|
-
async function
|
|
19512
|
+
async function lC(e, t) {
|
|
19503
19513
|
let { handlers: n, rowKey: r, getRowById: i, sourceRows: a, signal: o = new AbortController().signal } = t;
|
|
19504
19514
|
if (!n?.add && !n?.update && !n?.remove) return e;
|
|
19505
19515
|
let s = e;
|
|
19506
19516
|
if (n.remove && e.remove?.length) {
|
|
19507
|
-
let t =
|
|
19517
|
+
let t = aC(e, r), a = t.map((e) => {
|
|
19508
19518
|
let t = i(e);
|
|
19509
19519
|
return {
|
|
19510
19520
|
rowId: e,
|
|
19511
19521
|
data: t ? { ...t.data } : {}
|
|
19512
19522
|
};
|
|
19513
19523
|
});
|
|
19514
|
-
await
|
|
19524
|
+
await cC("remove", () => n.remove({
|
|
19515
19525
|
rowIds: t,
|
|
19516
19526
|
rows: a,
|
|
19517
19527
|
signal: o
|
|
@@ -19519,32 +19529,32 @@ async function cC(e, t) {
|
|
|
19519
19529
|
}
|
|
19520
19530
|
if (n.update && e.update?.length) {
|
|
19521
19531
|
let t = e.update.map((e) => {
|
|
19522
|
-
let t =
|
|
19532
|
+
let t = oC(e, r, i, a);
|
|
19523
19533
|
if (!t) throw new Zl(`Update target row not found for rowKey "${r}"`);
|
|
19524
19534
|
return {
|
|
19525
19535
|
rowId: t.id,
|
|
19526
19536
|
data: e
|
|
19527
19537
|
};
|
|
19528
19538
|
});
|
|
19529
|
-
await
|
|
19539
|
+
await cC("update", () => n.update({
|
|
19530
19540
|
rows: t,
|
|
19531
19541
|
signal: o
|
|
19532
19542
|
}));
|
|
19533
19543
|
}
|
|
19534
19544
|
if (n.add && e.add?.length) {
|
|
19535
|
-
let t = e.add.map((e) => ({ data: Ef(e, r) })), i = e.add[0], a = i ? Df(i, r) : void 0, c = i && Tf(i, r) ? i.indexMode : void 0, l = await
|
|
19545
|
+
let t = e.add.map((e) => ({ data: Ef(e, r) })), i = e.add[0], a = i ? Df(i, r) : void 0, c = i && Tf(i, r) ? i.indexMode : void 0, l = await cC("add", () => n.add({
|
|
19536
19546
|
rows: t,
|
|
19537
19547
|
index: a,
|
|
19538
19548
|
indexMode: c,
|
|
19539
19549
|
signal: o
|
|
19540
19550
|
}));
|
|
19541
|
-
s =
|
|
19551
|
+
s = sC(s, r, l);
|
|
19542
19552
|
}
|
|
19543
19553
|
return s;
|
|
19544
19554
|
}
|
|
19545
19555
|
//#endregion
|
|
19546
19556
|
//#region src/core/grid/gridRowMutation.ts
|
|
19547
|
-
var
|
|
19557
|
+
var uC = class {
|
|
19548
19558
|
deps;
|
|
19549
19559
|
pendingTransaction = null;
|
|
19550
19560
|
rowMoveService;
|
|
@@ -19564,12 +19574,12 @@ var lC = class {
|
|
|
19564
19574
|
});
|
|
19565
19575
|
}
|
|
19566
19576
|
async applyTransaction(e) {
|
|
19567
|
-
let t = await
|
|
19577
|
+
let t = await lC(e, {
|
|
19568
19578
|
rowKey: this.deps.rowKey,
|
|
19569
19579
|
handlers: this.deps.asyncRowMutation,
|
|
19570
19580
|
getRowById: (e) => this.deps.rowModel.getRowById(e),
|
|
19571
19581
|
sourceRows: this.deps.rowModel.getSourceRows()
|
|
19572
|
-
}), n =
|
|
19582
|
+
}), n = tC(t);
|
|
19573
19583
|
if (n.length > 0) {
|
|
19574
19584
|
this.prepareRemoveRows(new Set(n));
|
|
19575
19585
|
let e = this.commitTransaction(t);
|
|
@@ -19582,15 +19592,15 @@ var lC = class {
|
|
|
19582
19592
|
return this.deps.viewport.syncViewportHeight(), this.queueTransactionFlush(t), t;
|
|
19583
19593
|
}
|
|
19584
19594
|
async addRows(e) {
|
|
19585
|
-
let t =
|
|
19595
|
+
let t = $S(e, this.createRowIndexContext());
|
|
19586
19596
|
return this.applyTransaction(t);
|
|
19587
19597
|
}
|
|
19588
19598
|
async removeRows(e) {
|
|
19589
|
-
let t =
|
|
19599
|
+
let t = eC(e.rowIds ? {
|
|
19590
19600
|
...e,
|
|
19591
19601
|
rowIds: Xl(e.rowIds)
|
|
19592
19602
|
} : e, this.createRowIndexContext());
|
|
19593
|
-
return
|
|
19603
|
+
return tC(t).length === 0 ? {
|
|
19594
19604
|
add: [],
|
|
19595
19605
|
remove: [],
|
|
19596
19606
|
update: []
|
|
@@ -19638,7 +19648,7 @@ var lC = class {
|
|
|
19638
19648
|
this.deps.viewport.syncViewportHeight(), this.deps.refreshCellSpans(), this.deps.rowRenderer.setValueCacheVersion(this.deps.valueCache.getVersion()), this.deps.rowRenderer.invalidate(), this.deps.viewport.redrawImmediately(), this.deps.selectionOps.refreshSelectionAfterDataChange(), this.deps.refreshFooter();
|
|
19639
19649
|
}
|
|
19640
19650
|
getData(e) {
|
|
19641
|
-
return
|
|
19651
|
+
return QS(e?.sourceOrder === !1 ? this.deps.rowModel.rowsToDisplay : this.deps.rowModel.getSourceRows(), this.deps.rowModel.getRowKey());
|
|
19642
19652
|
}
|
|
19643
19653
|
promoteRowId(e) {
|
|
19644
19654
|
let t = X(e.rowId), { businessId: n } = e;
|
|
@@ -19650,7 +19660,7 @@ var lC = class {
|
|
|
19650
19660
|
if (!r.ok) return r;
|
|
19651
19661
|
this.finalizePromoteRowId(t, r.rowId);
|
|
19652
19662
|
let i = this.deps.rowModel.getRowById(r.rowId);
|
|
19653
|
-
return i && this.deps.eventBus.emit("rowIdPromoted",
|
|
19663
|
+
return i && this.deps.eventBus.emit("rowIdPromoted", iC(t, i, this.deps.rowModel.getRowKey())), {
|
|
19654
19664
|
ok: !0,
|
|
19655
19665
|
rowId: ai(r.rowId, {
|
|
19656
19666
|
rowKey: this.deps.rowModel.getRowKey(),
|
|
@@ -19723,9 +19733,9 @@ var lC = class {
|
|
|
19723
19733
|
}
|
|
19724
19734
|
emitRowMutationEvents(e) {
|
|
19725
19735
|
let t = this.deps.rowModel.getRowKey();
|
|
19726
|
-
e.add.length > 0 && this.deps.eventBus.emit("rowsAdded",
|
|
19736
|
+
e.add.length > 0 && this.deps.eventBus.emit("rowsAdded", nC(e.add, t, (e) => this.deps.rowModel.getSourceRowIndexById(e))), e.remove.length > 0 && this.deps.eventBus.emit("rowsRemoved", rC(e.remove, t));
|
|
19727
19737
|
}
|
|
19728
|
-
},
|
|
19738
|
+
}, dC = class {
|
|
19729
19739
|
deps;
|
|
19730
19740
|
constructor(e) {
|
|
19731
19741
|
this.deps = e;
|
|
@@ -19748,19 +19758,19 @@ var lC = class {
|
|
|
19748
19758
|
};
|
|
19749
19759
|
//#endregion
|
|
19750
19760
|
//#region src/core/grid/gridValidationNormalize.ts
|
|
19751
|
-
function
|
|
19761
|
+
function fC(e) {
|
|
19752
19762
|
return e?.rowIds ? {
|
|
19753
19763
|
...e,
|
|
19754
19764
|
rowIds: Xl(e.rowIds)
|
|
19755
19765
|
} : e;
|
|
19756
19766
|
}
|
|
19757
|
-
function
|
|
19767
|
+
function pC(e) {
|
|
19758
19768
|
return {
|
|
19759
19769
|
...e,
|
|
19760
19770
|
rowIds: Xl(e.rowIds)
|
|
19761
19771
|
};
|
|
19762
19772
|
}
|
|
19763
|
-
function
|
|
19773
|
+
function mC(e) {
|
|
19764
19774
|
return {
|
|
19765
19775
|
...e,
|
|
19766
19776
|
cells: e.cells.map((e) => ({
|
|
@@ -19769,19 +19779,19 @@ function pC(e) {
|
|
|
19769
19779
|
}))
|
|
19770
19780
|
};
|
|
19771
19781
|
}
|
|
19772
|
-
function
|
|
19782
|
+
function hC(e) {
|
|
19773
19783
|
return e?.rowIds ? {
|
|
19774
19784
|
...e,
|
|
19775
19785
|
rowIds: Xl(e.rowIds)
|
|
19776
19786
|
} : e;
|
|
19777
19787
|
}
|
|
19778
|
-
function
|
|
19788
|
+
function gC(e) {
|
|
19779
19789
|
return {
|
|
19780
19790
|
...e,
|
|
19781
19791
|
rowIds: Xl(e.rowIds)
|
|
19782
19792
|
};
|
|
19783
19793
|
}
|
|
19784
|
-
function
|
|
19794
|
+
function _C(e) {
|
|
19785
19795
|
return {
|
|
19786
19796
|
...e,
|
|
19787
19797
|
cells: e.cells.map((e) => ({
|
|
@@ -19792,17 +19802,17 @@ function gC(e) {
|
|
|
19792
19802
|
}
|
|
19793
19803
|
//#endregion
|
|
19794
19804
|
//#region src/core/grid/gridMetrics.ts
|
|
19795
|
-
function
|
|
19805
|
+
function vC(e) {
|
|
19796
19806
|
return e >= 1e6 ? 2e3 : e >= 1e5 ? 500 : e >= 1e4 ? 200 : e >= 1e3 ? 100 : 50;
|
|
19797
19807
|
}
|
|
19798
|
-
function
|
|
19808
|
+
function yC(e) {
|
|
19799
19809
|
return {
|
|
19800
19810
|
maxDomRows: 80,
|
|
19801
|
-
maxSetDataMs:
|
|
19811
|
+
maxSetDataMs: vC(e)
|
|
19802
19812
|
};
|
|
19803
19813
|
}
|
|
19804
|
-
function
|
|
19805
|
-
let n =
|
|
19814
|
+
function bC(e, t) {
|
|
19815
|
+
let n = yC(t), r = e.activeDomRowCount <= n.maxDomRows, i = e.lastSetDataMs <= n.maxSetDataMs;
|
|
19806
19816
|
return {
|
|
19807
19817
|
domRowsPass: r,
|
|
19808
19818
|
setDataPass: i,
|
|
@@ -19811,7 +19821,7 @@ function yC(e, t) {
|
|
|
19811
19821
|
}
|
|
19812
19822
|
//#endregion
|
|
19813
19823
|
//#region src/core/grid/grid.ts
|
|
19814
|
-
var
|
|
19824
|
+
var xC = class {
|
|
19815
19825
|
mountEl;
|
|
19816
19826
|
rowModel;
|
|
19817
19827
|
rowRenderer;
|
|
@@ -20097,7 +20107,7 @@ var bC = class {
|
|
|
20097
20107
|
resolveBusinessRowId: (e) => ri(e, t.rowKey),
|
|
20098
20108
|
getCellDisableContext: () => this.getCellDisableContext(),
|
|
20099
20109
|
getCellStyleContext: () => this.getCellStyleContext()
|
|
20100
|
-
}), this.selectionOps = new
|
|
20110
|
+
}), this.selectionOps = new XS({
|
|
20101
20111
|
mountEl: this.mountEl,
|
|
20102
20112
|
rowModel: this.rowModel,
|
|
20103
20113
|
rowRenderer: this.rowRenderer,
|
|
@@ -20138,7 +20148,7 @@ var bC = class {
|
|
|
20138
20148
|
data: e.data,
|
|
20139
20149
|
masterRowId: e.masterRowId ?? e.id
|
|
20140
20150
|
})
|
|
20141
|
-
}) : null, this.rowRenderer.setDetailRowAutoHeightService(this.detailRowAutoHeightService), this.gridFooter = new
|
|
20151
|
+
}) : null, this.rowRenderer.setDetailRowAutoHeightService(this.detailRowAutoHeightService), this.gridFooter = new dC({
|
|
20142
20152
|
columnModel: this.columnModel,
|
|
20143
20153
|
columnViewport: this.columnViewport,
|
|
20144
20154
|
rowModel: this.rowModel,
|
|
@@ -20146,7 +20156,7 @@ var bC = class {
|
|
|
20146
20156
|
valueCache: this.valueCache,
|
|
20147
20157
|
summaryOptions: this.summaryOptions,
|
|
20148
20158
|
getFooterRenderer: () => this.footerRenderer
|
|
20149
|
-
}), this.filterOps = new
|
|
20159
|
+
}), this.filterOps = new US({
|
|
20150
20160
|
rowModel: this.rowModel,
|
|
20151
20161
|
columnModel: this.columnModel,
|
|
20152
20162
|
columnViewport: this.columnViewport,
|
|
@@ -20160,7 +20170,7 @@ var bC = class {
|
|
|
20160
20170
|
refreshCellSpans: () => this.refreshCellSpanCache(),
|
|
20161
20171
|
clearCellSelection: () => this.clearCellSelectionOnStructuralChange(),
|
|
20162
20172
|
refreshOverlay: () => this.syncEmptyStateOverlay()
|
|
20163
|
-
}), this.viewport = new
|
|
20173
|
+
}), this.viewport = new RS({
|
|
20164
20174
|
rootEl: p.rootEl,
|
|
20165
20175
|
headerViewportEl: p.headerViewportEl,
|
|
20166
20176
|
headerScrollEl: p.headerScrollEl,
|
|
@@ -20252,7 +20262,7 @@ var bC = class {
|
|
|
20252
20262
|
});
|
|
20253
20263
|
this.inlineCellEditorService = m, this.rowRenderer.setInlineCellEditorContext(m.getRefreshContext()), this.columnFlexService = new Xo(this.columnModel), this.columnResizeService = new Qo(this.columnModel, () => {
|
|
20254
20264
|
this.columnLayout.syncColumnLayoutAfterResize();
|
|
20255
|
-
}, this.columnFlexService, () => this.getCenterViewportWidth()), this.columnAutosizeService = new Vo(this.mountEl, this.columnModel, a), this.columnLayout = new
|
|
20265
|
+
}, this.columnFlexService, () => this.getCenterViewportWidth()), this.columnAutosizeService = new Vo(this.mountEl, this.columnModel, a), this.columnLayout = new HS({
|
|
20256
20266
|
mountEl: this.mountEl,
|
|
20257
20267
|
rootEl: this.rootEl,
|
|
20258
20268
|
columnModel: this.columnModel,
|
|
@@ -20473,7 +20483,7 @@ var bC = class {
|
|
|
20473
20483
|
copyCellSelectionToClipboard: () => this.cellClipboardService?.copySelectedRanges() ?? !1,
|
|
20474
20484
|
pasteCellSelectionFromClipboard: () => this.pasteFromClipboard(),
|
|
20475
20485
|
isPointerOverCellCommentIndicator: (e, t, n) => xg(e, t, n)
|
|
20476
|
-
}), this.rowMutation = new
|
|
20486
|
+
}), this.rowMutation = new uC({
|
|
20477
20487
|
rowKey: t.rowKey,
|
|
20478
20488
|
asyncRowMutation: this.asyncRowMutation,
|
|
20479
20489
|
rowModel: this.rowModel,
|
|
@@ -21364,22 +21374,22 @@ var bC = class {
|
|
|
21364
21374
|
}));
|
|
21365
21375
|
}
|
|
21366
21376
|
validate(e) {
|
|
21367
|
-
return this.cellEditing.validate(
|
|
21377
|
+
return this.cellEditing.validate(fC(e)).then((e) => ci(e, this.businessRowIdCtx));
|
|
21368
21378
|
}
|
|
21369
21379
|
validateRows(e) {
|
|
21370
|
-
return this.cellEditing.validateRows(
|
|
21380
|
+
return this.cellEditing.validateRows(pC(e)).then((e) => ci(e, this.businessRowIdCtx));
|
|
21371
21381
|
}
|
|
21372
21382
|
validateCells(e) {
|
|
21373
|
-
return this.cellEditing.validateCells(
|
|
21383
|
+
return this.cellEditing.validateCells(mC(e)).then((e) => ci(e, this.businessRowIdCtx));
|
|
21374
21384
|
}
|
|
21375
21385
|
clearValidation(e) {
|
|
21376
|
-
this.cellEditing.clearValidation(
|
|
21386
|
+
this.cellEditing.clearValidation(hC(e));
|
|
21377
21387
|
}
|
|
21378
21388
|
clearRowValidation(e) {
|
|
21379
|
-
this.cellEditing.clearRowValidation(
|
|
21389
|
+
this.cellEditing.clearRowValidation(gC(e));
|
|
21380
21390
|
}
|
|
21381
21391
|
clearCellValidation(e) {
|
|
21382
|
-
this.cellEditing.clearCellValidation(
|
|
21392
|
+
this.cellEditing.clearCellValidation(_C(e));
|
|
21383
21393
|
}
|
|
21384
21394
|
registerCellEditor(e, t) {
|
|
21385
21395
|
this.cellEditing.registerCellEditor(e, t);
|
|
@@ -21403,7 +21413,7 @@ var bC = class {
|
|
|
21403
21413
|
isEditingTargetRow(e) {
|
|
21404
21414
|
return this.cellEditing.getEditingCell()?.rowId === e || this.cellEditing.getEditingCells().some((t) => t.rowId === e);
|
|
21405
21415
|
}
|
|
21406
|
-
},
|
|
21416
|
+
}, SC = {
|
|
21407
21417
|
"--mg-color-bg": "#141414",
|
|
21408
21418
|
"--mg-color-text-primary": "#e8e8e8",
|
|
21409
21419
|
"--mg-color-text-regular": "#e0e0e0",
|
|
@@ -21418,7 +21428,7 @@ var bC = class {
|
|
|
21418
21428
|
"--mg-fixed-shadow-left": "4px 0 8px -2px rgba(0, 0, 0, 0.45)",
|
|
21419
21429
|
"--mg-fixed-shadow-right": "-4px 0 8px -2px rgba(0, 0, 0, 0.45)",
|
|
21420
21430
|
"--mg-column-handle-menu-shadow": "0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4)"
|
|
21421
|
-
},
|
|
21431
|
+
}, CC = {
|
|
21422
21432
|
"--mg-color-bg-cell": "#ffffff",
|
|
21423
21433
|
"--mg-color-bg-stripe": "#f5f7fa",
|
|
21424
21434
|
"--mg-color-text-primary": "#333333",
|
|
@@ -21429,28 +21439,28 @@ var bC = class {
|
|
|
21429
21439
|
"--mg-fixed-shadow-left": "4px 0 8px -2px rgba(0, 0, 0, 0.12)",
|
|
21430
21440
|
"--mg-fixed-shadow-right": "-4px 0 8px -2px rgba(0, 0, 0, 0.12)"
|
|
21431
21441
|
};
|
|
21432
|
-
function CC(e) {
|
|
21433
|
-
return e ?? "light";
|
|
21434
|
-
}
|
|
21435
21442
|
function wC(e) {
|
|
21436
|
-
return
|
|
21443
|
+
return e ?? "light";
|
|
21437
21444
|
}
|
|
21438
21445
|
function TC(e) {
|
|
21439
|
-
return e
|
|
21446
|
+
return `magic-grid--theme-${e}`;
|
|
21440
21447
|
}
|
|
21441
21448
|
function EC(e) {
|
|
21442
21449
|
return e === "dark" ? { ...SC } : {};
|
|
21443
21450
|
}
|
|
21444
|
-
|
|
21445
|
-
|
|
21451
|
+
function DC(e) {
|
|
21452
|
+
return e === "dark" ? { ...CC } : {};
|
|
21453
|
+
}
|
|
21454
|
+
var OC = Object.keys(CC);
|
|
21455
|
+
function kC(e, t) {
|
|
21446
21456
|
if (!e) return;
|
|
21447
|
-
for (let t of
|
|
21448
|
-
let n =
|
|
21457
|
+
for (let t of OC) e.style.removeProperty(t);
|
|
21458
|
+
let n = DC(t);
|
|
21449
21459
|
for (let [t, r] of Object.entries(n)) e.style.setProperty(t, r);
|
|
21450
21460
|
}
|
|
21451
21461
|
//#endregion
|
|
21452
21462
|
//#region src/components/StatusBar/StatusBarDefaultPanels.vue?vue&type=script&setup=true&lang.ts
|
|
21453
|
-
var
|
|
21463
|
+
var AC = { class: "mg-status-bar__panels" }, jC = /* @__PURE__ */ g({
|
|
21454
21464
|
__name: "StatusBarDefaultPanels",
|
|
21455
21465
|
props: { context: {} },
|
|
21456
21466
|
setup(e) {
|
|
@@ -21458,67 +21468,67 @@ var kC = { class: "mg-status-bar__panels" }, AC = /* @__PURE__ */ g({
|
|
|
21458
21468
|
let { context: e } = t, n = [];
|
|
21459
21469
|
return n.push(`共 ${e.totalRowCount} 行`), e.isFiltered && n.push(`显示 ${e.displayedRowCount} 行`), e.rowSelectionEnabled && e.selectedRowCount > 0 && n.push(`已选 ${e.selectedRowCount} 行`), n;
|
|
21460
21470
|
});
|
|
21461
|
-
return (e, t) => (E(), d("div",
|
|
21471
|
+
return (e, t) => (E(), d("div", AC, [(E(!0), d(o, null, k(n.value, (e, t) => (E(), d("span", {
|
|
21462
21472
|
key: t,
|
|
21463
21473
|
class: "mg-status-bar__panel"
|
|
21464
21474
|
}, M(e), 1))), 128))]));
|
|
21465
21475
|
}
|
|
21466
|
-
}),
|
|
21476
|
+
}), MC = 2;
|
|
21467
21477
|
//#endregion
|
|
21468
21478
|
//#region src/components/StatusBar/resolveStatusBarRangeAggregationPrecision.ts
|
|
21469
|
-
function
|
|
21479
|
+
function NC(e) {
|
|
21470
21480
|
if (typeof e == "number") {
|
|
21471
|
-
let t =
|
|
21481
|
+
let t = PC(e);
|
|
21472
21482
|
return {
|
|
21473
21483
|
average: t,
|
|
21474
21484
|
sum: t
|
|
21475
21485
|
};
|
|
21476
21486
|
}
|
|
21477
21487
|
return {
|
|
21478
|
-
average:
|
|
21479
|
-
sum:
|
|
21488
|
+
average: PC(e?.average ?? 2),
|
|
21489
|
+
sum: PC(e?.sum ?? 2)
|
|
21480
21490
|
};
|
|
21481
21491
|
}
|
|
21482
|
-
function
|
|
21492
|
+
function PC(e) {
|
|
21483
21493
|
return Number.isFinite(e) ? Math.max(0, Math.min(10, Math.trunc(e))) : 2;
|
|
21484
21494
|
}
|
|
21485
21495
|
//#endregion
|
|
21486
21496
|
//#region src/components/StatusBar/formatAggregationDisplayValue.ts
|
|
21487
|
-
function
|
|
21497
|
+
function FC(e, t, n = 2) {
|
|
21488
21498
|
if (t === "count") return String(Math.trunc(e));
|
|
21489
|
-
let r =
|
|
21499
|
+
let r = PC(n), i = 10 ** r, a = Math.round(e * i) / i;
|
|
21490
21500
|
return r === 0 ? String(Math.round(a)) : a.toFixed(r).replace(/\.?0+$/, "");
|
|
21491
21501
|
}
|
|
21492
21502
|
//#endregion
|
|
21493
21503
|
//#region src/components/StatusBar/hasStatusBarAggregationContent.ts
|
|
21494
|
-
function
|
|
21504
|
+
function IC(e) {
|
|
21495
21505
|
return e != null && e.count > 0;
|
|
21496
21506
|
}
|
|
21497
21507
|
//#endregion
|
|
21498
21508
|
//#region src/components/StatusBar/StatusBarRangeAggregationPanels.vue?vue&type=script&setup=true&lang.ts
|
|
21499
|
-
var
|
|
21509
|
+
var LC = {
|
|
21500
21510
|
key: 0,
|
|
21501
21511
|
class: "mg-status-bar__panels mg-status-bar__panels--aggregation"
|
|
21502
|
-
},
|
|
21512
|
+
}, RC = /* @__PURE__ */ g({
|
|
21503
21513
|
__name: "StatusBarRangeAggregationPanels",
|
|
21504
21514
|
props: { context: {} },
|
|
21505
21515
|
setup(e) {
|
|
21506
|
-
let t = e, n = c(() =>
|
|
21516
|
+
let t = e, n = c(() => IC(t.context.cellSelectionAggregation)), r = c(() => {
|
|
21507
21517
|
let e = t.context.cellSelectionAggregation;
|
|
21508
|
-
if (!
|
|
21518
|
+
if (!IC(e)) return [];
|
|
21509
21519
|
let n = t.context.statusBarRangeAggregationPrecision, r = [];
|
|
21510
21520
|
return e.average != null && r.push({
|
|
21511
21521
|
label: "平均值",
|
|
21512
|
-
value:
|
|
21522
|
+
value: FC(e.average, "average", n.average)
|
|
21513
21523
|
}), r.push({
|
|
21514
21524
|
label: "计数",
|
|
21515
|
-
value:
|
|
21525
|
+
value: FC(e.count, "count")
|
|
21516
21526
|
}), e.sum != null && r.push({
|
|
21517
21527
|
label: "求和",
|
|
21518
|
-
value:
|
|
21528
|
+
value: FC(e.sum, "sum", n.sum)
|
|
21519
21529
|
}), r;
|
|
21520
21530
|
});
|
|
21521
|
-
return (e, t) => n.value && r.value.length ? (E(), d("div",
|
|
21531
|
+
return (e, t) => n.value && r.value.length ? (E(), d("div", LC, [(E(!0), d(o, null, k(r.value, (e, t) => (E(), d("span", {
|
|
21522
21532
|
key: t,
|
|
21523
21533
|
class: "mg-status-bar__panel"
|
|
21524
21534
|
}, M(e.label) + ": " + M(e.value), 1))), 128))])) : u("", !0);
|
|
@@ -21526,7 +21536,7 @@ var IC = {
|
|
|
21526
21536
|
});
|
|
21527
21537
|
//#endregion
|
|
21528
21538
|
//#region src/components/MagicGrid/resolveMagicGridDefaults.ts
|
|
21529
|
-
function
|
|
21539
|
+
function zC(e) {
|
|
21530
21540
|
if (e === !1) return !1;
|
|
21531
21541
|
let t = e === !0 || e == null ? {} : e, n = typeof e == "object" && !!e && "handleMode" in e, r = {
|
|
21532
21542
|
...t,
|
|
@@ -21538,7 +21548,7 @@ function RC(e) {
|
|
|
21538
21548
|
}
|
|
21539
21549
|
return r;
|
|
21540
21550
|
}
|
|
21541
|
-
function
|
|
21551
|
+
function BC(e) {
|
|
21542
21552
|
return {
|
|
21543
21553
|
...e,
|
|
21544
21554
|
syncToSelectionColumn: e?.syncToSelectionColumn ?? !0
|
|
@@ -21546,17 +21556,17 @@ function zC(e) {
|
|
|
21546
21556
|
}
|
|
21547
21557
|
//#endregion
|
|
21548
21558
|
//#region src/components/MagicGrid/useStatusBarContext.ts
|
|
21549
|
-
function
|
|
21559
|
+
function VC(e) {
|
|
21550
21560
|
return yc({ cellSelection: e }).enabled;
|
|
21551
21561
|
}
|
|
21552
|
-
function
|
|
21562
|
+
function HC(e) {
|
|
21553
21563
|
let t = D(0), n = D(0), r = () => {
|
|
21554
21564
|
t.value += 1;
|
|
21555
21565
|
};
|
|
21556
21566
|
return {
|
|
21557
21567
|
statusBarContext: c(() => {
|
|
21558
21568
|
t.value;
|
|
21559
|
-
let r = e.api.value, i = r?.getMetrics(), a = yt(e.rowSelection.value).mode !== !1, o =
|
|
21569
|
+
let r = e.api.value, i = r?.getMetrics(), a = yt(e.rowSelection.value).mode !== !1, o = VC(e.cellSelection.value);
|
|
21560
21570
|
return {
|
|
21561
21571
|
api: r,
|
|
21562
21572
|
totalRowCount: i?.sourceRowCount ?? 0,
|
|
@@ -21566,7 +21576,7 @@ function VC(e) {
|
|
|
21566
21576
|
rowSelectionEnabled: a,
|
|
21567
21577
|
cellSelectionEnabled: o,
|
|
21568
21578
|
cellSelectionAggregation: o ? r?.getCellSelectionAggregation() ?? null : null,
|
|
21569
|
-
statusBarRangeAggregationPrecision:
|
|
21579
|
+
statusBarRangeAggregationPrecision: NC(e.statusBarRangeAggregationPrecision.value),
|
|
21570
21580
|
metrics: i
|
|
21571
21581
|
};
|
|
21572
21582
|
}),
|
|
@@ -21581,7 +21591,7 @@ function VC(e) {
|
|
|
21581
21591
|
}
|
|
21582
21592
|
//#endregion
|
|
21583
21593
|
//#region src/components/cellRenderer/vueCellRendererHost.ts
|
|
21584
|
-
var
|
|
21594
|
+
var UC = class {
|
|
21585
21595
|
render(e, t) {
|
|
21586
21596
|
O(t, e);
|
|
21587
21597
|
}
|
|
@@ -21589,20 +21599,20 @@ var HC = class {
|
|
|
21589
21599
|
O(null, e);
|
|
21590
21600
|
}
|
|
21591
21601
|
};
|
|
21592
|
-
function
|
|
21602
|
+
function WC(e, t) {
|
|
21593
21603
|
return (n, r) => {
|
|
21594
21604
|
e.render(r.mountEl, t(n));
|
|
21595
21605
|
};
|
|
21596
21606
|
}
|
|
21597
|
-
function
|
|
21598
|
-
return
|
|
21607
|
+
function GC(e, t) {
|
|
21608
|
+
return WC(e, (e) => {
|
|
21599
21609
|
let n = t(e);
|
|
21600
21610
|
return Array.isArray(n) ? n[0] : n;
|
|
21601
21611
|
});
|
|
21602
21612
|
}
|
|
21603
21613
|
//#endregion
|
|
21604
21614
|
//#region src/components/detailRowRenderer/vueDetailRowRendererHost.ts
|
|
21605
|
-
var
|
|
21615
|
+
var KC = class {
|
|
21606
21616
|
render(e, t) {
|
|
21607
21617
|
O(t, e);
|
|
21608
21618
|
}
|
|
@@ -21610,20 +21620,20 @@ var GC = class {
|
|
|
21610
21620
|
O(null, e);
|
|
21611
21621
|
}
|
|
21612
21622
|
};
|
|
21613
|
-
function
|
|
21623
|
+
function qC(e, t) {
|
|
21614
21624
|
return (n, r) => {
|
|
21615
21625
|
e.render(r.mountEl, t(n));
|
|
21616
21626
|
};
|
|
21617
21627
|
}
|
|
21618
|
-
function
|
|
21619
|
-
return
|
|
21628
|
+
function JC(e, t) {
|
|
21629
|
+
return qC(e, (e) => {
|
|
21620
21630
|
let n = t(e);
|
|
21621
21631
|
return Array.isArray(n) ? n[0] : n;
|
|
21622
21632
|
});
|
|
21623
21633
|
}
|
|
21624
21634
|
//#endregion
|
|
21625
21635
|
//#region src/components/cellEditor/vueCellEditorHost.ts
|
|
21626
|
-
var
|
|
21636
|
+
var YC = class {
|
|
21627
21637
|
render(e, t) {
|
|
21628
21638
|
O(t, e);
|
|
21629
21639
|
}
|
|
@@ -21631,20 +21641,20 @@ var JC = class {
|
|
|
21631
21641
|
O(null, e);
|
|
21632
21642
|
}
|
|
21633
21643
|
};
|
|
21634
|
-
function
|
|
21644
|
+
function XC(e, t) {
|
|
21635
21645
|
return (n, r) => {
|
|
21636
21646
|
e.render(r.mountEl, t(n));
|
|
21637
21647
|
};
|
|
21638
21648
|
}
|
|
21639
|
-
function
|
|
21640
|
-
return
|
|
21649
|
+
function ZC(e, t) {
|
|
21650
|
+
return XC(e, (e) => {
|
|
21641
21651
|
let n = t(e);
|
|
21642
21652
|
return Array.isArray(n) ? n[0] : n;
|
|
21643
21653
|
});
|
|
21644
21654
|
}
|
|
21645
21655
|
//#endregion
|
|
21646
21656
|
//#region src/components/tooltip/vueTooltipComponentHost.ts
|
|
21647
|
-
var
|
|
21657
|
+
var QC = class {
|
|
21648
21658
|
mountEl = null;
|
|
21649
21659
|
render(e, t) {
|
|
21650
21660
|
this.unmount(), this.mountEl = e, O(t, e);
|
|
@@ -21653,7 +21663,7 @@ var ZC = class {
|
|
|
21653
21663
|
this.mountEl &&= (O(null, this.mountEl), null);
|
|
21654
21664
|
}
|
|
21655
21665
|
};
|
|
21656
|
-
function
|
|
21666
|
+
function $C(e, t) {
|
|
21657
21667
|
return (n, r) => {
|
|
21658
21668
|
let i = t(n), a = Array.isArray(i) ? i[0] : i;
|
|
21659
21669
|
return e.render(r, a), {
|
|
@@ -21664,7 +21674,7 @@ function QC(e, t) {
|
|
|
21664
21674
|
}
|
|
21665
21675
|
//#endregion
|
|
21666
21676
|
//#region src/components/overlay/vueOverlayComponentHost.ts
|
|
21667
|
-
var
|
|
21677
|
+
var ew = class {
|
|
21668
21678
|
mountEl = null;
|
|
21669
21679
|
render(e, t) {
|
|
21670
21680
|
this.unmount(), this.mountEl = e, O(t, e);
|
|
@@ -21673,7 +21683,7 @@ var $C = class {
|
|
|
21673
21683
|
this.mountEl &&= (O(null, this.mountEl), null);
|
|
21674
21684
|
}
|
|
21675
21685
|
};
|
|
21676
|
-
function
|
|
21686
|
+
function tw(e, t) {
|
|
21677
21687
|
return (n, r) => {
|
|
21678
21688
|
let i = t(n), a = Array.isArray(i) ? i[0] : i;
|
|
21679
21689
|
return e.render(r, a), {
|
|
@@ -21684,36 +21694,36 @@ function ew(e, t) {
|
|
|
21684
21694
|
}
|
|
21685
21695
|
//#endregion
|
|
21686
21696
|
//#region src/components/MagicGrid/MagicGrid.vue?vue&type=script&setup=true&lang.ts
|
|
21687
|
-
var
|
|
21697
|
+
var nw = ["data-status-bar", "data-toolbar"], rw = {
|
|
21688
21698
|
key: 0,
|
|
21689
21699
|
class: "magic-grid__toolbar"
|
|
21690
|
-
},
|
|
21700
|
+
}, iw = {
|
|
21691
21701
|
key: 0,
|
|
21692
21702
|
class: "mg-status-bar__region mg-status-bar__region--left"
|
|
21693
|
-
},
|
|
21703
|
+
}, aw = {
|
|
21694
21704
|
key: 1,
|
|
21695
21705
|
class: "mg-status-bar__separator",
|
|
21696
21706
|
role: "separator",
|
|
21697
21707
|
"aria-orientation": "vertical"
|
|
21698
|
-
},
|
|
21708
|
+
}, ow = {
|
|
21699
21709
|
key: 3,
|
|
21700
21710
|
class: "mg-status-bar__separator",
|
|
21701
21711
|
role: "separator",
|
|
21702
21712
|
"aria-orientation": "vertical"
|
|
21703
|
-
},
|
|
21713
|
+
}, sw = {
|
|
21704
21714
|
key: 4,
|
|
21705
21715
|
class: "mg-status-bar__separator",
|
|
21706
21716
|
role: "separator",
|
|
21707
21717
|
"aria-orientation": "vertical"
|
|
21708
|
-
},
|
|
21718
|
+
}, cw = {
|
|
21709
21719
|
key: 6,
|
|
21710
21720
|
class: "mg-status-bar__separator",
|
|
21711
21721
|
role: "separator",
|
|
21712
21722
|
"aria-orientation": "vertical"
|
|
21713
|
-
},
|
|
21723
|
+
}, lw = {
|
|
21714
21724
|
key: 7,
|
|
21715
21725
|
class: "mg-status-bar__region mg-status-bar__region--right"
|
|
21716
|
-
},
|
|
21726
|
+
}, uw = /* @__PURE__ */ g({
|
|
21717
21727
|
inheritAttrs: !1,
|
|
21718
21728
|
__name: "MagicGrid",
|
|
21719
21729
|
props: {
|
|
@@ -22280,7 +22290,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22280
22290
|
},
|
|
22281
22291
|
emits: /* @__PURE__ */ "scroll.data-rendered.cell-clicked.row-click.row-dblclick.selection-changed.index-focus-changed.cell-value-changed.cell-editing-started.cell-editing-stopped.cell-commit-started.cell-commit-finished.edit-commit-aborted.row-commit-started.row-commit-finished.row-editing-started.row-editing-stopped.row-value-changed.cell-validation-failed.row-validation-failed.sort-changed.column-moved.column-resized.column-pinned.column-hidden-changed.filter-changed.rows-added.rows-removed.row-id-promoted.row-moved.row-drag-end.row-drag-commit-started.row-drag-commit-finished.row-height-changed.row-expanded.row-collapsed.row-group-opened.row-group-changed.tree-node-opened.tree-children-loading.tree-children-loaded.tree-children-load-failed.cell-comment-changed.cell-selection-changed.cell-selection-delete-start.cell-selection-delete-end.overlay-shown.overlay-hidden".split("."),
|
|
22282
22292
|
setup(e, { expose: n, emit: r }) {
|
|
22283
|
-
let i = new
|
|
22293
|
+
let i = new UC(), a = new KC(), s = new YC(), p = new QC(), m = new ew();
|
|
22284
22294
|
function h(e, t) {
|
|
22285
22295
|
return e.key ?? e.prop ?? `col_${t}`;
|
|
22286
22296
|
}
|
|
@@ -22290,7 +22300,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22290
22300
|
let a = h(e, r);
|
|
22291
22301
|
e.cellRenderer && (n[a] = e.cellRenderer);
|
|
22292
22302
|
let o = t[`cell-${a}`];
|
|
22293
|
-
o && (n[a] =
|
|
22303
|
+
o && (n[a] = GC(i, (e) => o({
|
|
22294
22304
|
row: e.data,
|
|
22295
22305
|
value: e.value,
|
|
22296
22306
|
formattedValue: e.formattedValue,
|
|
@@ -22307,7 +22317,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22307
22317
|
let i = h(e, r);
|
|
22308
22318
|
e.cellEditor && typeof e.cellEditor == "function" && (n[i] = e.cellEditor);
|
|
22309
22319
|
let a = t[`cell-editor-${i}`];
|
|
22310
|
-
a && (n[i] =
|
|
22320
|
+
a && (n[i] = ZC(s, (e) => a({
|
|
22311
22321
|
row: e.data,
|
|
22312
22322
|
value: e.value,
|
|
22313
22323
|
formattedValue: e.formattedValue,
|
|
@@ -22320,11 +22330,11 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22320
22330
|
}
|
|
22321
22331
|
function C(e, t) {
|
|
22322
22332
|
let n = t.tooltip;
|
|
22323
|
-
return n ?
|
|
22333
|
+
return n ? $C(p, (e) => n(e)) : e;
|
|
22324
22334
|
}
|
|
22325
22335
|
function O(e, t, n) {
|
|
22326
22336
|
let r = t[e];
|
|
22327
|
-
return r ?
|
|
22337
|
+
return r ? tw(m, (e) => r({
|
|
22328
22338
|
overlayType: e.overlayType,
|
|
22329
22339
|
api: e.api,
|
|
22330
22340
|
overlayText: e.overlayText
|
|
@@ -22353,7 +22363,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22353
22363
|
}
|
|
22354
22364
|
function ee(e, t) {
|
|
22355
22365
|
let n = t["detail-row"];
|
|
22356
|
-
return n ?
|
|
22366
|
+
return n ? JC(a, (e) => n({
|
|
22357
22367
|
row: e.data,
|
|
22358
22368
|
rowId: e.rowId,
|
|
22359
22369
|
masterRowId: e.masterRowId,
|
|
@@ -22363,7 +22373,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22363
22373
|
loadError: e.loadError
|
|
22364
22374
|
})) : e;
|
|
22365
22375
|
}
|
|
22366
|
-
let M = e, P = r, I = te(), ne = D(), re = D(), ie = D(), L = j(), le = j(), { statusBarContext: R, bumpRefresh: ue, onSelectionChanged: de, resetSelectionCount: pe } =
|
|
22376
|
+
let M = e, P = r, I = te(), ne = D(), re = D(), ie = D(), L = j(), le = j(), { statusBarContext: R, bumpRefresh: ue, onSelectionChanged: de, resetSelectionCount: pe } = HC({
|
|
22367
22377
|
api: le,
|
|
22368
22378
|
rowSelection: c(() => M.rowSelection),
|
|
22369
22379
|
cellSelection: c(() => M.cellSelection),
|
|
@@ -22379,14 +22389,14 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22379
22389
|
})), xe = c(() => ae({
|
|
22380
22390
|
rounded: M.rounded,
|
|
22381
22391
|
sizeBorderRadius: be.value.borderRadius
|
|
22382
|
-
})), Se = c(() =>
|
|
22392
|
+
})), Se = c(() => wC(M.theme)), Ce = c(() => zC(M.cellSelection)), we = c(() => BC(M.indexColumn)), Te = c(() => se(M.statusBarHeight, be.value.statusBarHeight)), Ee = c(() => M.showDefaultStatusBarPanels || he.value), De = c(() => ge.value), Oe = c(() => M.showStatusBarRangeAggregation ? IC(R.value.cellSelectionAggregation) : !1), ke = c(() => M.statusBarRangeAggregationPosition === "left" && Oe.value), Ae = c(() => M.statusBarRangeAggregationPosition === "right" && Oe.value), je = c(() => Ee.value), Me = c(() => ke.value), Ne = c(() => Ae.value || De.value), Pe = c(() => Ae.value && De.value), Fe = c(() => ({
|
|
22383
22393
|
height: typeof M.height == "number" ? `${M.height}px` : M.height,
|
|
22384
22394
|
width: typeof M.width == "number" ? `${M.width}px` : M.width,
|
|
22385
22395
|
...fe({
|
|
22386
22396
|
...be.value,
|
|
22387
22397
|
statusBarHeight: Te.value
|
|
22388
22398
|
}, xe.value, M.summaryRowHeight),
|
|
22389
|
-
...
|
|
22399
|
+
...EC(Se.value)
|
|
22390
22400
|
})), Ie = c(() => {
|
|
22391
22401
|
let e = Te.value, { fontSize: t, spacing: n } = be.value, r = ce(e);
|
|
22392
22402
|
return {
|
|
@@ -22405,7 +22415,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22405
22415
|
"magic-grid",
|
|
22406
22416
|
`magic-grid--border-${M.border}`,
|
|
22407
22417
|
`magic-grid--size-${be.value.size}`,
|
|
22408
|
-
|
|
22418
|
+
TC(Se.value),
|
|
22409
22419
|
M.showSummary && "magic-grid--has-footer",
|
|
22410
22420
|
M.showStatusBar && "magic-grid--has-status-bar",
|
|
22411
22421
|
_e.value && "magic-grid--has-toolbar"
|
|
@@ -22437,7 +22447,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22437
22447
|
P("cell-selection-changed", e), ue();
|
|
22438
22448
|
}), e.on("cellSelectionDeleteStart", (e) => P("cell-selection-delete-start", e)), e.on("cellSelectionDeleteEnd", (e) => P("cell-selection-delete-end", e)), e.on("overlayShown", (e) => P("overlay-shown", e)), e.on("overlayHidden", (e) => P("overlay-hidden", e)));
|
|
22439
22449
|
}, Ue = () => {
|
|
22440
|
-
|
|
22450
|
+
kC(ne.value?.querySelector(".mg-body"), Se.value);
|
|
22441
22451
|
};
|
|
22442
22452
|
function We() {
|
|
22443
22453
|
L.value?.setStatusBarElement(M.showStatusBar ? ie.value ?? null : null);
|
|
@@ -22448,7 +22458,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22448
22458
|
ye.length = 0, L.value?.destroy(), pe(), M.columns, M.columns, M.columns, qn(M.columns), fh({
|
|
22449
22459
|
tree: M.tree,
|
|
22450
22460
|
rowGrouping: M.rowGrouping
|
|
22451
|
-
}), L.value = new
|
|
22461
|
+
}), L.value = new xC(ne.value, {
|
|
22452
22462
|
columns: t(M.columns),
|
|
22453
22463
|
rowKey: M.rowKey,
|
|
22454
22464
|
rowHeight: be.value.rowHeight,
|
|
@@ -22818,7 +22828,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22818
22828
|
"data-status-bar": e.showStatusBar ? "true" : "false",
|
|
22819
22829
|
"data-toolbar": _e.value ? "true" : "false"
|
|
22820
22830
|
}, [
|
|
22821
|
-
_e.value ? (E(), d("div",
|
|
22831
|
+
_e.value ? (E(), d("div", rw, [A(t.$slots, "toolbar", x(_(ve.value)))])) : u("", !0),
|
|
22822
22832
|
f("div", {
|
|
22823
22833
|
ref_key: "mountRef",
|
|
22824
22834
|
ref: ne,
|
|
@@ -22839,31 +22849,31 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22839
22849
|
role: "status",
|
|
22840
22850
|
"aria-live": "polite"
|
|
22841
22851
|
}, [me.value ? A(t.$slots, "status-bar", x(_(N(R))), void 0, void 0, 0) : (E(), d(o, { key: 1 }, [
|
|
22842
|
-
Ee.value ? (E(), d("div",
|
|
22852
|
+
Ee.value ? (E(), d("div", iw, [e.showDefaultStatusBarPanels ? (E(), l(jC, {
|
|
22843
22853
|
key: 0,
|
|
22844
22854
|
context: N(R)
|
|
22845
22855
|
}, null, 8, ["context"])) : u("", !0), A(t.$slots, "status-bar-left", x(_(N(R))))])) : u("", !0),
|
|
22846
|
-
je.value ? (E(), d("div",
|
|
22847
|
-
ke.value ? (E(), l(
|
|
22856
|
+
je.value ? (E(), d("div", aw)) : u("", !0),
|
|
22857
|
+
ke.value ? (E(), l(RC, {
|
|
22848
22858
|
key: 2,
|
|
22849
22859
|
context: N(R)
|
|
22850
22860
|
}, null, 8, ["context"])) : u("", !0),
|
|
22851
|
-
Me.value ? (E(), d("div",
|
|
22861
|
+
Me.value ? (E(), d("div", ow)) : u("", !0),
|
|
22852
22862
|
n[0] ||= f("div", {
|
|
22853
22863
|
class: "mg-status-bar__stretch",
|
|
22854
22864
|
"aria-hidden": "true"
|
|
22855
22865
|
}, null, -1),
|
|
22856
|
-
Ne.value ? (E(), d("div",
|
|
22857
|
-
Ae.value ? (E(), l(
|
|
22866
|
+
Ne.value ? (E(), d("div", sw)) : u("", !0),
|
|
22867
|
+
Ae.value ? (E(), l(RC, {
|
|
22858
22868
|
key: 5,
|
|
22859
22869
|
context: N(R)
|
|
22860
22870
|
}, null, 8, ["context"])) : u("", !0),
|
|
22861
|
-
Pe.value ? (E(), d("div",
|
|
22862
|
-
De.value ? (E(), d("div",
|
|
22871
|
+
Pe.value ? (E(), d("div", cw)) : u("", !0),
|
|
22872
|
+
De.value ? (E(), d("div", lw, [A(t.$slots, "status-bar-right", x(_(N(R))))])) : u("", !0)
|
|
22863
22873
|
], 64))], 4)) : u("", !0)
|
|
22864
|
-
], 14,
|
|
22874
|
+
], 14, nw));
|
|
22865
22875
|
}
|
|
22866
|
-
}),
|
|
22876
|
+
}), dw = {
|
|
22867
22877
|
"sliders-vertical": [
|
|
22868
22878
|
["path", { d: "M10 8h4" }],
|
|
22869
22879
|
["path", { d: "M12 21v-9" }],
|
|
@@ -22916,14 +22926,14 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22916
22926
|
["path", { d: "M9 3v18" }],
|
|
22917
22927
|
["path", { d: "M15 3v18" }]
|
|
22918
22928
|
]
|
|
22919
|
-
},
|
|
22929
|
+
}, fw = ["width", "height"], pw = /* @__PURE__ */ g({
|
|
22920
22930
|
__name: "ColumnSettingsMenuIcon",
|
|
22921
22931
|
props: {
|
|
22922
22932
|
name: {},
|
|
22923
22933
|
size: { default: 16 }
|
|
22924
22934
|
},
|
|
22925
22935
|
setup(e) {
|
|
22926
|
-
let t = e, n = c(() =>
|
|
22936
|
+
let t = e, n = c(() => dw[t.name]);
|
|
22927
22937
|
return (t, r) => (E(), d("svg", {
|
|
22928
22938
|
class: "mg-column-settings-menu__icon-svg",
|
|
22929
22939
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -22936,12 +22946,12 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22936
22946
|
"stroke-linecap": "round",
|
|
22937
22947
|
"stroke-linejoin": "round",
|
|
22938
22948
|
"aria-hidden": "true"
|
|
22939
|
-
}, [(E(!0), d(o, null, k(n.value, ([t, n], r) => (E(), l(ee(t), v({ key: `${e.name}-${t}-${r}` }, { ref_for: !0 }, n), null, 16))), 128))], 8,
|
|
22949
|
+
}, [(E(!0), d(o, null, k(n.value, ([t, n], r) => (E(), l(ee(t), v({ key: `${e.name}-${t}-${r}` }, { ref_for: !0 }, n), null, 16))), 128))], 8, fw));
|
|
22940
22950
|
}
|
|
22941
|
-
}),
|
|
22951
|
+
}), mw = {
|
|
22942
22952
|
key: 0,
|
|
22943
22953
|
class: "mg-column-settings-menu__item-icon"
|
|
22944
|
-
},
|
|
22954
|
+
}, hw = { class: "mg-column-settings-menu__item-label" }, gw = /* @__PURE__ */ g({
|
|
22945
22955
|
__name: "ColumnSettingsMenuItem",
|
|
22946
22956
|
props: { label: {} },
|
|
22947
22957
|
setup(e) {
|
|
@@ -22949,9 +22959,9 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22949
22959
|
type: "button",
|
|
22950
22960
|
class: b(N(Vu)),
|
|
22951
22961
|
role: "menuitem"
|
|
22952
|
-
}, [t.$slots.icon ? (E(), d("span",
|
|
22962
|
+
}, [t.$slots.icon ? (E(), d("span", mw, [A(t.$slots, "icon")])) : u("", !0), f("span", hw, [A(t.$slots, "default", {}, () => [m(M(e.label), 1)])])], 2));
|
|
22953
22963
|
}
|
|
22954
|
-
}),
|
|
22964
|
+
}), _w = ["aria-expanded"], vw = { class: "mg-column-settings-menu__item-leading" }, yw = { class: "mg-column-settings-menu__item-icon" }, bw = /* @__PURE__ */ g({
|
|
22955
22965
|
__name: "ColumnSettingsMenu",
|
|
22956
22966
|
props: { showDivider: { type: Boolean } },
|
|
22957
22967
|
emits: [
|
|
@@ -23019,11 +23029,11 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23019
23029
|
class: b(N(Bu)),
|
|
23020
23030
|
role: "menu"
|
|
23021
23031
|
}, [
|
|
23022
|
-
h(
|
|
23032
|
+
h(gw, {
|
|
23023
23033
|
label: "列设置",
|
|
23024
23034
|
onClick: l
|
|
23025
23035
|
}, {
|
|
23026
|
-
icon: I(() => [h(
|
|
23036
|
+
icon: I(() => [h(pw, { name: "sliders-vertical" })]),
|
|
23027
23037
|
_: 1
|
|
23028
23038
|
}),
|
|
23029
23039
|
f("div", {
|
|
@@ -23040,7 +23050,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23040
23050
|
role: "menuitem",
|
|
23041
23051
|
"aria-haspopup": "menu",
|
|
23042
23052
|
"aria-expanded": i.value
|
|
23043
|
-
}, [f("span",
|
|
23053
|
+
}, [f("span", vw, [f("span", yw, [h(pw, { name: "list-restart" })]), n[1] ||= f("span", { class: "mg-column-settings-menu__item-label" }, "重置", -1)]), n[2] ||= f("svg", {
|
|
23044
23054
|
class: "mg-column-settings-menu__item-chevron",
|
|
23045
23055
|
xmlns: "http://www.w3.org/2000/svg",
|
|
23046
23056
|
width: "14",
|
|
@@ -23052,17 +23062,17 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23052
23062
|
"stroke-linecap": "round",
|
|
23053
23063
|
"stroke-linejoin": "round",
|
|
23054
23064
|
"aria-hidden": "true"
|
|
23055
|
-
}, [f("path", { d: "m9 18 6-6-6-6" })], -1)], 10,
|
|
23065
|
+
}, [f("path", { d: "m9 18 6-6-6-6" })], -1)], 10, _w), ne(f("div", {
|
|
23056
23066
|
ref_key: "resetSubmenuPanelRef",
|
|
23057
23067
|
ref: c,
|
|
23058
23068
|
class: b([N(Wu), { "mg-column-settings-menu__submenu-panel--flip": a.value }]),
|
|
23059
23069
|
role: "menu"
|
|
23060
|
-
}, [(E(), d(o, null, k(r, (e) => h(
|
|
23070
|
+
}, [(E(), d(o, null, k(r, (e) => h(gw, {
|
|
23061
23071
|
key: e.scope,
|
|
23062
23072
|
label: e.label,
|
|
23063
23073
|
onClick: (t) => v(e.scope)
|
|
23064
23074
|
}, {
|
|
23065
|
-
icon: I(() => [h(
|
|
23075
|
+
icon: I(() => [h(pw, { name: e.icon }, null, 8, ["name"])]),
|
|
23066
23076
|
_: 2
|
|
23067
23077
|
}, 1032, ["label", "onClick"])), 64))], 2), [[P, i.value]])], 34),
|
|
23068
23078
|
e.showDivider ? (E(), d("div", {
|
|
@@ -23078,11 +23088,11 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23078
23088
|
}, [A(t.$slots, "default")])) : u("", !0)
|
|
23079
23089
|
], 2));
|
|
23080
23090
|
}
|
|
23081
|
-
}),
|
|
23091
|
+
}), xw = [
|
|
23082
23092
|
"disabled",
|
|
23083
23093
|
"aria-disabled",
|
|
23084
23094
|
"title"
|
|
23085
|
-
],
|
|
23095
|
+
], Sw = /*@__PURE__*/ g({
|
|
23086
23096
|
__name: "ColumnSettingsClearFiltersBar",
|
|
23087
23097
|
props: {
|
|
23088
23098
|
gridApi: {},
|
|
@@ -23101,16 +23111,16 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23101
23111
|
"aria-disabled": !e.canClearAllFilters,
|
|
23102
23112
|
title: e.canClearAllFilters ? void 0 : "当前无筛选",
|
|
23103
23113
|
onClick: i
|
|
23104
|
-
}, " 清除全部筛选 ", 10,
|
|
23114
|
+
}, " 清除全部筛选 ", 10, xw));
|
|
23105
23115
|
}
|
|
23106
|
-
}),
|
|
23116
|
+
}), Cw = (e, t) => {
|
|
23107
23117
|
let n = e.__vccOpts || e;
|
|
23108
23118
|
for (let [e, r] of t) n[e] = r;
|
|
23109
23119
|
return n;
|
|
23110
|
-
},
|
|
23120
|
+
}, ww = /*#__PURE__*/ Cw(Sw, [["__scopeId", "data-v-1c8bd037"]]);
|
|
23111
23121
|
//#endregion
|
|
23112
23122
|
//#region src/core/column/columnSettingsFilterApply.ts
|
|
23113
|
-
function
|
|
23123
|
+
function Tw(e) {
|
|
23114
23124
|
let t = null, n = () => {
|
|
23115
23125
|
t != null && (clearTimeout(t), t = null);
|
|
23116
23126
|
};
|
|
@@ -23146,7 +23156,7 @@ function ww(e) {
|
|
|
23146
23156
|
}
|
|
23147
23157
|
//#endregion
|
|
23148
23158
|
//#region src/components/ColumnSettings/ColumnFilterPanelEmbed.vue
|
|
23149
|
-
var
|
|
23159
|
+
var Ew = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23150
23160
|
__name: "ColumnFilterPanelEmbed",
|
|
23151
23161
|
props: {
|
|
23152
23162
|
colId: {},
|
|
@@ -23156,7 +23166,7 @@ var Tw = /*#__PURE__*/ Sw(/* @__PURE__ */ g({
|
|
|
23156
23166
|
},
|
|
23157
23167
|
emits: ["change"],
|
|
23158
23168
|
setup(e, { emit: t }) {
|
|
23159
|
-
let n = e, r = t, i = D(null), a = null, o = null, s =
|
|
23169
|
+
let n = e, r = t, i = D(null), a = null, o = null, s = Tw({
|
|
23160
23170
|
getFilterModel: () => n.gridApi.getFilterModel(),
|
|
23161
23171
|
setFilterModel: (e) => {
|
|
23162
23172
|
n.gridApi.setFilterModel(e), r("change");
|
|
@@ -23213,65 +23223,65 @@ var Tw = /*#__PURE__*/ Sw(/* @__PURE__ */ g({
|
|
|
23213
23223
|
}), [["__scopeId", "data-v-85b2c30c"]]);
|
|
23214
23224
|
//#endregion
|
|
23215
23225
|
//#region src/core/column/columnSettingsActions.ts
|
|
23216
|
-
function
|
|
23226
|
+
function Dw(e) {
|
|
23217
23227
|
return e === null ? "asc" : e === "asc" ? "desc" : null;
|
|
23218
23228
|
}
|
|
23219
|
-
function Dw(e, t, n) {
|
|
23220
|
-
return t === null ? Jv(e, n) : t === "asc" ? Kv(e, n) : qv(e, n);
|
|
23221
|
-
}
|
|
23222
23229
|
function Ow(e, t, n) {
|
|
23223
|
-
e
|
|
23230
|
+
return t === null ? Jv(e, n) : t === "asc" ? Kv(e, n) : qv(e, n);
|
|
23224
23231
|
}
|
|
23225
23232
|
function kw(e, t, n) {
|
|
23226
|
-
|
|
23227
|
-
return Ow(e, t, r), r;
|
|
23233
|
+
e.setSortModel(Ow(t, n, e.getSortModel()));
|
|
23228
23234
|
}
|
|
23229
23235
|
function Aw(e, t, n) {
|
|
23236
|
+
let r = Dw(n);
|
|
23237
|
+
return kw(e, t, r), r;
|
|
23238
|
+
}
|
|
23239
|
+
function jw(e, t, n) {
|
|
23230
23240
|
return e.setColumnFixed(t, n);
|
|
23231
23241
|
}
|
|
23232
|
-
function
|
|
23242
|
+
function Mw(e) {
|
|
23233
23243
|
return e === "asc" ? "升序" : e === "desc" ? "降序" : "无排序";
|
|
23234
23244
|
}
|
|
23235
|
-
function
|
|
23245
|
+
function Nw(e) {
|
|
23236
23246
|
return e === "left" ? "固定左侧" : e === "right" ? "固定右侧" : "不固定";
|
|
23237
23247
|
}
|
|
23238
23248
|
//#endregion
|
|
23239
23249
|
//#region src/core/column/columnSettingsVisibility.ts
|
|
23240
|
-
var
|
|
23241
|
-
function
|
|
23250
|
+
var Pw = "[magic-grid] ColumnSettings: at least one user column must remain visible.";
|
|
23251
|
+
function Fw(e) {
|
|
23242
23252
|
return e.filter((e) => Qu(e.colId) && ho(e)).length;
|
|
23243
23253
|
}
|
|
23244
|
-
function
|
|
23254
|
+
function Iw(e) {
|
|
23245
23255
|
return e.filter((e) => Qu(e.colId) && e.hidden).map((e) => e.colId);
|
|
23246
23256
|
}
|
|
23247
|
-
function
|
|
23257
|
+
function Lw(e, t) {
|
|
23248
23258
|
if (!Qu(e)) return !1;
|
|
23249
23259
|
let n = t.find((t) => t.colId === e);
|
|
23250
|
-
return !n || n.hidden ? !1 :
|
|
23260
|
+
return !n || n.hidden ? !1 : Fw(t) > 1;
|
|
23251
23261
|
}
|
|
23252
|
-
function
|
|
23262
|
+
function Rw(e, t, n, r = {}) {
|
|
23253
23263
|
let i = r.warn ?? ((e) => console.warn(e));
|
|
23254
|
-
return !n && !
|
|
23264
|
+
return !n && !Lw(t, e.getColumns()) ? (i(Pw), !1) : e.setColumnsHidden([t], !n);
|
|
23255
23265
|
}
|
|
23256
|
-
function
|
|
23257
|
-
let t =
|
|
23266
|
+
function zw(e) {
|
|
23267
|
+
let t = Iw(e.getColumns());
|
|
23258
23268
|
return t.length !== 0 && e.setColumnsHidden(t, !1);
|
|
23259
23269
|
}
|
|
23260
23270
|
//#endregion
|
|
23261
23271
|
//#region src/components/ColumnSettings/ColumnSettingsRow.vue?vue&type=script&setup=true&lang.ts
|
|
23262
|
-
var
|
|
23272
|
+
var Bw = ["data-col-id"], Vw = { class: "mg-column-settings__row-main" }, Hw = [
|
|
23263
23273
|
"draggable",
|
|
23264
23274
|
"aria-disabled",
|
|
23265
23275
|
"title"
|
|
23266
|
-
],
|
|
23276
|
+
], Uw = ["title"], Ww = {
|
|
23267
23277
|
key: 1,
|
|
23268
23278
|
class: "mg-column-settings__row-actions"
|
|
23269
|
-
},
|
|
23279
|
+
}, Gw = ["aria-label", "title"], Kw = ["aria-expanded", "aria-label"], qw = ["aria-label"], Jw = [
|
|
23270
23280
|
"aria-checked",
|
|
23271
23281
|
"aria-label",
|
|
23272
23282
|
"title",
|
|
23273
23283
|
"onClick"
|
|
23274
|
-
],
|
|
23284
|
+
], Yw = ["title"], Xw = ["checked", "aria-label"], Zw = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23275
23285
|
__name: "ColumnSettingsRow",
|
|
23276
23286
|
props: {
|
|
23277
23287
|
row: {},
|
|
@@ -23314,10 +23324,10 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23314
23324
|
"right"
|
|
23315
23325
|
];
|
|
23316
23326
|
function s() {
|
|
23317
|
-
!n.gridApi || !n.row.sortable || (
|
|
23327
|
+
!n.gridApi || !n.row.sortable || (Aw(n.gridApi, n.row.colId, n.row.sortDirection), r("change"));
|
|
23318
23328
|
}
|
|
23319
23329
|
function c(e) {
|
|
23320
|
-
!n.gridApi || n.row.fixed === e ||
|
|
23330
|
+
!n.gridApi || n.row.fixed === e || jw(n.gridApi, n.row.colId, e) && r("change");
|
|
23321
23331
|
}
|
|
23322
23332
|
function p() {
|
|
23323
23333
|
i.value = !i.value;
|
|
@@ -23325,7 +23335,7 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23325
23335
|
function m(e) {
|
|
23326
23336
|
if (!n.gridApi) return;
|
|
23327
23337
|
let t = e.target, i = t.checked;
|
|
23328
|
-
if (!
|
|
23338
|
+
if (!Rw(n.gridApi, n.row.colId, i)) {
|
|
23329
23339
|
t.checked = !i;
|
|
23330
23340
|
return;
|
|
23331
23341
|
}
|
|
@@ -23348,7 +23358,7 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23348
23358
|
"mg-column-settings__row--dragging": e.dragging
|
|
23349
23359
|
}]),
|
|
23350
23360
|
"data-col-id": e.row.colId
|
|
23351
|
-
}, [f("div",
|
|
23361
|
+
}, [f("div", Vw, [
|
|
23352
23362
|
e.showDragHandle ? (E(), d("span", {
|
|
23353
23363
|
key: 0,
|
|
23354
23364
|
class: b(["mg-column-settings__drag-handle", { "mg-column-settings__drag-handle--disabled": !e.draggable }]),
|
|
@@ -23357,12 +23367,12 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23357
23367
|
title: e.draggable ? "拖拽调整列顺序" : "此列不可拖拽",
|
|
23358
23368
|
onDragstart: h,
|
|
23359
23369
|
onDragend: g
|
|
23360
|
-
}, " ≡ ", 42,
|
|
23370
|
+
}, " ≡ ", 42, Hw)) : u("", !0),
|
|
23361
23371
|
f("span", {
|
|
23362
23372
|
class: "mg-column-settings__row-label",
|
|
23363
23373
|
title: e.row.label
|
|
23364
|
-
}, M(e.row.label), 9,
|
|
23365
|
-
e.gridApi ? (E(), d("div",
|
|
23374
|
+
}, M(e.row.label), 9, Uw),
|
|
23375
|
+
e.gridApi ? (E(), d("div", Ww, [
|
|
23366
23376
|
e.showSort && e.row.sortable ? (E(), d("button", {
|
|
23367
23377
|
key: 0,
|
|
23368
23378
|
type: "button",
|
|
@@ -23370,10 +23380,10 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23370
23380
|
"mg-column-settings__sort-button--asc": e.row.sortDirection === "asc",
|
|
23371
23381
|
"mg-column-settings__sort-button--desc": e.row.sortDirection === "desc"
|
|
23372
23382
|
}]),
|
|
23373
|
-
"aria-label": `${e.row.label} 排序:${N(
|
|
23374
|
-
title: N(
|
|
23383
|
+
"aria-label": `${e.row.label} 排序:${N(Mw)(e.row.sortDirection)}`,
|
|
23384
|
+
title: N(Mw)(e.row.sortDirection),
|
|
23375
23385
|
onClick: s
|
|
23376
|
-
}, M(e.row.sortDirection === "asc" ? "↑" : e.row.sortDirection === "desc" ? "↓" : "↕"), 11,
|
|
23386
|
+
}, M(e.row.sortDirection === "asc" ? "↑" : e.row.sortDirection === "desc" ? "↓" : "↕"), 11, Gw)) : u("", !0),
|
|
23377
23387
|
e.showFilter && e.row.filterable ? (E(), d("button", {
|
|
23378
23388
|
key: 1,
|
|
23379
23389
|
type: "button",
|
|
@@ -23398,7 +23408,7 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23398
23408
|
f("path", { d: "M3 6h18" }),
|
|
23399
23409
|
f("path", { d: "M7 12h10" }),
|
|
23400
23410
|
f("path", { d: "M10 18h4" })
|
|
23401
|
-
], -1)]], 10,
|
|
23411
|
+
], -1)]], 10, Kw)) : u("", !0),
|
|
23402
23412
|
e.showPin ? (E(), d("div", {
|
|
23403
23413
|
key: 2,
|
|
23404
23414
|
class: "mg-column-settings__pin-group",
|
|
@@ -23410,10 +23420,10 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23410
23420
|
class: b(["mg-column-settings__pin-button", { "mg-column-settings__pin-button--active": e.row.fixed === t }]),
|
|
23411
23421
|
role: "radio",
|
|
23412
23422
|
"aria-checked": e.row.fixed === t,
|
|
23413
|
-
"aria-label": N(
|
|
23414
|
-
title: N(
|
|
23423
|
+
"aria-label": N(Nw)(t),
|
|
23424
|
+
title: N(Nw)(t),
|
|
23415
23425
|
onClick: (e) => c(t)
|
|
23416
|
-
}, M(t === "left" ? "左" : t === "right" ? "右" : "中"), 11,
|
|
23426
|
+
}, M(t === "left" ? "左" : t === "right" ? "右" : "中"), 11, Jw)), 64))], 8, qw)) : u("", !0),
|
|
23417
23427
|
e.showVisibility ? (E(), d("label", {
|
|
23418
23428
|
key: 3,
|
|
23419
23429
|
class: "mg-column-settings__visibility",
|
|
@@ -23424,12 +23434,12 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23424
23434
|
checked: !e.row.hidden,
|
|
23425
23435
|
"aria-label": `${e.row.label} 显示列`,
|
|
23426
23436
|
onChange: m
|
|
23427
|
-
}, null, 40,
|
|
23437
|
+
}, null, 40, Xw), n[2] ||= f("span", {
|
|
23428
23438
|
class: "mg-column-settings__visibility-label",
|
|
23429
23439
|
"aria-hidden": "true"
|
|
23430
|
-
}, "显示", -1)], 8,
|
|
23440
|
+
}, "显示", -1)], 8, Yw)) : u("", !0)
|
|
23431
23441
|
])) : u("", !0)
|
|
23432
|
-
]), i.value && e.gridApi && e.row.filterable ? (E(), l(
|
|
23442
|
+
]), i.value && e.gridApi && e.row.filterable ? (E(), l(Ew, {
|
|
23433
23443
|
key: 0,
|
|
23434
23444
|
class: "mg-column-settings__filter-panel",
|
|
23435
23445
|
"col-id": e.row.colId,
|
|
@@ -23442,19 +23452,19 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23442
23452
|
"grid-api",
|
|
23443
23453
|
"filter-set-value-mode",
|
|
23444
23454
|
"filter-set-date-layout-mode"
|
|
23445
|
-
])) : u("", !0)], 10,
|
|
23455
|
+
])) : u("", !0)], 10, Bw));
|
|
23446
23456
|
}
|
|
23447
23457
|
}), [["__scopeId", "data-v-d7915c64"]]);
|
|
23448
23458
|
//#endregion
|
|
23449
23459
|
//#region src/core/column/columnSettingsMove.ts
|
|
23450
|
-
function
|
|
23460
|
+
function Qw(e, t) {
|
|
23451
23461
|
return Qu(e.colId) && !e.hidden && $u(e.fixed) === t;
|
|
23452
23462
|
}
|
|
23453
|
-
function
|
|
23454
|
-
return e.filter((e) =>
|
|
23463
|
+
function $w(e, t) {
|
|
23464
|
+
return e.filter((e) => Qw(e, t));
|
|
23455
23465
|
}
|
|
23456
|
-
function
|
|
23457
|
-
let i =
|
|
23466
|
+
function eT(e, t, n, r) {
|
|
23467
|
+
let i = $w(e, t), a = i.findIndex((e) => e.colId === n);
|
|
23458
23468
|
if (a < 0 || !e.find((e) => e.colId === n)?.movable) return null;
|
|
23459
23469
|
let o = Math.max(0, Math.min(r, i.length - 1));
|
|
23460
23470
|
if (a === o) return null;
|
|
@@ -23462,7 +23472,7 @@ function $w(e, t, n, r) {
|
|
|
23462
23472
|
s.splice(a, 1), s.splice(o, 0, n), e.map((e) => e.colId);
|
|
23463
23473
|
let c = [], l = 0;
|
|
23464
23474
|
for (let n of e) {
|
|
23465
|
-
if (
|
|
23475
|
+
if (Qw(n, t)) {
|
|
23466
23476
|
let e = s[l];
|
|
23467
23477
|
if (!e) return null;
|
|
23468
23478
|
c.push(e), l += 1;
|
|
@@ -23472,8 +23482,8 @@ function $w(e, t, n, r) {
|
|
|
23472
23482
|
}
|
|
23473
23483
|
return c;
|
|
23474
23484
|
}
|
|
23475
|
-
function
|
|
23476
|
-
let t =
|
|
23485
|
+
function tT(e) {
|
|
23486
|
+
let t = eT(e.columns, e.lane, e.colId, e.toDisplayIndex);
|
|
23477
23487
|
if (!t) return null;
|
|
23478
23488
|
let n = e.columns.findIndex((t) => t.colId === e.colId);
|
|
23479
23489
|
if (n < 0) return null;
|
|
@@ -23494,8 +23504,8 @@ function eT(e) {
|
|
|
23494
23504
|
allowCrossLaneColumnMove: !1
|
|
23495
23505
|
}) ? null : r;
|
|
23496
23506
|
}
|
|
23497
|
-
function
|
|
23498
|
-
let i =
|
|
23507
|
+
function nT(e, t, n, r) {
|
|
23508
|
+
let i = tT({
|
|
23499
23509
|
columns: e.getColumns(),
|
|
23500
23510
|
lane: t,
|
|
23501
23511
|
colId: n,
|
|
@@ -23505,7 +23515,7 @@ function tT(e, t, n, r) {
|
|
|
23505
23515
|
}
|
|
23506
23516
|
//#endregion
|
|
23507
23517
|
//#region src/components/ColumnSettings/ColumnSettingsList.vue?vue&type=script&setup=true&lang.ts
|
|
23508
|
-
var
|
|
23518
|
+
var rT = ["aria-label"], iT = { class: "mg-column-settings__rows" }, aT = ["onDragover", "onDrop"], oT = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23509
23519
|
__name: "ColumnSettingsList",
|
|
23510
23520
|
props: {
|
|
23511
23521
|
lane: {},
|
|
@@ -23538,7 +23548,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23538
23548
|
m();
|
|
23539
23549
|
return;
|
|
23540
23550
|
}
|
|
23541
|
-
|
|
23551
|
+
nT(r.gridApi, r.lane, n, e) && (i("reorder"), i("change")), m();
|
|
23542
23552
|
}
|
|
23543
23553
|
function m() {
|
|
23544
23554
|
a.value = null, s.value = null;
|
|
@@ -23547,12 +23557,12 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23547
23557
|
key: 0,
|
|
23548
23558
|
class: b([N(qu), `mg-column-settings__group--${e.lane}`]),
|
|
23549
23559
|
"aria-label": n[e.lane]
|
|
23550
|
-
}, [f("div",
|
|
23560
|
+
}, [f("div", iT, [(E(!0), d(o, null, k(e.rows, (t, n) => (E(), d("div", {
|
|
23551
23561
|
key: t.colId,
|
|
23552
23562
|
class: "mg-column-settings__row-host",
|
|
23553
23563
|
onDragover: (e) => l(n, e),
|
|
23554
23564
|
onDrop: (e) => p(n, e)
|
|
23555
|
-
}, [h(
|
|
23565
|
+
}, [h(Zw, {
|
|
23556
23566
|
row: t,
|
|
23557
23567
|
"grid-api": e.gridApi,
|
|
23558
23568
|
draggable: t.movable,
|
|
@@ -23572,9 +23582,9 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23572
23582
|
"show-filter",
|
|
23573
23583
|
"show-visibility",
|
|
23574
23584
|
"onDragstart"
|
|
23575
|
-
])], 40,
|
|
23585
|
+
])], 40, aT))), 128))])], 10, rT)) : u("", !0);
|
|
23576
23586
|
}
|
|
23577
|
-
}), [["__scopeId", "data-v-69b1c1f5"]]),
|
|
23587
|
+
}), [["__scopeId", "data-v-69b1c1f5"]]), sT = { class: "mg-column-settings__groups" }, cT = { class: "mg-column-settings__visible-lanes" }, lT = { class: "mg-column-settings__hidden-divider" }, uT = { class: "mg-column-settings__hidden-divider-center" }, dT = ["aria-expanded"], fT = {
|
|
23578
23588
|
key: 0,
|
|
23579
23589
|
class: "mg-column-settings__hidden-toggle-icon",
|
|
23580
23590
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -23587,7 +23597,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23587
23597
|
"stroke-linecap": "round",
|
|
23588
23598
|
"stroke-linejoin": "round",
|
|
23589
23599
|
"aria-hidden": "true"
|
|
23590
|
-
},
|
|
23600
|
+
}, pT = {
|
|
23591
23601
|
key: 1,
|
|
23592
23602
|
class: "mg-column-settings__hidden-toggle-icon",
|
|
23593
23603
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -23600,7 +23610,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23600
23610
|
"stroke-linecap": "round",
|
|
23601
23611
|
"stroke-linejoin": "round",
|
|
23602
23612
|
"aria-hidden": "true"
|
|
23603
|
-
},
|
|
23613
|
+
}, mT = { class: "mg-column-settings__hidden-rows" }, hT = { class: "mg-column-settings__rows" }, gT = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23604
23614
|
__name: "ColumnSettingsGroupedLists",
|
|
23605
23615
|
props: {
|
|
23606
23616
|
grouped: {},
|
|
@@ -23615,10 +23625,10 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23615
23625
|
setup(e, { emit: t }) {
|
|
23616
23626
|
let n = e, r = t, i = D(!0);
|
|
23617
23627
|
function a() {
|
|
23618
|
-
|
|
23628
|
+
zw(n.gridApi) && r("change");
|
|
23619
23629
|
}
|
|
23620
|
-
return (t, n) => (E(), d("div",
|
|
23621
|
-
h(
|
|
23630
|
+
return (t, n) => (E(), d("div", sT, [f("div", cT, [
|
|
23631
|
+
h(oT, {
|
|
23622
23632
|
lane: "left",
|
|
23623
23633
|
rows: e.grouped.left,
|
|
23624
23634
|
"grid-api": e.gridApi,
|
|
@@ -23632,7 +23642,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23632
23642
|
"show-filter",
|
|
23633
23643
|
"show-visibility"
|
|
23634
23644
|
]),
|
|
23635
|
-
h(
|
|
23645
|
+
h(oT, {
|
|
23636
23646
|
lane: "center",
|
|
23637
23647
|
rows: e.grouped.center,
|
|
23638
23648
|
"grid-api": e.gridApi,
|
|
@@ -23646,7 +23656,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23646
23656
|
"show-filter",
|
|
23647
23657
|
"show-visibility"
|
|
23648
23658
|
]),
|
|
23649
|
-
h(
|
|
23659
|
+
h(oT, {
|
|
23650
23660
|
lane: "right",
|
|
23651
23661
|
rows: e.grouped.right,
|
|
23652
23662
|
"grid-api": e.gridApi,
|
|
@@ -23663,17 +23673,17 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23663
23673
|
]), e.grouped.hidden.length > 0 ? (E(), d("section", {
|
|
23664
23674
|
key: 0,
|
|
23665
23675
|
class: b(N(Zu))
|
|
23666
|
-
}, [f("div",
|
|
23676
|
+
}, [f("div", lT, [
|
|
23667
23677
|
n[10] ||= f("span", {
|
|
23668
23678
|
class: "mg-column-settings__hidden-divider-line",
|
|
23669
23679
|
"aria-hidden": "true"
|
|
23670
23680
|
}, null, -1),
|
|
23671
|
-
f("div",
|
|
23681
|
+
f("div", uT, [f("button", {
|
|
23672
23682
|
type: "button",
|
|
23673
23683
|
class: "mg-column-settings__hidden-toggle",
|
|
23674
23684
|
"aria-expanded": i.value,
|
|
23675
23685
|
onClick: n[6] ||= (e) => i.value = !i.value
|
|
23676
|
-
}, [m(" 隐藏 (" + M(e.grouped.hidden.length) + ") ", 1), i.value ? (E(), d("svg",
|
|
23686
|
+
}, [m(" 隐藏 (" + M(e.grouped.hidden.length) + ") ", 1), i.value ? (E(), d("svg", fT, [...n[8] ||= [p("<path d=\"m3 8 4-4 4 4\" data-v-62756c32></path><path d=\"M7 4v16\" data-v-62756c32></path><path d=\"M11 12h10\" data-v-62756c32></path><path d=\"M11 16h7\" data-v-62756c32></path><path d=\"M11 20h4\" data-v-62756c32></path>", 5)]])) : (E(), d("svg", pT, [...n[9] ||= [p("<path d=\"m3 16 4 4 4-4\" data-v-62756c32></path><path d=\"M7 20V4\" data-v-62756c32></path><path d=\"M11 4h10\" data-v-62756c32></path><path d=\"M11 8h7\" data-v-62756c32></path><path d=\"M11 12h4\" data-v-62756c32></path>", 5)]]))], 8, dT), f("button", {
|
|
23677
23687
|
type: "button",
|
|
23678
23688
|
class: "mg-column-settings__hidden-show-all",
|
|
23679
23689
|
onClick: a
|
|
@@ -23682,7 +23692,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23682
23692
|
class: "mg-column-settings__hidden-divider-line",
|
|
23683
23693
|
"aria-hidden": "true"
|
|
23684
23694
|
}, null, -1)
|
|
23685
|
-
]), ne(f("div",
|
|
23695
|
+
]), ne(f("div", mT, [f("h4", { class: b([N(Ju), "mg-column-settings__sr-only"]) }, " 已隐藏列 ", 2), f("div", hT, [(E(!0), d(o, null, k(e.grouped.hidden, (t) => (E(), l(Zw, {
|
|
23686
23696
|
key: t.colId,
|
|
23687
23697
|
row: t,
|
|
23688
23698
|
"grid-api": e.gridApi,
|
|
@@ -23701,7 +23711,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23701
23711
|
}), [["__scopeId", "data-v-62756c32"]]);
|
|
23702
23712
|
//#endregion
|
|
23703
23713
|
//#region src/core/column/columnSettingsProjection.ts
|
|
23704
|
-
function
|
|
23714
|
+
function _T(e) {
|
|
23705
23715
|
return {
|
|
23706
23716
|
colId: e.colId,
|
|
23707
23717
|
label: e.label,
|
|
@@ -23713,20 +23723,20 @@ function gT(e) {
|
|
|
23713
23723
|
hidden: e.hidden
|
|
23714
23724
|
};
|
|
23715
23725
|
}
|
|
23716
|
-
function
|
|
23717
|
-
return e.map(
|
|
23726
|
+
function vT(e) {
|
|
23727
|
+
return e.map(_T);
|
|
23718
23728
|
}
|
|
23719
|
-
function
|
|
23729
|
+
function yT(e, t = {}) {
|
|
23720
23730
|
return nd({
|
|
23721
|
-
columns:
|
|
23731
|
+
columns: vT(e.getColumns()),
|
|
23722
23732
|
sortModel: e.getSortModel(),
|
|
23723
23733
|
filterModel: e.getFilterModel(),
|
|
23724
23734
|
isColumnFilterActive: (t) => e.isColumnFilterActive(t),
|
|
23725
23735
|
includeHidden: t.includeHidden
|
|
23726
23736
|
});
|
|
23727
23737
|
}
|
|
23728
|
-
function
|
|
23729
|
-
let n =
|
|
23738
|
+
function bT(e, t = {}) {
|
|
23739
|
+
let n = yT(e, t);
|
|
23730
23740
|
return {
|
|
23731
23741
|
rows: n,
|
|
23732
23742
|
grouped: rd(n),
|
|
@@ -23735,22 +23745,22 @@ function yT(e, t = {}) {
|
|
|
23735
23745
|
}
|
|
23736
23746
|
//#endregion
|
|
23737
23747
|
//#region src/core/column/columnSettingsPanelSubscribe.ts
|
|
23738
|
-
var
|
|
23748
|
+
var xT = [
|
|
23739
23749
|
"sortChanged",
|
|
23740
23750
|
"filterChanged",
|
|
23741
23751
|
"columnMoved",
|
|
23742
23752
|
"columnPinned",
|
|
23743
23753
|
"columnHiddenChanged"
|
|
23744
23754
|
];
|
|
23745
|
-
function
|
|
23746
|
-
let n =
|
|
23755
|
+
function ST(e, t) {
|
|
23756
|
+
let n = xT.map((n) => e.on(n, t));
|
|
23747
23757
|
return () => {
|
|
23748
23758
|
for (let e of n) e();
|
|
23749
23759
|
};
|
|
23750
23760
|
}
|
|
23751
23761
|
//#endregion
|
|
23752
23762
|
//#region src/components/ColumnSettings/ColumnSettingsPanel.vue?vue&type=script&setup=true&lang.ts
|
|
23753
|
-
var
|
|
23763
|
+
var CT = { class: "mg-column-settings__header-leading" }, wT = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23754
23764
|
__name: "ColumnSettingsPanel",
|
|
23755
23765
|
props: {
|
|
23756
23766
|
gridApi: {},
|
|
@@ -23769,12 +23779,12 @@ var ST = { class: "mg-column-settings__header-leading" }, CT = /*#__PURE__*/ Sw(
|
|
|
23769
23779
|
},
|
|
23770
23780
|
emits: ["close"],
|
|
23771
23781
|
setup(e, { emit: t }) {
|
|
23772
|
-
let n = e, r = t, i = j(
|
|
23782
|
+
let n = e, r = t, i = j(bT(n.gridApi)), a = null;
|
|
23773
23783
|
function o() {
|
|
23774
|
-
i.value =
|
|
23784
|
+
i.value = bT(n.gridApi);
|
|
23775
23785
|
}
|
|
23776
23786
|
function s() {
|
|
23777
|
-
c(), o(), a =
|
|
23787
|
+
c(), o(), a = ST(n.gridApi, o);
|
|
23778
23788
|
}
|
|
23779
23789
|
function c() {
|
|
23780
23790
|
a?.(), a = null;
|
|
@@ -23797,7 +23807,7 @@ var ST = { class: "mg-column-settings__header-leading" }, CT = /*#__PURE__*/ Sw(
|
|
|
23797
23807
|
class: b(N(Pu)),
|
|
23798
23808
|
role: "document",
|
|
23799
23809
|
"aria-label": "列设置"
|
|
23800
|
-
}, [f("header", { class: b(N(Fu)) }, [f("div",
|
|
23810
|
+
}, [f("header", { class: b(N(Fu)) }, [f("div", CT, [n[1] ||= p("<div class=\"mg-column-settings__title-group\" data-v-d618f6f4><svg class=\"mg-column-settings__title-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" data-v-d618f6f4><path d=\"M10 8h4\" data-v-d618f6f4></path><path d=\"M12 21v-9\" data-v-d618f6f4></path><path d=\"M12 8V3\" data-v-d618f6f4></path><path d=\"M17 16h4\" data-v-d618f6f4></path><path d=\"M19 12V3\" data-v-d618f6f4></path><path d=\"M19 21v-5\" data-v-d618f6f4></path><path d=\"M3 14h4\" data-v-d618f6f4></path><path d=\"M5 10V3\" data-v-d618f6f4></path><path d=\"M5 21v-7\" data-v-d618f6f4></path></svg><h3 class=\"mg-column-settings__title\" data-v-d618f6f4>列设置</h3></div>", 1), h(ww, {
|
|
23801
23811
|
"grid-api": e.gridApi,
|
|
23802
23812
|
"can-clear-all-filters": i.value.canClearAllFilters,
|
|
23803
23813
|
onChange: l
|
|
@@ -23806,7 +23816,7 @@ var ST = { class: "mg-column-settings__header-leading" }, CT = /*#__PURE__*/ Sw(
|
|
|
23806
23816
|
class: "mg-column-settings__close",
|
|
23807
23817
|
"aria-label": "关闭列设置",
|
|
23808
23818
|
onClick: n[0] ||= (e) => r("close")
|
|
23809
|
-
}, " × ")], 2), f("div", { class: b(N(Iu)) }, [h(
|
|
23819
|
+
}, " × ")], 2), f("div", { class: b(N(Iu)) }, [h(gT, {
|
|
23810
23820
|
grouped: i.value.grouped,
|
|
23811
23821
|
"grid-api": e.gridApi,
|
|
23812
23822
|
"show-filter": e.showFilter,
|
|
@@ -23823,67 +23833,67 @@ var ST = { class: "mg-column-settings__header-leading" }, CT = /*#__PURE__*/ Sw(
|
|
|
23823
23833
|
}), [["__scopeId", "data-v-d618f6f4"]]);
|
|
23824
23834
|
//#endregion
|
|
23825
23835
|
//#region src/core/column/columnSettingsReset.ts
|
|
23826
|
-
function wT(e) {
|
|
23827
|
-
e.getSortModel().length !== 0 && e.setSortModel([]);
|
|
23828
|
-
}
|
|
23829
23836
|
function TT(e) {
|
|
23830
|
-
e.
|
|
23837
|
+
e.getSortModel().length !== 0 && e.setSortModel([]);
|
|
23831
23838
|
}
|
|
23832
23839
|
function ET(e) {
|
|
23833
|
-
e.
|
|
23840
|
+
e.clearAllFilters();
|
|
23834
23841
|
}
|
|
23835
23842
|
function DT(e) {
|
|
23836
|
-
|
|
23837
|
-
zS(t.map((e) => e.colId), n) || e.resetColumnOrder();
|
|
23843
|
+
e.resetColumnWidths();
|
|
23838
23844
|
}
|
|
23839
23845
|
function OT(e) {
|
|
23846
|
+
let t = e.getColumns(), n = zS(t);
|
|
23847
|
+
BS(t.map((e) => e.colId), n) || e.resetColumnOrder();
|
|
23848
|
+
}
|
|
23849
|
+
function kT(e) {
|
|
23840
23850
|
for (let t of e.getColumns()) !Qu(t.colId) || t.fixed === null || e.setColumnFixed(t.colId, null);
|
|
23841
23851
|
}
|
|
23842
|
-
function
|
|
23852
|
+
function AT(e, t) {
|
|
23843
23853
|
switch (t) {
|
|
23844
23854
|
case "sort":
|
|
23845
|
-
|
|
23855
|
+
TT(e);
|
|
23846
23856
|
break;
|
|
23847
23857
|
case "filter":
|
|
23848
|
-
|
|
23858
|
+
ET(e);
|
|
23849
23859
|
break;
|
|
23850
23860
|
case "width":
|
|
23851
|
-
|
|
23861
|
+
DT(e);
|
|
23852
23862
|
break;
|
|
23853
23863
|
case "order":
|
|
23854
|
-
|
|
23864
|
+
OT(e);
|
|
23855
23865
|
break;
|
|
23856
23866
|
case "pin":
|
|
23857
|
-
|
|
23867
|
+
kT(e);
|
|
23858
23868
|
break;
|
|
23859
|
-
case "all":
|
|
23869
|
+
case "all": TT(e), ET(e), DT(e), OT(e), kT(e);
|
|
23860
23870
|
}
|
|
23861
23871
|
}
|
|
23862
23872
|
//#endregion
|
|
23863
23873
|
//#region src/core/column/columnSettingsPopoverPosition.ts
|
|
23864
|
-
var
|
|
23865
|
-
function
|
|
23866
|
-
let r = Math.min(
|
|
23867
|
-
return a + n > window.innerHeight -
|
|
23874
|
+
var jT = 8, MT = 4, NT = 320, PT = 400, FT = 168;
|
|
23875
|
+
function IT(e, t, n) {
|
|
23876
|
+
let r = Math.min(PT, Math.max(NT, t)), i = e.right - r, a = e.bottom + MT;
|
|
23877
|
+
return a + n > window.innerHeight - jT && (a = e.top - n - MT), i = Math.max(jT, Math.min(i, window.innerWidth - r - jT)), a = Math.max(jT, Math.min(a, window.innerHeight - n - jT)), {
|
|
23868
23878
|
left: i,
|
|
23869
23879
|
top: a
|
|
23870
23880
|
};
|
|
23871
23881
|
}
|
|
23872
|
-
function
|
|
23873
|
-
let r = Math.max(
|
|
23874
|
-
return a + n > window.innerHeight -
|
|
23882
|
+
function LT(e, t, n) {
|
|
23883
|
+
let r = Math.max(FT, t), i = e.left, a = e.bottom + MT;
|
|
23884
|
+
return a + n > window.innerHeight - jT && (a = e.top - n - MT), i = Math.max(jT, Math.min(i, window.innerWidth - r - jT)), a = Math.max(jT, Math.min(a, window.innerHeight - n - jT)), {
|
|
23875
23885
|
left: i,
|
|
23876
23886
|
top: a
|
|
23877
23887
|
};
|
|
23878
23888
|
}
|
|
23879
23889
|
//#endregion
|
|
23880
23890
|
//#region src/components/ColumnSettings/ColumnSettingsButton.vue?vue&type=script&setup=true&lang.ts
|
|
23881
|
-
var
|
|
23891
|
+
var RT = [
|
|
23882
23892
|
"disabled",
|
|
23883
23893
|
"aria-expanded",
|
|
23884
23894
|
"aria-label",
|
|
23885
23895
|
"title"
|
|
23886
|
-
],
|
|
23896
|
+
], zT = /* @__PURE__ */ g({
|
|
23887
23897
|
__name: "ColumnSettingsButton",
|
|
23888
23898
|
props: {
|
|
23889
23899
|
gridApi: {},
|
|
@@ -23945,7 +23955,7 @@ var LT = [
|
|
|
23945
23955
|
M(!0);
|
|
23946
23956
|
}
|
|
23947
23957
|
function ie(e) {
|
|
23948
|
-
|
|
23958
|
+
AT(n.gridApi, e), oe();
|
|
23949
23959
|
}
|
|
23950
23960
|
function ae() {
|
|
23951
23961
|
_.value && M(!1);
|
|
@@ -23964,10 +23974,10 @@ var LT = [
|
|
|
23964
23974
|
e.style.left = `${a}px`, e.style.top = `${s}px`, e.style.visibility = "";
|
|
23965
23975
|
}
|
|
23966
23976
|
function L() {
|
|
23967
|
-
ce(p.value,
|
|
23977
|
+
ce(p.value, LT);
|
|
23968
23978
|
}
|
|
23969
23979
|
function le() {
|
|
23970
|
-
ce(m.value,
|
|
23980
|
+
ce(m.value, IT);
|
|
23971
23981
|
}
|
|
23972
23982
|
function R() {
|
|
23973
23983
|
g.value && L(), _.value && le();
|
|
@@ -24025,7 +24035,7 @@ var LT = [
|
|
|
24025
24035
|
cx: "12",
|
|
24026
24036
|
cy: "12",
|
|
24027
24037
|
r: "3"
|
|
24028
|
-
})], -1)]], 8,
|
|
24038
|
+
})], -1)]], 8, RT), (E(), l(s, {
|
|
24029
24039
|
key: v.value,
|
|
24030
24040
|
to: O.value
|
|
24031
24041
|
}, [g.value ? (E(), d("div", {
|
|
@@ -24035,7 +24045,7 @@ var LT = [
|
|
|
24035
24045
|
ref_key: "menuRef",
|
|
24036
24046
|
ref: p,
|
|
24037
24047
|
class: b(N(zu))
|
|
24038
|
-
}, [h(
|
|
24048
|
+
}, [h(bw, {
|
|
24039
24049
|
"show-divider": k.value,
|
|
24040
24050
|
onColumnSettings: re,
|
|
24041
24051
|
onCustomAction: oe,
|
|
@@ -24053,7 +24063,7 @@ var LT = [
|
|
|
24053
24063
|
role: "dialog",
|
|
24054
24064
|
"aria-modal": "false",
|
|
24055
24065
|
"aria-label": "列设置面板"
|
|
24056
|
-
}, [h(
|
|
24066
|
+
}, [h(wT, {
|
|
24057
24067
|
"grid-api": e.gridApi,
|
|
24058
24068
|
open: _.value,
|
|
24059
24069
|
"show-visibility": e.showVisibility,
|
|
@@ -24066,7 +24076,7 @@ var LT = [
|
|
|
24066
24076
|
"show-filter"
|
|
24067
24077
|
])], 2)], 2)) : u("", !0)], 8, ["to"]))], 6));
|
|
24068
24078
|
}
|
|
24069
|
-
}),
|
|
24079
|
+
}), BT = {
|
|
24070
24080
|
input: {
|
|
24071
24081
|
deferEnterCommit: !1,
|
|
24072
24082
|
commitOnChange: !1
|
|
@@ -24076,8 +24086,8 @@ var LT = [
|
|
|
24076
24086
|
commitOnChange: !0
|
|
24077
24087
|
}
|
|
24078
24088
|
};
|
|
24079
|
-
function
|
|
24080
|
-
let n =
|
|
24089
|
+
function VT(e, t) {
|
|
24090
|
+
let n = BT[t.strategy ?? "input"], r = t.formatValue ?? ((e) => String(e ?? "")), i = t.commitOnChange ?? n.commitOnChange;
|
|
24081
24091
|
w(() => {
|
|
24082
24092
|
e.setGetValue?.(() => r(t.getValue())), e.setKeyboardPolicy?.({ deferEnterCommit: n.deferEnterCommit }), e.autoFocus !== !1 && t.onStart?.();
|
|
24083
24093
|
});
|
|
@@ -24107,6 +24117,6 @@ function BT(e, t) {
|
|
|
24107
24117
|
};
|
|
24108
24118
|
}
|
|
24109
24119
|
//#endregion
|
|
24110
|
-
export { Ee as BUILTIN_CELL_EDITOR_NAMES, Wi as COLUMN_DRAG_THRESHOLD_PX,
|
|
24120
|
+
export { Ee as BUILTIN_CELL_EDITOR_NAMES, Wi as COLUMN_DRAG_THRESHOLD_PX, zT as ColumnSettingsButton, pw as ColumnSettingsMenuIcon, gw as ColumnSettingsMenuItem, wT as ColumnSettingsPanel, co as DEFAULT_CELL_EDITOR_MODE, mt as DEFAULT_INDEX_COLUMN_START, Ct as DEFAULT_SELECTION_SELECT_ALL_LABEL, MC as DEFAULT_STATUS_BAR_RANGE_AGGREGATION_PRECISION, ft as INDEX_COLUMN_ID, pt as INDEX_COLUMN_MIN_WIDTH, Oe as INLINE_CHECKBOX_CLASS, uw as MagicGrid, Zl as RowMutationPersistError, St as SELECTION_COLUMN_DEFAULT_WIDTH, bt as SELECTION_COLUMN_ID, xt as SELECTION_COLUMN_MIN_WIDTH, Gi as SORT_AFTER_MOVE_GUARD_MS, YC as VueCellEditorHost, Fe as checkboxCellEditor, Ae as coerceCheckboxEditorValue, ZC as createSlotCellEditor, XC as createVueCellEditor, bC as evaluateGridAcceptance, je as formatCheckboxEditorRawValue, Be as getCellEditor, yC as getGridAcceptanceThresholds, vC as getGridSetDataLimit, He as getRegisteredCellEditorNames, Ve as hasCellEditor, De as isBuiltInCellEditor, fo as isInlineEditorColumn, ni as isSyntheticRow, Pe as numberCellEditor, Me as readCheckboxControlValue, Re as registerCellEditor, be as registerEditorSurfaceSelectors, xe as resetEditorSurfaceSelectors, lo as resolveCellEditorMode, uo as resolveColumnCellEditorMode, Ne as textCellEditor, ri as toBusinessRowId, ai as toBusinessRowIdFromInternal, oi as toBusinessRowIdsFromInternal, ub as toggleHeaderSort, ze as unregisterCellEditor, VT as useCellEditor };
|
|
24111
24121
|
|
|
24112
24122
|
//# sourceMappingURL=index.es.js.map
|