@leaflink/stash 48.6.0 → 48.6.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.
@@ -1,7 +1,7 @@
1
- import { defineComponent as T, inject as A, ref as M, computed as x, onBeforeMount as $, openBlock as a, createElementBlock as n, normalizeClass as j, unref as e, createElementVNode as k, createBlock as z, createCommentVNode as r, renderSlot as U, toDisplayString as W, Fragment as F, createVNode as s, withCtx as S } from "vue";
2
- import { t as y } from "./locale.js";
1
+ import { defineComponent as M, inject as $, ref as j, computed as x, onBeforeMount as z, openBlock as a, createElementBlock as n, normalizeClass as U, unref as e, createElementVNode as k, createBlock as W, createCommentVNode as s, renderSlot as F, toDisplayString as J, Fragment as K, createVNode as r, withCtx as y } from "vue";
2
+ import { t as S } from "./locale.js";
3
3
  import _ from "./Button.js";
4
- import J from "./Checkbox.js";
4
+ import L from "./Checkbox.js";
5
5
  import "lodash-es/cloneDeep";
6
6
  import C from "./Icon.js";
7
7
  import "./Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js";
@@ -14,13 +14,13 @@ import "lodash-es/uniqueId";
14
14
  import "./Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js";
15
15
  import "./index-79ce320f.js";
16
16
  import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
