@leaflink/stash 48.21.1 → 49.0.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/ActionsDropdown.js +1 -1
- package/dist/AddressSelect.js +15 -14
- package/dist/AddressSelect.js.map +1 -1
- package/dist/Alert.js +1 -1
- package/dist/Copy.js +1 -1
- package/dist/DataViewSortButton.js +1 -1
- package/dist/Dropdown.js +1 -1
- package/dist/FilterDropdown.js +1 -1
- package/dist/Filters.js +4 -3
- package/dist/Filters.js.map +1 -1
- package/dist/InputOptions.js +4 -3
- package/dist/InputOptions.js.map +1 -1
- package/dist/ListView.js +9 -8
- package/dist/ListView.js.map +1 -1
- package/dist/ModalsPlugin.js +10 -12
- package/dist/ModalsPlugin.js.map +1 -1
- package/dist/PageNavigation.js +1 -1
- package/dist/Select.js +272 -1277
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +10 -9
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Tab.js +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/ToastsPlugin.js +7 -9
- package/dist/ToastsPlugin.js.map +1 -1
- package/dist/Tooltip.js +199 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/Tooltip.vue.d.ts +106 -0
- package/dist/components.css +1 -1
- package/dist/directives/autofocus.js.map +1 -0
- package/dist/directives/clickoutside.js.map +1 -0
- package/dist/directives/observe.js.map +1 -0
- package/dist/directives/sticky.js.map +1 -0
- package/dist/{tooltip.js → directives/tooltip.js} +3 -3
- package/dist/directives/tooltip.js.map +1 -0
- package/dist/directives/viewable.js.map +1 -0
- package/dist/floating-ui.vue-8d7f7932.js +1069 -0
- package/dist/floating-ui.vue-8d7f7932.js.map +1 -0
- package/dist/index.js +20 -22
- package/dist/index.js.map +1 -1
- package/dist/tooltip.d.ts +1 -0
- package/package.json +6 -1
- package/styles/base.css +2 -2
- package/dist/autofocus.js.map +0 -1
- package/dist/clickoutside.js.map +0 -1
- package/dist/observe.js.map +0 -1
- package/dist/sticky.js.map +0 -1
- package/dist/tooltip.js.map +0 -1
- package/dist/viewable.js.map +0 -1
- /package/dist/{autofocus.js → directives/autofocus.js} +0 -0
- /package/dist/{clickoutside.js → directives/clickoutside.js} +0 -0
- /package/dist/{observe.js → directives/observe.js} +0 -0
- /package/dist/{sticky.js → directives/sticky.js} +0 -0
- /package/dist/{viewable.js → directives/viewable.js} +0 -0
package/dist/SelectStatus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectStatus.js","sources":["../src/components/SelectStatus/SelectStatus.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useAttrs, useCssModule } from 'vue';\n\n import { StashCommonColor, StashPrimaryColorGroup } from '../../../types';\n import { IconName } from '../Icon/Icon.types';\n import Icon from '../Icon/Icon.vue';\n import Select from '../Select/Select.vue';\n\n defineOptions({\n name: 'll-select-status',\n });\n\n export type SelectStatusOption = {\n id: number | string;\n name: string;\n color?: StashPrimaryColorGroup | StashCommonColor; // todo: just `StashPrimaryColor`?.\n icon?: IconName;\n };\n\n export interface SelectStatusProps {\n /**\n * Disables the component, if true\n */\n disabled?: boolean;\n /**\n * Which key of the prop option to use for display\n */\n displayBy?: string;\n /**\n * Sets the background color of the component to the color of the selected option\n */\n secondary?: boolean;\n /**\n * Allows option text to wrap to next line when set to true\n */\n noTruncate?: boolean;\n /**\n * Placeholder text\n */\n placeholder?: string;\n /**\n * The list of all options to select the status from\n * each object must have the following structure: { id: number | string, name: string, color?: string }\n */\n statusOptions: Array<SelectStatusOption>;\n /**\n * Default field to track the selected status by\n */\n trackBy?: string;\n /**\n * Sets the currently-selected option for the component\n */\n modelValue: number | string | boolean;\n /**\n * @deprecated Use `:model-value` or `v-model` instead of `:value`.\n */\n value?: number | string | boolean | null;\n }\n\n /**\n * Array containing the available dark fill colors that need a different text color.\n */\n const DARK_FILL_COLORS = ['green', 'teal', 'ice', 'yellow', 'seafoam', 'seafoam-700'];\n\n const attrs = useAttrs();\n const classes = useCssModule();\n\n const props = withDefaults(defineProps<SelectStatusProps>(), {\n disabled: false,\n displayBy: 'name',\n secondary: false,\n noTruncate: false,\n placeholder: 'Select Status',\n trackBy: 'id',\n value: null,\n });\n\n if (props.value) {\n throw new Error('ll-select-status: use :model-value or v-model instead of :value.');\n }\n\n if (attrs.onInput) {\n throw new Error('ll-select-status: use the @update:model-value event instead of @input');\n }\n\n const emit = defineEmits<{\n /**\n * Emitted when the model value changes\n */\n (e: 'update:model-value', value: unknown): void;\n }>();\n\n const valueOption = computed(() => {\n return props.statusOptions.find((status) => status[props.trackBy] === props.modelValue);\n });\n\n const hasDarkFill = computed(() => {\n const { color = '' } = valueOption.value || {};\n return DARK_FILL_COLORS.includes(color);\n });\n\n /**\n * @param {string} color Valid color name\n * @return {string} tailwind class for given color\n */\n function getBgColor(color: SelectStatusOption['color']): string {\n // if there's no hyphen then it's a color name and has no shade, so we default to 500\n return color?.includes('-') ? `tw-bg-${color}` : `tw-bg-${color}-500`;\n }\n\n /**\n * @param {string} color Valid color name\n * @return {string} tailwind class for given color\n */\n function getTextColor(color: SelectStatusOption['color']): string {\n // if there's no hyphen then it's a color name and has no shade, so we default to 500\n return color?.includes('-') ? `tw-text-${color}` : `tw-text-${color}-500`;\n }\n\n function onSelect(value?: SelectStatusOption): void {\n emit('update:model-value', value?.[props.trackBy] ?? '');\n }\n</script>\n\n<template>\n <Select\n ref=\"select\"\n hide-search\n single\n :class=\"[\n classes.select,\n {\n 'stash-select-status--filled': props.secondary,\n 'stash-select-status--filled-dark': props.secondary && hasDarkFill,\n },\n ]\"\n :disabled=\"props.disabled\"\n :icon=\"!props.disabled && 'caret-down'\"\n :options=\"props.statusOptions\"\n :placeholder=\"props.placeholder\"\n :track-by=\"props.trackBy\"\n :model-value=\"valueOption\"\n data-test=\"stash-select-status\"\n class=\"stash-select-status\"\n @update:model-value=\"onSelect\"\n >\n <template #selected=\"{ option }\">\n <div\n v-if=\"props.secondary\"\n class=\"stash-select-status--selected tw-absolute tw-inset-0 tw-flex tw-h-full tw-w-full tw-items-center tw-rounded tw-pl-3\"\n data-test=\"select-status|value\"\n :class=\"[getBgColor(option.color)]\"\n >\n <span class=\"tw-mr-6 tw-truncate\">{{ option[props.displayBy] }}</span>\n </div>\n\n <div v-else class=\"tw-flex tw-items-center\" data-test=\"select-status|value\">\n <Icon\n data-test=\"select-status|value-icon\"\n :name=\"option.icon || 'circle-status'\"\n :class=\"[\n { [getTextColor(option.color)]: option.color },\n { 'tw-text-ice-700': !option.color && !option.hexCode },\n ]\"\n :style=\"{ color: option.hexCode }\"\n />\n <span class=\"tw-ml-1.5 tw-mr-6 tw-truncate\">{{ option[props.displayBy] }}</span>\n </div>\n </template>\n\n <template #option=\"{ option }\">\n <div class=\"tw-flex tw-min-w-0\">\n <Icon\n data-test=\"svg|status-color\"\n :name=\"option.icon || 'circle-status'\"\n :class=\"[\n { [getTextColor(option.color)]: option.color },\n { 'tw-text-ice-700': !option.color && !option.hexCode },\n ]\"\n class=\"!tw-shrink-0\"\n :style=\"{ color: option.hexCode }\"\n />\n <span data-test=\"span|option-text\" class=\"tw-ml-1.5\" :class=\"!props.noTruncate && 'tw-truncate'\">\n {{ option[props.displayBy] }}\n </span>\n </div>\n </template>\n </Select>\n</template>\n\n<style module>\n :global(.stash-select-status--filled .stash-select__content) {\n border: none;\n padding: 0;\n }\n\n :global(\n .stash-select-status--filled\n .stash-select--active\n .stash-select__content:focus-within\n .stash-select__border-selector\n ) {\n box-sizing: content-box;\n max-width: calc(100% - 2px);\n }\n\n :global(.stash-select-status--filled .stash-select-status--selected),\n :global(.stash-select-status--filled :has(.stash-select-status--selected) .icon--caret-down) {\n color: theme('colors.white');\n }\n\n :global(.stash-select-status--filled-dark .stash-select-status--selected),\n :global(.stash-select-status--filled-dark :has(.stash-select-status--selected) .icon--caret-down) {\n color: var(--color-ice-900);\n }\n\n .select :global(.stash-select--disabled > .stash-select__content) {\n background-color: transparent;\n border-color: transparent;\n }\n\n .select :deep(.stash-select__chips) {\n margin: 0;\n }\n\n .select :global(.stash-select__options) {\n margin: 0;\n padding: 0;\n }\n\n .select ul {\n position: relative;\n }\n</style>\n"],"names":["DARK_FILL_COLORS","attrs","useAttrs","classes","useCssModule","props","__props","emit","__emit","valueOption","computed","status","hasDarkFill","color","getBgColor","getTextColor","onSelect","value"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectStatus.js","sources":["../src/components/SelectStatus/SelectStatus.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useAttrs, useCssModule } from 'vue';\n\n import { StashCommonColor, StashPrimaryColorGroup } from '../../../types';\n import { IconName } from '../Icon/Icon.types';\n import Icon from '../Icon/Icon.vue';\n import Select from '../Select/Select.vue';\n\n defineOptions({\n name: 'll-select-status',\n });\n\n export type SelectStatusOption = {\n id: number | string;\n name: string;\n color?: StashPrimaryColorGroup | StashCommonColor; // todo: just `StashPrimaryColor`?.\n icon?: IconName;\n };\n\n export interface SelectStatusProps {\n /**\n * Disables the component, if true\n */\n disabled?: boolean;\n /**\n * Which key of the prop option to use for display\n */\n displayBy?: string;\n /**\n * Sets the background color of the component to the color of the selected option\n */\n secondary?: boolean;\n /**\n * Allows option text to wrap to next line when set to true\n */\n noTruncate?: boolean;\n /**\n * Placeholder text\n */\n placeholder?: string;\n /**\n * The list of all options to select the status from\n * each object must have the following structure: { id: number | string, name: string, color?: string }\n */\n statusOptions: Array<SelectStatusOption>;\n /**\n * Default field to track the selected status by\n */\n trackBy?: string;\n /**\n * Sets the currently-selected option for the component\n */\n modelValue: number | string | boolean;\n /**\n * @deprecated Use `:model-value` or `v-model` instead of `:value`.\n */\n value?: number | string | boolean | null;\n }\n\n /**\n * Array containing the available dark fill colors that need a different text color.\n */\n const DARK_FILL_COLORS = ['green', 'teal', 'ice', 'yellow', 'seafoam', 'seafoam-700'];\n\n const attrs = useAttrs();\n const classes = useCssModule();\n\n const props = withDefaults(defineProps<SelectStatusProps>(), {\n disabled: false,\n displayBy: 'name',\n secondary: false,\n noTruncate: false,\n placeholder: 'Select Status',\n trackBy: 'id',\n value: null,\n });\n\n if (props.value) {\n throw new Error('ll-select-status: use :model-value or v-model instead of :value.');\n }\n\n if (attrs.onInput) {\n throw new Error('ll-select-status: use the @update:model-value event instead of @input');\n }\n\n const emit = defineEmits<{\n /**\n * Emitted when the model value changes\n */\n (e: 'update:model-value', value: unknown): void;\n }>();\n\n const valueOption = computed(() => {\n return props.statusOptions.find((status) => status[props.trackBy] === props.modelValue);\n });\n\n const hasDarkFill = computed(() => {\n const { color = '' } = valueOption.value || {};\n return DARK_FILL_COLORS.includes(color);\n });\n\n /**\n * @param {string} color Valid color name\n * @return {string} tailwind class for given color\n */\n function getBgColor(color: SelectStatusOption['color']): string {\n // if there's no hyphen then it's a color name and has no shade, so we default to 500\n return color?.includes('-') ? `tw-bg-${color}` : `tw-bg-${color}-500`;\n }\n\n /**\n * @param {string} color Valid color name\n * @return {string} tailwind class for given color\n */\n function getTextColor(color: SelectStatusOption['color']): string {\n // if there's no hyphen then it's a color name and has no shade, so we default to 500\n return color?.includes('-') ? `tw-text-${color}` : `tw-text-${color}-500`;\n }\n\n function onSelect(value?: SelectStatusOption): void {\n emit('update:model-value', value?.[props.trackBy] ?? '');\n }\n</script>\n\n<template>\n <Select\n ref=\"select\"\n hide-search\n single\n :class=\"[\n classes.select,\n {\n 'stash-select-status--filled': props.secondary,\n 'stash-select-status--filled-dark': props.secondary && hasDarkFill,\n },\n ]\"\n :disabled=\"props.disabled\"\n :icon=\"!props.disabled && 'caret-down'\"\n :options=\"props.statusOptions\"\n :placeholder=\"props.placeholder\"\n :track-by=\"props.trackBy\"\n :model-value=\"valueOption\"\n data-test=\"stash-select-status\"\n class=\"stash-select-status\"\n @update:model-value=\"onSelect\"\n >\n <template #selected=\"{ option }\">\n <div\n v-if=\"props.secondary\"\n class=\"stash-select-status--selected tw-absolute tw-inset-0 tw-flex tw-h-full tw-w-full tw-items-center tw-rounded tw-pl-3\"\n data-test=\"select-status|value\"\n :class=\"[getBgColor(option.color)]\"\n >\n <span class=\"tw-mr-6 tw-truncate\">{{ option[props.displayBy] }}</span>\n </div>\n\n <div v-else class=\"tw-flex tw-items-center\" data-test=\"select-status|value\">\n <Icon\n data-test=\"select-status|value-icon\"\n :name=\"option.icon || 'circle-status'\"\n :class=\"[\n { [getTextColor(option.color)]: option.color },\n { 'tw-text-ice-700': !option.color && !option.hexCode },\n ]\"\n :style=\"{ color: option.hexCode }\"\n />\n <span class=\"tw-ml-1.5 tw-mr-6 tw-truncate\">{{ option[props.displayBy] }}</span>\n </div>\n </template>\n\n <template #option=\"{ option }\">\n <div class=\"tw-flex tw-min-w-0\">\n <Icon\n data-test=\"svg|status-color\"\n :name=\"option.icon || 'circle-status'\"\n :class=\"[\n { [getTextColor(option.color)]: option.color },\n { 'tw-text-ice-700': !option.color && !option.hexCode },\n ]\"\n class=\"!tw-shrink-0\"\n :style=\"{ color: option.hexCode }\"\n />\n <span data-test=\"span|option-text\" class=\"tw-ml-1.5\" :class=\"!props.noTruncate && 'tw-truncate'\">\n {{ option[props.displayBy] }}\n </span>\n </div>\n </template>\n </Select>\n</template>\n\n<style module>\n :global(.stash-select-status--filled .stash-select__content) {\n border: none;\n padding: 0;\n }\n\n :global(\n .stash-select-status--filled\n .stash-select--active\n .stash-select__content:focus-within\n .stash-select__border-selector\n ) {\n box-sizing: content-box;\n max-width: calc(100% - 2px);\n }\n\n :global(.stash-select-status--filled .stash-select-status--selected),\n :global(.stash-select-status--filled :has(.stash-select-status--selected) .icon--caret-down) {\n color: theme('colors.white');\n }\n\n :global(.stash-select-status--filled-dark .stash-select-status--selected),\n :global(.stash-select-status--filled-dark :has(.stash-select-status--selected) .icon--caret-down) {\n color: var(--color-ice-900);\n }\n\n .select :global(.stash-select--disabled > .stash-select__content) {\n background-color: transparent;\n border-color: transparent;\n }\n\n .select :deep(.stash-select__chips) {\n margin: 0;\n }\n\n .select :global(.stash-select__options) {\n margin: 0;\n padding: 0;\n }\n\n .select ul {\n position: relative;\n }\n</style>\n"],"names":["DARK_FILL_COLORS","attrs","useAttrs","classes","useCssModule","props","__props","emit","__emit","valueOption","computed","status","hasDarkFill","color","getBgColor","getTextColor","onSelect","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DE,UAAMA,IAAmB,CAAC,SAAS,QAAQ,OAAO,UAAU,WAAW,aAAa,GAE9EC,IAAQC,KACRC,IAAUC,KAEVC,IAAQC;AAUd,QAAID,EAAM;AACF,YAAA,IAAI,MAAM,kEAAkE;AAGpF,QAAIJ,EAAM;AACF,YAAA,IAAI,MAAM,uEAAuE;AAGzF,UAAMM,IAAOC,GAOPC,IAAcC,EAAS,MACpBL,EAAM,cAAc,KAAK,CAACM,MAAWA,EAAON,EAAM,OAAO,MAAMA,EAAM,UAAU,CACvF,GAEKO,IAAcF,EAAS,MAAM;AACjC,YAAM,EAAE,OAAAG,IAAQ,GAAA,IAAOJ,EAAY,SAAS,CAAA;AACrC,aAAAT,EAAiB,SAASa,CAAK;AAAA,IAAA,CACvC;AAMD,aAASC,EAAWD,GAA4C;AAE9D,aAAOA,KAAA,QAAAA,EAAO,SAAS,OAAO,SAASA,MAAU,SAASA;AAAA,IAC5D;AAMA,aAASE,EAAaF,GAA4C;AAEhE,aAAOA,KAAA,QAAAA,EAAO,SAAS,OAAO,WAAWA,MAAU,WAAWA;AAAA,IAChE;AAEA,aAASG,EAASC,GAAkC;AAClD,MAAAV,EAAK,uBAAsBU,KAAA,gBAAAA,EAAQZ,EAAM,aAAY,EAAE;AAAA,IACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Tab.js
CHANGED
|
@@ -10,7 +10,7 @@ import "./constants.js";
|
|
|
10
10
|
import "./locale.js";
|
|
11
11
|
import "lodash-es/get";
|
|
12
12
|
import "./Dropdown.js";
|
|
13
|
-
import "./clickoutside.js";
|
|
13
|
+
import "./directives/clickoutside.js";
|
|
14
14
|
import "./utils/calculateElementOverflow.js";
|
|
15
15
|
import "./utils/helpers.js";
|
|
16
16
|
import "lodash-es/camelCase";
|
package/dist/Tabs.js
CHANGED
|
@@ -8,7 +8,7 @@ import "./constants.js";
|
|
|
8
8
|
import "./locale.js";
|
|
9
9
|
import "lodash-es/get";
|
|
10
10
|
import "./Dropdown.js";
|
|
11
|
-
import "./clickoutside.js";
|
|
11
|
+
import "./directives/clickoutside.js";
|
|
12
12
|
import "./utils/calculateElementOverflow.js";
|
|
13
13
|
import "./utils/helpers.js";
|
|
14
14
|
import "lodash-es/camelCase";
|
package/dist/ToastsPlugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createVNode as a, h as
|
|
2
|
-
import
|
|
1
|
+
import { createVNode as a, h as s, render as n } from "vue";
|
|
2
|
+
import c from "./Toasts.js";
|
|
3
3
|
import "./useToasts.js";
|
|
4
4
|
import "lodash-es/merge";
|
|
5
5
|
import "lodash-es/uniqueId";
|
|
@@ -12,19 +12,17 @@ import "./Icon.js";
|
|
|
12
12
|
import "./index-9e1095ef.js";
|
|
13
13
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
14
14
|
import "./_plugin-vue_export-helper-dad06003.js";
|
|
15
|
-
const o = "stash-toasts-mount-node",
|
|
15
|
+
const o = "stash-toasts-mount-node", D = {
|
|
16
16
|
install(r, t) {
|
|
17
17
|
const m = (t == null ? void 0 : t.mountNodeId) || o;
|
|
18
18
|
let e = document.getElementById(m);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const d = a(n(i));
|
|
23
|
-
document.body.appendChild(e), d.appContext = r._context, s(d, e);
|
|
19
|
+
e || (e = document.createElement("div"), e.id = m, e.dataset.test = o, document.body.appendChild(e)), t != null && t.mountNodeClass && !e.classList.contains(t.mountNodeClass) && e.classList.add(t.mountNodeClass);
|
|
20
|
+
const d = a(s(c));
|
|
21
|
+
d.appContext = r._context, n(d, e);
|
|
24
22
|
}
|
|
25
23
|
};
|
|
26
24
|
export {
|
|
27
25
|
o as DEFAULT_TOASTS_PLUGIN_NODE_ID,
|
|
28
|
-
|
|
26
|
+
D as default
|
|
29
27
|
};
|
|
30
28
|
//# sourceMappingURL=ToastsPlugin.js.map
|
package/dist/ToastsPlugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastsPlugin.js","sources":["../src/plugins/ToastsPlugin.ts"],"sourcesContent":["import { App, createVNode, h, Plugin, render } from 'vue';\n\nimport Toasts from '../components/Toasts/Toasts.vue';\n\nexport interface ToastsPluginOptions {\n mountNodeClass?: string;\n mountNodeId?: string;\n}\n\nexport const DEFAULT_TOASTS_PLUGIN_NODE_ID = 'stash-toasts-mount-node';\n\nexport default <Plugin>{\n install(app: App, options?: ToastsPluginOptions) {\n const mountNodeId = options?.mountNodeId || DEFAULT_TOASTS_PLUGIN_NODE_ID;\n let mountNode = document.getElementById(mountNodeId);\n\n
|
|
1
|
+
{"version":3,"file":"ToastsPlugin.js","sources":["../src/plugins/ToastsPlugin.ts"],"sourcesContent":["import { App, createVNode, h, Plugin, render } from 'vue';\n\nimport Toasts from '../components/Toasts/Toasts.vue';\n\nexport interface ToastsPluginOptions {\n mountNodeClass?: string;\n mountNodeId?: string;\n}\n\nexport const DEFAULT_TOASTS_PLUGIN_NODE_ID = 'stash-toasts-mount-node';\n\nexport default <Plugin>{\n install(app: App, options?: ToastsPluginOptions) {\n const mountNodeId = options?.mountNodeId || DEFAULT_TOASTS_PLUGIN_NODE_ID;\n let mountNode = document.getElementById(mountNodeId);\n\n if (!mountNode) {\n mountNode = document.createElement('div');\n mountNode.id = mountNodeId;\n mountNode.dataset.test = DEFAULT_TOASTS_PLUGIN_NODE_ID;\n document.body.appendChild(mountNode);\n }\n\n if (options?.mountNodeClass && !mountNode.classList.contains(options.mountNodeClass)) {\n mountNode.classList.add(options.mountNodeClass);\n }\n\n const vNode = createVNode(h(Toasts));\n vNode.appContext = app._context;\n\n render(vNode, mountNode);\n },\n};\n"],"names":["DEFAULT_TOASTS_PLUGIN_NODE_ID","ToastsPlugin","app","options","mountNodeId","mountNode","vNode","createVNode","h","Toasts","render"],"mappings":";;;;;;;;;;;;;;AASO,MAAMA,IAAgC,2BAEtBC,IAAA;AAAA,EACrB,QAAQC,GAAUC,GAA+B;AACzC,UAAAC,KAAcD,KAAA,gBAAAA,EAAS,gBAAeH;AACxC,QAAAK,IAAY,SAAS,eAAeD,CAAW;AAEnD,IAAKC,MACSA,IAAA,SAAS,cAAc,KAAK,GACxCA,EAAU,KAAKD,GACfC,EAAU,QAAQ,OAAOL,GAChB,SAAA,KAAK,YAAYK,CAAS,IAGjCF,KAAA,QAAAA,EAAS,kBAAkB,CAACE,EAAU,UAAU,SAASF,EAAQ,cAAc,KACvEE,EAAA,UAAU,IAAIF,EAAQ,cAAc;AAGhD,UAAMG,IAAQC,EAAYC,EAAEC,CAAM,CAAC;AACnC,IAAAH,EAAM,aAAaJ,EAAI,UAEvBQ,EAAOJ,GAAOD,CAAS;AAAA,EACzB;AACF;"}
|
package/dist/Tooltip.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { getCurrentScope as C, onScopeDispose as D, unref as M, ref as p, watch as $, defineComponent as F, computed as A, openBlock as Y, createElementBlock as P, createElementVNode as X, renderSlot as E, createBlock as j, Teleport as I, normalizeStyle as k, createTextVNode as R, toDisplayString as V } from "vue";
|
|
2
|
+
import { u as z, a as L, f as N, o as G, b as U } from "./floating-ui.vue-8d7f7932.js";
|
|
3
|
+
function q(e) {
|
|
4
|
+
return C() ? (D(e), !0) : !1;
|
|
5
|
+
}
|
|
6
|
+
function B(e) {
|
|
7
|
+
return typeof e == "function" ? e() : M(e);
|
|
8
|
+
}
|
|
9
|
+
const J = typeof window < "u" && typeof document < "u";
|
|
10
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
11
|
+
const K = Object.prototype.toString, Q = (e) => K.call(e) === "[object Object]", Z = () => {
|
|
12
|
+
}, W = J ? window : void 0;
|
|
13
|
+
function H(e) {
|
|
14
|
+
var s;
|
|
15
|
+
const n = B(e);
|
|
16
|
+
return (s = n == null ? void 0 : n.$el) != null ? s : n;
|
|
17
|
+
}
|
|
18
|
+
function b(...e) {
|
|
19
|
+
let s, n, l, i;
|
|
20
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, s = W) : [s, n, l, i] = e, !s)
|
|
21
|
+
return Z;
|
|
22
|
+
Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
|
|
23
|
+
const c = [], f = () => {
|
|
24
|
+
c.forEach((o) => o()), c.length = 0;
|
|
25
|
+
}, y = (o, r, u, a) => (o.addEventListener(r, u, a), () => o.removeEventListener(r, u, a)), d = $(
|
|
26
|
+
() => [H(s), B(i)],
|
|
27
|
+
([o, r]) => {
|
|
28
|
+
if (f(), !o)
|
|
29
|
+
return;
|
|
30
|
+
const u = Q(r) ? { ...r } : r;
|
|
31
|
+
c.push(
|
|
32
|
+
...n.flatMap((a) => l.map((m) => y(o, a, m, u)))
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
{ immediate: !0, flush: "post" }
|
|
36
|
+
), w = () => {
|
|
37
|
+
d(), f();
|
|
38
|
+
};
|
|
39
|
+
return q(w), w;
|
|
40
|
+
}
|
|
41
|
+
const ee = {
|
|
42
|
+
page: (e) => [e.pageX, e.pageY],
|
|
43
|
+
client: (e) => [e.clientX, e.clientY],
|
|
44
|
+
screen: (e) => [e.screenX, e.screenY],
|
|
45
|
+
movement: (e) => e instanceof Touch ? null : [e.movementX, e.movementY]
|
|
46
|
+
};
|
|
47
|
+
function te(e = {}) {
|
|
48
|
+
const {
|
|
49
|
+
type: s = "page",
|
|
50
|
+
touch: n = !0,
|
|
51
|
+
resetOnTouchEnds: l = !1,
|
|
52
|
+
initialValue: i = { x: 0, y: 0 },
|
|
53
|
+
window: c = W,
|
|
54
|
+
target: f = c,
|
|
55
|
+
scroll: y = !0,
|
|
56
|
+
eventFilter: d
|
|
57
|
+
} = e;
|
|
58
|
+
let w = null;
|
|
59
|
+
const o = p(i.x), r = p(i.y), u = p(null), a = typeof s == "function" ? s : ee[s], m = (t) => {
|
|
60
|
+
const h = a(t);
|
|
61
|
+
w = t, h && ([o.value, r.value] = h, u.value = "mouse");
|
|
62
|
+
}, v = (t) => {
|
|
63
|
+
if (t.touches.length > 0) {
|
|
64
|
+
const h = a(t.touches[0]);
|
|
65
|
+
h && ([o.value, r.value] = h, u.value = "touch");
|
|
66
|
+
}
|
|
67
|
+
}, g = () => {
|
|
68
|
+
if (!w || !c)
|
|
69
|
+
return;
|
|
70
|
+
const t = a(w);
|
|
71
|
+
w instanceof MouseEvent && t && (o.value = t[0] + c.scrollX, r.value = t[1] + c.scrollY);
|
|
72
|
+
}, x = () => {
|
|
73
|
+
o.value = i.x, r.value = i.y;
|
|
74
|
+
}, S = d ? (t) => d(() => m(t), {}) : (t) => m(t), O = d ? (t) => d(() => v(t), {}) : (t) => v(t), _ = d ? () => d(() => g(), {}) : () => g();
|
|
75
|
+
if (f) {
|
|
76
|
+
const t = { passive: !0 };
|
|
77
|
+
b(f, ["mousemove", "dragover"], S, t), n && s !== "movement" && (b(f, ["touchstart", "touchmove"], O, t), l && b(f, "touchend", x, t)), y && s === "page" && b(c, "scroll", _, { passive: !0 });
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
x: o,
|
|
81
|
+
y: r,
|
|
82
|
+
sourceType: u
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function oe(e, s = {}) {
|
|
86
|
+
const {
|
|
87
|
+
handleOutside: n = !0,
|
|
88
|
+
window: l = W
|
|
89
|
+
} = s, i = s.type || "page", { x: c, y: f, sourceType: y } = te(s), d = p(e ?? (l == null ? void 0 : l.document.body)), w = p(0), o = p(0), r = p(0), u = p(0), a = p(0), m = p(0), v = p(!0);
|
|
90
|
+
let g = () => {
|
|
91
|
+
};
|
|
92
|
+
return l && (g = $(
|
|
93
|
+
[d, c, f],
|
|
94
|
+
() => {
|
|
95
|
+
const x = H(d);
|
|
96
|
+
if (!x || !(x instanceof Element))
|
|
97
|
+
return;
|
|
98
|
+
const {
|
|
99
|
+
left: S,
|
|
100
|
+
top: O,
|
|
101
|
+
width: _,
|
|
102
|
+
height: t
|
|
103
|
+
} = x.getBoundingClientRect();
|
|
104
|
+
r.value = S + (i === "page" ? l.pageXOffset : 0), u.value = O + (i === "page" ? l.pageYOffset : 0), a.value = t, m.value = _;
|
|
105
|
+
const h = c.value - r.value, T = f.value - u.value;
|
|
106
|
+
v.value = _ === 0 || t === 0 || h < 0 || T < 0 || h > _ || T > t, (n || !v.value) && (w.value = h, o.value = T);
|
|
107
|
+
},
|
|
108
|
+
{ immediate: !0 }
|
|
109
|
+
), b(document, "mouseleave", () => {
|
|
110
|
+
v.value = !0;
|
|
111
|
+
})), {
|
|
112
|
+
x: c,
|
|
113
|
+
y: f,
|
|
114
|
+
sourceType: y,
|
|
115
|
+
elementX: w,
|
|
116
|
+
elementY: o,
|
|
117
|
+
elementPositionX: r,
|
|
118
|
+
elementPositionY: u,
|
|
119
|
+
elementHeight: a,
|
|
120
|
+
elementWidth: m,
|
|
121
|
+
isOutside: v,
|
|
122
|
+
stop: g
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const ne = {
|
|
126
|
+
ref: "wrapper",
|
|
127
|
+
class: "stash-tooltip__wrapper tw-relative tw-inline-flex tw-h-fit tw-w-fit"
|
|
128
|
+
}, se = 6, le = 12, ce = /* @__PURE__ */ F({
|
|
129
|
+
__name: "Tooltip",
|
|
130
|
+
props: {
|
|
131
|
+
disableTeleport: { type: Boolean, default: !1 },
|
|
132
|
+
side: { default: "top" },
|
|
133
|
+
isOpen: { type: Boolean, default: !1 },
|
|
134
|
+
teleportTo: { default: "#stash-menus-mount-node" },
|
|
135
|
+
text: { default: "" }
|
|
136
|
+
},
|
|
137
|
+
setup(e) {
|
|
138
|
+
const s = {
|
|
139
|
+
top: "bottom",
|
|
140
|
+
right: "left",
|
|
141
|
+
bottom: "top",
|
|
142
|
+
left: "right"
|
|
143
|
+
}, n = e, l = p(null), i = p(null), c = p(null), { isOutside: f } = oe(l), y = A(() => !f.value || n.isOpen), d = A(() => n.side), { floatingStyles: w, middlewareData: o, placement: r } = z(l, c, {
|
|
144
|
+
whileElementsMounted: L,
|
|
145
|
+
placement: d,
|
|
146
|
+
middleware: [N(), G(le), U({ element: i })]
|
|
147
|
+
}), u = A(() => {
|
|
148
|
+
var m, v;
|
|
149
|
+
const a = s[r.value];
|
|
150
|
+
return {
|
|
151
|
+
left: ((m = o.value.arrow) == null ? void 0 : m.x) != null ? `${o.value.arrow.x}px` : "",
|
|
152
|
+
top: ((v = o.value.arrow) == null ? void 0 : v.y) != null ? `${o.value.arrow.y}px` : "",
|
|
153
|
+
[a]: `-${se}px`
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
return (a, m) => (Y(), P("div", ne, [
|
|
157
|
+
X("span", {
|
|
158
|
+
ref_key: "anchor",
|
|
159
|
+
ref: l,
|
|
160
|
+
"data-test": "stash-tooltip|anchor",
|
|
161
|
+
class: "stash-tooltip__anchor"
|
|
162
|
+
}, [
|
|
163
|
+
E(a.$slots, "default")
|
|
164
|
+
], 512),
|
|
165
|
+
(Y(), j(I, {
|
|
166
|
+
to: n.teleportTo,
|
|
167
|
+
disabled: n.disableTeleport
|
|
168
|
+
}, [
|
|
169
|
+
X("div", {
|
|
170
|
+
ref_key: "tooltip",
|
|
171
|
+
ref: c,
|
|
172
|
+
"data-test": "stash-tooltip",
|
|
173
|
+
class: "stash-tooltip tw-pointer-events-none tw-z-screen tw-flex tw-w-[148px] tw-flex-col tw-items-center tw-whitespace-normal tw-rounded tw-bg-ice-900 tw-p-3 tw-text-center tw-text-xs tw-text-white tw-opacity-0 tw-shadow tw-transition-opacity",
|
|
174
|
+
role: "tooltip",
|
|
175
|
+
style: k({
|
|
176
|
+
...M(w),
|
|
177
|
+
opacity: y.value ? 0.95 : 0
|
|
178
|
+
})
|
|
179
|
+
}, [
|
|
180
|
+
E(a.$slots, "icon"),
|
|
181
|
+
E(a.$slots, "content", {}, () => [
|
|
182
|
+
R(V(n.text), 1)
|
|
183
|
+
]),
|
|
184
|
+
E(a.$slots, "secondaryIcon"),
|
|
185
|
+
X("div", {
|
|
186
|
+
ref_key: "floatingArrow",
|
|
187
|
+
ref: i,
|
|
188
|
+
class: "stash-tooltip__arrow tw-absolute tw-z-behind tw-h-[12px] tw-w-[12px] tw-rotate-45 tw-bg-ice-900",
|
|
189
|
+
style: k(u.value)
|
|
190
|
+
}, null, 4)
|
|
191
|
+
], 4)
|
|
192
|
+
], 8, ["to", "disabled"]))
|
|
193
|
+
], 512));
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
export {
|
|
197
|
+
ce as default
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=Tooltip.js.map
|