@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,13 +1,13 @@
|
|
|
1
1
|
import { useBridgeUI as e } from "../../../Provider/useBridgeUI.js";
|
|
2
2
|
import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
|
|
3
|
-
import { baseFieldBridgeKeys as i, useBaseField as
|
|
4
|
-
import { computed as
|
|
5
|
-
import { get as c,
|
|
6
|
-
import { getSliderBarGeometry as re, getSliderPointerClientX as
|
|
7
|
-
import { sliderColorProps as
|
|
8
|
-
import { cn as
|
|
3
|
+
import { baseFieldBridgeKeys as i, useBaseField as ee } from "../../BaseField/composables/useBaseField.js";
|
|
4
|
+
import { computed as a, ref as o, toValue as te, useAttrs as ne, watch as s } from "vue";
|
|
5
|
+
import { get as c, omit as l, pick as u } from "es-toolkit/compat";
|
|
6
|
+
import { getSliderBarGeometry as re, getSliderPointerClientX as d, isSliderStopCovered as f, normalizeSliderStops as ie, normalizeSliderValue as ae, percentFromSliderPointer as p, percentToValue as oe, readSliderThumbValue as m, resolveSliderBounds as se, resolveSliderKeyValue as ce, resolveSliderTrackPress as le, valueToPercent as h, writeSliderThumbValue as g } from "@bridge-ui/core/Domain";
|
|
7
|
+
import { sliderColorProps as ue, sliderRoundedProps as de, sliderSizeProps as _ } from "@bridge-ui/core/Tokens";
|
|
8
|
+
import { cn as v, getColorToken as y, mergeBridgeUILayeredClasses as b, splitComponentProps as x } from "@bridge-ui/core/Utils";
|
|
9
9
|
//#region src/Components/Slider/composables/useSlider.ts
|
|
10
|
-
var
|
|
10
|
+
var S = [
|
|
11
11
|
"max",
|
|
12
12
|
"min",
|
|
13
13
|
"step",
|
|
@@ -18,24 +18,15 @@ var x = [
|
|
|
18
18
|
"showStops",
|
|
19
19
|
"showTooltip",
|
|
20
20
|
"defaultValue"
|
|
21
|
-
],
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function w(e, t, n, r) {
|
|
26
|
-
return !r || !Array.isArray(e) ? {
|
|
27
|
-
thumbIndex: t,
|
|
28
|
-
value: n
|
|
29
|
-
} : v(e, t, n);
|
|
30
|
-
}
|
|
31
|
-
function T(v, T, E, me = {}) {
|
|
32
|
-
let he = te(), ge = e(), D = s(null), O = s(null), k = s(null), A = s(null), j = o(() => pe({
|
|
33
|
-
bridgeKeys: S,
|
|
21
|
+
], C = [...i, ...S];
|
|
22
|
+
function w(w, T, E, fe = {}) {
|
|
23
|
+
let pe = ne(), me = e(), D = o(null), O = o(null), k = o(null), A = o(null), j = a(() => x({
|
|
24
|
+
bridgeKeys: C,
|
|
34
25
|
props: {
|
|
35
|
-
...
|
|
36
|
-
...
|
|
26
|
+
...pe,
|
|
27
|
+
...te(w)
|
|
37
28
|
}
|
|
38
|
-
})),
|
|
29
|
+
})), he = a(() => u(j.value.componentProps, i)), M = ee(he, {
|
|
39
30
|
error: !1,
|
|
40
31
|
hideErrorMessage: !1,
|
|
41
32
|
size: T.size ?? "md"
|
|
@@ -47,107 +38,87 @@ function T(v, T, E, me = {}) {
|
|
|
47
38
|
chrome: "BaseField",
|
|
48
39
|
componentName: "Slider",
|
|
49
40
|
props: () => ({
|
|
50
|
-
...
|
|
41
|
+
...u(j.value.componentProps, S),
|
|
51
42
|
size: M.merged.value.size,
|
|
52
43
|
classes: j.value.componentProps.classes,
|
|
53
44
|
customProps: j.value.componentProps.customProps
|
|
54
45
|
})
|
|
55
|
-
}), F =
|
|
46
|
+
}), F = a(() => N.value.customProps), I = r({
|
|
56
47
|
entry: P,
|
|
57
48
|
props: () => j.value.componentProps
|
|
58
|
-
}), L =
|
|
49
|
+
}), L = a(() => se({
|
|
59
50
|
min: N.value.min,
|
|
60
51
|
max: N.value.max,
|
|
61
52
|
step: N.value.step
|
|
62
|
-
})), R =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return [n, n];
|
|
68
|
-
}
|
|
69
|
-
return h(Array.isArray(e) ? e[0] : l(e) ? e : t.min, t.min, t.max, t.step);
|
|
70
|
-
}), K = o(() => ae({
|
|
53
|
+
})), R = a(() => !!N.value.range), z = a(() => N.value.showTooltip !== !1), B = a(() => me?.global.value.direction === "rtl"), { controlId: V, isDisabled: H, isReadonly: U, invalidated: W, ariaDescribedBy: ge } = M, G = a(() => ae({
|
|
54
|
+
...L.value,
|
|
55
|
+
value: E.value,
|
|
56
|
+
range: R.value
|
|
57
|
+
})), K = a(() => ie({
|
|
71
58
|
min: L.value.min,
|
|
72
59
|
max: L.value.max,
|
|
73
60
|
step: L.value.step,
|
|
74
61
|
stops: N.value.stops,
|
|
75
62
|
showStops: N.value.showStops
|
|
76
|
-
})), q =
|
|
63
|
+
})), q = a(() => re({
|
|
77
64
|
range: R.value,
|
|
78
65
|
min: L.value.min,
|
|
79
66
|
max: L.value.max,
|
|
80
67
|
value: G.value
|
|
81
|
-
})), J =
|
|
82
|
-
let e = b(
|
|
83
|
-
return
|
|
68
|
+
})), J = a(() => {
|
|
69
|
+
let e = b(ue, P.value?.tokens?.color);
|
|
70
|
+
return y({
|
|
84
71
|
tokens: e,
|
|
85
72
|
color: N.value.color,
|
|
86
73
|
invalid: W.value
|
|
87
74
|
});
|
|
88
|
-
}), Y =
|
|
89
|
-
let e = b(
|
|
75
|
+
}), Y = a(() => {
|
|
76
|
+
let e = b(_, P.value?.tokens?.size);
|
|
90
77
|
return c(e, N.value.size ?? "md");
|
|
91
|
-
}), X =
|
|
92
|
-
let e = b(
|
|
78
|
+
}), X = a(() => {
|
|
79
|
+
let e = b(de, P.value?.tokens?.rounded);
|
|
93
80
|
return c(e, N.value.rounded ?? "full");
|
|
94
|
-
}),
|
|
95
|
-
E.value = e,
|
|
96
|
-
},
|
|
81
|
+
}), _e = a(() => K.value.some((e) => !!e.label)), Z = (e) => {
|
|
82
|
+
E.value = e, fe.onChange?.(e);
|
|
83
|
+
}, ve = (e) => {
|
|
97
84
|
D.value &&= { thumbIndex: e }, O.value !== null && (O.value = e);
|
|
98
|
-
},
|
|
85
|
+
}, ye = (e, t) => {
|
|
99
86
|
if (H.value || U.value) return;
|
|
100
|
-
let n = L.value, r =
|
|
101
|
-
i.thumbIndex !== e &&
|
|
87
|
+
let n = L.value, r = oe(t, n.min, n.max, n.step), i = g(G.value, e, r, R.value);
|
|
88
|
+
i.thumbIndex !== e && ve(i.thumbIndex), Z(i.value);
|
|
102
89
|
}, Q = (e, t) => {
|
|
103
90
|
H.value || U.value || (e.preventDefault(), D.value = { thumbIndex: t }, O.value = t);
|
|
104
|
-
},
|
|
91
|
+
}, be = (e) => {
|
|
105
92
|
if (H.value || U.value || e.target.closest("[data-bridge-slider-thumb]")) return;
|
|
106
93
|
let t = A.value?.getBoundingClientRect();
|
|
107
94
|
if (!t) return;
|
|
108
95
|
let n = p({
|
|
109
96
|
rect: t,
|
|
110
97
|
isRtl: B.value,
|
|
111
|
-
clientX:
|
|
112
|
-
}), r =
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
98
|
+
clientX: d(e)
|
|
99
|
+
}), r = le({
|
|
100
|
+
percent: n,
|
|
101
|
+
bounds: L.value,
|
|
102
|
+
range: R.value,
|
|
103
|
+
value: G.value
|
|
104
|
+
});
|
|
105
|
+
Z(r.value), Q(e, r.thumbIndex);
|
|
106
|
+
}, $ = (e) => (t) => {
|
|
117
107
|
Q(t, e);
|
|
118
|
-
},
|
|
108
|
+
}, xe = (e) => (t) => {
|
|
119
109
|
if (H.value || U.value) return;
|
|
120
|
-
let n =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
break;
|
|
128
|
-
case "ArrowUp":
|
|
129
|
-
i = g(r, 1, n.min, n.max, n.step);
|
|
130
|
-
break;
|
|
131
|
-
case "ArrowDown":
|
|
132
|
-
i = g(r, -1, n.min, n.max, n.step);
|
|
133
|
-
break;
|
|
134
|
-
case "Home":
|
|
135
|
-
i = n.min;
|
|
136
|
-
break;
|
|
137
|
-
case "End":
|
|
138
|
-
i = n.max;
|
|
139
|
-
break;
|
|
140
|
-
case "PageUp":
|
|
141
|
-
i = g(r, 1, n.min, n.max, n.step * 10);
|
|
142
|
-
break;
|
|
143
|
-
case "PageDown": i = g(r, -1, n.min, n.max, n.step * 10);
|
|
144
|
-
}
|
|
145
|
-
if (i === null) return;
|
|
110
|
+
let n = ce({
|
|
111
|
+
key: t.key,
|
|
112
|
+
isRtl: B.value,
|
|
113
|
+
bounds: L.value,
|
|
114
|
+
current: m(G.value, e, R.value)
|
|
115
|
+
});
|
|
116
|
+
if (n === null) return;
|
|
146
117
|
t.preventDefault();
|
|
147
|
-
let
|
|
148
|
-
Z(
|
|
118
|
+
let r = g(G.value, e, n, R.value);
|
|
119
|
+
Z(r.value), r.thumbIndex !== e && document.getElementById(`${V.value}-thumb-${r.thumbIndex}`)?.focus();
|
|
149
120
|
};
|
|
150
|
-
|
|
121
|
+
s(O, (e, t, n) => {
|
|
151
122
|
if (e === null) return;
|
|
152
123
|
let r = (e) => {
|
|
153
124
|
let t = A.value?.getBoundingClientRect();
|
|
@@ -155,9 +126,9 @@ function T(v, T, E, me = {}) {
|
|
|
155
126
|
let n = p({
|
|
156
127
|
rect: t,
|
|
157
128
|
isRtl: B.value,
|
|
158
|
-
clientX:
|
|
129
|
+
clientX: d(e)
|
|
159
130
|
});
|
|
160
|
-
|
|
131
|
+
ye(D.value.thumbIndex, n);
|
|
161
132
|
}, i = () => {
|
|
162
133
|
D.value = null, O.value = null;
|
|
163
134
|
};
|
|
@@ -165,10 +136,10 @@ function T(v, T, E, me = {}) {
|
|
|
165
136
|
window.removeEventListener("pointermove", r), window.removeEventListener("pointerup", i), window.removeEventListener("pointercancel", i);
|
|
166
137
|
});
|
|
167
138
|
});
|
|
168
|
-
let
|
|
169
|
-
...
|
|
170
|
-
onPointerdown:
|
|
171
|
-
}, {},
|
|
139
|
+
let Se = a(() => t({}, {}, v("relative w-full min-w-0 flex-1"))), Ce = a(() => t({
|
|
140
|
+
...l(F.value?.track ?? {}, ["style"]),
|
|
141
|
+
onPointerdown: be
|
|
142
|
+
}, {}, v({
|
|
172
143
|
"relative w-full select-none touch-none": !0,
|
|
173
144
|
"cursor-pointer": !H.value && !U.value,
|
|
174
145
|
"cursor-not-allowed": H.value,
|
|
@@ -176,21 +147,21 @@ function T(v, T, E, me = {}) {
|
|
|
176
147
|
[X.value ?? ""]: !0,
|
|
177
148
|
[J.value?.track ?? ""]: !0,
|
|
178
149
|
[I.value.track ?? ""]: !0
|
|
179
|
-
}))),
|
|
150
|
+
}))), we = a(() => t(l(F.value?.bar ?? {}, ["style"]), {
|
|
180
151
|
"aria-hidden": !0,
|
|
181
152
|
style: {
|
|
182
153
|
width: q.value.width,
|
|
183
154
|
insetInlineStart: q.value.start
|
|
184
155
|
}
|
|
185
|
-
},
|
|
156
|
+
}, v({
|
|
186
157
|
"absolute top-0 h-full": !0,
|
|
187
158
|
[X.value ?? ""]: !0,
|
|
188
159
|
[J.value?.bar ?? ""]: !0,
|
|
189
160
|
[I.value.bar ?? ""]: !0
|
|
190
|
-
}))),
|
|
191
|
-
let n =
|
|
161
|
+
}))), Te = (e) => {
|
|
162
|
+
let n = m(G.value, e, R.value), r = h(n, L.value.min, L.value.max), i = O.value === e;
|
|
192
163
|
return t({
|
|
193
|
-
...
|
|
164
|
+
...l(F.value?.thumb ?? {}, ["style"]),
|
|
194
165
|
role: "slider",
|
|
195
166
|
type: "button",
|
|
196
167
|
"aria-valuenow": n,
|
|
@@ -200,13 +171,13 @@ function T(v, T, E, me = {}) {
|
|
|
200
171
|
"data-bridge-slider-thumb": e,
|
|
201
172
|
disabled: H.value || void 0,
|
|
202
173
|
"aria-orientation": "horizontal",
|
|
203
|
-
"aria-describedby":
|
|
204
|
-
onKeydown:
|
|
174
|
+
"aria-describedby": ge.value,
|
|
175
|
+
onKeydown: xe(e),
|
|
205
176
|
id: `${V.value}-thumb-${e}`,
|
|
206
177
|
"aria-disabled": H.value || void 0,
|
|
207
178
|
"aria-readonly": U.value || void 0,
|
|
208
179
|
"aria-invalid": W.value || void 0,
|
|
209
|
-
onPointerdown:
|
|
180
|
+
onPointerdown: $(e),
|
|
210
181
|
style: { insetInlineStart: `${r}%` },
|
|
211
182
|
onFocus: () => {
|
|
212
183
|
k.value = e;
|
|
@@ -221,7 +192,7 @@ function T(v, T, E, me = {}) {
|
|
|
221
192
|
O.value !== e && (k.value = k.value === e ? null : k.value);
|
|
222
193
|
},
|
|
223
194
|
"aria-label": F.value?.thumb?.["aria-label"] ?? (R.value ? e === 0 ? "Minimum" : "Maximum" : M.merged.value.label || "Slider")
|
|
224
|
-
}, {},
|
|
195
|
+
}, {}, v({
|
|
225
196
|
"group/thumb absolute z-10 flex -translate-x-1/2 items-center justify-center bg-transparent leading-none outline-none": !0,
|
|
226
197
|
"cursor-grab": !H.value && !U.value,
|
|
227
198
|
"cursor-grabbing": i,
|
|
@@ -229,9 +200,9 @@ function T(v, T, E, me = {}) {
|
|
|
229
200
|
[Y.value?.thumb ?? ""]: !0,
|
|
230
201
|
[I.value.thumb ?? ""]: !0
|
|
231
202
|
}));
|
|
232
|
-
},
|
|
203
|
+
}, Ee = (e) => {
|
|
233
204
|
let n = O.value === e;
|
|
234
|
-
return t(F.value?.thumbKnob, { "aria-hidden": !0 },
|
|
205
|
+
return t(F.value?.thumbKnob, { "aria-hidden": !0 }, v({
|
|
235
206
|
"block rounded-full border-2 shadow-sm transition-transform duration-100": !0,
|
|
236
207
|
"group-focus-visible/thumb:ring-2 group-focus-visible/thumb:ring-offset-2": !0,
|
|
237
208
|
"scale-120": n,
|
|
@@ -240,59 +211,59 @@ function T(v, T, E, me = {}) {
|
|
|
240
211
|
[J.value?.thumb ?? ""]: !0,
|
|
241
212
|
[I.value.thumbKnob ?? ""]: !0
|
|
242
213
|
}));
|
|
243
|
-
},
|
|
244
|
-
let n =
|
|
214
|
+
}, De = (e) => {
|
|
215
|
+
let n = h(e.value, L.value.min, L.value.max), r = f({
|
|
245
216
|
range: R.value,
|
|
246
217
|
min: L.value.min,
|
|
247
218
|
max: L.value.max,
|
|
248
219
|
stopValue: e.value,
|
|
249
220
|
value: G.value
|
|
250
221
|
});
|
|
251
|
-
return t(
|
|
222
|
+
return t(l(F.value?.stop ?? {}, ["style"]), {
|
|
252
223
|
"aria-hidden": !0,
|
|
253
224
|
style: {
|
|
254
225
|
insetInlineStart: `${n}%`,
|
|
255
226
|
display: r ? "none" : void 0
|
|
256
227
|
}
|
|
257
|
-
},
|
|
228
|
+
}, v({
|
|
258
229
|
"absolute top-1/2 h-2 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white dark:bg-dark-400": !0,
|
|
259
230
|
[I.value.stop ?? ""]: !0
|
|
260
231
|
}));
|
|
261
|
-
},
|
|
232
|
+
}, Oe = a(() => t(F.value?.stopLabels, { "aria-hidden": !0 }, v({
|
|
262
233
|
"relative h-[1lh] w-full text-xs": !0,
|
|
263
234
|
[I.value.stopLabels ?? ""]: !0
|
|
264
235
|
})));
|
|
265
236
|
return {
|
|
266
237
|
bounds: L,
|
|
267
238
|
merged: N,
|
|
268
|
-
barBind:
|
|
239
|
+
barBind: we,
|
|
269
240
|
isRange: R,
|
|
270
241
|
trackRef: A,
|
|
271
242
|
baseField: M,
|
|
272
|
-
trackBind:
|
|
273
|
-
controlBind:
|
|
243
|
+
trackBind: Ce,
|
|
244
|
+
controlBind: Se,
|
|
274
245
|
showTooltip: z,
|
|
275
|
-
getStopBind:
|
|
276
|
-
thumbIndexes:
|
|
277
|
-
getThumbBind:
|
|
246
|
+
getStopBind: De,
|
|
247
|
+
thumbIndexes: a(() => R.value ? [0, 1] : [0]),
|
|
248
|
+
getThumbBind: Te,
|
|
278
249
|
resolvedStops: K,
|
|
279
250
|
resolvedValue: G,
|
|
280
251
|
isTooltipOpen: (e) => z.value && (O.value === e || k.value === e),
|
|
281
|
-
hasStopLabels:
|
|
282
|
-
stopLabelsBind:
|
|
252
|
+
hasStopLabels: _e,
|
|
253
|
+
stopLabelsBind: Oe,
|
|
283
254
|
getStopLabelBind: (e) => {
|
|
284
|
-
let n =
|
|
285
|
-
return t(
|
|
255
|
+
let n = h(e.value, L.value.min, L.value.max);
|
|
256
|
+
return t(l(F.value?.stopLabel ?? {}, ["style"]), { style: { insetInlineStart: `${n}%` } }, v({
|
|
286
257
|
"absolute top-0 -translate-x-1/2 whitespace-nowrap": !0,
|
|
287
258
|
"text-dark-700 dark:text-dark-400": !W.value,
|
|
288
259
|
"text-error-600 dark:text-error-400": W.value,
|
|
289
260
|
[I.value.stopLabel ?? ""]: !0
|
|
290
261
|
}));
|
|
291
262
|
},
|
|
292
|
-
getThumbKnobBind:
|
|
293
|
-
tooltipProps:
|
|
294
|
-
readThumbValue: (e) =>
|
|
263
|
+
getThumbKnobBind: Ee,
|
|
264
|
+
tooltipProps: a(() => F.value?.tooltip),
|
|
265
|
+
readThumbValue: (e) => m(G.value, e, R.value)
|
|
295
266
|
};
|
|
296
267
|
}
|
|
297
268
|
//#endregion
|
|
298
|
-
export {
|
|
269
|
+
export { C as sliderBridgeKeys, w as useSlider };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TextOwnProps, TextSlots } from './text.types';
|
|
2
|
+
type __VLS_Slots = TextSlots;
|
|
3
|
+
declare const __VLS_base: import('vue').DefineComponent<TextOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TextOwnProps> & 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,33 @@
|
|
|
1
|
+
import { useText as e } from "./composables/useText.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/Text/Text.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var u = /*@__PURE__*/ n({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "Text",
|
|
7
|
+
props: {
|
|
8
|
+
as: {},
|
|
9
|
+
classes: {},
|
|
10
|
+
color: {},
|
|
11
|
+
numeric: { type: Boolean },
|
|
12
|
+
size: {},
|
|
13
|
+
truncate: { type: Boolean },
|
|
14
|
+
uppercase: { type: Boolean },
|
|
15
|
+
variant: {},
|
|
16
|
+
weight: {}
|
|
17
|
+
},
|
|
18
|
+
setup(n) {
|
|
19
|
+
let { merged: u, rootBind: d } = e(n, {
|
|
20
|
+
as: "p",
|
|
21
|
+
size: "md",
|
|
22
|
+
color: "dark",
|
|
23
|
+
weight: "normal",
|
|
24
|
+
variant: "default"
|
|
25
|
+
});
|
|
26
|
+
return (e, n) => (a(), t(s(c(u).as), i(r(c(d))), {
|
|
27
|
+
default: l(() => [o(e.$slots, "default")]),
|
|
28
|
+
_: 3
|
|
29
|
+
}, 16));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { u as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
|
|
2
|
+
import { TextOwnProps, TextProps } from '../text.types';
|
|
3
|
+
type TextLibDefaults = LibDefaultsShape<TextOwnProps, "as" | "size" | "color" | "weight" | "variant">;
|
|
4
|
+
type TextMerged = MergeLibDefaults<TextOwnProps, TextLibDefaults>;
|
|
5
|
+
export declare function useText(props: TextOwnProps, libDefaults: TextLibDefaults): {
|
|
6
|
+
merged: import('vue').ComputedRef<TextMerged>;
|
|
7
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, Omit<TextProps, "color" | "size" | "classes" | "as" | "variant" | "numeric" | "truncate" | "weight" | "uppercase">>>;
|
|
8
|
+
};
|
|
9
|
+
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 } from "es-toolkit/compat";
|
|
4
|
+
import { textSizeProps as o, textVariantProps as s, textWeightProps as c } from "@bridge-ui/core/Tokens";
|
|
5
|
+
import { cn as l, mergeBridgeUILayeredClasses as u, splitComponentProps as d } from "@bridge-ui/core/Utils";
|
|
6
|
+
//#region src/Components/Text/composables/useText.ts
|
|
7
|
+
var f = [
|
|
8
|
+
"as",
|
|
9
|
+
"size",
|
|
10
|
+
"color",
|
|
11
|
+
"weight",
|
|
12
|
+
"classes",
|
|
13
|
+
"numeric",
|
|
14
|
+
"variant",
|
|
15
|
+
"truncate",
|
|
16
|
+
"uppercase"
|
|
17
|
+
];
|
|
18
|
+
function p(p, m) {
|
|
19
|
+
let h = i(), g = r(() => d({
|
|
20
|
+
bridgeKeys: f,
|
|
21
|
+
props: {
|
|
22
|
+
...h,
|
|
23
|
+
...p
|
|
24
|
+
}
|
|
25
|
+
})), { merged: _, entry: v } = t({
|
|
26
|
+
libDefaults: m,
|
|
27
|
+
componentName: "Text",
|
|
28
|
+
props: () => g.value.componentProps
|
|
29
|
+
}), y = n({
|
|
30
|
+
entry: v,
|
|
31
|
+
props: () => g.value.componentProps
|
|
32
|
+
}), b = r(() => {
|
|
33
|
+
let e = u(o, v.value?.tokens?.size);
|
|
34
|
+
return a(e, _.value.size);
|
|
35
|
+
}), x = r(() => {
|
|
36
|
+
let e = u(s, v.value?.tokens?.variant);
|
|
37
|
+
return a(e, [_.value.variant, _.value.color]);
|
|
38
|
+
}), S = r(() => {
|
|
39
|
+
let e = u(c, v.value?.tokens?.weight);
|
|
40
|
+
return a(e, _.value.weight);
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
merged: _,
|
|
44
|
+
rootBind: r(() => e({}, g.value.inheritedAttrs, l({
|
|
45
|
+
[b.value ?? ""]: !0,
|
|
46
|
+
[S.value ?? ""]: !0,
|
|
47
|
+
[x.value ?? ""]: !0,
|
|
48
|
+
truncate: _.value.truncate === !0,
|
|
49
|
+
"tabular-nums tracking-tight": _.value.numeric === !0,
|
|
50
|
+
"uppercase tracking-wider": _.value.uppercase === !0,
|
|
51
|
+
[y.value.root ?? ""]: !0
|
|
52
|
+
})))
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { p as useText };
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
export interface TextSizeOverrides {}
|
|
5
|
+
export interface TextColorOverrides {}
|
|
6
|
+
export interface TextWeightOverrides {}
|
|
7
|
+
export interface TextVariantOverrides {}
|
|
8
|
+
export interface TextClasses {
|
|
9
|
+
/**
|
|
10
|
+
* The classes to apply to the root.
|
|
11
|
+
*/
|
|
12
|
+
root?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TextOwnProps {
|
|
15
|
+
/**
|
|
16
|
+
* The element rendered as the root.
|
|
17
|
+
*
|
|
18
|
+
* @default "p"
|
|
19
|
+
*/
|
|
20
|
+
as?: "p" | "dd" | "dt" | "em" | "li" | "div" | "span" | "label" | "small" | "strong" | "figcaption";
|
|
21
|
+
/**
|
|
22
|
+
* The classes to apply to the text.
|
|
23
|
+
*
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
classes?: TextClasses;
|
|
27
|
+
/**
|
|
28
|
+
* The color of the text. Ignores `global.defaultColor`.
|
|
29
|
+
*
|
|
30
|
+
* @default "dark"
|
|
31
|
+
*/
|
|
32
|
+
color?: MergeProps<TextColor, TextColorOverrides>;
|
|
33
|
+
/**
|
|
34
|
+
* Whether digits use tabular figures and tight tracking (money, counts).
|
|
35
|
+
*
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
numeric?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The size of the text.
|
|
41
|
+
*
|
|
42
|
+
* @default "md"
|
|
43
|
+
*/
|
|
44
|
+
size?: MergeProps<TextSize, TextSizeOverrides>;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the text is cut to one line with an ellipsis.
|
|
47
|
+
*
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
truncate?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the text is uppercase with wide tracking (small labels).
|
|
53
|
+
*
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
uppercase?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The tone of the text: `default` for main text, `muted` for secondary text.
|
|
59
|
+
*
|
|
60
|
+
* @default "default"
|
|
61
|
+
*/
|
|
62
|
+
variant?: MergeProps<TextVariant, TextVariantOverrides>;
|
|
63
|
+
/**
|
|
64
|
+
* The font weight of the text.
|
|
65
|
+
*
|
|
66
|
+
* @default "normal"
|
|
67
|
+
*/
|
|
68
|
+
weight?: MergeProps<TextWeight, TextWeightOverrides>;
|
|
69
|
+
}
|
|
70
|
+
export interface TextSlots {
|
|
71
|
+
/**
|
|
72
|
+
* The content of the text.
|
|
73
|
+
*/
|
|
74
|
+
default?: Slot<undefined>;
|
|
75
|
+
}
|
|
76
|
+
export type TextProps = MergeHtmlProps<TextOwnProps, HTMLAttributes>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, Slot } from 'vue';
|
|
2
|
+
import { ChartColorRange } from '@bridge-ui/core/Domain';
|
|
2
3
|
import { ChartColor, ChartSize } from '@bridge-ui/core/Tokens';
|
|
3
4
|
import { MergeProps } from '@bridge-ui/core/Utils';
|
|
4
5
|
export interface ChartSizeOverrides {}
|
|
@@ -8,6 +9,11 @@ export interface ChartColorOverrides {}
|
|
|
8
9
|
* color (`"#6366f1"`, `"rgb(0 0 0)"`, `"var(--brand)"`).
|
|
9
10
|
*/
|
|
10
11
|
export type ChartColorValue = (string & {}) | MergeProps<ChartColor, ChartColorOverrides>;
|
|
12
|
+
/**
|
|
13
|
+
* Bar colors per category: `true` takes palette entries in category order,
|
|
14
|
+
* an array follows the category order, and a record maps category labels.
|
|
15
|
+
*/
|
|
16
|
+
export type ChartCategoryColors = boolean | ChartColorValue[] | Record<string, ChartColorValue>;
|
|
11
17
|
export interface ChartClasses {
|
|
12
18
|
/**
|
|
13
19
|
* Classes merged onto the center content (`ChartPie` donut hole).
|
|
@@ -34,6 +40,17 @@ export interface ChartClasses {
|
|
|
34
40
|
*/
|
|
35
41
|
table?: string;
|
|
36
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* One color range: values in `[min, max)` take `color` (token key or CSS
|
|
45
|
+
* color). With `colorBy="category"`, `min` and `max` are category indices
|
|
46
|
+
* and both ends are included.
|
|
47
|
+
*/
|
|
48
|
+
export interface ChartColorRangeOption extends Omit<ChartColorRange, "color"> {
|
|
49
|
+
/**
|
|
50
|
+
* Range color.
|
|
51
|
+
*/
|
|
52
|
+
color: ChartColorValue;
|
|
53
|
+
}
|
|
37
54
|
export interface ChartCustomProps {
|
|
38
55
|
/**
|
|
39
56
|
* Props forwarded to the plot area (`role="img"`, keyboard target).
|
|
@@ -12,7 +12,7 @@ export type ChartLegendPosition = "top" | "left" | "right" | "bottom";
|
|
|
12
12
|
* Series registered by `ChartLineSeries`. Unset options fall back to the
|
|
13
13
|
* `ChartLine` props.
|
|
14
14
|
*/
|
|
15
|
-
export type ChartLineSeriesRegistration = Pick<ChartLineSeriesEntry, "id" | "data" | "kind" | "name" | "color"> & Partial<Pick<ChartLineSeriesEntry, "area" | "step" | "curve" | "stack" | "dashed" | "labels" | "showPoints">> & {
|
|
15
|
+
export type ChartLineSeriesRegistration = Pick<ChartLineSeriesEntry, "id" | "data" | "kind" | "name" | "color"> & Partial<Pick<ChartLineSeriesEntry, "area" | "step" | "curve" | "stack" | "dashed" | "labels" | "colorBy" | "showPoints" | "areaOpacity" | "colorRanges">> & {
|
|
16
16
|
/**
|
|
17
17
|
* Reference lines.
|
|
18
18
|
*/
|
|
@@ -22,7 +22,7 @@ export type ChartLineSeriesRegistration = Pick<ChartLineSeriesEntry, "id" | "dat
|
|
|
22
22
|
* Series registered by `ChartBarSeries`. Unset options fall back to the
|
|
23
23
|
* `ChartBar` props.
|
|
24
24
|
*/
|
|
25
|
-
export type ChartBarSeriesRegistration = Pick<ChartBarSeriesEntry, "id" | "data" | "kind" | "name" | "color"> & Partial<Pick<ChartBarSeriesEntry, "stack" | "labels">> & {
|
|
25
|
+
export type ChartBarSeriesRegistration = Pick<ChartBarSeriesEntry, "id" | "data" | "kind" | "name" | "color"> & Partial<Pick<ChartBarSeriesEntry, "tone" | "stack" | "labels" | "colorBy" | "colorRanges">> & {
|
|
26
26
|
/**
|
|
27
27
|
* Reference lines.
|
|
28
28
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ChartClasses, ChartColorOverrides, ChartColorValue, ChartCustomProps, ChartRootOwnProps, ChartSizeOverrides, ChartSlots, } from './chart.types';
|
|
1
|
+
export type { ChartCategoryColors, ChartClasses, ChartColorOverrides, ChartColorRangeOption, ChartColorValue, ChartCustomProps, ChartRootOwnProps, ChartSizeOverrides, ChartSlots, } from './chart.types';
|
|
2
2
|
export { default as ChartFrame } from './ChartFrame.vue';
|
|
3
3
|
export { CHART_INJECTION_KEY, useChartContext, type ChartBarSeriesRegistration, type ChartContextValue, type ChartFamily, type ChartLegendItem, type ChartLegendPosition, type ChartLineSeriesRegistration, type ChartScatterSeriesRegistration, type ChartSeriesRegistration, } from './chartInjectionKey';
|
|
4
4
|
export { useChartRegistry } from './useChartRegistry';
|