@witchcraft/ui 0.1.1 → 0.1.3
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.cjs +5 -0
- package/dist/module.d.ts +36 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +2 -1
- package/dist/runtime/assets/utils.css +1 -1
- package/dist/runtime/components/Aria/Aria.vue +9 -5
- package/dist/runtime/components/Focus.stories.d.ts +11 -0
- package/dist/runtime/components/Focus.stories.js +53 -0
- package/dist/runtime/components/Icon/Icon.vue +30 -10
- package/dist/runtime/components/LibButton/LibButton.stories.d.ts +12 -0
- package/dist/runtime/components/LibButton/LibButton.stories.js +94 -0
- package/dist/runtime/components/LibButton/LibButton.vue +72 -58
- package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.d.ts +14 -0
- package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.js +29 -0
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +74 -48
- package/dist/runtime/components/LibColorInput/LibColorInput.stories.d.ts +7 -0
- package/dist/runtime/components/LibColorInput/LibColorInput.stories.js +58 -0
- package/dist/runtime/components/LibColorInput/LibColorInput.vue +107 -63
- package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.d.ts +9 -0
- package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.js +68 -0
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +352 -271
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.d.ts +7 -0
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.js +36 -0
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +56 -32
- package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.d.ts +11 -0
- package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.js +98 -0
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue +38 -17
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +82 -53
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +67 -50
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue +8 -7
- package/dist/runtime/components/LibDebug/LibDebug.stories.d.ts +9 -0
- package/dist/runtime/components/LibDebug/LibDebug.stories.js +46 -0
- package/dist/runtime/components/LibDebug/LibDebug.vue +70 -42
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +31 -18
- package/dist/runtime/components/LibFileInput/LibFileInput.stories.d.ts +10 -0
- package/dist/runtime/components/LibFileInput/LibFileInput.stories.js +63 -0
- package/dist/runtime/components/LibFileInput/LibFileInput.vue +156 -113
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.d.ts +33 -0
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.js +384 -0
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +241 -215
- package/dist/runtime/components/LibLabel/LibLabel.stories.d.ts +6 -0
- package/dist/runtime/components/LibLabel/LibLabel.stories.js +25 -0
- package/dist/runtime/components/LibLabel/LibLabel.vue +46 -30
- package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.d.ts +23 -0
- package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.js +61 -0
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +58 -44
- package/dist/runtime/components/LibNotifications/LibNotification.stories.d.ts +15 -0
- package/dist/runtime/components/LibNotifications/LibNotification.stories.js +126 -0
- package/dist/runtime/components/LibNotifications/LibNotification.vue +48 -32
- package/dist/runtime/components/LibNotifications/LibNotifications.stories.d.ts +6 -0
- package/dist/runtime/components/LibNotifications/LibNotifications.stories.js +109 -0
- package/dist/runtime/components/LibNotifications/LibNotifications.vue +83 -63
- package/dist/runtime/components/LibPagination/LibPagination.stories.d.ts +6 -0
- package/dist/runtime/components/LibPagination/LibPagination.stories.js +40 -0
- package/dist/runtime/components/LibPagination/LibPagination.vue +111 -67
- package/dist/runtime/components/LibPalette/LibPalette.stories.d.ts +6 -0
- package/dist/runtime/components/LibPalette/LibPalette.stories.js +20 -0
- package/dist/runtime/components/LibPalette/LibPalette.vue +23 -20
- package/dist/runtime/components/LibPopup/LibPopup.stories.d.ts +14 -0
- package/dist/runtime/components/LibPopup/LibPopup.stories.js +147 -0
- package/dist/runtime/components/LibPopup/LibPopup.vue +351 -314
- package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.d.ts +10 -0
- package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.js +81 -0
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +91 -70
- package/dist/runtime/components/LibRecorder/LibRecorder.stories.d.ts +19 -0
- package/dist/runtime/components/LibRecorder/LibRecorder.stories.js +63 -0
- package/dist/runtime/components/LibRecorder/LibRecorder.vue +177 -133
- package/dist/runtime/components/LibRoot/LibRoot.vue +100 -73
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.d.ts +26 -0
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.js +78 -0
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +77 -49
- package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.d.ts +27 -0
- package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.js +112 -0
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +156 -123
- package/dist/runtime/components/LibTable/LibTable.stories.d.ts +16 -0
- package/dist/runtime/components/LibTable/LibTable.stories.js +156 -0
- package/dist/runtime/components/LibTable/LibTable.vue +99 -63
- package/dist/runtime/components/Reset.stories.d.ts +5 -0
- package/dist/runtime/components/Reset.stories.js +19 -0
- package/dist/runtime/components/Scrolling.stories.d.ts +6 -0
- package/dist/runtime/components/Scrolling.stories.js +44 -0
- package/dist/runtime/components/Template/NAME.vue +36 -15
- package/dist/runtime/components/TestControls/TestControls.vue +9 -6
- package/dist/runtime/composables/useScrollNearContainerEdges.stories.d.ts +7 -0
- package/dist/runtime/composables/useScrollNearContainerEdges.stories.js +85 -0
- package/dist/types.d.mts +6 -2
- package/dist/types.d.ts +7 -0
- package/package.json +11 -5
- package/src/module.ts +2 -1
- package/src/runtime/assets/utils.css +5 -5
- package/src/runtime/components/LibButton/LibButton.vue +2 -6
- package/src/runtime/nuxt/plugins/vue-plugin.ts +1 -1
- package/dist/runtime/components/Aria/Aria.vue.d.ts +0 -5
- package/dist/runtime/components/Icon/Icon.vue.d.ts +0 -21
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +0 -36
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +0 -42
- package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +0 -63
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +0 -61
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +0 -22
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +0 -40
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +0 -34
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +0 -34
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +0 -22
- package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +0 -32
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +0 -22
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +0 -43
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +0 -165
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -27
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +0 -29
- package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +0 -17
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +0 -13
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +0 -104
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +0 -14
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +0 -46
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +0 -41
- package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +0 -77
- package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +0 -41
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +0 -35
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +0 -94
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +0 -45
- package/dist/runtime/components/Template/NAME.vue.d.ts +0 -17
- package/dist/runtime/components/TestControls/TestControls.vue.d.ts +0 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- todo aria errors -->
|
|
3
|
-
<div :class="twMerge(
|
|
4
|
-
`file-input
|
|
3
|
+
<div :class="twMerge(`file-input
|
|
5
4
|
justify-center
|
|
6
5
|
border-2
|
|
7
6
|
border-dashed
|
|
@@ -9,26 +8,25 @@
|
|
|
9
8
|
focus-outline-within
|
|
10
9
|
transition-[border-color,box-shadow]
|
|
11
10
|
ease-out`,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)"
|
|
17
|
-
v-bind="{
|
|
11
|
+
compact && `rounded-sm`,
|
|
12
|
+
!compact && `flex w-full flex-col items-center gap-2 rounded-xl p-2 `,
|
|
13
|
+
errors.length > 0 && errorFlashing && `border-danger-400`,
|
|
14
|
+
( $.wrapperAttrs as any ).class
|
|
15
|
+
)"
|
|
16
|
+
v-bind="{...$.wrapperAttrs, class:undefined}"
|
|
18
17
|
>
|
|
19
|
-
<div :class="twMerge(
|
|
20
|
-
`
|
|
18
|
+
<div :class="twMerge( `
|
|
21
19
|
file-input--wrapper
|
|
22
20
|
relative justify-center`,
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
compact && `flex gap-2`,
|
|
22
|
+
!compact && `input-wrapper
|
|
25
23
|
flex flex-col items-center
|
|
26
24
|
`
|
|
27
|
-
)"
|
|
25
|
+
)"
|
|
28
26
|
>
|
|
29
27
|
<label
|
|
30
28
|
:for="id ?? fallbackId"
|
|
31
|
-
:class="twMerge(`
|
|
29
|
+
:class="twMerge( `
|
|
32
30
|
file-input--label
|
|
33
31
|
pointer-events-none
|
|
34
32
|
flex
|
|
@@ -42,7 +40,14 @@
|
|
|
42
40
|
</slot>
|
|
43
41
|
<slot name="label">
|
|
44
42
|
{{
|
|
45
|
-
|
|
43
|
+
(compact
|
|
44
|
+
? multiple
|
|
45
|
+
? t("file-input.compact-choose-file-plural")
|
|
46
|
+
: t("file-input.compact-choose-file")
|
|
47
|
+
: multiple
|
|
48
|
+
? t("file-input.non-compact-choose-file-plural")
|
|
49
|
+
: t("file-input.non-compact-choose-file")
|
|
50
|
+
)
|
|
46
51
|
}}
|
|
47
52
|
</slot>
|
|
48
53
|
<span
|
|
@@ -60,8 +65,7 @@
|
|
|
60
65
|
</label>
|
|
61
66
|
<input
|
|
62
67
|
:id="id ?? fallbackId"
|
|
63
|
-
:class="twMerge(
|
|
64
|
-
`
|
|
68
|
+
:class="twMerge(`
|
|
65
69
|
file-input--input
|
|
66
70
|
absolute
|
|
67
71
|
inset-0
|
|
@@ -70,28 +74,27 @@
|
|
|
70
74
|
text-[0]
|
|
71
75
|
opacity-0
|
|
72
76
|
`,
|
|
73
|
-
|
|
74
|
-
)"
|
|
77
|
+
($.inputAttrs as any)?.class
|
|
78
|
+
)"
|
|
75
79
|
type="file"
|
|
76
80
|
:accept="formats.join(', ')"
|
|
77
81
|
:multiple="multiple"
|
|
78
82
|
ref="el"
|
|
79
|
-
v-bind="{
|
|
80
|
-
@input="inputFile"
|
|
81
|
-
@click="$event.target.value = null"
|
|
83
|
+
v-bind="{...$.inputAttrs, class:undefined}"
|
|
84
|
+
@input="(inputFile as any)"
|
|
85
|
+
@click="($event.target! as any).value = null"
|
|
82
86
|
>
|
|
83
87
|
<!-- click event allows event to fire even if the user picks the same file -->
|
|
84
88
|
</div>
|
|
85
89
|
<div v-if="!compact && files.length > 0"
|
|
86
|
-
:class="twMerge(
|
|
87
|
-
`file-input--previews
|
|
90
|
+
:class="twMerge(`file-input--previews
|
|
88
91
|
flex items-stretch justify-center gap-2 flex-wrap
|
|
89
92
|
`,
|
|
90
|
-
|
|
93
|
+
multiple && `
|
|
91
94
|
w-full
|
|
92
95
|
`,
|
|
93
|
-
|
|
94
|
-
)"
|
|
96
|
+
($.previewsAttrs as any)?.class
|
|
97
|
+
)"
|
|
95
98
|
>
|
|
96
99
|
<div class="file-input--preview-spacer flex-1"/>
|
|
97
100
|
<div class="file-input--preview-wrapper
|
|
@@ -160,96 +163,136 @@
|
|
|
160
163
|
</div>
|
|
161
164
|
</div>
|
|
162
165
|
</template>
|
|
166
|
+
<script setup lang="ts">
|
|
167
|
+
import { computed, type HTMLAttributes, type InputHTMLAttributes,ref, shallowReactive, watch } from "vue"
|
|
168
|
+
|
|
169
|
+
import { useDivideAttrs } from "../../composables/useDivideAttrs.js"
|
|
170
|
+
import { useInjectedI18n } from "../../composables/useInjectedI18n.js"
|
|
171
|
+
import { type FileInputError } from "../../types/index.js"
|
|
172
|
+
import { twMerge } from "../../utils/twMerge.js"
|
|
173
|
+
import Icon from "../Icon/Icon.vue"
|
|
174
|
+
import LibButton from "../LibButton/LibButton.vue"
|
|
175
|
+
import { getFallbackId,type LinkableByIdProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js"
|
|
176
|
+
|
|
177
|
+
const t = useInjectedI18n()
|
|
178
|
+
const el = ref<null | HTMLInputElement>(null)
|
|
179
|
+
type Entry = { file: File, isImg: boolean }
|
|
180
|
+
|
|
181
|
+
const files = shallowReactive<(Entry)[]>([])
|
|
182
|
+
const errors = shallowReactive<(FileInputError)[]>([])
|
|
183
|
+
const errorFlashing = ref(false)
|
|
163
184
|
|
|
164
|
-
<script setup>
|
|
165
|
-
import { computed, ref, shallowReactive, watch } from "vue";
|
|
166
|
-
import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
|
|
167
|
-
import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
|
|
168
|
-
import {} from "../../types/index.js";
|
|
169
|
-
import { twMerge } from "../../utils/twMerge.js";
|
|
170
|
-
import Icon from "../Icon/Icon.vue";
|
|
171
|
-
import LibButton from "../LibButton/LibButton.vue";
|
|
172
|
-
import { getFallbackId } from "../shared/props.js";
|
|
173
|
-
const t = useInjectedI18n();
|
|
174
|
-
const el = ref(null);
|
|
175
|
-
const files = shallowReactive([]);
|
|
176
|
-
const errors = shallowReactive([]);
|
|
177
|
-
const errorFlashing = ref(false);
|
|
178
185
|
watch(files, () => {
|
|
179
|
-
|
|
180
|
-
})
|
|
186
|
+
emits("input", files.map(entry => entry.file))
|
|
187
|
+
})
|
|
181
188
|
watch(errors, () => {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
})
|
|
189
|
+
if (errors.length > 0) {
|
|
190
|
+
errorFlashing.value = true
|
|
191
|
+
setTimeout(() => {
|
|
192
|
+
errorFlashing.value = false
|
|
193
|
+
}, 500)
|
|
194
|
+
emits("errors", errors)
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
|
|
190
198
|
defineOptions({
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
})
|
|
194
|
-
const $ = useDivideAttrs(["wrapper", "input", "previews"])
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
199
|
+
name: "lib-file-input",
|
|
200
|
+
inheritAttrs: false,
|
|
201
|
+
})
|
|
202
|
+
const $ = useDivideAttrs(["wrapper", "input", "previews"] as const)
|
|
203
|
+
|
|
204
|
+
const emits = defineEmits<{
|
|
205
|
+
(e: "input", val: File[]): void
|
|
206
|
+
(e: "errors", val: FileInputError[]): void
|
|
207
|
+
}>()
|
|
208
|
+
|
|
209
|
+
const fallbackId = getFallbackId()
|
|
210
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
211
|
+
multiple: false,
|
|
212
|
+
formats: () => ["image/*", ".jpeg", ".jpg", ".png"],
|
|
213
|
+
compact: false,
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
const mimeTypes = computed(() => props.formats?.filter(_ => !_.startsWith(".")) ?? [])
|
|
217
|
+
const extensions = computed(() => props.formats?.filter(_ => _.startsWith(".")) ?? [])
|
|
218
|
+
|
|
219
|
+
const getSrc = (file: File) => {
|
|
220
|
+
const src = URL.createObjectURL(file)
|
|
221
|
+
return src
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const removeFile = (entry: Entry) => {
|
|
225
|
+
const index = files.indexOf(entry)
|
|
226
|
+
files.splice(index, 1)
|
|
227
|
+
}
|
|
228
|
+
const extensionsList = computed(() => extensions.value.join(", "))
|
|
229
|
+
const inputFile = async (e: InputEvent): Promise<void | boolean> => {
|
|
230
|
+
e.preventDefault()
|
|
231
|
+
if (el.value!.files) {
|
|
232
|
+
const errs = []
|
|
233
|
+
for (const file of el.value!.files) {
|
|
234
|
+
const isImg = file.type.startsWith("image")
|
|
235
|
+
|
|
236
|
+
const byPassValidation = props.formats.length === 0
|
|
237
|
+
const isValidMimeType = mimeTypes.value.find(_ => _.endsWith("/*") ? file.type.startsWith(_.slice(0, -2)) : _ === file.type) !== undefined
|
|
238
|
+
const isValidExtension = extensions.value.find(_ => file.name.endsWith(_)) !== undefined
|
|
239
|
+
if (!byPassValidation && (!isValidMimeType || !isValidExtension)) {
|
|
240
|
+
const extension = file.name.match(/.*(\..*)/)?.[1] ?? "Unknown"
|
|
241
|
+
const type = file.type === "" ? "" : ` (${file.type})`
|
|
242
|
+
const message = `File type ${extension}${type} is not allowed. Allowed file types are: ${extensionsList.value}.`
|
|
243
|
+
const err = new Error(message) as FileInputError
|
|
244
|
+
err.file = file
|
|
245
|
+
err.isValidExtension = isValidExtension
|
|
246
|
+
err.isValidMimeType = isValidMimeType
|
|
247
|
+
errs.push(err)
|
|
248
|
+
continue
|
|
249
|
+
}
|
|
250
|
+
if (errs.length > 0) continue
|
|
251
|
+
if (!files.find(_ => _.file === file)) {
|
|
252
|
+
if ((props.multiple || files.length < 1)
|
|
253
|
+
) {
|
|
254
|
+
files.push({ file, isImg })
|
|
255
|
+
} else {
|
|
256
|
+
files.splice(0, files.length, { file, isImg })
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (errs.length > 0) {
|
|
261
|
+
errors.splice(0, errors.length, ...errs)
|
|
262
|
+
return false
|
|
263
|
+
} else if (errors.length > 0) {
|
|
264
|
+
errors.splice(0, errors.length)
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
251
269
|
</script>
|
|
270
|
+
<script lang="ts">
|
|
271
|
+
export default { name: "lib-file-input" }
|
|
272
|
+
|
|
273
|
+
type WrapperTypes =
|
|
274
|
+
& WrapperProps<"input", InputHTMLAttributes >
|
|
275
|
+
& WrapperProps<"wrapper", HTMLAttributes >
|
|
276
|
+
& WrapperProps<"previews",HTMLAttributes >
|
|
277
|
+
|
|
278
|
+
type RealProps =
|
|
279
|
+
& LinkableByIdProps
|
|
280
|
+
& {
|
|
281
|
+
multiple?: boolean
|
|
282
|
+
/**
|
|
283
|
+
* 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.
|
|
284
|
+
*
|
|
285
|
+
* Pass an empty array to allow any filetype.
|
|
286
|
+
*/
|
|
287
|
+
formats?: string[]
|
|
288
|
+
compact?: boolean
|
|
289
|
+
}
|
|
252
290
|
|
|
253
|
-
|
|
254
|
-
|
|
291
|
+
interface Props
|
|
292
|
+
extends
|
|
293
|
+
/** @vue-ignore */
|
|
294
|
+
Partial<Omit<InputHTMLAttributes,"class" | "multiple" | "formats" | "compact"> & TailwindClassProp>,
|
|
295
|
+
/** @vue-ignore */
|
|
296
|
+
Partial<WrapperTypes>,
|
|
297
|
+
RealProps { }
|
|
255
298
|
</script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/vue3";
|
|
2
|
+
import LibInputDeprecated from "./LibInputDeprecated.vue.js";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: any;
|
|
5
|
+
title: string;
|
|
6
|
+
args: any;
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof LibInputDeprecated>;
|
|
10
|
+
export declare const Primary: Story;
|
|
11
|
+
export declare const Disabled: Story;
|
|
12
|
+
export declare const Readonly: Story;
|
|
13
|
+
export declare const Invalid: Story;
|
|
14
|
+
export declare const AttrsPassword: Story;
|
|
15
|
+
export declare const AttrsDate: Story;
|
|
16
|
+
export declare const AttrsNumber: Story;
|
|
17
|
+
export declare const Borderless: any;
|
|
18
|
+
export declare const WithAutosuggest: any;
|
|
19
|
+
export declare const WithAutosuggestNoLabel: any;
|
|
20
|
+
export declare const WithInstantAutosuggest: any;
|
|
21
|
+
export declare const AutosuggestRestricted: any;
|
|
22
|
+
export declare const AutosuggestRestrictedWithClearOnClick: any;
|
|
23
|
+
export declare const AutosuggestSelectLikeShowAllUnrestricted: any;
|
|
24
|
+
export declare const AutosuggestObjectOptions: any;
|
|
25
|
+
export declare const Slots: Story;
|
|
26
|
+
/** Press enter to add a value. */
|
|
27
|
+
export declare const WithMultipleValues: Story;
|
|
28
|
+
export declare const WithMultipleValuesWithSuggestions: any;
|
|
29
|
+
export declare const WithMultipleValuesWithSuggestionsNoSelected: any;
|
|
30
|
+
export declare const WithMultipleValuesDisabled: any;
|
|
31
|
+
export declare const WithMultipleValuesReadonly: any;
|
|
32
|
+
export declare const InputSlotReplacement: Story;
|
|
33
|
+
export declare const NextToButton: Story;
|