@bridge-ui/vue 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/skills/bridge-ui-components/SKILL.md +2 -2
- package/dist/Components/Alert/alertDefaultIcons.js +1 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +1 -1
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +150 -145
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Button/button.types.d.ts +6 -0
- package/dist/Components/Button/composables/useButton.d.ts +4 -1
- package/dist/Components/Button/composables/useButton.js +88 -69
- package/dist/Components/ButtonGroup/ButtonGroup.js +5 -0
- package/dist/Components/ButtonGroup/ButtonGroup.vue.d.ts +14 -0
- package/dist/Components/ButtonGroup/ButtonGroup.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/Components/ButtonGroup/buttonGroup.types.d.ts +93 -0
- package/dist/Components/ButtonGroup/buttonGroupInjectionKey.d.ts +7 -0
- package/dist/Components/ButtonGroup/buttonGroupInjectionKey.js +4 -0
- package/dist/Components/ButtonGroup/composables/useButtonGroup.d.ts +16 -0
- package/dist/Components/ButtonGroup/composables/useButtonGroup.js +66 -0
- package/dist/Components/ButtonGroup/index.d.ts +4 -0
- package/dist/Components/ButtonGroup/index.js +4 -0
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Checkbox/composables/useCheckbox.js +1 -1
- package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +90 -90
- package/dist/Components/DataTable/DataTableColumnsMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/DataTable/DataTableFilterMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/DataTable/DataTableFilterOptions.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/DataTable/DataTableSortButton.vue.d.ts +5 -11
- package/dist/Components/DataTable/DataTableSortButton.vue_vue_type_script_setup_true_lang.js +22 -26
- package/dist/Components/DataTable/composables/useDataTable.d.ts +0 -3
- package/dist/Components/DataTable/composables/useDataTable.js +199 -213
- package/dist/Components/FieldOverlay/composables/useFieldOverlay.js +4 -1
- package/dist/Components/List/composables/useList.js +1 -1
- package/dist/Components/ListItem/ListItem.vue.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.d.ts +2 -2
- package/dist/Components/ListItem/composables/useListItem.js +101 -86
- package/dist/Components/ListSection/composables/useListSection.js +34 -31
- package/dist/Components/ListSection/listSection.types.d.ts +2 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +82 -82
- package/dist/Components/Listbox/collectComposedListboxOptions.d.ts +5 -0
- package/dist/Components/Listbox/collectComposedListboxOptions.js +27 -0
- package/dist/Components/Radio/composables/useRadio.js +2 -1
- package/dist/Components/Select/composables/useSelect.d.ts +1 -1
- package/dist/Components/Select/composables/useSelect.js +104 -99
- package/dist/Components/Sidebar/SidebarTrigger.vue_vue_type_script_setup_true_lang.js +16 -15
- package/dist/Components/Sidebar/composables/useSidebarListItem.js +29 -28
- package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +2 -0
- package/dist/Components/Sidebar/composables/useSidebarTrigger.js +16 -13
- package/dist/Components/Slider/composables/useSlider.js +53 -53
- package/dist/Components/Snackbar/snackbarDefaultIcons.js +1 -0
- package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/Components/TimePanel/composables/useTimePanel.js +106 -106
- package/dist/augments.d.ts +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +150 -147
- package/docs/README.md +1 -0
- package/docs/components/Badge.md +2 -0
- package/docs/components/Button.md +5 -1
- package/docs/components/ButtonGroup.md +124 -0
- package/docs/components/DataTable.md +5 -1
- package/docs/components/Divider.md +1 -0
- package/docs/components/ToggleGroup.md +1 -1
- package/docs/examples/i18n-dictionary.ts +3 -0
- package/docs/examples/icon-fontawesome.ts +2 -0
- package/docs/examples/icon-heroicons.ts +2 -0
- package/docs/examples/icon-lucide.ts +2 -0
- package/docs/examples/icon-phosphor.ts +2 -0
- package/docs/examples/icon-tabler.ts +2 -0
- package/package.json +2 -2
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { useResolveMessage as e } from "../../Adapters/I18n/useI18nAdapter.js";
|
|
2
2
|
import { hasNamedSlot as t } from "../../Utils/slotOrProp.js";
|
|
3
3
|
import { mergeNestedComponentProps as n } from "../../Utils/index.js";
|
|
4
|
-
import { useListbox as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { LISTBOX_INJECTION_KEY as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { Fragment as
|
|
4
|
+
import { useListbox as r } from "./composables/useListbox.js";
|
|
5
|
+
import i from "../Button/Button.js";
|
|
6
|
+
import a from "../FieldOverlay/FieldOverlay.js";
|
|
7
|
+
import o from "../List/List.js";
|
|
8
|
+
import { LISTBOX_INJECTION_KEY as ee } from "./listboxInjectionKey.js";
|
|
9
|
+
import te from "../ListItem/ListItem.js";
|
|
10
|
+
import ne from "../ListSection/ListSection.js";
|
|
11
|
+
import s from "../Progress/Progress.js";
|
|
12
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as re, createTextVNode as m, createVNode as h, defineComponent as g, guardReactiveProps as _, mergeModels as v, mergeProps as y, normalizeClass as b, normalizeProps as x, openBlock as S, provide as ie, ref as ae, renderList as oe, renderSlot as C, toDisplayString as w, unref as T, useModel as E, useSlots as se, watch as D, withCtx as O } from "vue";
|
|
13
13
|
import { isNil as ce } from "es-toolkit/compat";
|
|
14
|
-
import { entriesFromListboxOptions as le, flattenListboxOptions as ue, mapListboxEntriesToRows as de } from "@bridge-ui/core/Domain";
|
|
15
|
-
import { cn as
|
|
14
|
+
import { entriesFromListboxOptions as le, flattenListboxOptions as ue, mapListboxEntriesToRows as de, upsertListboxOption as k } from "@bridge-ui/core/Domain";
|
|
15
|
+
import { cn as A } from "@bridge-ui/core/Utils";
|
|
16
16
|
//#region src/Components/Listbox/Listbox.vue?vue&type=script&setup=true&lang.ts
|
|
17
|
-
var
|
|
17
|
+
var j = { key: 1 }, M = /*@__PURE__*/ g({
|
|
18
18
|
__name: "Listbox",
|
|
19
|
-
props: /*@__PURE__*/
|
|
19
|
+
props: /*@__PURE__*/ v({
|
|
20
20
|
anchorEl: {},
|
|
21
21
|
classes: {},
|
|
22
22
|
color: { default: "primary" },
|
|
@@ -67,114 +67,114 @@ var A = { key: 1 }, j = /*@__PURE__*/ h({
|
|
|
67
67
|
},
|
|
68
68
|
modelModifiers: {}
|
|
69
69
|
}),
|
|
70
|
-
emits: /*@__PURE__*/
|
|
70
|
+
emits: /*@__PURE__*/ v([
|
|
71
71
|
"apply",
|
|
72
72
|
"cancel",
|
|
73
73
|
"registered-options-change",
|
|
74
74
|
"select",
|
|
75
75
|
"show-change"
|
|
76
76
|
], ["update:modelValue"]),
|
|
77
|
-
setup(
|
|
78
|
-
let
|
|
79
|
-
D(
|
|
80
|
-
|
|
77
|
+
setup(g, { emit: v }) {
|
|
78
|
+
let M = se(), N = v, P = E(g, "modelValue");
|
|
79
|
+
D(P, (e) => {
|
|
80
|
+
N("show-change", e);
|
|
81
81
|
});
|
|
82
|
-
let
|
|
82
|
+
let F = g, I = e(), L = l(() => F.emptyMessage ?? I("No options")), R = l(() => F.loadingMessage ?? I("Loading...")), { merged: z, checkClass: B, scrollBind: V, footerBind: H, showFooter: fe, applyLabel: pe, cancelLabel: me, messageBind: U, surfaceBind: he, sizeClasses: ge, mergedClasses: W, applyButtonProps: _e, optionHoverClass: ve, cancelButtonProps: ye, optionSelectedClass: be, optionHighlightedClass: xe } = r(F, {
|
|
83
83
|
size: "md",
|
|
84
84
|
color: "primary"
|
|
85
|
-
}),
|
|
85
|
+
}), Se = l(() => F.options ?? []), G = l(() => F.entries ? F.entries : le(Se.value)), K = l(() => ue(G.value)), q = l(() => t(M, "default")), J = l(() => !F.loading && !q.value && K.value.length === 0 && F.hideEmptyMessage !== !0), Ce = l(() => A(B.value, W.value.check)), Y = ae([]);
|
|
86
86
|
function X(e) {
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
function Ce(e) {
|
|
90
|
-
e.disabled || M("select", e);
|
|
87
|
+
return F.isSelected?.(e) ?? !1;
|
|
91
88
|
}
|
|
92
89
|
function we(e) {
|
|
93
|
-
|
|
90
|
+
e.disabled || N("select", e);
|
|
91
|
+
}
|
|
92
|
+
function Te(e) {
|
|
93
|
+
let t = k(Y.value, e);
|
|
94
|
+
return t !== Y.value && (Y.value = t), () => {
|
|
94
95
|
Y.value = Y.value.filter((t) => String(t.value) !== String(e.value));
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function Ee(e) {
|
|
98
99
|
return (q.value ? Y.value : K.value).findIndex((t) => String(t.value) === String(e));
|
|
99
100
|
}
|
|
100
101
|
D(Y, (e) => {
|
|
101
|
-
q.value &&
|
|
102
|
+
q.value && N("registered-options-change", e);
|
|
102
103
|
}, { deep: !0 });
|
|
103
|
-
let
|
|
104
|
-
getOptionIndex:
|
|
105
|
-
registerOption:
|
|
106
|
-
onSelect:
|
|
107
|
-
listboxId:
|
|
104
|
+
let De = l(() => ({
|
|
105
|
+
getOptionIndex: Ee,
|
|
106
|
+
registerOption: Te,
|
|
107
|
+
onSelect: we,
|
|
108
|
+
listboxId: F.listboxId,
|
|
108
109
|
isSelected: X,
|
|
109
|
-
sizeClasses:
|
|
110
|
-
showCheckmark:
|
|
111
|
-
checkClass:
|
|
112
|
-
highlightedIndex:
|
|
113
|
-
optionHoverClass:
|
|
114
|
-
optionSelectedClass:
|
|
115
|
-
optionHighlightedClass:
|
|
110
|
+
sizeClasses: ge.value,
|
|
111
|
+
showCheckmark: F.showCheckmark,
|
|
112
|
+
checkClass: Ce.value,
|
|
113
|
+
highlightedIndex: F.highlightedIndex,
|
|
114
|
+
optionHoverClass: ve.value,
|
|
115
|
+
optionSelectedClass: be.value,
|
|
116
|
+
optionHighlightedClass: xe.value,
|
|
116
117
|
mergedClasses: {
|
|
117
118
|
optionHover: W.value.optionHover,
|
|
118
119
|
optionSelected: W.value.optionSelected,
|
|
119
120
|
optionHighlighted: W.value.optionHighlighted
|
|
120
121
|
}
|
|
121
122
|
}));
|
|
122
|
-
|
|
123
|
-
let
|
|
124
|
-
modal:
|
|
125
|
-
drawer:
|
|
123
|
+
ie(ee, De);
|
|
124
|
+
let Oe = l(() => de(G.value, X)), ke = l(() => z.value.customProps?.menu), Ae = l(() => z.value.customProps?.modal), je = l(() => z.value.customProps?.drawer), Me = l(() => z.value.customProps?.list), Ne = l(() => z.value.customProps?.listItem), Pe = l(() => z.value.customProps?.progress), Fe = l(() => z.value.customProps?.listSection), Ie = l(() => ({
|
|
125
|
+
modal: Ae.value,
|
|
126
|
+
drawer: je.value,
|
|
126
127
|
menu: {
|
|
127
|
-
anchorEl:
|
|
128
|
-
placement:
|
|
129
|
-
disableAutoFocus:
|
|
130
|
-
...ce(
|
|
131
|
-
...
|
|
128
|
+
anchorEl: F.anchorEl,
|
|
129
|
+
placement: F.placement,
|
|
130
|
+
disableAutoFocus: F.disableAutoFocus,
|
|
131
|
+
...ce(F.rounded) ? {} : { rounded: F.rounded },
|
|
132
|
+
...ke.value
|
|
132
133
|
}
|
|
133
|
-
})),
|
|
134
|
+
})), Z = l(() => ({
|
|
134
135
|
size: "xs",
|
|
135
136
|
"aria-hidden": !0,
|
|
136
|
-
color:
|
|
137
|
-
...n(
|
|
137
|
+
color: z.value.color,
|
|
138
|
+
...n(Pe.value, {
|
|
138
139
|
class: "shrink-0",
|
|
139
140
|
classes: { bar: W.value.loading }
|
|
140
141
|
})
|
|
141
|
-
})),
|
|
142
|
-
dense: !0,
|
|
142
|
+
})), Le = l(() => ({
|
|
143
143
|
role: "listbox",
|
|
144
|
-
id:
|
|
145
|
-
"aria-labelledby":
|
|
146
|
-
"aria-multiselectable":
|
|
147
|
-
...n(
|
|
144
|
+
id: F.listboxId,
|
|
145
|
+
"aria-labelledby": F.labelledBy,
|
|
146
|
+
"aria-multiselectable": F.multiple || void 0,
|
|
147
|
+
...n(Me.value)
|
|
148
148
|
}));
|
|
149
149
|
function Q() {
|
|
150
|
-
|
|
150
|
+
N("apply"), P.value = !1;
|
|
151
151
|
}
|
|
152
152
|
function $() {
|
|
153
|
-
|
|
153
|
+
N("cancel"), P.value = !1;
|
|
154
154
|
}
|
|
155
|
-
return (e, n) => (
|
|
156
|
-
modelValue:
|
|
157
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
158
|
-
overlay:
|
|
159
|
-
"custom-props":
|
|
155
|
+
return (e, n) => (S(), u(T(a), {
|
|
156
|
+
modelValue: P.value,
|
|
157
|
+
"onUpdate:modelValue": n[0] ||= (e) => P.value = e,
|
|
158
|
+
overlay: g.overlay,
|
|
159
|
+
"custom-props": Ie.value
|
|
160
160
|
}, {
|
|
161
|
-
default: O(() => [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
default: O(() => [q.value ?
|
|
161
|
+
default: O(() => [p("div", { class: b(T(he)) }, [
|
|
162
|
+
T(t)(T(M), "beforeOptions") ? C(e.$slots, "beforeOptions", {}, void 0, void 0, 0) : d("", !0),
|
|
163
|
+
g.loading ? (S(), f(c, { key: 1 }, [h(T(s), x(_(Z.value)), null, 16), p("div", x(_(T(U))), [T(t)(T(M), "loading") ? C(e.$slots, "loading", {}, void 0, void 0, 0) : (S(), f("span", j, w(R.value), 1))], 16)], 64)) : (S(), f("div", x(y({ key: 2 }, T(V))), [h(T(o), x(_(Le.value)), {
|
|
164
|
+
default: O(() => [q.value ? C(e.$slots, "default", {}, void 0, void 0, 0) : (S(!0), f(c, { key: 1 }, oe(Oe.value, (n) => (S(), f(c, { key: n.key }, [n.kind === "section" ? (S(), u(T(ne), y({
|
|
165
165
|
key: 0,
|
|
166
166
|
title: n.title,
|
|
167
167
|
sticky: n.sticky
|
|
168
|
-
}, { ref_for: !0 },
|
|
168
|
+
}, { ref_for: !0 }, Fe.value), null, 16, ["title", "sticky"])) : (S(), u(T(te), y({
|
|
169
169
|
key: 1,
|
|
170
170
|
interactive: "",
|
|
171
171
|
value: n.option.value,
|
|
172
172
|
disabled: n.option.disabled,
|
|
173
173
|
secondary: n.option.description,
|
|
174
|
-
primary:
|
|
175
|
-
}, { ref_for: !0 },
|
|
174
|
+
primary: T(t)(T(M), "option") ? void 0 : n.option.label
|
|
175
|
+
}, { ref_for: !0 }, Ne.value), re({ _: 2 }, [T(t)(T(M), "option") ? {
|
|
176
176
|
name: "default",
|
|
177
|
-
fn: O(() => [
|
|
177
|
+
fn: O(() => [C(e.$slots, "option", {
|
|
178
178
|
option: n.option,
|
|
179
179
|
selected: n.selected
|
|
180
180
|
})]),
|
|
@@ -187,21 +187,21 @@ var A = { key: 1 }, j = /*@__PURE__*/ h({
|
|
|
187
187
|
]))], 64))), 128))]),
|
|
188
188
|
_: 3
|
|
189
189
|
}, 16)], 16)),
|
|
190
|
-
J.value && !
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
J.value && !T(t)(T(M), "empty") ? (S(), f("div", x(y({ key: 3 }, T(U))), w(L.value), 17)) : J.value && T(t)(T(M), "empty") ? C(e.$slots, "empty", {}, void 0, void 0, 4) : d("", !0),
|
|
191
|
+
T(t)(T(M), "afterOptions") ? C(e.$slots, "afterOptions", {}, void 0, void 0, 5) : d("", !0),
|
|
192
|
+
T(fe) ? (S(), f("div", x(y({ key: 6 }, T(H))), [C(e.$slots, "footer", {
|
|
193
193
|
apply: Q,
|
|
194
194
|
cancel: $
|
|
195
|
-
}, () => [
|
|
195
|
+
}, () => [h(T(i), y({
|
|
196
196
|
variant: "flat",
|
|
197
197
|
color: "secondary"
|
|
198
|
-
},
|
|
199
|
-
default: O(() => [
|
|
198
|
+
}, T(ye), { onClick: $ }), {
|
|
199
|
+
default: O(() => [m(w(T(me)), 1)]),
|
|
200
200
|
_: 1
|
|
201
|
-
}, 16),
|
|
202
|
-
default: O(() => [
|
|
201
|
+
}, 16), h(T(i), y({ color: "primary" }, T(_e), { onClick: Q }), {
|
|
202
|
+
default: O(() => [m(w(T(pe)), 1)]),
|
|
203
203
|
_: 1
|
|
204
|
-
}, 16)])], 16)) :
|
|
204
|
+
}, 16)])], 16)) : d("", !0)
|
|
205
205
|
], 2)]),
|
|
206
206
|
_: 3
|
|
207
207
|
}, 8, [
|
|
@@ -212,4 +212,4 @@ var A = { key: 1 }, j = /*@__PURE__*/ h({
|
|
|
212
212
|
}
|
|
213
213
|
});
|
|
214
214
|
//#endregion
|
|
215
|
-
export {
|
|
215
|
+
export { M as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { isArray as e, isFunction as t, isNil as n, isObjectLike as r } from "es-toolkit/compat";
|
|
2
|
+
import { listboxOptionFromComposedItem as i } from "@bridge-ui/core/Domain";
|
|
3
|
+
//#region src/Components/Listbox/collectComposedListboxOptions.ts
|
|
4
|
+
function a(o) {
|
|
5
|
+
let s = [], c = e(o) ? o : n(o) ? [] : [o];
|
|
6
|
+
for (let n of c) {
|
|
7
|
+
if (!r(n)) continue;
|
|
8
|
+
let o = n, c = i({
|
|
9
|
+
value: o.props?.value,
|
|
10
|
+
primary: o.props?.primary,
|
|
11
|
+
disabled: o.props?.disabled,
|
|
12
|
+
secondary: o.props?.secondary
|
|
13
|
+
});
|
|
14
|
+
if (c && s.push(c), e(o.children)) {
|
|
15
|
+
s.push(...a(o.children));
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
let l = o.children;
|
|
19
|
+
if (r(l) && "default" in l) {
|
|
20
|
+
let e = l.default;
|
|
21
|
+
t(e) && s.push(...a(e()));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return s;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { a as collectComposedListboxOptions };
|
|
@@ -73,7 +73,8 @@ function v(v, y, b) {
|
|
|
73
73
|
return {
|
|
74
74
|
merged: w,
|
|
75
75
|
dotBind: i(() => e(E.value?.dot, {}, p({
|
|
76
|
-
"rounded-full
|
|
76
|
+
"rounded-full transition-transform duration-100": !0,
|
|
77
|
+
[k.value?.dot ?? "bg-white"]: !0,
|
|
77
78
|
"scale-0": !O.value,
|
|
78
79
|
"scale-100": O.value,
|
|
79
80
|
"h-[42%] w-[42%]": !0,
|
|
@@ -729,7 +729,7 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
|
|
|
729
729
|
listboxProps: import('vue').ComputedRef<{
|
|
730
730
|
anchorEl?: null | HTMLElement;
|
|
731
731
|
classes?: import('../../Listbox').ListboxClasses;
|
|
732
|
-
color: "info" | "error" | "success" | "warning" | "dark" | "primary" | "secondary";
|
|
732
|
+
color: "info" | "error" | "success" | "warning" | "black" | "dark" | "primary" | "secondary";
|
|
733
733
|
customProps?: import('../../Listbox').ListboxCustomProps;
|
|
734
734
|
disableAutoFocus: boolean;
|
|
735
735
|
disableMaxHeight: boolean;
|