@leaflink/stash 53.4.5 → 53.4.6

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/Table.js CHANGED
@@ -1,19 +1,19 @@
1
- import { defineComponent as K, useCssModule as Q, inject as R, computed as l, useTemplateRef as O, ref as Y, provide as Z, watchEffect as ee, createElementBlock as v, openBlock as d, createElementVNode as u, createCommentVNode as _, normalizeStyle as k, normalizeClass as n, unref as b, renderSlot as S, createBlock as H, withCtx as f, createVNode as r, Fragment as I } from "vue";
1
+ import { defineComponent as K, useCssModule as Q, inject as R, computed as l, useTemplateRef as O, ref as Y, provide as Z, watchEffect as ee, createElementBlock as v, openBlock as d, createElementVNode as u, createCommentVNode as _, normalizeStyle as S, normalizeClass as n, unref as b, renderSlot as k, createBlock as H, withCtx as f, createVNode as r, Fragment as I } from "vue";
2
2
  import { b as te, c as N, d as le } from "./index-DA70nQCT.js";
3
3
  import A from "./Button.js";
4
4
  import "lodash-es/cloneDeep";
5
- import { M as z } from "./Module.keys-DcqBbvvT.js";
5
+ import { M as D } from "./Module.keys-DcqBbvvT.js";
6
6
  import "lodash-es/get";
7
- import $ from "./Icon.js";
8
- import { D } from "./DataView.keys-aSOnA4AD.js";
7
+ import z from "./Icon.js";
8
+ import { D as $ } from "./DataView.keys-aSOnA4AD.js";
9
9
  import ae from "./EmptyState.js";
10
- import oe from "./Loading.js";
10
+ import se from "./Loading.js";
11
11
  import M from "./TableCell.js";
12
12
  import J from "./TableRow.js";
13
- import { T as se } from "./Table.keys-LHQf6FEH.js";
13
+ import { T as oe } from "./Table.keys-LHQf6FEH.js";
14
14
  import { S as re } from "./misc-CHQs-G03.js";
15
15
  import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
