@open-xamu-co/ui-common-types 4.0.0-next.3 → 4.0.0-next.5
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/package.json +2 -2
- package/src/files.ts +16 -0
- package/src/form/class.ts +2 -1
- package/src/form/types.ts +4 -0
- package/src/locale.ts +12 -0
- package/src/values.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xamu-co/ui-common-types",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.5",
|
|
4
4
|
"description": "Xamu shared types",
|
|
5
5
|
"author": "@xamu-co",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build:legacy": "rimraf dist && tsc --outDir dist --declaration --emitDeclarationOnly"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@open-xamu-co/ui-common-enums": "^4.0.0-next.
|
|
34
|
+
"@open-xamu-co/ui-common-enums": "^4.0.0-next.2",
|
|
35
35
|
"@fortawesome/fontawesome-common-types": "^6.4.0",
|
|
36
36
|
"sweetalert2": "^11.11.1"
|
|
37
37
|
},
|
package/src/files.ts
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import type { eMimeType } from "@open-xamu-co/ui-common-enums";
|
|
2
2
|
|
|
3
3
|
export interface iMime {
|
|
4
|
+
/**
|
|
5
|
+
* Mime type
|
|
6
|
+
* @example image/jpeg
|
|
7
|
+
*/
|
|
4
8
|
mime: string;
|
|
9
|
+
/**
|
|
10
|
+
* Pattern to match
|
|
11
|
+
* @example [0xff, 0xd8, 0xff]
|
|
12
|
+
*/
|
|
5
13
|
pattern: number[];
|
|
14
|
+
/**
|
|
15
|
+
* Mask to match
|
|
16
|
+
* @example [0xff, 0xff, 0xff]
|
|
17
|
+
*/
|
|
6
18
|
mask: number[];
|
|
19
|
+
/**
|
|
20
|
+
* Mime type range
|
|
21
|
+
* @example eMimeType.IMAGE
|
|
22
|
+
*/
|
|
7
23
|
type: eMimeType;
|
|
8
24
|
}
|
package/src/form/class.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare abstract class tFormInputDefault<
|
|
|
31
31
|
public setRerender(rerender: (fi?: Partial<iFormInputDefault<T>>) => void): this;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export declare class tFormInput<
|
|
34
|
+
export declare abstract class tFormInput<
|
|
35
35
|
V extends iFormValue | iFormValue[] = iFormValue | iFormValue[],
|
|
36
36
|
T extends eFormTypeBase | eFormTypeSimple | eFormTypeComplex =
|
|
37
37
|
| eFormTypeBase
|
|
@@ -47,6 +47,7 @@ export declare class tFormInput<
|
|
|
47
47
|
public readonly multiple: boolean;
|
|
48
48
|
public readonly min: number;
|
|
49
49
|
public readonly max: number;
|
|
50
|
+
public readonly meta?: Record<string, any>;
|
|
50
51
|
// public
|
|
51
52
|
public options: iSelectOption[];
|
|
52
53
|
public values: V[];
|
package/src/form/types.ts
CHANGED
|
@@ -152,6 +152,10 @@ export interface iFormInput<
|
|
|
152
152
|
* if multiple is set to true this optional value would be the mandatory maximun amount of values
|
|
153
153
|
*/
|
|
154
154
|
max?: number;
|
|
155
|
+
/**
|
|
156
|
+
* Additional input metadata
|
|
157
|
+
*/
|
|
158
|
+
meta?: Record<string, any>;
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
/**
|
package/src/locale.ts
CHANGED
|
@@ -202,6 +202,18 @@ export type tLocaleForm = {
|
|
|
202
202
|
form_no_values: string;
|
|
203
203
|
/** @example "New value" */
|
|
204
204
|
form_new_value: string;
|
|
205
|
+
/** @example "Rendered text" */
|
|
206
|
+
form_editor_preview: string;
|
|
207
|
+
/** @example "See rendered text" */
|
|
208
|
+
form_editor_see_preview: string;
|
|
209
|
+
/** @example "Bold" */
|
|
210
|
+
form_editor_bold: string;
|
|
211
|
+
/** @example "Italic" */
|
|
212
|
+
form_editor_italic: string;
|
|
213
|
+
/** @example "Link" */
|
|
214
|
+
form_editor_link: string;
|
|
215
|
+
/** @example "Add URL" */
|
|
216
|
+
form_editor_link_add_url: string;
|
|
205
217
|
// swal: {};
|
|
206
218
|
};
|
|
207
219
|
|
package/src/values.ts
CHANGED
|
@@ -70,6 +70,11 @@ export interface iProperty<
|
|
|
70
70
|
P extends Record<string, any> = Record<string, any>,
|
|
71
71
|
ComponentType = unknown,
|
|
72
72
|
> extends iSelectOption {
|
|
73
|
+
/**
|
|
74
|
+
* Prefer to use the node's id instead of the value
|
|
75
|
+
* Useful for object like properties
|
|
76
|
+
*/
|
|
77
|
+
preferId?: boolean;
|
|
73
78
|
/**
|
|
74
79
|
* Function to create a node within the relation
|
|
75
80
|
* The parent is given since the node doesn't exist yet
|