@witchcraft/ui 0.2.1-beta.3 → 0.2.2
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/module.json +1 -1
- package/dist/module.mjs +20 -4
- package/dist/runtime/build/WitchcraftUiResolver.d.ts +2 -2
- package/dist/runtime/build/generateTheme.js +2 -2
- package/dist/runtime/components/Aria/Aria.d.vue.ts +5 -0
- package/dist/runtime/components/Aria/Aria.vue +4 -2
- package/dist/runtime/components/Aria/Aria.vue.d.ts +1 -1
- package/dist/runtime/components/Icon/Icon.d.vue.ts +21 -0
- package/dist/runtime/components/Icon/Icon.vue +3 -3
- package/dist/runtime/components/Icon/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/LibButton/LibButton.d.vue.ts +36 -0
- package/dist/runtime/components/LibButton/LibButton.vue +9 -4
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +1 -1
- package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +42 -0
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +3 -4
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +1 -1
- package/dist/runtime/components/LibColorInput/LibColorInput.d.vue.ts +63 -0
- package/dist/runtime/components/LibColorInput/LibColorInput.vue +15 -8
- package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +1 -1
- package/dist/runtime/components/LibColorPicker/LibColorPicker.d.vue.ts +61 -0
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +10 -6
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibColorPicker/utils/truncate.js +1 -1
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.d.vue.ts +22 -0
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +5 -2
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibDatePicker.d.vue.ts +40 -0
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.d.vue.ts +34 -0
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +8 -6
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.d.vue.ts +34 -0
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +7 -5
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.d.vue.ts +22 -0
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDebug/LibDebug.d.vue.ts +32 -0
- package/dist/runtime/components/LibDebug/LibDebug.vue +9 -4
- package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +1 -1
- package/dist/runtime/components/LibDevOnly/LibDevOnly.d.vue.ts +25 -0
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +2 -1
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +4 -1
- package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +43 -0
- package/dist/runtime/components/LibFileInput/LibFileInput.vue +29 -13
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +2 -2
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +165 -0
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +42 -12
- package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +26 -0
- package/dist/runtime/components/LibLabel/LibLabel.vue +2 -2
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +3 -3
- package/dist/runtime/components/LibMultiValues/LibMultiValues.d.vue.ts +29 -0
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +1 -2
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +2 -2
- package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +17 -0
- package/dist/runtime/components/LibNotifications/LibNotification.vue +19 -8
- package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +13 -0
- package/dist/runtime/components/LibNotifications/LibNotifications.vue +10 -6
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +2 -2
- package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +104 -0
- package/dist/runtime/components/LibPagination/LibPagination.vue +25 -12
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +2 -2
- package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +14 -0
- package/dist/runtime/components/LibPalette/LibPalette.vue +6 -5
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +5 -5
- package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +46 -0
- package/dist/runtime/components/LibPopup/LibPopup.vue +6 -4
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +3 -3
- package/dist/runtime/components/LibProgressBar/LibProgressBar.d.vue.ts +41 -0
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +5 -3
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +9 -9
- package/dist/runtime/components/LibRecorder/LibRecorder.d.vue.ts +77 -0
- package/dist/runtime/components/LibRecorder/LibRecorder.vue +1 -1
- package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +2 -2
- package/dist/runtime/components/LibRoot/LibRoot.d.vue.ts +41 -0
- package/dist/runtime/components/LibRoot/LibRoot.vue +11 -6
- package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +1 -1
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.d.vue.ts +35 -0
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +1 -1
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +1 -1
- package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +94 -0
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +6 -4
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +1 -1
- package/dist/runtime/components/LibTable/LibTable.d.vue.ts +45 -0
- package/dist/runtime/components/LibTable/LibTable.vue +23 -8
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +1 -1
- package/dist/runtime/components/Template/NAME.d.vue.ts +17 -0
- package/dist/runtime/components/Template/NAME.vue +2 -3
- package/dist/runtime/components/Template/NAME.vue.d.ts +1 -1
- package/dist/runtime/components/TestControls/TestControls.d.vue.ts +5 -0
- package/dist/runtime/components/TestControls/TestControls.vue +4 -2
- package/dist/runtime/components/TestControls/TestControls.vue.d.ts +1 -1
- package/dist/runtime/composables/useDragWithThreshold.d.ts +1 -1
- package/dist/runtime/composables/useInjectedI18n.d.ts +1 -1
- package/dist/runtime/composables/useScrollNearContainerEdges.d.ts +1 -1
- package/dist/runtime/composables/useSetupI18n.d.ts +1 -1
- package/dist/runtime/composables/useSuggestions.d.ts +2 -2
- package/dist/runtime/helpers/NotificationHandler.d.ts +1 -1
- package/dist/runtime/helpers/base64ToImg.js +2 -2
- package/dist/runtime/tailwind/themeConvertionOpts.d.ts +1 -1
- package/dist/runtime/types/index.d.ts +1 -1
- package/dist/runtime/utils/notifyIfError.d.ts +1 -1
- package/package.json +9 -10
- package/src/module.ts +41 -33
- package/src/runtime/build/WitchcraftUiResolver.ts +3 -3
- package/src/runtime/build/generateTheme.ts +3 -2
- package/src/runtime/build/unpluginIconViteOptions.ts +1 -1
- package/src/runtime/components/Aria/Aria.vue +5 -6
- package/src/runtime/components/Focus.stories.ts +11 -12
- package/src/runtime/components/Icon/Icon.vue +5 -9
- package/src/runtime/components/LibButton/LibButton.stories.ts +21 -22
- package/src/runtime/components/LibButton/LibButton.vue +23 -21
- package/src/runtime/components/LibCheckbox/LibCheckbox.stories.ts +6 -10
- package/src/runtime/components/LibCheckbox/LibCheckbox.vue +17 -19
- package/src/runtime/components/LibColorInput/LibColorInput.stories.ts +8 -13
- package/src/runtime/components/LibColorInput/LibColorInput.vue +49 -45
- package/src/runtime/components/LibColorPicker/LibColorPicker.stories.ts +14 -18
- package/src/runtime/components/LibColorPicker/LibColorPicker.vue +50 -52
- package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +1 -2
- package/src/runtime/components/LibColorPicker/utils/safeConvertToRgba.ts +1 -2
- package/src/runtime/components/LibColorPicker/utils/truncate.ts +1 -2
- package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts +5 -8
- package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +11 -9
- package/src/runtime/components/LibDatePicker/LibDatePicker.stories.ts +14 -15
- package/src/runtime/components/LibDatePicker/LibDatePicker.vue +1 -2
- package/src/runtime/components/LibDatePicker/LibRangeDatePicker.vue +13 -13
- package/src/runtime/components/LibDatePicker/LibSingleDatePicker.vue +9 -8
- package/src/runtime/components/LibDatePicker/LibTimeZonePicker.vue +2 -1
- package/src/runtime/components/LibDatePicker/helpers.ts +0 -2
- package/src/runtime/components/LibDebug/LibDebug.stories.ts +11 -15
- package/src/runtime/components/LibDebug/LibDebug.vue +14 -11
- package/src/runtime/components/LibDevOnly/LibDevOnly.vue +8 -4
- package/src/runtime/components/LibFileInput/LibFileInput.stories.ts +12 -15
- package/src/runtime/components/LibFileInput/LibFileInput.vue +65 -47
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +77 -84
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +73 -48
- package/src/runtime/components/LibLabel/LibLabel.stories.ts +4 -8
- package/src/runtime/components/LibLabel/LibLabel.vue +8 -8
- package/src/runtime/components/LibMultiValues/LibMultiValues.stories.ts +10 -15
- package/src/runtime/components/LibMultiValues/LibMultiValues.vue +14 -18
- package/src/runtime/components/LibNotifications/LibNotification.stories.ts +30 -34
- package/src/runtime/components/LibNotifications/LibNotification.vue +27 -17
- package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +11 -15
- package/src/runtime/components/LibNotifications/LibNotifications.vue +21 -16
- package/src/runtime/components/LibPagination/LibPagination.stories.ts +5 -9
- package/src/runtime/components/LibPagination/LibPagination.vue +46 -32
- package/src/runtime/components/LibPalette/LibPalette.stories.ts +3 -7
- package/src/runtime/components/LibPalette/LibPalette.vue +13 -12
- package/src/runtime/components/LibPopup/LibPopup.stories.ts +19 -23
- package/src/runtime/components/LibPopup/LibPopup.vue +31 -35
- package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +13 -17
- package/src/runtime/components/LibProgressBar/LibProgressBar.vue +36 -33
- package/src/runtime/components/LibRecorder/LibRecorder.stories.ts +11 -12
- package/src/runtime/components/LibRecorder/LibRecorder.vue +34 -34
- package/src/runtime/components/LibRoot/LibRoot.vue +16 -12
- package/src/runtime/components/LibSimpleInput/LibSimpleInput.stories.ts +20 -24
- package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +17 -21
- package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +16 -19
- package/src/runtime/components/LibSuggestions/LibSuggestions.vue +28 -30
- package/src/runtime/components/LibTable/LibTable.stories.ts +30 -33
- package/src/runtime/components/LibTable/LibTable.vue +38 -24
- package/src/runtime/components/Reset.stories.ts +3 -6
- package/src/runtime/components/Scrolling.stories.ts +5 -8
- package/src/runtime/components/Template/NAME.vue +11 -11
- package/src/runtime/components/Template/TemplateStory.ts +9 -10
- package/src/runtime/components/TestControls/TestControls.vue +5 -5
- package/src/runtime/components/shared/props.ts +4 -6
- package/src/runtime/components/shared/storyHelpers/playInput.ts +2 -3
- package/src/runtime/components/shared/storyHelpers/playSuggestions.ts +5 -9
- package/src/runtime/composables/useAccesibilityOutline.ts +1 -1
- package/src/runtime/composables/useAriaLabel.ts +1 -1
- package/src/runtime/composables/useDarkMode.ts +15 -19
- package/src/runtime/composables/useDragWithThreshold.ts +6 -8
- package/src/runtime/composables/useGlobalResizeObserver.ts +0 -1
- package/src/runtime/composables/useInjectedDarkMode.ts +2 -2
- package/src/runtime/composables/useInjectedI18n.ts +1 -1
- package/src/runtime/composables/useInjectedLocale.ts +3 -4
- package/src/runtime/composables/useScrollNearContainerEdges.stories.ts +4 -4
- package/src/runtime/composables/useScrollNearContainerEdges.ts +12 -13
- package/src/runtime/composables/useSetupI18n.ts +4 -7
- package/src/runtime/composables/useSetupLocale.ts +3 -5
- package/src/runtime/composables/useSuggestions.ts +25 -30
- package/src/runtime/directives/vDetectFlex.ts +5 -8
- package/src/runtime/directives/vExtractRootEl.ts +1 -1
- package/src/runtime/directives/vResizableCols.ts +3 -7
- package/src/runtime/directives/vResizeObserver.ts +1 -2
- package/src/runtime/globalResizeObserver.ts +0 -1
- package/src/runtime/helpers/NotificationHandler.ts +8 -12
- package/src/runtime/helpers/base64ToImg.ts +2 -3
- package/src/runtime/helpers/createNoonUtcDate.ts +0 -1
- package/src/runtime/helpers/defaultTranslationFunction.ts +0 -1
- package/src/runtime/helpers/getTimeZoneList.ts +0 -1
- package/src/runtime/helpers/readFile.ts +2 -2
- package/src/runtime/helpers/resizeObserverWrapper.ts +0 -1
- package/src/runtime/helpers/storybook.ts +2 -3
- package/src/runtime/main.lib.ts +0 -2
- package/src/runtime/nuxt/plugins/vue-plugin.ts +4 -5
- package/src/runtime/tailwind/themeConvertionOpts.ts +3 -4
- package/src/runtime/theme.ts +0 -1
- package/src/runtime/types/index.ts +3 -4
- package/src/runtime/utils/notifyIfError.ts +2 -2
- package/src/runtime/utils/twMerge.ts +2 -2
- package/src/runtime/vue/VueComponentsPlugin.ts +1 -2
- package/src/runtime/vue/registerComponents.ts +0 -1
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
<component :is="darkModeState === 'dark' ? IFaSolidMoon : darkModeState === 'light' ? IPhSunBold : IFa6SolidCircleHalfStroke"/>
|
|
21
21
|
</icon>
|
|
22
22
|
</template>
|
|
23
|
-
<template
|
|
23
|
+
<template
|
|
24
|
+
#default
|
|
25
|
+
v-if="showLabel"
|
|
26
|
+
>
|
|
24
27
|
<div class="dark-mode-switcher--label pr-[2px]">
|
|
25
28
|
{{ t(`dark-mode-switcher.${darkModeState}`) }}
|
|
26
29
|
</div>
|
|
@@ -58,6 +61,6 @@ onMounted(() => {
|
|
|
58
61
|
|
|
59
62
|
<script>
|
|
60
63
|
export default {
|
|
61
|
-
name: "
|
|
64
|
+
name: "LibDarkModeSwitcher"
|
|
62
65
|
};
|
|
63
66
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ButtonHTMLAttributes } from "vue";
|
|
2
2
|
import type { TailwindClassProp } from "../shared/props.js.js";
|
|
3
|
-
declare const _default: import("vue").DefineComponent<Props,
|
|
3
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
4
|
"update:darkMode": (value: boolean) => any;
|
|
5
5
|
"update:darkModeState": (value: "system" | "dark" | "light") => any;
|
|
6
6
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { RangeDate, SingleDate } from "../../types/index.js.js";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
showTime?: boolean;
|
|
4
|
+
id?: string;
|
|
5
|
+
/** The fallback suggested date when the modelValue is undefined (it will not update modelValue, it only serves as a suggestions and is used internally in the temporary value). If ignoring the time element, you should probably use the {@link createNoonTodayUtc} function (`createNonTodayUtc().toDate(())`) in the helpers, otherwise `new Date()` (the default) will do. */
|
|
6
|
+
fallbackDate?: Date;
|
|
7
|
+
/** The local user's timezone, defaults to @internationalized/date's getLocalTimeZone(). */
|
|
8
|
+
timeZone?: string;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
11
|
+
/**
|
|
12
|
+
* modelValue can be undefined or an object with start/end undefined, but it must be passed, otherwise we can't tell the difference between a single date and a range date.
|
|
13
|
+
*
|
|
14
|
+
* In the case of an undefined date, the current date at NOON UTC will be used to avoid the date changing.
|
|
15
|
+
*
|
|
16
|
+
* The @internationalized/date library's fromDate function is used internally to convert the date given (should be UTC) to the local time zone. It's converted back via it's toDate function.
|
|
17
|
+
*/
|
|
18
|
+
modelValue: SingleDate | RangeDate;
|
|
19
|
+
};
|
|
20
|
+
declare var __VLS_8: any;
|
|
21
|
+
type __VLS_Slots = {} & {
|
|
22
|
+
default?: (props: typeof __VLS_8) => any;
|
|
23
|
+
};
|
|
24
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
"update:modelValue": (value: SingleDate | RangeDate) => any;
|
|
26
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
27
|
+
"onUpdate:modelValue"?: ((value: SingleDate | RangeDate) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
id: string;
|
|
30
|
+
fallbackDate: Date;
|
|
31
|
+
timeZone: string;
|
|
32
|
+
showTime: boolean;
|
|
33
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -21,7 +21,7 @@ declare var __VLS_8: any;
|
|
|
21
21
|
type __VLS_Slots = {} & {
|
|
22
22
|
default?: (props: typeof __VLS_8) => any;
|
|
23
23
|
};
|
|
24
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
24
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
25
|
"update:modelValue": (value: SingleDate | RangeDate) => any;
|
|
26
26
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
27
27
|
"onUpdate:modelValue"?: ((value: SingleDate | RangeDate) => any) | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RangeDate } from "../../types/index.js.js";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
useTime?: boolean;
|
|
4
|
+
id: string;
|
|
5
|
+
fallbackDate?: Date;
|
|
6
|
+
timeZone?: string;
|
|
7
|
+
updateInterval?: number;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
10
|
+
modelValue: RangeDate;
|
|
11
|
+
};
|
|
12
|
+
declare var __VLS_167: {
|
|
13
|
+
tempValue: any;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_167) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
"update:modelValue": (value: RangeDate) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: RangeDate) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
fallbackDate: Date;
|
|
24
|
+
timeZone: string;
|
|
25
|
+
useTime: boolean;
|
|
26
|
+
updateInterval: number;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { getLocalTimeZone } from "@internationalized/date";
|
|
3
3
|
import { DateRangePickerArrow, DateRangePickerCalendar, DateRangePickerCell, DateRangePickerCellTrigger, DateRangePickerContent, DateRangePickerField, DateRangePickerGrid, DateRangePickerGridBody, DateRangePickerGridHead, DateRangePickerGridRow, DateRangePickerHeadCell, DateRangePickerHeader, DateRangePickerHeading, DateRangePickerInput, DateRangePickerNext, DateRangePickerPrev, DateRangePickerRoot, DateRangePickerTrigger } from "reka-ui";
|
|
4
4
|
import { onBeforeUnmount, ref, toRaw, useAttrs, watch } from "vue";
|
|
5
5
|
import { convertDateWithFallback, getNow, toEmittableDate } from "./helpers.js";
|
|
@@ -76,7 +76,8 @@ const locale = useInjectedLocale().timeLocale;
|
|
|
76
76
|
`, attrs.class)"
|
|
77
77
|
>
|
|
78
78
|
<div class="date-range-picker--segments-input flex items-center flex-1 overflow-scroll scrollbar-hidden whitespace-nowrap">
|
|
79
|
-
<div
|
|
79
|
+
<div
|
|
80
|
+
:class="twMerge(`
|
|
80
81
|
date-range-picker--start-segment
|
|
81
82
|
flex
|
|
82
83
|
items-center
|
|
@@ -123,7 +124,8 @@ const locale = useInjectedLocale().timeLocale;
|
|
|
123
124
|
<div class="date-range-picker--range-separator text-center px-1">
|
|
124
125
|
–
|
|
125
126
|
</div>
|
|
126
|
-
<div
|
|
127
|
+
<div
|
|
128
|
+
:class="twMerge(`
|
|
127
129
|
date-range-picker--end-segment
|
|
128
130
|
flex
|
|
129
131
|
items-center
|
|
@@ -189,13 +191,12 @@ const locale = useInjectedLocale().timeLocale;
|
|
|
189
191
|
</DateRangePickerField>
|
|
190
192
|
|
|
191
193
|
<!-- side=bottom makes months easier to click through -->
|
|
192
|
-
<!-- @vue-expect-error to exists-->
|
|
193
194
|
<DateRangePickerContent
|
|
194
195
|
:side-offset="4"
|
|
195
196
|
:avoid-collisions="true"
|
|
196
197
|
:prioritize-position="true"
|
|
197
198
|
side="bottom"
|
|
198
|
-
|
|
199
|
+
:portal="{ to: '#root' }"
|
|
199
200
|
class="
|
|
200
201
|
date-range-picker--content
|
|
201
202
|
z-100
|
|
@@ -313,7 +314,8 @@ const locale = useInjectedLocale().timeLocale;
|
|
|
313
314
|
:key="month.value.toString()"
|
|
314
315
|
>
|
|
315
316
|
<DateRangePickerGridHead class="date-range-picker--grid-head">
|
|
316
|
-
<DateRangePickerGridRow
|
|
317
|
+
<DateRangePickerGridRow
|
|
318
|
+
class="
|
|
317
319
|
date-range-picker--grid-row
|
|
318
320
|
mb-1
|
|
319
321
|
flex
|
|
@@ -15,7 +15,7 @@ declare var __VLS_167: {
|
|
|
15
15
|
type __VLS_Slots = {} & {
|
|
16
16
|
default?: (props: typeof __VLS_167) => any;
|
|
17
17
|
};
|
|
18
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
19
|
"update:modelValue": (value: RangeDate) => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
21
|
"onUpdate:modelValue"?: ((value: RangeDate) => any) | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SingleDate } from "../../types/index.js.js";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
useTime?: boolean;
|
|
4
|
+
id: string;
|
|
5
|
+
fallbackDate?: Date;
|
|
6
|
+
timeZone?: string;
|
|
7
|
+
updateInterval?: number;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
10
|
+
modelValue: SingleDate;
|
|
11
|
+
};
|
|
12
|
+
declare var __VLS_157: {
|
|
13
|
+
tempValue: any;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_157) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
"update:modelValue": (value: SingleDate) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: SingleDate) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
fallbackDate: Date;
|
|
24
|
+
timeZone: string;
|
|
25
|
+
useTime: boolean;
|
|
26
|
+
updateInterval: number;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -74,7 +74,8 @@ onBeforeUnmount(() => {
|
|
|
74
74
|
)
|
|
75
75
|
"
|
|
76
76
|
>
|
|
77
|
-
<div
|
|
77
|
+
<div
|
|
78
|
+
:class="twMerge(`
|
|
78
79
|
date-picker--segment
|
|
79
80
|
flex
|
|
80
81
|
items-center
|
|
@@ -139,13 +140,12 @@ onBeforeUnmount(() => {
|
|
|
139
140
|
</Icon>
|
|
140
141
|
</DatePickerTrigger>
|
|
141
142
|
</DatePickerField>
|
|
142
|
-
<!-- @vue-expect-error to exists-->
|
|
143
143
|
<DatePickerContent
|
|
144
144
|
:side-offset="4"
|
|
145
145
|
:avoid-collisions="true"
|
|
146
146
|
:prioritize-position="true"
|
|
147
147
|
side="bottom"
|
|
148
|
-
|
|
148
|
+
:portal="{ to: '#root' }"
|
|
149
149
|
class="
|
|
150
150
|
date-picker--content
|
|
151
151
|
z-100
|
|
@@ -178,7 +178,8 @@ onBeforeUnmount(() => {
|
|
|
178
178
|
max-w-[calc(1.2em*4+var(--spacing)*8+14ch)]
|
|
179
179
|
"
|
|
180
180
|
>
|
|
181
|
-
<DatePickerHeader
|
|
181
|
+
<DatePickerHeader
|
|
182
|
+
class="
|
|
182
183
|
date-picker--header
|
|
183
184
|
flex
|
|
184
185
|
items-center
|
|
@@ -276,7 +277,8 @@ onBeforeUnmount(() => {
|
|
|
276
277
|
:key="month.value.toString()"
|
|
277
278
|
>
|
|
278
279
|
<DatePickerGridHead class="date-picker--grid-head">
|
|
279
|
-
<DatePickerGridRow
|
|
280
|
+
<DatePickerGridRow
|
|
281
|
+
class="
|
|
280
282
|
date-picker--grid-row
|
|
281
283
|
mb-1
|
|
282
284
|
flex
|
|
@@ -15,7 +15,7 @@ declare var __VLS_157: {
|
|
|
15
15
|
type __VLS_Slots = {} & {
|
|
16
16
|
default?: (props: typeof __VLS_157) => any;
|
|
17
17
|
};
|
|
18
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
19
|
"update:modelValue": (value: SingleDate) => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
21
|
"onUpdate:modelValue"?: ((value: SingleDate) => any) | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_PublicProps = {
|
|
2
|
+
modelValue?: string;
|
|
3
|
+
"label"?: string;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_7: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_7) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:modelValue": (value: string) => any;
|
|
11
|
+
"update:label": (value: string) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
14
|
+
"onUpdate:label"?: ((value: string) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -6,7 +6,7 @@ declare var __VLS_7: {};
|
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_7) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
10
|
"update:modelValue": (value: string) => any;
|
|
11
11
|
"update:label": (value: string) => any;
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple debug component for displaying objects and strings with whitespace.
|
|
3
|
+
*
|
|
4
|
+
* In the case of objects, it JSON.stringifies them with a tab character. The tab width can be controlled with the `tab` prop, which will set the `tab-size` css property on the element.
|
|
5
|
+
*
|
|
6
|
+
* The value can be undefined, it will just display undefined.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
9
|
+
/** The value to debug, can be anything. */
|
|
10
|
+
value?: any;
|
|
11
|
+
/** Sets the tab size in css. Defaults to 3. */
|
|
12
|
+
tab?: number;
|
|
13
|
+
title?: string;
|
|
14
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
15
|
+
/** The value to debug, can be anything. */
|
|
16
|
+
value?: any;
|
|
17
|
+
/** Sets the tab size in css. Defaults to 3. */
|
|
18
|
+
tab?: number;
|
|
19
|
+
title?: string;
|
|
20
|
+
}> & Readonly<{}>, {
|
|
21
|
+
value: any;
|
|
22
|
+
title: string;
|
|
23
|
+
tab: number;
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
25
|
+
default?: (props: {}) => any;
|
|
26
|
+
}>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="debug--wrapper
|
|
3
4
|
text-fg
|
|
4
5
|
dark:text-bg
|
|
5
6
|
flex
|
|
@@ -13,11 +14,15 @@
|
|
|
13
14
|
>
|
|
14
15
|
<div class="debug--header flex justify-between">
|
|
15
16
|
<span class="debug--title font-bold">{{ title }}</span>
|
|
16
|
-
<LibButton
|
|
17
|
+
<LibButton
|
|
18
|
+
class="debug--copy-button w-min-content"
|
|
19
|
+
@click="copy()"
|
|
20
|
+
>
|
|
17
21
|
<icon><i-fa6-regular-copy/></icon>
|
|
18
22
|
</LibButton>
|
|
19
23
|
</div>
|
|
20
|
-
<pre
|
|
24
|
+
<pre
|
|
25
|
+
v-if="value"
|
|
21
26
|
:class="
|
|
22
27
|
`
|
|
23
28
|
debug--value
|
|
@@ -68,7 +73,7 @@ const copy = () => {
|
|
|
68
73
|
|
|
69
74
|
<script>
|
|
70
75
|
export default {
|
|
71
|
-
name: "
|
|
76
|
+
name: "LibDebug"
|
|
72
77
|
// https://v3.vuejs.org/guide/typescript-support.html#annotating-props
|
|
73
78
|
};
|
|
74
79
|
</script>
|
|
@@ -11,7 +11,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
11
11
|
/** Sets the tab size in css. Defaults to 3. */
|
|
12
12
|
tab?: number;
|
|
13
13
|
title?: string;
|
|
14
|
-
},
|
|
14
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
15
15
|
/** The value to debug, can be anything. */
|
|
16
16
|
value?: any;
|
|
17
17
|
/** Sets the tab size in css. Defaults to 3. */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
show?: boolean;
|
|
3
|
+
}
|
|
4
|
+
declare module "vue" {
|
|
5
|
+
interface GlobalComponents {
|
|
6
|
+
DevOnly: any;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
10
|
+
show?: boolean;
|
|
11
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
12
|
+
show?: boolean;
|
|
13
|
+
}> & Readonly<{}>, {
|
|
14
|
+
show: boolean;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
16
|
+
default?: (props: {}) => any;
|
|
17
|
+
} & {
|
|
18
|
+
default?: (props: {}) => any;
|
|
19
|
+
}>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
show?: boolean;
|
|
3
|
+
}
|
|
1
4
|
declare module "vue" {
|
|
2
5
|
interface GlobalComponents {
|
|
3
6
|
DevOnly: any;
|
|
@@ -5,7 +8,7 @@ declare module "vue" {
|
|
|
5
8
|
}
|
|
6
9
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
7
10
|
show?: boolean;
|
|
8
|
-
},
|
|
11
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
9
12
|
show?: boolean;
|
|
10
13
|
}> & Readonly<{}>, {
|
|
11
14
|
show: boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type HTMLAttributes, type InputHTMLAttributes } from "vue";
|
|
2
|
+
import type { FileInputError } from "../../types/index.js.js";
|
|
3
|
+
import { type LinkableByIdProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js.js";
|
|
4
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
|
+
input: (val: File[]) => any;
|
|
6
|
+
errors: (val: FileInputError[]) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
8
|
+
onInput?: ((val: File[]) => any) | undefined;
|
|
9
|
+
onErrors?: ((val: FileInputError[]) => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
multiple: boolean;
|
|
12
|
+
formats: string[];
|
|
13
|
+
compact: boolean;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
15
|
+
icon?: (props: {}) => any;
|
|
16
|
+
} & {
|
|
17
|
+
label?: (props: {}) => any;
|
|
18
|
+
} & {
|
|
19
|
+
formats?: (props: {}) => any;
|
|
20
|
+
}>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type WrapperTypes = WrapperProps<"input", InputHTMLAttributes> & WrapperProps<"wrapper", HTMLAttributes> & WrapperProps<"previews", HTMLAttributes>;
|
|
23
|
+
type RealProps = LinkableByIdProps & {
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A list of extensions or mime types to add to the input's accept. Basic validations are done so that files match an extension and mimeType, but note that a file could still be lying, all files should be validated server side.
|
|
27
|
+
*
|
|
28
|
+
* Pass an empty array to allow any filetype.
|
|
29
|
+
*/
|
|
30
|
+
formats?: string[];
|
|
31
|
+
compact?: boolean;
|
|
32
|
+
};
|
|
33
|
+
interface Props extends
|
|
34
|
+
/** @vue-ignore */
|
|
35
|
+
Partial<Omit<InputHTMLAttributes, "class" | "multiple" | "formats" | "compact"> & TailwindClassProp>,
|
|
36
|
+
/** @vue-ignore */
|
|
37
|
+
Partial<WrapperTypes>, RealProps {
|
|
38
|
+
}
|
|
39
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- todo aria errors -->
|
|
3
|
-
<div
|
|
3
|
+
<div
|
|
4
|
+
:class="twMerge(
|
|
4
5
|
`file-input
|
|
5
6
|
justify-center
|
|
6
7
|
border-2
|
|
@@ -16,7 +17,8 @@
|
|
|
16
17
|
)"
|
|
17
18
|
v-bind="{ ...$.wrapperAttrs, class: void 0 }"
|
|
18
19
|
>
|
|
19
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
:class="twMerge(
|
|
20
22
|
`
|
|
21
23
|
file-input--wrapper
|
|
22
24
|
relative justify-center`,
|
|
@@ -37,7 +39,10 @@
|
|
|
37
39
|
whitespace-nowrap
|
|
38
40
|
`)"
|
|
39
41
|
>
|
|
40
|
-
<slot
|
|
42
|
+
<slot
|
|
43
|
+
v-if="compact || multiple || files.length === 0"
|
|
44
|
+
name="icon"
|
|
45
|
+
>
|
|
41
46
|
<icon><i-fa6-solid-arrow-up-from-bracket/></icon>
|
|
42
47
|
</slot>
|
|
43
48
|
<slot name="label">
|
|
@@ -52,7 +57,10 @@
|
|
|
52
57
|
{{ ` (${files.length})` }}
|
|
53
58
|
</span>
|
|
54
59
|
</label>
|
|
55
|
-
<label
|
|
60
|
+
<label
|
|
61
|
+
v-if="!compact && formats?.length > 0"
|
|
62
|
+
class="file-input--formats-label flex flex-col items-center text-sm"
|
|
63
|
+
>
|
|
56
64
|
<slot name="formats">{{ t("file-input.accepted-formats") }}: </slot>
|
|
57
65
|
<div class="file-input--formats-list">
|
|
58
66
|
{{ extensions.join(", ") }}
|
|
@@ -82,7 +90,8 @@
|
|
|
82
90
|
>
|
|
83
91
|
<!-- click event allows event to fire even if the user picks the same file -->
|
|
84
92
|
</div>
|
|
85
|
-
<div
|
|
93
|
+
<div
|
|
94
|
+
v-if="!compact && files.length > 0"
|
|
86
95
|
:class="twMerge(
|
|
87
96
|
`file-input--previews
|
|
88
97
|
flex items-stretch justify-center gap-2 flex-wrap
|
|
@@ -94,7 +103,8 @@
|
|
|
94
103
|
)"
|
|
95
104
|
>
|
|
96
105
|
<div class="file-input--preview-spacer flex-1"/>
|
|
97
|
-
<div
|
|
106
|
+
<div
|
|
107
|
+
class="file-input--preview-wrapper
|
|
98
108
|
z-1
|
|
99
109
|
relative
|
|
100
110
|
flex
|
|
@@ -121,16 +131,21 @@
|
|
|
121
131
|
</div>
|
|
122
132
|
|
|
123
133
|
<div class="file-input--preview flex flex-initial basis-full justify-center">
|
|
124
|
-
<div
|
|
134
|
+
<div
|
|
135
|
+
v-if="entry.isImg"
|
|
125
136
|
class="file-input--preview-image
|
|
126
137
|
bg-transparency-squares flex
|
|
127
138
|
h-[80px] flex-wrap items-center
|
|
128
139
|
justify-center
|
|
129
140
|
"
|
|
130
141
|
>
|
|
131
|
-
<img
|
|
142
|
+
<img
|
|
143
|
+
class="max-h-full w-auto"
|
|
144
|
+
:src="getSrc(entry.file)"
|
|
145
|
+
>
|
|
132
146
|
</div>
|
|
133
|
-
<div
|
|
147
|
+
<div
|
|
148
|
+
v-if="!entry.isImg"
|
|
134
149
|
class="file-input--preview-no-image
|
|
135
150
|
flex h-[80px]
|
|
136
151
|
flex-1 basis-full flex-wrap items-center justify-center
|
|
@@ -139,7 +154,8 @@
|
|
|
139
154
|
<icon><i-fa6-regular-file class="text-4xl opacity-50"/></icon>
|
|
140
155
|
</div>
|
|
141
156
|
</div>
|
|
142
|
-
<div
|
|
157
|
+
<div
|
|
158
|
+
class="
|
|
143
159
|
file-input--preview-filename
|
|
144
160
|
min-w-0
|
|
145
161
|
flex-1
|
|
@@ -168,7 +184,6 @@ import IFa6SolidArrowUpFromBracket from "~icons/fa6-solid/arrow-up-from-bracket"
|
|
|
168
184
|
import IFa6SolidXmark from "~icons/fa6-solid/xmark";
|
|
169
185
|
import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
|
|
170
186
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
|
|
171
|
-
import {} from "../../types/index.js";
|
|
172
187
|
import { twMerge } from "../../utils/twMerge.js";
|
|
173
188
|
import Icon from "../Icon/Icon.vue";
|
|
174
189
|
import LibButton from "../LibButton/LibButton.vue";
|
|
@@ -191,7 +206,7 @@ watch(errors, () => {
|
|
|
191
206
|
}
|
|
192
207
|
});
|
|
193
208
|
defineOptions({
|
|
194
|
-
name: "
|
|
209
|
+
name: "LibFileInput",
|
|
195
210
|
inheritAttrs: false
|
|
196
211
|
});
|
|
197
212
|
const $ = useDivideAttrs(["wrapper", "input", "previews"]);
|
|
@@ -250,9 +265,10 @@ const inputFile = async (e) => {
|
|
|
250
265
|
errors.splice(0, errors.length);
|
|
251
266
|
}
|
|
252
267
|
}
|
|
268
|
+
return void 0;
|
|
253
269
|
};
|
|
254
270
|
</script>
|
|
255
271
|
|
|
256
272
|
<script>
|
|
257
|
-
export default { name: "
|
|
273
|
+
export default { name: "LibFileInput" };
|
|
258
274
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type InputHTMLAttributes } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import type { FileInputError } from "../../types/index.js.js";
|
|
3
3
|
import { type LinkableByIdProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js.js";
|
|
4
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props,
|
|
4
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
5
|
input: (val: File[]) => any;
|
|
6
6
|
errors: (val: FileInputError[]) => any;
|
|
7
7
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|