@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
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { type HTMLAttributes, type InputHTMLAttributes } from "vue";
|
|
2
|
+
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type SuggestionsProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js.js";
|
|
3
|
+
type WrapperTypes = WrapperProps<"suggestions", HTMLAttributes> & WrapperProps<"wrapper", HTMLAttributes> & WrapperProps<"inner-wrapper", HTMLAttributes>;
|
|
4
|
+
type RealProps = SuggestionsProps & LinkableByIdProps & LabelProps & BaseInteractiveProps & {
|
|
5
|
+
suggestions?: SuggestionsProps["suggestions"];
|
|
6
|
+
valid?: boolean;
|
|
7
|
+
};
|
|
8
|
+
interface Props extends
|
|
9
|
+
/** @vue-ignore */
|
|
10
|
+
Partial<Omit<InputHTMLAttributes, "class" | "readonly" | "disabled" | "onSubmit"> & TailwindClassProp>,
|
|
11
|
+
/** @vue-ignore */
|
|
12
|
+
Partial<WrapperTypes>, RealProps {
|
|
13
|
+
}
|
|
14
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props & {
|
|
15
|
+
values?: string[] | undefined;
|
|
16
|
+
modelValue: string;
|
|
17
|
+
inputValue?: string;
|
|
18
|
+
}, {
|
|
19
|
+
suggestionsComponent: import("vue").Ref<{
|
|
20
|
+
suggestions: {
|
|
21
|
+
list: any[] | undefined;
|
|
22
|
+
filtered: any[] | undefined;
|
|
23
|
+
active: number;
|
|
24
|
+
available: boolean;
|
|
25
|
+
moreThanOneAvailable: boolean;
|
|
26
|
+
hasExactlyMatching: string | object | undefined;
|
|
27
|
+
hasValidSuggestion: boolean;
|
|
28
|
+
openable: boolean | undefined;
|
|
29
|
+
getLabel: (item: any) => string;
|
|
30
|
+
$open: boolean;
|
|
31
|
+
open: () => void;
|
|
32
|
+
close: () => void;
|
|
33
|
+
enterSelected: (doClose?: boolean) => void;
|
|
34
|
+
enterIndex: (num: number, doClose?: boolean) => void;
|
|
35
|
+
toggle: () => void;
|
|
36
|
+
cancel: () => void;
|
|
37
|
+
select: (num: number) => void;
|
|
38
|
+
prev: () => void;
|
|
39
|
+
next: () => void;
|
|
40
|
+
first: () => void;
|
|
41
|
+
last: () => void;
|
|
42
|
+
};
|
|
43
|
+
el: HTMLElement | null;
|
|
44
|
+
inputKeydownHandler: (e: KeyboardEvent) => void;
|
|
45
|
+
inputBlurHandler: (e: MouseEvent) => void;
|
|
46
|
+
inputFocusHandler: (e: FocusEvent) => void;
|
|
47
|
+
} | null, import("vue").ShallowUnwrapRef<{
|
|
48
|
+
suggestions: {
|
|
49
|
+
list: any[] | undefined;
|
|
50
|
+
filtered: any[] | undefined;
|
|
51
|
+
active: number;
|
|
52
|
+
available: boolean;
|
|
53
|
+
moreThanOneAvailable: boolean;
|
|
54
|
+
hasExactlyMatching: string | object | undefined;
|
|
55
|
+
hasValidSuggestion: boolean;
|
|
56
|
+
openable: boolean | undefined;
|
|
57
|
+
getLabel: (item: any) => string;
|
|
58
|
+
$open: boolean;
|
|
59
|
+
open: () => void;
|
|
60
|
+
close: () => void;
|
|
61
|
+
enterSelected: (doClose?: boolean) => void;
|
|
62
|
+
enterIndex: (num: number, doClose?: boolean) => void;
|
|
63
|
+
toggle: () => void;
|
|
64
|
+
cancel: () => void;
|
|
65
|
+
select: (num: number) => void;
|
|
66
|
+
prev: () => void;
|
|
67
|
+
next: () => void;
|
|
68
|
+
first: () => void;
|
|
69
|
+
last: () => void;
|
|
70
|
+
};
|
|
71
|
+
el: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
72
|
+
inputKeydownHandler: (e: KeyboardEvent) => void;
|
|
73
|
+
inputBlurHandler: (e: MouseEvent) => void;
|
|
74
|
+
inputFocusHandler: (e: FocusEvent) => void;
|
|
75
|
+
}> | {
|
|
76
|
+
suggestions: {
|
|
77
|
+
list: any[] | undefined;
|
|
78
|
+
filtered: any[] | undefined;
|
|
79
|
+
active: number;
|
|
80
|
+
available: boolean;
|
|
81
|
+
moreThanOneAvailable: boolean;
|
|
82
|
+
hasExactlyMatching: string | object | undefined;
|
|
83
|
+
hasValidSuggestion: boolean;
|
|
84
|
+
openable: boolean | undefined;
|
|
85
|
+
getLabel: (item: any) => string;
|
|
86
|
+
$open: boolean;
|
|
87
|
+
open: () => void;
|
|
88
|
+
close: () => void;
|
|
89
|
+
enterSelected: (doClose?: boolean) => void;
|
|
90
|
+
enterIndex: (num: number, doClose?: boolean) => void;
|
|
91
|
+
toggle: () => void;
|
|
92
|
+
cancel: () => void;
|
|
93
|
+
select: (num: number) => void;
|
|
94
|
+
prev: () => void;
|
|
95
|
+
next: () => void;
|
|
96
|
+
first: () => void;
|
|
97
|
+
last: () => void;
|
|
98
|
+
};
|
|
99
|
+
el: HTMLElement | null;
|
|
100
|
+
inputKeydownHandler: (e: KeyboardEvent) => void;
|
|
101
|
+
inputBlurHandler: (e: MouseEvent) => void;
|
|
102
|
+
inputFocusHandler: (e: FocusEvent) => void;
|
|
103
|
+
} | null>;
|
|
104
|
+
el: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
105
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
106
|
+
"update:modelValue": (value: string) => any;
|
|
107
|
+
"update:inputValue": (value: string) => any;
|
|
108
|
+
"update:values": (value: string[] | undefined) => any;
|
|
109
|
+
} & {
|
|
110
|
+
blur: (val: FocusEvent) => any;
|
|
111
|
+
input: (val: InputEvent) => any;
|
|
112
|
+
submit: (val: string, suggestion?: any) => any;
|
|
113
|
+
keydown: (val: KeyboardEvent) => any;
|
|
114
|
+
focus: (val: FocusEvent) => any;
|
|
115
|
+
indicatorClick: (val: MouseEvent) => any;
|
|
116
|
+
}, string, import("vue").PublicProps, Readonly<Props & {
|
|
117
|
+
values?: string[] | undefined;
|
|
118
|
+
modelValue: string;
|
|
119
|
+
inputValue?: string;
|
|
120
|
+
}> & Readonly<{
|
|
121
|
+
onBlur?: ((val: FocusEvent) => any) | undefined;
|
|
122
|
+
onInput?: ((val: InputEvent) => any) | undefined;
|
|
123
|
+
onSubmit?: ((val: string, suggestion?: any) => any) | undefined;
|
|
124
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
125
|
+
"onUpdate:inputValue"?: ((value: string) => any) | undefined;
|
|
126
|
+
"onUpdate:values"?: ((value: string[] | undefined) => any) | undefined;
|
|
127
|
+
onKeydown?: ((val: KeyboardEvent) => any) | undefined;
|
|
128
|
+
onFocus?: ((val: FocusEvent) => any) | undefined;
|
|
129
|
+
onIndicatorClick?: ((val: MouseEvent) => any) | undefined;
|
|
130
|
+
}>, {
|
|
131
|
+
disabled: boolean;
|
|
132
|
+
readonly: boolean;
|
|
133
|
+
border: boolean;
|
|
134
|
+
unstyle: boolean;
|
|
135
|
+
valid: boolean;
|
|
136
|
+
suggestions: any[];
|
|
137
|
+
updateOnlyOnSubmit: boolean;
|
|
138
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
139
|
+
label?: (props: any) => any;
|
|
140
|
+
} & {
|
|
141
|
+
default?: (props: any) => any;
|
|
142
|
+
} & {
|
|
143
|
+
left?: (props: any) => any;
|
|
144
|
+
} & {
|
|
145
|
+
input?: (props: any) => any;
|
|
146
|
+
} & {
|
|
147
|
+
indicator?: (props: {
|
|
148
|
+
isOpen: any;
|
|
149
|
+
suggestionsIndicatorClickHandler: any;
|
|
150
|
+
}) => any;
|
|
151
|
+
} & {
|
|
152
|
+
values?: (props: any) => any;
|
|
153
|
+
} & {
|
|
154
|
+
right?: (props: any) => any;
|
|
155
|
+
} & {
|
|
156
|
+
suggestions?: (props: any) => any;
|
|
157
|
+
} & {
|
|
158
|
+
'suggestion-item'?: (props: any) => any;
|
|
159
|
+
}>;
|
|
160
|
+
export default _default;
|
|
161
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
162
|
+
new (): {
|
|
163
|
+
$slots: S;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
@@ -16,8 +16,12 @@
|
|
|
16
16
|
v-bind="{ ...$.wrapperAttrs, class: void 0 }"
|
|
17
17
|
ref="inputWrapperEl"
|
|
18
18
|
>
|
|
19
|
-
<slot
|
|
20
|
-
|
|
19
|
+
<slot
|
|
20
|
+
name="label"
|
|
21
|
+
v-bind="{ ...slotProps, label }"
|
|
22
|
+
>
|
|
23
|
+
<lib-label
|
|
24
|
+
v-if="label || $slots.default"
|
|
21
25
|
:id="id ?? fallbackId"
|
|
22
26
|
:disabled="disabled"
|
|
23
27
|
:readonly="readonly"
|
|
@@ -79,8 +83,14 @@
|
|
|
79
83
|
$['inner-wrapperAttrs']?.class
|
|
80
84
|
)"
|
|
81
85
|
>
|
|
82
|
-
<slot
|
|
83
|
-
|
|
86
|
+
<slot
|
|
87
|
+
name="left"
|
|
88
|
+
v-bind="slotProps"
|
|
89
|
+
/>
|
|
90
|
+
<slot
|
|
91
|
+
name="input"
|
|
92
|
+
v-bind="{ ...inputProps, ...slotProps, suggestionsIndicatorClickHandler }"
|
|
93
|
+
>
|
|
84
94
|
<lib-simple-input
|
|
85
95
|
:class="twMerge(
|
|
86
96
|
`input--input p-0`,
|
|
@@ -91,7 +101,10 @@
|
|
|
91
101
|
v-bind="inputProps"
|
|
92
102
|
/>
|
|
93
103
|
</slot>
|
|
94
|
-
<slot
|
|
104
|
+
<slot
|
|
105
|
+
name="indicator"
|
|
106
|
+
v-bind="{ isOpen, suggestionsIndicatorClickHandler }"
|
|
107
|
+
>
|
|
95
108
|
<!-- todo, convert to button for accessibility ? -->
|
|
96
109
|
<div
|
|
97
110
|
v-if="suggestions"
|
|
@@ -99,7 +112,9 @@
|
|
|
99
112
|
:class="twMerge(`input--indicator flex flex-col justify-center`)"
|
|
100
113
|
@click="suggestionsIndicatorClickHandler"
|
|
101
114
|
>
|
|
102
|
-
<icon :class="isOpen && `rotate-180`">
|
|
115
|
+
<icon :class="isOpen && `rotate-180`">
|
|
116
|
+
<i-fa6-solid-chevron-up/>
|
|
117
|
+
</icon>
|
|
103
118
|
</div>
|
|
104
119
|
</slot>
|
|
105
120
|
<slot
|
|
@@ -122,9 +137,16 @@
|
|
|
122
137
|
/>
|
|
123
138
|
</template>
|
|
124
139
|
</slot>
|
|
125
|
-
<slot
|
|
140
|
+
<slot
|
|
141
|
+
name="right"
|
|
142
|
+
v-bind="slotProps"
|
|
143
|
+
/>
|
|
126
144
|
|
|
127
|
-
<slot
|
|
145
|
+
<slot
|
|
146
|
+
v-if="suggestions"
|
|
147
|
+
name="suggestions"
|
|
148
|
+
v-bind="{ ...suggestionProps, ...slotProps }"
|
|
149
|
+
>
|
|
128
150
|
<!-- todo 1px needs to be abstracted to var -->
|
|
129
151
|
<lib-suggestions
|
|
130
152
|
:class="twMerge(
|
|
@@ -147,7 +169,10 @@
|
|
|
147
169
|
v-bind="suggestionProps"
|
|
148
170
|
>
|
|
149
171
|
<template #item="itemSlotProps">
|
|
150
|
-
<slot
|
|
172
|
+
<slot
|
|
173
|
+
name="suggestion-item"
|
|
174
|
+
v-bind="itemSlotProps"
|
|
175
|
+
/>
|
|
151
176
|
</template>
|
|
152
177
|
</lib-suggestions>
|
|
153
178
|
</slot>
|
|
@@ -157,9 +182,8 @@
|
|
|
157
182
|
|
|
158
183
|
<script setup>
|
|
159
184
|
import { isBlank } from "@alanscodelog/utils/isBlank";
|
|
160
|
-
import { isObject } from "@alanscodelog/utils/isObject";
|
|
161
185
|
import { pushIfNotIn } from "@alanscodelog/utils/pushIfNotIn";
|
|
162
|
-
import { computed, nextTick,
|
|
186
|
+
import { computed, nextTick, ref, toRef, useSlots, watch } from "vue";
|
|
163
187
|
import IFa6SolidChevronUp from "~icons/fa6-solid/chevron-up";
|
|
164
188
|
import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
|
|
165
189
|
import { useSuggestionsInputAria } from "../../composables/useSuggestions.js";
|
|
@@ -171,7 +195,7 @@ import LibSimpleInput from "../LibSimpleInput/LibSimpleInput.vue";
|
|
|
171
195
|
import LibSuggestions from "../LibSuggestions/LibSuggestions.vue";
|
|
172
196
|
import { getFallbackId } from "../shared/props.js";
|
|
173
197
|
defineOptions({
|
|
174
|
-
name: "
|
|
198
|
+
name: "LibSimpleInputDeprecated",
|
|
175
199
|
inheritAttrs: false
|
|
176
200
|
});
|
|
177
201
|
const $slots = useSlots();
|
|
@@ -270,6 +294,7 @@ const inputProps = computed(() => ({
|
|
|
270
294
|
onBlur: handleBlur,
|
|
271
295
|
onFocus: handleFocus,
|
|
272
296
|
modelValue: $inputValue.value,
|
|
297
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
273
298
|
"onUpdate:modelValue": (e) => {
|
|
274
299
|
$inputValue.value = e;
|
|
275
300
|
if (!props.suggestions && !props.updateOnlyOnSubmit && !props.restrictToSuggestions) {
|
|
@@ -311,17 +336,21 @@ const suggestionProps = computed(() => ({
|
|
|
311
336
|
modelValue: $values.value ?? $modelValue.value.toString(),
|
|
312
337
|
inputValue: $inputValue.value,
|
|
313
338
|
isValid: props.isValid,
|
|
339
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
314
340
|
"onUpdate:inputValue": (e) => $inputValue.value = e,
|
|
315
341
|
onSubmit: (e, suggestion, wasRemoved) => {
|
|
316
342
|
$modelValue.value = wasRemoved ? "" : e;
|
|
317
343
|
emit("submit", e, suggestion);
|
|
318
344
|
},
|
|
345
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
319
346
|
"onUpdate:modelValue": (e) => {
|
|
320
347
|
$values.value &&= e;
|
|
321
348
|
},
|
|
349
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
322
350
|
"onUpdate:isOpen": (e) => {
|
|
323
351
|
isOpen.value = e;
|
|
324
352
|
},
|
|
353
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
325
354
|
"onUpdate:activeSuggestion": (e) => activeSuggestion.value = e,
|
|
326
355
|
...$.value.suggestionsAttrs,
|
|
327
356
|
class: void 0
|
|
@@ -333,6 +362,7 @@ const multivaluesProps = computed(() => ({
|
|
|
333
362
|
disabled: props.disabled,
|
|
334
363
|
readonly: props.readonly,
|
|
335
364
|
modelValue: $values.value,
|
|
365
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
336
366
|
"onUpdate:modelValue": (e) => $values.value = e,
|
|
337
367
|
...$.value.multivaluesAttrs,
|
|
338
368
|
class: void 0
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { LabelHTMLAttributes } from "vue";
|
|
2
|
+
import type { BaseInteractiveProps, LabelProps, LinkableByIdProps, TailwindClassProp } from "../shared/props.js.js";
|
|
3
|
+
type RealProps = LinkableByIdProps & LabelProps & BaseInteractiveProps & {
|
|
4
|
+
unstyled?: boolean;
|
|
5
|
+
valid?: boolean;
|
|
6
|
+
};
|
|
7
|
+
interface Props extends
|
|
8
|
+
/** @vue-ignore */
|
|
9
|
+
Partial<Omit<LabelHTMLAttributes, "class"> & TailwindClassProp>, RealProps {
|
|
10
|
+
}
|
|
11
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
12
|
+
id: string;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
readonly: boolean;
|
|
15
|
+
border: boolean;
|
|
16
|
+
unstyle: boolean;
|
|
17
|
+
valid: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
19
|
+
default?: (props: {}) => any;
|
|
20
|
+
}>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
23
|
-
import {
|
|
23
|
+
import { useAttrs } from "vue";
|
|
24
24
|
import { twMerge } from "../../utils/twMerge.js";
|
|
25
25
|
import { getFallbackId } from "../shared/props.js";
|
|
26
26
|
defineOptions({
|
|
27
|
-
name: "
|
|
27
|
+
name: "LibLabel"
|
|
28
28
|
});
|
|
29
29
|
const fallbackId = getFallbackId();
|
|
30
30
|
defineProps({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { LabelHTMLAttributes } from "vue";
|
|
2
|
+
import type { BaseInteractiveProps, LabelProps, LinkableByIdProps, TailwindClassProp } from "../shared/props.js.js";
|
|
3
3
|
type RealProps = LinkableByIdProps & LabelProps & BaseInteractiveProps & {
|
|
4
4
|
unstyled?: boolean;
|
|
5
5
|
valid?: boolean;
|
|
@@ -8,7 +8,7 @@ interface Props extends
|
|
|
8
8
|
/** @vue-ignore */
|
|
9
9
|
Partial<Omit<LabelHTMLAttributes, "class"> & TailwindClassProp>, RealProps {
|
|
10
10
|
}
|
|
11
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props,
|
|
11
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
12
12
|
id: string;
|
|
13
13
|
disabled: boolean;
|
|
14
14
|
readonly: boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "vue";
|
|
2
|
+
import type { BaseInteractiveProps, LabelProps, TailwindClassProp, WrapperProps } from "../shared/props.js.js";
|
|
3
|
+
type WrapperTypes = Partial<WrapperProps<"item", HTMLAttributes>>;
|
|
4
|
+
type RealProps = LabelProps & BaseInteractiveProps & {
|
|
5
|
+
border?: boolean;
|
|
6
|
+
};
|
|
7
|
+
interface Props extends
|
|
8
|
+
/** @vue-ignore */
|
|
9
|
+
Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>,
|
|
10
|
+
/** @vue-ignore */
|
|
11
|
+
WrapperTypes, RealProps {
|
|
12
|
+
}
|
|
13
|
+
declare const _default: <T extends string | number>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
14
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
15
|
+
readonly "onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|
|
16
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & (Props & {
|
|
17
|
+
modelValue?: T[];
|
|
18
|
+
}) & {}> & import("vue").PublicProps;
|
|
19
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
20
|
+
attrs: any;
|
|
21
|
+
slots: {};
|
|
22
|
+
emit: (evt: "update:modelValue", value: T[]) => void;
|
|
23
|
+
}>) => import("vue").VNode & {
|
|
24
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_PrettifyLocal<T> = {
|
|
28
|
+
[K in keyof T as K]: T[K];
|
|
29
|
+
} & {};
|
|
@@ -84,9 +84,8 @@ import { copy } from "../../helpers/copy.js";
|
|
|
84
84
|
import { twMerge } from "../../utils/twMerge.js";
|
|
85
85
|
import Icon from "../Icon/Icon.vue";
|
|
86
86
|
import LibButton from "../LibButton/LibButton.vue";
|
|
87
|
-
import {} from "../shared/props.js";
|
|
88
87
|
defineOptions({
|
|
89
|
-
name: "
|
|
88
|
+
name: "LibMultiValues",
|
|
90
89
|
inheritAttrs: false
|
|
91
90
|
});
|
|
92
91
|
const $ = useDivideAttrs(["item"]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import type { BaseInteractiveProps, LabelProps, TailwindClassProp, WrapperProps } from "../shared/props.js.js";
|
|
3
3
|
type WrapperTypes = Partial<WrapperProps<"item", HTMLAttributes>>;
|
|
4
4
|
type RealProps = LabelProps & BaseInteractiveProps & {
|
|
5
5
|
border?: boolean;
|
|
@@ -15,7 +15,7 @@ declare const _default: <T extends string | number>(__VLS_props: NonNullable<Awa
|
|
|
15
15
|
readonly "onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|
|
16
16
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & (Props & {
|
|
17
17
|
modelValue?: T[];
|
|
18
|
-
}) &
|
|
18
|
+
}) & {}> & import("vue").PublicProps;
|
|
19
19
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
20
20
|
attrs: any;
|
|
21
21
|
slots: {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "vue";
|
|
2
|
+
import { type NotificationEntry, NotificationHandler } from "../../helpers/NotificationHandler.js.js";
|
|
3
|
+
import type { TailwindClassProp } from "../shared/props.js.js";
|
|
4
|
+
type RealProps = {
|
|
5
|
+
notification: NotificationEntry;
|
|
6
|
+
handler?: NotificationHandler;
|
|
7
|
+
};
|
|
8
|
+
interface Props extends
|
|
9
|
+
/** @vue-ignore */
|
|
10
|
+
Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>, RealProps {
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import("vue").DefineComponent<Props, {
|
|
13
|
+
focus: () => void;
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
15
|
+
handler: NotificationHandler;
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:class="twMerge(
|
|
3
4
|
`notification
|
|
4
5
|
max-w-700px
|
|
5
6
|
bg-neutral-50
|
|
@@ -22,7 +23,8 @@
|
|
|
22
23
|
@keydown.enter.self="NotificationHandler.resolveToDefault(notification)"
|
|
23
24
|
>
|
|
24
25
|
<div class="notification--header flex-reverse flex justify-between">
|
|
25
|
-
<div
|
|
26
|
+
<div
|
|
27
|
+
v-if="notification.title"
|
|
26
28
|
tabindex="0"
|
|
27
29
|
class="title
|
|
28
30
|
focus-outline flex
|
|
@@ -34,7 +36,8 @@
|
|
|
34
36
|
</div>
|
|
35
37
|
<div class="notification--spacer flex-1"/>
|
|
36
38
|
<div class="actions flex">
|
|
37
|
-
<LibButton
|
|
39
|
+
<LibButton
|
|
40
|
+
:border="false"
|
|
38
41
|
class="notification--copy-button text-neutral-700"
|
|
39
42
|
@click="copy(handler ? handler.stringify(notification) : JSON.stringify(notification))"
|
|
40
43
|
>
|
|
@@ -50,21 +53,29 @@
|
|
|
50
53
|
</lib-button>
|
|
51
54
|
</div>
|
|
52
55
|
</div>
|
|
53
|
-
<div
|
|
56
|
+
<div
|
|
57
|
+
class="notification--message whitespace-pre-wrap"
|
|
58
|
+
tabindex="0"
|
|
59
|
+
>
|
|
54
60
|
{{ notification.message }}
|
|
55
61
|
</div>
|
|
56
62
|
<div class="notification--footer flex items-end justify-between">
|
|
57
|
-
<div
|
|
63
|
+
<div
|
|
64
|
+
v-if="notification.code"
|
|
65
|
+
class="code text-xs text-neutral-700 dark:text-neutral-300"
|
|
66
|
+
>
|
|
58
67
|
Code: {{ notification.code }}
|
|
59
68
|
</div>
|
|
60
69
|
<div class="notification--footer-spacer flex-1 py-1"/>
|
|
61
|
-
<div
|
|
70
|
+
<div
|
|
71
|
+
v-if="notification.options"
|
|
62
72
|
class="notification--options
|
|
63
73
|
flex flex-wrap justify-end
|
|
64
74
|
gap-2
|
|
65
75
|
"
|
|
66
76
|
>
|
|
67
|
-
<lib-button
|
|
77
|
+
<lib-button
|
|
78
|
+
:label="option"
|
|
68
79
|
:class="twMerge(
|
|
69
80
|
`
|
|
70
81
|
notification--option-button
|
|
@@ -92,7 +103,7 @@ import { twMerge } from "../../utils/twMerge.js";
|
|
|
92
103
|
import Icon from "../Icon/Icon.vue";
|
|
93
104
|
import LibButton from "../LibButton/LibButton.vue";
|
|
94
105
|
defineOptions({
|
|
95
|
-
name: "
|
|
106
|
+
name: "LibNotification",
|
|
96
107
|
inheritAttrs: false
|
|
97
108
|
});
|
|
98
109
|
const $attrs = useAttrs();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NotificationHandler } from "../../helpers/NotificationHandler.js.js";
|
|
2
|
+
import type { LinkableByIdProps, TailwindClassProp } from "../shared/props.js.js";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
type RealProps = LinkableByIdProps & {
|
|
5
|
+
/** If not provided, uses the global handler (this requires useNotificationHandler be called and configured). */
|
|
6
|
+
handler?: NotificationHandler;
|
|
7
|
+
};
|
|
8
|
+
interface Props extends
|
|
9
|
+
/** @vue-ignore */
|
|
10
|
+
Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>, RealProps {
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<TransitionGroup
|
|
2
|
+
<TransitionGroup
|
|
3
|
+
name="list"
|
|
3
4
|
tag="div"
|
|
4
5
|
:class="twMerge(`notifications
|
|
5
6
|
absolute
|
|
@@ -13,7 +14,8 @@
|
|
|
13
14
|
`, $attrs.class)"
|
|
14
15
|
v-bind="{ ...$attrs, class: void 0 }"
|
|
15
16
|
>
|
|
16
|
-
<lib-notification
|
|
17
|
+
<lib-notification
|
|
18
|
+
class="pointer-events-auto"
|
|
17
19
|
:handler="handler"
|
|
18
20
|
tabindex="0"
|
|
19
21
|
:notification="notification"
|
|
@@ -28,7 +30,8 @@
|
|
|
28
30
|
/>
|
|
29
31
|
</Transition>
|
|
30
32
|
<Transition>
|
|
31
|
-
<dialog
|
|
33
|
+
<dialog
|
|
34
|
+
v-show="topNotifications.length > 0"
|
|
32
35
|
:id="id"
|
|
33
36
|
:class="twMerge(`notifications-modal
|
|
34
37
|
bg-transparent
|
|
@@ -40,7 +43,8 @@
|
|
|
40
43
|
@click.self.prevent="topNotifications[0] && NotificationHandler.dismiss(topNotifications[0])"
|
|
41
44
|
>
|
|
42
45
|
<form>
|
|
43
|
-
<lib-notification
|
|
46
|
+
<lib-notification
|
|
47
|
+
v-if="topNotifications.length > 0 && topNotifications[0]"
|
|
44
48
|
:handler="handler"
|
|
45
49
|
class="top-notification"
|
|
46
50
|
:notification="topNotifications[0]"
|
|
@@ -53,13 +57,13 @@
|
|
|
53
57
|
|
|
54
58
|
<script setup>
|
|
55
59
|
import { removeIfIn } from "@alanscodelog/utils/removeIfIn";
|
|
56
|
-
import { nextTick, onBeforeUnmount, ref, shallowReactive
|
|
60
|
+
import { nextTick, onBeforeUnmount, ref, shallowReactive } from "vue";
|
|
57
61
|
import LibNotification from "./LibNotification.vue";
|
|
58
62
|
import { useNotificationHandler } from "../../composables/useNotificationHandler.js";
|
|
59
63
|
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
60
64
|
import { twMerge } from "../../utils/twMerge.js";
|
|
61
65
|
defineOptions({
|
|
62
|
-
name: "
|
|
66
|
+
name: "LibNotifications",
|
|
63
67
|
inheritAttrs: false
|
|
64
68
|
});
|
|
65
69
|
const props = defineProps({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "vue";
|
|
2
1
|
import { NotificationHandler } from "../../helpers/NotificationHandler.js.js";
|
|
3
2
|
import type { LinkableByIdProps, TailwindClassProp } from "../shared/props.js.js";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
4
|
type RealProps = LinkableByIdProps & {
|
|
5
5
|
/** If not provided, uses the global handler (this requires useNotificationHandler be called and configured). */
|
|
6
6
|
handler?: NotificationHandler;
|
|
@@ -9,5 +9,5 @@ interface Props extends
|
|
|
9
9
|
/** @vue-ignore */
|
|
10
10
|
Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>, RealProps {
|
|
11
11
|
}
|
|
12
|
-
declare const _default: import("vue").DefineComponent<Props,
|
|
12
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
export default _default;
|