@bridge-ui/vue 0.12.0 → 0.13.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.
Files changed (54) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +2 -1
  2. package/dist/Adapters/Examples/date-moment.js +31 -31
  3. package/dist/Adapters/Examples/i18n-dictionary.js +14 -0
  4. package/dist/Adapters/Examples/icon-fontawesome.js +23 -22
  5. package/dist/Adapters/Examples/icon-heroicons.js +46 -45
  6. package/dist/Adapters/Examples/icon-lucide.js +12 -11
  7. package/dist/Adapters/Examples/icon-phosphor.js +48 -47
  8. package/dist/Adapters/Examples/icon-tabler.js +12 -11
  9. package/dist/Components/BaseField/composables/useBaseField.d.ts +3 -3
  10. package/dist/Components/BaseField/composables/useBaseField.js +7 -7
  11. package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +8 -8
  12. package/dist/Components/Carousel/Carousel.js +5 -0
  13. package/dist/Components/Carousel/Carousel.vue.d.ts +22 -0
  14. package/dist/Components/Carousel/Carousel.vue_vue_type_script_setup_true_lang.js +49 -0
  15. package/dist/Components/Carousel/carousel.types.d.ts +236 -0
  16. package/dist/Components/Carousel/carouselInjectionKey.d.ts +48 -0
  17. package/dist/Components/Carousel/carouselInjectionKey.js +4 -0
  18. package/dist/Components/Carousel/composables/useCarousel.d.ts +91 -0
  19. package/dist/Components/Carousel/composables/useCarousel.js +331 -0
  20. package/dist/Components/Carousel/index.d.ts +4 -0
  21. package/dist/Components/Carousel/index.js +4 -0
  22. package/dist/Components/CarouselSlide/CarouselSlide.js +5 -0
  23. package/dist/Components/CarouselSlide/CarouselSlide.vue.d.ts +11 -0
  24. package/dist/Components/CarouselSlide/CarouselSlide.vue_vue_type_script_setup_true_lang.js +17 -0
  25. package/dist/Components/CarouselSlide/carouselSlide.types.d.ts +40 -0
  26. package/dist/Components/CarouselSlide/composables/useCarouselSlide.d.ts +205 -0
  27. package/dist/Components/CarouselSlide/composables/useCarouselSlide.js +79 -0
  28. package/dist/Components/CarouselSlide/index.d.ts +3 -0
  29. package/dist/Components/CarouselSlide/index.js +3 -0
  30. package/dist/Components/FileUpload/FileUpload.vue.d.ts +22 -24
  31. package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +101 -92
  32. package/dist/Components/FileUpload/composables/useFileUpload.d.ts +66 -16
  33. package/dist/Components/FileUpload/composables/useFileUpload.js +182 -157
  34. package/dist/Components/FileUpload/fileUpload.types.d.ts +113 -23
  35. package/dist/Components/FileUpload/fileUploadInjectionKey.d.ts +61 -0
  36. package/dist/Components/FileUpload/fileUploadInjectionKey.js +4 -0
  37. package/dist/Components/FileUpload/index.d.ts +1 -1
  38. package/dist/Components/FileUploadItem/FileUploadItem.js +5 -0
  39. package/dist/Components/FileUploadItem/FileUploadItem.vue.d.ts +12 -0
  40. package/dist/Components/FileUploadItem/FileUploadItem.vue_vue_type_script_setup_true_lang.js +83 -0
  41. package/dist/Components/FileUploadItem/composables/useFileUploadItem.d.ts +1153 -0
  42. package/dist/Components/FileUploadItem/composables/useFileUploadItem.js +94 -0
  43. package/dist/Components/FileUploadItem/fileUploadItem.types.d.ts +20 -0
  44. package/dist/Components/FileUploadItem/index.d.ts +3 -0
  45. package/dist/Components/FileUploadItem/index.js +3 -0
  46. package/dist/Components/Pagination/composables/usePagination.d.ts +1 -1
  47. package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +1 -1
  48. package/dist/augments.d.ts +10 -1
  49. package/dist/index.d.ts +7 -1
  50. package/dist/index.js +115 -109
  51. package/docs/README.md +1 -0
  52. package/docs/components/Carousel.md +113 -0
  53. package/docs/components/FileUpload.md +83 -8
  54. package/package.json +2 -2
