@leaflink/stash 50.4.0 → 50.5.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/Carousel.js +321 -324
- package/dist/Carousel.js.map +1 -1
- package/dist/Carousel.vue.d.ts +4 -0
- package/dist/DatePicker.vue.d.ts +1 -1
- package/dist/Filters.vue.d.ts +9 -9
- package/dist/Image.js +6 -166
- package/dist/Image.js.map +1 -1
- package/dist/Image.vue_vue_type_script_setup_true_lang-YUNunj71.js +169 -0
- package/dist/Image.vue_vue_type_script_setup_true_lang-YUNunj71.js.map +1 -0
- package/dist/InlineEdit.vue.d.ts +1 -1
- package/dist/ListView.vue.d.ts +9 -9
- package/dist/Module.vue.d.ts +1 -1
- package/dist/Thumbnail.js +91 -0
- package/dist/Thumbnail.js.map +1 -0
- package/dist/Thumbnail.vue.d.ts +63 -0
- package/dist/ThumbnailEmpty.js +33 -0
- package/dist/ThumbnailEmpty.js.map +1 -0
- package/dist/ThumbnailEmpty.vue.d.ts +9 -0
- package/dist/ThumbnailGroup.js +73 -0
- package/dist/ThumbnailGroup.js.map +1 -0
- package/dist/ThumbnailGroup.keys-D6WL5xQ5.js +16 -0
- package/dist/ThumbnailGroup.keys-D6WL5xQ5.js.map +1 -0
- package/dist/ThumbnailGroup.vue.d.ts +191 -0
- package/dist/Tooltip.js +6 -6
- package/dist/components.css +1 -1
- package/dist/{index-Ck3Dl09q.js → index-Bbc2pg2X.js} +3 -3
- package/dist/index-Bbc2pg2X.js.map +1 -0
- package/dist/locale.js +16 -12
- package/dist/locale.js.map +1 -1
- package/dist/useSortable.js +1 -1
- package/package.json +2 -1
- package/dist/index-Ck3Dl09q.js.map +0 -1
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { defineComponent as W, inject as C, computed as a, useAttrs as M, openBlock as B, createElementBlock as k, mergeProps as L, unref as $ } from "vue";
|
|
2
|
+
import { IMAGE_PROVIDER_URLS as N, SCREEN_SIZES as w } from "./constants.js";
|
|
3
|
+
import q from "lodash-es/merge";
|
|
4
|
+
const j = {
|
|
5
|
+
xs: 160,
|
|
6
|
+
sm: 338,
|
|
7
|
+
md: 676,
|
|
8
|
+
lg: 1352,
|
|
9
|
+
xl: 2704
|
|
10
|
+
};
|
|
11
|
+
var z = /* @__PURE__ */ ((t) => (t.None = "none", t.Rounded = "rounded", t.Circle = "circle", t))(z || {}), b = /* @__PURE__ */ ((t) => (t.Cloudinary = "cloudinary", t.Static = "static", t))(b || {});
|
|
12
|
+
function P(t) {
|
|
13
|
+
return (s) => t[s] || s;
|
|
14
|
+
}
|
|
15
|
+
function G({
|
|
16
|
+
formatter: t = (m, c) => `${m}=${c}`,
|
|
17
|
+
keyMap: s,
|
|
18
|
+
joinWith: i = "/",
|
|
19
|
+
valueMap: e = {}
|
|
20
|
+
} = {}) {
|
|
21
|
+
const m = typeof s == "function" ? s : P(s || {});
|
|
22
|
+
return Object.keys(e).forEach((c) => {
|
|
23
|
+
typeof e[c] != "function" && (e[c] = P(e[c]));
|
|
24
|
+
}), (c = {}) => Object.entries(c).map(([l, d]) => {
|
|
25
|
+
const p = e[l], g = m(l);
|
|
26
|
+
let v = d;
|
|
27
|
+
return typeof p == "function" && (v = p(c[l])), t(g, v);
|
|
28
|
+
}).join(i);
|
|
29
|
+
}
|
|
30
|
+
const Q = N.CLOUDINARY, T = (t) => t.startsWith("#") ? t.replace("#", "rgb_") : t, E = G({
|
|
31
|
+
keyMap: {
|
|
32
|
+
fit: "c",
|
|
33
|
+
width: "w",
|
|
34
|
+
height: "h",
|
|
35
|
+
format: "f",
|
|
36
|
+
quality: "q",
|
|
37
|
+
background: "b",
|
|
38
|
+
dpr: "dpr"
|
|
39
|
+
},
|
|
40
|
+
valueMap: {
|
|
41
|
+
fit: {
|
|
42
|
+
fill: "fill",
|
|
43
|
+
inside: "pad",
|
|
44
|
+
outside: "lpad",
|
|
45
|
+
cover: "fit",
|
|
46
|
+
contain: "scale"
|
|
47
|
+
},
|
|
48
|
+
format: {
|
|
49
|
+
jpeg: "jpg"
|
|
50
|
+
},
|
|
51
|
+
background(t) {
|
|
52
|
+
return T(t);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
joinWith: ",",
|
|
56
|
+
formatter: (t, s) => `${t}_${s}`
|
|
57
|
+
}), D = {
|
|
58
|
+
format: "auto",
|
|
59
|
+
quality: "auto:best"
|
|
60
|
+
};
|
|
61
|
+
function F(t, s = {}) {
|
|
62
|
+
const i = q(D, s), e = E(i);
|
|
63
|
+
return `${Q}/${e}/${t}`;
|
|
64
|
+
}
|
|
65
|
+
const V = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
66
|
+
__proto__: null,
|
|
67
|
+
getImageUrl: F,
|
|
68
|
+
operationsGenerator: E
|
|
69
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
70
|
+
function H(t = "") {
|
|
71
|
+
return t;
|
|
72
|
+
}
|
|
73
|
+
const Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
74
|
+
__proto__: null,
|
|
75
|
+
getImageUrl: H
|
|
76
|
+
}, Symbol.toStringTag, { value: "Module" })), Z = {
|
|
77
|
+
cloudinary: V,
|
|
78
|
+
static: Y
|
|
79
|
+
}, J = ["src"], et = /* @__PURE__ */ W({
|
|
80
|
+
inheritAttrs: !1,
|
|
81
|
+
__name: "Image",
|
|
82
|
+
props: {
|
|
83
|
+
src: { default: "" },
|
|
84
|
+
srcset: { default: void 0 },
|
|
85
|
+
sizes: { default: void 0 },
|
|
86
|
+
provider: { default: void 0 },
|
|
87
|
+
radius: { default: "none" },
|
|
88
|
+
staticPath: { default: void 0 }
|
|
89
|
+
},
|
|
90
|
+
setup(t) {
|
|
91
|
+
const s = {
|
|
92
|
+
md: w.md,
|
|
93
|
+
lg: w.lg
|
|
94
|
+
}, i = C("stashOptions"), e = t, m = a(() => {
|
|
95
|
+
const { src: r, ...n } = M();
|
|
96
|
+
return n.sizes = v.value, n.srcset = I.value, n;
|
|
97
|
+
}), c = a(() => {
|
|
98
|
+
try {
|
|
99
|
+
return new URL(e.src), !0;
|
|
100
|
+
} catch {
|
|
101
|
+
return !1;
|
|
102
|
+
}
|
|
103
|
+
}), S = a(() => {
|
|
104
|
+
var r;
|
|
105
|
+
return e.provider || ((r = i == null ? void 0 : i.images) == null ? void 0 : r.provider) || b.Static;
|
|
106
|
+
}), l = a(() => e.staticPath ?? (i == null ? void 0 : i.staticPath)), d = a(() => S.value === b.Static), p = a(() => Z[S.value]), g = a(() => d.value ? _() : _({ width: j.md })), v = a(() => e.sizes ? O() : e.sizes), I = a(() => e.sizes && !e.srcset && !d.value ? R() : e.srcset), U = a(() => e.sizes ? x(e.sizes) : []);
|
|
107
|
+
function _(r = {}) {
|
|
108
|
+
if (d.value && c.value)
|
|
109
|
+
return e.src;
|
|
110
|
+
const n = d.value && l.value ? `${l.value}/${e.src}` : e.src;
|
|
111
|
+
return p.value.getImageUrl(n, r);
|
|
112
|
+
}
|
|
113
|
+
function R() {
|
|
114
|
+
return Object.values(j).map((r) => `${_({ width: r })} ${r}w`).join(", ");
|
|
115
|
+
}
|
|
116
|
+
function O() {
|
|
117
|
+
var r;
|
|
118
|
+
return (r = e.sizes) != null && r.includes("(") ? e.sizes : U.value.map((n) => `${n.mediaQuery ? n.mediaQuery + " " : ""}${n.size}`).join(", ");
|
|
119
|
+
}
|
|
120
|
+
function x(r = "") {
|
|
121
|
+
const n = [], h = {
|
|
122
|
+
default: "100vw"
|
|
123
|
+
};
|
|
124
|
+
if (typeof r == "string") {
|
|
125
|
+
const f = r.split(/[\s]+/).filter((u) => u);
|
|
126
|
+
for (const u of f) {
|
|
127
|
+
const o = u.split(":");
|
|
128
|
+
if (o.length !== 2) {
|
|
129
|
+
h.default = o[0].trim();
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
h[o[0].trim()] = o[1].trim();
|
|
133
|
+
}
|
|
134
|
+
} else
|
|
135
|
+
throw new Error("`sizes` needs to be a string");
|
|
136
|
+
for (const f in h) {
|
|
137
|
+
const u = parseInt(s[f] || 0);
|
|
138
|
+
let o = String(h[f]);
|
|
139
|
+
const y = o.endsWith("vw");
|
|
140
|
+
if (!y && /^\d+$/.test(o) && (o = `${o}px`), !y && o.endsWith("%"))
|
|
141
|
+
throw new Error("Image: `sizes` does not support percentage values");
|
|
142
|
+
const A = {
|
|
143
|
+
mediaQuery: u ? `(min-width: ${u}px)` : "",
|
|
144
|
+
screenMinWidth: u,
|
|
145
|
+
size: o
|
|
146
|
+
};
|
|
147
|
+
n.push(A);
|
|
148
|
+
}
|
|
149
|
+
return n.sort((f, u) => f.screenMinWidth > u.screenMinWidth ? -1 : 1), n;
|
|
150
|
+
}
|
|
151
|
+
return (r, n) => (B(), k("img", L({
|
|
152
|
+
ref: "img",
|
|
153
|
+
key: g.value,
|
|
154
|
+
"data-test": "stash-image",
|
|
155
|
+
class: ["stash-image", {
|
|
156
|
+
"tw-rounded": e.radius === $(z).Rounded,
|
|
157
|
+
"tw-rounded-full": e.radius === $(z).Circle
|
|
158
|
+
}],
|
|
159
|
+
src: g.value
|
|
160
|
+
}, m.value), null, 16, J));
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
export {
|
|
164
|
+
z as I,
|
|
165
|
+
j as S,
|
|
166
|
+
et as _,
|
|
167
|
+
b as a
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=Image.vue_vue_type_script_setup_true_lang-YUNunj71.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.vue_vue_type_script_setup_true_lang-YUNunj71.js","sources":["../src/components/Image/Image.types.ts","../src/components/Image/providers/utils.ts","../src/components/Image/providers/cloudinary.ts","../src/components/Image/providers/static.ts","../src/components/Image/providers/index.ts","../src/components/Image/Image.vue"],"sourcesContent":["// Sizes used to generate resized and optimized versions of an image.\n// Generated in `srcset`, and informed by `sizes`.\nexport const Screens = {\n xs: 160,\n sm: 338,\n md: 676,\n lg: 1352,\n xl: 2704,\n} as const;\n\nexport interface ImageSizeCondition {\n mediaQuery: string;\n screenMinWidth: number;\n size: string;\n}\n\nexport enum ImageRadius {\n None = 'none',\n Rounded = 'rounded',\n Circle = 'circle',\n}\n\nexport type ImageRadii = `${ImageRadius}`;\n\nexport enum ImageProviders {\n Cloudinary = 'cloudinary',\n Static = 'static',\n}\n","export interface ImageModifiers {\n format?: string;\n height?: number;\n width?: number;\n [key: string]: any /* eslint-disable-line @typescript-eslint/no-explicit-any */;\n}\n\nexport type ParamFormatter = (key: string, value: string) => string;\n\nexport type ParamMapper = { [key: string]: string } | ((key: string) => string);\n\nexport interface ProviderUrlBuilder {\n keyMap?: ParamMapper;\n formatter?: ParamFormatter;\n joinWith?: string;\n valueMap?: {\n [key: string]: ParamMapper;\n };\n}\n\nfunction createMapper(map: ParamMapper) {\n return (key: string) => {\n return map[key] || key;\n };\n}\n\n/**\n * Builds the parameterized Cloudinary url\n */\nexport function buildProviderUrl({\n formatter = (key, value) => `${key}=${value}`,\n keyMap,\n joinWith = '/',\n valueMap = {},\n}: ProviderUrlBuilder = {}) {\n const keyMapper = typeof keyMap === 'function' ? keyMap : createMapper(keyMap || {});\n\n Object.keys(valueMap).forEach((valueKey) => {\n if (typeof valueMap[valueKey] !== 'function') {\n valueMap[valueKey] = createMapper(valueMap[valueKey]);\n }\n });\n\n return (modifiers: { [key: string]: string } = {}) => {\n const operations = Object.entries(modifiers).map(([key, value]) => {\n const mapper = valueMap[key];\n const newKey = keyMapper(key);\n let newVal = value;\n\n if (typeof mapper === 'function') {\n newVal = mapper(modifiers[key]);\n }\n\n return formatter(newKey, newVal);\n });\n\n return operations.join(joinWith);\n };\n}\n\n/**\n * Checks if a (sub)domain is included in a list of acceptable domains\n * @param str the (sub)domain to check\n * @param domains an array of valid domains\n */\nexport function isDomainValid(str = '', domains: string[] = []): boolean {\n const url = new URL(str);\n const host = url.host;\n\n return domains.some((domain) => {\n if (domain === host) {\n return true;\n }\n\n return domain.endsWith(`.${host}`);\n });\n}\n","import merge from 'lodash-es/merge';\n\nimport { IMAGE_PROVIDER_URLS } from '../../../constants';\nimport { buildProviderUrl, ImageModifiers } from './utils';\n\nconst BASE_URL = IMAGE_PROVIDER_URLS.CLOUDINARY;\n\nconst convertHextoRGBFormat = (value: string) => (value.startsWith('#') ? value.replace('#', 'rgb_') : value);\n\n/**\n * Parameters (option and value pairs) that can be used in the <transformations> segment of the Cloudinary transformation URL.\n * Options and their respective values are connected by an underscore (eg `w_250` for width of 250px.).\n * Multiple parameters are comma separated (eg. `w_250,h_250`).\n *\n * `keyMap` maps the option to its option prefix.\n * `valueMap` is used for grouping options using the same `keyMap` value under a 'category', allowing for easier usage and custom labelling in the component context.\n *\n * Transformation URL structure:\n * https://cloudinary.com/documentation/transformation_reference\n *\n * Transformation URL parameters (options and values):\n * https://cloudinary.com/documentation/image_transformations#transformation_url_syntax\n *\n */\nexport const operationsGenerator = buildProviderUrl({\n keyMap: {\n fit: 'c',\n width: 'w',\n height: 'h',\n format: 'f',\n quality: 'q',\n background: 'b',\n dpr: 'dpr',\n },\n valueMap: {\n fit: {\n fill: 'fill',\n inside: 'pad',\n outside: 'lpad',\n cover: 'fit',\n contain: 'scale',\n },\n format: {\n jpeg: 'jpg',\n },\n background(value: string) {\n return convertHextoRGBFormat(value);\n },\n },\n joinWith: ',',\n formatter: (key, value) => `${key}_${value}`,\n});\n\n// Note: Not configurable via Image props (for now).\nconst defaultModifiers = {\n format: 'auto',\n quality: 'auto:best',\n};\n\nexport function getImageUrl(src: string, modifiers: Partial<ImageModifiers> = {}): string {\n const mergeModifiers = merge(defaultModifiers, modifiers);\n const operations = operationsGenerator(mergeModifiers);\n\n return `${BASE_URL}/${operations}/${src}`;\n}\n","export function getImageUrl(src = ''): string {\n return src;\n}\n","import * as cloudinary from './cloudinary';\nimport * as staticProvider from './static';\n\nexport default {\n cloudinary,\n static: staticProvider,\n};\n","<script lang=\"ts\">\n export * from './Image.types';\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, useAttrs } from 'vue';\n\n import { StashImageProviders, StashProvideState } from '../../../types/misc';\n import { SCREEN_SIZES } from '../../constants';\n import { ImageProviders, ImageRadii, ImageRadius, ImageSizeCondition, Screens } from './Image.types';\n import providers from './providers';\n import { ImageModifiers } from './providers/utils';\n\n export interface ImageProps {\n /**\n * The path to the image you want to embed.\n */\n src: string;\n\n /**\n * Native srcset attribute.\n * One or more strings separated by commas, indicating possible image sources\n * Can only be used with provider=static, otherwise it's ignored and auto-generated with `sizes` usage\n */\n srcset?: string;\n\n /**\n * For specifying responsive sizes\n */\n sizes?: string;\n\n /**\n * Where the image is served from.\n * If not provided, the provider will inherit from the Stash config `stashOptions.images.provider` (default: `static`).\n * - `static` for relative or absolute paths\n * - `cloudinary` for images served via Cloudinary\n */\n provider?: StashImageProviders;\n\n /**\n * For applying border radius\n */\n radius?: ImageRadii;\n\n /**\n * A custom static path the image src will be appended onto when provider=static.\n * Can be used to override the library-level default.\n */\n staticPath?: string;\n\n /**\n * TODO - https://leaflink.atlassian.net/browse/GRO-204\n * A custom function used to resolve a URL string for the image\n */\n // loader?: () => string;\n }\n\n defineOptions({\n inheritAttrs: false,\n });\n\n const BREAKPOINTS = {\n md: SCREEN_SIZES.md,\n lg: SCREEN_SIZES.lg,\n };\n const stashOptions = inject<StashProvideState>('stashOptions');\n const props = withDefaults(defineProps<ImageProps>(), {\n src: '',\n srcset: undefined,\n sizes: undefined,\n staticPath: undefined,\n provider: undefined,\n radius: 'none',\n // loader: undefined, // TODO - https://leaflink.atlassian.net/browse/GRO-204\n });\n\n const attrs = computed(() => {\n const { src, ...attrs } = useAttrs();\n\n attrs.sizes = imgSizes.value;\n attrs.srcset = imgSrcset.value;\n\n return attrs;\n });\n\n const isAbsoluteUrl = computed(() => {\n // return true if not an absolute url\n try {\n new URL(props.src);\n return true;\n } catch (e) {\n return false;\n }\n });\n\n const computedProvider = computed(() => props.provider || stashOptions?.images?.provider || ImageProviders.Static);\n\n const computedStaticPath = computed(() => props.staticPath ?? stashOptions?.staticPath);\n\n const isStatic = computed(() => computedProvider.value === ImageProviders.Static);\n\n const imgProvider = computed(() => providers[computedProvider.value]);\n\n const imgSrc = computed(() => (isStatic.value ? getProviderImage() : getProviderImage({ width: Screens.md })));\n\n const imgSizes = computed(() => (props.sizes ? getSizes() : props.sizes));\n\n const imgSrcset = computed(() => (props.sizes && !props.srcset && !isStatic.value ? getSources() : props.srcset));\n\n const parsedSizes = computed(() => {\n return props.sizes ? parseSizes(props.sizes) : [];\n });\n\n function getProviderImage(modifiers: ImageModifiers = {}) {\n if (isStatic.value && isAbsoluteUrl.value) {\n return props.src;\n }\n\n const src = isStatic.value && computedStaticPath.value ? `${computedStaticPath.value}/${props.src}` : props.src;\n\n return imgProvider.value.getImageUrl(src, modifiers);\n }\n\n function getSources() {\n return Object.values(Screens)\n .map((width) => {\n const src = getProviderImage({ width });\n\n return `${src} ${width}w`;\n })\n .join(', ');\n }\n\n function getSizes() {\n // return if using native media conditions\n if (props.sizes?.includes('(')) {\n return props.sizes;\n }\n\n return parsedSizes.value.map((v) => `${v.mediaQuery ? v.mediaQuery + ' ' : ''}${v.size}`).join(', ');\n }\n\n function parseSizes(providedSizes = '') {\n const conditions: ImageSizeCondition[] = [];\n const sizes = {\n default: '100vw',\n };\n\n // parse sizes and convert to object\n if (typeof providedSizes === 'string') {\n const definitions = providedSizes.split(/[\\s]+/).filter((size) => size);\n\n for (const entry of definitions) {\n const size = entry.split(':');\n\n if (size.length !== 2) {\n sizes['default'] = size[0].trim();\n continue;\n }\n\n sizes[size[0].trim()] = size[1].trim();\n }\n } else {\n throw new Error('`sizes` needs to be a string');\n }\n\n for (const key in sizes) {\n const screenMinWidth = parseInt(BREAKPOINTS[key] || 0);\n let size = String(sizes[key]);\n const isFluidSize = size.endsWith('vw');\n\n // convert integer to pixels\n if (!isFluidSize && /^\\d+$/.test(size)) {\n size = `${size}px`;\n }\n\n if (!isFluidSize && size.endsWith('%')) {\n throw new Error('Image: `sizes` does not support percentage values');\n }\n\n const condition = {\n mediaQuery: screenMinWidth ? `(min-width: ${screenMinWidth}px)` : '',\n screenMinWidth,\n size,\n };\n\n conditions.push(condition);\n }\n\n conditions.sort((v1, v2) => (v1.screenMinWidth > v2.screenMinWidth ? -1 : 1));\n\n return conditions;\n }\n</script>\n\n<template>\n <img\n ref=\"img\"\n :key=\"imgSrc\"\n data-test=\"stash-image\"\n class=\"stash-image\"\n :class=\"{\n 'tw-rounded': props.radius === ImageRadius.Rounded,\n 'tw-rounded-full': props.radius === ImageRadius.Circle,\n }\"\n :src=\"imgSrc\"\n v-bind=\"attrs\"\n />\n</template>\n"],"names":["Screens","ImageRadius","ImageProviders","createMapper","map","key","buildProviderUrl","formatter","value","keyMap","joinWith","valueMap","keyMapper","valueKey","modifiers","mapper","newKey","newVal","BASE_URL","IMAGE_PROVIDER_URLS","convertHextoRGBFormat","operationsGenerator","defaultModifiers","getImageUrl","src","mergeModifiers","merge","operations","providers","cloudinary","staticProvider","BREAKPOINTS","SCREEN_SIZES","stashOptions","inject","props","__props","attrs","computed","useAttrs","imgSizes","imgSrcset","isAbsoluteUrl","computedProvider","_a","computedStaticPath","isStatic","imgProvider","imgSrc","getProviderImage","getSizes","getSources","parsedSizes","parseSizes","width","v","providedSizes","conditions","sizes","definitions","size","entry","screenMinWidth","isFluidSize","condition","v1","v2"],"mappings":"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"}
|
package/dist/InlineEdit.vue.d.ts
CHANGED
|
@@ -61,8 +61,8 @@ errorText: string;
|
|
|
61
61
|
hintText: string;
|
|
62
62
|
placeholder: string;
|
|
63
63
|
modelValue: string | number;
|
|
64
|
-
oldValue: string | number;
|
|
65
64
|
format: "" | "currency" | "percent";
|
|
65
|
+
oldValue: string | number;
|
|
66
66
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
67
67
|
prepend?(_: {}): any;
|
|
68
68
|
append?(_: {}): any;
|
package/dist/ListView.vue.d.ts
CHANGED
|
@@ -3048,11 +3048,11 @@ enableTeleport: {
|
|
|
3048
3048
|
type: PropType<boolean>;
|
|
3049
3049
|
default: boolean;
|
|
3050
3050
|
};
|
|
3051
|
-
|
|
3051
|
+
format: {
|
|
3052
3052
|
type: PropType<string>;
|
|
3053
3053
|
default: string;
|
|
3054
3054
|
};
|
|
3055
|
-
|
|
3055
|
+
timeZone: {
|
|
3056
3056
|
type: PropType<string>;
|
|
3057
3057
|
default: string;
|
|
3058
3058
|
};
|
|
@@ -3115,8 +3115,8 @@ hintText: string;
|
|
|
3115
3115
|
placeholder: string;
|
|
3116
3116
|
modelValue: string;
|
|
3117
3117
|
enableTeleport: boolean;
|
|
3118
|
-
timeZone: string;
|
|
3119
3118
|
format: string;
|
|
3119
|
+
timeZone: string;
|
|
3120
3120
|
availableDates: DateRangeSource[];
|
|
3121
3121
|
disabledDates: DateRangeSource[];
|
|
3122
3122
|
hideClearButton: boolean;
|
|
@@ -3183,11 +3183,11 @@ enableTeleport: {
|
|
|
3183
3183
|
type: PropType<boolean>;
|
|
3184
3184
|
default: boolean;
|
|
3185
3185
|
};
|
|
3186
|
-
|
|
3186
|
+
format: {
|
|
3187
3187
|
type: PropType<string>;
|
|
3188
3188
|
default: string;
|
|
3189
3189
|
};
|
|
3190
|
-
|
|
3190
|
+
timeZone: {
|
|
3191
3191
|
type: PropType<string>;
|
|
3192
3192
|
default: string;
|
|
3193
3193
|
};
|
|
@@ -3247,8 +3247,8 @@ hintText: string;
|
|
|
3247
3247
|
placeholder: string;
|
|
3248
3248
|
modelValue: string;
|
|
3249
3249
|
enableTeleport: boolean;
|
|
3250
|
-
timeZone: string;
|
|
3251
3250
|
format: string;
|
|
3251
|
+
timeZone: string;
|
|
3252
3252
|
availableDates: DateRangeSource[];
|
|
3253
3253
|
disabledDates: DateRangeSource[];
|
|
3254
3254
|
hideClearButton: boolean;
|
|
@@ -3312,11 +3312,11 @@ enableTeleport: {
|
|
|
3312
3312
|
type: PropType<boolean>;
|
|
3313
3313
|
default: boolean;
|
|
3314
3314
|
};
|
|
3315
|
-
|
|
3315
|
+
format: {
|
|
3316
3316
|
type: PropType<string>;
|
|
3317
3317
|
default: string;
|
|
3318
3318
|
};
|
|
3319
|
-
|
|
3319
|
+
timeZone: {
|
|
3320
3320
|
type: PropType<string>;
|
|
3321
3321
|
default: string;
|
|
3322
3322
|
};
|
|
@@ -3379,8 +3379,8 @@ hintText: string;
|
|
|
3379
3379
|
placeholder: string;
|
|
3380
3380
|
modelValue: string;
|
|
3381
3381
|
enableTeleport: boolean;
|
|
3382
|
-
timeZone: string;
|
|
3383
3382
|
format: string;
|
|
3383
|
+
timeZone: string;
|
|
3384
3384
|
availableDates: DateRangeSource[];
|
|
3385
3385
|
disabledDates: DateRangeSource[];
|
|
3386
3386
|
hideClearButton: boolean;
|
package/dist/Module.vue.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ variant: string;
|
|
|
58
58
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleProps>, {
|
|
59
59
|
variant: string;
|
|
60
60
|
}>>> & Readonly<{}>, {
|
|
61
|
-
variant: "table" | "
|
|
61
|
+
variant: "table" | "list" | "box" | "card";
|
|
62
62
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
63
63
|
default?(_: {}): any;
|
|
64
64
|
}>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineComponent as w, useCssModule as q, inject as C, computed as T, toValue as x, openBlock as b, createElementBlock as B, normalizeClass as s, unref as t, createVNode as h, createBlock as I, withModifiers as y, withCtx as M, createCommentVNode as N, renderSlot as $ } from "vue";
|
|
2
|
+
import { t as V } from "./locale.js";
|
|
3
|
+
import z from "./Button.js";
|
|
4
|
+
import E from "./Icon.js";
|
|
5
|
+
import { _ as U } from "./Image.vue_vue_type_script_setup_true_lang-YUNunj71.js";
|
|
6
|
+
import { T as d } from "./ThumbnailGroup.keys-D6WL5xQ5.js";
|
|
7
|
+
import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
const A = ["aria-current", "draggable"], D = /* @__PURE__ */ w({
|
|
9
|
+
__name: "Thumbnail",
|
|
10
|
+
props: {
|
|
11
|
+
thumbnail: {},
|
|
12
|
+
altText: { default: "" },
|
|
13
|
+
variant: { default: "opaque" }
|
|
14
|
+
},
|
|
15
|
+
emits: ["remove", "click"],
|
|
16
|
+
setup(_, { emit: f }) {
|
|
17
|
+
const u = _, r = f, a = q(), { thumbnails: v, activeThumbnail: n, draggable: p, isDragging: m, radius: i, removable: o } = C(
|
|
18
|
+
d.key,
|
|
19
|
+
d.defaults
|
|
20
|
+
), e = T(() => x(v).findIndex((l) => l === u.thumbnail));
|
|
21
|
+
function g() {
|
|
22
|
+
n.value = e.value, r("click", e.value);
|
|
23
|
+
}
|
|
24
|
+
function k() {
|
|
25
|
+
r("remove", e.value), n.value = -1;
|
|
26
|
+
}
|
|
27
|
+
return (l, c) => (b(), B("li", {
|
|
28
|
+
class: s(["stash-thumbnail tw-group tw-relative tw-cursor-pointer focus-visible:tw-outline-none", [
|
|
29
|
+
{
|
|
30
|
+
[t(a)["thumbnail-translucent"]]: u.variant === "translucent",
|
|
31
|
+
[t(a)["thumbnail-opaque"]]: u.variant === "opaque",
|
|
32
|
+
[t(a)["thumbnail-removable"]]: t(o),
|
|
33
|
+
[t(a)["thumbnail-circle"]]: t(i) === "circle",
|
|
34
|
+
[t(a)["thumbnail-rounded"]]: t(i) === "rounded"
|
|
35
|
+
}
|
|
36
|
+
]]),
|
|
37
|
+
"aria-current": t(n) === e.value,
|
|
38
|
+
draggable: t(p),
|
|
39
|
+
"data-test": "stash-thumbnail",
|
|
40
|
+
tabindex: "0",
|
|
41
|
+
onClick: c[0] || (c[0] = (L) => g())
|
|
42
|
+
}, [
|
|
43
|
+
h(U, {
|
|
44
|
+
class: s(["stash-thumbnail__img tw-border-ice-200 tw-outline-blue-500/15 tw-transition-colors", [
|
|
45
|
+
t(a)["thumbnail-img"],
|
|
46
|
+
{
|
|
47
|
+
[t(a)["thumbnail-mask"]]: t(o) && t(i) !== "circle",
|
|
48
|
+
[t(a)["thumbnail-active"]]: t(n) === e.value && !t(m),
|
|
49
|
+
"group-hover:tw-border-blue-500 group-focus-visible:tw-border-blue-500 group-focus-visible:tw-outline": !t(m)
|
|
50
|
+
}
|
|
51
|
+
]]),
|
|
52
|
+
"data-test": "stash-thumbnail|img",
|
|
53
|
+
radius: t(i),
|
|
54
|
+
src: l.thumbnail.imageUrl,
|
|
55
|
+
alt: l.altText
|
|
56
|
+
}, null, 8, ["class", "radius", "src", "alt"]),
|
|
57
|
+
t(o) ? (b(), I(z, {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: s(["stash-thumbnail__remove", [t(a)["thumbnail-remove"]]]),
|
|
60
|
+
"data-test": "stash-thumbnail|remove",
|
|
61
|
+
"aria-label": t(V)("ll.thumbnail.removeButton", { index: e.value + 1 }),
|
|
62
|
+
type: "button",
|
|
63
|
+
icon: "",
|
|
64
|
+
onClick: y(k, ["stop", "prevent"])
|
|
65
|
+
}, {
|
|
66
|
+
default: M(() => [
|
|
67
|
+
h(E, {
|
|
68
|
+
name: "close",
|
|
69
|
+
size: "small"
|
|
70
|
+
})
|
|
71
|
+
]),
|
|
72
|
+
_: 1
|
|
73
|
+
}, 8, ["class", "aria-label"])) : N("", !0),
|
|
74
|
+
$(l.$slots, "hint")
|
|
75
|
+
], 10, A));
|
|
76
|
+
}
|
|
77
|
+
}), H = {
|
|
78
|
+
"thumbnail-remove": "_thumbnail-remove_afa4q_2",
|
|
79
|
+
"thumbnail-img": "_thumbnail-img_afa4q_24",
|
|
80
|
+
"thumbnail-translucent": "_thumbnail-translucent_afa4q_32",
|
|
81
|
+
"thumbnail-active": "_thumbnail-active_afa4q_36",
|
|
82
|
+
"thumbnail-mask": "_thumbnail-mask_afa4q_46",
|
|
83
|
+
"thumbnail-full": "_thumbnail-full_afa4q_50",
|
|
84
|
+
"thumbnail-rounded": "_thumbnail-rounded_afa4q_54"
|
|
85
|
+
}, J = {
|
|
86
|
+
$style: H
|
|
87
|
+
}, Q = /* @__PURE__ */ j(D, [["__cssModules", J]]);
|
|
88
|
+
export {
|
|
89
|
+
Q as default
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=Thumbnail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Thumbnail.js","sources":["../src/components/Thumbnail/Thumbnail.vue"],"sourcesContent":["<script lang=\"ts\">\n export * from './Thumbnail.types';\n</script>\n\n<script setup lang=\"ts\" generic=\"ThumbnailItem extends ThumbnailDefinition\">\n import { computed, inject, toValue, useCssModule } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n import Image from '../Image/Image.vue';\n import { THUMBNAIL_INJECTION } from '../ThumbnailGroup/ThumbnailGroup.keys';\n import { ThumbnailDefinition, ThumbnailVariant } from './Thumbnail.types';\n\n interface ThumbnailProps {\n /**\n * Thumbnail data containing and id and the image url\n */\n thumbnail: ThumbnailItem;\n\n /**\n * Thumbnail alt text for the image\n * @default ''\n */\n altText?: string;\n\n /**\n * Whether the thumbnail has some transparency or is fully opaque\n * @default 'opaque'\n */\n variant?: ThumbnailVariant;\n }\n\n const props = withDefaults(defineProps<ThumbnailProps>(), {\n variant: 'opaque',\n altText: '',\n });\n\n const emit = defineEmits<{\n /**\n * Emits when a thumbnail is removed\n */\n remove: [index: number];\n\n /**\n * Emits when a thumbnail is clicked\n */\n click: [index: number];\n }>();\n\n const classes = useCssModule();\n\n const { thumbnails, activeThumbnail, draggable, isDragging, radius, removable } = inject(\n THUMBNAIL_INJECTION.key,\n THUMBNAIL_INJECTION.defaults,\n );\n\n const thumbnailIndex = computed(() => toValue(thumbnails).findIndex((t) => t === props.thumbnail));\n\n function handleThumbnailClick() {\n activeThumbnail.value = thumbnailIndex.value;\n emit('click', thumbnailIndex.value);\n }\n\n function handleRemove() {\n emit('remove', thumbnailIndex.value);\n activeThumbnail.value = -1;\n }\n</script>\n\n<template>\n <li\n class=\"stash-thumbnail tw-group tw-relative tw-cursor-pointer focus-visible:tw-outline-none\"\n :class=\"[\n {\n [classes['thumbnail-translucent']]: props.variant === 'translucent',\n [classes['thumbnail-opaque']]: props.variant === 'opaque',\n [classes['thumbnail-removable']]: removable,\n [classes['thumbnail-circle']]: radius === 'circle',\n [classes['thumbnail-rounded']]: radius === 'rounded',\n },\n ]\"\n :aria-current=\"activeThumbnail === thumbnailIndex\"\n :draggable=\"draggable\"\n data-test=\"stash-thumbnail\"\n tabindex=\"0\"\n @click=\"handleThumbnailClick()\"\n >\n <Image\n class=\"stash-thumbnail__img tw-border-ice-200 tw-outline-blue-500/15 tw-transition-colors\"\n :class=\"[\n classes['thumbnail-img'],\n {\n [classes['thumbnail-mask']]: removable && radius !== 'circle',\n [classes['thumbnail-active']]: activeThumbnail === thumbnailIndex && !isDragging,\n 'group-hover:tw-border-blue-500 group-focus-visible:tw-border-blue-500 group-focus-visible:tw-outline':\n !isDragging,\n },\n ]\"\n data-test=\"stash-thumbnail|img\"\n :radius=\"radius\"\n :src=\"thumbnail.imageUrl\"\n :alt=\"altText\"\n />\n\n <Button\n v-if=\"removable\"\n class=\"stash-thumbnail__remove\"\n :class=\"[classes['thumbnail-remove']]\"\n data-test=\"stash-thumbnail|remove\"\n :aria-label=\"t('ll.thumbnail.removeButton', { index: thumbnailIndex + 1 })\"\n type=\"button\"\n icon\n @click.stop.prevent=\"handleRemove\"\n >\n <Icon name=\"close\" size=\"small\" />\n </Button>\n\n <!-- @slot: Slot to add a hint below the image -->\n <slot name=\"hint\" />\n </li>\n</template>\n\n<style module>\n .thumbnail-remove {\n position: absolute;\n top: calc(theme('spacing[1.5]') * -1);\n right: calc(theme('spacing[1.5]') * -1);\n padding: 1px;\n height: auto;\n width: auto !important;\n min-width: auto;\n border-radius: theme('borderRadius.full');\n background: var(--color-blue-500);\n color: white;\n\n &:hover,\n &:focus {\n background: var(--color-blue-600);\n }\n\n &:focus {\n outline: none;\n }\n }\n\n .thumbnail-img {\n border-style: solid;\n object-fit: cover;\n height: theme('spacing.12');\n width: theme('spacing.12');\n border-width: 1px;\n outline-width: theme('borderSpacing.1');\n\n .thumbnail-translucent & {\n opacity: theme('opacity.40');\n\n &:hover,\n &.thumbnail-active {\n opacity: theme('opacity.100');\n }\n }\n }\n\n .thumbnail-active {\n border: 1px solid var(--color-ice-500);\n }\n\n .thumbnail-mask {\n mask-image: radial-gradient(circle at top right, transparent 20%, white 20.5%);\n }\n\n .thumbnail-full {\n border-radius: theme('borderRadius.full');\n }\n\n .thumbnail-rounded {\n border-radius: theme('borderRadius.DEFAULT');\n }\n</style>\n"],"names":["props","__props","emit","__emit","classes","useCssModule","thumbnails","activeThumbnail","draggable","isDragging","radius","removable","inject","THUMBNAIL_INJECTION","thumbnailIndex","computed","toValue","t","handleThumbnailClick","handleRemove"],"mappings":";;;;;;;;;;;;;;;;AAiCE,UAAMA,IAAQC,GAKRC,IAAOC,GAYPC,IAAUC,KAEV,EAAE,YAAAC,GAAY,iBAAAC,GAAiB,WAAAC,GAAW,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,MAAcC;AAAA,MAChFC,EAAoB;AAAA,MACpBA,EAAoB;AAAA,IAAA,GAGhBC,IAAiBC,EAAS,MAAMC,EAAQV,CAAU,EAAE,UAAU,CAACW,MAAMA,MAAMjB,EAAM,SAAS,CAAC;AAEjG,aAASkB,IAAuB;AAC9B,MAAAX,EAAgB,QAAQO,EAAe,OAClCZ,EAAA,SAASY,EAAe,KAAK;AAAA,IACpC;AAEA,aAASK,IAAe;AACjB,MAAAjB,EAAA,UAAUY,EAAe,KAAK,GACnCP,EAAgB,QAAQ;AAAA,IAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AllowedComponentProps } from 'vue';
|
|
2
|
+
import { ComponentCustomProps } from 'vue';
|
|
3
|
+
import { RendererElement } from 'vue';
|
|
4
|
+
import { RendererNode } from 'vue';
|
|
5
|
+
import { ShallowUnwrapRef } from 'vue';
|
|
6
|
+
import { VNode } from 'vue';
|
|
7
|
+
import { VNodeProps } from 'vue';
|
|
8
|
+
|
|
9
|
+
declare const _default: <ThumbnailItem extends ThumbnailDefinition>(__VLS_props: {
|
|
10
|
+
readonly onClick?: ((index: number) => any) | undefined;
|
|
11
|
+
readonly onRemove?: ((index: number) => any) | undefined;
|
|
12
|
+
variant?: ThumbnailVariant | undefined;
|
|
13
|
+
thumbnail: ThumbnailItem;
|
|
14
|
+
altText?: string | undefined;
|
|
15
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, __VLS_ctx?: {
|
|
16
|
+
attrs: any;
|
|
17
|
+
slots: {
|
|
18
|
+
hint?(_: {}): any;
|
|
19
|
+
};
|
|
20
|
+
emit: ((evt: "click", index: number) => void) & ((evt: "remove", index: number) => void);
|
|
21
|
+
} | undefined, __VLS_expose?: ((exposed: ShallowUnwrapRef< {}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
22
|
+
props: {
|
|
23
|
+
readonly onClick?: ((index: number) => any) | undefined;
|
|
24
|
+
readonly onRemove?: ((index: number) => any) | undefined;
|
|
25
|
+
variant?: ThumbnailVariant | undefined;
|
|
26
|
+
thumbnail: ThumbnailItem;
|
|
27
|
+
altText?: string | undefined;
|
|
28
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
29
|
+
expose(exposed: ShallowUnwrapRef< {}>): void;
|
|
30
|
+
attrs: any;
|
|
31
|
+
slots: {
|
|
32
|
+
hint?(_: {}): any;
|
|
33
|
+
};
|
|
34
|
+
emit: ((evt: "click", index: number) => void) & ((evt: "remove", index: number) => void);
|
|
35
|
+
}>) => VNode<RendererNode, RendererElement, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}> & {
|
|
38
|
+
__ctx?: {
|
|
39
|
+
props: {
|
|
40
|
+
readonly onClick?: ((index: number) => any) | undefined;
|
|
41
|
+
readonly onRemove?: ((index: number) => any) | undefined;
|
|
42
|
+
variant?: ThumbnailVariant | undefined;
|
|
43
|
+
thumbnail: ThumbnailItem;
|
|
44
|
+
altText?: string | undefined;
|
|
45
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
46
|
+
expose(exposed: ShallowUnwrapRef< {}>): void;
|
|
47
|
+
attrs: any;
|
|
48
|
+
slots: {
|
|
49
|
+
hint?(_: {}): any;
|
|
50
|
+
};
|
|
51
|
+
emit: ((evt: "click", index: number) => void) & ((evt: "remove", index: number) => void);
|
|
52
|
+
} | undefined;
|
|
53
|
+
};
|
|
54
|
+
export default _default;
|
|
55
|
+
|
|
56
|
+
export declare interface ThumbnailDefinition {
|
|
57
|
+
id: number | string;
|
|
58
|
+
imageUrl: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare type ThumbnailVariant = 'opaque' | 'translucent';
|
|
62
|
+
|
|
63
|
+
export { }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent as n, useCssModule as o, inject as m, openBlock as l, createElementBlock as c, normalizeClass as r, unref as t, createVNode as u } from "vue";
|
|
2
|
+
import i from "./Icon.js";
|
|
3
|
+
import { T as s } from "./ThumbnailGroup.keys-D6WL5xQ5.js";
|
|
4
|
+
import { _ as p } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const _ = /* @__PURE__ */ n({
|
|
6
|
+
__name: "ThumbnailEmpty",
|
|
7
|
+
setup(f) {
|
|
8
|
+
const a = o(), { radius: e } = m(s.key, s.defaults);
|
|
9
|
+
return (y, b) => (l(), c("li", {
|
|
10
|
+
class: r(["stash-thumbnail-empty", [
|
|
11
|
+
t(a)["thumbnail-empty"],
|
|
12
|
+
{
|
|
13
|
+
"tw-rounded-full": t(e) === "circle",
|
|
14
|
+
"tw-rounded": t(e) === "rounded"
|
|
15
|
+
}
|
|
16
|
+
]]),
|
|
17
|
+
"data-test": "stash-thumbnail-empty"
|
|
18
|
+
}, [
|
|
19
|
+
u(i, {
|
|
20
|
+
name: "image",
|
|
21
|
+
"data-test": "stash-thumbnail-empty|icon"
|
|
22
|
+
})
|
|
23
|
+
], 2));
|
|
24
|
+
}
|
|
25
|
+
}), d = {
|
|
26
|
+
"thumbnail-empty": "_thumbnail-empty_1c6pl_2"
|
|
27
|
+
}, h = {
|
|
28
|
+
$style: d
|
|
29
|
+
}, M = /* @__PURE__ */ p(_, [["__cssModules", h]]);
|
|
30
|
+
export {
|
|
31
|
+
M as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=ThumbnailEmpty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbnailEmpty.js","sources":["../src/components/ThumbnailEmpty/ThumbnailEmpty.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n import { THUMBNAIL_INJECTION } from '../ThumbnailGroup/ThumbnailGroup.keys';\n\n const classes = useCssModule();\n\n const { radius } = inject(THUMBNAIL_INJECTION.key, THUMBNAIL_INJECTION.defaults);\n</script>\n\n<template>\n <li\n class=\"stash-thumbnail-empty\"\n :class=\"[\n classes['thumbnail-empty'],\n {\n 'tw-rounded-full': radius === 'circle',\n 'tw-rounded': radius === 'rounded',\n },\n ]\"\n data-test=\"stash-thumbnail-empty\"\n >\n <Icon name=\"image\" data-test=\"stash-thumbnail-empty|icon\" />\n </li>\n</template>\n\n<style module>\n .thumbnail-empty {\n height: theme('spacing.12');\n width: theme('spacing.12');\n border-width: 1px;\n outline-width: theme('borderSpacing.1');\n border-style: dashed;\n border-color: var(--colors-ice-500);\n background-color: var(--colors-ice-100);\n color: var(--colors-ice-700);\n display: flex;\n justify-content: center;\n align-items: center;\n }\n</style>\n"],"names":["classes","useCssModule","radius","inject","THUMBNAIL_INJECTION"],"mappings":";;;;;;;AAME,UAAMA,IAAUC,KAEV,EAAE,QAAAC,EAAO,IAAIC,EAAOC,EAAoB,KAAKA,EAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
2
|
+
import { ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { DefineComponent } from 'vue';
|
|
4
|
+
import { PublicProps } from 'vue';
|
|
5
|
+
|
|
6
|
+
declare const _default: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
export default _default;
|
|
8
|
+
|
|
9
|
+
export { }
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineComponent as h, mergeModels as m, useModel as c, computed as l, ref as g, provide as v, openBlock as o, createElementBlock as d, renderSlot as T, normalizeProps as y, guardReactiveProps as _, unref as E, Fragment as x, renderList as w, createBlock as I } from "vue";
|
|
2
|
+
import B, { moveSortableElements as k } from "./useSortable.js";
|
|
3
|
+
import S from "./ThumbnailEmpty.js";
|
|
4
|
+
import { T as C } from "./ThumbnailGroup.keys-D6WL5xQ5.js";
|
|
5
|
+
import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const M = /* @__PURE__ */ h({
|
|
7
|
+
__name: "ThumbnailGroup",
|
|
8
|
+
props: /* @__PURE__ */ m({
|
|
9
|
+
draggable: { type: Boolean, default: !1 },
|
|
10
|
+
radius: { default: "rounded" },
|
|
11
|
+
removable: { type: Boolean, default: !1 },
|
|
12
|
+
showEmpty: { type: Boolean, default: !1 },
|
|
13
|
+
emptyOptions: { default: () => ({ max: 6 }) },
|
|
14
|
+
thumbnails: { default: () => [] }
|
|
15
|
+
}, {
|
|
16
|
+
activeThumbnail: {
|
|
17
|
+
default: -1
|
|
18
|
+
},
|
|
19
|
+
activeThumbnailModifiers: {}
|
|
20
|
+
}),
|
|
21
|
+
emits: /* @__PURE__ */ m(["dragStart", "dragEnd", "update:thumbnails"], ["update:activeThumbnail"]),
|
|
22
|
+
setup(s, { emit: p }) {
|
|
23
|
+
const n = p, t = s, r = c(s, "activeThumbnail"), a = l({
|
|
24
|
+
get() {
|
|
25
|
+
return t.thumbnails;
|
|
26
|
+
},
|
|
27
|
+
set(e) {
|
|
28
|
+
n("update:thumbnails", e);
|
|
29
|
+
}
|
|
30
|
+
}), u = g(null), { isDragging: i } = B({
|
|
31
|
+
ref: u,
|
|
32
|
+
list: a,
|
|
33
|
+
isEnabled: t.draggable,
|
|
34
|
+
ghostClass: "thumbnail-ghost",
|
|
35
|
+
chosenClass: "thumbnail-chosen",
|
|
36
|
+
sortInPlace: !1,
|
|
37
|
+
onDragStart: (e) => n("dragStart", e),
|
|
38
|
+
onDragEnd: (e) => {
|
|
39
|
+
r.value = e.newIndex, k({ list: a, from: e.oldIndex, to: e.newIndex }), n("dragEnd", e);
|
|
40
|
+
}
|
|
41
|
+
}), f = l(() => {
|
|
42
|
+
if (!t.showEmpty) return 0;
|
|
43
|
+
const { max: e } = t.emptyOptions || {};
|
|
44
|
+
return a.value.length < e ? e - a.value.length : 0;
|
|
45
|
+
});
|
|
46
|
+
return v(
|
|
47
|
+
C.key,
|
|
48
|
+
Object.freeze({
|
|
49
|
+
draggable: l(() => t.draggable),
|
|
50
|
+
removable: l(() => t.removable),
|
|
51
|
+
thumbnails: a,
|
|
52
|
+
radius: t.radius,
|
|
53
|
+
activeThumbnail: r,
|
|
54
|
+
isDragging: i
|
|
55
|
+
})
|
|
56
|
+
), (e, O) => (o(), d("ul", {
|
|
57
|
+
ref_key: "thumbnailRef",
|
|
58
|
+
ref: u,
|
|
59
|
+
class: "stash-thumbnail-group tw-flex tw-flex-wrap tw-gap-3",
|
|
60
|
+
"data-test": "stash-thumbnail-group"
|
|
61
|
+
}, [
|
|
62
|
+
T(e.$slots, "default", y(_({ activeThumbnail: r.value, isDragging: E(i) })), void 0, !0),
|
|
63
|
+
(o(!0), d(x, null, w(f.value, (N, b) => (o(), I(S, {
|
|
64
|
+
key: `empty_thumb_${b}`
|
|
65
|
+
}))), 128))
|
|
66
|
+
], 512));
|
|
67
|
+
}
|
|
68
|
+
}), $ = /* @__PURE__ */ D(M, [["__scopeId", "data-v-358f73aa"]]);
|
|
69
|
+
export {
|
|
70
|
+
$ as default,
|
|
71
|
+
k as moveSortableElements
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=ThumbnailGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbnailGroup.js","sources":["../src/components/ThumbnailGroup/ThumbnailGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n export * from '../../composables/useSortable/useSortable';\n export * from './ThumbnailGroup.types';\n</script>\n\n<script setup lang=\"ts\" generic=\"Thumbnail extends ThumbnailDefinition\">\n import { computed, provide, ref } from 'vue';\n\n import useSortable, {\n moveSortableElements,\n type SortableOnDragEndEvent,\n type SortableOnDragStartEvent,\n } from '../../composables/useSortable/useSortable';\n import { ThumbnailDefinition } from '../Thumbnail/Thumbnail.types';\n import ThumbnailEmpty from '../ThumbnailEmpty/ThumbnailEmpty.vue';\n import { THUMBNAIL_INJECTION } from './ThumbnailGroup.keys';\n import type { ThumbnailEmptyOptions, ThumbnailRadius } from './ThumbnailGroup.types';\n\n interface ThumbnailProps {\n /**\n * Enable drag and drop functionality\n * @default false\n */\n draggable?: boolean;\n\n /**\n * Thumbnail radius. Can be 'rounded' or 'circle'\n * @default 'rounded'\n */\n radius?: ThumbnailRadius;\n\n /**\n * Shows a close button on the thumbnail when set to true\n * @default false\n */\n removable?: boolean;\n\n /**\n * Shows empty thumbnails when set to true\n */\n showEmpty?: boolean;\n\n /**\n * Empty thumbnail options. Only applicable when `showEmpty` is true\n * @default { max: 6 }\n */\n emptyOptions?: ThumbnailEmptyOptions;\n\n /**\n * List of thumbnails to display\n * @default []\n */\n thumbnails?: Thumbnail[];\n }\n\n const emit = defineEmits<{\n /**\n * Emits when a thumbnail starts dragging\n */\n dragStart: [event: SortableOnDragStartEvent];\n\n /**\n * Emits when a thumbnail stops dragging\n */\n dragEnd: [event: SortableOnDragEndEvent];\n\n /**\n * Emits when the thumbnails are updated\n */\n 'update:thumbnails': [thumbnails: Thumbnail[]];\n }>();\n\n const props = withDefaults(defineProps<ThumbnailProps>(), {\n thumbnails: () => [],\n draggable: false,\n radius: 'rounded',\n variant: 'opaque',\n removable: false,\n showEmpty: false,\n emptyOptions: () => ({ max: 6 }),\n });\n\n /**\n * The active thumbnail index\n */\n const activeThumbnail = defineModel<number>('activeThumbnail', {\n default: -1,\n });\n\n const internalThumbnails = computed({\n get() {\n return props.thumbnails;\n },\n set(value) {\n emit('update:thumbnails', value);\n },\n });\n\n const thumbnailRef = ref<HTMLElement | null>(null);\n const { isDragging } = useSortable({\n ref: thumbnailRef,\n list: internalThumbnails,\n isEnabled: props.draggable,\n ghostClass: 'thumbnail-ghost',\n chosenClass: 'thumbnail-chosen',\n sortInPlace: false,\n onDragStart: (e) => emit('dragStart', e),\n onDragEnd: (e) => {\n activeThumbnail.value = e.newIndex;\n moveSortableElements({ list: internalThumbnails, from: e.oldIndex, to: e.newIndex });\n emit('dragEnd', e);\n },\n });\n\n const emptyThumbnailsCount = computed(() => {\n if (!props.showEmpty) return 0;\n\n const { max } = props.emptyOptions || {};\n\n return internalThumbnails.value.length < max ? max - internalThumbnails.value.length : 0;\n });\n\n provide(\n THUMBNAIL_INJECTION.key,\n Object.freeze({\n draggable: computed(() => props.draggable),\n removable: computed(() => props.removable),\n thumbnails: internalThumbnails,\n radius: props.radius,\n activeThumbnail,\n isDragging,\n }),\n );\n</script>\n\n<template>\n <ul ref=\"thumbnailRef\" class=\"stash-thumbnail-group tw-flex tw-flex-wrap tw-gap-3\" data-test=\"stash-thumbnail-group\">\n <slot v-bind=\"{ activeThumbnail, isDragging }\"></slot>\n\n <ThumbnailEmpty v-for=\"(_, index) in emptyThumbnailsCount\" :key=\"`empty_thumb_${index}`\" />\n </ul>\n</template>\n\n<style>\n .thumbnail-ghost {\n .stash-thumbnail-item__img {\n border: 1px solid var(-color-blue-500);\n mask-image: none !important;\n box-shadow: theme('boxShadow.DEFAULT');\n }\n\n .stash-thumbnail-item__remove {\n opacity: 0;\n }\n }\n</style>\n\n<style scoped>\n :deep(.thumbnail-chosen) {\n opacity: 0 !important;\n }\n</style>\n"],"names":["emit","__emit","props","__props","activeThumbnail","_useModel","internalThumbnails","computed","value","thumbnailRef","ref","isDragging","useSortable","moveSortableElements","emptyThumbnailsCount","max","provide","THUMBNAIL_INJECTION"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuDE,UAAMA,IAAOC,GAiBPC,IAAQC,GAaRC,IAAkBC,EAAoBF,GAAA,iBAE3C,GAEKG,IAAqBC,EAAS;AAAA,MAClC,MAAM;AACJ,eAAOL,EAAM;AAAA,MACf;AAAA,MACA,IAAIM,GAAO;AACT,QAAAR,EAAK,qBAAqBQ,CAAK;AAAA,MACjC;AAAA,IAAA,CACD,GAEKC,IAAeC,EAAwB,IAAI,GAC3C,EAAE,YAAAC,EAAW,IAAIC,EAAY;AAAA,MACjC,KAAKH;AAAA,MACL,MAAMH;AAAA,MACN,WAAWJ,EAAM;AAAA,MACjB,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,aAAa;AAAA,MACb,aAAa,CAAC,MAAMF,EAAK,aAAa,CAAC;AAAA,MACvC,WAAW,CAAC,MAAM;AAChB,QAAAI,EAAgB,QAAQ,EAAE,UACLS,EAAA,EAAE,MAAMP,GAAoB,MAAM,EAAE,UAAU,IAAI,EAAE,SAAA,CAAU,GACnFN,EAAK,WAAW,CAAC;AAAA,MACnB;AAAA,IAAA,CACD,GAEKc,IAAuBP,EAAS,MAAM;AACtC,UAAA,CAACL,EAAM,UAAkB,QAAA;AAE7B,YAAM,EAAE,KAAAa,EAAQ,IAAAb,EAAM,gBAAgB,CAAA;AAEtC,aAAOI,EAAmB,MAAM,SAASS,IAAMA,IAAMT,EAAmB,MAAM,SAAS;AAAA,IAAA,CACxF;AAED,WAAAU;AAAA,MACEC,EAAoB;AAAA,MACpB,OAAO,OAAO;AAAA,QACZ,WAAWV,EAAS,MAAML,EAAM,SAAS;AAAA,QACzC,WAAWK,EAAS,MAAML,EAAM,SAAS;AAAA,QACzC,YAAYI;AAAA,QACZ,QAAQJ,EAAM;AAAA,QACd,iBAAAE;AAAA,QACA,YAAAO;AAAA,MAAA,CACD;AAAA,IAAA;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { computed as e, ref as a } from "vue";
|
|
2
|
+
const l = Object.freeze({
|
|
3
|
+
key: Symbol("THUMBNAIL_INJECTION_KEY"),
|
|
4
|
+
defaults: Object.freeze({
|
|
5
|
+
radius: "rounded",
|
|
6
|
+
draggable: e(() => !1),
|
|
7
|
+
removable: e(() => !1),
|
|
8
|
+
thumbnails: e(() => []),
|
|
9
|
+
activeThumbnail: a(void 0),
|
|
10
|
+
isDragging: a(!1)
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
l as T
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=ThumbnailGroup.keys-D6WL5xQ5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbnailGroup.keys-D6WL5xQ5.js","sources":["../src/components/ThumbnailGroup/ThumbnailGroup.keys.ts"],"sourcesContent":["import { computed, ref } from 'vue';\n\nimport { InjectionWithDefaults } from '../../../types/utils';\nimport { ThumbnailDefinition } from '../Thumbnail/Thumbnail.types';\nimport { ThumbnailInjection, ThumbnailRadius } from './ThumbnailGroup.types';\n\n// See: https://vuejs.org/guide/typescript/composition-api.html#typing-provide-inject\nexport const THUMBNAIL_INJECTION: InjectionWithDefaults<ThumbnailInjection<ThumbnailDefinition>> = Object.freeze({\n key: Symbol('THUMBNAIL_INJECTION_KEY'),\n defaults: Object.freeze({\n radius: 'rounded' as ThumbnailRadius,\n draggable: computed(() => false),\n removable: computed(() => false),\n thumbnails: computed(() => [] as ThumbnailDefinition[]),\n activeThumbnail: ref(undefined),\n isDragging: ref(false),\n }),\n});\n"],"names":["THUMBNAIL_INJECTION","computed","ref"],"mappings":";AAOa,MAAAA,IAAsF,OAAO,OAAO;AAAA,EAC/G,KAAK,OAAO,yBAAyB;AAAA,EACrC,UAAU,OAAO,OAAO;AAAA,IACtB,QAAQ;AAAA,IACR,WAAWC,EAAS,MAAM,EAAK;AAAA,IAC/B,WAAWA,EAAS,MAAM,EAAK;AAAA,IAC/B,YAAYA,EAAS,MAAM,EAA2B;AAAA,IACtD,iBAAiBC,EAAI,MAAS;AAAA,IAC9B,YAAYA,EAAI,EAAK;AAAA,EAAA,CACtB;AACH,CAAC;"}
|