@leavepulse/ui 0.85.2 → 0.86.1

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.
Files changed (37) hide show
  1. package/README.md +367 -72
  2. package/dist/assets/{LpTable-CCk0ZHo7.css → LpTable-CEFsRz5J.css} +19 -19
  3. package/dist/chunks/{LpCodeBlock-Dx0J9xlm.js → LpCodeBlock-kGT15Zou.js} +1 -1
  4. package/dist/chunks/{LpCodeDisplay-BlN7U8Z-.js → LpCodeDisplay-DlwzZo9o.js} +1 -1
  5. package/dist/chunks/{LpCopyButton-BrbvIVMG.js → LpCopyButton-TGoE43mE.js} +2 -2
  6. package/dist/chunks/{LpDataList-DhETPjzv.js → LpDataList-Due909Cy.js} +1 -1
  7. package/dist/chunks/{LpInspector-CqPgVXrm.js → LpInspector-BNxjuWMP.js} +1 -1
  8. package/dist/chunks/{LpLightbox-Bg1LW_ED.js → LpLightbox-DVyiB4dw.js} +1 -1
  9. package/dist/chunks/{LpMediaGallery-pX-znMeP.js → LpMediaGallery-OJemmbV7.js} +1 -1
  10. package/dist/chunks/{LpPaletteTheme-Bi6pD1GL.js → LpPaletteTheme-CWFz4H2D.js} +1 -1
  11. package/dist/chunks/{LpSecretField-_B2qPfk8.js → LpSecretField-Dp-c7wWc.js} +1 -1
  12. package/dist/chunks/{LpThemeStudio-C1xKiv8C.js → LpThemeStudio-RyI-SWiw.js} +1 -1
  13. package/dist/chunks/{LpThemeSwitcher-Dk4Bk6u1.js → LpThemeSwitcher-BZYJ0AXy.js} +1 -1
  14. package/dist/chunks/{LpToaster-C_CFWSys.js → LpToaster-YcLJFSsH.js} +1 -1
  15. package/dist/chunks/{LpTruncate-CBUKnr36.js → LpTruncate-DCZjfcE-.js} +1 -1
  16. package/dist/components/LpCodeBlock.vue.js +1 -1
  17. package/dist/components/LpCodeDisplay.vue.js +1 -1
  18. package/dist/components/LpCopyButton.vue.js +1 -1
  19. package/dist/components/LpDataList.vue.js +1 -1
  20. package/dist/components/LpInspector.vue.js +1 -1
  21. package/dist/components/LpLightbox.vue.js +1 -1
  22. package/dist/components/LpMediaGallery.vue.js +1 -1
  23. package/dist/components/LpPaletteTheme.vue.js +1 -1
  24. package/dist/components/LpSecretField.vue.js +1 -1
  25. package/dist/components/LpTable.vue.d.ts +2 -0
  26. package/dist/components/LpTable.vue.js +381 -370
  27. package/dist/components/LpThemeStudio.vue.js +1 -1
  28. package/dist/components/LpThemeSwitcher.vue.js +1 -1
  29. package/dist/components/LpToaster.vue.js +1 -1
  30. package/dist/components/LpTruncate.vue.js +1 -1
  31. package/dist/composables/useClipboard.d.ts +17 -3
  32. package/dist/composables/useClipboard.js +6 -2
  33. package/dist/index.js +13 -13
  34. package/package.json +3 -2
  35. package/src/components/LpCopyButton.vue +2 -2
  36. package/src/components/LpTable.vue +32 -9
  37. package/src/composables/useClipboard.ts +18 -5
@@ -1,19 +1,19 @@
1
- import { defineComponent, computed, useAttrs, ref, shallowRef, watch, onMounted, onBeforeUnmount, useId, h, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, createBlock, createElementVNode, Transition, renderSlot, mergeProps, normalizeStyle, withModifiers, TransitionGroup, unref, nextTick } from "vue";
1
+ import { defineComponent, computed, useAttrs, ref, shallowRef, watch, onMounted, useSlots, onBeforeUnmount, useId, h, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, renderSlot, createCommentVNode, Fragment, renderList, createBlock, createElementVNode, toDisplayString, createTextVNode, 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-DhETPjzv.js";
4
+ import { _ as _sfc_main$1 } from "../chunks/LpDataList-Due909Cy.js";
5
5
  import { _ as _sfc_main$9 } from "../chunks/LpCheckbox-DcXC2qd5.js";
6
6
  import { _ as _sfc_main$8 } from "../chunks/LpContextMenu-CUFZIQX2.js";
7
7
  import { _ as _sfc_main$e } from "../chunks/LpEditable-DCPdDDBb.js";
8
8
  import { _ as _sfc_main$d } from "../chunks/LpEmptyState-DT8U4R8L.js";
9
- import { _ as _sfc_main$5 } from "../chunks/LpBadge-RFp8uHFt.js";
10
- import { _ as _sfc_main$3 } from "../chunks/LpIcon-DCGhNsCU.js";
9
+ import { _ as _sfc_main$3 } from "../chunks/LpBadge-RFp8uHFt.js";
10
+ import { _ as _sfc_main$6 } from "../chunks/LpIcon-DCGhNsCU.js";
11
11
  import { _ as _sfc_main$c } from "../chunks/LpSkeleton-BB6XIV-w.js";
12
12
  import { _ as _sfc_main$f } from "../chunks/LpPagination-V1wEhu1K.js";
13
13
  import { _ as _sfc_main$a } from "../chunks/LpPopover-BQSuxtai.js";
14
14
  import { _ as _sfc_main$7 } from "../chunks/LpScrollArea-CqvwfZs2.js";
15
- import { _ as _sfc_main$6 } from "../chunks/LpRollingText-B54Pje7P.js";
16
- import { _ as _sfc_main$4 } from "../chunks/LpShift-DAgS_d2x.js";
15
+ import { _ as _sfc_main$4 } from "../chunks/LpRollingText-B54Pje7P.js";
16
+ import { _ as _sfc_main$2 } from "../chunks/LpShift-DAgS_d2x.js";
17
17
  import { _ as _sfc_main$b } from "../chunks/LpTableFilter-B_BFoBqS.js";
18
18
  import { useKitStorage } from "../composables/usePersisted.js";
19
19
  import { useAsyncTask } from "../composables/useAsyncTask.js";
@@ -27,21 +27,21 @@ import { orderPinned, pinOffsets, groupRows, rowWindow, presetHidden, sortByKeys
27
27
  import { devWarn } from "../composables/devWarn.js";
28
28
  import { startPointerDrag } from "../composables/pointerDrag.js";
29
29
  import { isHTMLElement, nodeWindow } from "../composables/realm.js";
30
- import { _ as _sfc_main$2 } from "../chunks/LpButton-DSHioIfD.js";
30
+ import { _ as _sfc_main$5 } from "../chunks/LpButton-DSHioIfD.js";
31
31
  import { toCsv, downloadFile, fileStem } from "./exportData.js";
32
32
  import { toHiddenSets, sameHidden, summarizeShown, parseTableState, mergeRestored, serializeTableState, fromHiddenSets } from "./tableFilter.js";
33
33
  import { resolveRowMenu } from "./tableRowMenu.js";
34
34
  import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
35
- import '../assets/LpTable-CCk0ZHo7.css';const _hoisted_1 = {
35
+ import '../assets/LpTable-CEFsRz5J.css';const _hoisted_1 = {
36
36
  key: 0,
37
- class: "flex justify-end"
37
+ class: "flex min-h-8 flex-wrap items-center gap-x-3 gap-y-2 pb-3 text-xs"
38
38
  };
39
39
  const _hoisted_2 = {
40
40
  key: 0,
41
- class: "flex min-h-8 items-center gap-x-3 pb-3 text-xs"
41
+ class: "flex min-w-0 flex-wrap items-center gap-2 text-sm"
42
42
  };
43
43
  const _hoisted_3 = {
44
- key: 0,
44
+ key: 1,
45
45
  class: "flex min-w-0 flex-1 flex-wrap items-center gap-1.5"
46
46
  };
47
47
  const _hoisted_4 = { class: "truncate" };
@@ -799,8 +799,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
799
799
  }
800
800
  return t.rowsTotal.replace("{total}", String(props.rows.length));
801
801
  });