@@ -0,0 +1,79 @@
1
+ import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
2
+ import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
3
+ import { CAROUSEL_INJECTION_KEY as i } from "../../Carousel/carouselInjectionKey.js";
4
+ import { computed as a, inject as o, onBeforeUnmount as s, useAttrs as c, useId as l, watchEffect as u } from "vue";
5
+ import { get as d, omit as f } from "es-toolkit/compat";
6
+ import { getCarouselSlideId as p, isCarouselSlideInView as m } from "@bridge-ui/core/Domain";
7
+ import { cn as h, splitComponentProps as g } from "@bridge-ui/core/Utils";
8
+ //#region src/Components/CarouselSlide/composables/useCarouselSlide.ts
9
+ var _ = ["classes", "customProps"];
10
+ function v(e) {
11
+ return e && typeof e == "object" && !Array.isArray(e) ? e : {};
12
+ }
13
+ function y(y) {
14
+ let b = c(), x = l(), S = e(), C = o(i, null);
15
+ if (!C) throw Error("CarouselSlide must be used within a Carousel provider");
16
+ let w = C, T = null;
17
+ T = w.value.registerSlide(x), s(() => {
18
+ T?.(), T = null;
19
+ });
20
+ let E = a(() => w.value.getIndex(x)), D = a(() => E.value === w.value.activeIndex), O = a(() => m({
21
+ slideIndex: E.value,
22
+ activeIndex: w.value.activeIndex,
23
+ slidesPerView: w.value.slidesPerView
24
+ })), k = a(() => p(w.value.id, E.value)), A = a(() => g({
25
+ props: {
26
+ ...b,
27
+ ...y
28
+ },
29
+ bridgeKeys: _
30
+ })), { merged: j, entry: M } = n({
31
+ componentName: "CarouselSlide",
32
+ props: () => A.value.componentProps
33
+ }), N = r({
34
+ entry: M,
35
+ props: () => A.value.componentProps
36
+ }), P = a(() => {
37
+ let e = E.value + 1;
38
+ return w.value.slideCount > 0 ? S("Slide {{index}} of {{count}}", {
39
+ index: e,
40
+ count: w.value.slideCount
41
+ }) : S("Slide {{index}}", { index: e });
42
+ });
43
+ return u(() => {
44
+ let e = document.getElementById(k.value);
45
+ e && (O.value ? e.removeAttribute("inert") : e.setAttribute("inert", ""));
46
+ }), {
47
+ index: E,
48
+ rootBind: a(() => {
49
+ let e = j.value.customProps?.root;
50
+ return t({
51
+ ...A.value.inheritedAttrs,
52
+ ...e,
53
+ class: h(A.value.inheritedAttrs.class, e?.class),
54
+ style: {
55
+ ...w.value.slideStyle,
56
+ ...v(A.value.inheritedAttrs.style),
57
+ ...v(w.value.slidePartProps?.style),
58
+ ...v(e?.style)
59
+ }
60
+ }, f(w.value.slidePartProps, ["class", "style"]), {
61
+ role: "group",
62
+ id: k.value,
63
+ "data-part": "slide",
64
+ "aria-label": P.value,
65
+ "aria-roledescription": "slide",
66
+ inert: !O.value || void 0,
67
+ "aria-hidden": !O.value || void 0,
68
+ class: h(A.value.inheritedAttrs.class, w.value.slidePartProps?.class, {
69
+ [w.value.slideClassName]: !0,
70
+ [d(N.value, "root") ?? ""]: !0,
71
+ [d(w.value.sizeItem, "slide") ?? ""]: !0
72
+ })
73
+ });
74
+ }),
75
+ selected: D
76
+ };
77
+ }
78
+ //#endregion
79
+ export { y as useCarouselSlide };
@@ -0,0 +1,3 @@
1
+ export type { CarouselSlideClasses, CarouselSlideCustomProps, CarouselSlideOwnProps, CarouselSlideProps, CarouselSlideSlots, } from './carouselSlide.types';
2
+ export { default as CarouselSlide } from './CarouselSlide.vue';
3
+ export { useCarouselSlide } from './composables/useCarouselSlide';
@@ -0,0 +1,3 @@
1
+ import { useCarouselSlide as e } from "./composables/useCarouselSlide.js";
2
+ import t from "./CarouselSlide.js";
3
+ export { t as CarouselSlide, e as useCarouselSlide };
@@ -1,28 +1,26 @@
1
+ import { FileUploadModel, FileUploadValue } from '@bridge-ui/core/Domain';
1
2
  import { FileUploadOwnProps, FileUploadSlots } from './fileUpload.types';
