argus-table 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/argus-table.js +38 -13
- package/dist/argus-table.js.map +1 -1
- package/dist/cdn/argus-table.js +260 -434
- package/dist/cdn/argus-table.js.map +1 -1
- package/dist/controllers/pin-scroll-controller.js +78 -0
- package/dist/controllers/pin-scroll-controller.js.map +1 -0
- package/dist/custom-elements.json +61 -1
- package/dist/render/body.js +0 -1
- package/dist/render/body.js.map +1 -1
- package/dist/render/header.js +0 -1
- package/dist/render/header.js.map +1 -1
- package/dist/styles/base.js +1 -225
- package/dist/styles/base.js.map +1 -1
- package/package.json +2 -1
package/dist/cdn/argus-table.js
CHANGED
|
@@ -2913,9 +2913,47 @@ var Gi = class {
|
|
|
2913
2913
|
clear() {
|
|
2914
2914
|
this.#e.clear(), this.#t = [], this.#n = 0, this.#r = void 0;
|
|
2915
2915
|
}
|
|
2916
|
+
}, Ki = 150, qi = class {
|
|
2917
|
+
#e;
|
|
2918
|
+
#t;
|
|
2919
|
+
#n = 0;
|
|
2920
|
+
#r;
|
|
2921
|
+
#i;
|
|
2922
|
+
constructor(e, t) {
|
|
2923
|
+
this.#e = t, e.addController(this);
|
|
2924
|
+
}
|
|
2925
|
+
hostConnected() {
|
|
2926
|
+
this.#a();
|
|
2927
|
+
}
|
|
2928
|
+
hostUpdated() {
|
|
2929
|
+
this.#a();
|
|
2930
|
+
}
|
|
2931
|
+
hostDisconnected() {
|
|
2932
|
+
this.#t?.removeEventListener("scroll", this.#o), this.#i?.disconnect(), clearTimeout(this.#r), this.#t = void 0;
|
|
2933
|
+
}
|
|
2934
|
+
measure() {
|
|
2935
|
+
let e = this.#t;
|
|
2936
|
+
if (e) {
|
|
2937
|
+
e.style.setProperty("--_max-x", `${String(Math.max(0, e.scrollWidth - e.clientWidth))}px`);
|
|
2938
|
+
for (let t of e.parentNode?.querySelectorAll(":scope > .pin-shadow") ?? []) t.style.setProperty("--_view-h", `${String(e.clientHeight)}px`), t.style.setProperty("--_sb-x", `${String(e.offsetWidth - e.clientWidth)}px`);
|
|
2939
|
+
this.#n = e.scrollLeft, e.style.setProperty("--_sx", `${String(this.#n)}px`);
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
#a() {
|
|
2943
|
+
let e = this.#e();
|
|
2944
|
+
e && e !== this.#t && (this.#t = e, e.addEventListener("scroll", this.#o, { passive: !0 }), this.#i ??= new ResizeObserver(() => {
|
|
2945
|
+
this.measure();
|
|
2946
|
+
}), this.#i.observe(e), this.measure());
|
|
2947
|
+
}
|
|
2948
|
+
#o = () => {
|
|
2949
|
+
let e = this.#t;
|
|
2950
|
+
e && e.scrollLeft !== this.#n && (this.#n = e.scrollLeft, e.toggleAttribute("data-hscroll", !0), clearTimeout(this.#r), this.#r = setTimeout(() => {
|
|
2951
|
+
this.measure(), e.removeAttribute("data-hscroll");
|
|
2952
|
+
}, Ki));
|
|
2953
|
+
};
|
|
2916
2954
|
};
|
|
2917
2955
|
// src/controllers/resize-drag.ts
|
|
2918
|
-
function
|
|
2956
|
+
function Ji(e, t, n, r, i) {
|
|
2919
2957
|
let a = t.clientX, o = 0, s, c = () => {
|
|
2920
2958
|
o = 0, s !== void 0 && i(s), s = void 0;
|
|
2921
2959
|
}, l = (e) => {
|
|
@@ -2930,7 +2968,7 @@ function Ki(e, t, n, r, i) {
|
|
|
2930
2968
|
e.setAttribute("data-active", ""), e.addEventListener("pointermove", l), e.addEventListener("pointerup", u), e.addEventListener("pointercancel", u);
|
|
2931
2969
|
}
|
|
2932
2970
|
// src/controllers/table-controller.ts
|
|
2933
|
-
var
|
|
2971
|
+
var Yi = class {
|
|
2934
2972
|
constructor() {
|
|
2935
2973
|
this.model = Ui({
|
|
2936
2974
|
columns: [],
|
|
@@ -2945,10 +2983,10 @@ var qi = class {
|
|
|
2945
2983
|
}
|
|
2946
2984
|
};
|
|
2947
2985
|
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.19.11/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js
|
|
2948
|
-
function
|
|
2986
|
+
function Xi(e) {
|
|
2949
2987
|
return typeof e == "object" ? e.key : e;
|
|
2950
2988
|
}
|
|
2951
|
-
function
|
|
2989
|
+
function Zi(e, t) {
|
|
2952
2990
|
let n = e.length;
|
|
2953
2991
|
return new Proxy(e, { get(e, r, i) {
|
|
2954
2992
|
if (typeof r == "string") {
|
|
@@ -2987,11 +3025,11 @@ function K(e, t, n) {
|
|
|
2987
3025
|
r = e;
|
|
2988
3026
|
}, o;
|
|
2989
3027
|
}
|
|
2990
|
-
function
|
|
3028
|
+
function Qi(e, t) {
|
|
2991
3029
|
if (e === void 0) throw Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
|
|
2992
3030
|
return e;
|
|
2993
3031
|
}
|
|
2994
|
-
var q = (e, t) => Math.abs(e - t) < 1.01,
|
|
3032
|
+
var q = (e, t) => Math.abs(e - t) < 1.01, $i = (e, t, n) => {
|
|
2995
3033
|
let r;
|
|
2996
3034
|
return Object.assign(function(...i) {
|
|
2997
3035
|
e.clearTimeout(r), r = e.setTimeout(() => t.apply(this, i), n);
|
|
@@ -3000,46 +3038,46 @@ var q = (e, t) => Math.abs(e - t) < 1.01, Zi = (e, t, n) => {
|
|
|
3000
3038
|
} });
|
|
3001
3039
|
};
|
|
3002
3040
|
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.19.11/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.js
|
|
3003
|
-
function
|
|
3041
|
+
function ea({ offset: e, isScrolling: t, elementMax: n, holdOffset: r, scrollOffset: i, pendingWrite: a, clampedMaxAtWrite: o }) {
|
|
3004
3042
|
return t && a === null && e === i ? "spurious" : a !== null && Math.abs(e - a.target) < 1.5 ? "readBack" : a !== null && !a.smooth && n !== null && a.target > n + r + .5 && Math.abs(e - (n + r)) < 1.5 || a !== null && !a.smooth && a.lowMaxes?.some((t) => Math.abs(e - t) < 1.5) ? "clampedReadBack" : o !== null && Math.abs(e - o) < 1.5 ? "clampedEcho" : "external";
|
|
3005
3043
|
}
|
|
3006
|
-
var
|
|
3007
|
-
function
|
|
3008
|
-
return e !== "spurious" && e !== "readBack" && e !== "clampedReadBack" && n?.index != null && n.phase !== "queued" &&
|
|
3044
|
+
var ta = (e) => e === "smooth" || e === "smoothFinishing";
|
|
3045
|
+
function na({ kind: e, offset: t, command: n, target: r }) {
|
|
3046
|
+
return e !== "spurious" && e !== "readBack" && e !== "clampedReadBack" && n?.index != null && n.phase !== "queued" && !ta(n.phase) && !q(t, n.lastTargetOffset) && !q(t, r()) && e !== "clampedEcho";
|
|
3009
3047
|
}
|
|
3010
|
-
var
|
|
3011
|
-
function
|
|
3048
|
+
var ra = 40;
|
|
3049
|
+
function ia(e) {
|
|
3012
3050
|
let t = e[e.length - 1];
|
|
3013
3051
|
if (t === void 0) return !1;
|
|
3014
3052
|
let n = e.length - 2;
|
|
3015
|
-
for (; n >= 0 && t.t - e[n].t <
|
|
3053
|
+
for (; n >= 0 && t.t - e[n].t < ra;) n--;
|
|
3016
3054
|
if (n < 0) return !1;
|
|
3017
3055
|
let r = e[n], i = n - 1;
|
|
3018
|
-
for (; i >= 0 && r.t - e[i].t <
|
|
3056
|
+
for (; i >= 0 && r.t - e[i].t < ra;) i--;
|
|
3019
3057
|
if (i < 0) return !1;
|
|
3020
3058
|
let a = e[i], o = (t.offset - r.offset) / (t.t - r.t), s = (r.offset - a.offset) / (r.t - a.t);
|
|
3021
3059
|
return o * s >= 0 && Math.abs(o) >= 2 * Math.abs(s) && Math.abs(o) - Math.abs(s) >= .8;
|
|
3022
3060
|
}
|
|
3023
|
-
function
|
|
3061
|
+
function aa(e) {
|
|
3024
3062
|
let t = e[e.length - 1];
|
|
3025
3063
|
if (t === void 0) return !1;
|
|
3026
3064
|
let n = e.length - 2;
|
|
3027
|
-
for (; n >= 0 && t.t - e[n].t <
|
|
3065
|
+
for (; n >= 0 && t.t - e[n].t < ra;) n--;
|
|
3028
3066
|
if (n < 0) return !1;
|
|
3029
3067
|
let r = e[n];
|
|
3030
3068
|
return Math.abs(t.offset - r.offset) / (t.t - r.t) >= .05;
|
|
3031
3069
|
}
|
|
3032
3070
|
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.19.11/node_modules/@tanstack/virtual-core/dist/esm/ios-gesture.js
|
|
3033
|
-
var
|
|
3034
|
-
if (
|
|
3035
|
-
if (typeof navigator > "u") return
|
|
3036
|
-
if (/iP(hone|od|ad)/.test(navigator.userAgent)) return
|
|
3071
|
+
var oa, sa = () => {
|
|
3072
|
+
if (oa !== void 0) return oa;
|
|
3073
|
+
if (typeof navigator > "u") return oa = !1;
|
|
3074
|
+
if (/iP(hone|od|ad)/.test(navigator.userAgent)) return oa = !0;
|
|
3037
3075
|
let e = navigator.maxTouchPoints;
|
|
3038
|
-
return
|
|
3039
|
-
},
|
|
3076
|
+
return oa = navigator.platform === "MacIntel" && e !== void 0 && e > 0;
|
|
3077
|
+
}, ca, la = () => ca === void 0 ? ca = sa() && typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("overflow-anchor: auto") : ca, ua = () => !sa() || la(), J = {
|
|
3040
3078
|
capture: !0,
|
|
3041
3079
|
passive: !0
|
|
3042
|
-
},
|
|
3080
|
+
}, da = class {
|
|
3043
3081
|
constructor(e) {
|
|
3044
3082
|
this.host = e, this._touch = null, this.inMotion = () => this._touch !== null && this._touch.phase !== "lateFling", this.dragging = () => this._touch?.phase === "down" && this._touch.moved, this.tail = () => this._touch?.phase === "tail" ? this._touch.moved ? "fling" : "tap" : null, this.onScroll = ({ isScrolling: e, ownReadBack: t, moved: n, external: r }) => (e && this._touch?.phase === "tail" ? this._openTail(this._touch.moved || !t, !1) : this._touch?.phase === "lateFling" && (this.host.now() > this._touch.until ? this._touch = null : r && e && n && this._openTail(!0, !1)), !t && e && n && this._touch?.phase === "down" ? (this._touch.moved = !0, !0) : !1), this.touchStart = () => {
|
|
3045
3083
|
this.end(), this._touch = {
|
|
@@ -3078,13 +3116,13 @@ var ia, aa = () => {
|
|
|
3078
3116
|
get touch() {
|
|
3079
3117
|
return this._touch;
|
|
3080
3118
|
}
|
|
3081
|
-
},
|
|
3119
|
+
}, fa = (e) => {
|
|
3082
3120
|
let { clientWidth: t, clientHeight: n } = e;
|
|
3083
3121
|
return {
|
|
3084
3122
|
width: t,
|
|
3085
3123
|
height: n
|
|
3086
3124
|
};
|
|
3087
|
-
},
|
|
3125
|
+
}, pa = (e) => {
|
|
3088
3126
|
let t = /* @__PURE__ */ new Set();
|
|
3089
3127
|
return {
|
|
3090
3128
|
schedule: (n) => {
|
|
@@ -3097,11 +3135,11 @@ var ia, aa = () => {
|
|
|
3097
3135
|
t.forEach((t) => e.cancelAnimationFrame(t)), t.clear();
|
|
3098
3136
|
}
|
|
3099
3137
|
};
|
|
3100
|
-
},
|
|
3138
|
+
}, ma = (e) => e, ha = (e) => {
|
|
3101
3139
|
let t = e.overscan * Math.max(e.lanes ?? 1, 1), n = Math.max(e.startIndex - t, 0), r = Math.min(e.endIndex + t, e.count - 1) - n + 1, i = Array(r);
|
|
3102
3140
|
for (let e = 0; e < r; e++) i[e] = n + e;
|
|
3103
3141
|
return i;
|
|
3104
|
-
},
|
|
3142
|
+
}, ga = (e, t) => {
|
|
3105
3143
|
let n = e.scrollElement;
|
|
3106
3144
|
if (!n) return;
|
|
3107
3145
|
let r = e.targetWindow;
|
|
@@ -3113,31 +3151,31 @@ var ia, aa = () => {
|
|
|
3113
3151
|
height: Math.round(r)
|
|
3114
3152
|
});
|
|
3115
3153
|
};
|
|
3116
|
-
if (i(
|
|
3117
|
-
let a =
|
|
3154
|
+
if (i(fa(n)), !r.ResizeObserver) return () => {};
|
|
3155
|
+
let a = pa(r), o = new r.ResizeObserver(() => {
|
|
3118
3156
|
let t = () => {
|
|
3119
|
-
i(
|
|
3157
|
+
i(fa(n));
|
|
3120
3158
|
};
|
|
3121
3159
|
e.options.useAnimationFrameWithResizeObserver ? a.schedule(t) : t();
|
|
3122
3160
|
});
|
|
3123
3161
|
return o.observe(n, { box: "content-box" }), () => {
|
|
3124
3162
|
o.unobserve(n), a.cancel();
|
|
3125
3163
|
};
|
|
3126
|
-
},
|
|
3164
|
+
}, _a = { passive: !0 }, va = typeof window > "u" || "onscrollend" in window, ya = (e, t, n) => {
|
|
3127
3165
|
let r = e.scrollElement;
|
|
3128
3166
|
if (!r) return;
|
|
3129
3167
|
let i = e.targetWindow;
|
|
3130
3168
|
if (!i) return;
|
|
3131
|
-
let a = e.options.useScrollendEvent &&
|
|
3169
|
+
let a = e.options.useScrollendEvent && va, o = 0, s = a ? null : $i(i, () => t(n(r), !1), e.options.isScrollingResetDelay), c = (e) => () => {
|
|
3132
3170
|
o = n(r), s?.(), t(o, e);
|
|
3133
3171
|
}, l = c(!0), u = c(!1);
|
|
3134
|
-
return r.addEventListener("scroll", l,
|
|
3172
|
+
return r.addEventListener("scroll", l, _a), a && r.addEventListener("scrollend", u, _a), () => {
|
|
3135
3173
|
r.removeEventListener("scroll", l), a && r.removeEventListener("scrollend", u), s?.cancel();
|
|
3136
3174
|
};
|
|
3137
|
-
},
|
|
3175
|
+
}, ba = (e, t) => ya(e, t, (t) => {
|
|
3138
3176
|
let { horizontal: n, isRtl: r } = e.options;
|
|
3139
3177
|
return n ? t.scrollLeft * (r && -1 || 1) : t.scrollTop;
|
|
3140
|
-
}),
|
|
3178
|
+
}), xa = (e, t, n) => {
|
|
3141
3179
|
if (n.options.useCachedMeasurements) {
|
|
3142
3180
|
let t = n.indexFromElement(e), r = n.options.getItemKey(t);
|
|
3143
3181
|
return n.itemSizeCache.get(r) ?? n.options.estimateSize(t);
|
|
@@ -3151,15 +3189,15 @@ var ia, aa = () => {
|
|
|
3151
3189
|
if (i !== void 0) return i;
|
|
3152
3190
|
}
|
|
3153
3191
|
return e[n.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
3154
|
-
},
|
|
3192
|
+
}, Sa = (e, { adjustments: t = 0, behavior: n }, r) => {
|
|
3155
3193
|
var i;
|
|
3156
3194
|
let { scrollElement: a, options: o } = r, s = e + t, c = o.horizontal && o.isRtl && a !== null && "ownerDocument" in a;
|
|
3157
3195
|
(i = a?.scrollTo) == null || i.call(a, {
|
|
3158
3196
|
[o.horizontal ? "left" : "top"]: c ? -s : s,
|
|
3159
3197
|
behavior: n
|
|
3160
3198
|
});
|
|
3161
|
-
},
|
|
3162
|
-
function
|
|
3199
|
+
}, Ca = (e, t) => e === "smooth" ? t ? "smoothLanded" : "smooth" : "instant", wa = (e) => e?.phase === "smooth" || e?.phase === "smoothLanded";
|
|
3200
|
+
function Ta(e, t, n, r) {
|
|
3163
3201
|
if (t === 0) return !1;
|
|
3164
3202
|
let i = r(0), a = /* @__PURE__ */ new Set(), o = 0;
|
|
3165
3203
|
for (; o < e;) {
|
|
@@ -3173,9 +3211,9 @@ function Ca(e, t, n, r) {
|
|
|
3173
3211
|
for (let e = s; e < t; e++) if (a.has(r(e))) return !1;
|
|
3174
3212
|
return !0;
|
|
3175
3213
|
}
|
|
3176
|
-
var
|
|
3214
|
+
var Ea = class {
|
|
3177
3215
|
constructor(e) {
|
|
3178
|
-
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this._singleLaneMeasurements = null, this.itemSizeCache = /* @__PURE__ */ new Map(), this.itemSizeCacheVersion = 0, this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMin = null, this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.pendingScrollAnchor = null, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this._holdOffset = 0, this._reportedOverscroll = !1, this._iosGesture = new
|
|
3216
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this._singleLaneMeasurements = null, this.itemSizeCache = /* @__PURE__ */ new Map(), this.itemSizeCacheVersion = 0, this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMin = null, this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.pendingScrollAnchor = null, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this._holdOffset = 0, this._reportedOverscroll = !1, this._iosGesture = new da({
|
|
3179
3217
|
getWindow: () => this.targetWindow,
|
|
3180
3218
|
now: () => this.now(),
|
|
3181
3219
|
tailStillMoving: () => {
|
|
@@ -3189,7 +3227,7 @@ var wa = class {
|
|
|
3189
3227
|
},
|
|
3190
3228
|
onTailClosed: () => {
|
|
3191
3229
|
let e = this.scrollState;
|
|
3192
|
-
e?.phase === "queued" &&
|
|
3230
|
+
e?.phase === "queued" && aa(e.samples ?? []) && (this.scrollState = null), this._flushHoldIfReady(!0), this._writeAwaitingCommand(), this._retryClampedAdjustment();
|
|
3193
3231
|
}
|
|
3194
3232
|
}), this._lastElementOffset = null, this.pendingWrite = null, this._clampedAdjustment = null, this.elementsCache = /* @__PURE__ */ new Map(), this._resizeBatch = null, this.now = () => {
|
|
3195
3233
|
var e;
|
|
@@ -3199,7 +3237,7 @@ var wa = class {
|
|
|
3199
3237
|
if (e) return e;
|
|
3200
3238
|
let r = this.targetWindow;
|
|
3201
3239
|
if (!r || !r.ResizeObserver) return null;
|
|
3202
|
-
let i = t =
|
|
3240
|
+
let i = t = pa(r);
|
|
3203
3241
|
return e = new r.ResizeObserver((e) => {
|
|
3204
3242
|
let t = () => {
|
|
3205
3243
|
let t = { sync: !1 };
|
|
@@ -3259,10 +3297,10 @@ var wa = class {
|
|
|
3259
3297
|
scrollPaddingStart: 0,
|
|
3260
3298
|
scrollPaddingEnd: 0,
|
|
3261
3299
|
horizontal: !1,
|
|
3262
|
-
getItemKey:
|
|
3263
|
-
rangeExtractor:
|
|
3300
|
+
getItemKey: ma,
|
|
3301
|
+
rangeExtractor: ha,
|
|
3264
3302
|
onChange: () => {},
|
|
3265
|
-
measureElement:
|
|
3303
|
+
measureElement: xa,
|
|
3266
3304
|
initialRect: {
|
|
3267
3305
|
width: 0,
|
|
3268
3306
|
height: 0
|
|
@@ -3289,13 +3327,13 @@ var wa = class {
|
|
|
3289
3327
|
}
|
|
3290
3328
|
let n = this.options, r = null, i = null, a = !1;
|
|
3291
3329
|
if (n !== void 0 && n.enabled && t.enabled && t.anchorTo === "end" && this.scrollElement !== null) {
|
|
3292
|
-
let e = n.count, o = t.count, s = this.getMeasurements(), c = this._singleLaneMeasurements?.items ?? s, l = (e) =>
|
|
3330
|
+
let e = n.count, o = t.count, s = this.getMeasurements(), c = this._singleLaneMeasurements?.items ?? s, l = (e) => Xi(c[e]), u = e > 0 ? l(0) : null, d = e > 0 ? l(e - 1) : null;
|
|
3293
3331
|
if (o !== e || e > 0 && o > 0 && (t.getItemKey(0) !== u || t.getItemKey(o - 1) !== d)) {
|
|
3294
3332
|
a = !0;
|
|
3295
3333
|
let c = e > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? s[0] : null;
|
|
3296
3334
|
c && (r = [c.key, this.getScrollOffset() - c.start]);
|
|
3297
3335
|
let u = t.followOnAppend === !0 ? "auto" : t.followOnAppend || null;
|
|
3298
|
-
u && o > 0 && this.isAtEnd(n.scrollEndThreshold) && (e === 0 || t.getItemKey(o - 1) !== d) && (o > e ||
|
|
3336
|
+
u && o > 0 && this.isAtEnd(n.scrollEndThreshold) && (e === 0 || t.getItemKey(o - 1) !== d) && (o > e || Ta(e, o, l, t.getItemKey)) && (i = u);
|
|
3299
3337
|
}
|
|
3300
3338
|
}
|
|
3301
3339
|
this.options = t, a && (this.pendingMin = 0, this.itemSizeCacheVersion++);
|
|
@@ -3358,7 +3396,7 @@ var wa = class {
|
|
|
3358
3396
|
this._lastElementOffset = i, e = this._toLayoutOffset(e);
|
|
3359
3397
|
let a = this._classifyScrollEvent(e, t, n);
|
|
3360
3398
|
if (a === "spurious") return;
|
|
3361
|
-
a === "readBack" ? e = this.pendingWrite.target : a === "clampedReadBack" && this.scrollState?.index != null && e < this.getMaxScrollOffset() - 1.5 ? this.scrollState.lastTargetOffset = e :
|
|
3399
|
+
a === "readBack" ? e = this.pendingWrite.target : a === "clampedReadBack" && this.scrollState?.index != null && e < this.getMaxScrollOffset() - 1.5 ? this.scrollState.lastTargetOffset = e : na({
|
|
3362
3400
|
kind: a,
|
|
3363
3401
|
offset: e,
|
|
3364
3402
|
command: this.scrollState,
|
|
@@ -3374,7 +3412,7 @@ var wa = class {
|
|
|
3374
3412
|
c.samples = [...(c.samples ?? []).filter((t) => e - t.t <= 200), {
|
|
3375
3413
|
t: e,
|
|
3376
3414
|
offset: i
|
|
3377
|
-
}], (s !== null && this.scrollDirection !== s ||
|
|
3415
|
+
}], (s !== null && this.scrollDirection !== s || ia(c.samples)) && (this.scrollState = null);
|
|
3378
3416
|
}
|
|
3379
3417
|
}
|
|
3380
3418
|
this._iosGesture.onScroll({
|
|
@@ -3387,8 +3425,8 @@ var wa = class {
|
|
|
3387
3425
|
}
|
|
3388
3426
|
this._noteClampMax();
|
|
3389
3427
|
let t = this.pendingScrollAnchor;
|
|
3390
|
-
this.pendingScrollAnchor = null, t && this.scrollElement && this.options.enabled && (t.kind === "anchor" ? this._canWriteScroll() ?
|
|
3391
|
-
}, this._classifyScrollEvent = (e, t, n) =>
|
|
3428
|
+
this.pendingScrollAnchor = null, t && this.scrollElement && this.options.enabled && (t.kind === "anchor" ? this._canWriteScroll() ? wa(this.scrollState) && !q(this.getScrollOffset() - t.delta, this.scrollState.lastTargetOffset) || (this._followOffsetTarget(t.delta), this._scrollToOffset(this.getScrollOffset())) : (this._holdOffset += t.delta, this._followOffsetTarget(t.delta), this.notify(!1)) : this.scrollToEnd({ behavior: t.behavior })), this._flushHoldIfReady(!1), this._retryClampedAdjustment();
|
|
3429
|
+
}, this._classifyScrollEvent = (e, t, n) => ea({
|
|
3392
3430
|
offset: e,
|
|
3393
3431
|
isScrolling: t,
|
|
3394
3432
|
elementMax: n,
|
|
@@ -3409,13 +3447,13 @@ var wa = class {
|
|
|
3409
3447
|
let { behavior: t } = e;
|
|
3410
3448
|
this.getMeasurements();
|
|
3411
3449
|
let n = this.getScrollStateTarget(e);
|
|
3412
|
-
e.lastTargetOffset = n, this._clampedAdjustment = null, e.phase =
|
|
3450
|
+
e.lastTargetOffset = n, this._clampedAdjustment = null, e.phase = Ca(t, e.index != null && q(n, this.getScrollOffset())), this._scrollToOffset(n, { behavior: t }), this.scheduleScrollReconcile();
|
|
3413
3451
|
}, this._readElementOffset = () => {
|
|
3414
3452
|
let e = this.scrollElement;
|
|
3415
3453
|
if (e == null) return null;
|
|
3416
3454
|
let { horizontal: t, isRtl: n } = this.options;
|
|
3417
3455
|
return typeof e.scrollTop == "number" ? t ? e.scrollLeft * (n && -1 || 1) : e.scrollTop : typeof e.scrollY == "number" ? t ? e.scrollX : e.scrollY : null;
|
|
3418
|
-
}, this._canWriteScroll = () => !(
|
|
3456
|
+
}, this._canWriteScroll = () => !(sa() && this._iosGesture.inMotion()) && !this._reportedOverscroll, this._flushHoldIfReady = (e) => {
|
|
3419
3457
|
if (this._holdOffset === 0 || !this.scrollElement || !this.options.enabled || !this._canWriteScroll() || this.scrollState?.phase === "smooth") return;
|
|
3420
3458
|
this._holdOffset = 0, this.scrollOffset !== null && this.scrollOffset < 0 && (this.scrollOffset = 0), this.notify(e);
|
|
3421
3459
|
let t = this.getCommandWrittenOffset() ?? this.getScrollOffset();
|
|
@@ -3468,7 +3506,7 @@ var wa = class {
|
|
|
3468
3506
|
flat: a,
|
|
3469
3507
|
items: o
|
|
3470
3508
|
};
|
|
3471
|
-
let d =
|
|
3509
|
+
let d = Zi(o, a);
|
|
3472
3510
|
return this.measurementsCache = d, d;
|
|
3473
3511
|
}
|
|
3474
3512
|
let d = this.measurementsCache.slice(0, u), f = Array(a).fill(void 0), p = new Float64Array(a), m = 0;
|
|
@@ -3513,7 +3551,7 @@ var wa = class {
|
|
|
3513
3551
|
], (e, t, n, r, i) => {
|
|
3514
3552
|
if (e.length === 0 || t === 0) return this.range = null, null;
|
|
3515
3553
|
let a = Math.max(i - t, 0);
|
|
3516
|
-
return this.range =
|
|
3554
|
+
return this.range = ka(e, t, Math.min(n, a), r, r === 1 && this._singleLaneMeasurements !== null ? this._singleLaneMeasurements.flat : null), this.range;
|
|
3517
3555
|
}, {
|
|
3518
3556
|
key: !1,
|
|
3519
3557
|
debug: () => this.options.debug
|
|
@@ -3544,7 +3582,7 @@ var wa = class {
|
|
|
3544
3582
|
let t = this.options.indexAttribute, n = e.getAttribute(t);
|
|
3545
3583
|
return n ? parseInt(n, 10) : (console.warn(`Missing attribute name '${t}={index}' on measured element.`), -1);
|
|
3546
3584
|
}, this.shouldMeasureDuringScroll = (e) => {
|
|
3547
|
-
if (!
|
|
3585
|
+
if (!wa(this.scrollState)) return !0;
|
|
3548
3586
|
let t = this.scrollState.index ?? this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;
|
|
3549
3587
|
if (t !== void 0 && this.range) {
|
|
3550
3588
|
let n = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2)), r = Math.max(0, t - n), i = Math.min(this.options.count - 1, t + n);
|
|
@@ -3575,7 +3613,7 @@ var wa = class {
|
|
|
3575
3613
|
}
|
|
3576
3614
|
let s = this.itemSizeCache.get(a) ?? r, c = t - s;
|
|
3577
3615
|
if (c !== 0) {
|
|
3578
|
-
let o = this.options.anchorTo === "end" && !
|
|
3616
|
+
let o = this.options.anchorTo === "end" && !wa(this.scrollState) && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, l = o ? this._getLayoutTotalSize() : 0, u = this.getScrollOffset(), d = this.itemSizeCache.has(a) ? i + s <= u && this.scrollDirection !== "backward" : i < u, f = !wa(this.scrollState) && (this.shouldAdjustScrollPositionOnItemSizeChange === void 0 ? d : this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e] ?? {
|
|
3579
3617
|
index: e,
|
|
3580
3618
|
key: a,
|
|
3581
3619
|
start: i,
|
|
@@ -3613,7 +3651,7 @@ var wa = class {
|
|
|
3613
3651
|
let t = this.getMeasurements();
|
|
3614
3652
|
if (t.length === 0) return;
|
|
3615
3653
|
let n = this._singleLaneMeasurements?.flat, r = this.options.lanes === 1 && n != null;
|
|
3616
|
-
return
|
|
3654
|
+
return Qi(t[Da(0, t.length - 1, r ? (e) => n[e * 2] : (e) => Qi(t[e]).start, e)]);
|
|
3617
3655
|
}, this._noteClampMax = () => {
|
|
3618
3656
|
if (!this._awaitingCommandReadBack()) return;
|
|
3619
3657
|
let e = this._elementMaxScrollOffset();
|
|
@@ -3751,7 +3789,7 @@ var wa = class {
|
|
|
3751
3789
|
}, this), r;
|
|
3752
3790
|
}, this.getCommandWrittenOffset = () => this.scrollState !== null && this.pendingWrite !== null && !this.pendingWrite.smooth ? this.pendingWrite.target : null, this._awaitingCommandReadBack = () => {
|
|
3753
3791
|
let e = this.getCommandWrittenOffset();
|
|
3754
|
-
return !(
|
|
3792
|
+
return !(sa() && this._iosGesture.dragging()) && e !== null && !q(e, this.getScrollOffset());
|
|
3755
3793
|
}, this._followOffsetTarget = (e) => {
|
|
3756
3794
|
this.scrollState !== null && this.scrollState.index == null && (this.scrollState.lastTargetOffset += e);
|
|
3757
3795
|
}, this.measure = () => {
|
|
@@ -3801,7 +3839,7 @@ var wa = class {
|
|
|
3801
3839
|
return;
|
|
3802
3840
|
}
|
|
3803
3841
|
} else if (this.scrollState.stableFrames = 0, n) {
|
|
3804
|
-
let t = this.getSize() || 600, n = Math.abs(e - this.getScrollOffset()), r =
|
|
3842
|
+
let t = this.getSize() || 600, n = Math.abs(e - this.getScrollOffset()), r = wa(this.scrollState) && n > t;
|
|
3805
3843
|
this.scrollState.lastTargetOffset = e, r ? this.scrollState.phase = "smooth" : this.scrollState.phase === "smooth" ? this.scrollState.phase = "smoothFinishing" : this.scrollState.phase === "smoothLanded" && (this.scrollState.phase = "instant"), this._scrollToOffset(e, { behavior: r ? "smooth" : "auto" });
|
|
3806
3844
|
}
|
|
3807
3845
|
this.scheduleScrollReconcile();
|
|
@@ -3810,7 +3848,7 @@ var wa = class {
|
|
|
3810
3848
|
this.pendingScrollAnchor = null, this._clampedAdjustment = null;
|
|
3811
3849
|
let i = this._iosGesture.tail();
|
|
3812
3850
|
if (r === "absolute" && i !== null) {
|
|
3813
|
-
if (i === "fling" &&
|
|
3851
|
+
if (i === "fling" && ua()) {
|
|
3814
3852
|
this._stopMomentum(() => {
|
|
3815
3853
|
this.scrollState?.phase !== "queued" || this._iosGesture.tail() !== "fling" || this._reportedOverscroll || (this._iosGesture.end(), this._flushHoldIfReady(!0), this._writeAwaitingCommand());
|
|
3816
3854
|
}), this.scrollState = {
|
|
@@ -3832,10 +3870,10 @@ var wa = class {
|
|
|
3832
3870
|
lastTargetOffset: t,
|
|
3833
3871
|
stableFrames: 0,
|
|
3834
3872
|
behavior: n,
|
|
3835
|
-
phase:
|
|
3873
|
+
phase: Ca(n, e.index != null && q(t, this.getScrollOffset()))
|
|
3836
3874
|
}, this._scrollToOffset(t, { behavior: n }), this.scheduleScrollReconcile();
|
|
3837
3875
|
}
|
|
3838
|
-
},
|
|
3876
|
+
}, Da = (e, t, n, r) => {
|
|
3839
3877
|
for (; e <= t;) {
|
|
3840
3878
|
let i = (e + t) / 2 | 0, a = n(i);
|
|
3841
3879
|
if (a < r) e = i + 1;
|
|
@@ -3844,7 +3882,7 @@ var wa = class {
|
|
|
3844
3882
|
}
|
|
3845
3883
|
return e > 0 ? e - 1 : 0;
|
|
3846
3884
|
};
|
|
3847
|
-
function
|
|
3885
|
+
function Oa(e, t, n) {
|
|
3848
3886
|
let r = 0;
|
|
3849
3887
|
for (; r <= t;) {
|
|
3850
3888
|
let i = (r + t) / 2 | 0, a = e[i * 2];
|
|
@@ -3854,21 +3892,21 @@ function Ea(e, t, n) {
|
|
|
3854
3892
|
}
|
|
3855
3893
|
return r > 0 ? r - 1 : 0;
|
|
3856
3894
|
}
|
|
3857
|
-
function
|
|
3895
|
+
function ka(e, t, n, r, i) {
|
|
3858
3896
|
let a = e.length - 1;
|
|
3859
3897
|
if (e.length <= r) return {
|
|
3860
3898
|
startIndex: 0,
|
|
3861
3899
|
endIndex: a
|
|
3862
3900
|
};
|
|
3863
3901
|
if (r === 1 && i !== null) {
|
|
3864
|
-
let e =
|
|
3902
|
+
let e = Oa(i, a, n), r = e, o = n + t;
|
|
3865
3903
|
for (; r < a && i[r * 2] + i[r * 2 + 1] < o;) r++;
|
|
3866
3904
|
return {
|
|
3867
3905
|
startIndex: e,
|
|
3868
3906
|
endIndex: r
|
|
3869
3907
|
};
|
|
3870
3908
|
}
|
|
3871
|
-
let o =
|
|
3909
|
+
let o = Da(0, a, (t) => e[t].start, n), s = o;
|
|
3872
3910
|
if (r === 1) for (; s < a && e[s].end < n + t;) s++;
|
|
3873
3911
|
else if (r > 1) {
|
|
3874
3912
|
let i = Array(r).fill(0);
|
|
@@ -3889,9 +3927,9 @@ function Da(e, t, n, r, i) {
|
|
|
3889
3927
|
};
|
|
3890
3928
|
}
|
|
3891
3929
|
// ../../node_modules/.pnpm/@tanstack+lit-virtual@3.15.3_lit@3.3.3/node_modules/@tanstack/lit-virtual/dist/esm/index.js
|
|
3892
|
-
var
|
|
3930
|
+
var Aa = class {
|
|
3893
3931
|
constructor(e, t) {
|
|
3894
|
-
this.cleanup = () => {}, this.host = e, this.options = { ...t }, this.virtualizer = new
|
|
3932
|
+
this.cleanup = () => {}, this.host = e, this.options = { ...t }, this.virtualizer = new Ea(this.resolveOptions(this.options)), this.host.addController(this);
|
|
3895
3933
|
}
|
|
3896
3934
|
getVirtualizer() {
|
|
3897
3935
|
return this.virtualizer;
|
|
@@ -3926,16 +3964,16 @@ var Oa = class {
|
|
|
3926
3964
|
}
|
|
3927
3965
|
};
|
|
3928
3966
|
}
|
|
3929
|
-
},
|
|
3967
|
+
}, ja = class extends Aa {
|
|
3930
3968
|
constructor(e, t) {
|
|
3931
3969
|
super(e, {
|
|
3932
|
-
observeElementRect:
|
|
3933
|
-
observeElementOffset:
|
|
3934
|
-
scrollToFn:
|
|
3970
|
+
observeElementRect: ga,
|
|
3971
|
+
observeElementOffset: ba,
|
|
3972
|
+
scrollToFn: Sa,
|
|
3935
3973
|
...t
|
|
3936
3974
|
});
|
|
3937
3975
|
}
|
|
3938
|
-
},
|
|
3976
|
+
}, Ma = class {
|
|
3939
3977
|
#e;
|
|
3940
3978
|
#t = new Gi();
|
|
3941
3979
|
#n = {
|
|
@@ -3945,7 +3983,7 @@ var Oa = class {
|
|
|
3945
3983
|
rowIdAt: String
|
|
3946
3984
|
};
|
|
3947
3985
|
constructor(e, t) {
|
|
3948
|
-
this.#e = new
|
|
3986
|
+
this.#e = new ja(e, {
|
|
3949
3987
|
count: 0,
|
|
3950
3988
|
getScrollElement: t,
|
|
3951
3989
|
estimateSize: () => this.#n.rowHeight,
|
|
@@ -3994,7 +4032,7 @@ var Oa = class {
|
|
|
3994
4032
|
scrollToIndex(e, t = "start") {
|
|
3995
4033
|
this.#e.getVirtualizer().scrollToIndex(e, { align: t });
|
|
3996
4034
|
}
|
|
3997
|
-
},
|
|
4035
|
+
}, Na = "argus-range-change", Pa = "argus-sort-change", Fa = "argus-column-resize", Ia = "argus-row-click", La = "argus-cell-click";
|
|
3998
4036
|
function Y(e, t, n) {
|
|
3999
4037
|
return e.dispatchEvent(new CustomEvent(t, {
|
|
4000
4038
|
detail: n,
|
|
@@ -4003,9 +4041,9 @@ function Y(e, t, n) {
|
|
|
4003
4041
|
}));
|
|
4004
4042
|
}
|
|
4005
4043
|
// ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive-helpers.js
|
|
4006
|
-
var { I:
|
|
4044
|
+
var { I: Ra } = Ae, za = (e) => e, Ba = () => document.createComment(""), Va = (e, t, n) => {
|
|
4007
4045
|
let r = e._$AA.parentNode, i = t === void 0 ? e._$AB : t._$AA;
|
|
4008
|
-
if (n === void 0) n = new
|
|
4046
|
+
if (n === void 0) n = new Ra(r.insertBefore(Ba(), i), r.insertBefore(Ba(), i), e, e.options);
|
|
4009
4047
|
else {
|
|
4010
4048
|
let t = n._$AB.nextSibling, a = n._$AM, o = a !== e;
|
|
4011
4049
|
if (o) {
|
|
@@ -4015,15 +4053,15 @@ var { I: Ia } = Ae, La = (e) => e, Ra = () => document.createComment(""), za = (
|
|
|
4015
4053
|
if (t !== i || o) {
|
|
4016
4054
|
let e = n._$AA;
|
|
4017
4055
|
for (; e !== t;) {
|
|
4018
|
-
let t =
|
|
4019
|
-
|
|
4056
|
+
let t = za(e).nextSibling;
|
|
4057
|
+
za(r).insertBefore(e, i), e = t;
|
|
4020
4058
|
}
|
|
4021
4059
|
}
|
|
4022
4060
|
}
|
|
4023
4061
|
return n;
|
|
4024
|
-
}, X = (e, t, n = e) => (e._$AI(t, n), e),
|
|
4062
|
+
}, X = (e, t, n = e) => (e._$AI(t, n), e), Ha = {}, Ua = (e, t = Ha) => e._$AH = t, Wa = (e) => e._$AH, Ga = (e) => {
|
|
4025
4063
|
e._$AR(), e._$AA.remove();
|
|
4026
|
-
},
|
|
4064
|
+
}, Ka = (e, t, n) => {
|
|
4027
4065
|
let r = /* @__PURE__ */ new Map();
|
|
4028
4066
|
for (let i = t; i <= n; i++) r.set(e[i], i);
|
|
4029
4067
|
return r;
|
|
@@ -4045,65 +4083,65 @@ var { I: Ia } = Ae, La = (e) => e, Ra = () => document.createComment(""), za = (
|
|
|
4045
4083
|
return this.dt(e, t, n).values;
|
|
4046
4084
|
}
|
|
4047
4085
|
update(e, [t, n, r]) {
|
|
4048
|
-
let i =
|
|
4086
|
+
let i = Wa(e), { values: a, keys: o } = this.dt(t, n, r);
|
|
4049
4087
|
if (!Array.isArray(i)) return this.ut = o, a;
|
|
4050
4088
|
let s = this.ut ??= [], c = [], l, u, d = 0, f = i.length - 1, p = 0, m = a.length - 1;
|
|
4051
4089
|
for (; d <= f && p <= m;) if (i[d] === null) d++;
|
|
4052
4090
|
else if (i[f] === null) f--;
|
|
4053
4091
|
else if (s[d] === o[p]) c[p] = X(i[d], a[p]), d++, p++;
|
|
4054
4092
|
else if (s[f] === o[m]) c[m] = X(i[f], a[m]), f--, m--;
|
|
4055
|
-
else if (s[d] === o[m]) c[m] = X(i[d], a[m]),
|
|
4056
|
-
else if (s[f] === o[p]) c[p] = X(i[f], a[p]),
|
|
4057
|
-
else if (l === void 0 && (l =
|
|
4093
|
+
else if (s[d] === o[m]) c[m] = X(i[d], a[m]), Va(e, c[m + 1], i[d]), d++, m--;
|
|
4094
|
+
else if (s[f] === o[p]) c[p] = X(i[f], a[p]), Va(e, i[d], i[f]), f--, p++;
|
|
4095
|
+
else if (l === void 0 && (l = Ka(o, p, m), u = Ka(s, d, f)), l.has(s[d])) {
|
|
4058
4096
|
if (l.has(s[f])) {
|
|
4059
4097
|
let t = u.get(o[p]), n = t === void 0 ? null : i[t];
|
|
4060
4098
|
if (n === null) {
|
|
4061
|
-
let t =
|
|
4099
|
+
let t = Va(e, i[d]);
|
|
4062
4100
|
X(t, a[p]), c[p] = t;
|
|
4063
|
-
} else c[p] = X(n, a[p]),
|
|
4101
|
+
} else c[p] = X(n, a[p]), Va(e, i[d], n), i[t] = null;
|
|
4064
4102
|
p++;
|
|
4065
|
-
} else
|
|
4066
|
-
} else
|
|
4103
|
+
} else Ga(i[f]), f--;
|
|
4104
|
+
} else Ga(i[d]), d++;
|
|
4067
4105
|
for (; p <= m;) {
|
|
4068
|
-
let t =
|
|
4106
|
+
let t = Va(e, c[m + 1]);
|
|
4069
4107
|
X(t, a[p]), c[p++] = t;
|
|
4070
4108
|
}
|
|
4071
4109
|
for (; d <= f;) {
|
|
4072
4110
|
let e = i[d++];
|
|
4073
|
-
e !== null &&
|
|
4111
|
+
e !== null && Ga(e);
|
|
4074
4112
|
}
|
|
4075
|
-
return this.ut = o,
|
|
4113
|
+
return this.ut = o, Ua(e, c), E;
|
|
4076
4114
|
}
|
|
4077
4115
|
});
|
|
4078
4116
|
// src/render/content.ts
|
|
4079
|
-
function
|
|
4117
|
+
function qa(e) {
|
|
4080
4118
|
return e == null ? D : typeof e == "number" ? String(e) : e;
|
|
4081
4119
|
}
|
|
4082
|
-
function
|
|
4120
|
+
function Ja(e) {
|
|
4083
4121
|
return e == null ? "" : e instanceof Date ? e.toLocaleString() : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
4084
4122
|
}
|
|
4085
|
-
var
|
|
4086
|
-
function
|
|
4123
|
+
var Ya = (e, t) => `c-${String(e)}-${String(t)}`, Xa = (e) => `h-${String(e)}`;
|
|
4124
|
+
function Za(e) {
|
|
4087
4125
|
let t = "cell";
|
|
4088
4126
|
return e.pin && (t += e.pinEdge ? " cell-pinned cell-pinned-edge" : " cell-pinned"), e.sorted && (t += " cell-sorted"), t;
|
|
4089
4127
|
}
|
|
4090
|
-
function
|
|
4128
|
+
function Qa(e) {
|
|
4091
4129
|
if (e) return e === "asc" ? "ascending" : "descending";
|
|
4092
4130
|
}
|
|
4093
|
-
function
|
|
4131
|
+
function $a(e) {
|
|
4094
4132
|
return e.pin ? `--_pin-offset: ${String(e.offset)}px` : void 0;
|
|
4095
4133
|
}
|
|
4096
4134
|
// src/render/body.ts
|
|
4097
|
-
function
|
|
4135
|
+
function eo(e, t, n, r) {
|
|
4098
4136
|
return T`<div
|
|
4099
4137
|
part="body"
|
|
4100
4138
|
role="rowgroup"
|
|
4101
4139
|
style=${Ue({ blockSize: `${String(n)}px` })}
|
|
4102
4140
|
>
|
|
4103
|
-
${Z(e, (e) => e.slot, (e) =>
|
|
4141
|
+
${Z(e, (e) => e.slot, (e) => to(e, t, e.index === r?.index ? r.col : void 0))}
|
|
4104
4142
|
</div>`;
|
|
4105
4143
|
}
|
|
4106
|
-
function
|
|
4144
|
+
function to(e, t, n) {
|
|
4107
4145
|
return T`<div
|
|
4108
4146
|
part=${e.index % 2 == 0 ? "row row-even" : "row row-odd"}
|
|
4109
4147
|
class="row"
|
|
@@ -4112,38 +4150,37 @@ function $a(e, t, n) {
|
|
|
4112
4150
|
style=${Ue({ transform: `translateY(${String(e.start)}px)` })}
|
|
4113
4151
|
>
|
|
4114
4152
|
${Z(t, (e) => e.id, (t) => T`<div
|
|
4115
|
-
part=${
|
|
4153
|
+
part=${Za(t)}
|
|
4116
4154
|
role="gridcell"
|
|
4117
4155
|
aria-colindex=${t.colIndex}
|
|
4118
4156
|
tabindex=${t.id === n ? 0 : -1}
|
|
4119
4157
|
data-col=${t.id}
|
|
4120
4158
|
data-align=${t.align}
|
|
4121
4159
|
data-pin=${t.pin ?? D}
|
|
4122
|
-
|
|
4123
|
-
style=${Za(t) ?? D}
|
|
4160
|
+
style=${$a(t) ?? D}
|
|
4124
4161
|
>
|
|
4125
|
-
<slot name=${
|
|
4162
|
+
<slot name=${Ya(e.slot, t.colIndex)}></slot>
|
|
4126
4163
|
</div>`)}
|
|
4127
4164
|
</div>`;
|
|
4128
4165
|
}
|
|
4129
4166
|
// src/render/cells.ts
|
|
4130
|
-
function
|
|
4167
|
+
function no(e, t, n) {
|
|
4131
4168
|
let r = t.columns;
|
|
4132
|
-
Me(T`${Z(r, (e) => e.id, (e) => T`<div slot=${
|
|
4169
|
+
Me(T`${Z(r, (e) => e.id, (e) => T`<div slot=${Xa(e.colIndex)}>${ro(e)}</div>`)}${Z(n, (e) => e.slot, (e) => Z(r, (e) => e.id, (n) => T`<div slot=${Ya(e.slot, n.colIndex)}>${io(t, e.index, n)}</div>`))}`, e, { host: e });
|
|
4133
4170
|
}
|
|
4134
|
-
function
|
|
4171
|
+
function ro(e) {
|
|
4135
4172
|
let { header: t } = e;
|
|
4136
|
-
return
|
|
4173
|
+
return qa(typeof t == "function" ? t() : t);
|
|
4137
4174
|
}
|
|
4138
|
-
function
|
|
4175
|
+
function io(e, t, n) {
|
|
4139
4176
|
if (n.cell) {
|
|
4140
4177
|
let r = e.cellContext(t, n.id);
|
|
4141
|
-
return r ?
|
|
4178
|
+
return r ? qa(n.cell(r.row, r)) : "";
|
|
4142
4179
|
}
|
|
4143
|
-
return n.hasAccessor ?
|
|
4180
|
+
return n.hasAccessor ? Ja(e.valueAt(t, n.id)) : "";
|
|
4144
4181
|
}
|
|
4145
4182
|
// src/render/header.ts
|
|
4146
|
-
function
|
|
4183
|
+
function ao(e, t, n) {
|
|
4147
4184
|
return T`<div part="header" role="rowgroup">
|
|
4148
4185
|
<div
|
|
4149
4186
|
part="header-row"
|
|
@@ -4157,23 +4194,22 @@ function ro(e, t, n) {
|
|
|
4157
4194
|
part=${e.sorted ? "header-cell header-cell-sorted" : "header-cell"}
|
|
4158
4195
|
role="columnheader"
|
|
4159
4196
|
aria-colindex=${e.colIndex}
|
|
4160
|
-
aria-sort=${
|
|
4197
|
+
aria-sort=${Qa(e.sorted) ?? D}
|
|
4161
4198
|
data-col=${e.id}
|
|
4162
4199
|
data-sort-col=${e.sortable ? e.id : D}
|
|
4163
4200
|
tabindex=${e.id === n ? 0 : -1}
|
|
4164
4201
|
data-align=${e.align}
|
|
4165
4202
|
data-pin=${e.pin ?? D}
|
|
4166
|
-
|
|
4167
|
-
style=${Za(e) ?? D}
|
|
4203
|
+
style=${$a(e) ?? D}
|
|
4168
4204
|
>
|
|
4169
|
-
<slot name=${
|
|
4205
|
+
<slot name=${Xa(e.colIndex)}></slot>
|
|
4170
4206
|
${e.sortable ? T`<span class="sort-indicator" aria-hidden="true"></span>` : D}
|
|
4171
|
-
${e.resizable ?
|
|
4207
|
+
${e.resizable ? oo(e) : D}
|
|
4172
4208
|
</div>`)}
|
|
4173
4209
|
</div>
|
|
4174
4210
|
</div>`;
|
|
4175
4211
|
}
|
|
4176
|
-
function
|
|
4212
|
+
function oo(e) {
|
|
4177
4213
|
return T`<div
|
|
4178
4214
|
part="resize-handle"
|
|
4179
4215
|
role="separator"
|
|
@@ -4186,231 +4222,7 @@ function io(e) {
|
|
|
4186
4222
|
></div>`;
|
|
4187
4223
|
}
|
|
4188
4224
|
// src/styles/base.ts
|
|
4189
|
-
var
|
|
4190
|
-
@layer argus-base {
|
|
4191
|
-
:host {
|
|
4192
|
-
display: block;
|
|
4193
|
-
/* A table that virtualizes needs a bounded height; set your own on the element. */
|
|
4194
|
-
block-size: 400px;
|
|
4195
|
-
box-sizing: border-box;
|
|
4196
|
-
contain: content;
|
|
4197
|
-
color-scheme: light dark;
|
|
4198
|
-
color: var(--argus-fg, CanvasText);
|
|
4199
|
-
background: var(--argus-bg, Canvas);
|
|
4200
|
-
font: var(--argus-font, inherit);
|
|
4201
|
-
--_row-height: var(--argus-row-height, 40px);
|
|
4202
|
-
--_pad: var(--argus-cell-padding-inline, 12px);
|
|
4203
|
-
--_border: var(--argus-border-width, 1px) solid
|
|
4204
|
-
var(--argus-border-color, light-dark(#e5e7eb, #374151));
|
|
4205
|
-
/* 1 in LTR, -1 in RTL: mirrors the pinned-edge shadow. */
|
|
4206
|
-
--_dir: 1;
|
|
4207
|
-
}
|
|
4208
|
-
:host(:dir(rtl)) {
|
|
4209
|
-
--_dir: -1;
|
|
4210
|
-
}
|
|
4211
|
-
:host([density='compact']) {
|
|
4212
|
-
--_row-height: var(--argus-row-height, 32px);
|
|
4213
|
-
--_pad: var(--argus-cell-padding-inline, 8px);
|
|
4214
|
-
}
|
|
4215
|
-
:host([density='spacious']) {
|
|
4216
|
-
--_row-height: var(--argus-row-height, 52px);
|
|
4217
|
-
--_pad: var(--argus-cell-padding-inline, 16px);
|
|
4218
|
-
}
|
|
4219
|
-
:host([hidden]) {
|
|
4220
|
-
display: none;
|
|
4221
|
-
}
|
|
4222
|
-
|
|
4223
|
-
[part~='table'] {
|
|
4224
|
-
position: relative;
|
|
4225
|
-
block-size: 100%;
|
|
4226
|
-
overflow: auto;
|
|
4227
|
-
overscroll-behavior: contain;
|
|
4228
|
-
/* A cell moved to by keyboard scrolls clear of the sticky header and pinned columns. */
|
|
4229
|
-
scroll-padding-block-start: var(--_row-height);
|
|
4230
|
-
scroll-padding-inline: var(--_pin-start, 0) var(--_pin-end, 0);
|
|
4231
|
-
}
|
|
4232
|
-
|
|
4233
|
-
.row {
|
|
4234
|
-
display: grid;
|
|
4235
|
-
grid-template-columns: var(--_cols);
|
|
4236
|
-
inline-size: var(--_width);
|
|
4237
|
-
min-inline-size: 100%;
|
|
4238
|
-
block-size: var(--_row-height);
|
|
4239
|
-
box-sizing: border-box;
|
|
4240
|
-
}
|
|
4241
|
-
|
|
4242
|
-
[part~='header'] {
|
|
4243
|
-
position: sticky;
|
|
4244
|
-
inset-block-start: 0;
|
|
4245
|
-
z-index: 2;
|
|
4246
|
-
}
|
|
4247
|
-
|
|
4248
|
-
[part~='body'] {
|
|
4249
|
-
position: relative;
|
|
4250
|
-
contain: layout;
|
|
4251
|
-
}
|
|
4252
|
-
[part~='row'] {
|
|
4253
|
-
position: absolute;
|
|
4254
|
-
inset-block-start: 0;
|
|
4255
|
-
inset-inline-start: 0;
|
|
4256
|
-
--_row-bg: var(--argus-bg, Canvas);
|
|
4257
|
-
--_row-surface: var(--_row-bg);
|
|
4258
|
-
background: var(--_row-surface);
|
|
4259
|
-
}
|
|
4260
|
-
[part~='row-odd'] {
|
|
4261
|
-
--_row-bg: var(--argus-row-stripe-bg, var(--argus-bg, Canvas));
|
|
4262
|
-
}
|
|
4263
|
-
[part~='row']:hover {
|
|
4264
|
-
--_row-surface: var(--argus-row-hover-bg, var(--_row-bg));
|
|
4265
|
-
}
|
|
4266
|
-
|
|
4267
|
-
[part~='cell'],
|
|
4268
|
-
[part~='header-cell'] {
|
|
4269
|
-
display: flex;
|
|
4270
|
-
align-items: center;
|
|
4271
|
-
min-inline-size: 0;
|
|
4272
|
-
box-sizing: border-box;
|
|
4273
|
-
padding-inline: var(--_pad);
|
|
4274
|
-
overflow: hidden;
|
|
4275
|
-
white-space: nowrap;
|
|
4276
|
-
border-block-end: var(--_border);
|
|
4277
|
-
}
|
|
4278
|
-
[part~='header-cell'] {
|
|
4279
|
-
background: var(--argus-header-bg, light-dark(#f9fafb, #111827));
|
|
4280
|
-
color: var(--argus-header-fg, inherit);
|
|
4281
|
-
font-weight: 600;
|
|
4282
|
-
}
|
|
4283
|
-
[part~='header-cell'] {
|
|
4284
|
-
position: relative;
|
|
4285
|
-
}
|
|
4286
|
-
[part~='resize-handle'] {
|
|
4287
|
-
position: absolute;
|
|
4288
|
-
inset-block: 0;
|
|
4289
|
-
inset-inline-end: 0;
|
|
4290
|
-
inline-size: 8px;
|
|
4291
|
-
z-index: 1;
|
|
4292
|
-
cursor: col-resize;
|
|
4293
|
-
touch-action: none;
|
|
4294
|
-
}
|
|
4295
|
-
[part~='resize-handle']::after {
|
|
4296
|
-
content: '';
|
|
4297
|
-
position: absolute;
|
|
4298
|
-
inset-block: 25%;
|
|
4299
|
-
inset-inline-end: 0;
|
|
4300
|
-
inline-size: 2px;
|
|
4301
|
-
background: var(--argus-resize-handle-color, light-dark(#9ca3af, #6b7280));
|
|
4302
|
-
opacity: 0;
|
|
4303
|
-
}
|
|
4304
|
-
[part~='header-cell']:hover [part~='resize-handle']::after,
|
|
4305
|
-
[part~='header-cell']:focus-visible [part~='resize-handle']::after,
|
|
4306
|
-
[part~='resize-handle'][data-active]::after {
|
|
4307
|
-
opacity: 1;
|
|
4308
|
-
}
|
|
4309
|
-
[data-sort-col] {
|
|
4310
|
-
cursor: pointer;
|
|
4311
|
-
user-select: none;
|
|
4312
|
-
}
|
|
4313
|
-
[part~='header-cell']:focus-visible,
|
|
4314
|
-
[part~='cell']:focus-visible {
|
|
4315
|
-
outline: var(--argus-focus-ring, 2px solid Highlight);
|
|
4316
|
-
outline-offset: -2px;
|
|
4317
|
-
}
|
|
4318
|
-
/* A small chevron after the header content; only the sorted column shows it. */
|
|
4319
|
-
.sort-indicator {
|
|
4320
|
-
flex: none;
|
|
4321
|
-
inline-size: 0.35em;
|
|
4322
|
-
block-size: 0.35em;
|
|
4323
|
-
margin-inline-start: 0.4em;
|
|
4324
|
-
/* Physical sides on purpose: the chevron is rotated, so it must not mirror in RTL. */
|
|
4325
|
-
border-right: 0.12em solid currentColor;
|
|
4326
|
-
border-bottom: 0.12em solid currentColor;
|
|
4327
|
-
visibility: hidden;
|
|
4328
|
-
}
|
|
4329
|
-
[aria-sort] .sort-indicator {
|
|
4330
|
-
visibility: visible;
|
|
4331
|
-
}
|
|
4332
|
-
[aria-sort='ascending'] .sort-indicator {
|
|
4333
|
-
transform: translateY(0.1em) rotate(-135deg);
|
|
4334
|
-
}
|
|
4335
|
-
[aria-sort='descending'] .sort-indicator {
|
|
4336
|
-
transform: translateY(-0.1em) rotate(45deg);
|
|
4337
|
-
}
|
|
4338
|
-
[data-align='end'] .sort-indicator {
|
|
4339
|
-
order: -1;
|
|
4340
|
-
margin-inline: 0 0.4em;
|
|
4341
|
-
}
|
|
4342
|
-
/*
|
|
4343
|
-
* Pinned columns: sticky inside the scroll container, with offsets from the
|
|
4344
|
-
* table model. Logical insets make RTL work without extra rules.
|
|
4345
|
-
*/
|
|
4346
|
-
[data-pin] {
|
|
4347
|
-
position: sticky;
|
|
4348
|
-
z-index: 1;
|
|
4349
|
-
/* Visible so the edge shadow isn't clipped; slotted content still clips itself. */
|
|
4350
|
-
overflow: visible;
|
|
4351
|
-
}
|
|
4352
|
-
[data-pin='start'] {
|
|
4353
|
-
inset-inline-start: var(--_pin-offset);
|
|
4354
|
-
}
|
|
4355
|
-
[data-pin='end'] {
|
|
4356
|
-
inset-inline-end: var(--_pin-offset);
|
|
4357
|
-
}
|
|
4358
|
-
[part~='cell-pinned'] {
|
|
4359
|
-
background: var(--_row-surface);
|
|
4360
|
-
}
|
|
4361
|
-
/*
|
|
4362
|
-
* The edge shadow. --argus-pinned-shadow is written for a shadow falling
|
|
4363
|
-
* toward the end side; the start edge in RTL and the end edge in LTR mirror it.
|
|
4364
|
-
*/
|
|
4365
|
-
[data-pin-edge]::after {
|
|
4366
|
-
content: '';
|
|
4367
|
-
position: absolute;
|
|
4368
|
-
inset: 0;
|
|
4369
|
-
pointer-events: none;
|
|
4370
|
-
box-shadow: var(
|
|
4371
|
-
--argus-pinned-shadow,
|
|
4372
|
-
4px 0 6px -4px light-dark(rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.6))
|
|
4373
|
-
);
|
|
4374
|
-
transform: scaleX(var(--_dir));
|
|
4375
|
-
}
|
|
4376
|
-
[data-pin='end'][data-pin-edge]::after {
|
|
4377
|
-
transform: scaleX(calc(-1 * var(--_dir)));
|
|
4378
|
-
}
|
|
4379
|
-
|
|
4380
|
-
[data-align='center'] {
|
|
4381
|
-
justify-content: center;
|
|
4382
|
-
text-align: center;
|
|
4383
|
-
}
|
|
4384
|
-
[data-align='end'] {
|
|
4385
|
-
justify-content: flex-end;
|
|
4386
|
-
text-align: end;
|
|
4387
|
-
}
|
|
4388
|
-
::slotted(*) {
|
|
4389
|
-
min-inline-size: 0;
|
|
4390
|
-
overflow: hidden;
|
|
4391
|
-
text-overflow: ellipsis;
|
|
4392
|
-
}
|
|
4393
|
-
|
|
4394
|
-
[part~='empty'] {
|
|
4395
|
-
display: flex;
|
|
4396
|
-
align-items: center;
|
|
4397
|
-
justify-content: center;
|
|
4398
|
-
min-block-size: calc(100% - var(--_row-height));
|
|
4399
|
-
padding: var(--_pad);
|
|
4400
|
-
box-sizing: border-box;
|
|
4401
|
-
}
|
|
4402
|
-
|
|
4403
|
-
/* Measures the resolved row height in px for the virtualizer. */
|
|
4404
|
-
.probe {
|
|
4405
|
-
position: absolute;
|
|
4406
|
-
inset-block-start: 0;
|
|
4407
|
-
inline-size: 0;
|
|
4408
|
-
block-size: var(--_row-height);
|
|
4409
|
-
visibility: hidden;
|
|
4410
|
-
pointer-events: none;
|
|
4411
|
-
}
|
|
4412
|
-
}
|
|
4413
|
-
`;
|
|
4225
|
+
var so = o`@layer argus-base{:host{box-sizing:border-box;contain:content;color-scheme:light dark;block-size:400px;color:var(--argus-fg,CanvasText);background:var(--argus-bg,Canvas);font:var(--argus-font,inherit);--_row-height:var(--argus-row-height,40px);--_pad:var(--argus-cell-padding-inline,12px);--_border:var(--argus-border-width,1px) solid var(--argus-border-color,light-dark(#e5e7eb,#374151));--_dir:1;display:block}:host(:dir(rtl)){--_dir:-1}:host([density=compact]){--_row-height:var(--argus-row-height,32px);--_pad:var(--argus-cell-padding-inline,8px)}:host([density=spacious]){--_row-height:var(--argus-row-height,52px);--_pad:var(--argus-cell-padding-inline,16px)}:host([hidden]){display:none}[part~=table]{overscroll-behavior:contain;block-size:100%;scroll-padding-block-start:var(--_row-height);scroll-padding-inline:var(--_pin-start,0) var(--_pin-end,0);position:relative;overflow:auto}.row{grid-template-columns:var(--_cols);inline-size:var(--_width);min-inline-size:100%;block-size:var(--_row-height);box-sizing:border-box;display:grid}[part~=header]{z-index:2;position:sticky;inset-block-start:0}[part~=body]{contain:layout;position:relative}[part~=row]{--_row-bg:var(--argus-bg,Canvas);--_row-surface:var(--_row-bg);background:var(--_row-surface);position:absolute;inset-block-start:0;inset-inline-start:0}[part~=row-odd]{--_row-bg:var(--argus-row-stripe-bg,var(--argus-bg,Canvas))}[part~=row]:hover{--_row-surface:var(--argus-row-hover-bg,var(--_row-bg))}[part~=cell],[part~=header-cell]{box-sizing:border-box;min-inline-size:0;padding-inline:var(--_pad);white-space:nowrap;border-block-end:var(--_border);align-items:center;display:flex;overflow:hidden}[part~=header-cell]{background:var(--argus-header-bg,light-dark(#f9fafb,#111827));color:var(--argus-header-fg,inherit);font-weight:600;position:relative}[part~=resize-handle]{z-index:1;cursor:col-resize;touch-action:none;inline-size:8px;position:absolute;inset-block:0;inset-inline-end:0}[part~=resize-handle]:after{content:"";background:var(--argus-resize-handle-color,light-dark(#9ca3af,#6b7280));opacity:0;inline-size:2px;position:absolute;inset-block:25%;inset-inline-end:0}[part~=header-cell]:hover [part~=resize-handle]:after,[part~=header-cell]:focus-visible [part~=resize-handle]:after,[part~=resize-handle][data-active]:after{opacity:1}[data-sort-col]{cursor:pointer;user-select:none}[part~=header-cell]:focus-visible,[part~=cell]:focus-visible{outline:var(--argus-focus-ring,2px solid Highlight);outline-offset:-2px}.sort-indicator{visibility:hidden;border-bottom:.12em solid;border-right:.12em solid;flex:none;block-size:.35em;inline-size:.35em;margin-inline-start:.4em}[aria-sort] .sort-indicator{visibility:visible}[aria-sort=ascending] .sort-indicator{transform:translateY(.1em)rotate(-135deg)}[aria-sort=descending] .sort-indicator{transform:translateY(-.1em)rotate(45deg)}[data-align=end] .sort-indicator{order:-1;margin-inline:0 .4em}[data-pin]{z-index:1;position:sticky}[data-pin=start]{inset-inline-start:var(--_pin-offset)}[data-pin=end]{inset-inline-end:var(--_pin-offset)}[part~=row]>[data-pin]{position:relative;inset-inline:auto}[part~=row]>[data-pin=start]{transform:translateX(var(--_sx,0px))}[part~=row]>[data-pin=end]{transform:translateX(calc(var(--_sx,0px) - var(--_dir) * var(--_max-x,0px)))}[data-hscroll] [part~=row]>[data-pin]{position:sticky;transform:none}[data-hscroll] [part~=row]>[data-pin=start]{inset-inline-start:var(--_pin-offset)}[data-hscroll] [part~=row]>[data-pin=end]{inset-inline-end:var(--_pin-offset)}[part~=cell-pinned]{background:var(--_row-surface)}.pin-shadow{block-size:min(var(--_view-h,100%), var(--_content-h,100%));z-index:3;pointer-events:none;position:absolute;inset-block-start:0}.pin-shadow[data-side=start]{inset-inline-start:0}.pin-shadow[data-side=end]{inset-inline-end:var(--_sb-x,0px)}.pin-shadow:after{content:"";box-shadow:var(--argus-pinned-shadow,4px 0 6px -4px light-dark(#0003,#0009));transform:scaleX(var(--_dir));position:absolute;inset:0}.pin-shadow[data-side=end]:after{transform:scaleX(calc(-1 * var(--_dir)))}[data-align=center]{text-align:center;justify-content:center}[data-align=end]{text-align:end;justify-content:flex-end}::slotted(*){text-overflow:ellipsis;min-inline-size:0;overflow:hidden}[part~=empty]{min-block-size:calc(100% - var(--_row-height));padding:var(--_pad);box-sizing:border-box;justify-content:center;align-items:center;display:flex}.probe{inline-size:0;block-size:var(--_row-height);visibility:hidden;pointer-events:none;position:absolute;inset-block-start:0}}`;
|
|
4414
4226
|
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
4415
4227
|
function Q(e, t, n, r) {
|
|
4416
4228
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
@@ -4419,51 +4231,62 @@ function Q(e, t, n, r) {
|
|
|
4419
4231
|
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
4420
4232
|
}
|
|
4421
4233
|
// src/argus-table.ts
|
|
4422
|
-
function
|
|
4234
|
+
function co(e) {
|
|
4423
4235
|
let t = e.attachInternals();
|
|
4424
4236
|
return t.role = "grid", t;
|
|
4425
4237
|
}
|
|
4426
|
-
function
|
|
4238
|
+
function lo(e) {
|
|
4427
4239
|
for (let t of e.composedPath()) if (t instanceof HTMLElement) {
|
|
4428
4240
|
if (t.dataset.resizeCol !== void 0) return;
|
|
4429
4241
|
if (t.dataset.sortCol !== void 0) return t.dataset.sortCol;
|
|
4430
4242
|
if (t.getAttribute("part") === "header-row") return;
|
|
4431
4243
|
}
|
|
4432
4244
|
}
|
|
4433
|
-
var
|
|
4434
|
-
function
|
|
4245
|
+
var uo = 10;
|
|
4246
|
+
function fo(e) {
|
|
4435
4247
|
if (!(e instanceof HTMLElement) || e.dataset.col === void 0) return;
|
|
4436
4248
|
let t = e.getAttribute("role");
|
|
4437
4249
|
return t === "gridcell" || t === "columnheader" ? e : void 0;
|
|
4438
4250
|
}
|
|
4439
|
-
function
|
|
4251
|
+
function po(e) {
|
|
4440
4252
|
return Number(e?.getAttribute("aria-rowindex") ?? 1) - 2;
|
|
4441
4253
|
}
|
|
4442
|
-
function
|
|
4254
|
+
function mo(e, t, n, r) {
|
|
4255
|
+
return t === 0 ? D : T`<div
|
|
4256
|
+
class="pin-shadow"
|
|
4257
|
+
data-side=${e}
|
|
4258
|
+
aria-hidden="true"
|
|
4259
|
+
style=${Ue({
|
|
4260
|
+
inlineSize: `${String(t)}px`,
|
|
4261
|
+
"--_content-h": `${String((n + 1) * r)}px`
|
|
4262
|
+
})}
|
|
4263
|
+
></div>`;
|
|
4264
|
+
}
|
|
4265
|
+
function ho(e) {
|
|
4443
4266
|
return e.flex === void 0 ? `${String(e.width)}px` : `minmax(${String(e.minWidth)}px, ${String(e.flex)}fr)`;
|
|
4444
4267
|
}
|
|
4445
4268
|
var $ = class extends j {
|
|
4446
4269
|
constructor(...e) {
|
|
4447
|
-
super(...e), this.columns = [], this.data = [], this.density = "comfortable", this.overscan = 6, this.#e = Wi([]), this.#t = Wi({}), this.#i =
|
|
4270
|
+
super(...e), this.columns = [], this.data = [], this.density = "comfortable", this.overscan = 6, this.#e = Wi([]), this.#t = Wi({}), this.#i = co(this), this.#a = new Yi(), this.#o = new Ma(this, () => this.renderRoot.querySelector("[part~=\"table\"]")), this.#s = new qi(this, () => this.renderRoot.querySelector("[part~=\"table\"]")), this.#c = 40, this.#u = {
|
|
4448
4271
|
rows: [],
|
|
4449
4272
|
totalSize: 0,
|
|
4450
4273
|
range: null
|
|
4451
|
-
}, this.#
|
|
4274
|
+
}, this.#f = !1, this.#p = "", this.#m = {
|
|
4452
4275
|
click: (e) => {
|
|
4453
|
-
let t =
|
|
4454
|
-
t !== void 0 && this.#
|
|
4276
|
+
let t = lo(e);
|
|
4277
|
+
t !== void 0 && this.#T(t);
|
|
4455
4278
|
},
|
|
4456
4279
|
pointerdown: (e) => {
|
|
4457
4280
|
if (e.button !== 0) return;
|
|
4458
4281
|
let t = e.composedPath()[0];
|
|
4459
4282
|
if (!(t instanceof HTMLElement)) return;
|
|
4460
4283
|
let n = t.dataset.resizeCol, r = t.parentElement;
|
|
4461
|
-
n !== void 0 && r &&
|
|
4462
|
-
this.#
|
|
4284
|
+
n !== void 0 && r && Ji(t, e, r.getBoundingClientRect().width, this.#C(), (e) => {
|
|
4285
|
+
this.#w(n, e);
|
|
4463
4286
|
});
|
|
4464
4287
|
}
|
|
4465
|
-
}, this.#
|
|
4466
|
-
let t =
|
|
4288
|
+
}, this.#h = (e) => {
|
|
4289
|
+
let t = fo(e.composedPath()[0] ?? e.target ?? this), n = t?.dataset.col;
|
|
4467
4290
|
if (!t || n === void 0) return;
|
|
4468
4291
|
if (e.key === "Tab" && e.shiftKey) {
|
|
4469
4292
|
let n = e.currentTarget;
|
|
@@ -4475,20 +4298,20 @@ var $ = class extends j {
|
|
|
4475
4298
|
let r = t.getAttribute("role") === "columnheader", { key: i } = e;
|
|
4476
4299
|
if (r && e.altKey && (i === "ArrowLeft" || i === "ArrowRight")) {
|
|
4477
4300
|
e.preventDefault();
|
|
4478
|
-
let r = i === "ArrowRight" == (this.#
|
|
4479
|
-
this.#
|
|
4301
|
+
let r = i === "ArrowRight" == (this.#C() === 1);
|
|
4302
|
+
this.#w(n, this.#S(n, t) + (r ? uo : -10));
|
|
4480
4303
|
return;
|
|
4481
4304
|
}
|
|
4482
4305
|
if (r && (i === "Enter" || i === " ") && t.dataset.sortCol !== void 0) {
|
|
4483
|
-
e.preventDefault(), this.#
|
|
4306
|
+
e.preventDefault(), this.#T(n);
|
|
4484
4307
|
return;
|
|
4485
4308
|
}
|
|
4486
4309
|
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
|
|
4487
4310
|
if (!r && i === "Enter") {
|
|
4488
|
-
e.preventDefault(), this.#
|
|
4311
|
+
e.preventDefault(), this.#v(e.composedPath());
|
|
4489
4312
|
return;
|
|
4490
4313
|
}
|
|
4491
|
-
let a = this.#a.model, o = a.columns, s = r ? -1 :
|
|
4314
|
+
let a = this.#a.model, o = a.columns, s = r ? -1 : po(t.parentElement), c = o.findIndex((e) => e.id === n);
|
|
4492
4315
|
switch (i) {
|
|
4493
4316
|
case "ArrowDown":
|
|
4494
4317
|
s = Math.min(s + 1, a.rowCount - 1);
|
|
@@ -4497,10 +4320,10 @@ var $ = class extends j {
|
|
|
4497
4320
|
s = Math.max(s - 1, -1);
|
|
4498
4321
|
break;
|
|
4499
4322
|
case "ArrowRight":
|
|
4500
|
-
c += this.#
|
|
4323
|
+
c += this.#C();
|
|
4501
4324
|
break;
|
|
4502
4325
|
case "ArrowLeft":
|
|
4503
|
-
c -= this.#
|
|
4326
|
+
c -= this.#C();
|
|
4504
4327
|
break;
|
|
4505
4328
|
case "Home":
|
|
4506
4329
|
c = 0;
|
|
@@ -4512,17 +4335,17 @@ var $ = class extends j {
|
|
|
4512
4335
|
}
|
|
4513
4336
|
e.preventDefault();
|
|
4514
4337
|
let l = o[Math.min(Math.max(c, 0), o.length - 1)];
|
|
4515
|
-
l && this.#
|
|
4516
|
-
}, this.#
|
|
4338
|
+
l && this.#y(s, l.id, a);
|
|
4339
|
+
}, this.#g = (e) => {
|
|
4517
4340
|
let t = e.currentTarget;
|
|
4518
4341
|
if (e.composedPath()[0] === t) {
|
|
4519
4342
|
let n = e.relatedTarget;
|
|
4520
|
-
n instanceof Node && t.contains(n) || (this.#
|
|
4343
|
+
n instanceof Node && t.contains(n) || (this.#f = !0, this.requestUpdate());
|
|
4521
4344
|
} else for (let t of e.composedPath()) {
|
|
4522
|
-
let n =
|
|
4345
|
+
let n = fo(t);
|
|
4523
4346
|
if (n?.dataset.col !== void 0) {
|
|
4524
|
-
let e = n.getAttribute("role") === "columnheader" ? -1 :
|
|
4525
|
-
(e !== this.#
|
|
4347
|
+
let e = n.getAttribute("role") === "columnheader" ? -1 : po(n.parentElement), { col: t } = n.dataset;
|
|
4348
|
+
(e !== this.#d?.index || t !== this.#d.col) && (this.#d = {
|
|
4526
4349
|
index: e,
|
|
4527
4350
|
rowId: this.#a.model.rowAt(e)?.id,
|
|
4528
4351
|
col: t
|
|
@@ -4531,12 +4354,12 @@ var $ = class extends j {
|
|
|
4531
4354
|
}
|
|
4532
4355
|
if (t === e.currentTarget) return;
|
|
4533
4356
|
}
|
|
4534
|
-
}, this.#
|
|
4535
|
-
this.#
|
|
4357
|
+
}, this.#_ = (e) => {
|
|
4358
|
+
this.#v(e.composedPath());
|
|
4536
4359
|
};
|
|
4537
4360
|
}
|
|
4538
4361
|
static {
|
|
4539
|
-
this.styles =
|
|
4362
|
+
this.styles = so;
|
|
4540
4363
|
}
|
|
4541
4364
|
get sorting() {
|
|
4542
4365
|
return this.#e.value;
|
|
@@ -4563,11 +4386,12 @@ var $ = class extends j {
|
|
|
4563
4386
|
#u;
|
|
4564
4387
|
#d;
|
|
4565
4388
|
#f;
|
|
4389
|
+
#p;
|
|
4566
4390
|
connectedCallback() {
|
|
4567
|
-
super.connectedCallback(), this.hasAttribute("role") || this.setAttribute("role", "grid"), this.hasUpdated && this.#
|
|
4391
|
+
super.connectedCallback(), this.hasAttribute("role") || this.setAttribute("role", "grid"), this.hasUpdated && this.#E();
|
|
4568
4392
|
}
|
|
4569
4393
|
disconnectedCallback() {
|
|
4570
|
-
super.disconnectedCallback(), this.#
|
|
4394
|
+
super.disconnectedCallback(), this.#l?.disconnect();
|
|
4571
4395
|
}
|
|
4572
4396
|
async scrollToRow(e) {
|
|
4573
4397
|
await this.updateComplete, this.#o.scrollToIndex(e), await this.updateComplete;
|
|
@@ -4581,11 +4405,11 @@ var $ = class extends j {
|
|
|
4581
4405
|
columnSizing: this.#t.value
|
|
4582
4406
|
});
|
|
4583
4407
|
let t = this.#a.model;
|
|
4584
|
-
this.#
|
|
4585
|
-
let n = this.#
|
|
4408
|
+
this.#x(t);
|
|
4409
|
+
let n = this.#d;
|
|
4586
4410
|
this.#i.ariaRowCount = String(t.rowCount + 1), this.#i.ariaColCount = String(t.columns.length), this.#o.configure({
|
|
4587
4411
|
count: t.rowCount,
|
|
4588
|
-
rowHeight: this.#
|
|
4412
|
+
rowHeight: this.#c,
|
|
4589
4413
|
overscan: Math.max(0, this.overscan),
|
|
4590
4414
|
rowIdAt: (e) => t.rowAt(e)?.id ?? String(e),
|
|
4591
4415
|
keep: n?.rowId === void 0 ? void 0 : {
|
|
@@ -4596,64 +4420,66 @@ var $ = class extends j {
|
|
|
4596
4420
|
}
|
|
4597
4421
|
render() {
|
|
4598
4422
|
let e = this.#a.model, t = e.columns;
|
|
4599
|
-
this.#
|
|
4600
|
-
let n = (e) =>
|
|
4601
|
-
"--_cols": t.map(
|
|
4423
|
+
this.#u = this.#o.computeWindow();
|
|
4424
|
+
let n = (e) => t.reduce((t, n) => n.pin === e ? t + n.width : t, 0), r = (e) => `${String(n(e))}px`, i = {
|
|
4425
|
+
"--_cols": t.map(ho).join(" "),
|
|
4602
4426
|
"--_width": `${String(e.totalWidth)}px`,
|
|
4603
|
-
"--_pin-start":
|
|
4604
|
-
"--_pin-end":
|
|
4605
|
-
},
|
|
4606
|
-
index:
|
|
4607
|
-
col:
|
|
4427
|
+
"--_pin-start": r("start"),
|
|
4428
|
+
"--_pin-end": r("end")
|
|
4429
|
+
}, a = this.#d, o = a && a.index >= 0 ? {
|
|
4430
|
+
index: a.index,
|
|
4431
|
+
col: a.col
|
|
4608
4432
|
} : void 0;
|
|
4609
|
-
return this.rowHeight !== void 0 && this.rowHeight > 0 && (
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4433
|
+
return this.rowHeight !== void 0 && this.rowHeight > 0 && (i["--_row-height"] = `${String(this.rowHeight)}px`), T`<div
|
|
4434
|
+
part="table"
|
|
4435
|
+
role="presentation"
|
|
4436
|
+
style=${Ue(i)}
|
|
4437
|
+
@keydown=${this.#h}
|
|
4438
|
+
@focusin=${this.#g}
|
|
4439
|
+
@click=${this.#_}
|
|
4440
|
+
>
|
|
4441
|
+
${ao(t, this.#m, a?.index === -1 ? a.col : void 0)}
|
|
4442
|
+
${e.rowCount === 0 ? T`<div part="empty"><slot name="empty">No rows</slot></div>` : eo(this.#u.rows, t, this.#u.totalSize, o)}
|
|
4443
|
+
<div class="probe" aria-hidden="true"></div>
|
|
4444
|
+
</div>
|
|
4445
|
+
${mo("start", n("start"), e.rowCount, this.#c)}
|
|
4446
|
+
${mo("end", n("end"), e.rowCount, this.#c)}`;
|
|
4621
4447
|
}
|
|
4622
4448
|
firstUpdated() {
|
|
4623
|
-
this.#
|
|
4449
|
+
this.#E(), this.#D();
|
|
4624
4450
|
}
|
|
4625
4451
|
updated(e) {
|
|
4626
|
-
if (
|
|
4452
|
+
if (no(this, this.#a.model, this.#u.rows), (e.has("columns") || e.has("columnSizing")) && this.#s.measure(), this.#f && (this.#f = !1, this.#b()), (e.has("density") || e.has("rowHeight")) && this.#D(), this.#n) {
|
|
4627
4453
|
let e = this.#n;
|
|
4628
|
-
this.#n = void 0, Y(this,
|
|
4454
|
+
this.#n = void 0, Y(this, Fa, e);
|
|
4629
4455
|
}
|
|
4630
4456
|
if (this.#r) {
|
|
4631
4457
|
let e = this.#r;
|
|
4632
|
-
this.#r = void 0, Y(this,
|
|
4458
|
+
this.#r = void 0, Y(this, Pa, { sorting: e });
|
|
4633
4459
|
}
|
|
4634
|
-
let { range: t } = this.#
|
|
4635
|
-
t && n !== this.#
|
|
4460
|
+
let { range: t } = this.#u, n = t ? `${String(t.start)}:${String(t.end)}` : "";
|
|
4461
|
+
t && n !== this.#p && (this.#p = n, Y(this, Na, {
|
|
4636
4462
|
start: t.start,
|
|
4637
4463
|
end: t.end
|
|
4638
4464
|
}));
|
|
4639
4465
|
}
|
|
4640
|
-
#p;
|
|
4641
4466
|
#m;
|
|
4642
4467
|
#h;
|
|
4643
4468
|
#g;
|
|
4644
|
-
#_
|
|
4469
|
+
#_;
|
|
4470
|
+
#v(e) {
|
|
4645
4471
|
let t;
|
|
4646
4472
|
for (let n of e) {
|
|
4647
4473
|
if (!(n instanceof HTMLElement)) continue;
|
|
4648
4474
|
let e = n.getAttribute("role");
|
|
4649
4475
|
if (e === "gridcell" && (t = n.dataset.col), e !== "row") continue;
|
|
4650
|
-
let r = this.#a.model, i =
|
|
4476
|
+
let r = this.#a.model, i = po(n), a = i >= 0 ? r.rowAt(i) : void 0;
|
|
4651
4477
|
if (!a) return;
|
|
4652
|
-
t !== void 0 && Y(this,
|
|
4478
|
+
t !== void 0 && Y(this, La, {
|
|
4653
4479
|
row: a.original,
|
|
4654
4480
|
columnId: t,
|
|
4655
4481
|
value: r.valueAt(i, t)
|
|
4656
|
-
}), Y(this,
|
|
4482
|
+
}), Y(this, Ia, {
|
|
4657
4483
|
row: a.original,
|
|
4658
4484
|
rowId: a.id,
|
|
4659
4485
|
index: i
|
|
@@ -4661,15 +4487,15 @@ var $ = class extends j {
|
|
|
4661
4487
|
return;
|
|
4662
4488
|
}
|
|
4663
4489
|
}
|
|
4664
|
-
#
|
|
4665
|
-
this.#
|
|
4490
|
+
#y(e, t, n) {
|
|
4491
|
+
this.#d = {
|
|
4666
4492
|
index: e,
|
|
4667
4493
|
rowId: e >= 0 ? n.rowAt(e)?.id : void 0,
|
|
4668
4494
|
col: t
|
|
4669
|
-
}, this.#
|
|
4495
|
+
}, this.#f = !0, this.requestUpdate();
|
|
4670
4496
|
}
|
|
4671
|
-
#
|
|
4672
|
-
let e = this.#
|
|
4497
|
+
#b() {
|
|
4498
|
+
let e = this.#d;
|
|
4673
4499
|
if (!e) return;
|
|
4674
4500
|
let t = CSS.escape(e.col), n = e.index === -1 ? `[part~='header-row'] > [data-col="${t}"]` : `[part~='body'] > [aria-rowindex="${String(e.index + 2)}"] > [data-col="${t}"]`, r = this.renderRoot.querySelector(n);
|
|
4675
4501
|
r && (r.scrollIntoView({
|
|
@@ -4677,37 +4503,37 @@ var $ = class extends j {
|
|
|
4677
4503
|
inline: "nearest"
|
|
4678
4504
|
}), r.focus({ preventScroll: !0 }));
|
|
4679
4505
|
}
|
|
4680
|
-
#
|
|
4506
|
+
#x(e) {
|
|
4681
4507
|
let t = e.columns, n = t[0];
|
|
4682
4508
|
if (!n) {
|
|
4683
|
-
this.#
|
|
4509
|
+
this.#d = void 0;
|
|
4684
4510
|
return;
|
|
4685
4511
|
}
|
|
4686
|
-
let r = this.#
|
|
4512
|
+
let r = this.#d ?? {
|
|
4687
4513
|
index: -1,
|
|
4688
4514
|
rowId: void 0,
|
|
4689
4515
|
col: n.id
|
|
4690
4516
|
}, i = t.some((e) => e.id === r.col) ? r.col : n.id, { index: a, rowId: o } = r;
|
|
4691
4517
|
if (o !== void 0) {
|
|
4692
4518
|
let t = e.indexOf(o);
|
|
4693
|
-
t === void 0 ? (a = Math.min(a, e.rowCount - 1), o = e.rowAt(a)?.id, this.matches(":focus-within") && (this.#
|
|
4519
|
+
t === void 0 ? (a = Math.min(a, e.rowCount - 1), o = e.rowAt(a)?.id, this.matches(":focus-within") && (this.#f = !0)) : a = t;
|
|
4694
4520
|
}
|
|
4695
|
-
a === r.index && o === r.rowId && i === r.col && this.#
|
|
4521
|
+
a === r.index && o === r.rowId && i === r.col && this.#d || (this.#d = {
|
|
4696
4522
|
index: a,
|
|
4697
4523
|
rowId: o,
|
|
4698
4524
|
col: i
|
|
4699
4525
|
});
|
|
4700
4526
|
}
|
|
4701
|
-
#
|
|
4527
|
+
#S(e, t) {
|
|
4702
4528
|
let n = this.#t.value[e];
|
|
4703
4529
|
if (n !== void 0) return n;
|
|
4704
4530
|
let r = this.#a.model.columns.find((t) => t.id === e);
|
|
4705
4531
|
return r && r.flex === void 0 ? r.width : t.getBoundingClientRect().width;
|
|
4706
4532
|
}
|
|
4707
|
-
#
|
|
4533
|
+
#C() {
|
|
4708
4534
|
return getComputedStyle(this).direction === "rtl" ? -1 : 1;
|
|
4709
4535
|
}
|
|
4710
|
-
#
|
|
4536
|
+
#w(e, t) {
|
|
4711
4537
|
let n = this.#a.model.nextSizing(e, t), r = n?.[e];
|
|
4712
4538
|
if (!n || r === void 0 || r === this.#t.value[e]) return;
|
|
4713
4539
|
let i = this.#t.value, { value: a, applied: o } = this.#t.request(n), s = {
|
|
@@ -4715,29 +4541,29 @@ var $ = class extends j {
|
|
|
4715
4541
|
width: r,
|
|
4716
4542
|
sizing: a
|
|
4717
4543
|
};
|
|
4718
|
-
o ? (this.#n = s, this.requestUpdate("columnSizing", i)) : Y(this,
|
|
4544
|
+
o ? (this.#n = s, this.requestUpdate("columnSizing", i)) : Y(this, Fa, s);
|
|
4719
4545
|
}
|
|
4720
|
-
#
|
|
4546
|
+
#T(e) {
|
|
4721
4547
|
let t = this.#a.model.nextSorting(e);
|
|
4722
4548
|
if (!t) return;
|
|
4723
4549
|
let n = this.#e.value, { value: r, applied: i } = this.#e.request(t);
|
|
4724
|
-
i ? (this.#r = r, this.requestUpdate("sorting", n)) : Y(this,
|
|
4550
|
+
i ? (this.#r = r, this.requestUpdate("sorting", n)) : Y(this, Pa, { sorting: r });
|
|
4725
4551
|
}
|
|
4726
|
-
#
|
|
4552
|
+
#E() {
|
|
4727
4553
|
let e = this.renderRoot.querySelector(".probe");
|
|
4728
|
-
e && (this.#
|
|
4729
|
-
this.#
|
|
4730
|
-
}), this.#
|
|
4554
|
+
e && (this.#l ??= new ResizeObserver(() => {
|
|
4555
|
+
this.#D();
|
|
4556
|
+
}), this.#l.observe(e));
|
|
4731
4557
|
}
|
|
4732
|
-
#
|
|
4558
|
+
#D() {
|
|
4733
4559
|
let e = this.renderRoot.querySelector(".probe")?.getBoundingClientRect().height ?? 0;
|
|
4734
|
-
e > 0 && Math.abs(e - this.#
|
|
4560
|
+
e > 0 && Math.abs(e - this.#c) > .01 && (this.#c = e, this.requestUpdate());
|
|
4735
4561
|
}
|
|
4736
4562
|
};
|
|
4737
4563
|
Q([M({ attribute: !1 })], $.prototype, "columns", void 0), Q([M({ attribute: !1 })], $.prototype, "data", void 0), Q([M({ attribute: !1 })], $.prototype, "getRowId", void 0), Q([M({
|
|
4738
4564
|
attribute: "row-height",
|
|
4739
4565
|
type: Number
|
|
4740
4566
|
})], $.prototype, "rowHeight", void 0), Q([M({ reflect: !0 })], $.prototype, "density", void 0), Q([M({ type: Number })], $.prototype, "overscan", void 0), Q([M({ attribute: !1 })], $.prototype, "sorting", null), Q([M({ attribute: !1 })], $.prototype, "columnSizing", null), $ = Q([Fe("argus-table")], $);
|
|
4741
|
-
export { $ as ArgusTable,
|
|
4567
|
+
export { $ as ArgusTable, La as CELL_CLICK, Fa as COLUMN_RESIZE, Na as RANGE_CHANGE, Ia as ROW_CLICK, Pa as SORT_CHANGE };
|
|
4742
4568
|
|
|
4743
4569
|
//# sourceMappingURL=argus-table.js.map
|