@leaflink/stash 50.10.0 → 50.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/assets/icons/tier-1.svg +15 -0
  2. package/assets/icons/tier-2.svg +15 -0
  3. package/assets/icons/tier-3.svg +15 -0
  4. package/assets/spritesheet.svg +1 -1
  5. package/dist/Accordion.js +28 -29
  6. package/dist/Accordion.js.map +1 -1
  7. package/dist/Accordion.vue.d.ts +8 -3
  8. package/dist/AppNavigationItem.vue.d.ts +6 -1
  9. package/dist/AppSidebar.js +1 -1
  10. package/dist/AppSidebar.js.map +1 -1
  11. package/dist/CurrencyInput.js.map +1 -1
  12. package/dist/DataView.js +102 -98
  13. package/dist/DataView.js.map +1 -1
  14. package/dist/{DataView.keys-C7eaZg2G.js → DataView.keys-aSOnA4AD.js} +2 -1
  15. package/dist/DataView.keys-aSOnA4AD.js.map +1 -0
  16. package/dist/DataView.vue.d.ts +11 -0
  17. package/dist/DataViewFilters.js +1 -1
  18. package/dist/DataViewSortButton.js +1 -1
  19. package/dist/DataViewToolbar.js +61 -60
  20. package/dist/DataViewToolbar.js.map +1 -1
  21. package/dist/Dropdown.js +10 -10
  22. package/dist/Dropdown.js.map +1 -1
  23. package/dist/Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js.map +1 -1
  24. package/dist/FilterDropdown.js +1 -1
  25. package/dist/Filters.js.map +1 -1
  26. package/dist/Icon.js +3 -0
  27. package/dist/Icon.js.map +1 -1
  28. package/dist/Icon.vue.d.ts +6 -1
  29. package/dist/IconLabel.vue.d.ts +6 -1
  30. package/dist/InlineEdit.js.map +1 -1
  31. package/dist/InputOptions.js.map +1 -1
  32. package/dist/ListView.js.map +1 -1
  33. package/dist/ListView.vue.d.ts +44 -19
  34. package/dist/Modals.js +7 -7
  35. package/dist/Modals.js.map +1 -1
  36. package/dist/Paginate.js +73 -55
  37. package/dist/Paginate.js.map +1 -1
  38. package/dist/Paginate.vue.d.ts +12 -1
  39. package/dist/QuickAction.vue.d.ts +6 -1
  40. package/dist/SearchBar.js +1 -1
  41. package/dist/SearchBar.js.map +1 -1
  42. package/dist/Select.js +5 -5
  43. package/dist/Select.js.map +1 -1
  44. package/dist/SelectStatus.js +15 -15
  45. package/dist/SelectStatus.js.map +1 -1
  46. package/dist/SelectStatus.vue.d.ts +6 -1
  47. package/dist/Step.js +15 -15
  48. package/dist/Step.js.map +1 -1
  49. package/dist/Table.js +5 -5
  50. package/dist/Table.js.map +1 -1
  51. package/dist/TableCell.js +2 -2
  52. package/dist/TableHeaderCell.js +2 -2
  53. package/dist/TableHeaderRow.js +1 -1
  54. package/dist/TableRow.js +1 -1
  55. package/dist/TextEditor.js +1 -0
  56. package/dist/TextEditor.js.map +1 -1
  57. package/dist/TextEditor.vue.d.ts +6 -1
  58. package/dist/Textarea.js.map +1 -1
  59. package/dist/components.css +1 -1
  60. package/dist/directives/autofocus.js +2 -2
  61. package/dist/directives/autofocus.js.map +1 -1
  62. package/dist/directives/sticky.js.map +1 -1
  63. package/dist/index.js.map +1 -1
  64. package/dist/locale.js +3 -2
  65. package/dist/locale.js.map +1 -1
  66. package/dist/tailwind-base.js +0 -2
  67. package/dist/tailwind-base.js.map +1 -1
  68. package/dist/useModals.js.map +1 -1
  69. package/dist/usePaginationStats-d_q39naC.js +12 -0
  70. package/dist/usePaginationStats-d_q39naC.js.map +1 -0
  71. package/dist/useSelection.js +4 -1
  72. package/dist/useSelection.js.map +1 -1
  73. package/dist/useValidation.js +39 -36
  74. package/dist/useValidation.js.map +1 -1
  75. package/dist/utils/helpers.js +29 -29
  76. package/dist/utils/helpers.js.map +1 -1
  77. package/package.json +27 -5
  78. package/tailwind-base.ts +0 -2
  79. package/types/jsonApi.ts +8 -8
  80. package/dist/DataView.keys-C7eaZg2G.js.map +0 -1
@@ -1,17 +1,18 @@
1
- import { defineComponent as M, inject as $, ref as j, computed as k, onBeforeMount as U, openBlock as o, createElementBlock as s, normalizeClass as W, unref as e, createElementVNode as y, createBlock as F, createCommentVNode as n, renderSlot as J, toDisplayString as K, Fragment as L, createVNode as r, withCtx as x } from "vue";
2
- import { t as S } from "./locale.js";
3
- import _ from "./Button.js";
4
- import O from "./Checkbox.js";
1
+ import { defineComponent as $, inject as j, ref as M, computed as U, onBeforeMount as W, openBlock as a, createElementBlock as l, normalizeClass as F, unref as e, createElementVNode as h, createBlock as J, createCommentVNode as s, renderSlot as K, toDisplayString as L, Fragment as O, createVNode as i, withCtx as v } from "vue";
2
+ import { u as q } from "./usePaginationStats-d_q39naC.js";
3
+ import { t as n } from "./locale.js";
4
+ import x from "./Button.js";
5
+ import G from "./Checkbox.js";
5
6
  import "lodash-es/cloneDeep";
