@bridge-ui/vue 0.0.1-beta.5 → 0.0.1-beta.7
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/dist/Components/List/List.vue.d.ts +0 -1
- package/dist/Components/List/List.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/Components/List/composables/useList.d.ts +3 -9
- package/dist/Components/List/composables/useList.js +21 -25
- package/dist/Components/List/index.d.ts +1 -1
- package/dist/Components/List/list.types.d.ts +1 -8
- package/dist/Components/ListItem/ListItem.vue.d.ts +0 -1
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +3 -6
- package/dist/Components/ListItem/composables/useListItem.d.ts +12 -18
- package/dist/Components/ListItem/composables/useListItem.js +97 -75
- package/dist/Components/ListItem/index.d.ts +1 -1
- package/dist/Components/ListItem/listItem.types.d.ts +7 -8
- package/dist/Components/ListSection/composables/useListSection.d.ts +1 -3
- package/dist/Components/ListSection/composables/useListSection.js +6 -5
- package/dist/Components/Listbox/Listbox.vue.d.ts +5 -2
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +107 -56
- package/dist/Components/Listbox/composables/useListbox.d.ts +0 -5
- package/dist/Components/Listbox/composables/useListbox.js +10 -19
- package/dist/Components/Listbox/index.d.ts +2 -1
- package/dist/Components/Listbox/index.js +3 -2
- package/dist/Components/Listbox/listbox.types.d.ts +23 -6
- package/dist/Components/Listbox/listboxInjectionKey.d.ts +23 -0
- package/dist/Components/Listbox/listboxInjectionKey.js +4 -0
- package/dist/Components/Menu/Menu.vue.d.ts +2 -2
- package/dist/Components/Menu/composables/useMenu.d.ts +1 -3
- package/dist/Components/Menu/composables/useMenu.js +3 -3
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Progress/Progress.js +5 -0
- package/dist/Components/Progress/Progress.vue.d.ts +4 -0
- package/dist/Components/Progress/Progress.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Progress/composables/useProgress.d.ts +29 -0
- package/dist/Components/Progress/composables/useProgress.js +75 -0
- package/dist/Components/Progress/index.d.ts +3 -0
- package/dist/Components/Progress/index.js +3 -0
- package/dist/Components/Progress/progress.types.d.ts +94 -0
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +68 -57
- package/dist/Components/Select/SelectOption.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/Select/composables/useSelect.d.ts +5 -1
- package/dist/Components/Select/composables/useSelect.js +187 -154
- package/dist/Components/Select/select.types.d.ts +12 -5
- package/dist/Components/Spinner/Spinner.js +5 -0
- package/dist/Components/Spinner/Spinner.vue.d.ts +4 -0
- package/dist/Components/Spinner/Spinner.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/Components/Spinner/composables/useSpinner.d.ts +58 -0
- package/dist/Components/Spinner/composables/useSpinner.js +97 -0
- package/dist/Components/Spinner/index.d.ts +3 -0
- package/dist/Components/Spinner/index.js +3 -0
- package/dist/Components/Spinner/spinner.types.d.ts +99 -0
- package/dist/augments.d.ts +12 -3
- package/dist/index.d.ts +6 -2
- package/dist/index.js +32 -28
- package/dist/theme.css +46 -3
- package/package.json +2 -2
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { MergeHtmlProps, MergeProps, ProgressColor, ProgressRounded, ProgressSize, ProgressVariant } from '@bridge-ui/core';
|
|
3
|
+
export interface ProgressSizeOverrides {}
|
|
4
|
+
export interface ProgressColorOverrides {}
|
|
5
|
+
export interface ProgressRoundedOverrides {}
|
|
6
|
+
export interface ProgressVariantOverrides {}
|
|
7
|
+
export interface ProgressClasses {
|
|
8
|
+
/**
|
|
9
|
+
* The classes to apply to the primary progress bar.
|
|
10
|
+
*/
|
|
11
|
+
bar?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The classes to apply to the buffer bar.
|
|
14
|
+
*/
|
|
15
|
+
buffer?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The classes to apply to the root.
|
|
18
|
+
*/
|
|
19
|
+
root?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The classes to apply to the track.
|
|
22
|
+
*/
|
|
23
|
+
track?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ProgressCustomProps {
|
|
26
|
+
/**
|
|
27
|
+
* Props forwarded to the primary progress bar.
|
|
28
|
+
*/
|
|
29
|
+
bar?: HTMLAttributes;
|
|
30
|
+
/**
|
|
31
|
+
* Props forwarded to the buffer bar.
|
|
32
|
+
*/
|
|
33
|
+
buffer?: HTMLAttributes;
|
|
34
|
+
/**
|
|
35
|
+
* Props forwarded to the root element.
|
|
36
|
+
*/
|
|
37
|
+
root?: HTMLAttributes;
|
|
38
|
+
/**
|
|
39
|
+
* Props forwarded to the track element.
|
|
40
|
+
*/
|
|
41
|
+
track?: HTMLAttributes;
|
|
42
|
+
}
|
|
43
|
+
export interface ProgressOwnProps {
|
|
44
|
+
/**
|
|
45
|
+
* The classes to apply to progress parts.
|
|
46
|
+
*
|
|
47
|
+
* @default undefined
|
|
48
|
+
*/
|
|
49
|
+
classes?: ProgressClasses;
|
|
50
|
+
/**
|
|
51
|
+
* The color of the progress indicator.
|
|
52
|
+
*
|
|
53
|
+
* @default "primary"
|
|
54
|
+
*/
|
|
55
|
+
color?: MergeProps<ProgressColor, ProgressColorOverrides>;
|
|
56
|
+
/**
|
|
57
|
+
* Extra props for internal parts (`root`, `track`, `bar`, `buffer`).
|
|
58
|
+
* Root HTML attributes stay on the component top level.
|
|
59
|
+
*
|
|
60
|
+
* @default undefined
|
|
61
|
+
*/
|
|
62
|
+
customProps?: ProgressCustomProps;
|
|
63
|
+
/**
|
|
64
|
+
* The roundedness of the progress bar.
|
|
65
|
+
*
|
|
66
|
+
* @default "full"
|
|
67
|
+
*/
|
|
68
|
+
rounded?: MergeProps<ProgressRounded, ProgressRoundedOverrides>;
|
|
69
|
+
/**
|
|
70
|
+
* The height size of the progress bar.
|
|
71
|
+
*
|
|
72
|
+
* @default "md"
|
|
73
|
+
*/
|
|
74
|
+
size?: MergeProps<ProgressSize, ProgressSizeOverrides>;
|
|
75
|
+
/**
|
|
76
|
+
* Progress value from 0 to 100. Used by `determinate` and `buffer` variants.
|
|
77
|
+
*
|
|
78
|
+
* @default undefined
|
|
79
|
+
*/
|
|
80
|
+
value?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Buffer value from 0 to 100. Used by the `buffer` variant; should be ≥ `value`.
|
|
83
|
+
*
|
|
84
|
+
* @default undefined
|
|
85
|
+
*/
|
|
86
|
+
valueBuffer?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Visual variant of the progress indicator.
|
|
89
|
+
*
|
|
90
|
+
* @default "indeterminate"
|
|
91
|
+
*/
|
|
92
|
+
variant?: MergeProps<ProgressVariant, ProgressVariantOverrides>;
|
|
93
|
+
}
|
|
94
|
+
export type ProgressProps = MergeHtmlProps<ProgressOwnProps, HTMLAttributes>;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { hasNamedSlot as e, resolveNamedSlot as t } from "../../Utils/slotOrProp.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useSelect as
|
|
7
|
-
import { SELECT_OPTION_KEY as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { X as
|
|
2
|
+
import ee from "../Icon/Icon.js";
|
|
3
|
+
import n from "../Chip/Chip.js";
|
|
4
|
+
import r from "../FormField/FormField.js";
|
|
5
|
+
import i from "../Listbox/Listbox.js";
|
|
6
|
+
import { useSelect as a } from "./composables/useSelect.js";
|
|
7
|
+
import { SELECT_OPTION_KEY as o } from "./selectInjectionKey.js";
|
|
8
|
+
import { Fragment as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as f, createTextVNode as p, createVNode as m, defineComponent as h, guardReactiveProps as g, isRef as _, mergeModels as v, mergeProps as y, normalizeProps as b, openBlock as x, provide as S, ref as C, renderList as w, renderSlot as T, resolveDynamicComponent as E, toDisplayString as D, unref as O, useModel as k, useTemplateRef as A, withCtx as j, withKeys as M, withModifiers as N } from "vue";
|
|
9
|
+
import { X as P } from "@lucide/vue";
|
|
10
10
|
//#region src/Components/Select/Select.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var
|
|
11
|
+
var F = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "flex min-w-0 flex-1 flex-wrap items-center gap-0.5"
|
|
14
|
-
},
|
|
14
|
+
}, I = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "flex min-w-0 flex-1 items-center gap-1"
|
|
17
|
-
},
|
|
17
|
+
}, L = {
|
|
18
|
+
key: 0,
|
|
19
|
+
hidden: "",
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}, R = /* @__PURE__ */ h({
|
|
18
22
|
inheritAttrs: !1,
|
|
19
23
|
__name: "Select",
|
|
20
|
-
props: /* @__PURE__ */
|
|
24
|
+
props: /* @__PURE__ */ v({
|
|
21
25
|
asyncData: {},
|
|
22
26
|
clearable: {
|
|
23
27
|
type: Boolean,
|
|
@@ -72,7 +76,7 @@ var I = {
|
|
|
72
76
|
modelValue: {},
|
|
73
77
|
modelModifiers: {}
|
|
74
78
|
}),
|
|
75
|
-
emits: /* @__PURE__ */
|
|
79
|
+
emits: /* @__PURE__ */ v([
|
|
76
80
|
"change",
|
|
77
81
|
"clear",
|
|
78
82
|
"close",
|
|
@@ -82,9 +86,9 @@ var I = {
|
|
|
82
86
|
"select",
|
|
83
87
|
"update:modelValue"
|
|
84
88
|
], ["update:modelValue"]),
|
|
85
|
-
setup(
|
|
86
|
-
let R =
|
|
87
|
-
|
|
89
|
+
setup(h, { emit: v }) {
|
|
90
|
+
let R = k(h, "modelValue"), z = h, B = v, V = A("trigger"), H = C([]);
|
|
91
|
+
S(o, {
|
|
88
92
|
unregister(e) {
|
|
89
93
|
H.value = H.value.filter((t) => String(t.value) !== String(e));
|
|
90
94
|
},
|
|
@@ -92,20 +96,20 @@ var I = {
|
|
|
92
96
|
H.value.some((t) => String(t.value) === String(e.value)) || (H.value = [...H.value, e]);
|
|
93
97
|
}
|
|
94
98
|
});
|
|
95
|
-
let { open: U, slots: W, hasValue: G, multiple: K, formField: q, clearable: J, clearBind: Y, clearValue: X, removeChip: Z, triggerBind: Q, selectOption:
|
|
96
|
-
return (
|
|
97
|
-
|
|
98
|
-
default:
|
|
99
|
+
let { open: U, slots: W, hasValue: G, multiple: K, formField: q, clearable: J, clearBind: Y, clearValue: X, removeChip: Z, triggerBind: Q, selectOption: te, containerRef: ne, listboxProps: re, clearIconSize: ie, mergedClasses: ae, selectedOptions: oe, hasComposedList: $, handleRegisteredOptionsChange: se } = a(z, R, V, B, H);
|
|
100
|
+
return (a, o) => (x(), u(s, null, [
|
|
101
|
+
m(O(r), { field: O(q) }, {
|
|
102
|
+
default: j(() => [O(K) ? (x(), u("div", F, [(x(!0), u(s, null, w(O(oe), (e) => (x(), c(O(n), {
|
|
99
103
|
dismissible: "",
|
|
100
104
|
key: String(e.value),
|
|
101
|
-
size:
|
|
102
|
-
"custom-props": { clear:
|
|
103
|
-
disabled:
|
|
105
|
+
size: O(q).merged.value.size,
|
|
106
|
+
"custom-props": { clear: O(Y) },
|
|
107
|
+
disabled: O(q).isDisabled.value,
|
|
104
108
|
"clear-label": `Remove ${e.label}`,
|
|
105
|
-
classes: { root:
|
|
106
|
-
onDismiss: (t) =>
|
|
109
|
+
classes: { root: O(ae).chip },
|
|
110
|
+
onDismiss: (t) => O(Z)(e, t)
|
|
107
111
|
}, {
|
|
108
|
-
default:
|
|
112
|
+
default: j(() => [T(a.$slots, "chip", { option: e }, () => [p(D(e.label), 1)])]),
|
|
109
113
|
_: 2
|
|
110
114
|
}, 1032, [
|
|
111
115
|
"size",
|
|
@@ -114,56 +118,63 @@ var I = {
|
|
|
114
118
|
"clear-label",
|
|
115
119
|
"classes",
|
|
116
120
|
"onDismiss"
|
|
117
|
-
]))), 128)),
|
|
121
|
+
]))), 128)), d("textarea", y({ ref: "trigger" }, O(Q)), null, 16)])) : (x(), u("div", I, [d("input", y({
|
|
118
122
|
ref: "trigger",
|
|
119
123
|
class: "min-w-0 flex-1"
|
|
120
|
-
},
|
|
121
|
-
onClick:
|
|
124
|
+
}, O(Q)), null, 16), O(J) && O(G) && !O(q).isDisabled.value ? (x(), u("span", y({ key: 0 }, O(Y), {
|
|
125
|
+
onClick: o[0] ||= (...e) => O(X) && O(X)(...e),
|
|
122
126
|
"aria-label": "Clear selection",
|
|
123
|
-
onKeydown: [
|
|
124
|
-
}), [
|
|
125
|
-
icon:
|
|
126
|
-
size:
|
|
127
|
-
}, null, 8, ["icon", "size"])], 16)) :
|
|
127
|
+
onKeydown: [o[1] ||= M(N((...e) => O(X) && O(X)(...e), ["prevent"]), ["enter"]), o[2] ||= M(N((...e) => O(X) && O(X)(...e), ["prevent"]), ["space"])]
|
|
128
|
+
}), [m(O(ee), {
|
|
129
|
+
icon: O(P),
|
|
130
|
+
size: O(ie)
|
|
131
|
+
}, null, 8, ["icon", "size"])], 16)) : l("", !0)]))]),
|
|
128
132
|
_: 3
|
|
129
133
|
}, 8, ["field"]),
|
|
130
|
-
|
|
131
|
-
modelValue:
|
|
132
|
-
"onUpdate:modelValue":
|
|
133
|
-
"anchor-el":
|
|
134
|
-
onSelect:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
m(O(i), y(O(re), {
|
|
135
|
+
modelValue: O(U),
|
|
136
|
+
"onUpdate:modelValue": o[3] ||= (e) => _(U) ? U.value = e : null,
|
|
137
|
+
"anchor-el": O(ne),
|
|
138
|
+
onSelect: O(te),
|
|
139
|
+
onRegisteredOptionsChange: O(se)
|
|
140
|
+
}), f({ _: 2 }, [
|
|
141
|
+
O($) ? {
|
|
142
|
+
name: "default",
|
|
143
|
+
fn: j(() => [T(a.$slots, "default")]),
|
|
139
144
|
key: "0"
|
|
140
145
|
} : void 0,
|
|
141
|
-
|
|
142
|
-
name: "
|
|
143
|
-
fn:
|
|
146
|
+
O(e)(O(W), "beforeOptions") ? {
|
|
147
|
+
name: "beforeOptions",
|
|
148
|
+
fn: j(() => [(x(), c(E(O(t)(O(W), "beforeOptions"))))]),
|
|
144
149
|
key: "1"
|
|
145
150
|
} : void 0,
|
|
146
|
-
|
|
147
|
-
name: "
|
|
148
|
-
fn:
|
|
151
|
+
O(e)(O(W), "loading") ? {
|
|
152
|
+
name: "loading",
|
|
153
|
+
fn: j(() => [(x(), c(E(O(t)(O(W), "loading"))))]),
|
|
149
154
|
key: "2"
|
|
150
155
|
} : void 0,
|
|
151
|
-
|
|
152
|
-
name: "
|
|
153
|
-
fn:
|
|
156
|
+
O(e)(O(W), "option") ? {
|
|
157
|
+
name: "option",
|
|
158
|
+
fn: j((e) => [T(a.$slots, "option", b(g(e)))]),
|
|
154
159
|
key: "3"
|
|
155
160
|
} : void 0,
|
|
156
|
-
|
|
157
|
-
name: "
|
|
158
|
-
fn:
|
|
161
|
+
O(e)(O(W), "empty") ? {
|
|
162
|
+
name: "empty",
|
|
163
|
+
fn: j(() => [(x(), c(E(O(t)(O(W), "empty"))))]),
|
|
159
164
|
key: "4"
|
|
165
|
+
} : void 0,
|
|
166
|
+
O(e)(O(W), "afterOptions") ? {
|
|
167
|
+
name: "afterOptions",
|
|
168
|
+
fn: j(() => [(x(), c(E(O(t)(O(W), "afterOptions"))))]),
|
|
169
|
+
key: "5"
|
|
160
170
|
} : void 0
|
|
161
171
|
]), 1040, [
|
|
162
172
|
"modelValue",
|
|
163
173
|
"anchor-el",
|
|
164
|
-
"onSelect"
|
|
174
|
+
"onSelect",
|
|
175
|
+
"onRegisteredOptionsChange"
|
|
165
176
|
]),
|
|
166
|
-
|
|
177
|
+
O($) ? l("", !0) : (x(), u("div", L, [T(a.$slots, "default")]))
|
|
167
178
|
], 64));
|
|
168
179
|
}
|
|
169
180
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Ref, SetupContext } from 'vue';
|
|
2
|
+
import { ListboxEntry } from '@bridge-ui/core';
|
|
2
3
|
import { FormFieldOwnProps } from '../../FormField/formField.types';
|
|
3
4
|
import { SelectClasses, SelectEmits, SelectOption, SelectOwnProps, SelectValue } from '../select.types';
|
|
4
5
|
export declare function useSelect(props: SelectOwnProps, model: Ref<null | undefined | SelectValue | SelectValue[]>, triggerRef: Ref<null | HTMLInputElement | HTMLTextAreaElement>, emit: SetupContext<SelectEmits>["emit"], declarativeOptions: Ref<SelectOption[]>): {
|
|
@@ -728,6 +729,7 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
|
|
|
728
729
|
isSelected: (value: SelectValue) => boolean;
|
|
729
730
|
loading: boolean;
|
|
730
731
|
multiple: boolean;
|
|
732
|
+
entries: ListboxEntry[];
|
|
731
733
|
options: import('@bridge-ui/core').ListboxOption[];
|
|
732
734
|
labelledBy: string;
|
|
733
735
|
highlightedIndex: number;
|
|
@@ -737,12 +739,12 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
|
|
|
737
739
|
classes?: import('../../Listbox').ListboxClasses;
|
|
738
740
|
customProps?: import('../../Listbox').ListboxCustomProps;
|
|
739
741
|
disableAutoFocus: boolean;
|
|
740
|
-
placement?: import('@floating-ui/utils').Placement;
|
|
741
742
|
disableMaxHeight: boolean;
|
|
742
743
|
emptyMessage: string;
|
|
743
744
|
hideEmptyMessage: boolean;
|
|
744
745
|
loadingMessage: string;
|
|
745
746
|
maxHeight: string;
|
|
747
|
+
placement?: import('@floating-ui/utils').Placement;
|
|
746
748
|
showCheckmark?: boolean;
|
|
747
749
|
}>;
|
|
748
750
|
clearIconSize: import('vue').ComputedRef<keyof import('@bridge-ui/core').IconSize>;
|
|
@@ -750,7 +752,9 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
|
|
|
750
752
|
visibleOptions: import('vue').ComputedRef<import('@bridge-ui/core').ListboxOption[]>;
|
|
751
753
|
isSearchActive: import('vue').ComputedRef<boolean>;
|
|
752
754
|
selectedOptions: import('vue').ComputedRef<import('@bridge-ui/core').ListboxOption[]>;
|
|
755
|
+
hasComposedList: import('vue').ComputedRef<boolean>;
|
|
753
756
|
highlightedIndex: Ref<number, number>;
|
|
757
|
+
handleRegisteredOptionsChange: (options: SelectOption[]) => void;
|
|
754
758
|
emptyMessage: import('vue').ComputedRef<string>;
|
|
755
759
|
hideEmptyMessage: import('vue').ComputedRef<boolean>;
|
|
756
760
|
loadingMessage: import('vue').ComputedRef<string>;
|