@bridge-ui/vue 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/skills/bridge-ui-forms/SKILL.md +3 -3
- package/dist/Adapters/Examples/icon-fontawesome.js +22 -21
- package/dist/Adapters/Examples/icon-heroicons.js +13 -12
- package/dist/Adapters/Examples/icon-lucide.js +11 -10
- package/dist/Adapters/Examples/icon-phosphor.js +19 -18
- package/dist/Adapters/Examples/icon-tabler.js +10 -9
- package/dist/Adapters/Examples/rich-text-tiptap.js +34 -41
- package/dist/Components/BaseField/composables/useBaseField.d.ts +2 -2
- package/dist/Components/Calendar/Calendar.vue.d.ts +14 -6
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +78 -74
- package/dist/Components/Calendar/calendar.types.d.ts +12 -7
- package/dist/Components/Calendar/composables/useCalendar.d.ts +5 -9
- package/dist/Components/Calendar/composables/useCalendar.js +144 -143
- package/dist/Components/CalendarDate/CalendarDate.vue.d.ts +14 -6
- package/dist/Components/CalendarDate/CalendarDate.vue_vue_type_script_setup_true_lang.js +20 -16
- package/dist/Components/CalendarDate/calendarDate.types.d.ts +13 -8
- package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +4 -8
- package/dist/Components/CalendarDate/composables/useCalendarDate.js +105 -105
- package/dist/Components/CalendarMonth/CalendarMonth.vue.d.ts +9 -2
- package/dist/Components/CalendarMonth/CalendarMonth.vue_vue_type_script_setup_true_lang.js +19 -12
- package/dist/Components/CalendarMonth/calendarMonth.types.d.ts +14 -8
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +4 -7
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.js +92 -89
- package/dist/Components/CalendarRange/CalendarRange.vue.d.ts +14 -6
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +109 -105
- package/dist/Components/CalendarRange/calendarRange.types.d.ts +12 -7
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +5 -9
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +181 -154
- package/dist/Components/CalendarYear/CalendarYear.vue.d.ts +9 -2
- package/dist/Components/CalendarYear/CalendarYear.vue_vue_type_script_setup_true_lang.js +20 -13
- package/dist/Components/CalendarYear/calendarYear.types.d.ts +12 -6
- package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +4 -7
- package/dist/Components/CalendarYear/composables/useCalendarYear.js +91 -88
- package/dist/Components/Carousel/composables/useCarousel.js +117 -117
- package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +9 -2
- package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +48 -44
- package/dist/Components/ColorPicker/colorPicker.types.d.ts +12 -7
- package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +3 -3
- package/dist/Components/ColorPicker/composables/useColorPicker.js +150 -150
- package/dist/Components/DateField/DateField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DatePicker/DatePicker.vue.d.ts +12 -4
- package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +55 -51
- package/dist/Components/DatePicker/composables/useDatePicker.d.ts +3 -3
- package/dist/Components/DatePicker/composables/useDatePicker.js +52 -25
- package/dist/Components/DatePicker/datePicker.types.d.ts +12 -7
- package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateRangePicker/DateRangePicker.vue.d.ts +12 -4
- package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +54 -50
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +3 -3
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +26 -26
- package/dist/Components/DateRangePicker/dateRangePicker.types.d.ts +12 -7
- package/dist/Components/DateTimeField/DateTimeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateTimePicker/DateTimePicker.vue.d.ts +9 -2
- package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +82 -78
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +3 -3
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +64 -63
- package/dist/Components/DateTimePicker/dateTimePicker.types.d.ts +12 -7
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts +12 -4
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +110 -106
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +3 -3
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +71 -70
- package/dist/Components/DateTimeRangePicker/dateTimeRangePicker.types.d.ts +12 -7
- package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/FileUpload/fileUpload.types.d.ts +1 -1
- package/dist/Components/Rating/Rating.js +5 -0
- package/dist/Components/Rating/Rating.vue.d.ts +20 -0
- package/dist/Components/Rating/Rating.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/Components/Rating/composables/useRating.d.ts +112 -0
- package/dist/Components/Rating/composables/useRating.js +190 -0
- package/dist/Components/Rating/index.d.ts +4 -0
- package/dist/Components/Rating/index.js +3 -0
- package/dist/Components/Rating/rating.types.d.ts +107 -0
- package/dist/Components/Sidebar/composables/useSidebar.js +1 -1
- package/dist/Components/Slider/composables/useSlider.d.ts +1 -1
- package/dist/Components/TimeField/TimeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/TimePanel/TimePanel.vue.d.ts +10 -2
- package/dist/Components/TimePanel/TimePanel.vue_vue_type_script_setup_true_lang.js +37 -34
- package/dist/Components/TimePanel/composables/useTimePanel.d.ts +5 -5
- package/dist/Components/TimePanel/composables/useTimePanel.js +108 -109
- package/dist/Components/TimePanel/timePanel.types.d.ts +10 -4
- package/dist/Components/TimePicker/TimePicker.vue.d.ts +10 -2
- package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +46 -42
- package/dist/Components/TimePicker/composables/useTimePicker.d.ts +3 -3
- package/dist/Components/TimePicker/composables/useTimePicker.js +36 -36
- package/dist/Components/TimePicker/timePicker.types.d.ts +12 -7
- package/dist/Components/TimeRangeField/TimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue.d.ts +12 -4
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +72 -68
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +4 -4
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +87 -87
- package/dist/Components/TimeRangePicker/timeRangePicker.types.d.ts +12 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.js +69 -67
- package/docs/README.md +1 -0
- package/docs/components/BaseField.md +3 -3
- package/docs/components/Calendar.md +0 -1
- package/docs/components/CalendarDate.md +0 -1
- package/docs/components/CalendarMonth.md +0 -1
- package/docs/components/CalendarRange.md +0 -1
- package/docs/components/CalendarYear.md +0 -1
- package/docs/components/ColorPicker.md +13 -14
- package/docs/components/DatePicker.md +0 -1
- package/docs/components/DateRangePicker.md +0 -1
- package/docs/components/DateTimePicker.md +0 -1
- package/docs/components/DateTimeRangePicker.md +0 -1
- package/docs/components/Rating.md +86 -0
- package/docs/components/RichTextEditor.md +3 -3
- package/docs/components/TimePanel.md +0 -1
- package/docs/components/TimePicker.md +0 -1
- package/docs/components/TimeRangePicker.md +0 -1
- package/package.json +2 -12
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { MaybeRefOrGetter, SetupContext } from 'vue';
|
|
1
|
+
import { MaybeRefOrGetter, Ref, SetupContext } from 'vue';
|
|
2
2
|
import { DatePickerModel } from '@bridge-ui/core/Domain';
|
|
3
3
|
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
|
|
4
4
|
import { DatePickerEmits, DatePickerOwnProps } from '../datePicker.types';
|
|
5
5
|
type DatePickerLibDefaults = LibDefaultsShape<DatePickerOwnProps, "color" | "rounded" | "startOfWeek">;
|
|
6
6
|
type DatePickerMerged = MergeLibDefaults<DatePickerOwnProps, DatePickerLibDefaults>;
|
|
7
|
-
export declare function useDatePicker(props: MaybeRefOrGetter<DatePickerOwnProps>, libDefaults: DatePickerLibDefaults, emit: SetupContext<DatePickerEmits>["emit"]): {
|
|
7
|
+
export declare function useDatePicker(props: MaybeRefOrGetter<DatePickerOwnProps>, libDefaults: DatePickerLibDefaults, model: Ref<DatePickerModel>, emit: SetupContext<DatePickerEmits>["emit"]): {
|
|
8
8
|
merged: import('vue').ComputedRef<DatePickerMerged>;
|
|
9
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DatePickerOwnProps, "error" | "color" | "fill" | "
|
|
9
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DatePickerOwnProps, "error" | "color" | "fill" | "classes" | "showFooter" | "customProps" | "disabled" | "rounded" | "granularity" | "hideMonths" | "hideOutsideDays" | "hideWeekdays" | "hideYears" | "multiple" | "range" | "startOfWeek" | "timeZone" | "defaultValue" | "readOnly" | "disableDates" | "disableMonths" | "disableYears" | "maxDate" | "minDate" | "defaultView">>>>;
|
|
10
10
|
footerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
11
11
|
showFooter: import('vue').ComputedRef<boolean>;
|
|
12
12
|
handleApply: () => void;
|
|
@@ -1,44 +1,71 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
2
|
import { FIELD_OVERLAY_INJECTION_KEY as r } from "../../FieldOverlay/fieldOverlayInjectionKey.js";
|
|
3
3
|
import { computed as i, inject as a, ref as o, toValue as s, useAttrs as c, watch as l } from "vue";
|
|
4
|
-
import { get as u,
|
|
5
|
-
import { menuRoundedProps as
|
|
6
|
-
import { cn as
|
|
4
|
+
import { get as u, omit as d } from "es-toolkit/compat";
|
|
5
|
+
import { menuRoundedProps as f } from "@bridge-ui/core/Tokens";
|
|
6
|
+
import { cn as p, splitComponentProps as m } from "@bridge-ui/core/Utils";
|
|
7
7
|
//#region src/Components/DatePicker/composables/useDatePicker.ts
|
|
8
|
-
var
|
|
9
|
-
|
|
8
|
+
var h = [
|
|
9
|
+
"fill",
|
|
10
|
+
"color",
|
|
11
|
+
"error",
|
|
12
|
+
"range",
|
|
13
|
+
"classes",
|
|
14
|
+
"maxDate",
|
|
15
|
+
"minDate",
|
|
16
|
+
"rounded",
|
|
17
|
+
"disabled",
|
|
18
|
+
"multiple",
|
|
19
|
+
"readOnly",
|
|
20
|
+
"timeZone",
|
|
21
|
+
"hideYears",
|
|
22
|
+
"hideMonths",
|
|
23
|
+
"showFooter",
|
|
24
|
+
"customProps",
|
|
25
|
+
"defaultView",
|
|
26
|
+
"granularity",
|
|
27
|
+
"startOfWeek",
|
|
28
|
+
"defaultValue",
|
|
29
|
+
"disableDates",
|
|
30
|
+
"disableYears",
|
|
31
|
+
"hideWeekdays",
|
|
32
|
+
"disableMonths",
|
|
33
|
+
"hideOutsideDays"
|
|
34
|
+
];
|
|
35
|
+
function g(g, _, v, y) {
|
|
10
36
|
let b = c(), x = a(r, {
|
|
11
37
|
apply: () => void 0,
|
|
12
38
|
cancel: () => void 0
|
|
13
|
-
}), S = i(() =>
|
|
14
|
-
bridgeKeys:
|
|
39
|
+
}), S = i(() => m({
|
|
40
|
+
bridgeKeys: h,
|
|
15
41
|
props: {
|
|
16
42
|
...b,
|
|
17
|
-
...s(
|
|
43
|
+
...s(g)
|
|
18
44
|
}
|
|
19
45
|
})), { merged: C, entry: w } = t({
|
|
20
|
-
libDefaults:
|
|
46
|
+
libDefaults: _,
|
|
21
47
|
componentName: "DatePicker",
|
|
22
48
|
props: () => S.value.componentProps
|
|
23
|
-
}), T = i(() => C.value.customProps), E = i(() =>
|
|
49
|
+
}), T = i(() => C.value.customProps), E = i(() => d(S.value.inheritedAttrs, [
|
|
24
50
|
"onApply",
|
|
25
51
|
"onCancel",
|
|
26
|
-
"onChange"
|
|
52
|
+
"onChange",
|
|
53
|
+
"onUpdate:modelValue"
|
|
27
54
|
])), D = n({
|
|
28
55
|
entry: w,
|
|
29
56
|
props: () => S.value.componentProps
|
|
30
|
-
}), O =
|
|
31
|
-
l(() => [
|
|
32
|
-
t && (
|
|
57
|
+
}), O = o(v.value);
|
|
58
|
+
l(() => [v.value, C.value.showFooter], ([e, t]) => {
|
|
59
|
+
t && (O.value = e);
|
|
33
60
|
});
|
|
34
|
-
let
|
|
35
|
-
|
|
61
|
+
let k = i(() => C.value.showFooter ? O.value : v.value), A = (e) => {
|
|
62
|
+
v.value = e, y("change", e);
|
|
36
63
|
};
|
|
37
64
|
return {
|
|
38
65
|
merged: C,
|
|
39
66
|
rootBind: i(() => {
|
|
40
|
-
let t = u(
|
|
41
|
-
return e(T.value?.root, E.value,
|
|
67
|
+
let t = u(f, C.value.rounded ?? "md");
|
|
68
|
+
return e(T.value?.root, E.value, p({
|
|
42
69
|
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-900": !0,
|
|
43
70
|
"w-full": C.value.fill,
|
|
44
71
|
"w-fit": !C.value.fill,
|
|
@@ -46,28 +73,28 @@ function _(_, v, y) {
|
|
|
46
73
|
[D.value.root ?? ""]: !0
|
|
47
74
|
}));
|
|
48
75
|
}),
|
|
49
|
-
footerBind: i(() => e(T.value?.footer, {},
|
|
76
|
+
footerBind: i(() => e(T.value?.footer, {}, p({
|
|
50
77
|
"flex items-center justify-end gap-2 border-t border-dark-100 bg-dark-50 px-3 py-2 dark:border-dark-800 dark:bg-dark-950/40": !0,
|
|
51
78
|
[D.value.footer ?? ""]: !0
|
|
52
79
|
}))),
|
|
53
80
|
showFooter: i(() => !!C.value.showFooter),
|
|
54
81
|
handleApply: () => {
|
|
55
|
-
|
|
82
|
+
A(O.value), y("apply"), x.apply();
|
|
56
83
|
},
|
|
57
|
-
displayValue:
|
|
84
|
+
displayValue: k,
|
|
58
85
|
handleCancel: () => {
|
|
59
|
-
|
|
86
|
+
O.value = v.value, y("cancel"), x.cancel();
|
|
60
87
|
},
|
|
61
88
|
handleCalendarChange: (e) => {
|
|
62
89
|
if (C.value.showFooter) {
|
|
63
|
-
|
|
90
|
+
O.value = e;
|
|
64
91
|
return;
|
|
65
92
|
}
|
|
66
|
-
|
|
93
|
+
A(e);
|
|
67
94
|
},
|
|
68
95
|
applyButtonProps: i(() => T.value?.applyButton),
|
|
69
96
|
cancelButtonProps: i(() => T.value?.cancelButton)
|
|
70
97
|
};
|
|
71
98
|
}
|
|
72
99
|
//#endregion
|
|
73
|
-
export {
|
|
100
|
+
export { g as useDatePicker };
|
|
@@ -55,6 +55,10 @@ export interface DatePickerEmits {
|
|
|
55
55
|
* Emitted when Apply is pressed (`showFooter`) or when the value commits.
|
|
56
56
|
*/
|
|
57
57
|
change: [value: DatePickerModel];
|
|
58
|
+
/**
|
|
59
|
+
* Emitted when `v-model` should update.
|
|
60
|
+
*/
|
|
61
|
+
"update:modelValue": [value: DatePickerModel];
|
|
58
62
|
}
|
|
59
63
|
export interface DatePickerOwnProps {
|
|
60
64
|
/**
|
|
@@ -217,12 +221,6 @@ export interface DatePickerOwnProps {
|
|
|
217
221
|
* @default undefined
|
|
218
222
|
*/
|
|
219
223
|
timeZone?: string;
|
|
220
|
-
/**
|
|
221
|
-
* Controlled value.
|
|
222
|
-
*
|
|
223
|
-
* @default undefined
|
|
224
|
-
*/
|
|
225
|
-
value?: DatePickerModel;
|
|
226
224
|
}
|
|
227
225
|
export interface DatePickerSlots {
|
|
228
226
|
/**
|
|
@@ -239,4 +237,11 @@ export interface DatePickerSlots {
|
|
|
239
237
|
*/
|
|
240
238
|
footer?: Slot<FieldOverlayFooterSlotProps>;
|
|
241
239
|
}
|
|
242
|
-
export type DatePickerProps = MergeHtmlProps<DatePickerOwnProps, HTMLAttributes
|
|
240
|
+
export type DatePickerProps = MergeHtmlProps<DatePickerOwnProps, HTMLAttributes> & {
|
|
241
|
+
/**
|
|
242
|
+
* Bound with `v-model` on the component (`defineModel` internally).
|
|
243
|
+
*
|
|
244
|
+
* @default undefined
|
|
245
|
+
*/
|
|
246
|
+
modelValue?: DatePickerModel;
|
|
247
|
+
};
|
package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -104,8 +104,8 @@ var M = { class: "flex min-w-0 flex-1 items-center gap-1" }, N = ["aria-label"],
|
|
|
104
104
|
}, {
|
|
105
105
|
default: k(() => [h(c, {
|
|
106
106
|
fill: D(B),
|
|
107
|
-
value: D(q),
|
|
108
107
|
class: b(D(X)),
|
|
108
|
+
"model-value": D(q),
|
|
109
109
|
"show-footer": D(J),
|
|
110
110
|
orientation: D(Y),
|
|
111
111
|
"read-only": L.readonly,
|
|
@@ -136,7 +136,7 @@ var M = { class: "flex min-w-0 flex-1 items-center gap-1" }, N = ["aria-label"],
|
|
|
136
136
|
name: "footer",
|
|
137
137
|
fn: k((t) => [T(e.$slots, "footer", x(_(t)))]),
|
|
138
138
|
key: "0"
|
|
139
|
-
} : void 0]), 1032, /* @__PURE__ */ "fill.value.
|
|
139
|
+
} : void 0]), 1032, /* @__PURE__ */ "fill.class.model-value.show-footer.orientation.read-only.max-date.min-date.time-zone.onChange.onCancel.hide-years.hide-months.granularity.default-view.error.color.start-of-week.disabled.disable-dates.hide-weekdays.disable-years.disable-months.rounded.custom-props.hide-outside-days".split("."))]),
|
|
140
140
|
_: 3
|
|
141
141
|
}, 8, [
|
|
142
142
|
"overlay",
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
import { DateRangeValue } from '@bridge-ui/core/Domain';
|
|
1
2
|
import { DateRangePickerOwnProps, DateRangePickerSlots } from './dateRangePicker.types';
|
|
2
3
|
type __VLS_Slots = DateRangePickerSlots;
|
|
3
|
-
|
|
4
|
+
type __VLS_Props = DateRangePickerOwnProps;
|
|
5
|
+
type __VLS_ModelProps = {
|
|
6
|
+
modelValue?: null | DateRangeValue;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
10
|
apply: () => any;
|
|
5
11
|
cancel: () => any;
|
|
6
|
-
change: (value:
|
|
7
|
-
|
|
12
|
+
change: (value: DateRangeValue | null) => any;
|
|
13
|
+
"update:modelValue": (...args: unknown[]) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
8
15
|
onApply?: (() => any) | undefined;
|
|
9
16
|
onCancel?: (() => any) | undefined;
|
|
10
|
-
onChange?: ((value:
|
|
17
|
+
onChange?: ((value: DateRangeValue | null) => any) | undefined;
|
|
18
|
+
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
11
19
|
}>, {
|
|
12
20
|
showFooter: boolean;
|
|
13
21
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { useOptionalModel as e } from "../../Utils/useOptionalModel.js";
|
|
2
|
+
import t from "../ActionFooter/ActionFooter.js";
|
|
3
|
+
import n from "../CalendarRange/CalendarRange.js";
|
|
4
|
+
import { useDateRangePicker as r } from "./composables/useDateRangePicker.js";
|
|
5
|
+
import { createCommentVNode as i, createElementBlock as a, createTextVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, mergeModels as u, mergeProps as d, normalizeProps as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g, unref as _, useModel as v, withCtx as y } from "vue";
|
|
5
6
|
//#region src/Components/DateRangePicker/DateRangePicker.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var b = /*@__PURE__*/ c({
|
|
7
8
|
inheritAttrs: !1,
|
|
8
9
|
__name: "DateRangePicker",
|
|
9
|
-
props: {
|
|
10
|
+
props: /*@__PURE__*/ u({
|
|
10
11
|
classes: {},
|
|
11
12
|
color: {},
|
|
12
13
|
customProps: {},
|
|
@@ -33,56 +34,59 @@ var g = /*@__PURE__*/ s({
|
|
|
33
34
|
default: void 0
|
|
34
35
|
},
|
|
35
36
|
startOfWeek: {},
|
|
36
|
-
timeZone: {}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
timeZone: {}
|
|
38
|
+
}, {
|
|
39
|
+
modelValue: {},
|
|
40
|
+
modelModifiers: {}
|
|
41
|
+
}),
|
|
42
|
+
emits: /*@__PURE__*/ u([
|
|
40
43
|
"apply",
|
|
41
44
|
"cancel",
|
|
42
|
-
"change"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
"change",
|
|
46
|
+
"update:modelValue"
|
|
47
|
+
], ["update:modelValue"]),
|
|
48
|
+
setup(c, { emit: u }) {
|
|
49
|
+
let b = u, x = v(c, "modelValue"), S = c, C = m(S.defaultValue ?? null), w = e(x, C), { merged: T, rootBind: E, footerBind: D, showFooter: O, handleApply: k, displayValue: A, handleCancel: j, applyButtonProps: M, cancelButtonProps: N, handleCalendarChange: P } = r(S, {
|
|
46
50
|
rounded: "md",
|
|
47
51
|
startOfWeek: 0,
|
|
48
52
|
color: "primary",
|
|
49
53
|
orientation: "horizontal"
|
|
50
|
-
},
|
|
51
|
-
return (
|
|
52
|
-
fill:
|
|
53
|
-
color:
|
|
54
|
-
error:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"read-only":
|
|
61
|
-
"time-zone":
|
|
62
|
-
"hide-years":
|
|
63
|
-
"hide-months":
|
|
64
|
-
granularity:
|
|
65
|
-
orientation:
|
|
66
|
-
onChange:
|
|
67
|
-
"default-view":
|
|
68
|
-
"start-of-week":
|
|
69
|
-
"disable-dates":
|
|
70
|
-
"hide-weekdays":
|
|
71
|
-
"disable-years":
|
|
72
|
-
"disable-months":
|
|
73
|
-
"hide-outside-days":
|
|
54
|
+
}, w, b);
|
|
55
|
+
return (e, r) => (p(), a("div", f(l(_(E))), [s(n, {
|
|
56
|
+
fill: _(T).fill,
|
|
57
|
+
color: _(T).color,
|
|
58
|
+
error: _(T).error,
|
|
59
|
+
rounded: _(T).rounded,
|
|
60
|
+
"max-date": _(T).maxDate,
|
|
61
|
+
"min-date": _(T).minDate,
|
|
62
|
+
disabled: _(T).disabled,
|
|
63
|
+
"model-value": _(A),
|
|
64
|
+
"read-only": _(T).readOnly,
|
|
65
|
+
"time-zone": _(T).timeZone,
|
|
66
|
+
"hide-years": _(T).hideYears,
|
|
67
|
+
"hide-months": _(T).hideMonths,
|
|
68
|
+
granularity: _(T).granularity,
|
|
69
|
+
orientation: _(T).orientation,
|
|
70
|
+
onChange: _(P),
|
|
71
|
+
"default-view": _(T).defaultView,
|
|
72
|
+
"start-of-week": _(T).startOfWeek,
|
|
73
|
+
"disable-dates": _(T).disableDates,
|
|
74
|
+
"hide-weekdays": _(T).hideWeekdays,
|
|
75
|
+
"disable-years": _(T).disableYears,
|
|
76
|
+
"disable-months": _(T).disableMonths,
|
|
77
|
+
"hide-outside-days": _(T).hideOutsideDays
|
|
74
78
|
}, {
|
|
75
|
-
day:
|
|
79
|
+
day: y((t) => [h(e.$slots, "day", f(l(t)), () => [o(g(t.label), 1)])]),
|
|
76
80
|
_: 3
|
|
77
81
|
}, 8, [
|
|
78
82
|
"fill",
|
|
79
83
|
"color",
|
|
80
84
|
"error",
|
|
81
|
-
"value",
|
|
82
85
|
"rounded",
|
|
83
86
|
"max-date",
|
|
84
87
|
"min-date",
|
|
85
88
|
"disabled",
|
|
89
|
+
"model-value",
|
|
86
90
|
"read-only",
|
|
87
91
|
"time-zone",
|
|
88
92
|
"hide-years",
|
|
@@ -97,22 +101,22 @@ var g = /*@__PURE__*/ s({
|
|
|
97
101
|
"disable-years",
|
|
98
102
|
"disable-months",
|
|
99
103
|
"hide-outside-days"
|
|
100
|
-
]),
|
|
101
|
-
apply:
|
|
102
|
-
cancel:
|
|
103
|
-
}, () => [
|
|
104
|
-
onApply:
|
|
105
|
-
onCancel:
|
|
104
|
+
]), _(O) ? (p(), a("div", f(d({ key: 0 }, _(D))), [h(e.$slots, "footer", {
|
|
105
|
+
apply: _(k),
|
|
106
|
+
cancel: _(j)
|
|
107
|
+
}, () => [s(_(t), {
|
|
108
|
+
onApply: _(k),
|
|
109
|
+
onCancel: _(j),
|
|
106
110
|
"custom-props": {
|
|
107
|
-
applyButton:
|
|
108
|
-
cancelButton:
|
|
111
|
+
applyButton: _(M),
|
|
112
|
+
cancelButton: _(N)
|
|
109
113
|
}
|
|
110
114
|
}, null, 8, [
|
|
111
115
|
"onApply",
|
|
112
116
|
"onCancel",
|
|
113
117
|
"custom-props"
|
|
114
|
-
])])], 16)) :
|
|
118
|
+
])])], 16)) : i("", !0)], 16));
|
|
115
119
|
}
|
|
116
120
|
});
|
|
117
121
|
//#endregion
|
|
118
|
-
export {
|
|
122
|
+
export { b as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { MaybeRefOrGetter, SetupContext } from 'vue';
|
|
1
|
+
import { MaybeRefOrGetter, Ref, SetupContext } from 'vue';
|
|
2
2
|
import { DateRangeValue } from '@bridge-ui/core/Domain';
|
|
3
3
|
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
|
|
4
4
|
import { DateRangePickerEmits, DateRangePickerOwnProps } from '../dateRangePicker.types';
|
|
5
5
|
type DateRangePickerLibDefaults = LibDefaultsShape<DateRangePickerOwnProps, "color" | "rounded" | "orientation" | "startOfWeek">;
|
|
6
6
|
type DateRangePickerMerged = MergeLibDefaults<DateRangePickerOwnProps, DateRangePickerLibDefaults>;
|
|
7
|
-
export declare function useDateRangePicker(props: MaybeRefOrGetter<DateRangePickerOwnProps>, libDefaults: DateRangePickerLibDefaults, emit: SetupContext<DateRangePickerEmits>["emit"]): {
|
|
7
|
+
export declare function useDateRangePicker(props: MaybeRefOrGetter<DateRangePickerOwnProps>, libDefaults: DateRangePickerLibDefaults, model: Ref<null | DateRangeValue>, emit: SetupContext<DateRangePickerEmits>["emit"]): {
|
|
8
8
|
merged: import('vue').ComputedRef<DateRangePickerMerged>;
|
|
9
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DateRangePickerOwnProps, "error" | "color" | "fill" | "orientation" | "
|
|
9
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DateRangePickerOwnProps, "error" | "color" | "fill" | "orientation" | "classes" | "showFooter" | "customProps" | "disabled" | "rounded" | "granularity" | "hideMonths" | "hideOutsideDays" | "hideWeekdays" | "hideYears" | "startOfWeek" | "timeZone" | "defaultValue" | "readOnly" | "disableDates" | "disableMonths" | "disableYears" | "maxDate" | "minDate" | "defaultView">>>>;
|
|
10
10
|
footerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
11
11
|
showFooter: import('vue').ComputedRef<boolean>;
|
|
12
12
|
handleApply: () => void;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
2
|
import { FIELD_OVERLAY_INJECTION_KEY as r } from "../../FieldOverlay/fieldOverlayInjectionKey.js";
|
|
3
3
|
import { computed as i, inject as a, ref as o, toValue as s, useAttrs as c, watch as l } from "vue";
|
|
4
|
-
import { get as u,
|
|
5
|
-
import { menuRoundedProps as
|
|
6
|
-
import { cn as
|
|
4
|
+
import { get as u, omit as d } from "es-toolkit/compat";
|
|
5
|
+
import { menuRoundedProps as f } from "@bridge-ui/core/Tokens";
|
|
6
|
+
import { cn as p, splitComponentProps as m } from "@bridge-ui/core/Utils";
|
|
7
7
|
//#region src/Components/DateRangePicker/composables/useDateRangePicker.ts
|
|
8
|
-
var
|
|
8
|
+
var h = [
|
|
9
9
|
"fill",
|
|
10
10
|
"color",
|
|
11
11
|
"error",
|
|
12
|
-
"value",
|
|
13
12
|
"classes",
|
|
14
13
|
"maxDate",
|
|
15
14
|
"minDate",
|
|
@@ -32,39 +31,40 @@ var g = [
|
|
|
32
31
|
"disableMonths",
|
|
33
32
|
"hideOutsideDays"
|
|
34
33
|
];
|
|
35
|
-
function
|
|
34
|
+
function g(g, _, v, y) {
|
|
36
35
|
let b = c(), x = a(r, {
|
|
37
36
|
apply: () => void 0,
|
|
38
37
|
cancel: () => void 0
|
|
39
|
-
}), S = i(() =>
|
|
40
|
-
bridgeKeys:
|
|
38
|
+
}), S = i(() => m({
|
|
39
|
+
bridgeKeys: h,
|
|
41
40
|
props: {
|
|
42
41
|
...b,
|
|
43
|
-
...s(
|
|
42
|
+
...s(g)
|
|
44
43
|
}
|
|
45
44
|
})), { merged: C, entry: w } = t({
|
|
46
|
-
libDefaults:
|
|
45
|
+
libDefaults: _,
|
|
47
46
|
componentName: "DateRangePicker",
|
|
48
47
|
props: () => S.value.componentProps
|
|
49
|
-
}), T = i(() => C.value.customProps), E = i(() =>
|
|
48
|
+
}), T = i(() => C.value.customProps), E = i(() => d(S.value.inheritedAttrs, [
|
|
50
49
|
"onApply",
|
|
51
50
|
"onCancel",
|
|
52
|
-
"onChange"
|
|
51
|
+
"onChange",
|
|
52
|
+
"onUpdate:modelValue"
|
|
53
53
|
])), D = n({
|
|
54
54
|
entry: w,
|
|
55
55
|
props: () => S.value.componentProps
|
|
56
|
-
}), O =
|
|
57
|
-
l(() => [
|
|
58
|
-
t && (
|
|
56
|
+
}), O = o(v.value);
|
|
57
|
+
l(() => [v.value, C.value.showFooter], ([e, t]) => {
|
|
58
|
+
t && (O.value = e);
|
|
59
59
|
});
|
|
60
|
-
let
|
|
61
|
-
|
|
60
|
+
let k = i(() => C.value.showFooter ? O.value : v.value), A = (e) => {
|
|
61
|
+
v.value = e, y("change", e);
|
|
62
62
|
};
|
|
63
63
|
return {
|
|
64
64
|
merged: C,
|
|
65
65
|
rootBind: i(() => {
|
|
66
|
-
let t = u(
|
|
67
|
-
return e(T.value?.root, E.value,
|
|
66
|
+
let t = u(f, C.value.rounded ?? "md");
|
|
67
|
+
return e(T.value?.root, E.value, p({
|
|
68
68
|
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-900": !0,
|
|
69
69
|
"w-full": C.value.fill,
|
|
70
70
|
"w-fit": !C.value.fill,
|
|
@@ -72,28 +72,28 @@ function _(_, v, y) {
|
|
|
72
72
|
[D.value.root ?? ""]: !0
|
|
73
73
|
}));
|
|
74
74
|
}),
|
|
75
|
-
footerBind: i(() => e(T.value?.footer, {},
|
|
75
|
+
footerBind: i(() => e(T.value?.footer, {}, p({
|
|
76
76
|
"flex items-center justify-end gap-2 border-t border-dark-100 bg-dark-50 px-3 py-2 dark:border-dark-800 dark:bg-dark-950/40": !0,
|
|
77
77
|
[D.value.footer ?? ""]: !0
|
|
78
78
|
}))),
|
|
79
79
|
showFooter: i(() => !!C.value.showFooter),
|
|
80
80
|
handleApply: () => {
|
|
81
|
-
|
|
81
|
+
A(O.value), y("apply"), x.apply();
|
|
82
82
|
},
|
|
83
|
-
displayValue:
|
|
83
|
+
displayValue: k,
|
|
84
84
|
handleCancel: () => {
|
|
85
|
-
|
|
85
|
+
O.value = v.value, y("cancel"), x.cancel();
|
|
86
86
|
},
|
|
87
87
|
handleCalendarChange: (e) => {
|
|
88
88
|
if (C.value.showFooter) {
|
|
89
|
-
|
|
89
|
+
O.value = e;
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
A(e);
|
|
93
93
|
},
|
|
94
94
|
applyButtonProps: i(() => T.value?.applyButton),
|
|
95
95
|
cancelButtonProps: i(() => T.value?.cancelButton)
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
|
-
export {
|
|
99
|
+
export { g as useDateRangePicker };
|
|
@@ -56,6 +56,10 @@ export interface DateRangePickerEmits {
|
|
|
56
56
|
* Emitted when Apply is pressed (`showFooter`) or when the value commits.
|
|
57
57
|
*/
|
|
58
58
|
change: [value: null | DateRangeValue];
|
|
59
|
+
/**
|
|
60
|
+
* Emitted when `v-model` should update.
|
|
61
|
+
*/
|
|
62
|
+
"update:modelValue": [value: null | DateRangeValue];
|
|
59
63
|
}
|
|
60
64
|
export interface DateRangePickerOwnProps {
|
|
61
65
|
/**
|
|
@@ -209,12 +213,6 @@ export interface DateRangePickerOwnProps {
|
|
|
209
213
|
* @default undefined
|
|
210
214
|
*/
|
|
211
215
|
timeZone?: string;
|
|
212
|
-
/**
|
|
213
|
-
* Controlled value.
|
|
214
|
-
*
|
|
215
|
-
* @default undefined
|
|
216
|
-
*/
|
|
217
|
-
value?: null | DateRangeValue;
|
|
218
216
|
}
|
|
219
217
|
export interface DateRangePickerSlots {
|
|
220
218
|
/**
|
|
@@ -231,4 +229,11 @@ export interface DateRangePickerSlots {
|
|
|
231
229
|
*/
|
|
232
230
|
footer?: Slot<FieldOverlayFooterSlotProps>;
|
|
233
231
|
}
|
|
234
|
-
export type DateRangePickerProps = MergeHtmlProps<DateRangePickerOwnProps, HTMLAttributes
|
|
232
|
+
export type DateRangePickerProps = MergeHtmlProps<DateRangePickerOwnProps, HTMLAttributes> & {
|
|
233
|
+
/**
|
|
234
|
+
* Bound with `v-model` on the component (`defineModel` internally).
|
|
235
|
+
*
|
|
236
|
+
* @default undefined
|
|
237
|
+
*/
|
|
238
|
+
modelValue?: null | DateRangeValue;
|
|
239
|
+
};
|
|
@@ -108,8 +108,8 @@ var M = { class: "flex min-w-0 flex-1 items-center gap-1" }, N = ["aria-label"],
|
|
|
108
108
|
}, {
|
|
109
109
|
default: k(() => [h(D(c), {
|
|
110
110
|
fill: D(B),
|
|
111
|
-
value: D(q),
|
|
112
111
|
class: b(D(J)),
|
|
112
|
+
"model-value": D(q),
|
|
113
113
|
ampm: D(Y).ampm,
|
|
114
114
|
"show-footer": D(K),
|
|
115
115
|
"read-only": L.readonly,
|
|
@@ -144,7 +144,7 @@ var M = { class: "flex min-w-0 flex-1 items-center gap-1" }, N = ["aria-label"],
|
|
|
144
144
|
name: "footer",
|
|
145
145
|
fn: k((t) => [T(e.$slots, "footer", x(_(t)))]),
|
|
146
146
|
key: "0"
|
|
147
|
-
} : void 0]), 1032, /* @__PURE__ */ "fill.value.
|
|
147
|
+
} : void 0]), 1032, /* @__PURE__ */ "fill.class.model-value.ampm.show-footer.read-only.max-date.min-date.max-time.min-time.onChange.onCancel.interval.time-zone.hide-years.error.color.hide-months.disabled.show-seconds.default-view.start-of-week.custom-props.rounded.disable-dates.hide-weekdays.disable-times.disable-years.disable-months.hide-outside-days".split("."))]),
|
|
148
148
|
_: 3
|
|
149
149
|
}, 8, [
|
|
150
150
|
"overlay",
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { DateTimePickerOwnProps, DateTimePickerSlots } from './dateTimePicker.types';
|
|
2
2
|
type __VLS_Slots = DateTimePickerSlots;
|
|
3
|
-
|
|
3
|
+
type __VLS_Props = DateTimePickerOwnProps;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: Date | null;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
9
|
apply: () => any;
|
|
5
10
|
cancel: () => any;
|
|
6
11
|
change: (value: Date | null) => any;
|
|
7
|
-
|
|
12
|
+
"update:modelValue": (...args: unknown[]) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
8
14
|
onApply?: (() => any) | undefined;
|
|
9
15
|
onCancel?: (() => any) | undefined;
|
|
10
16
|
onChange?: ((value: Date | null) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
11
18
|
}>, {
|
|
12
19
|
showFooter: boolean;
|
|
13
20
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|