2
- type __VLS_Slots = FileUploadSlots;
3
- type __VLS_Props = FileUploadOwnProps;
4
- type __VLS_ModelProps = {
5
- modelValue?: File[] | undefined;
3
+ declare const __VLS_export: <Multiple extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<(FileUploadOwnProps<Multiple> & {
5
+ modelValue?: Multiple extends true ? FileUploadValue[] : FileUploadValue | null;
6
+ }) & {
7
+ onRemove?: ((value: FileUploadValue, index: number) => any) | undefined;
8
+ "onUpdate:modelValue"?: ((value: (Multiple extends true ? FileUploadValue[] : FileUploadValue | null) | undefined) => any) | undefined;
9
+ onRetry?: ((value: FileUploadValue, index: number) => any) | undefined;
10
+ }> & (typeof globalThis extends {
11
+ __VLS_PROPS_FALLBACK: infer P;
12
+ } ? P : {});
13
+ expose: (exposed: {}) => void;
14
+ attrs: any;
15
+ slots: FileUploadSlots;
16
+ emit: (((evt: "remove", value: FileUploadValue, index: number) => void) & ((evt: "update:modelValue", value: FileUploadModel) => void) & ((evt: "retry", value: FileUploadValue, index: number) => void)) & ((event: "update:modelValue", value: (Multiple extends true ? FileUploadValue[] : FileUploadValue | null) | undefined) => void);
17
+ }>) => import('vue').VNode & {
18
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
6
19
  };
7
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
- declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- remove: (file: File, index: number) => any;
10
- "update:modelValue": (...args: unknown[]) => any;
11
- }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
- onRemove?: ((file: File, index: number) => any) | undefined;
13
- "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
14
- }>, {
15
- color: import('@bridge-ui/core/Utils').MergeProps<import('@bridge-ui/core/Tokens').ButtonColor, import('./fileUpload.types').FileUploadColorOverrides>;
16
- size: import('@bridge-ui/core/Utils').MergeProps<import('@bridge-ui/core/Tokens').FileUploadSize, import('./fileUpload.types').FileUploadSizeOverrides>;
17
- rounded: import('@bridge-ui/core/Utils').MergeProps<import('@bridge-ui/core/Tokens').FileUploadRounded, import('./fileUpload.types').FileUploadRoundedOverrides>;
18
- variant: import('@bridge-ui/core/Utils').MergeProps<import('@bridge-ui/core/Tokens').FileUploadVariant, import('./fileUpload.types').FileUploadVariantOverrides>;
19
- multiple: boolean;
20
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
20
  declare const _default: typeof __VLS_export;
23
21
  export default _default;
24
- type __VLS_WithSlots<T, S> = T & {
25
- new (): {
26
- $slots: S;
27
- };
28
- };
22
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
23
+ [K in keyof T]: T[K];
24
+ } : {
25
+ [K in keyof T as K]: T[K];
26
+ }) & {};
@@ -1,28 +1,30 @@
1
- import { hasNamedSlot as e, isPropPresent as t } from "../../Utils/slotOrProp.js";
2
- import { useOptionalModel as n } from "../../Utils/useOptionalModel.js";
3
- import r from "../Icon/Icon.js";
4
- import i from "../Button/Button.js";
5
- import { useFileUpload as a } from "./composables/useFileUpload.js";
6
- import { Fragment as o, computed as ee, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, normalizeProps as _, openBlock as v, ref as y, renderList as b, renderSlot as x, toDisplayString as S, unref as C, useModel as w, withCtx as T } from "vue";
1
+ import { hasNamedSlot as e, isPropPresent as t, presentSlotNames as n } from "../../Utils/slotOrProp.js";
2
+ import { useOptionalModel as r } from "../../Utils/useOptionalModel.js";
3
+ import i from "../Icon/Icon.js";
4
+ import a from "../Button/Button.js";
5
+ import { BASE_FIELD_CHROME_SLOT_NAMES as o } from "../BaseField/baseField.types.js";
6
+ import s from "../BaseField/BaseField.js";
7
+ import { useFileUpload as c } from "./composables/useFileUpload.js";
8
+ import { FILE_UPLOAD_KEY as l } from "./fileUploadInjectionKey.js";
9
+ import u from "../FileUploadItem/FileUploadItem.js";
10
+ import { Fragment as d, computed as ee, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createSlots as g, createTextVNode as _, createVNode as v, defineComponent as y, guardReactiveProps as b, mergeModels as x, mergeProps as S, normalizeProps as C, openBlock as w, provide as te, ref as ne, renderList as T, renderSlot as E, toDisplayString as D, unref as O, useModel as k, withCtx as A } from "vue";
11
+ import { getFileUploadItemKey as j } from "@bridge-ui/core/Domain";
7
12
  //#region src/Components/FileUpload/FileUpload.vue?vue&type=script&setup=true&lang.ts
