@leaflink/stash 43.0.1 → 43.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataViewFilters.js +67 -66
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewFilters.vue.d.ts +8 -0
- package/dist/FilterDrawerItem.js +55 -39
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDrawerItem.vue.d.ts +12 -2
- package/dist/PageNavigation.js +84 -341
- package/dist/PageNavigation.js.map +1 -1
- package/dist/PageNavigation.vue.d.ts +76 -163
- package/dist/Step.vue.d.ts +1 -1
- package/dist/Tab.js +5 -87
- package/dist/Tab.js.map +1 -1
- package/dist/Tab.vue_vue_type_script_setup_true_lang-b810bee8.js +90 -0
- package/dist/Tab.vue_vue_type_script_setup_true_lang-b810bee8.js.map +1 -0
- package/dist/Tabs.js +9 -6
- package/dist/Tabs.js.map +1 -1
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js +156 -0
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js.map +1 -0
- package/dist/components.css +1 -1
- package/dist/locale.js +8 -7
- package/dist/locale.js.map +1 -1
- package/package.json +1 -1
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js +0 -154
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js.map +0 -1
package/dist/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sources":["../src/locales/en-US.ts","../src/locale.ts"],"sourcesContent":["export default {\n ll: {\n actions: 'Actions',\n all: 'All',\n allFilters: 'All Filters',\n apply: 'Apply',\n areYouSure: 'Are you sure?',\n cancel: 'Cancel',\n carousel: {\n imageLabel: 'Image {index} of {total}',\n paginationLabel: 'Go to image {index}',\n },\n clear: 'Clear',\n closeModal: 'Close modal',\n confirm: 'Confirm',\n copy: {\n copied: 'Copied!',\n copyToClipboard: 'Copy to clipboard',\n },\n datePicker: {\n dateFormat: 'Date format',\n today: 'Today',\n },\n pageStats: '{from} - {to} of {total}',\n emptyState: {\n noResults: 'No results',\n },\n fileUpload: {\n dragDropFileHere: 'Drag and drop your file here',\n errors: {\n incorrectFileType: 'Please drop a file with type: {fileTypes}',\n },\n or: 'or',\n remove: 'Remove',\n uploadFile: 'Upload File',\n },\n filter: 'Filter',\n filterBy: 'Filter by',\n filters: 'Filters',\n httpError: {\n 401: {\n title: 'Unauthorized',\n description: 'Sorry, you are not authorized to access the LeafLink portal!',\n },\n 403: {\n title: 'Access denied.',\n description: `Sorry, you can not access the page you are looking for. Talk to your account admin regarding your account's permission settings.`,\n },\n 404: {\n title: `Sorry, we can't find this page.`,\n description: `We couldn't find the page you're looking for.`,\n },\n 405: {\n title: 'Not allowed.',\n description: `We couldn't reach the page you're looking for this way.`,\n },\n '50X': {\n title: 'Please wait while we hash this out.',\n description: `You've encountered an error.`,\n },\n 504: {\n title: 'Your request got lost in the weeds.',\n description: `You've encountered an error.`,\n },\n },\n listView: {\n calculating: 'Calculating results...',\n clearSelection: 'Clear Selection',\n deselectAllCount: 'Deselect all ({count})',\n numItemsSelected: '{totalSelectedCount} of {totalCount} items selected',\n numberOfTotalSelected: '{num} of {total} selected',\n selectAll: 'Select all',\n selectAllCount: 'Select all ({count})',\n sortBy: 'Sort by',\n totalResults: 'Showing {num} of {total} results',\n },\n numberOfActiveFilters: 'Number of active filters',\n okay: 'Okay',\n optional: 'optional',\n pageNavigation: {\n more: 'More',\n },\n more: 'More',\n next: 'Next',\n previous: 'Previous',\n reset: 'Reset',\n resetAll: 'Reset all',\n search: 'Search',\n select: {\n self: 'Select',\n empty: 'No options',\n placeholder: 'Select option',\n selected: 'selected',\n },\n selectAll: 'Select all',\n sort: 'Sort',\n table: {\n collapseRow: 'Collapse row',\n expandRow: 'Expand row',\n },\n validation: {\n email: 'Email must be valid',\n maxValue: 'Must be at most {max}',\n minValue: 'Must be at least {min}',\n positiveNumber: 'Must be greater than 0',\n required: 'Required',\n price: 'Must have 2 decimal places',\n wholeNumber: 'Must be a Whole Number',\n },\n },\n};\n","import get from 'lodash-es/get';\n\nimport messages from './locales/en-US';\n\nexport let locale = 'en-US';\nlet i18nHandler;\n\n/**\n * Replaces params in a translation message with respective values\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string}\n */\nexport function format(path, params) {\n const pathParams = path.match(/({)([\\w]+)(})/g) || [];\n let message = path;\n\n pathParams.forEach((param) => {\n const prop = param.replace(/[{}]/g, '');\n\n message = message.replace(param, params[prop] || '');\n });\n\n return message;\n}\n\n/**\n * Returns a translation based on translation path\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n */\nfunction translate(path, params) {\n // Lookup translation\n const value = get(messages, path);\n\n // Return translation, otherwise the path\n return value ? format(value, params) : path;\n}\n\n/**\n * Calls the provided translation method `config.i18n.t` if provided, or the built-in\n * @param {...(string|object)} args\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string} Translation message\n */\nexport function t(...args) {\n const value = i18nHandler && i18nHandler(...args);\n\n // If value exists, but translation doesn't (returns translation key format (xx.xx)),\n // then fallback to default\n if (value && !/^\\w{2,}\\.\\w{2,}/.test(value)) {\n return value;\n }\n\n // @ts-ignore - todo: Fix \"A spread argument must either have a tuple type or be passed to a rest parameter.ts(2556)\"\n // Default English message\n return translate(...args);\n}\n\n/**\n * Sets the locale\n * @param {string} l locale\n */\nexport function use(l) {\n locale = l || locale;\n}\n\n/**\n * Sets the translate function `t()`\n * @param {function} fn Translate function `t()`\n */\nexport function i18n(fn) {\n i18nHandler = fn;\n}\n\nexport default { i18n, locale, t, use };\n"],"names":["messages","locale","i18nHandler","format","path","params","pathParams","message","param","prop","translate","value","get","t","args","use","l","i18n","fn","locale$1"],"mappings":";AAAA,MAAeA,IAAA;AAAA,EACb,IAAI;AAAA,IACF,SAAS;AAAA,IACT,KAAK;A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AAA,IACV,gBAAgB;AAAA,MACd,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,MACL,aAAa;AAAA,MACb,WAAW;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,
|
|
1
|
+
{"version":3,"file":"locale.js","sources":["../src/locales/en-US.ts","../src/locale.ts"],"sourcesContent":["export default {\n ll: {\n actions: 'Actions',\n all: 'All',\n allFilters: 'All Filters',\n apply: 'Apply',\n areYouSure: 'Are you sure?',\n cancel: 'Cancel',\n carousel: {\n imageLabel: 'Image {index} of {total}',\n paginationLabel: 'Go to image {index}',\n },\n clear: 'Clear',\n closeModal: 'Close modal',\n confirm: 'Confirm',\n copy: {\n copied: 'Copied!',\n copyToClipboard: 'Copy to clipboard',\n },\n datePicker: {\n dateFormat: 'Date format',\n today: 'Today',\n },\n pageStats: '{from} - {to} of {total}',\n emptyState: {\n noResults: 'No results',\n },\n fileUpload: {\n dragDropFileHere: 'Drag and drop your file here',\n errors: {\n incorrectFileType: 'Please drop a file with type: {fileTypes}',\n },\n or: 'or',\n remove: 'Remove',\n uploadFile: 'Upload File',\n },\n filter: 'Filter',\n filterBy: 'Filter by',\n filters: 'Filters',\n httpError: {\n 401: {\n title: 'Unauthorized',\n description: 'Sorry, you are not authorized to access the LeafLink portal!',\n },\n 403: {\n title: 'Access denied.',\n description: `Sorry, you can not access the page you are looking for. Talk to your account admin regarding your account's permission settings.`,\n },\n 404: {\n title: `Sorry, we can't find this page.`,\n description: `We couldn't find the page you're looking for.`,\n },\n 405: {\n title: 'Not allowed.',\n description: `We couldn't reach the page you're looking for this way.`,\n },\n '50X': {\n title: 'Please wait while we hash this out.',\n description: `You've encountered an error.`,\n },\n 504: {\n title: 'Your request got lost in the weeds.',\n description: `You've encountered an error.`,\n },\n },\n listView: {\n calculating: 'Calculating results...',\n clearSelection: 'Clear Selection',\n deselectAllCount: 'Deselect all ({count})',\n numItemsSelected: '{totalSelectedCount} of {totalCount} items selected',\n numberOfTotalSelected: '{num} of {total} selected',\n selectAll: 'Select all',\n selectAllCount: 'Select all ({count})',\n sortBy: 'Sort by',\n totalResults: 'Showing {num} of {total} results',\n },\n numberOfActiveFilters: 'Number of active filters',\n okay: 'Okay',\n optional: 'optional',\n pageNavigation: {\n more: 'More',\n },\n more: 'More',\n next: 'Next',\n previous: 'Previous',\n reset: 'Reset',\n resetAll: 'Reset all',\n search: 'Search',\n select: {\n self: 'Select',\n empty: 'No options',\n placeholder: 'Select option',\n selected: 'selected',\n },\n selectAll: 'Select all',\n sort: 'Sort',\n table: {\n collapseRow: 'Collapse row',\n expandRow: 'Expand row',\n },\n validation: {\n email: 'Email must be valid',\n maxValue: 'Must be at most {max}',\n minValue: 'Must be at least {min}',\n positiveNumber: 'Must be greater than 0',\n required: 'Required',\n price: 'Must have 2 decimal places',\n wholeNumber: 'Must be a Whole Number',\n },\n viewFilterGroup: 'View filter group',\n },\n};\n","import get from 'lodash-es/get';\n\nimport messages from './locales/en-US';\n\nexport let locale = 'en-US';\nlet i18nHandler;\n\n/**\n * Replaces params in a translation message with respective values\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string}\n */\nexport function format(path, params) {\n const pathParams = path.match(/({)([\\w]+)(})/g) || [];\n let message = path;\n\n pathParams.forEach((param) => {\n const prop = param.replace(/[{}]/g, '');\n\n message = message.replace(param, params[prop] || '');\n });\n\n return message;\n}\n\n/**\n * Returns a translation based on translation path\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n */\nfunction translate(path, params) {\n // Lookup translation\n const value = get(messages, path);\n\n // Return translation, otherwise the path\n return value ? format(value, params) : path;\n}\n\n/**\n * Calls the provided translation method `config.i18n.t` if provided, or the built-in\n * @param {...(string|object)} args\n * @param {string} path Translation path (foo.bar.baz)\n * @param {object} params Any params used in the translation message\n * @returns {string} Translation message\n */\nexport function t(...args) {\n const value = i18nHandler && i18nHandler(...args);\n\n // If value exists, but translation doesn't (returns translation key format (xx.xx)),\n // then fallback to default\n if (value && !/^\\w{2,}\\.\\w{2,}/.test(value)) {\n return value;\n }\n\n // @ts-ignore - todo: Fix \"A spread argument must either have a tuple type or be passed to a rest parameter.ts(2556)\"\n // Default English message\n return translate(...args);\n}\n\n/**\n * Sets the locale\n * @param {string} l locale\n */\nexport function use(l) {\n locale = l || locale;\n}\n\n/**\n * Sets the translate function `t()`\n * @param {function} fn Translate function `t()`\n */\nexport function i18n(fn) {\n i18nHandler = fn;\n}\n\nexport default { i18n, locale, t, use };\n"],"names":["messages","locale","i18nHandler","format","path","params","pathParams","message","param","prop","translate","value","get","t","args","use","l","i18n","fn","locale$1"],"mappings":";AAAA,MAAeA,IAAA;AAAA,EACb,IAAI;AAAA,IACF,SAAS;AAAA,IACT,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,MACR,YAAY;AAAA,MACZ,iBAAiB;AAAA,IACnB;AAAA,IACA,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,iBAAiB;AAAA,IACnB;AAAA,IACA,YAAY;AAAA,MACV,YAAY;AAAA,MACZ,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,IACX,YAAY;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,YAAY;AAA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V,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,EACnB;AACF;AC3GO,IAAIC,IAAS,SAChBC;AAQY,SAAAC,EAAOC,GAAMC,GAAQ;AACnC,QAAMC,IAAaF,EAAK,MAAM,gBAAgB,KAAK,CAAA;AACnD,MAAIG,IAAUH;AAEH,SAAAE,EAAA,QAAQ,CAACE,MAAU;AAC5B,UAAMC,IAAOD,EAAM,QAAQ,SAAS,EAAE;AAEtC,IAAAD,IAAUA,EAAQ,QAAQC,GAAOH,EAAOI,CAAI,KAAK,EAAE;AAAA,EAAA,CACpD,GAEMF;AACT;AAOA,SAASG,EAAUN,GAAMC,GAAQ;AAEzB,QAAAM,IAAQC,EAAIZ,GAAUI,CAAI;AAGhC,SAAOO,IAAQR,EAAOQ,GAAON,CAAM,IAAID;AACzC;AASO,SAASS,KAAKC,GAAM;AACzB,QAAMH,IAAQT,KAAeA,EAAY,GAAGY,CAAI;AAIhD,SAAIH,KAAS,CAAC,kBAAkB,KAAKA,CAAK,IACjCA,IAKFD,EAAU,GAAGI,CAAI;AAC1B;AAMO,SAASC,EAAIC,GAAG;AACrB,EAAAf,IAASe,KAAKf;AAChB;AAMO,SAASgB,EAAKC,GAAI;AACT,EAAAhB,IAAAgB;AAChB;AAEA,MAAeC,IAAA,EAAE,MAAAF,GAAM,QAAAhB,GAAQ,GAAAY,GAAG,KAAAE,EAAI;"}
|
package/package.json
CHANGED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { defineComponent as $, ref as a, computed as p, provide as z, onMounted as U, onUpdated as V, onDeactivated as j, onBeforeUnmount as J, openBlock as x, createElementBlock as R, createElementVNode as f, normalizeStyle as q, normalizeClass as A, renderSlot as C, createBlock as F, withCtx as I, unref as b, createTextVNode as K, toDisplayString as W, createVNode as Y, createCommentVNode as G } from "vue";
|
|
2
|
-
import H from "lodash-es/debounce";
|
|
3
|
-
import P from "lodash-es/uniqueId";
|
|
4
|
-
import { DEBOUNCE as Q } from "./constants.js";
|
|
5
|
-
import { t as X } from "./locale.js";
|
|
6
|
-
import Z from "./Dropdown.js";
|
|
7
|
-
import ee from "./Icon.js";
|
|
8
|
-
const te = Object.freeze({
|
|
9
|
-
key: Symbol("TABS_INJECTION_KEY")
|
|
10
|
-
});
|
|
11
|
-
var N = /* @__PURE__ */ ((i) => (i.Line = "line", i.Enclosed = "enclosed", i))(N || {});
|
|
12
|
-
const oe = {
|
|
13
|
-
class: "root stash-tabs tw-relative",
|
|
14
|
-
role: "tabList",
|
|
15
|
-
"data-test": "stash-tabs"
|
|
16
|
-
}, re = ["aria-controls", "aria-expanded", "onClick"], se = ["id"], ve = /* @__PURE__ */ $({
|
|
17
|
-
__name: "Tabs",
|
|
18
|
-
props: {
|
|
19
|
-
activeTab: {},
|
|
20
|
-
variant: { default: N.Line }
|
|
21
|
-
},
|
|
22
|
-
emits: ["update:activeTab"],
|
|
23
|
-
setup(i, { emit: O }) {
|
|
24
|
-
const d = i, l = a(), c = a(), n = a(void 0), D = "IntersectionObserver" in window, r = a(/* @__PURE__ */ new Set()), m = a(0), h = a(), E = P("more-dropdown-menu-"), u = a(!1), g = p({
|
|
25
|
-
get() {
|
|
26
|
-
return d.activeTab;
|
|
27
|
-
},
|
|
28
|
-
set(t) {
|
|
29
|
-
O("update:activeTab", t);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
function B(t) {
|
|
33
|
-
g.value = t;
|
|
34
|
-
}
|
|
35
|
-
z(te.key, {
|
|
36
|
-
activeTab: p(() => g.value),
|
|
37
|
-
variant: p(() => d.variant),
|
|
38
|
-
setActiveTab: B
|
|
39
|
-
});
|
|
40
|
-
function y() {
|
|
41
|
-
var w, _, T;
|
|
42
|
-
if (!D || !l.value)
|
|
43
|
-
return;
|
|
44
|
-
const t = Array.from((w = l.value) == null ? void 0 : w.children), k = {
|
|
45
|
-
root: l.value,
|
|
46
|
-
rootMargin: "0px",
|
|
47
|
-
threshold: Array.from({ length: 100 }).map((e, o) => (o + 1) / 100)
|
|
48
|
-
};
|
|
49
|
-
if (n.value = new IntersectionObserver((e) => {
|
|
50
|
-
e.forEach((o) => {
|
|
51
|
-
const s = o.target.getAttribute("id");
|
|
52
|
-
o.intersectionRatio > 0.94 ? r.value.has(s) && r.value.delete(s) : s && !r.value.has(s) && r.value.add(s);
|
|
53
|
-
});
|
|
54
|
-
}, k), t.forEach((e) => {
|
|
55
|
-
var o;
|
|
56
|
-
(o = n.value) == null || o.observe(e), r.value.has(e.getAttribute("id")) ? e.classList.add("tw-invisible") : e.classList.remove("tw-invisible");
|
|
57
|
-
}), m.value = (T = (_ = h.value) == null ? void 0 : _.$el) == null ? void 0 : T.getBoundingClientRect().width, !c.value)
|
|
58
|
-
return;
|
|
59
|
-
Array.from(c.value.children).forEach((e) => {
|
|
60
|
-
e.className = "";
|
|
61
|
-
const o = e.firstChild;
|
|
62
|
-
if (o.className = "", e.setAttribute("aria-selected", "false"), e.addEventListener("click", () => {
|
|
63
|
-
e.getAttribute("aria-selected") && e.classList.add("tw-bg-blue-500", "tw-text-white");
|
|
64
|
-
}), r.value.has(e.getAttribute("id")))
|
|
65
|
-
e.classList.remove("tw-hidden"), e.classList.add(
|
|
66
|
-
"tw-rounded",
|
|
67
|
-
"dropdown-link",
|
|
68
|
-
"tw-text-sm",
|
|
69
|
-
"tw-cursor-pointer",
|
|
70
|
-
"tw-p-1.5",
|
|
71
|
-
"hover:tw-bg-blue-500",
|
|
72
|
-
"hover:tw-text-white"
|
|
73
|
-
);
|
|
74
|
-
else {
|
|
75
|
-
e.classList.add("tw-hidden");
|
|
76
|
-
const s = e.firstChild;
|
|
77
|
-
s.className = "";
|
|
78
|
-
}
|
|
79
|
-
e.removeEventListener("click", () => {
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
const M = H(y, Q.FAST, { leading: !0 });
|
|
84
|
-
function v() {
|
|
85
|
-
n.value && (n.value.disconnect(), n.value = void 0);
|
|
86
|
-
}
|
|
87
|
-
U(() => {
|
|
88
|
-
y();
|
|
89
|
-
}), V(() => {
|
|
90
|
-
v(), M();
|
|
91
|
-
}), j(() => {
|
|
92
|
-
v();
|
|
93
|
-
}), J(() => {
|
|
94
|
-
v();
|
|
95
|
-
});
|
|
96
|
-
function S(t) {
|
|
97
|
-
t(), u.value = !u.value;
|
|
98
|
-
}
|
|
99
|
-
return (t, k) => (x(), R("div", oe, [
|
|
100
|
-
f("ul", {
|
|
101
|
-
ref_key: "tabListEl",
|
|
102
|
-
ref: l,
|
|
103
|
-
style: q({
|
|
104
|
-
width: `calc(100% - ${m.value}px)`
|
|
105
|
-
}),
|
|
106
|
-
class: A(["stash-tabs-list tw-flex tw-items-end tw-overflow-hidden", {
|
|
107
|
-
"stash-tabs-list--line": t.variant === "line",
|
|
108
|
-
"stash-tabs-list--enclosed": t.variant === "enclosed",
|
|
109
|
-
"tw-gap-6": t.variant === "line"
|
|
110
|
-
}])
|
|
111
|
-
}, [
|
|
112
|
-
C(t.$slots, "default"),
|
|
113
|
-
r.value.size ? (x(), F(Z, {
|
|
114
|
-
key: 0,
|
|
115
|
-
ref_key: "moreDropdownEl",
|
|
116
|
-
ref: h,
|
|
117
|
-
class: "!tw-absolute tw-right-0 tw-top-0"
|
|
118
|
-
}, {
|
|
119
|
-
toggle: I(({ toggle: L }) => [
|
|
120
|
-
f("button", {
|
|
121
|
-
"aria-haspopup": "menu",
|
|
122
|
-
"aria-controls": b(E),
|
|
123
|
-
"aria-expanded": u.value,
|
|
124
|
-
class: A(["tw-font-medium tw-text-sm tw-border-solid tw-py-1.5 tw-flex tw-items-center tw-justify-center tw-cursor-pointer tw-px-6 tw-text-blue-500 hover:tw-text-blue-700", { "tw-border-t-4 tw-border-transparent": d.variant === "enclosed" }]),
|
|
125
|
-
type: "button",
|
|
126
|
-
onClick: (w) => S(L)
|
|
127
|
-
}, [
|
|
128
|
-
K(W(b(X)("ll.more")) + " ", 1),
|
|
129
|
-
Y(ee, { name: "caret-down" })
|
|
130
|
-
], 10, re)
|
|
131
|
-
]),
|
|
132
|
-
default: I(() => [
|
|
133
|
-
f("ul", {
|
|
134
|
-
id: b(E),
|
|
135
|
-
ref_key: "moreDropdownMenuEl",
|
|
136
|
-
ref: c,
|
|
137
|
-
class: "dropdown-list tw-px-1.5 tw-pb-1.5 tw-space-y-1.5",
|
|
138
|
-
role: "menu"
|
|
139
|
-
}, [
|
|
140
|
-
C(t.$slots, "default")
|
|
141
|
-
], 8, se)
|
|
142
|
-
]),
|
|
143
|
-
_: 3
|
|
144
|
-
}, 512)) : G("", !0)
|
|
145
|
-
], 6)
|
|
146
|
-
]));
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
export {
|
|
150
|
-
te as T,
|
|
151
|
-
ve as _,
|
|
152
|
-
N as a
|
|
153
|
-
};
|
|
154
|
-
//# sourceMappingURL=Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js","sources":["../src/components/Tabs/keys.ts","../src/components/Tabs/models.ts","../src/components/Tabs/Tabs.vue"],"sourcesContent":["import { Injection } from '../../../types/utils';\nimport { TabsInjection } from './models';\n\nexport const TABS_INJECTION: Injection<TabsInjection> = Object.freeze({\n key: Symbol('TABS_INJECTION_KEY'),\n});\n","import { ComputedRef } from 'vue';\n\nexport enum TabVariant {\n Line = 'line',\n Enclosed = 'enclosed',\n}\n\nexport type TabVariants = `${TabVariant}`;\n\nexport interface TabsInjection {\n activeTab: ComputedRef<string>;\n variant: ComputedRef<TabVariants>;\n setActiveTab: (newTabValue: string) => void;\n}\n","<script lang=\"ts\">\n import { TabVariant, TabVariants } from './models';\n\n export * from './keys';\n export * from './models';\n\n export interface TabsProps {\n /**\n * The currently active tab value\n */\n activeTab: string;\n\n /**\n * Tabs variant\n */\n variant?: TabVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import debounce from 'lodash-es/debounce';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, onDeactivated, onMounted, onUpdated, provide, Ref, ref } from 'vue';\n\n import { DEBOUNCE } from '../../constants';\n import { t } from '../../locale';\n import Dropdown from '../Dropdown/Dropdown.vue';\n import Icon from '../Icon/Icon.vue';\n import { TABS_INJECTION } from './keys';\n\n const emit =\n defineEmits<{\n (e: 'update:activeTab', newTabValue: TabsProps['activeTab']): void;\n }>();\n\n const props = withDefaults(defineProps<TabsProps>(), {\n variant: TabVariant.Line,\n });\n\n const tabListEl = ref();\n const moreDropdownMenuEl = ref();\n const observer: Ref<IntersectionObserver | undefined> = ref(undefined);\n const hasIntersectionObserver = 'IntersectionObserver' in window;\n const overflowIds = ref<Set<string>>(new Set());\n const moreDropdownWidth = ref(0);\n const moreDropdownEl = ref<InstanceType<typeof Dropdown>>();\n const moreMenuId = uniqueId('more-dropdown-menu-');\n const isMoreMenuOpen = ref(false);\n\n const currentActiveTab = computed({\n get() {\n return props.activeTab;\n },\n set(nv: TabsProps['activeTab']) {\n emit('update:activeTab', nv);\n },\n });\n\n function setActiveTab(newTabValue: TabsProps['activeTab']) {\n currentActiveTab.value = newTabValue;\n }\n\n provide(TABS_INJECTION.key, {\n activeTab: computed(() => currentActiveTab.value),\n variant: computed(() => props.variant),\n setActiveTab,\n });\n\n function initObserve() {\n if (!hasIntersectionObserver) {\n return;\n }\n\n if (!tabListEl.value) {\n return;\n }\n\n const tabs = Array.from(tabListEl.value?.children as HTMLLIElement[]);\n const options = {\n root: tabListEl.value,\n rootMargin: '0px',\n threshold: Array.from({ length: 100 }).map((v, i) => (i + 1) / 100),\n };\n\n observer.value = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n const dataId = entry.target.getAttribute('id') as string;\n /**\n * Check for partial intersection.\n * Zooming out can result in ratio of approx 0.984\n * Anything higher will result in nav items disappearing\n */\n if (entry.intersectionRatio > 0.94) {\n // show tab, hide in dropdown\n if (overflowIds.value.has(dataId)) {\n overflowIds.value.delete(dataId);\n }\n } else {\n // hide tab, show in dropdown\n if (dataId && !overflowIds.value.has(dataId)) {\n overflowIds.value.add(dataId);\n }\n }\n });\n }, options);\n\n tabs.forEach((element) => {\n observer.value?.observe(element);\n if (overflowIds.value.has(element.getAttribute('id') as string)) {\n element.classList.add('tw-invisible');\n } else {\n element.classList.remove('tw-invisible');\n }\n });\n\n moreDropdownWidth.value = moreDropdownEl.value?.$el?.getBoundingClientRect().width;\n\n if (!moreDropdownMenuEl.value) {\n return;\n }\n\n const dropdownList = Array.from(moreDropdownMenuEl.value.children as HTMLLIElement[]);\n dropdownList.forEach((element) => {\n element.className = '';\n const el = element.firstChild as Element;\n el.className = '';\n element.setAttribute('aria-selected', 'false');\n\n element.addEventListener('click', () => {\n if (element.getAttribute('aria-selected')) {\n element.classList.add('tw-bg-blue-500', 'tw-text-white');\n }\n });\n\n if (!overflowIds.value.has(element.getAttribute('id') as string)) {\n element.classList.add('tw-hidden');\n const el = element.firstChild as Element;\n el.className = '';\n } else {\n element.classList.remove('tw-hidden');\n element.classList.add(\n 'tw-rounded',\n 'dropdown-link',\n 'tw-text-sm',\n 'tw-cursor-pointer',\n 'tw-p-1.5',\n 'hover:tw-bg-blue-500',\n 'hover:tw-text-white',\n );\n }\n\n element.removeEventListener('click', () => {});\n });\n }\n\n const debouncedInitObserve = debounce(initObserve, DEBOUNCE.FAST, { leading: true });\n\n function destroyObserver() {\n if (observer.value) {\n observer.value.disconnect();\n observer.value = undefined;\n }\n }\n\n onMounted(() => {\n initObserve();\n });\n\n onUpdated(() => {\n destroyObserver();\n debouncedInitObserve();\n });\n\n onDeactivated(() => {\n destroyObserver();\n });\n\n onBeforeUnmount(() => {\n destroyObserver();\n });\n\n function onMoreClick(toggleMoreDropdown) {\n toggleMoreDropdown();\n isMoreMenuOpen.value = !isMoreMenuOpen.value;\n }\n</script>\n\n<template>\n <div class=\"root stash-tabs tw-relative\" role=\"tabList\" data-test=\"stash-tabs\">\n <ul\n ref=\"tabListEl\"\n :style=\"{\n width: `calc(100% - ${moreDropdownWidth}px)`,\n }\"\n class=\"stash-tabs-list tw-flex tw-items-end tw-overflow-hidden\"\n :class=\"{\n 'stash-tabs-list--line': variant === 'line',\n 'stash-tabs-list--enclosed': variant === 'enclosed',\n 'tw-gap-6': variant === 'line',\n }\"\n >\n <slot></slot>\n\n <Dropdown v-if=\"overflowIds.size\" ref=\"moreDropdownEl\" class=\"!tw-absolute tw-right-0 tw-top-0\">\n <template #toggle=\"{ toggle }\">\n <button\n aria-haspopup=\"menu\"\n :aria-controls=\"moreMenuId\"\n :aria-expanded=\"isMoreMenuOpen\"\n class=\"\n tw-font-medium\n tw-text-sm\n tw-border-solid\n tw-py-1.5\n tw-flex\n tw-items-center\n tw-justify-center\n tw-cursor-pointer\n tw-px-6\n tw-text-blue-500\n hover:tw-text-blue-700\n \"\n :class=\"{ 'tw-border-t-4 tw-border-transparent': props.variant === 'enclosed' }\"\n type=\"button\"\n @click=\"onMoreClick(toggle)\"\n >\n {{ t('ll.more') }}\n <Icon name=\"caret-down\" />\n </button>\n </template>\n <template #default>\n <ul\n :id=\"moreMenuId\"\n ref=\"moreDropdownMenuEl\"\n class=\"dropdown-list tw-px-1.5 tw-pb-1.5 tw-space-y-1.5\"\n role=\"menu\"\n >\n <slot></slot>\n </ul>\n </template>\n </Dropdown>\n </ul>\n </div>\n</template>\n"],"names":["TABS_INJECTION","TabVariant","tabListEl","ref","moreDropdownMenuEl","observer","hasIntersectionObserver","overflowIds","moreDropdownWidth","moreDropdownEl","moreMenuId","uniqueId","isMoreMenuOpen","currentActiveTab","computed","props","nv","emit","setActiveTab","newTabValue","provide","initObserve","tabs","_a","options","v","i","entries","entry","dataId","element","_c","_b","el","debouncedInitObserve","debounce","DEBOUNCE","destroyObserver","onMounted","onUpdated","onDeactivated","onBeforeUnmount","onMoreClick","toggleMoreDropdown"],"mappings":";;;;;;;AAGa,MAAAA,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