@ui-sdk/vue 0.0.0-stage → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +10 -2
- package/dist/accordion.d.ts +561 -0
- package/dist/accordion.js +24 -0
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +7 -0
- package/dist/alert-dialog.d.ts +231 -0
- package/dist/alert-dialog.js +33 -0
- package/dist/async-options.d.ts +18 -0
- package/dist/async-options.js +40 -0
- package/dist/autocomplete.d.ts +384 -0
- package/dist/autocomplete.js +344 -0
- package/dist/avatar.d.ts +40 -0
- package/dist/avatar.js +28 -0
- package/dist/button.d.ts +52 -0
- package/dist/button.js +43 -0
- package/dist/calendar-context.d.ts +10 -0
- package/dist/calendar-context.js +7 -0
- package/dist/calendar.d.ts +311 -0
- package/dist/calendar.js +349 -0
- package/dist/carousel.d.ts +236 -0
- package/dist/carousel.js +204 -0
- package/dist/checkbox.d.ts +211 -0
- package/dist/checkbox.js +151 -0
- package/dist/children.d.ts +41 -0
- package/dist/children.js +135 -0
- package/dist/collapsible.d.ts +54 -0
- package/dist/collapsible.js +18 -0
- package/dist/color-picker.d.ts +187 -0
- package/dist/color-picker.js +158 -0
- package/dist/color.d.ts +2 -0
- package/dist/color.js +21 -0
- package/dist/combobox.d.ts +517 -0
- package/dist/combobox.js +531 -0
- package/dist/command.d.ts +322 -0
- package/dist/command.js +345 -0
- package/dist/controller-target.d.ts +49 -0
- package/dist/controller-target.js +112 -0
- package/dist/create-parts.d.ts +126 -0
- package/dist/create-parts.js +206 -0
- package/dist/date-input.d.ts +133 -0
- package/dist/date-input.js +31 -0
- package/dist/date-picker.d.ts +328 -0
- package/dist/date-picker.js +354 -0
- package/dist/date.d.ts +2 -0
- package/dist/date.js +59 -0
- package/dist/dialog-parts.d.ts +259 -0
- package/dist/dialog-parts.js +300 -0
- package/dist/dialog.d.ts +251 -0
- package/dist/dialog.js +25 -0
- package/dist/drawer.d.ts +304 -0
- package/dist/drawer.js +373 -0
- package/dist/editor-context.d.ts +4 -0
- package/dist/editor-context.js +5 -0
- package/dist/field-context.d.ts +26 -0
- package/dist/field-context.js +44 -0
- package/dist/field.d.ts +154 -0
- package/dist/field.js +240 -0
- package/dist/file-input.d.ts +212 -0
- package/dist/file-input.js +255 -0
- package/dist/form-inputs.d.ts +16 -0
- package/dist/form-inputs.js +25 -0
- package/dist/gesture.d.ts +1 -0
- package/dist/gesture.js +15 -0
- package/dist/history.d.ts +2 -0
- package/dist/history.js +11 -0
- package/dist/hover-card.d.ts +137 -0
- package/dist/hover-card.js +153 -0
- package/dist/image-cropper.d.ts +74 -0
- package/dist/image-cropper.js +36 -0
- package/dist/image.d.ts +2 -0
- package/dist/image.js +5 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +60 -0
- package/dist/input.d.ts +120 -0
- package/dist/input.js +73 -0
- package/dist/item-icon.d.ts +34 -0
- package/dist/item-icon.js +63 -0
- package/dist/label.d.ts +16 -0
- package/dist/label.js +8 -0
- package/dist/lifecycle.d.ts +11 -0
- package/dist/lifecycle.js +91 -0
- package/dist/list-items.d.ts +38 -0
- package/dist/list-items.js +59 -0
- package/dist/list-text.d.ts +7 -0
- package/dist/list-text.js +15 -0
- package/dist/listbox.d.ts +273 -0
- package/dist/listbox.js +126 -0
- package/dist/menu.d.ts +678 -0
- package/dist/menu.js +607 -0
- package/dist/menubar-context.d.ts +5 -0
- package/dist/menubar-context.js +5 -0
- package/dist/menubar.d.ts +61 -0
- package/dist/menubar.js +48 -0
- package/dist/meter.d.ts +41 -0
- package/dist/meter.js +37 -0
- package/dist/navigation-menu.d.ts +228 -0
- package/dist/navigation-menu.js +195 -0
- package/dist/number-input.d.ts +176 -0
- package/dist/number-input.js +231 -0
- package/dist/number.d.ts +2 -0
- package/dist/number.js +39 -0
- package/dist/nuxt/entries.json +977 -0
- package/dist/nuxt/module.d.ts +18 -0
- package/dist/nuxt/module.js +31 -0
- package/dist/nuxt/registrations.d.ts +22 -0
- package/dist/nuxt/registrations.js +22 -0
- package/dist/observe.d.ts +2 -0
- package/dist/observe.js +7 -0
- package/dist/otp-input.d.ts +142 -0
- package/dist/otp-input.js +130 -0
- package/dist/overlays.d.ts +40 -0
- package/dist/overlays.js +118 -0
- package/dist/pagination.d.ts +201 -0
- package/dist/pagination.js +146 -0
- package/dist/password-input.d.ts +144 -0
- package/dist/password-input.js +134 -0
- package/dist/popover.d.ts +211 -0
- package/dist/popover.js +258 -0
- package/dist/popup.d.ts +60 -0
- package/dist/popup.js +89 -0
- package/dist/preferences.d.ts +44 -0
- package/dist/preferences.js +102 -0
- package/dist/primitive.d.ts +2 -0
- package/dist/primitive.js +11 -0
- package/dist/progress.d.ts +41 -0
- package/dist/progress.js +37 -0
- package/dist/radio.d.ts +164 -0
- package/dist/radio.js +145 -0
- package/dist/rating.d.ts +149 -0
- package/dist/rating.js +146 -0
- package/dist/renderless.d.ts +4 -0
- package/dist/renderless.js +28 -0
- package/dist/resizable.d.ts +54 -0
- package/dist/resizable.js +22 -0
- package/dist/scroll-area.d.ts +72 -0
- package/dist/scroll-area.js +77 -0
- package/dist/segmented-control.d.ts +151 -0
- package/dist/segmented-control.js +110 -0
- package/dist/segmented-input.d.ts +76 -0
- package/dist/segmented-input.js +115 -0
- package/dist/select.d.ts +458 -0
- package/dist/select.js +468 -0
- package/dist/separator.d.ts +14 -0
- package/dist/separator.js +8 -0
- package/dist/shortcuts.d.ts +32 -0
- package/dist/shortcuts.js +56 -0
- package/dist/slider.d.ts +65 -0
- package/dist/slider.js +194 -0
- package/dist/switch.d.ts +103 -0
- package/dist/switch.js +71 -0
- package/dist/tabs.d.ts +338 -0
- package/dist/tabs.js +27 -0
- package/dist/text-control.d.ts +89 -0
- package/dist/text-control.js +51 -0
- package/dist/text-match.d.ts +2 -0
- package/dist/text-match.js +7 -0
- package/dist/textarea.d.ts +106 -0
- package/dist/textarea.js +68 -0
- package/dist/time-input.d.ts +131 -0
- package/dist/time-input.js +32 -0
- package/dist/timeline.d.ts +81 -0
- package/dist/timeline.js +30 -0
- package/dist/toast-parts.d.ts +203 -0
- package/dist/toast-parts.js +270 -0
- package/dist/toast.d.ts +2 -0
- package/dist/toast.js +21 -0
- package/dist/toggle-props.d.ts +22 -0
- package/dist/toggle-props.js +14 -0
- package/dist/toggle.d.ts +199 -0
- package/dist/toggle.js +129 -0
- package/dist/token-input.d.ts +136 -0
- package/dist/token-input.js +214 -0
- package/dist/toolbar-context.d.ts +7 -0
- package/dist/toolbar-context.js +20 -0
- package/dist/toolbar.d.ts +120 -0
- package/dist/toolbar.js +77 -0
- package/dist/tooltip.d.ts +160 -0
- package/dist/tooltip.js +224 -0
- package/dist/tree.d.ts +300 -0
- package/dist/tree.js +209 -0
- package/dist/trigger-menu.d.ts +452 -0
- package/dist/trigger-menu.js +254 -0
- package/dist/use-primitive.d.ts +132 -0
- package/dist/use-primitive.js +462 -0
- package/dist/waterfall.d.ts +201 -0
- package/dist/waterfall.js +171 -0
- package/docs/README.md +89 -0
- package/docs/agents.md +1523 -0
- package/docs/components/accordion.md +1369 -0
- package/docs/components/alert-dialog.md +799 -0
- package/docs/components/autocomplete.md +1857 -0
- package/docs/components/avatar.md +272 -0
- package/docs/components/button.md +435 -0
- package/docs/components/calendar.md +1589 -0
- package/docs/components/carousel.md +1171 -0
- package/docs/components/checkbox.md +1008 -0
- package/docs/components/collapsible.md +536 -0
- package/docs/components/color-picker.md +706 -0
- package/docs/components/combobox.md +3504 -0
- package/docs/components/command.md +1481 -0
- package/docs/components/date-input.md +536 -0
- package/docs/components/date-picker.md +1244 -0
- package/docs/components/dialog.md +1397 -0
- package/docs/components/drawer.md +1166 -0
- package/docs/components/field.md +538 -0
- package/docs/components/file-input.md +611 -0
- package/docs/components/hover-card.md +505 -0
- package/docs/components/image-cropper.md +556 -0
- package/docs/components/input.md +306 -0
- package/docs/components/label.md +203 -0
- package/docs/components/listbox.md +1004 -0
- package/docs/components/menu.md +1229 -0
- package/docs/components/menubar.md +443 -0
- package/docs/components/meter.md +315 -0
- package/docs/components/navigation-menu.md +1523 -0
- package/docs/components/number-input.md +1029 -0
- package/docs/components/otp-input.md +512 -0
- package/docs/components/pagination.md +613 -0
- package/docs/components/password-input.md +649 -0
- package/docs/components/popover.md +1448 -0
- package/docs/components/preferences.md +208 -0
- package/docs/components/progress.md +423 -0
- package/docs/components/radio.md +785 -0
- package/docs/components/rating.md +416 -0
- package/docs/components/resizable.md +910 -0
- package/docs/components/scroll-area.md +915 -0
- package/docs/components/segmented-control.md +435 -0
- package/docs/components/select.md +2015 -0
- package/docs/components/separator.md +229 -0
- package/docs/components/slider.md +1084 -0
- package/docs/components/switch.md +565 -0
- package/docs/components/tabs.md +944 -0
- package/docs/components/textarea.md +299 -0
- package/docs/components/time-input.md +224 -0
- package/docs/components/timeline.md +654 -0
- package/docs/components/toast.md +1224 -0
- package/docs/components/toggle.md +500 -0
- package/docs/components/token-input.md +953 -0
- package/docs/components/toolbar.md +739 -0
- package/docs/components/tooltip.md +818 -0
- package/docs/components/tree.md +1306 -0
- package/docs/components/trigger-menu.md +1223 -0
- package/docs/components/waterfall.md +717 -0
- package/docs/controllers.md +71 -0
- package/docs/core.md +8027 -0
- package/docs/custom-parts.md +89 -0
- package/docs/first-component.md +83 -0
- package/docs/forms.md +122 -0
- package/docs/installation.md +72 -0
- package/docs/introduction.md +32 -0
- package/docs/lists-and-menus.md +122 -0
- package/docs/llms.txt +1502 -0
- package/docs/parts-and-composition.md +85 -0
- package/docs/popups.md +108 -0
- package/docs/rendering.md +56 -0
- package/docs/server-rendering.md +180 -0
- package/docs/state-and-events.md +100 -0
- package/docs/styling-and-animation.md +148 -0
- package/docs/utilities/async-options.md +348 -0
- package/docs/utilities/shortcuts.md +159 -0
- package/package.json +352 -3
package/dist/field.js
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
// src/field.ts
|
|
2
|
+
import {
|
|
3
|
+
fieldGroup as fieldGroupPrimitive,
|
|
4
|
+
field as fieldPrimitive,
|
|
5
|
+
fieldSet as fieldSetPrimitive
|
|
6
|
+
} from "@ui-sdk/core/field";
|
|
7
|
+
import {
|
|
8
|
+
checkFieldOutside,
|
|
9
|
+
fieldOutsideAttrs,
|
|
10
|
+
fieldOutsideErrorShown,
|
|
11
|
+
fieldOutsideState
|
|
12
|
+
} from "@ui-sdk/core/renderer";
|
|
13
|
+
import {
|
|
14
|
+
defineComponent,
|
|
15
|
+
inject,
|
|
16
|
+
provide,
|
|
17
|
+
useAttrs,
|
|
18
|
+
useId,
|
|
19
|
+
useSlots
|
|
20
|
+
} from "vue";
|
|
21
|
+
import { slotContent } from "./children.js";
|
|
22
|
+
import { withElement } from "./create-parts.js";
|
|
23
|
+
import {
|
|
24
|
+
optionalBoolean,
|
|
25
|
+
renderElement,
|
|
26
|
+
usePart,
|
|
27
|
+
usePrimitive,
|
|
28
|
+
useScope
|
|
29
|
+
} from "./use-primitive.js";
|
|
30
|
+
import { FieldKey } from "./field-context.js";
|
|
31
|
+
import { useFieldControl } from "./field-context.js";
|
|
32
|
+
var DescribedKey = /* @__PURE__ */ Symbol("field-described");
|
|
33
|
+
var outsideRefs = {
|
|
34
|
+
label: (el) => checkFieldOutside(el, "label"),
|
|
35
|
+
control: (el) => checkFieldOutside(el, "control")
|
|
36
|
+
};
|
|
37
|
+
function useOutside(slot, element, shown = () => true) {
|
|
38
|
+
const attrs = useAttrs();
|
|
39
|
+
const slots = useSlots();
|
|
40
|
+
const ref = outsideRefs[slot];
|
|
41
|
+
return () => {
|
|
42
|
+
if (!shown()) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const props = { ...fieldOutsideAttrs(slot), ...attrs, ...ref && { ref } };
|
|
46
|
+
return renderElement(props, slots, fieldOutsideState, element);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function useIdProp() {
|
|
50
|
+
const attrs = useAttrs();
|
|
51
|
+
return () => ({ id: attrs.id });
|
|
52
|
+
}
|
|
53
|
+
var Field = withElement(
|
|
54
|
+
"div",
|
|
55
|
+
defineComponent({
|
|
56
|
+
name: "Field",
|
|
57
|
+
inheritAttrs: false,
|
|
58
|
+
props: {
|
|
59
|
+
name: String,
|
|
60
|
+
disabled: optionalBoolean,
|
|
61
|
+
invalid: optionalBoolean,
|
|
62
|
+
debug: optionalBoolean
|
|
63
|
+
},
|
|
64
|
+
slots: Object,
|
|
65
|
+
setup(props) {
|
|
66
|
+
const field = usePrimitive(fieldPrimitive, () => ({
|
|
67
|
+
name: props.name,
|
|
68
|
+
disabled: props.disabled,
|
|
69
|
+
invalid: props.invalid,
|
|
70
|
+
debug: props.debug
|
|
71
|
+
}));
|
|
72
|
+
const context = {
|
|
73
|
+
...field,
|
|
74
|
+
name: () => props.name,
|
|
75
|
+
disabled: () => props.disabled
|
|
76
|
+
};
|
|
77
|
+
provide(FieldKey, context);
|
|
78
|
+
provide(DescribedKey, context);
|
|
79
|
+
return usePart(field, "root");
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
);
|
|
83
|
+
var FieldLabel = withElement(
|
|
84
|
+
"label",
|
|
85
|
+
defineComponent({
|
|
86
|
+
name: "FieldLabel",
|
|
87
|
+
inheritAttrs: false,
|
|
88
|
+
slots: Object,
|
|
89
|
+
setup() {
|
|
90
|
+
const field = inject(FieldKey, null);
|
|
91
|
+
if (!field) {
|
|
92
|
+
return useOutside("label", { tag: "label" });
|
|
93
|
+
}
|
|
94
|
+
return usePart(field, "label", useIdProp(), void 0, "label");
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
var FieldDescription = withElement(
|
|
99
|
+
"p",
|
|
100
|
+
defineComponent({
|
|
101
|
+
name: "FieldDescription",
|
|
102
|
+
inheritAttrs: false,
|
|
103
|
+
// A field set's description has only the set's state.
|
|
104
|
+
slots: Object,
|
|
105
|
+
setup() {
|
|
106
|
+
const described = inject(DescribedKey, null);
|
|
107
|
+
if (!described) {
|
|
108
|
+
return useOutside("description", { tag: "p" });
|
|
109
|
+
}
|
|
110
|
+
return usePart(
|
|
111
|
+
described,
|
|
112
|
+
"description",
|
|
113
|
+
useIdProp(),
|
|
114
|
+
void 0,
|
|
115
|
+
"p"
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
);
|
|
120
|
+
var FieldError = withElement(
|
|
121
|
+
"div",
|
|
122
|
+
defineComponent({
|
|
123
|
+
name: "FieldError",
|
|
124
|
+
inheritAttrs: false,
|
|
125
|
+
props: {
|
|
126
|
+
match: {
|
|
127
|
+
type: [Boolean, String],
|
|
128
|
+
default: void 0
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
slots: Object,
|
|
132
|
+
setup(props, { slots }) {
|
|
133
|
+
const attrs = useAttrs();
|
|
134
|
+
const made = useId();
|
|
135
|
+
const field = inject(FieldKey, null);
|
|
136
|
+
const element = {
|
|
137
|
+
tag: "div",
|
|
138
|
+
children: (state) => slotContent(slots.default, { state }) ?? state.message
|
|
139
|
+
};
|
|
140
|
+
if (!field) {
|
|
141
|
+
return useOutside(
|
|
142
|
+
"error",
|
|
143
|
+
element,
|
|
144
|
+
() => fieldOutsideErrorShown({ match: props.match })
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
const id = () => attrs.id ?? (props.match === void 0 ? void 0 : made);
|
|
148
|
+
return usePart(
|
|
149
|
+
field,
|
|
150
|
+
"error",
|
|
151
|
+
() => ({ id: id(), match: props.match }),
|
|
152
|
+
void 0,
|
|
153
|
+
element
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
);
|
|
158
|
+
var FieldControl = withElement(
|
|
159
|
+
"input",
|
|
160
|
+
defineComponent({
|
|
161
|
+
name: "FieldControl",
|
|
162
|
+
inheritAttrs: false,
|
|
163
|
+
slots: Object,
|
|
164
|
+
setup() {
|
|
165
|
+
const field = inject(FieldKey, null);
|
|
166
|
+
if (!field) {
|
|
167
|
+
return useOutside("control", { tag: "input" });
|
|
168
|
+
}
|
|
169
|
+
const attrs = useAttrs();
|
|
170
|
+
const control = () => ({
|
|
171
|
+
id: attrs.id,
|
|
172
|
+
describedBy: attrs["aria-describedby"]
|
|
173
|
+
});
|
|
174
|
+
return usePart(
|
|
175
|
+
field,
|
|
176
|
+
"control",
|
|
177
|
+
control,
|
|
178
|
+
() => ({ name: field.name(), ...attrs }),
|
|
179
|
+
"input"
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
})
|
|
183
|
+
);
|
|
184
|
+
var FieldSet = withElement(
|
|
185
|
+
"fieldset",
|
|
186
|
+
defineComponent({
|
|
187
|
+
name: "FieldSet",
|
|
188
|
+
inheritAttrs: false,
|
|
189
|
+
props: { disabled: optionalBoolean, debug: optionalBoolean },
|
|
190
|
+
slots: Object,
|
|
191
|
+
setup(props) {
|
|
192
|
+
const set = usePrimitive(fieldSetPrimitive, () => ({
|
|
193
|
+
disabled: props.disabled,
|
|
194
|
+
debug: props.debug
|
|
195
|
+
}));
|
|
196
|
+
provide(DescribedKey, set);
|
|
197
|
+
return usePart(set, "set", void 0, void 0, "fieldset");
|
|
198
|
+
}
|
|
199
|
+
})
|
|
200
|
+
);
|
|
201
|
+
var FieldLegend = withElement(
|
|
202
|
+
"legend",
|
|
203
|
+
defineComponent({
|
|
204
|
+
name: "FieldLegend",
|
|
205
|
+
inheritAttrs: false,
|
|
206
|
+
slots: Object,
|
|
207
|
+
setup() {
|
|
208
|
+
const set = useScope(fieldSetPrimitive)?.handle;
|
|
209
|
+
if (!set) {
|
|
210
|
+
throw new Error("FieldLegend must be used inside <FieldSet>.");
|
|
211
|
+
}
|
|
212
|
+
return usePart(set, "legend", useIdProp(), void 0, "legend");
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
);
|
|
216
|
+
var FieldGroup = withElement(
|
|
217
|
+
"div",
|
|
218
|
+
defineComponent({
|
|
219
|
+
name: "FieldGroup",
|
|
220
|
+
inheritAttrs: false,
|
|
221
|
+
slots: Object,
|
|
222
|
+
setup() {
|
|
223
|
+
return usePart(
|
|
224
|
+
usePrimitive(fieldGroupPrimitive, () => ({})),
|
|
225
|
+
"group"
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
);
|
|
230
|
+
export {
|
|
231
|
+
Field,
|
|
232
|
+
FieldControl,
|
|
233
|
+
FieldDescription,
|
|
234
|
+
FieldError,
|
|
235
|
+
FieldGroup,
|
|
236
|
+
FieldLabel,
|
|
237
|
+
FieldLegend,
|
|
238
|
+
FieldSet,
|
|
239
|
+
useFieldControl
|
|
240
|
+
};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { type FileInputDropzoneTarget, type FileInputController, type FileInputOptions, type FileInputState, type FileInputValueChangeDetails, type FileInputValueChangeReason, type FileRejection, type FileInputPasteTarget } from "@ui-sdk/core/file-input";
|
|
2
|
+
import type { CommitDetails } from "@ui-sdk/core";
|
|
3
|
+
import { type FunctionalComponent, type PropType, type SlotsType, type VNode } from "vue";
|
|
4
|
+
import { type PartSlots } from "./use-primitive.js";
|
|
5
|
+
/**
|
|
6
|
+
* The root: it holds the files, and renders the hidden file input that opens
|
|
7
|
+
* the picker and that a form submits.
|
|
8
|
+
* @stable
|
|
9
|
+
*/
|
|
10
|
+
declare const FileInput: import("./create-parts.js").ElementPart<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
11
|
+
value: {
|
|
12
|
+
type: PropType<File[]>;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
15
|
+
modelValue: {
|
|
16
|
+
type: PropType<File[]>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
defaultValue: {
|
|
20
|
+
type: PropType<File[]>;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
accept: PropType<FileInputOptions["accept"]>;
|
|
24
|
+
multiple: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: undefined;
|
|
27
|
+
};
|
|
28
|
+
directory: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: undefined;
|
|
31
|
+
};
|
|
32
|
+
capture: {
|
|
33
|
+
type: PropType<FileInputOptions["capture"]>;
|
|
34
|
+
default: undefined;
|
|
35
|
+
};
|
|
36
|
+
maxFiles: NumberConstructor;
|
|
37
|
+
maxSize: NumberConstructor;
|
|
38
|
+
minSize: NumberConstructor;
|
|
39
|
+
validate: PropType<FileInputOptions["validate"]>;
|
|
40
|
+
name: StringConstructor;
|
|
41
|
+
form: StringConstructor;
|
|
42
|
+
required: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: undefined;
|
|
45
|
+
};
|
|
46
|
+
disabled: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: undefined;
|
|
49
|
+
};
|
|
50
|
+
announcement: PropType<FileInputOptions["announcement"]>;
|
|
51
|
+
controller: PropType<FileInputController>;
|
|
52
|
+
debug: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: undefined;
|
|
55
|
+
};
|
|
56
|
+
}>, (() => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
}>[] | null) & {
|
|
61
|
+
state: NoInfer<FileInputState>;
|
|
62
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
63
|
+
"update:value": (_value: File[]) => true;
|
|
64
|
+
"update:modelValue": (_value: File[]) => true;
|
|
65
|
+
valueChange: (_value: File[], _details: FileInputValueChangeDetails) => true;
|
|
66
|
+
reject: (_rejected: FileRejection[], _details: CommitDetails<FileInputValueChangeReason>) => true;
|
|
67
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
68
|
+
value: {
|
|
69
|
+
type: PropType<File[]>;
|
|
70
|
+
default: undefined;
|
|
71
|
+
};
|
|
72
|
+
modelValue: {
|
|
73
|
+
type: PropType<File[]>;
|
|
74
|
+
default: undefined;
|
|
75
|
+
};
|
|
76
|
+
defaultValue: {
|
|
77
|
+
type: PropType<File[]>;
|
|
78
|
+
default: undefined;
|
|
79
|
+
};
|
|
80
|
+
accept: PropType<FileInputOptions["accept"]>;
|
|
81
|
+
multiple: {
|
|
82
|
+
type: BooleanConstructor;
|
|
83
|
+
default: undefined;
|
|
84
|
+
};
|
|
85
|
+
directory: {
|
|
86
|
+
type: BooleanConstructor;
|
|
87
|
+
default: undefined;
|
|
88
|
+
};
|
|
89
|
+
capture: {
|
|
90
|
+
type: PropType<FileInputOptions["capture"]>;
|
|
91
|
+
default: undefined;
|
|
92
|
+
};
|
|
93
|
+
maxFiles: NumberConstructor;
|
|
94
|
+
maxSize: NumberConstructor;
|
|
95
|
+
minSize: NumberConstructor;
|
|
96
|
+
validate: PropType<FileInputOptions["validate"]>;
|
|
97
|
+
name: StringConstructor;
|
|
98
|
+
form: StringConstructor;
|
|
99
|
+
required: {
|
|
100
|
+
type: BooleanConstructor;
|
|
101
|
+
default: undefined;
|
|
102
|
+
};
|
|
103
|
+
disabled: {
|
|
104
|
+
type: BooleanConstructor;
|
|
105
|
+
default: undefined;
|
|
106
|
+
};
|
|
107
|
+
announcement: PropType<FileInputOptions["announcement"]>;
|
|
108
|
+
controller: PropType<FileInputController>;
|
|
109
|
+
debug: {
|
|
110
|
+
type: BooleanConstructor;
|
|
111
|
+
default: undefined;
|
|
112
|
+
};
|
|
113
|
+
}>> & Readonly<{
|
|
114
|
+
onReject?: ((_rejected: FileRejection[], _details: CommitDetails<FileInputValueChangeReason>) => any) | undefined;
|
|
115
|
+
"onUpdate:modelValue"?: ((_value: File[]) => any) | undefined;
|
|
116
|
+
"onUpdate:value"?: ((_value: File[]) => any) | undefined;
|
|
117
|
+
onValueChange?: ((_value: File[], _details: FileInputValueChangeDetails) => any) | undefined;
|
|
118
|
+
}>, {
|
|
119
|
+
value: File[];
|
|
120
|
+
disabled: boolean;
|
|
121
|
+
debug: boolean;
|
|
122
|
+
capture: boolean | "user" | "environment" | undefined;
|
|
123
|
+
multiple: boolean;
|
|
124
|
+
defaultValue: File[];
|
|
125
|
+
required: boolean;
|
|
126
|
+
directory: boolean;
|
|
127
|
+
modelValue: File[];
|
|
128
|
+
}, PartSlots<import("@ui-sdk/core/file-input").FileInputPrimitive, "root">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "div">;
|
|
129
|
+
/**
|
|
130
|
+
* Opens the file picker. Inside a Field, the field's label names it with the
|
|
131
|
+
* button's own text. Outside the file input, it connects through `controller`.
|
|
132
|
+
* @stable
|
|
133
|
+
*/
|
|
134
|
+
declare const FileInputTrigger: import("./create-parts.js").ElementPart<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
135
|
+
controller: PropType<FileInputController>;
|
|
136
|
+
}>, () => unknown, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
137
|
+
controller: PropType<FileInputController>;
|
|
138
|
+
}>> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/file-input").FileInputPrimitive, "trigger">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "button">;
|
|
139
|
+
/**
|
|
140
|
+
* Takes dropped and pasted files. Put the trigger inside it, which is how
|
|
141
|
+
* keyboard and screen reader users choose files.
|
|
142
|
+
* @stable
|
|
143
|
+
*/
|
|
144
|
+
declare const FileInputDropzone: import("./create-parts.js").ElementPart<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
145
|
+
target: PropType<FileInputDropzoneTarget>;
|
|
146
|
+
pasteTarget: PropType<FileInputPasteTarget>;
|
|
147
|
+
}>, (() => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
148
|
+
[key: string]: any;
|
|
149
|
+
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
150
|
+
[key: string]: any;
|
|
151
|
+
}>[] | null) & {
|
|
152
|
+
state: NoInfer<import("@ui-sdk/core/file-input").FileInputDropzoneState>;
|
|
153
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
154
|
+
target: PropType<FileInputDropzoneTarget>;
|
|
155
|
+
pasteTarget: PropType<FileInputPasteTarget>;
|
|
156
|
+
}>> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/file-input").FileInputPrimitive, "dropzone">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "div">;
|
|
157
|
+
/**
|
|
158
|
+
* The files, as a list. Its default slot renders once for each file, so put
|
|
159
|
+
* a FileInputItem in it.
|
|
160
|
+
* @stable
|
|
161
|
+
*/
|
|
162
|
+
declare const FileInputList: import("./create-parts.js").ElementPart<import("vue").DefineComponent<{}, (() => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
163
|
+
[key: string]: any;
|
|
164
|
+
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
165
|
+
[key: string]: any;
|
|
166
|
+
}>[] | null) & {
|
|
167
|
+
state: NoInfer<FileInputState>;
|
|
168
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
|
|
169
|
+
/** Renders once for each file. */
|
|
170
|
+
default?: () => VNode[];
|
|
171
|
+
/** Renders your own element: bind `props` to it, and render the files inside with `<component :is="children" />`. */
|
|
172
|
+
render?: (scope: {
|
|
173
|
+
props: Record<string, unknown>;
|
|
174
|
+
state: FileInputState;
|
|
175
|
+
children: FunctionalComponent;
|
|
176
|
+
}) => VNode[];
|
|
177
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "div">;
|
|
178
|
+
/**
|
|
179
|
+
* One file. Its slot state has the file, for its name, size and preview.
|
|
180
|
+
* Arrow keys move between items, and Backspace or Delete removes the focused one.
|
|
181
|
+
* @stable
|
|
182
|
+
*/
|
|
183
|
+
declare const FileInputItem: import("./create-parts.js").ElementPart<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
184
|
+
file: PropType<File>;
|
|
185
|
+
}>, (() => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
186
|
+
[key: string]: any;
|
|
187
|
+
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
188
|
+
[key: string]: any;
|
|
189
|
+
}>[] | null) & {
|
|
190
|
+
state: NoInfer<import("@ui-sdk/core/file-input").FileInputItemState>;
|
|
191
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
192
|
+
file: PropType<File>;
|
|
193
|
+
}>> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/file-input").FileInputPrimitive, "item">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "div">;
|
|
194
|
+
/**
|
|
195
|
+
* Removes its item's file, or the `file` it's given. It's named "Remove <file
|
|
196
|
+
* name>" unless you name it.
|
|
197
|
+
* @stable
|
|
198
|
+
*/
|
|
199
|
+
declare const FileInputItemRemove: import("./create-parts.js").ElementPart<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
200
|
+
file: PropType<File>;
|
|
201
|
+
}>, (() => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
202
|
+
[key: string]: any;
|
|
203
|
+
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
204
|
+
[key: string]: any;
|
|
205
|
+
}>[] | null) & {
|
|
206
|
+
state: NoInfer<import("@ui-sdk/core/file-input").FileInputItemRemoveState>;
|
|
207
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
208
|
+
file: PropType<File>;
|
|
209
|
+
}>> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/file-input").FileInputPrimitive, "item-remove">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "button">;
|
|
210
|
+
export { createFileInputController, formatFileSize, relativePath, } from "@ui-sdk/core/file-input";
|
|
211
|
+
export type { FileInputApi, FileInputChange, FileInputChangeOptions, FileInputController, FileInputDropzoneProps, FileInputDropzoneState, FileInputDropzoneTarget, FileInputItemProps, FileInputItemRemoveState, FileInputItemState, FileInputOptions, FileInputPasteTarget, FileInputPrimitive, FileInputState, FileInputTriggerProps, FileInputValueChangeDetails, FileInputValueChangeReason, FileLike, FileRejection, FileRejectionReason, FileRules, } from "@ui-sdk/core/file-input";
|
|
212
|
+
export { FileInput, FileInputDropzone, FileInputItem, FileInputItemRemove, FileInputList, FileInputTrigger, };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// src/file-input.ts
|
|
2
|
+
import {
|
|
3
|
+
fileInput as fileInputPrimitive
|
|
4
|
+
} from "@ui-sdk/core/file-input";
|
|
5
|
+
import { fileKey } from "@ui-sdk/core/renderer";
|
|
6
|
+
import {
|
|
7
|
+
defineComponent,
|
|
8
|
+
h,
|
|
9
|
+
inject,
|
|
10
|
+
provide,
|
|
11
|
+
useId
|
|
12
|
+
} from "vue";
|
|
13
|
+
import {
|
|
14
|
+
renderUnbound,
|
|
15
|
+
useConnectedPart,
|
|
16
|
+
useControllerEntry,
|
|
17
|
+
useControllerTarget
|
|
18
|
+
} from "./controller-target.js";
|
|
19
|
+
import { withElement } from "./create-parts.js";
|
|
20
|
+
import { useFieldControl } from "./field-context.js";
|
|
21
|
+
import {
|
|
22
|
+
optionalBoolean,
|
|
23
|
+
orModel,
|
|
24
|
+
usePart,
|
|
25
|
+
usePrimitive,
|
|
26
|
+
useScope
|
|
27
|
+
} from "./use-primitive.js";
|
|
28
|
+
import {
|
|
29
|
+
createFileInputController,
|
|
30
|
+
formatFileSize,
|
|
31
|
+
relativePath
|
|
32
|
+
} from "@ui-sdk/core/file-input";
|
|
33
|
+
var FileKey = /* @__PURE__ */ Symbol("file-input-file");
|
|
34
|
+
function useFileInput(part) {
|
|
35
|
+
const context = useScope(fileInputPrimitive)?.handle;
|
|
36
|
+
if (!context) {
|
|
37
|
+
throw new Error(`${part} must be used inside <FileInput>.`);
|
|
38
|
+
}
|
|
39
|
+
return context;
|
|
40
|
+
}
|
|
41
|
+
function useItemFile(part, own) {
|
|
42
|
+
const listed = inject(FileKey, null);
|
|
43
|
+
return () => {
|
|
44
|
+
const file = own() ?? listed?.();
|
|
45
|
+
if (!file) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`${part} must be used inside <FileInputList>, or be given a file.`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return file;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var FileInput = withElement(
|
|
54
|
+
"div",
|
|
55
|
+
defineComponent({
|
|
56
|
+
name: "FileInput",
|
|
57
|
+
inheritAttrs: false,
|
|
58
|
+
props: {
|
|
59
|
+
value: { type: Array, default: void 0 },
|
|
60
|
+
modelValue: { type: Array, default: void 0 },
|
|
61
|
+
defaultValue: { type: Array, default: void 0 },
|
|
62
|
+
accept: [String, Array],
|
|
63
|
+
multiple: optionalBoolean,
|
|
64
|
+
directory: optionalBoolean,
|
|
65
|
+
capture: {
|
|
66
|
+
type: [Boolean, String],
|
|
67
|
+
default: void 0
|
|
68
|
+
},
|
|
69
|
+
maxFiles: Number,
|
|
70
|
+
maxSize: Number,
|
|
71
|
+
minSize: Number,
|
|
72
|
+
validate: Function,
|
|
73
|
+
name: String,
|
|
74
|
+
form: String,
|
|
75
|
+
required: optionalBoolean,
|
|
76
|
+
disabled: optionalBoolean,
|
|
77
|
+
announcement: Function,
|
|
78
|
+
controller: Object,
|
|
79
|
+
debug: optionalBoolean
|
|
80
|
+
},
|
|
81
|
+
emits: {
|
|
82
|
+
"update:value": (_value) => true,
|
|
83
|
+
"update:modelValue": (_value) => true,
|
|
84
|
+
valueChange: (_value, _details) => true,
|
|
85
|
+
reject: (_rejected, _details) => true
|
|
86
|
+
},
|
|
87
|
+
slots: Object,
|
|
88
|
+
setup(props, { emit }) {
|
|
89
|
+
const field = useFieldControl();
|
|
90
|
+
const fileInput = usePrimitive(fileInputPrimitive, () => ({
|
|
91
|
+
value: orModel(props.value, props.modelValue),
|
|
92
|
+
defaultValue: props.defaultValue,
|
|
93
|
+
accept: props.accept,
|
|
94
|
+
multiple: props.multiple,
|
|
95
|
+
directory: props.directory,
|
|
96
|
+
capture: props.capture,
|
|
97
|
+
maxFiles: props.maxFiles,
|
|
98
|
+
maxSize: props.maxSize,
|
|
99
|
+
minSize: props.minSize,
|
|
100
|
+
validate: props.validate,
|
|
101
|
+
name: props.name ?? field?.name(),
|
|
102
|
+
form: props.form,
|
|
103
|
+
required: props.required,
|
|
104
|
+
disabled: props.disabled || field?.disabled(),
|
|
105
|
+
announcement: props.announcement,
|
|
106
|
+
controller: props.controller,
|
|
107
|
+
debug: props.debug,
|
|
108
|
+
onValueChange: (value, details) => {
|
|
109
|
+
emit("valueChange", value, details);
|
|
110
|
+
if (details.canceled) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
emit("update:value", value);
|
|
114
|
+
emit("update:modelValue", value);
|
|
115
|
+
},
|
|
116
|
+
onReject: (rejected, details) => emit("reject", rejected, details)
|
|
117
|
+
}));
|
|
118
|
+
useControllerEntry(() => props.controller, fileInput);
|
|
119
|
+
return usePart(fileInput, "root", void 0, void 0, {
|
|
120
|
+
tag: "div",
|
|
121
|
+
hidden: () => h("input", fileInput.slot("input"))
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
);
|
|
126
|
+
var unconnected = {
|
|
127
|
+
value: [],
|
|
128
|
+
disabled: false,
|
|
129
|
+
required: false,
|
|
130
|
+
dragging: false
|
|
131
|
+
};
|
|
132
|
+
var FileInputTrigger = withElement(
|
|
133
|
+
"button",
|
|
134
|
+
defineComponent({
|
|
135
|
+
name: "FileInputTrigger",
|
|
136
|
+
inheritAttrs: false,
|
|
137
|
+
props: {
|
|
138
|
+
controller: Object
|
|
139
|
+
},
|
|
140
|
+
slots: Object,
|
|
141
|
+
setup(props, { slots, attrs }) {
|
|
142
|
+
const connected = useControllerTarget(
|
|
143
|
+
fileInputPrimitive,
|
|
144
|
+
() => props.controller
|
|
145
|
+
);
|
|
146
|
+
const field = useFieldControl();
|
|
147
|
+
return useConnectedPart(
|
|
148
|
+
connected,
|
|
149
|
+
(fileInput) => usePart(fileInput, "trigger", void 0, void 0, {
|
|
150
|
+
tag: "button",
|
|
151
|
+
extend: field?.props
|
|
152
|
+
}),
|
|
153
|
+
// Until the file input it names mounts, a trigger outside it is a plain button.
|
|
154
|
+
() => renderUnbound(
|
|
155
|
+
"button",
|
|
156
|
+
{ type: "button", ...attrs },
|
|
157
|
+
{ slots, state: unconnected }
|
|
158
|
+
)
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
);
|
|
163
|
+
var FileInputDropzone = withElement(
|
|
164
|
+
"div",
|
|
165
|
+
defineComponent({
|
|
166
|
+
name: "FileInputDropzone",
|
|
167
|
+
inheritAttrs: false,
|
|
168
|
+
props: {
|
|
169
|
+
target: String,
|
|
170
|
+
pasteTarget: [String, Object, Function]
|
|
171
|
+
},
|
|
172
|
+
slots: Object,
|
|
173
|
+
setup(props) {
|
|
174
|
+
const fileInput = useFileInput("FileInputDropzone");
|
|
175
|
+
const id = useId();
|
|
176
|
+
const zone = () => ({
|
|
177
|
+
id,
|
|
178
|
+
target: props.target,
|
|
179
|
+
pasteTarget: props.pasteTarget
|
|
180
|
+
});
|
|
181
|
+
return usePart(fileInput, "dropzone", zone);
|
|
182
|
+
}
|
|
183
|
+
})
|
|
184
|
+
);
|
|
185
|
+
var FileScope = defineComponent({
|
|
186
|
+
name: "FileInputFileScope",
|
|
187
|
+
props: { file: { type: Object, required: true } },
|
|
188
|
+
setup(props, { slots }) {
|
|
189
|
+
provide(FileKey, () => props.file);
|
|
190
|
+
return () => slots.default?.();
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
var FileInputList = withElement(
|
|
194
|
+
"div",
|
|
195
|
+
defineComponent({
|
|
196
|
+
name: "FileInputList",
|
|
197
|
+
inheritAttrs: false,
|
|
198
|
+
slots: Object,
|
|
199
|
+
setup(_, { slots }) {
|
|
200
|
+
const fileInput = useFileInput("FileInputList");
|
|
201
|
+
return usePart(fileInput, "list", void 0, void 0, {
|
|
202
|
+
tag: "div",
|
|
203
|
+
children: (state) => state.value.map(
|
|
204
|
+
(file) => h(FileScope, { file, key: fileKey(file) }, () => slots.default?.())
|
|
205
|
+
)
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
);
|
|
210
|
+
var FileInputItem = withElement(
|
|
211
|
+
"div",
|
|
212
|
+
defineComponent({
|
|
213
|
+
name: "FileInputItem",
|
|
214
|
+
inheritAttrs: false,
|
|
215
|
+
props: {
|
|
216
|
+
file: Object
|
|
217
|
+
},
|
|
218
|
+
slots: Object,
|
|
219
|
+
setup(props) {
|
|
220
|
+
const fileInput = useFileInput("FileInputItem");
|
|
221
|
+
const file = useItemFile("FileInputItem", () => props.file);
|
|
222
|
+
const item = () => ({ file: file(), value: fileKey(file()) });
|
|
223
|
+
provide(FileKey, file);
|
|
224
|
+
return usePart(fileInput, "item", item);
|
|
225
|
+
}
|
|
226
|
+
})
|
|
227
|
+
);
|
|
228
|
+
var FileInputItemRemove = withElement(
|
|
229
|
+
"button",
|
|
230
|
+
defineComponent({
|
|
231
|
+
name: "FileInputItemRemove",
|
|
232
|
+
inheritAttrs: false,
|
|
233
|
+
props: {
|
|
234
|
+
file: Object
|
|
235
|
+
},
|
|
236
|
+
slots: Object,
|
|
237
|
+
setup(props) {
|
|
238
|
+
const fileInput = useFileInput("FileInputItemRemove");
|
|
239
|
+
const file = useItemFile("FileInputItemRemove", () => props.file);
|
|
240
|
+
const item = () => ({ file: file(), value: fileKey(file()) });
|
|
241
|
+
return usePart(fileInput, "item-remove", item, void 0, "button");
|
|
242
|
+
}
|
|
243
|
+
})
|
|
244
|
+
);
|
|
245
|
+
export {
|
|
246
|
+
FileInput,
|
|
247
|
+
FileInputDropzone,
|
|
248
|
+
FileInputItem,
|
|
249
|
+
FileInputItemRemove,
|
|
250
|
+
FileInputList,
|
|
251
|
+
FileInputTrigger,
|
|
252
|
+
createFileInputController,
|
|
253
|
+
formatFileSize,
|
|
254
|
+
relativePath
|
|
255
|
+
};
|