@bridge-ui/vue 0.6.0 → 0.7.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/dist/Adapters/I18n/useI18nAdapter.d.ts +1 -1
- package/dist/Adapters/I18n/useI18nAdapter.js +4 -1
- package/dist/Components/Accordion/Accordion.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Accordion/accordion.types.d.ts +2 -2
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +1 -1
- package/dist/Components/BaseField/BaseField.vue_vue_type_script_setup_true_lang.js +33 -28
- package/dist/Components/BaseField/BaseFieldCorner.js +5 -0
- package/dist/Components/BaseField/BaseFieldCorner.vue.d.ts +17 -0
- package/dist/Components/BaseField/BaseFieldCorner.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/Components/BaseField/baseField.types.d.ts +4 -2
- package/dist/Components/BaseField/composables/useBaseField.d.ts +1 -1
- package/dist/Components/BaseField/composables/useBaseField.js +11 -8
- package/dist/Components/ColorField/composables/useColorField.d.ts +1 -1
- package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +154 -131
- package/dist/Components/DataTable/DataTablePagination.js +5 -0
- package/dist/Components/DataTable/DataTablePagination.vue.d.ts +24 -0
- package/dist/Components/DataTable/DataTablePagination.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/Components/DataTable/composables/useDataTable.d.ts +8 -3
- package/dist/Components/DataTable/composables/useDataTable.js +299 -280
- package/dist/Components/DataTable/composables/useDataTablePagination.d.ts +69 -0
- package/dist/Components/DataTable/composables/useDataTablePagination.js +130 -0
- package/dist/Components/DataTable/dataTable.types.d.ts +27 -12
- package/dist/Components/DataTable/dataTablePagination.types.d.ts +169 -0
- package/dist/Components/DataTable/index.d.ts +2 -1
- package/dist/Components/DateField/composables/useDateField.d.ts +1 -1
- package/dist/Components/DateRangeField/composables/useDateRangeField.d.ts +1 -1
- package/dist/Components/DateTimeField/composables/useDateTimeField.d.ts +1 -1
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.d.ts +1 -1
- package/dist/Components/FormField/FilledFormField.vue.d.ts +7 -7
- package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +32 -27
- package/dist/Components/FormField/FormFieldCorner.js +5 -0
- package/dist/Components/FormField/FormFieldCorner.vue.d.ts +17 -0
- package/dist/Components/FormField/FormFieldCorner.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/Components/FormField/NotchedFormField.vue.d.ts +7 -7
- package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +31 -26
- package/dist/Components/FormField/OutlinedFormField.vue.d.ts +7 -7
- package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +32 -27
- package/dist/Components/FormField/StackedFormField.vue.d.ts +6 -6
- package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +34 -29
- package/dist/Components/FormField/UnderlinedFormField.vue.d.ts +7 -7
- package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +32 -27
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/FormField/composables/useFormField.js +15 -9
- package/dist/Components/FormField/formField.types.d.ts +4 -2
- package/dist/Components/NumberField/composables/useNumberField.d.ts +1 -1
- package/dist/Components/OtpField/composables/useOtpField.d.ts +1 -1
- package/dist/Components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/Components/Pagination/composables/usePagination.d.ts +4 -2
- package/dist/Components/Pagination/composables/usePagination.js +125 -127
- package/dist/Components/Pagination/pagination.types.d.ts +5 -5
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +1 -1
- package/dist/Components/Select/composables/useSelect.d.ts +1 -1
- package/dist/Components/Slider/composables/useSlider.d.ts +1 -1
- package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Tabs/composables/useTabs.js +16 -10
- package/dist/Components/Tabs/tabs.types.d.ts +3 -3
- package/dist/Components/TextField/composables/useTextField.d.ts +1 -1
- package/dist/Components/Textarea/composables/useTextarea.d.ts +1 -1
- package/dist/Components/TimeField/composables/useTimeField.d.ts +1 -1
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/docs/components/Accordion.md +1 -1
- package/docs/components/DataTable.md +5 -11
- package/docs/components/I18n.md +65 -24
- package/docs/components/Pagination.md +5 -3
- package/docs/components/Table.md +2 -2
- package/docs/components/Tabs.md +24 -6
- package/docs/examples/i18n-dictionary.ts +28 -10
- package/docs/examples/i18n-vue-i18n.ts +7 -6
- package/docs/examples/icon-fontawesome.ts +4 -0
- package/docs/examples/icon-heroicons.ts +5 -1
- package/docs/examples/icon-lucide.ts +4 -0
- package/docs/examples/icon-phosphor.ts +4 -0
- package/docs/examples/icon-tabler.ts +4 -0
- package/package.json +2 -2
package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,42 +1,47 @@
|
|
|
1
1
|
import { hasNamedSlot as e, hasSlotOrProp as t, isPropPresent as n } from "../../Utils/slotOrProp.js";
|
|
2
2
|
import r from "../Icon/Icon.js";
|
|
3
|
-
import i from "./
|
|
4
|
-
import
|
|
3
|
+
import i from "./FormFieldCorner.js";
|
|
4
|
+
import a from "./FormFieldLabel.js";
|
|
5
|
+
import { Fragment as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeProps as h, normalizeProps as g, openBlock as _, renderSlot as v, toDisplayString as y, unref as b, useSlots as x, withCtx as S } from "vue";
|
|
5
6
|
//#region src/Components/FormField/UnderlinedFormField.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var C = [
|
|
7
8
|
"data-invalid",
|
|
8
9
|
"aria-disabled",
|
|
9
10
|
"aria-readonly"
|
|
10
|
-
],
|
|
11
|
+
], w = ["id"], T = ["id", "aria-hidden"], E = /*@__PURE__*/ p({
|
|
11
12
|
__name: "UnderlinedFormField",
|
|
12
13
|
props: { api: {} },
|
|
13
|
-
setup(
|
|
14
|
-
let
|
|
15
|
-
return (
|
|
16
|
-
"data-invalid":
|
|
17
|
-
"aria-disabled":
|
|
18
|
-
"aria-readonly":
|
|
14
|
+
setup(p) {
|
|
15
|
+
let E = x();
|
|
16
|
+
return (x, D) => (_(), c("div", h(p.api.rootBind.value, {
|
|
17
|
+
"data-invalid": p.api.invalidated.value || void 0,
|
|
18
|
+
"aria-disabled": p.api.isDisabled.value || void 0,
|
|
19
|
+
"aria-readonly": p.api.isReadonly.value || void 0
|
|
19
20
|
}), [
|
|
20
|
-
|
|
21
|
+
b(t)(b(E), "label", p.api.merged.value.label) || b(t)(b(E), "corner", p.api.merged.value.corner) ? (_(), c("div", g(h({ key: 0 }, p.api.headerBind.value)), [f(a, { api: p.api }, u({ _: 2 }, [b(e)(b(E), "label") ? {
|
|
21
22
|
name: "label",
|
|
22
|
-
fn:
|
|
23
|
+
fn: S(() => [v(x.$slots, "label")]),
|
|
23
24
|
key: "0"
|
|
24
|
-
} : void 0]), 1032, ["api"]),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
} : void 0]), 1032, ["api"]), f(i, { api: p.api }, u({ _: 2 }, [b(e)(b(E), "corner") ? {
|
|
26
|
+
name: "corner",
|
|
27
|
+
fn: S(() => [v(x.$slots, "corner")]),
|
|
28
|
+
key: "0"
|
|
29
|
+
} : void 0]), 1032, ["api"])], 16)) : s("", !0),
|
|
30
|
+
l("div", g(m(p.api.containerBind.value)), [
|
|
31
|
+
b(e)(b(E), "start") ? (_(), c("div", g(h({ key: 0 }, p.api.startSlotBind.value)), [v(x.$slots, "start")], 16)) : b(n)(p.api.merged.value.start) ? (_(), c("div", g(h({ key: 1 }, p.api.startBind.value)), y(p.api.merged.value.start), 17)) : p.api.merged.value.startIcon ? (_(), c("div", g(h({ key: 2 }, p.api.startBind.value)), [f(b(r), h({ size: p.api.merged.value.size }, p.api.startIconBind.value, { icon: p.api.merged.value.startIcon }), null, 16, ["size", "icon"])], 16)) : s("", !0),
|
|
32
|
+
v(x.$slots, "default"),
|
|
33
|
+
b(e)(b(E), "end") ? (_(), c("div", g(h({ key: 3 }, p.api.endSlotBind.value)), [v(x.$slots, "end")], 16)) : b(n)(p.api.merged.value.end) ? (_(), c("div", g(h({ key: 4 }, p.api.endBind.value)), y(p.api.merged.value.end), 17)) : p.api.invalidated.value && p.api.merged.value.showErrorIcon !== !1 ? (_(), c("div", g(h({ key: 5 }, p.api.endBind.value)), [f(b(r), h({
|
|
34
|
+
icon: p.api.errorIcon.value,
|
|
35
|
+
size: p.api.merged.value.size
|
|
36
|
+
}, p.api.endIconBind.value), null, 16, ["icon", "size"])], 16)) : p.api.merged.value.endIcon ? (_(), c("div", g(h({ key: 6 }, p.api.endBind.value)), [f(b(r), h({ size: p.api.merged.value.size }, p.api.endIconBind.value, { icon: p.api.merged.value.endIcon }), null, 16, ["size", "icon"])], 16)) : s("", !0)
|
|
32
37
|
], 16),
|
|
33
|
-
!
|
|
34
|
-
|
|
35
|
-
id: `${
|
|
36
|
-
"aria-hidden": !
|
|
37
|
-
}), [
|
|
38
|
-
], 16,
|
|
38
|
+
!p.api.invalidated.value && b(t)(b(E), "description", p.api.merged.value.description) ? (_(), c("p", h({ key: 1 }, p.api.descriptionBind.value, { id: `${p.api.controlId.value}-description` }), [b(e)(b(E), "description") ? v(x.$slots, "description", {}, void 0, void 0, 0) : b(n)(p.api.merged.value.description) ? (_(), c(o, { key: 1 }, [d(y(p.api.merged.value.description), 1)], 64)) : s("", !0)], 16, w)) : s("", !0),
|
|
39
|
+
p.api.merged.value.hideErrorMessage ? s("", !0) : (_(), c("p", h({ key: 2 }, p.api.errorBind.value, {
|
|
40
|
+
id: `${p.api.controlId.value}-error`,
|
|
41
|
+
"aria-hidden": !p.api.showErrorMessageContent.value || void 0
|
|
42
|
+
}), [p.api.showErrorMessageContent.value ? (_(), c(o, { key: 0 }, [b(e)(b(E), "errorMessage") ? v(x.$slots, "errorMessage", {}, void 0, void 0, 0) : b(n)(p.api.merged.value.errorMessage) ? (_(), c(o, { key: 1 }, [d(y(p.api.merged.value.errorMessage), 1)], 64)) : s("", !0)], 64)) : s("", !0)], 16, T))
|
|
43
|
+
], 16, C));
|
|
39
44
|
}
|
|
40
45
|
});
|
|
41
46
|
//#endregion
|
|
42
|
-
export {
|
|
47
|
+
export { E as default };
|
|
@@ -451,7 +451,6 @@ export declare function useFormField(props: MaybeRefOrGetter<Omit<FormFieldOwnPr
|
|
|
451
451
|
isNotched: import('vue').ComputedRef<boolean>;
|
|
452
452
|
isStacked: import('vue').ComputedRef<boolean>;
|
|
453
453
|
startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
|
|
454
|
-
cornerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
|
|
455
454
|
headerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
|
|
456
455
|
isDisabled: import('vue').ComputedRef<boolean>;
|
|
457
456
|
isReadonly: import('vue').ComputedRef<boolean>;
|
|
@@ -469,6 +468,7 @@ export declare function useFormField(props: MaybeRefOrGetter<Omit<FormFieldOwnPr
|
|
|
469
468
|
ariaDescribedBy: import('vue').ComputedRef<string | undefined>;
|
|
470
469
|
descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
|
|
471
470
|
stackedBodyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
|
|
471
|
+
fieldCornerProps: import('vue').ComputedRef<LabelProps>;
|
|
472
472
|
hasInsetLabelRow: import('vue').ComputedRef<boolean>;
|
|
473
473
|
insetLabelRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
|
|
474
474
|
stackedInputRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
|
|
@@ -90,10 +90,12 @@ function x(x, ee, S = {}) {
|
|
|
90
90
|
[A.value.root ?? ""]: !0
|
|
91
91
|
}));
|
|
92
92
|
}), ie = o(() => r(O.value?.errorMessage, {}, g({
|
|
93
|
-
"mt-
|
|
93
|
+
"mt-1": !0,
|
|
94
94
|
"min-h-[1lh]": V.value,
|
|
95
95
|
"text-error-600 dark:text-error-400": !0,
|
|
96
96
|
[q.value?.text ?? ""]: !0,
|
|
97
|
+
[q.value?.insetStart ?? ""]: !0,
|
|
98
|
+
[q.value?.insetEnd ?? ""]: !0,
|
|
97
99
|
[A.value.errorMessage ?? ""]: !0
|
|
98
100
|
}))), ae = o(() => r({
|
|
99
101
|
...O.value?.input,
|
|
@@ -134,12 +136,14 @@ function x(x, ee, S = {}) {
|
|
|
134
136
|
"text-dark-400": !0,
|
|
135
137
|
[J.value?.start ?? ""]: !0,
|
|
136
138
|
[A.value.start ?? ""]: !0
|
|
137
|
-
}))), se = o(() =>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
}))), se = o(() => n(O.value?.corner, {
|
|
140
|
+
for: H.value,
|
|
141
|
+
size: E.value.size,
|
|
142
|
+
classes: { root: g({
|
|
143
|
+
[X.value?.corner ?? ""]: I.value,
|
|
144
|
+
[A.value.corner ?? ""]: !0
|
|
145
|
+
}) }
|
|
146
|
+
})), ce = o(() => {
|
|
143
147
|
let e = t(w, "label", E.value.label);
|
|
144
148
|
return r(O.value?.header, {}, g({
|
|
145
149
|
flex: !0,
|
|
@@ -181,7 +185,6 @@ function x(x, ee, S = {}) {
|
|
|
181
185
|
isNotched: I,
|
|
182
186
|
isStacked: L,
|
|
183
187
|
startBind: $,
|
|
184
|
-
cornerBind: se,
|
|
185
188
|
headerBind: le,
|
|
186
189
|
isDisabled: M,
|
|
187
190
|
isReadonly: N,
|
|
@@ -219,11 +222,14 @@ function x(x, ee, S = {}) {
|
|
|
219
222
|
fieldLabelProps: oe,
|
|
220
223
|
ariaDescribedBy: K,
|
|
221
224
|
descriptionBind: o(() => r(O.value?.description, {}, g({
|
|
222
|
-
"mt-
|
|
225
|
+
"mt-1 text-dark-500 dark:text-dark-400": !0,
|
|
223
226
|
[q.value?.text ?? ""]: !0,
|
|
227
|
+
[q.value?.insetStart ?? ""]: !0,
|
|
228
|
+
[q.value?.insetEnd ?? ""]: !0,
|
|
224
229
|
[A.value.description ?? ""]: !0
|
|
225
230
|
}))),
|
|
226
231
|
stackedBodyBind: fe,
|
|
232
|
+
fieldCornerProps: se,
|
|
227
233
|
hasInsetLabelRow: W,
|
|
228
234
|
insetLabelRowBind: ce,
|
|
229
235
|
stackedInputRowBind: pe,
|
|
@@ -61,9 +61,11 @@ export interface FormFieldCustomProps {
|
|
|
61
61
|
*/
|
|
62
62
|
container?: HTMLAttributes;
|
|
63
63
|
/**
|
|
64
|
-
* Props forwarded to the corner
|
|
64
|
+
* Props forwarded to the corner `Label` (content stays owned by `FormField`).
|
|
65
|
+
*
|
|
66
|
+
* @default undefined
|
|
65
67
|
*/
|
|
66
|
-
corner?:
|
|
68
|
+
corner?: Partial<LabelProps>;
|
|
67
69
|
/**
|
|
68
70
|
* Props forwarded to the helper text below the control.
|
|
69
71
|
*/
|
|
@@ -439,7 +439,6 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
439
439
|
isNotched: import('vue').ComputedRef<boolean>;
|
|
440
440
|
isStacked: import('vue').ComputedRef<boolean>;
|
|
441
441
|
startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
442
|
-
cornerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
443
442
|
headerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
444
443
|
isDisabled: import('vue').ComputedRef<boolean>;
|
|
445
444
|
isReadonly: import('vue').ComputedRef<boolean>;
|
|
@@ -457,6 +456,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
457
456
|
ariaDescribedBy: import('vue').ComputedRef<string | undefined>;
|
|
458
457
|
descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
459
458
|
stackedBodyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
|
|
459
|
+
fieldCornerProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
|
|
460
460
|
hasInsetLabelRow: import('vue').ComputedRef<boolean>;
|
|
461
461
|
insetLabelRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
462
462
|
stackedInputRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
|
|
@@ -41,7 +41,6 @@ export declare function useOtpField(props: MaybeRefOrGetter<OtpFieldOwnProps>, m
|
|
|
41
41
|
}>>;
|
|
42
42
|
controlId: import('vue').ComputedRef<string>;
|
|
43
43
|
headerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
44
|
-
cornerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
45
44
|
isDisabled: import('vue').ComputedRef<boolean>;
|
|
46
45
|
isReadonly: import('vue').ComputedRef<boolean>;
|
|
47
46
|
sizeClasses: import('vue').ComputedRef<import('@bridge-ui/core/Tokens').BaseFieldSizeItem | undefined>;
|
|
@@ -52,6 +51,7 @@ export declare function useOtpField(props: MaybeRefOrGetter<OtpFieldOwnProps>, m
|
|
|
52
51
|
ariaDescribedBy: import('vue').ComputedRef<string | undefined>;
|
|
53
52
|
fieldLabelProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
|
|
54
53
|
descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
54
|
+
fieldCornerProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
|
|
55
55
|
showErrorMessageContent: import('vue').ComputedRef<boolean>;
|
|
56
56
|
};
|
|
57
57
|
inputBind: (index: number) => import('@bridge-ui/core/Utils').MergePartBind<object, "class", {
|
|
@@ -51,25 +51,25 @@ var y = {
|
|
|
51
51
|
"update:modelValue"
|
|
52
52
|
], ["update:modelValue"]),
|
|
53
53
|
setup(c, { emit: u }) {
|
|
54
|
-
let S = u, C = c, w = v(c, "modelValue"), { entries: T, showPrev: E, showNext: D, rootBind: O, listBind: k, prevBind: A, nextBind: j,
|
|
54
|
+
let S = u, C = c, w = v(c, "modelValue"), { entries: T, showPrev: E, showNext: D, rootBind: O, listBind: k, prevBind: A, nextBind: j, prevLabel: M, nextLabel: N, getItemBind: P, prevIconBind: F, nextIconBind: I, getEllipsisBind: L } = t(C, {
|
|
55
55
|
size: "md",
|
|
56
56
|
rounded: "md",
|
|
57
|
-
|
|
57
|
+
color: "dark",
|
|
58
58
|
disabled: !1,
|
|
59
59
|
siblingCount: 1,
|
|
60
|
+
variant: "ghost",
|
|
60
61
|
mode: "numbered",
|
|
61
|
-
color: "primary",
|
|
62
62
|
boundaryCount: 1,
|
|
63
63
|
hideNextButton: !1,
|
|
64
64
|
hidePrevButton: !1
|
|
65
65
|
}, w, S);
|
|
66
66
|
return (t, c) => (p(), i("nav", f(l(_(O))), [a("ul", f(l(_(k))), [
|
|
67
|
-
_(E) ? (p(), i("li", y, [a("button", f(l(_(A))), [h(t.$slots, "prev", {}, () => [s(_(e), d({ icon: "chevronLeft" }, _(
|
|
67
|
+
_(E) ? (p(), i("li", y, [a("button", f(l(_(A))), [h(t.$slots, "prev", {}, () => [s(_(e), d({ icon: "chevronLeft" }, _(F)), null, 16), o(" " + g(_(M)), 1)])], 16)])) : r("", !0),
|
|
68
68
|
(p(!0), i(n, null, m(_(T), (e, r) => (p(), i(n, { key: `${e.type}-${r}` }, [e.type === "ellipsis" ? (p(), i("li", d({
|
|
69
69
|
key: 0,
|
|
70
70
|
ref_for: !0
|
|
71
|
-
}, _(
|
|
72
|
-
_(D) ? (p(), i("li", x, [a("button", f(l(_(j))), [h(t.$slots, "next", {}, () => [s(_(e), d({ icon: "chevronRight" }, _(
|
|
71
|
+
}, _(L)(r)), [h(t.$slots, "ellipsis", {}, () => [c[0] ||= o("…", -1)])], 16)) : (p(), i("li", b, [a("button", d({ ref_for: !0 }, _(P)(e.page)), g(e.page), 17)]))], 64))), 128)),
|
|
72
|
+
_(D) ? (p(), i("li", x, [a("button", f(l(_(j))), [h(t.$slots, "next", {}, () => [o(g(_(N)) + " ", 1), s(_(e), d({ icon: "chevronRight" }, _(I)), null, 16)])], 16)])) : r("", !0)
|
|
73
73
|
], 16)], 16));
|
|
74
74
|
}
|
|
75
75
|
});
|
|
@@ -24,17 +24,19 @@ export declare function usePagination(props: PaginationOwnProps, libDefaults: Pa
|
|
|
24
24
|
prevBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
25
25
|
onClick: () => void;
|
|
26
26
|
type: "button";
|
|
27
|
-
"aria-label": string;
|
|
28
27
|
disabled: boolean;
|
|
28
|
+
"aria-label": string;
|
|
29
29
|
class: string;
|
|
30
30
|
}, "class", import('vue').ButtonHTMLAttributes | undefined, {}>>;
|
|
31
31
|
nextBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
32
32
|
onClick: () => void;
|
|
33
|
-
"aria-label": string;
|
|
34
33
|
type: "button";
|
|
35
34
|
disabled: boolean;
|
|
35
|
+
"aria-label": string;
|
|
36
36
|
class: string;
|
|
37
37
|
}, "class", import('vue').ButtonHTMLAttributes | undefined, {}>>;
|
|
38
|
+
prevLabel: import('vue').ComputedRef<string>;
|
|
39
|
+
nextLabel: import('vue').ComputedRef<string>;
|
|
38
40
|
getItemBind: (pageNumber: number) => import('@bridge-ui/core/Utils').MergePartBind<{
|
|
39
41
|
type: "button";
|
|
40
42
|
disabled: NonNullable<boolean | undefined>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
|
|
2
|
+
import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
|
|
3
|
+
import { computed as i, useAttrs as a, useSlots as o } from "vue";
|
|
4
|
+
import { get as s } from "es-toolkit/compat";
|
|
5
|
+
import { getPaginationItems as c } from "@bridge-ui/core/Domain";
|
|
6
|
+
import { paginationColorProps as l, paginationRoundedProps as u, paginationSizeProps as d, paginationVariantProps as f } from "@bridge-ui/core/Tokens";
|
|
7
|
+
import { cn as p, mergeBridgeUILayeredClasses as m, splitComponentProps as h } from "@bridge-ui/core/Utils";
|
|
7
8
|
//#region src/Components/Pagination/composables/usePagination.ts
|
|
8
|
-
var
|
|
9
|
+
var g = [
|
|
9
10
|
"mode",
|
|
10
11
|
"size",
|
|
11
12
|
"color",
|
|
@@ -23,166 +24,163 @@ var m = [
|
|
|
23
24
|
"hideNextButton",
|
|
24
25
|
"hidePrevButton"
|
|
25
26
|
];
|
|
26
|
-
function
|
|
27
|
-
let
|
|
27
|
+
function _(_, v, y, b) {
|
|
28
|
+
let x = e(), S = a(), C = o(), w = i(() => h({
|
|
28
29
|
props: {
|
|
29
|
-
...
|
|
30
|
-
...
|
|
30
|
+
...S,
|
|
31
|
+
..._
|
|
31
32
|
},
|
|
32
|
-
bridgeKeys:
|
|
33
|
-
})), { merged:
|
|
34
|
-
libDefaults:
|
|
33
|
+
bridgeKeys: g
|
|
34
|
+
})), { merged: T, entry: E } = n({
|
|
35
|
+
libDefaults: v,
|
|
35
36
|
componentName: "Pagination",
|
|
36
|
-
props: () =>
|
|
37
|
-
}),
|
|
38
|
-
page:
|
|
39
|
-
count:
|
|
40
|
-
siblingCount:
|
|
41
|
-
boundaryCount:
|
|
42
|
-
})),
|
|
43
|
-
entry:
|
|
44
|
-
props: () =>
|
|
45
|
-
}),
|
|
46
|
-
if (
|
|
47
|
-
let t =
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
if (!
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
53
|
-
|
|
37
|
+
props: () => w.value.componentProps
|
|
38
|
+
}), D = i(() => T.value.customProps), O = i(() => T.value.mode === "simple" ? 1 : y.value ?? 1), k = i(() => T.value.mode === "simple" ? [] : c({
|
|
39
|
+
page: O.value,
|
|
40
|
+
count: T.value.count ?? 0,
|
|
41
|
+
siblingCount: T.value.siblingCount,
|
|
42
|
+
boundaryCount: T.value.boundaryCount
|
|
43
|
+
})), A = r({
|
|
44
|
+
entry: E,
|
|
45
|
+
props: () => w.value.componentProps
|
|
46
|
+
}), j = i(() => m(d, E.value?.tokens?.size)), M = i(() => m(f, E.value?.tokens?.variant)), ee = i(() => m(l, E.value?.tokens?.color)), te = i(() => m(u, E.value?.tokens?.rounded)), N = i(() => s(j.value, T.value.size)), P = i(() => s(M.value, T.value.variant)), F = i(() => s(ee.value, T.value.color)), I = i(() => s(te.value, T.value.rounded)), L = (e) => {
|
|
47
|
+
if (T.value.disabled) return;
|
|
48
|
+
let t = T.value.count ?? 0, n = Math.min(Math.max(1, e), Math.max(t, 1));
|
|
49
|
+
y.value = n, b("change", n), b("update:modelValue", n);
|
|
50
|
+
}, R = () => {
|
|
51
|
+
if (!T.value.disabled) {
|
|
52
|
+
if (T.value.mode === "simple") {
|
|
53
|
+
if (T.value.hasPrevious === !1) return;
|
|
54
|
+
b("previous");
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
+
L(O.value - 1);
|
|
57
58
|
}
|
|
58
|
-
},
|
|
59
|
-
if (!
|
|
60
|
-
if (
|
|
61
|
-
if (
|
|
62
|
-
|
|
59
|
+
}, z = () => {
|
|
60
|
+
if (!T.value.disabled) {
|
|
61
|
+
if (T.value.mode === "simple") {
|
|
62
|
+
if (T.value.hasNext === !1) return;
|
|
63
|
+
b("next");
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
+
L(O.value + 1);
|
|
66
67
|
}
|
|
67
|
-
},
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
})),
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
})),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
[o(P.value, "itemSelectedAccent") ?? ""]: e === "text" || e === "ghost",
|
|
81
|
-
[o(P.value, "itemSelectedSoft") ?? ""]: e === "ghost"
|
|
82
|
-
});
|
|
83
|
-
}), J = r(() => {
|
|
84
|
-
let e = E.value.filter((e) => e.type === "page");
|
|
68
|
+
}, B = i(() => T.value.disabled ? !0 : T.value.mode === "simple" ? T.value.hasPrevious === !1 : O.value <= 1), V = i(() => T.value.disabled ? !0 : T.value.mode === "simple" ? T.value.hasNext === !1 : O.value >= (T.value.count ?? 0)), H = i(() => !T.value.hidePrevButton), U = i(() => !T.value.hideNextButton), W = i(() => T.value.variant === "outlined"), G = i(() => T.value.variant === "ghost" || T.value.variant === "text"), K = i(() => p({
|
|
69
|
+
[s(N.value, "item") ?? ""]: !0,
|
|
70
|
+
[s(P.value, "item") ?? ""]: !0,
|
|
71
|
+
[s(I.value, "item") ?? ""]: G.value
|
|
72
|
+
})), q = i(() => p({
|
|
73
|
+
[s(N.value, "itemIcon") ?? ""]: !0,
|
|
74
|
+
[s(P.value, "item") ?? ""]: !0,
|
|
75
|
+
[s(I.value, "item") ?? ""]: G.value
|
|
76
|
+
})), J = i(() => p({
|
|
77
|
+
[s(P.value, "itemSelected") ?? ""]: !0,
|
|
78
|
+
[s(F.value, "itemSelectedAccent") ?? ""]: !0
|
|
79
|
+
})), Y = i(() => {
|
|
80
|
+
let e = k.value.filter((e) => e.type === "page");
|
|
85
81
|
return {
|
|
86
82
|
first: e[0]?.page,
|
|
87
83
|
last: e[e.length - 1]?.page
|
|
88
84
|
};
|
|
89
|
-
}),
|
|
90
|
-
if (!
|
|
85
|
+
}), X = (e, t) => {
|
|
86
|
+
if (!W.value) return !1;
|
|
91
87
|
if (e === "prev") return !0;
|
|
92
|
-
if (
|
|
93
|
-
let n =
|
|
88
|
+
if (H.value) return !1;
|
|
89
|
+
let n = k.value[0];
|
|
94
90
|
return e === "page" ? n?.type === "page" && n.page === t : e === "ellipsis" && n?.type === "ellipsis" && t === 0;
|
|
95
|
-
},
|
|
96
|
-
let
|
|
97
|
-
return
|
|
98
|
-
"aria-label":
|
|
99
|
-
class:
|
|
100
|
-
[
|
|
101
|
-
[
|
|
91
|
+
}, Z = i(() => x("Previous")), Q = i(() => x("Next")), ne = i(() => {
|
|
92
|
+
let e = w.value.inheritedAttrs;
|
|
93
|
+
return t(D.value?.root, e, {
|
|
94
|
+
"aria-label": e["aria-label"] ?? x("Pagination"),
|
|
95
|
+
class: p({
|
|
96
|
+
[s(N.value, "root") ?? ""]: !0,
|
|
97
|
+
[s(A.value, "root") ?? ""]: !0
|
|
102
98
|
})
|
|
103
99
|
});
|
|
104
|
-
}),
|
|
105
|
-
[
|
|
106
|
-
[
|
|
107
|
-
[
|
|
108
|
-
[
|
|
109
|
-
}) })),
|
|
110
|
-
let n =
|
|
111
|
-
return
|
|
100
|
+
}), re = i(() => t(D.value?.list, {}, { class: p({
|
|
101
|
+
[s(N.value, "list") ?? ""]: !0,
|
|
102
|
+
[s(P.value, "list") ?? ""]: !0,
|
|
103
|
+
[s(I.value, "list") ?? ""]: W.value,
|
|
104
|
+
[s(A.value, "list") ?? ""]: !0
|
|
105
|
+
}) })), ie = (e) => {
|
|
106
|
+
let n = e === O.value, r = W.value && !H.value && e === Y.value.first, i = W.value && !U.value && e === Y.value.last;
|
|
107
|
+
return t(D.value?.item, {}, {
|
|
112
108
|
type: "button",
|
|
113
|
-
disabled:
|
|
114
|
-
"aria-label": `Page ${
|
|
109
|
+
disabled: T.value.disabled,
|
|
110
|
+
"aria-label": `Page ${e}`,
|
|
115
111
|
"aria-current": n ? "page" : void 0,
|
|
116
112
|
onClick: () => {
|
|
117
|
-
n ||
|
|
113
|
+
n || L(e);
|
|
118
114
|
},
|
|
119
|
-
class:
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
123
|
-
"ml-0":
|
|
124
|
-
[
|
|
125
|
-
[
|
|
115
|
+
class: p({
|
|
116
|
+
[K.value]: !0,
|
|
117
|
+
[J.value]: n,
|
|
118
|
+
[s(A.value, "item") ?? ""]: !0,
|
|
119
|
+
"ml-0": X("page", e),
|
|
120
|
+
[s(I.value, "itemStart") ?? ""]: r,
|
|
121
|
+
[s(I.value, "itemEnd") ?? ""]: i
|
|
126
122
|
})
|
|
127
123
|
});
|
|
128
|
-
},
|
|
124
|
+
}, ae = (e) => t(D.value?.ellipsis, {}, {
|
|
129
125
|
"aria-hidden": !0,
|
|
130
|
-
"data-ellipsis-index":
|
|
131
|
-
class:
|
|
132
|
-
[
|
|
133
|
-
[
|
|
134
|
-
[
|
|
135
|
-
[
|
|
136
|
-
"ml-0":
|
|
126
|
+
"data-ellipsis-index": e,
|
|
127
|
+
class: p({
|
|
128
|
+
[s(N.value, "ellipsis") ?? ""]: !0,
|
|
129
|
+
[s(P.value, "ellipsis") ?? ""]: !0,
|
|
130
|
+
[s(I.value, "item") ?? ""]: G.value,
|
|
131
|
+
[s(A.value, "ellipsis") ?? ""]: !0,
|
|
132
|
+
"ml-0": X("ellipsis", e)
|
|
137
133
|
})
|
|
138
|
-
}), $ =
|
|
134
|
+
}), $ = i(() => s(N.value, "icon") ?? "sm");
|
|
139
135
|
return {
|
|
140
|
-
page:
|
|
141
|
-
slots:
|
|
142
|
-
merged:
|
|
143
|
-
entries:
|
|
144
|
-
showPrev:
|
|
145
|
-
showNext:
|
|
146
|
-
rootBind:
|
|
147
|
-
listBind:
|
|
148
|
-
prevBind:
|
|
149
|
-
onClick:
|
|
136
|
+
page: O,
|
|
137
|
+
slots: C,
|
|
138
|
+
merged: T,
|
|
139
|
+
entries: k,
|
|
140
|
+
showPrev: H,
|
|
141
|
+
showNext: U,
|
|
142
|
+
rootBind: ne,
|
|
143
|
+
listBind: re,
|
|
144
|
+
prevBind: i(() => t(D.value?.prev, {}, {
|
|
145
|
+
onClick: R,
|
|
150
146
|
type: "button",
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
class:
|
|
154
|
-
[
|
|
155
|
-
[
|
|
156
|
-
[
|
|
157
|
-
"ml-0":
|
|
158
|
-
[
|
|
147
|
+
disabled: B.value,
|
|
148
|
+
"aria-label": Z.value,
|
|
149
|
+
class: p({
|
|
150
|
+
[q.value]: !0,
|
|
151
|
+
[s(A.value, "prev") ?? ""]: !0,
|
|
152
|
+
[s(A.value, "item") ?? ""]: !0,
|
|
153
|
+
"ml-0": W.value,
|
|
154
|
+
[s(I.value, "itemStart") ?? ""]: W.value
|
|
159
155
|
})
|
|
160
156
|
})),
|
|
161
|
-
nextBind:
|
|
162
|
-
onClick:
|
|
163
|
-
"aria-label": "Next",
|
|
157
|
+
nextBind: i(() => t(D.value?.next, {}, {
|
|
158
|
+
onClick: z,
|
|
164
159
|
type: "button",
|
|
165
|
-
disabled:
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
[
|
|
169
|
-
[
|
|
170
|
-
[
|
|
160
|
+
disabled: V.value,
|
|
161
|
+
"aria-label": Q.value,
|
|
162
|
+
class: p({
|
|
163
|
+
[q.value]: !0,
|
|
164
|
+
[s(A.value, "next") ?? ""]: !0,
|
|
165
|
+
[s(A.value, "item") ?? ""]: !0,
|
|
166
|
+
[s(I.value, "itemEnd") ?? ""]: W.value
|
|
171
167
|
})
|
|
172
168
|
})),
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
prevLabel: Z,
|
|
170
|
+
nextLabel: Q,
|
|
171
|
+
getItemBind: ie,
|
|
172
|
+
prevIconBind: i(() => t(D.value?.prevIcon, {}, {
|
|
175
173
|
"aria-hidden": !0,
|
|
176
174
|
size: $.value,
|
|
177
175
|
class: "shrink-0 pointer-events-none"
|
|
178
176
|
})),
|
|
179
|
-
nextIconBind:
|
|
177
|
+
nextIconBind: i(() => t(D.value?.nextIcon, {}, {
|
|
180
178
|
"aria-hidden": !0,
|
|
181
179
|
size: $.value,
|
|
182
180
|
class: "shrink-0 pointer-events-none"
|
|
183
181
|
})),
|
|
184
|
-
getEllipsisBind:
|
|
182
|
+
getEllipsisBind: ae
|
|
185
183
|
};
|
|
186
184
|
}
|
|
187
185
|
//#endregion
|
|
188
|
-
export {
|
|
186
|
+
export { _ as usePagination };
|
|
@@ -117,9 +117,9 @@ export interface PaginationOwnProps {
|
|
|
117
117
|
*/
|
|
118
118
|
classes?: PaginationClasses;
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
120
|
+
* Optional text accent for the selected page. Selected surface comes from `variant`.
|
|
121
121
|
*
|
|
122
|
-
* @default "
|
|
122
|
+
* @default "dark"
|
|
123
123
|
*/
|
|
124
124
|
color?: MergeProps<PaginationColor, PaginationColorOverrides>;
|
|
125
125
|
/**
|
|
@@ -165,7 +165,7 @@ export interface PaginationOwnProps {
|
|
|
165
165
|
*/
|
|
166
166
|
hidePrevButton?: boolean;
|
|
167
167
|
/**
|
|
168
|
-
* Numbered pages
|
|
168
|
+
* Numbered pages, or prev/next only.
|
|
169
169
|
*
|
|
170
170
|
* @default "numbered"
|
|
171
171
|
*/
|
|
@@ -177,7 +177,7 @@ export interface PaginationOwnProps {
|
|
|
177
177
|
*/
|
|
178
178
|
modelValue?: number;
|
|
179
179
|
/**
|
|
180
|
-
* Control corner radius (`ghost` items
|
|
180
|
+
* Control corner radius (`ghost` / `text` items and `outlined` group edges).
|
|
181
181
|
*
|
|
182
182
|
* @default "md"
|
|
183
183
|
*/
|
|
@@ -197,7 +197,7 @@ export interface PaginationOwnProps {
|
|
|
197
197
|
/**
|
|
198
198
|
* Visual style of page / control buttons.
|
|
199
199
|
*
|
|
200
|
-
* @default "
|
|
200
|
+
* @default "ghost"
|
|
201
201
|
*/
|
|
202
202
|
variant?: MergeProps<PaginationVariant, PaginationVariantOverrides>;
|
|
203
203
|
}
|