6
- import C from "./Icon.js";
7
- import { D as B } from "./DataView.keys-C7eaZg2G.js";
8
- const q = { class: "tw-flex tw-place-items-center" }, G = { class: "tw-flex tw-items-center tw-gap-x-2 lg:tw-gap-x-6" }, H = {
7
+ import k from "./Icon.js";
8
+ import { D as y } from "./DataView.keys-aSOnA4AD.js";
9
+ const H = { class: "tw-flex tw-place-items-center" }, Q = { class: "tw-flex tw-items-center tw-gap-x-2 lg:tw-gap-x-6" }, X = {
9
10
  key: 0,
10
11
  class: "tw-flex tw-items-center"
11
- }, Q = {
12
+ }, Y = {
12
13
  key: 0,
13
14
  class: "tw-mr-1.5"
14
- }, le = /* @__PURE__ */ M({
15
+ }, ne = /* @__PURE__ */ $({
15
16
  __name: "DataViewToolbar",
16
17
  props: {
17
18
  allRowsSelected: { type: Boolean, default: !1 },
@@ -21,96 +22,96 @@ const q = { class: "tw-flex tw-place-items-center" }, G = { class: "tw-flex tw-i
21
22
  hasTabsAbove: { type: Boolean, default: !1 }
22
23
  },
23
24
  emits: ["select"],
24
- setup(E, { emit: P }) {
25
- const t = E, V = P, {
26
- isWithinModule: d,
25
+ setup(S, { emit: _ }) {
26
+ const t = S, C = _, {
27
+ isWithinModule: r,
27
28
  variant: m,
28
29
  density: p,
29
- currentPage: l,
30
+ currentPage: d,
30
31
  hasToolbar: w,
31
- isPaginationEnabled: N,
32
- isSelectable: R,
32
+ isPaginateNextDisabled: B,
33
+ isPaginationEnabled: P,
34
+ isSelectable: E,
33
35
  pageCount: f,
34
- pageSize: v,
35
- totalDataCount: b,
36
- goPrevPage: T,
37
- goNextPage: z,
38
- isEmpty: A,
39
- isLoading: D
40
- } = $(B.key, B.defaults), h = j(0), i = k(() => t.radius ? t.radius : d.value ? "none" : m.value === "table" ? t.hasTabsAbove ? "rounded-top-right" : "rounded-top" : "rounded"), I = k(() => {
41
- const u = v.value * (l.value - 1) + 1, a = Math.min(v.value * l.value, b.value), c = b.value;
42
- return S("ll.pageStats", { from: u, to: a, total: c });
43
- });
36
+ pageSize: N,
37
+ totalDataCount: V,
38
+ goPrevPage: D,
39
+ goNextPage: R,
40
+ isEmpty: T,
41
+ isLoading: u
42
+ } = j(y.key, y.defaults), b = M(0), c = U(() => t.radius ? t.radius : r.value ? "none" : m.value === "table" ? t.hasTabsAbove ? "rounded-top-right" : "rounded-top" : "rounded"), z = q({ currentPage: d, pageSize: N, totalItems: V });
44
43
  function g() {
45
- V("select"), h.value++;
44
+ C("select"), b.value++;
46
45
  }
47
- return U(() => {
46
+ return W(() => {
48
47
  w && (w.value = !0);
49
- }), (u, a) => (o(), s("div", {
50
- class: W(["stash-data-view-toolbar tw-flex tw-min-h-15 tw-items-center tw-justify-between tw-bg-white tw-py-1.5 tw-shadow", {
51
- "tw-border-t tw-border-ice-200": e(d),
52
- "tw-rounded-tr": i.value === "rounded-top-right",
53
- "tw-rounded": i.value === "rounded",
54
- "tw-rounded-t": i.value === "rounded-top",
55
- "tw-mb-3": e(m) !== "table" && !e(d),
48
+ }), (A, o) => (a(), l("div", {
49
+ class: F(["stash-data-view-toolbar tw-flex tw-min-h-15 tw-items-center tw-justify-between tw-bg-white tw-py-1.5 tw-shadow", {
50
+ "tw-border-t tw-border-ice-200": e(r),
51
+ "tw-rounded-tr": c.value === "rounded-top-right",
52
+ "tw-rounded": c.value === "rounded",
53
+ "tw-rounded-t": c.value === "rounded-top",
54
+ "tw-mb-3": e(m) !== "table" && !e(r),
56
55
  "tw-px-0": e(p) === "compact",
57
56
  "lg:tw-px-3": e(p) === "comfortable"
58
57
  }]),
59
58
  "data-test": "stash-data-view-toolbar"
60
59
  }, [
61
- y("div", q, [
62
- e(R) && !e(A) ? (o(), F(O, {
63
- key: h.value,
60
+ h("div", H, [
61
+ e(E) && !e(T) ? (a(), J(G, {
62
+ key: b.value,
64
63
  checked: t.allRowsSelected,
65
64
  indeterminate: t.someRowsSelected && !t.allRowsSelected,
66
- title: e(S)("ll.selectAll"),
67
- disabled: e(D),
65
+ title: e(n)("ll.selectAll"),
66
+ disabled: e(u),
68
67
  "onUpdate:indeterminate": g,
69
68
  "onUpdate:checked": g
70
- }, null, 8, ["checked", "indeterminate", "title", "disabled"])) : n("", !0),
71
- y("div", G, [
72
- J(u.$slots, "default")
69
+ }, null, 8, ["checked", "indeterminate", "title", "disabled"])) : s("", !0),
70
+ h("div", Q, [
71
+ K(A.$slots, "default")
73
72
  ])
74
73
  ]),
75
- e(N) ? (o(), s("div", H, [
76
- t.hidePageStats ? n("", !0) : (o(), s("span", Q, K(I.value), 1)),
77
- e(f) > 1 ? (o(), s(L, { key: 1 }, [
78
- r(_, {
74
+ e(P) ? (a(), l("div", X, [
75
+ t.hidePageStats ? s("", !0) : (a(), l("span", Y, L(e(n)("ll.pageStats", e(z))), 1)),
76
+ e(f) > 1 ? (a(), l(O, { key: 1 }, [
77
+ i(x, {
79
78
  icon: "",
79
+ "aria-label": e(n)("ll.previous"),
80
80
  class: "tw-size-9 tw-p-1.5",
81
81
  "data-test": "button|prev-page",
82
- disabled: e(l) === 1,
83
- onClick: a[0] || (a[0] = (c) => e(T)({ shouldEmit: !0 }))
82
+ disabled: e(u) || e(d) === 1,
83
+ onClick: o[0] || (o[0] = (I) => e(D)({ shouldEmit: !0 }))
84
84
  }, {
85
- default: x(() => [
86
- r(C, {
85
+ default: v(() => [
86
+ i(k, {
87
87
  name: "chevron-left",
88
88
  size: "dense"
89
89
  })
90
90
  ]),
91
91
  _: 1
92
- }, 8, ["disabled"]),
93
- r(_, {
92
+ }, 8, ["aria-label", "disabled"]),
93
+ i(x, {
94
94
  icon: "",
95
+ "aria-label": e(n)("ll.next"),
95
96
  class: "tw-h-9 tw-w-9 tw-p-1.5",
96
97
  "data-test": "button|next-page",
97
- disabled: e(l) === e(f),
98
- onClick: a[1] || (a[1] = (c) => e(z)({ shouldEmit: !0 }))
98
+ disabled: e(u) || e(B) || e(d) === e(f),
99
+ onClick: o[1] || (o[1] = (I) => e(R)({ shouldEmit: !0 }))
99
100
  }, {
100
- default: x(() => [
101
- r(C, {
101
+ default: v(() => [
102
+ i(k, {
102
103
  name: "chevron-right",
103
104
  size: "dense"
104
105
  })
105
106
  ]),
106
107
  _: 1
107
- }, 8, ["disabled"])
108
- ], 64)) : n("", !0)
109
- ])) : n("", !0)
108
+ }, 8, ["aria-label", "disabled"])
109
+ ], 64)) : s("", !0)
110
+ ])) : s("", !0)
110
111
  ], 2));
111
112
  }
112
113
  });
113
114
  export {
114
- le as default
115
+ ne as default
115
116
  };
116
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 * When DataView has tabs above it, we need to remove the top left rounded corner\n */\n hasTabsAbove?: boolean;\n }\n\n const props = withDefaults(defineProps<DataViewToolbarProps>(), {\n allRowsSelected: false,\n hidePageStats: false,\n radius: undefined,\n someRowsSelected: false,\n hasTabsAbove: false,\n });\n\n const emit = 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 (props.radius) {\n return props.radius;\n }\n\n if (isWithinModule.value) {\n return 'none';\n }\n\n if (dataViewVariant.value === 'table') {\n if (props.hasTabsAbove) {\n return 'rounded-top-right';\n }\n\n return 'rounded-top';\n }\n\n return 'rounded';\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 tw-shadow\"\n :class=\"{\n 'tw-border-t tw-border-ice-200': isWithinModule,\n 'tw-rounded-tr': computedRadius === 'rounded-top-right',\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\">\n {{ pageStats }}\n </span>\n <template v-if=\"pageCount > 1\">\n <Button\n icon\n class=\"tw-size-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\" size=\"dense\" />\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\" size=\"dense\" />\n </Button>\n </template>\n </div>\n </div>\n</template>\n"],"names":["props","__props","emit","__emit","isWithinModule","dataViewVariant","density","currentPage","hasToolbar","isPaginationEnabled","isSelectable","pageCount","pageSize","totalDataCount","goPrevPage","goNextPage","isEmpty","isLoading","inject","DATA_VIEW_INJECTION","checkboxKey","ref","computedRadius","computed","pageStats","from","to","total","t","onSelect","onBeforeMount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwCE,UAAMA,IAAQC,GAQRC,IAAOC,GAIP;AAAA,MACJ,gBAAAC;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,MAC3CvB,EAAM,SACDA,EAAM,SAGXI,EAAe,QACV,SAGLC,EAAgB,UAAU,UACxBL,EAAM,eACD,sBAGF,gBAGF,SACR,GAGKwB,IAAYD,EAAS,MAAM;AAC/B,YAAME,IAAOb,EAAS,SAASL,EAAY,QAAQ,KAAK,GAClDmB,IAAK,KAAK,IAAId,EAAS,QAAQL,EAAY,OAAOM,EAAe,KAAK,GACtEc,IAAQd,EAAe;AAE7B,aAAOe,EAAE,gBAAgB,EAAE,MAAAH,GAAM,IAAAC,GAAI,OAAAC,GAAO;AAAA,IAAA,CAC7C;AAGD,aAASE,IAAW;AAClB,MAAA3B,EAAK,QAAQ,GAODkB,EAAA;AAAA,IAAA;AAGd,WAAAU,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 usePaginationStats from '../../composables/usePaginationStats/usePaginationStats';\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 * When DataView has tabs above it, we need to remove the top left rounded corner\n */\n hasTabsAbove?: boolean;\n }\n\n const props = withDefaults(defineProps<DataViewToolbarProps>(), {\n allRowsSelected: false,\n hidePageStats: false,\n radius: undefined,\n someRowsSelected: false,\n hasTabsAbove: false,\n });\n\n const emit = defineEmits<{\n (e: 'select'): void;\n }>();\n\n const {\n isWithinModule,\n variant: dataViewVariant,\n density,\n currentPage,\n hasToolbar,\n isPaginateNextDisabled,\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 (props.radius) {\n return props.radius;\n }\n\n if (isWithinModule.value) {\n return 'none';\n }\n\n if (dataViewVariant.value === 'table') {\n if (props.hasTabsAbove) {\n return 'rounded-top-right';\n }\n\n return 'rounded-top';\n }\n\n return 'rounded';\n });\n\n const pageStats = usePaginationStats({ currentPage, pageSize, totalItems: totalDataCount });\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 tw-shadow\"\n :class=\"{\n 'tw-border-t tw-border-ice-200': isWithinModule,\n 'tw-rounded-tr': computedRadius === 'rounded-top-right',\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\">\n {{ t('ll.pageStats', pageStats) }}\n </span>\n <template v-if=\"pageCount > 1\">\n <Button\n icon\n :aria-label=\"t('ll.previous')\"\n class=\"tw-size-9 tw-p-1.5\"\n data-test=\"button|prev-page\"\n :disabled=\"isLoading || currentPage === 1\"\n @click=\"goPrevPage({ shouldEmit: true })\"\n >\n <Icon name=\"chevron-left\" size=\"dense\" />\n </Button>\n <Button\n icon\n :aria-label=\"t('ll.next')\"\n class=\"tw-h-9 tw-w-9 tw-p-1.5\"\n data-test=\"button|next-page\"\n :disabled=\"isLoading || isPaginateNextDisabled || currentPage === pageCount\"\n @click=\"goNextPage({ shouldEmit: true })\"\n >\n <Icon name=\"chevron-right\" size=\"dense\" />\n </Button>\n </template>\n </div>\n </div>\n</template>\n"],"names":["props","__props","emit","__emit","isWithinModule","dataViewVariant","density","currentPage","hasToolbar","isPaginateNextDisabled","isPaginationEnabled","isSelectable","pageCount","pageSize","totalDataCount","goPrevPage","goNextPage","isEmpty","isLoading","inject","DATA_VIEW_INJECTION","checkboxKey","ref","computedRadius","computed","pageStats","usePaginationStats","onSelect","onBeforeMount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyCE,UAAMA,IAAQC,GAQRC,IAAOC,GAIP;AAAA,MACJ,gBAAAC;AAAA,MACA,SAASC;AAAA,MACT,SAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,wBAAAC;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,MAC3CxB,EAAM,SACDA,EAAM,SAGXI,EAAe,QACV,SAGLC,EAAgB,UAAU,UACxBL,EAAM,eACD,sBAGF,gBAGF,SACR,GAEKyB,IAAYC,EAAmB,EAAE,aAAAnB,GAAa,UAAAM,GAAU,YAAYC,GAAgB;AAE1F,aAASa,IAAW;AAClB,MAAAzB,EAAK,QAAQ,GAODmB,EAAA;AAAA,IAAA;AAGd,WAAAO,EAAc,MAAM;AAClB,MAAIpB,MACFA,EAAW,QAAQ;AAAA,IACrB,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/Dropdown.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as I, ref as r, useCssModule as q, watch as C, onMounted as K, onBeforeUnmount as R, computed as U, withDirectives as _, openBlock as m, createElementBlock as k, renderSlot as x, createElementVNode as E, normalizeClass as b, createTextVNode as V, toDisplayString as W, createVNode as S, createBlock as Y, Transition as F, withCtx as j, unref as M, normalizeStyle as G, vShow as H, nextTick as A } from "vue";
2
- import { KEY_CODES as d } from "./constants.js";
2
+ import { KEY_CODES as f } from "./constants.js";
3
3
  import J from "./directives/clickoutside.js";
4
4
  import Q from "./utils/calculateElementOverflow.js";
5
5
  import { getMountPoint as X } from "./utils/helpers.js";
@@ -22,7 +22,7 @@ const ee = ["aria-expanded"], te = {
22
22
  },
23
23
  emits: ["toggle", "dismiss"],
24
24
  setup(D, { expose: $, emit: L }) {
25
- const a = D, p = L, t = r(null), w = r(null), f = [], s = r(f), i = r(-1), l = r(!1), g = r({}), T = q();
25
+ const a = D, p = L, t = r(null), w = r(null), d = [], s = r(d), i = r(-1), l = r(!1), g = r({}), T = q();
26
26
  C(l, (e) => {
27
27
  e || (i.value = -1), p("toggle", e);
28
28
  }), C(i, (e, o) => {
@@ -33,7 +33,7 @@ const ee = ["aria-expanded"], te = {
33
33
  const c = X();
34
34
  t.value && c.appendChild(t.value);
35
35
  }
36
- (e = t.value) != null && e.querySelector(".stash-menu") ? s.value = ((o = t.value) == null ? void 0 : o.querySelectorAll(".stash-menu-item")) ?? f : s.value = ((n = t.value) == null ? void 0 : n.querySelectorAll(".dropdown__item")) ?? f, window.addEventListener("resize", () => u());
36
+ (e = t.value) != null && e.querySelector(".stash-menu") ? s.value = ((o = t.value) == null ? void 0 : o.querySelectorAll(".stash-menu-item")) ?? d : s.value = ((n = t.value) == null ? void 0 : n.querySelectorAll(".dropdown__item")) ?? d, window.addEventListener("resize", () => u());
37
37
  }), R(() => {
38
38
  var e, o;
39
39
  window.removeEventListener("resize", () => u()), (o = (e = t == null ? void 0 : t.value) == null ? void 0 : e.parentNode) == null || o.removeChild(t.value);
@@ -50,14 +50,14 @@ const ee = ["aria-expanded"], te = {
50
50
  l.value ? l.value = !1 : (l.value = !0, await z(), (e = t.value) == null || e.focus());
51
51
  }
52
52
  function N(e) {
53
- if (e.keyCode === d.ESCAPE)
53
+ if (e.keyCode === f.ESCAPE)
54
54
  u();
55
- else if (e.keyCode === d.DOWN && i.value < s.value.length - 1)
56
- l.value && i.value++;
57
- else if (e.keyCode === d.UP && i.value > -1)
58
- l.value && i.value--;
59
- else if (e.keyCode === d.ENTER && i.value !== -1)
60
- l.value && s[i.value].click();
55
+ else if (e.keyCode === f.DOWN && i.value < s.value.length - 1 && l.value)
56
+ i.value++;
57
+ else if (e.keyCode === f.UP && i.value > -1 && l.value)
58
+ i.value--;
59
+ else if (e.keyCode === f.ENTER && i.value !== -1 && l.value)
60
+ s[i.value].click();
61
61
  else
62
62
  return;
63
63
  e.preventDefault();
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.js","sources":["../src/components/Dropdown/Dropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, nextTick, onBeforeUnmount, onMounted, ref, useCssModule, watch } from 'vue';\n\n import { KEY_CODES } from '../../constants';\n import vClickoutside from '../../directives/clickoutside/clickoutside';\n import calculateElementOverflow from '../../utils/calculateElementOverflow';\n import { getMountPoint } from '../../utils/helpers';\n import Icon from '../Icon/Icon.vue';\n\n export type DropdownOffset = {\n x?: number;\n y?: number;\n };\n\n export interface DropdownProps {\n /**\n * Used to position the dropdown relative to target\n * Options: left, right\n */\n align?: 'left' | 'right';\n /**\n * When passed, text with caret is displayed instead of default kebab menu.\n */\n label?: string;\n /**\n * If true, dropdown will remain open when clicking on its content. Otherwise, it'll close automatically on click.\n */\n closeManually?: boolean;\n /**\n * Used to horizontally and vertically offset the dropdown in pixels\n * Keep in mind, `x` value is relative to `align` value.\n */\n offset?: DropdownOffset;\n /**\n * If `reattach` is true, the contents will be mounted in the mount point container,\n * so as to circumvent clipping issues from a parent's overflow property.\n */\n reattach?: boolean;\n /**\n * Custom class to apply to the default dropdown content element\n */\n contentClass?: string | string[];\n /**\n * Removes content container's max width\n */\n fluidContent?: boolean;\n }\n\n type DropdownStyles = {\n left?: string;\n right?: string;\n top?: string;\n };\n\n defineOptions({\n name: 'll-dropdown',\n });\n\n const props = withDefaults(defineProps<DropdownProps>(), {\n align: 'right',\n label: '',\n closeManually: false,\n offset: () => ({}),\n reattach: true,\n contentClass: '',\n fluidContent: false,\n });\n\n const emit = defineEmits<{\n toggle: [isActive: boolean];\n dismiss: [];\n }>();\n\n const contentRef = ref<HTMLElement | null>(null);\n const dropdownRef = ref<HTMLDivElement | null>(null);\n\n const DEFAULT_ITEMS_LIST = [] as unknown as NodeListOf<Element>;\n\n const items = ref<NodeListOf<Element>>(DEFAULT_ITEMS_LIST);\n const itemIndex = ref(-1);\n const isActive = ref(false);\n\n const styles = ref<DropdownStyles>({});\n const classes = useCssModule();\n\n watch(isActive, (val) => {\n if (!val) {\n itemIndex.value = -1;\n }\n\n emit('toggle', val);\n });\n\n watch(itemIndex, (next, prev) => {\n next in items.value && items.value[next].classList.add('tw-bg-ice-200');\n prev in items.value && items.value[prev].classList.remove('tw-bg-ice-200');\n });\n\n onMounted(() => {\n if (props.reattach) {\n const target = getMountPoint();\n\n contentRef.value && target.appendChild(contentRef.value);\n }\n\n // if stash-menu exists, use it's items\n if (contentRef.value?.querySelector('.stash-menu')) {\n items.value = contentRef.value?.querySelectorAll('.stash-menu-item') ?? DEFAULT_ITEMS_LIST;\n } else {\n items.value = contentRef.value?.querySelectorAll('.dropdown__item') ?? DEFAULT_ITEMS_LIST;\n }\n\n // avoid calling dismiss with ResizeEvent because it's target is the Window element and it's not a valid Node element to be passed to dismiss\n window.addEventListener('resize', () => dismiss());\n });\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', () => dismiss());\n contentRef?.value?.parentNode?.removeChild(contentRef.value);\n });\n\n /**\n * Dismisses the Dropdown.\n */\n function dismiss(event?: Event) {\n if (\n props.closeManually &&\n (contentRef.value?.contains(event?.target as HTMLElement) || contentRef.value === event?.target)\n ) {\n return;\n }\n\n const wasOpen = isActive.value;\n\n isActive.value = false;\n\n if (wasOpen) {\n emit('dismiss');\n }\n }\n\n /**\n * Opens or closes the Dropdown. If opening, positions and focuses its content.\n */\n async function toggle() {\n if (isActive.value) {\n isActive.value = false;\n } else {\n isActive.value = true;\n await calculateOffset();\n contentRef.value?.focus();\n }\n }\n\n /**\n * Handles all user keyboard input on the Dropdown.\n * @param {KeyboardEvent} e The native keydown event.\n */\n function onKeyDown(e: KeyboardEvent) {\n if (e.keyCode === KEY_CODES.ESCAPE) {\n dismiss();\n } else if (e.keyCode === KEY_CODES.DOWN && itemIndex.value < items.value.length - 1) {\n isActive.value && itemIndex.value++;\n } else if (e.keyCode === KEY_CODES.UP && itemIndex.value > -1) {\n isActive.value && itemIndex.value--;\n } else if (e.keyCode === KEY_CODES.ENTER && itemIndex.value !== -1) {\n isActive.value && items[itemIndex.value].click();\n } else {\n return;\n }\n\n e.preventDefault(); // if keyDown did something / we didn't return\n }\n\n /**\n * Reset any page overflow offset\n */\n function resetOffset() {\n contentRef.value?.style.setProperty('--offset', '0');\n }\n\n /**\n * Calculate the position for the Dropdown content element,\n * relative to the viewport.\n * Repositions the dropdown content element (& arrow)\n * if it overflows the page (including gutter).\n */\n async function calculateOffset() {\n await nextTick();\n\n const toggleBCR = dropdownRef.value?.getBoundingClientRect() || ({} as DOMRect);\n const top = toggleBCR.top + toggleBCR.height;\n const offset = {\n x: 0,\n y: 0,\n ...props.offset,\n };\n\n if (props.reattach) {\n styles.value = {\n left: props.align === 'left' ? `${Math.round(toggleBCR.left) + offset.x}px` : undefined,\n right:\n props.align === 'right'\n ? `${document.documentElement.clientWidth - Math.round(toggleBCR.right) + offset.x}px`\n : undefined,\n top: `${window.scrollY + top + offset.y}px`,\n };\n await nextTick(); // wait for style updates to sync in the DOM\n }\n\n const overflow = calculateElementOverflow(contentRef?.value);\n\n if (overflow) {\n const direction = props.align === 'left' ? '-' : '';\n contentRef.value?.style.setProperty('--offset', `${direction}${overflow.value}`);\n }\n }\n\n defineExpose({\n isActive: computed(() => isActive.value),\n toggle,\n dismiss,\n });\n</script>\n\n<template>\n <div\n ref=\"dropdownRef\"\n v-clickoutside=\"dismiss\"\n class=\"tw-relative tw-inline-block\"\n data-test=\"ll-dropdown\"\n @keydown=\"onKeyDown\"\n >\n <!-- @slot Toggle component slot, receives `toggle` method to trigger Dropdown display -->\n <slot name=\"toggle\" :is-active=\"isActive\" :toggle=\"toggle\">\n <button\n data-test=\"button|toggle\"\n :aria-expanded=\"isActive\"\n :class=\"[label ? 'tw-min-w-auto tw-outline-none' : 'tw-rounded tw-p-3']\"\n @click=\"toggle\"\n >\n <span v-if=\"label\" class=\"tw-flex tw-items-center tw-font-medium tw-text-blue-500 hover:tw-text-blue-700\">\n {{ label }}\n <Icon name=\"caret-down\" />\n </span>\n <Icon v-else name=\"ellipsis\" />\n </button>\n </slot>\n\n <transition name=\"fade\" @after-leave=\"resetOffset\">\n <div\n v-show=\"isActive\"\n ref=\"contentRef\"\n data-test=\"ll-dropdown-content\"\n :class=\"[\n classes.content,\n contentClass,\n {\n 'tw-left-0 after:tw-left-6': props.align === 'left',\n 'tw-right-0': props.align === 'right',\n 'tw-max-w-[360px]': !props.fluidContent,\n },\n ]\"\n :style=\"styles\"\n >\n <!-- @slot Dropdown content slot. Receives `dismiss` method, to trigger manual close. You must call dismiss with parentheses. Receives `is-active` prop. -->\n <slot :dismiss=\"dismiss\" :is-active=\"isActive\"></slot>\n </div>\n </transition>\n </div>\n</template>\n\n<style module>\n .content {\n --offset: 0;\n\n @apply tw-shadow-2xl\n tw-bg-white\n tw-border\n tw-border-solid\n tw-border-blue-500\n tw-rounded\n tw-absolute\n tw-z-[301]\n tw-min-w-[200px];\n\n transform: translateX(calc(var(--offset) * 1px));\n }\n\n /**\n * TODO: these global styles should be componentized in https://leaflink.atlassian.net/browse/STASH-566\n */\n :global(.dropdown__list) {\n @apply tw-bg-white tw-list-none tw-m-1.5 tw-p-0;\n }\n\n :global(.dropdown__item) {\n @apply tw-block tw-mx-0 tw-mt-0 tw-mb-1.5 tw-w-full first:tw-mt-0 last:tw-mb-0;\n }\n\n :global(.dropdown__item) button {\n @apply tw-border-none tw-text-left tw-p-1.5;\n }\n\n :global(.dropdown__item) :where(a, button) {\n @apply tw-rounded\n tw-text-ice-700\n tw-block\n tw-py-[10px]\n tw-px-1.5\n tw-w-full\n disabled:tw-text-ice-500\n disabled:tw-cursor-default\n hover:tw-bg-ice-200\n hover:tw-text-ice-700\n hover:tw-no-underline\n tw-transition-all\n tw-duration-fast\n tw-ease-swing;\n }\n</style>\n"],"names":["props","__props","emit","__emit","contentRef","ref","dropdownRef","DEFAULT_ITEMS_LIST","items","itemIndex","isActive","styles","classes","useCssModule","watch","val","next","prev","onMounted","target","getMountPoint","_a","_b","_c","dismiss","onBeforeUnmount","event","wasOpen","toggle","calculateOffset","onKeyDown","KEY_CODES","resetOffset","nextTick","toggleBCR","top","offset","overflow","calculateElementOverflow","direction","__expose","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0DE,UAAMA,IAAQ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C,OAAO;AAAA,QAC9E,OACEpC,EAAM,UAAU,UACZ,GAAG,SAAS,gBAAgB,cAAc,KAAK,MAAMkC,EAAU,KAAK,IAAIE,EAAO,CAAC,OAChF;AAAA,QACN,KAAK,GAAG,OAAO,UAAUD,IAAMC,EAAO,CAAC;AAAA,MACzC,GACA,MAAMH,EAAS;AAGX,YAAAI,IAAWC,EAAyBlC,KAAA,gBAAAA,EAAY,KAAK;AAE3D,UAAIiC,GAAU;AACZ,cAAME,IAAYvC,EAAM,UAAU,SAAS,MAAM;AACtC,SAAAsB,IAAAlB,EAAA,UAAA,QAAAkB,EAAO,MAAM,YAAY,YAAY,GAAGiB,CAAS,GAAGF,EAAS,KAAK;AAAA,MAAE;AAAA,IACjF;AAGW,WAAAG,EAAA;AAAA,MACX,UAAUC,EAAS,MAAM/B,EAAS,KAAK;AAAA,MACvC,QAAAkB;AAAA,MACA,SAAAJ;AAAA,IAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Dropdown.js","sources":["../src/components/Dropdown/Dropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, nextTick, onBeforeUnmount, onMounted, ref, useCssModule, watch } from 'vue';\n\n import { KEY_CODES } from '../../constants';\n import vClickoutside from '../../directives/clickoutside/clickoutside';\n import calculateElementOverflow from '../../utils/calculateElementOverflow';\n import { getMountPoint } from '../../utils/helpers';\n import Icon from '../Icon/Icon.vue';\n\n export type DropdownOffset = {\n x?: number;\n y?: number;\n };\n\n export interface DropdownProps {\n /**\n * Used to position the dropdown relative to target\n * Options: left, right\n */\n align?: 'left' | 'right';\n /**\n * When passed, text with caret is displayed instead of default kebab menu.\n */\n label?: string;\n /**\n * If true, dropdown will remain open when clicking on its content. Otherwise, it'll close automatically on click.\n */\n closeManually?: boolean;\n /**\n * Used to horizontally and vertically offset the dropdown in pixels\n * Keep in mind, `x` value is relative to `align` value.\n */\n offset?: DropdownOffset;\n /**\n * If `reattach` is true, the contents will be mounted in the mount point container,\n * so as to circumvent clipping issues from a parent's overflow property.\n */\n reattach?: boolean;\n /**\n * Custom class to apply to the default dropdown content element\n */\n contentClass?: string | string[];\n /**\n * Removes content container's max width\n */\n fluidContent?: boolean;\n }\n\n type DropdownStyles = {\n left?: string;\n right?: string;\n top?: string;\n };\n\n defineOptions({\n name: 'll-dropdown',\n });\n\n const props = withDefaults(defineProps<DropdownProps>(), {\n align: 'right',\n label: '',\n closeManually: false,\n offset: () => ({}),\n reattach: true,\n contentClass: '',\n fluidContent: false,\n });\n\n const emit = defineEmits<{\n toggle: [isActive: boolean];\n dismiss: [];\n }>();\n\n const contentRef = ref<HTMLElement | null>(null);\n const dropdownRef = ref<HTMLDivElement | null>(null);\n\n const DEFAULT_ITEMS_LIST = [] as unknown as NodeListOf<Element>;\n\n const items = ref<NodeListOf<Element>>(DEFAULT_ITEMS_LIST);\n const itemIndex = ref(-1);\n const isActive = ref(false);\n\n const styles = ref<DropdownStyles>({});\n const classes = useCssModule();\n\n watch(isActive, (val) => {\n if (!val) {\n itemIndex.value = -1;\n }\n\n emit('toggle', val);\n });\n\n watch(itemIndex, (next, prev) => {\n if (next in items.value) {\n items.value[next].classList.add('tw-bg-ice-200');\n }\n if (prev in items.value) {\n items.value[prev].classList.remove('tw-bg-ice-200');\n }\n });\n\n onMounted(() => {\n if (props.reattach) {\n const target = getMountPoint();\n\n if (contentRef.value) {\n target.appendChild(contentRef.value);\n }\n }\n\n // if stash-menu exists, use it's items\n if (contentRef.value?.querySelector('.stash-menu')) {\n items.value = contentRef.value?.querySelectorAll('.stash-menu-item') ?? DEFAULT_ITEMS_LIST;\n } else {\n items.value = contentRef.value?.querySelectorAll('.dropdown__item') ?? DEFAULT_ITEMS_LIST;\n }\n\n // avoid calling dismiss with ResizeEvent because it's target is the Window element and it's not a valid Node element to be passed to dismiss\n window.addEventListener('resize', () => dismiss());\n });\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', () => dismiss());\n contentRef?.value?.parentNode?.removeChild(contentRef.value);\n });\n\n /**\n * Dismisses the Dropdown.\n */\n function dismiss(event?: Event) {\n if (\n props.closeManually &&\n (contentRef.value?.contains(event?.target as HTMLElement) || contentRef.value === event?.target)\n ) {\n return;\n }\n\n const wasOpen = isActive.value;\n\n isActive.value = false;\n\n if (wasOpen) {\n emit('dismiss');\n }\n }\n\n /**\n * Opens or closes the Dropdown. If opening, positions and focuses its content.\n */\n async function toggle() {\n if (isActive.value) {\n isActive.value = false;\n } else {\n isActive.value = true;\n await calculateOffset();\n contentRef.value?.focus();\n }\n }\n\n /**\n * Handles all user keyboard input on the Dropdown.\n * @param {KeyboardEvent} e The native keydown event.\n */\n function onKeyDown(e: KeyboardEvent) {\n if (e.keyCode === KEY_CODES.ESCAPE) {\n dismiss();\n } else if (e.keyCode === KEY_CODES.DOWN && itemIndex.value < items.value.length - 1 && isActive.value) {\n itemIndex.value++;\n } else if (e.keyCode === KEY_CODES.UP && itemIndex.value > -1 && isActive.value) {\n itemIndex.value--;\n } else if (e.keyCode === KEY_CODES.ENTER && itemIndex.value !== -1 && isActive.value) {\n items[itemIndex.value].click();\n } else {\n return;\n }\n\n e.preventDefault(); // if keyDown did something / we didn't return\n }\n\n /**\n * Reset any page overflow offset\n */\n function resetOffset() {\n contentRef.value?.style.setProperty('--offset', '0');\n }\n\n /**\n * Calculate the position for the Dropdown content element,\n * relative to the viewport.\n * Repositions the dropdown content element (& arrow)\n * if it overflows the page (including gutter).\n */\n async function calculateOffset() {\n await nextTick();\n\n const toggleBCR = dropdownRef.value?.getBoundingClientRect() || ({} as DOMRect);\n const top = toggleBCR.top + toggleBCR.height;\n const offset = {\n x: 0,\n y: 0,\n ...props.offset,\n };\n\n if (props.reattach) {\n styles.value = {\n left: props.align === 'left' ? `${Math.round(toggleBCR.left) + offset.x}px` : undefined,\n right:\n props.align === 'right'\n ? `${document.documentElement.clientWidth - Math.round(toggleBCR.right) + offset.x}px`\n : undefined,\n top: `${window.scrollY + top + offset.y}px`,\n };\n await nextTick(); // wait for style updates to sync in the DOM\n }\n\n const overflow = calculateElementOverflow(contentRef?.value);\n\n if (overflow) {\n const direction = props.align === 'left' ? '-' : '';\n contentRef.value?.style.setProperty('--offset', `${direction}${overflow.value}`);\n }\n }\n\n defineExpose({\n isActive: computed(() => isActive.value),\n toggle,\n dismiss,\n });\n</script>\n\n<template>\n <div\n ref=\"dropdownRef\"\n v-clickoutside=\"dismiss\"\n class=\"tw-relative tw-inline-block\"\n data-test=\"ll-dropdown\"\n @keydown=\"onKeyDown\"\n >\n <!-- @slot Toggle component slot, receives `toggle` method to trigger Dropdown display -->\n <slot name=\"toggle\" :is-active=\"isActive\" :toggle=\"toggle\">\n <button\n data-test=\"button|toggle\"\n :aria-expanded=\"isActive\"\n :class=\"[label ? 'tw-min-w-auto tw-outline-none' : 'tw-rounded tw-p-3']\"\n @click=\"toggle\"\n >\n <span v-if=\"label\" class=\"tw-flex tw-items-center tw-font-medium tw-text-blue-500 hover:tw-text-blue-700\">\n {{ label }}\n <Icon name=\"caret-down\" />\n </span>\n <Icon v-else name=\"ellipsis\" />\n </button>\n </slot>\n\n <transition name=\"fade\" @after-leave=\"resetOffset\">\n <div\n v-show=\"isActive\"\n ref=\"contentRef\"\n data-test=\"ll-dropdown-content\"\n :class=\"[\n classes.content,\n contentClass,\n {\n 'tw-left-0 after:tw-left-6': props.align === 'left',\n 'tw-right-0': props.align === 'right',\n 'tw-max-w-[360px]': !props.fluidContent,\n },\n ]\"\n :style=\"styles\"\n >\n <!-- @slot Dropdown content slot. Receives `dismiss` method, to trigger manual close. You must call dismiss with parentheses. Receives `is-active` prop. -->\n <slot :dismiss=\"dismiss\" :is-active=\"isActive\"></slot>\n </div>\n </transition>\n </div>\n</template>\n\n<style module>\n .content {\n --offset: 0;\n\n @apply tw-shadow-2xl\n tw-bg-white\n tw-border\n tw-border-solid\n tw-border-blue-500\n tw-rounded\n tw-absolute\n tw-z-[301]\n tw-min-w-[200px];\n\n transform: translateX(calc(var(--offset) * 1px));\n }\n\n /**\n * TODO: these global styles should be componentized in https://leaflink.atlassian.net/browse/STASH-566\n */\n :global(.dropdown__list) {\n @apply tw-bg-white tw-list-none tw-m-1.5 tw-p-0;\n }\n\n :global(.dropdown__item) {\n @apply tw-block tw-mx-0 tw-mt-0 tw-mb-1.5 tw-w-full first:tw-mt-0 last:tw-mb-0;\n }\n\n :global(.dropdown__item) button {\n @apply tw-border-none tw-text-left tw-p-1.5;\n }\n\n :global(.dropdown__item) :where(a, button) {\n @apply tw-rounded\n tw-text-ice-700\n tw-block\n tw-py-[10px]\n tw-px-1.5\n tw-w-full\n disabled:tw-text-ice-500\n disabled:tw-cursor-default\n hover:tw-bg-ice-200\n hover:tw-text-ice-700\n hover:tw-no-underline\n tw-transition-all\n tw-duration-fast\n tw-ease-swing;\n }\n</style>\n"],"names":["props","__props","emit","__emit","contentRef","ref","dropdownRef","DEFAULT_ITEMS_LIST","items","itemIndex","isActive","styles","classes","useCssModule","watch","val","next","prev","onMounted","target","getMountPoint","_a","_b","_c","dismiss","onBeforeUnmount","event","wasOpen","toggle","calculateOffset","onKeyDown","KEY_CODES","resetOffset","nextTick","toggleBCR","top","offset","overflow","calculateElementOverflow","direction","__expose","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0DE,UAAMA,IAAQC,GAURC,IAAOC,GAKPC,IAAaC,EAAwB,IAAI,GACzCC,IAAcD,EAA2B,IAAI,GAE7CE,IAAqB,CAAC,GAEtBC,IAAQH,EAAyBE,CAAkB,GACnDE,IAAYJ,EAAI,EAAE,GAClBK,IAAWL,EAAI,EAAK,GAEpBM,IAASN,EAAoB,EAAE,GAC/BO,IAAUC,EAAa;AAEvB,IAAAC,EAAAJ,GAAU,CAACK,MAAQ;AACvB,MAAKA,MACHN,EAAU,QAAQ,KAGpBP,EAAK,UAAUa,CAAG;AAAA,IAAA,CACnB,GAEKD,EAAAL,GAAW,CAACO,GAAMC,MAA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AAM,YAAY,YAAY,GAAGiB,CAAS,GAAGF,EAAS,KAAK;AAAA,MAAE;AAAA,IACjF;AAGW,WAAAG,EAAA;AAAA,MACX,UAAUC,EAAS,MAAM/B,EAAS,KAAK;AAAA,MACvC,QAAAkB;AAAA,MACA,SAAAJ;AAAA,IAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js","sources":["../src/components/Field/Field.vue"],"sourcesContent":["<script lang=\"ts\">\n import { FieldProps } from './Field.types';\n\n export * from './Field.types';\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, useAttrs, useSlots } from 'vue';\n\n import Label from '../Label/Label.vue';\n\n defineOptions({\n inheritAttrs: false,\n });\n\n const props = withDefaults(defineProps<FieldProps>(), {\n addBottomSpace: false,\n errorText: undefined,\n hintText: undefined,\n id: undefined,\n errorId: undefined,\n isRequired: false,\n label: undefined,\n showOptionalInLabel: false,\n fieldset: false,\n isDisabled: false,\n disabled: false,\n });\n const attrs = useAttrs();\n const slots = useSlots();\n const fieldId = computed(() => props.id || uniqueId('stash-field-'));\n const fieldErrorId = computed(() => props.errorId || uniqueId('stash-field-error-'));\n const labelId = computed(() => uniqueId('stash-field-label-'));\n const hasError = computed(() => !!props.errorText);\n const wrapperElement = computed(() => (props.fieldset ? 'fieldset' : 'div'));\n\n // Any attributes that are unique to form elements, you want to exclude from\n // being bound from the root element.\n const rootAttrs = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { placeholder, ...otherAttrs } = attrs;\n\n return otherAttrs;\n });\n</script>\n\n<template>\n <component\n :is=\"wrapperElement\"\n data-test=\"stash-field\"\n class=\"stash-field\"\n :class=\"[\n { 'tw-p-0': props.fieldset },\n { 'tw-mb-9': props.addBottomSpace && !props.errorText && !props.hintText && !slots.hint },\n { 'tw-mb-4': props.addBottomSpace && (props.errorText || props.hintText || slots.hint) },\n { 'stash-field--disabled': props.isDisabled || props.disabled },\n { 'stash-field--is-read-only': props.isReadOnly },\n { 'stash-field--is-required': props.isRequired },\n { 'stash-field--has-error': hasError },\n ]\"\n v-bind=\"rootAttrs\"\n >\n <Label\n v-if=\"props.label\"\n :id=\"labelId\"\n :for=\"fieldId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :show-optional=\"props.showOptionalInLabel\"\n :legend=\"props.fieldset\"\n :disabled=\"props.isDisabled || props.disabled\"\n >\n {{ props.label }}\n </Label>\n\n <!-- @slot for the form field; the Label can also be rendered here instead of using the label prop -->\n <slot\n :field-id=\"fieldId\"\n :field-error-id=\"fieldErrorId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :is-read-only=\"props.isReadOnly\"\n :disabled=\"props.isDisabled || props.disabled\"\n :label-id=\"labelId\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n ></slot>\n\n <span\n v-if=\"props.errorText\"\n :id=\"fieldErrorId\"\n class=\"stash-field-error tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs tw-text-red-500\"\n data-test=\"stash-field-error\"\n >\n {{ props.errorText }}\n </span>\n\n <span\n v-else-if=\"props.hintText && !props.isReadOnly\"\n class=\"stash-field-hint tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs\"\n data-test=\"stash-field-hint\"\n >\n {{ props.hintText }}\n </span>\n\n <div\n v-else-if=\"slots.hint && !props.isReadOnly\"\n class=\"stash-field-hint tw-mt-1 tw-whitespace-pre-line tw-text-xs\"\n data-test=\"stash-field-hint\"\n >\n <!-- @slot for displaying hint text below the field -->\n <slot name=\"hint\"></slot>\n </div>\n </component>\n</template>\n"],"names":["props","__props","attrs","useAttrs","slots","useSlots","fieldId","computed","uniqueId","fieldErrorId","labelId","hasError","wrapperElement","rootAttrs","placeholder","otherAttrs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBE,UAAMA,IAAQC,GAaRC,IAAQC,EAAS,GACjBC,IAAQC,EAAS,GACjBC,IAAUC,EAAS,MAAMP,EAAM,MAAMQ,EAAS,cAAc,CAAC,GAC7DC,IAAeF,EAAS,MAAMP,EAAM,WAAWQ,EAAS,oBAAoB,CAAC,GAC7EE,IAAUH,EAAS,MAAMC,EAAS,oBAAoB,CAAC,GACvDG,IAAWJ,EAAS,MAAM,CAAC,CAACP,EAAM,SAAS,GAC3CY,IAAiBL,EAAS,MAAOP,EAAM,WAAW,aAAa,KAAM,GAIrEa,IAAYN,EAAS,MAAM;AAE/B,YAAM,EAAE,aAAAO,GAAa,GAAGC,EAAA,IAAeb;AAEhC,aAAAa;AAAA,IAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js","sources":["../src/components/Field/Field.vue"],"sourcesContent":["<script lang=\"ts\">\n import { FieldProps } from './Field.types';\n\n export * from './Field.types';\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, useAttrs, useSlots } from 'vue';\n\n import Label from '../Label/Label.vue';\n\n defineOptions({\n inheritAttrs: false,\n });\n\n const props = withDefaults(defineProps<FieldProps>(), {\n addBottomSpace: false,\n errorText: undefined,\n hintText: undefined,\n id: undefined,\n errorId: undefined,\n isRequired: false,\n label: undefined,\n showOptionalInLabel: false,\n fieldset: false,\n isDisabled: false,\n disabled: false,\n });\n const attrs = useAttrs();\n const slots = useSlots();\n const fieldId = computed(() => props.id || uniqueId('stash-field-'));\n const fieldErrorId = computed(() => props.errorId || uniqueId('stash-field-error-'));\n const labelId = computed(() => uniqueId('stash-field-label-'));\n const hasError = computed(() => !!props.errorText);\n const wrapperElement = computed(() => (props.fieldset ? 'fieldset' : 'div'));\n\n // Any attributes that are unique to form elements, you want to exclude from\n // being bound from the root element.\n const rootAttrs = computed(() => {\n const { placeholder, ...otherAttrs } = attrs;\n\n return otherAttrs;\n });\n</script>\n\n<template>\n <component\n :is=\"wrapperElement\"\n data-test=\"stash-field\"\n class=\"stash-field\"\n :class=\"[\n { 'tw-p-0': props.fieldset },\n { 'tw-mb-9': props.addBottomSpace && !props.errorText && !props.hintText && !slots.hint },\n { 'tw-mb-4': props.addBottomSpace && (props.errorText || props.hintText || slots.hint) },\n { 'stash-field--disabled': props.isDisabled || props.disabled },\n { 'stash-field--is-read-only': props.isReadOnly },\n { 'stash-field--is-required': props.isRequired },\n { 'stash-field--has-error': hasError },\n ]\"\n v-bind=\"rootAttrs\"\n >\n <Label\n v-if=\"props.label\"\n :id=\"labelId\"\n :for=\"fieldId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :show-optional=\"props.showOptionalInLabel\"\n :legend=\"props.fieldset\"\n :disabled=\"props.isDisabled || props.disabled\"\n >\n {{ props.label }}\n </Label>\n\n <!-- @slot for the form field; the Label can also be rendered here instead of using the label prop -->\n <slot\n :field-id=\"fieldId\"\n :field-error-id=\"fieldErrorId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :is-read-only=\"props.isReadOnly\"\n :disabled=\"props.isDisabled || props.disabled\"\n :label-id=\"labelId\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n ></slot>\n\n <span\n v-if=\"props.errorText\"\n :id=\"fieldErrorId\"\n class=\"stash-field-error tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs tw-text-red-500\"\n data-test=\"stash-field-error\"\n >\n {{ props.errorText }}\n </span>\n\n <span\n v-else-if=\"props.hintText && !props.isReadOnly\"\n class=\"stash-field-hint tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs\"\n data-test=\"stash-field-hint\"\n >\n {{ props.hintText }}\n </span>\n\n <div\n v-else-if=\"slots.hint && !props.isReadOnly\"\n class=\"stash-field-hint tw-mt-1 tw-whitespace-pre-line tw-text-xs\"\n data-test=\"stash-field-hint\"\n >\n <!-- @slot for displaying hint text below the field -->\n <slot name=\"hint\"></slot>\n </div>\n </component>\n</template>\n"],"names":["props","__props","attrs","useAttrs","slots","useSlots","fieldId","computed","uniqueId","fieldErrorId","labelId","hasError","wrapperElement","rootAttrs","placeholder","otherAttrs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBE,UAAMA,IAAQC,GAaRC,IAAQC,EAAS,GACjBC,IAAQC,EAAS,GACjBC,IAAUC,EAAS,MAAMP,EAAM,MAAMQ,EAAS,cAAc,CAAC,GAC7DC,IAAeF,EAAS,MAAMP,EAAM,WAAWQ,EAAS,oBAAoB,CAAC,GAC7EE,IAAUH,EAAS,MAAMC,EAAS,oBAAoB,CAAC,GACvDG,IAAWJ,EAAS,MAAM,CAAC,CAACP,EAAM,SAAS,GAC3CY,IAAiBL,EAAS,MAAOP,EAAM,WAAW,aAAa,KAAM,GAIrEa,IAAYN,EAAS,MAAM;AAC/B,YAAM,EAAE,aAAAO,GAAa,GAAGC,EAAA,IAAeb;AAEhC,aAAAa;AAAA,IAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,7 +4,7 @@ import { t as C } from "./locale.js";
4
4
  import D from "./Button.js";
5
5
  import "lodash-es/cloneDeep";
6
6
  import "lodash-es/uniqueId";
7
- import { D as F } from "./DataView.keys-C7eaZg2G.js";
7
+ import { D as F } from "./DataView.keys-aSOnA4AD.js";
8
8
  import { D as G } from "./DataViewFilters.keys-BLu07FiP.js";
9
9
  import $ from "./Dropdown.js";
10
10
  import q from "./FilterChip.js";
@@ -1 +1 @@
1
- {"version":3,"file":"Filters.js","sources":["../src/components/Filters/Filters.vue"],"sourcesContent":["<script>\n import cloneDeep from 'lodash-es/cloneDeep';\n import merge from 'lodash-es/merge';\n import { nextTick, ref, toRefs } from 'vue';\n\n import useValidation from '../../composables/useValidation/useValidation';\n import { LLLV_CHANGE_TRIGGERS } from '../../constants';\n import { t } from '../../locale';\n import { persistentStorage } from '../../storage';\n import Button from '../Button/Button.vue';\n import Checkbox from '../Checkbox/Checkbox.vue';\n import DatePicker from '../DatePicker/DatePicker.vue';\n import Input from '../Input/Input.vue';\n import InputOptions from '../InputOptions/InputOptions.vue';\n import Radio from '../Radio/Radio.vue';\n import Select from '../Select/Select.vue';\n\n export default {\n name: 'll-filters',\n\n components: {\n 'll-button': Button,\n 'll-checkbox': Checkbox,\n 'll-input': Input,\n 'll-input-options': InputOptions,\n 'll-radio': Radio,\n 'll-select': Select,\n DatePicker,\n },\n\n props: {\n /**\n * Whether to disable the Apply button\n */\n disableApply: Boolean,\n /**\n * Whether to disable the Clear button\n */\n disableClear: Boolean,\n /**\n * Whether to disable the sticky filters\n * If disabled, a default pre-selected value(s) can be added to\n * the filter component's attributes\n */\n disablePersistency: Boolean,\n /**\n * Filters schema\n */\n schema: {\n type: Array,\n default: () => [],\n },\n /**\n * Validation schema function that returns an object\n */\n validationSchema: {\n type: Function,\n default: () => () => undefined,\n },\n },\n\n emits: ['change', 'submit', 'reset'],\n\n setup(props) {\n const { validationSchema: getValidationSchema } = toRefs(props);\n const validationSchema = getValidationSchema.value();\n const validationValues = ref({});\n\n // Without ref, `this.validation` will always evaluate to its initial value of `undefined` due to lack of reactivity.\n const validation = ref();\n\n function initValidation() {\n if (validationSchema?.toString() !== '[object Object]') {\n return;\n }\n\n validationValues.value = Object.keys(validationSchema).reduce((values, fieldName) => {\n values[fieldName] = undefined;\n\n return values;\n }, {});\n\n const validationRules = Object.entries(validationSchema).reduce((rules, [fieldName, fieldRules]) => {\n rules[fieldName] = fieldRules.map((fieldRule) => {\n return fieldRule(validationValues);\n });\n\n return rules;\n }, {});\n\n validation.value = useValidation({ rules: validationRules, values: validationValues });\n validation.value.validate();\n }\n\n return {\n validation,\n validationValues,\n initValidation,\n };\n },\n\n data() {\n return {\n applyText: t('ll.apply'),\n clearText: t('ll.clear'),\n filters: {},\n filterValues: {},\n forceRenderCount: 0,\n };\n },\n\n watch: {\n filterValues: {\n /**\n * Maps filters to a partcular object structure:\n * @param {IFilterSchemaItem} newFilterValues all selected filters\n * @returns {IFilter}\n */\n handler: function (newFilterValues) {\n const filters = Object.keys(newFilterValues).reduce((acc, i) => {\n const schema = this.schema[i];\n\n if (!schema || !schema.fieldToFilter) {\n return acc;\n }\n\n const item = newFilterValues[i];\n\n // Ignore empty string or undefined/null filter values\n if (item === '' || item == null) {\n return acc;\n }\n\n const trackBy = schema.attributes.trackBy || 'id';\n const isObject = typeof item === 'object';\n const isCustomFilterComponent = typeof schema.type === 'object';\n // TODO: remove handling of schema.attributes.multiple when we remove the vue-multiselect version of Select\n const isMultiple =\n (isCustomFilterComponent && schema.attributes.multiple) ||\n (!isCustomFilterComponent &&\n schema.type.includes('ll-select') &&\n (schema.attributes.multiple || !schema.attributes.single));\n const filterBy = isMultiple\n ? // local storage might have item stored as an object from the old Select\n (Array.isArray(item) ? item : [item]).map((v) => v[trackBy])\n : isObject\n ? [item[trackBy]]\n : [item];\n\n const groupedWith = schema.groupedWith;\n\n if (groupedWith) {\n filterBy[0] = {\n index: groupedWith,\n value: newFilterValues[groupedWith],\n };\n filterBy.push({\n index: Number(i),\n value: newFilterValues[i],\n });\n }\n\n filterBy.length &&\n (acc[schema.fieldToFilter] = {\n // don't add to `filters` if no filterBy\n filterBy,\n filterType: schema.type, // Informs the applied filter count\n isMultiple,\n ...('fn' in schema && { customFilter: schema.fn }),\n });\n\n return acc;\n }, {});\n\n this.filters = filters;\n this.$emit('change', filters);\n },\n\n deep: true,\n immediate: true,\n },\n\n filters() {\n if (this.validation) {\n this.updateValidationValues();\n }\n },\n },\n\n async created() {\n // initFilterValues updates the filterValues so using await nextTick() forces the code\n // after it to wait until nextTick is done, at which point the filterValues will\n // be done initializing. Otherwise, applyFilters sometimes applies the wrong\n // filters because filterValues is not done updating.\n this.initFilterValues();\n await nextTick();\n this.initValidation();\n this.applyFilters({ trigger: LLLV_CHANGE_TRIGGERS.LOAD });\n },\n\n methods: {\n initFilterValues() {\n if (this.disablePersistency) {\n this.filterValues = this.getDefaultFilterValues();\n\n return;\n }\n\n this.filterValues = this.getPersistentFilterValues() || this.getDefaultFilterValues();\n },\n\n /**\n * Apply the selected filters and save them to localStorage.\n * ListView calls this method using a ref to Filters.\n * The trigger option is used in ListView.\n * @param {object} [options] - optional parameters\n * @param {string} [options.trigger] - the action that triggered this function call\n */\n async applyFilters({ trigger = LLLV_CHANGE_TRIGGERS.APPLY } = {}) {\n if (this.validation) {\n await this.validation.validate();\n\n if (this.validation.hasErrors) {\n return;\n }\n }\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n this.$emit('submit', { trigger });\n },\n\n resetFilters() {\n this.filterValues = this.getDefaultFilterValues();\n\n this.forceRenderCount++;\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n // Emit after filters are updated\n this.$nextTick(() => {\n this.$emit('reset');\n });\n },\n\n /**\n * Returns pre-defined filter values to become the default values\n */\n getDefaultFilterValues() {\n return this.schema.reduce((acc, item, filterIndex) => {\n if (item.type === 'll-checkbox') {\n acc[filterIndex] = item.attributes.checked || false;\n } else if (Object.prototype.hasOwnProperty.call(item.attributes, 'modelValue')) {\n acc[filterIndex] = item.attributes.modelValue;\n }\n\n return acc;\n }, {});\n },\n\n /**\n * Intended for external use, when filter values need to be set for the user\n */\n setFilterValues(newValues) {\n this.filterValues = merge({}, this.filterValues, newValues);\n this.forceRenderCount++;\n },\n\n updateValidationValues() {\n const validatable = Object.keys(this.validationSchema());\n\n this.schema.forEach((fieldSchema, filterIndex) => {\n const fieldToFilter = fieldSchema.fieldToFilter;\n const validate = validatable.includes(fieldToFilter);\n\n if (validate) {\n const filter = this.filters[fieldToFilter];\n\n /**\n * Get all validatable fields.\n * Use parsed value of filters that are set,\n * otherwise fall back to `filterValue` value if not set.\n */\n const filterValue = filter\n ? filter.isMultiple\n ? filter.filterBy\n : filter.filterBy[0]\n : this.filterValues[filterIndex];\n\n this.validationValues[fieldToFilter] = filterValue;\n }\n });\n },\n\n /**\n * Change handler for filter fields\n */\n onChange(filter, filterValues, filterIndex) {\n if (filter.on?.change) {\n // Maps to `on.change` handlers in the filter schema.\n filter.on.change(filterValues, filterIndex);\n }\n },\n\n /**\n * Select input event handler for filter fields\n */\n onSelectInput(newValue, filter, filterIndex) {\n if (newValue === undefined) {\n delete this.filterValues[filterIndex]; // prevent undefined filterValues which cause an empty result list\n } else {\n this.filterValues[filterIndex] = newValue;\n }\n\n this.onChange(filter, this.filterValues, filterIndex);\n },\n\n /**\n * Get filter values from local storage.\n * @returns {any}\n */\n getPersistentFilterValues() {\n return persistentStorage.get('filter-values');\n },\n\n /**\n * Clone new filterValues to remove reactivity, and save them to localStorage.\n * @param {object} newValues - the filterValues to be persisted in localStorage\n */\n persistFilterValues(newValues) {\n persistentStorage.set('filter-values', cloneDeep(newValues));\n },\n },\n };\n</script>\n\n<template>\n <div class=\"tw-ll-grid tw-grid-cols-4 md:tw-grid-cols-12\">\n <template v-for=\"(filter, filterIndex) in schema\">\n <div\n v-if=\"!filter.hidden\"\n :key=\"`${filterIndex} ${forceRenderCount}`\"\n class=\"field-wrapper tw-col-span-4 md:tw-col-span-3\"\n :class=\"{ 'max-md:tw-hidden': !filter.type, 'tw-flex tw-items-end': filter.type === 'll-checkbox' }\"\n :data-test=\"`filter|${filter.fieldToFilter}`\"\n >\n <!-- Filter component -->\n <ll-select\n v-if=\"filter.type === 'll-select'\"\n v-bind=\"filter.attributes\"\n :error=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n :model-value=\"filterValues[filterIndex]\"\n @update:model-value=\"(newValue) => onSelectInput(newValue, filter, filterIndex)\"\n />\n <ll-checkbox\n v-else-if=\"filter.type === 'll-checkbox'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <ll-radio\n v-else-if=\"filter.type === 'll-radio'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <component\n v-bind=\"filter.attributes\"\n :is=\"filter.type\"\n v-else-if=\"filter.type\"\n v-model=\"filterValues[filterIndex]\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:model-value=\"onChange(filter, filterValues, filterIndex)\"\n >\n <template v-if=\"filter.slots && filter.slots.selected\" #selected=\"{ option }\">\n <component :is=\"filter.slots.selected\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.option\" #option=\"{ option }\">\n <component :is=\"filter.slots.option\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.prepend\" #prepend>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-html=\"filter.slots.prepend\"></span>\n </template>\n <template v-if=\"filter.slots && filter.slots.append\" #append>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-html=\"filter.slots.append\"></span>\n </template>\n </component>\n </div>\n </template>\n <div\n class=\"button-grid tw-col-span-4 tw-flex tw-items-end tw-justify-end md:tw-col-span-12\"\n :class=\"$style['filter-button-group']\"\n >\n <ll-button secondary data-test=\"button|reset-filters\" :disabled=\"disableClear\" @click=\"resetFilters\">\n {{ clearText }}\n </ll-button>\n <ll-button\n primary\n data-test=\"button|apply-filters\"\n :disabled=\"disableApply || validation?.hasErrors\"\n @click=\"applyFilters\"\n >\n {{ applyText }}\n </ll-button>\n </div>\n </div>\n</template>\n\n<style module>\n .filter-button-group {\n @media screen('max-md') {\n display: flex;\n flex-direction: column-reverse;\n }\n\n button {\n @media screen('max-md') {\n width: 100% !important;\n }\n\n &:nth-child(2) {\n @media screen('max-md') {\n margin-bottom: theme('spacing.3');\n }\n }\n }\n }\n</style>\n"],"names":["_sfc_main","Button","Checkbox","Input","InputOptions","Radio","Select","DatePicker","props","getValidationSchema","toRefs","validationSchema","validationValues","ref","validation","initValidation","values","fieldName","validationRules","rules","fieldRules","fieldRule","useValidation","t","newFilterValues","filters","acc","i","schema","item","trackBy","isObject","isCustomFilterComponent","isMultiple","filterBy","v","groupedWith","nextTick","LLLV_CHANGE_TRIGGERS","trigger","filterIndex","newValues","merge","validatable","fieldSchema","fieldToFilter","filter","filterValue","filterValues","_a","newValue","persistentStorage","cloneDeep","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_Fragment","_renderList","$props","_createCommentVNode","$data","_normalizeClass","_createBlock","_component_ll_select","_mergeProps","$setup","_b","$options","_component_ll_checkbox","$event","_c","_d","_component_ll_radio","_e","_f","_resolveDynamicComponent","_g","_h","_createSlots","_withCtx","option","_createElementVNode","_ctx","_createVNode","_component_ll_button","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;GAiBOA,KAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,aAAaC;AAAA,IACb,eAAeC;AAAA,IACf,YAAYC;AAAA,IACZ,oBAAoBC;AAAA,IACpB,YAAYC;AAAA,IACZ,aAAaC;AAAA,IACb,YAAAC;AAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,cAAc;AAAA;AAAA;AAAA;AAAA,IAId,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMd,oBAAoB;AAAA;AAAA;AAAA;AAAA,IAIpB,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAE;AAAA,IAClB;AAAA;AAAA;AAAA;AAAA,IAID,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS,MAAM,MAAA;AAAA;AAAA,IA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Ae;AAAA,UA9ZvBM,EAAAC,EA8ZW1B,EAAS,SAAA,GAAA,CAAA;AAAA;QA9ZpB,GAAA;AAAA;;;;;;;"}
1
+ {"version":3,"file":"Filters.js","sources":["../src/components/Filters/Filters.vue"],"sourcesContent":["<script>\n import cloneDeep from 'lodash-es/cloneDeep';\n import merge from 'lodash-es/merge';\n import { nextTick, ref, toRefs } from 'vue';\n\n import useValidation from '../../composables/useValidation/useValidation';\n import { LLLV_CHANGE_TRIGGERS } from '../../constants';\n import { t } from '../../locale';\n import { persistentStorage } from '../../storage';\n import Button from '../Button/Button.vue';\n import Checkbox from '../Checkbox/Checkbox.vue';\n import DatePicker from '../DatePicker/DatePicker.vue';\n import Input from '../Input/Input.vue';\n import InputOptions from '../InputOptions/InputOptions.vue';\n import Radio from '../Radio/Radio.vue';\n import Select from '../Select/Select.vue';\n\n export default {\n name: 'll-filters',\n\n components: {\n 'll-button': Button,\n 'll-checkbox': Checkbox,\n 'll-input': Input,\n 'll-input-options': InputOptions,\n 'll-radio': Radio,\n 'll-select': Select,\n DatePicker,\n },\n\n props: {\n /**\n * Whether to disable the Apply button\n */\n disableApply: Boolean,\n /**\n * Whether to disable the Clear button\n */\n disableClear: Boolean,\n /**\n * Whether to disable the sticky filters\n * If disabled, a default pre-selected value(s) can be added to\n * the filter component's attributes\n */\n disablePersistency: Boolean,\n /**\n * Filters schema\n */\n schema: {\n type: Array,\n default: () => [],\n },\n /**\n * Validation schema function that returns an object\n */\n validationSchema: {\n type: Function,\n default: () => () => undefined,\n },\n },\n\n emits: ['change', 'submit', 'reset'],\n\n setup(props) {\n const { validationSchema: getValidationSchema } = toRefs(props);\n const validationSchema = getValidationSchema.value();\n const validationValues = ref({});\n\n // Without ref, `this.validation` will always evaluate to its initial value of `undefined` due to lack of reactivity.\n const validation = ref();\n\n function initValidation() {\n if (validationSchema?.toString() !== '[object Object]') {\n return;\n }\n\n validationValues.value = Object.keys(validationSchema).reduce((values, fieldName) => {\n values[fieldName] = undefined;\n\n return values;\n }, {});\n\n const validationRules = Object.entries(validationSchema).reduce((rules, [fieldName, fieldRules]) => {\n rules[fieldName] = fieldRules.map((fieldRule) => {\n return fieldRule(validationValues);\n });\n\n return rules;\n }, {});\n\n validation.value = useValidation({ rules: validationRules, values: validationValues });\n validation.value.validate();\n }\n\n return {\n validation,\n validationValues,\n initValidation,\n };\n },\n\n data() {\n return {\n applyText: t('ll.apply'),\n clearText: t('ll.clear'),\n filters: {},\n filterValues: {},\n forceRenderCount: 0,\n };\n },\n\n watch: {\n filterValues: {\n /**\n * Maps filters to a partcular object structure:\n * @param {IFilterSchemaItem} newFilterValues all selected filters\n * @returns {IFilter}\n */\n handler: function (newFilterValues) {\n const filters = Object.keys(newFilterValues).reduce((acc, i) => {\n const schema = this.schema[i];\n\n if (!schema || !schema.fieldToFilter) {\n return acc;\n }\n\n const item = newFilterValues[i];\n\n // Ignore empty string or undefined/null filter values\n if (item === '' || item == null) {\n return acc;\n }\n\n const trackBy = schema.attributes.trackBy || 'id';\n const isObject = typeof item === 'object';\n const isCustomFilterComponent = typeof schema.type === 'object';\n // TODO: remove handling of schema.attributes.multiple when we remove the vue-multiselect version of Select\n const isMultiple =\n (isCustomFilterComponent && schema.attributes.multiple) ||\n (!isCustomFilterComponent &&\n schema.type.includes('ll-select') &&\n (schema.attributes.multiple || !schema.attributes.single));\n const filterBy = isMultiple\n ? // local storage might have item stored as an object from the old Select\n (Array.isArray(item) ? item : [item]).map((v) => v[trackBy])\n : isObject\n ? [item[trackBy]]\n : [item];\n\n const groupedWith = schema.groupedWith;\n\n if (groupedWith) {\n filterBy[0] = {\n index: groupedWith,\n value: newFilterValues[groupedWith],\n };\n filterBy.push({\n index: Number(i),\n value: newFilterValues[i],\n });\n }\n\n if (filterBy.length) {\n acc[schema.fieldToFilter] = {\n // don't add to `filters` if no filterBy\n filterBy,\n filterType: schema.type, // Informs the applied filter count\n isMultiple,\n ...('fn' in schema && { customFilter: schema.fn }),\n };\n }\n\n return acc;\n }, {});\n\n this.filters = filters;\n this.$emit('change', filters);\n },\n\n deep: true,\n immediate: true,\n },\n\n filters() {\n if (this.validation) {\n this.updateValidationValues();\n }\n },\n },\n\n async created() {\n // initFilterValues updates the filterValues so using await nextTick() forces the code\n // after it to wait until nextTick is done, at which point the filterValues will\n // be done initializing. Otherwise, applyFilters sometimes applies the wrong\n // filters because filterValues is not done updating.\n this.initFilterValues();\n await nextTick();\n this.initValidation();\n this.applyFilters({ trigger: LLLV_CHANGE_TRIGGERS.LOAD });\n },\n\n methods: {\n initFilterValues() {\n if (this.disablePersistency) {\n this.filterValues = this.getDefaultFilterValues();\n\n return;\n }\n\n this.filterValues = this.getPersistentFilterValues() || this.getDefaultFilterValues();\n },\n\n /**\n * Apply the selected filters and save them to localStorage.\n * ListView calls this method using a ref to Filters.\n * The trigger option is used in ListView.\n * @param {object} [options] - optional parameters\n * @param {string} [options.trigger] - the action that triggered this function call\n */\n async applyFilters({ trigger = LLLV_CHANGE_TRIGGERS.APPLY } = {}) {\n if (this.validation) {\n await this.validation.validate();\n\n if (this.validation.hasErrors) {\n return;\n }\n }\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n this.$emit('submit', { trigger });\n },\n\n resetFilters() {\n this.filterValues = this.getDefaultFilterValues();\n\n this.forceRenderCount++;\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n // Emit after filters are updated\n this.$nextTick(() => {\n this.$emit('reset');\n });\n },\n\n /**\n * Returns pre-defined filter values to become the default values\n */\n getDefaultFilterValues() {\n return this.schema.reduce((acc, item, filterIndex) => {\n if (item.type === 'll-checkbox') {\n acc[filterIndex] = item.attributes.checked || false;\n } else if (Object.prototype.hasOwnProperty.call(item.attributes, 'modelValue')) {\n acc[filterIndex] = item.attributes.modelValue;\n }\n\n return acc;\n }, {});\n },\n\n /**\n * Intended for external use, when filter values need to be set for the user\n */\n setFilterValues(newValues) {\n this.filterValues = merge({}, this.filterValues, newValues);\n this.forceRenderCount++;\n },\n\n updateValidationValues() {\n const validatable = Object.keys(this.validationSchema());\n\n this.schema.forEach((fieldSchema, filterIndex) => {\n const fieldToFilter = fieldSchema.fieldToFilter;\n const validate = validatable.includes(fieldToFilter);\n\n if (validate) {\n const filter = this.filters[fieldToFilter];\n\n /**\n * Get all validatable fields.\n * Use parsed value of filters that are set,\n * otherwise fall back to `filterValue` value if not set.\n */\n const filterValue = filter\n ? filter.isMultiple\n ? filter.filterBy\n : filter.filterBy[0]\n : this.filterValues[filterIndex];\n\n this.validationValues[fieldToFilter] = filterValue;\n }\n });\n },\n\n /**\n * Change handler for filter fields\n */\n onChange(filter, filterValues, filterIndex) {\n if (filter.on?.change) {\n // Maps to `on.change` handlers in the filter schema.\n filter.on.change(filterValues, filterIndex);\n }\n },\n\n /**\n * Select input event handler for filter fields\n */\n onSelectInput(newValue, filter, filterIndex) {\n if (newValue === undefined) {\n delete this.filterValues[filterIndex]; // prevent undefined filterValues which cause an empty result list\n } else {\n this.filterValues[filterIndex] = newValue;\n }\n\n this.onChange(filter, this.filterValues, filterIndex);\n },\n\n /**\n * Get filter values from local storage.\n * @returns {any}\n */\n getPersistentFilterValues() {\n return persistentStorage.get('filter-values');\n },\n\n /**\n * Clone new filterValues to remove reactivity, and save them to localStorage.\n * @param {object} newValues - the filterValues to be persisted in localStorage\n */\n persistFilterValues(newValues) {\n persistentStorage.set('filter-values', cloneDeep(newValues));\n },\n },\n };\n</script>\n\n<template>\n <div class=\"tw-ll-grid tw-grid-cols-4 md:tw-grid-cols-12\">\n <template v-for=\"(filter, filterIndex) in schema\">\n <div\n v-if=\"!filter.hidden\"\n :key=\"`${filterIndex} ${forceRenderCount}`\"\n class=\"field-wrapper tw-col-span-4 md:tw-col-span-3\"\n :class=\"{ 'max-md:tw-hidden': !filter.type, 'tw-flex tw-items-end': filter.type === 'll-checkbox' }\"\n :data-test=\"`filter|${filter.fieldToFilter}`\"\n >\n <!-- Filter component -->\n <ll-select\n v-if=\"filter.type === 'll-select'\"\n v-bind=\"filter.attributes\"\n :error=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n :model-value=\"filterValues[filterIndex]\"\n @update:model-value=\"(newValue) => onSelectInput(newValue, filter, filterIndex)\"\n />\n <ll-checkbox\n v-else-if=\"filter.type === 'll-checkbox'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <ll-radio\n v-else-if=\"filter.type === 'll-radio'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <component\n v-bind=\"filter.attributes\"\n :is=\"filter.type\"\n v-else-if=\"filter.type\"\n v-model=\"filterValues[filterIndex]\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:model-value=\"onChange(filter, filterValues, filterIndex)\"\n >\n <template v-if=\"filter.slots && filter.slots.selected\" #selected=\"{ option }\">\n <component :is=\"filter.slots.selected\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.option\" #option=\"{ option }\">\n <component :is=\"filter.slots.option\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.prepend\" #prepend>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-html=\"filter.slots.prepend\"></span>\n </template>\n <template v-if=\"filter.slots && filter.slots.append\" #append>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-html=\"filter.slots.append\"></span>\n </template>\n </component>\n </div>\n </template>\n <div\n class=\"button-grid tw-col-span-4 tw-flex tw-items-end tw-justify-end md:tw-col-span-12\"\n :class=\"$style['filter-button-group']\"\n >\n <ll-button secondary data-test=\"button|reset-filters\" :disabled=\"disableClear\" @click=\"resetFilters\">\n {{ clearText }}\n </ll-button>\n <ll-button\n primary\n data-test=\"button|apply-filters\"\n :disabled=\"disableApply || validation?.hasErrors\"\n @click=\"applyFilters\"\n >\n {{ applyText }}\n </ll-button>\n </div>\n </div>\n</template>\n\n<style module>\n .filter-button-group {\n @media screen('max-md') {\n display: flex;\n flex-direction: column-reverse;\n }\n\n button {\n @media screen('max-md') {\n width: 100% !important;\n }\n\n &:nth-child(2) {\n @media screen('max-md') {\n margin-bottom: theme('spacing.3');\n }\n }\n }\n }\n</style>\n"],"names":["_sfc_main","Button","Checkbox","Input","InputOptions","Radio","Select","DatePicker","props","getValidationSchema","toRefs","validationSchema","validationValues","ref","validation","initValidation","values","fieldName","validationRules","rules","fieldRules","fieldRule","useValidation","t","newFilterValues","filters","acc","i","schema","item","trackBy","isObject","isCustomFilterComponent","isMultiple","filterBy","v","groupedWith","nextTick","LLLV_CHANGE_TRIGGERS","trigger","filterIndex","newValues","merge","validatable","fieldSchema","fieldToFilter","filter","filterValue","filterValues","_a","newValue","persistentStorage","cloneDeep","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_Fragment","_renderList","$props","_createCommentVNode","$data","_normalizeClass","_createBlock","_component_ll_select","_mergeProps","$setup","_b","$options","_component_ll_checkbox","$event","_c","_d","_component_ll_radio","_e","_f","_resolveDynamicComponent","_g","_h","_createSlots","_withCtx","option","_createElementVNode","_ctx","_createVNode","_component_ll_button","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;GAiBOA,KAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,aAAaC;AAAA,IACb,eAAeC;AAAA,IACf,YAAYC;AAAA,IACZ,oBAAoBC;AAAA,IACpB,YAAYC;AAAA,IACZ,aAAaC;AAAA,IACb,YAAAC;AAAA,EACD;AAAA,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AAG,SAAOS,EAAY;AAAA;QAtZzG,SAAAY,EAuZQ,MAAe;AAAA,UAvZvBM,EAAAC,EAuZW1B,EAAS,SAAA,GAAA,CAAA;AAAA;QAvZpB,GAAA;AAAA;MAyZMuB,EAOYC,GAAA;AAAA,QANV,SAAA;AAAA,QACA,aAAU;AAAA,QACT,UAAU1B,EAAA,kBAAgBZ,IAAAmB,EAAA,eAAA,gBAAAnB,EAAY;AAAA,QACtC,SAAOqB,EAAY;AAAA;QA7Z5B,SAAAY,EA+ZQ,MAAe;AAAA,UA/ZvBM,EAAAC,EA+ZW1B,EAAS,SAAA,GAAA,CAAA;AAAA;QA/ZpB,GAAA;AAAA;;;;;;;"}
package/dist/Icon.js CHANGED
@@ -96,6 +96,9 @@ const v = [
96
96
  "image",
97
97
  "import",
98
98
  "keyboard-return",
99
+ "tier-1",
100
+ "tier-2",
101
+ "tier-3",
99
102
  "license-approved",
100
103
  "license-certificate",
101
104
  "lightbulb",
package/dist/Icon.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sources":["../src/components/Icon/Icon.types.ts","../src/components/Icon/Icon.vue"],"sourcesContent":["export const iconNames = [\n 'action-dots',\n 'activity',\n 'alert-bell',\n 'archive',\n 'arrow-down',\n 'arrow-left',\n 'arrow-right',\n 'arrow-up',\n 'badge-discount',\n 'badge-seller-elite',\n 'badge-seller-power',\n 'badge-seller-verified',\n 'book-customer',\n 'building-office',\n 'bulk-add',\n 'calendar-reschedule',\n 'calendar',\n 'camera',\n 'caret-down',\n 'caret-up',\n 'change-log',\n 'check',\n 'chevron-down',\n 'chevron-left',\n 'chevron-right',\n 'chevron-up',\n 'circle-check',\n 'circle-close',\n 'circle-dollar',\n 'circle-empty',\n 'circle-info',\n 'circle-partial',\n 'circle-percent',\n 'circle-question-mark',\n 'circle-status',\n 'circle-warning',\n 'clipboard-checkmark',\n 'clipboard-inventory',\n 'close',\n 'combine',\n 'compass',\n 'contact',\n 'contract',\n 'copy',\n 'credit-card',\n 'credit-profile',\n 'dashboard',\n 'document-accept',\n 'document-invoice',\n 'document-recieved',\n 'document-sent',\n 'document-view',\n 'document',\n 'dolly',\n 'download',\n 'edit',\n 'ellipsis',\n 'envelope-open',\n 'envelope',\n 'equals',\n 'export',\n 'figma',\n 'file-csv',\n 'file',\n 'filter-funnel',\n 'filter-line',\n 'flag',\n 'folder',\n 'folder-bar-graph',\n 'folder-orders',\n 'font-bold',\n 'font-clear-format',\n 'font-italic',\n 'font-underline',\n 'gear',\n 'github',\n 'globe',\n 'graph-bar-chart',\n 'graph-line-chart',\n 'graph-pie-chart',\n 'hazard',\n 'hazard-outline',\n 'headset-agent',\n 'headset-mic',\n 'heart-filled',\n 'heart-outline',\n 'help-question-mark',\n 'hide',\n 'history',\n 'home',\n 'image',\n 'import',\n 'keyboard-return',\n 'license-approved',\n 'license-certificate',\n 'lightbulb',\n 'link-add',\n 'link-unlink',\n 'link',\n 'list-bulleted',\n 'list-items',\n 'list-numbered',\n 'loading-big',\n 'loading-empty',\n 'loading-small',\n 'location',\n 'lock-unlock',\n 'lock',\n 'logo-facebook',\n 'logo-instagram',\n 'logo-linkedin',\n 'logo-ll',\n 'logo-metrc',\n 'logo-plaid',\n 'logo-x',\n 'logo-youtube',\n 'logout',\n 'medical',\n 'megaphone-sound',\n 'megaphone',\n 'menu',\n 'message-dispute',\n 'message-reply',\n 'message',\n 'minus',\n 'mj-leaf',\n 'money',\n 'note-add',\n 'note',\n 'open-in-new',\n 'paperclip',\n 'paper-plane',\n 'performance',\n 'phone',\n 'plus',\n 'preview',\n 'print',\n 'product-menu-manage',\n 'product-menu-search',\n 'product-menu',\n 'queue-add',\n 'queue',\n 'recent',\n 'refresh',\n 'register',\n 'reply',\n 'report-download',\n 'sample',\n 'save',\n 'scale-law',\n 'scale-weight',\n 'search',\n 'seed-cycle',\n 'share',\n 'shop-bag-browse',\n 'shop-bag-reorder',\n 'shop-bag',\n 'shop-basket',\n 'shop-cart-add',\n 'shop-cart',\n 'show',\n 'sign-dollar',\n 'sign-percent',\n 'sort',\n 'split',\n 'star-filled',\n 'star-outline',\n 'storefront',\n 'submit',\n 'swap-horizontal',\n 'swap-vertical',\n 'tag-star',\n 'tag',\n 'test-results',\n 'ticket-star',\n 'ticket',\n 'tool-dropper',\n 'tool-wrench',\n 'transfer',\n 'trashcan',\n 'truck',\n 'upload',\n 'user-add',\n 'user-admin',\n 'user-check',\n 'user',\n 'view-card',\n 'view-detailed',\n 'view-list',\n 'warehouse',\n 'working',\n] as const;\n\nexport type IconName = (typeof iconNames)[number];\n\nexport enum IconSizes {\n Standard = 'standard',\n Dense = 'dense',\n Small = 'small',\n Large = 'large',\n}\n\nexport type IconSize = `${IconSizes}`;\n","<script lang=\"ts\">\n export * from './Icon.types';\n</script>\n\n<script lang=\"ts\" setup>\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, inject, useCssModule } from 'vue';\n import InlineSvg from 'vue-inline-svg';\n\n import { StashProvideState } from '../../../types/misc';\n import { IconName, iconNames, IconSize } from './Icon.types';\n\n export interface IconProps {\n id?: string;\n\n /**\n * The filename of the icon that should be displayed\n */\n name: IconName;\n\n /**\n * Accessible, short-text description for the icon. Not rendered as part of the graphic, but\n * browsers usually display it as a tooltip and screen readers use this.\n */\n title?: string;\n\n /**\n * The size of the icon\n * Options: large (32x32px), default (24x24px), dense (20x20px), small (14x14px).\n */\n size?: IconSize;\n\n /**\n * @deprecated Use the `size` prop with value \"dense\" instead\n */\n dense?: boolean;\n\n /**\n` * @deprecated Use the `size` prop with value \"small\" instead\n */\n small?: boolean;\n\n /**\n * Icon's custom static path. It'll default to either the staticPath defined on the library installation or '/static' if none are provided.\n */\n staticPath?: string;\n }\n\n defineOptions({\n name: 'll-icon',\n });\n\n const props = withDefaults(defineProps<IconProps>(), {\n id: () => uniqueId('ll-icon-'),\n size: 'standard',\n title: '',\n staticPath: '',\n });\n const classes = useCssModule();\n const stashOptions = inject<Partial<StashProvideState>>('stashOptions', {\n staticPath: '/static',\n });\n\n const computedName = computed<IconName>(() => {\n if (iconNames.includes(props.name)) {\n return props.name;\n }\n\n return 'mj-leaf';\n });\n\n const computedStaticPath = computed(() => {\n return props.staticPath || stashOptions?.staticPath;\n });\n\n /**\n * Event handler to add the use tag for the specific icon we need to the svg\n */\n const transformSvgSource = (svgElem: SVGElement) => {\n if (!svgElem) {\n return svgElem;\n }\n\n const useNode = document.createElement('use');\n useNode.setAttribute('href', `#${computedName.value}`);\n\n // Grab icon from sprite\n const symbolNode = svgElem.querySelector(`#${computedName.value}`);\n\n // This really shouldn't happen but if the spritesheet gets out of sync with the `IconName` type it could\n if (!symbolNode) {\n // still insert <use> element but it will not be found (this is more for tests than anything else)\n svgElem.insertBefore(useNode, svgElem.firstChild);\n return svgElem;\n }\n\n /**\n * Repeatedly inlining the entire spritesheet was causing failures in mobile Safari, and also\n * performance issues on long list pages where the svg was being inlined over and over.\n * Since the SVG is cached after the first request, this callback is just removing the unnecessary\n * <symbol> nodes to slim down the DOM manipulation and insertion.\n */\n // Replace all children with just the one <symbol> element and <use> element\n svgElem.replaceChildren(symbolNode, useNode);\n\n return svgElem;\n };\n</script>\n\n<!-- Use inline svg so that requests to pull the spritesheet are done via JS and avoid\n browser restrictions for different domains for svgs. inline svg also caches the requests\n so we don't load the spritesheet multiple times\n Reference: https://oreillymedia.github.io/Using_SVG/extras/ch10-cors.html -->\n<template>\n <InlineSvg\n :id=\"props.id\"\n role=\"presentation\"\n :aria-labelledby=\"props.id\"\n class=\"stash-icon\"\n :class=\"[\n classes.icon,\n `icon--${props.name}`,\n {\n [classes.standard]: props.size === 'standard',\n [classes.dense]: props.size === 'dense' || props.dense,\n [classes.small]: props.size === 'small' || props.small,\n [classes.large]: props.size === 'large',\n },\n ]\"\n data-test=\"stash-icon\"\n :src=\"`${computedStaticPath}/spritesheet.svg`\"\n :title=\"props.title\"\n :transform-source=\"transformSvgSource\"\n />\n</template>\n\n<style module>\n .icon {\n display: inline-block;\n fill: currentcolor;\n vertical-align: middle;\n }\n\n .standard {\n height: 24px;\n min-height: 24px;\n min-width: 24px;\n width: 24px;\n }\n\n .dense {\n height: 20px;\n min-height: 20px;\n min-width: 20px;\n width: 20px;\n }\n\n .small {\n height: 14px;\n min-height: 14px;\n min-width: 14px;\n width: 14px;\n }\n\n .large {\n height: 32px;\n min-height: 32px;\n min-width: 32px;\n width: 32px;\n }\n</style>\n"],"names":["iconNames","IconSizes","props","__props","classes","useCssModule","stashOptions","inject","computedName","computed","computedStaticPath","transformSvgSource","svgElem","useNode","symbolNode"],"mappings":";;;;AAAO,MAAMA,IAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIY,IAAAC,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SAJEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;AChJV,UAAMC,IAAQC,GAMRC,IAAUC,EAAa,GACvBC,IAAeC,EAAmC,gBAAgB;AAAA,MACtE,YAAY;AAAA,IAAA,CACb,GAEKC,IAAeC,EAAmB,MAClCT,EAAU,SAASE,EAAM,IAAI,IACxBA,EAAM,OAGR,SACR,GAEKQ,IAAqBD,EAAS,MAC3BP,EAAM,eAAcI,KAAA,gBAAAA,EAAc,WAC1C,GAKKK,IAAqB,CAACC,MAAwB;AAClD,UAAI,CAACA;AACI,eAAAA;AAGH,YAAAC,IAAU,SAAS,cAAc,KAAK;AAC5C,MAAAA,EAAQ,aAAa,QAAQ,IAAIL,EAAa,KAAK,EAAE;AAGrD,YAAMM,IAAaF,EAAQ,cAAc,IAAIJ,EAAa,KAAK,EAAE;AAGjE,aAAKM,KAaGF,EAAA,gBAAgBE,GAAYD,CAAO,GAEpCD,MAbGA,EAAA,aAAaC,GAASD,EAAQ,UAAU,GACzCA;AAAA,IAaX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Icon.js","sources":["../src/components/Icon/Icon.types.ts","../src/components/Icon/Icon.vue"],"sourcesContent":["/**\n * To add a new icon, follow these steps:\n *\n * https://github.com/LeafLink/stash/blob/main/CONTRIBUTING.md#adding-a-new-icon\n */\nexport const iconNames = [\n 'action-dots',\n 'activity',\n 'alert-bell',\n 'archive',\n 'arrow-down',\n 'arrow-left',\n 'arrow-right',\n 'arrow-up',\n 'badge-discount',\n 'badge-seller-elite',\n 'badge-seller-power',\n 'badge-seller-verified',\n 'book-customer',\n 'building-office',\n 'bulk-add',\n 'calendar-reschedule',\n 'calendar',\n 'camera',\n 'caret-down',\n 'caret-up',\n 'change-log',\n 'check',\n 'chevron-down',\n 'chevron-left',\n 'chevron-right',\n 'chevron-up',\n 'circle-check',\n 'circle-close',\n 'circle-dollar',\n 'circle-empty',\n 'circle-info',\n 'circle-partial',\n 'circle-percent',\n 'circle-question-mark',\n 'circle-status',\n 'circle-warning',\n 'clipboard-checkmark',\n 'clipboard-inventory',\n 'close',\n 'combine',\n 'compass',\n 'contact',\n 'contract',\n 'copy',\n 'credit-card',\n 'credit-profile',\n 'dashboard',\n 'document-accept',\n 'document-invoice',\n 'document-recieved',\n 'document-sent',\n 'document-view',\n 'document',\n 'dolly',\n 'download',\n 'edit',\n 'ellipsis',\n 'envelope-open',\n 'envelope',\n 'equals',\n 'export',\n 'figma',\n 'file-csv',\n 'file',\n 'filter-funnel',\n 'filter-line',\n 'flag',\n 'folder',\n 'folder-bar-graph',\n 'folder-orders',\n 'font-bold',\n 'font-clear-format',\n 'font-italic',\n 'font-underline',\n 'gear',\n 'github',\n 'globe',\n 'graph-bar-chart',\n 'graph-line-chart',\n 'graph-pie-chart',\n 'hazard',\n 'hazard-outline',\n 'headset-agent',\n 'headset-mic',\n 'heart-filled',\n 'heart-outline',\n 'help-question-mark',\n 'hide',\n 'history',\n 'home',\n 'image',\n 'import',\n 'keyboard-return',\n 'tier-1',\n 'tier-2',\n 'tier-3',\n 'license-approved',\n 'license-certificate',\n 'lightbulb',\n 'link-add',\n 'link-unlink',\n 'link',\n 'list-bulleted',\n 'list-items',\n 'list-numbered',\n 'loading-big',\n 'loading-empty',\n 'loading-small',\n 'location',\n 'lock-unlock',\n 'lock',\n 'logo-facebook',\n 'logo-instagram',\n 'logo-linkedin',\n 'logo-ll',\n 'logo-metrc',\n 'logo-plaid',\n 'logo-x',\n 'logo-youtube',\n 'logout',\n 'medical',\n 'megaphone-sound',\n 'megaphone',\n 'menu',\n 'message-dispute',\n 'message-reply',\n 'message',\n 'minus',\n 'mj-leaf',\n 'money',\n 'note-add',\n 'note',\n 'open-in-new',\n 'paperclip',\n 'paper-plane',\n 'performance',\n 'phone',\n 'plus',\n 'preview',\n 'print',\n 'product-menu-manage',\n 'product-menu-search',\n 'product-menu',\n 'queue-add',\n 'queue',\n 'recent',\n 'refresh',\n 'register',\n 'reply',\n 'report-download',\n 'sample',\n 'save',\n 'scale-law',\n 'scale-weight',\n 'search',\n 'seed-cycle',\n 'share',\n 'shop-bag-browse',\n 'shop-bag-reorder',\n 'shop-bag',\n 'shop-basket',\n 'shop-cart-add',\n 'shop-cart',\n 'show',\n 'sign-dollar',\n 'sign-percent',\n 'sort',\n 'split',\n 'star-filled',\n 'star-outline',\n 'storefront',\n 'submit',\n 'swap-horizontal',\n 'swap-vertical',\n 'tag-star',\n 'tag',\n 'test-results',\n 'ticket-star',\n 'ticket',\n 'tool-dropper',\n 'tool-wrench',\n 'transfer',\n 'trashcan',\n 'truck',\n 'upload',\n 'user-add',\n 'user-admin',\n 'user-check',\n 'user',\n 'view-card',\n 'view-detailed',\n 'view-list',\n 'warehouse',\n 'working',\n] as const;\n\nexport type IconName = (typeof iconNames)[number];\n\nexport enum IconSizes {\n Standard = 'standard',\n Dense = 'dense',\n Small = 'small',\n Large = 'large',\n}\n\nexport type IconSize = `${IconSizes}`;\n","<script lang=\"ts\">\n export * from './Icon.types';\n</script>\n\n<script lang=\"ts\" setup>\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, inject, useCssModule } from 'vue';\n import InlineSvg from 'vue-inline-svg';\n\n import { StashProvideState } from '../../../types/misc';\n import { IconName, iconNames, IconSize } from './Icon.types';\n\n export interface IconProps {\n id?: string;\n\n /**\n * The filename of the icon that should be displayed\n */\n name: IconName;\n\n /**\n * Accessible, short-text description for the icon. Not rendered as part of the graphic, but\n * browsers usually display it as a tooltip and screen readers use this.\n */\n title?: string;\n\n /**\n * The size of the icon\n * Options: large (32x32px), default (24x24px), dense (20x20px), small (14x14px).\n */\n size?: IconSize;\n\n /**\n * @deprecated Use the `size` prop with value \"dense\" instead\n */\n dense?: boolean;\n\n /**\n` * @deprecated Use the `size` prop with value \"small\" instead\n */\n small?: boolean;\n\n /**\n * Icon's custom static path. It'll default to either the staticPath defined on the library installation or '/static' if none are provided.\n */\n staticPath?: string;\n }\n\n defineOptions({\n name: 'll-icon',\n });\n\n const props = withDefaults(defineProps<IconProps>(), {\n id: () => uniqueId('ll-icon-'),\n size: 'standard',\n title: '',\n staticPath: '',\n });\n const classes = useCssModule();\n const stashOptions = inject<Partial<StashProvideState>>('stashOptions', {\n staticPath: '/static',\n });\n\n const computedName = computed<IconName>(() => {\n if (iconNames.includes(props.name)) {\n return props.name;\n }\n\n return 'mj-leaf';\n });\n\n const computedStaticPath = computed(() => {\n return props.staticPath || stashOptions?.staticPath;\n });\n\n /**\n * Event handler to add the use tag for the specific icon we need to the svg\n */\n const transformSvgSource = (svgElem: SVGElement) => {\n if (!svgElem) {\n return svgElem;\n }\n\n const useNode = document.createElement('use');\n useNode.setAttribute('href', `#${computedName.value}`);\n\n // Grab icon from sprite\n const symbolNode = svgElem.querySelector(`#${computedName.value}`);\n\n // This really shouldn't happen but if the spritesheet gets out of sync with the `IconName` type it could\n if (!symbolNode) {\n // still insert <use> element but it will not be found (this is more for tests than anything else)\n svgElem.insertBefore(useNode, svgElem.firstChild);\n return svgElem;\n }\n\n /**\n * Repeatedly inlining the entire spritesheet was causing failures in mobile Safari, and also\n * performance issues on long list pages where the svg was being inlined over and over.\n * Since the SVG is cached after the first request, this callback is just removing the unnecessary\n * <symbol> nodes to slim down the DOM manipulation and insertion.\n */\n // Replace all children with just the one <symbol> element and <use> element\n svgElem.replaceChildren(symbolNode, useNode);\n\n return svgElem;\n };\n</script>\n\n<!-- Use inline svg so that requests to pull the spritesheet are done via JS and avoid\n browser restrictions for different domains for svgs. inline svg also caches the requests\n so we don't load the spritesheet multiple times\n Reference: https://oreillymedia.github.io/Using_SVG/extras/ch10-cors.html -->\n<template>\n <InlineSvg\n :id=\"props.id\"\n role=\"presentation\"\n :aria-labelledby=\"props.id\"\n class=\"stash-icon\"\n :class=\"[\n classes.icon,\n `icon--${props.name}`,\n {\n [classes.standard]: props.size === 'standard',\n [classes.dense]: props.size === 'dense' || props.dense,\n [classes.small]: props.size === 'small' || props.small,\n [classes.large]: props.size === 'large',\n },\n ]\"\n data-test=\"stash-icon\"\n :src=\"`${computedStaticPath}/spritesheet.svg`\"\n :title=\"props.title\"\n :transform-source=\"transformSvgSource\"\n />\n</template>\n\n<style module>\n .icon {\n display: inline-block;\n fill: currentcolor;\n vertical-align: middle;\n }\n\n .standard {\n height: 24px;\n min-height: 24px;\n min-width: 24px;\n width: 24px;\n }\n\n .dense {\n height: 20px;\n min-height: 20px;\n min-width: 20px;\n width: 20px;\n }\n\n .small {\n height: 14px;\n min-height: 14px;\n min-width: 14px;\n width: 14px;\n }\n\n .large {\n height: 32px;\n min-height: 32px;\n min-width: 32px;\n width: 32px;\n }\n</style>\n"],"names":["iconNames","IconSizes","props","__props","classes","useCssModule","stashOptions","inject","computedName","computed","computedStaticPath","transformSvgSource","svgElem","useNode","symbolNode"],"mappings":";;;;AAKO,MAAMA,IAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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