@leaflink/stash 49.3.2 → 49.3.4
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/AddressSelect.js +2 -2
- package/dist/Badge.vue.d.ts +1 -1
- package/dist/CurrencyInput.js +4 -3
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +4 -0
- package/dist/DataViewFilters.js +2 -2
- package/dist/DatePicker.js +2 -2
- package/dist/Field.js +2 -2
- package/dist/Field.vue.d.ts +7 -0
- package/dist/{Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js → Field.vue_vue_type_script_setup_true_lang-3ea26741.js} +22 -19
- package/dist/Field.vue_vue_type_script_setup_true_lang-3ea26741.js.map +1 -0
- package/dist/FilterSelect.js +2 -2
- package/dist/Filters.js +2 -2
- package/dist/Filters.vue.d.ts +38 -0
- package/dist/InlineEdit.js +2 -2
- package/dist/Input.js +61 -59
- package/dist/Input.js.map +1 -1
- package/dist/Input.vue.d.ts +7 -0
- package/dist/InputOptions.js +52 -49
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +7 -0
- package/dist/Label.js +1 -1
- package/dist/Label.vue.d.ts +6 -0
- package/dist/Label.vue_vue_type_script_setup_true_lang-b6ba2f02.js +43 -0
- package/dist/Label.vue_vue_type_script_setup_true_lang-b6ba2f02.js.map +1 -0
- package/dist/ListView.js +2 -2
- package/dist/ListView.vue.d.ts +76 -19
- package/dist/Module.js +12 -12
- package/dist/Module.js.map +1 -1
- package/dist/ModuleHeader.js +13 -12
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/RadioGroup.js +2 -2
- package/dist/SearchBar.js +2 -2
- package/dist/Select.js +82 -81
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +2 -2
- package/dist/Table.js +50 -47
- package/dist/Table.js.map +1 -1
- package/dist/TextEditor.js +6 -6
- package/dist/TextEditor.js.map +1 -1
- package/dist/Textarea.js +38 -34
- package/dist/Textarea.js.map +1 -1
- package/dist/Textarea.vue.d.ts +7 -0
- package/dist/components.css +2 -2
- package/package.json +1 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js.map +0 -1
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js +0 -38
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js.map +0 -1
package/dist/ModuleHeader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleHeader.js","sources":["../src/components/ModuleHeader/ModuleHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, ref, useCssModule, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-header',\n });\n\n export interface ModuleHeaderProps {\n /**\n * Header title. Will get overridden by the `title` slot if provided.\n */\n title?: string;\n\n /**\n * Size of the header.\n *\n * - `small` = `h4`\n * - `medium` = `h3`\n * - `large` = `h2`\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Header description, aka subtitle. Will get overridden by the `description` slot if provided.\n */\n description?: string;\n\n /**\n * Stop the actions slot from force-wrapping on medium and smalls screens.\n */\n preventActionsWrap?: boolean;\n\n /**\n * Displays a border at the bottom\n */\n underline?: boolean;\n }\n\n const props = withDefaults(defineProps<ModuleHeaderProps>(), {\n title: '',\n size: 'medium',\n description: '',\n preventActionsWrap: false,\n underline: false,\n });\n const classes = useCssModule();\n const slots = useSlots();\n\n // get the module variant from the parent module\n const moduleVariant = ref();\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('<ModuleHeader> must be used within a <Module> component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n\n const is = computed(() => {\n let component: string;\n\n switch (props.size) {\n case 'small':\n component = 'h4';\n break;\n\n case 'medium':\n component = 'h3';\n break;\n\n case 'large':\n component = 'h2';\n break;\n\n default:\n component = 'h3';\n break;\n }\n\n return component;\n });\n\n const isDefaultSlotSimpleString = computed(() => {\n if (!slots.default) {\n return false;\n }\n\n const defaultSlot = slots.default();\n return (\n defaultSlot.length === 1 &&\n typeof slots.default()[0].children === 'string' &&\n typeof slots.default()[0].type === 'symbol'\n );\n });\n\n const marginBottomClasses = computed(() => {\n const isBoxOrTableOrList = ['box', 'table', 'list'].includes(moduleVariant.value);\n\n if (isBoxOrTableOrList && !props.underline) {\n return 'tw-mb-3 lg:tw-mb-6';\n } else if (isBoxOrTableOrList && props.underline) {\n return 'tw-mb-3';\n } else {\n return '';\n }\n });\n</script>\n\n<template>\n <header\n class=\"stash-module-header tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6':\n moduleVariant === ModuleVariant.Card,\n 'tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none':\n moduleVariant === ModuleVariant.
|
|
1
|
+
{"version":3,"file":"ModuleHeader.js","sources":["../src/components/ModuleHeader/ModuleHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, ref, useCssModule, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-header',\n });\n\n export interface ModuleHeaderProps {\n /**\n * Header title. Will get overridden by the `title` slot if provided.\n */\n title?: string;\n\n /**\n * Size of the header.\n *\n * - `small` = `h4`\n * - `medium` = `h3`\n * - `large` = `h2`\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Header description, aka subtitle. Will get overridden by the `description` slot if provided.\n */\n description?: string;\n\n /**\n * Stop the actions slot from force-wrapping on medium and smalls screens.\n */\n preventActionsWrap?: boolean;\n\n /**\n * Displays a border at the bottom\n */\n underline?: boolean;\n }\n\n const props = withDefaults(defineProps<ModuleHeaderProps>(), {\n title: '',\n size: 'medium',\n description: '',\n preventActionsWrap: false,\n underline: false,\n });\n const classes = useCssModule();\n const slots = useSlots();\n\n // get the module variant from the parent module\n const moduleVariant = ref();\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('<ModuleHeader> must be used within a <Module> component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n\n const is = computed(() => {\n let component: string;\n\n switch (props.size) {\n case 'small':\n component = 'h4';\n break;\n\n case 'medium':\n component = 'h3';\n break;\n\n case 'large':\n component = 'h2';\n break;\n\n default:\n component = 'h3';\n break;\n }\n\n return component;\n });\n\n const isDefaultSlotSimpleString = computed(() => {\n if (!slots.default) {\n return false;\n }\n\n const defaultSlot = slots.default();\n return (\n defaultSlot.length === 1 &&\n typeof slots.default()[0].children === 'string' &&\n typeof slots.default()[0].type === 'symbol'\n );\n });\n\n const marginBottomClasses = computed(() => {\n const isBoxOrTableOrList = ['box', 'table', 'list'].includes(moduleVariant.value);\n\n if (isBoxOrTableOrList && !props.underline) {\n return 'tw-mb-3 lg:tw-mb-6';\n } else if (isBoxOrTableOrList && props.underline) {\n return 'tw-mb-3';\n } else {\n return '';\n }\n });\n</script>\n\n<template>\n <header\n class=\"stash-module-header tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6':\n moduleVariant === ModuleVariant.Card,\n 'tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none':\n moduleVariant === ModuleVariant.List,\n 'tw-mb-3 tw-border-b tw-border-ice-200 lg:tw-mb-6': props.underline,\n 'tw-mb-6 tw-rounded-t tw-bg-white tw-px-3 tw-pt-3 lg:tw-mb-0 lg:tw-px-6 lg:tw-pt-6':\n moduleVariant === ModuleVariant.Table,\n }\"\n data-test=\"stash-module-header\"\n >\n <div\n class=\"stash-module-header__content tw-mr-6\"\n :class=\"marginBottomClasses\"\n data-test=\"stash-module-header|content\"\n >\n <div class=\"tw-flex tw-items-center\">\n <div\n v-if=\"slots.media && props.size === 'large'\"\n class=\"stash-module-header__content__media tw-mr-3\"\n :class=\"classes.media\"\n data-test=\"stash-module-header|content-media\"\n >\n <!-- @slot Place an illustration that sits next to the header title & description. -->\n <slot name=\"media\"></slot>\n </div>\n\n <div class=\"stash-module-header__content__text\" data-test=\"stash-module-header|content-text\">\n <!--\n @slot Header title. **Deprecated**: Use the default slot or the `title` prop instead.\n -->\n <slot v-if=\"slots.title\" name=\"title\"></slot>\n\n <template v-else-if=\"isDefaultSlotSimpleString\">\n <component\n :is=\"is\"\n class=\"stash-module-header__default_slot_string tw-my-0\"\n data-test=\"stash-module-header|default-slot-text\"\n >\n <!-- @slot Header title. -->\n <slot></slot>\n </component>\n </template>\n <!-- @slot Header title. Falls back to the `title` prop. -->\n <slot v-else>\n <component :is=\"is\" class=\"tw-my-0\">{{ props.title }}</component>\n </slot>\n\n <!--\n @slot Header description, aka subtitle. Falls back to the `description` prop.\n -->\n <slot name=\"description\">\n <p v-if=\"props.description\" class=\"tw-mb-0 tw-mt-3\">{{ props.description }}</p>\n </slot>\n </div>\n </div>\n </div>\n\n <!-- todo: how can we pass a prop/class to actions in order to top align vs middle align? -->\n <div\n v-if=\"slots.actions\"\n class=\"stash-module-header__actions tw-self-center\"\n :class=\"[\n marginBottomClasses,\n {\n 'tw-w-full lg:tw-w-auto': !props.preventActionsWrap,\n },\n ]\"\n data-test=\"stash-module-header|actions\"\n >\n <!-- @slot Add action buttons or other CTAs. -->\n <slot name=\"actions\"></slot>\n </div>\n </header>\n</template>\n\n<style module>\n /* max size for media/marketing illustration icons we would be passing to the slot */\n .media {\n max-height: 58px;\n max-width: 58px;\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","slots","useSlots","moduleVariant","ref","moduleInjectedValues","inject","MODULE_INJECTION","is","computed","component","isDefaultSlotSimpleString","marginBottomClasses","isBoxOrTableOrList"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyCE,UAAMA,IAAQC,GAORC,IAAUC,KACVC,IAAQC,KAGRC,IAAgBC,KAChBC,IAAuBC,EAAOC,EAAiB,KAAKA,EAAiB,QAAQ;AAC/E,QAAA,CAACF,EAAqB;AAClB,YAAA,IAAI,MAAM,0DAA0D;AAE9D,IAAAF,EAAA,QAAQE,EAAqB,QAAQ;AAE7C,UAAAG,IAAKC,EAAS,MAAM;AACpB,UAAAC;AAEJ,cAAQb,EAAM,MAAM;AAAA,QAClB,KAAK;AACS,UAAAa,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF;AACc,UAAAA,IAAA;AACZ;AAAA,MACJ;AAEO,aAAAA;AAAA,IAAA,CACR,GAEKC,IAA4BF,EAAS,MACpCR,EAAM,UAISA,EAAM,UAEZ,WAAW,KACvB,OAAOA,EAAM,QAAU,EAAA,CAAC,EAAE,YAAa,YACvC,OAAOA,EAAM,UAAU,CAAC,EAAE,QAAS,WAP5B,EASV,GAEKW,IAAsBH,EAAS,MAAM;AACnC,YAAAI,IAAqB,CAAC,OAAO,SAAS,MAAM,EAAE,SAASV,EAAc,KAAK;AAE5E,aAAAU,KAAsB,CAAChB,EAAM,YACxB,uBACEgB,KAAsBhB,EAAM,YAC9B,YAEA;AAAA,IACT,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/RadioGroup.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as $, inject as k, useCssModule as V, openBlock as l, createElementBlock as n, normalizeClass as p, unref as e, Fragment as B, renderList as R, createElementVNode as i, toDisplayString as h, provide as C, computed as v, createBlock as I, withCtx as M, renderSlot as T, resolveDynamicComponent as G } from "vue";
|
|
2
2
|
import E from "lodash-es/uniqueId";
|
|
3
|
-
import { _ as O } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as O } from "./Field.vue_vue_type_script_setup_true_lang-3ea26741.js";
|
|
4
4
|
import { R as y } from "./RadioGroup.keys-974818d6.js";
|
|
5
5
|
import { _ as x } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import "./Label.vue_vue_type_script_setup_true_lang-b6ba2f02.js";
|
|
7
7
|
import "./locale.js";
|
|
8
8
|
import "lodash-es/get";
|
|
9
9
|
const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @__PURE__ */ $({
|
package/dist/SearchBar.js
CHANGED
|
@@ -12,8 +12,8 @@ import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
|
12
12
|
import "lodash-es/isNil";
|
|
13
13
|
import "./utils/i18n.js";
|
|
14
14
|
import "./constants.js";
|
|
15
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
15
|
+
import "./Field.vue_vue_type_script_setup_true_lang-3ea26741.js";
|
|
16
|
+
import "./Label.vue_vue_type_script_setup_true_lang-b6ba2f02.js";
|
|
17
17
|
const R = /* @__PURE__ */ V({
|
|
18
18
|
name: "ll-search-bar",
|
|
19
19
|
__name: "SearchBar",
|
package/dist/Select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Te, useAttrs as Ce, useSlots as Ie, ref as c, computed as v, watch as U, nextTick as Y, onMounted as Oe, onUnmounted as Me, openBlock as o, createBlock as K, normalizeClass as k, unref as y, createSlots as Fe, withCtx as M, createElementVNode as p, createElementBlock as d, Fragment as V, renderList as G, toDisplayString as B, withDirectives as F, withKeys as oe, createCommentVNode as R, renderSlot as j, createTextVNode as $, withModifiers as P, createVNode as S, Teleport as Re, Transition as $e, normalizeStyle as Pe, vModelText as ze, vShow as J } from "vue";
|
|
2
2
|
import { u as He, a as Ne, f as Ae, o as Le, s as De } from "./floating-ui.vue-8d7f7932.js";
|
|
3
3
|
import Ue from "@leaflink/snitch";
|
|
4
4
|
import Ke from "lodash-es/debounce";
|
|
@@ -7,11 +7,11 @@ import re from "lodash-es/isEqual";
|
|
|
7
7
|
import Ge from "lodash-es/isPlainObject";
|
|
8
8
|
import je from "lodash-es/uniqueId";
|
|
9
9
|
import qe from "./useSearch.js";
|
|
10
|
-
import { DEBOUNCE as We, KEY_CODES as
|
|
10
|
+
import { DEBOUNCE as We, KEY_CODES as E } from "./constants.js";
|
|
11
11
|
import Xe from "./directives/clickoutside.js";
|
|
12
12
|
import { D as Ye } from "./MenusPlugin-9288029a.js";
|
|
13
13
|
import ie from "./Chip.js";
|
|
14
|
-
import { _ as Je } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
14
|
+
import { _ as Je } from "./Field.vue_vue_type_script_setup_true_lang-3ea26741.js";
|
|
15
15
|
import z from "./Icon.js";
|
|
16
16
|
import { _ as Qe } from "./_plugin-vue_export-helper-dad06003.js";
|
|
17
17
|
import "lodash-es/get";
|
|
@@ -21,7 +21,7 @@ import "./utils/helpers.js";
|
|
|
21
21
|
import "lodash-es/camelCase";
|
|
22
22
|
import "lodash-es/isFinite";
|
|
23
23
|
import "./utils/colorScheme.js";
|
|
24
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
24
|
+
import "./Label.vue_vue_type_script_setup_true_lang-b6ba2f02.js";
|
|
25
25
|
import "./locale.js";
|
|
26
26
|
import "./index-9e1095ef.js";
|
|
27
27
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
@@ -31,10 +31,10 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
31
31
|
}, nt = {
|
|
32
32
|
key: 0,
|
|
33
33
|
class: "tw-flex tw-items-center tw-border-b tw-border-blue-500 tw-pr-1.5"
|
|
34
|
-
}, ot = ["data-test", "placeholder"], rt = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, it = ["data-test", "onClick", "onMouseenter"],
|
|
34
|
+
}, ot = ["data-test", "placeholder"], rt = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, it = ["data-test", "onClick", "onMouseenter"], ct = { class: "tw-m-1.5 tw-cursor-default tw-p-1.5" }, ut = {
|
|
35
35
|
class: "tw-m-1.5 tw-cursor-default tw-p-1.5",
|
|
36
36
|
"data-test": "stash-select|no-options"
|
|
37
|
-
}, dt = /* @__PURE__ */
|
|
37
|
+
}, dt = /* @__PURE__ */ Te({
|
|
38
38
|
name: "ll-select",
|
|
39
39
|
__name: "Select",
|
|
40
40
|
props: {
|
|
@@ -77,8 +77,8 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
77
77
|
teleportTo: { default: `#${Ye}` }
|
|
78
78
|
},
|
|
79
79
|
emits: ["update:model-value", "clear", "add", "remove", "opened", "closed"],
|
|
80
|
-
setup(
|
|
81
|
-
const e =
|
|
80
|
+
setup(ce, { emit: ue }) {
|
|
81
|
+
const e = ce, h = ue, H = Ce(), de = Ie(), Q = c(null), m = c(null), x = c(null), q = c(null), Z = c(null), N = c(0), T = c(0), n = c([]), ee = c(() => []), _ = c(""), f = c(-1), u = c(!1), W = c({}), te = c(!1), { floatingStyles: fe } = He(Q, x, {
|
|
82
82
|
whileElementsMounted: Ne,
|
|
83
83
|
placement: e.menuPlacement,
|
|
84
84
|
middleware: [
|
|
@@ -96,10 +96,10 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
96
96
|
}), X = v(() => !e.hideSearch && e.searchable !== "false" && e.searchable !== !1), A = v(() => {
|
|
97
97
|
let t = (te.value && e.lazy ? e.lazy() : e.options).filter(Boolean);
|
|
98
98
|
return Ge(t[0]) || (t = t.map((l, s) => ({ name: l, id: s }))), t;
|
|
99
|
-
}), le = v(() => e.searchLoading || Object.keys(W.value).length > 0),
|
|
100
|
-
() => !
|
|
99
|
+
}), le = v(() => e.searchLoading || Object.keys(W.value).length > 0), C = v(() => e.disableFiltering || !(_.value || "").trim() ? A.value : ee.value(_.value)), pe = v(() => N.value <= T.value), ve = v(
|
|
100
|
+
() => !u.value && !e.single && !pe.value && n.value.length
|
|
101
101
|
), he = v(() => [n.value.length, e.selectItemType, "selected"].filter(Boolean).join(" ")), me = v(() => e.preventEmpty || e.allowEmpty === "false" || e.allowEmpty === !1);
|
|
102
|
-
U(_, (t, l) => l !== t && D(-1)), U(n, () =>
|
|
102
|
+
U(_, (t, l) => l !== t && D(-1)), U(n, () => O(), { deep: !0 }), U(
|
|
103
103
|
() => e.modelValue,
|
|
104
104
|
(t) => {
|
|
105
105
|
if (Array.isArray(t)) {
|
|
@@ -129,7 +129,7 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
129
129
|
const ye = () => {
|
|
130
130
|
n.value = [], h("update:model-value", e.single ? void 0 : n.value), h("clear");
|
|
131
131
|
}, L = (t) => {
|
|
132
|
-
e.disabled || !t || typeof t == "object" && "disabled" in t && (t != null && t.disabled) || (
|
|
132
|
+
e.disabled || !t || typeof t == "object" && "disabled" in t && (t != null && t.disabled) || (g(t) ? I(t) : (e.single && (n.value = []), n.value.push(t), h("update:model-value", e.single ? n.value[0] : n.value), h("add", t)), e.single && w());
|
|
133
133
|
}, _e = (t) => {
|
|
134
134
|
if (e.single) {
|
|
135
135
|
const s = A.value.find((r) => {
|
|
@@ -144,7 +144,7 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
144
144
|
l.find((i) => {
|
|
145
145
|
var a;
|
|
146
146
|
return i.value === ((a = s[e.trackBy]) == null ? void 0 : a.toString());
|
|
147
|
-
}) ||
|
|
147
|
+
}) || I(s);
|
|
148
148
|
for (const s of l) {
|
|
149
149
|
const r = A.value.find(
|
|
150
150
|
(i) => {
|
|
@@ -152,9 +152,9 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
152
152
|
return ((a = i[e.trackBy]) == null ? void 0 : a.toString()) === s.value;
|
|
153
153
|
}
|
|
154
154
|
);
|
|
155
|
-
|
|
155
|
+
g(r) || L(r);
|
|
156
156
|
}
|
|
157
|
-
},
|
|
157
|
+
}, I = (t) => {
|
|
158
158
|
if (e.disabled || me.value && n.value.length === 1)
|
|
159
159
|
return;
|
|
160
160
|
const l = n.value.findIndex((s) => s[e.trackBy] === t[e.trackBy]);
|
|
@@ -164,17 +164,17 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
164
164
|
}
|
|
165
165
|
n.value.splice(l, 1), h("update:model-value", e.single ? n.value[0] : n.value), h("remove", t, l);
|
|
166
166
|
}, ae = () => {
|
|
167
|
-
|
|
167
|
+
u.value || (O(), u.value = !0, h("opened"), X.value && Y(() => {
|
|
168
168
|
var t;
|
|
169
169
|
(t = Z.value) == null || t.focus({ preventScroll: !0 });
|
|
170
170
|
}));
|
|
171
|
-
},
|
|
171
|
+
}, w = () => {
|
|
172
172
|
var t;
|
|
173
|
-
|
|
173
|
+
u.value && h("closed", n.value), D(-1), u.value = !1, e.preserveSearchTerm || (_.value = ""), (t = m.value) == null || t.blur();
|
|
174
174
|
}, be = async (t) => {
|
|
175
175
|
if (await Y(), !m.value)
|
|
176
176
|
return;
|
|
177
|
-
if (![
|
|
177
|
+
if (![E.ENTER, E.ESCAPE].includes(t.keyCode)) {
|
|
178
178
|
const s = m.value.querySelector(".stash-select__option--highlighted"), r = s == null ? void 0 : s.getBoundingClientRect(), i = m.value.getBoundingClientRect();
|
|
179
179
|
if (!r || !i)
|
|
180
180
|
return;
|
|
@@ -182,21 +182,21 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
182
182
|
}
|
|
183
183
|
}, D = (t) => {
|
|
184
184
|
f.value = t;
|
|
185
|
-
},
|
|
186
|
-
if (t.keyCode ===
|
|
187
|
-
|
|
188
|
-
else if (t.keyCode ===
|
|
189
|
-
|
|
190
|
-
else if (t.keyCode ===
|
|
191
|
-
|
|
192
|
-
else if (t.keyCode ===
|
|
193
|
-
|
|
185
|
+
}, we = (t) => {
|
|
186
|
+
if (t.keyCode === E.ESCAPE)
|
|
187
|
+
w();
|
|
188
|
+
else if (t.keyCode === E.DOWN && f.value < C.value.length - 1)
|
|
189
|
+
u.value && f.value++;
|
|
190
|
+
else if (t.keyCode === E.UP && f.value > 0)
|
|
191
|
+
u.value && f.value--, x.value && X.value && f.value === 0 && (x.value.scrollTop -= 100);
|
|
192
|
+
else if (t.keyCode === E.ENTER && f.value !== -1)
|
|
193
|
+
u.value && L(C.value[f.value]);
|
|
194
194
|
else
|
|
195
195
|
return;
|
|
196
196
|
t.preventDefault(), be(t);
|
|
197
197
|
}, se = Ke(function() {
|
|
198
|
-
|
|
199
|
-
}, We.FAST),
|
|
198
|
+
ge();
|
|
199
|
+
}, We.FAST), ge = async function() {
|
|
200
200
|
if (!e.onSearch)
|
|
201
201
|
return;
|
|
202
202
|
const t = je("search-request-");
|
|
@@ -210,49 +210,50 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
210
210
|
"stash-select__option": !0,
|
|
211
211
|
"stash-select__option--disabled": t && typeof t == "object" && "disabled" in t && (t == null ? void 0 : t.disabled),
|
|
212
212
|
"stash-select__option--highlighted": f.value === l,
|
|
213
|
-
"stash-select__option--selected":
|
|
213
|
+
"stash-select__option--selected": g(t)
|
|
214
214
|
},
|
|
215
215
|
// @deprecated
|
|
216
216
|
{
|
|
217
217
|
"tw-bg-ice-200": f.value === l,
|
|
218
|
-
"tw-bg-blue-100 tw-text-ice-700":
|
|
218
|
+
"tw-bg-blue-100 tw-text-ice-700": g(t)
|
|
219
219
|
}
|
|
220
|
-
],
|
|
220
|
+
], g = (t) => t == null ? !1 : n.value.some((l) => (l == null ? void 0 : l[e.trackBy]) === t[e.trackBy]);
|
|
221
221
|
function ne(t) {
|
|
222
222
|
var r, i;
|
|
223
223
|
if (!t)
|
|
224
224
|
return !1;
|
|
225
|
-
const l = (r = m.value) == null ? void 0 : r.contains(t), s = (i =
|
|
225
|
+
const l = (r = m.value) == null ? void 0 : r.contains(t), s = (i = x.value) == null ? void 0 : i.contains(t);
|
|
226
226
|
return l || s;
|
|
227
227
|
}
|
|
228
228
|
function Be(t) {
|
|
229
229
|
const l = t.relatedTarget;
|
|
230
|
-
!ne(l) && l &&
|
|
230
|
+
!ne(l) && l && w();
|
|
231
231
|
}
|
|
232
232
|
function Se(t) {
|
|
233
233
|
const l = t.target;
|
|
234
|
-
ne(l) ||
|
|
234
|
+
ne(l) || w();
|
|
235
235
|
}
|
|
236
236
|
const Ee = () => {
|
|
237
237
|
D(-1);
|
|
238
|
-
},
|
|
238
|
+
}, O = async () => {
|
|
239
239
|
await Y(), q.value && m.value && (T.value = T.value === 0 ? m.value.clientHeight : T.value, N.value = q.value.clientHeight);
|
|
240
240
|
};
|
|
241
241
|
return Oe(() => {
|
|
242
242
|
if (H.onInput)
|
|
243
243
|
throw new Error("ll-select: use the @update:model-value event instead of @input.");
|
|
244
|
-
window.addEventListener("resize",
|
|
244
|
+
window.addEventListener("resize", O), O();
|
|
245
245
|
}), Me(() => {
|
|
246
|
-
window.removeEventListener("resize",
|
|
246
|
+
window.removeEventListener("resize", O);
|
|
247
247
|
}), (t, l) => (o(), K(Je, {
|
|
248
248
|
id: e.id,
|
|
249
|
-
class:
|
|
249
|
+
class: k(["input ll-select stash-select", y(H).class]),
|
|
250
250
|
"data-test": "stash-select",
|
|
251
251
|
"add-bottom-space": e.addBottomSpace,
|
|
252
252
|
"error-text": e.errorText || e.error,
|
|
253
253
|
"hint-text": e.hintText || e.hint,
|
|
254
254
|
label: e.label,
|
|
255
|
-
"show-optional-in-label": e.showOptionalInLabel
|
|
255
|
+
"show-optional-in-label": e.showOptionalInLabel,
|
|
256
|
+
disabled: e.disabled
|
|
256
257
|
}, Fe({
|
|
257
258
|
default: M(({ fieldId: s, fieldErrorId: r, hasError: i }) => [
|
|
258
259
|
p("select", {
|
|
@@ -265,11 +266,11 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
265
266
|
name: e.name,
|
|
266
267
|
onChange: _e
|
|
267
268
|
}, [
|
|
268
|
-
(o(!0), d(V, null, G(
|
|
269
|
+
(o(!0), d(V, null, G(C.value, (a, b) => (o(), d("option", {
|
|
269
270
|
key: `srOnlyOption-${b}`,
|
|
270
|
-
selected:
|
|
271
|
+
selected: g(a),
|
|
271
272
|
value: a[e.trackBy]
|
|
272
|
-
},
|
|
273
|
+
}, B(a[e.displayBy] || ""), 9, et))), 128)),
|
|
273
274
|
l[5] || (l[5] = p("option", { value: "" }, null, -1))
|
|
274
275
|
], 40, Ze),
|
|
275
276
|
F((o(), d("div", {
|
|
@@ -277,26 +278,26 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
277
278
|
ref: Q,
|
|
278
279
|
role: "listbox",
|
|
279
280
|
"aria-hidden": "true",
|
|
280
|
-
class:
|
|
281
|
+
class: k(["stash-select__content-wrapper", [
|
|
281
282
|
{
|
|
282
283
|
"stash-select--disabled": !!e.disabled,
|
|
283
284
|
"stash-select--error": !!(e.errorText || e.error),
|
|
284
|
-
"stash-select--active":
|
|
285
|
+
"stash-select--active": u.value,
|
|
285
286
|
"stash-select--single": e.single
|
|
286
287
|
},
|
|
287
288
|
// @deprecated
|
|
288
289
|
{
|
|
289
|
-
"is-active":
|
|
290
|
+
"is-active": u.value,
|
|
290
291
|
"is-single": e.single,
|
|
291
292
|
"is-disabled": e.disabled
|
|
292
293
|
}
|
|
293
294
|
]]),
|
|
294
295
|
"aria-controls": "listbox-" + s,
|
|
295
|
-
"aria-expanded":
|
|
296
|
+
"aria-expanded": u.value,
|
|
296
297
|
"aria-label": e.placeholder,
|
|
297
298
|
"aria-disabled": e.disabled || void 0,
|
|
298
|
-
onKeydown:
|
|
299
|
-
onKeyup: oe(
|
|
299
|
+
onKeydown: we,
|
|
300
|
+
onKeyup: oe(w, ["esc"])
|
|
300
301
|
}, [
|
|
301
302
|
p("div", {
|
|
302
303
|
id: "listbox-" + s,
|
|
@@ -317,21 +318,21 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
317
318
|
}, [
|
|
318
319
|
n.value.length ? R("", !0) : (o(), d("li", {
|
|
319
320
|
key: 0,
|
|
320
|
-
class:
|
|
321
|
-
},
|
|
321
|
+
class: k(["stash-select__placeholder tw-mr-0 tw-pl-1.5", { "tw-truncate": !e.noTruncate }])
|
|
322
|
+
}, B(e.placeholder), 3)),
|
|
322
323
|
e.single ? (o(!0), d(V, { key: 1 }, G(n.value, (a) => (o(), d("li", {
|
|
323
324
|
key: `chip-${a[e.trackBy]}`,
|
|
324
|
-
class:
|
|
325
|
+
class: k(["stash-select__selected tw-mr-0 tw-pl-1.5", { "tw-truncate": !e.noTruncate }])
|
|
325
326
|
}, [
|
|
326
327
|
j(t.$slots, "selected", { option: a }, () => [
|
|
327
|
-
$(
|
|
328
|
+
$(B(a[e.displayBy] || a) + " ", 1),
|
|
328
329
|
p("button", {
|
|
329
330
|
tabindex: "-1",
|
|
330
331
|
class: "stash-select__remove",
|
|
331
|
-
onKeypress: oe(P((b) =>
|
|
332
|
-
onMousedown: P((b) =>
|
|
332
|
+
onKeypress: oe(P((b) => I(a), ["prevent"]), ["enter"]),
|
|
333
|
+
onMousedown: P((b) => I(a), ["prevent", "stop"])
|
|
333
334
|
}, [
|
|
334
|
-
|
|
335
|
+
S(z, {
|
|
335
336
|
icon: "close",
|
|
336
337
|
name: "close",
|
|
337
338
|
size: "small"
|
|
@@ -342,22 +343,22 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
342
343
|
key: `chip-${a[e.trackBy]}`,
|
|
343
344
|
class: "tw-inline-block"
|
|
344
345
|
}, [
|
|
345
|
-
|
|
346
|
+
S(ie, {
|
|
346
347
|
"bg-color": "blue-500",
|
|
347
348
|
"is-removable": "",
|
|
348
349
|
"text-color": "white",
|
|
349
350
|
class: "stash-select__chip",
|
|
350
|
-
onRemove: (b) =>
|
|
351
|
+
onRemove: (b) => I(a)
|
|
351
352
|
}, {
|
|
352
353
|
default: M(() => [
|
|
353
|
-
$(
|
|
354
|
+
$(B(a[e.displayBy] || a), 1)
|
|
354
355
|
]),
|
|
355
356
|
_: 2
|
|
356
357
|
}, 1032, ["onRemove"])
|
|
357
358
|
]))), 128))
|
|
358
359
|
], 512),
|
|
359
360
|
ve.value ? (o(), d("div", st, [
|
|
360
|
-
|
|
361
|
+
S(ie, {
|
|
361
362
|
"bg-color": "blue-500",
|
|
362
363
|
"is-removable": "",
|
|
363
364
|
"text-color": "white",
|
|
@@ -365,27 +366,27 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
365
366
|
onRemove: ye
|
|
366
367
|
}, {
|
|
367
368
|
default: M(() => [
|
|
368
|
-
$(
|
|
369
|
+
$(B(he.value), 1)
|
|
369
370
|
]),
|
|
370
371
|
_: 1
|
|
371
372
|
})
|
|
372
373
|
])) : R("", !0),
|
|
373
374
|
e.icon ? (o(), K(z, {
|
|
374
375
|
key: 1,
|
|
375
|
-
class: "stash-select__icon",
|
|
376
|
+
class: k(["stash-select__icon", { "tw-text-ice-500": e.disabled }]),
|
|
376
377
|
"data-test": "stash-select|toggle-icon",
|
|
377
378
|
name: e.icon,
|
|
378
|
-
onMousedown: l[0] || (l[0] = P((a) =>
|
|
379
|
-
}, null, 8, ["name"])) : R("", !0),
|
|
379
|
+
onMousedown: l[0] || (l[0] = P((a) => u.value && w(), ["prevent"]))
|
|
380
|
+
}, null, 8, ["name", "class"])) : R("", !0),
|
|
380
381
|
(o(), K(Re, {
|
|
381
382
|
to: e.teleportTo,
|
|
382
383
|
disabled: !e.enableTeleport
|
|
383
384
|
}, [
|
|
384
|
-
|
|
385
|
+
S($e, { name: "fade" }, {
|
|
385
386
|
default: M(() => [
|
|
386
387
|
F(p("div", {
|
|
387
388
|
ref_key: "optionsWrapperRef",
|
|
388
|
-
ref:
|
|
389
|
+
ref: x,
|
|
389
390
|
class: "stash-select__border-selector tw-w-full tw-shadow-2xl",
|
|
390
391
|
style: Pe(y(fe)),
|
|
391
392
|
onClick: l[3] || (l[3] = P(() => {
|
|
@@ -407,30 +408,30 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
407
408
|
}, null, 40, ot), [
|
|
408
409
|
[ze, _.value]
|
|
409
410
|
]),
|
|
410
|
-
|
|
411
|
+
S(z, {
|
|
411
412
|
name: "search",
|
|
412
413
|
class: "tw-text-ice-500"
|
|
413
414
|
})
|
|
414
415
|
])) : R("", !0),
|
|
415
416
|
p("ul", rt, [
|
|
416
|
-
(o(!0), d(V, null, G(
|
|
417
|
+
(o(!0), d(V, null, G(C.value, (a, b) => (o(), d("li", {
|
|
417
418
|
key: `option-${a[e.trackBy]}`,
|
|
418
419
|
"data-test": a[e.trackBy],
|
|
419
|
-
class:
|
|
420
|
-
onClick: (
|
|
421
|
-
onMouseenter: P((
|
|
420
|
+
class: k(ke(a, b)),
|
|
421
|
+
onClick: (xe) => L(a),
|
|
422
|
+
onMouseenter: P((xe) => D(b), ["self"])
|
|
422
423
|
}, [
|
|
423
424
|
j(t.$slots, "option", { option: a }, () => [
|
|
424
|
-
$(
|
|
425
|
+
$(B(a[e.displayBy] || a), 1)
|
|
425
426
|
], !0),
|
|
426
|
-
|
|
427
|
+
g(a) && !e.hideCheck ? (o(), K(z, {
|
|
427
428
|
key: 0,
|
|
428
429
|
class: "tw-ml-auto tw-text-blue-500",
|
|
429
430
|
name: "check"
|
|
430
431
|
})) : R("", !0)
|
|
431
432
|
], 42, it))), 128)),
|
|
432
|
-
F(p("li",
|
|
433
|
-
|
|
433
|
+
F(p("li", ct, [
|
|
434
|
+
S(z, {
|
|
434
435
|
"data-test": "stash-select|options-loading",
|
|
435
436
|
name: "working",
|
|
436
437
|
class: "tw-animate-spin tw-text-ice-500"
|
|
@@ -438,16 +439,16 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
438
439
|
], 512), [
|
|
439
440
|
[J, e.loading || le.value]
|
|
440
441
|
]),
|
|
441
|
-
F(p("li",
|
|
442
|
+
F(p("li", ut, [
|
|
442
443
|
j(t.$slots, "no-options", {}, () => [
|
|
443
444
|
l[6] || (l[6] = $(" No options "))
|
|
444
445
|
], !0)
|
|
445
446
|
], 512), [
|
|
446
|
-
[J, !e.loading && !le.value && !
|
|
447
|
+
[J, !e.loading && !le.value && !C.value.length]
|
|
447
448
|
])
|
|
448
449
|
])
|
|
449
450
|
], 4), [
|
|
450
|
-
[J,
|
|
451
|
+
[J, u.value && !e.disabled]
|
|
451
452
|
])
|
|
452
453
|
]),
|
|
453
454
|
_: 3
|
|
@@ -467,10 +468,10 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
467
468
|
]),
|
|
468
469
|
key: "0"
|
|
469
470
|
} : void 0
|
|
470
|
-
]), 1032, ["id", "add-bottom-space", "class", "error-text", "hint-text", "label", "show-optional-in-label"]));
|
|
471
|
+
]), 1032, ["id", "add-bottom-space", "class", "error-text", "hint-text", "label", "show-optional-in-label", "disabled"]));
|
|
471
472
|
}
|
|
472
473
|
});
|
|
473
|
-
const Dt = /* @__PURE__ */ Qe(dt, [["__scopeId", "data-v-
|
|
474
|
+
const Dt = /* @__PURE__ */ Qe(dt, [["__scopeId", "data-v-173b2aea"]]);
|
|
474
475
|
export {
|
|
475
476
|
Dt as default
|
|
476
477
|
};
|