802
+ const slots = useSlots();
802
803
  const showBar = computed(
803
- () => props.summary || !!props.selectable && props.selected.length > 0 || activeFilters.value.length > 0
804
+ () => props.summary || props.exportable || !!slots.toolbar || !!props.selectable && props.selected.length > 0 || activeFilters.value.length > 0
804
805
  );
805
806
  const filteredOut = computed(() => {
806
807
  if (busy.value || failed.value || displayRows.value.length) return false;
@@ -980,28 +981,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
980
981
  ref: frameEl,
981
982
  class: normalizeClass(["flex flex-col gap-3", rootClass.value])
982
983
  }, [
983
- __props.exportable ? (openBlock(), createElementBlock("div", _hoisted_1, [
984
- createVNode(_sfc_main$2, {
985
- variant: "ghost",
986
- size: "sm",
987
- onClick: _cache[0] || (_cache[0] = ($event) => exportCsv())
988
- }, {
989
- default: withCtx(() => [
990
- createVNode(_sfc_main$3, {
991
- name: "lucide:download",
992
- size: 14
993
- }),
994
- createTextVNode(" " + toDisplayString(text.value.exportCsv), 1)
995
- ]),
996
- _: 1
997
- })
998
- ])) : createCommentVNode("", true),
999
- createVNode(_sfc_main$4, { class: "-mb-3" }, {
984
+ createVNode(_sfc_main$2, { class: "-mb-3" }, {
1000
985
  default: withCtx(() => [
1001
- showBar.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
986
+ showBar.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
987
+ _ctx.$slots.toolbar ? (openBlock(), createElementBlock("div", _hoisted_2, [
988
+ renderSlot(_ctx.$slots, "toolbar", {}, void 0, true)
989
+ ])) : createCommentVNode("", true),
1002
990
  activeFilters.value.length ? (openBlock(), createElementBlock("div", _hoisted_3, [
1003
991
  (openBlock(true), createElementBlock(Fragment, null, renderList(activeFilters.value, (f) => {
1004
- return openBlock(), createBlock(_sfc_main$5, {
992
+ return openBlock(), createBlock(_sfc_main$3, {
1005
993
  key: f.col.key,
1006
994
  tone: "brand",
1007
995
  removable: "",
@@ -1025,13 +1013,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1025
1013
  onClick: clearAllFilters
1026
1014
  }, toDisplayString(text.value.clearFilters), 1)) : createCommentVNode("", true)
1027
1015
  ])) : createCommentVNode("", true),
1028
- createVNode(_sfc_main$4, {
1016
+ createVNode(_sfc_main$2, {
1029
1017
  axis: "width",
1030
1018
  class: "ml-auto shrink-0"
1031
1019
  }, {
1032
1020
  default: withCtx(() => [
1033
1021
  createElementVNode("div", _hoisted_6, [
1034
- createVNode(_sfc_main$6, {
1022
+ createVNode(_sfc_main$4, {
1035
1023
  value: statusText.value,
1036
1024
  align: "end",
1037
1025
  class: normalizeClass(["tabular-nums", __props.selectable && __props.selected.length ? "font-medium text-ink" : ""]),
@@ -1057,7 +1045,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1057
1045
  createElementVNode("button", {
1058
1046
  type: "button",
1059
1047
  class: "rounded-control px-1.5 py-0.5 font-medium text-brand outline-none transition-colors duration-fast hover:bg-brand-soft focus-visible:ring-2 focus-visible:ring-ring",
1060
- onClick: _cache[1] || (_cache[1] = ($event) => emit("update:allMatching", true))
1048
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("update:allMatching", true))
1061
1049
  }, toDisplayString(text.value.selectAllMatching.replace("{total}", String(total.value))), 1)
1062
1050
  ])) : createCommentVNode("", true)
1063
1051
  ]),
@@ -1076,7 +1064,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1076
1064
  ])) : createCommentVNode("", true)
1077
1065
  ]),
1078
1066
  _: 3
1079
- })
1067
+ }),
1068
+ __props.exportable ? (openBlock(), createBlock(_sfc_main$5, {
1069
+ key: 0,
1070
+ variant: "ghost",
1071
+ size: "sm",
1072
+ onClick: _cache[1] || (_cache[1] = ($event) => exportCsv())
1073
+ }, {
1074
+ default: withCtx(() => [
1075
+ createVNode(_sfc_main$6, {
1076
+ name: "lucide:download",
1077
+ size: 14
1078
+ }),
1079
+ createTextVNode(" " + toDisplayString(text.value.exportCsv), 1)
1080
+ ]),
1081
+ _: 1
1082
+ })) : createCommentVNode("", true)
1080
1083
  ])
1081
1084
  ]),
1082
1085
  _: 3
@@ -1085,366 +1088,374 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1085
1088
  ]),
1086
1089
  _: 3
1087
1090
  }),
1088
- createVNode(_sfc_main$7, mergeProps(scrollAttrs.value, {
1089
- fade: false,
1090
- class: "min-h-0 flex-1 rounded-card border border-line bg-surface",
1091
- style: __props.load && floor.value ? { minHeight: `${floor.value + 2}px` } : void 0,
1092
- "bar-inset-top": barInsetTop.value
1093
- }), {
1091
+ createVNode(_sfc_main$2, {
1092
+ disabled: !!__props.virtualRowHeight,
1093
+ class: "flex min-h-0 flex-auto flex-col"
1094
+ }, {
1094
1095
  default: withCtx(() => [
1095
- createVNode(_sfc_main$8, {
1096
- items: contextMenu.value,
1097
- always: "",
1098
- "no-hint": !__props.rowMenu,
1099
- title: menuHead.value?.title,
1100
- subtitle: menuHead.value?.subtitle,
1101
- "title-icon": menuHead.value?.icon,
1102
- "title-image": menuHead.value?.image
1103
- }, {
1096
+ createVNode(_sfc_main$7, mergeProps(scrollAttrs.value, {
1097
+ fade: false,
1098
+ class: "min-h-0 flex-1 rounded-card border border-line bg-surface",
1099
+ style: __props.load && floor.value ? { minHeight: `${floor.value + 2}px` } : void 0,
1100
+ "bar-inset-top": barInsetTop.value
1101
+ }), {
1104
1102
  default: withCtx(() => [
1105
- createElementVNode("table", {
1106
- ref_key: "tableEl",
1107
- ref: tableEl,
1108
- class: normalizeClass(["w-full border-collapse text-sm", fixedLayout.value ? "table-fixed" : ""]),
1109
- style: normalizeStyle(tableStyle.value),
1110
- "aria-rowcount": __props.virtualRowHeight ? allEntries.value.length + 1 : void 0
1111
- }, [
1112
- createElementVNode("thead", {
1113
- ref_key: "headEl",
1114
- ref: headEl,
1115
- class: normalizeClass(__props.stickyHeader ? "sticky top-0 z-10 bg-surface-soft" : "")
1116
- }, [
1117
- createElementVNode("tr", _hoisted_11, [
1118
- expansionOn.value ? (openBlock(), createElementBlock("th", {
1119
- key: 0,
1120
- class: normalizeClass(["w-px p-0", cellY.value]),
1121
- style: normalizeStyle(fixedLayout.value ? { width: EXPAND_COLUMN_WIDTH } : void 0)
1122
- }, null, 6)) : createCommentVNode("", true),
1123
- __props.selectable ? (openBlock(), createElementBlock("th", {
1124
- key: 1,
1125
- class: normalizeClass(["w-px p-0", cellY.value]),
1126
- style: normalizeStyle(fixedLayout.value ? { width: ticksShown.value ? TICK_COLUMN_WIDTH : "0" } : void 0)
1103
+ createVNode(_sfc_main$8, {
1104
+ items: contextMenu.value,
1105
+ always: "",
1106
+ "no-hint": !__props.rowMenu,
1107
+ title: menuHead.value?.title,
1108
+ subtitle: menuHead.value?.subtitle,
1109
+ "title-icon": menuHead.value?.icon,
1110
+ "title-image": menuHead.value?.image
1111
+ }, {
1112
+ default: withCtx(() => [
1113
+ createElementVNode("table", {
1114
+ ref_key: "tableEl",
1115
+ ref: tableEl,
1116
+ class: normalizeClass(["w-full border-collapse text-sm", fixedLayout.value ? "table-fixed" : ""]),
1117
+ style: normalizeStyle(tableStyle.value),
1118
+ "aria-rowcount": __props.virtualRowHeight ? allEntries.value.length + 1 : void 0
1119
+ }, [
1120
+ createElementVNode("thead", {
1121
+ ref_key: "headEl",
1122
+ ref: headEl,
1123
+ class: normalizeClass(__props.stickyHeader ? "sticky top-0 z-10 bg-surface-soft" : "")
1127
1124
  }, [
1128
- createElementVNode("div", {
1129
- class: normalizeClass(["lp-tick lp-tick-open", ticksShown.value ? "" : "lp-tick-hidden"]),
1130
- inert: !ticksShown.value
1131
- }, [
1132
- createVNode(_sfc_main$9, {
1133
- "model-value": allChecked.value,
1134
- indeterminate: someChecked.value,
1135
- "onUpdate:modelValue": toggleAll
1136
- }, null, 8, ["model-value", "indeterminate"])
1137
- ], 10, _hoisted_12)
1138
- ], 6)) : createCommentVNode("", true),
1139
- (openBlock(true), createElementBlock(Fragment, null, renderList(shownColumns.value, (col) => {
1140
- return openBlock(), createElementBlock("th", {
1141
- key: col.key,
1142
- style: normalizeStyle(headStyle(col)),
1143
- class: normalizeClass(["px-4 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted", [alignClass(col.align), cellY.value, col.pin ? PIN_HEAD : "", canResize(col) && !col.pin ? "relative" : ""]]),
1144
- "data-lp-col": measuredCol(col),
1145
- "aria-sort": sortOf(col) ? sortOf(col).dir === "asc" ? "ascending" : "descending" : void 0
1146
- }, [
1147
- col.sortable || col.filterable ? (openBlock(), createBlock(_sfc_main$8, {
1125
+ createElementVNode("tr", _hoisted_11, [
1126
+ expansionOn.value ? (openBlock(), createElementBlock("th", {
1148
1127
  key: 0,
1149
- items: headerMenu(col)
1150
- }, {
1151
- default: withCtx(() => [
1152
- createElementVNode("button", {
1153
- type: "button",
1154
- class: normalizeClass(["group/sort -mx-1 inline-flex items-center gap-1 rounded-small px-1 outline-none transition-colors duration-[var(--duration-fast)] hover:text-ink focus-visible:ring-2 focus-visible:ring-ring", [
1155
- col.align === "right" ? "flex-row-reverse" : "",
1156
- sortOf(col) ? "text-ink" : ""
1157
- ]]),
1158
- onClick: ($event) => toggleSort(col, $event)
1159
- }, [
1160
- createTextVNode(toDisplayString(col.label) + " ", 1),
1161
- col.sortable ? (openBlock(), createBlock(_sfc_main$3, {
1162
- key: 0,
1163
- name: sortIcon(col),
1164
- size: 13,
1165
- class: normalizeClass([
1166
- "shrink-0 transition-[transform,opacity] duration-[var(--duration-fast)] ease-[var(--ease-emphasized)]",
1167
- sortOf(col) ? "opacity-100" : "opacity-40 group-hover/sort:opacity-70"
1168
- ])
1169
- }, null, 8, ["name", "class"])) : createCommentVNode("", true),
1170
- sortPosition(col) ? (openBlock(), createElementBlock("span", _hoisted_15, toDisplayString(sortPosition(col)), 1)) : createCommentVNode("", true)
1171
- ], 10, _hoisted_14)
1172
- ]),
1173
- _: 2
1174
- }, 1032, ["items"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1175
- createTextVNode(toDisplayString(col.label), 1)
1176
- ], 64)),
1177
- col.filterable ? (openBlock(), createBlock(_sfc_main$a, {
1178
- key: 2,
1179
- align: "start",
1180
- "panel-class": "w-72",
1181
- "aria-label": text.value.filterColumn.replace("{column}", col.label)
1182
- }, {
1183
- trigger: withCtx(() => [
1184
- createElementVNode("button", {
1185
- type: "button",
1186
- class: normalizeClass(["ml-0.5 inline-grid size-5 place-items-center rounded-small align-middle outline-none transition-colors duration-fast hover:bg-surface-raised hover:text-ink focus-visible:ring-2 focus-visible:ring-ring", hiddenValues.value[col.key]?.size ? "text-brand" : "opacity-60"]),
1187
- "aria-label": text.value.filterColumn.replace("{column}", col.label),
1188
- "data-lp-filter": col.key
1189
- }, [
1190
- createVNode(_sfc_main$3, {
1191
- name: hiddenValues.value[col.key]?.size ? "lucide:filter-x" : "lucide:filter",
1192
- size: 12
1193
- }, null, 8, ["name"])
1194
- ], 10, _hoisted_16)
1195
- ]),
1196
- default: withCtx(() => [
1197
- createVNode(_sfc_main$b, {
1198
- options: facetOptions.value.get(col.key)?.value ?? [],
1199
- hidden: hiddenValues.value[col.key] ?? /* @__PURE__ */ new Set(),
1200
- labels: filterLabels(),
1201
- "onUpdate:hidden": (next) => setHidden(col.key, next)
1202
- }, null, 8, ["options", "hidden", "labels", "onUpdate:hidden"])
1203
- ]),
1204
- _: 2
1205
- }, 1032, ["aria-label"])) : createCommentVNode("", true),
1206
- canResize(col) ? (openBlock(), createElementBlock("span", {
1207
- key: 3,
1208
- role: "separator",
1209
- "aria-orientation": "vertical",
1210
- tabindex: "0",
1211
- "aria-label": text.value.resizeColumn.replace("{column}", col.label),
1212
- "aria-valuenow": widths.value[col.key],
1213
- class: "absolute inset-y-0 right-0 w-1.5 cursor-col-resize touch-none outline-none transition-colors duration-fast hover:bg-brand focus-visible:bg-brand",
1214
- "data-lp-resize": col.key,
1215
- onPointerdown: ($event) => startResize($event, col),
1216
- onClick: _cache[2] || (_cache[2] = withModifiers(() => {
1217
- }, ["stop"])),
1218
- onDblclick: withModifiers(($event) => clearWidth(col), ["stop"]),
1219
- onKeydown: ($event) => onResizeKey($event, col)
1220
- }, null, 40, _hoisted_17)) : createCommentVNode("", true)
1221
- ], 14, _hoisted_13);
1222
- }), 128))
1223
- ])
1224
- ], 2),
1225
- createVNode(TransitionGroup, {
1226
- tag: "tbody",
1227
- name: "lp-row",
1228
- css: animating.value && !__props.virtualRowHeight,
1229
- class: normalizeClass(busy.value && displayRows.value.length ? "opacity-60 transition-opacity" : "transition-opacity"),
1230
- "aria-busy": busy.value || void 0,
1231
- ref: (el) => unref(roving).setContainer(el?.$el ?? null)
1232
- }, {
1233
- default: withCtx(() => [
1234
- displayRows.value.length === 0 && busy.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.skeletonRows, (n) => {
1235
- return openBlock(), createElementBlock("tr", {
1236
- key: `lp-table-skeleton-${n}`,
1237
- class: "lp-row-empty border-b border-line/60 last:border-0"
1238
- }, [
1239
- expansionOn.value ? (openBlock(), createElementBlock("td", {
1240
- key: 0,
1241
- class: normalizeClass(["w-px p-0", cellY.value])
1242
- }, null, 2)) : createCommentVNode("", true),
1243
- __props.selectable ? (openBlock(), createElementBlock("td", {
1128
+ class: normalizeClass(["w-px p-0", cellY.value]),
1129
+ style: normalizeStyle(fixedLayout.value ? { width: EXPAND_COLUMN_WIDTH } : void 0)
1130
+ }, null, 6)) : createCommentVNode("", true),
1131
+ __props.selectable ? (openBlock(), createElementBlock("th", {
1244
1132
  key: 1,
1245
- class: normalizeClass(["w-px p-0", cellY.value])
1246
- }, null, 2)) : createCommentVNode("", true),
1247
- (openBlock(true), createElementBlock(Fragment, null, renderList(shownColumns.value, (col, ci) => {
1248
- return openBlock(), createElementBlock("td", {
1133
+ class: normalizeClass(["w-px p-0", cellY.value]),
1134
+ style: normalizeStyle(fixedLayout.value ? { width: ticksShown.value ? TICK_COLUMN_WIDTH : "0" } : void 0)
1135
+ }, [
1136
+ createElementVNode("div", {
1137
+ class: normalizeClass(["lp-tick lp-tick-open", ticksShown.value ? "" : "lp-tick-hidden"]),
1138
+ inert: !ticksShown.value
1139
+ }, [
1140
+ createVNode(_sfc_main$9, {
1141
+ "model-value": allChecked.value,
1142
+ indeterminate: someChecked.value,
1143
+ "onUpdate:modelValue": toggleAll
1144
+ }, null, 8, ["model-value", "indeterminate"])
1145
+ ], 10, _hoisted_12)
1146
+ ], 6)) : createCommentVNode("", true),
1147
+ (openBlock(true), createElementBlock(Fragment, null, renderList(shownColumns.value, (col) => {
1148
+ return openBlock(), createElementBlock("th", {
1249
1149
  key: col.key,
1250
- class: normalizeClass(["px-4", [alignClass(col.align), cellY.value]])
1150
+ style: normalizeStyle(headStyle(col)),
1151
+ class: normalizeClass(["px-4 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted", [alignClass(col.align), cellY.value, col.pin ? PIN_HEAD : "", canResize(col) && !col.pin ? "relative" : ""]]),
1152
+ "data-lp-col": measuredCol(col),
1153
+ "aria-sort": sortOf(col) ? sortOf(col).dir === "asc" ? "ascending" : "descending" : void 0
1251
1154
  }, [
1252
- createVNode(_sfc_main$c, {
1253
- class: "inline-block h-3 align-middle",
1254
- style: normalizeStyle({ width: skeletonWidth(n, ci) })
1255
- }, null, 8, ["style"]),
1256
- n === 1 && ci === 0 ? (openBlock(), createElementBlock("span", _hoisted_18, toDisplayString(text.value.loading), 1)) : createCommentVNode("", true)
1257
- ], 2);
1258
- }), 128))
1259
- ]);
1260
- }), 128)) : displayRows.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_19, [
1261
- createElementVNode("td", {
1262
- colspan: colSpan.value,
1263
- class: "p-0"
1264
- }, [
1265
- createVNode(_sfc_main$d, {
1266
- compact: "",
1267
- icon: failed.value ? "lucide:circle-alert" : filteredOut.value ? "lucide:filter-x" : __props.emptyIcon,
1268
- title: failed.value ? text.value.error : filteredOut.value ? text.value.noMatches : text.value.empty
1269
- }, {
1270
- default: withCtx(() => [
1271
- filteredOut.value ? (openBlock(), createBlock(_sfc_main$2, {
1155
+ col.sortable || col.filterable ? (openBlock(), createBlock(_sfc_main$8, {
1272
1156
  key: 0,
1273
- variant: "outline",
1274
- size: "sm",
1275
- onClick: resetFilters
1157
+ items: headerMenu(col)
1276
1158
  }, {
1277
1159
  default: withCtx(() => [
1278
- createTextVNode(toDisplayString(text.value.resetFilters), 1)
1160
+ createElementVNode("button", {
1161
+ type: "button",
1162
+ class: normalizeClass(["group/sort -mx-1 inline-flex items-center gap-1 rounded-small px-1 outline-none transition-colors duration-[var(--duration-fast)] hover:text-ink focus-visible:ring-2 focus-visible:ring-ring", [
1163
+ col.align === "right" ? "flex-row-reverse" : "",
1164
+ sortOf(col) ? "text-ink" : ""
1165
+ ]]),
1166
+ onClick: ($event) => toggleSort(col, $event)
1167
+ }, [
1168
+ createTextVNode(toDisplayString(col.label) + " ", 1),
1169
+ col.sortable ? (openBlock(), createBlock(_sfc_main$6, {
1170
+ key: 0,
1171
+ name: sortIcon(col),
1172
+ size: 13,
1173
+ class: normalizeClass([
1174
+ "shrink-0 transition-[transform,opacity] duration-[var(--duration-fast)] ease-[var(--ease-emphasized)]",
1175
+ sortOf(col) ? "opacity-100" : "opacity-40 group-hover/sort:opacity-70"
1176
+ ])
1177
+ }, null, 8, ["name", "class"])) : createCommentVNode("", true),
1178
+ sortPosition(col) ? (openBlock(), createElementBlock("span", _hoisted_15, toDisplayString(sortPosition(col)), 1)) : createCommentVNode("", true)
1179
+ ], 10, _hoisted_14)
1279
1180
  ]),
1280
- _: 1
1281
- })) : createCommentVNode("", true)
1282
- ]),
1283
- _: 1
1284
- }, 8, ["icon", "title"])
1285
- ], 8, _hoisted_20)
1286
- ])) : createCommentVNode("", true),
1287
- rowWindowed.value?.before ? (openBlock(), createElementBlock("tr", _hoisted_21, [
1288
- createElementVNode("td", {
1289
- colspan: colSpan.value,
1290
- class: "p-0",
1291
- style: normalizeStyle({ height: `${rowWindowed.value.before}px` })
1292
- }, null, 12, _hoisted_22)
1293
- ])) : createCommentVNode("", true),
1294
- (openBlock(true), createElementBlock(Fragment, null, renderList(viewEntries.value, (entry) => {
1295
- return openBlock(), createElementBlock(Fragment, {
1296
- key: entry.id
1297
- }, [
1298
- entry.kind === "group" ? (openBlock(), createElementBlock("tr", {
1299
- key: 0,
1300
- class: "border-b border-line/60 bg-surface-soft/60",
1301
- style: normalizeStyle(rowStyle.value)
1302
- }, [
1303
- createElementVNode("td", {
1304
- colspan: colSpan.value,
1305
- class: normalizeClass(["px-4 text-xs font-medium text-muted", cellY.value])
1181
+ _: 2
1182
+ }, 1032, ["items"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1183
+ createTextVNode(toDisplayString(col.label), 1)
1184
+ ], 64)),
1185
+ col.filterable ? (openBlock(), createBlock(_sfc_main$a, {
1186
+ key: 2,
1187
+ align: "start",
1188
+ "panel-class": "w-72",
1189
+ "aria-label": text.value.filterColumn.replace("{column}", col.label)
1190
+ }, {
1191
+ trigger: withCtx(() => [
1192
+ createElementVNode("button", {
1193
+ type: "button",
1194
+ class: normalizeClass(["ml-0.5 inline-grid size-5 place-items-center rounded-small align-middle outline-none transition-colors duration-fast hover:bg-surface-raised hover:text-ink focus-visible:ring-2 focus-visible:ring-ring", hiddenValues.value[col.key]?.size ? "text-brand" : "opacity-60"]),
1195
+ "aria-label": text.value.filterColumn.replace("{column}", col.label),
1196
+ "data-lp-filter": col.key
1197
+ }, [
1198
+ createVNode(_sfc_main$6, {
1199
+ name: hiddenValues.value[col.key]?.size ? "lucide:filter-x" : "lucide:filter",
1200
+ size: 12
1201
+ }, null, 8, ["name"])
1202
+ ], 10, _hoisted_16)
1203
+ ]),
1204
+ default: withCtx(() => [
1205
+ createVNode(_sfc_main$b, {
1206
+ options: facetOptions.value.get(col.key)?.value ?? [],
1207
+ hidden: hiddenValues.value[col.key] ?? /* @__PURE__ */ new Set(),
1208
+ labels: filterLabels(),
1209
+ "onUpdate:hidden": (next) => setHidden(col.key, next)
1210
+ }, null, 8, ["options", "hidden", "labels", "onUpdate:hidden"])
1211
+ ]),
1212
+ _: 2
1213
+ }, 1032, ["aria-label"])) : createCommentVNode("", true),
1214
+ canResize(col) ? (openBlock(), createElementBlock("span", {
1215
+ key: 3,
1216
+ role: "separator",
1217
+ "aria-orientation": "vertical",
1218
+ tabindex: "0",
1219
+ "aria-label": text.value.resizeColumn.replace("{column}", col.label),
1220
+ "aria-valuenow": widths.value[col.key],
1221
+ class: "absolute inset-y-0 right-0 w-1.5 cursor-col-resize touch-none outline-none transition-colors duration-fast hover:bg-brand focus-visible:bg-brand",
1222
+ "data-lp-resize": col.key,
1223
+ onPointerdown: ($event) => startResize($event, col),
1224
+ onClick: _cache[2] || (_cache[2] = withModifiers(() => {
1225
+ }, ["stop"])),
1226
+ onDblclick: withModifiers(($event) => clearWidth(col), ["stop"]),
1227
+ onKeydown: ($event) => onResizeKey($event, col)
1228
+ }, null, 40, _hoisted_17)) : createCommentVNode("", true)
1229
+ ], 14, _hoisted_13);
1230
+ }), 128))
1231
+ ])
1232
+ ], 2),
1233
+ createVNode(TransitionGroup, {
1234
+ tag: "tbody",
1235
+ name: "lp-row",
1236
+ css: animating.value && !__props.virtualRowHeight,
1237
+ class: normalizeClass(busy.value && displayRows.value.length ? "opacity-60 transition-opacity" : "transition-opacity"),
1238
+ "aria-busy": busy.value || void 0,
1239
+ ref: (el) => unref(roving).setContainer(el?.$el ?? null)
1240
+ }, {
1241
+ default: withCtx(() => [
1242
+ displayRows.value.length === 0 && busy.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.skeletonRows, (n) => {
1243
+ return openBlock(), createElementBlock("tr", {
1244
+ key: `lp-table-skeleton-${n}`,
1245
+ class: "lp-row-empty border-b border-line/60 last:border-0"
1306
1246
  }, [
1307
- renderSlot(_ctx.$slots, "group", {
1308
- value: entry.value,
1309
- rows: entry.rows,
1310
- label: entry.label,
1311
- collapsed: entry.collapsed,
1312
- toggle: () => toggleGroup(entry.group)
1313
- }, () => [
1314
- createElementVNode("button", {
1315
- type: "button",
1316
- class: "inline-flex items-center gap-1 rounded-small outline-none transition-colors duration-fast hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
1317
- "aria-expanded": !entry.collapsed,
1318
- "aria-label": (entry.collapsed ? text.value.expandGroup : text.value.collapseGroup).replace("{label}", entry.label),
1319
- onClick: ($event) => toggleGroup(entry.group)
1247
+ expansionOn.value ? (openBlock(), createElementBlock("td", {
1248
+ key: 0,
1249
+ class: normalizeClass(["w-px p-0", cellY.value])
1250
+ }, null, 2)) : createCommentVNode("", true),
1251
+ __props.selectable ? (openBlock(), createElementBlock("td", {
1252
+ key: 1,
1253
+ class: normalizeClass(["w-px p-0", cellY.value])
1254
+ }, null, 2)) : createCommentVNode("", true),
1255
+ (openBlock(true), createElementBlock(Fragment, null, renderList(shownColumns.value, (col, ci) => {
1256
+ return openBlock(), createElementBlock("td", {
1257
+ key: col.key,
1258
+ class: normalizeClass(["px-4", [alignClass(col.align), cellY.value]])
1320
1259
  }, [
1321
- createVNode(_sfc_main$3, {
1322
- name: "lucide:chevron-right",
1323
- size: 14,
1324
- class: normalizeClass(["transition-transform duration-fast motion-reduce:transition-none", entry.collapsed ? "" : "rotate-90"])
1325
- }, null, 8, ["class"]),
1326
- createTextVNode(" " + toDisplayString(entry.label), 1)
1327
- ], 8, _hoisted_24)
1328
- ], true)
1329
- ], 10, _hoisted_23)
1330
- ], 4)) : entry.kind === "detail" ? (openBlock(), createElementBlock("tr", _hoisted_25, [
1260
+ createVNode(_sfc_main$c, {
1261
+ class: "inline-block h-3 align-middle",
1262
+ style: normalizeStyle({ width: skeletonWidth(n, ci) })
1263
+ }, null, 8, ["style"]),
1264
+ n === 1 && ci === 0 ? (openBlock(), createElementBlock("span", _hoisted_18, toDisplayString(text.value.loading), 1)) : createCommentVNode("", true)
1265
+ ], 2);
1266
+ }), 128))
1267
+ ]);
1268
+ }), 128)) : displayRows.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_19, [
1331
1269
  createElementVNode("td", {
1332
1270
  colspan: colSpan.value,
1333
- class: "px-4 py-3"
1271
+ class: "p-0"
1334
1272
  }, [
1335
- renderSlot(_ctx.$slots, "expanded", {
1336
- row: entry.row,
1337
- close: () => toggleExpanded(keyFor(entry.row, entry.index))
1338
- }, void 0, true)
1339
- ], 8, _hoisted_26)
1340
- ])) : (openBlock(), createElementBlock("tr", mergeProps({
1341
- key: 2,
1342
- onContextmenu: ($event) => onRowContextMenu(entry.row),
1343
- class: ["group border-b border-line/60 outline-none transition-colors last:border-0 hover:bg-surface-soft/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-[active]:bg-surface-soft/40", isSelected(keyFor(entry.row, entry.index)) ? "bg-brand-soft/40" : ""],
1344
- style: rowStyle.value,
1345
- "aria-rowindex": __props.virtualRowHeight ? rowOffset(entry) : void 0
1346
- }, { ref_for: true }, unref(roving).itemProps(String(keyFor(entry.row, entry.index))), {
1347
- "data-paint-key": __props.selectable ? String(keyFor(entry.row, entry.index)) : void 0,
1348
- "data-lp-context-row": __props.rowMenu ? "" : void 0,
1349
- onClick: ($event) => onRowClick(entry.row, keyFor(entry.row, entry.index)),
1350
- onPointerdown: ($event) => onRowPointerDown($event, keyFor(entry.row, entry.index)),
1351
- onKeydown: onRowKeydown
1352
- }), [
1353
- expansionOn.value ? (openBlock(), createElementBlock("td", {
1354
- key: 0,
1355
- class: normalizeClass(["w-px p-0 text-center", cellY.value]),
1356
- onClick: _cache[3] || (_cache[3] = withModifiers(() => {
1357
- }, ["stop"])),
1358
- onKeydown: _cache[4] || (_cache[4] = withModifiers(() => {
1359
- }, ["stop"]))
1273
+ createVNode(_sfc_main$d, {
1274
+ compact: "",
1275
+ icon: failed.value ? "lucide:circle-alert" : filteredOut.value ? "lucide:filter-x" : __props.emptyIcon,
1276
+ title: failed.value ? text.value.error : filteredOut.value ? text.value.noMatches : text.value.empty
1277
+ }, {
1278
+ default: withCtx(() => [
1279
+ filteredOut.value ? (openBlock(), createBlock(_sfc_main$5, {
1280
+ key: 0,
1281
+ variant: "outline",
1282
+ size: "sm",
1283
+ onClick: resetFilters
1284
+ }, {
1285
+ default: withCtx(() => [
1286
+ createTextVNode(toDisplayString(text.value.resetFilters), 1)
1287
+ ]),
1288
+ _: 1
1289
+ })) : createCommentVNode("", true)
1290
+ ]),
1291
+ _: 1
1292
+ }, 8, ["icon", "title"])
1293
+ ], 8, _hoisted_20)
1294
+ ])) : createCommentVNode("", true),
1295
+ rowWindowed.value?.before ? (openBlock(), createElementBlock("tr", _hoisted_21, [
1296
+ createElementVNode("td", {
1297
+ colspan: colSpan.value,
1298
+ class: "p-0",
1299
+ style: normalizeStyle({ height: `${rowWindowed.value.before}px` })
1300
+ }, null, 12, _hoisted_22)
1301
+ ])) : createCommentVNode("", true),
1302
+ (openBlock(true), createElementBlock(Fragment, null, renderList(viewEntries.value, (entry) => {
1303
+ return openBlock(), createElementBlock(Fragment, {
1304
+ key: entry.id
1360
1305
  }, [
1361
- canExpand(entry.row) ? (openBlock(), createElementBlock("button", {
1306
+ entry.kind === "group" ? (openBlock(), createElementBlock("tr", {
1362
1307
  key: 0,
1363
- type: "button",
1364
- class: "inline-grid size-6 place-items-center rounded-small text-muted outline-none transition-colors duration-fast hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
1365
- "aria-expanded": expandedKeys.value.has(keyFor(entry.row, entry.index)),
1366
- "aria-label": expandedKeys.value.has(keyFor(entry.row, entry.index)) ? text.value.collapseRow : text.value.expandRow,
1367
- onClick: ($event) => toggleExpanded(keyFor(entry.row, entry.index))
1368
- }, [
1369
- createVNode(_sfc_main$3, {
1370
- name: "lucide:chevron-right",
1371
- size: 14,
1372
- class: normalizeClass(["transition-transform duration-fast motion-reduce:transition-none", expandedKeys.value.has(keyFor(entry.row, entry.index)) ? "rotate-90" : ""])
1373
- }, null, 8, ["class"])
1374
- ], 8, _hoisted_28)) : createCommentVNode("", true)
1375
- ], 34)) : createCommentVNode("", true),
1376
- __props.selectable ? (openBlock(), createElementBlock("td", {
1377
- key: 1,
1378
- class: normalizeClass(["w-px cursor-pointer p-0 select-none", cellY.value]),
1379
- onClick: _cache[5] || (_cache[5] = withModifiers(() => {
1380
- }, ["stop"])),
1381
- onPointerdown: withModifiers(($event) => unref(paint).onPointerDown($event, keyFor(entry.row, entry.index)), ["stop"])
1382
- }, [
1383
- createElementVNode("div", {
1384
- class: normalizeClass(["lp-tick lp-tick-open", ticksShown.value ? "" : "lp-tick-cue"])
1308
+ class: "border-b border-line/60 bg-surface-soft/60",
1309
+ style: normalizeStyle(rowStyle.value)
1385
1310
  }, [
1386
- createVNode(_sfc_main$9, {
1387
- "model-value": isSelected(keyFor(entry.row, entry.index)),
1388
- "onUpdate:modelValue": (v) => toggleRow(keyFor(entry.row, entry.index), v)
1389
- }, null, 8, ["model-value", "onUpdate:modelValue"])
1390
- ], 2)
1391
- ], 42, _hoisted_29)) : createCommentVNode("", true),
1392
- (openBlock(true), createElementBlock(Fragment, null, renderList(shownColumns.value, (col) => {
1393
- return openBlock(), createElementBlock("td", {
1394
- key: col.key,
1395
- class: normalizeClass(["px-4 text-ink", [alignClass(col.align), cellY.value, col.nowrap ? "whitespace-nowrap" : "", col.pin ? PIN_CELL : ""]]),
1396
- style: normalizeStyle(pinStyle(col))
1397
- }, [
1398
- renderSlot(_ctx.$slots, `cell-${col.key}`, {
1399
- row: entry.row,
1400
- value: entry.row[col.key],
1401
- openMenu: openRowMenu
1402
- }, () => [
1403
- isEditable(col, entry.row) ? (openBlock(), createElementBlock("span", {
1311
+ createElementVNode("td", {
1312
+ colspan: colSpan.value,
1313
+ class: normalizeClass(["px-4 text-xs font-medium text-muted", cellY.value])
1314
+ }, [
1315
+ renderSlot(_ctx.$slots, "group", {
1316
+ value: entry.value,
1317
+ rows: entry.rows,
1318
+ label: entry.label,
1319
+ collapsed: entry.collapsed,
1320
+ toggle: () => toggleGroup(entry.group)
1321
+ }, () => [
1322
+ createElementVNode("button", {
1323
+ type: "button",
1324
+ class: "inline-flex items-center gap-1 rounded-small outline-none transition-colors duration-fast hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
1325
+ "aria-expanded": !entry.collapsed,
1326
+ "aria-label": (entry.collapsed ? text.value.expandGroup : text.value.collapseGroup).replace("{label}", entry.label),
1327
+ onClick: ($event) => toggleGroup(entry.group)
1328
+ }, [
1329
+ createVNode(_sfc_main$6, {
1330
+ name: "lucide:chevron-right",
1331
+ size: 14,
1332
+ class: normalizeClass(["transition-transform duration-fast motion-reduce:transition-none", entry.collapsed ? "" : "rotate-90"])
1333
+ }, null, 8, ["class"]),
1334
+ createTextVNode(" " + toDisplayString(entry.label), 1)
1335
+ ], 8, _hoisted_24)
1336
+ ], true)
1337
+ ], 10, _hoisted_23)
1338
+ ], 4)) : entry.kind === "detail" ? (openBlock(), createElementBlock("tr", _hoisted_25, [
1339
+ createElementVNode("td", {
1340
+ colspan: colSpan.value,
1341
+ class: "px-4 py-3"
1342
+ }, [
1343
+ renderSlot(_ctx.$slots, "expanded", {
1344
+ row: entry.row,
1345
+ close: () => toggleExpanded(keyFor(entry.row, entry.index))
1346
+ }, void 0, true)
1347
+ ], 8, _hoisted_26)
1348
+ ])) : (openBlock(), createElementBlock("tr", mergeProps({
1349
+ key: 2,
1350
+ onContextmenu: ($event) => onRowContextMenu(entry.row),
1351
+ class: ["group border-b border-line/60 outline-none transition-colors last:border-0 hover:bg-surface-soft/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-[active]:bg-surface-soft/40", isSelected(keyFor(entry.row, entry.index)) ? "bg-brand-soft/40" : ""],
1352
+ style: rowStyle.value,
1353
+ "aria-rowindex": __props.virtualRowHeight ? rowOffset(entry) : void 0
1354
+ }, { ref_for: true }, unref(roving).itemProps(String(keyFor(entry.row, entry.index))), {
1355
+ "data-paint-key": __props.selectable ? String(keyFor(entry.row, entry.index)) : void 0,
1356
+ "data-lp-context-row": __props.rowMenu ? "" : void 0,
1357
+ onClick: ($event) => onRowClick(entry.row, keyFor(entry.row, entry.index)),
1358
+ onPointerdown: ($event) => onRowPointerDown($event, keyFor(entry.row, entry.index)),
1359
+ onKeydown: onRowKeydown
1360
+ }), [
1361
+ expansionOn.value ? (openBlock(), createElementBlock("td", {
1362
+ key: 0,
1363
+ class: normalizeClass(["w-px p-0 text-center", cellY.value]),
1364
+ onClick: _cache[3] || (_cache[3] = withModifiers(() => {
1365
+ }, ["stop"])),
1366
+ onKeydown: _cache[4] || (_cache[4] = withModifiers(() => {
1367
+ }, ["stop"]))
1368
+ }, [
1369
+ canExpand(entry.row) ? (openBlock(), createElementBlock("button", {
1404
1370
  key: 0,
1405
- class: "inline-block",
1406
- onClick: _cache[6] || (_cache[6] = withModifiers(() => {
1407
- }, ["stop"])),
1408
- onPointerdown: _cache[7] || (_cache[7] = withModifiers(() => {
1409
- }, ["stop"])),
1410
- onKeydown: _cache[8] || (_cache[8] = withModifiers(() => {
1411
- }, ["stop"]))
1371
+ type: "button",
1372
+ class: "inline-grid size-6 place-items-center rounded-small text-muted outline-none transition-colors duration-fast hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
1373
+ "aria-expanded": expandedKeys.value.has(keyFor(entry.row, entry.index)),
1374
+ "aria-label": expandedKeys.value.has(keyFor(entry.row, entry.index)) ? text.value.collapseRow : text.value.expandRow,
1375
+ onClick: ($event) => toggleExpanded(keyFor(entry.row, entry.index))
1412
1376
  }, [
1413
- createVNode(_sfc_main$e, {
1414
- "model-value": String(entry.row[col.key] ?? ""),
1415
- label: col.label,
1416
- size: "sm",
1417
- validate: (value) => col.validateEdit?.(value, entry.row),
1418
- save: (value) => saveCell(col, entry.row, value)
1419
- }, null, 8, ["model-value", "label", "validate", "save"])
1420
- ], 32)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1421
- createTextVNode(toDisplayString(entry.row[col.key]), 1)
1422
- ], 64))
1423
- ], true)
1424
- ], 6);
1425
- }), 128))
1426
- ], 16, _hoisted_27))
1427
- ], 64);
1428
- }), 128)),
1429
- rowWindowed.value?.after ? (openBlock(), createElementBlock("tr", _hoisted_30, [
1430
- createElementVNode("td", {
1431
- colspan: colSpan.value,
1432
- class: "p-0",
1433
- style: normalizeStyle({ height: `${rowWindowed.value.after}px` })
1434
- }, null, 12, _hoisted_31)
1435
- ])) : createCommentVNode("", true)
1436
- ]),
1437
- _: 3
1438
- }, 8, ["css", "class", "aria-busy"])
1439
- ], 14, _hoisted_10)
1377
+ createVNode(_sfc_main$6, {
1378
+ name: "lucide:chevron-right",
1379
+ size: 14,
1380
+ class: normalizeClass(["transition-transform duration-fast motion-reduce:transition-none", expandedKeys.value.has(keyFor(entry.row, entry.index)) ? "rotate-90" : ""])
1381
+ }, null, 8, ["class"])
1382
+ ], 8, _hoisted_28)) : createCommentVNode("", true)
1383
+ ], 34)) : createCommentVNode("", true),
1384
+ __props.selectable ? (openBlock(), createElementBlock("td", {
1385
+ key: 1,
1386
+ class: normalizeClass(["w-px cursor-pointer p-0 select-none", cellY.value]),
1387
+ onClick: _cache[5] || (_cache[5] = withModifiers(() => {
1388
+ }, ["stop"])),
1389
+ onPointerdown: withModifiers(($event) => unref(paint).onPointerDown($event, keyFor(entry.row, entry.index)), ["stop"])
1390
+ }, [
1391
+ createElementVNode("div", {
1392
+ class: normalizeClass(["lp-tick lp-tick-open", ticksShown.value ? "" : "lp-tick-cue"])
1393
+ }, [
1394
+ createVNode(_sfc_main$9, {
1395
+ "model-value": isSelected(keyFor(entry.row, entry.index)),
1396
+ "onUpdate:modelValue": (v) => toggleRow(keyFor(entry.row, entry.index), v)
1397
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
1398
+ ], 2)
1399
+ ], 42, _hoisted_29)) : createCommentVNode("", true),
1400
+ (openBlock(true), createElementBlock(Fragment, null, renderList(shownColumns.value, (col) => {
1401
+ return openBlock(), createElementBlock("td", {
1402
+ key: col.key,
1403
+ class: normalizeClass(["px-4 text-ink", [alignClass(col.align), cellY.value, col.nowrap ? "whitespace-nowrap" : "", col.pin ? PIN_CELL : ""]]),
1404
+ style: normalizeStyle(pinStyle(col))
1405
+ }, [
1406
+ renderSlot(_ctx.$slots, `cell-${col.key}`, {
1407
+ row: entry.row,
1408
+ value: entry.row[col.key],
1409
+ openMenu: openRowMenu
1410
+ }, () => [
1411
+ isEditable(col, entry.row) ? (openBlock(), createElementBlock("span", {
1412
+ key: 0,
1413
+ class: "inline-block",
1414
+ onClick: _cache[6] || (_cache[6] = withModifiers(() => {
1415
+ }, ["stop"])),
1416
+ onPointerdown: _cache[7] || (_cache[7] = withModifiers(() => {
1417
+ }, ["stop"])),
1418
+ onKeydown: _cache[8] || (_cache[8] = withModifiers(() => {
1419
+ }, ["stop"]))
1420
+ }, [
1421
+ createVNode(_sfc_main$e, {
1422
+ "model-value": String(entry.row[col.key] ?? ""),
1423
+ label: col.label,
1424
+ size: "sm",
1425
+ validate: (value) => col.validateEdit?.(value, entry.row),
1426
+ save: (value) => saveCell(col, entry.row, value)
1427
+ }, null, 8, ["model-value", "label", "validate", "save"])
1428
+ ], 32)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1429
+ createTextVNode(toDisplayString(entry.row[col.key]), 1)
1430
+ ], 64))
1431
+ ], true)
1432
+ ], 6);
1433
+ }), 128))
1434
+ ], 16, _hoisted_27))
1435
+ ], 64);
1436
+ }), 128)),
1437
+ rowWindowed.value?.after ? (openBlock(), createElementBlock("tr", _hoisted_30, [
1438
+ createElementVNode("td", {
1439
+ colspan: colSpan.value,
1440
+ class: "p-0",
1441
+ style: normalizeStyle({ height: `${rowWindowed.value.after}px` })
1442
+ }, null, 12, _hoisted_31)
1443
+ ])) : createCommentVNode("", true)
1444
+ ]),
1445
+ _: 3
1446
+ }, 8, ["css", "class", "aria-busy"])
1447
+ ], 14, _hoisted_10)
1448
+ ]),
1449
+ _: 3
1450
+ }, 8, ["items", "no-hint", "title", "subtitle", "title-icon", "title-image"])
1440
1451
  ]),
1441
1452
  _: 3
1442
- }, 8, ["items", "no-hint", "title", "subtitle", "title-icon", "title-image"])
1453
+ }, 16, ["style", "bar-inset-top"])
1443
1454
  ]),
1444
1455
  _: 3
1445
- }, 16, ["style", "bar-inset-top"]),
1456
+ }, 8, ["disabled"]),
1446
1457
  __props.load && total.value > __props.pageSize ? (openBlock(), createBlock(_sfc_main$f, {
1447
- key: 1,
1458
+ key: 0,
1448
1459
  page: page.value,
1449
1460
  "onUpdate:page": _cache[9] || (_cache[9] = ($event) => page.value = $event),
1450
1461
  total: total.value,
@@ -1455,7 +1466,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1455
1466
  };
1456
1467
  }
1457
1468
  });
1458
- const LpTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-48ad51fc"]]);
1469
+ const LpTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3fb24315"]]);
1459
1470
  export {
1460
1471
  LpTable as default
1461
1472
  };