@htmlbricks/hb-input-file 0.66.8 → 0.66.9
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/README.md +57 -0
- package/manifest.json +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# hb-input-file
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
File picker with `accept` from `schemaentry.params.accept` (defaults to any file), optional image preview or Bootstrap Icons by MIME type, and an optional clickable `placeHolderImage` that opens the hidden input. Clears selection with the remove control; validates required fields against an actual chosen file. Dispatches `setVal` with `{ value, valid, id }`.
|
|
6
|
+
|
|
7
|
+
## Types
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
export type FormSchemaEntry = {
|
|
11
|
+
/**
|
|
12
|
+
* This will be both the key of the object when submitting the form's data,
|
|
13
|
+
* and also the id in the DOM.
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The descriptive label that will show alongside the form control.
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Optional default value.
|
|
24
|
+
*/
|
|
25
|
+
value?: string | number | boolean;
|
|
26
|
+
|
|
27
|
+
readonly?: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This doesn't matter if the dependencies requirements aren't met.
|
|
31
|
+
*/
|
|
32
|
+
required?: boolean;
|
|
33
|
+
|
|
34
|
+
validationRegex?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Shows if value is not valid.
|
|
37
|
+
*/
|
|
38
|
+
validationTip?: string;
|
|
39
|
+
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Other parameters that may be specific to a certain kind of form control.
|
|
44
|
+
*/
|
|
45
|
+
params?: Record<string, any>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type Component = {
|
|
49
|
+
id?: string;
|
|
50
|
+
style?: string;
|
|
51
|
+
|
|
52
|
+
show_validation?: "yes" | "no";
|
|
53
|
+
schemaentry: FormSchemaEntry;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type Events = { setVal: { value: string; valid: boolean; id: string } };
|
|
57
|
+
```
|
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@htmlbricks/hb-input-file",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.9",
|
|
4
4
|
"contributors": [],
|
|
5
5
|
"description": "File picker with `accept` from `schemaentry.params.accept` (defaults to any file), optional image preview or Bootstrap Icons by MIME type, and an optional clickable `placeHolderImage` that opens the hidden input. Clears selection with the remove control; validates required fields against an actual chosen file. Dispatches `setVal` with `{ value, valid, id }`.",
|
|
6
6
|
"licenses": [
|