@bridge-ui/vue 0.18.0 → 0.20.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 +35 -34
- package/ai/skills/bridge-ui-setup/SKILL.md +1 -1
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +257 -265
- package/dist/Components/Calendar/composables/useCalendar.d.ts +1 -1
- package/dist/Components/Calendar/composables/useCalendar.js +192 -187
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +1 -1
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +243 -238
- package/dist/Components/ChartBar/ChartBar.vue_vue_type_script_setup_true_lang.js +5 -0
- package/dist/Components/ChartBar/chartBar.types.d.ts +11 -1
- package/dist/Components/ChartBar/composables/useChartBar.js +4 -4
- package/dist/Components/ChartBar/index.d.ts +1 -1
- package/dist/Components/ChartBarSeries/ChartBarSeries.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/Components/ChartBarSeries/chartBarSeries.types.d.ts +24 -2
- package/dist/Components/ChartBarSeries/composables/useChartBarSeries.js +3 -0
- package/dist/Components/ChartBarSeries/index.d.ts +1 -0
- package/dist/Components/ChartFunnel/composables/useChartFunnel.js +10 -10
- package/dist/Components/ChartLine/ChartLine.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/ChartLine/chartLine.types.d.ts +7 -0
- package/dist/Components/ChartLine/composables/useChartLine.js +1 -1
- package/dist/Components/ChartLineSeries/ChartLineSeries.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/Components/ChartLineSeries/chartLineSeries.types.d.ts +23 -2
- package/dist/Components/ChartLineSeries/composables/useChartLineSeries.js +3 -0
- package/dist/Components/ChartLineSeries/index.d.ts +1 -0
- package/dist/Components/ChartPie/ChartPie.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/Components/ChartPie/chartPie.types.d.ts +20 -1
- package/dist/Components/ChartPie/composables/useChartPie.d.ts +1 -1
- package/dist/Components/ChartPie/composables/useChartPie.js +39 -29
- package/dist/Components/ChartScatter/composables/useChartScatter.js +63 -58
- package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/ChartScatterSeries/chartScatterSeries.types.d.ts +8 -1
- package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.js +2 -1
- package/dist/Components/ChartScatterSeries/index.d.ts +1 -0
- package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +4 -0
- package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +1 -0
- package/dist/Components/ChartTooltip/composables/useChartTooltip.js +4 -0
- package/dist/Components/DataTable/DataTableColumnsMenu.vue.d.ts +1 -2
- package/dist/Components/DataTable/composables/useDataTable.d.ts +8 -66
- package/dist/Components/DataTable/composables/useDataTable.js +267 -349
- package/dist/Components/DataTable/composables/useDataTableColumnsMenu.d.ts +1 -2
- package/dist/Components/Heading/Heading.js +5 -0
- package/dist/Components/Heading/Heading.vue.d.ts +11 -0
- package/dist/Components/Heading/Heading.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/Components/Heading/composables/useHeading.d.ts +10 -0
- package/dist/Components/Heading/composables/useHeading.js +56 -0
- package/dist/Components/Heading/heading.types.d.ts +56 -0
- package/dist/Components/Heading/index.d.ts +3 -0
- package/dist/Components/Heading/index.js +3 -0
- package/dist/Components/ListItem/composables/useListItem.js +29 -30
- package/dist/Components/Listbox/composables/useListboxNavigation.d.ts +0 -5
- package/dist/Components/Listbox/composables/useListboxNavigation.js +23 -50
- package/dist/Components/Listbox/index.d.ts +1 -1
- package/dist/Components/Listbox/index.js +5 -5
- package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +1 -1
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +31 -31
- package/dist/Components/Select/composables/useSelect.js +201 -211
- package/dist/Components/Slider/composables/useSlider.js +93 -122
- package/dist/Components/Text/Text.js +5 -0
- package/dist/Components/Text/Text.vue.d.ts +11 -0
- package/dist/Components/Text/Text.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/Text/composables/useText.d.ts +9 -0
- package/dist/Components/Text/composables/useText.js +56 -0
- package/dist/Components/Text/index.d.ts +3 -0
- package/dist/Components/Text/index.js +3 -0
- package/dist/Components/Text/text.types.d.ts +76 -0
- package/dist/Utils/Charts/chart.types.d.ts +17 -0
- package/dist/Utils/Charts/chartInjectionKey.d.ts +2 -2
- package/dist/Utils/Charts/index.d.ts +1 -1
- package/dist/Utils/Charts/useChartCartesian.d.ts +4 -2
- package/dist/Utils/Charts/useChartCartesian.js +90 -76
- package/dist/augments.d.ts +10 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +175 -171
- package/docs/README.md +2 -0
- package/docs/components/BridgeUIProvider.md +1 -1
- package/docs/components/Card.md +15 -0
- package/docs/components/Chart.md +17 -10
- package/docs/components/ChartBar.md +70 -17
- package/docs/components/ChartLine.md +57 -16
- package/docs/components/ChartPie.md +33 -10
- package/docs/components/ChartScatter.md +25 -7
- package/docs/components/Heading.md +85 -0
- package/docs/components/Text.md +118 -0
- package/package.json +2 -2
- package/dist/Components/RichTextEditor/tiptapEditor.d.ts +0 -111
- package/dist/Components/RichTextEditor/tiptapEditor.js +0 -121
- package/dist/Utils/Charts/echarts/bar.d.ts +0 -6
- package/dist/Utils/Charts/echarts/bar.js +0 -22
- package/dist/Utils/Charts/echarts/cartesian.d.ts +0 -15
- package/dist/Utils/Charts/echarts/cartesian.js +0 -255
- package/dist/Utils/Charts/echarts/funnel.d.ts +0 -15
- package/dist/Utils/Charts/echarts/funnel.js +0 -79
- package/dist/Utils/Charts/echarts/line.d.ts +0 -5
- package/dist/Utils/Charts/echarts/line.js +0 -19
- package/dist/Utils/Charts/echarts/part.d.ts +0 -19
- package/dist/Utils/Charts/echarts/part.js +0 -45
- package/dist/Utils/Charts/echarts/pie.d.ts +0 -14
- package/dist/Utils/Charts/echarts/pie.js +0 -75
- package/dist/Utils/Charts/echarts/plot.d.ts +0 -44
- package/dist/Utils/Charts/echarts/plot.js +0 -52
- package/dist/Utils/Charts/echarts/scatter.d.ts +0 -14
- package/dist/Utils/Charts/echarts/scatter.js +0 -152
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { FieldOverlayMode } from '@bridge-ui/core/Domain';
|
|
2
|
-
import { DataTableVisibilityItem } from './useDataTable';
|
|
1
|
+
import { DataTableVisibilityItem, FieldOverlayMode } from '@bridge-ui/core/Domain';
|
|
3
2
|
/**
|
|
4
3
|
* Column visibility overlay state: draft when the footer is shown, live
|
|
5
4
|
* otherwise.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HeadingOwnProps, HeadingSlots } from './heading.types';
|
|
2
|
+
type __VLS_Slots = HeadingSlots;
|
|
3
|
+
declare const __VLS_base: import('vue').DefineComponent<HeadingOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<HeadingOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
|
+
new (): {
|
|
9
|
+
$slots: S;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useHeading as e } from "./composables/useHeading.js";
|
|
2
|
+
import { createBlock as t, defineComponent as n, guardReactiveProps as r, normalizeProps as i, openBlock as a, renderSlot as o, resolveDynamicComponent as s, unref as c, withCtx as l } from "vue";
|
|
3
|
+
//#region src/Components/Heading/Heading.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var u = /*@__PURE__*/ n({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "Heading",
|
|
7
|
+
props: {
|
|
8
|
+
classes: {},
|
|
9
|
+
color: {},
|
|
10
|
+
level: {},
|
|
11
|
+
size: {},
|
|
12
|
+
variant: {},
|
|
13
|
+
weight: {}
|
|
14
|
+
},
|
|
15
|
+
setup(n) {
|
|
16
|
+
let { rootTag: u, rootBind: d } = e(n, {
|
|
17
|
+
level: 2,
|
|
18
|
+
color: "dark",
|
|
19
|
+
weight: "semibold",
|
|
20
|
+
variant: "default"
|
|
21
|
+
});
|
|
22
|
+
return (e, n) => (a(), t(s(c(u)), i(r(c(d))), {
|
|
23
|
+
default: l(() => [o(e.$slots, "default")]),
|
|
24
|
+
_: 3
|
|
25
|
+
}, 16));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { u as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
|
|
2
|
+
import { HeadingOwnProps, HeadingProps } from '../heading.types';
|
|
3
|
+
type HeadingLibDefaults = LibDefaultsShape<HeadingOwnProps, "color" | "level" | "weight" | "variant">;
|
|
4
|
+
type HeadingMerged = MergeLibDefaults<HeadingOwnProps, HeadingLibDefaults>;
|
|
5
|
+
export declare function useHeading(props: HeadingOwnProps, libDefaults: HeadingLibDefaults): {
|
|
6
|
+
merged: import('vue').ComputedRef<HeadingMerged>;
|
|
7
|
+
rootTag: import('vue').ComputedRef<"h1" | "h2" | "h3" | "h4" | "h5" | "h6">;
|
|
8
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, Omit<HeadingProps, "color" | "size" | "classes" | "variant" | "weight" | "level">>>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
|
+
import { computed as r, useAttrs as i } from "vue";
|
|
3
|
+
import { get as a, isNil as o } from "es-toolkit/compat";
|
|
4
|
+
import { headingLevelProps as s, textSizeProps as c, textVariantProps as l, textWeightProps as u } from "@bridge-ui/core/Tokens";
|
|
5
|
+
import { cn as d, mergeBridgeUILayeredClasses as f, splitComponentProps as p } from "@bridge-ui/core/Utils";
|
|
6
|
+
//#region src/Components/Heading/composables/useHeading.ts
|
|
7
|
+
var m = [
|
|
8
|
+
"size",
|
|
9
|
+
"color",
|
|
10
|
+
"level",
|
|
11
|
+
"weight",
|
|
12
|
+
"classes",
|
|
13
|
+
"variant"
|
|
14
|
+
];
|
|
15
|
+
function h(h, g) {
|
|
16
|
+
let _ = i(), v = r(() => p({
|
|
17
|
+
props: {
|
|
18
|
+
..._,
|
|
19
|
+
...h
|
|
20
|
+
},
|
|
21
|
+
bridgeKeys: m
|
|
22
|
+
})), { merged: y, entry: b } = t({
|
|
23
|
+
libDefaults: g,
|
|
24
|
+
componentName: "Heading",
|
|
25
|
+
props: () => v.value.componentProps
|
|
26
|
+
}), x = n({
|
|
27
|
+
entry: b,
|
|
28
|
+
props: () => v.value.componentProps
|
|
29
|
+
}), S = r(() => `h${y.value.level}`), C = r(() => {
|
|
30
|
+
if (o(y.value.size)) {
|
|
31
|
+
let e = f(s, b.value?.tokens?.level);
|
|
32
|
+
return a(e, String(y.value.level));
|
|
33
|
+
}
|
|
34
|
+
let e = f(c, b.value?.tokens?.size);
|
|
35
|
+
return a(e, y.value.size);
|
|
36
|
+
}), w = r(() => {
|
|
37
|
+
let e = f(l, b.value?.tokens?.variant);
|
|
38
|
+
return a(e, [y.value.variant, y.value.color]);
|
|
39
|
+
}), T = r(() => {
|
|
40
|
+
let e = f(u, b.value?.tokens?.weight);
|
|
41
|
+
return a(e, y.value.weight);
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
merged: y,
|
|
45
|
+
rootTag: S,
|
|
46
|
+
rootBind: r(() => e({}, v.value.inheritedAttrs, d({
|
|
47
|
+
"tracking-tight": !0,
|
|
48
|
+
[C.value ?? ""]: !0,
|
|
49
|
+
[T.value ?? ""]: !0,
|
|
50
|
+
[w.value ?? ""]: !0,
|
|
51
|
+
[x.value.root ?? ""]: !0
|
|
52
|
+
})))
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { h as useHeading };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { HTMLAttributes, Slot } from 'vue';
|
|
2
|
+
import { TextColor, TextSize, TextVariant, TextWeight } from '@bridge-ui/core/Tokens';
|
|
3
|
+
import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
|
|
4
|
+
import { TextColorOverrides, TextSizeOverrides, TextVariantOverrides, TextWeightOverrides } from '../Text';
|
|
5
|
+
export interface HeadingClasses {
|
|
6
|
+
/**
|
|
7
|
+
* The classes to apply to the root.
|
|
8
|
+
*/
|
|
9
|
+
root?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface HeadingOwnProps {
|
|
12
|
+
/**
|
|
13
|
+
* The classes to apply to the heading.
|
|
14
|
+
*
|
|
15
|
+
* @default undefined
|
|
16
|
+
*/
|
|
17
|
+
classes?: HeadingClasses;
|
|
18
|
+
/**
|
|
19
|
+
* The color of the heading. Ignores `global.defaultColor`.
|
|
20
|
+
*
|
|
21
|
+
* @default "dark"
|
|
22
|
+
*/
|
|
23
|
+
color?: MergeProps<TextColor, TextColorOverrides>;
|
|
24
|
+
/**
|
|
25
|
+
* The heading level. Sets the element (`h1`–`h6`) and, when `size` is not
|
|
26
|
+
* set, the font size.
|
|
27
|
+
*
|
|
28
|
+
* @default 2
|
|
29
|
+
*/
|
|
30
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
31
|
+
/**
|
|
32
|
+
* The font size of the heading. When unset, it follows `level`.
|
|
33
|
+
*
|
|
34
|
+
* @default undefined
|
|
35
|
+
*/
|
|
36
|
+
size?: MergeProps<TextSize, TextSizeOverrides>;
|
|
37
|
+
/**
|
|
38
|
+
* The tone of the heading: `default` for main text, `muted` for secondary text.
|
|
39
|
+
*
|
|
40
|
+
* @default "default"
|
|
41
|
+
*/
|
|
42
|
+
variant?: MergeProps<TextVariant, TextVariantOverrides>;
|
|
43
|
+
/**
|
|
44
|
+
* The font weight of the heading.
|
|
45
|
+
*
|
|
46
|
+
* @default "semibold"
|
|
47
|
+
*/
|
|
48
|
+
weight?: MergeProps<TextWeight, TextWeightOverrides>;
|
|
49
|
+
}
|
|
50
|
+
export interface HeadingSlots {
|
|
51
|
+
/**
|
|
52
|
+
* The content of the heading.
|
|
53
|
+
*/
|
|
54
|
+
default?: Slot<undefined>;
|
|
55
|
+
}
|
|
56
|
+
export type HeadingProps = MergeHtmlProps<HeadingOwnProps, HTMLAttributes>;
|
|
@@ -1,12 +1,11 @@
|
|
|
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
3
|
import { resolveLinkAsProps as i } from "../../../Utils/linkAs.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { listboxOptionFromComposedItem as y } from "@bridge-ui/core/Domain";
|
|
4
|
+
import { LIST_INJECTION_KEY as a } from "../../List/listInjectionKey.js";
|
|
5
|
+
import { LISTBOX_INJECTION_KEY as o } from "../../Listbox/listboxInjectionKey.js";
|
|
6
|
+
import { computed as s, getCurrentInstance as c, inject as l, onBeforeUnmount as u, toValue as d, useAttrs as f, watch as p } from "vue";
|
|
7
|
+
import { get as m, isNil as h, isNull as g, omit as _ } from "es-toolkit/compat";
|
|
8
|
+
import { getListboxOptionId as v, listboxOptionFromComposedItem as y } from "@bridge-ui/core/Domain";
|
|
10
9
|
import { cn as b, splitComponentProps as x } from "@bridge-ui/core/Utils";
|
|
11
10
|
//#region src/Components/ListItem/composables/useListItem.ts
|
|
12
11
|
var S = [
|
|
@@ -30,7 +29,7 @@ var S = [
|
|
|
30
29
|
"selectedIcon"
|
|
31
30
|
];
|
|
32
31
|
function C(C, w, T) {
|
|
33
|
-
let E =
|
|
32
|
+
let E = f(), D = l(a, null), O = l(o, null), k = !h(O), A = s(() => x({
|
|
34
33
|
props: {
|
|
35
34
|
...E,
|
|
36
35
|
...C
|
|
@@ -40,33 +39,33 @@ function C(C, w, T) {
|
|
|
40
39
|
libDefaults: w,
|
|
41
40
|
componentName: "ListItem",
|
|
42
41
|
props: () => A.value.componentProps
|
|
43
|
-
}), N =
|
|
42
|
+
}), N = s(() => O ? d(O) : null), P = s(() => k ? y({
|
|
44
43
|
value: j.value.value,
|
|
45
44
|
primary: j.value.primary,
|
|
46
45
|
disabled: j.value.disabled,
|
|
47
46
|
secondary: j.value.secondary
|
|
48
47
|
}) : null), F;
|
|
49
|
-
|
|
48
|
+
p(() => {
|
|
50
49
|
let e = P.value;
|
|
51
50
|
return e ? `${String(e.value)}:${e.label}:${e.disabled}:${e.description ?? ""}` : null;
|
|
52
51
|
}, () => {
|
|
53
52
|
F?.(), F = void 0;
|
|
54
53
|
let e = P.value;
|
|
55
|
-
e && O && (F =
|
|
56
|
-
}, { immediate: !0 }),
|
|
54
|
+
e && O && (F = d(O).registerOption(e));
|
|
55
|
+
}, { immediate: !0 }), u(() => {
|
|
57
56
|
F?.();
|
|
58
57
|
});
|
|
59
|
-
let I =
|
|
58
|
+
let I = s(() => !h(P.value)), L = s(() => !P.value || !N.value ? !1 : N.value.isSelected(P.value.value)), R = s(() => !P.value || !N.value ? -1 : N.value.getOptionIndex(P.value.value)), z = s(() => !N.value || R.value < 0 ? !1 : N.value.highlightedIndex === R.value), B = s(() => j.value.customProps), V = r({
|
|
60
59
|
entry: M,
|
|
61
60
|
props: () => A.value.componentProps
|
|
62
|
-
}), H =
|
|
61
|
+
}), H = s(() => "dense" in (c()?.vnode.props ?? {}) ? C.dense === !0 : C.dense === !0 ? !0 : D ? d(D).dense : !1), U = s(() => e(T, "primary") || e(T, "default") || !!j.value.primary), W = s(() => e(T, "secondary") || !!j.value.secondary), G = s(() => I.value ? !L.value || !N.value?.showCheckmark ? null : "check" : !j.value.selected || g(j.value.selectedIcon) ? null : j.value.selectedIcon ?? "check"), K = s(() => e(T, "end") || G.value != null), q = s(() => _(A.value.inheritedAttrs, [])), J = s(() => t(B.value?.root, q.value, {
|
|
63
62
|
class: b({
|
|
64
63
|
"list-none": !0,
|
|
65
64
|
"border-b border-black/10 last:border-b-0 dark:border-white/10": j.value.divider,
|
|
66
|
-
[
|
|
65
|
+
[m(V.value, "root") ?? ""]: !0
|
|
67
66
|
}),
|
|
68
|
-
id: I.value && N.value?.listboxId && R.value >= 0 ?
|
|
69
|
-
})), Y =
|
|
67
|
+
id: I.value && N.value?.listboxId && R.value >= 0 ? v(N.value.listboxId, R.value) : void 0
|
|
68
|
+
})), Y = s(() => !!j.value.href && !I.value), X = s(() => !!(j.value.interactive || I.value || Y.value)), Z = s(() => Y.value ? j.value.disabled || j.value.linkAs == null ? "a" : j.value.linkAs : "div"), Q = s(() => {
|
|
70
69
|
if (!X.value) return null;
|
|
71
70
|
let e = t(B.value?.interactive, i(j.value.linkAs, j.value.linkProps, Z.value), {
|
|
72
71
|
"aria-disabled": j.value.disabled ? !0 : void 0,
|
|
@@ -99,7 +98,7 @@ function C(C, w, T) {
|
|
|
99
98
|
[N.value?.optionHighlightedClass ?? ""]: I.value && z.value && !L.value,
|
|
100
99
|
[N.value?.mergedClasses.optionHighlighted ?? ""]: I.value && z.value && !L.value,
|
|
101
100
|
"opacity-50 pointer-events-none": j.value.disabled,
|
|
102
|
-
[
|
|
101
|
+
[m(V.value, "interactive") ?? ""]: !0,
|
|
103
102
|
[N.value?.sizeClasses?.option ?? ""]: I.value
|
|
104
103
|
})
|
|
105
104
|
});
|
|
@@ -109,34 +108,34 @@ function C(C, w, T) {
|
|
|
109
108
|
href: void 0,
|
|
110
109
|
target: void 0
|
|
111
110
|
};
|
|
112
|
-
}), $ =
|
|
111
|
+
}), $ = s(() => b({
|
|
113
112
|
"flex w-full min-w-0 items-center gap-x-2": !0,
|
|
114
113
|
"rounded-md text-dark-900 dark:text-dark-100": !X.value,
|
|
115
114
|
"px-2": !X.value,
|
|
116
115
|
"py-1.5": !X.value && !H.value,
|
|
117
116
|
"py-1": !X.value && H.value
|
|
118
|
-
})), ee =
|
|
117
|
+
})), ee = s(() => t(B.value?.start, {}, b({
|
|
119
118
|
"flex shrink-0 items-center text-dark-600 dark:text-dark-300": !0,
|
|
120
|
-
[
|
|
121
|
-
}))), te =
|
|
119
|
+
[m(V.value, "start") ?? ""]: !0
|
|
120
|
+
}))), te = s(() => t(B.value?.content, {}, b({
|
|
122
121
|
"min-w-0 flex-1": !0,
|
|
123
|
-
[
|
|
124
|
-
}))), ne =
|
|
122
|
+
[m(V.value, "content") ?? ""]: !0
|
|
123
|
+
}))), ne = s(() => t(B.value?.primary, {}, b({
|
|
125
124
|
"block truncate text-sm font-medium": !0,
|
|
126
125
|
[N.value?.sizeClasses?.primary ?? ""]: I.value,
|
|
127
|
-
[
|
|
126
|
+
[m(V.value, "primary") ?? ""]: !0,
|
|
128
127
|
"leading-normal": !0
|
|
129
|
-
}))), re =
|
|
128
|
+
}))), re = s(() => t(B.value?.secondary, {}, b({
|
|
130
129
|
"mt-0.5 block truncate text-xs leading-normal text-dark-500 dark:text-dark-400": !0,
|
|
131
130
|
[N.value?.sizeClasses?.secondary ?? ""]: I.value,
|
|
132
|
-
[
|
|
131
|
+
[m(V.value, "secondary") ?? ""]: !0
|
|
133
132
|
})));
|
|
134
133
|
return {
|
|
135
134
|
merged: j,
|
|
136
135
|
hasEnd: K,
|
|
137
|
-
endBind:
|
|
136
|
+
endBind: s(() => t(B.value?.end, {}, b({
|
|
138
137
|
"ml-auto flex shrink-0 items-center": !0,
|
|
139
|
-
[
|
|
138
|
+
[m(V.value, "end") ?? ""]: !0
|
|
140
139
|
}))),
|
|
141
140
|
rootBind: J,
|
|
142
141
|
rowClass: $,
|
|
@@ -148,12 +147,12 @@ function C(C, w, T) {
|
|
|
148
147
|
secondaryBind: re,
|
|
149
148
|
interactiveTag: Z,
|
|
150
149
|
interactiveBind: Q,
|
|
151
|
-
selectedIconBind:
|
|
150
|
+
selectedIconBind: s(() => t(B.value?.selectedIcon, {}, {
|
|
152
151
|
...I.value ? {} : { size: "sm" },
|
|
153
152
|
class: b({
|
|
154
153
|
"block shrink-0": !0,
|
|
155
154
|
[N.value?.checkClass ?? ""]: I.value,
|
|
156
|
-
[
|
|
155
|
+
[m(V.value, "selectedIcon") ?? ""]: !0
|
|
157
156
|
})
|
|
158
157
|
})),
|
|
159
158
|
resolvedSelectedIcon: G
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
2
|
import { ListboxOption, ListboxValue } from '../listbox.types';
|
|
3
|
-
export declare function findFirstEnabledOptionIndex(options: ListboxOption[]): number;
|
|
4
|
-
export declare function findLastEnabledOptionIndex(options: ListboxOption[]): number;
|
|
5
|
-
export declare function moveListboxHighlight(options: ListboxOption[], currentIndex: number, delta: number): number;
|
|
6
|
-
export declare function getListboxOptionId(listboxId: string, index: number): string;
|
|
7
|
-
export declare function getListboxActiveDescendantId(listboxId: string, highlightedIndex: number): string | undefined;
|
|
8
3
|
export declare function useListboxNavigation(options: MaybeRefOrGetter<ListboxOption[]>, highlightedIndex: Ref<number>, listboxId: MaybeRefOrGetter<string>): {
|
|
9
4
|
moveHighlight: (delta: number) => void;
|
|
10
5
|
highlightLast: () => void;
|
|
@@ -1,62 +1,35 @@
|
|
|
1
1
|
import { computed as e, toValue as t } from "vue";
|
|
2
|
+
import { findFirstEnabledOptionIndex as n, findLastEnabledOptionIndex as r, findSelectedListboxOptionIndex as i, getListboxActiveDescendantId as a, moveListboxHighlight as o } from "@bridge-ui/core/Domain";
|
|
2
3
|
//#region src/Components/Listbox/composables/useListboxNavigation.ts
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (let t = e.length - 1; t >= 0; --t) if (!e[t]?.disabled) return t;
|
|
8
|
-
return -1;
|
|
9
|
-
}
|
|
10
|
-
function i(e, t, i) {
|
|
11
|
-
if (!e.length) return -1;
|
|
12
|
-
if (t < 0) return i > 0 ? n(e) : r(e);
|
|
13
|
-
let a = t;
|
|
14
|
-
for (let t = 0; t < e.length; t += 1) if (a = (a + i + e.length) % e.length, !e[a]?.disabled) return a;
|
|
15
|
-
return -1;
|
|
16
|
-
}
|
|
17
|
-
function a(e, t) {
|
|
18
|
-
return `${e}-option-${t}`;
|
|
19
|
-
}
|
|
20
|
-
function o(e, t) {
|
|
21
|
-
if (!(t < 0)) return a(e, t);
|
|
22
|
-
}
|
|
23
|
-
function s(a, s, c) {
|
|
24
|
-
let l = e(() => o(t(c), s.value));
|
|
25
|
-
function u() {
|
|
26
|
-
s.value = n(t(a));
|
|
27
|
-
}
|
|
28
|
-
function d(e) {
|
|
29
|
-
let n = t(a);
|
|
30
|
-
if (e) {
|
|
31
|
-
let t = n.findIndex((t) => !t.disabled && e(t.value));
|
|
32
|
-
if (t >= 0) {
|
|
33
|
-
s.value = t;
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
s.value = -1;
|
|
4
|
+
function s(s, c, l) {
|
|
5
|
+
let u = e(() => a(t(l), c.value));
|
|
6
|
+
function d() {
|
|
7
|
+
c.value = n(t(s));
|
|
38
8
|
}
|
|
39
|
-
function f() {
|
|
40
|
-
|
|
9
|
+
function f(e) {
|
|
10
|
+
c.value = i(t(s), e);
|
|
41
11
|
}
|
|
42
12
|
function p() {
|
|
43
|
-
|
|
13
|
+
c.value = n(t(s));
|
|
14
|
+
}
|
|
15
|
+
function m() {
|
|
16
|
+
c.value = r(t(s));
|
|
44
17
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
18
|
+
function h(e) {
|
|
19
|
+
c.value = o(t(s), c.value, e);
|
|
47
20
|
}
|
|
48
|
-
function
|
|
49
|
-
return t(
|
|
21
|
+
function g() {
|
|
22
|
+
return t(s)[c.value];
|
|
50
23
|
}
|
|
51
24
|
return {
|
|
52
|
-
moveHighlight:
|
|
53
|
-
highlightLast:
|
|
54
|
-
resetHighlight:
|
|
55
|
-
highlightFirst:
|
|
56
|
-
activeDescendantId:
|
|
57
|
-
getHighlightedOption:
|
|
58
|
-
highlightCurrentSelection:
|
|
25
|
+
moveHighlight: h,
|
|
26
|
+
highlightLast: m,
|
|
27
|
+
resetHighlight: d,
|
|
28
|
+
highlightFirst: p,
|
|
29
|
+
activeDescendantId: u,
|
|
30
|
+
getHighlightedOption: g,
|
|
31
|
+
highlightCurrentSelection: f
|
|
59
32
|
};
|
|
60
33
|
}
|
|
61
34
|
//#endregion
|
|
62
|
-
export {
|
|
35
|
+
export { s as useListboxNavigation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { useListbox } from './composables/useListbox';
|
|
2
|
-
export {
|
|
2
|
+
export { useListboxNavigation } from './composables/useListboxNavigation';
|
|
3
3
|
export type { ListboxClasses, ListboxColorOverrides, ListboxCustomProps, ListboxEmits, ListboxEntry, ListboxOption, ListboxOwnProps, ListboxProps, ListboxSlots, ListboxValue, } from './listbox.types';
|
|
4
4
|
export { default as Listbox } from './Listbox.vue';
|
|
5
5
|
export { LISTBOX_INJECTION_KEY, type ListboxContextValue, } from './listboxInjectionKey';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useListbox as
|
|
3
|
-
import { LISTBOX_INJECTION_KEY as
|
|
4
|
-
import
|
|
5
|
-
export {
|
|
1
|
+
import { useListboxNavigation as e } from "./composables/useListboxNavigation.js";
|
|
2
|
+
import { useListbox as t } from "./composables/useListbox.js";
|
|
3
|
+
import { LISTBOX_INJECTION_KEY as n } from "./listboxInjectionKey.js";
|
|
4
|
+
import r from "./Listbox.js";
|
|
5
|
+
export { n as LISTBOX_INJECTION_KEY, r as Listbox, t as useListbox, e as useListboxNavigation };
|
|
@@ -13,7 +13,7 @@ export declare function useResizablePanel(props: ResizablePanelOwnProps, libDefa
|
|
|
13
13
|
[x: string]: string;
|
|
14
14
|
};
|
|
15
15
|
class: string;
|
|
16
|
-
}, "class", {}, Omit<Omit<ResizablePanelProps, "classes" | "
|
|
16
|
+
}, "class", {}, Omit<Omit<ResizablePanelProps, "classes" | "maxSize" | "collapsedSize" | "collapsible" | "defaultSize" | "minSize">, "style">>>;
|
|
17
17
|
collapsed: import('vue').ComputedRef<boolean>;
|
|
18
18
|
elementRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
19
19
|
id: string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
|
|
2
2
|
import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
|
|
3
3
|
import { formFieldBridgeKeys as i, useFormField as a } from "../../FormField/composables/useFormField.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { computed as o, onBeforeUnmount as s, ref as c, useAttrs as l, useSlots as u, watch as d } from "vue";
|
|
5
|
+
import { get as f, isNil as p, omit as m } from "es-toolkit/compat";
|
|
6
|
+
import { DEFAULT_RICH_TEXT_TOOLS as h, RICH_TEXT_TOOL_ICONS as ee, RICH_TEXT_TOOL_LABELS as te, richTextValuesEqual as ne } from "@bridge-ui/core/Domain";
|
|
7
|
+
import { richTextEditorSizeProps as re } from "@bridge-ui/core/Tokens";
|
|
8
|
+
import { cn as g, mergeBridgeUILayeredClasses as _, splitComponentProps as v } from "@bridge-ui/core/Utils";
|
|
9
|
+
import { mountTiptapEditor as y } from "@bridge-ui/core/Integrations/Tiptap";
|
|
10
10
|
//#region src/Components/RichTextEditor/composables/useRichTextEditor.ts
|
|
11
|
-
var
|
|
11
|
+
var b = [
|
|
12
12
|
"tools",
|
|
13
13
|
"format",
|
|
14
14
|
"classes",
|
|
@@ -18,15 +18,15 @@ var re = [
|
|
|
18
18
|
"defaultValue"
|
|
19
19
|
];
|
|
20
20
|
function x(x, S, ie, C) {
|
|
21
|
-
let w = l(), T =
|
|
22
|
-
bridgeKeys:
|
|
21
|
+
let w = l(), T = u(), E = e(), D = c(""), O = c(0), k = c(null), A = c(null), j = c(null), M = o(() => v({
|
|
22
|
+
bridgeKeys: b,
|
|
23
23
|
props: {
|
|
24
24
|
...x,
|
|
25
25
|
...w
|
|
26
26
|
}
|
|
27
|
-
})), N = o(() => M.value.componentProps), P = o(() =>
|
|
27
|
+
})), N = o(() => M.value.componentProps), P = o(() => v({
|
|
28
28
|
bridgeKeys: i,
|
|
29
|
-
props:
|
|
29
|
+
props: m(M.value.inheritedAttrs, ["class", "onUpdate:modelValue"])
|
|
30
30
|
})), F = o(() => P.value.componentProps), I = o(() => P.value.inheritedAttrs), L = o(() => {
|
|
31
31
|
let { content: e, toolbar: t, toolbarButton: n, ...r } = N.value.customProps ?? {};
|
|
32
32
|
return r;
|
|
@@ -52,9 +52,9 @@ function x(x, S, ie, C) {
|
|
|
52
52
|
}), H = r({
|
|
53
53
|
entry: V,
|
|
54
54
|
props: () => z.value
|
|
55
|
-
}), U = o(() => B.value.format ?? "html"), W = o(() => [...N.value.tools ?? B.value.tools ??
|
|
56
|
-
let e =
|
|
57
|
-
return
|
|
55
|
+
}), U = o(() => B.value.format ?? "html"), W = o(() => [...N.value.tools ?? B.value.tools ?? h]), G = o(() => N.value.readOnly === !0 || F.value.readonly === !0), K = o(() => !(G.value || F.value.disabled === !0) && W.value.length > 0), q = o(() => {
|
|
56
|
+
let e = _(re, V.value?.tokens?.size);
|
|
57
|
+
return f(e, F.value.size ?? B.value.size ?? "md");
|
|
58
58
|
}), J = a(() => ({
|
|
59
59
|
...I.value,
|
|
60
60
|
...F.value,
|
|
@@ -86,7 +86,7 @@ function x(x, S, ie, C) {
|
|
|
86
86
|
}
|
|
87
87
|
function Q(e, t) {
|
|
88
88
|
let n = j.value;
|
|
89
|
-
if (!
|
|
89
|
+
if (!p(n)) {
|
|
90
90
|
if (e === "link") {
|
|
91
91
|
if (n.isActive("link")) {
|
|
92
92
|
n.run("link"), X(), Z();
|
|
@@ -101,26 +101,26 @@ function x(x, S, ie, C) {
|
|
|
101
101
|
}
|
|
102
102
|
let ce = o({
|
|
103
103
|
get() {
|
|
104
|
-
return !
|
|
104
|
+
return !p(A.value);
|
|
105
105
|
},
|
|
106
106
|
set(e) {
|
|
107
107
|
e || Z();
|
|
108
108
|
}
|
|
109
109
|
}), le = o(() => D.value.trim().length > 0), ue = o(() => E("URL"));
|
|
110
|
-
|
|
110
|
+
d(K, (e) => {
|
|
111
111
|
e || Z();
|
|
112
112
|
});
|
|
113
113
|
function $() {
|
|
114
114
|
j.value?.destroy(), j.value = null;
|
|
115
115
|
let e = k.value;
|
|
116
|
-
|
|
116
|
+
p(e) || (e.remove(), k.value = null);
|
|
117
117
|
}
|
|
118
118
|
function de() {
|
|
119
119
|
$();
|
|
120
120
|
let e = C.value;
|
|
121
|
-
if (
|
|
121
|
+
if (p(e)) return;
|
|
122
122
|
let t = document.createElement("div");
|
|
123
|
-
t.className = "flex min-h-0 min-w-0 w-full flex-1 flex-col outline-none", e.appendChild(t), k.value = t, j.value =
|
|
123
|
+
t.className = "flex min-h-0 min-w-0 w-full flex-1 flex-col outline-none", e.appendChild(t), k.value = t, j.value = y({
|
|
124
124
|
element: t,
|
|
125
125
|
value: S.value,
|
|
126
126
|
format: U.value,
|
|
@@ -138,16 +138,16 @@ function x(x, S, ie, C) {
|
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
d([U, C], () => {
|
|
142
142
|
de();
|
|
143
|
-
}, { flush: "post" }),
|
|
143
|
+
}, { flush: "post" }), d(() => S.value, (e) => {
|
|
144
144
|
let t = j.value;
|
|
145
|
-
|
|
146
|
-
}),
|
|
145
|
+
p(t) || e === void 0 || ne(t.getValue(), e) || t.setValue(e);
|
|
146
|
+
}), d(() => J.isDisabled.value, (e) => {
|
|
147
147
|
j.value?.setDisabled(e);
|
|
148
|
-
}),
|
|
148
|
+
}), d(G, (e) => {
|
|
149
149
|
j.value?.setReadOnly(e);
|
|
150
|
-
}),
|
|
150
|
+
}), d([
|
|
151
151
|
G,
|
|
152
152
|
() => N.value.placeholder,
|
|
153
153
|
() => J.controlId.value,
|
|
@@ -169,10 +169,10 @@ function x(x, S, ie, C) {
|
|
|
169
169
|
let fe = o(() => t(N.value.customProps?.toolbar, {
|
|
170
170
|
role: "toolbar",
|
|
171
171
|
"aria-label": E("Formatting")
|
|
172
|
-
},
|
|
172
|
+
}, g({
|
|
173
173
|
[q.value?.toolbar ?? ""]: !0,
|
|
174
174
|
[H.value.toolbar ?? ""]: !0
|
|
175
|
-
}))), pe = o(() => t(N.value.customProps?.content, {},
|
|
175
|
+
}))), pe = o(() => t(N.value.customProps?.content, {}, g({
|
|
176
176
|
"min-w-0 flex-1": !0,
|
|
177
177
|
[q.value?.content ?? ""]: !0,
|
|
178
178
|
[H.value.content ?? ""]: !0,
|
|
@@ -180,19 +180,19 @@ function x(x, S, ie, C) {
|
|
|
180
180
|
})));
|
|
181
181
|
function me(e) {
|
|
182
182
|
O.value;
|
|
183
|
-
let n = j.value, r = E(
|
|
183
|
+
let n = j.value, r = E(te[e]);
|
|
184
184
|
return t(R.value, {
|
|
185
185
|
type: "button",
|
|
186
186
|
density: "mini",
|
|
187
187
|
variant: "flat",
|
|
188
188
|
"aria-label": r,
|
|
189
189
|
color: ae.value,
|
|
190
|
-
icon:
|
|
190
|
+
icon: ee[e],
|
|
191
191
|
disabled: oe(e),
|
|
192
192
|
size: J.merged.value.size ?? "md",
|
|
193
193
|
selected: n?.isActive(e) ?? !1,
|
|
194
194
|
rounded: J.merged.value.rounded ?? "md"
|
|
195
|
-
},
|
|
195
|
+
}, g({
|
|
196
196
|
[q.value?.toolbarButton ?? ""]: !0,
|
|
197
197
|
[H.value.toolbarButton ?? ""]: !0
|
|
198
198
|
}));
|