@leaflink/stash 49.1.0 → 49.3.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/DataViewToolbar.js +47 -45
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DataViewToolbar.vue.d.ts +12 -4
- package/dist/ObfuscateText.js +25 -26
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +12 -9
- package/dist/PageNavigation.js +8 -8
- package/dist/Tab.js +96 -7
- package/dist/Tab.js.map +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-3aa36673.js → Tabs.vue_used_vue_type_style_index_0_lang.module-d7530989.js} +13 -13
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-3aa36673.js.map → Tabs.vue_used_vue_type_style_index_0_lang.module-d7530989.js.map} +1 -1
- package/dist/components.css +1 -1
- package/dist/obfuscateText.d.ts +25 -0
- package/dist/utils/obfuscateText.js +10 -0
- package/dist/utils/obfuscateText.js.map +1 -0
- package/package.json +1 -1
- package/dist/Tab.vue_vue_type_script_setup_true_lang-9aa53203.js +0 -93
- package/dist/Tab.vue_vue_type_script_setup_true_lang-9aa53203.js.map +0 -1
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { defineComponent as x, inject as T, computed as o, onMounted as k, nextTick as g, toRefs as u, openBlock as c, createElementBlock as y, normalizeClass as _, unref as n, withKeys as C, createBlock as P, resolveDynamicComponent as B, mergeProps as E, withCtx as b, createElementVNode as $, createVNode as N, renderSlot as A } from "vue";
|
|
2
|
-
import I from "@leaflink/snitch";
|
|
3
|
-
import j from "./Badge.js";
|
|
4
|
-
import { T as D } from "./Tabs.vue_used_vue_type_style_index_0_lang.module-3aa36673.js";
|
|
5
|
-
const L = ["id", "aria-selected", "aria-controls", "aria-disabled"], V = { class: "tw-mt-0.5" }, J = /* @__PURE__ */ x({
|
|
6
|
-
__name: "Tab",
|
|
7
|
-
props: {
|
|
8
|
-
value: {},
|
|
9
|
-
to: {},
|
|
10
|
-
href: {},
|
|
11
|
-
badge: {},
|
|
12
|
-
disabled: { type: Boolean },
|
|
13
|
-
anchorProps: {},
|
|
14
|
-
routerLinkProps: {}
|
|
15
|
-
},
|
|
16
|
-
setup(p) {
|
|
17
|
-
const e = p, l = T(D.key);
|
|
18
|
-
if (!l)
|
|
19
|
-
throw Error("The Tab component must be a child of the Tabs component.");
|
|
20
|
-
const { setActiveTab: v, activeTab: w, variant: a } = l, t = o(() => e.value === w.value), f = o(() => e.to ? "router-link" : e.href ? "a" : "button");
|
|
21
|
-
function d(i) {
|
|
22
|
-
e.disabled || v(i);
|
|
23
|
-
}
|
|
24
|
-
const s = o(() => `tabpanel-${e.value}`);
|
|
25
|
-
k(async () => {
|
|
26
|
-
await g(), process.env.NODE_ENV !== "test" && t.value && !document.getElementById(s.value) && I.warn(
|
|
27
|
-
`The <Tab> with value "${e.value}" is active, but its corresponding tab panel cannot be found. Please ensure that the corresponding tab panel has an "id" attribute with value "${s.value}" and a "role" attribute with value "tabpanel".`
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
const h = o(() => e.to && e.routerLinkProps ? u(e.routerLinkProps) : e.href && e.anchorProps ? u(e.anchorProps) : {});
|
|
31
|
-
return (i, r) => (c(), y("li", {
|
|
32
|
-
id: `tab-${e.value}`,
|
|
33
|
-
role: "tab",
|
|
34
|
-
"aria-selected": t.value,
|
|
35
|
-
"aria-controls": s.value,
|
|
36
|
-
"aria-disabled": e.disabled,
|
|
37
|
-
class: _(["stash-tab", [
|
|
38
|
-
{
|
|
39
|
-
"stash-tab--active is-active": t.value,
|
|
40
|
-
"stash-tab--disabled": e.disabled,
|
|
41
|
-
"stash-tab--variant-line": n(a) === "line",
|
|
42
|
-
"stash-tab--variant-enclosed": n(a) === "enclosed"
|
|
43
|
-
}
|
|
44
|
-
]]),
|
|
45
|
-
onClick: r[0] || (r[0] = (m) => d(e.value)),
|
|
46
|
-
onKeypress: r[1] || (r[1] = C((m) => d(e.value), ["enter"]))
|
|
47
|
-
}, [
|
|
48
|
-
(c(), P(B(f.value), E(h.value, {
|
|
49
|
-
to: e.to,
|
|
50
|
-
href: e.href,
|
|
51
|
-
class: ["tw-flex tw-cursor-pointer tw-items-center tw-justify-center tw-whitespace-nowrap tw-border-solid tw-py-1.5 tw-text-sm tw-font-medium hover:tw-no-underline", [
|
|
52
|
-
{
|
|
53
|
-
"tw-border-b-2": n(a) === "line",
|
|
54
|
-
"tw-border-t-4 tw-px-6": n(a) === "enclosed",
|
|
55
|
-
"tw-rounded-t tw-bg-white": t.value && n(a) === "enclosed",
|
|
56
|
-
"focus:tw-no-underline": e.href,
|
|
57
|
-
"tw-pointer-events-none tw-text-ice-500": e.disabled,
|
|
58
|
-
"tw-text-ice-700": !e.disabled && !t.value
|
|
59
|
-
},
|
|
60
|
-
[
|
|
61
|
-
t.value ? "tw-border-blue-500 tw-text-blue-500" : "tw-border-transparent hover:tw-text-blue-500 focus:tw-text-blue-500"
|
|
62
|
-
]
|
|
63
|
-
]],
|
|
64
|
-
tabindex: e.disabled ? -1 : 0
|
|
65
|
-
}), {
|
|
66
|
-
default: b(() => [
|
|
67
|
-
$("div", V, [
|
|
68
|
-
N(j, {
|
|
69
|
-
content: e.badge,
|
|
70
|
-
position: "inline",
|
|
71
|
-
color: "red",
|
|
72
|
-
"is-disabled": e.disabled
|
|
73
|
-
}, {
|
|
74
|
-
default: b(() => [
|
|
75
|
-
A(i.$slots, "default", {
|
|
76
|
-
isActive: t.value,
|
|
77
|
-
isDisabled: e.disabled,
|
|
78
|
-
variant: n(a)
|
|
79
|
-
})
|
|
80
|
-
]),
|
|
81
|
-
_: 3
|
|
82
|
-
}, 8, ["content", "is-disabled"])
|
|
83
|
-
])
|
|
84
|
-
]),
|
|
85
|
-
_: 3
|
|
86
|
-
}, 16, ["to", "href", "class", "tabindex"]))
|
|
87
|
-
], 42, L));
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
export {
|
|
91
|
-
J as _
|
|
92
|
-
};
|
|
93
|
-
//# sourceMappingURL=Tab.vue_vue_type_script_setup_true_lang-9aa53203.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.vue_vue_type_script_setup_true_lang-9aa53203.js","sources":["../src/components/Tab/Tab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, inject, nextTick, onMounted, toRefs } from 'vue';\n import { type RouteLocationRaw, type RouterLinkProps } from 'vue-router';\n\n import Badge from '../Badge/Badge.vue';\n import { TABS_INJECTION } from '../Tabs/Tabs.vue';\n\n /**\n * Allowed attributes for the `<a>` element when the `href` prop is used.\n */\n type AnchorAttrs =\n | HTMLAnchorElement['download']\n | HTMLAnchorElement['hreflang']\n | HTMLAnchorElement['ping']\n | HTMLAnchorElement['referrerPolicy']\n | HTMLAnchorElement['rel']\n | HTMLAnchorElement['target']\n | HTMLAnchorElement['type'];\n\n export interface TabProps {\n /**\n * The tab identifier\n */\n value: string;\n\n /**\n * Router link `to` prop\n */\n to?: RouteLocationRaw;\n\n /**\n * Anchor tag href. Used for navigating to non-vue pages, such as Django pages in marketplace.\n */\n href?: string;\n\n /**\n * The badge's content\n */\n badge?: string | number;\n\n /**\n * Will render a plain text item if true.\n */\n disabled?: boolean;\n\n /**\n * Props for the `<a>` element when the `href` prop is used\n */\n anchorProps?: Record<AnchorAttrs, string>;\n\n /**\n * Props for the `<RouterLink>` element when the `to` prop is used\n */\n routerLinkProps?: Omit<RouterLinkProps, 'to'>;\n }\n\n const props = defineProps<TabProps>();\n\n const tabsInjection = inject(TABS_INJECTION.key);\n\n if (!tabsInjection) {\n throw Error('The Tab component must be a child of the Tabs component.');\n }\n\n const { setActiveTab, activeTab, variant } = tabsInjection;\n\n const isTabActive = computed(() => {\n return props.value === activeTab.value;\n });\n\n const is = computed(() => {\n if (props.to) {\n return 'router-link';\n }\n\n if (props.href) {\n return 'a';\n }\n\n return 'button';\n });\n\n /**\n * Note: this click handler gets ignored when the `href` prop is used; `preventDefault()` is intentionally omitted in order to enable the `href` prop to work correctly. The `href` prop is used for navigation to non-vue pages, such as Django pages in marketplace.\n */\n function onClick(tabValue: string) {\n if (props.disabled) {\n return;\n }\n\n setActiveTab(tabValue);\n }\n\n const panelId = computed(() => `tabpanel-${props.value}`);\n\n onMounted(async () => {\n await nextTick();\n\n if (process.env.NODE_ENV !== 'test' && isTabActive.value && !document.getElementById(panelId.value)) {\n // The following warning ensures optimal accessibility is maintained when using the Tabs component. See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tab_role#example\n logger.warn(\n `The <Tab> with value \"${props.value}\" is active, but its corresponding tab panel cannot be found. Please ensure that the corresponding tab panel has an \"id\" attribute with value \"${panelId.value}\" and a \"role\" attribute with value \"tabpanel\".`,\n );\n }\n });\n\n const dynamicComponentAttrs = computed(() => {\n if (props.to && props.routerLinkProps) {\n return toRefs(props.routerLinkProps);\n }\n\n if (props.href && props.anchorProps) {\n return toRefs(props.anchorProps);\n }\n\n return {};\n });\n</script>\n\n<template>\n <li\n :id=\"`tab-${props.value}`\"\n role=\"tab\"\n :aria-selected=\"isTabActive\"\n :aria-controls=\"panelId\"\n :aria-disabled=\"props.disabled\"\n class=\"stash-tab\"\n :class=\"[\n {\n 'stash-tab--active is-active': isTabActive,\n 'stash-tab--disabled': props.disabled,\n 'stash-tab--variant-line': variant === 'line',\n 'stash-tab--variant-enclosed': variant === 'enclosed',\n },\n ]\"\n @click=\"onClick(props.value)\"\n @keypress.enter=\"onClick(props.value)\"\n >\n <component\n v-bind=\"dynamicComponentAttrs\"\n :is=\"is\"\n :to=\"props.to\"\n :href=\"props.href\"\n class=\"tw-flex tw-cursor-pointer tw-items-center tw-justify-center tw-whitespace-nowrap tw-border-solid tw-py-1.5 tw-text-sm tw-font-medium hover:tw-no-underline\"\n :class=\"[\n {\n 'tw-border-b-2': variant === 'line',\n 'tw-border-t-4 tw-px-6': variant === 'enclosed',\n 'tw-rounded-t tw-bg-white': isTabActive && variant === 'enclosed',\n 'focus:tw-no-underline': props.href,\n 'tw-pointer-events-none tw-text-ice-500': props.disabled,\n 'tw-text-ice-700': !props.disabled && !isTabActive,\n },\n [\n isTabActive\n ? 'tw-border-blue-500 tw-text-blue-500'\n : 'tw-border-transparent hover:tw-text-blue-500 focus:tw-text-blue-500',\n ],\n ]\"\n :tabindex=\"props.disabled ? -1 : 0\"\n >\n <!-- The margin-top on the <div> below is necessary to fix the vertical alignment of text in the default slot since our Sofia font has extra space under the baseline -->\n <div class=\"tw-mt-0.5\">\n <Badge :content=\"props.badge\" position=\"inline\" color=\"red\" :is-disabled=\"props.disabled\">\n <slot :is-active=\"isTabActive\" :is-disabled=\"props.disabled\" :variant=\"variant\"></slot>\n </Badge>\n </div>\n </component>\n </li>\n</template>\n"],"names":["props","__props","tabsInjection","inject","TABS_INJECTION","setActiveTab","activeTab","variant","isTabActive","computed","is","onClick","tabValue","panelId","onMounted","nextTick","logger","dynamicComponentAttrs","toRefs"],"mappings":";;;;;;;;;;;;;;;;AAyDE,UAAMA,IAAQC,GAERC,IAAgBC,EAAOC,EAAe,GAAG;AAE/C,QAAI,CAACF;AACH,YAAM,MAAM,0DAA0D;AAGxE,UAAM,EAAE,cAAAG,GAAc,WAAAC,GAAW,SAAAC,EAAA,IAAYL,GAEvCM,IAAcC,EAAS,MACpBT,EAAM,UAAUM,EAAU,KAClC,GAEKI,IAAKD,EAAS,MACdT,EAAM,KACD,gBAGLA,EAAM,OACD,MAGF,QACR;AAKD,aAASW,EAAQC,GAAkB;AACjC,MAAIZ,EAAM,YAIVK,EAAaO,CAAQ;AAAA,IACvB;AAEA,UAAMC,IAAUJ,EAAS,MAAM,YAAYT,EAAM,OAAO;AAExD,IAAAc,EAAU,YAAY;AACpB,YAAMC,EAAS,GAEX,QAAQ,IAAI,aAAa,UAAUP,EAAY,SAAS,CAAC,SAAS,eAAeK,EAAQ,KAAK,KAEzFG,EAAA;AAAA,QACL,yBAAyBhB,EAAM,uJAAuJa,EAAQ;AAAA,MAAA;AAAA,IAElM,CACD;AAEK,UAAAI,IAAwBR,EAAS,MACjCT,EAAM,MAAMA,EAAM,kBACbkB,EAAOlB,EAAM,eAAe,IAGjCA,EAAM,QAAQA,EAAM,cACfkB,EAAOlB,EAAM,WAAW,IAG1B,EACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|