@leaflink/stash 50.11.0 → 50.12.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/Accordion.js +28 -29
- package/dist/Accordion.js.map +1 -1
- package/dist/Accordion.vue.d.ts +6 -1
- package/dist/AppNavigationItem.vue.d.ts +5 -0
- package/dist/AppSidebar.js +1 -1
- package/dist/AppSidebar.js.map +1 -1
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/DataView.js +102 -98
- package/dist/DataView.js.map +1 -1
- package/dist/{DataView.keys-C7eaZg2G.js → DataView.keys-aSOnA4AD.js} +2 -1
- package/dist/DataView.keys-aSOnA4AD.js.map +1 -0
- package/dist/DataView.vue.d.ts +11 -0
- package/dist/DataViewFilters.js +1 -1
- package/dist/DataViewSortButton.js +1 -1
- package/dist/DataViewToolbar.js +61 -60
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/Dropdown.js +10 -10
- package/dist/Dropdown.js.map +1 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js.map +1 -1
- package/dist/FilterDropdown.js +1 -1
- package/dist/Filters.js.map +1 -1
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.vue.d.ts +5 -0
- package/dist/IconLabel.vue.d.ts +5 -0
- package/dist/InlineEdit.js.map +1 -1
- package/dist/InputOptions.js.map +1 -1
- package/dist/ListView.js.map +1 -1
- package/dist/ListView.vue.d.ts +38 -13
- package/dist/Modals.js +7 -7
- package/dist/Modals.js.map +1 -1
- package/dist/Paginate.js +73 -55
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue.d.ts +12 -1
- package/dist/QuickAction.vue.d.ts +5 -0
- package/dist/SearchBar.js +1 -1
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +5 -5
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +15 -15
- package/dist/SelectStatus.js.map +1 -1
- package/dist/SelectStatus.vue.d.ts +5 -0
- package/dist/Step.js +15 -15
- package/dist/Step.js.map +1 -1
- package/dist/Table.js +5 -5
- package/dist/Table.js.map +1 -1
- package/dist/TableCell.js +2 -2
- package/dist/TableHeaderCell.js +2 -2
- package/dist/TableHeaderRow.js +1 -1
- package/dist/TableRow.js +1 -1
- package/dist/TextEditor.js +1 -0
- package/dist/TextEditor.js.map +1 -1
- package/dist/TextEditor.vue.d.ts +5 -0
- package/dist/Textarea.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/directives/autofocus.js +2 -2
- package/dist/directives/autofocus.js.map +1 -1
- package/dist/directives/sticky.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/locale.js +3 -2
- package/dist/locale.js.map +1 -1
- package/dist/tailwind-base.js +0 -2
- package/dist/tailwind-base.js.map +1 -1
- package/dist/useModals.js.map +1 -1
- package/dist/usePaginationStats-d_q39naC.js +12 -0
- package/dist/usePaginationStats-d_q39naC.js.map +1 -0
- package/dist/useSelection.js +4 -1
- package/dist/useSelection.js.map +1 -1
- package/dist/useValidation.js +39 -36
- package/dist/useValidation.js.map +1 -1
- package/dist/utils/helpers.js +29 -29
- package/dist/utils/helpers.js.map +1 -1
- package/package.json +27 -5
- package/tailwind-base.ts +0 -2
- package/types/jsonApi.ts +8 -8
- package/dist/DataView.keys-C7eaZg2G.js.map +0 -1
package/dist/ListView.vue.d.ts
CHANGED
|
@@ -1383,9 +1383,6 @@ trigger?: string | undefined;
|
|
|
1383
1383
|
resetFilters(): void;
|
|
1384
1384
|
getDefaultFilterValues(): unknown;
|
|
1385
1385
|
setFilterValues(newValues: any): void;
|
|
1386
|
-
/**
|
|
1387
|
-
* Start of page
|
|
1388
|
-
*/
|
|
1389
1386
|
updateValidationValues(): void;
|
|
1390
1387
|
onChange(filter: any, filterValues: any, filterIndex: any): void;
|
|
1391
1388
|
onSelectInput(newValue: any, filter: any, filterIndex: any): void;
|
|
@@ -2072,7 +2069,9 @@ default: boolean;
|
|
|
2072
2069
|
};
|
|
2073
2070
|
}>> & Readonly<{
|
|
2074
2071
|
onChange?: ((v: {
|
|
2075
|
-
value?: string | undefined;
|
|
2072
|
+
value?: string | undefined; /**
|
|
2073
|
+
* Text to render in EmptyState component if there are no results
|
|
2074
|
+
*/
|
|
2076
2075
|
option?: any;
|
|
2077
2076
|
isValueChange: boolean;
|
|
2078
2077
|
type: "input" | "select";
|
|
@@ -2091,7 +2090,9 @@ isValueChange: boolean;
|
|
|
2091
2090
|
type: "input" | "select";
|
|
2092
2091
|
}) => void;
|
|
2093
2092
|
change: (v: {
|
|
2094
|
-
value?: string | undefined;
|
|
2093
|
+
value?: string | undefined; /**
|
|
2094
|
+
* Text to render in EmptyState component if there are no results
|
|
2095
|
+
*/
|
|
2095
2096
|
option?: any;
|
|
2096
2097
|
isValueChange: boolean;
|
|
2097
2098
|
type: "input" | "select";
|
|
@@ -2187,7 +2188,9 @@ default: boolean;
|
|
|
2187
2188
|
};
|
|
2188
2189
|
}>> & Readonly<{
|
|
2189
2190
|
onChange?: ((v: {
|
|
2190
|
-
value?: string | undefined;
|
|
2191
|
+
value?: string | undefined; /**
|
|
2192
|
+
* Text to render in EmptyState component if there are no results
|
|
2193
|
+
*/
|
|
2191
2194
|
option?: any;
|
|
2192
2195
|
isValueChange: boolean;
|
|
2193
2196
|
type: "input" | "select";
|
|
@@ -2286,7 +2289,9 @@ default: boolean;
|
|
|
2286
2289
|
};
|
|
2287
2290
|
}>> & Readonly<{
|
|
2288
2291
|
onChange?: ((v: {
|
|
2289
|
-
value?: string | undefined;
|
|
2292
|
+
value?: string | undefined; /**
|
|
2293
|
+
* Text to render in EmptyState component if there are no results
|
|
2294
|
+
*/
|
|
2290
2295
|
option?: any;
|
|
2291
2296
|
isValueChange: boolean;
|
|
2292
2297
|
type: "input" | "select";
|
|
@@ -2305,7 +2310,9 @@ isValueChange: boolean;
|
|
|
2305
2310
|
type: "input" | "select";
|
|
2306
2311
|
}) => void;
|
|
2307
2312
|
change: (v: {
|
|
2308
|
-
value?: string | undefined;
|
|
2313
|
+
value?: string | undefined; /**
|
|
2314
|
+
* Text to render in EmptyState component if there are no results
|
|
2315
|
+
*/
|
|
2309
2316
|
option?: any;
|
|
2310
2317
|
isValueChange: boolean;
|
|
2311
2318
|
type: "input" | "select";
|
|
@@ -3402,39 +3409,57 @@ hint?(_: {}): any;
|
|
|
3402
3409
|
});
|
|
3403
3410
|
}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3404
3411
|
Paginate: DefineComponent<ExtractPropTypes< {
|
|
3412
|
+
variant: {
|
|
3413
|
+
type: PropType<"standard" | "stats">;
|
|
3414
|
+
default: string;
|
|
3415
|
+
};
|
|
3405
3416
|
currentPage: {
|
|
3406
3417
|
type: PropType<number>;
|
|
3407
3418
|
default: number;
|
|
3408
3419
|
};
|
|
3409
|
-
|
|
3420
|
+
pageSize: {
|
|
3410
3421
|
type: PropType<number>;
|
|
3411
3422
|
default: number;
|
|
3412
3423
|
};
|
|
3413
|
-
|
|
3424
|
+
listLength: {
|
|
3414
3425
|
type: PropType<number>;
|
|
3415
3426
|
default: number;
|
|
3416
3427
|
};
|
|
3428
|
+
isNextDisabled: {
|
|
3429
|
+
type: PropType<boolean>;
|
|
3430
|
+
default: boolean;
|
|
3431
|
+
};
|
|
3417
3432
|
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
3418
3433
|
"set-page": (pageNumber: number) => void;
|
|
3419
3434
|
}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
3435
|
+
variant: {
|
|
3436
|
+
type: PropType<"standard" | "stats">;
|
|
3437
|
+
default: string;
|
|
3438
|
+
};
|
|
3420
3439
|
currentPage: {
|
|
3421
3440
|
type: PropType<number>;
|
|
3422
3441
|
default: number;
|
|
3423
3442
|
};
|
|
3424
|
-
|
|
3443
|
+
pageSize: {
|
|
3425
3444
|
type: PropType<number>;
|
|
3426
3445
|
default: number;
|
|
3427
3446
|
};
|
|
3428
|
-
|
|
3447
|
+
listLength: {
|
|
3429
3448
|
type: PropType<number>;
|
|
3430
3449
|
default: number;
|
|
3431
3450
|
};
|
|
3451
|
+
isNextDisabled: {
|
|
3452
|
+
type: PropType<boolean>;
|
|
3453
|
+
default: boolean;
|
|
3454
|
+
};
|
|
3432
3455
|
}>> & Readonly<{
|
|
3433
3456
|
"onSet-page"?: ((pageNumber: number) => any) | undefined;
|
|
3434
3457
|
}>, {
|
|
3458
|
+
variant: "standard" | "stats";
|
|
3435
3459
|
currentPage: number;
|
|
3436
|
-
listLength: number;
|
|
3437
3460
|
pageSize: number;
|
|
3461
|
+
listLength: number;
|
|
3462
|
+
isNextDisabled: boolean;
|
|
3438
3463
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3439
3464
|
LoadingManager: DefineComponent<ExtractPropTypes< {
|
|
3440
3465
|
emptyStateText: {
|
package/dist/Modals.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as d, computed as u, openBlock as s, createBlock as r, Transition as m, withCtx as a, resolveDynamicComponent as p, mergeProps as _, toHandlers as f, createSlots as v, renderList as x, createElementVNode as M, createCommentVNode as L } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
2
|
+
import C from "./useModals.js";
|
|
3
|
+
import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const k = ["innerHTML"], H = /* @__PURE__ */ d({
|
|
5
5
|
__name: "Modals",
|
|
6
|
-
setup(
|
|
7
|
-
const t =
|
|
6
|
+
setup(T) {
|
|
7
|
+
const t = C(), e = u(() => t.current);
|
|
8
8
|
function c(n) {
|
|
9
9
|
var o;
|
|
10
10
|
return (o = n.options) != null && o.disableDefaultListeners ? {} : {
|
|
@@ -22,7 +22,7 @@ const h = ["innerHTML"], k = /* @__PURE__ */ d({
|
|
|
22
22
|
x(e.value.slots, (l, i) => ({
|
|
23
23
|
name: i,
|
|
24
24
|
fn: a(() => [
|
|
25
|
-
M("div", { innerHTML: l }, null, 8,
|
|
25
|
+
M("div", { innerHTML: l }, null, 8, k)
|
|
26
26
|
])
|
|
27
27
|
}))
|
|
28
28
|
]), 1040)) : L("", !0)
|
|
@@ -30,7 +30,7 @@ const h = ["innerHTML"], k = /* @__PURE__ */ d({
|
|
|
30
30
|
_: 1
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
|
-
}), B = /* @__PURE__ */
|
|
33
|
+
}), B = /* @__PURE__ */ h(H, [["__scopeId", "data-v-cf8ad226"]]);
|
|
34
34
|
export {
|
|
35
35
|
B as default
|
|
36
36
|
};
|
package/dist/Modals.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n
|
|
1
|
+
{"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, DeepReadonly } from 'vue';\n\n import useModals, { type Modal } from '../../composables/useModals/useModals';\n\n const modals = useModals();\n\n const currentModal = computed(() => modals.current);\n\n // Stupid TS version issues. Todo: remove ` | any` when TS/vite/vue deps are updated.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function getListeners(modal: DeepReadonly<Modal> | any) {\n if (modal.options?.disableDefaultListeners) {\n return {};\n }\n\n return {\n dismiss: () => modals.close({ index: 0 }),\n close: () => modals.close({ index: 0 }),\n cancel: () => modals.close({ index: 0 }),\n };\n }\n</script>\n\n<template>\n <Transition name=\"modals\" mode=\"out-in\">\n <component\n :is=\"currentModal.component\"\n v-if=\"currentModal\"\n v-bind=\"currentModal.attributes\"\n :is-open=\"true\"\n v-on=\"getListeners(currentModal)\"\n >\n <template v-for=\"(value, name) in currentModal.slots\" :key=\"name\" #[name]>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <div v-html=\"value\" />\n </template>\n </component>\n </Transition>\n</template>\n\n<style scoped>\n .modals-enter-active,\n .modals-leave-active {\n --swing-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1); /* \"swing\" from the $transition sass map */\n transition: opacity 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from,\n .modals-leave-to {\n opacity: 0;\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--position-center),\n .modals-leave-active :deep(.stash-modal__dialog--position-center) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-center),\n .modals-leave-to :deep(.stash-modal__dialog--position-center) {\n transform: translateY(20px);\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--is-drawer),\n .modals-leave-active :deep(.stash-modal__dialog--is-drawer) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-left),\n .modals-leave-to :deep(.stash-modal__dialog--position-left) {\n transform: translateX(-50px);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-right),\n .modals-leave-to :deep(.stash-modal__dialog--position-right) {\n transform: translateX(50px);\n }\n</style>\n"],"names":["modals","useModals","currentModal","computed","getListeners","modal","_a"],"mappings":";;;;;;AAKE,UAAMA,IAASC,EAAU,GAEnBC,IAAeC,EAAS,MAAMH,EAAO,OAAO;AAIlD,aAASI,EAAaC,GAAkC;;AAClD,cAAAC,IAAAD,EAAM,YAAN,QAAAC,EAAe,0BACV,CAAC,IAGH;AAAA,QACL,SAAS,MAAMN,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,QACxC,OAAO,MAAMA,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,QACtC,QAAQ,MAAMA,EAAO,MAAM,EAAE,OAAO,EAAG,CAAA;AAAA,MACzC;AAAA,IAAA;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Paginate.js
CHANGED
|
@@ -1,94 +1,112 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as L, useCssModule as M, computed as N, toRef as u, openBlock as i, createElementBlock as l, createElementVNode as d, normalizeClass as o, unref as n, createVNode as _, toDisplayString as m, Fragment as v, renderList as D, createCommentVNode as p } from "vue";
|
|
2
|
+
import { u as E } from "./usePaginationStats-d_q39naC.js";
|
|
3
|
+
import { t as g } from "./locale.js";
|
|
2
4
|
import h from "./Icon.js";
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
5
|
+
import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const B = {
|
|
5
7
|
class: "stash-paginate tw-flex tw-justify-center",
|
|
6
8
|
"data-test": "stash-paginate"
|
|
7
|
-
},
|
|
9
|
+
}, V = ["aria-label", "disabled"], F = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "tw-mx-3 tw-text-ice-900"
|
|
12
|
+
}, I = ["onClick"], j = ["aria-label", "disabled"], R = /* @__PURE__ */ L({
|
|
8
13
|
name: "ll-paginate",
|
|
9
14
|
__name: "Paginate",
|
|
10
15
|
props: {
|
|
11
16
|
currentPage: { default: 1 },
|
|
12
17
|
listLength: { default: 1 },
|
|
13
|
-
pageSize: { default: 50 }
|
|
18
|
+
pageSize: { default: 50 },
|
|
19
|
+
isNextDisabled: { type: Boolean, default: !1 },
|
|
20
|
+
variant: { default: "standard" }
|
|
14
21
|
},
|
|
15
22
|
emits: ["set-page"],
|
|
16
|
-
setup(
|
|
17
|
-
const t =
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
setup(P, { emit: b }) {
|
|
24
|
+
const t = P, x = b, r = M(), a = N(() => Math.ceil(t.listLength / t.pageSize)), w = t.variant === "stats" ? E({
|
|
25
|
+
currentPage: u(() => t.currentPage),
|
|
26
|
+
pageSize: u(() => t.pageSize),
|
|
27
|
+
totalItems: u(() => t.listLength)
|
|
28
|
+
}) : null;
|
|
29
|
+
function c(e) {
|
|
30
|
+
x("set-page", e);
|
|
20
31
|
}
|
|
21
|
-
function
|
|
22
|
-
t.currentPage <
|
|
32
|
+
function k() {
|
|
33
|
+
t.currentPage < a.value && c(t.currentPage + 1);
|
|
23
34
|
}
|
|
24
|
-
function
|
|
25
|
-
t.currentPage > 1 &&
|
|
35
|
+
function S() {
|
|
36
|
+
t.currentPage > 1 && c(t.currentPage - 1);
|
|
26
37
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
return
|
|
38
|
+
function y(e) {
|
|
39
|
+
const f = Math.abs(t.currentPage - e);
|
|
40
|
+
return a.value < 10 || e === 1 || e === a.value || t.currentPage < 6 && e < 8 || a.value - t.currentPage < 5 && a.value - e < 7 || f < 3;
|
|
30
41
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
42
|
+
function C(e) {
|
|
43
|
+
return a.value > 9 && t.currentPage > 5 && e === 2;
|
|
33
44
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
45
|
+
function z(e) {
|
|
46
|
+
return a.value > 9 && a.value - t.currentPage > 4 && e === a.value - 1;
|
|
36
47
|
}
|
|
37
|
-
return (e,
|
|
38
|
-
|
|
39
|
-
class: o(["stash-paginate__list tw-flex", r
|
|
48
|
+
return (e, f) => (i(), l("div", B, [
|
|
49
|
+
d("ul", {
|
|
50
|
+
class: o(["stash-paginate__list tw-flex tw-items-center", n(r).pagination]),
|
|
40
51
|
"data-test": "stash-paginate|list"
|
|
41
52
|
}, [
|
|
42
|
-
|
|
53
|
+
d("button", {
|
|
54
|
+
"aria-label": n(g)("ll.previous"),
|
|
43
55
|
"data-test": "stash-paginate|prev-page",
|
|
44
|
-
class: o(
|
|
45
|
-
|
|
56
|
+
class: o(n(r).prev),
|
|
57
|
+
disabled: t.currentPage === 1,
|
|
58
|
+
onClick: S
|
|
46
59
|
}, [
|
|
47
|
-
|
|
60
|
+
_(h, {
|
|
48
61
|
size: "small",
|
|
49
62
|
name: "chevron-left"
|
|
50
63
|
})
|
|
51
|
-
],
|
|
52
|
-
(i(!0), l(
|
|
53
|
-
|
|
54
|
-
key: `${
|
|
55
|
-
|
|
64
|
+
], 10, V),
|
|
65
|
+
t.variant === "stats" ? (i(), l("span", F, m(n(g)("ll.pageStats", n(w))), 1)) : (i(!0), l(v, { key: 1 }, D(a.value, (s) => (i(), l(v, null, [
|
|
66
|
+
C(s) ? (i(), l("button", {
|
|
67
|
+
key: `${s}-ellipsis`,
|
|
68
|
+
class: "tw-pointer-events-none",
|
|
69
|
+
"data-test": "stash-paginate|first-ellipsis",
|
|
70
|
+
tabindex: "-1"
|
|
56
71
|
}, " … ")) : p("", !0),
|
|
57
|
-
|
|
58
|
-
key:
|
|
72
|
+
y(s) ? (i(), l("button", {
|
|
73
|
+
key: s,
|
|
59
74
|
"data-test": "stash-paginate|page-number",
|
|
60
|
-
class: o({ [r
|
|
61
|
-
onClick: (
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
key: `${
|
|
65
|
-
|
|
75
|
+
class: o({ [n(r)["is-active"]]: t.currentPage === s }),
|
|
76
|
+
onClick: (K) => c(s)
|
|
77
|
+
}, m(s), 11, I)) : p("", !0),
|
|
78
|
+
z(s) ? (i(), l("button", {
|
|
79
|
+
key: `${s}-ellipsis`,
|
|
80
|
+
class: "tw-pointer-events-none",
|
|
81
|
+
"data-test": "stash-paginate|last-ellipsis",
|
|
82
|
+
tabindex: "-1"
|
|
66
83
|
}, " … ")) : p("", !0)
|
|
67
84
|
], 64))), 256)),
|
|
68
|
-
|
|
85
|
+
d("button", {
|
|
86
|
+
"aria-label": n(g)("ll.next"),
|
|
69
87
|
"data-test": "stash-paginate|next-page",
|
|
70
|
-
class: o(
|
|
71
|
-
|
|
88
|
+
class: o(n(r).next),
|
|
89
|
+
disabled: t.isNextDisabled || t.currentPage === a.value,
|
|
90
|
+
onClick: k
|
|
72
91
|
}, [
|
|
73
|
-
|
|
92
|
+
_(h, {
|
|
74
93
|
size: "small",
|
|
75
94
|
class: "tw-rotate-180",
|
|
76
95
|
name: "chevron-left"
|
|
77
96
|
})
|
|
78
|
-
],
|
|
97
|
+
], 10, j)
|
|
79
98
|
], 2)
|
|
80
99
|
]));
|
|
81
100
|
}
|
|
82
|
-
}),
|
|
83
|
-
pagination:
|
|
84
|
-
prev:
|
|
85
|
-
next:
|
|
86
|
-
"is-active": "_is-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, H = /* @__PURE__ */ E(N, [["__cssModules", j]]);
|
|
101
|
+
}), q = "_pagination_104d8_2", A = "_prev_104d8_20", G = "_next_104d8_25", H = {
|
|
102
|
+
pagination: q,
|
|
103
|
+
prev: A,
|
|
104
|
+
next: G,
|
|
105
|
+
"is-active": "_is-active_104d8_38"
|
|
106
|
+
}, J = {
|
|
107
|
+
$style: H
|
|
108
|
+
}, X = /* @__PURE__ */ $(R, [["__cssModules", J]]);
|
|
91
109
|
export {
|
|
92
|
-
|
|
110
|
+
X as default
|
|
93
111
|
};
|
|
94
112
|
//# sourceMappingURL=Paginate.js.map
|
package/dist/Paginate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paginate.js","sources":["../src/components/Paginate/Paginate.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, useCssModule } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-paginate',\n });\n\n export interface PaginateProps {\n /**\n * Current page number\n */\n currentPage?: number;\n /**\n * Total number of items in list\n */\n listLength?: number;\n /**\n * Number of items per page\n */\n pageSize?: number;\n }\n\n const props = withDefaults(defineProps<PaginateProps>(), {\n currentPage: 1,\n listLength: 1,\n pageSize: 50,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the page number changes.\n */\n (e: 'set-page', pageNumber: number): void;\n }>();\n\n const classes = useCssModule();\n\n const
|
|
1
|
+
{"version":3,"file":"Paginate.js","sources":["../src/components/Paginate/Paginate.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, toRef, useCssModule } from 'vue';\n\n import usePaginationStats from '../../composables/usePaginationStats/usePaginationStats';\n import { t } from '../../locale';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-paginate',\n });\n\n export interface PaginateProps {\n /**\n * Current page number\n */\n currentPage?: number;\n /**\n * Total number of items in list\n */\n listLength?: number;\n /**\n * Number of items per page\n */\n pageSize?: number;\n /*\n * Optional override for the next button disabled state\n */\n isNextDisabled?: boolean;\n /**\n * Variant of the pagination component\n */\n variant?: 'standard' | 'stats';\n }\n\n const props = withDefaults(defineProps<PaginateProps>(), {\n currentPage: 1,\n listLength: 1,\n pageSize: 50,\n isNextDisabled: false,\n variant: 'standard',\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the page number changes.\n */\n (e: 'set-page', pageNumber: number): void;\n }>();\n\n const classes = useCssModule();\n\n const pageCount = computed(() => Math.ceil(props.listLength / props.pageSize));\n\n const pageStats =\n props.variant === 'stats'\n ? usePaginationStats({\n currentPage: toRef(() => props.currentPage),\n pageSize: toRef(() => props.pageSize),\n totalItems: toRef(() => props.listLength),\n })\n : null;\n\n /**\n * Emits current page to list view.\n */\n function updatePage(currentPage: number) {\n emit('set-page', currentPage);\n }\n\n /**\n * Sets current page to next page\n */\n function next() {\n if (props.currentPage < pageCount.value) {\n updatePage(props.currentPage + 1);\n }\n }\n\n /**\n * Sets current page to previous page\n */\n function prev() {\n if (props.currentPage > 1) {\n updatePage(props.currentPage - 1);\n }\n }\n\n /**\n * Determines whether to show page\n * @returns {boolean} - should show page in pagination component\n */\n function shouldShowPage(page: number): boolean {\n const pageDiff = Math.abs(props.currentPage - page);\n\n if (\n pageCount.value < 10 ||\n page === 1 ||\n page === pageCount.value ||\n (props.currentPage < 6 && page < 8) ||\n (pageCount.value - props.currentPage < 5 && pageCount.value - page < 7) ||\n pageDiff < 3\n ) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Determines whether to show the leading ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowFirstEllipsis(page: number): boolean {\n return pageCount.value > 9 && props.currentPage > 5 && page === 2;\n }\n\n /**\n * Determines whether to show the trailing ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowLastEllipsis(page: number): boolean {\n return pageCount.value > 9 && pageCount.value - props.currentPage > 4 && page === pageCount.value - 1;\n }\n</script>\n\n<template>\n <div class=\"stash-paginate tw-flex tw-justify-center\" data-test=\"stash-paginate\">\n <ul\n class=\"stash-paginate__list tw-flex tw-items-center\"\n :class=\"classes.pagination\"\n data-test=\"stash-paginate|list\"\n >\n <button\n :aria-label=\"t('ll.previous')\"\n data-test=\"stash-paginate|prev-page\"\n :class=\"classes.prev\"\n :disabled=\"props.currentPage === 1\"\n @click=\"prev\"\n >\n <Icon size=\"small\" name=\"chevron-left\" />\n </button>\n <span v-if=\"props.variant === 'stats'\" class=\"tw-mx-3 tw-text-ice-900\">\n {{ t('ll.pageStats', pageStats) }}\n </span>\n <template v-for=\"page in pageCount\" v-else>\n <button\n v-if=\"shouldShowFirstEllipsis(page)\"\n :key=\"`${page}-ellipsis`\"\n class=\"tw-pointer-events-none\"\n data-test=\"stash-paginate|first-ellipsis\"\n tabindex=\"-1\"\n >\n …\n </button>\n <button\n v-if=\"shouldShowPage(page)\"\n :key=\"page\"\n data-test=\"stash-paginate|page-number\"\n :class=\"{ [classes['is-active']]: props.currentPage === page }\"\n @click=\"updatePage(page)\"\n >\n {{ page }}\n </button>\n <button\n v-if=\"shouldShowLastEllipsis(page)\"\n :key=\"`${page}-ellipsis`\"\n class=\"tw-pointer-events-none\"\n data-test=\"stash-paginate|last-ellipsis\"\n tabindex=\"-1\"\n >\n …\n </button>\n </template>\n <button\n :aria-label=\"t('ll.next')\"\n data-test=\"stash-paginate|next-page\"\n :class=\"classes.next\"\n :disabled=\"props.isNextDisabled || props.currentPage === pageCount\"\n @click=\"next\"\n >\n <Icon size=\"small\" class=\"tw-rotate-180\" name=\"chevron-left\" />\n </button>\n </ul>\n </div>\n</template>\n\n<style module>\n .pagination {\n /* Todo: We shouldn't really be making assumptions about the outer spacing of the pagination component */\n margin-top: theme('spacing.12');\n z-index: 0;\n\n a,\n button {\n @apply tw-border tw-border-solid tw-border-ice-200;\n align-items: center;\n background-color: theme('colors.white');\n color: var(--color-blue-500);\n cursor: pointer;\n display: flex;\n height: theme('height.input');\n justify-content: center;\n margin: 0 0 0 -1px;\n width: theme('height.input');\n\n &.prev {\n border-bottom-left-radius: theme('borderRadius.DEFAULT');\n border-top-left-radius: theme('borderRadius.DEFAULT');\n }\n\n &.next {\n border-bottom-right-radius: theme('borderRadius.DEFAULT');\n border-top-right-radius: theme('borderRadius.DEFAULT');\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n text-decoration: none;\n }\n\n &.is-active {\n background-color: var(--color-blue-500);\n color: theme('colors.white');\n pointer-events: none;\n z-index: theme('zIndex.control');\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n &:not(:disabled):hover,\n &:not(:disabled):focus,\n &.is-active {\n @apply tw-border tw-border-solid tw-border-blue-500;\n position: relative;\n }\n\n &.is-active:focus {\n @apply tw-bg-blue-700 tw-border-blue-700;\n }\n }\n }\n</style>\n"],"names":["props","__props","emit","__emit","classes","useCssModule","pageCount","computed","pageStats","usePaginationStats","toRef","updatePage","currentPage","next","prev","shouldShowPage","page","pageDiff","shouldShowFirstEllipsis","shouldShowLastEllipsis"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkCE,UAAMA,IAAQC,GAQRC,IAAOC,GAOPC,IAAUC,EAAa,GAEvBC,IAAYC,EAAS,MAAM,KAAK,KAAKP,EAAM,aAAaA,EAAM,QAAQ,CAAC,GAEvEQ,IACJR,EAAM,YAAY,UACdS,EAAmB;AAAA,MACjB,aAAaC,EAAM,MAAMV,EAAM,WAAW;AAAA,MAC1C,UAAUU,EAAM,MAAMV,EAAM,QAAQ;AAAA,MACpC,YAAYU,EAAM,MAAMV,EAAM,UAAU;AAAA,IACzC,CAAA,IACD;AAKN,aAASW,EAAWC,GAAqB;AACvC,MAAAV,EAAK,YAAYU,CAAW;AAAA,IAAA;AAM9B,aAASC,IAAO;AACV,MAAAb,EAAM,cAAcM,EAAU,SACrBK,EAAAX,EAAM,cAAc,CAAC;AAAA,IAClC;AAMF,aAASc,IAAO;AACV,MAAAd,EAAM,cAAc,KACXW,EAAAX,EAAM,cAAc,CAAC;AAAA,IAClC;AAOF,aAASe,EAAeC,GAAuB;AAC7C,YAAMC,IAAW,KAAK,IAAIjB,EAAM,cAAcgB,CAAI;AAGhD,aAAAV,EAAU,QAAQ,MAClBU,MAAS,KACTA,MAASV,EAAU,SAClBN,EAAM,cAAc,KAAKgB,IAAO,KAChCV,EAAU,QAAQN,EAAM,cAAc,KAAKM,EAAU,QAAQU,IAAO,KACrEC,IAAW;AAAA,IAKN;AAOT,aAASC,EAAwBF,GAAuB;AACtD,aAAOV,EAAU,QAAQ,KAAKN,EAAM,cAAc,KAAKgB,MAAS;AAAA,IAAA;AAOlE,aAASG,EAAuBH,GAAuB;AAC9C,aAAAV,EAAU,QAAQ,KAAKA,EAAU,QAAQN,EAAM,cAAc,KAAKgB,MAASV,EAAU,QAAQ;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Paginate.vue.d.ts
CHANGED
|
@@ -30,18 +30,24 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
|
|
|
30
30
|
currentPage: number;
|
|
31
31
|
listLength: number;
|
|
32
32
|
pageSize: number;
|
|
33
|
+
isNextDisabled: boolean;
|
|
34
|
+
variant: string;
|
|
33
35
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
34
36
|
"set-page": (pageNumber: number) => void;
|
|
35
37
|
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PaginateProps>, {
|
|
36
38
|
currentPage: number;
|
|
37
39
|
listLength: number;
|
|
38
40
|
pageSize: number;
|
|
41
|
+
isNextDisabled: boolean;
|
|
42
|
+
variant: string;
|
|
39
43
|
}>>> & Readonly<{
|
|
40
44
|
"onSet-page"?: ((pageNumber: number) => any) | undefined;
|
|
41
45
|
}>, {
|
|
46
|
+
variant: "standard" | "stats";
|
|
42
47
|
currentPage: number;
|
|
43
|
-
listLength: number;
|
|
44
48
|
pageSize: number;
|
|
49
|
+
listLength: number;
|
|
50
|
+
isNextDisabled: boolean;
|
|
45
51
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
46
52
|
export default _default;
|
|
47
53
|
|
|
@@ -58,6 +64,11 @@ export declare interface PaginateProps {
|
|
|
58
64
|
* Number of items per page
|
|
59
65
|
*/
|
|
60
66
|
pageSize?: number;
|
|
67
|
+
isNextDisabled?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Variant of the pagination component
|
|
70
|
+
*/
|
|
71
|
+
variant?: 'standard' | 'stats';
|
|
61
72
|
}
|
|
62
73
|
|
|
63
74
|
export { }
|
|
@@ -22,6 +22,11 @@ export default _default;
|
|
|
22
22
|
|
|
23
23
|
declare type IconName = (typeof iconNames)[number];
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* To add a new icon, follow these steps:
|
|
27
|
+
*
|
|
28
|
+
* https://github.com/LeafLink/stash/blob/main/CONTRIBUTING.md#adding-a-new-icon
|
|
29
|
+
*/
|
|
25
30
|
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", "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-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", "figma", "file-csv", "file", "filter-funnel", "filter-line", "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", "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", "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", "view-card", "view-detailed", "view-list", "warehouse", "working"];
|
|
26
31
|
|
|
27
32
|
export declare interface QuickActionProps {
|
package/dist/SearchBar.js
CHANGED
|
@@ -91,7 +91,7 @@ const N = /* @__PURE__ */ C({
|
|
|
91
91
|
} : void 0
|
|
92
92
|
]), 1032, ["modelValue", "class", "label", "placeholder", "hint-text"]));
|
|
93
93
|
}
|
|
94
|
-
}), q = /* @__PURE__ */ w(N, [["__scopeId", "data-v-
|
|
94
|
+
}), q = /* @__PURE__ */ w(N, [["__scopeId", "data-v-005a7e1b"]]);
|
|
95
95
|
export {
|
|
96
96
|
q as default
|
|
97
97
|
};
|
package/dist/SearchBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sources":["../src/components/SearchBar/SearchBar.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, ref, useSlots } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n import Input from '../Input/Input.vue';\n\n export interface SearchBarProps {\n /**\n * Indicates loading activity (for example async request) that should prevent search\n */\n isLoading?: boolean;\n\n /**\n * Sets a visual indicator that the search is active\n */\n isWorking?: boolean;\n\n /**\n * The search term\n */\n modelValue?: string;\n\n /**\n * Placeholder text for the input\n */\n placeholder?: string;\n\n /**\n * Label for search bar\n */\n label?: string;\n\n /**\n * Text below the input\n */\n hintText?: string;\n }\n\n defineOptions({\n name: 'll-search-bar',\n });\n\n const props = withDefaults(defineProps<SearchBarProps>(), {\n isLoading: false,\n isWorking: false,\n modelValue: '',\n placeholder: t('ll.search'),\n label: t('ll.search'),\n hintText: undefined,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when searching or clearing the search input\n */\n (e: 'search', searchTerm: string): void;\n\n /**\n * Emitted when the search term changes\n */\n (e: 'update:model-value', searchTerm: string): void;\n }>();\n\n const slots = useSlots();\n const searchTerm = ref(props.modelValue);\n const stashInputRef = ref<InstanceType<typeof Input>>();\n\n const searchTabIndex = computed(() => (searchTerm.value ? 0 : -1));\n\n function onSearch() {\n if (props.isLoading || props.isWorking) {\n return;\n }\n emit('search', searchTerm.value);\n }\n\n function clearSearchTerm() {\n searchTerm.value = '';\n emit('search', '');\n emit('update:model-value', '');\n\n stashInputRef.value?.inputEl?.focus();\n }\n\n function handleChange() {\n emit('update:model-value', searchTerm.value);\n }\n</script>\n\n<template>\n <Input\n ref=\"stashInputRef\"\n v-model=\"searchTerm\"\n class=\"stash-search-bar\"\n :class=\"[{ 'stash-search-bar--value': !!searchTerm }]\"\n :label=\"props.label\"\n :placeholder=\"props.placeholder\"\n :hint-text=\"props.hintText\"\n data-test=\"stash-search-bar\"\n @update:model-value=\"handleChange\"\n @keyup.enter=\"onSearch\"\n >\n <template #append>\n <Button\n v-if=\"searchTerm\"\n class=\"stash-search-bar__clear-button\"\n :disabled=\"props.isLoading\"\n data-test=\"stash-search-bar|clear-button\"\n @click=\"clearSearchTerm\"\n @keyup.enter=\"clearSearchTerm\"\n @keyup.space=\"clearSearchTerm\"\n >\n <Icon name=\"close\" />\n </Button>\n <Button\n :tabindex=\"searchTabIndex\"\n data-test=\"stash-search-bar|search-button\"\n :disabled=\"props.isLoading\"\n class=\"stash-search-bar__search-button\"\n @click=\"onSearch\"\n @keyup.enter=\"onSearch\"\n @keyup.space=\"onSearch\"\n >\n <Icon :class=\"{ 'tw-animate-spin': props.isWorking }\" :name=\"props.isWorking ? 'loading-empty' : 'search'\" />\n </Button>\n </template>\n <template v-if=\"slots.hint\" #hint>\n <!-- @slot Overrides the Input hint-text prop -->\n <slot name=\"hint\"></slot>\n </template>\n </Input>\n</template>\n\n<style scoped>\n .stash-search-bar :deep(input) {\n text-overflow: ellipsis;\n }\n\n .stash-search-bar--value :deep(input) {\n padding-right: 72px;\n }\n\n .stash-search-bar :deep(input):hover {\n border: 1px solid var(--color-blue-500);\n }\n\n .stash-search-bar :deep(.stash-input-append) {\n display: flex;\n justify-content: flex-end;\n width: 72px; /* double the the default width of 36px */\n overflow: visible;\n }\n\n .stash-search-bar__clear-button {\n color: var(--color-ice-700);\n height: theme('spacing.9');\n min-width: theme('spacing.9');\n width: theme('spacing.9');\n background: none;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:focus-visible {\n outline: none;\n box-shadow: none;\n\n & svg {\n border-radius: theme(borderRadius.DEFAULT);\n\n @apply tw-ring-4 tw-ring-blue-500 tw-ring-opacity-15;\n }\n }\n }\n\n .stash-search-bar__clear-button:disabled {\n color: var(--color-ice-500);\n cursor: default;\n }\n\n .stash-search-bar__search-button {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n height: theme('spacing.9');\n min-width: theme('spacing.9');\n width: theme('spacing.9');\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:focus {\n box-shadow: none;\n }\n\n &:disabled {\n border-color: var(--color-ice-500);\n }\n\n &:hover {\n background-color: var(--color-blue-600);\n }\n\n &:active {\n background-color: var(--color-blue-700);\n }\n\n &:focus-visible {\n outline: none;\n border: 1px solid var(--color-blue-900);\n /* Simulating a bigger border so the design does not break */\n box-shadow
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sources":["../src/components/SearchBar/SearchBar.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, ref, useSlots } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n import Input from '../Input/Input.vue';\n\n export interface SearchBarProps {\n /**\n * Indicates loading activity (for example async request) that should prevent search\n */\n isLoading?: boolean;\n\n /**\n * Sets a visual indicator that the search is active\n */\n isWorking?: boolean;\n\n /**\n * The search term\n */\n modelValue?: string;\n\n /**\n * Placeholder text for the input\n */\n placeholder?: string;\n\n /**\n * Label for search bar\n */\n label?: string;\n\n /**\n * Text below the input\n */\n hintText?: string;\n }\n\n defineOptions({\n name: 'll-search-bar',\n });\n\n const props = withDefaults(defineProps<SearchBarProps>(), {\n isLoading: false,\n isWorking: false,\n modelValue: '',\n placeholder: t('ll.search'),\n label: t('ll.search'),\n hintText: undefined,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when searching or clearing the search input\n */\n (e: 'search', searchTerm: string): void;\n\n /**\n * Emitted when the search term changes\n */\n (e: 'update:model-value', searchTerm: string): void;\n }>();\n\n const slots = useSlots();\n const searchTerm = ref(props.modelValue);\n const stashInputRef = ref<InstanceType<typeof Input>>();\n\n const searchTabIndex = computed(() => (searchTerm.value ? 0 : -1));\n\n function onSearch() {\n if (props.isLoading || props.isWorking) {\n return;\n }\n emit('search', searchTerm.value);\n }\n\n function clearSearchTerm() {\n searchTerm.value = '';\n emit('search', '');\n emit('update:model-value', '');\n\n stashInputRef.value?.inputEl?.focus();\n }\n\n function handleChange() {\n emit('update:model-value', searchTerm.value);\n }\n</script>\n\n<template>\n <Input\n ref=\"stashInputRef\"\n v-model=\"searchTerm\"\n class=\"stash-search-bar\"\n :class=\"[{ 'stash-search-bar--value': !!searchTerm }]\"\n :label=\"props.label\"\n :placeholder=\"props.placeholder\"\n :hint-text=\"props.hintText\"\n data-test=\"stash-search-bar\"\n @update:model-value=\"handleChange\"\n @keyup.enter=\"onSearch\"\n >\n <template #append>\n <Button\n v-if=\"searchTerm\"\n class=\"stash-search-bar__clear-button\"\n :disabled=\"props.isLoading\"\n data-test=\"stash-search-bar|clear-button\"\n @click=\"clearSearchTerm\"\n @keyup.enter=\"clearSearchTerm\"\n @keyup.space=\"clearSearchTerm\"\n >\n <Icon name=\"close\" />\n </Button>\n <Button\n :tabindex=\"searchTabIndex\"\n data-test=\"stash-search-bar|search-button\"\n :disabled=\"props.isLoading\"\n class=\"stash-search-bar__search-button\"\n @click=\"onSearch\"\n @keyup.enter=\"onSearch\"\n @keyup.space=\"onSearch\"\n >\n <Icon :class=\"{ 'tw-animate-spin': props.isWorking }\" :name=\"props.isWorking ? 'loading-empty' : 'search'\" />\n </Button>\n </template>\n <template v-if=\"slots.hint\" #hint>\n <!-- @slot Overrides the Input hint-text prop -->\n <slot name=\"hint\"></slot>\n </template>\n </Input>\n</template>\n\n<style scoped>\n .stash-search-bar :deep(input) {\n text-overflow: ellipsis;\n }\n\n .stash-search-bar--value :deep(input) {\n padding-right: 72px;\n }\n\n .stash-search-bar :deep(input):hover {\n border: 1px solid var(--color-blue-500);\n }\n\n .stash-search-bar :deep(.stash-input-append) {\n display: flex;\n justify-content: flex-end;\n width: 72px; /* double the the default width of 36px */\n overflow: visible;\n }\n\n .stash-search-bar__clear-button {\n color: var(--color-ice-700);\n height: theme('spacing.9');\n min-width: theme('spacing.9');\n width: theme('spacing.9');\n background: none;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:focus-visible {\n outline: none;\n box-shadow: none;\n\n & svg {\n border-radius: theme(borderRadius.DEFAULT);\n\n @apply tw-ring-4 tw-ring-blue-500 tw-ring-opacity-15;\n }\n }\n }\n\n .stash-search-bar__clear-button:disabled {\n color: var(--color-ice-500);\n cursor: default;\n }\n\n .stash-search-bar__search-button {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n height: theme('spacing.9');\n min-width: theme('spacing.9');\n width: theme('spacing.9');\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:focus {\n box-shadow: none;\n }\n\n &:disabled {\n border-color: var(--color-ice-500);\n }\n\n &:hover {\n background-color: var(--color-blue-600);\n }\n\n &:active {\n background-color: var(--color-blue-700);\n }\n\n &:focus-visible {\n outline: none;\n border: 1px solid var(--color-blue-900);\n /* Simulating a bigger border so the design does not break */\n box-shadow:\n inset 0 0 0 1px var(--color-blue-900),\n 0 0 0 4px rgb(0 114 240 / 15%); /* Unfortunatelly, we have to use RGBA to make the shadow transparent, this is blue-500 */\n }\n }\n</style>\n"],"names":["props","__props","emit","__emit","slots","useSlots","searchTerm","ref","stashInputRef","searchTabIndex","computed","onSearch","clearSearchTerm","_b","_a","handleChange"],"mappings":";;;;;;;;;;;;;;;;;;;AA4CE,UAAMA,IAAQC,GASRC,IAAOC,GAYPC,IAAQC,EAAS,GACjBC,IAAaC,EAAIP,EAAM,UAAU,GACjCQ,IAAgBD,EAAgC,GAEhDE,IAAiBC,EAAS,MAAOJ,EAAW,QAAQ,IAAI,EAAG;AAEjE,aAASK,IAAW;AACd,MAAAX,EAAM,aAAaA,EAAM,aAGxBE,EAAA,UAAUI,EAAW,KAAK;AAAA,IAAA;AAGjC,aAASM,IAAkB;;AACzB,MAAAN,EAAW,QAAQ,IACnBJ,EAAK,UAAU,EAAE,GACjBA,EAAK,sBAAsB,EAAE,IAEfW,KAAAC,IAAAN,EAAA,UAAA,gBAAAM,EAAO,YAAP,QAAAD,EAAgB;AAAA,IAAM;AAGtC,aAASE,IAAe;AACjB,MAAAb,EAAA,sBAAsBI,EAAW,KAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Select.js
CHANGED
|
@@ -179,12 +179,12 @@ const tt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, lt = ["id
|
|
|
179
179
|
}, be = (e) => {
|
|
180
180
|
if (e.keyCode === E.ESCAPE)
|
|
181
181
|
b();
|
|
182
|
-
else if (e.keyCode === E.DOWN && v.value < C.value.length - 1)
|
|
183
|
-
|
|
182
|
+
else if (e.keyCode === E.DOWN && v.value < C.value.length - 1 && u.value)
|
|
183
|
+
v.value++;
|
|
184
184
|
else if (e.keyCode === E.UP && v.value > 0)
|
|
185
185
|
u.value && v.value--, x.value && X.value && v.value === 0 && (x.value.scrollTop -= 100);
|
|
186
|
-
else if (e.keyCode === E.ENTER && v.value !== -1)
|
|
187
|
-
|
|
186
|
+
else if (e.keyCode === E.ENTER && v.value !== -1 && u.value)
|
|
187
|
+
D(C.value[v.value]);
|
|
188
188
|
else
|
|
189
189
|
return;
|
|
190
190
|
e.preventDefault(), ge(e);
|
|
@@ -473,7 +473,7 @@ const tt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, lt = ["id
|
|
|
473
473
|
} : void 0
|
|
474
474
|
]), 1040, ["class", "error-text", "hint-text"]));
|
|
475
475
|
}
|
|
476
|
-
}), $t = /* @__PURE__ */ et(pt, [["__scopeId", "data-v-
|
|
476
|
+
}), $t = /* @__PURE__ */ et(pt, [["__scopeId", "data-v-514b8e8b"]]);
|
|
477
477
|
export {
|
|
478
478
|
$t as default
|
|
479
479
|
};
|