@bridge-ui/vue 0.11.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.
- package/ai/skills/bridge-ui-components/SKILL.md +2 -1
- package/dist/Adapters/Examples/date-moment.js +31 -31
- package/dist/Adapters/Examples/i18n-dictionary.js +14 -0
- package/dist/Adapters/Examples/icon-fontawesome.js +53 -40
- package/dist/Adapters/Examples/icon-heroicons.js +46 -33
- package/dist/Adapters/Examples/icon-lucide.js +47 -34
- package/dist/Adapters/Examples/icon-phosphor.js +48 -35
- package/dist/Adapters/Examples/icon-tabler.js +45 -32
- package/dist/Adapters/Examples/rich-text-tiptap.d.ts +5 -0
- package/dist/Adapters/Examples/rich-text-tiptap.js +138 -0
- package/dist/Adapters/RichText/index.d.ts +1 -0
- package/dist/Adapters/RichText/index.js +2 -0
- package/dist/Adapters/RichText/mockRichTextAdapter.d.ts +5 -0
- package/dist/Adapters/RichText/useRichTextAdapter.d.ts +12 -0
- package/dist/Adapters/RichText/useRichTextAdapter.js +13 -0
- package/dist/Adapters/index.d.ts +1 -0
- package/dist/Adapters/index.js +2 -1
- package/dist/Components/ActionFooter/composables/useActionFooter.d.ts +6 -6
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +2 -2
- package/dist/Components/BaseField/composables/useBaseField.d.ts +3 -3
- package/dist/Components/BaseField/composables/useBaseField.js +7 -7
- package/dist/Components/Breadcrumb/Breadcrumb.vue.d.ts +17 -10
- package/dist/Components/Breadcrumb/Breadcrumb.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/Components/Breadcrumb/breadcrumb.types.d.ts +22 -4
- package/dist/Components/Breadcrumb/breadcrumbInjectionKey.d.ts +5 -1
- package/dist/Components/Breadcrumb/composables/useBreadcrumb.d.ts +6 -5
- package/dist/Components/Breadcrumb/composables/useBreadcrumb.js +2 -0
- package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue.d.ts +17 -11
- package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/BreadcrumbItem/breadcrumbItem.types.d.ts +21 -3
- package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.d.ts +10 -6
- package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.js +65 -59
- package/dist/Components/Button/Button.vue.d.ts +17 -8
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +10 -10
- package/dist/Components/Button/button.types.d.ts +22 -5
- package/dist/Components/Button/composables/useButton.d.ts +198 -8
- package/dist/Components/Button/composables/useButton.js +101 -86
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/Components/Carousel/Carousel.js +5 -0
- package/dist/Components/Carousel/Carousel.vue.d.ts +22 -0
- package/dist/Components/Carousel/Carousel.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/Components/Carousel/carousel.types.d.ts +236 -0
- package/dist/Components/Carousel/carouselInjectionKey.d.ts +48 -0
- package/dist/Components/Carousel/carouselInjectionKey.js +4 -0
- package/dist/Components/Carousel/composables/useCarousel.d.ts +91 -0
- package/dist/Components/Carousel/composables/useCarousel.js +331 -0
- package/dist/Components/Carousel/index.d.ts +4 -0
- package/dist/Components/Carousel/index.js +4 -0
- package/dist/Components/CarouselSlide/CarouselSlide.js +5 -0
- package/dist/Components/CarouselSlide/CarouselSlide.vue.d.ts +11 -0
- package/dist/Components/CarouselSlide/CarouselSlide.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/Components/CarouselSlide/carouselSlide.types.d.ts +40 -0
- package/dist/Components/CarouselSlide/composables/useCarouselSlide.d.ts +205 -0
- package/dist/Components/CarouselSlide/composables/useCarouselSlide.js +79 -0
- package/dist/Components/CarouselSlide/index.d.ts +3 -0
- package/dist/Components/CarouselSlide/index.js +3 -0
- package/dist/Components/ColorPicker/composables/useColorPicker.js +1 -1
- package/dist/Components/DataTable/DataTable.vue.d.ts +1 -1
- package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
- package/dist/Components/DataTable/composables/useDataTable.js +288 -282
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.js +2 -2
- package/dist/Components/FileUpload/FileUpload.js +5 -0
- package/dist/Components/FileUpload/FileUpload.vue.d.ts +26 -0
- package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +141 -0
- package/dist/Components/FileUpload/composables/useFileUpload.d.ts +120 -0
- package/dist/Components/FileUpload/composables/useFileUpload.js +235 -0
- package/dist/Components/FileUpload/fileUpload.types.d.ts +396 -0
- package/dist/Components/FileUpload/fileUploadInjectionKey.d.ts +61 -0
- package/dist/Components/FileUpload/fileUploadInjectionKey.js +4 -0
- package/dist/Components/FileUpload/index.d.ts +3 -0
- package/dist/Components/FileUpload/index.js +3 -0
- package/dist/Components/FileUploadItem/FileUploadItem.js +5 -0
- package/dist/Components/FileUploadItem/FileUploadItem.vue.d.ts +12 -0
- package/dist/Components/FileUploadItem/FileUploadItem.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/Components/FileUploadItem/composables/useFileUploadItem.d.ts +1153 -0
- package/dist/Components/FileUploadItem/composables/useFileUploadItem.js +94 -0
- package/dist/Components/FileUploadItem/fileUploadItem.types.d.ts +20 -0
- package/dist/Components/FileUploadItem/index.d.ts +3 -0
- package/dist/Components/FileUploadItem/index.js +3 -0
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/Link/Link.vue.d.ts +17 -8
- package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +30 -25
- package/dist/Components/Link/composables/useLink.d.ts +8 -6
- package/dist/Components/Link/composables/useLink.js +52 -45
- package/dist/Components/Link/link.types.d.ts +21 -4
- package/dist/Components/ListItem/ListItem.vue.d.ts +17 -15
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/ListItem/composables/useListItem.d.ts +7 -6
- package/dist/Components/ListItem/composables/useListItem.js +108 -105
- package/dist/Components/ListItem/listItem.types.d.ts +19 -3
- package/dist/Components/Listbox/composables/useListbox.d.ts +2 -2
- package/dist/Components/Menu/composables/useMenu.js +6 -6
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Modal/composables/useModal.js +2 -2
- package/dist/Components/Pagination/composables/usePagination.d.ts +1 -1
- package/dist/Components/RichTextEditor/RichTextEditor.js +5 -0
- package/dist/Components/RichTextEditor/RichTextEditor.vue.d.ts +23 -0
- package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +488 -0
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +226 -0
- package/dist/Components/RichTextEditor/index.d.ts +3 -0
- package/dist/Components/RichTextEditor/index.js +3 -0
- package/dist/Components/RichTextEditor/richTextEditor.types.d.ts +103 -0
- package/dist/Components/Select/composables/useSelect.js +2 -2
- package/dist/Components/Sidebar/SidebarListItem.vue.d.ts +17 -9
- package/dist/Components/Sidebar/SidebarListItem.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/Sidebar/composables/useSidebarListItem.js +1 -1
- package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +1 -1
- package/dist/Components/Sidebar/sidebar.types.d.ts +2 -1
- package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
- package/dist/Components/Textarea/composables/useTextarea.js +1 -1
- package/dist/Components/Tooltip/composables/useTooltip.js +3 -3
- package/dist/Utils/linkAs.d.ts +29 -0
- package/dist/Utils/linkAs.js +18 -0
- package/dist/augments.d.ts +19 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +181 -170
- package/dist/theme.css +3 -0
- package/docs/README.md +4 -0
- package/docs/components/Breadcrumb.md +16 -0
- package/docs/components/BridgeUIProvider.md +18 -1
- package/docs/components/Button.md +31 -19
- package/docs/components/Carousel.md +113 -0
- package/docs/components/DataTable.md +1 -1
- package/docs/components/FileUpload.md +197 -0
- package/docs/components/Link.md +28 -12
- package/docs/components/List.md +21 -19
- package/docs/components/RichTextEditor.md +88 -0
- package/docs/components/Sidebar.md +1 -1
- package/package.json +54 -18
|
@@ -1,160 +1,163 @@
|
|
|
1
1
|
import { hasNamedSlot as e } from "../../../Utils/slotOrProp.js";
|
|
2
2
|
import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { resolveLinkAsProps as i } from "../../../Utils/linkAs.js";
|
|
4
|
+
import { getListboxOptionId as a } from "../../Listbox/composables/useListboxNavigation.js";
|
|
5
|
+
import { LIST_INJECTION_KEY as o } from "../../List/listInjectionKey.js";
|
|
6
|
+
import { LISTBOX_INJECTION_KEY as s } from "../../Listbox/listboxInjectionKey.js";
|
|
7
|
+
import { computed as c, getCurrentInstance as l, inject as u, onBeforeUnmount as d, toValue as f, useAttrs as p, watch as m } from "vue";
|
|
8
|
+
import { get as h, isNil as g, isNull as _, omit as v } from "es-toolkit/compat";
|
|
9
|
+
import { listboxOptionFromComposedItem as y } from "@bridge-ui/core/Domain";
|
|
10
|
+
import { cn as b, splitComponentProps as x } from "@bridge-ui/core/Utils";
|
|
10
11
|
//#region src/Components/ListItem/composables/useListItem.ts
|
|
11
|
-
var
|
|
12
|
+
var S = [
|
|
12
13
|
"as",
|
|
13
14
|
"rel",
|
|
14
15
|
"href",
|
|
15
16
|
"role",
|
|
16
17
|
"dense",
|
|
17
18
|
"value",
|
|
19
|
+
"linkAs",
|
|
18
20
|
"target",
|
|
19
21
|
"classes",
|
|
20
22
|
"divider",
|
|
21
23
|
"primary",
|
|
22
24
|
"disabled",
|
|
23
25
|
"selected",
|
|
26
|
+
"linkProps",
|
|
24
27
|
"secondary",
|
|
25
28
|
"customProps",
|
|
26
29
|
"interactive",
|
|
27
30
|
"selectedIcon"
|
|
28
31
|
];
|
|
29
|
-
function
|
|
30
|
-
let
|
|
32
|
+
function C(C, w, T) {
|
|
33
|
+
let E = p(), D = u(o, null), O = u(s, null), k = !g(O), A = c(() => x({
|
|
31
34
|
props: {
|
|
32
|
-
...
|
|
33
|
-
...
|
|
35
|
+
...E,
|
|
36
|
+
...C
|
|
34
37
|
},
|
|
35
|
-
bridgeKeys:
|
|
36
|
-
})), { merged:
|
|
37
|
-
libDefaults:
|
|
38
|
+
bridgeKeys: S
|
|
39
|
+
})), { merged: j, entry: M } = n({
|
|
40
|
+
libDefaults: w,
|
|
38
41
|
componentName: "ListItem",
|
|
39
|
-
props: () =>
|
|
40
|
-
}),
|
|
41
|
-
value:
|
|
42
|
-
primary:
|
|
43
|
-
disabled:
|
|
44
|
-
secondary:
|
|
45
|
-
}) : null),
|
|
46
|
-
|
|
47
|
-
let e =
|
|
42
|
+
props: () => A.value.componentProps
|
|
43
|
+
}), N = c(() => O ? f(O) : null), P = c(() => k ? y({
|
|
44
|
+
value: j.value.value,
|
|
45
|
+
primary: j.value.primary,
|
|
46
|
+
disabled: j.value.disabled,
|
|
47
|
+
secondary: j.value.secondary
|
|
48
|
+
}) : null), F;
|
|
49
|
+
m(() => {
|
|
50
|
+
let e = P.value;
|
|
48
51
|
return e ? `${String(e.value)}:${e.label}:${e.disabled}:${e.description ?? ""}` : null;
|
|
49
52
|
}, () => {
|
|
50
|
-
|
|
51
|
-
let e =
|
|
52
|
-
|
|
53
|
-
}, { immediate: !0 }),
|
|
54
|
-
|
|
53
|
+
F?.(), F = void 0;
|
|
54
|
+
let e = P.value;
|
|
55
|
+
e && O && (F = f(O).registerOption(e));
|
|
56
|
+
}, { immediate: !0 }), d(() => {
|
|
57
|
+
F?.();
|
|
55
58
|
});
|
|
56
|
-
let
|
|
57
|
-
entry:
|
|
58
|
-
props: () =>
|
|
59
|
-
}),
|
|
60
|
-
class:
|
|
59
|
+
let I = c(() => !g(P.value)), L = c(() => !P.value || !N.value ? !1 : N.value.isSelected(P.value.value)), R = c(() => !P.value || !N.value ? -1 : N.value.getOptionIndex(P.value.value)), z = c(() => !N.value || R.value < 0 ? !1 : N.value.highlightedIndex === R.value), B = c(() => j.value.customProps), V = r({
|
|
60
|
+
entry: M,
|
|
61
|
+
props: () => A.value.componentProps
|
|
62
|
+
}), H = c(() => "dense" in (l()?.vnode.props ?? {}) ? C.dense === !0 : C.dense === !0 ? !0 : D ? f(D).dense : !1), U = c(() => e(T, "primary") || e(T, "default") || !!j.value.primary), W = c(() => e(T, "secondary") || !!j.value.secondary), G = c(() => I.value ? !L.value || !N.value?.showCheckmark ? null : "check" : !j.value.selected || _(j.value.selectedIcon) ? null : j.value.selectedIcon ?? "check"), K = c(() => e(T, "end") || G.value != null), q = c(() => v(A.value.inheritedAttrs, [])), J = c(() => t(B.value?.root, q.value, {
|
|
63
|
+
class: b({
|
|
61
64
|
"list-none": !0,
|
|
62
|
-
"border-b border-black/10 last:border-b-0 dark:border-white/10":
|
|
63
|
-
[
|
|
65
|
+
"border-b border-black/10 last:border-b-0 dark:border-white/10": j.value.divider,
|
|
66
|
+
[h(V.value, "root") ?? ""]: !0
|
|
64
67
|
}),
|
|
65
|
-
id:
|
|
66
|
-
})),
|
|
67
|
-
if (!
|
|
68
|
-
let e = t(
|
|
69
|
-
"aria-disabled":
|
|
70
|
-
rel:
|
|
71
|
-
"data-selected":
|
|
72
|
-
"aria-selected":
|
|
73
|
-
href:
|
|
74
|
-
target:
|
|
75
|
-
role:
|
|
76
|
-
onMousedown:
|
|
68
|
+
id: I.value && N.value?.listboxId && R.value >= 0 ? a(N.value.listboxId, R.value) : void 0
|
|
69
|
+
})), Y = c(() => !!j.value.href && !I.value), X = c(() => !!(j.value.interactive || I.value || Y.value)), Z = c(() => Y.value ? j.value.disabled || j.value.linkAs == null ? "a" : j.value.linkAs : "div"), Q = c(() => {
|
|
70
|
+
if (!X.value) return null;
|
|
71
|
+
let e = t(B.value?.interactive, i(j.value.linkAs, j.value.linkProps, Z.value), {
|
|
72
|
+
"aria-disabled": j.value.disabled ? !0 : void 0,
|
|
73
|
+
rel: Y.value && !j.value.disabled ? j.value.rel : void 0,
|
|
74
|
+
"data-selected": j.value.selected || L.value ? !0 : void 0,
|
|
75
|
+
"aria-selected": I.value ? L.value : void 0,
|
|
76
|
+
href: Y.value && !j.value.disabled ? j.value.href : void 0,
|
|
77
|
+
target: Y.value && !j.value.disabled ? j.value.target : void 0,
|
|
78
|
+
role: I.value ? "option" : Y.value ? void 0 : j.value.role,
|
|
79
|
+
onMousedown: I.value ? (e) => {
|
|
77
80
|
e.preventDefault();
|
|
78
81
|
} : void 0,
|
|
79
|
-
tabindex:
|
|
80
|
-
onClick:
|
|
81
|
-
|
|
82
|
+
tabindex: j.value.disabled || I.value ? -1 : Y.value ? void 0 : 0,
|
|
83
|
+
onClick: I.value ? () => {
|
|
84
|
+
P.value && N.value?.onSelect(P.value);
|
|
82
85
|
} : void 0,
|
|
83
|
-
class:
|
|
86
|
+
class: b({
|
|
84
87
|
"flex w-full min-w-0 items-center gap-x-2 rounded-md text-left text-sm text-dark-900 outline-hidden transition-colors dark:text-dark-100": !0,
|
|
85
|
-
"no-underline":
|
|
86
|
-
"cursor-pointer select-none": !
|
|
87
|
-
"px-2": !
|
|
88
|
-
"py-1.5": !
|
|
89
|
-
"py-1": !
|
|
90
|
-
"hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !
|
|
91
|
-
"bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white":
|
|
92
|
-
[
|
|
93
|
-
[
|
|
94
|
-
[
|
|
95
|
-
[
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
"opacity-50 pointer-events-none":
|
|
99
|
-
[
|
|
100
|
-
[
|
|
88
|
+
"no-underline": Y.value,
|
|
89
|
+
"cursor-pointer select-none": !j.value.disabled,
|
|
90
|
+
"px-2": !I.value,
|
|
91
|
+
"py-1.5": !I.value && !H.value,
|
|
92
|
+
"py-1": !I.value && H.value,
|
|
93
|
+
"hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !j.value.disabled && !I.value,
|
|
94
|
+
"bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": j.value.selected && !I.value,
|
|
95
|
+
[N.value?.optionHoverClass ?? ""]: I.value && !j.value.disabled && !L.value,
|
|
96
|
+
[N.value?.mergedClasses.optionHover ?? ""]: I.value && !j.value.disabled && !L.value,
|
|
97
|
+
[N.value?.optionSelectedClass ?? ""]: I.value && L.value,
|
|
98
|
+
[N.value?.mergedClasses.optionSelected ?? ""]: I.value && L.value,
|
|
99
|
+
[N.value?.optionHighlightedClass ?? ""]: I.value && z.value && !L.value,
|
|
100
|
+
[N.value?.mergedClasses.optionHighlighted ?? ""]: I.value && z.value && !L.value,
|
|
101
|
+
"opacity-50 pointer-events-none": j.value.disabled,
|
|
102
|
+
[h(V.value, "interactive") ?? ""]: !0,
|
|
103
|
+
[N.value?.sizeClasses?.option ?? ""]: I.value
|
|
101
104
|
})
|
|
102
105
|
});
|
|
103
|
-
return !
|
|
106
|
+
return !Y.value || !j.value.disabled ? e : {
|
|
104
107
|
...e,
|
|
105
108
|
rel: void 0,
|
|
106
109
|
href: void 0,
|
|
107
110
|
target: void 0
|
|
108
111
|
};
|
|
109
|
-
}),
|
|
112
|
+
}), $ = c(() => b({
|
|
110
113
|
"flex w-full min-w-0 items-center gap-x-2": !0,
|
|
111
|
-
"rounded-md text-dark-900 dark:text-dark-100": !
|
|
112
|
-
"px-2": !
|
|
113
|
-
"py-1.5": !
|
|
114
|
-
"py-1": !
|
|
115
|
-
})),
|
|
114
|
+
"rounded-md text-dark-900 dark:text-dark-100": !X.value,
|
|
115
|
+
"px-2": !X.value,
|
|
116
|
+
"py-1.5": !X.value && !H.value,
|
|
117
|
+
"py-1": !X.value && H.value
|
|
118
|
+
})), ee = c(() => t(B.value?.start, {}, b({
|
|
116
119
|
"flex shrink-0 items-center text-dark-600 dark:text-dark-300": !0,
|
|
117
|
-
[
|
|
118
|
-
}))),
|
|
120
|
+
[h(V.value, "start") ?? ""]: !0
|
|
121
|
+
}))), te = c(() => t(B.value?.content, {}, b({
|
|
119
122
|
"min-w-0 flex-1": !0,
|
|
120
|
-
[
|
|
121
|
-
}))),
|
|
123
|
+
[h(V.value, "content") ?? ""]: !0
|
|
124
|
+
}))), ne = c(() => t(B.value?.primary, {}, b({
|
|
122
125
|
"block truncate text-sm font-medium": !0,
|
|
123
|
-
[
|
|
124
|
-
[
|
|
126
|
+
[N.value?.sizeClasses?.primary ?? ""]: I.value,
|
|
127
|
+
[h(V.value, "primary") ?? ""]: !0,
|
|
125
128
|
"leading-normal": !0
|
|
126
|
-
}))),
|
|
129
|
+
}))), re = c(() => t(B.value?.secondary, {}, b({
|
|
127
130
|
"mt-0.5 block truncate text-xs leading-normal text-dark-500 dark:text-dark-400": !0,
|
|
128
|
-
[
|
|
129
|
-
[
|
|
131
|
+
[N.value?.sizeClasses?.secondary ?? ""]: I.value,
|
|
132
|
+
[h(V.value, "secondary") ?? ""]: !0
|
|
130
133
|
})));
|
|
131
134
|
return {
|
|
132
|
-
merged:
|
|
133
|
-
hasEnd:
|
|
134
|
-
endBind:
|
|
135
|
+
merged: j,
|
|
136
|
+
hasEnd: K,
|
|
137
|
+
endBind: c(() => t(B.value?.end, {}, b({
|
|
135
138
|
"ml-auto flex shrink-0 items-center": !0,
|
|
136
|
-
[
|
|
139
|
+
[h(V.value, "end") ?? ""]: !0
|
|
137
140
|
}))),
|
|
138
|
-
rootBind:
|
|
139
|
-
rowClass:
|
|
140
|
-
startBind:
|
|
141
|
-
hasPrimary:
|
|
142
|
-
contentBind:
|
|
143
|
-
primaryBind:
|
|
144
|
-
hasSecondary:
|
|
145
|
-
secondaryBind:
|
|
146
|
-
interactiveTag:
|
|
147
|
-
interactiveBind:
|
|
148
|
-
selectedIconBind:
|
|
149
|
-
...
|
|
150
|
-
class:
|
|
141
|
+
rootBind: J,
|
|
142
|
+
rowClass: $,
|
|
143
|
+
startBind: ee,
|
|
144
|
+
hasPrimary: U,
|
|
145
|
+
contentBind: te,
|
|
146
|
+
primaryBind: ne,
|
|
147
|
+
hasSecondary: W,
|
|
148
|
+
secondaryBind: re,
|
|
149
|
+
interactiveTag: Z,
|
|
150
|
+
interactiveBind: Q,
|
|
151
|
+
selectedIconBind: c(() => t(B.value?.selectedIcon, {}, {
|
|
152
|
+
...I.value ? {} : { size: "sm" },
|
|
153
|
+
class: b({
|
|
151
154
|
"block shrink-0": !0,
|
|
152
|
-
[
|
|
153
|
-
[
|
|
155
|
+
[N.value?.checkClass ?? ""]: I.value,
|
|
156
|
+
[h(V.value, "selectedIcon") ?? ""]: !0
|
|
154
157
|
})
|
|
155
158
|
})),
|
|
156
|
-
resolvedSelectedIcon:
|
|
159
|
+
resolvedSelectedIcon: G
|
|
157
160
|
};
|
|
158
161
|
}
|
|
159
162
|
//#endregion
|
|
160
|
-
export {
|
|
163
|
+
export { C as useListItem };
|
|
@@ -3,6 +3,7 @@ import { ListboxValue } from '@bridge-ui/core/Domain';
|
|
|
3
3
|
import { MergeHtmlProps } from '@bridge-ui/core/Utils';
|
|
4
4
|
import { IconSource } from '../../Adapters/Icon';
|
|
5
5
|
import { IconProps } from '../Icon';
|
|
6
|
+
import { LinkAsTag, LinkHref, LinkPropsOf } from '../../Utils/linkAs';
|
|
6
7
|
export interface ListItemClasses {
|
|
7
8
|
/**
|
|
8
9
|
* The classes to apply to the main content column.
|
|
@@ -75,7 +76,7 @@ export interface ListItemCustomProps {
|
|
|
75
76
|
* List row. Set `interactive` for clickable rows, or `href` for a link.
|
|
76
77
|
* Use `role="menuitem"` inside menus or `role="option"` in selects.
|
|
77
78
|
*/
|
|
78
|
-
export interface ListItemOwnProps {
|
|
79
|
+
export interface ListItemOwnProps<T extends LinkAsTag = "a"> {
|
|
79
80
|
/**
|
|
80
81
|
* The element to render as.
|
|
81
82
|
*
|
|
@@ -115,10 +116,11 @@ export interface ListItemOwnProps {
|
|
|
115
116
|
/**
|
|
116
117
|
* URL for the interactive wrapper. Renders an anchor so hover shows the
|
|
117
118
|
* address and middle-click opens a new tab.
|
|
119
|
+
* When `linkAs` is set, this also accepts that component's `href`.
|
|
118
120
|
*
|
|
119
121
|
* @default undefined
|
|
120
122
|
*/
|
|
121
|
-
href?:
|
|
123
|
+
href?: LinkHref<T, "a">;
|
|
122
124
|
/**
|
|
123
125
|
* When true, applies hover/focus styles and `tabIndex={0}` on the inner wrapper.
|
|
124
126
|
* Implied when `href` is set.
|
|
@@ -126,6 +128,20 @@ export interface ListItemOwnProps {
|
|
|
126
128
|
* @default false
|
|
127
129
|
*/
|
|
128
130
|
interactive?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Component rendered in place of the interactive `<a>`.
|
|
133
|
+
* The root stays `as` (`li` or `div`). Ignored while disabled.
|
|
134
|
+
*
|
|
135
|
+
* @default undefined
|
|
136
|
+
*/
|
|
137
|
+
linkAs?: T;
|
|
138
|
+
/**
|
|
139
|
+
* Props forwarded to `linkAs` (`method`, `replace`, `prefetch`, and so on).
|
|
140
|
+
* Checked against that component. Ignored while `linkAs` is not rendered.
|
|
141
|
+
*
|
|
142
|
+
* @default undefined
|
|
143
|
+
*/
|
|
144
|
+
linkProps?: LinkPropsOf<T, "a">;
|
|
129
145
|
/**
|
|
130
146
|
* Primary label text.
|
|
131
147
|
*
|
|
@@ -199,4 +215,4 @@ export interface ListItemSlots {
|
|
|
199
215
|
*/
|
|
200
216
|
start?: Slot<undefined>;
|
|
201
217
|
}
|
|
202
|
-
export type ListItemProps = MergeHtmlProps<ListItemOwnProps
|
|
218
|
+
export type ListItemProps<T extends LinkAsTag = "a"> = MergeHtmlProps<ListItemOwnProps<T>, HTMLAttributes>;
|
|
@@ -13,9 +13,9 @@ export declare function useListbox(props: ListboxOwnProps, libDefaults: ListboxL
|
|
|
13
13
|
surfaceBind: import('vue').ComputedRef<string>;
|
|
14
14
|
sizeClasses: import('vue').ComputedRef<import('@bridge-ui/core/Tokens').ListboxSizeOverlayItem | undefined>;
|
|
15
15
|
mergedClasses: import('vue').ComputedRef<Partial<ListboxClasses>>;
|
|
16
|
-
applyButtonProps: import('vue').ComputedRef<Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<Omit<import('../../Button').ButtonOwnProps
|
|
16
|
+
applyButtonProps: import('vue').ComputedRef<Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<Omit<import('../../Button').ButtonOwnProps<"button">, "as">, import('vue').ButtonHTMLAttributes>> | undefined>;
|
|
17
17
|
optionHoverClass: import('vue').ComputedRef<any>;
|
|
18
|
-
cancelButtonProps: import('vue').ComputedRef<Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<Omit<import('../../Button').ButtonOwnProps
|
|
18
|
+
cancelButtonProps: import('vue').ComputedRef<Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<Omit<import('../../Button').ButtonOwnProps<"button">, "as">, import('vue').ButtonHTMLAttributes>> | undefined>;
|
|
19
19
|
optionSelectedClass: import('vue').ComputedRef<any>;
|
|
20
20
|
optionHighlightedClass: import('vue').ComputedRef<any>;
|
|
21
21
|
};
|
|
@@ -61,7 +61,7 @@ function _(_, de, v = {}) {
|
|
|
61
61
|
return !(e instanceof Element) || K(e) || w.value?.contains(e) ? !1 : !!e.closest("[aria-haspopup=\"menu\"], button, [role=\"button\"]");
|
|
62
62
|
}
|
|
63
63
|
function q() {
|
|
64
|
-
|
|
64
|
+
H.value && N.value && P(!1);
|
|
65
65
|
}
|
|
66
66
|
function he() {
|
|
67
67
|
I.value.persistent && N.value || P(!N.value);
|
|
@@ -95,7 +95,7 @@ function _(_, de, v = {}) {
|
|
|
95
95
|
function Y() {
|
|
96
96
|
J();
|
|
97
97
|
let e = W(), t = w.value;
|
|
98
|
-
|
|
98
|
+
N.value && e && t && (O = ie({
|
|
99
99
|
floating: t,
|
|
100
100
|
reference: e,
|
|
101
101
|
offset: I.value.offset,
|
|
@@ -103,14 +103,14 @@ function _(_, de, v = {}) {
|
|
|
103
103
|
placement: I.value.placement,
|
|
104
104
|
matchWidth: I.value.matchWidth === !0,
|
|
105
105
|
onReferenceHidden: () => {
|
|
106
|
-
|
|
106
|
+
j && H.value && N.value && q();
|
|
107
107
|
}
|
|
108
108
|
}), O.start(), a(() => {
|
|
109
109
|
j = !0;
|
|
110
110
|
}));
|
|
111
111
|
}
|
|
112
112
|
function X() {
|
|
113
|
-
|
|
113
|
+
N.value && !I.value.disableAutoFocus && w.value && h(w.value).focusFirst();
|
|
114
114
|
}
|
|
115
115
|
function ve() {
|
|
116
116
|
if (k?.(), !N.value) {
|
|
@@ -119,7 +119,7 @@ function _(_, de, v = {}) {
|
|
|
119
119
|
}
|
|
120
120
|
function e(e) {
|
|
121
121
|
let t = e.target;
|
|
122
|
-
K(t) || w.value?.contains(t) || I.value.closeOnClickAway
|
|
122
|
+
K(t) || w.value?.contains(t) || I.value.closeOnClickAway !== !1 && H.value && (me(t) || q());
|
|
123
123
|
}
|
|
124
124
|
document.addEventListener("pointerdown", e, !0), k = () => {
|
|
125
125
|
document.removeEventListener("pointerdown", e, !0);
|
|
@@ -141,7 +141,7 @@ function _(_, de, v = {}) {
|
|
|
141
141
|
}));
|
|
142
142
|
}
|
|
143
143
|
function xe() {
|
|
144
|
-
|
|
144
|
+
N.value && I.value.closeOnEscape !== !1 && H.value && (q(), G());
|
|
145
145
|
}
|
|
146
146
|
function Q() {
|
|
147
147
|
let e = se(S.value);
|
|
@@ -34,7 +34,7 @@ export declare function useModal(props: ModalOwnProps, libDefaults: ModalLibDefa
|
|
|
34
34
|
};
|
|
35
35
|
"aria-hidden": boolean | undefined;
|
|
36
36
|
class: string;
|
|
37
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "classes" | "customProps" | "scroll" | "autoFocus" | "blur" | "closeOnEscape" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "persistent" | "stackId" | "teleportTo" | "
|
|
37
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "classes" | "customProps" | "transition" | "scroll" | "autoFocus" | "blur" | "closeOnEscape" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "persistent" | "stackId" | "teleportTo" | "align">>>;
|
|
38
38
|
panelBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
39
39
|
"data-modal-part": string;
|
|
40
40
|
"data-state": "open" | "closed";
|
|
@@ -146,13 +146,13 @@ function y(y, pe, b = {}) {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
function Z() {
|
|
149
|
-
I.value.closeOnOverlay
|
|
149
|
+
I.value.closeOnOverlay !== !1 && W.value && X();
|
|
150
150
|
}
|
|
151
151
|
function Q(e) {
|
|
152
152
|
le(e) && Z();
|
|
153
153
|
}
|
|
154
154
|
function De() {
|
|
155
|
-
|
|
155
|
+
N.value && I.value.closeOnEscape !== !1 && W.value && X();
|
|
156
156
|
}
|
|
157
157
|
o(N, (e) => {
|
|
158
158
|
if (e) {
|
|
@@ -17,7 +17,7 @@ export declare function usePagination(props: PaginationOwnProps, libDefaults: Pa
|
|
|
17
17
|
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
18
18
|
"aria-label": string;
|
|
19
19
|
class: string;
|
|
20
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<PaginationProps, "color" | "mode" | "size" | "classes" | "customProps" | "disabled" | "rounded" | "variant" | "modelValue" | "
|
|
20
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<PaginationProps, "color" | "mode" | "size" | "classes" | "customProps" | "disabled" | "rounded" | "variant" | "modelValue" | "count" | "boundaryCount" | "hasNext" | "hasPrevious" | "hideNextButton" | "hidePrevButton" | "siblingCount">>>;
|
|
21
21
|
listBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
22
22
|
class: string;
|
|
23
23
|
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RichTextValue } from '@bridge-ui/core/Adapters';
|
|
2
|
+
import { RichTextEditorOwnProps, RichTextEditorSlots } from './richTextEditor.types';
|
|
3
|
+
type __VLS_Slots = RichTextEditorSlots;
|
|
4
|
+
type __VLS_Props = RichTextEditorOwnProps;
|
|
5
|
+
type __VLS_ModelProps = {
|
|
6
|
+
modelValue?: RichTextValue;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
"update:modelValue": (...args: unknown[]) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
|
+
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
showErrorIcon: boolean;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { hasNamedSlot as e, presentSlotNames as t } from "../../Utils/slotOrProp.js";
|
|
2
|
+
import { useOptionalModel as n } from "../../Utils/useOptionalModel.js";
|
|
3
|
+
import r from "../Button/Button.js";
|
|
4
|
+
import i from "../ActionFooter/ActionFooter.js";
|
|
5
|
+
import { FORM_FIELD_CHROME_SLOT_NAMES as a } from "../FormField/formField.types.js";
|
|
6
|
+
import o from "../FormField/FormField.js";
|
|
7
|
+
import s from "../Menu/Menu.js";
|
|
8
|
+
import { useRichTextEditor as c } from "./composables/useRichTextEditor.js";
|
|
9
|
+
import l from "../TextField/TextField.js";
|
|
10
|
+
import { Fragment as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as h, createVNode as g, defineComponent as _, guardReactiveProps as v, isRef as y, mergeModels as b, mergeProps as x, normalizeProps as S, openBlock as C, ref as w, renderList as T, renderSlot as E, unref as D, useModel as O, useTemplateRef as k, withCtx as A, withModifiers as j } from "vue";
|
|
11
|
+
//#region src/Components/RichTextEditor/RichTextEditor.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
+
var M = { class: "flex min-h-0 min-w-0 flex-1 flex-col" }, N = { class: "flex w-64 flex-col" }, P = { class: "p-1.5" }, F = { class: "flex items-center justify-end gap-2 border-t border-dark-100 bg-dark-50 px-3 py-2 dark:border-dark-800 dark:bg-dark-950/40" }, I = /*@__PURE__*/ _({
|
|
13
|
+
inheritAttrs: !1,
|
|
14
|
+
__name: "RichTextEditor",
|
|
15
|
+
props: /*@__PURE__*/ b({
|
|
16
|
+
classes: {},
|
|
17
|
+
customProps: {},
|
|
18
|
+
defaultValue: {},
|
|
19
|
+
format: {},
|
|
20
|
+
placeholder: {},
|
|
21
|
+
readOnly: { type: Boolean },
|
|
22
|
+
tools: {},
|
|
23
|
+
color: {},
|
|
24
|
+
controlId: {},
|
|
25
|
+
corner: {},
|
|
26
|
+
description: {},
|
|
27
|
+
disabled: { type: Boolean },
|
|
28
|
+
end: {},
|
|
29
|
+
endIcon: {},
|
|
30
|
+
error: { type: Boolean },
|
|
31
|
+
errorIcon: {},
|
|
32
|
+
errorMessage: {},
|
|
33
|
+
hideErrorMessage: { type: Boolean },
|
|
34
|
+
label: {},
|
|
35
|
+
readonly: { type: Boolean },
|
|
36
|
+
required: { type: Boolean },
|
|
37
|
+
rounded: {},
|
|
38
|
+
showDescriptionOnError: { type: Boolean },
|
|
39
|
+
showErrorIcon: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !0
|
|
42
|
+
},
|
|
43
|
+
size: {},
|
|
44
|
+
slots: {},
|
|
45
|
+
start: {},
|
|
46
|
+
startIcon: {},
|
|
47
|
+
variant: {}
|
|
48
|
+
}, {
|
|
49
|
+
modelValue: {},
|
|
50
|
+
modelModifiers: {}
|
|
51
|
+
}),
|
|
52
|
+
emits: /*@__PURE__*/ b(["update:modelValue"], ["update:modelValue"]),
|
|
53
|
+
setup(_, { emit: b }) {
|
|
54
|
+
let I = O(_, "modelValue"), L = b, R = _, z = k("content"), B = w(R.defaultValue), V = n(I, B), { slots: H, tools: U, linkHref: W, linkOpen: G, formField: K, linkAnchor: q, contentBind: J, confirmLink: Y, onToolClick: X, toolbarBind: Z, showToolbar: Q, linkUrlLabel: $, canConfirmLink: ee, closeLinkEditor: te, getToolbarButtonBind: ne } = c(R, V, L, z);
|
|
55
|
+
return (n, c) => (C(), d(D(o), { field: D(K) }, h({
|
|
56
|
+
default: A(() => [m("div", M, [D(Q) ? (C(), p(u, { key: 0 }, [D(e)(D(H), "toolbar") ? E(n.$slots, "toolbar", { tools: D(U) }, void 0, void 0, 0) : (C(), p("div", S(x({ key: 1 }, D(Z))), [(C(!0), p(u, null, T(D(U), (e) => (C(), d(D(r), x({
|
|
57
|
+
key: e,
|
|
58
|
+
onMousedown: c[0] ||= j(() => {}, ["prevent"])
|
|
59
|
+
}, { ref_for: !0 }, D(ne)(e), { onClick: (t) => D(X)(e, t) }), null, 16, ["onClick"]))), 128))], 16))], 64)) : f("", !0), m("div", x({ ref: "content" }, D(J)), null, 16)]), g(D(s), {
|
|
60
|
+
modelValue: D(G),
|
|
61
|
+
"onUpdate:modelValue": c[2] ||= (e) => y(G) ? G.value = e : null,
|
|
62
|
+
"anchor-el": D(q),
|
|
63
|
+
placement: "bottom-start"
|
|
64
|
+
}, {
|
|
65
|
+
default: A(() => [m("div", N, [m("div", P, [g(D(l), {
|
|
66
|
+
size: "sm",
|
|
67
|
+
type: "url",
|
|
68
|
+
class: "w-full",
|
|
69
|
+
modelValue: D(W),
|
|
70
|
+
"onUpdate:modelValue": c[1] ||= (e) => y(W) ? W.value = e : null,
|
|
71
|
+
autocomplete: "off",
|
|
72
|
+
"hide-error-message": "",
|
|
73
|
+
"aria-label": D($),
|
|
74
|
+
placeholder: D($)
|
|
75
|
+
}, null, 8, [
|
|
76
|
+
"modelValue",
|
|
77
|
+
"aria-label",
|
|
78
|
+
"placeholder"
|
|
79
|
+
])]), m("div", F, [g(D(i), {
|
|
80
|
+
onApply: D(Y),
|
|
81
|
+
onCancel: D(te),
|
|
82
|
+
"custom-props": {
|
|
83
|
+
cancelButton: { size: "sm" },
|
|
84
|
+
applyButton: {
|
|
85
|
+
size: "sm",
|
|
86
|
+
disabled: !D(ee)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, null, 8, [
|
|
90
|
+
"onApply",
|
|
91
|
+
"onCancel",
|
|
92
|
+
"custom-props"
|
|
93
|
+
])])])]),
|
|
94
|
+
_: 1
|
|
95
|
+
}, 8, ["modelValue", "anchor-el"])]),
|
|
96
|
+
_: 2
|
|
97
|
+
}, [T(D(t)(D(a), n.$slots), (e) => ({
|
|
98
|
+
name: e,
|
|
99
|
+
fn: A((t) => [E(n.$slots, e, S(v(t || {})))])
|
|
100
|
+
}))]), 1032, ["field"]));
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
//#endregion
|
|
104
|
+
export { I as default };
|