- var ie = /* @__PURE__ */ ((s) => (s.Scroll = "scroll", s.Stack = "stack", s))(ie || {}), ce = /* @__PURE__ */ ((s) => (s.None = "none", s.Rounded = "rounded", s.RoundedBottom = "rounded-bottom", s))(ce || {});
16
+ var ie = /* @__PURE__ */ ((o) => (o.Scroll = "scroll", o.Stack = "stack", o))(ie || {}), ce = /* @__PURE__ */ ((o) => (o.None = "none", o.Rounded = "rounded", o.RoundedBottom = "rounded-bottom", o))(ce || {});
17
17
  const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /* @__PURE__ */ K({
18
18
  __name: "Table",
19
19
  props: {
@@ -22,6 +22,7 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
22
22
  hasActions: { type: Boolean, default: !1 },
23
23
  hasCustomExpandToggle: { type: Boolean, default: !1 },
24
24
  isEmpty: { type: Boolean, default: !1 },
25
+ isSchemaDriven: { type: Boolean, default: !1 },
25
26
  isLoading: { type: Boolean, default: !1 },
26
27
  isExpandable: { type: Boolean, default: !1 },
27
28
  isSelectable: { type: Boolean, default: !1 },
@@ -29,14 +30,14 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
29
30
  radius: { default: "rounded" },
30
31
  stickyHeader: { default: void 0 }
31
32
  },
32
- setup(s) {
33
- const e = s, m = Q(), {
33
+ setup(o) {
34
+ const e = o, m = Q(), {
34
35
  density: P,
35
36
  variant: p,
36
37
  isEmpty: h,
37
38
  isLoading: i,
38
39
  isSelectable: E
39
- } = R(D.key, D.defaults), { variant: y } = R(z.key, z.defaults), C = l(() => (y == null ? void 0 : y.value) === "table" || p.value === "table" ? "rounded-bottom" : e.radius), o = l(() => e.stickyHeader ? "scroll" : e.layout), V = l(() => o.value === "scroll" && p.value === "table"), W = l(() => {
40
+ } = R($.key, $.defaults), { variant: y } = R(D.key, D.defaults), C = l(() => (y == null ? void 0 : y.value) === "table" || p.value === "table" ? "rounded-bottom" : e.radius), s = l(() => e.stickyHeader ? "scroll" : e.layout), V = l(() => s.value === "scroll" && p.value === "table"), W = l(() => {
40
41
  var t, a;
41
42
  return !!((t = e.stickyHeader) != null && t.maxHeight && ((a = e.stickyHeader) == null ? void 0 : a.listLength) > 3);
42
43
  }), X = l(() => {
@@ -44,10 +45,10 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
44
45
  return {
45
46
  maxHeight: W.value ? (t = e.stickyHeader) == null ? void 0 : t.maxHeight : ""
46
47
  };
47
- }), w = l(() => !!(e.isLoading || i != null && i.value)), c = O("scrollContainerRef"), x = O("tableRef"), T = Y(!1), { arrivedState: L, measure: j } = te(c, { behavior: "smooth" });
48
+ }), w = l(() => !!(e.isLoading || i != null && i.value)), c = O("scrollContainerRef"), x = O("tableRef"), T = Y(!1), { arrivedState: B, measure: j } = te(c, { behavior: "smooth" });
48
49
  function g() {
49
50
  const t = c.value;
50
- !t || o.value !== "scroll" || (T.value = t.scrollWidth > t.clientWidth, j());
51
+ !t || s.value !== "scroll" || (T.value = t.scrollWidth > t.clientWidth, j());
51
52
  }
52
53
  N(c, g), N(x, g), le(
53
54
  c,
@@ -57,21 +58,22 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
57
58
  },
58
59
  { threshold: 0.01 }
59
60
  );
60
- const F = l(() => !L.left), U = l(() => !L.right), q = l(() => o.value === "scroll" && T.value);
61
- function B(t) {
61
+ const F = l(() => !B.left), U = l(() => !B.right), q = l(() => s.value === "scroll" && T.value);
62
+ function L(t) {
62
63
  var a;
63
64
  (a = c.value) == null || a.scrollBy({ left: t, behavior: "smooth" });
64
65
  }
65
- return Z(se.key, {
66
+ return Z(oe.key, {
66
67
  density: l(() => e.density || P.value || re.Comfortable),
67
68
  hasCustomExpandToggle: l(() => e.hasCustomExpandToggle),
68
69
  hasActions: l(() => e.hasActions),
70
+ isSchemaDriven: l(() => e.isSchemaDriven),
69
71
  isExpandable: l(() => e.isExpandable),
70
72
  isSelectable: l(
71
73
  () => e.isSelectable && !e.isLoading && !(i != null && i.value) && !e.isEmpty && !(h != null && h.value)
72
74
  ),
73
75
  isLoading: w,
74
- layout: o
76
+ layout: s
75
77
  }), ee(() => {
76
78
  E && (E.value = e.isSelectable);
77
79
  }), (t, a) => (d(), v("div", de, [
@@ -82,15 +84,15 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
82
84
  { rounded: C.value === "rounded" },
83
85
  { "rounded-b": C.value === "rounded-bottom" },
84
86
  { "border-t border-ice-200": b(p) === "table" },
85
- { "overflow-auto scroll-smooth": o.value === "scroll" },
87
+ { "overflow-auto scroll-smooth": s.value === "scroll" },
86
88
  { shadow: V.value },
87
89
  {
88
- "overflow-visible lg:overflow-auto lg:shadow": o.value === "stack"
90
+ "overflow-visible lg:overflow-auto lg:shadow": s.value === "stack"
89
91
  }
90
92
  ]]),
91
93
  "data-test": "stash-table",
92
94
  "aria-busy": w.value,
93
- style: k(X.value)
95
+ style: S(X.value)
94
96
  }, [
95
97
  u("table", {
96
98
  ref_key: "tableRef",
@@ -98,22 +100,20 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
98
100
  class: "relative w-full border-separate"
99
101
  }, [
100
102
  u("thead", {
101
- class: n(["border-b border-ice-200", {
102
- "hidden lg:table-header-group": o.value === "stack"
103
- }])
103
+ class: n(["border-b border-ice-200", { "hidden lg:table-header-group": s.value === "stack" }])
104
104
  }, [
105
- S(t.$slots, "head")
105
+ k(t.$slots, "head")
106
106
  ], 2),
107
107
  u("tbody", null, [
108
108
  w.value ? (d(), H(J, { key: 0 }, {
109
109
  default: f(() => [
110
110
  r(M, {
111
111
  colspan: "100%",
112
- class: n({ "relative! col-span-12": o.value === "stack" })
112
+ class: n({ "relative! col-span-12": s.value === "stack" })
113
113
  }, {
114
114
  default: f(() => [
115
- r(oe, {
116
- style: k([o.value === "scroll" ? { "max-width": "100vw" } : {}])
115
+ r(se, {
116
+ style: S([s.value === "scroll" ? { "max-width": "100vw" } : {}])
117
117
  }, null, 8, ["style"])
118
118
  ]),
119
119
  _: 1
@@ -124,14 +124,14 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
124
124
  default: f(() => [
125
125
  r(M, {
126
126
  colspan: "100%",
127
- class: n({ "relative! col-span-12": o.value === "stack" })
127
+ class: n({ "relative! col-span-12": s.value === "stack" })
128
128
  }, {
129
129
  default: f(() => [
130
- S(t.$slots, "empty", {}, () => [
130
+ k(t.$slots, "empty", {}, () => [
131
131
  r(ae, {
132
132
  class: "w-full bg-white",
133
133
  text: e.emptyStateText,
134
- style: k([o.value === "scroll" ? { "max-width": "100vw" } : {}])
134
+ style: S([s.value === "scroll" ? { "max-width": "100vw" } : {}])
135
135
  }, null, 8, ["text", "style"])
136
136
  ])
137
137
  ]),
@@ -139,7 +139,7 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
139
139
  }, 8, ["class"])
140
140
  ]),
141
141
  _: 3
142
- })) : S(t.$slots, "body", { key: 2 })
142
+ })) : k(t.$slots, "body", { key: 2 })
143
143
  ])
144
144
  ], 512)
145
145
  ], 14, ue),
@@ -158,10 +158,10 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
158
158
  icon: "",
159
159
  "aria-label": "Scroll table left",
160
160
  "data-test": "stash-table|scroll-left",
161
- onClick: a[0] || (a[0] = (G) => B(-200))
161
+ onClick: a[0] || (a[0] = (G) => L(-200))
162
162
  }, {
163
163
  default: f(() => [
164
- r($, { name: "chevron-left" })
164
+ r(z, { name: "chevron-left" })
165
165
  ]),
166
166
  _: 1
167
167
  })
@@ -177,10 +177,10 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
177
177
  icon: "",
178
178
  "aria-label": "Scroll table right",
179
179
  "data-test": "stash-table|scroll-right",
180
- onClick: a[1] || (a[1] = (G) => B(200))
180
+ onClick: a[1] || (a[1] = (G) => L(200))
181
181
  }, {
182
182
  default: f(() => [
183
- r($, {
183
+ r(z, {
184
184
  name: "chevron-right",
185
185
  class: "text-ice-900"
186
186
  })
@@ -200,7 +200,7 @@ const de = { class: "stash-table-wrapper relative" }, ue = ["aria-busy"], fe = /
200
200
  }, Oe = /* @__PURE__ */ ne(fe, [["__cssModules", he]]);
201
201
  export {
202
202
  ie as Layout,
203
- se as TABLE_INJECTION,
203
+ oe as TABLE_INJECTION,
204
204
  ce as TableRadius,
205
205
  Oe as default
206
206
  };
package/dist/Table.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../src/components/Table/Table.types.ts","../src/components/Table/Table.vue"],"sourcesContent":["import type { ComputedRef } from 'vue';\n\nimport { SpacingDensities } from '../../../types/misc';\n\nexport enum Layout {\n Scroll = 'scroll',\n Stack = 'stack',\n}\n\nexport type Layouts = `${Layout}`;\n\nexport enum TableRadius {\n None = 'none',\n Rounded = 'rounded',\n RoundedBottom = 'rounded-bottom',\n}\n\nexport type TableRadiuses = `${TableRadius}`;\n\n/**\n * Properties and utilities provided to children of a Table instance\n */\nexport interface TableInjection {\n /**\n * Controls the Table's padding; the default value is \"comfortable\". On small screens, the density will always be \"compact\".\n */\n density: ComputedRef<SpacingDensities>;\n\n /**\n * Styles the last column for \"row actions\"\n */\n hasActions: ComputedRef<boolean>;\n\n /**\n * If true, hides the default expansion toggle column\n */\n hasCustomExpandToggle: ComputedRef<boolean>;\n\n /**\n * Adds a toggle column for row expansion. This is primarily needed for ensuring the corresponding empty TableHeaderRow is included.\n */\n isExpandable: ComputedRef<boolean>;\n\n /**\n * Adds a checkbox column for selecting rows; intended for use with the `useSelection` composable.\n */\n isSelectable: ComputedRef<boolean>;\n\n /**\n * Sets the table layout; the default value is \"scroll\".\n */\n layout: ComputedRef<Layouts>;\n\n /**\n * Sets the table loading state.\n */\n isLoading: ComputedRef<boolean>;\n}\n","<script lang=\"ts\">\n import { SpacingDensities, SpacingDensity } from '../../../types/misc';\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { Layouts, TableRadiuses } from './Table.types';\n\n export * from './Table.keys';\n export * from './Table.types';\n\n export interface TableProps {\n /**\n * Controls the Table's padding; the default value is \"comfortable\". On small screens, \"compact\" density is applied regardless of this prop's value.\n */\n density?: SpacingDensities;\n\n /**\n * Sets the text for the empty state; the default value is \"No Results\".\n */\n emptyStateText?: string;\n\n /**\n * Styles the last column for \"row actions\"\n */\n hasActions?: boolean;\n\n /**\n * If true, hides the default expansion toggle column\n */\n hasCustomExpandToggle?: boolean;\n\n /**\n * Shows the empty state\n */\n isEmpty?: boolean;\n\n /**\n * Shows the loading state\n */\n isLoading?: boolean;\n\n /**\n * Adds a toggle column for row expansion. This is primarily needed for ensuring the corresponding empty TableHeaderRow is included.\n */\n isExpandable?: boolean;\n\n /**\n * Adds a checkbox column for selecting rows; intended for use with the `useSelection` composable.\n */\n isSelectable?: boolean;\n\n /**\n * Sets the table layout; the default value is \"scroll\".\n */\n layout?: Layouts;\n\n /**\n * Controls the corners of the table with the \"border-radius\" CSS property. The default value is \"rounded\".\n */\n radius?: TableRadiuses;\n\n /**\n * Allows the table head to be sticky when scrolling inside the table body\n */\n stickyHeader?: {\n listLength: number;\n maxHeight: string;\n };\n }\n</script>\n\n<script setup lang=\"ts\">\n import { useIntersectionObserver, useResizeObserver, useScroll } from '@vueuse/core';\n import { computed, inject, provide, ref, useCssModule, useTemplateRef, watchEffect } from 'vue';\n\n import Button from '../Button/Button.vue';\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import EmptyState from '../EmptyState/EmptyState.vue';\n import Icon from '../Icon/Icon.vue';\n import Loading from '../Loading/Loading.vue';\n import TableCell from '../TableCell/TableCell.vue';\n import TableRow from '../TableRow/TableRow.vue';\n import { TABLE_INJECTION } from './Table.keys';\n\n const SCROLL_DELTA_PX = 200;\n\n const props = withDefaults(defineProps<TableProps>(), {\n density: undefined,\n emptyStateText: '',\n hasActions: false,\n hasCustomExpandToggle: false,\n isEmpty: false,\n isLoading: false,\n isExpandable: false,\n isSelectable: false,\n layout: 'scroll',\n radius: 'rounded',\n stickyHeader: undefined,\n });\n\n const classes = useCssModule();\n\n const {\n density: dataViewDensity,\n variant: dataViewVariant,\n isEmpty: isDataViewEmpty,\n isLoading: isDataViewLoading,\n isSelectable: isDataViewSelectable,\n } = inject(DATA_VIEW_INJECTION.key, DATA_VIEW_INJECTION.defaults);\n\n const { variant: moduleVariant } = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n\n const computedRadius = computed<TableRadiuses>(() => {\n // Will work for tables when rendered inside of a Module with OR without a DataView.\n if (moduleVariant?.value === 'table') {\n return 'rounded-bottom';\n }\n\n if (dataViewVariant.value === 'table') {\n return 'rounded-bottom';\n }\n\n return props.radius;\n });\n\n const computedLayout = computed<Layouts>(() => {\n if (props.stickyHeader) {\n return 'scroll';\n }\n\n return props.layout;\n });\n\n const isShadowEnabled = computed<boolean>(() => {\n return computedLayout.value === 'scroll' && dataViewVariant.value === 'table';\n });\n\n const isStickyHeaderEnabled = computed<boolean>(() => {\n return !!(\n (props.stickyHeader?.maxHeight && props.stickyHeader?.listLength > 3) // table can't scroll without a max height; sticky headers only needed for a scrollable table\n // scrollable table and sticky headers not needed when list is small\n );\n });\n\n const rootStyle = computed(() => ({\n maxHeight: isStickyHeaderEnabled.value ? props.stickyHeader?.maxHeight : '',\n }));\n\n const isTableLoading = computed(() => Boolean(props.isLoading || isDataViewLoading?.value));\n\n const scrollContainerRef = useTemplateRef<HTMLElement>('scrollContainerRef');\n const tableRef = useTemplateRef<HTMLTableElement>('tableRef');\n const hasHorizontalOverflow = ref(false);\n\n const { arrivedState, measure } = useScroll(scrollContainerRef, { behavior: 'smooth' });\n\n function updateOverflow() {\n const el = scrollContainerRef.value;\n if (!el || computedLayout.value !== 'scroll') return;\n hasHorizontalOverflow.value = el.scrollWidth > el.clientWidth;\n measure();\n }\n\n useResizeObserver(scrollContainerRef, updateOverflow);\n useResizeObserver(tableRef, updateOverflow);\n\n // recalculate overflow when the scroll container is intersected by the viewport.\n // For instance when the table is inside a v-show container\n useIntersectionObserver(\n scrollContainerRef,\n (entries) => {\n if (entries[0]?.isIntersecting) updateOverflow();\n },\n { threshold: 0.01 },\n );\n\n const canScrollLeft = computed(() => !arrivedState.left);\n const canScrollRight = computed(() => !arrivedState.right);\n const showScrollButtons = computed(() => computedLayout.value === 'scroll' && hasHorizontalOverflow.value);\n\n function scrollBy(delta: number) {\n scrollContainerRef.value?.scrollBy({ left: delta, behavior: 'smooth' });\n }\n\n provide(TABLE_INJECTION.key, {\n density: computed(() => props.density || dataViewDensity.value || SpacingDensity.Comfortable),\n hasCustomExpandToggle: computed(() => props.hasCustomExpandToggle),\n hasActions: computed(() => props.hasActions),\n isExpandable: computed(() => props.isExpandable),\n isSelectable: computed(\n () =>\n props.isSelectable &&\n !props.isLoading &&\n !isDataViewLoading?.value &&\n !props.isEmpty &&\n !isDataViewEmpty?.value,\n ),\n isLoading: isTableLoading,\n layout: computedLayout,\n });\n\n watchEffect(() => {\n // Table can be both casted within a DataView or standalone. useSelection is still possible to be used on both cases,\n // making it important to have Table to control selection props.\n // To avoid breaking changes and developer experience, a DataView injection is passed down and updated whenever it exists,\n // and move the information up into DataView, that sometimes aren't used.\n if (isDataViewSelectable) {\n isDataViewSelectable.value = props.isSelectable;\n }\n });\n</script>\n\n<template>\n <div class=\"stash-table-wrapper relative\">\n <div\n ref=\"scrollContainerRef\"\n class=\"stash-table relative\"\n :class=\"[\n { rounded: computedRadius === 'rounded' },\n { 'rounded-b': computedRadius === 'rounded-bottom' },\n { 'border-t border-ice-200': dataViewVariant === 'table' },\n { 'overflow-auto scroll-smooth': computedLayout === 'scroll' },\n { shadow: isShadowEnabled },\n {\n 'overflow-visible lg:overflow-auto lg:shadow': computedLayout === 'stack',\n },\n ]\"\n data-test=\"stash-table\"\n :aria-busy=\"isTableLoading\"\n :style=\"rootStyle\"\n >\n <table ref=\"tableRef\" class=\"relative w-full border-separate\">\n <thead\n class=\"border-b border-ice-200\"\n :class=\"{\n 'hidden lg:table-header-group': computedLayout === 'stack',\n }\"\n >\n <!-- @slot head -->\n <slot name=\"head\"> </slot>\n </thead>\n <tbody>\n <!--\n col-span-12 makes the td span all columns only when layout === 'stack' and the viewport is below lg (when table elements are using display: grid ).\n The colspan attr does the same in all other cases when the table elements are using their native table styles.\n relative prevents the loading/empty state from overflowing the table whenever the table has actions and the table cell applies position absolute.\n \"max-width: '100vw'\" prevents the loading/empty state from overflowing the table whenever the table is in the scroll layout.\n These are necessary in order to properly horizontally center Loading, and EmptyState\n -->\n <TableRow v-if=\"isTableLoading\">\n <TableCell colspan=\"100%\" :class=\"{ 'relative! col-span-12': computedLayout === 'stack' }\">\n <Loading :style=\"[computedLayout === 'scroll' ? { 'max-width': '100vw' } : {}]\" />\n </TableCell>\n </TableRow>\n <!-- @slot empty -->\n <template v-else-if=\"props.isEmpty || isDataViewEmpty\">\n <TableRow>\n <TableCell colspan=\"100%\" :class=\"{ 'relative! col-span-12': computedLayout === 'stack' }\">\n <slot name=\"empty\">\n <EmptyState\n class=\"w-full bg-white\"\n :text=\"props.emptyStateText\"\n :style=\"[computedLayout === 'scroll' ? { 'max-width': '100vw' } : {}]\"\n />\n </slot>\n </TableCell>\n </TableRow>\n </template>\n <!-- @slot body -->\n <slot v-else name=\"body\"></slot>\n </tbody>\n </table>\n </div>\n <div\n v-if=\"showScrollButtons\"\n :class=\"classes['stash-table-scroll-overlay']\"\n class=\"pointer-events-none absolute inset-0 flex items-center justify-between z-2\"\n >\n <template v-if=\"canScrollLeft\">\n <div\n :class=\"classes['stash-table-scroll-shadow-left']\"\n class=\"stash-table-scroll-shadow border-l border-ice-100 absolute left-0 top-0 bottom-0 w-4\"\n data-test=\"stash-table|scroll-shadow-left\"\n />\n <Button\n class=\"pointer-events-auto absolute left-3 top-[7px] border border-ice-100 bg-white rounded-full shadow size-6 p-0 min-w-auto\"\n secondary\n icon\n :aria-label=\"'Scroll table left'\"\n data-test=\"stash-table|scroll-left\"\n @click=\"scrollBy(-SCROLL_DELTA_PX)\"\n >\n <Icon name=\"chevron-left\" />\n </Button>\n </template>\n <template v-if=\"canScrollRight\">\n <div\n :class=\"classes['stash-table-scroll-shadow-right']\"\n class=\"stash-table-scroll-shadow border-r border-ice-100 absolute right-0 top-0 bottom-0 w-4\"\n data-test=\"stash-table|scroll-shadow-right\"\n />\n\n <Button\n class=\"pointer-events-auto absolute right-3 top-[7px] border border-ice-100 bg-white rounded-full shadow size-6 p-0 min-w-auto\"\n secondary\n icon\n :aria-label=\"'Scroll table right'\"\n data-test=\"stash-table|scroll-right\"\n @click=\"scrollBy(SCROLL_DELTA_PX)\"\n >\n <Icon name=\"chevron-right\" class=\"text-ice-900\" />\n </Button>\n </template>\n </div>\n </div>\n</template>\n\n<style module>\n .stash-table-scroll-shadow-left {\n background: linear-gradient(90deg, rgb(38 38 38 / 10%) 0%, rgb(38 38 38 / 0%) 32.65%);\n }\n\n .stash-table-scroll-shadow-right {\n background: linear-gradient(270deg, rgb(38 38 38 / 10%) 0%, rgb(38 38 38 / 0%) 32.65%);\n }\n\n @media print {\n .stash-table-scroll-overlay {\n display: none !important;\n }\n }\n</style>\n"],"names":["Layout","TableRadius","props","__props","classes","useCssModule","dataViewDensity","dataViewVariant","isDataViewEmpty","isDataViewLoading","isDataViewSelectable","inject","DATA_VIEW_INJECTION","moduleVariant","MODULE_INJECTION","computedRadius","computed","computedLayout","isShadowEnabled","isStickyHeaderEnabled","_a","_b","rootStyle","isTableLoading","scrollContainerRef","useTemplateRef","tableRef","hasHorizontalOverflow","ref","arrivedState","measure","useScroll","updateOverflow","el","useResizeObserver","useIntersectionObserver","entries","canScrollLeft","canScrollRight","showScrollButtons","scrollBy","delta","provide","TABLE_INJECTION","SpacingDensity","watchEffect","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_unref","_renderSlot","_ctx","_createBlock","TableRow","_createVNode","TableCell","Loading","EmptyState","_normalizeClass","_Fragment","Button","_cache","$event","Icon"],"mappings":";;;;;;;;;;;;;;;AAIO,IAAKA,uBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,MAAA,CAAA,CAAA,GAOAC,uBAAAA,OACVA,EAAA,OAAO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;"}
1
+ {"version":3,"file":"Table.js","sources":["../src/components/Table/Table.types.ts","../src/components/Table/Table.vue"],"sourcesContent":["import type { ComputedRef } from 'vue';\n\nimport { SpacingDensities } from '../../../types/misc';\n\nexport enum Layout {\n Scroll = 'scroll',\n Stack = 'stack',\n}\n\nexport type Layouts = `${Layout}`;\n\nexport enum TableRadius {\n None = 'none',\n Rounded = 'rounded',\n RoundedBottom = 'rounded-bottom',\n}\n\nexport type TableRadiuses = `${TableRadius}`;\n\n/**\n * Properties and utilities provided to children of a Table instance\n */\nexport interface TableInjection {\n /**\n * Controls the Table's padding; the default value is \"comfortable\". On small screens, the density will always be \"compact\".\n */\n density: ComputedRef<SpacingDensities>;\n\n /**\n * Styles the last column for \"row actions\"\n */\n hasActions: ComputedRef<boolean>;\n\n /**\n * If true, hides the default expansion toggle column\n */\n hasCustomExpandToggle: ComputedRef<boolean>;\n\n /**\n * When true, the table is schema-driven (e.g. DataTable); selection column is rendered from the schema, not by TableRow/TableHeaderRow.\n */\n isSchemaDriven?: ComputedRef<boolean>;\n\n /**\n * Adds a toggle column for row expansion. This is primarily needed for ensuring the corresponding empty TableHeaderRow is included.\n */\n isExpandable: ComputedRef<boolean>;\n\n /**\n * Adds a checkbox column for selecting rows; intended for use with the `useSelection` composable.\n */\n isSelectable: ComputedRef<boolean>;\n\n /**\n * Sets the table layout; the default value is \"scroll\".\n */\n layout: ComputedRef<Layouts>;\n\n /**\n * Sets the table loading state.\n */\n isLoading: ComputedRef<boolean>;\n}\n","<script lang=\"ts\">\n import { SpacingDensities, SpacingDensity } from '../../../types/misc';\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { Layouts, TableRadiuses } from './Table.types';\n\n export * from './Table.keys';\n export * from './Table.types';\n\n export interface TableProps {\n /**\n * Controls the Table's padding; the default value is \"comfortable\". On small screens, \"compact\" density is applied regardless of this prop's value.\n */\n density?: SpacingDensities;\n\n /**\n * Sets the text for the empty state; the default value is \"No Results\".\n */\n emptyStateText?: string;\n\n /**\n * Styles the last column for \"row actions\"\n */\n hasActions?: boolean;\n\n /**\n * If true, hides the default expansion toggle column\n */\n hasCustomExpandToggle?: boolean;\n\n /**\n * Shows the empty state\n */\n isEmpty?: boolean;\n\n /**\n * When true, indicates the table is being composed by DataTable (schema-driven mode).\n * TableRow/TableHeaderRow use this to suppress their built-in selection cells.\n */\n isSchemaDriven?: boolean;\n\n /**\n * Shows the loading state\n */\n isLoading?: boolean;\n\n /**\n * Adds a toggle column for row expansion. This is primarily needed for ensuring the corresponding empty TableHeaderRow is included.\n */\n isExpandable?: boolean;\n\n /**\n * Adds a checkbox column for selecting rows; intended for use with the `useSelection` composable.\n */\n isSelectable?: boolean;\n\n /**\n * Sets the table layout; the default value is \"scroll\".\n */\n layout?: Layouts;\n\n /**\n * Controls the corners of the table with the \"border-radius\" CSS property. The default value is \"rounded\".\n */\n radius?: TableRadiuses;\n\n /**\n * Allows the table head to be sticky when scrolling inside the table body\n */\n stickyHeader?: {\n listLength: number;\n maxHeight: string;\n };\n }\n</script>\n\n<script setup lang=\"ts\">\n import { useIntersectionObserver, useResizeObserver, useScroll } from '@vueuse/core';\n import { computed, inject, provide, ref, useCssModule, useTemplateRef, watchEffect } from 'vue';\n\n import Button from '../Button/Button.vue';\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import EmptyState from '../EmptyState/EmptyState.vue';\n import Icon from '../Icon/Icon.vue';\n import Loading from '../Loading/Loading.vue';\n import TableCell from '../TableCell/TableCell.vue';\n import TableRow from '../TableRow/TableRow.vue';\n import { TABLE_INJECTION } from './Table.keys';\n\n const SCROLL_DELTA_PX = 200;\n\n const props = withDefaults(defineProps<TableProps>(), {\n density: undefined,\n emptyStateText: '',\n hasActions: false,\n hasCustomExpandToggle: false,\n isEmpty: false,\n isSchemaDriven: false,\n isLoading: false,\n isExpandable: false,\n isSelectable: false,\n layout: 'scroll',\n radius: 'rounded',\n stickyHeader: undefined,\n });\n\n const classes = useCssModule();\n\n const {\n density: dataViewDensity,\n variant: dataViewVariant,\n isEmpty: isDataViewEmpty,\n isLoading: isDataViewLoading,\n isSelectable: isDataViewSelectable,\n } = inject(DATA_VIEW_INJECTION.key, DATA_VIEW_INJECTION.defaults);\n\n const { variant: moduleVariant } = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n\n const computedRadius = computed<TableRadiuses>(() => {\n // Will work for tables when rendered inside of a Module with OR without a DataView.\n if (moduleVariant?.value === 'table') {\n return 'rounded-bottom';\n }\n\n if (dataViewVariant.value === 'table') {\n return 'rounded-bottom';\n }\n\n return props.radius;\n });\n\n const computedLayout = computed<Layouts>(() => {\n if (props.stickyHeader) {\n return 'scroll';\n }\n\n return props.layout;\n });\n\n const isShadowEnabled = computed<boolean>(() => {\n return computedLayout.value === 'scroll' && dataViewVariant.value === 'table';\n });\n\n const isStickyHeaderEnabled = computed<boolean>(() => {\n return !!(\n (props.stickyHeader?.maxHeight && props.stickyHeader?.listLength > 3) // table can't scroll without a max height; sticky headers only needed for a scrollable table\n // scrollable table and sticky headers not needed when list is small\n );\n });\n\n const rootStyle = computed(() => ({\n maxHeight: isStickyHeaderEnabled.value ? props.stickyHeader?.maxHeight : '',\n }));\n\n const isTableLoading = computed(() => Boolean(props.isLoading || isDataViewLoading?.value));\n\n const scrollContainerRef = useTemplateRef<HTMLElement>('scrollContainerRef');\n const tableRef = useTemplateRef<HTMLTableElement>('tableRef');\n const hasHorizontalOverflow = ref(false);\n\n const { arrivedState, measure } = useScroll(scrollContainerRef, { behavior: 'smooth' });\n\n function updateOverflow() {\n const el = scrollContainerRef.value;\n if (!el || computedLayout.value !== 'scroll') return;\n hasHorizontalOverflow.value = el.scrollWidth > el.clientWidth;\n measure();\n }\n\n useResizeObserver(scrollContainerRef, updateOverflow);\n useResizeObserver(tableRef, updateOverflow);\n\n useIntersectionObserver(\n scrollContainerRef,\n (entries) => {\n if (entries[0]?.isIntersecting) updateOverflow();\n },\n { threshold: 0.01 },\n );\n\n const canScrollLeft = computed(() => !arrivedState.left);\n const canScrollRight = computed(() => !arrivedState.right);\n const showScrollButtons = computed(() => computedLayout.value === 'scroll' && hasHorizontalOverflow.value);\n\n function scrollBy(delta: number) {\n scrollContainerRef.value?.scrollBy({ left: delta, behavior: 'smooth' });\n }\n\n provide(TABLE_INJECTION.key, {\n density: computed(() => props.density || dataViewDensity.value || SpacingDensity.Comfortable),\n hasCustomExpandToggle: computed(() => props.hasCustomExpandToggle),\n hasActions: computed(() => props.hasActions),\n isSchemaDriven: computed(() => props.isSchemaDriven),\n isExpandable: computed(() => props.isExpandable),\n isSelectable: computed(\n () =>\n props.isSelectable &&\n !props.isLoading &&\n !isDataViewLoading?.value &&\n !props.isEmpty &&\n !isDataViewEmpty?.value,\n ),\n isLoading: isTableLoading,\n layout: computedLayout,\n });\n\n watchEffect(() => {\n // Table can be both casted within a DataView or standalone. useSelection is still possible to be used on both cases,\n // making it important to have Table to control selection props.\n // To avoid breaking changes and developer experience, a DataView injection is passed down and updated whenever it exists,\n // and move the information up into DataView, that sometimes aren't used.\n if (isDataViewSelectable) {\n isDataViewSelectable.value = props.isSelectable;\n }\n });\n</script>\n\n<template>\n <div class=\"stash-table-wrapper relative\">\n <div\n ref=\"scrollContainerRef\"\n class=\"stash-table relative\"\n :class=\"[\n { rounded: computedRadius === 'rounded' },\n { 'rounded-b': computedRadius === 'rounded-bottom' },\n { 'border-t border-ice-200': dataViewVariant === 'table' },\n { 'overflow-auto scroll-smooth': computedLayout === 'scroll' },\n { shadow: isShadowEnabled },\n {\n 'overflow-visible lg:overflow-auto lg:shadow': computedLayout === 'stack',\n },\n ]\"\n data-test=\"stash-table\"\n :aria-busy=\"isTableLoading\"\n :style=\"rootStyle\"\n >\n <table ref=\"tableRef\" class=\"relative w-full border-separate\">\n <thead class=\"border-b border-ice-200\" :class=\"{ 'hidden lg:table-header-group': computedLayout === 'stack' }\">\n <!-- @slot head -->\n <slot name=\"head\"> </slot>\n </thead>\n <tbody>\n <!--\n col-span-12 makes the td span all columns only when layout === 'stack' and the viewport is below lg (when table elements are using display: grid ).\n The colspan attr does the same in all other cases when the table elements are using their native table styles.\n relative prevents the loading/empty state from overflowing the table whenever the table has actions and the table cell applies position absolute.\n \"max-width: '100vw'\" prevents the loading/empty state from overflowing the table whenever the table is in the scroll layout.\n These are necessary in order to properly horizontally center Loading, and EmptyState\n -->\n <TableRow v-if=\"isTableLoading\">\n <TableCell colspan=\"100%\" :class=\"{ 'relative! col-span-12': computedLayout === 'stack' }\">\n <Loading :style=\"[computedLayout === 'scroll' ? { 'max-width': '100vw' } : {}]\" />\n </TableCell>\n </TableRow>\n <!-- @slot empty -->\n <template v-else-if=\"props.isEmpty || isDataViewEmpty\">\n <TableRow>\n <TableCell colspan=\"100%\" :class=\"{ 'relative! col-span-12': computedLayout === 'stack' }\">\n <slot name=\"empty\">\n <EmptyState\n class=\"w-full bg-white\"\n :text=\"props.emptyStateText\"\n :style=\"[computedLayout === 'scroll' ? { 'max-width': '100vw' } : {}]\"\n />\n </slot>\n </TableCell>\n </TableRow>\n </template>\n <!-- @slot body -->\n <slot v-else name=\"body\"></slot>\n </tbody>\n </table>\n </div>\n <div\n v-if=\"showScrollButtons\"\n :class=\"classes['stash-table-scroll-overlay']\"\n class=\"pointer-events-none absolute inset-0 flex items-center justify-between z-2\"\n >\n <template v-if=\"canScrollLeft\">\n <div\n :class=\"classes['stash-table-scroll-shadow-left']\"\n class=\"stash-table-scroll-shadow border-l border-ice-100 absolute left-0 top-0 bottom-0 w-4\"\n data-test=\"stash-table|scroll-shadow-left\"\n />\n <Button\n class=\"pointer-events-auto absolute left-3 top-[7px] border border-ice-100 bg-white rounded-full shadow size-6 p-0 min-w-auto\"\n secondary\n icon\n :aria-label=\"'Scroll table left'\"\n data-test=\"stash-table|scroll-left\"\n @click=\"scrollBy(-SCROLL_DELTA_PX)\"\n >\n <Icon name=\"chevron-left\" />\n </Button>\n </template>\n <template v-if=\"canScrollRight\">\n <div\n :class=\"classes['stash-table-scroll-shadow-right']\"\n class=\"stash-table-scroll-shadow border-r border-ice-100 absolute right-0 top-0 bottom-0 w-4\"\n data-test=\"stash-table|scroll-shadow-right\"\n />\n\n <Button\n class=\"pointer-events-auto absolute right-3 top-[7px] border border-ice-100 bg-white rounded-full shadow size-6 p-0 min-w-auto\"\n secondary\n icon\n :aria-label=\"'Scroll table right'\"\n data-test=\"stash-table|scroll-right\"\n @click=\"scrollBy(SCROLL_DELTA_PX)\"\n >\n <Icon name=\"chevron-right\" class=\"text-ice-900\" />\n </Button>\n </template>\n </div>\n </div>\n</template>\n\n<style module>\n .stash-table-scroll-shadow-left {\n background: linear-gradient(90deg, rgb(38 38 38 / 10%) 0%, rgb(38 38 38 / 0%) 32.65%);\n }\n\n .stash-table-scroll-shadow-right {\n background: linear-gradient(270deg, rgb(38 38 38 / 10%) 0%, rgb(38 38 38 / 0%) 32.65%);\n }\n\n @media print {\n .stash-table-scroll-overlay {\n display: none !important;\n }\n }\n</style>\n"],"names":["Layout","TableRadius","props","__props","classes","useCssModule","dataViewDensity","dataViewVariant","isDataViewEmpty","isDataViewLoading","isDataViewSelectable","inject","DATA_VIEW_INJECTION","moduleVariant","MODULE_INJECTION","computedRadius","computed","computedLayout","isShadowEnabled","isStickyHeaderEnabled","_a","_b","rootStyle","isTableLoading","scrollContainerRef","useTemplateRef","tableRef","hasHorizontalOverflow","ref","arrivedState","measure","useScroll","updateOverflow","el","useResizeObserver","useIntersectionObserver","entries","canScrollLeft","canScrollRight","showScrollButtons","scrollBy","delta","provide","TABLE_INJECTION","SpacingDensity","watchEffect","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_unref","_normalizeClass","_renderSlot","_ctx","_createBlock","TableRow","_createVNode","TableCell","Loading","EmptyState","_Fragment","Button","_cache","$event","Icon"],"mappings":";;;;;;;;;;;;;;;AAIO,IAAKA,uBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,MAAA,CAAA,CAAA,GAOAC,uBAAAA,OACVA,EAAA,OAAO,Q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Q,GAAA;AAAA,gBAA5C,MAAK;AAAA,gBAAgB,OAAM;AAAA,cAAA;;;;;;;;;;;;;;;"}
@@ -40,6 +40,7 @@ emptyStateText: string;
40
40
  hasActions: boolean;
41
41
  hasCustomExpandToggle: boolean;
42
42
  isEmpty: boolean;
43
+ isSchemaDriven: boolean;
43
44
  isLoading: boolean;
44
45
  isExpandable: boolean;
45
46
  isSelectable: boolean;
@@ -52,6 +53,7 @@ emptyStateText: string;
52
53
  hasActions: boolean;
53
54
  hasCustomExpandToggle: boolean;
54
55
  isEmpty: boolean;
56
+ isSchemaDriven: boolean;
55
57
  isLoading: boolean;
56
58
  isExpandable: boolean;
57
59
  isSelectable: boolean;
@@ -68,6 +70,7 @@ emptyStateText: string;
68
70
  hasActions: boolean;
69
71
  layout: "scroll" | "stack";
70
72
  hasCustomExpandToggle: boolean;
73
+ isSchemaDriven: boolean;
71
74
  isExpandable: boolean;
72
75
  stickyHeader: {
73
76
  listLength: number;
@@ -119,6 +122,10 @@ export declare interface TableInjection {
119
122
  * If true, hides the default expansion toggle column
120
123
  */
121
124
  hasCustomExpandToggle: ComputedRef<boolean>;
125
+ /**
126
+ * When true, the table is schema-driven (e.g. DataTable); selection column is rendered from the schema, not by TableRow/TableHeaderRow.
127
+ */
128
+ isSchemaDriven?: ComputedRef<boolean>;
122
129
  /**
123
130
  * Adds a toggle column for row expansion. This is primarily needed for ensuring the corresponding empty TableHeaderRow is included.
124
131
  */
@@ -158,6 +165,11 @@ export declare interface TableProps {
158
165
  * Shows the empty state
159
166
  */
160
167
  isEmpty?: boolean;
168
+ /**
169
+ * When true, indicates the table is being composed by DataTable (schema-driven mode).
170
+ * TableRow/TableHeaderRow use this to suppress their built-in selection cells.
171
+ */
172
+ isSchemaDriven?: boolean;
161
173
  /**
162
174
  * Shows the loading state
163
175
  */
package/dist/TableCell.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as _, useCssModule as p, inject as d, createElementBlock as r, openBlock as c, normalizeClass as u, unref as o, createCommentVNode as f, renderSlot as y, toDisplayString as h } from "vue";
1
+ import { defineComponent as _, useCssModule as p, inject as d, createElementBlock as r, openBlock as c, normalizeClass as f, unref as o, createCommentVNode as u, renderSlot as y, toDisplayString as b } from "vue";
2
2
  import "lodash-es/uniqueId";
3
3
  import "lodash-es/cloneDeep";
4
4
  import "./Module.keys-DcqBbvvT.js";
@@ -6,24 +6,24 @@ import "lodash-es/get";
6
6
  import "./DataView.keys-aSOnA4AD.js";
7
7
  import "./Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js";
8
8
  import "@leaflink/snitch";
9
- import { T as b } from "./Table.keys-LHQf6FEH.js";
10
- import { _ as C } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- const k = {
9
+ import { T as g } from "./Table.keys-LHQf6FEH.js";
10
+ import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
+ const C = {
12
12
  key: 0,
13
13
  class: "text-xs font-medium text-ice-900 lg:hidden"
14
- }, T = /* @__PURE__ */ _({
14
+ }, k = /* @__PURE__ */ _({
15
15
  __name: "TableCell",
16
16
  props: {
17
17
  isControl: { type: Boolean, default: !1 },
18
18
  mobileHeader: { default: "" }
19
19
  },
20
20
  setup(n) {
21
- const l = n, t = p(), a = d(b.key);
21
+ const l = n, t = p(), a = d(g.key);
22
22
  if (!a)
23
23
  throw new Error("TableCell must be used within a Table component");
24
24
  const { density: e, hasActions: i, layout: s } = a;
25
25
  return (m, E) => (c(), r("td", {
26
- class: u(["stash-table-cell", [
26
+ class: f(["stash-table-cell", [
27
27
  o(t).root,
28
28
  o(t)[`layout--${o(s)}`],
29
29
  {
@@ -39,20 +39,20 @@ const k = {
39
39
  ]]),
40
40
  "data-test": "stash-table-cell"
41
41
  }, [
42
- l.mobileHeader && o(s) === "stack" ? (c(), r("div", k, h(l.mobileHeader), 1)) : f("", !0),
42
+ l.mobileHeader && o(s) === "stack" ? (c(), r("div", C, b(l.mobileHeader), 1)) : u("", !0),
43
43
  y(m.$slots, "default")
44
44
  ], 2));
45
45
  }
46
- }), x = "_root_1hns6_5", g = {
47
- root: x,
48
- "layout--scroll": "_layout--scroll_1hns6_9",
49
- "has-actions": "_has-actions_1hns6_15",
50
- "layout--stack": "_layout--stack_1hns6_19",
51
- "is-control": "_is-control_1hns6_31",
52
- "root--density-comfortable": "_root--density-comfortable_1hns6_55"
46
+ }), T = "_root_1f3ga_5", x = {
47
+ root: T,
48
+ "layout--scroll": "_layout--scroll_1f3ga_9",
49
+ "has-actions": "_has-actions_1f3ga_15",
50
+ "layout--stack": "_layout--stack_1f3ga_19",
51
+ "is-control": "_is-control_1f3ga_31",
52
+ "root--density-comfortable": "_root--density-comfortable_1f3ga_55"
53
53
  }, B = {
54
- $style: g
55
- }, z = /* @__PURE__ */ C(T, [["__cssModules", B]]);
54
+ $style: x
55
+ }, z = /* @__PURE__ */ h(k, [["__cssModules", B]]);
56
56
  export {
57
57
  z as default
58
58
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","sources":["../src/components/TableCell/TableCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { TABLE_INJECTION } from '../Table/Table.vue';\n\n export interface TableCellProps {\n /**\n * If true, displays the cell as a control (vs data) cell without a background color on mobile when Table is in the stacked layout\n */\n isControl?: boolean;\n /**\n * If true, displays the header inside the cell on mobile and tablet screens when Table is in the stacked layout\n */\n mobileHeader?: string;\n }\n\n const props = withDefaults(defineProps<TableCellProps>(), {\n isControl: false,\n mobileHeader: '',\n });\n const classes = useCssModule();\n\n const tableInjection = inject(TABLE_INJECTION.key);\n if (!tableInjection) {\n throw new Error('TableCell must be used within a Table component');\n }\n\n const { density, hasActions, layout } = tableInjection;\n</script>\n\n<template>\n <td\n class=\"stash-table-cell\"\n data-test=\"stash-table-cell\"\n :class=\"[\n classes.root,\n classes[`layout--${layout}`],\n {\n [classes['root--density-compact']]: density === 'compact',\n [classes['root--density-comfortable']]: density === 'comfortable',\n [classes['has-actions']]: hasActions,\n 'p-3': layout === 'scroll',\n 'p-1.5': layout === 'stack',\n 'lg:p-3': density === 'compact',\n 'lg:px-3 lg:py-6': density === 'comfortable',\n [classes['is-control']]: props.isControl,\n },\n ]\"\n >\n <div v-if=\"props.mobileHeader && layout === 'stack'\" class=\"text-xs font-medium text-ice-900 lg:hidden\">\n {{ props.mobileHeader }}\n </div>\n <!-- @slot default -->\n <slot></slot>\n </td>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .root {\n border: 0;\n }\n\n .layout--scroll {\n background-color: var(--color-white);\n border: none;\n border-bottom: 1px solid var(--color-ice-200);\n }\n\n .layout--scroll.has-actions:last-of-type {\n text-align: center;\n }\n\n .layout--stack {\n background-color: var(--color-ice-100);\n border-radius: var(--radius-sm);\n }\n\n .layout--stack.has-actions:last-of-type {\n background-color: transparent;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .layout--stack.is-control {\n background-color: transparent;\n }\n\n /* On large screens, layout--stack should match layout--scroll */\n @media (width >= theme(--breakpoint-lg)) {\n .layout--stack {\n background-color: var(--color-white);\n border-bottom: 1px solid var(--color-ice-200);\n border-radius: initial;\n }\n\n .layout--stack.has-actions:last-of-type {\n background-color: var(--color-white);\n position: initial;\n right: initial;\n text-align: center;\n top: initial;\n }\n\n .layout--stack.is-control {\n background-color: var(--color-white);\n }\n\n .root--density-comfortable:last-of-type:not(.has-actions) {\n padding-right: 24px;\n }\n\n .root--density-comfortable:first-of-type:not(\n :global(.stash-table-header-row__selection-cell),\n :global(.stash-table-row__selection-cell),\n :global(.stash-table-row__toggle-expansion-cell)\n ) {\n padding-left: 24px;\n }\n }\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","tableInjection","inject","TABLE_INJECTION","density","hasActions","layout","_createElementBlock","_unref","_openBlock","_hoisted_1","_toDisplayString","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBE,UAAMA,IAAQC,GAIRC,IAAUC,EAAA,GAEVC,IAAiBC,EAAOC,EAAgB,GAAG;AACjD,QAAI,CAACF;AACH,YAAM,IAAI,MAAM,iDAAiD;AAGnE,UAAM,EAAE,SAAAG,GAAS,YAAAC,GAAY,QAAAC,EAAA,IAAWL;2BAIxCM,EAuBK,MAAA;AAAA,MAtBH,UAAM,oBAAkB;AAAA,QAERC,EAAAT,CAAA,EAAQ;AAAA,QAAYS,EAAAT,CAAA,aAAmBS,EAAAF,CAAA,CAAM,EAAA;AAAA;UAAsB,CAAAE,EAAAT,CAAA,6BAAmCS,EAAAJ,CAAA,MAAO;AAAA,UAAyB,CAAAI,EAAAT,CAAA,iCAAuCS,EAAAJ,CAAA,MAAO;AAAA,UAA6B,CAAAI,EAAAT,CAAA,mBAAyBS,EAAAH,CAAA;AAAA,iBAA2BG,EAAAF,CAAA,MAAM;AAAA,mBAAgCE,EAAAF,CAAA,MAAM;AAAA,oBAAgCE,EAAAJ,CAAA,MAAO;AAAA,6BAA2CI,EAAAJ,CAAA,MAAO;AAAA,WAA6BI,EAAAT,CAAA,EAAO,YAAA,CAAA,GAAiBF,EAAM;AAAA,QAAA;AAAA;MADrd,aAAU;AAAA,IAAA;MAgBCA,EAAM,gBAAgBW,EAAAF,CAAA,MAAM,WAAvCG,KAAAF,EAEM,OAFNG,GAEMC,EADDd,EAAM,YAAY,GAAA,CAAA;MAGvBe,EAAaC,EAAA,QAAA,SAAA;AAAA,IAAA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TableCell.js","sources":["../src/components/TableCell/TableCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { TABLE_INJECTION } from '../Table/Table.vue';\n\n export interface TableCellProps {\n /**\n * If true, displays the cell as a control (vs data) cell without a background color on mobile when Table is in the stacked layout\n */\n isControl?: boolean;\n /**\n * If true, displays the header inside the cell on mobile and tablet screens when Table is in the stacked layout\n */\n mobileHeader?: string;\n }\n\n const props = withDefaults(defineProps<TableCellProps>(), {\n isControl: false,\n mobileHeader: '',\n });\n const classes = useCssModule();\n\n const tableInjection = inject(TABLE_INJECTION.key);\n if (!tableInjection) {\n throw new Error('TableCell must be used within a Table component');\n }\n\n const { density, hasActions, layout } = tableInjection;\n</script>\n\n<template>\n <td\n class=\"stash-table-cell\"\n data-test=\"stash-table-cell\"\n :class=\"[\n classes.root,\n classes[`layout--${layout}`],\n {\n [classes['root--density-compact']]: density === 'compact',\n [classes['root--density-comfortable']]: density === 'comfortable',\n [classes['has-actions']]: hasActions,\n 'p-3': layout === 'scroll',\n 'p-1.5': layout === 'stack',\n 'lg:p-3': density === 'compact',\n 'lg:px-3 lg:py-6': density === 'comfortable',\n [classes['is-control']]: props.isControl,\n },\n ]\"\n >\n <div v-if=\"props.mobileHeader && layout === 'stack'\" class=\"text-xs font-medium text-ice-900 lg:hidden\">\n {{ props.mobileHeader }}\n </div>\n <!-- @slot default -->\n <slot></slot>\n </td>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .root {\n border: 0;\n }\n\n .layout--scroll {\n background-color: var(--color-white);\n border: none;\n border-bottom: 1px solid var(--color-ice-200);\n }\n\n .layout--scroll.has-actions:last-of-type {\n text-align: center;\n }\n\n .layout--stack {\n background-color: var(--color-ice-100);\n border-radius: var(--radius-sm);\n }\n\n .layout--stack.has-actions:last-of-type {\n background-color: transparent;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .layout--stack.is-control {\n background-color: transparent;\n }\n\n /* On large screens, layout--stack should match layout--scroll */\n @media (width >= theme(--breakpoint-lg)) {\n .layout--stack {\n background-color: var(--color-white);\n border-bottom: 1px solid var(--color-ice-200);\n border-radius: initial;\n }\n\n .layout--stack.has-actions:last-of-type {\n background-color: var(--color-white);\n position: initial;\n right: initial;\n text-align: center;\n top: initial;\n }\n\n .layout--stack.is-control {\n background-color: var(--color-white);\n }\n\n .root--density-comfortable:last-of-type:not(.has-actions) {\n padding-right: 24px;\n }\n\n .root--density-comfortable:first-of-type:not(\n :global(.stash-table-header-row__selection-cell),\n :global(.stash-table-row__selection-cell),\n :global(.stash-table-row__toggle-expansion-cell),\n :global(.stash-table-cell__is-selection-cell),\n :global(.stash-table-cell__is-expansion-cell)\n ) {\n padding-left: 24px;\n }\n }\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","tableInjection","inject","TABLE_INJECTION","density","hasActions","layout","_createElementBlock","_unref","_openBlock","_hoisted_1","_toDisplayString","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBE,UAAMA,IAAQC,GAIRC,IAAUC,EAAA,GAEVC,IAAiBC,EAAOC,EAAgB,GAAG;AACjD,QAAI,CAACF;AACH,YAAM,IAAI,MAAM,iDAAiD;AAGnE,UAAM,EAAE,SAAAG,GAAS,YAAAC,GAAY,QAAAC,EAAA,IAAWL;2BAIxCM,EAuBK,MAAA;AAAA,MAtBH,UAAM,oBAAkB;AAAA,QAERC,EAAAT,CAAA,EAAQ;AAAA,QAAYS,EAAAT,CAAA,aAAmBS,EAAAF,CAAA,CAAM,EAAA;AAAA;UAAsB,CAAAE,EAAAT,CAAA,6BAAmCS,EAAAJ,CAAA,MAAO;AAAA,UAAyB,CAAAI,EAAAT,CAAA,iCAAuCS,EAAAJ,CAAA,MAAO;AAAA,UAA6B,CAAAI,EAAAT,CAAA,mBAAyBS,EAAAH,CAAA;AAAA,iBAA2BG,EAAAF,CAAA,MAAM;AAAA,mBAAgCE,EAAAF,CAAA,MAAM;AAAA,oBAAgCE,EAAAJ,CAAA,MAAO;AAAA,6BAA2CI,EAAAJ,CAAA,MAAO;AAAA,WAA6BI,EAAAT,CAAA,EAAO,YAAA,CAAA,GAAiBF,EAAM;AAAA,QAAA;AAAA;MADrd,aAAU;AAAA,IAAA;MAgBCA,EAAM,gBAAgBW,EAAAF,CAAA,MAAM,WAAvCG,KAAAF,EAEM,OAFNG,GAEMC,EADDd,EAAM,YAAY,GAAA,CAAA;MAGvBe,EAAaC,EAAA,QAAA,SAAA;AAAA,IAAA;;;;;;;;;;;;"}
@@ -1,72 +1,78 @@
1
- import { defineComponent as I, useCssModule as k, inject as p, computed as m, createElementBlock as _, openBlock as r, normalizeClass as s, unref as e, createElementVNode as T, renderSlot as E, createCommentVNode as n, createBlock as f } from "vue";
1
+ import { defineComponent as k, useCssModule as D, inject as h, computed as s, createElementBlock as b, openBlock as c, normalizeClass as n, unref as e, createElementVNode as T, renderSlot as g, createCommentVNode as d, createBlock as x } from "vue";
2
2
  import "lodash-es/cloneDeep";
3
3
  import "./Module.keys-DcqBbvvT.js";
4
4
  import "lodash-es/get";
5
- import b from "./Icon.js";
6
- import { D as v } from "./DataView.keys-aSOnA4AD.js";
5
+ import w from "./Icon.js";
6
+ import { D as y } from "./DataView.keys-aSOnA4AD.js";
7
7
  import "./Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js";
8
8
  import "lodash-es/uniqueId";
9
9
  import "@leaflink/snitch";
10
- import { T as N } from "./Table.keys-LHQf6FEH.js";
11
- import { _ as S } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
+ import { T as E } from "./Table.keys-LHQf6FEH.js";
11
+ import { _ as N } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
12
  const A = {
13
13
  key: 0,
14
14
  class: "relative h-4 w-3"
15
- }, B = /* @__PURE__ */ I({
15
+ }, B = /* @__PURE__ */ k({
16
16
  __name: "TableHeaderCell",
17
17
  props: {
18
- sortId: { default: "" }
18
+ sortId: { default: "" },
19
+ schemaDrivenHeader: { default: void 0 }
19
20
  },
20
- setup(h) {
21
- const a = h, t = k(), l = p(N.key);
22
- if (!l)
21
+ setup(I) {
22
+ const r = I, t = D(), m = h(E.key);
23
+ if (!m)
23
24
  throw new Error("TableHeaderCell must be used within a Table component");
24
- const { density: i, hasActions: x } = l, { currentSortId: w, currentSortOrder: d, updateCurrentSort: u } = p(
25
- v.key,
26
- v.defaults
27
- ), c = m(() => !!a.sortId), o = m(() => w.value === a.sortId);
28
- function y() {
29
- c.value && typeof u == "function" && u(a.sortId, { shouldEmit: !0 });
25
+ const { density: p, hasActions: C } = m, a = s(() => !!r.schemaDrivenHeader), { currentSortId: H, currentSortOrder: v, updateCurrentSort: _ } = h(
26
+ y.key,
27
+ y.defaults
28
+ ), l = s(() => a.value ? r.schemaDrivenHeader.column.getCanSort() : !!r.sortId), o = s(() => a.value ? !!r.schemaDrivenHeader.column.getIsSorted() : H.value === r.sortId), f = s(() => a.value ? r.schemaDrivenHeader.column.getIsSorted() : o.value && v.value ? v.value : !1);
29
+ function S(i) {
30
+ var u;
31
+ if (a.value) {
32
+ (u = r.schemaDrivenHeader.column.getToggleSortingHandler()) == null || u(i);
33
+ return;
34
+ }
35
+ l.value && typeof _ == "function" && _(r.sortId, { shouldEmit: !0 });
30
36
  }
31
- return (C, O) => (r(), _("th", {
32
- class: s(["stash-table-header-cell border-b border-r border-ice-200 p-3 text-xs font-medium text-ice-900", [
37
+ return (i, u) => (c(), b("th", {
38
+ class: n(["stash-table-header-cell border-b border-r border-ice-200 p-3 text-xs font-medium text-ice-900", [
33
39
  e(t).root,
34
40
  {
35
41
  "bg-white": !o.value,
36
42
  "stash-table-header-cell--sorted bg-blue-100": o.value,
37
- [e(t)["root--density-compact"]]: e(i) === "compact",
38
- [e(t)["root--density-comfortable"]]: e(i) === "comfortable",
39
- [e(t)["has-actions"]]: e(x),
40
- "cursor-pointer": c.value
43
+ [e(t)["root--density-compact"]]: e(p) === "compact",
44
+ [e(t)["root--density-comfortable"]]: e(p) === "comfortable",
45
+ [e(t)["has-actions"]]: e(C),
46
+ "cursor-pointer": l.value
41
47
  }
42
48
  ]]),
43
49
  "data-test": "stash-table-header-cell",
44
- onClick: y
50
+ onClick: S
45
51
  }, [
46
52
  T("div", {
47
- class: s(["flex justify-between", e(t)["content-wrapper"]])
53
+ class: n(["flex justify-between", e(t)["content-wrapper"]])
48
54
  }, [
49
- E(C.$slots, "default"),
50
- c.value ? (r(), _("div", A, [
51
- !o.value || e(d) === "asc" ? (r(), f(b, {
55
+ g(i.$slots, "default"),
56
+ l.value ? (c(), b("div", A, [
57
+ !o.value || f.value === "asc" ? (c(), x(w, {
52
58
  key: 0,
53
- class: s(["absolute text-ice-700", [e(t).caret, e(t)["caret-up"]]]),
59
+ class: n(["absolute text-ice-700", [e(t).caret, e(t)["caret-up"]]]),
54
60
  "data-test": "icon|caret-up",
55
61
  name: "caret-up",
56
62
  size: "dense"
57
- }, null, 8, ["class"])) : n("", !0),
58
- !o.value || e(d) === "desc" ? (r(), f(b, {
63
+ }, null, 8, ["class"])) : d("", !0),
64
+ !o.value || f.value === "desc" ? (c(), x(w, {
59
65
  key: 1,
60
- class: s(["absolute text-ice-700", [e(t).caret, e(t)["caret-down"]]]),
66
+ class: n(["absolute text-ice-700", [e(t).caret, e(t)["caret-down"]]]),
61
67
  "data-test": "icon|caret-down",
62
68
  name: "caret-down",
63
69
  size: "dense"
64
- }, null, 8, ["class"])) : n("", !0)
65
- ])) : n("", !0)
70
+ }, null, 8, ["class"])) : d("", !0)
71
+ ])) : d("", !0)
66
72
  ], 2)
67
73
  ], 2));
68
74
  }
69
- }), j = "_root_1xv85_5", z = "_caret_1xv85_21", H = {
75
+ }), j = "_root_1xv85_5", z = "_caret_1xv85_21", M = {
70
76
  root: j,
71
77
  "has-actions": "_has-actions_1xv85_17",
72
78
  "content-wrapper": "_content-wrapper_1xv85_17",
@@ -74,10 +80,10 @@ const A = {
74
80
  "caret-down": "_caret-down_1xv85_25",
75
81
  caret: z,
76
82
  "root--density-comfortable": "_root--density-comfortable_1xv85_34"
77
- }, M = {
78
- $style: H
79
- }, K = /* @__PURE__ */ S(B, [["__cssModules", M]]);
83
+ }, O = {
84
+ $style: M
85
+ }, Q = /* @__PURE__ */ N(B, [["__cssModules", O]]);
80
86
  export {
81
- K as default
87
+ Q as default
82
88
  };
83
89
  //# sourceMappingURL=TableHeaderCell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeaderCell.js","sources":["../src/components/TableHeaderCell/TableHeaderCell.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, inject, useCssModule } from 'vue';\n\n import { DATA_VIEW_INJECTION, SortValueDeserialized } from '../DataView/DataView.vue';\n import Icon from '../Icon/Icon.vue';\n import { TABLE_INJECTION } from '../Table/Table.vue';\n\n export interface TableHeaderCellProps {\n /**\n * A unique value correlated to the data in this header's column (without a leading hyphen/dash).\n * For example: `'product_name'` (with no leading dash/hyphen).\n */\n sortId?: SortValueDeserialized['id'];\n }\n\n const props = withDefaults(defineProps<TableHeaderCellProps>(), {\n sortId: '',\n });\n const classes = useCssModule();\n\n const tableInjection = inject(TABLE_INJECTION.key);\n if (!tableInjection) {\n throw new Error('TableHeaderCell must be used within a Table component');\n }\n\n const { density, hasActions } = tableInjection;\n\n // #region sorting\n const { currentSortId, currentSortOrder, updateCurrentSort } = inject(\n DATA_VIEW_INJECTION.key,\n DATA_VIEW_INJECTION.defaults,\n );\n const isSortable = computed(() => !!props.sortId);\n const isActiveSort = computed(() => currentSortId.value === props.sortId);\n\n function onRootClick() {\n if (isSortable.value && typeof updateCurrentSort === 'function') {\n updateCurrentSort(props.sortId, { shouldEmit: true });\n }\n }\n // #endregion sorting\n</script>\n\n<template>\n <th\n class=\"stash-table-header-cell border-b border-r border-ice-200 p-3 text-xs font-medium text-ice-900\"\n :class=\"[\n classes.root,\n {\n 'bg-white': !isActiveSort,\n 'stash-table-header-cell--sorted bg-blue-100': isActiveSort,\n [classes['root--density-compact']]: density === 'compact',\n [classes['root--density-comfortable']]: density === 'comfortable',\n [classes['has-actions']]: hasActions,\n 'cursor-pointer': isSortable,\n },\n ]\"\n data-test=\"stash-table-header-cell\"\n @click=\"onRootClick\"\n >\n <div class=\"flex justify-between\" :class=\"classes['content-wrapper']\">\n <!-- @slot default -->\n <slot></slot>\n <div v-if=\"isSortable\" class=\"relative h-4 w-3\">\n <Icon\n v-if=\"!isActiveSort || currentSortOrder === 'asc'\"\n class=\"absolute text-ice-700\"\n :class=\"[classes.caret, classes['caret-up']]\"\n data-test=\"icon|caret-up\"\n name=\"caret-up\"\n size=\"dense\"\n />\n <Icon\n v-if=\"!isActiveSort || currentSortOrder === 'desc'\"\n class=\"absolute text-ice-700\"\n :class=\"[classes.caret, classes['caret-down']]\"\n data-test=\"icon|caret-down\"\n name=\"caret-down\"\n size=\"dense\"\n />\n </div>\n </div>\n </th>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .root {\n border-left: none;\n border-top: none;\n position: sticky;\n top: 0;\n z-index: 1;\n }\n\n .root:last-of-type {\n border-right: 0;\n }\n\n .has-actions:last-of-type .content-wrapper {\n justify-content: flex-end !important;\n }\n\n .caret-up {\n top: -5px;\n }\n\n .caret-down {\n top: 2px;\n }\n\n :global(.stash-table-header-cell--sorted) .caret {\n top: -2px; /* vertically center the caret icon */\n }\n\n @media (width >= theme(--breakpoint-lg)) {\n .root--density-comfortable:last-of-type {\n padding-right: 24px;\n }\n\n .root--density-comfortable:first-of-type:not(\n :global(.stash-table-header-row__selection-cell),\n :global(.stash-table-row__selection-cell)\n ) {\n padding-left: 24px;\n }\n }\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","tableInjection","inject","TABLE_INJECTION","density","hasActions","currentSortId","currentSortOrder","updateCurrentSort","DATA_VIEW_INJECTION","isSortable","computed","isActiveSort","onRootClick","_createElementBlock","_unref","_createElementVNode","_normalizeClass","_renderSlot","_ctx","_openBlock","_hoisted_1","_createBlock","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;AAeE,UAAMA,IAAQC,GAGRC,IAAUC,EAAA,GAEVC,IAAiBC,EAAOC,EAAgB,GAAG;AACjD,QAAI,CAACF;AACH,YAAM,IAAI,MAAM,uDAAuD;AAGzE,UAAM,EAAE,SAAAG,GAAS,YAAAC,EAAA,IAAeJ,GAG1B,EAAE,eAAAK,GAAe,kBAAAC,GAAkB,mBAAAC,EAAA,IAAsBN;AAAA,MAC7DO,EAAoB;AAAA,MACpBA,EAAoB;AAAA,IAAA,G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B,aAAU;AAAA,YACV,MAAK;AAAA,YACL,MAAK;AAAA,UAAA;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TableHeaderCell.js","sources":["../src/components/TableHeaderCell/TableHeaderCell.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import type { Header } from '@tanstack/vue-table';\n import { computed, inject, useCssModule } from 'vue';\n\n import { DATA_VIEW_INJECTION, SortValueDeserialized } from '../DataView/DataView.vue';\n import Icon from '../Icon/Icon.vue';\n import { TABLE_INJECTION } from '../Table/Table.vue';\n\n export interface TableHeaderCellProps {\n /**\n * A unique value correlated to the data in this header's column (without a leading hyphen/dash).\n * For example: `'product_name'` (with no leading dash/hyphen).\n */\n sortId?: SortValueDeserialized['id'];\n\n /**\n * TanStack header instance passed when Table is in schema-driven mode.\n * When provided, sorting is controlled by TanStack instead of DataView.\n * Typed as any so DataTable can pass Header<TData, unknown> without a type assertion.\n */\n schemaDrivenHeader?: Header<any, any>;\n }\n\n const props = withDefaults(defineProps<TableHeaderCellProps>(), {\n sortId: '',\n schemaDrivenHeader: undefined,\n });\n const classes = useCssModule();\n\n const tableInjection = inject(TABLE_INJECTION.key);\n if (!tableInjection) {\n throw new Error('TableHeaderCell must be used within a Table component');\n }\n\n const { density, hasActions } = tableInjection;\n\n const hasSchemaDrivenHeader = computed(() => !!props.schemaDrivenHeader);\n\n // #region sorting\n const { currentSortId, currentSortOrder, updateCurrentSort } = inject(\n DATA_VIEW_INJECTION.key,\n DATA_VIEW_INJECTION.defaults,\n );\n\n const isSortable = computed(() => {\n if (hasSchemaDrivenHeader.value) {\n return props.schemaDrivenHeader!.column.getCanSort();\n }\n return !!props.sortId;\n });\n\n const isActiveSort = computed(() => {\n if (hasSchemaDrivenHeader.value) {\n return !!props.schemaDrivenHeader!.column.getIsSorted();\n }\n return currentSortId.value === props.sortId;\n });\n\n const sortDirection = computed<'asc' | 'desc' | false>(() => {\n if (hasSchemaDrivenHeader.value) {\n return props.schemaDrivenHeader!.column.getIsSorted();\n }\n if (isActiveSort.value && currentSortOrder.value) {\n return currentSortOrder.value;\n }\n return false;\n });\n\n function onRootClick(event: MouseEvent) {\n if (hasSchemaDrivenHeader.value) {\n props.schemaDrivenHeader!.column.getToggleSortingHandler()?.(event);\n return;\n }\n\n if (isSortable.value && typeof updateCurrentSort === 'function') {\n updateCurrentSort(props.sortId, { shouldEmit: true });\n }\n }\n // #endregion sorting\n</script>\n\n<template>\n <th\n class=\"stash-table-header-cell border-b border-r border-ice-200 p-3 text-xs font-medium text-ice-900\"\n :class=\"[\n classes.root,\n {\n 'bg-white': !isActiveSort,\n 'stash-table-header-cell--sorted bg-blue-100': isActiveSort,\n [classes['root--density-compact']]: density === 'compact',\n [classes['root--density-comfortable']]: density === 'comfortable',\n [classes['has-actions']]: hasActions,\n 'cursor-pointer': isSortable,\n },\n ]\"\n data-test=\"stash-table-header-cell\"\n @click=\"onRootClick\"\n >\n <div class=\"flex justify-between\" :class=\"classes['content-wrapper']\">\n <!-- @slot default -->\n <slot></slot>\n <div v-if=\"isSortable\" class=\"relative h-4 w-3\">\n <Icon\n v-if=\"!isActiveSort || sortDirection === 'asc'\"\n class=\"absolute text-ice-700\"\n :class=\"[classes.caret, classes['caret-up']]\"\n data-test=\"icon|caret-up\"\n name=\"caret-up\"\n size=\"dense\"\n />\n <Icon\n v-if=\"!isActiveSort || sortDirection === 'desc'\"\n class=\"absolute text-ice-700\"\n :class=\"[classes.caret, classes['caret-down']]\"\n data-test=\"icon|caret-down\"\n name=\"caret-down\"\n size=\"dense\"\n />\n </div>\n </div>\n </th>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .root {\n border-left: none;\n border-top: none;\n position: sticky;\n top: 0;\n z-index: 1;\n }\n\n .root:last-of-type {\n border-right: 0;\n }\n\n .has-actions:last-of-type .content-wrapper {\n justify-content: flex-end !important;\n }\n\n .caret-up {\n top: -5px;\n }\n\n .caret-down {\n top: 2px;\n }\n\n :global(.stash-table-header-cell--sorted) .caret {\n top: -2px; /* vertically center the caret icon */\n }\n\n @media (width >= theme(--breakpoint-lg)) {\n .root--density-comfortable:last-of-type {\n padding-right: 24px;\n }\n\n .root--density-comfortable:first-of-type:not(\n :global(.stash-table-header-row__selection-cell),\n :global(.stash-table-row__selection-cell)\n ) {\n padding-left: 24px;\n }\n }\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","tableInjection","inject","TABLE_INJECTION","density","hasActions","hasSchemaDrivenHeader","computed","currentSortId","currentSortOrder","updateCurrentSort","DATA_VIEW_INJECTION","isSortable","isActiveSort","sortDirection","onRootClick","event","_a","_createElementBlock","_unref","_createElementVNode","_normalizeClass","_renderSlot","_ctx","_openBlock","_hoisted_1","_createBlock","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBE,UAAMA,IAAQC,GAIRC,IAAUC,EAAA,GAEVC,IAAiBC,EAAOC,EAAgB,GAAG;AACjD,QAAI,CAACF;AACH,YAAM,IAAI,MAAM,uDAAuD;AAGzE,UAAM,EAAE,SAAAG,GAAS,YAAAC,EAAA,IAAeJ,GAE1BK,IAAwBC,EAAS,MAAM,CAAC,CAACV,EAAM,kBAAkB,GAGjE,EAAE,eAAAW,GAAe,kBAAAC,GAAkB,mBAAAC,EAAA,IAAsBR;AAAA,MAC7DS,EAAoB;AAAA,MACpBA,EAAoB;AAAA,IAAA,GAGhBC,IAAaL,EAAS,MACtBD,EAAsB,QACjBT,EAAM,mBAAoB,OAAO,WAAA,IAEnC,CAAC,CAACA,EAAM,MAChB,GAEKgB,IAAeN,EAAS,MACxBD,EAAsB,QACjB,CAAC,CAACT,EAAM,mBAAoB,OAAO,YAAA,IAErCW,EAAc,UAAUX,EAAM,MACtC,GAEKiB,IAAgBP,EAAiC,MACjDD,EAAsB,QACjBT,EAAM,mBAAoB,OAAO,YAAA,IAEtCgB,EAAa,SAASJ,EAAiB,QAClCA,EAAiB,QAEnB,EACR;AAED,aAASM,EAAYC,GAAmB;;AACtC,UAAIV,EAAsB,OAA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