@bridge-ui/vue 0.13.0 → 0.14.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-forms/SKILL.md +3 -3
- package/dist/Adapters/Examples/icon-fontawesome.js +22 -21
- package/dist/Adapters/Examples/icon-heroicons.js +13 -12
- package/dist/Adapters/Examples/icon-lucide.js +11 -10
- package/dist/Adapters/Examples/icon-phosphor.js +19 -18
- package/dist/Adapters/Examples/icon-tabler.js +10 -9
- package/dist/Adapters/Examples/rich-text-tiptap.js +34 -41
- package/dist/Components/BaseField/composables/useBaseField.d.ts +2 -2
- package/dist/Components/Calendar/Calendar.vue.d.ts +14 -6
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +78 -74
- package/dist/Components/Calendar/calendar.types.d.ts +12 -7
- package/dist/Components/Calendar/composables/useCalendar.d.ts +5 -9
- package/dist/Components/Calendar/composables/useCalendar.js +144 -143
- package/dist/Components/CalendarDate/CalendarDate.vue.d.ts +14 -6
- package/dist/Components/CalendarDate/CalendarDate.vue_vue_type_script_setup_true_lang.js +20 -16
- package/dist/Components/CalendarDate/calendarDate.types.d.ts +13 -8
- package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +4 -8
- package/dist/Components/CalendarDate/composables/useCalendarDate.js +105 -105
- package/dist/Components/CalendarMonth/CalendarMonth.vue.d.ts +9 -2
- package/dist/Components/CalendarMonth/CalendarMonth.vue_vue_type_script_setup_true_lang.js +19 -12
- package/dist/Components/CalendarMonth/calendarMonth.types.d.ts +14 -8
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +4 -7
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.js +92 -89
- package/dist/Components/CalendarRange/CalendarRange.vue.d.ts +14 -6
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +109 -105
- package/dist/Components/CalendarRange/calendarRange.types.d.ts +12 -7
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +5 -9
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +181 -154
- package/dist/Components/CalendarYear/CalendarYear.vue.d.ts +9 -2
- package/dist/Components/CalendarYear/CalendarYear.vue_vue_type_script_setup_true_lang.js +20 -13
- package/dist/Components/CalendarYear/calendarYear.types.d.ts +12 -6
- package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +4 -7
- package/dist/Components/CalendarYear/composables/useCalendarYear.js +91 -88
- package/dist/Components/Carousel/composables/useCarousel.js +117 -117
- package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +9 -2
- package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +48 -44
- package/dist/Components/ColorPicker/colorPicker.types.d.ts +12 -7
- package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +3 -3
- package/dist/Components/ColorPicker/composables/useColorPicker.js +150 -150
- package/dist/Components/DateField/DateField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DatePicker/DatePicker.vue.d.ts +12 -4
- package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +55 -51
- package/dist/Components/DatePicker/composables/useDatePicker.d.ts +3 -3
- package/dist/Components/DatePicker/composables/useDatePicker.js +52 -25
- package/dist/Components/DatePicker/datePicker.types.d.ts +12 -7
- package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateRangePicker/DateRangePicker.vue.d.ts +12 -4
- package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +54 -50
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +3 -3
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +26 -26
- package/dist/Components/DateRangePicker/dateRangePicker.types.d.ts +12 -7
- package/dist/Components/DateTimeField/DateTimeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateTimePicker/DateTimePicker.vue.d.ts +9 -2
- package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +82 -78
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +3 -3
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +64 -63
- package/dist/Components/DateTimePicker/dateTimePicker.types.d.ts +12 -7
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts +12 -4
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +110 -106
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +3 -3
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +71 -70
- package/dist/Components/DateTimeRangePicker/dateTimeRangePicker.types.d.ts +12 -7
- package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/FileUpload/fileUpload.types.d.ts +1 -1
- package/dist/Components/Rating/Rating.js +5 -0
- package/dist/Components/Rating/Rating.vue.d.ts +20 -0
- package/dist/Components/Rating/Rating.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/Components/Rating/composables/useRating.d.ts +112 -0
- package/dist/Components/Rating/composables/useRating.js +190 -0
- package/dist/Components/Rating/index.d.ts +4 -0
- package/dist/Components/Rating/index.js +3 -0
- package/dist/Components/Rating/rating.types.d.ts +107 -0
- package/dist/Components/Sidebar/composables/useSidebar.js +1 -1
- package/dist/Components/Slider/composables/useSlider.d.ts +1 -1
- package/dist/Components/TimeField/TimeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/TimePanel/TimePanel.vue.d.ts +10 -2
- package/dist/Components/TimePanel/TimePanel.vue_vue_type_script_setup_true_lang.js +37 -34
- package/dist/Components/TimePanel/composables/useTimePanel.d.ts +5 -5
- package/dist/Components/TimePanel/composables/useTimePanel.js +108 -109
- package/dist/Components/TimePanel/timePanel.types.d.ts +10 -4
- package/dist/Components/TimePicker/TimePicker.vue.d.ts +10 -2
- package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +46 -42
- package/dist/Components/TimePicker/composables/useTimePicker.d.ts +3 -3
- package/dist/Components/TimePicker/composables/useTimePicker.js +36 -36
- package/dist/Components/TimePicker/timePicker.types.d.ts +12 -7
- package/dist/Components/TimeRangeField/TimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue.d.ts +12 -4
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +72 -68
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +4 -4
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +87 -87
- package/dist/Components/TimeRangePicker/timeRangePicker.types.d.ts +12 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.js +69 -67
- package/docs/README.md +1 -0
- package/docs/components/BaseField.md +3 -3
- package/docs/components/Calendar.md +0 -1
- package/docs/components/CalendarDate.md +0 -1
- package/docs/components/CalendarMonth.md +0 -1
- package/docs/components/CalendarRange.md +0 -1
- package/docs/components/CalendarYear.md +0 -1
- package/docs/components/ColorPicker.md +13 -14
- package/docs/components/DatePicker.md +0 -1
- package/docs/components/DateRangePicker.md +0 -1
- package/docs/components/DateTimePicker.md +0 -1
- package/docs/components/DateTimeRangePicker.md +0 -1
- package/docs/components/Rating.md +86 -0
- package/docs/components/RichTextEditor.md +3 -3
- package/docs/components/TimePanel.md +0 -1
- package/docs/components/TimePicker.md +0 -1
- package/docs/components/TimeRangePicker.md +0 -1
- package/package.json +2 -12
|
@@ -1,13 +1,13 @@
|
|
|
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 { CAROUSEL_INJECTION_KEY as i } from "../carouselInjectionKey.js";
|
|
4
|
-
import { computed as a, onMounted as o, onScopeDispose as s, provide as c, ref as l, useAttrs as
|
|
5
|
-
import { get as f, omit as p } from "es-toolkit/compat";
|
|
6
|
-
import { canMoveCarousel as m, clampCarouselIndex as h, getAdjacentCarouselIndex as
|
|
7
|
-
import { carouselSizeProps as
|
|
8
|
-
import { cn as x, mergeBridgeUILayeredClasses as
|
|
4
|
+
import { computed as a, onMounted as o, onScopeDispose as s, provide as c, ref as l, useAttrs as ee, useId as te, watch as u } from "vue";
|
|
5
|
+
import { get as d, isFunction as f, omit as p } from "es-toolkit/compat";
|
|
6
|
+
import { canMoveCarousel as m, clampCarouselIndex as h, getAdjacentCarouselIndex as g, getCarouselMaxIndex as _, getCarouselSlideStyle as v, getCarouselTrackStyle as y, resolveCarouselAutoPlayInterval as b, resolveCarouselSwipeDirection as ne, shouldPauseCarouselAutoPlay as re } from "@bridge-ui/core/Domain";
|
|
7
|
+
import { carouselSizeProps as ie } from "@bridge-ui/core/Tokens";
|
|
8
|
+
import { cn as x, mergeBridgeUILayeredClasses as ae, splitComponentProps as oe } from "@bridge-ui/core/Utils";
|
|
9
9
|
//#region src/Components/Carousel/composables/useCarousel.ts
|
|
10
|
-
var
|
|
10
|
+
var se = [
|
|
11
11
|
"gap",
|
|
12
12
|
"loop",
|
|
13
13
|
"size",
|
|
@@ -18,33 +18,33 @@ var oe = [
|
|
|
18
18
|
"orientation",
|
|
19
19
|
"defaultIndex",
|
|
20
20
|
"slidesPerView"
|
|
21
|
-
],
|
|
21
|
+
], ce = [
|
|
22
22
|
"onBlur",
|
|
23
23
|
"onFocus",
|
|
24
24
|
"onKeydown",
|
|
25
25
|
"onMouseenter",
|
|
26
26
|
"onMouseleave"
|
|
27
|
-
],
|
|
27
|
+
], le = [
|
|
28
28
|
"onPointerup",
|
|
29
29
|
"onPointerdown",
|
|
30
30
|
"onPointercancel"
|
|
31
31
|
];
|
|
32
|
-
function
|
|
32
|
+
function S(e) {
|
|
33
33
|
if (!(e instanceof HTMLElement)) return !1;
|
|
34
34
|
if (e.isContentEditable) return !0;
|
|
35
35
|
let t = e.tagName;
|
|
36
36
|
return t === "INPUT" || t === "SELECT" || t === "TEXTAREA";
|
|
37
37
|
}
|
|
38
38
|
function C(e) {
|
|
39
|
-
return
|
|
39
|
+
return f(e) ? e : void 0;
|
|
40
40
|
}
|
|
41
41
|
function w(w, T, E) {
|
|
42
|
-
let D = e(),
|
|
42
|
+
let D = e(), ue = ee(), de = `bridge-carousel${te()}`, O = l([]), k = l(w.defaultIndex ?? T.defaultIndex ?? 0), A = l(!1), j = l(!1), M = l(!1), N = l(""), P = l(null), F = l(null), I = a(() => oe({
|
|
43
43
|
props: {
|
|
44
|
-
...
|
|
44
|
+
...ue,
|
|
45
45
|
...w
|
|
46
46
|
},
|
|
47
|
-
bridgeKeys:
|
|
47
|
+
bridgeKeys: se
|
|
48
48
|
})), { merged: L, entry: R } = n({
|
|
49
49
|
libDefaults: T,
|
|
50
50
|
componentName: "Carousel",
|
|
@@ -52,25 +52,25 @@ function w(w, T, E) {
|
|
|
52
52
|
}), z = a(() => {
|
|
53
53
|
let e = E.value ?? k.value, t = O.value.length;
|
|
54
54
|
if (t <= 0) return e;
|
|
55
|
-
let n =
|
|
55
|
+
let n = _(t, L.value.slidesPerView);
|
|
56
56
|
return h(e, n + 1);
|
|
57
57
|
}), B = r({
|
|
58
58
|
entry: R,
|
|
59
59
|
props: () => I.value.componentProps
|
|
60
|
-
}), V = a(() => ie
|
|
61
|
-
function
|
|
60
|
+
}), V = a(() => ae(ie, R.value?.tokens?.size)), H = a(() => d(V.value, L.value.size)), U = a(() => d(H.value, "icon") ?? "sm");
|
|
61
|
+
function fe(e) {
|
|
62
62
|
return O.value.includes(e) || (O.value = [...O.value, e]), () => {
|
|
63
63
|
O.value = O.value.filter((t) => t !== e);
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function pe(e) {
|
|
67
67
|
return O.value.indexOf(e);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
let t = O.value.length, n = t <= 0 ? null :
|
|
69
|
+
function W(e) {
|
|
70
|
+
let t = O.value.length, n = t <= 0 ? null : _(t, L.value.slidesPerView), r = n == null ? e : h(e, n + 1);
|
|
71
71
|
r !== z.value && (E.value === void 0 && (k.value = r), E.value = r);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function G(e) {
|
|
74
74
|
let t = O.value.length, n = {
|
|
75
75
|
loop: L.value.loop === !0,
|
|
76
76
|
count: t,
|
|
@@ -78,17 +78,17 @@ function w(w, T, E) {
|
|
|
78
78
|
slidesPerView: L.value.slidesPerView,
|
|
79
79
|
index: z.value
|
|
80
80
|
};
|
|
81
|
-
m(n) &&
|
|
81
|
+
m(n) && W(g(n));
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
83
|
+
function K(e) {
|
|
84
|
+
W(e);
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
u(() => ({
|
|
87
87
|
count: O.value.length,
|
|
88
88
|
slidesPerView: L.value.slidesPerView
|
|
89
89
|
}), ({ count: e }) => {
|
|
90
|
-
e <= 0 || E.value !== void 0 || (k.value = h(k.value,
|
|
91
|
-
}), P.value = z.value,
|
|
90
|
+
e <= 0 || E.value !== void 0 || (k.value = h(k.value, _(e, L.value.slidesPerView) + 1));
|
|
91
|
+
}), P.value = z.value, u(z, (e) => {
|
|
92
92
|
if (e === P.value) return;
|
|
93
93
|
P.value = e;
|
|
94
94
|
let t = O.value.length;
|
|
@@ -97,7 +97,7 @@ function w(w, T, E) {
|
|
|
97
97
|
index: e + 1
|
|
98
98
|
}));
|
|
99
99
|
}), o(() => {
|
|
100
|
-
if (
|
|
100
|
+
if (!f(window.matchMedia)) return;
|
|
101
101
|
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => {
|
|
102
102
|
M.value = e.matches;
|
|
103
103
|
};
|
|
@@ -105,11 +105,11 @@ function w(w, T, E) {
|
|
|
105
105
|
e.removeEventListener("change", t);
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
|
-
let
|
|
109
|
-
function
|
|
110
|
-
|
|
108
|
+
let q;
|
|
109
|
+
function J() {
|
|
110
|
+
q !== void 0 && (window.clearInterval(q), q = void 0);
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
u(() => [
|
|
113
113
|
A.value,
|
|
114
114
|
j.value,
|
|
115
115
|
L.value.loop,
|
|
@@ -117,46 +117,46 @@ function w(w, T, E) {
|
|
|
117
117
|
M.value,
|
|
118
118
|
O.value.length
|
|
119
119
|
], () => {
|
|
120
|
-
|
|
121
|
-
let e =
|
|
122
|
-
e == null ||
|
|
120
|
+
J();
|
|
121
|
+
let e = b(L.value.autoPlay);
|
|
122
|
+
e == null || re({
|
|
123
123
|
focused: j.value,
|
|
124
124
|
hovered: A.value,
|
|
125
125
|
reducedMotion: M.value
|
|
126
|
-
}) || (
|
|
127
|
-
|
|
126
|
+
}) || (q = window.setInterval(() => {
|
|
127
|
+
G(1);
|
|
128
128
|
}, e));
|
|
129
|
-
}, { immediate: !0 }), s(
|
|
130
|
-
let
|
|
129
|
+
}, { immediate: !0 }), s(J);
|
|
130
|
+
let Y = a(() => {
|
|
131
131
|
let e = O.value.length;
|
|
132
|
-
return e <= 0 ? 0 :
|
|
133
|
-
}),
|
|
132
|
+
return e <= 0 ? 0 : _(e, L.value.slidesPerView) + 1;
|
|
133
|
+
}), X = a(() => Y.value > 1), me = a(() => L.value.indicators !== !1 && Y.value > 1), Z = a(() => L.value.orientation === "vertical"), Q = a(() => !Z.value && I.value.inheritedAttrs.dir === "rtl"), he = a(() => Z.value ? "ArrowUp" : Q.value ? "ArrowRight" : "ArrowLeft"), ge = a(() => Z.value ? "ArrowDown" : Q.value ? "ArrowLeft" : "ArrowRight"), _e = a(() => !m({
|
|
134
134
|
direction: -1,
|
|
135
135
|
index: z.value,
|
|
136
136
|
count: O.value.length,
|
|
137
137
|
loop: L.value.loop === !0,
|
|
138
138
|
slidesPerView: L.value.slidesPerView
|
|
139
|
-
})),
|
|
139
|
+
})), ve = a(() => !m({
|
|
140
140
|
direction: 1,
|
|
141
141
|
index: z.value,
|
|
142
142
|
count: O.value.length,
|
|
143
143
|
loop: L.value.loop === !0,
|
|
144
144
|
slidesPerView: L.value.slidesPerView
|
|
145
|
-
})),
|
|
146
|
-
getIndex:
|
|
147
|
-
registerSlide:
|
|
148
|
-
id:
|
|
145
|
+
})), ye = a(() => Array.from({ length: Y.value }, (e, t) => t)), be = a(() => ({
|
|
146
|
+
getIndex: pe,
|
|
147
|
+
registerSlide: fe,
|
|
148
|
+
id: de,
|
|
149
149
|
sizeItem: H.value,
|
|
150
150
|
activeIndex: z.value,
|
|
151
151
|
slideCount: O.value.length,
|
|
152
152
|
slidesPerView: L.value.slidesPerView,
|
|
153
153
|
slidePartProps: L.value.customProps?.slide,
|
|
154
|
-
slideClassName:
|
|
155
|
-
slideStyle:
|
|
154
|
+
slideClassName: d(B.value, "slide") ?? "",
|
|
155
|
+
slideStyle: v(L.value.slidesPerView, L.value.gap, L.value.orientation)
|
|
156
156
|
}));
|
|
157
|
-
c(i,
|
|
158
|
-
let
|
|
159
|
-
let e = C(I.value.inheritedAttrs.onBlur), n = C(I.value.inheritedAttrs.onFocus), r = C(I.value.inheritedAttrs.onKeydown), i = C(I.value.inheritedAttrs.onMouseenter), a = C(I.value.inheritedAttrs.onMouseleave), o = p(I.value.inheritedAttrs, [...
|
|
157
|
+
c(i, be);
|
|
158
|
+
let xe = a(() => {
|
|
159
|
+
let e = C(I.value.inheritedAttrs.onBlur), n = C(I.value.inheritedAttrs.onFocus), r = C(I.value.inheritedAttrs.onKeydown), i = C(I.value.inheritedAttrs.onMouseenter), a = C(I.value.inheritedAttrs.onMouseleave), o = p(I.value.inheritedAttrs, [...ce]);
|
|
160
160
|
return t(L.value.customProps?.root, o, {
|
|
161
161
|
role: "region",
|
|
162
162
|
"aria-roledescription": "carousel",
|
|
@@ -172,28 +172,28 @@ function w(w, T, E) {
|
|
|
172
172
|
},
|
|
173
173
|
"aria-label": I.value.inheritedAttrs["aria-label"] ?? D("Carousel"),
|
|
174
174
|
class: x({
|
|
175
|
-
[
|
|
176
|
-
[
|
|
175
|
+
[d(H.value, "root") ?? ""]: !0,
|
|
176
|
+
[d(B.value, "root") ?? ""]: !0
|
|
177
177
|
}),
|
|
178
178
|
onBlur: (t) => {
|
|
179
179
|
let n = t.relatedTarget, r = t.currentTarget;
|
|
180
180
|
(!(n instanceof Node) || !(r instanceof Node) || !r.contains(n)) && (j.value = !1), e?.(t);
|
|
181
181
|
},
|
|
182
182
|
onKeydown: (e) => {
|
|
183
|
-
|
|
183
|
+
S(e.target) || (e.key === ge.value ? (e.preventDefault(), G(1)) : e.key === he.value ? (e.preventDefault(), G(-1)) : e.key === "Home" ? (e.preventDefault(), K(0)) : e.key === "End" && (e.preventDefault(), K(_(O.value.length, L.value.slidesPerView)))), r?.(e);
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
|
-
}),
|
|
186
|
+
}), Se = a(() => {
|
|
187
187
|
let e = L.value.customProps?.viewport, n = C(e?.onPointerup), r = C(e?.onPointerdown), i = C(e?.onPointercancel);
|
|
188
|
-
return t(p(e, [...
|
|
188
|
+
return t(p(e, [...le]), {}, {
|
|
189
189
|
"data-part": "viewport",
|
|
190
190
|
onPointercancel: (e) => {
|
|
191
191
|
F.value = null, i?.(e);
|
|
192
192
|
},
|
|
193
193
|
class: x({
|
|
194
|
-
[
|
|
195
|
-
[
|
|
196
|
-
[
|
|
194
|
+
[d(H.value, "viewport") ?? ""]: !0,
|
|
195
|
+
[d(B.value, "viewport") ?? ""]: !0,
|
|
196
|
+
[d(H.value, "viewportVertical") ?? ""]: Z.value
|
|
197
197
|
}),
|
|
198
198
|
onPointerdown: (e) => {
|
|
199
199
|
(e.pointerType !== "mouse" || e.button === 0) && (F.value = {
|
|
@@ -205,126 +205,126 @@ function w(w, T, E) {
|
|
|
205
205
|
onPointerup: (e) => {
|
|
206
206
|
let t = F.value;
|
|
207
207
|
if (F.value = null, t && t.pointerId === e.pointerId) {
|
|
208
|
-
let n =
|
|
209
|
-
rtl:
|
|
208
|
+
let n = ne(e.clientX - t.x, e.clientY - t.y, {
|
|
209
|
+
rtl: Q.value,
|
|
210
210
|
orientation: L.value.orientation
|
|
211
211
|
});
|
|
212
|
-
n &&
|
|
212
|
+
n && G(n);
|
|
213
213
|
}
|
|
214
214
|
n?.(e);
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
|
-
}),
|
|
217
|
+
}), $ = a(() => t(L.value.customProps?.track, {}, {
|
|
218
218
|
"data-part": "track",
|
|
219
219
|
class: x({
|
|
220
|
-
[
|
|
221
|
-
[
|
|
222
|
-
[
|
|
220
|
+
[d(H.value, "track") ?? ""]: !0,
|
|
221
|
+
[d(B.value, "track") ?? ""]: !0,
|
|
222
|
+
[d(H.value, "trackVertical") ?? ""]: Z.value
|
|
223
223
|
}),
|
|
224
|
-
style:
|
|
225
|
-
rtl:
|
|
224
|
+
style: y(z.value, {
|
|
225
|
+
rtl: Q.value,
|
|
226
226
|
gap: L.value.gap,
|
|
227
227
|
count: O.value.length,
|
|
228
228
|
orientation: L.value.orientation,
|
|
229
229
|
slidesPerView: L.value.slidesPerView
|
|
230
230
|
})
|
|
231
|
-
})),
|
|
231
|
+
})), Ce = a(() => t(L.value.customProps?.controls, {}, {
|
|
232
232
|
"data-part": "controls",
|
|
233
233
|
class: x({
|
|
234
|
-
[
|
|
235
|
-
[
|
|
236
|
-
[
|
|
234
|
+
[d(H.value, "controls") ?? ""]: !0,
|
|
235
|
+
[d(B.value, "controls") ?? ""]: !0,
|
|
236
|
+
[d(H.value, "controlsVertical") ?? ""]: Z.value
|
|
237
237
|
})
|
|
238
|
-
})),
|
|
238
|
+
})), we = a(() => X.value ? Z.value ? d(H.value, "frameVertical") ?? "relative" : d(H.value, "frame") ?? "relative" : "relative"), Te = a(() => t(L.value.customProps?.prev, {}, {
|
|
239
239
|
"data-part": "prev",
|
|
240
240
|
type: "button",
|
|
241
|
-
disabled:
|
|
241
|
+
disabled: _e.value,
|
|
242
242
|
onClick: () => {
|
|
243
|
-
|
|
243
|
+
G(-1);
|
|
244
244
|
},
|
|
245
245
|
"aria-label": D("Previous slide"),
|
|
246
246
|
class: x({
|
|
247
|
-
[
|
|
248
|
-
[
|
|
249
|
-
[
|
|
247
|
+
[d(H.value, "control") ?? ""]: !0,
|
|
248
|
+
[d(B.value, "prev") ?? ""]: !0,
|
|
249
|
+
[d(B.value, "control") ?? ""]: !0
|
|
250
250
|
})
|
|
251
|
-
})),
|
|
251
|
+
})), Ee = a(() => t(L.value.customProps?.next, {}, {
|
|
252
252
|
"data-part": "next",
|
|
253
253
|
type: "button",
|
|
254
|
-
disabled:
|
|
254
|
+
disabled: ve.value,
|
|
255
255
|
"aria-label": D("Next slide"),
|
|
256
256
|
onClick: () => {
|
|
257
|
-
|
|
257
|
+
G(1);
|
|
258
258
|
},
|
|
259
259
|
class: x({
|
|
260
|
-
[
|
|
261
|
-
[
|
|
262
|
-
[
|
|
260
|
+
[d(H.value, "control") ?? ""]: !0,
|
|
261
|
+
[d(B.value, "next") ?? ""]: !0,
|
|
262
|
+
[d(B.value, "control") ?? ""]: !0
|
|
263
263
|
})
|
|
264
|
-
})),
|
|
264
|
+
})), De = a(() => t(L.value.customProps?.prevIcon, {}, {
|
|
265
265
|
"aria-hidden": !0,
|
|
266
266
|
size: U.value,
|
|
267
|
-
class:
|
|
268
|
-
})),
|
|
267
|
+
class: Z.value ? void 0 : "rtl:rotate-180"
|
|
268
|
+
})), Oe = a(() => t(L.value.customProps?.nextIcon, {}, {
|
|
269
269
|
"aria-hidden": !0,
|
|
270
270
|
size: U.value,
|
|
271
|
-
class:
|
|
272
|
-
})),
|
|
271
|
+
class: Z.value ? void 0 : "rtl:rotate-180"
|
|
272
|
+
})), ke = a(() => t(L.value.customProps?.indicators, {}, {
|
|
273
273
|
role: "group",
|
|
274
274
|
"data-part": "indicators",
|
|
275
275
|
"aria-label": D("Slides"),
|
|
276
276
|
class: x({
|
|
277
|
-
[
|
|
278
|
-
[
|
|
277
|
+
[d(H.value, "indicators") ?? ""]: !0,
|
|
278
|
+
[d(B.value, "indicators") ?? ""]: !0
|
|
279
279
|
})
|
|
280
|
-
})),
|
|
280
|
+
})), Ae = a(() => t(L.value.customProps?.live, {}, {
|
|
281
281
|
"aria-atomic": !0,
|
|
282
282
|
"data-part": "live",
|
|
283
283
|
"aria-live": "polite",
|
|
284
284
|
class: x({
|
|
285
|
-
[
|
|
286
|
-
[
|
|
285
|
+
[d(H.value, "live") ?? ""]: !0,
|
|
286
|
+
[d(B.value, "live") ?? ""]: !0
|
|
287
287
|
})
|
|
288
288
|
}));
|
|
289
|
-
function
|
|
289
|
+
function je(e) {
|
|
290
290
|
let n = e === z.value;
|
|
291
291
|
return t(L.value.customProps?.indicator, {}, {
|
|
292
292
|
type: "button",
|
|
293
293
|
"data-part": "indicator",
|
|
294
294
|
"aria-current": n ? "true" : void 0,
|
|
295
295
|
onClick: () => {
|
|
296
|
-
|
|
296
|
+
K(e);
|
|
297
297
|
},
|
|
298
298
|
"aria-label": D("Go to slide {{index}}", { index: e + 1 }),
|
|
299
299
|
class: x({
|
|
300
|
-
[
|
|
301
|
-
[
|
|
302
|
-
[
|
|
300
|
+
[d(H.value, "indicator") ?? ""]: !0,
|
|
301
|
+
[d(H.value, "indicatorSelected") ?? ""]: n,
|
|
302
|
+
[d(B.value, "indicator") ?? ""]: !0
|
|
303
303
|
})
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
|
-
let
|
|
306
|
+
let Me = a(() => Z.value ? "chevronUp" : "chevronLeft");
|
|
307
307
|
return {
|
|
308
|
-
go:
|
|
309
|
-
liveBind:
|
|
310
|
-
nextBind:
|
|
311
|
-
nextIcon: a(() =>
|
|
312
|
-
prevBind:
|
|
313
|
-
prevIcon:
|
|
314
|
-
rootBind:
|
|
315
|
-
trackBind:
|
|
308
|
+
go: G,
|
|
309
|
+
liveBind: Ae,
|
|
310
|
+
nextBind: Ee,
|
|
311
|
+
nextIcon: a(() => Z.value ? "chevronDown" : "chevronRight"),
|
|
312
|
+
prevBind: Te,
|
|
313
|
+
prevIcon: Me,
|
|
314
|
+
rootBind: xe,
|
|
315
|
+
trackBind: $,
|
|
316
316
|
activeIndex: z,
|
|
317
|
-
controlsBind:
|
|
318
|
-
nextIconBind:
|
|
319
|
-
prevIconBind:
|
|
320
|
-
showControls:
|
|
321
|
-
viewportBind:
|
|
317
|
+
controlsBind: Ce,
|
|
318
|
+
nextIconBind: Oe,
|
|
319
|
+
prevIconBind: De,
|
|
320
|
+
showControls: X,
|
|
321
|
+
viewportBind: Se,
|
|
322
322
|
announcement: N,
|
|
323
|
-
frameClassName:
|
|
324
|
-
indicatorsBind:
|
|
325
|
-
showIndicators:
|
|
326
|
-
getIndicatorBind:
|
|
327
|
-
indicatorIndexes:
|
|
323
|
+
frameClassName: we,
|
|
324
|
+
indicatorsBind: ke,
|
|
325
|
+
showIndicators: me,
|
|
326
|
+
getIndicatorBind: je,
|
|
327
|
+
indicatorIndexes: ye
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
330
|
//#endregion
|
|
@@ -102,9 +102,9 @@ var A = { class: "flex min-w-0 flex-1 items-center gap-2" }, j = ["aria-label"],
|
|
|
102
102
|
default: D(() => [m(T(c), {
|
|
103
103
|
fill: T(z),
|
|
104
104
|
format: T(B),
|
|
105
|
-
value: T(q),
|
|
106
105
|
class: y(T(X)),
|
|
107
106
|
alpha: T(V).alpha,
|
|
107
|
+
"model-value": T(q),
|
|
108
108
|
"show-footer": T(J),
|
|
109
109
|
"read-only": F.readonly,
|
|
110
110
|
swatches: T(V).swatches,
|
|
@@ -120,9 +120,9 @@ var A = { class: "flex min-w-0 flex-1 items-center gap-2" }, j = ["aria-label"],
|
|
|
120
120
|
} : void 0]), 1032, [
|
|
121
121
|
"fill",
|
|
122
122
|
"format",
|
|
123
|
-
"value",
|
|
124
123
|
"class",
|
|
125
124
|
"alpha",
|
|
125
|
+
"model-value",
|
|
126
126
|
"show-footer",
|
|
127
127
|
"read-only",
|
|
128
128
|
"swatches",
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { ColorPickerOwnProps, ColorPickerSlots } from './colorPicker.types';
|
|
2
2
|
type __VLS_Slots = ColorPickerSlots;
|
|
3
|
-
|
|
3
|
+
type __VLS_Props = ColorPickerOwnProps;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: null | string;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
9
|
apply: () => any;
|
|
5
10
|
cancel: () => any;
|
|
6
11
|
change: (value: string | null) => any;
|
|
7
|
-
|
|
12
|
+
"update:modelValue": (...args: unknown[]) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
8
14
|
onApply?: (() => any) | undefined;
|
|
9
15
|
onCancel?: (() => any) | undefined;
|
|
10
16
|
onChange?: ((value: string | null) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
11
18
|
}>, {
|
|
12
19
|
showFooter: boolean;
|
|
13
20
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useOptionalModel as e } from "../../Utils/useOptionalModel.js";
|
|
2
|
+
import t from "../ActionFooter/ActionFooter.js";
|
|
3
|
+
import { useColorPicker as n } from "./composables/useColorPicker.js";
|
|
4
|
+
import { Fragment as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, mergeModels as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, useModel as x } from "vue";
|
|
5
|
+
import { cn as S } from "@bridge-ui/core/Utils";
|
|
5
6
|
//#region src/Components/ColorPicker/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var C = { class: "min-w-0 truncate text-sm text-dark-700 dark:text-dark-100" }, w = [
|
|
7
8
|
"aria-label",
|
|
8
9
|
"onClick",
|
|
9
10
|
"aria-pressed",
|
|
10
11
|
"disabled"
|
|
11
|
-
],
|
|
12
|
+
], T = /*@__PURE__*/ c({
|
|
12
13
|
inheritAttrs: !1,
|
|
13
14
|
__name: "ColorPicker",
|
|
14
|
-
props: {
|
|
15
|
+
props: /*@__PURE__*/ u({
|
|
15
16
|
alpha: { type: Boolean },
|
|
16
17
|
classes: {},
|
|
17
18
|
customProps: {},
|
|
@@ -25,68 +26,71 @@ var y = { class: "min-w-0 truncate text-sm text-dark-700 dark:text-dark-100" },
|
|
|
25
26
|
type: Boolean,
|
|
26
27
|
default: void 0
|
|
27
28
|
},
|
|
28
|
-
swatches: {}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
swatches: {}
|
|
30
|
+
}, {
|
|
31
|
+
modelValue: {},
|
|
32
|
+
modelModifiers: {}
|
|
33
|
+
}),
|
|
34
|
+
emits: /*@__PURE__*/ u([
|
|
32
35
|
"apply",
|
|
33
36
|
"cancel",
|
|
34
|
-
"change"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
"change",
|
|
38
|
+
"update:modelValue"
|
|
39
|
+
], ["update:modelValue"]),
|
|
40
|
+
setup(c, { emit: u }) {
|
|
41
|
+
let T = x(c, "modelValue"), E = u, D = c, O = g(D.defaultValue ?? null), k = e(T, O), { merged: A, hueBind: j, rootBind: M, areaBind: N, alphaBind: P, showAlpha: F, swatchCss: I, footerBind: ee, showFooter: L, previewBind: R, contentBind: z, handleApply: B, swatchesBind: V, handleCancel: H, hueThumbBind: U, areaThumbBind: W, alphaFillBind: G, formattedValue: K, alphaThumbBind: q, presetSwatches: J, applyButtonProps: Y, isSwatchSelected: X, previewSwatchBind: Z, handleSwatchClick: Q, swatchButtonClass: $, cancelButtonProps: te, swatchSelectedClass: ne, previewSwatchFillBind: re } = n(D, {
|
|
38
42
|
rounded: "md",
|
|
39
43
|
format: "hex"
|
|
40
|
-
},
|
|
41
|
-
return (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
}, k, E);
|
|
45
|
+
return (e, n) => (h(), a("div", p(l(b(M))), [o("div", { class: f(b(z)) }, [
|
|
46
|
+
o("div", p(l(b(N))), [
|
|
47
|
+
n[0] ||= o("span", {
|
|
44
48
|
"aria-hidden": "",
|
|
45
49
|
class: "pointer-events-none absolute inset-0",
|
|
46
50
|
style: { backgroundImage: "linear-gradient(to right, #fff, transparent)" }
|
|
47
51
|
}, null, -1),
|
|
48
|
-
|
|
52
|
+
n[1] ||= o("span", {
|
|
49
53
|
"aria-hidden": "",
|
|
50
54
|
class: "pointer-events-none absolute inset-0",
|
|
51
55
|
style: { backgroundImage: "linear-gradient(to top, #000, transparent)" }
|
|
52
56
|
}, null, -1),
|
|
53
|
-
|
|
57
|
+
o("span", p(l(b(W))), null, 16)
|
|
54
58
|
], 16),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
o("div", p(l(b(j))), [o("span", p(l(b(U))), null, 16)], 16),
|
|
60
|
+
b(F) ? (h(), a("div", p(d({ key: 0 }, b(P))), [o("span", p(l(b(G))), null, 16), o("span", p(l(b(q))), null, 16)], 16)) : i("", !0),
|
|
61
|
+
o("div", p(l(b(R))), [o("span", p(l(b(Z))), [o("span", p(l(b(re))), null, 16)], 16), o("span", C, y(b(K)), 1)], 16),
|
|
62
|
+
b(J).length > 0 ? (h(), a("div", p(d({ key: 1 }, b(V))), [(h(!0), a(r, null, _(b(J), (e) => (h(), a("button", {
|
|
59
63
|
type: "button",
|
|
60
64
|
key: e,
|
|
61
65
|
"aria-label": e,
|
|
62
|
-
onClick: (t) =>
|
|
63
|
-
"aria-pressed":
|
|
64
|
-
disabled:
|
|
65
|
-
class:
|
|
66
|
-
[
|
|
67
|
-
[
|
|
66
|
+
onClick: (t) => b(Q)(e),
|
|
67
|
+
"aria-pressed": b(X)(e),
|
|
68
|
+
disabled: b(A).disabled || b(A).readOnly,
|
|
69
|
+
class: f(b(S)({
|
|
70
|
+
[b($)]: !0,
|
|
71
|
+
[b(ne)]: b(X)(e)
|
|
68
72
|
}))
|
|
69
|
-
}, [
|
|
73
|
+
}, [o("span", {
|
|
70
74
|
"aria-hidden": "",
|
|
71
75
|
class: "absolute inset-0",
|
|
72
|
-
style:
|
|
73
|
-
}, null, 4)], 10,
|
|
74
|
-
], 2),
|
|
75
|
-
apply:
|
|
76
|
-
cancel:
|
|
77
|
-
}, () => [
|
|
78
|
-
onApply:
|
|
79
|
-
onCancel:
|
|
76
|
+
style: m({ backgroundColor: b(I)(e) })
|
|
77
|
+
}, null, 4)], 10, w))), 128))], 16)) : i("", !0)
|
|
78
|
+
], 2), b(L) ? (h(), a("div", p(d({ key: 0 }, b(ee))), [v(e.$slots, "footer", {
|
|
79
|
+
apply: b(B),
|
|
80
|
+
cancel: b(H)
|
|
81
|
+
}, () => [s(b(t), {
|
|
82
|
+
onApply: b(B),
|
|
83
|
+
onCancel: b(H),
|
|
80
84
|
"custom-props": {
|
|
81
|
-
applyButton:
|
|
82
|
-
cancelButton:
|
|
85
|
+
applyButton: b(Y),
|
|
86
|
+
cancelButton: b(te)
|
|
83
87
|
}
|
|
84
88
|
}, null, 8, [
|
|
85
89
|
"onApply",
|
|
86
90
|
"onCancel",
|
|
87
91
|
"custom-props"
|
|
88
|
-
])])], 16)) :
|
|
92
|
+
])])], 16)) : i("", !0)], 16));
|
|
89
93
|
}
|
|
90
94
|
});
|
|
91
95
|
//#endregion
|
|
92
|
-
export {
|
|
96
|
+
export { T as default };
|
|
@@ -103,6 +103,10 @@ export interface ColorPickerEmits {
|
|
|
103
103
|
* Emitted when Apply is pressed (`showFooter`) or when the value commits.
|
|
104
104
|
*/
|
|
105
105
|
change: [value: null | string];
|
|
106
|
+
/**
|
|
107
|
+
* Emitted when `v-model` should update.
|
|
108
|
+
*/
|
|
109
|
+
"update:modelValue": [value: null | string];
|
|
106
110
|
}
|
|
107
111
|
export interface ColorPickerOwnProps {
|
|
108
112
|
/**
|
|
@@ -181,12 +185,6 @@ export interface ColorPickerOwnProps {
|
|
|
181
185
|
* @default undefined
|
|
182
186
|
*/
|
|
183
187
|
swatches?: string[];
|
|
184
|
-
/**
|
|
185
|
-
* Controlled value.
|
|
186
|
-
*
|
|
187
|
-
* @default undefined
|
|
188
|
-
*/
|
|
189
|
-
value?: null | string;
|
|
190
188
|
}
|
|
191
189
|
export interface ColorPickerSlots {
|
|
192
190
|
/**
|
|
@@ -197,4 +195,11 @@ export interface ColorPickerSlots {
|
|
|
197
195
|
*/
|
|
198
196
|
footer?: Slot<FieldOverlayFooterSlotProps>;
|
|
199
197
|
}
|
|
200
|
-
export type ColorPickerProps = MergeHtmlProps<ColorPickerOwnProps, HTMLAttributes
|
|
198
|
+
export type ColorPickerProps = MergeHtmlProps<ColorPickerOwnProps, HTMLAttributes> & {
|
|
199
|
+
/**
|
|
200
|
+
* Bound with `v-model` on the component (`defineModel` internally).
|
|
201
|
+
*
|
|
202
|
+
* @default undefined
|
|
203
|
+
*/
|
|
204
|
+
modelValue?: null | string;
|
|
205
|
+
};
|