8
- var E = {
9
- key: 2,
10
- "aria-hidden": "true",
11
- class: "text-error-600 dark:text-error-400"
12
- }, D = {
13
+ var M = { class: "flex w-full flex-col" }, N = {
13
14
  key: 0,
14
15
  class: "m-0 font-medium text-dark-900 dark:text-dark-100"
15
- }, O = {
16
+ }, P = {
16
17
  key: 1,
17
18
  class: "m-0 text-sm text-dark-500 dark:text-dark-400"
18
- }, k = ["tabindex"], A = ["src"], j = /*@__PURE__*/ p({
19
+ }, F = ["tabindex"], I = /*@__PURE__*/ y({
19
20
  inheritAttrs: !1,
20
21
  __name: "FileUpload",
21
- props: /*@__PURE__*/ h({
22
+ props: /*@__PURE__*/ x({
22
23
  accept: {},
23
24
  buttonLabel: {},
24
25
  classes: {},
25
- color: { default: "primary" },
26
+ color: {},
27
+ corner: {},
26
28
  customProps: {},
27
29
  defaultValue: {},
28
30
  description: {},
@@ -32,101 +34,108 @@ var E = {
32
34
  label: {},
33
35
  maxFiles: {},
34
36
  maxSize: {},
35
- multiple: {
36
- type: Boolean,
37
- default: !1
38
- },
37
+ multiple: {},
38
+ orientation: {},
39
39
  required: { type: Boolean },
40
- rounded: { default: "md" },
41
- size: { default: "md" },
40
+ rounded: {},
41
+ size: {},
42
42
  title: {},
43
- variant: { default: "button" }
43
+ variant: {}
44
44
  }, {
45
45
  modelValue: {},
46
46
  modelModifiers: {}
47
47
  }),
48
- emits: /*@__PURE__*/ h(["remove", "update:modelValue"], ["update:modelValue"]),
49
- setup(p, { emit: h }) {
50
- let j = h, M = w(p, "modelValue"), N = p, P = y(N.defaultValue ?? []), F = n(M, P), { slots: I, merged: L, rootBind: R, listBind: z, inputRef: B, labelBind: V, inputBind: H, errorBind: U, mediaBind: W, titleBind: te, fileItems: G, showError: K, isDropzone: q, showPicker: J, actionsBind: Y, contentBind: X, triggerBind: Z, getItemBind: Q, buttonLabel: ne, dropzoneBind: re, openFileDialog: $, descriptionBind: ie, itemDescriptionBind: ae, resolvedErrorMessage: oe } = a(N, {
48
+ emits: /*@__PURE__*/ x([
49
+ "remove",
50
+ "retry",
51
+ "update:modelValue"
52
+ ], ["update:modelValue"]),
53
+ setup(y, { emit: x }) {
54
+ let I = x, L = k(y, "modelValue"), R = y, z = ne(R.defaultValue ?? null), B = r(L, z), { slots: V, merged: H, listBind: U, inputRef: W, baseField: G, inputBind: K, mediaBind: q, titleBind: J, fileItems: Y, isDropzone: X, showPicker: Z, stateItems: re, actionsBind: ie, contentBind: ae, triggerBind: oe, getItemBind: Q, buttonLabel: se, dropzoneBind: ce, openFileDialog: $, orientationItems: le, itemDescriptionBind: ue } = c(R, {
51
55
  size: "md",
52
56
  rounded: "md",
53
57
  multiple: !1,
54
58
  color: "primary",
55
- variant: "button"
56
- }, F, j), se = ee(() => !K.value && !q.value && (e(I, "description") || t(L.value.description)));
57
- function ce(e) {
59
+ variant: "button",
60
+ orientation: "horizontal"
61
+ }, B, I);
62
+ te(l, ee(() => ({
63
+ getItemBind: Q,
64
+ size: H.value.size,
65
+ color: H.value.color,
66
+ mediaBind: q.value,
67
+ titleBind: J.value,
68
+ stateItems: re.value,
69
+ rounded: H.value.rounded,
70
+ actionsBind: ie.value,
71
+ contentBind: ae.value,
72
+ disabled: H.value.disabled,
73
+ orientation: H.value.orientation,
74
+ orientationItems: le.value,
75
+ descriptionBind: ue.value
76
+ })));
77
+ function de(e) {
58
78
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), $());
59
79
  }
60
- return (n, a) => (v(), l("div", _(m(C(R))), [
61
- u("input", g({
62
- ref_key: "inputRef",
63
- ref: B
64
- }, C(H)), null, 16),
65
- C(t)(C(L).label) || C(e)(C(I), "label") ? (v(), l("label", _(g({ key: 0 }, C(V))), [C(e)(C(I), "label") ? x(n.$slots, "label", {}, void 0, void 0, 0) : C(t)(C(L).label) ? (v(), l(o, { key: 1 }, [d(S(C(L).label), 1)], 64)) : c("", !0), C(L).required ? (v(), l("span", E, " * ")) : c("", !0)], 16)) : c("", !0),
66
- C(J) ? (v(), l(o, { key: 1 }, [C(q) ? (v(), l("div", _(g({ key: 0 }, C(re))), [C(e)(C(I), "dropzone") ? x(n.$slots, "dropzone", {}, void 0, void 0, 0) : (v(), l(o, { key: 1 }, [
67
- f(C(r), {
68
- icon: "inbox",
69
- class: "mb-1 text-dark-400"
70
- }),
71
- C(t)(C(L).title) ? (v(), l("p", D, S(C(L).title), 1)) : c("", !0),
72
- C(t)(C(L).description) ? (v(), l("p", O, S(C(L).description), 1)) : c("", !0)
73
- ], 64))], 16)) : (v(), l("div", _(g({ key: 1 }, C(Z))), [C(e)(C(I), "trigger") ? (v(), l("span", {
74
- key: 0,
75
- role: "button",
76
- onClick: a[0] ||= (...e) => C($) && C($)(...e),
77
- onKeydown: ce,
78
- tabindex: C(L).disabled ? -1 : 0
79
- }, [x(n.$slots, "trigger")], 40, k)) : (v(), s(C(i), {
80
- key: 1,
81
- type: "button",
82
- size: C(L).size,
83
- color: C(L).color,
84
- rounded: C(L).rounded,
85
- disabled: C(L).disabled,
86
- onClick: C($)
87
- }, {
88
- default: T(() => [d(S(C(ne)), 1)]),
89
- _: 1
90
- }, 8, [
91
- "size",
92
- "color",
93
- "rounded",
94
- "disabled",
95
- "onClick"
96
- ]))], 16))], 64)) : c("", !0),
97
- C(G).length > 0 ? (v(), l("ul", _(g({ key: 2 }, C(z))), [(v(!0), l(o, null, b(C(G), (t) => (v(), l("li", g({ ref_for: !0 }, C(Q)(t.index), { key: `${t.file.name}-${t.index}` }), [C(e)(C(I), "item") ? x(n.$slots, "item", g({ ref_for: !0 }, t), void 0, void 0, 0) : (v(), l(o, { key: 1 }, [
98
- u("div", g({ ref_for: !0 }, C(W)), [t.isImage && t.previewUrl ? (v(), l("img", {
80
+ return (r, c) => (w(), f(s, { field: O(G) }, g({
81
+ default: A(() => [h("div", M, [
82
+ h("input", S({
83
+ ref_key: "inputRef",
84
+ ref: W
85
+ }, O(K)), null, 16),
86
+ O(Z) ? (w(), m(d, { key: 0 }, [O(X) ? (w(), m("div", C(S({ key: 0 }, O(ce))), [O(e)(O(V), "dropzone") ? E(r.$slots, "dropzone", {}, void 0, void 0, 0) : (w(), m(d, { key: 1 }, [
87
+ v(O(i), {
88
+ icon: "inbox",
89
+ class: "mb-1 text-dark-400"
90
+ }),
91
+ O(t)(O(H).title) ? (w(), m("p", N, D(O(H).title), 1)) : p("", !0),
92
+ O(t)(O(H).description) ? (w(), m("p", P, D(O(H).description), 1)) : p("", !0)
93
+ ], 64))], 16)) : (w(), m("div", C(S({ key: 1 }, O(oe))), [O(e)(O(V), "trigger") ? (w(), m("span", {
99
94
  key: 0,
100
- alt: "",
101
- src: t.previewUrl
102
- }, null, 8, A)) : (v(), s(C(r), {
95
+ role: "button",
96
+ onClick: c[0] ||= (...e) => O($) && O($)(...e),
97
+ onKeydown: de,
98
+ tabindex: O(H).disabled ? -1 : 0
99
+ }, [E(r.$slots, "trigger")], 40, F)) : (w(), f(O(a), {
103
100
  key: 1,
104
- icon: "download"
105
- }))], 16),
106
- u("div", g({ ref_for: !0 }, C(X)), [u("p", g({ ref_for: !0 }, C(te)), S(t.file.name), 17), u("p", g({ ref_for: !0 }, C(ae)), S(t.metaLabel), 17)], 16),
107
- u("div", g({ ref_for: !0 }, C(Y)), [f(C(i), {
108
- size: "sm",
109
- icon: "clear",
110
101
  type: "button",
111
- variant: "flat",
112
- density: "mini",
113
- color: C(L).color,
114
- onClick: t.remove,
115
- rounded: C(L).rounded,
116
- disabled: C(L).disabled,
117
- "aria-label": `Remove ${t.file.name}`
118
- }, null, 8, [
102
+ size: O(H).size,
103
+ color: O(H).color,
104
+ rounded: O(H).rounded,
105
+ disabled: O(H).disabled,
106
+ onClick: O($)
107
+ }, {
108
+ default: A(() => [_(D(O(se)), 1)]),
109
+ _: 1
110
+ }, 8, [
111
+ "size",
119
112
  "color",
120
- "onClick",
121
113
  "rounded",
122
114
  "disabled",
123
- "aria-label"
124
- ])], 16)
125
- ], 64))], 16))), 128))], 16)) : c("", !0),
126
- se.value ? (v(), l("p", _(g({ key: 3 }, C(ie))), [C(e)(C(I), "description") ? x(n.$slots, "description", {}, void 0, void 0, 0) : C(t)(C(L).description) ? (v(), l(o, { key: 1 }, [d(S(C(L).description), 1)], 64)) : c("", !0)], 16)) : c("", !0),
127
- C(K) ? (v(), l("p", _(g({ key: 4 }, C(U))), [C(e)(C(I), "errorMessage") ? x(n.$slots, "errorMessage", {}, void 0, void 0, 0) : (v(), l(o, { key: 1 }, [d(S(C(oe)), 1)], 64))], 16)) : c("", !0)
128
- ], 16));
115
+ "onClick"
116
+ ]))], 16))], 64)) : p("", !0),
117
+ O(e)(O(V), "list") ? E(r.$slots, "list", { items: O(Y) }, void 0, void 0, 1) : O(Y).length > 0 ? (w(), m("ul", C(S({ key: 2 }, O(U))), [(w(!0), m(d, null, T(O(Y), (t) => (w(), m(d, { key: O(j)(t.value, t.index) }, [O(e)(O(V), "item") ? (w(), m("li", S({
118
+ key: 0,
119
+ ref_for: !0
120
+ }, O(Q)(t.index)), [E(r.$slots, "item", S({ ref_for: !0 }, t))], 16)) : (w(), f(u, S({
121
+ key: 1,
122
+ ref_for: !0
123
+ }, t), g({ _: 2 }, [O(e)(O(V), "start") ? {
124
+ name: "start",
125
+ fn: A(() => [E(r.$slots, "start", S({ ref_for: !0 }, t))]),
126
+ key: "0"
127
+ } : void 0, O(e)(O(V), "end") ? {
128
+ name: "end",
129
+ fn: A(() => [E(r.$slots, "end", S({ ref_for: !0 }, t))]),
130
+ key: "1"
131
+ } : void 0]), 1040))], 64))), 128))], 16)) : p("", !0)
132
+ ])]),
133
+ _: 2
134
+ }, [T(O(n)(O(o).filter((e) => e !== "start" && e !== "end"), r.$slots), (e) => ({
135
+ name: e,
136
+ fn: A((t) => [E(r.$slots, e, C(b(t || {})))])
137
+ }))]), 1032, ["field"]));
129
138
  }
130
139
  });
131
140
  //#endregion
132
- export { j as default };
141
+ export { I as default };
@@ -1,20 +1,58 @@
1
1
  import { Ref, WritableComputedRef } from 'vue';
2
+ import { FileUploadModel, FileUploadValue } from '@bridge-ui/core/Domain';
2
3
  import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
3
- import { FileUploadOwnProps, FileUploadProps } from '../fileUpload.types';
4
- type FileUploadLibDefaults = LibDefaultsShape<FileUploadOwnProps, "size" | "color" | "rounded" | "variant" | "multiple">;
5
- type FileUploadMerged = MergeLibDefaults<FileUploadOwnProps, FileUploadLibDefaults>;
6
- export declare function useFileUpload(props: FileUploadOwnProps, libDefaults: FileUploadLibDefaults, files: WritableComputedRef<File[]>, emit: {
7
- (event: "remove", file: File, index: number): void;
8
- (event: "update:modelValue", files: File[]): void;
4
+ import { FileUploadOwnProps } from '../fileUpload.types';
5
+ type FileUploadLibDefaults = LibDefaultsShape<FileUploadOwnProps<boolean>, "size" | "color" | "rounded" | "variant" | "multiple" | "orientation">;
6
+ type FileUploadMerged = MergeLibDefaults<FileUploadOwnProps<boolean>, FileUploadLibDefaults>;
7
+ export declare function useFileUpload(props: FileUploadOwnProps<boolean>, libDefaults: FileUploadLibDefaults, model: WritableComputedRef<FileUploadModel>, emit: {
8
+ (event: "remove", value: FileUploadValue, index: number): void;
9
+ (event: "retry", value: FileUploadValue, index: number): void;
10
+ (event: "update:modelValue", value: FileUploadModel): void;
9
11
  }): {
10
12
  slots: Readonly<{
11
13
  [name: string]: import('vue').Slot<any> | undefined;
12
14
  }>;
13
15
  merged: import('vue').ComputedRef<FileUploadMerged>;
14
16
  dragging: Ref<boolean, boolean>;
15
- rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<FileUploadProps, "error" | "color" | "size" | "classes" | "customProps" | "title" | "disabled" | "rounded" | "variant" | "label" | "required" | "description" | "errorMessage" | "multiple" | "accept" | "defaultValue" | "modelValue" | "buttonLabel" | "maxFiles" | "maxSize">, "class">>>;
16
17
  listBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
17
- labelBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
18
+ baseField: {
19
+ slots: Readonly<{
20
+ [name: string]: import('vue').Slot<any> | undefined;
21
+ }>;
22
+ merged: import('vue').ComputedRef<Omit<Omit<import('../../BaseField/baseField.types').BaseFieldOwnProps, "field">, "error" | "size" | "hideErrorMessage"> & {
23
+ error: NonNullable<boolean | undefined>;
24
+ size: NonNullable<keyof import('@bridge-ui/core/Tokens').BaseFieldSize | undefined>;
25
+ hideErrorMessage: NonNullable<boolean | undefined>;
26
+ }>;
27
+ rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
28
+ slots?: import('../../BaseField/baseField.types').BaseFieldSlots | undefined;
29
+ class: string;
30
+ }>>;
31
+ errorBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
32
+ groupBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
33
+ role: string;
34
+ id: string;
35
+ "aria-describedby": string | undefined;
36
+ "aria-disabled": true | undefined;
37
+ "aria-invalid": true | undefined;
38
+ }>>;
39
+ controlId: import('vue').ComputedRef<string>;
40
+ headerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
41
+ isDisabled: import('vue').ComputedRef<boolean>;
42
+ isReadonly: import('vue').ComputedRef<boolean>;
43
+ sizeClasses: import('vue').ComputedRef<import('@bridge-ui/core/Tokens').BaseFieldSizeItem | undefined>;
44
+ endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
45
+ invalidated: import('vue').ComputedRef<boolean>;
46
+ startSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
47
+ mergedClasses: import('vue').ComputedRef<Partial<import('../../BaseField/baseField.types').BaseFieldClasses>>;
48
+ ariaDescribedBy: import('vue').ComputedRef<string | undefined>;
49
+ fieldLabelProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
50
+ descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
51
+ fieldCornerProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
52
+ showErrorMessageRow: import('vue').ComputedRef<boolean>;
53
+ showDescriptionContent: import('vue').ComputedRef<boolean>;
54
+ showErrorMessageContent: import('vue').ComputedRef<boolean>;
55
+ };
18
56
  inputBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
19
57
  type: string;
20
58
  tabIndex: number;
@@ -22,32 +60,41 @@ export declare function useFileUpload(props: FileUploadOwnProps, libDefaults: Fi
22
60
  accept: string | undefined;
23
61
  onChange: (event: Event) => void;
24
62
  multiple: NonNullable<boolean | undefined>;
63
+ id: string;
25
64
  disabled: boolean;
26
65
  class: string;
27
66
  }, "class", import('vue').InputHTMLAttributes | undefined, {}>>;
28
- errorBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
29
- role: string;
30
- }>>;
31
67
  mediaBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
32
68
  titleBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
33
69
  fileItems: import('vue').ComputedRef<{
34
- file: File;
35
70
  index: number;
71
+ value: FileUploadValue;
36
72
  isImage: boolean;
37
73
  metaLabel: string;
38
- previewUrl: string | undefined;
39
- sizeLabel: string;
40
74
  remove: () => void;
75
+ sizeLabel: string;
76
+ previewUrl: string | undefined;
77
+ retry: (() => void) | undefined;
41
78
  }[]>;
42
79
  showError: import('vue').ComputedRef<boolean>;
43
80
  isDropzone: import('vue').ComputedRef<boolean>;
44
81
  isDisabled: import('vue').ComputedRef<boolean>;
45
82
  showPicker: import('vue').ComputedRef<boolean>;
46
83
  canAddMore: import('vue').ComputedRef<boolean>;
84
+ stateItems: import('vue').ComputedRef<Partial<{
85
+ done: import('@bridge-ui/core/Tokens').FileUploadStateItem;
86
+ error: import('@bridge-ui/core/Tokens').FileUploadStateItem;
87
+ idle: import('@bridge-ui/core/Tokens').FileUploadStateItem;
88
+ processing: import('@bridge-ui/core/Tokens').FileUploadStateItem;
89
+ uploading: import('@bridge-ui/core/Tokens').FileUploadStateItem;
90
+ }>>;
47
91
  actionsBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
48
92
  contentBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
49
93
  triggerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
50
- getItemBind: (_index: number) => import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>;
94
+ getItemBind: (index: number) => import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
95
+ "data-state"?: import('@bridge-ui/core/Domain').FileUploadItemState | undefined;
96
+ "data-orientation": NonNullable<keyof import('@bridge-ui/core/Tokens').FileUploadOrientation | undefined>;
97
+ }>;
51
98
  buttonLabel: import('vue').ComputedRef<string>;
52
99
  dropzoneBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
53
100
  role: string;
@@ -61,8 +108,11 @@ export declare function useFileUpload(props: FileUploadOwnProps, libDefaults: Fi
61
108
  "aria-disabled": true | undefined;
62
109
  }>>;
63
110
  openFileDialog: () => void;
64
- descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
65
111
  validationError: Ref<string | undefined, string | undefined>;
112
+ orientationItems: import('vue').ComputedRef<Partial<{
113
+ horizontal: import('@bridge-ui/core/Tokens').FileUploadOrientationItem;
114
+ vertical: import('@bridge-ui/core/Tokens').FileUploadOrientationItem;
115
+ }>>;
66
116
  itemDescriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
67
117
  resolvedErrorMessage: import('vue').ComputedRef<string | undefined>;
68
118
  inputRef: Ref<null | HTMLInputElement>;