@leaflink/stash 51.6.0 → 51.8.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/assets/icons/tag-leaf.svg +3 -0
- package/assets/spritesheet.svg +1 -1
- package/dist/Accordion.vue.d.ts +2 -2
- package/dist/AppNavigationItem.vue.d.ts +1 -1
- package/dist/Filters.vue.d.ts +22 -7
- package/dist/Icon.js +10 -9
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.vue.d.ts +1 -1
- package/dist/IconLabel.vue.d.ts +1 -1
- package/dist/ListView.vue.d.ts +24 -13
- package/dist/QuickAction.vue.d.ts +1 -1
- package/dist/SectionHeader.vue.d.ts +2 -2
- package/dist/Select.js +130 -122
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +46 -9
- package/dist/SelectStatus.vue.d.ts +1 -1
- package/dist/TextEditor.vue.d.ts +1 -1
- package/dist/components.css +1 -1
- package/package.json +1 -1
|
@@ -50,7 +50,7 @@ onActionEvent?: (() => any) | undefined;
|
|
|
50
50
|
}>, {
|
|
51
51
|
to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;
|
|
52
52
|
actionLabel: string;
|
|
53
|
-
actionIcon: "close" | "copy" | "submit" | "sort" | "search" | "split" | "link" | "tag" | "menu" | "image" | "action-dots" | "activity" | "alert-bell" | "archive" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "badge-discount" | "badge-seller-elite" | "badge-seller-power" | "badge-seller-verified" | "bank" | "book-customer" | "building-office" | "bulk-add" | "calendar-reschedule" | "calendar" | "camera" | "caret-down" | "caret-up" | "change-log" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "circle-check" | "circle-close" | "circle-dollar" | "circle-empty" | "circle-info" | "circle-partial" | "circle-percent" | "circle-question-mark" | "circle-slash" | "circle-status" | "circle-warning" | "clipboard-checkmark" | "clipboard-inventory" | "combine" | "compass" | "contact" | "contract" | "credit-card" | "credit-profile" | "dashboard" | "document-accept" | "document-invoice" | "document-recieved" | "document-sent" | "document-view" | "document" | "dolly" | "download" | "edit" | "ellipsis" | "envelope-open" | "envelope" | "equals" | "export" | "face-id" | "face" | "figma" | "file-csv" | "file" | "filter-funnel" | "filter-line" | "fingerprint" | "flag" | "folder" | "folder-bar-graph" | "folder-orders" | "font-bold" | "font-clear-format" | "font-italic" | "font-underline" | "gear" | "github" | "globe" | "graph-bar-chart" | "graph-line-chart" | "graph-pie-chart" | "hazard" | "hazard-outline" | "headset-agent" | "headset-mic" | "heart-filled" | "heart-outline" | "help-question-mark" | "hide" | "history" | "home" | "import" | "keyboard-return" | "tier-1" | "tier-2" | "tier-3" | "license-approved" | "license-certificate" | "lightbulb" | "link-add" | "link-unlink" | "list-bulleted" | "list-items" | "list-numbered" | "loading-big" | "loading-empty" | "loading-small" | "location" | "lock-unlock" | "lock" | "logo-facebook" | "logo-instagram" | "logo-linkedin" | "logo-ll" | "logo-metrc" | "logo-plaid" | "logo-x" | "logo-youtube" | "logout" | "medical" | "megaphone-sound" | "megaphone" | "message-dispute" | "message-reply" | "message" | "minus" | "mj-leaf" | "money" | "note-add" | "note" | "open-in-new" | "paperclip" | "paper-plane" | "performance" | "phone" | "plus" | "preview" | "print" | "product-menu-manage" | "product-menu-search" | "product-menu" | "queue-add" | "queue" | "recent" | "refresh" | "register" | "reorder" | "reply" | "report-download" | "sample" | "save" | "scale-law" | "scale-weight" | "seed-cycle" | "share" | "shop-bag-browse" | "shop-bag-reorder" | "shop-bag" | "shop-basket" | "shop-cart-add" | "shop-cart" | "show" | "sign-dollar" | "sign-percent" | "star-filled" | "star-outline" | "start" | "storefront" | "swap-horizontal" | "swap-vertical" | "tag-star" | "test-results" | "ticket-star" | "ticket" | "tool-dropper" | "tool-wrench" | "transfer" | "trashcan" | "truck" | "upload" | "user-add" | "user-admin" | "user-check" | "user-group" | "user" | "view-card" | "view-detailed" | "view-list" | "warehouse" | "working";
|
|
53
|
+
actionIcon: "close" | "copy" | "submit" | "sort" | "search" | "split" | "link" | "tag" | "menu" | "image" | "action-dots" | "activity" | "alert-bell" | "archive" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "badge-discount" | "badge-seller-elite" | "badge-seller-power" | "badge-seller-verified" | "bank" | "book-customer" | "building-office" | "bulk-add" | "calendar-reschedule" | "calendar" | "camera" | "caret-down" | "caret-up" | "change-log" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "circle-check" | "circle-close" | "circle-dollar" | "circle-empty" | "circle-info" | "circle-partial" | "circle-percent" | "circle-question-mark" | "circle-slash" | "circle-status" | "circle-warning" | "clipboard-checkmark" | "clipboard-inventory" | "combine" | "compass" | "contact" | "contract" | "credit-card" | "credit-profile" | "dashboard" | "document-accept" | "document-invoice" | "document-recieved" | "document-sent" | "document-view" | "document" | "dolly" | "download" | "edit" | "ellipsis" | "envelope-open" | "envelope" | "equals" | "export" | "face-id" | "face" | "figma" | "file-csv" | "file" | "filter-funnel" | "filter-line" | "fingerprint" | "flag" | "folder" | "folder-bar-graph" | "folder-orders" | "font-bold" | "font-clear-format" | "font-italic" | "font-underline" | "gear" | "github" | "globe" | "graph-bar-chart" | "graph-line-chart" | "graph-pie-chart" | "hazard" | "hazard-outline" | "headset-agent" | "headset-mic" | "heart-filled" | "heart-outline" | "help-question-mark" | "hide" | "history" | "home" | "import" | "keyboard-return" | "tier-1" | "tier-2" | "tier-3" | "license-approved" | "license-certificate" | "lightbulb" | "link-add" | "link-unlink" | "list-bulleted" | "list-items" | "list-numbered" | "loading-big" | "loading-empty" | "loading-small" | "location" | "lock-unlock" | "lock" | "logo-facebook" | "logo-instagram" | "logo-linkedin" | "logo-ll" | "logo-metrc" | "logo-plaid" | "logo-x" | "logo-youtube" | "logout" | "medical" | "megaphone-sound" | "megaphone" | "message-dispute" | "message-reply" | "message" | "minus" | "mj-leaf" | "money" | "note-add" | "note" | "open-in-new" | "paperclip" | "paper-plane" | "performance" | "phone" | "plus" | "preview" | "print" | "product-menu-manage" | "product-menu-search" | "product-menu" | "queue-add" | "queue" | "recent" | "refresh" | "register" | "reorder" | "reply" | "report-download" | "sample" | "save" | "scale-law" | "scale-weight" | "seed-cycle" | "share" | "shop-bag-browse" | "shop-bag-reorder" | "shop-bag" | "shop-basket" | "shop-cart-add" | "shop-cart" | "show" | "sign-dollar" | "sign-percent" | "star-filled" | "star-outline" | "start" | "storefront" | "swap-horizontal" | "swap-vertical" | "tag-star" | "tag-leaf" | "test-results" | "ticket-star" | "ticket" | "tool-dropper" | "tool-wrench" | "transfer" | "trashcan" | "truck" | "upload" | "user-add" | "user-admin" | "user-check" | "user-group" | "user" | "view-card" | "view-detailed" | "view-list" | "warehouse" | "working";
|
|
54
54
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
55
55
|
default?(_: {}): any;
|
|
56
56
|
}>;
|
|
@@ -63,7 +63,7 @@ declare type IconName = (typeof iconNames)[number];
|
|
|
63
63
|
*
|
|
64
64
|
* https://github.com/LeafLink/stash/blob/main/CONTRIBUTING.md#adding-a-new-icon
|
|
65
65
|
*/
|
|
66
|
-
declare const iconNames: readonly ["action-dots", "activity", "alert-bell", "archive", "arrow-down", "arrow-left", "arrow-right", "arrow-up", "badge-discount", "badge-seller-elite", "badge-seller-power", "badge-seller-verified", "bank", "book-customer", "building-office", "bulk-add", "calendar-reschedule", "calendar", "camera", "caret-down", "caret-up", "change-log", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "circle-check", "circle-close", "circle-dollar", "circle-empty", "circle-info", "circle-partial", "circle-percent", "circle-question-mark", "circle-slash", "circle-status", "circle-warning", "clipboard-checkmark", "clipboard-inventory", "close", "combine", "compass", "contact", "contract", "copy", "credit-card", "credit-profile", "dashboard", "document-accept", "document-invoice", "document-recieved", "document-sent", "document-view", "document", "dolly", "download", "edit", "ellipsis", "envelope-open", "envelope", "equals", "export", "face-id", "face", "figma", "file-csv", "file", "filter-funnel", "filter-line", "fingerprint", "flag", "folder", "folder-bar-graph", "folder-orders", "font-bold", "font-clear-format", "font-italic", "font-underline", "gear", "github", "globe", "graph-bar-chart", "graph-line-chart", "graph-pie-chart", "hazard", "hazard-outline", "headset-agent", "headset-mic", "heart-filled", "heart-outline", "help-question-mark", "hide", "history", "home", "image", "import", "keyboard-return", "tier-1", "tier-2", "tier-3", "license-approved", "license-certificate", "lightbulb", "link-add", "link-unlink", "link", "list-bulleted", "list-items", "list-numbered", "loading-big", "loading-empty", "loading-small", "location", "lock-unlock", "lock", "logo-facebook", "logo-instagram", "logo-linkedin", "logo-ll", "logo-metrc", "logo-plaid", "logo-x", "logo-youtube", "logout", "medical", "megaphone-sound", "megaphone", "menu", "message-dispute", "message-reply", "message", "minus", "mj-leaf", "money", "note-add", "note", "open-in-new", "paperclip", "paper-plane", "performance", "phone", "plus", "preview", "print", "product-menu-manage", "product-menu-search", "product-menu", "queue-add", "queue", "recent", "refresh", "register", "reorder", "reply", "report-download", "sample", "save", "scale-law", "scale-weight", "search", "seed-cycle", "share", "shop-bag-browse", "shop-bag-reorder", "shop-bag", "shop-basket", "shop-cart-add", "shop-cart", "show", "sign-dollar", "sign-percent", "sort", "split", "star-filled", "star-outline", "start", "storefront", "submit", "swap-horizontal", "swap-vertical", "tag-star", "tag", "test-results", "ticket-star", "ticket", "tool-dropper", "tool-wrench", "transfer", "trashcan", "truck", "upload", "user-add", "user-admin", "user-check", "user-group", "user", "view-card", "view-detailed", "view-list", "warehouse", "working"];
|
|
66
|
+
declare const iconNames: readonly ["action-dots", "activity", "alert-bell", "archive", "arrow-down", "arrow-left", "arrow-right", "arrow-up", "badge-discount", "badge-seller-elite", "badge-seller-power", "badge-seller-verified", "bank", "book-customer", "building-office", "bulk-add", "calendar-reschedule", "calendar", "camera", "caret-down", "caret-up", "change-log", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "circle-check", "circle-close", "circle-dollar", "circle-empty", "circle-info", "circle-partial", "circle-percent", "circle-question-mark", "circle-slash", "circle-status", "circle-warning", "clipboard-checkmark", "clipboard-inventory", "close", "combine", "compass", "contact", "contract", "copy", "credit-card", "credit-profile", "dashboard", "document-accept", "document-invoice", "document-recieved", "document-sent", "document-view", "document", "dolly", "download", "edit", "ellipsis", "envelope-open", "envelope", "equals", "export", "face-id", "face", "figma", "file-csv", "file", "filter-funnel", "filter-line", "fingerprint", "flag", "folder", "folder-bar-graph", "folder-orders", "font-bold", "font-clear-format", "font-italic", "font-underline", "gear", "github", "globe", "graph-bar-chart", "graph-line-chart", "graph-pie-chart", "hazard", "hazard-outline", "headset-agent", "headset-mic", "heart-filled", "heart-outline", "help-question-mark", "hide", "history", "home", "image", "import", "keyboard-return", "tier-1", "tier-2", "tier-3", "license-approved", "license-certificate", "lightbulb", "link-add", "link-unlink", "link", "list-bulleted", "list-items", "list-numbered", "loading-big", "loading-empty", "loading-small", "location", "lock-unlock", "lock", "logo-facebook", "logo-instagram", "logo-linkedin", "logo-ll", "logo-metrc", "logo-plaid", "logo-x", "logo-youtube", "logout", "medical", "megaphone-sound", "megaphone", "menu", "message-dispute", "message-reply", "message", "minus", "mj-leaf", "money", "note-add", "note", "open-in-new", "paperclip", "paper-plane", "performance", "phone", "plus", "preview", "print", "product-menu-manage", "product-menu-search", "product-menu", "queue-add", "queue", "recent", "refresh", "register", "reorder", "reply", "report-download", "sample", "save", "scale-law", "scale-weight", "search", "seed-cycle", "share", "shop-bag-browse", "shop-bag-reorder", "shop-bag", "shop-basket", "shop-cart-add", "shop-cart", "show", "sign-dollar", "sign-percent", "sort", "split", "star-filled", "star-outline", "start", "storefront", "submit", "swap-horizontal", "swap-vertical", "tag-star", "tag", "tag-leaf", "test-results", "ticket-star", "ticket", "tool-dropper", "tool-wrench", "transfer", "trashcan", "truck", "upload", "user-add", "user-admin", "user-check", "user-group", "user", "view-card", "view-detailed", "view-list", "warehouse", "working"];
|
|
67
67
|
|
|
68
68
|
declare interface SectionHeaderProps {
|
|
69
69
|
/**
|
package/dist/Select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Oe, useAttrs as Ie, useSlots as
|
|
1
|
+
import { defineComponent as Oe, useAttrs as Ie, useSlots as Re, ref as c, computed as v, watch as V, nextTick as Y, onMounted as Me, onUnmounted as Fe, createBlock as J, openBlock as r, mergeProps as $e, unref as g, createSlots as Pe, withCtx as E, createElementVNode as f, toDisplayString as b, withDirectives as R, createElementBlock as d, Fragment as K, renderList as G, withKeys as re, normalizeClass as M, createCommentVNode as F, renderSlot as $, createTextVNode as P, withModifiers as z, createVNode as B, Teleport as ze, Transition as He, normalizeStyle as Ne, vModelText as Ae, vShow as Q } from "vue";
|
|
2
2
|
import { u as De, a as Le, f as Ue, o as Ve, s as Ke } from "./floating-ui.vue-pzUuloyX.js";
|
|
3
3
|
import Ge from "@leaflink/snitch";
|
|
4
4
|
import qe from "lodash-es/debounce";
|
|
@@ -7,11 +7,11 @@ import ie from "lodash-es/isEqual";
|
|
|
7
7
|
import We from "lodash-es/isPlainObject";
|
|
8
8
|
import Xe from "lodash-es/uniqueId";
|
|
9
9
|
import Ye from "./useSearch.js";
|
|
10
|
-
import { DEBOUNCE as Je, KEY_CODES as
|
|
10
|
+
import { DEBOUNCE as Je, KEY_CODES as T } from "./constants.js";
|
|
11
11
|
import Qe from "./directives/clickoutside.js";
|
|
12
12
|
import { D as Ze } from "./MenusPlugin-Bk6UW6o9.js";
|
|
13
13
|
import ce from "./Chip.js";
|
|
14
|
-
import
|
|
14
|
+
import H from "./Icon.js";
|
|
15
15
|
import { _ as et } from "./Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js";
|
|
16
16
|
import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
17
17
|
const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id", "aria-labelledby"], at = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], nt = ["selected", "value", "disabled"], ot = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled"], rt = ["id"], it = ["onKeypress", "onMousedown"], ct = {
|
|
@@ -20,10 +20,10 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
20
20
|
}, ut = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "tw-flex tw-items-center tw-border-b tw-border-blue-500 tw-pr-1.5"
|
|
23
|
-
}, dt = ["data-test", "placeholder"], ft = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, pt = ["data-test", "onClick", "onMouseenter"],
|
|
23
|
+
}, dt = ["data-test", "placeholder"], ft = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, pt = ["data-test", "onClick", "onMouseenter"], vt = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "tw-ml-auto tw-pl-1.5"
|
|
26
|
-
},
|
|
26
|
+
}, ht = { class: "tw-m-1.5 tw-cursor-default tw-p-1.5" }, mt = {
|
|
27
27
|
class: "tw-m-1.5 tw-cursor-default tw-p-1.5",
|
|
28
28
|
"data-test": "stash-select|no-options"
|
|
29
29
|
}, yt = /* @__PURE__ */ Oe({
|
|
@@ -76,12 +76,12 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
76
76
|
},
|
|
77
77
|
emits: ["update:model-value", "clear", "add", "remove", "opened", "closed"],
|
|
78
78
|
setup(ue, { emit: de }) {
|
|
79
|
-
const t = ue,
|
|
79
|
+
const t = ue, h = de, N = Ie(), fe = Re(), Z = c(null), m = c(null), x = c(null), q = c(null), ee = c(null), A = c(0), C = c(0), n = c([]), te = c(() => []), y = c(""), p = c(-1), u = c(!1), j = c({}), le = c(!1), { floatingStyles: pe } = De(Z, x, {
|
|
80
80
|
whileElementsMounted: Le,
|
|
81
81
|
placement: t.menuPlacement,
|
|
82
82
|
middleware: [
|
|
83
83
|
Ue(),
|
|
84
|
-
Ve(({ rects: e, placement: l }) => l.split("-")[0] === "bottom" &&
|
|
84
|
+
Ve(({ rects: e, placement: l }) => l.split("-")[0] === "bottom" && A.value > C.value ? A.value - e.reference.height + 6 : 6),
|
|
85
85
|
Ke({
|
|
86
86
|
apply({ availableHeight: e, elements: l, rects: a }) {
|
|
87
87
|
t.enableTeleport && Object.assign(l.floating.style, {
|
|
@@ -91,13 +91,13 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
91
91
|
}
|
|
92
92
|
})
|
|
93
93
|
]
|
|
94
|
-
}), W =
|
|
94
|
+
}), W = v(() => !t.hideSearch && t.searchable !== "false" && t.searchable !== !1), D = v(() => {
|
|
95
95
|
let e = (le.value && t.lazy ? t.lazy() : t.options).filter(Boolean);
|
|
96
96
|
return We(e[0]) || (e = e.map((l, a) => ({ name: l, id: a }))), e;
|
|
97
|
-
}),
|
|
98
|
-
() => !u.value && !t.single && !
|
|
99
|
-
), ye =
|
|
100
|
-
|
|
97
|
+
}), ve = v(() => n.value.length ? n.value.map((e) => e[t.displayBy] || e).join(", ") : ""), se = v(() => t.searchLoading || Object.keys(j.value).length > 0), O = v(() => t.disableFiltering || !(y.value || "").trim() ? D.value : te.value(y.value)), he = v(() => A.value <= C.value), me = v(
|
|
98
|
+
() => !u.value && !t.single && !he.value && n.value.length
|
|
99
|
+
), ye = v(() => [n.value.length, t.selectItemType, "selected"].filter(Boolean).join(" ")), we = v(() => t.preventEmpty || t.allowEmpty === "false" || t.allowEmpty === !1);
|
|
100
|
+
V(y, (e, l) => l !== e && U(-1)), V(n, () => I(), { deep: !0 }), V(
|
|
101
101
|
() => t.modelValue,
|
|
102
102
|
(e) => {
|
|
103
103
|
if (Array.isArray(e)) {
|
|
@@ -112,11 +112,11 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
112
112
|
n.value = [];
|
|
113
113
|
},
|
|
114
114
|
{ immediate: !0 }
|
|
115
|
-
),
|
|
115
|
+
), V(
|
|
116
116
|
() => t.options,
|
|
117
117
|
() => {
|
|
118
118
|
const { searchFor: e } = Ye({
|
|
119
|
-
items:
|
|
119
|
+
items: v(() => D.value),
|
|
120
120
|
fieldNames: t.searchBy.length ? t.searchBy : [t.displayBy],
|
|
121
121
|
trackBy: t.trackBy
|
|
122
122
|
});
|
|
@@ -125,16 +125,16 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
125
125
|
{ immediate: !0 }
|
|
126
126
|
);
|
|
127
127
|
const X = (e) => e && typeof e == "object" && "disabled" in e && (e == null ? void 0 : e.disabled), _e = () => {
|
|
128
|
-
n.value = [],
|
|
129
|
-
},
|
|
130
|
-
t.disabled || !e || X(e) || (
|
|
128
|
+
n.value = [], h("update:model-value", t.single ? void 0 : n.value), h("clear");
|
|
129
|
+
}, L = (e) => {
|
|
130
|
+
t.disabled || !e || X(e) || (S(e) ? w(e) : (t.single && (n.value = []), n.value.push(e), h("update:model-value", t.single ? n.value[0] : n.value), h("add", e)), t.single && k());
|
|
131
131
|
}, ge = (e) => {
|
|
132
132
|
if (t.single) {
|
|
133
|
-
const a =
|
|
133
|
+
const a = D.value.find((o) => {
|
|
134
134
|
var i;
|
|
135
135
|
return ((i = o[t.trackBy]) == null ? void 0 : i.toString()) === e.target.value;
|
|
136
136
|
});
|
|
137
|
-
|
|
137
|
+
L(a);
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
const l = [...e.target.selectedOptions];
|
|
@@ -142,17 +142,17 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
142
142
|
l.find((i) => {
|
|
143
143
|
var s;
|
|
144
144
|
return i.value === ((s = a[t.trackBy]) == null ? void 0 : s.toString());
|
|
145
|
-
}) ||
|
|
145
|
+
}) || w(a);
|
|
146
146
|
for (const a of l) {
|
|
147
|
-
const o =
|
|
147
|
+
const o = D.value.find(
|
|
148
148
|
(i) => {
|
|
149
149
|
var s;
|
|
150
150
|
return ((s = i[t.trackBy]) == null ? void 0 : s.toString()) === a.value;
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
|
|
153
|
+
S(o) || L(o);
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, w = (e) => {
|
|
156
156
|
if (t.disabled || we.value && n.value.length === 1)
|
|
157
157
|
return;
|
|
158
158
|
const l = n.value.findIndex((a) => a[t.trackBy] === e[t.trackBy]);
|
|
@@ -160,35 +160,35 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
160
160
|
Ge.warn("ll-select: could not find option to remove", e);
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
|
-
n.value.splice(l, 1),
|
|
163
|
+
n.value.splice(l, 1), h("update:model-value", t.single ? n.value[0] : n.value), h("remove", e, l);
|
|
164
164
|
}, ae = () => {
|
|
165
|
-
u.value || (I(), u.value = !0,
|
|
165
|
+
u.value || (I(), u.value = !0, h("opened"), W.value && Y(() => {
|
|
166
166
|
var e;
|
|
167
167
|
(e = ee.value) == null || e.focus({ preventScroll: !0 });
|
|
168
168
|
}));
|
|
169
|
-
},
|
|
169
|
+
}, k = () => {
|
|
170
170
|
var e;
|
|
171
|
-
u.value &&
|
|
171
|
+
u.value && h("closed", n.value), U(-1), u.value = !1, t.preserveSearchTerm || (y.value = ""), (e = m.value) == null || e.blur();
|
|
172
172
|
}, be = async (e) => {
|
|
173
173
|
if (await Y(), !m.value)
|
|
174
174
|
return;
|
|
175
|
-
if (![
|
|
175
|
+
if (![T.ENTER, T.ESCAPE].includes(e.keyCode)) {
|
|
176
176
|
const a = m.value.querySelector(".stash-select__option--highlighted"), o = a == null ? void 0 : a.getBoundingClientRect(), i = m.value.getBoundingClientRect();
|
|
177
177
|
if (!o || !i)
|
|
178
178
|
return;
|
|
179
179
|
(o.bottom >= i.bottom || o.top <= i.top + o.height) && (a == null || a.scrollIntoView({ block: "nearest", inline: "nearest" }));
|
|
180
180
|
}
|
|
181
|
-
},
|
|
181
|
+
}, U = (e) => {
|
|
182
182
|
p.value = e;
|
|
183
183
|
}, Be = (e) => {
|
|
184
|
-
if (e.keyCode ===
|
|
185
|
-
|
|
186
|
-
else if (e.keyCode ===
|
|
184
|
+
if (e.keyCode === T.ESCAPE)
|
|
185
|
+
k();
|
|
186
|
+
else if (e.keyCode === T.DOWN && p.value < O.value.length - 1 && u.value)
|
|
187
187
|
p.value++;
|
|
188
|
-
else if (e.keyCode ===
|
|
188
|
+
else if (e.keyCode === T.UP && p.value > 0)
|
|
189
189
|
u.value && p.value--, x.value && W.value && p.value === 0 && (x.value.scrollTop -= 100);
|
|
190
|
-
else if (e.keyCode ===
|
|
191
|
-
|
|
190
|
+
else if (e.keyCode === T.ENTER && p.value !== -1 && u.value)
|
|
191
|
+
L(O.value[p.value]);
|
|
192
192
|
else
|
|
193
193
|
return;
|
|
194
194
|
e.preventDefault(), be(e);
|
|
@@ -199,7 +199,7 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
199
199
|
return;
|
|
200
200
|
const e = Xe("search-request-");
|
|
201
201
|
try {
|
|
202
|
-
j.value[e] = !0, await t.onSearch(
|
|
202
|
+
j.value[e] = !0, await t.onSearch(y.value);
|
|
203
203
|
} finally {
|
|
204
204
|
delete j.value[e];
|
|
205
205
|
}
|
|
@@ -208,16 +208,16 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
208
208
|
"stash-select__option": !0,
|
|
209
209
|
"stash-select__option--disabled": X(e),
|
|
210
210
|
"stash-select__option--highlighted": p.value === l,
|
|
211
|
-
"stash-select__option--selected":
|
|
211
|
+
"stash-select__option--selected": S(e)
|
|
212
212
|
},
|
|
213
213
|
// @deprecated
|
|
214
214
|
// backwards compatibility
|
|
215
215
|
{
|
|
216
216
|
"is-selected": p.value === l,
|
|
217
217
|
"tw-bg-ice-200": p.value === l,
|
|
218
|
-
"tw-bg-blue-100 tw-text-ice-700":
|
|
218
|
+
"tw-bg-blue-100 tw-text-ice-700": S(e)
|
|
219
219
|
}
|
|
220
|
-
],
|
|
220
|
+
], S = (e) => e == null ? !1 : n.value.some((l) => (l == null ? void 0 : l[t.trackBy]) === e[t.trackBy]);
|
|
221
221
|
function oe(e) {
|
|
222
222
|
var o, i;
|
|
223
223
|
if (!e)
|
|
@@ -227,44 +227,44 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
227
227
|
}
|
|
228
228
|
function Ee(e) {
|
|
229
229
|
const l = e.relatedTarget;
|
|
230
|
-
!oe(l) && l &&
|
|
230
|
+
!oe(l) && l && k();
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function Te(e) {
|
|
233
233
|
const l = e.target;
|
|
234
|
-
oe(l) ||
|
|
234
|
+
oe(l) || k();
|
|
235
235
|
}
|
|
236
|
-
const
|
|
237
|
-
|
|
236
|
+
const xe = () => {
|
|
237
|
+
U(-1);
|
|
238
238
|
}, I = async () => {
|
|
239
|
-
await Y(), q.value && m.value && (
|
|
239
|
+
await Y(), q.value && m.value && (C.value = C.value === 0 ? m.value.clientHeight : C.value, A.value = q.value.clientHeight);
|
|
240
240
|
};
|
|
241
|
-
return
|
|
242
|
-
if (
|
|
241
|
+
return Me(() => {
|
|
242
|
+
if (N.onInput)
|
|
243
243
|
throw new Error("ll-select: use the @update:model-value event instead of @input.");
|
|
244
244
|
window.addEventListener("resize", I), I();
|
|
245
|
-
}),
|
|
245
|
+
}), Fe(() => {
|
|
246
246
|
window.removeEventListener("resize", I);
|
|
247
247
|
}), (e, l) => (r(), J(et, $e(t, {
|
|
248
|
-
class: ["input ll-select stash-select",
|
|
248
|
+
class: ["input ll-select stash-select", g(N).class],
|
|
249
249
|
"data-test": "stash-select",
|
|
250
250
|
"error-text": t.errorText || t.error,
|
|
251
251
|
"hint-text": t.hintText || t.hint
|
|
252
252
|
}), Pe({ _: 2 }, [
|
|
253
253
|
t.isReadOnly ? {
|
|
254
254
|
name: "default",
|
|
255
|
-
fn:
|
|
255
|
+
fn: E(({ fieldId: a, labelId: o }) => [
|
|
256
256
|
f("div", lt, [
|
|
257
257
|
f("span", {
|
|
258
258
|
id: a,
|
|
259
259
|
"aria-labelledby": o,
|
|
260
260
|
class: "show-empty tw-h-min"
|
|
261
|
-
},
|
|
261
|
+
}, b(ve.value), 9, st)
|
|
262
262
|
])
|
|
263
263
|
]),
|
|
264
264
|
key: "0"
|
|
265
265
|
} : {
|
|
266
266
|
name: "default",
|
|
267
|
-
fn:
|
|
267
|
+
fn: E(({ fieldId: a, fieldErrorId: o, hasError: i }) => [
|
|
268
268
|
f("select", {
|
|
269
269
|
id: a,
|
|
270
270
|
"aria-errormessage": o,
|
|
@@ -275,20 +275,20 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
275
275
|
name: t.name,
|
|
276
276
|
onChange: ge
|
|
277
277
|
}, [
|
|
278
|
-
(r(!0), d(
|
|
278
|
+
(r(!0), d(K, null, G(O.value, (s, _) => (r(), d("option", {
|
|
279
279
|
key: `srOnlyOption-${_}`,
|
|
280
|
-
selected:
|
|
280
|
+
selected: S(s),
|
|
281
281
|
value: s[t.trackBy],
|
|
282
282
|
disabled: X(s)
|
|
283
|
-
},
|
|
283
|
+
}, b(s[t.displayBy] || ""), 9, nt))), 128)),
|
|
284
284
|
l[5] || (l[5] = f("option", { value: "" }, null, -1))
|
|
285
285
|
], 40, at),
|
|
286
|
-
|
|
286
|
+
R((r(), d("div", {
|
|
287
287
|
ref_key: "selectRef",
|
|
288
288
|
ref: Z,
|
|
289
289
|
role: "listbox",
|
|
290
290
|
"aria-hidden": "true",
|
|
291
|
-
class:
|
|
291
|
+
class: M(["stash-select__content-wrapper", [
|
|
292
292
|
{
|
|
293
293
|
"stash-select--disabled": !!t.disabled,
|
|
294
294
|
"stash-select--error": !!(t.errorText || t.error),
|
|
@@ -308,7 +308,7 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
308
308
|
"aria-label": t.placeholder,
|
|
309
309
|
"aria-disabled": t.disabled || void 0,
|
|
310
310
|
onKeydown: Be,
|
|
311
|
-
onKeyup: re(
|
|
311
|
+
onKeyup: re(k, ["esc"])
|
|
312
312
|
}, [
|
|
313
313
|
f("div", {
|
|
314
314
|
id: "listbox-" + a,
|
|
@@ -321,130 +321,138 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
321
321
|
onFocusinOnce: l[4] || (l[4] = (s) => le.value = !0),
|
|
322
322
|
onFocusout: Ee,
|
|
323
323
|
onKeydown: ae,
|
|
324
|
-
onMouseleave:
|
|
324
|
+
onMouseleave: xe
|
|
325
325
|
}, [
|
|
326
326
|
f("ul", {
|
|
327
327
|
ref_key: "chipsRef",
|
|
328
328
|
ref: q,
|
|
329
329
|
class: "stash-select__chips"
|
|
330
330
|
}, [
|
|
331
|
-
n.value.length ?
|
|
331
|
+
n.value.length ? F("", !0) : (r(), d("li", {
|
|
332
332
|
key: 0,
|
|
333
|
-
class:
|
|
334
|
-
},
|
|
335
|
-
t.single ? (r(!0), d(
|
|
333
|
+
class: M(["stash-select__placeholder tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
|
|
334
|
+
}, b(t.placeholder), 3)),
|
|
335
|
+
t.single ? (r(!0), d(K, { key: 1 }, G(n.value, (s) => (r(), d("li", {
|
|
336
336
|
key: `chip-${s[t.trackBy]}`,
|
|
337
|
-
class:
|
|
337
|
+
class: M(["stash-select__selected tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
|
|
338
338
|
}, [
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
$(e.$slots, "selected", {
|
|
340
|
+
option: s,
|
|
341
|
+
onRemove: () => w(s)
|
|
342
|
+
}, () => [
|
|
343
|
+
P(b(s[t.displayBy] || s) + " ", 1),
|
|
341
344
|
f("button", {
|
|
342
345
|
tabindex: "-1",
|
|
343
346
|
class: "stash-select__remove",
|
|
344
|
-
onKeypress: re(
|
|
345
|
-
onMousedown:
|
|
347
|
+
onKeypress: re(z((_) => w(s), ["prevent"]), ["enter"]),
|
|
348
|
+
onMousedown: z((_) => w(s), ["prevent", "stop"])
|
|
346
349
|
}, [
|
|
347
|
-
|
|
350
|
+
B(H, {
|
|
348
351
|
icon: "close",
|
|
349
352
|
name: "close",
|
|
350
353
|
size: "small"
|
|
351
354
|
})
|
|
352
355
|
], 40, it)
|
|
353
356
|
], !0)
|
|
354
|
-
], 2))), 128)) : (r(!0), d(
|
|
357
|
+
], 2))), 128)) : (r(!0), d(K, { key: 2 }, G(n.value, (s) => (r(), d("li", {
|
|
355
358
|
key: `chip-${s[t.trackBy]}`,
|
|
356
359
|
class: "tw-inline-block"
|
|
357
360
|
}, [
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
361
|
+
$(e.$slots, "selected", {
|
|
362
|
+
option: s,
|
|
363
|
+
onRemove: () => w(s)
|
|
364
|
+
}, () => [
|
|
365
|
+
B(ce, {
|
|
366
|
+
"bg-color": "blue-500",
|
|
367
|
+
"is-removable": "",
|
|
368
|
+
"text-color": "white",
|
|
369
|
+
class: "stash-select__chip",
|
|
370
|
+
onRemove: (_) => w(s)
|
|
371
|
+
}, {
|
|
372
|
+
default: E(() => [
|
|
373
|
+
P(b(s[t.displayBy] || s), 1)
|
|
374
|
+
]),
|
|
375
|
+
_: 2
|
|
376
|
+
}, 1032, ["onRemove"])
|
|
377
|
+
], !0)
|
|
370
378
|
]))), 128))
|
|
371
379
|
], 512),
|
|
372
380
|
me.value ? (r(), d("div", ct, [
|
|
373
|
-
|
|
381
|
+
B(ce, {
|
|
374
382
|
"bg-color": "blue-500",
|
|
375
383
|
"is-removable": "",
|
|
376
384
|
"text-color": "white",
|
|
377
385
|
class: "stash-select__chip",
|
|
378
386
|
onRemove: _e
|
|
379
387
|
}, {
|
|
380
|
-
default:
|
|
381
|
-
|
|
388
|
+
default: E(() => [
|
|
389
|
+
P(b(ye.value), 1)
|
|
382
390
|
]),
|
|
383
391
|
_: 1
|
|
384
392
|
})
|
|
385
|
-
])) :
|
|
386
|
-
t.icon ? (r(), J(
|
|
393
|
+
])) : F("", !0),
|
|
394
|
+
t.icon ? (r(), J(H, {
|
|
387
395
|
key: 1,
|
|
388
|
-
class:
|
|
396
|
+
class: M(["stash-select__icon", { "tw-text-ice-500": t.disabled }]),
|
|
389
397
|
"data-test": "stash-select|toggle-icon",
|
|
390
398
|
name: t.icon,
|
|
391
|
-
onMousedown: l[0] || (l[0] =
|
|
392
|
-
}, null, 8, ["name", "class"])) :
|
|
399
|
+
onMousedown: l[0] || (l[0] = z((s) => u.value && k(), ["prevent"]))
|
|
400
|
+
}, null, 8, ["name", "class"])) : F("", !0),
|
|
393
401
|
(r(), J(ze, {
|
|
394
402
|
to: t.teleportTo,
|
|
395
403
|
disabled: !t.enableTeleport
|
|
396
404
|
}, [
|
|
397
|
-
|
|
398
|
-
default:
|
|
399
|
-
|
|
405
|
+
B(He, { name: "fade" }, {
|
|
406
|
+
default: E(() => [
|
|
407
|
+
R(f("div", {
|
|
400
408
|
ref_key: "optionsWrapperRef",
|
|
401
409
|
ref: x,
|
|
402
410
|
class: "stash-select__border-selector tw-w-full tw-shadow-2xl",
|
|
403
|
-
style: Ne(
|
|
404
|
-
onClick: l[3] || (l[3] =
|
|
411
|
+
style: Ne(g(pe)),
|
|
412
|
+
onClick: l[3] || (l[3] = z(() => {
|
|
405
413
|
}, ["stop"]))
|
|
406
414
|
}, [
|
|
407
415
|
W.value ? (r(), d("div", ut, [
|
|
408
|
-
|
|
416
|
+
R(f("input", {
|
|
409
417
|
ref_key: "searchRef",
|
|
410
418
|
ref: ee,
|
|
411
|
-
"onUpdate:modelValue": l[1] || (l[1] = (s) =>
|
|
419
|
+
"onUpdate:modelValue": l[1] || (l[1] = (s) => y.value = s),
|
|
412
420
|
type: "text",
|
|
413
421
|
autocomplete: "off",
|
|
414
422
|
class: "stash-select__search",
|
|
415
|
-
"data-test":
|
|
423
|
+
"data-test": g(N)["data-test"] ? g(N)["data-test"] + "-search" : "stash-select|search",
|
|
416
424
|
placeholder: t.searchPlaceholder,
|
|
417
425
|
spellcheck: !1,
|
|
418
426
|
onInput: l[2] || (l[2] = //@ts-ignore
|
|
419
|
-
(...s) =>
|
|
427
|
+
(...s) => g(ne) && g(ne)(...s))
|
|
420
428
|
}, null, 40, dt), [
|
|
421
|
-
[Ae,
|
|
429
|
+
[Ae, y.value]
|
|
422
430
|
]),
|
|
423
|
-
|
|
431
|
+
B(H, {
|
|
424
432
|
name: "search",
|
|
425
433
|
class: "tw-text-ice-500"
|
|
426
434
|
})
|
|
427
|
-
])) :
|
|
435
|
+
])) : F("", !0),
|
|
428
436
|
f("ul", ft, [
|
|
429
|
-
(r(!0), d(
|
|
437
|
+
(r(!0), d(K, null, G(O.value, (s, _) => (r(), d("li", {
|
|
430
438
|
key: `option-${s[t.trackBy]}`,
|
|
431
439
|
"data-test": s[t.trackBy],
|
|
432
|
-
class:
|
|
433
|
-
onClick: (Ce) =>
|
|
434
|
-
onMouseenter:
|
|
440
|
+
class: M(Se(s, _)),
|
|
441
|
+
onClick: (Ce) => L(s),
|
|
442
|
+
onMouseenter: z((Ce) => U(_), ["self"])
|
|
435
443
|
}, [
|
|
436
|
-
|
|
437
|
-
|
|
444
|
+
$(e.$slots, "option", { option: s }, () => [
|
|
445
|
+
P(b(s[t.displayBy] || s), 1)
|
|
438
446
|
], !0),
|
|
439
|
-
|
|
440
|
-
|
|
447
|
+
S(s) && !t.hideCheck ? (r(), d("span", vt, [
|
|
448
|
+
B(H, {
|
|
441
449
|
class: "tw-text-blue-500",
|
|
442
450
|
name: "check"
|
|
443
451
|
})
|
|
444
|
-
])) :
|
|
452
|
+
])) : F("", !0)
|
|
445
453
|
], 42, pt))), 128)),
|
|
446
|
-
|
|
447
|
-
|
|
454
|
+
R(f("li", ht, [
|
|
455
|
+
B(H, {
|
|
448
456
|
"data-test": "stash-select|options-loading",
|
|
449
457
|
name: "working",
|
|
450
458
|
class: "tw-animate-spin tw-text-ice-500"
|
|
@@ -452,12 +460,12 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
452
460
|
], 512), [
|
|
453
461
|
[Q, t.loading || se.value]
|
|
454
462
|
]),
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
l[6] || (l[6] =
|
|
463
|
+
R(f("li", mt, [
|
|
464
|
+
$(e.$slots, "no-options", {}, () => [
|
|
465
|
+
l[6] || (l[6] = P(" No options "))
|
|
458
466
|
], !0)
|
|
459
467
|
], 512), [
|
|
460
|
-
[Q, !t.loading && !se.value && !
|
|
468
|
+
[Q, !t.loading && !se.value && !O.value.length]
|
|
461
469
|
])
|
|
462
470
|
])
|
|
463
471
|
], 4), [
|
|
@@ -469,21 +477,21 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
|
|
|
469
477
|
], 8, ["to", "disabled"]))
|
|
470
478
|
], 40, rt)
|
|
471
479
|
], 42, ot)), [
|
|
472
|
-
[
|
|
480
|
+
[g(Qe), Te]
|
|
473
481
|
])
|
|
474
482
|
]),
|
|
475
483
|
key: "1"
|
|
476
484
|
},
|
|
477
|
-
|
|
485
|
+
fe.hint ? {
|
|
478
486
|
name: "hint",
|
|
479
|
-
fn:
|
|
480
|
-
|
|
487
|
+
fn: E(() => [
|
|
488
|
+
$(e.$slots, "hint", {}, void 0, !0)
|
|
481
489
|
]),
|
|
482
490
|
key: "2"
|
|
483
491
|
} : void 0
|
|
484
492
|
]), 1040, ["class", "error-text", "hint-text"]));
|
|
485
493
|
}
|
|
486
|
-
}), zt = /* @__PURE__ */ tt(yt, [["__scopeId", "data-v-
|
|
494
|
+
}), zt = /* @__PURE__ */ tt(yt, [["__scopeId", "data-v-a91abebc"]]);
|
|
487
495
|
export {
|
|
488
496
|
zt as default
|
|
489
497
|
};
|