@bridge-ui/vue 0.21.0 → 0.22.1
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/Alert/Alert.vue_vue_type_script_setup_true_lang.js +24 -10
- package/dist/Components/Alert/alert.types.d.ts +5 -4
- package/dist/Components/Alert/composables/useAlert.d.ts +2 -2
- package/dist/Components/Alert/composables/useAlert.js +2 -2
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +1 -0
- package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/Components/Autocomplete/autocomplete.types.d.ts +7 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +2 -2
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +3 -2
- package/dist/Components/Avatar/composables/useAvatar.js +2 -2
- package/dist/Components/Calendar/composables/useCalendar.js +132 -131
- package/dist/Components/CalendarDate/composables/useCalendarDate.js +116 -115
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +132 -131
- package/dist/Components/Card/Card.vue_vue_type_script_setup_true_lang.js +24 -10
- package/dist/Components/Card/card.types.d.ts +5 -4
- package/dist/Components/Card/composables/useCard.d.ts +2 -2
- package/dist/Components/Card/composables/useCard.js +2 -2
- package/dist/Components/Carousel/composables/useCarousel.js +6 -6
- package/dist/Components/Chip/Chip.vue.d.ts +0 -1
- package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +48 -39
- package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +33 -36
- package/dist/Components/DataTable/composables/useDataTable.d.ts +2 -0
- package/dist/Components/DataTable/composables/useDataTable.js +226 -216
- package/dist/Components/EmptyState/EmptyState.vue.d.ts +0 -3
- package/dist/Components/EmptyState/EmptyState.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +51 -57
- package/dist/Components/FileUpload/composables/useFileUpload.d.ts +2 -0
- package/dist/Components/FileUpload/composables/useFileUpload.js +6 -4
- package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Link/link.types.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.js +4 -5
- package/dist/Components/Pagination/composables/usePagination.js +9 -9
- package/dist/Components/Select/Select.vue.d.ts +1 -0
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/Components/Select/composables/useSelect.d.ts +2 -2
- package/dist/Components/Select/composables/useSelect.js +3 -2
- package/dist/Components/Select/select.types.d.ts +7 -0
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +97 -72
- package/dist/Components/Snackbar/composables/useSnackbar.d.ts +2 -2
- package/dist/Components/Snackbar/composables/useSnackbar.js +2 -2
- package/dist/Components/Snackbar/snackbar.types.d.ts +5 -4
- package/dist/Components/Table/composables/useTableRow.js +3 -3
- package/dist/Components/Text/Text.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Text/composables/useText.d.ts +1 -1
- package/dist/Components/Text/text.types.d.ts +1 -1
- package/dist/Components/TimePanel/composables/useTimePanel.js +113 -112
- package/dist/Utils/index.d.ts +6 -0
- package/dist/Utils/index.js +21 -17
- package/dist/index.js +157 -157
- package/docs/components/Autocomplete.md +23 -22
- package/docs/components/Link.md +1 -1
- package/docs/components/Select.md +22 -21
- package/docs/components/Text.md +6 -4
- package/package.json +2 -2
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { hasNamedSlot as e, isPropPresent as t } from "../../Utils/slotOrProp.js";
|
|
2
2
|
import n from "../Icon/Icon.js";
|
|
3
3
|
import { useAlert as r } from "./composables/useAlert.js";
|
|
4
|
-
import
|
|
4
|
+
import i from "../Text/Text.js";
|
|
5
|
+
import { Fragment as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, guardReactiveProps as p, mergeProps as m, normalizeProps as h, openBlock as g, renderSlot as _, toDisplayString as v, unref as y, withCtx as b } from "vue";
|
|
5
6
|
// src/Components/Alert/Alert.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var x = {
|
|
7
8
|
key: 1,
|
|
8
9
|
class: "flex justify-between items-start"
|
|
9
|
-
},
|
|
10
|
+
}, S = { class: "flex items-start gap-x-3" }, C = /*@__PURE__*/ f({
|
|
10
11
|
inheritAttrs: !1,
|
|
11
12
|
__name: "Alert",
|
|
12
13
|
props: {
|
|
@@ -20,19 +21,32 @@ var v = {
|
|
|
20
21
|
title: {},
|
|
21
22
|
variant: {}
|
|
22
23
|
},
|
|
23
|
-
setup(
|
|
24
|
-
let { slots:
|
|
24
|
+
setup(f) {
|
|
25
|
+
let { slots: C, merged: w, bodyBind: T, iconBind: E, rootBind: D, hasTitle: O, titleBind: k, resolvedIcon: A, hasDefaultBody: j } = r(f, {
|
|
25
26
|
shadow: "sm",
|
|
26
27
|
rounded: "sm",
|
|
27
28
|
variant: "flat",
|
|
28
29
|
color: "primary",
|
|
29
30
|
padding: "medium"
|
|
30
31
|
});
|
|
31
|
-
return (r,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
return (r, f) => (g(), c("div", h(p(y(D))), [
|
|
33
|
+
y(e)(y(C), "header") ? _(r.$slots, "header", {}, void 0, void 0, 0) : y(O) ? (g(), c("div", x, [l("div", S, [y(e)(y(C), "icon") ? _(r.$slots, "icon", {}, void 0, void 0, 0) : y(A) ? (g(), o(n, m({ key: 1 }, y(E), { icon: y(A) }), null, 16, ["icon"])) : s("", !0), d(y(i), m({
|
|
34
|
+
as: "div",
|
|
35
|
+
color: "inherit"
|
|
36
|
+
}, y(k)), {
|
|
37
|
+
default: b(() => [y(e)(y(C), "title") ? _(r.$slots, "title", {}, void 0, void 0, 0) : y(t)(y(w).title) ? (g(), c(a, { key: 1 }, [u(v(y(w).title), 1)], 64)) : _(r.$slots, "default", {}, void 0, void 0, 2)]),
|
|
38
|
+
_: 3
|
|
39
|
+
}, 16)]), _(r.$slots, "action")])) : s("", !0),
|
|
40
|
+
y(j) ? (g(), o(y(i), m({
|
|
41
|
+
key: 2,
|
|
42
|
+
as: "div",
|
|
43
|
+
color: "inherit"
|
|
44
|
+
}, y(T)), {
|
|
45
|
+
default: b(() => [_(r.$slots, "default")]),
|
|
46
|
+
_: 3
|
|
47
|
+
}, 16)) : s("", !0),
|
|
48
|
+
_(r.$slots, "footer")
|
|
35
49
|
], 16));
|
|
36
50
|
}
|
|
37
51
|
});
|
|
38
|
-
export {
|
|
52
|
+
export { C as default };
|
|
@@ -3,6 +3,7 @@ import { AlertColor, AlertPadding, AlertRounded, AlertShadow, AlertVariant } fro
|
|
|
3
3
|
import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
|
|
4
4
|
import { IconSource } from '../../Adapters/Icon';
|
|
5
5
|
import { IconProps } from '../Icon';
|
|
6
|
+
import { TextProps } from '../Text';
|
|
6
7
|
export interface AlertColorOverrides {}
|
|
7
8
|
export interface AlertShadowOverrides {}
|
|
8
9
|
export interface AlertPaddingOverrides {}
|
|
@@ -28,9 +29,9 @@ export interface AlertClasses {
|
|
|
28
29
|
}
|
|
29
30
|
export interface AlertCustomProps {
|
|
30
31
|
/**
|
|
31
|
-
* Props forwarded to the default body container.
|
|
32
|
+
* Props forwarded to the `Text` that renders the default body container.
|
|
32
33
|
*/
|
|
33
|
-
body?:
|
|
34
|
+
body?: Partial<Omit<TextProps, "as">>;
|
|
34
35
|
/**
|
|
35
36
|
* Props forwarded to the default `Icon` (`icon` is set by the alert).
|
|
36
37
|
*/
|
|
@@ -40,9 +41,9 @@ export interface AlertCustomProps {
|
|
|
40
41
|
*/
|
|
41
42
|
root?: HTMLAttributes;
|
|
42
43
|
/**
|
|
43
|
-
* Props forwarded to the title container.
|
|
44
|
+
* Props forwarded to the `Text` that renders the title container.
|
|
44
45
|
*/
|
|
45
|
-
title?:
|
|
46
|
+
title?: Partial<Omit<TextProps, "as">>;
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
48
49
|
* Alert banner. Does not set `role` or `aria-live` by default — pass them when needed:
|
|
@@ -8,11 +8,11 @@ export declare function useAlert(props: AlertOwnProps, libDefaults: AlertLibDefa
|
|
|
8
8
|
[name: string]: import('vue').Slot<any> | undefined;
|
|
9
9
|
}>;
|
|
10
10
|
merged: import('vue').ComputedRef<AlertMerged>;
|
|
11
|
-
bodyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('
|
|
11
|
+
bodyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Text').TextProps, "as">> | undefined, {}>>;
|
|
12
12
|
iconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
13
13
|
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<AlertProps, "color" | "icon" | "classes" | "customProps" | "title" | "rounded" | "variant" | "padding" | "shadow">>>;
|
|
14
14
|
hasTitle: import('vue').ComputedRef<boolean>;
|
|
15
|
-
titleBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('
|
|
15
|
+
titleBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Text').TextProps, "as">> | undefined, {}>>;
|
|
16
16
|
resolvedIcon: import('vue').ComputedRef<IconSource | null>;
|
|
17
17
|
hasDefaultBody: import('vue').ComputedRef<boolean>;
|
|
18
18
|
};
|
|
@@ -51,7 +51,7 @@ function y(y, b) {
|
|
|
51
51
|
slots: S,
|
|
52
52
|
merged: w,
|
|
53
53
|
bodyBind: o(() => n(E.value?.body, {}, h({
|
|
54
|
-
"grow
|
|
54
|
+
"grow font-normal text-start": !0,
|
|
55
55
|
[l(P.value, "body") ?? ""]: !0,
|
|
56
56
|
[l(M.value, "text") ?? ""]: !0,
|
|
57
57
|
[l(D.value, "body") ?? ""]: !0
|
|
@@ -72,7 +72,7 @@ function y(y, b) {
|
|
|
72
72
|
}))),
|
|
73
73
|
hasTitle: A,
|
|
74
74
|
titleBind: o(() => n(E.value?.title, {}, h({
|
|
75
|
-
"text-start
|
|
75
|
+
"text-start whitespace-normal": !0,
|
|
76
76
|
"font-normal": !j.value,
|
|
77
77
|
"font-semibold": j.value,
|
|
78
78
|
[l(M.value, "text") ?? ""]: !0,
|
|
@@ -32,6 +32,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
32
32
|
showErrorIcon: boolean;
|
|
33
33
|
clearable: boolean;
|
|
34
34
|
minItemsForSearch: number;
|
|
35
|
+
persistentPlaceholder: boolean;
|
|
35
36
|
searchable: boolean;
|
|
36
37
|
freeSolo: boolean;
|
|
37
38
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -14,7 +14,7 @@ import { cn as M } from "@bridge-ui/core/Utils";
|
|
|
14
14
|
// src/Components/Autocomplete/Autocomplete.vue?vue&type=script&setup=true&lang.ts
|
|
15
15
|
var N = {
|
|
16
16
|
key: 0,
|
|
17
|
-
class: "flex min-w-0 flex-1 flex-wrap items-center gap-0.5"
|
|
17
|
+
class: "flex min-w-0 flex-1 flex-wrap items-center gap-0.5 py-1.5 [&>textarea]:py-0"
|
|
18
18
|
}, P = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "flex min-w-0 flex-1 items-center gap-1"
|
|
@@ -51,6 +51,10 @@ var N = {
|
|
|
51
51
|
options: {},
|
|
52
52
|
optionValue: {},
|
|
53
53
|
overlay: {},
|
|
54
|
+
persistentPlaceholder: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
57
|
+
},
|
|
54
58
|
placeholder: {},
|
|
55
59
|
searchable: {
|
|
56
60
|
type: Boolean,
|
|
@@ -226,6 +226,13 @@ export interface AutocompleteOwnProps extends Omit<FormFieldOwnProps, "field"> {
|
|
|
226
226
|
* @default "auto"
|
|
227
227
|
*/
|
|
228
228
|
overlay?: FieldOverlayMode;
|
|
229
|
+
/**
|
|
230
|
+
* Keeps the placeholder visible next to the chips when `multiple` is set.
|
|
231
|
+
* By default it hides once a value is selected.
|
|
232
|
+
*
|
|
233
|
+
* @default false
|
|
234
|
+
*/
|
|
235
|
+
persistentPlaceholder?: boolean;
|
|
229
236
|
/**
|
|
230
237
|
* Placeholder shown when no value is selected.
|
|
231
238
|
*/
|
|
@@ -487,9 +487,9 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
|
|
|
487
487
|
"aria-expanded": boolean;
|
|
488
488
|
readonly: boolean;
|
|
489
489
|
onKeydown: (event: KeyboardEvent) => void;
|
|
490
|
-
placeholder: string | undefined;
|
|
491
490
|
"aria-autocomplete": string | undefined;
|
|
492
491
|
"aria-activedescendant": string | undefined;
|
|
492
|
+
placeholder: string | undefined;
|
|
493
493
|
} | {
|
|
494
494
|
onInput: (event: Event) => void;
|
|
495
495
|
role: string;
|
|
@@ -498,9 +498,9 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
|
|
|
498
498
|
"aria-expanded": boolean;
|
|
499
499
|
readonly: boolean;
|
|
500
500
|
onKeydown: (event: KeyboardEvent) => void;
|
|
501
|
-
placeholder: string | undefined;
|
|
502
501
|
"aria-autocomplete": string | undefined;
|
|
503
502
|
"aria-activedescendant": string | undefined;
|
|
503
|
+
placeholder: string | undefined;
|
|
504
504
|
}, import('@bridge-ui/core/Utils').MergePartBind<object, "class", {
|
|
505
505
|
id: string;
|
|
506
506
|
disabled: boolean;
|
|
@@ -33,7 +33,8 @@ var Me = [
|
|
|
33
33
|
"disableMaxHeight",
|
|
34
34
|
"hideEmptyMessage",
|
|
35
35
|
"minItemsForSearch",
|
|
36
|
-
"optionDescription"
|
|
36
|
+
"optionDescription",
|
|
37
|
+
"persistentPlaceholder"
|
|
37
38
|
];
|
|
38
39
|
function m(m, h, g, _, Ne) {
|
|
39
40
|
let Pe = de(), v = pe(), y = fe(), Fe = n(), b = e(), x = s(!1), S = s(""), C = s(!1), w = s(-1), T = s([]), E = s([]), D = s([]), O = s(null), k = null, A = a(() => je({
|
|
@@ -278,9 +279,9 @@ function m(m, h, g, _, Ne) {
|
|
|
278
279
|
"aria-expanded": x.value,
|
|
279
280
|
readonly: Ye.value,
|
|
280
281
|
onKeydown: ft,
|
|
281
|
-
placeholder: j.value.placeholder,
|
|
282
282
|
"aria-autocomplete": W.value ? "list" : void 0,
|
|
283
283
|
"aria-activedescendant": x.value ? q.activeDescendantId.value : void 0,
|
|
284
|
+
placeholder: N.value && H.value && !j.value.persistentPlaceholder ? void 0 : j.value.placeholder,
|
|
284
285
|
...N.value ? {
|
|
285
286
|
rows: 1,
|
|
286
287
|
onInput: (e) => {
|
|
@@ -44,11 +44,11 @@ function v(v, y) {
|
|
|
44
44
|
return s(e, C.value.size);
|
|
45
45
|
}), F = i(() => C.value.customProps), I = i(() => t(F.value?.root, S.value.inheritedAttrs, m({
|
|
46
46
|
"inline-flex shrink-0 items-center justify-center overflow-hidden": !0,
|
|
47
|
-
[T.value.root ?? ""]: !0,
|
|
48
47
|
[N.value ?? ""]: !0,
|
|
49
48
|
[j.value ?? ""]: A.value || E.value || D.value,
|
|
50
49
|
[s(M.value, "background") ?? ""]: A.value,
|
|
51
|
-
[s(M.value, "text") ?? ""]: A.value
|
|
50
|
+
[s(M.value, "text") ?? ""]: A.value,
|
|
51
|
+
[T.value.root ?? ""]: !0
|
|
52
52
|
}))), L = i(() => t(F.value?.image, {
|
|
53
53
|
alt: C.value.alt,
|
|
54
54
|
src: C.value.src
|
|
@@ -1,229 +1,230 @@
|
|
|
1
1
|
import { useDateAdapter as e } from "../../../Adapters/Date/useDateAdapter.js";
|
|
2
2
|
import { useResolveMessage as t } from "../../../Adapters/I18n/useI18nAdapter.js";
|
|
3
|
-
import { mergePartBind as n, useBridgeUIComponent as
|
|
4
|
-
import { computed as
|
|
5
|
-
import { get as
|
|
6
|
-
import { CALENDAR_YEAR_PAGE_SIZE as
|
|
7
|
-
import { calendarRoundedProps as
|
|
8
|
-
import { cn as x, mergeBridgeUILayeredClasses as
|
|
3
|
+
import { mergePartBind as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as i, useDefaultTextSizeClass as ee } from "../../../Utils/index.js";
|
|
4
|
+
import { computed as a, getCurrentInstance as o, ref as s, toValue as c, useAttrs as te } from "vue";
|
|
5
|
+
import { get as ne, isFunction as l, isNil as u, omit as d } from "es-toolkit/compat";
|
|
6
|
+
import { CALENDAR_YEAR_PAGE_SIZE as f, applyDateSelection as p, calendarPanelViewFromGranularity as m, getCalendarNavigationMessage as h, getCalendarYearPageStart as g, isCalendarMonthPanelHidden as _, isCalendarYearPanelHidden as v, resolveCalendarFocusDate as y, resolveCalendarMonthSelection as re, resolveCalendarNavigation as ie, resolveCalendarPanelView as b, resolveCalendarYearSelection as ae, resolveDatePickerMode as oe } from "@bridge-ui/core/Domain";
|
|
7
|
+
import { calendarRoundedProps as se } from "@bridge-ui/core/Tokens";
|
|
8
|
+
import { cn as x, mergeBridgeUILayeredClasses as ce, splitComponentProps as le } from "@bridge-ui/core/Utils";
|
|
9
9
|
// src/Components/Calendar/composables/useCalendar.ts
|
|
10
|
-
var
|
|
11
|
-
function S(S, C, w
|
|
12
|
-
let
|
|
13
|
-
bridgeKeys:
|
|
10
|
+
var ue = /* @__PURE__ */ "fill.view.color.error.range.classes.maxDate.minDate.rounded.disabled.multiple.readOnly.timeZone.viewDate.hideYears.hideMonths.customProps.defaultView.granularity.previewDate.startOfWeek.defaultValue.disableDates.disableYears.hideWeekdays.disableMonths.hideOutsideDays".split(".");
|
|
11
|
+
function S(S, de, C, w) {
|
|
12
|
+
let T = te(), E = e(), D = t(), O = a(() => le({
|
|
13
|
+
bridgeKeys: ue,
|
|
14
14
|
props: {
|
|
15
|
-
...
|
|
16
|
-
...
|
|
15
|
+
...T,
|
|
16
|
+
...c(S)
|
|
17
17
|
}
|
|
18
|
-
})), { merged:
|
|
19
|
-
libDefaults:
|
|
18
|
+
})), { merged: k, entry: A } = r({
|
|
19
|
+
libDefaults: de,
|
|
20
20
|
componentName: "Calendar",
|
|
21
|
-
props: () =>
|
|
22
|
-
}), j =
|
|
21
|
+
props: () => O.value.componentProps
|
|
22
|
+
}), j = a(() => k.value.customProps), fe = a(() => d(O.value.inheritedAttrs, [
|
|
23
23
|
"onChange",
|
|
24
24
|
"onViewChange",
|
|
25
25
|
"onViewDateChange",
|
|
26
26
|
"onPreviewDateChange",
|
|
27
27
|
"onUpdate:modelValue"
|
|
28
|
-
])), M =
|
|
29
|
-
props: () =>
|
|
30
|
-
entry:
|
|
31
|
-
}), N =
|
|
32
|
-
range:
|
|
33
|
-
multiple:
|
|
34
|
-
})), F =
|
|
35
|
-
let e =
|
|
28
|
+
])), M = i({
|
|
29
|
+
props: () => O.value.componentProps,
|
|
30
|
+
entry: a(() => {})
|
|
31
|
+
}), N = a(() => k.value.timeZone), P = a(() => oe({
|
|
32
|
+
range: k.value.range,
|
|
33
|
+
multiple: k.value.multiple
|
|
34
|
+
})), F = a(() => c(S)), I = a(() => {
|
|
35
|
+
let e = o()?.vnode.props ?? {}, t = l(e.onViewChange) || l(e["onUpdate:view"]);
|
|
36
36
|
return !u(F.value.view) && t;
|
|
37
|
-
}), L =
|
|
38
|
-
let e =
|
|
37
|
+
}), L = a(() => {
|
|
38
|
+
let e = o()?.vnode.props ?? {}, t = l(e.onViewDateChange) || l(e["onUpdate:viewDate"]);
|
|
39
39
|
return !u(F.value.viewDate) && t;
|
|
40
|
-
}), R =
|
|
41
|
-
hideYears:
|
|
42
|
-
hideMonths:
|
|
40
|
+
}), R = s(b({
|
|
41
|
+
hideYears: k.value.hideYears,
|
|
42
|
+
hideMonths: k.value.hideMonths,
|
|
43
43
|
granularity: F.value.granularity ?? "day",
|
|
44
|
-
view: F.value.view ??
|
|
45
|
-
})), z =
|
|
44
|
+
view: F.value.view ?? k.value.defaultView ?? m(F.value.granularity ?? "day")
|
|
45
|
+
})), z = s(E.value.startOfMonth(u(F.value.viewDate) ? y(C.value, E.value, N.value) : F.value.viewDate, N.value)), B = s(null), V = a(() => k.value.granularity ?? "day"), H = a(() => {
|
|
46
46
|
let e = I.value ? F.value.view ?? "date" : R.value;
|
|
47
|
-
return
|
|
47
|
+
return b({
|
|
48
48
|
view: e,
|
|
49
49
|
granularity: V.value,
|
|
50
|
-
hideYears:
|
|
51
|
-
hideMonths:
|
|
50
|
+
hideYears: k.value.hideYears,
|
|
51
|
+
hideMonths: k.value.hideMonths
|
|
52
52
|
});
|
|
53
|
-
}), U =
|
|
54
|
-
let e = se
|
|
55
|
-
return
|
|
56
|
-
}),
|
|
57
|
-
I.value || (R.value = e),
|
|
53
|
+
}), U = a(() => L.value ? F.value.viewDate : z.value), pe = a(() => String(E.value.getYear(U.value, N.value))), W = a(() => E.value.getMonthNames()[E.value.getMonth(U.value, N.value)] ?? ""), G = a(() => E.value.getYear(U.value, N.value)), me = a(() => E.value.getMonth(U.value, N.value)), K = a(() => u(B.value) ? g(G.value) : B.value), q = a(() => {
|
|
54
|
+
let e = ce(se, A.value?.tokens?.rounded);
|
|
55
|
+
return ne(e, k.value.rounded);
|
|
56
|
+
}), J = (e) => {
|
|
57
|
+
I.value || (R.value = e), w("viewChange", e);
|
|
58
58
|
}, he = () => {
|
|
59
|
-
B.value =
|
|
60
|
-
}, J = (e) => {
|
|
61
|
-
let t = D.value.startOfMonth(e, N.value);
|
|
62
|
-
L.value || (z.value = t), T("viewDateChange", t);
|
|
59
|
+
B.value = g(G.value), J("year");
|
|
63
60
|
}, Y = (e) => {
|
|
64
|
-
|
|
61
|
+
let t = E.value.startOfMonth(e, N.value);
|
|
62
|
+
L.value || (z.value = t), w("viewDateChange", t);
|
|
65
63
|
}, X = (e) => {
|
|
66
|
-
|
|
64
|
+
C.value = e, w("change", e);
|
|
65
|
+
}, Z = (e) => {
|
|
66
|
+
let t = ie({
|
|
67
67
|
direction: e,
|
|
68
68
|
view: H.value,
|
|
69
|
-
adapter:
|
|
69
|
+
adapter: E.value,
|
|
70
70
|
viewDate: U.value,
|
|
71
71
|
timeZone: N.value,
|
|
72
|
-
yearPageStart:
|
|
72
|
+
yearPageStart: K.value
|
|
73
73
|
});
|
|
74
|
-
t.type === "yearPage" ? B.value = t.yearPageStart :
|
|
74
|
+
t.type === "yearPage" ? B.value = t.yearPageStart : Y(t.viewDate);
|
|
75
75
|
}, ge = () => {
|
|
76
|
-
|
|
76
|
+
Z(-1);
|
|
77
77
|
}, _e = () => {
|
|
78
|
-
|
|
78
|
+
Z(1);
|
|
79
79
|
}, ve = () => {
|
|
80
|
-
let e =
|
|
81
|
-
B.value = null,
|
|
80
|
+
let e = E.value.startOfMonth(E.value.now(N.value), N.value);
|
|
81
|
+
B.value = null, Y(e), J(m(V.value));
|
|
82
82
|
}, ye = (e) => {
|
|
83
83
|
B.value = null;
|
|
84
|
-
let t =
|
|
84
|
+
let t = ae({
|
|
85
85
|
year: e,
|
|
86
|
-
adapter:
|
|
86
|
+
adapter: E.value,
|
|
87
87
|
viewDate: U.value,
|
|
88
88
|
timeZone: N.value,
|
|
89
89
|
granularity: V.value,
|
|
90
|
-
hideMonths:
|
|
90
|
+
hideMonths: k.value.hideMonths
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
Y(t.viewDate), t.type === "commit" ? X(p({
|
|
93
93
|
mode: P.value,
|
|
94
|
-
value:
|
|
94
|
+
value: C.value,
|
|
95
95
|
next: t.date,
|
|
96
|
-
adapter:
|
|
96
|
+
adapter: E.value,
|
|
97
97
|
timeZone: N.value,
|
|
98
98
|
granularity: V.value
|
|
99
|
-
})) :
|
|
99
|
+
})) : J(t.view);
|
|
100
100
|
}, be = (e) => {
|
|
101
|
-
let t =
|
|
101
|
+
let t = re({
|
|
102
102
|
month: e,
|
|
103
|
-
adapter:
|
|
103
|
+
adapter: E.value,
|
|
104
104
|
viewDate: U.value,
|
|
105
105
|
timeZone: N.value,
|
|
106
106
|
granularity: V.value
|
|
107
107
|
});
|
|
108
|
-
|
|
108
|
+
Y(t.viewDate), t.type === "commit" ? X(p({
|
|
109
109
|
mode: P.value,
|
|
110
|
-
value:
|
|
110
|
+
value: C.value,
|
|
111
111
|
next: t.date,
|
|
112
|
-
adapter:
|
|
112
|
+
adapter: E.value,
|
|
113
113
|
timeZone: N.value,
|
|
114
114
|
granularity: V.value
|
|
115
|
-
})) :
|
|
116
|
-
}, xe =
|
|
117
|
-
color:
|
|
118
|
-
error:
|
|
119
|
-
rounded:
|
|
120
|
-
maxDate:
|
|
121
|
-
minDate:
|
|
122
|
-
disabled:
|
|
123
|
-
readOnly:
|
|
124
|
-
timeZone:
|
|
125
|
-
})), Se =
|
|
115
|
+
})) : J(t.view);
|
|
116
|
+
}, xe = a(() => ({
|
|
117
|
+
color: k.value.color,
|
|
118
|
+
error: k.value.error,
|
|
119
|
+
rounded: k.value.rounded,
|
|
120
|
+
maxDate: k.value.maxDate,
|
|
121
|
+
minDate: k.value.minDate,
|
|
122
|
+
disabled: k.value.disabled,
|
|
123
|
+
readOnly: k.value.readOnly,
|
|
124
|
+
timeZone: k.value.timeZone
|
|
125
|
+
})), Se = a(() => n(j.value?.root, fe.value, x({
|
|
126
126
|
"flex flex-col overflow-hidden": !0,
|
|
127
|
-
"w-full min-w-72":
|
|
128
|
-
"w-72": !
|
|
127
|
+
"w-full min-w-72": k.value.fill,
|
|
128
|
+
"w-72": !k.value.fill,
|
|
129
129
|
[M.value.root ?? ""]: !0
|
|
130
|
-
}))), Ce =
|
|
130
|
+
}))), Ce = a(() => n(j.value?.header, {}, x({
|
|
131
131
|
"flex items-center justify-between p-2.5": !0,
|
|
132
132
|
[M.value.header ?? ""]: !0
|
|
133
|
-
}))), we =
|
|
133
|
+
}))), we = a(() => n(j.value?.body, {}, x({
|
|
134
134
|
"flex flex-col p-2.5": !0,
|
|
135
135
|
[M.value.body ?? ""]: !0
|
|
136
|
-
}))),
|
|
136
|
+
}))), Te = ee(), Q = a(() => n(j.value?.selector, {
|
|
137
137
|
type: "button",
|
|
138
|
-
disabled:
|
|
138
|
+
disabled: k.value.disabled
|
|
139
139
|
}, x({
|
|
140
|
-
"inline-flex cursor-pointer items-center gap-x-2 px-1.5 py-1
|
|
141
|
-
[
|
|
140
|
+
"inline-flex cursor-pointer items-center gap-x-2 px-1.5 py-1 font-medium text-dark-600 hover:bg-dark-100 focus:outline-none disabled:cursor-not-allowed dark:text-dark-300 dark:hover:bg-dark-800": !0,
|
|
141
|
+
[q.value ?? ""]: !0,
|
|
142
|
+
[Te.value]: !0,
|
|
142
143
|
[M.value.selector ?? ""]: !0
|
|
143
|
-
}))),
|
|
144
|
+
}))), $ = a(() => n(j.value?.navButton, {
|
|
144
145
|
type: "button",
|
|
145
|
-
disabled:
|
|
146
|
+
disabled: k.value.disabled
|
|
146
147
|
}, x({
|
|
147
148
|
"inline-flex size-8 shrink-0 cursor-pointer items-center justify-center text-dark-600 hover:bg-dark-100 disabled:cursor-not-allowed dark:text-dark-300 dark:hover:bg-dark-800": !0,
|
|
148
|
-
[
|
|
149
|
+
[q.value ?? ""]: !0,
|
|
149
150
|
[M.value.navButton ?? ""]: !0
|
|
150
|
-
}))),
|
|
151
|
-
|
|
151
|
+
}))), Ee = a(() => D(h(H.value, -1))), De = a(() => D(h(H.value, 1))), Oe = a(() => n(j.value?.previousButton, {
|
|
152
|
+
...$.value,
|
|
152
153
|
onClick: ge,
|
|
153
154
|
type: "button",
|
|
154
|
-
disabled:
|
|
155
|
-
"aria-label":
|
|
156
|
-
}, x({ [M.value.navButton ?? ""]: !0 }))),
|
|
157
|
-
|
|
155
|
+
disabled: k.value.disabled,
|
|
156
|
+
"aria-label": Ee.value
|
|
157
|
+
}, x({ [M.value.navButton ?? ""]: !0 }))), ke = a(() => n(j.value?.nextButton, {
|
|
158
|
+
...$.value,
|
|
158
159
|
onClick: _e,
|
|
159
160
|
type: "button",
|
|
160
|
-
disabled:
|
|
161
|
-
"aria-label":
|
|
162
|
-
}, x({ [M.value.navButton ?? ""]: !0 }))),
|
|
161
|
+
disabled: k.value.disabled,
|
|
162
|
+
"aria-label": De.value
|
|
163
|
+
}, x({ [M.value.navButton ?? ""]: !0 }))), Ae = a(() => n(j.value?.todayButton, {
|
|
163
164
|
onClick: ve,
|
|
164
165
|
type: "button",
|
|
165
|
-
disabled:
|
|
166
|
-
"aria-label":
|
|
166
|
+
disabled: k.value.disabled,
|
|
167
|
+
"aria-label": D("Today")
|
|
167
168
|
}, x({
|
|
168
169
|
"inline-flex size-8 shrink-0 cursor-pointer items-center justify-center hover:bg-dark-100 disabled:cursor-not-allowed dark:hover:bg-dark-800": !0,
|
|
169
|
-
[
|
|
170
|
+
[q.value ?? ""]: !0,
|
|
170
171
|
[M.value.navButton ?? ""]: !0
|
|
171
|
-
}))),
|
|
172
|
-
...
|
|
172
|
+
}))), je = a(() => n(j.value?.selector, void 0, {
|
|
173
|
+
...Q.value,
|
|
173
174
|
onClick: he,
|
|
174
175
|
type: "button",
|
|
175
|
-
"aria-label":
|
|
176
|
-
disabled:
|
|
176
|
+
"aria-label": D("Select year"),
|
|
177
|
+
disabled: k.value.disabled || v({
|
|
177
178
|
granularity: V.value,
|
|
178
|
-
hideYears:
|
|
179
|
+
hideYears: k.value.hideYears
|
|
179
180
|
})
|
|
180
|
-
})),
|
|
181
|
-
...
|
|
181
|
+
})), Me = a(() => n(j.value?.selector, void 0, {
|
|
182
|
+
...Q.value,
|
|
182
183
|
type: "button",
|
|
183
|
-
onClick: () =>
|
|
184
|
-
"aria-label":
|
|
185
|
-
disabled:
|
|
184
|
+
onClick: () => J("month"),
|
|
185
|
+
"aria-label": D("Select month"),
|
|
186
|
+
disabled: k.value.disabled || _({
|
|
186
187
|
granularity: V.value,
|
|
187
|
-
hideMonths:
|
|
188
|
+
hideMonths: k.value.hideMonths
|
|
188
189
|
})
|
|
189
|
-
})),
|
|
190
|
+
})), Ne = a(() => !v({
|
|
190
191
|
granularity: V.value,
|
|
191
|
-
hideYears:
|
|
192
|
-
})),
|
|
192
|
+
hideYears: k.value.hideYears
|
|
193
|
+
})), Pe = a(() => !_({
|
|
193
194
|
granularity: V.value,
|
|
194
|
-
hideMonths:
|
|
195
|
+
hideMonths: k.value.hideMonths
|
|
195
196
|
}));
|
|
196
197
|
return {
|
|
197
198
|
view: H,
|
|
198
199
|
mode: P,
|
|
199
|
-
model:
|
|
200
|
-
merged:
|
|
200
|
+
model: C,
|
|
201
|
+
merged: k,
|
|
201
202
|
shared: xe,
|
|
202
|
-
showNav:
|
|
203
|
+
showNav: a(() => !0),
|
|
203
204
|
timeZone: N,
|
|
204
205
|
rootBind: Se,
|
|
205
206
|
viewDate: U,
|
|
206
|
-
viewYear:
|
|
207
|
+
viewYear: G,
|
|
207
208
|
bodyBind: we,
|
|
208
209
|
viewMonth: me,
|
|
209
|
-
yearLabel:
|
|
210
|
-
monthLabel:
|
|
210
|
+
yearLabel: pe,
|
|
211
|
+
monthLabel: W,
|
|
211
212
|
headerBind: Ce,
|
|
212
|
-
setViewDate:
|
|
213
|
-
navIconBind:
|
|
213
|
+
setViewDate: Y,
|
|
214
|
+
navIconBind: a(() => j.value?.navIcon),
|
|
214
215
|
granularity: V,
|
|
215
|
-
handleChange:
|
|
216
|
-
nextButtonBind:
|
|
217
|
-
todayButtonBind:
|
|
218
|
-
yearSelectorBind:
|
|
216
|
+
handleChange: X,
|
|
217
|
+
nextButtonBind: ke,
|
|
218
|
+
todayButtonBind: Ae,
|
|
219
|
+
yearSelectorBind: je,
|
|
219
220
|
handleYearSelect: ye,
|
|
220
|
-
showYearSelector:
|
|
221
|
-
monthSelectorBind:
|
|
221
|
+
showYearSelector: Ne,
|
|
222
|
+
monthSelectorBind: Me,
|
|
222
223
|
handleMonthSelect: be,
|
|
223
|
-
showMonthSelector:
|
|
224
|
-
previousButtonBind:
|
|
225
|
-
yearPageStart:
|
|
226
|
-
yearPageSize:
|
|
224
|
+
showMonthSelector: Pe,
|
|
225
|
+
previousButtonBind: Oe,
|
|
226
|
+
yearPageStart: K,
|
|
227
|
+
yearPageSize: f
|
|
227
228
|
};
|
|
228
229
|
}
|
|
229
230
|
export { S as useCalendar };
|