17
- const K = { class: "tw-flex tw-place-items-center" }, O = { class: "tw-flex tw-items-center tw-gap-x-2 lg:tw-gap-x-6" }, q = {
17
+ const O = { class: "tw-flex tw-place-items-center" }, q = { class: "tw-flex tw-items-center tw-gap-x-2 lg:tw-gap-x-6" }, G = {
18
18
  key: 0,
19
19
  class: "tw-flex tw-items-center"
20
- }, G = {
20
+ }, H = {
21
21
  key: 0,
22
22
  class: "tw-mr-1.5 tw-text-xs"
23
- }, ce = /* @__PURE__ */ T({
23
+ }, me = /* @__PURE__ */ M({
24
24
  __name: "DataViewToolbar",
25
25
  props: {
26
26
  allRowsSelected: { type: Boolean, default: !1 },
@@ -42,73 +42,76 @@ const K = { class: "tw-flex tw-place-items-center" }, O = { class: "tw-flex tw-i
42
42
  pageSize: f,
43
43
  totalDataCount: v,
44
44
  goPrevPage: R,
45
- goNextPage: D
46
- } = A(B.key, B.defaults), h = M(0), b = x(() => i.value ? "none" : u.value === "table" ? "rounded-top" : o.radius), I = x(() => {
45
+ goNextPage: D,
46
+ isEmpty: I,
47
+ isLoading: T
48
+ } = $(B.key, B.defaults), b = j(0), g = x(() => i.value ? "none" : u.value === "table" ? "rounded-top" : o.radius), A = x(() => {
47
49
  const d = f.value * (l.value - 1) + 1, t = Math.min(f.value * l.value, v.value), c = v.value;
48
- return y("ll.pageStats", { from: d, to: t, total: c });
50
+ return S("ll.pageStats", { from: d, to: t, total: c });
49
51
  });
50
- function g() {
51
- P("select"), h.value++;
52
+ function h() {
53
+ P("select"), b.value++;
52
54
  }
53
- return $(() => {
55
+ return z(() => {
54
56
  p && (p.value = !0);
55
57
  }), (d, t) => (a(), n("div", {
56
- class: j(["stash-data-view-toolbar tw-flex tw-min-h-15 tw-items-center tw-justify-between tw-bg-white tw-py-1.5", {
58
+ class: U(["stash-data-view-toolbar tw-flex tw-min-h-15 tw-items-center tw-justify-between tw-bg-white tw-py-1.5", {
57
59
  "tw-border-t tw-border-ice-200": e(i),
58
- "tw-rounded": b.value === "rounded",
59
- "tw-rounded-t": b.value === "rounded-top",
60
+ "tw-rounded": g.value === "rounded",
61
+ "tw-rounded-t": g.value === "rounded-top",
60
62
  "tw-mb-3": e(u) !== "table" && !e(i),
61
63
  "tw-px-0": e(m) === "compact",
62
64
  "lg:tw-px-3": e(m) === "comfortable"
63
65
  }]),
64
66
  "data-test": "stash-data-view-toolbar"
65
67
  }, [
66
- k("div", K, [
67
- e(N) ? (a(), z(J, {
68
- key: h.value,
68
+ k("div", O, [
69
+ e(N) && !e(I) ? (a(), W(L, {
70
+ key: b.value,
69
71
  checked: o.allRowsSelected,
70
72
  indeterminate: o.someRowsSelected && !o.allRowsSelected,
71
- title: e(y)("ll.selectAll"),
72
- "onUpdate:indeterminate": g,
73
- "onUpdate:checked": g
74
- }, null, 8, ["checked", "indeterminate", "title"])) : r("", !0),
75
- k("div", O, [
76
- U(d.$slots, "default")
73
+ title: e(S)("ll.selectAll"),
74
+ disabled: e(T),
75
+ "onUpdate:indeterminate": h,
76
+ "onUpdate:checked": h
77
+ }, null, 8, ["checked", "indeterminate", "title", "disabled"])) : s("", !0),
78
+ k("div", q, [
79
+ F(d.$slots, "default")
77
80
  ])
78
81
  ]),
79
- e(V) ? (a(), n("div", q, [
80
- o.hidePageStats ? r("", !0) : (a(), n("span", G, W(I.value), 1)),
81
- e(w) > 1 ? (a(), n(F, { key: 1 }, [
82
- s(_, {
82
+ e(V) ? (a(), n("div", G, [
83
+ o.hidePageStats ? s("", !0) : (a(), n("span", H, J(A.value), 1)),
84
+ e(w) > 1 ? (a(), n(K, { key: 1 }, [
85
+ r(_, {
83
86
  icon: "",
84
87
  class: "tw-h-9 tw-w-9 tw-p-1.5",
85
88
  "data-test": "button|prev-page",
86
89
  disabled: e(l) === 1,
87
90
  onClick: t[0] || (t[0] = (c) => e(R)({ shouldEmit: !0 }))
88
91
  }, {
89
- default: S(() => [
90
- s(C, { name: "chevron-left" })
92
+ default: y(() => [
93
+ r(C, { name: "chevron-left" })
91
94
  ]),
92
95
  _: 1
93
96
  }, 8, ["disabled"]),
94
- s(_, {
97
+ r(_, {
95
98
  icon: "",
96
99
  class: "tw-h-9 tw-w-9 tw-p-1.5",
97
100
  "data-test": "button|next-page",
98
101
  disabled: e(l) === e(w),
99
102
  onClick: t[1] || (t[1] = (c) => e(D)({ shouldEmit: !0 }))
100
103
  }, {
101
- default: S(() => [
102
- s(C, { name: "chevron-right" })
104
+ default: y(() => [
105
+ r(C, { name: "chevron-right" })
103
106
  ]),
104
107
  _: 1
105
108
  }, 8, ["disabled"])
106
- ], 64)) : r("", !0)
107
- ])) : r("", !0)
109
+ ], 64)) : s("", !0)
110
+ ])) : s("", !0)
108
111
  ], 2));
109
112
  }
110
113
  });
111
114
  export {
112
- ce as default
115
+ me as default
113
116
  };
114
117
  //# sourceMappingURL=DataViewToolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataViewToolbar.js","sources":["../src/components/DataViewToolbar/DataViewToolbar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, onBeforeMount, ref } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Checkbox from '../Checkbox/Checkbox.vue';\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import Icon from '../Icon/Icon.vue';\n import { ToolbarRadiuses } from './DataViewToolbar.types';\n\n export interface DataViewToolbarProps {\n /**\n * When DataView has `variant=\"table\"` and Table has `is-selectable` enabled, it provides a way to flag\n * a checkbox whenever all rows are selected, just like the standalone version on TableHeaderRow.\n */\n allRowsSelected?: boolean;\n\n /**\n * Hides the page statistics (ex: \"1 - 12 of 20\") in the toolbar\n */\n hidePageStats?: boolean;\n\n /**\n * Controls the corners of DataViewToolbar with the \"border-radius\" CSS property. The default value is \"rounded\".\n */\n radius?: ToolbarRadiuses;\n\n /**\n * When DataView has variant=\"table\" and Table has `is-selectable` enabled, it provides a way to flag\n * a checkbox whenever one or more, but not all rows are selected, just like the standalone\n * version on TableHeaderRow.\n */\n someRowsSelected?: boolean;\n }\n\n const props = withDefaults(defineProps<DataViewToolbarProps>(), {\n allRowsSelected: false,\n hidePageStats: false,\n radius: 'rounded',\n someRowsSelected: false,\n });\n\n const emit =\n defineEmits<{\n (e: 'select'): void;\n }>();\n\n const {\n isWithinModule,\n variant: dataViewVariant,\n density,\n currentPage,\n hasToolbar,\n isPaginationEnabled,\n isSelectable,\n pageCount,\n pageSize,\n totalDataCount,\n goPrevPage,\n goNextPage,\n } = inject(DATA_VIEW_INJECTION.key, DATA_VIEW_INJECTION.defaults);\n\n const checkboxKey = ref(0);\n\n const computedRadius = computed<ToolbarRadiuses>(() => {\n if (isWithinModule.value) {\n return 'none';\n }\n\n if (dataViewVariant.value === 'table') {\n return 'rounded-top';\n }\n\n return props.radius;\n });\n\n // #region pagination\n const pageStats = computed(() => {\n const from = pageSize.value * (currentPage.value - 1) + 1;\n const to = Math.min(pageSize.value * currentPage.value, totalDataCount.value);\n const total = totalDataCount.value;\n\n return t('ll.pageStats', { from, to, total });\n });\n // #endregion pagination\n\n function onSelect() {\n emit('select');\n\n /**\n * In Vue (as of this writing), if a user checks a native checkbox but the v-model is `false` and does not change from `false`, then the checkbox will display as checked even though the v-model is still `false`.\n * Forcing a re-render with a `key` change allows the checkbox to stay unchecked if its v-model is still `false` and its v-model not been changed.\n * To verify that this is necessary, test the \"select all\" checkbox in the SelectionWithSomeDisabled story in Table.story.ts with and without the `key` attribute.\n */\n checkboxKey.value++;\n }\n\n onBeforeMount(() => {\n if (hasToolbar) {\n hasToolbar.value = true;\n }\n });\n</script>\n\n<template>\n <div\n class=\"stash-data-view-toolbar tw-flex tw-min-h-15 tw-items-center tw-justify-between tw-bg-white tw-py-1.5\"\n :class=\"{\n 'tw-border-t tw-border-ice-200': isWithinModule,\n 'tw-rounded': computedRadius === 'rounded',\n 'tw-rounded-t': computedRadius === 'rounded-top',\n 'tw-mb-3': dataViewVariant !== 'table' && !isWithinModule,\n 'tw-px-0': density === 'compact',\n 'lg:tw-px-3': density === 'comfortable',\n }\"\n data-test=\"stash-data-view-toolbar\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <Checkbox\n v-if=\"isSelectable\"\n :key=\"checkboxKey\"\n :checked=\"props.allRowsSelected\"\n :indeterminate=\"props.someRowsSelected && !props.allRowsSelected\"\n :title=\"t('ll.selectAll')\"\n @update:indeterminate=\"onSelect\"\n @update:checked=\"onSelect\"\n />\n <div class=\"tw-flex tw-items-center tw-gap-x-2 lg:tw-gap-x-6\">\n <!-- @slot default -->\n <slot></slot>\n </div>\n </div>\n\n <!-- Pagination -->\n <div v-if=\"isPaginationEnabled\" class=\"tw-flex tw-items-center\">\n <span v-if=\"!props.hidePageStats\" class=\"tw-mr-1.5 tw-text-xs\">\n {{ pageStats }}\n </span>\n <template v-if=\"pageCount > 1\">\n <Button\n icon\n class=\"tw-h-9 tw-w-9 tw-p-1.5\"\n data-test=\"button|prev-page\"\n :disabled=\"currentPage === 1\"\n @click=\"goPrevPage({ shouldEmit: true })\"\n >\n <Icon name=\"chevron-left\" />\n </Button>\n <Button\n icon\n class=\"tw-h-9 tw-w-9 tw-p-1.5\"\n data-test=\"button|next-page\"\n :disabled=\"currentPage === pageCount\"\n @click=\"goNextPage({ shouldEmit: true })\"\n >\n <Icon name=\"chevron-right\" />\n </Button>\n </template>\n </div>\n </div>\n</template>\n"],"names":["isWithinModule","dataViewVariant","density","currentPage","hasToolbar","isPaginationEnabled","isSelectable","pageCount","pageSize","totalDataCount","goPrevPage","goNextPage","inject","DATA_VIEW_INJECTION","checkboxKey","ref","computedRadius","computed","props","pageStats","from","to","total","t","onSelect","emit","onBeforeMount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+CQ;AAAA,MACJ,gBAAAA;AAAA,MACA,SAASC;AAAA,MACT,SAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,qBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,WAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,IACE,IAAAC,EAAOC,EAAoB,KAAKA,EAAoB,QAAQ,GAE1DC,IAAcC,EAAI,CAAC,GAEnBC,IAAiBC,EAA0B,MAC3CjB,EAAe,QACV,SAGLC,EAAgB,UAAU,UACrB,gBAGFiB,EAAM,MACd,GAGKC,IAAYF,EAAS,MAAM;AAC/B,YAAMG,IAAOZ,EAAS,SAASL,EAAY,QAAQ,KAAK,GAClDkB,IAAK,KAAK,IAAIb,EAAS,QAAQL,EAAY,OAAOM,EAAe,KAAK,GACtEa,IAAQb,EAAe;AAE7B,aAAOc,EAAE,gBAAgB,EAAE,MAAAH,GAAM,IAAAC,GAAI,OAAAC,GAAO;AAAA,IAAA,CAC7C;AAGD,aAASE,IAAW;AAClB,MAAAC,EAAK,QAAQ,GAODX,EAAA;AAAA,IACd;AAEA,WAAAY,EAAc,MAAM;AAClB,MAAItB,MACFA,EAAW,QAAQ;AAAA,IACrB,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"DataViewToolbar.js","sources":["../src/components/DataViewToolbar/DataViewToolbar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, onBeforeMount, ref } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Checkbox from '../Checkbox/Checkbox.vue';\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import Icon from '../Icon/Icon.vue';\n import { ToolbarRadiuses } from './DataViewToolbar.types';\n\n export interface DataViewToolbarProps {\n /**\n * When DataView has `variant=\"table\"` and Table has `is-selectable` enabled, it provides a way to flag\n * a checkbox whenever all rows are selected, just like the standalone version on TableHeaderRow.\n */\n allRowsSelected?: boolean;\n\n /**\n * Hides the page statistics (ex: \"1 - 12 of 20\") in the toolbar\n */\n hidePageStats?: boolean;\n\n /**\n * Controls the corners of DataViewToolbar with the \"border-radius\" CSS property. The default value is \"rounded\".\n */\n radius?: ToolbarRadiuses;\n\n /**\n * When DataView has variant=\"table\" and Table has `is-selectable` enabled, it provides a way to flag\n * a checkbox whenever one or more, but not all rows are selected, just like the standalone\n * version on TableHeaderRow.\n */\n someRowsSelected?: boolean;\n }\n\n const props = withDefaults(defineProps<DataViewToolbarProps>(), {\n allRowsSelected: false,\n hidePageStats: false,\n radius: 'rounded',\n someRowsSelected: false,\n });\n\n const emit =\n defineEmits<{\n (e: 'select'): void;\n }>();\n\n const {\n isWithinModule,\n variant: dataViewVariant,\n density,\n currentPage,\n hasToolbar,\n isPaginationEnabled,\n isSelectable,\n pageCount,\n pageSize,\n totalDataCount,\n goPrevPage,\n goNextPage,\n isEmpty,\n isLoading,\n } = inject(DATA_VIEW_INJECTION.key, DATA_VIEW_INJECTION.defaults);\n\n const checkboxKey = ref(0);\n\n const computedRadius = computed<ToolbarRadiuses>(() => {\n if (isWithinModule.value) {\n return 'none';\n }\n\n if (dataViewVariant.value === 'table') {\n return 'rounded-top';\n }\n\n return props.radius;\n });\n\n // #region pagination\n const pageStats = computed(() => {\n const from = pageSize.value * (currentPage.value - 1) + 1;\n const to = Math.min(pageSize.value * currentPage.value, totalDataCount.value);\n const total = totalDataCount.value;\n\n return t('ll.pageStats', { from, to, total });\n });\n // #endregion pagination\n\n function onSelect() {\n emit('select');\n\n /**\n * In Vue (as of this writing), if a user checks a native checkbox but the v-model is `false` and does not change from `false`, then the checkbox will display as checked even though the v-model is still `false`.\n * Forcing a re-render with a `key` change allows the checkbox to stay unchecked if its v-model is still `false` and its v-model not been changed.\n * To verify that this is necessary, test the \"select all\" checkbox in the SelectionWithSomeDisabled story in Table.story.ts with and without the `key` attribute.\n */\n checkboxKey.value++;\n }\n\n onBeforeMount(() => {\n if (hasToolbar) {\n hasToolbar.value = true;\n }\n });\n</script>\n\n<template>\n <div\n class=\"stash-data-view-toolbar tw-flex tw-min-h-15 tw-items-center tw-justify-between tw-bg-white tw-py-1.5\"\n :class=\"{\n 'tw-border-t tw-border-ice-200': isWithinModule,\n 'tw-rounded': computedRadius === 'rounded',\n 'tw-rounded-t': computedRadius === 'rounded-top',\n 'tw-mb-3': dataViewVariant !== 'table' && !isWithinModule,\n 'tw-px-0': density === 'compact',\n 'lg:tw-px-3': density === 'comfortable',\n }\"\n data-test=\"stash-data-view-toolbar\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <Checkbox\n v-if=\"isSelectable && !isEmpty\"\n :key=\"checkboxKey\"\n :checked=\"props.allRowsSelected\"\n :indeterminate=\"props.someRowsSelected && !props.allRowsSelected\"\n :title=\"t('ll.selectAll')\"\n :disabled=\"isLoading\"\n @update:indeterminate=\"onSelect\"\n @update:checked=\"onSelect\"\n />\n <div class=\"tw-flex tw-items-center tw-gap-x-2 lg:tw-gap-x-6\">\n <!-- @slot default -->\n <slot></slot>\n </div>\n </div>\n\n <!-- Pagination -->\n <div v-if=\"isPaginationEnabled\" class=\"tw-flex tw-items-center\">\n <span v-if=\"!props.hidePageStats\" class=\"tw-mr-1.5 tw-text-xs\">\n {{ pageStats }}\n </span>\n <template v-if=\"pageCount > 1\">\n <Button\n icon\n class=\"tw-h-9 tw-w-9 tw-p-1.5\"\n data-test=\"button|prev-page\"\n :disabled=\"currentPage === 1\"\n @click=\"goPrevPage({ shouldEmit: true })\"\n >\n <Icon name=\"chevron-left\" />\n </Button>\n <Button\n icon\n class=\"tw-h-9 tw-w-9 tw-p-1.5\"\n data-test=\"button|next-page\"\n :disabled=\"currentPage === pageCount\"\n @click=\"goNextPage({ shouldEmit: true })\"\n >\n <Icon name=\"chevron-right\" />\n </Button>\n </template>\n </div>\n </div>\n</template>\n"],"names":["isWithinModule","dataViewVariant","density","currentPage","hasToolbar","isPaginationEnabled","isSelectable","pageCount","pageSize","totalDataCount","goPrevPage","goNextPage","isEmpty","isLoading","inject","DATA_VIEW_INJECTION","checkboxKey","ref","computedRadius","computed","props","pageStats","from","to","total","t","onSelect","emit","onBeforeMount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+CQ;AAAA,MACJ,gBAAAA;AAAA,MACA,SAASC;AAAA,MACT,SAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,qBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,WAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,SAAAC;AAAA,MACA,WAAAC;AAAA,IACE,IAAAC,EAAOC,EAAoB,KAAKA,EAAoB,QAAQ,GAE1DC,IAAcC,EAAI,CAAC,GAEnBC,IAAiBC,EAA0B,MAC3CnB,EAAe,QACV,SAGLC,EAAgB,UAAU,UACrB,gBAGFmB,EAAM,MACd,GAGKC,IAAYF,EAAS,MAAM;AAC/B,YAAMG,IAAOd,EAAS,SAASL,EAAY,QAAQ,KAAK,GAClDoB,IAAK,KAAK,IAAIf,EAAS,QAAQL,EAAY,OAAOM,EAAe,KAAK,GACtEe,IAAQf,EAAe;AAE7B,aAAOgB,EAAE,gBAAgB,EAAE,MAAAH,GAAM,IAAAC,GAAI,OAAAC,GAAO;AAAA,IAAA,CAC7C;AAGD,aAASE,IAAW;AAClB,MAAAC,EAAK,QAAQ,GAODX,EAAA;AAAA,IACd;AAEA,WAAAY,EAAc,MAAM;AAClB,MAAIxB,MACFA,EAAW,QAAQ;AAAA,IACrB,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/Table.js CHANGED
@@ -1,16 +1,16 @@
1
- import { defineComponent as C, inject as v, computed as o, provide as L, watchEffect as H, openBlock as u, createElementBlock as N, normalizeClass as s, unref as m, normalizeStyle as D, createElementVNode as p, renderSlot as c, createBlock as h, withCtx as r, createVNode as i } from "vue";
1
+ import { defineComponent as C, inject as g, computed as o, provide as H, watchEffect as N, openBlock as p, createElementBlock as L, normalizeClass as i, unref as c, normalizeStyle as I, createElementVNode as f, renderSlot as y, createBlock as k, withCtx as d, createVNode as n } from "vue";
2
2
  import "lodash-es/cloneDeep";
3
- import { M as g } from "./Module.keys-2cc7d830.js";
3
+ import { M as E } from "./Module.keys-2cc7d830.js";
4
4
  import "lodash-es/uniqueId";
5
5
  import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
6
6
  import "./Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js";
7
- import { D as E } from "./DataView.vue_used_vue_type_style_index_0_lang.module-5c180dba.js";
8
- import V from "./EmptyState.js";
9
- import I from "./Loading.js";
10
- import k from "./TableCell.js";
11
- import S from "./TableRow.js";
12
- import { T as A } from "./Table.keys-cf93df19.js";
13
- import { S as O } from "./misc-76697f61.js";
7
+ import { D as S } from "./DataView.vue_used_vue_type_style_index_0_lang.module-5c180dba.js";
8
+ import A from "./EmptyState.js";
9
+ import D from "./Loading.js";
10
+ import x from "./TableCell.js";
11
+ import _ from "./TableRow.js";
12
+ import { T as O } from "./Table.keys-cf93df19.js";
13
+ import { S as V } from "./misc-76697f61.js";
14
14
  import "./locale.js";
15
15
  import "lodash-es/get";
16
16
  import "./Illustration.vue_vue_type_script_setup_true_lang-4b8944da.js";
@@ -44,74 +44,76 @@ const z = { class: "tw-relative tw-min-w-full tw-max-w-initial tw-border-separat
44
44
  },
45
45
  setup(e) {
46
46
  const t = e, {
47
- density: x,
48
- variant: f,
49
- isEmpty: _,
50
- isLoading: T,
51
- isSelectable: y
52
- } = v(E.key, E.defaults), { variant: d } = v(g.key, g.defaults), w = o(() => (d == null ? void 0 : d.value) === "table" || f.value === "table" ? "rounded-bottom" : t.radius), l = o(() => t.stickyHeader ? "scroll" : t.layout), b = o(() => {
53
- var a, n;
47
+ density: T,
48
+ variant: w,
49
+ isEmpty: r,
50
+ isLoading: s,
51
+ isSelectable: b
52
+ } = g(S.key, S.defaults), { variant: u } = g(E.key, E.defaults), v = o(() => (u == null ? void 0 : u.value) === "table" || w.value === "table" ? "rounded-bottom" : t.radius), l = o(() => t.stickyHeader ? "scroll" : t.layout), h = o(() => {
53
+ var a, m;
54
54
  return !!((a = t.stickyHeader) != null && a.maxHeight && // table can't scroll without a max height; sticky headers only needed for a scrollable table
55
- ((n = t.stickyHeader) == null ? void 0 : n.listLength) > 3);
55
+ ((m = t.stickyHeader) == null ? void 0 : m.listLength) > 3);
56
56
  }), B = o(() => {
57
57
  var a;
58
58
  return {
59
- maxHeight: b.value ? (a = t.stickyHeader) == null ? void 0 : a.maxHeight : ""
59
+ maxHeight: h.value ? (a = t.stickyHeader) == null ? void 0 : a.maxHeight : ""
60
60
  };
61
61
  });
62
- return L(A.key, {
63
- density: o(() => t.density || x.value || O.Comfortable),
62
+ return H(O.key, {
63
+ density: o(() => t.density || T.value || V.Comfortable),
64
64
  hasCustomExpandToggle: o(() => t.hasCustomExpandToggle),
65
65
  hasActions: o(() => t.hasActions),
66
66
  isExpandable: o(() => t.isExpandable),
67
- isSelectable: o(() => t.isSelectable && !t.isLoading && !t.isEmpty),
67
+ isSelectable: o(
68
+ () => t.isSelectable && !t.isLoading && !(s != null && s.value) && !t.isEmpty && !(r != null && r.value)
69
+ ),
68
70
  layout: l
69
- }), H(() => {
70
- y && (y.value = t.isSelectable);
71
- }), (a, n) => (u(), N("div", {
72
- class: s(["stash-table tw-relative", [
73
- { "tw-rounded": w.value === "rounded" },
74
- { "tw-rounded-b": w.value === "rounded-bottom" },
75
- { "tw-border-t tw-border-ice-200": m(f) === "table" },
71
+ }), N(() => {
72
+ b && (b.value = t.isSelectable);
73
+ }), (a, m) => (p(), L("div", {
74
+ class: i(["stash-table tw-relative", [
75
+ { "tw-rounded": v.value === "rounded" },
76
+ { "tw-rounded-b": v.value === "rounded-bottom" },
77
+ { "tw-border-t tw-border-ice-200": c(w) === "table" },
76
78
  { "tw-overflow-auto tw-shadow": l.value === "scroll" },
77
79
  { "tw-overflow-visble lg:tw-overflow-auto lg:tw-shadow": l.value === "stack" },
78
- { "tw-min-h-[300px]": b.value && !t.isLoading }
80
+ { "tw-min-h-[300px]": h.value && !t.isLoading }
79
81
  // prevent the table from collapsing on small screen heights when the max-height is dynamic
80
82
  ]]),
81
83
  "data-test": "stash-table",
82
- style: D(B.value)
84
+ style: I(B.value)
83
85
  }, [
84
- p("table", z, [
85
- p("thead", {
86
- class: s(["tw-border-b tw-border-ice-200", {
86
+ f("table", z, [
87
+ f("thead", {
88
+ class: i(["tw-border-b tw-border-ice-200", {
87
89
  "tw-hidden lg:tw-table-header-group": l.value === "stack"
88
90
  }])
89
91
  }, [
90
- c(a.$slots, "head")
92
+ y(a.$slots, "head")
91
93
  ], 2),
92
- p("tbody", null, [
93
- t.isLoading || m(T) ? (u(), h(S, { key: 0 }, {
94
- default: r(() => [
95
- i(k, {
94
+ f("tbody", null, [
95
+ t.isLoading || c(s) ? (p(), k(_, { key: 0 }, {
96
+ default: d(() => [
97
+ n(x, {
96
98
  colspan: "100%",
97
- class: s({ "tw-col-span-12": l.value === "stack" })
99
+ class: i({ "tw-col-span-12": l.value === "stack" })
98
100
  }, {
99
- default: r(() => [
100
- i(I)
101
+ default: d(() => [
102
+ n(D)
101
103
  ]),
102
104
  _: 1
103
105
  }, 8, ["class"])
104
106
  ]),
105
107
  _: 1
106
- })) : t.isEmpty || m(_) ? (u(), h(S, { key: 1 }, {
107
- default: r(() => [
108
- i(k, {
108
+ })) : t.isEmpty || c(r) ? (p(), k(_, { key: 1 }, {
109
+ default: d(() => [
110
+ n(x, {
109
111
  colspan: "100%",
110
- class: s({ "tw-col-span-12": l.value === "stack" })
112
+ class: i({ "tw-col-span-12": l.value === "stack" })
111
113
  }, {
112
- default: r(() => [
113
- c(a.$slots, "empty", {}, () => [
114
- i(V, {
114
+ default: d(() => [
115
+ y(a.$slots, "empty", {}, () => [
116
+ n(A, {
115
117
  class: "tw-w-full tw-bg-white",
116
118
  text: t.emptyStateText
117
119
  }, null, 8, ["text"])
@@ -121,7 +123,7 @@ const z = { class: "tw-relative tw-min-w-full tw-max-w-initial tw-border-separat
121
123
  }, 8, ["class"])
122
124
  ]),
123
125
  _: 3
124
- })) : c(a.$slots, "body", { key: 2 })
126
+ })) : y(a.$slots, "body", { key: 2 })
125
127
  ])
126
128
  ])
127
129
  ], 6));
@@ -129,7 +131,7 @@ const z = { class: "tw-relative tw-min-w-full tw-max-w-initial tw-border-separat
129
131
  });
130
132
  export {
131
133
  J as Layout,
132
- A as TABLE_INJECTION,
134
+ O as TABLE_INJECTION,
133
135
  $ as TableRadius,
134
136
  ft as default
135
137
  };
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 { 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","<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 { computed, inject, provide, watchEffect } from 'vue';\n\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import EmptyState from '../EmptyState/EmptyState.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 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 {\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 isStickyHeaderEnabled = computed<boolean>(() => {\n return !!(\n (\n props.stickyHeader?.maxHeight && // table can't scroll without a max height; sticky headers only needed for a scrollable table\n props.stickyHeader?.listLength > 3\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 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(() => props.isSelectable && !props.isLoading && !props.isEmpty),\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\n class=\"stash-table tw-relative\"\n :class=\"[\n { 'tw-rounded': computedRadius === 'rounded' },\n { 'tw-rounded-b': computedRadius === 'rounded-bottom' },\n { 'tw-border-t tw-border-ice-200': dataViewVariant === 'table' },\n { 'tw-overflow-auto tw-shadow': computedLayout === 'scroll' },\n { 'tw-overflow-visble lg:tw-overflow-auto lg:tw-shadow': computedLayout === 'stack' },\n { 'tw-min-h-[300px]': isStickyHeaderEnabled && !props.isLoading }, // prevent the table from collapsing on small screen heights when the max-height is dynamic\n ]\"\n data-test=\"stash-table\"\n :style=\"rootStyle\"\n >\n <table class=\"tw-relative tw-min-w-full tw-max-w-initial tw-border-separate\">\n <thead\n class=\"tw-border-b tw-border-ice-200\"\n :class=\"{\n 'tw-hidden lg:tw-table-header-group': computedLayout === 'stack',\n }\"\n >\n <!-- @slot head -->\n <slot name=\"head\"> </slot>\n </thead>\n <tbody>\n <!-- \n tw-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 These are necessary in order to properly horizontally center Loading, and EmptyState \n -->\n <TableRow v-if=\"props.isLoading || isDataViewLoading\">\n <TableCell colspan=\"100%\" :class=\"{ 'tw-col-span-12': computedLayout === 'stack' }\">\n <Loading />\n </TableCell>\n </TableRow>\n <!-- @slot empty -->\n <template v-else-if=\"props.isEmpty || isDataViewEmpty\">\n <TableRow>\n <TableCell colspan=\"100%\" :class=\"{ 'tw-col-span-12': computedLayout === 'stack' }\">\n <slot name=\"empty\">\n <EmptyState class=\"tw-w-full tw-bg-white\" :text=\"props.emptyStateText\" />\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</template>\n"],"names":["Layout","TableRadius","dataViewDensity","dataViewVariant","isDataViewEmpty","isDataViewLoading","isDataViewSelectable","inject","DATA_VIEW_INJECTION","moduleVariant","MODULE_INJECTION","computedRadius","computed","props","computedLayout","isStickyHeaderEnabled","_a","_b","rootStyle","provide","TABLE_INJECTION","SpacingDensity","watchEffect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WACVA,EAAA,gBAAgB,kBAHNA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;iBCkFJ;AAAA,MACJ,SAASC;AAAA,MACT,SAASC;AAAA,MACT,SAASC;AAAA,MACT,WAAWC;AAAA,MACX,cAAcC;AAAA,IACZ,IAAAC,EAAOC,EAAoB,KAAKA,EAAoB,QAAQ,GAE1D,EAAE,SAASC,MAAkBF,EAAOG,EAAiB,KAAKA,EAAiB,QAAQ,GAEnFC,IAAiBC,EAAwB,OAEzCH,KAAA,gBAAAA,EAAe,WAAU,WAIzBN,EAAgB,UAAU,UACrB,mBAGFU,EAAM,MACd,GAEKC,IAAiBF,EAAkB,MACnCC,EAAM,eACD,WAGFA,EAAM,MACd,GAEKE,IAAwBH,EAAkB,MAAM;;AAC7C,aAAA,CAAC,GAEJI,IAAAH,EAAM,iBAAN,QAAAG,EAAoB;AAAA,QACpBC,IAAAJ,EAAM,iBAAN,gBAAAI,EAAoB,cAAa;AAAA,IAAA,CAGtC,GAEKC,IAAYN,EAAS,MAAO;;AAAA;AAAA,QAChC,WAAWG,EAAsB,SAAQC,IAAAH,EAAM,iBAAN,gBAAAG,EAAoB,YAAY;AAAA,MACzE;AAAA,KAAA;AAEF,WAAAG,EAAQC,EAAgB,KAAK;AAAA,MAC3B,SAASR,EAAS,MAAMC,EAAM,WAAWX,EAAgB,SAASmB,EAAe,WAAW;AAAA,MAC5F,uBAAuBT,EAAS,MAAMC,EAAM,qBAAqB;AAAA,MACjE,YAAYD,EAAS,MAAMC,EAAM,UAAU;AAAA,MAC3C,cAAcD,EAAS,MAAMC,EAAM,YAAY;AAAA,MAC/C,cAAcD,EAAS,MAAMC,EAAM,gBAAgB,CAACA,EAAM,aAAa,CAACA,EAAM,OAAO;AAAA,MACrF,QAAQC;AAAA,IAAA,CACT,GAEDQ,EAAY,MAAM;AAKhB,MAAIhB,MACFA,EAAqB,QAAQO,EAAM;AAAA,IACrC,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Table.js","sources":["../src/components/Table/Table.types.ts","../src/components/Table/Table.vue"],"sourcesContent":["import { 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","<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 { computed, inject, provide, watchEffect } from 'vue';\n\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import EmptyState from '../EmptyState/EmptyState.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 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 {\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 isStickyHeaderEnabled = computed<boolean>(() => {\n return !!(\n (\n props.stickyHeader?.maxHeight && // table can't scroll without a max height; sticky headers only needed for a scrollable table\n props.stickyHeader?.listLength > 3\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 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 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\n class=\"stash-table tw-relative\"\n :class=\"[\n { 'tw-rounded': computedRadius === 'rounded' },\n { 'tw-rounded-b': computedRadius === 'rounded-bottom' },\n { 'tw-border-t tw-border-ice-200': dataViewVariant === 'table' },\n { 'tw-overflow-auto tw-shadow': computedLayout === 'scroll' },\n { 'tw-overflow-visble lg:tw-overflow-auto lg:tw-shadow': computedLayout === 'stack' },\n { 'tw-min-h-[300px]': isStickyHeaderEnabled && !props.isLoading }, // prevent the table from collapsing on small screen heights when the max-height is dynamic\n ]\"\n data-test=\"stash-table\"\n :style=\"rootStyle\"\n >\n <table class=\"tw-relative tw-min-w-full tw-max-w-initial tw-border-separate\">\n <thead\n class=\"tw-border-b tw-border-ice-200\"\n :class=\"{\n 'tw-hidden lg:tw-table-header-group': computedLayout === 'stack',\n }\"\n >\n <!-- @slot head -->\n <slot name=\"head\"> </slot>\n </thead>\n <tbody>\n <!-- \n tw-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 These are necessary in order to properly horizontally center Loading, and EmptyState \n -->\n <TableRow v-if=\"props.isLoading || isDataViewLoading\">\n <TableCell colspan=\"100%\" :class=\"{ 'tw-col-span-12': computedLayout === 'stack' }\">\n <Loading />\n </TableCell>\n </TableRow>\n <!-- @slot empty -->\n <template v-else-if=\"props.isEmpty || isDataViewEmpty\">\n <TableRow>\n <TableCell colspan=\"100%\" :class=\"{ 'tw-col-span-12': computedLayout === 'stack' }\">\n <slot name=\"empty\">\n <EmptyState class=\"tw-w-full tw-bg-white\" :text=\"props.emptyStateText\" />\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</template>\n"],"names":["Layout","TableRadius","dataViewDensity","dataViewVariant","isDataViewEmpty","isDataViewLoading","isDataViewSelectable","inject","DATA_VIEW_INJECTION","moduleVariant","MODULE_INJECTION","computedRadius","computed","props","computedLayout","isStickyHeaderEnabled","_a","_b","rootStyle","provide","TABLE_INJECTION","SpacingDensity","watchEffect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WACVA,EAAA,gBAAgB,kBAHNA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;iBCkFJ;AAAA,MACJ,SAASC;AAAA,MACT,SAASC;AAAA,MACT,SAASC;AAAA,MACT,WAAWC;AAAA,MACX,cAAcC;AAAA,IACZ,IAAAC,EAAOC,EAAoB,KAAKA,EAAoB,QAAQ,GAE1D,EAAE,SAASC,MAAkBF,EAAOG,EAAiB,KAAKA,EAAiB,QAAQ,GAEnFC,IAAiBC,EAAwB,OAEzCH,KAAA,gBAAAA,EAAe,WAAU,WAIzBN,EAAgB,UAAU,UACrB,mBAGFU,EAAM,MACd,GAEKC,IAAiBF,EAAkB,MACnCC,EAAM,eACD,WAGFA,EAAM,MACd,GAEKE,IAAwBH,EAAkB,MAAM;;AAC7C,aAAA,CAAC,GAEJI,IAAAH,EAAM,iBAAN,QAAAG,EAAoB;AAAA,QACpBC,IAAAJ,EAAM,iBAAN,gBAAAI,EAAoB,cAAa;AAAA,IAAA,CAGtC,GAEKC,IAAYN,EAAS,MAAO;;AAAA;AAAA,QAChC,WAAWG,EAAsB,SAAQC,IAAAH,EAAM,iBAAN,gBAAAG,EAAoB,YAAY;AAAA,MACzE;AAAA,KAAA;AAEF,WAAAG,EAAQC,EAAgB,KAAK;AAAA,MAC3B,SAASR,EAAS,MAAMC,EAAM,WAAWX,EAAgB,SAASmB,EAAe,WAAW;AAAA,MAC5F,uBAAuBT,EAAS,MAAMC,EAAM,qBAAqB;AAAA,MACjE,YAAYD,EAAS,MAAMC,EAAM,UAAU;AAAA,MAC3C,cAAcD,EAAS,MAAMC,EAAM,YAAY;AAAA,MAC/C,cAAcD;AAAA,QACZ,MACEC,EAAM,gBACN,CAACA,EAAM,aACP,EAACR,KAAA,QAAAA,EAAmB,UACpB,CAACQ,EAAM,WACP,EAACT,KAAA,QAAAA,EAAiB;AAAA,MACtB;AAAA,MACA,QAAQU;AAAA,IAAA,CACT,GAEDQ,EAAY,MAAM;AAKhB,MAAIhB,MACFA,EAAqB,QAAQO,EAAM;AAAA,IACrC,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflink/stash",
3
- "version": "48.6.0",
3
+ "version": "48.6.1",
4
4
  "description": "LeafLink's design system.",
5
5
  "homepage": "https://stash.leaflink.com",
6
6
  "main": "./dist/index.ts",