@taocompany/magic-grid 0.3.2 → 0.3.3
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.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 +332 -329
- 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
|
+
}
|
|
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);
|
|
18652
18655
|
}
|
|
18653
|
-
function
|
|
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();
|
|
@@ -18826,7 +18829,7 @@ var LS = class {
|
|
|
18826
18829
|
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
18830
|
}
|
|
18828
18831
|
syncScrollbarGutter() {
|
|
18829
|
-
|
|
18832
|
+
LS({
|
|
18830
18833
|
rootEl: this.deps.rootEl,
|
|
18831
18834
|
headerViewportEl: this.deps.headerViewportEl,
|
|
18832
18835
|
footerViewportEl: this.deps.footerViewportEl,
|
|
@@ -18835,10 +18838,10 @@ var LS = class {
|
|
|
18835
18838
|
}, this.deps.viewportEl, this.getOverlayScrollbars());
|
|
18836
18839
|
}
|
|
18837
18840
|
getOverlayScrollbars() {
|
|
18838
|
-
return this.overlayScrollbars === null && (this.overlayScrollbars =
|
|
18841
|
+
return this.overlayScrollbars === null && (this.overlayScrollbars = FS()), this.overlayScrollbars;
|
|
18839
18842
|
}
|
|
18840
18843
|
handleViewportResize() {
|
|
18841
|
-
this.deps.isDestroyed() || (
|
|
18844
|
+
this.deps.isDestroyed() || (PS(), this.overlayScrollbars = null, this.syncViewportHeight());
|
|
18842
18845
|
}
|
|
18843
18846
|
syncHeaderFooterRowWidth() {
|
|
18844
18847
|
let e = this.deps.columnModel.getTotalWidth();
|
|
@@ -18916,24 +18919,24 @@ var LS = class {
|
|
|
18916
18919
|
e.hidden = !0;
|
|
18917
18920
|
return;
|
|
18918
18921
|
}
|
|
18919
|
-
let r = this.deps.rowModel.getRowCount(), i = this.deps.rowModel.getTotalHeight(), a = this.getViewportHeight(), o = this.getLogicalScrollTop(),
|
|
18920
|
-
if (r === 0 ||
|
|
18922
|
+
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));
|
|
18923
|
+
if (r === 0 || c <= 0) {
|
|
18921
18924
|
e.hidden = !0;
|
|
18922
18925
|
return;
|
|
18923
18926
|
}
|
|
18924
|
-
let
|
|
18925
|
-
e.hidden = !1, t.style.top = `${
|
|
18927
|
+
let l = this.getScrollRange(a).compressed ? i - s : i;
|
|
18928
|
+
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
18929
|
}
|
|
18927
18930
|
getScrollRange(e) {
|
|
18928
18931
|
let t = e ?? this.getViewportHeight();
|
|
18929
|
-
return
|
|
18932
|
+
return OS(this.deps.rowModel.getTotalHeight(), t, this.deps.getDefaultRowHeight(), this.deps.rowModel.getRowCount());
|
|
18930
18933
|
}
|
|
18931
18934
|
resolveLogicalScrollTopForSync() {
|
|
18932
18935
|
return Math.max(this.getLogicalScrollTop(), this.deps.scrollBridge.getNextScrollTop(), this.deps.scrollBridge.getScrollTop());
|
|
18933
18936
|
}
|
|
18934
18937
|
applyPhysicalScrollFromLogical(e) {
|
|
18935
18938
|
let t = this.getScrollRange();
|
|
18936
|
-
this.deps.viewportEl.scrollTop =
|
|
18939
|
+
this.deps.viewportEl.scrollTop = AS(e, t);
|
|
18937
18940
|
}
|
|
18938
18941
|
syncScrollMode(e) {
|
|
18939
18942
|
let t = e ?? this.getViewportHeight(), n = this.getScrollRange(t).compressed;
|
|
@@ -18942,7 +18945,7 @@ var LS = class {
|
|
|
18942
18945
|
};
|
|
18943
18946
|
//#endregion
|
|
18944
18947
|
//#region src/core/column/columnSettingsOrderReset.ts
|
|
18945
|
-
function
|
|
18948
|
+
function zS(e) {
|
|
18946
18949
|
let t = [
|
|
18947
18950
|
"left",
|
|
18948
18951
|
"center",
|
|
@@ -18954,10 +18957,10 @@ function RS(e) {
|
|
|
18954
18957
|
}
|
|
18955
18958
|
return n;
|
|
18956
18959
|
}
|
|
18957
|
-
function
|
|
18960
|
+
function BS(e, t) {
|
|
18958
18961
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
18959
18962
|
}
|
|
18960
|
-
function
|
|
18963
|
+
function VS(e, t) {
|
|
18961
18964
|
for (let n = 0; n < t.length; n += 1) {
|
|
18962
18965
|
let r = t[n];
|
|
18963
18966
|
if (!(!r || e[n] === r)) return {
|
|
@@ -18969,7 +18972,7 @@ function BS(e, t) {
|
|
|
18969
18972
|
}
|
|
18970
18973
|
//#endregion
|
|
18971
18974
|
//#region src/core/grid/gridColumnLayout.ts
|
|
18972
|
-
var
|
|
18975
|
+
var HS = class {
|
|
18973
18976
|
deps;
|
|
18974
18977
|
columnMoveOptions;
|
|
18975
18978
|
columnResizeOptions;
|
|
@@ -19093,10 +19096,10 @@ var VS = class {
|
|
|
19093
19096
|
return i !== o && (c.toFixed = o), this.deps.eventBus.emit("columnMoved", c), n && this.deps.clearCellSelection?.(), !0;
|
|
19094
19097
|
}
|
|
19095
19098
|
resetColumnOrder() {
|
|
19096
|
-
let e = this.deps.columnModel.getColumns(), t = e.map((e) => e.colId), n =
|
|
19097
|
-
if (
|
|
19099
|
+
let e = this.deps.columnModel.getColumns(), t = e.map((e) => e.colId), n = zS(e);
|
|
19100
|
+
if (BS(t, n) || !this.deps.columnModel.resetColumnsOrder(n)) return !1;
|
|
19098
19101
|
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 =
|
|
19102
|
+
let r = VS(t, n);
|
|
19100
19103
|
return this.deps.eventBus.emit("columnMoved", {
|
|
19101
19104
|
columnOrder: n,
|
|
19102
19105
|
fromColId: r?.fromColId ?? n[0] ?? "",
|
|
@@ -19140,7 +19143,7 @@ var VS = class {
|
|
|
19140
19143
|
syncColumnMovePresentationClasses() {
|
|
19141
19144
|
this.deps.rootEl.classList.toggle("magic-grid--suppress-column-move-animation", this.columnMoveOptions.suppressColumnMoveAnimation);
|
|
19142
19145
|
}
|
|
19143
|
-
},
|
|
19146
|
+
}, US = class {
|
|
19144
19147
|
deps;
|
|
19145
19148
|
constructor(e) {
|
|
19146
19149
|
this.deps = e;
|
|
@@ -19210,48 +19213,48 @@ var VS = class {
|
|
|
19210
19213
|
};
|
|
19211
19214
|
//#endregion
|
|
19212
19215
|
//#region src/core/selection/treeSelectionCascade.ts
|
|
19213
|
-
function
|
|
19216
|
+
function WS(e) {
|
|
19214
19217
|
return e.rowKind == null || e.rowKind === "data";
|
|
19215
19218
|
}
|
|
19216
|
-
function
|
|
19219
|
+
function GS(e, t) {
|
|
19217
19220
|
let n = e[t];
|
|
19218
19221
|
if (!n || !G(n)) return [];
|
|
19219
19222
|
let r = n.treeLevel ?? 0, i = [];
|
|
19220
19223
|
for (let n = t + 1; n < e.length; n += 1) {
|
|
19221
19224
|
let t = e[n];
|
|
19222
19225
|
if ((t.treeLevel ?? 0) <= r) break;
|
|
19223
|
-
|
|
19226
|
+
WS(t) && i.push(t.id);
|
|
19224
19227
|
}
|
|
19225
19228
|
return i;
|
|
19226
19229
|
}
|
|
19227
|
-
function
|
|
19230
|
+
function KS(e, t) {
|
|
19228
19231
|
let n = e.findIndex((e) => e.id === t);
|
|
19229
19232
|
if (n < 0) return [];
|
|
19230
19233
|
let r = e[n].treeLevel ?? 0, i = [];
|
|
19231
19234
|
for (let t = n + 1; t < e.length; t += 1) {
|
|
19232
19235
|
let n = e[t], a = n.treeLevel ?? 0;
|
|
19233
19236
|
if (a <= r) break;
|
|
19234
|
-
a === r + 1 &&
|
|
19237
|
+
a === r + 1 && WS(n) && i.push(n.id);
|
|
19235
19238
|
}
|
|
19236
19239
|
return i;
|
|
19237
19240
|
}
|
|
19238
|
-
function
|
|
19241
|
+
function qS(e, t) {
|
|
19239
19242
|
let n = /* @__PURE__ */ new Set();
|
|
19240
19243
|
for (let r = 0; r < e.length; r += 1) {
|
|
19241
19244
|
let i = e[r];
|
|
19242
19245
|
if (!G(i) || i.treeLeaf === !0) continue;
|
|
19243
|
-
let a =
|
|
19246
|
+
let a = KS(e, i.id);
|
|
19244
19247
|
if (a.length === 0) continue;
|
|
19245
19248
|
let o = a.filter((e) => t.has(e)).length;
|
|
19246
19249
|
o !== 0 && (o < a.length || !t.has(i.id)) && n.add(i.id);
|
|
19247
19250
|
}
|
|
19248
19251
|
return n;
|
|
19249
19252
|
}
|
|
19250
|
-
function
|
|
19253
|
+
function JS(e) {
|
|
19251
19254
|
if (!e.groupSelectsChildren) return !1;
|
|
19252
19255
|
let t = e.displayRows.findIndex((t) => t.id === e.rowId);
|
|
19253
19256
|
if (t < 0) return !1;
|
|
19254
|
-
let n = !1, r =
|
|
19257
|
+
let n = !1, r = GS(e.displayRows, t);
|
|
19255
19258
|
for (let t of r) {
|
|
19256
19259
|
if (e.selected) {
|
|
19257
19260
|
e.selectedIds.has(t) || (e.selectedIds.add(t), n = !0);
|
|
@@ -19261,12 +19264,12 @@ function qS(e) {
|
|
|
19261
19264
|
}
|
|
19262
19265
|
return n;
|
|
19263
19266
|
}
|
|
19264
|
-
function
|
|
19267
|
+
function YS(e, t) {
|
|
19265
19268
|
let n = !1;
|
|
19266
19269
|
for (let r = e.length - 1; r >= 0; --r) {
|
|
19267
19270
|
let i = e[r];
|
|
19268
19271
|
if (!G(i) || i.treeLeaf === !0) continue;
|
|
19269
|
-
let a =
|
|
19272
|
+
let a = KS(e, i.id);
|
|
19270
19273
|
if (a.length === 0) continue;
|
|
19271
19274
|
let o = a.filter((e) => t.has(e)).length, s = o === a.length, c = t.has(i.id);
|
|
19272
19275
|
if (s && !c) {
|
|
@@ -19279,7 +19282,7 @@ function JS(e, t) {
|
|
|
19279
19282
|
}
|
|
19280
19283
|
//#endregion
|
|
19281
19284
|
//#region src/core/grid/gridSelection.ts
|
|
19282
|
-
var
|
|
19285
|
+
var XS = class {
|
|
19283
19286
|
deps;
|
|
19284
19287
|
selectableFn;
|
|
19285
19288
|
reserveSelection;
|
|
@@ -19326,14 +19329,14 @@ var YS = class {
|
|
|
19326
19329
|
syncTreeSelectionCascade(e) {
|
|
19327
19330
|
if (!this.deps.selectionService || !this.deps.isTreeActive?.() || !this.deps.groupSelectsChildren?.()) return;
|
|
19328
19331
|
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)
|
|
19332
|
+
for (let { rowId: e } of r) JS({
|
|
19330
19333
|
displayRows: t,
|
|
19331
19334
|
rowId: e,
|
|
19332
19335
|
selected: n.has(e),
|
|
19333
19336
|
groupSelectsChildren: !0,
|
|
19334
19337
|
selectedIds: n
|
|
19335
19338
|
});
|
|
19336
|
-
|
|
19339
|
+
YS(t, n), this.deps.selectionService.replaceWithRowIds([...n], r.length > 0 ? r[r.length - 1].rowIndex : -1);
|
|
19337
19340
|
}
|
|
19338
19341
|
setIndexFocus(e) {
|
|
19339
19342
|
if (!this.deps.indexFocusService) return;
|
|
@@ -19360,7 +19363,7 @@ var YS = class {
|
|
|
19360
19363
|
}
|
|
19361
19364
|
applySelectionVisuals() {
|
|
19362
19365
|
if (!this.deps.selectionService) return;
|
|
19363
|
-
let e = new Set(this.deps.selectionService.getSelectedRowIds()), t = this.deps.isTreeActive?.() ?
|
|
19366
|
+
let e = new Set(this.deps.selectionService.getSelectedRowIds()), t = this.deps.isTreeActive?.() ? qS(this.deps.rowModel.rowsToDisplay, e) : /* @__PURE__ */ new Set();
|
|
19364
19367
|
this.deps.rowRenderer.refreshSelection(e, t), sp(this.deps.mountEl, {
|
|
19365
19368
|
selectionColumnOptions: this.deps.selectionColumnOptions,
|
|
19366
19369
|
selectedIds: e,
|
|
@@ -19411,23 +19414,23 @@ var YS = class {
|
|
|
19411
19414
|
};
|
|
19412
19415
|
//#endregion
|
|
19413
19416
|
//#region src/core/rowModel/rowDataExport.ts
|
|
19414
|
-
function
|
|
19417
|
+
function ZS(e, t) {
|
|
19415
19418
|
let n = { ...e.data };
|
|
19416
19419
|
return e.isTransient && (n[t] = null), n;
|
|
19417
19420
|
}
|
|
19418
|
-
function
|
|
19419
|
-
return e.map((e) =>
|
|
19421
|
+
function QS(e, t) {
|
|
19422
|
+
return e.map((e) => ZS(e, t));
|
|
19420
19423
|
}
|
|
19421
19424
|
//#endregion
|
|
19422
19425
|
//#region src/core/rowMutation/rowMutationService.ts
|
|
19423
|
-
function
|
|
19426
|
+
function $S(e, t) {
|
|
19424
19427
|
let n = e.indexMode ?? "source", r = mh(e.index, n, t);
|
|
19425
19428
|
return { add: e.rows.map((e, t) => ({
|
|
19426
19429
|
data: e.data,
|
|
19427
19430
|
index: r === void 0 ? void 0 : r + t
|
|
19428
19431
|
})) };
|
|
19429
19432
|
}
|
|
19430
|
-
function
|
|
19433
|
+
function eC(e, t) {
|
|
19431
19434
|
let n = new Set(Xl(e.rowIds) ?? []);
|
|
19432
19435
|
if (e.indexes?.length) {
|
|
19433
19436
|
let r = e.indexMode ?? "source";
|
|
@@ -19435,35 +19438,35 @@ function $S(e, t) {
|
|
|
19435
19438
|
}
|
|
19436
19439
|
return n.size === 0 ? {} : { remove: [...n] };
|
|
19437
19440
|
}
|
|
19438
|
-
function
|
|
19441
|
+
function tC(e) {
|
|
19439
19442
|
return e.remove?.length ? e.remove.filter((e) => typeof e == "string") : [];
|
|
19440
19443
|
}
|
|
19441
19444
|
//#endregion
|
|
19442
19445
|
//#region src/core/rowMutation/rowMutationEvents.ts
|
|
19443
|
-
function
|
|
19446
|
+
function nC(e, t, n) {
|
|
19444
19447
|
return { rows: e.map((e) => ({
|
|
19445
19448
|
rowId: e.id,
|
|
19446
19449
|
rowIndex: n(e.id),
|
|
19447
|
-
data:
|
|
19450
|
+
data: ZS(e, t),
|
|
19448
19451
|
isTransient: e.isTransient ?? !1
|
|
19449
19452
|
})) };
|
|
19450
19453
|
}
|
|
19451
|
-
function
|
|
19454
|
+
function rC(e, t) {
|
|
19452
19455
|
return { rows: e.map((e) => ({
|
|
19453
19456
|
rowId: e.id,
|
|
19454
|
-
data:
|
|
19457
|
+
data: ZS(e, t)
|
|
19455
19458
|
})) };
|
|
19456
19459
|
}
|
|
19457
|
-
function
|
|
19460
|
+
function iC(e, t, n) {
|
|
19458
19461
|
return {
|
|
19459
19462
|
oldRowId: e,
|
|
19460
19463
|
newRowId: t.id,
|
|
19461
|
-
data:
|
|
19464
|
+
data: ZS(t, n)
|
|
19462
19465
|
};
|
|
19463
19466
|
}
|
|
19464
19467
|
//#endregion
|
|
19465
19468
|
//#region src/core/rowMutation/asyncRowMutation.ts
|
|
19466
|
-
function
|
|
19469
|
+
function aC(e, t) {
|
|
19467
19470
|
return e.remove?.length ? e.remove.map((e) => {
|
|
19468
19471
|
if (typeof e == "string") return e;
|
|
19469
19472
|
let n = e[t];
|
|
@@ -19471,11 +19474,11 @@ function iC(e, t) {
|
|
|
19471
19474
|
return String(n);
|
|
19472
19475
|
}) : [];
|
|
19473
19476
|
}
|
|
19474
|
-
function
|
|
19477
|
+
function oC(e, t, n, r) {
|
|
19475
19478
|
let i = e[t];
|
|
19476
19479
|
return i == null ? r?.find((t) => t.data === e && t.isTransient) : n(String(i));
|
|
19477
19480
|
}
|
|
19478
|
-
function
|
|
19481
|
+
function sC(e, t, n) {
|
|
19479
19482
|
return !e.add?.length || !n?.rows?.length ? e : {
|
|
19480
19483
|
...e,
|
|
19481
19484
|
add: e.add.map((e, r) => {
|
|
@@ -19492,26 +19495,26 @@ function oC(e, t, n) {
|
|
|
19492
19495
|
})
|
|
19493
19496
|
};
|
|
19494
19497
|
}
|
|
19495
|
-
async function
|
|
19498
|
+
async function cC(e, t) {
|
|
19496
19499
|
try {
|
|
19497
19500
|
return await t();
|
|
19498
19501
|
} catch (t) {
|
|
19499
19502
|
throw t instanceof Zl ? t : new Zl(`${e} persist failed`, t);
|
|
19500
19503
|
}
|
|
19501
19504
|
}
|
|
19502
|
-
async function
|
|
19505
|
+
async function lC(e, t) {
|
|
19503
19506
|
let { handlers: n, rowKey: r, getRowById: i, sourceRows: a, signal: o = new AbortController().signal } = t;
|
|
19504
19507
|
if (!n?.add && !n?.update && !n?.remove) return e;
|
|
19505
19508
|
let s = e;
|
|
19506
19509
|
if (n.remove && e.remove?.length) {
|
|
19507
|
-
let t =
|
|
19510
|
+
let t = aC(e, r), a = t.map((e) => {
|
|
19508
19511
|
let t = i(e);
|
|
19509
19512
|
return {
|
|
19510
19513
|
rowId: e,
|
|
19511
19514
|
data: t ? { ...t.data } : {}
|
|
19512
19515
|
};
|
|
19513
19516
|
});
|
|
19514
|
-
await
|
|
19517
|
+
await cC("remove", () => n.remove({
|
|
19515
19518
|
rowIds: t,
|
|
19516
19519
|
rows: a,
|
|
19517
19520
|
signal: o
|
|
@@ -19519,32 +19522,32 @@ async function cC(e, t) {
|
|
|
19519
19522
|
}
|
|
19520
19523
|
if (n.update && e.update?.length) {
|
|
19521
19524
|
let t = e.update.map((e) => {
|
|
19522
|
-
let t =
|
|
19525
|
+
let t = oC(e, r, i, a);
|
|
19523
19526
|
if (!t) throw new Zl(`Update target row not found for rowKey "${r}"`);
|
|
19524
19527
|
return {
|
|
19525
19528
|
rowId: t.id,
|
|
19526
19529
|
data: e
|
|
19527
19530
|
};
|
|
19528
19531
|
});
|
|
19529
|
-
await
|
|
19532
|
+
await cC("update", () => n.update({
|
|
19530
19533
|
rows: t,
|
|
19531
19534
|
signal: o
|
|
19532
19535
|
}));
|
|
19533
19536
|
}
|
|
19534
19537
|
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
|
|
19538
|
+
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
19539
|
rows: t,
|
|
19537
19540
|
index: a,
|
|
19538
19541
|
indexMode: c,
|
|
19539
19542
|
signal: o
|
|
19540
19543
|
}));
|
|
19541
|
-
s =
|
|
19544
|
+
s = sC(s, r, l);
|
|
19542
19545
|
}
|
|
19543
19546
|
return s;
|
|
19544
19547
|
}
|
|
19545
19548
|
//#endregion
|
|
19546
19549
|
//#region src/core/grid/gridRowMutation.ts
|
|
19547
|
-
var
|
|
19550
|
+
var uC = class {
|
|
19548
19551
|
deps;
|
|
19549
19552
|
pendingTransaction = null;
|
|
19550
19553
|
rowMoveService;
|
|
@@ -19564,12 +19567,12 @@ var lC = class {
|
|
|
19564
19567
|
});
|
|
19565
19568
|
}
|
|
19566
19569
|
async applyTransaction(e) {
|
|
19567
|
-
let t = await
|
|
19570
|
+
let t = await lC(e, {
|
|
19568
19571
|
rowKey: this.deps.rowKey,
|
|
19569
19572
|
handlers: this.deps.asyncRowMutation,
|
|
19570
19573
|
getRowById: (e) => this.deps.rowModel.getRowById(e),
|
|
19571
19574
|
sourceRows: this.deps.rowModel.getSourceRows()
|
|
19572
|
-
}), n =
|
|
19575
|
+
}), n = tC(t);
|
|
19573
19576
|
if (n.length > 0) {
|
|
19574
19577
|
this.prepareRemoveRows(new Set(n));
|
|
19575
19578
|
let e = this.commitTransaction(t);
|
|
@@ -19582,15 +19585,15 @@ var lC = class {
|
|
|
19582
19585
|
return this.deps.viewport.syncViewportHeight(), this.queueTransactionFlush(t), t;
|
|
19583
19586
|
}
|
|
19584
19587
|
async addRows(e) {
|
|
19585
|
-
let t =
|
|
19588
|
+
let t = $S(e, this.createRowIndexContext());
|
|
19586
19589
|
return this.applyTransaction(t);
|
|
19587
19590
|
}
|
|
19588
19591
|
async removeRows(e) {
|
|
19589
|
-
let t =
|
|
19592
|
+
let t = eC(e.rowIds ? {
|
|
19590
19593
|
...e,
|
|
19591
19594
|
rowIds: Xl(e.rowIds)
|
|
19592
19595
|
} : e, this.createRowIndexContext());
|
|
19593
|
-
return
|
|
19596
|
+
return tC(t).length === 0 ? {
|
|
19594
19597
|
add: [],
|
|
19595
19598
|
remove: [],
|
|
19596
19599
|
update: []
|
|
@@ -19638,7 +19641,7 @@ var lC = class {
|
|
|
19638
19641
|
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
19642
|
}
|
|
19640
19643
|
getData(e) {
|
|
19641
|
-
return
|
|
19644
|
+
return QS(e?.sourceOrder === !1 ? this.deps.rowModel.rowsToDisplay : this.deps.rowModel.getSourceRows(), this.deps.rowModel.getRowKey());
|
|
19642
19645
|
}
|
|
19643
19646
|
promoteRowId(e) {
|
|
19644
19647
|
let t = X(e.rowId), { businessId: n } = e;
|
|
@@ -19650,7 +19653,7 @@ var lC = class {
|
|
|
19650
19653
|
if (!r.ok) return r;
|
|
19651
19654
|
this.finalizePromoteRowId(t, r.rowId);
|
|
19652
19655
|
let i = this.deps.rowModel.getRowById(r.rowId);
|
|
19653
|
-
return i && this.deps.eventBus.emit("rowIdPromoted",
|
|
19656
|
+
return i && this.deps.eventBus.emit("rowIdPromoted", iC(t, i, this.deps.rowModel.getRowKey())), {
|
|
19654
19657
|
ok: !0,
|
|
19655
19658
|
rowId: ai(r.rowId, {
|
|
19656
19659
|
rowKey: this.deps.rowModel.getRowKey(),
|
|
@@ -19723,9 +19726,9 @@ var lC = class {
|
|
|
19723
19726
|
}
|
|
19724
19727
|
emitRowMutationEvents(e) {
|
|
19725
19728
|
let t = this.deps.rowModel.getRowKey();
|
|
19726
|
-
e.add.length > 0 && this.deps.eventBus.emit("rowsAdded",
|
|
19729
|
+
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
19730
|
}
|
|
19728
|
-
},
|
|
19731
|
+
}, dC = class {
|
|
19729
19732
|
deps;
|
|
19730
19733
|
constructor(e) {
|
|
19731
19734
|
this.deps = e;
|
|
@@ -19748,19 +19751,19 @@ var lC = class {
|
|
|
19748
19751
|
};
|
|
19749
19752
|
//#endregion
|
|
19750
19753
|
//#region src/core/grid/gridValidationNormalize.ts
|
|
19751
|
-
function
|
|
19754
|
+
function fC(e) {
|
|
19752
19755
|
return e?.rowIds ? {
|
|
19753
19756
|
...e,
|
|
19754
19757
|
rowIds: Xl(e.rowIds)
|
|
19755
19758
|
} : e;
|
|
19756
19759
|
}
|
|
19757
|
-
function
|
|
19760
|
+
function pC(e) {
|
|
19758
19761
|
return {
|
|
19759
19762
|
...e,
|
|
19760
19763
|
rowIds: Xl(e.rowIds)
|
|
19761
19764
|
};
|
|
19762
19765
|
}
|
|
19763
|
-
function
|
|
19766
|
+
function mC(e) {
|
|
19764
19767
|
return {
|
|
19765
19768
|
...e,
|
|
19766
19769
|
cells: e.cells.map((e) => ({
|
|
@@ -19769,19 +19772,19 @@ function pC(e) {
|
|
|
19769
19772
|
}))
|
|
19770
19773
|
};
|
|
19771
19774
|
}
|
|
19772
|
-
function
|
|
19775
|
+
function hC(e) {
|
|
19773
19776
|
return e?.rowIds ? {
|
|
19774
19777
|
...e,
|
|
19775
19778
|
rowIds: Xl(e.rowIds)
|
|
19776
19779
|
} : e;
|
|
19777
19780
|
}
|
|
19778
|
-
function
|
|
19781
|
+
function gC(e) {
|
|
19779
19782
|
return {
|
|
19780
19783
|
...e,
|
|
19781
19784
|
rowIds: Xl(e.rowIds)
|
|
19782
19785
|
};
|
|
19783
19786
|
}
|
|
19784
|
-
function
|
|
19787
|
+
function _C(e) {
|
|
19785
19788
|
return {
|
|
19786
19789
|
...e,
|
|
19787
19790
|
cells: e.cells.map((e) => ({
|
|
@@ -19792,17 +19795,17 @@ function gC(e) {
|
|
|
19792
19795
|
}
|
|
19793
19796
|
//#endregion
|
|
19794
19797
|
//#region src/core/grid/gridMetrics.ts
|
|
19795
|
-
function
|
|
19798
|
+
function vC(e) {
|
|
19796
19799
|
return e >= 1e6 ? 2e3 : e >= 1e5 ? 500 : e >= 1e4 ? 200 : e >= 1e3 ? 100 : 50;
|
|
19797
19800
|
}
|
|
19798
|
-
function
|
|
19801
|
+
function yC(e) {
|
|
19799
19802
|
return {
|
|
19800
19803
|
maxDomRows: 80,
|
|
19801
|
-
maxSetDataMs:
|
|
19804
|
+
maxSetDataMs: vC(e)
|
|
19802
19805
|
};
|
|
19803
19806
|
}
|
|
19804
|
-
function
|
|
19805
|
-
let n =
|
|
19807
|
+
function bC(e, t) {
|
|
19808
|
+
let n = yC(t), r = e.activeDomRowCount <= n.maxDomRows, i = e.lastSetDataMs <= n.maxSetDataMs;
|
|
19806
19809
|
return {
|
|
19807
19810
|
domRowsPass: r,
|
|
19808
19811
|
setDataPass: i,
|
|
@@ -19811,7 +19814,7 @@ function yC(e, t) {
|
|
|
19811
19814
|
}
|
|
19812
19815
|
//#endregion
|
|
19813
19816
|
//#region src/core/grid/grid.ts
|
|
19814
|
-
var
|
|
19817
|
+
var xC = class {
|
|
19815
19818
|
mountEl;
|
|
19816
19819
|
rowModel;
|
|
19817
19820
|
rowRenderer;
|
|
@@ -20097,7 +20100,7 @@ var bC = class {
|
|
|
20097
20100
|
resolveBusinessRowId: (e) => ri(e, t.rowKey),
|
|
20098
20101
|
getCellDisableContext: () => this.getCellDisableContext(),
|
|
20099
20102
|
getCellStyleContext: () => this.getCellStyleContext()
|
|
20100
|
-
}), this.selectionOps = new
|
|
20103
|
+
}), this.selectionOps = new XS({
|
|
20101
20104
|
mountEl: this.mountEl,
|
|
20102
20105
|
rowModel: this.rowModel,
|
|
20103
20106
|
rowRenderer: this.rowRenderer,
|
|
@@ -20138,7 +20141,7 @@ var bC = class {
|
|
|
20138
20141
|
data: e.data,
|
|
20139
20142
|
masterRowId: e.masterRowId ?? e.id
|
|
20140
20143
|
})
|
|
20141
|
-
}) : null, this.rowRenderer.setDetailRowAutoHeightService(this.detailRowAutoHeightService), this.gridFooter = new
|
|
20144
|
+
}) : null, this.rowRenderer.setDetailRowAutoHeightService(this.detailRowAutoHeightService), this.gridFooter = new dC({
|
|
20142
20145
|
columnModel: this.columnModel,
|
|
20143
20146
|
columnViewport: this.columnViewport,
|
|
20144
20147
|
rowModel: this.rowModel,
|
|
@@ -20146,7 +20149,7 @@ var bC = class {
|
|
|
20146
20149
|
valueCache: this.valueCache,
|
|
20147
20150
|
summaryOptions: this.summaryOptions,
|
|
20148
20151
|
getFooterRenderer: () => this.footerRenderer
|
|
20149
|
-
}), this.filterOps = new
|
|
20152
|
+
}), this.filterOps = new US({
|
|
20150
20153
|
rowModel: this.rowModel,
|
|
20151
20154
|
columnModel: this.columnModel,
|
|
20152
20155
|
columnViewport: this.columnViewport,
|
|
@@ -20160,7 +20163,7 @@ var bC = class {
|
|
|
20160
20163
|
refreshCellSpans: () => this.refreshCellSpanCache(),
|
|
20161
20164
|
clearCellSelection: () => this.clearCellSelectionOnStructuralChange(),
|
|
20162
20165
|
refreshOverlay: () => this.syncEmptyStateOverlay()
|
|
20163
|
-
}), this.viewport = new
|
|
20166
|
+
}), this.viewport = new RS({
|
|
20164
20167
|
rootEl: p.rootEl,
|
|
20165
20168
|
headerViewportEl: p.headerViewportEl,
|
|
20166
20169
|
headerScrollEl: p.headerScrollEl,
|
|
@@ -20252,7 +20255,7 @@ var bC = class {
|
|
|
20252
20255
|
});
|
|
20253
20256
|
this.inlineCellEditorService = m, this.rowRenderer.setInlineCellEditorContext(m.getRefreshContext()), this.columnFlexService = new Xo(this.columnModel), this.columnResizeService = new Qo(this.columnModel, () => {
|
|
20254
20257
|
this.columnLayout.syncColumnLayoutAfterResize();
|
|
20255
|
-
}, this.columnFlexService, () => this.getCenterViewportWidth()), this.columnAutosizeService = new Vo(this.mountEl, this.columnModel, a), this.columnLayout = new
|
|
20258
|
+
}, this.columnFlexService, () => this.getCenterViewportWidth()), this.columnAutosizeService = new Vo(this.mountEl, this.columnModel, a), this.columnLayout = new HS({
|
|
20256
20259
|
mountEl: this.mountEl,
|
|
20257
20260
|
rootEl: this.rootEl,
|
|
20258
20261
|
columnModel: this.columnModel,
|
|
@@ -20473,7 +20476,7 @@ var bC = class {
|
|
|
20473
20476
|
copyCellSelectionToClipboard: () => this.cellClipboardService?.copySelectedRanges() ?? !1,
|
|
20474
20477
|
pasteCellSelectionFromClipboard: () => this.pasteFromClipboard(),
|
|
20475
20478
|
isPointerOverCellCommentIndicator: (e, t, n) => xg(e, t, n)
|
|
20476
|
-
}), this.rowMutation = new
|
|
20479
|
+
}), this.rowMutation = new uC({
|
|
20477
20480
|
rowKey: t.rowKey,
|
|
20478
20481
|
asyncRowMutation: this.asyncRowMutation,
|
|
20479
20482
|
rowModel: this.rowModel,
|
|
@@ -21364,22 +21367,22 @@ var bC = class {
|
|
|
21364
21367
|
}));
|
|
21365
21368
|
}
|
|
21366
21369
|
validate(e) {
|
|
21367
|
-
return this.cellEditing.validate(
|
|
21370
|
+
return this.cellEditing.validate(fC(e)).then((e) => ci(e, this.businessRowIdCtx));
|
|
21368
21371
|
}
|
|
21369
21372
|
validateRows(e) {
|
|
21370
|
-
return this.cellEditing.validateRows(
|
|
21373
|
+
return this.cellEditing.validateRows(pC(e)).then((e) => ci(e, this.businessRowIdCtx));
|
|
21371
21374
|
}
|
|
21372
21375
|
validateCells(e) {
|
|
21373
|
-
return this.cellEditing.validateCells(
|
|
21376
|
+
return this.cellEditing.validateCells(mC(e)).then((e) => ci(e, this.businessRowIdCtx));
|
|
21374
21377
|
}
|
|
21375
21378
|
clearValidation(e) {
|
|
21376
|
-
this.cellEditing.clearValidation(
|
|
21379
|
+
this.cellEditing.clearValidation(hC(e));
|
|
21377
21380
|
}
|
|
21378
21381
|
clearRowValidation(e) {
|
|
21379
|
-
this.cellEditing.clearRowValidation(
|
|
21382
|
+
this.cellEditing.clearRowValidation(gC(e));
|
|
21380
21383
|
}
|
|
21381
21384
|
clearCellValidation(e) {
|
|
21382
|
-
this.cellEditing.clearCellValidation(
|
|
21385
|
+
this.cellEditing.clearCellValidation(_C(e));
|
|
21383
21386
|
}
|
|
21384
21387
|
registerCellEditor(e, t) {
|
|
21385
21388
|
this.cellEditing.registerCellEditor(e, t);
|
|
@@ -21403,7 +21406,7 @@ var bC = class {
|
|
|
21403
21406
|
isEditingTargetRow(e) {
|
|
21404
21407
|
return this.cellEditing.getEditingCell()?.rowId === e || this.cellEditing.getEditingCells().some((t) => t.rowId === e);
|
|
21405
21408
|
}
|
|
21406
|
-
},
|
|
21409
|
+
}, SC = {
|
|
21407
21410
|
"--mg-color-bg": "#141414",
|
|
21408
21411
|
"--mg-color-text-primary": "#e8e8e8",
|
|
21409
21412
|
"--mg-color-text-regular": "#e0e0e0",
|
|
@@ -21418,7 +21421,7 @@ var bC = class {
|
|
|
21418
21421
|
"--mg-fixed-shadow-left": "4px 0 8px -2px rgba(0, 0, 0, 0.45)",
|
|
21419
21422
|
"--mg-fixed-shadow-right": "-4px 0 8px -2px rgba(0, 0, 0, 0.45)",
|
|
21420
21423
|
"--mg-column-handle-menu-shadow": "0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4)"
|
|
21421
|
-
},
|
|
21424
|
+
}, CC = {
|
|
21422
21425
|
"--mg-color-bg-cell": "#ffffff",
|
|
21423
21426
|
"--mg-color-bg-stripe": "#f5f7fa",
|
|
21424
21427
|
"--mg-color-text-primary": "#333333",
|
|
@@ -21429,28 +21432,28 @@ var bC = class {
|
|
|
21429
21432
|
"--mg-fixed-shadow-left": "4px 0 8px -2px rgba(0, 0, 0, 0.12)",
|
|
21430
21433
|
"--mg-fixed-shadow-right": "-4px 0 8px -2px rgba(0, 0, 0, 0.12)"
|
|
21431
21434
|
};
|
|
21432
|
-
function CC(e) {
|
|
21433
|
-
return e ?? "light";
|
|
21434
|
-
}
|
|
21435
21435
|
function wC(e) {
|
|
21436
|
-
return
|
|
21436
|
+
return e ?? "light";
|
|
21437
21437
|
}
|
|
21438
21438
|
function TC(e) {
|
|
21439
|
-
return e
|
|
21439
|
+
return `magic-grid--theme-${e}`;
|
|
21440
21440
|
}
|
|
21441
21441
|
function EC(e) {
|
|
21442
21442
|
return e === "dark" ? { ...SC } : {};
|
|
21443
21443
|
}
|
|
21444
|
-
|
|
21445
|
-
|
|
21444
|
+
function DC(e) {
|
|
21445
|
+
return e === "dark" ? { ...CC } : {};
|
|
21446
|
+
}
|
|
21447
|
+
var OC = Object.keys(CC);
|
|
21448
|
+
function kC(e, t) {
|
|
21446
21449
|
if (!e) return;
|
|
21447
|
-
for (let t of
|
|
21448
|
-
let n =
|
|
21450
|
+
for (let t of OC) e.style.removeProperty(t);
|
|
21451
|
+
let n = DC(t);
|
|
21449
21452
|
for (let [t, r] of Object.entries(n)) e.style.setProperty(t, r);
|
|
21450
21453
|
}
|
|
21451
21454
|
//#endregion
|
|
21452
21455
|
//#region src/components/StatusBar/StatusBarDefaultPanels.vue?vue&type=script&setup=true&lang.ts
|
|
21453
|
-
var
|
|
21456
|
+
var AC = { class: "mg-status-bar__panels" }, jC = /* @__PURE__ */ g({
|
|
21454
21457
|
__name: "StatusBarDefaultPanels",
|
|
21455
21458
|
props: { context: {} },
|
|
21456
21459
|
setup(e) {
|
|
@@ -21458,67 +21461,67 @@ var kC = { class: "mg-status-bar__panels" }, AC = /* @__PURE__ */ g({
|
|
|
21458
21461
|
let { context: e } = t, n = [];
|
|
21459
21462
|
return n.push(`共 ${e.totalRowCount} 行`), e.isFiltered && n.push(`显示 ${e.displayedRowCount} 行`), e.rowSelectionEnabled && e.selectedRowCount > 0 && n.push(`已选 ${e.selectedRowCount} 行`), n;
|
|
21460
21463
|
});
|
|
21461
|
-
return (e, t) => (E(), d("div",
|
|
21464
|
+
return (e, t) => (E(), d("div", AC, [(E(!0), d(o, null, k(n.value, (e, t) => (E(), d("span", {
|
|
21462
21465
|
key: t,
|
|
21463
21466
|
class: "mg-status-bar__panel"
|
|
21464
21467
|
}, M(e), 1))), 128))]));
|
|
21465
21468
|
}
|
|
21466
|
-
}),
|
|
21469
|
+
}), MC = 2;
|
|
21467
21470
|
//#endregion
|
|
21468
21471
|
//#region src/components/StatusBar/resolveStatusBarRangeAggregationPrecision.ts
|
|
21469
|
-
function
|
|
21472
|
+
function NC(e) {
|
|
21470
21473
|
if (typeof e == "number") {
|
|
21471
|
-
let t =
|
|
21474
|
+
let t = PC(e);
|
|
21472
21475
|
return {
|
|
21473
21476
|
average: t,
|
|
21474
21477
|
sum: t
|
|
21475
21478
|
};
|
|
21476
21479
|
}
|
|
21477
21480
|
return {
|
|
21478
|
-
average:
|
|
21479
|
-
sum:
|
|
21481
|
+
average: PC(e?.average ?? 2),
|
|
21482
|
+
sum: PC(e?.sum ?? 2)
|
|
21480
21483
|
};
|
|
21481
21484
|
}
|
|
21482
|
-
function
|
|
21485
|
+
function PC(e) {
|
|
21483
21486
|
return Number.isFinite(e) ? Math.max(0, Math.min(10, Math.trunc(e))) : 2;
|
|
21484
21487
|
}
|
|
21485
21488
|
//#endregion
|
|
21486
21489
|
//#region src/components/StatusBar/formatAggregationDisplayValue.ts
|
|
21487
|
-
function
|
|
21490
|
+
function FC(e, t, n = 2) {
|
|
21488
21491
|
if (t === "count") return String(Math.trunc(e));
|
|
21489
|
-
let r =
|
|
21492
|
+
let r = PC(n), i = 10 ** r, a = Math.round(e * i) / i;
|
|
21490
21493
|
return r === 0 ? String(Math.round(a)) : a.toFixed(r).replace(/\.?0+$/, "");
|
|
21491
21494
|
}
|
|
21492
21495
|
//#endregion
|
|
21493
21496
|
//#region src/components/StatusBar/hasStatusBarAggregationContent.ts
|
|
21494
|
-
function
|
|
21497
|
+
function IC(e) {
|
|
21495
21498
|
return e != null && e.count > 0;
|
|
21496
21499
|
}
|
|
21497
21500
|
//#endregion
|
|
21498
21501
|
//#region src/components/StatusBar/StatusBarRangeAggregationPanels.vue?vue&type=script&setup=true&lang.ts
|
|
21499
|
-
var
|
|
21502
|
+
var LC = {
|
|
21500
21503
|
key: 0,
|
|
21501
21504
|
class: "mg-status-bar__panels mg-status-bar__panels--aggregation"
|
|
21502
|
-
},
|
|
21505
|
+
}, RC = /* @__PURE__ */ g({
|
|
21503
21506
|
__name: "StatusBarRangeAggregationPanels",
|
|
21504
21507
|
props: { context: {} },
|
|
21505
21508
|
setup(e) {
|
|
21506
|
-
let t = e, n = c(() =>
|
|
21509
|
+
let t = e, n = c(() => IC(t.context.cellSelectionAggregation)), r = c(() => {
|
|
21507
21510
|
let e = t.context.cellSelectionAggregation;
|
|
21508
|
-
if (!
|
|
21511
|
+
if (!IC(e)) return [];
|
|
21509
21512
|
let n = t.context.statusBarRangeAggregationPrecision, r = [];
|
|
21510
21513
|
return e.average != null && r.push({
|
|
21511
21514
|
label: "平均值",
|
|
21512
|
-
value:
|
|
21515
|
+
value: FC(e.average, "average", n.average)
|
|
21513
21516
|
}), r.push({
|
|
21514
21517
|
label: "计数",
|
|
21515
|
-
value:
|
|
21518
|
+
value: FC(e.count, "count")
|
|
21516
21519
|
}), e.sum != null && r.push({
|
|
21517
21520
|
label: "求和",
|
|
21518
|
-
value:
|
|
21521
|
+
value: FC(e.sum, "sum", n.sum)
|
|
21519
21522
|
}), r;
|
|
21520
21523
|
});
|
|
21521
|
-
return (e, t) => n.value && r.value.length ? (E(), d("div",
|
|
21524
|
+
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
21525
|
key: t,
|
|
21523
21526
|
class: "mg-status-bar__panel"
|
|
21524
21527
|
}, M(e.label) + ": " + M(e.value), 1))), 128))])) : u("", !0);
|
|
@@ -21526,7 +21529,7 @@ var IC = {
|
|
|
21526
21529
|
});
|
|
21527
21530
|
//#endregion
|
|
21528
21531
|
//#region src/components/MagicGrid/resolveMagicGridDefaults.ts
|
|
21529
|
-
function
|
|
21532
|
+
function zC(e) {
|
|
21530
21533
|
if (e === !1) return !1;
|
|
21531
21534
|
let t = e === !0 || e == null ? {} : e, n = typeof e == "object" && !!e && "handleMode" in e, r = {
|
|
21532
21535
|
...t,
|
|
@@ -21538,7 +21541,7 @@ function RC(e) {
|
|
|
21538
21541
|
}
|
|
21539
21542
|
return r;
|
|
21540
21543
|
}
|
|
21541
|
-
function
|
|
21544
|
+
function BC(e) {
|
|
21542
21545
|
return {
|
|
21543
21546
|
...e,
|
|
21544
21547
|
syncToSelectionColumn: e?.syncToSelectionColumn ?? !0
|
|
@@ -21546,17 +21549,17 @@ function zC(e) {
|
|
|
21546
21549
|
}
|
|
21547
21550
|
//#endregion
|
|
21548
21551
|
//#region src/components/MagicGrid/useStatusBarContext.ts
|
|
21549
|
-
function
|
|
21552
|
+
function VC(e) {
|
|
21550
21553
|
return yc({ cellSelection: e }).enabled;
|
|
21551
21554
|
}
|
|
21552
|
-
function
|
|
21555
|
+
function HC(e) {
|
|
21553
21556
|
let t = D(0), n = D(0), r = () => {
|
|
21554
21557
|
t.value += 1;
|
|
21555
21558
|
};
|
|
21556
21559
|
return {
|
|
21557
21560
|
statusBarContext: c(() => {
|
|
21558
21561
|
t.value;
|
|
21559
|
-
let r = e.api.value, i = r?.getMetrics(), a = yt(e.rowSelection.value).mode !== !1, o =
|
|
21562
|
+
let r = e.api.value, i = r?.getMetrics(), a = yt(e.rowSelection.value).mode !== !1, o = VC(e.cellSelection.value);
|
|
21560
21563
|
return {
|
|
21561
21564
|
api: r,
|
|
21562
21565
|
totalRowCount: i?.sourceRowCount ?? 0,
|
|
@@ -21566,7 +21569,7 @@ function VC(e) {
|
|
|
21566
21569
|
rowSelectionEnabled: a,
|
|
21567
21570
|
cellSelectionEnabled: o,
|
|
21568
21571
|
cellSelectionAggregation: o ? r?.getCellSelectionAggregation() ?? null : null,
|
|
21569
|
-
statusBarRangeAggregationPrecision:
|
|
21572
|
+
statusBarRangeAggregationPrecision: NC(e.statusBarRangeAggregationPrecision.value),
|
|
21570
21573
|
metrics: i
|
|
21571
21574
|
};
|
|
21572
21575
|
}),
|
|
@@ -21581,7 +21584,7 @@ function VC(e) {
|
|
|
21581
21584
|
}
|
|
21582
21585
|
//#endregion
|
|
21583
21586
|
//#region src/components/cellRenderer/vueCellRendererHost.ts
|
|
21584
|
-
var
|
|
21587
|
+
var UC = class {
|
|
21585
21588
|
render(e, t) {
|
|
21586
21589
|
O(t, e);
|
|
21587
21590
|
}
|
|
@@ -21589,20 +21592,20 @@ var HC = class {
|
|
|
21589
21592
|
O(null, e);
|
|
21590
21593
|
}
|
|
21591
21594
|
};
|
|
21592
|
-
function
|
|
21595
|
+
function WC(e, t) {
|
|
21593
21596
|
return (n, r) => {
|
|
21594
21597
|
e.render(r.mountEl, t(n));
|
|
21595
21598
|
};
|
|
21596
21599
|
}
|
|
21597
|
-
function
|
|
21598
|
-
return
|
|
21600
|
+
function GC(e, t) {
|
|
21601
|
+
return WC(e, (e) => {
|
|
21599
21602
|
let n = t(e);
|
|
21600
21603
|
return Array.isArray(n) ? n[0] : n;
|
|
21601
21604
|
});
|
|
21602
21605
|
}
|
|
21603
21606
|
//#endregion
|
|
21604
21607
|
//#region src/components/detailRowRenderer/vueDetailRowRendererHost.ts
|
|
21605
|
-
var
|
|
21608
|
+
var KC = class {
|
|
21606
21609
|
render(e, t) {
|
|
21607
21610
|
O(t, e);
|
|
21608
21611
|
}
|
|
@@ -21610,20 +21613,20 @@ var GC = class {
|
|
|
21610
21613
|
O(null, e);
|
|
21611
21614
|
}
|
|
21612
21615
|
};
|
|
21613
|
-
function
|
|
21616
|
+
function qC(e, t) {
|
|
21614
21617
|
return (n, r) => {
|
|
21615
21618
|
e.render(r.mountEl, t(n));
|
|
21616
21619
|
};
|
|
21617
21620
|
}
|
|
21618
|
-
function
|
|
21619
|
-
return
|
|
21621
|
+
function JC(e, t) {
|
|
21622
|
+
return qC(e, (e) => {
|
|
21620
21623
|
let n = t(e);
|
|
21621
21624
|
return Array.isArray(n) ? n[0] : n;
|
|
21622
21625
|
});
|
|
21623
21626
|
}
|
|
21624
21627
|
//#endregion
|
|
21625
21628
|
//#region src/components/cellEditor/vueCellEditorHost.ts
|
|
21626
|
-
var
|
|
21629
|
+
var YC = class {
|
|
21627
21630
|
render(e, t) {
|
|
21628
21631
|
O(t, e);
|
|
21629
21632
|
}
|
|
@@ -21631,20 +21634,20 @@ var JC = class {
|
|
|
21631
21634
|
O(null, e);
|
|
21632
21635
|
}
|
|
21633
21636
|
};
|
|
21634
|
-
function
|
|
21637
|
+
function XC(e, t) {
|
|
21635
21638
|
return (n, r) => {
|
|
21636
21639
|
e.render(r.mountEl, t(n));
|
|
21637
21640
|
};
|
|
21638
21641
|
}
|
|
21639
|
-
function
|
|
21640
|
-
return
|
|
21642
|
+
function ZC(e, t) {
|
|
21643
|
+
return XC(e, (e) => {
|
|
21641
21644
|
let n = t(e);
|
|
21642
21645
|
return Array.isArray(n) ? n[0] : n;
|
|
21643
21646
|
});
|
|
21644
21647
|
}
|
|
21645
21648
|
//#endregion
|
|
21646
21649
|
//#region src/components/tooltip/vueTooltipComponentHost.ts
|
|
21647
|
-
var
|
|
21650
|
+
var QC = class {
|
|
21648
21651
|
mountEl = null;
|
|
21649
21652
|
render(e, t) {
|
|
21650
21653
|
this.unmount(), this.mountEl = e, O(t, e);
|
|
@@ -21653,7 +21656,7 @@ var ZC = class {
|
|
|
21653
21656
|
this.mountEl &&= (O(null, this.mountEl), null);
|
|
21654
21657
|
}
|
|
21655
21658
|
};
|
|
21656
|
-
function
|
|
21659
|
+
function $C(e, t) {
|
|
21657
21660
|
return (n, r) => {
|
|
21658
21661
|
let i = t(n), a = Array.isArray(i) ? i[0] : i;
|
|
21659
21662
|
return e.render(r, a), {
|
|
@@ -21664,7 +21667,7 @@ function QC(e, t) {
|
|
|
21664
21667
|
}
|
|
21665
21668
|
//#endregion
|
|
21666
21669
|
//#region src/components/overlay/vueOverlayComponentHost.ts
|
|
21667
|
-
var
|
|
21670
|
+
var ew = class {
|
|
21668
21671
|
mountEl = null;
|
|
21669
21672
|
render(e, t) {
|
|
21670
21673
|
this.unmount(), this.mountEl = e, O(t, e);
|
|
@@ -21673,7 +21676,7 @@ var $C = class {
|
|
|
21673
21676
|
this.mountEl &&= (O(null, this.mountEl), null);
|
|
21674
21677
|
}
|
|
21675
21678
|
};
|
|
21676
|
-
function
|
|
21679
|
+
function tw(e, t) {
|
|
21677
21680
|
return (n, r) => {
|
|
21678
21681
|
let i = t(n), a = Array.isArray(i) ? i[0] : i;
|
|
21679
21682
|
return e.render(r, a), {
|
|
@@ -21684,36 +21687,36 @@ function ew(e, t) {
|
|
|
21684
21687
|
}
|
|
21685
21688
|
//#endregion
|
|
21686
21689
|
//#region src/components/MagicGrid/MagicGrid.vue?vue&type=script&setup=true&lang.ts
|
|
21687
|
-
var
|
|
21690
|
+
var nw = ["data-status-bar", "data-toolbar"], rw = {
|
|
21688
21691
|
key: 0,
|
|
21689
21692
|
class: "magic-grid__toolbar"
|
|
21690
|
-
},
|
|
21693
|
+
}, iw = {
|
|
21691
21694
|
key: 0,
|
|
21692
21695
|
class: "mg-status-bar__region mg-status-bar__region--left"
|
|
21693
|
-
},
|
|
21696
|
+
}, aw = {
|
|
21694
21697
|
key: 1,
|
|
21695
21698
|
class: "mg-status-bar__separator",
|
|
21696
21699
|
role: "separator",
|
|
21697
21700
|
"aria-orientation": "vertical"
|
|
21698
|
-
},
|
|
21701
|
+
}, ow = {
|
|
21699
21702
|
key: 3,
|
|
21700
21703
|
class: "mg-status-bar__separator",
|
|
21701
21704
|
role: "separator",
|
|
21702
21705
|
"aria-orientation": "vertical"
|
|
21703
|
-
},
|
|
21706
|
+
}, sw = {
|
|
21704
21707
|
key: 4,
|
|
21705
21708
|
class: "mg-status-bar__separator",
|
|
21706
21709
|
role: "separator",
|
|
21707
21710
|
"aria-orientation": "vertical"
|
|
21708
|
-
},
|
|
21711
|
+
}, cw = {
|
|
21709
21712
|
key: 6,
|
|
21710
21713
|
class: "mg-status-bar__separator",
|
|
21711
21714
|
role: "separator",
|
|
21712
21715
|
"aria-orientation": "vertical"
|
|
21713
|
-
},
|
|
21716
|
+
}, lw = {
|
|
21714
21717
|
key: 7,
|
|
21715
21718
|
class: "mg-status-bar__region mg-status-bar__region--right"
|
|
21716
|
-
},
|
|
21719
|
+
}, uw = /* @__PURE__ */ g({
|
|
21717
21720
|
inheritAttrs: !1,
|
|
21718
21721
|
__name: "MagicGrid",
|
|
21719
21722
|
props: {
|
|
@@ -22280,7 +22283,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22280
22283
|
},
|
|
22281
22284
|
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
22285
|
setup(e, { expose: n, emit: r }) {
|
|
22283
|
-
let i = new
|
|
22286
|
+
let i = new UC(), a = new KC(), s = new YC(), p = new QC(), m = new ew();
|
|
22284
22287
|
function h(e, t) {
|
|
22285
22288
|
return e.key ?? e.prop ?? `col_${t}`;
|
|
22286
22289
|
}
|
|
@@ -22290,7 +22293,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22290
22293
|
let a = h(e, r);
|
|
22291
22294
|
e.cellRenderer && (n[a] = e.cellRenderer);
|
|
22292
22295
|
let o = t[`cell-${a}`];
|
|
22293
|
-
o && (n[a] =
|
|
22296
|
+
o && (n[a] = GC(i, (e) => o({
|
|
22294
22297
|
row: e.data,
|
|
22295
22298
|
value: e.value,
|
|
22296
22299
|
formattedValue: e.formattedValue,
|
|
@@ -22307,7 +22310,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22307
22310
|
let i = h(e, r);
|
|
22308
22311
|
e.cellEditor && typeof e.cellEditor == "function" && (n[i] = e.cellEditor);
|
|
22309
22312
|
let a = t[`cell-editor-${i}`];
|
|
22310
|
-
a && (n[i] =
|
|
22313
|
+
a && (n[i] = ZC(s, (e) => a({
|
|
22311
22314
|
row: e.data,
|
|
22312
22315
|
value: e.value,
|
|
22313
22316
|
formattedValue: e.formattedValue,
|
|
@@ -22320,11 +22323,11 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22320
22323
|
}
|
|
22321
22324
|
function C(e, t) {
|
|
22322
22325
|
let n = t.tooltip;
|
|
22323
|
-
return n ?
|
|
22326
|
+
return n ? $C(p, (e) => n(e)) : e;
|
|
22324
22327
|
}
|
|
22325
22328
|
function O(e, t, n) {
|
|
22326
22329
|
let r = t[e];
|
|
22327
|
-
return r ?
|
|
22330
|
+
return r ? tw(m, (e) => r({
|
|
22328
22331
|
overlayType: e.overlayType,
|
|
22329
22332
|
api: e.api,
|
|
22330
22333
|
overlayText: e.overlayText
|
|
@@ -22353,7 +22356,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22353
22356
|
}
|
|
22354
22357
|
function ee(e, t) {
|
|
22355
22358
|
let n = t["detail-row"];
|
|
22356
|
-
return n ?
|
|
22359
|
+
return n ? JC(a, (e) => n({
|
|
22357
22360
|
row: e.data,
|
|
22358
22361
|
rowId: e.rowId,
|
|
22359
22362
|
masterRowId: e.masterRowId,
|
|
@@ -22363,7 +22366,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22363
22366
|
loadError: e.loadError
|
|
22364
22367
|
})) : e;
|
|
22365
22368
|
}
|
|
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 } =
|
|
22369
|
+
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
22370
|
api: le,
|
|
22368
22371
|
rowSelection: c(() => M.rowSelection),
|
|
22369
22372
|
cellSelection: c(() => M.cellSelection),
|
|
@@ -22379,14 +22382,14 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22379
22382
|
})), xe = c(() => ae({
|
|
22380
22383
|
rounded: M.rounded,
|
|
22381
22384
|
sizeBorderRadius: be.value.borderRadius
|
|
22382
|
-
})), Se = c(() =>
|
|
22385
|
+
})), 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
22386
|
height: typeof M.height == "number" ? `${M.height}px` : M.height,
|
|
22384
22387
|
width: typeof M.width == "number" ? `${M.width}px` : M.width,
|
|
22385
22388
|
...fe({
|
|
22386
22389
|
...be.value,
|
|
22387
22390
|
statusBarHeight: Te.value
|
|
22388
22391
|
}, xe.value, M.summaryRowHeight),
|
|
22389
|
-
...
|
|
22392
|
+
...EC(Se.value)
|
|
22390
22393
|
})), Ie = c(() => {
|
|
22391
22394
|
let e = Te.value, { fontSize: t, spacing: n } = be.value, r = ce(e);
|
|
22392
22395
|
return {
|
|
@@ -22405,7 +22408,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22405
22408
|
"magic-grid",
|
|
22406
22409
|
`magic-grid--border-${M.border}`,
|
|
22407
22410
|
`magic-grid--size-${be.value.size}`,
|
|
22408
|
-
|
|
22411
|
+
TC(Se.value),
|
|
22409
22412
|
M.showSummary && "magic-grid--has-footer",
|
|
22410
22413
|
M.showStatusBar && "magic-grid--has-status-bar",
|
|
22411
22414
|
_e.value && "magic-grid--has-toolbar"
|
|
@@ -22437,7 +22440,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22437
22440
|
P("cell-selection-changed", e), ue();
|
|
22438
22441
|
}), 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
22442
|
}, Ue = () => {
|
|
22440
|
-
|
|
22443
|
+
kC(ne.value?.querySelector(".mg-body"), Se.value);
|
|
22441
22444
|
};
|
|
22442
22445
|
function We() {
|
|
22443
22446
|
L.value?.setStatusBarElement(M.showStatusBar ? ie.value ?? null : null);
|
|
@@ -22448,7 +22451,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22448
22451
|
ye.length = 0, L.value?.destroy(), pe(), M.columns, M.columns, M.columns, qn(M.columns), fh({
|
|
22449
22452
|
tree: M.tree,
|
|
22450
22453
|
rowGrouping: M.rowGrouping
|
|
22451
|
-
}), L.value = new
|
|
22454
|
+
}), L.value = new xC(ne.value, {
|
|
22452
22455
|
columns: t(M.columns),
|
|
22453
22456
|
rowKey: M.rowKey,
|
|
22454
22457
|
rowHeight: be.value.rowHeight,
|
|
@@ -22818,7 +22821,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22818
22821
|
"data-status-bar": e.showStatusBar ? "true" : "false",
|
|
22819
22822
|
"data-toolbar": _e.value ? "true" : "false"
|
|
22820
22823
|
}, [
|
|
22821
|
-
_e.value ? (E(), d("div",
|
|
22824
|
+
_e.value ? (E(), d("div", rw, [A(t.$slots, "toolbar", x(_(ve.value)))])) : u("", !0),
|
|
22822
22825
|
f("div", {
|
|
22823
22826
|
ref_key: "mountRef",
|
|
22824
22827
|
ref: ne,
|
|
@@ -22839,31 +22842,31 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22839
22842
|
role: "status",
|
|
22840
22843
|
"aria-live": "polite"
|
|
22841
22844
|
}, [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",
|
|
22845
|
+
Ee.value ? (E(), d("div", iw, [e.showDefaultStatusBarPanels ? (E(), l(jC, {
|
|
22843
22846
|
key: 0,
|
|
22844
22847
|
context: N(R)
|
|
22845
22848
|
}, 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(
|
|
22849
|
+
je.value ? (E(), d("div", aw)) : u("", !0),
|
|
22850
|
+
ke.value ? (E(), l(RC, {
|
|
22848
22851
|
key: 2,
|
|
22849
22852
|
context: N(R)
|
|
22850
22853
|
}, null, 8, ["context"])) : u("", !0),
|
|
22851
|
-
Me.value ? (E(), d("div",
|
|
22854
|
+
Me.value ? (E(), d("div", ow)) : u("", !0),
|
|
22852
22855
|
n[0] ||= f("div", {
|
|
22853
22856
|
class: "mg-status-bar__stretch",
|
|
22854
22857
|
"aria-hidden": "true"
|
|
22855
22858
|
}, null, -1),
|
|
22856
|
-
Ne.value ? (E(), d("div",
|
|
22857
|
-
Ae.value ? (E(), l(
|
|
22859
|
+
Ne.value ? (E(), d("div", sw)) : u("", !0),
|
|
22860
|
+
Ae.value ? (E(), l(RC, {
|
|
22858
22861
|
key: 5,
|
|
22859
22862
|
context: N(R)
|
|
22860
22863
|
}, null, 8, ["context"])) : u("", !0),
|
|
22861
|
-
Pe.value ? (E(), d("div",
|
|
22862
|
-
De.value ? (E(), d("div",
|
|
22864
|
+
Pe.value ? (E(), d("div", cw)) : u("", !0),
|
|
22865
|
+
De.value ? (E(), d("div", lw, [A(t.$slots, "status-bar-right", x(_(N(R))))])) : u("", !0)
|
|
22863
22866
|
], 64))], 4)) : u("", !0)
|
|
22864
|
-
], 14,
|
|
22867
|
+
], 14, nw));
|
|
22865
22868
|
}
|
|
22866
|
-
}),
|
|
22869
|
+
}), dw = {
|
|
22867
22870
|
"sliders-vertical": [
|
|
22868
22871
|
["path", { d: "M10 8h4" }],
|
|
22869
22872
|
["path", { d: "M12 21v-9" }],
|
|
@@ -22916,14 +22919,14 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22916
22919
|
["path", { d: "M9 3v18" }],
|
|
22917
22920
|
["path", { d: "M15 3v18" }]
|
|
22918
22921
|
]
|
|
22919
|
-
},
|
|
22922
|
+
}, fw = ["width", "height"], pw = /* @__PURE__ */ g({
|
|
22920
22923
|
__name: "ColumnSettingsMenuIcon",
|
|
22921
22924
|
props: {
|
|
22922
22925
|
name: {},
|
|
22923
22926
|
size: { default: 16 }
|
|
22924
22927
|
},
|
|
22925
22928
|
setup(e) {
|
|
22926
|
-
let t = e, n = c(() =>
|
|
22929
|
+
let t = e, n = c(() => dw[t.name]);
|
|
22927
22930
|
return (t, r) => (E(), d("svg", {
|
|
22928
22931
|
class: "mg-column-settings-menu__icon-svg",
|
|
22929
22932
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -22936,12 +22939,12 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22936
22939
|
"stroke-linecap": "round",
|
|
22937
22940
|
"stroke-linejoin": "round",
|
|
22938
22941
|
"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,
|
|
22942
|
+
}, [(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
22943
|
}
|
|
22941
|
-
}),
|
|
22944
|
+
}), mw = {
|
|
22942
22945
|
key: 0,
|
|
22943
22946
|
class: "mg-column-settings-menu__item-icon"
|
|
22944
|
-
},
|
|
22947
|
+
}, hw = { class: "mg-column-settings-menu__item-label" }, gw = /* @__PURE__ */ g({
|
|
22945
22948
|
__name: "ColumnSettingsMenuItem",
|
|
22946
22949
|
props: { label: {} },
|
|
22947
22950
|
setup(e) {
|
|
@@ -22949,9 +22952,9 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
22949
22952
|
type: "button",
|
|
22950
22953
|
class: b(N(Vu)),
|
|
22951
22954
|
role: "menuitem"
|
|
22952
|
-
}, [t.$slots.icon ? (E(), d("span",
|
|
22955
|
+
}, [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
22956
|
}
|
|
22954
|
-
}),
|
|
22957
|
+
}), _w = ["aria-expanded"], vw = { class: "mg-column-settings-menu__item-leading" }, yw = { class: "mg-column-settings-menu__item-icon" }, bw = /* @__PURE__ */ g({
|
|
22955
22958
|
__name: "ColumnSettingsMenu",
|
|
22956
22959
|
props: { showDivider: { type: Boolean } },
|
|
22957
22960
|
emits: [
|
|
@@ -23019,11 +23022,11 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23019
23022
|
class: b(N(Bu)),
|
|
23020
23023
|
role: "menu"
|
|
23021
23024
|
}, [
|
|
23022
|
-
h(
|
|
23025
|
+
h(gw, {
|
|
23023
23026
|
label: "列设置",
|
|
23024
23027
|
onClick: l
|
|
23025
23028
|
}, {
|
|
23026
|
-
icon: I(() => [h(
|
|
23029
|
+
icon: I(() => [h(pw, { name: "sliders-vertical" })]),
|
|
23027
23030
|
_: 1
|
|
23028
23031
|
}),
|
|
23029
23032
|
f("div", {
|
|
@@ -23040,7 +23043,7 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23040
23043
|
role: "menuitem",
|
|
23041
23044
|
"aria-haspopup": "menu",
|
|
23042
23045
|
"aria-expanded": i.value
|
|
23043
|
-
}, [f("span",
|
|
23046
|
+
}, [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
23047
|
class: "mg-column-settings-menu__item-chevron",
|
|
23045
23048
|
xmlns: "http://www.w3.org/2000/svg",
|
|
23046
23049
|
width: "14",
|
|
@@ -23052,17 +23055,17 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23052
23055
|
"stroke-linecap": "round",
|
|
23053
23056
|
"stroke-linejoin": "round",
|
|
23054
23057
|
"aria-hidden": "true"
|
|
23055
|
-
}, [f("path", { d: "m9 18 6-6-6-6" })], -1)], 10,
|
|
23058
|
+
}, [f("path", { d: "m9 18 6-6-6-6" })], -1)], 10, _w), ne(f("div", {
|
|
23056
23059
|
ref_key: "resetSubmenuPanelRef",
|
|
23057
23060
|
ref: c,
|
|
23058
23061
|
class: b([N(Wu), { "mg-column-settings-menu__submenu-panel--flip": a.value }]),
|
|
23059
23062
|
role: "menu"
|
|
23060
|
-
}, [(E(), d(o, null, k(r, (e) => h(
|
|
23063
|
+
}, [(E(), d(o, null, k(r, (e) => h(gw, {
|
|
23061
23064
|
key: e.scope,
|
|
23062
23065
|
label: e.label,
|
|
23063
23066
|
onClick: (t) => v(e.scope)
|
|
23064
23067
|
}, {
|
|
23065
|
-
icon: I(() => [h(
|
|
23068
|
+
icon: I(() => [h(pw, { name: e.icon }, null, 8, ["name"])]),
|
|
23066
23069
|
_: 2
|
|
23067
23070
|
}, 1032, ["label", "onClick"])), 64))], 2), [[P, i.value]])], 34),
|
|
23068
23071
|
e.showDivider ? (E(), d("div", {
|
|
@@ -23078,11 +23081,11 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23078
23081
|
}, [A(t.$slots, "default")])) : u("", !0)
|
|
23079
23082
|
], 2));
|
|
23080
23083
|
}
|
|
23081
|
-
}),
|
|
23084
|
+
}), xw = [
|
|
23082
23085
|
"disabled",
|
|
23083
23086
|
"aria-disabled",
|
|
23084
23087
|
"title"
|
|
23085
|
-
],
|
|
23088
|
+
], Sw = /*@__PURE__*/ g({
|
|
23086
23089
|
__name: "ColumnSettingsClearFiltersBar",
|
|
23087
23090
|
props: {
|
|
23088
23091
|
gridApi: {},
|
|
@@ -23101,16 +23104,16 @@ var tw = ["data-status-bar", "data-toolbar"], nw = {
|
|
|
23101
23104
|
"aria-disabled": !e.canClearAllFilters,
|
|
23102
23105
|
title: e.canClearAllFilters ? void 0 : "当前无筛选",
|
|
23103
23106
|
onClick: i
|
|
23104
|
-
}, " 清除全部筛选 ", 10,
|
|
23107
|
+
}, " 清除全部筛选 ", 10, xw));
|
|
23105
23108
|
}
|
|
23106
|
-
}),
|
|
23109
|
+
}), Cw = (e, t) => {
|
|
23107
23110
|
let n = e.__vccOpts || e;
|
|
23108
23111
|
for (let [e, r] of t) n[e] = r;
|
|
23109
23112
|
return n;
|
|
23110
|
-
},
|
|
23113
|
+
}, ww = /*#__PURE__*/ Cw(Sw, [["__scopeId", "data-v-1c8bd037"]]);
|
|
23111
23114
|
//#endregion
|
|
23112
23115
|
//#region src/core/column/columnSettingsFilterApply.ts
|
|
23113
|
-
function
|
|
23116
|
+
function Tw(e) {
|
|
23114
23117
|
let t = null, n = () => {
|
|
23115
23118
|
t != null && (clearTimeout(t), t = null);
|
|
23116
23119
|
};
|
|
@@ -23146,7 +23149,7 @@ function ww(e) {
|
|
|
23146
23149
|
}
|
|
23147
23150
|
//#endregion
|
|
23148
23151
|
//#region src/components/ColumnSettings/ColumnFilterPanelEmbed.vue
|
|
23149
|
-
var
|
|
23152
|
+
var Ew = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23150
23153
|
__name: "ColumnFilterPanelEmbed",
|
|
23151
23154
|
props: {
|
|
23152
23155
|
colId: {},
|
|
@@ -23156,7 +23159,7 @@ var Tw = /*#__PURE__*/ Sw(/* @__PURE__ */ g({
|
|
|
23156
23159
|
},
|
|
23157
23160
|
emits: ["change"],
|
|
23158
23161
|
setup(e, { emit: t }) {
|
|
23159
|
-
let n = e, r = t, i = D(null), a = null, o = null, s =
|
|
23162
|
+
let n = e, r = t, i = D(null), a = null, o = null, s = Tw({
|
|
23160
23163
|
getFilterModel: () => n.gridApi.getFilterModel(),
|
|
23161
23164
|
setFilterModel: (e) => {
|
|
23162
23165
|
n.gridApi.setFilterModel(e), r("change");
|
|
@@ -23213,65 +23216,65 @@ var Tw = /*#__PURE__*/ Sw(/* @__PURE__ */ g({
|
|
|
23213
23216
|
}), [["__scopeId", "data-v-85b2c30c"]]);
|
|
23214
23217
|
//#endregion
|
|
23215
23218
|
//#region src/core/column/columnSettingsActions.ts
|
|
23216
|
-
function
|
|
23219
|
+
function Dw(e) {
|
|
23217
23220
|
return e === null ? "asc" : e === "asc" ? "desc" : null;
|
|
23218
23221
|
}
|
|
23219
|
-
function Dw(e, t, n) {
|
|
23220
|
-
return t === null ? Jv(e, n) : t === "asc" ? Kv(e, n) : qv(e, n);
|
|
23221
|
-
}
|
|
23222
23222
|
function Ow(e, t, n) {
|
|
23223
|
-
e
|
|
23223
|
+
return t === null ? Jv(e, n) : t === "asc" ? Kv(e, n) : qv(e, n);
|
|
23224
23224
|
}
|
|
23225
23225
|
function kw(e, t, n) {
|
|
23226
|
-
|
|
23227
|
-
return Ow(e, t, r), r;
|
|
23226
|
+
e.setSortModel(Ow(t, n, e.getSortModel()));
|
|
23228
23227
|
}
|
|
23229
23228
|
function Aw(e, t, n) {
|
|
23229
|
+
let r = Dw(n);
|
|
23230
|
+
return kw(e, t, r), r;
|
|
23231
|
+
}
|
|
23232
|
+
function jw(e, t, n) {
|
|
23230
23233
|
return e.setColumnFixed(t, n);
|
|
23231
23234
|
}
|
|
23232
|
-
function
|
|
23235
|
+
function Mw(e) {
|
|
23233
23236
|
return e === "asc" ? "升序" : e === "desc" ? "降序" : "无排序";
|
|
23234
23237
|
}
|
|
23235
|
-
function
|
|
23238
|
+
function Nw(e) {
|
|
23236
23239
|
return e === "left" ? "固定左侧" : e === "right" ? "固定右侧" : "不固定";
|
|
23237
23240
|
}
|
|
23238
23241
|
//#endregion
|
|
23239
23242
|
//#region src/core/column/columnSettingsVisibility.ts
|
|
23240
|
-
var
|
|
23241
|
-
function
|
|
23243
|
+
var Pw = "[magic-grid] ColumnSettings: at least one user column must remain visible.";
|
|
23244
|
+
function Fw(e) {
|
|
23242
23245
|
return e.filter((e) => Qu(e.colId) && ho(e)).length;
|
|
23243
23246
|
}
|
|
23244
|
-
function
|
|
23247
|
+
function Iw(e) {
|
|
23245
23248
|
return e.filter((e) => Qu(e.colId) && e.hidden).map((e) => e.colId);
|
|
23246
23249
|
}
|
|
23247
|
-
function
|
|
23250
|
+
function Lw(e, t) {
|
|
23248
23251
|
if (!Qu(e)) return !1;
|
|
23249
23252
|
let n = t.find((t) => t.colId === e);
|
|
23250
|
-
return !n || n.hidden ? !1 :
|
|
23253
|
+
return !n || n.hidden ? !1 : Fw(t) > 1;
|
|
23251
23254
|
}
|
|
23252
|
-
function
|
|
23255
|
+
function Rw(e, t, n, r = {}) {
|
|
23253
23256
|
let i = r.warn ?? ((e) => console.warn(e));
|
|
23254
|
-
return !n && !
|
|
23257
|
+
return !n && !Lw(t, e.getColumns()) ? (i(Pw), !1) : e.setColumnsHidden([t], !n);
|
|
23255
23258
|
}
|
|
23256
|
-
function
|
|
23257
|
-
let t =
|
|
23259
|
+
function zw(e) {
|
|
23260
|
+
let t = Iw(e.getColumns());
|
|
23258
23261
|
return t.length !== 0 && e.setColumnsHidden(t, !1);
|
|
23259
23262
|
}
|
|
23260
23263
|
//#endregion
|
|
23261
23264
|
//#region src/components/ColumnSettings/ColumnSettingsRow.vue?vue&type=script&setup=true&lang.ts
|
|
23262
|
-
var
|
|
23265
|
+
var Bw = ["data-col-id"], Vw = { class: "mg-column-settings__row-main" }, Hw = [
|
|
23263
23266
|
"draggable",
|
|
23264
23267
|
"aria-disabled",
|
|
23265
23268
|
"title"
|
|
23266
|
-
],
|
|
23269
|
+
], Uw = ["title"], Ww = {
|
|
23267
23270
|
key: 1,
|
|
23268
23271
|
class: "mg-column-settings__row-actions"
|
|
23269
|
-
},
|
|
23272
|
+
}, Gw = ["aria-label", "title"], Kw = ["aria-expanded", "aria-label"], qw = ["aria-label"], Jw = [
|
|
23270
23273
|
"aria-checked",
|
|
23271
23274
|
"aria-label",
|
|
23272
23275
|
"title",
|
|
23273
23276
|
"onClick"
|
|
23274
|
-
],
|
|
23277
|
+
], Yw = ["title"], Xw = ["checked", "aria-label"], Zw = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23275
23278
|
__name: "ColumnSettingsRow",
|
|
23276
23279
|
props: {
|
|
23277
23280
|
row: {},
|
|
@@ -23314,10 +23317,10 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23314
23317
|
"right"
|
|
23315
23318
|
];
|
|
23316
23319
|
function s() {
|
|
23317
|
-
!n.gridApi || !n.row.sortable || (
|
|
23320
|
+
!n.gridApi || !n.row.sortable || (Aw(n.gridApi, n.row.colId, n.row.sortDirection), r("change"));
|
|
23318
23321
|
}
|
|
23319
23322
|
function c(e) {
|
|
23320
|
-
!n.gridApi || n.row.fixed === e ||
|
|
23323
|
+
!n.gridApi || n.row.fixed === e || jw(n.gridApi, n.row.colId, e) && r("change");
|
|
23321
23324
|
}
|
|
23322
23325
|
function p() {
|
|
23323
23326
|
i.value = !i.value;
|
|
@@ -23325,7 +23328,7 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23325
23328
|
function m(e) {
|
|
23326
23329
|
if (!n.gridApi) return;
|
|
23327
23330
|
let t = e.target, i = t.checked;
|
|
23328
|
-
if (!
|
|
23331
|
+
if (!Rw(n.gridApi, n.row.colId, i)) {
|
|
23329
23332
|
t.checked = !i;
|
|
23330
23333
|
return;
|
|
23331
23334
|
}
|
|
@@ -23348,7 +23351,7 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23348
23351
|
"mg-column-settings__row--dragging": e.dragging
|
|
23349
23352
|
}]),
|
|
23350
23353
|
"data-col-id": e.row.colId
|
|
23351
|
-
}, [f("div",
|
|
23354
|
+
}, [f("div", Vw, [
|
|
23352
23355
|
e.showDragHandle ? (E(), d("span", {
|
|
23353
23356
|
key: 0,
|
|
23354
23357
|
class: b(["mg-column-settings__drag-handle", { "mg-column-settings__drag-handle--disabled": !e.draggable }]),
|
|
@@ -23357,12 +23360,12 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23357
23360
|
title: e.draggable ? "拖拽调整列顺序" : "此列不可拖拽",
|
|
23358
23361
|
onDragstart: h,
|
|
23359
23362
|
onDragend: g
|
|
23360
|
-
}, " ≡ ", 42,
|
|
23363
|
+
}, " ≡ ", 42, Hw)) : u("", !0),
|
|
23361
23364
|
f("span", {
|
|
23362
23365
|
class: "mg-column-settings__row-label",
|
|
23363
23366
|
title: e.row.label
|
|
23364
|
-
}, M(e.row.label), 9,
|
|
23365
|
-
e.gridApi ? (E(), d("div",
|
|
23367
|
+
}, M(e.row.label), 9, Uw),
|
|
23368
|
+
e.gridApi ? (E(), d("div", Ww, [
|
|
23366
23369
|
e.showSort && e.row.sortable ? (E(), d("button", {
|
|
23367
23370
|
key: 0,
|
|
23368
23371
|
type: "button",
|
|
@@ -23370,10 +23373,10 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23370
23373
|
"mg-column-settings__sort-button--asc": e.row.sortDirection === "asc",
|
|
23371
23374
|
"mg-column-settings__sort-button--desc": e.row.sortDirection === "desc"
|
|
23372
23375
|
}]),
|
|
23373
|
-
"aria-label": `${e.row.label} 排序:${N(
|
|
23374
|
-
title: N(
|
|
23376
|
+
"aria-label": `${e.row.label} 排序:${N(Mw)(e.row.sortDirection)}`,
|
|
23377
|
+
title: N(Mw)(e.row.sortDirection),
|
|
23375
23378
|
onClick: s
|
|
23376
|
-
}, M(e.row.sortDirection === "asc" ? "↑" : e.row.sortDirection === "desc" ? "↓" : "↕"), 11,
|
|
23379
|
+
}, M(e.row.sortDirection === "asc" ? "↑" : e.row.sortDirection === "desc" ? "↓" : "↕"), 11, Gw)) : u("", !0),
|
|
23377
23380
|
e.showFilter && e.row.filterable ? (E(), d("button", {
|
|
23378
23381
|
key: 1,
|
|
23379
23382
|
type: "button",
|
|
@@ -23398,7 +23401,7 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23398
23401
|
f("path", { d: "M3 6h18" }),
|
|
23399
23402
|
f("path", { d: "M7 12h10" }),
|
|
23400
23403
|
f("path", { d: "M10 18h4" })
|
|
23401
|
-
], -1)]], 10,
|
|
23404
|
+
], -1)]], 10, Kw)) : u("", !0),
|
|
23402
23405
|
e.showPin ? (E(), d("div", {
|
|
23403
23406
|
key: 2,
|
|
23404
23407
|
class: "mg-column-settings__pin-group",
|
|
@@ -23410,10 +23413,10 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23410
23413
|
class: b(["mg-column-settings__pin-button", { "mg-column-settings__pin-button--active": e.row.fixed === t }]),
|
|
23411
23414
|
role: "radio",
|
|
23412
23415
|
"aria-checked": e.row.fixed === t,
|
|
23413
|
-
"aria-label": N(
|
|
23414
|
-
title: N(
|
|
23416
|
+
"aria-label": N(Nw)(t),
|
|
23417
|
+
title: N(Nw)(t),
|
|
23415
23418
|
onClick: (e) => c(t)
|
|
23416
|
-
}, M(t === "left" ? "左" : t === "right" ? "右" : "中"), 11,
|
|
23419
|
+
}, M(t === "left" ? "左" : t === "right" ? "右" : "中"), 11, Jw)), 64))], 8, qw)) : u("", !0),
|
|
23417
23420
|
e.showVisibility ? (E(), d("label", {
|
|
23418
23421
|
key: 3,
|
|
23419
23422
|
class: "mg-column-settings__visibility",
|
|
@@ -23424,12 +23427,12 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23424
23427
|
checked: !e.row.hidden,
|
|
23425
23428
|
"aria-label": `${e.row.label} 显示列`,
|
|
23426
23429
|
onChange: m
|
|
23427
|
-
}, null, 40,
|
|
23430
|
+
}, null, 40, Xw), n[2] ||= f("span", {
|
|
23428
23431
|
class: "mg-column-settings__visibility-label",
|
|
23429
23432
|
"aria-hidden": "true"
|
|
23430
|
-
}, "显示", -1)], 8,
|
|
23433
|
+
}, "显示", -1)], 8, Yw)) : u("", !0)
|
|
23431
23434
|
])) : u("", !0)
|
|
23432
|
-
]), i.value && e.gridApi && e.row.filterable ? (E(), l(
|
|
23435
|
+
]), i.value && e.gridApi && e.row.filterable ? (E(), l(Ew, {
|
|
23433
23436
|
key: 0,
|
|
23434
23437
|
class: "mg-column-settings__filter-panel",
|
|
23435
23438
|
"col-id": e.row.colId,
|
|
@@ -23442,19 +23445,19 @@ var zw = ["data-col-id"], Bw = { class: "mg-column-settings__row-main" }, Vw = [
|
|
|
23442
23445
|
"grid-api",
|
|
23443
23446
|
"filter-set-value-mode",
|
|
23444
23447
|
"filter-set-date-layout-mode"
|
|
23445
|
-
])) : u("", !0)], 10,
|
|
23448
|
+
])) : u("", !0)], 10, Bw));
|
|
23446
23449
|
}
|
|
23447
23450
|
}), [["__scopeId", "data-v-d7915c64"]]);
|
|
23448
23451
|
//#endregion
|
|
23449
23452
|
//#region src/core/column/columnSettingsMove.ts
|
|
23450
|
-
function
|
|
23453
|
+
function Qw(e, t) {
|
|
23451
23454
|
return Qu(e.colId) && !e.hidden && $u(e.fixed) === t;
|
|
23452
23455
|
}
|
|
23453
|
-
function
|
|
23454
|
-
return e.filter((e) =>
|
|
23456
|
+
function $w(e, t) {
|
|
23457
|
+
return e.filter((e) => Qw(e, t));
|
|
23455
23458
|
}
|
|
23456
|
-
function
|
|
23457
|
-
let i =
|
|
23459
|
+
function eT(e, t, n, r) {
|
|
23460
|
+
let i = $w(e, t), a = i.findIndex((e) => e.colId === n);
|
|
23458
23461
|
if (a < 0 || !e.find((e) => e.colId === n)?.movable) return null;
|
|
23459
23462
|
let o = Math.max(0, Math.min(r, i.length - 1));
|
|
23460
23463
|
if (a === o) return null;
|
|
@@ -23462,7 +23465,7 @@ function $w(e, t, n, r) {
|
|
|
23462
23465
|
s.splice(a, 1), s.splice(o, 0, n), e.map((e) => e.colId);
|
|
23463
23466
|
let c = [], l = 0;
|
|
23464
23467
|
for (let n of e) {
|
|
23465
|
-
if (
|
|
23468
|
+
if (Qw(n, t)) {
|
|
23466
23469
|
let e = s[l];
|
|
23467
23470
|
if (!e) return null;
|
|
23468
23471
|
c.push(e), l += 1;
|
|
@@ -23472,8 +23475,8 @@ function $w(e, t, n, r) {
|
|
|
23472
23475
|
}
|
|
23473
23476
|
return c;
|
|
23474
23477
|
}
|
|
23475
|
-
function
|
|
23476
|
-
let t =
|
|
23478
|
+
function tT(e) {
|
|
23479
|
+
let t = eT(e.columns, e.lane, e.colId, e.toDisplayIndex);
|
|
23477
23480
|
if (!t) return null;
|
|
23478
23481
|
let n = e.columns.findIndex((t) => t.colId === e.colId);
|
|
23479
23482
|
if (n < 0) return null;
|
|
@@ -23494,8 +23497,8 @@ function eT(e) {
|
|
|
23494
23497
|
allowCrossLaneColumnMove: !1
|
|
23495
23498
|
}) ? null : r;
|
|
23496
23499
|
}
|
|
23497
|
-
function
|
|
23498
|
-
let i =
|
|
23500
|
+
function nT(e, t, n, r) {
|
|
23501
|
+
let i = tT({
|
|
23499
23502
|
columns: e.getColumns(),
|
|
23500
23503
|
lane: t,
|
|
23501
23504
|
colId: n,
|
|
@@ -23505,7 +23508,7 @@ function tT(e, t, n, r) {
|
|
|
23505
23508
|
}
|
|
23506
23509
|
//#endregion
|
|
23507
23510
|
//#region src/components/ColumnSettings/ColumnSettingsList.vue?vue&type=script&setup=true&lang.ts
|
|
23508
|
-
var
|
|
23511
|
+
var rT = ["aria-label"], iT = { class: "mg-column-settings__rows" }, aT = ["onDragover", "onDrop"], oT = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23509
23512
|
__name: "ColumnSettingsList",
|
|
23510
23513
|
props: {
|
|
23511
23514
|
lane: {},
|
|
@@ -23538,7 +23541,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23538
23541
|
m();
|
|
23539
23542
|
return;
|
|
23540
23543
|
}
|
|
23541
|
-
|
|
23544
|
+
nT(r.gridApi, r.lane, n, e) && (i("reorder"), i("change")), m();
|
|
23542
23545
|
}
|
|
23543
23546
|
function m() {
|
|
23544
23547
|
a.value = null, s.value = null;
|
|
@@ -23547,12 +23550,12 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23547
23550
|
key: 0,
|
|
23548
23551
|
class: b([N(qu), `mg-column-settings__group--${e.lane}`]),
|
|
23549
23552
|
"aria-label": n[e.lane]
|
|
23550
|
-
}, [f("div",
|
|
23553
|
+
}, [f("div", iT, [(E(!0), d(o, null, k(e.rows, (t, n) => (E(), d("div", {
|
|
23551
23554
|
key: t.colId,
|
|
23552
23555
|
class: "mg-column-settings__row-host",
|
|
23553
23556
|
onDragover: (e) => l(n, e),
|
|
23554
23557
|
onDrop: (e) => p(n, e)
|
|
23555
|
-
}, [h(
|
|
23558
|
+
}, [h(Zw, {
|
|
23556
23559
|
row: t,
|
|
23557
23560
|
"grid-api": e.gridApi,
|
|
23558
23561
|
draggable: t.movable,
|
|
@@ -23572,9 +23575,9 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23572
23575
|
"show-filter",
|
|
23573
23576
|
"show-visibility",
|
|
23574
23577
|
"onDragstart"
|
|
23575
|
-
])], 40,
|
|
23578
|
+
])], 40, aT))), 128))])], 10, rT)) : u("", !0);
|
|
23576
23579
|
}
|
|
23577
|
-
}), [["__scopeId", "data-v-69b1c1f5"]]),
|
|
23580
|
+
}), [["__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
23581
|
key: 0,
|
|
23579
23582
|
class: "mg-column-settings__hidden-toggle-icon",
|
|
23580
23583
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -23587,7 +23590,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23587
23590
|
"stroke-linecap": "round",
|
|
23588
23591
|
"stroke-linejoin": "round",
|
|
23589
23592
|
"aria-hidden": "true"
|
|
23590
|
-
},
|
|
23593
|
+
}, pT = {
|
|
23591
23594
|
key: 1,
|
|
23592
23595
|
class: "mg-column-settings__hidden-toggle-icon",
|
|
23593
23596
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -23600,7 +23603,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23600
23603
|
"stroke-linecap": "round",
|
|
23601
23604
|
"stroke-linejoin": "round",
|
|
23602
23605
|
"aria-hidden": "true"
|
|
23603
|
-
},
|
|
23606
|
+
}, mT = { class: "mg-column-settings__hidden-rows" }, hT = { class: "mg-column-settings__rows" }, gT = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23604
23607
|
__name: "ColumnSettingsGroupedLists",
|
|
23605
23608
|
props: {
|
|
23606
23609
|
grouped: {},
|
|
@@ -23615,10 +23618,10 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23615
23618
|
setup(e, { emit: t }) {
|
|
23616
23619
|
let n = e, r = t, i = D(!0);
|
|
23617
23620
|
function a() {
|
|
23618
|
-
|
|
23621
|
+
zw(n.gridApi) && r("change");
|
|
23619
23622
|
}
|
|
23620
|
-
return (t, n) => (E(), d("div",
|
|
23621
|
-
h(
|
|
23623
|
+
return (t, n) => (E(), d("div", sT, [f("div", cT, [
|
|
23624
|
+
h(oT, {
|
|
23622
23625
|
lane: "left",
|
|
23623
23626
|
rows: e.grouped.left,
|
|
23624
23627
|
"grid-api": e.gridApi,
|
|
@@ -23632,7 +23635,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23632
23635
|
"show-filter",
|
|
23633
23636
|
"show-visibility"
|
|
23634
23637
|
]),
|
|
23635
|
-
h(
|
|
23638
|
+
h(oT, {
|
|
23636
23639
|
lane: "center",
|
|
23637
23640
|
rows: e.grouped.center,
|
|
23638
23641
|
"grid-api": e.gridApi,
|
|
@@ -23646,7 +23649,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23646
23649
|
"show-filter",
|
|
23647
23650
|
"show-visibility"
|
|
23648
23651
|
]),
|
|
23649
|
-
h(
|
|
23652
|
+
h(oT, {
|
|
23650
23653
|
lane: "right",
|
|
23651
23654
|
rows: e.grouped.right,
|
|
23652
23655
|
"grid-api": e.gridApi,
|
|
@@ -23663,17 +23666,17 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23663
23666
|
]), e.grouped.hidden.length > 0 ? (E(), d("section", {
|
|
23664
23667
|
key: 0,
|
|
23665
23668
|
class: b(N(Zu))
|
|
23666
|
-
}, [f("div",
|
|
23669
|
+
}, [f("div", lT, [
|
|
23667
23670
|
n[10] ||= f("span", {
|
|
23668
23671
|
class: "mg-column-settings__hidden-divider-line",
|
|
23669
23672
|
"aria-hidden": "true"
|
|
23670
23673
|
}, null, -1),
|
|
23671
|
-
f("div",
|
|
23674
|
+
f("div", uT, [f("button", {
|
|
23672
23675
|
type: "button",
|
|
23673
23676
|
class: "mg-column-settings__hidden-toggle",
|
|
23674
23677
|
"aria-expanded": i.value,
|
|
23675
23678
|
onClick: n[6] ||= (e) => i.value = !i.value
|
|
23676
|
-
}, [m(" 隐藏 (" + M(e.grouped.hidden.length) + ") ", 1), i.value ? (E(), d("svg",
|
|
23679
|
+
}, [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
23680
|
type: "button",
|
|
23678
23681
|
class: "mg-column-settings__hidden-show-all",
|
|
23679
23682
|
onClick: a
|
|
@@ -23682,7 +23685,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23682
23685
|
class: "mg-column-settings__hidden-divider-line",
|
|
23683
23686
|
"aria-hidden": "true"
|
|
23684
23687
|
}, null, -1)
|
|
23685
|
-
]), ne(f("div",
|
|
23688
|
+
]), 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
23689
|
key: t.colId,
|
|
23687
23690
|
row: t,
|
|
23688
23691
|
"grid-api": e.gridApi,
|
|
@@ -23701,7 +23704,7 @@ var nT = ["aria-label"], rT = { class: "mg-column-settings__rows" }, iT = ["onDr
|
|
|
23701
23704
|
}), [["__scopeId", "data-v-62756c32"]]);
|
|
23702
23705
|
//#endregion
|
|
23703
23706
|
//#region src/core/column/columnSettingsProjection.ts
|
|
23704
|
-
function
|
|
23707
|
+
function _T(e) {
|
|
23705
23708
|
return {
|
|
23706
23709
|
colId: e.colId,
|
|
23707
23710
|
label: e.label,
|
|
@@ -23713,20 +23716,20 @@ function gT(e) {
|
|
|
23713
23716
|
hidden: e.hidden
|
|
23714
23717
|
};
|
|
23715
23718
|
}
|
|
23716
|
-
function
|
|
23717
|
-
return e.map(
|
|
23719
|
+
function vT(e) {
|
|
23720
|
+
return e.map(_T);
|
|
23718
23721
|
}
|
|
23719
|
-
function
|
|
23722
|
+
function yT(e, t = {}) {
|
|
23720
23723
|
return nd({
|
|
23721
|
-
columns:
|
|
23724
|
+
columns: vT(e.getColumns()),
|
|
23722
23725
|
sortModel: e.getSortModel(),
|
|
23723
23726
|
filterModel: e.getFilterModel(),
|
|
23724
23727
|
isColumnFilterActive: (t) => e.isColumnFilterActive(t),
|
|
23725
23728
|
includeHidden: t.includeHidden
|
|
23726
23729
|
});
|
|
23727
23730
|
}
|
|
23728
|
-
function
|
|
23729
|
-
let n =
|
|
23731
|
+
function bT(e, t = {}) {
|
|
23732
|
+
let n = yT(e, t);
|
|
23730
23733
|
return {
|
|
23731
23734
|
rows: n,
|
|
23732
23735
|
grouped: rd(n),
|
|
@@ -23735,22 +23738,22 @@ function yT(e, t = {}) {
|
|
|
23735
23738
|
}
|
|
23736
23739
|
//#endregion
|
|
23737
23740
|
//#region src/core/column/columnSettingsPanelSubscribe.ts
|
|
23738
|
-
var
|
|
23741
|
+
var xT = [
|
|
23739
23742
|
"sortChanged",
|
|
23740
23743
|
"filterChanged",
|
|
23741
23744
|
"columnMoved",
|
|
23742
23745
|
"columnPinned",
|
|
23743
23746
|
"columnHiddenChanged"
|
|
23744
23747
|
];
|
|
23745
|
-
function
|
|
23746
|
-
let n =
|
|
23748
|
+
function ST(e, t) {
|
|
23749
|
+
let n = xT.map((n) => e.on(n, t));
|
|
23747
23750
|
return () => {
|
|
23748
23751
|
for (let e of n) e();
|
|
23749
23752
|
};
|
|
23750
23753
|
}
|
|
23751
23754
|
//#endregion
|
|
23752
23755
|
//#region src/components/ColumnSettings/ColumnSettingsPanel.vue?vue&type=script&setup=true&lang.ts
|
|
23753
|
-
var
|
|
23756
|
+
var CT = { class: "mg-column-settings__header-leading" }, wT = /*#__PURE__*/ Cw(/* @__PURE__ */ g({
|
|
23754
23757
|
__name: "ColumnSettingsPanel",
|
|
23755
23758
|
props: {
|
|
23756
23759
|
gridApi: {},
|
|
@@ -23769,12 +23772,12 @@ var ST = { class: "mg-column-settings__header-leading" }, CT = /*#__PURE__*/ Sw(
|
|
|
23769
23772
|
},
|
|
23770
23773
|
emits: ["close"],
|
|
23771
23774
|
setup(e, { emit: t }) {
|
|
23772
|
-
let n = e, r = t, i = j(
|
|
23775
|
+
let n = e, r = t, i = j(bT(n.gridApi)), a = null;
|
|
23773
23776
|
function o() {
|
|
23774
|
-
i.value =
|
|
23777
|
+
i.value = bT(n.gridApi);
|
|
23775
23778
|
}
|
|
23776
23779
|
function s() {
|
|
23777
|
-
c(), o(), a =
|
|
23780
|
+
c(), o(), a = ST(n.gridApi, o);
|
|
23778
23781
|
}
|
|
23779
23782
|
function c() {
|
|
23780
23783
|
a?.(), a = null;
|
|
@@ -23797,7 +23800,7 @@ var ST = { class: "mg-column-settings__header-leading" }, CT = /*#__PURE__*/ Sw(
|
|
|
23797
23800
|
class: b(N(Pu)),
|
|
23798
23801
|
role: "document",
|
|
23799
23802
|
"aria-label": "列设置"
|
|
23800
|
-
}, [f("header", { class: b(N(Fu)) }, [f("div",
|
|
23803
|
+
}, [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
23804
|
"grid-api": e.gridApi,
|
|
23802
23805
|
"can-clear-all-filters": i.value.canClearAllFilters,
|
|
23803
23806
|
onChange: l
|
|
@@ -23806,7 +23809,7 @@ var ST = { class: "mg-column-settings__header-leading" }, CT = /*#__PURE__*/ Sw(
|
|
|
23806
23809
|
class: "mg-column-settings__close",
|
|
23807
23810
|
"aria-label": "关闭列设置",
|
|
23808
23811
|
onClick: n[0] ||= (e) => r("close")
|
|
23809
|
-
}, " × ")], 2), f("div", { class: b(N(Iu)) }, [h(
|
|
23812
|
+
}, " × ")], 2), f("div", { class: b(N(Iu)) }, [h(gT, {
|
|
23810
23813
|
grouped: i.value.grouped,
|
|
23811
23814
|
"grid-api": e.gridApi,
|
|
23812
23815
|
"show-filter": e.showFilter,
|
|
@@ -23823,67 +23826,67 @@ var ST = { class: "mg-column-settings__header-leading" }, CT = /*#__PURE__*/ Sw(
|
|
|
23823
23826
|
}), [["__scopeId", "data-v-d618f6f4"]]);
|
|
23824
23827
|
//#endregion
|
|
23825
23828
|
//#region src/core/column/columnSettingsReset.ts
|
|
23826
|
-
function wT(e) {
|
|
23827
|
-
e.getSortModel().length !== 0 && e.setSortModel([]);
|
|
23828
|
-
}
|
|
23829
23829
|
function TT(e) {
|
|
23830
|
-
e.
|
|
23830
|
+
e.getSortModel().length !== 0 && e.setSortModel([]);
|
|
23831
23831
|
}
|
|
23832
23832
|
function ET(e) {
|
|
23833
|
-
e.
|
|
23833
|
+
e.clearAllFilters();
|
|
23834
23834
|
}
|
|
23835
23835
|
function DT(e) {
|
|
23836
|
-
|
|
23837
|
-
zS(t.map((e) => e.colId), n) || e.resetColumnOrder();
|
|
23836
|
+
e.resetColumnWidths();
|
|
23838
23837
|
}
|
|
23839
23838
|
function OT(e) {
|
|
23839
|
+
let t = e.getColumns(), n = zS(t);
|
|
23840
|
+
BS(t.map((e) => e.colId), n) || e.resetColumnOrder();
|
|
23841
|
+
}
|
|
23842
|
+
function kT(e) {
|
|
23840
23843
|
for (let t of e.getColumns()) !Qu(t.colId) || t.fixed === null || e.setColumnFixed(t.colId, null);
|
|
23841
23844
|
}
|
|
23842
|
-
function
|
|
23845
|
+
function AT(e, t) {
|
|
23843
23846
|
switch (t) {
|
|
23844
23847
|
case "sort":
|
|
23845
|
-
|
|
23848
|
+
TT(e);
|
|
23846
23849
|
break;
|
|
23847
23850
|
case "filter":
|
|
23848
|
-
|
|
23851
|
+
ET(e);
|
|
23849
23852
|
break;
|
|
23850
23853
|
case "width":
|
|
23851
|
-
|
|
23854
|
+
DT(e);
|
|
23852
23855
|
break;
|
|
23853
23856
|
case "order":
|
|
23854
|
-
|
|
23857
|
+
OT(e);
|
|
23855
23858
|
break;
|
|
23856
23859
|
case "pin":
|
|
23857
|
-
|
|
23860
|
+
kT(e);
|
|
23858
23861
|
break;
|
|
23859
|
-
case "all":
|
|
23862
|
+
case "all": TT(e), ET(e), DT(e), OT(e), kT(e);
|
|
23860
23863
|
}
|
|
23861
23864
|
}
|
|
23862
23865
|
//#endregion
|
|
23863
23866
|
//#region src/core/column/columnSettingsPopoverPosition.ts
|
|
23864
|
-
var
|
|
23865
|
-
function
|
|
23866
|
-
let r = Math.min(
|
|
23867
|
-
return a + n > window.innerHeight -
|
|
23867
|
+
var jT = 8, MT = 4, NT = 320, PT = 400, FT = 168;
|
|
23868
|
+
function IT(e, t, n) {
|
|
23869
|
+
let r = Math.min(PT, Math.max(NT, t)), i = e.right - r, a = e.bottom + MT;
|
|
23870
|
+
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
23871
|
left: i,
|
|
23869
23872
|
top: a
|
|
23870
23873
|
};
|
|
23871
23874
|
}
|
|
23872
|
-
function
|
|
23873
|
-
let r = Math.max(
|
|
23874
|
-
return a + n > window.innerHeight -
|
|
23875
|
+
function LT(e, t, n) {
|
|
23876
|
+
let r = Math.max(FT, t), i = e.left, 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)), {
|
|
23875
23878
|
left: i,
|
|
23876
23879
|
top: a
|
|
23877
23880
|
};
|
|
23878
23881
|
}
|
|
23879
23882
|
//#endregion
|
|
23880
23883
|
//#region src/components/ColumnSettings/ColumnSettingsButton.vue?vue&type=script&setup=true&lang.ts
|
|
23881
|
-
var
|
|
23884
|
+
var RT = [
|
|
23882
23885
|
"disabled",
|
|
23883
23886
|
"aria-expanded",
|
|
23884
23887
|
"aria-label",
|
|
23885
23888
|
"title"
|
|
23886
|
-
],
|
|
23889
|
+
], zT = /* @__PURE__ */ g({
|
|
23887
23890
|
__name: "ColumnSettingsButton",
|
|
23888
23891
|
props: {
|
|
23889
23892
|
gridApi: {},
|
|
@@ -23945,7 +23948,7 @@ var LT = [
|
|
|
23945
23948
|
M(!0);
|
|
23946
23949
|
}
|
|
23947
23950
|
function ie(e) {
|
|
23948
|
-
|
|
23951
|
+
AT(n.gridApi, e), oe();
|
|
23949
23952
|
}
|
|
23950
23953
|
function ae() {
|
|
23951
23954
|
_.value && M(!1);
|
|
@@ -23964,10 +23967,10 @@ var LT = [
|
|
|
23964
23967
|
e.style.left = `${a}px`, e.style.top = `${s}px`, e.style.visibility = "";
|
|
23965
23968
|
}
|
|
23966
23969
|
function L() {
|
|
23967
|
-
ce(p.value,
|
|
23970
|
+
ce(p.value, LT);
|
|
23968
23971
|
}
|
|
23969
23972
|
function le() {
|
|
23970
|
-
ce(m.value,
|
|
23973
|
+
ce(m.value, IT);
|
|
23971
23974
|
}
|
|
23972
23975
|
function R() {
|
|
23973
23976
|
g.value && L(), _.value && le();
|
|
@@ -24025,7 +24028,7 @@ var LT = [
|
|
|
24025
24028
|
cx: "12",
|
|
24026
24029
|
cy: "12",
|
|
24027
24030
|
r: "3"
|
|
24028
|
-
})], -1)]], 8,
|
|
24031
|
+
})], -1)]], 8, RT), (E(), l(s, {
|
|
24029
24032
|
key: v.value,
|
|
24030
24033
|
to: O.value
|
|
24031
24034
|
}, [g.value ? (E(), d("div", {
|
|
@@ -24035,7 +24038,7 @@ var LT = [
|
|
|
24035
24038
|
ref_key: "menuRef",
|
|
24036
24039
|
ref: p,
|
|
24037
24040
|
class: b(N(zu))
|
|
24038
|
-
}, [h(
|
|
24041
|
+
}, [h(bw, {
|
|
24039
24042
|
"show-divider": k.value,
|
|
24040
24043
|
onColumnSettings: re,
|
|
24041
24044
|
onCustomAction: oe,
|
|
@@ -24053,7 +24056,7 @@ var LT = [
|
|
|
24053
24056
|
role: "dialog",
|
|
24054
24057
|
"aria-modal": "false",
|
|
24055
24058
|
"aria-label": "列设置面板"
|
|
24056
|
-
}, [h(
|
|
24059
|
+
}, [h(wT, {
|
|
24057
24060
|
"grid-api": e.gridApi,
|
|
24058
24061
|
open: _.value,
|
|
24059
24062
|
"show-visibility": e.showVisibility,
|
|
@@ -24066,7 +24069,7 @@ var LT = [
|
|
|
24066
24069
|
"show-filter"
|
|
24067
24070
|
])], 2)], 2)) : u("", !0)], 8, ["to"]))], 6));
|
|
24068
24071
|
}
|
|
24069
|
-
}),
|
|
24072
|
+
}), BT = {
|
|
24070
24073
|
input: {
|
|
24071
24074
|
deferEnterCommit: !1,
|
|
24072
24075
|
commitOnChange: !1
|
|
@@ -24076,8 +24079,8 @@ var LT = [
|
|
|
24076
24079
|
commitOnChange: !0
|
|
24077
24080
|
}
|
|
24078
24081
|
};
|
|
24079
|
-
function
|
|
24080
|
-
let n =
|
|
24082
|
+
function VT(e, t) {
|
|
24083
|
+
let n = BT[t.strategy ?? "input"], r = t.formatValue ?? ((e) => String(e ?? "")), i = t.commitOnChange ?? n.commitOnChange;
|
|
24081
24084
|
w(() => {
|
|
24082
24085
|
e.setGetValue?.(() => r(t.getValue())), e.setKeyboardPolicy?.({ deferEnterCommit: n.deferEnterCommit }), e.autoFocus !== !1 && t.onStart?.();
|
|
24083
24086
|
});
|
|
@@ -24107,6 +24110,6 @@ function BT(e, t) {
|
|
|
24107
24110
|
};
|
|
24108
24111
|
}
|
|
24109
24112
|
//#endregion
|
|
24110
|
-
export { Ee as BUILTIN_CELL_EDITOR_NAMES, Wi as COLUMN_DRAG_THRESHOLD_PX,
|
|
24113
|
+
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
24114
|
|
|
24112
24115
|
//# sourceMappingURL=index.es.js.map
|