@leavepulse/ui 0.94.0 → 0.95.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/assets/{LpTable-DxnthVz4.css → LpTable-BJjNEvgJ.css} +57 -30
- package/dist/assets/LpTabs-7yQjX2ih.css +18 -0
- package/dist/chunks/{LpAddressInput-BCqR0zmv.js → LpAddressInput-C5VIgRp0.js} +1 -1
- package/dist/chunks/{LpAppShell-xEBmGV78.js → LpAppShell-C4b3ySa_.js} +3 -3
- package/dist/chunks/{LpCodeBlock-BgWcg2mk.js → LpCodeBlock-DTU40x8P.js} +1 -1
- package/dist/chunks/{LpCodeDisplay-DBi1YPLp.js → LpCodeDisplay-F2hjLb0X.js} +2 -2
- package/dist/chunks/{LpConfirmDialog-y6k0ryWR.js → LpConfirmDialog-DrHcIxRn.js} +1 -1
- package/dist/chunks/{LpConfirmHost-D-X0tDym.js → LpConfirmHost-D0Cd8FA_.js} +1 -1
- package/dist/chunks/{LpCopyButton-BGzw95Xc.js → LpCopyButton-CiqUS4SX.js} +1 -1
- package/dist/chunks/{LpDataList-B56Gu6Yt.js → LpDataList-Cit9fOSp.js} +2 -2
- package/dist/chunks/{LpDrawer-BkWjFdV0.js → LpDrawer-BHlqi62K.js} +1 -1
- package/dist/chunks/{LpFileTree-BN_zybBN.js → LpFileTree-gVjF_b6r.js} +1 -1
- package/dist/chunks/{LpInspector-oTfkOdYd.js → LpInspector-DSL1lINx.js} +2 -2
- package/dist/chunks/{LpLightbox-DPgz7IsT.js → LpLightbox--EwvQGe-.js} +1 -1
- package/dist/chunks/{LpLogViewer-BuIzr_6h.js → LpLogViewer-DSq9e8mT.js} +1 -1
- package/dist/chunks/{LpMediaGallery-CTejKF2-.js → LpMediaGallery-DlYJf3DS.js} +1 -1
- package/dist/chunks/{LpModal-D1E7rQzw.js → LpModal-COMHrBKL.js} +1 -1
- package/dist/chunks/{LpModalNav-DVXAF-DG.js → LpModalNav-Cj02cfhL.js} +2 -2
- package/dist/chunks/{LpNotificationBell-KRgdRZs-.js → LpNotificationBell-DNGijtmW.js} +1 -1
- package/dist/chunks/{LpNotificationFeed-CMGYU8c-.js → LpNotificationFeed-BoovbtfL.js} +3 -3
- package/dist/chunks/{LpPageScrollbar-C9sTeU-2.js → LpPageScrollbar-BniFeL2U.js} +5 -1
- package/dist/chunks/{LpPaletteTheme-CLwO-SDf.js → LpPaletteTheme-_FwkJO2o.js} +1 -1
- package/dist/chunks/{LpPasswordInput-LPVI7D3v.js → LpPasswordInput-BBDz2zyU.js} +1 -1
- package/dist/chunks/{LpPie-CsiBXe-e.js → LpPie-CtC4XdhC.js} +1 -1
- package/dist/chunks/{LpPipeline-DVcoSs--.js → LpPipeline-aCALaUY8.js} +1 -1
- package/dist/chunks/{LpRelativeTime-CN5bWD73.js → LpRelativeTime-9MHlbq6F.js} +1 -1
- package/dist/chunks/{LpScrollArea-CqvwfZs2.js → LpScrollArea-B_1KZOSS.js} +11 -1
- package/dist/chunks/{LpSecretField-BwrZ4TfT.js → LpSecretField-C9vwMFQ6.js} +4 -4
- package/dist/chunks/{LpSidebar-BIhusppV.js → LpSidebar-DPri9uyz.js} +4 -4
- package/dist/chunks/{LpSidebarNav-CFcI7--7.js → LpSidebarNav-CV1rU6La.js} +34 -20
- package/dist/chunks/{LpThemeStudio-BPPctXgd.js → LpThemeStudio-yiEdFJQL.js} +1 -1
- package/dist/chunks/{LpThemeSwitcher-B3c44xFH.js → LpThemeSwitcher-DKkCFaFk.js} +1 -1
- package/dist/chunks/{LpToaster-Cdx1tnHB.js → LpToaster-C7hHkGOA.js} +1 -1
- package/dist/chunks/LpTooltip-Bt1ZFViJ.js +333 -0
- package/dist/chunks/{LpTruncate-C_C8eiIE.js → LpTruncate-DEHWL1OA.js} +2 -2
- package/dist/chunks/{LpUptimeBar-Dt6SY_-m.js → LpUptimeBar-CXgzU5ym.js} +1 -1
- package/dist/chunks/{LpWorkspaceSwitcher-DCIiOQt_.js → LpWorkspaceSwitcher-CrUVSI7x.js} +1 -1
- package/dist/chunks/{RevealToggle-BsYxY6Oz.js → RevealToggle-D9Vs88kM.js} +1 -1
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpCodeBlock.vue.js +1 -1
- package/dist/components/LpCodeDisplay.vue.js +1 -1
- package/dist/components/LpCommandPalette.vue.js +1 -1
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpConfirmHost.vue.js +1 -1
- package/dist/components/LpCopyButton.vue.js +1 -1
- package/dist/components/LpDataList.vue.js +1 -1
- package/dist/components/LpDock.vue.js +1 -1
- package/dist/components/LpDrawer.vue.js +1 -1
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpInspector.vue.js +1 -1
- package/dist/components/LpLightbox.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpMediaGallery.vue.js +1 -1
- package/dist/components/LpModal.vue.js +1 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpNotificationBell.vue.js +1 -1
- package/dist/components/LpNotificationFeed.vue.js +1 -1
- package/dist/components/LpPageScrollbar.vue.js +1 -1
- package/dist/components/LpPaletteTheme.vue.js +1 -1
- package/dist/components/LpPasswordInput.vue.js +1 -1
- package/dist/components/LpPie.vue.js +1 -1
- package/dist/components/LpPipeline.vue.js +1 -1
- package/dist/components/LpRelativeTime.vue.js +1 -1
- package/dist/components/LpScrollArea.vue.js +1 -1
- package/dist/components/LpSecretField.vue.js +1 -1
- package/dist/components/LpShortcutsDialog.vue.js +1 -1
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSidebarNav.vue.js +1 -1
- package/dist/components/LpTable.vue.js +38 -12
- package/dist/components/LpTabs.vue.js +11 -6
- package/dist/components/LpThemeStudio.vue.js +1 -1
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpToaster.vue.js +1 -1
- package/dist/components/LpTooltip.vue.d.ts +3 -3
- package/dist/components/LpTooltip.vue.js +1 -1
- package/dist/components/LpTruncate.vue.js +1 -1
- package/dist/components/LpUptimeBar.vue.js +1 -1
- package/dist/components/LpWorkspaceSwitcher.vue.js +1 -1
- package/dist/components/RevealToggle.vue.js +1 -1
- package/dist/components/tableFeatures.d.ts +1 -0
- package/dist/components/tableFeatures.js +25 -0
- package/dist/composables/useShift.js +28 -11
- package/dist/index.js +34 -34
- package/package.json +1 -1
- package/src/components/LpPageScrollbar.vue +14 -1
- package/src/components/LpScrollArea.vue +18 -1
- package/src/components/LpSidebar.vue +1 -1
- package/src/components/LpSidebarNav.vue +18 -8
- package/src/components/LpTable.vue +76 -4
- package/src/components/LpTabs.vue +14 -5
- package/src/components/LpTooltip.vue +153 -14
- package/src/components/tableFeatures.ts +36 -0
- package/src/composables/useShift.ts +45 -15
- package/dist/assets/LpTabs-D7EyG21l.css +0 -18
- package/dist/chunks/LpTooltip-BKde8Xjv.js +0 -230
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString, createTextVNode, createCommentVNode, createVNode } from "vue";
|
|
2
2
|
import LpKeys from "./LpKeys.vue.js";
|
|
3
|
-
import { _ as _sfc_main$1 } from "../chunks/LpModal-
|
|
3
|
+
import { _ as _sfc_main$1 } from "../chunks/LpModal-COMHrBKL.js";
|
|
4
4
|
import { mergeShortcutGroups, activeShortcuts, useHotkeys } from "../composables/useHotkeys.js";
|
|
5
5
|
import { useLabels } from "../composables/useLpConfig.js";
|
|
6
6
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed, useAttrs, ref, shallowRef, watch, onMounted, useSlots, onBeforeUnmount, useId, h, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, renderSlot, createCommentVNode, createBlock, createTextVNode, toDisplayString, Fragment, renderList, createElementVNode, Transition, mergeProps, normalizeStyle, withModifiers, TransitionGroup, unref, nextTick } from "vue";
|
|
2
2
|
import { usePaletteScope, suppressPaletteDiscovery, usePaletteCommands } from "../composables/usePaletteCommands.js";
|
|
3
3
|
import { menuPaletteCommands } from "./commandPalette.js";
|
|
4
|
-
import { _ as _sfc_main$1 } from "../chunks/LpDataList-
|
|
4
|
+
import { _ as _sfc_main$1 } from "../chunks/LpDataList-Cit9fOSp.js";
|
|
5
5
|
import { _ as _sfc_main$d } from "../chunks/LpCheckbox-C9VnPIQf.js";
|
|
6
6
|
import { _ as _sfc_main$c } from "../chunks/LpContextMenu-DEFirphS.js";
|
|
7
7
|
import { _ as _sfc_main$g } from "../chunks/LpEditable-DfRUAGkA.js";
|
|
@@ -11,7 +11,7 @@ import { _ as _sfc_main$5 } from "../chunks/LpIcon-CxHFPwKt.js";
|
|
|
11
11
|
import { _ as _sfc_main$e } from "../chunks/LpSkeleton-leTl53V9.js";
|
|
12
12
|
import { _ as _sfc_main$h } from "../chunks/LpPagination-DGLntZJN.js";
|
|
13
13
|
import { _ as _sfc_main$6 } from "../chunks/LpPopover-w2rr4x7n.js";
|
|
14
|
-
import { _ as _sfc_main$b } from "../chunks/LpScrollArea-
|
|
14
|
+
import { _ as _sfc_main$b } from "../chunks/LpScrollArea-B_1KZOSS.js";
|
|
15
15
|
import { _ as _sfc_main$9 } from "../chunks/LpRollingText-B54Pje7P.js";
|
|
16
16
|
import { _ as _sfc_main$2 } from "../chunks/LpShift-DAgS_d2x.js";
|
|
17
17
|
import { _ as _sfc_main$7 } from "../chunks/LpTableFilter-CILHffC1.js";
|
|
@@ -25,16 +25,17 @@ import { usePaintSelect } from "../composables/usePaintSelect.js";
|
|
|
25
25
|
import { useRovingFocus } from "../composables/useRovingFocus.js";
|
|
26
26
|
import { useLabels } from "../composables/useLpConfig.js";
|
|
27
27
|
import { useResizeObserver } from "../composables/useResizeObserver.js";
|
|
28
|
-
import { orderPinned, pinOffsets, groupRows, rowWindow, presetHidden, sortByKeys, nextSorts, clampColumnWidth } from "./tableFeatures.js";
|
|
28
|
+
import { orderPinned, pinOffsets, groupRows, rowWindow, rowChanges, presetHidden, sortByKeys, nextSorts, clampColumnWidth } from "./tableFeatures.js";
|
|
29
29
|
import { devWarn } from "../composables/devWarn.js";
|
|
30
30
|
import { startPointerDrag } from "../composables/pointerDrag.js";
|
|
31
|
-
import {
|
|
31
|
+
import { nodeWindow, isHTMLElement } from "../composables/realm.js";
|
|
32
|
+
import { prefersReducedMotion } from "../composables/easing.js";
|
|
32
33
|
import { _ as _sfc_main$4 } from "../chunks/LpButton-BvVoF-PO.js";
|
|
33
34
|
import { toCsv, downloadFile, fileStem } from "./exportData.js";
|
|
34
35
|
import { toHiddenSets, sameHidden, summarizeShown, parseTableState, mergeRestored, serializeTableState, fromHiddenSets } from "./tableFilter.js";
|
|
35
36
|
import { resolveRowMenu } from "./tableRowMenu.js";
|
|
36
37
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
|
|
37
|
-
import '../assets/LpTable-
|
|
38
|
+
import '../assets/LpTable-BJjNEvgJ.css';const _hoisted_1 = {
|
|
38
39
|
key: 0,
|
|
39
40
|
class: "flex min-h-8 flex-wrap items-center gap-x-3 gap-y-2 pb-3 text-xs"
|
|
40
41
|
};
|
|
@@ -1044,6 +1045,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1044
1045
|
emit("rowClick", row);
|
|
1045
1046
|
}
|
|
1046
1047
|
});
|
|
1048
|
+
const ROW_MOTION_LIMIT = 12;
|
|
1049
|
+
const rowsEl = shallowRef(null);
|
|
1050
|
+
function setRowsEl(el) {
|
|
1051
|
+
const node = el?.$el ?? null;
|
|
1052
|
+
rowsEl.value = node;
|
|
1053
|
+
roving.setContainer(node);
|
|
1054
|
+
}
|
|
1055
|
+
const motionIds = computed(() => (headerless.value ? allEntries.value : viewEntries.value).map((entry) => entry.id));
|
|
1056
|
+
let shownIds = [];
|
|
1057
|
+
const bigSwap = computed(() => rowChanges(shownIds, motionIds.value) > ROW_MOTION_LIMIT);
|
|
1058
|
+
let settleFlip = false;
|
|
1059
|
+
watch(
|
|
1060
|
+
motionIds,
|
|
1061
|
+
(ids) => {
|
|
1062
|
+
const eased = bigSwap.value && shownIds.length > 0 && ids.length > 0;
|
|
1063
|
+
shownIds = ids;
|
|
1064
|
+
const body = rowsEl.value;
|
|
1065
|
+
if (!eased || !body || props.virtualRowHeight || prefersReducedMotion(nodeWindow(body))) return;
|
|
1066
|
+
settleFlip = !settleFlip;
|
|
1067
|
+
body.dataset.lpSettle = settleFlip ? "a" : "b";
|
|
1068
|
+
},
|
|
1069
|
+
{ flush: "post", immediate: true }
|
|
1070
|
+
);
|
|
1047
1071
|
function onRowKeydown(event) {
|
|
1048
1072
|
if (event.key === " " && props.selectable && roving.activeId.value) {
|
|
1049
1073
|
event.preventDefault();
|
|
@@ -1437,10 +1461,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1437
1461
|
createVNode(TransitionGroup, {
|
|
1438
1462
|
tag: "tbody",
|
|
1439
1463
|
name: "lp-row",
|
|
1440
|
-
css: animating.value && !__props.virtualRowHeight,
|
|
1464
|
+
css: animating.value && !__props.virtualRowHeight && !bigSwap.value,
|
|
1465
|
+
"move-class": bigSwap.value ? "lp-row-still" : void 0,
|
|
1441
1466
|
class: normalizeClass(busy.value && displayRows.value.length ? "opacity-60 transition-opacity" : "transition-opacity"),
|
|
1442
1467
|
"aria-busy": busy.value || void 0,
|
|
1443
|
-
ref:
|
|
1468
|
+
ref: setRowsEl
|
|
1444
1469
|
}, {
|
|
1445
1470
|
default: withCtx(() => [
|
|
1446
1471
|
displayRows.value.length === 0 && busy.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.skeletonRows, (n) => {
|
|
@@ -1647,7 +1672,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1647
1672
|
])) : createCommentVNode("", true)
|
|
1648
1673
|
]),
|
|
1649
1674
|
_: 3
|
|
1650
|
-
}, 8, ["css", "class", "aria-busy"])
|
|
1675
|
+
}, 8, ["css", "move-class", "class", "aria-busy"])
|
|
1651
1676
|
], 14, _hoisted_11)
|
|
1652
1677
|
]),
|
|
1653
1678
|
_: 3
|
|
@@ -1669,7 +1694,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1669
1694
|
key: activeLayout.value,
|
|
1670
1695
|
tag: "div",
|
|
1671
1696
|
name: "lp-row",
|
|
1672
|
-
css: animating.value
|
|
1697
|
+
css: animating.value && !bigSwap.value,
|
|
1698
|
+
"move-class": bigSwap.value ? "lp-row-still" : void 0
|
|
1673
1699
|
}, scrollAttrs.value, {
|
|
1674
1700
|
class: ["min-h-0 transition-opacity", [
|
|
1675
1701
|
busy.value && displayRows.value.length ? "opacity-60" : "",
|
|
@@ -1677,7 +1703,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1677
1703
|
]],
|
|
1678
1704
|
style: activeLayout.value === "cards" ? { gridTemplateColumns: `repeat(auto-fill, minmax(min(${__props.cardWidth}, 100%), 1fr))` } : void 0,
|
|
1679
1705
|
"aria-busy": busy.value || void 0,
|
|
1680
|
-
ref:
|
|
1706
|
+
ref: setRowsEl
|
|
1681
1707
|
}), {
|
|
1682
1708
|
default: withCtx(() => [
|
|
1683
1709
|
displayRows.value.length === 0 && busy.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.skeletonRows, (n) => {
|
|
@@ -1896,7 +1922,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1896
1922
|
}), 128))
|
|
1897
1923
|
]),
|
|
1898
1924
|
_: 3
|
|
1899
|
-
}, 16, ["css", "class", "style", "aria-busy"]))
|
|
1925
|
+
}, 16, ["css", "move-class", "class", "style", "aria-busy"]))
|
|
1900
1926
|
]),
|
|
1901
1927
|
_: 3
|
|
1902
1928
|
}, 8, ["items", "no-hint", "title", "subtitle", "title-icon", "title-image"]))
|
|
@@ -1915,7 +1941,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1915
1941
|
};
|
|
1916
1942
|
}
|
|
1917
1943
|
});
|
|
1918
|
-
const LpTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
1944
|
+
const LpTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a366adee"]]);
|
|
1919
1945
|
export {
|
|
1920
1946
|
LpTable as default
|
|
1921
1947
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, watch, nextTick, useId, openBlock, createBlock, unref, withCtx, resolveDynamicComponent, mergeProps, createVNode, normalizeClass, createElementBlock, Fragment, renderList, createCommentVNode, renderSlot } from "vue";
|
|
1
|
+
import { defineComponent, computed, ref, watch, nextTick, onMounted, useId, openBlock, createBlock, unref, withCtx, resolveDynamicComponent, mergeProps, createVNode, normalizeClass, createElementBlock, Fragment, renderList, createCommentVNode, renderSlot } from "vue";
|
|
2
2
|
import { isHTMLElement } from "../composables/realm.js";
|
|
3
3
|
import { usePaletteScope, usePaletteCommands } from "../composables/usePaletteCommands.js";
|
|
4
4
|
import { Motion } from "motion-v";
|
|
5
5
|
import { TabsRoot, TabsList, TabsTrigger, TabsContent } from "reka-ui";
|
|
6
|
+
import { useResizeObserver } from "../composables/useResizeObserver.js";
|
|
6
7
|
import { usePillTransition } from "../composables/usePillTransition.js";
|
|
7
8
|
import { useStepHistory } from "../composables/useOverlayHistory.js";
|
|
8
9
|
import { _ as _sfc_main$2 } from "../chunks/LpContextMenu-DEFirphS.js";
|
|
@@ -11,7 +12,7 @@ import { _ as _sfc_main$3 } from "../chunks/LpTabFace-uoZgD_SN.js";
|
|
|
11
12
|
import { _ as _sfc_main$1 } from "../chunks/LpScrollStrip-D4tsOfAQ.js";
|
|
12
13
|
import { pickTab, BOTTOM_BAR, BOTTOM_ITEM, BOTTOM_MARKER } from "./tabs.js";
|
|
13
14
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
|
|
14
|
-
import '../assets/LpTabs-
|
|
15
|
+
import '../assets/LpTabs-7yQjX2ih.css';const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
16
|
__name: "LpTabs",
|
|
16
17
|
props: {
|
|
17
18
|
modelValue: {},
|
|
@@ -47,9 +48,13 @@ import '../assets/LpTabs-D7EyG21l.css';const _sfc_main = /* @__PURE__ */ defineC
|
|
|
47
48
|
const strip = ref(null);
|
|
48
49
|
const Passthrough = (_, { slots }) => slots.default?.();
|
|
49
50
|
const list = ref(null);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
function revealActive(smooth) {
|
|
52
|
+
if (bottom.value) return;
|
|
53
|
+
strip.value?.reveal(list.value?.$el?.querySelector('[data-state="active"]'), { smooth });
|
|
54
|
+
}
|
|
55
|
+
watch(current, () => void nextTick(() => revealActive(true)));
|
|
56
|
+
onMounted(() => requestAnimationFrame(() => revealActive(false)));
|
|
57
|
+
useResizeObserver(() => strip.value?.scroller, () => revealActive(false));
|
|
53
58
|
function holdMousePick(event) {
|
|
54
59
|
if (event.button !== 0 || event.ctrlKey || bottom.value) return;
|
|
55
60
|
if (!isHTMLElement(event.target) || !event.target.closest('[role="tab"]')) return;
|
|
@@ -224,7 +229,7 @@ import '../assets/LpTabs-D7EyG21l.css';const _sfc_main = /* @__PURE__ */ defineC
|
|
|
224
229
|
};
|
|
225
230
|
}
|
|
226
231
|
});
|
|
227
|
-
const LpTabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
232
|
+
const LpTabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-60b1eda3"]]);
|
|
228
233
|
export {
|
|
229
234
|
LpTabs as default
|
|
230
235
|
};
|
|
@@ -46,11 +46,11 @@ type __VLS_Props = {
|
|
|
46
46
|
*/
|
|
47
47
|
touch?: "hold" | "none";
|
|
48
48
|
};
|
|
49
|
-
declare var
|
|
49
|
+
declare var __VLS_9: {}, __VLS_50: {};
|
|
50
50
|
type __VLS_Slots = {} & {
|
|
51
|
-
default?: (props: typeof
|
|
51
|
+
default?: (props: typeof __VLS_9) => any;
|
|
52
52
|
} & {
|
|
53
|
-
content?: (props: typeof
|
|
53
|
+
content?: (props: typeof __VLS_50) => any;
|
|
54
54
|
};
|
|
55
55
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
56
56
|
touch: "hold" | "none";
|
|
@@ -65,3 +65,4 @@ export declare function presetHidden(preset: Pick<ColumnPreset, "columns">, colu
|
|
|
65
65
|
* - `list`: one compact line per row with no header, for narrow places.
|
|
66
66
|
*/
|
|
67
67
|
export type TableLayout = "table" | "cards" | "list";
|
|
68
|
+
export declare function rowChanges(before: readonly string[], after: readonly string[]): number;
|
|
@@ -74,6 +74,30 @@ function presetHidden(preset, columns) {
|
|
|
74
74
|
const hidden = columns.filter((c) => !c.alwaysVisible && !shown.has(c.key)).map((c) => c.key);
|
|
75
75
|
return hidden.length === columns.length ? /* @__PURE__ */ new Set() : new Set(hidden);
|
|
76
76
|
}
|
|
77
|
+
function rowChanges(before, after) {
|
|
78
|
+
const old = /* @__PURE__ */ new Map();
|
|
79
|
+
before.forEach((id, i) => old.set(id, i));
|
|
80
|
+
let entered = 0;
|
|
81
|
+
const kept = [];
|
|
82
|
+
for (const id of after) {
|
|
83
|
+
const at = old.get(id);
|
|
84
|
+
if (at === void 0) entered++;
|
|
85
|
+
else kept.push(at);
|
|
86
|
+
}
|
|
87
|
+
const left = before.length - kept.length;
|
|
88
|
+
const tails = [];
|
|
89
|
+
for (const at of kept) {
|
|
90
|
+
let lo = 0;
|
|
91
|
+
let hi = tails.length;
|
|
92
|
+
while (lo < hi) {
|
|
93
|
+
const mid = lo + hi >> 1;
|
|
94
|
+
if (tails[mid] < at) lo = mid + 1;
|
|
95
|
+
else hi = mid;
|
|
96
|
+
}
|
|
97
|
+
tails[lo] = at;
|
|
98
|
+
}
|
|
99
|
+
return entered + left + (kept.length - tails.length);
|
|
100
|
+
}
|
|
77
101
|
export {
|
|
78
102
|
MIN_COLUMN_PX,
|
|
79
103
|
clampColumnWidth,
|
|
@@ -82,6 +106,7 @@ export {
|
|
|
82
106
|
orderPinned,
|
|
83
107
|
pinOffsets,
|
|
84
108
|
presetHidden,
|
|
109
|
+
rowChanges,
|
|
85
110
|
rowWindow,
|
|
86
111
|
sortByKeys
|
|
87
112
|
};
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { ref, watch, toValue, onBeforeUnmount, nextTick } from "vue";
|
|
2
2
|
import { nodeWindow, isElement } from "./realm.js";
|
|
3
3
|
import { prefersReducedMotion } from "./easing.js";
|
|
4
|
+
const firstReads = /* @__PURE__ */ new Map();
|
|
5
|
+
function firstRead(win, pass) {
|
|
6
|
+
let queue = firstReads.get(win);
|
|
7
|
+
if (!queue) {
|
|
8
|
+
const batch2 = /* @__PURE__ */ new Set();
|
|
9
|
+
queue = batch2;
|
|
10
|
+
firstReads.set(win, batch2);
|
|
11
|
+
win.requestAnimationFrame(() => {
|
|
12
|
+
firstReads.delete(win);
|
|
13
|
+
for (const p of batch2) p.read();
|
|
14
|
+
for (const p of batch2) p.write();
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
queue.add(pass);
|
|
18
|
+
const batch = queue;
|
|
19
|
+
return () => batch.delete(pass);
|
|
20
|
+
}
|
|
4
21
|
const TWEEN_MS = 160;
|
|
5
22
|
const RETARGET_AFTER_MS = 40;
|
|
6
23
|
function useShift(options = {}) {
|
|
@@ -9,7 +26,7 @@ function useShift(options = {}) {
|
|
|
9
26
|
const resizing = ref(false);
|
|
10
27
|
let ro;
|
|
11
28
|
let mo;
|
|
12
|
-
let
|
|
29
|
+
let cancelFirstRead;
|
|
13
30
|
let settleTimer;
|
|
14
31
|
let lastHeight = 0;
|
|
15
32
|
let lastWidth = 0;
|
|
@@ -95,7 +112,8 @@ function useShift(options = {}) {
|
|
|
95
112
|
mo?.disconnect();
|
|
96
113
|
ro = void 0;
|
|
97
114
|
mo = void 0;
|
|
98
|
-
|
|
115
|
+
cancelFirstRead?.();
|
|
116
|
+
cancelFirstRead = void 0;
|
|
99
117
|
clearTimeout(settleTimer);
|
|
100
118
|
tweening.value = false;
|
|
101
119
|
resizing.value = false;
|
|
@@ -109,17 +127,16 @@ function useShift(options = {}) {
|
|
|
109
127
|
([node, enabled]) => {
|
|
110
128
|
teardown();
|
|
111
129
|
if (!enabled || !node) return;
|
|
112
|
-
lastHeight = node.offsetHeight;
|
|
113
|
-
lastWidth = node.offsetWidth;
|
|
114
|
-
laidOut = node.getClientRects().length > 0;
|
|
115
130
|
scrollHost = node;
|
|
116
131
|
node.addEventListener("scroll", rememberScroll, { capture: true, passive: true });
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
cancelFirstRead = firstRead(nodeWindow(node), {
|
|
133
|
+
read: () => {
|
|
134
|
+
if (inFlight) return;
|
|
135
|
+
lastHeight = node.offsetHeight;
|
|
136
|
+
lastWidth = node.offsetWidth;
|
|
137
|
+
laidOut = node.getClientRects().length > 0;
|
|
138
|
+
},
|
|
139
|
+
write: () => tweening.value = true
|
|
123
140
|
});
|
|
124
141
|
const watchChildren = () => {
|
|
125
142
|
if (!ro) return;
|