@open-xamu-co/ui-common-types 4.0.0-next.9 → 4.1.0
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 +9 -4
- package/src/form/class.ts +3 -4
- package/src/form/index.ts +2 -2
- package/src/form/types.ts +4 -0
- package/src/locale.ts +11 -1
- package/src/plugin.ts +1 -13
- package/src/props.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xamu-co/ui-common-types",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
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.
|
|
34
|
+
"@open-xamu-co/ui-common-enums": "^4.1.0",
|
|
35
35
|
"@fortawesome/fontawesome-common-types": "^6.4.0",
|
|
36
36
|
"sweetalert2": "^11.11.1"
|
|
37
37
|
},
|
package/src/files.ts
CHANGED
|
@@ -7,18 +7,23 @@ export interface iMime {
|
|
|
7
7
|
*/
|
|
8
8
|
mime: string;
|
|
9
9
|
/**
|
|
10
|
-
* Pattern to match
|
|
10
|
+
* Pattern to match (optional for text files without fixed magic bytes)
|
|
11
11
|
* @example [0xff, 0xd8, 0xff]
|
|
12
12
|
*/
|
|
13
|
-
pattern
|
|
13
|
+
pattern?: number[];
|
|
14
14
|
/**
|
|
15
|
-
* Mask to match
|
|
15
|
+
* Mask to match (optional for text files without fixed magic bytes)
|
|
16
16
|
* @example [0xff, 0xff, 0xff]
|
|
17
17
|
*/
|
|
18
|
-
mask
|
|
18
|
+
mask?: number[];
|
|
19
19
|
/**
|
|
20
20
|
* Mime type range
|
|
21
21
|
* @example eMimeType.IMAGE
|
|
22
22
|
*/
|
|
23
23
|
type: eMimeType;
|
|
24
|
+
/**
|
|
25
|
+
* Associated file extensions without leading dot (used to disambiguate shared container formats)
|
|
26
|
+
* @example ['docx'], ['zip']
|
|
27
|
+
*/
|
|
28
|
+
extensions?: string[];
|
|
24
29
|
}
|
package/src/form/class.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
tFormAutocomplete,
|
|
13
13
|
tFormIcon,
|
|
14
14
|
tOptionsLoaderFn,
|
|
15
|
-
} from "./types";
|
|
15
|
+
} from "./types.js";
|
|
16
16
|
|
|
17
17
|
export declare abstract class tFormInputDefault<
|
|
18
18
|
T extends eFormTypeBase | eFormTypeSimple | eFormTypeComplex = eFormTypeSimple,
|
|
@@ -35,9 +35,7 @@ export declare abstract class tFormInputDefault<
|
|
|
35
35
|
export declare abstract class tFormInput<
|
|
36
36
|
V extends iFormValue | iFormValue[] = iFormValue | iFormValue[],
|
|
37
37
|
T extends eFormTypeBase | eFormTypeSimple | eFormTypeComplex =
|
|
38
|
-
|
|
|
39
|
-
| eFormTypeSimple
|
|
40
|
-
| eFormTypeComplex,
|
|
38
|
+
eFormTypeBase | eFormTypeSimple | eFormTypeComplex,
|
|
41
39
|
>
|
|
42
40
|
extends tFormInputDefault<T>
|
|
43
41
|
implements iFormInput<V, T>
|
|
@@ -48,6 +46,7 @@ export declare abstract class tFormInput<
|
|
|
48
46
|
public readonly optionsFilter?: tOptionsLoaderFn;
|
|
49
47
|
// public
|
|
50
48
|
public multiple: boolean;
|
|
49
|
+
public unique: boolean;
|
|
51
50
|
public min: number;
|
|
52
51
|
public max: number;
|
|
53
52
|
public meta?: Record<string, any>;
|
package/src/form/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./class";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./class.js";
|
|
2
|
+
export * from "./types.js";
|
package/src/form/types.ts
CHANGED
|
@@ -168,6 +168,10 @@ export interface iFormInput<
|
|
|
168
168
|
* Ex: { multiple: true, min:3, max:3 } would make 3 values a requirement
|
|
169
169
|
*/
|
|
170
170
|
multiple?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* If multiple options are accepted, whether to accept or not duplicate values.
|
|
173
|
+
*/
|
|
174
|
+
unique?: boolean;
|
|
171
175
|
/**
|
|
172
176
|
* if muliple is set to true this optional value would be the required minimun amount of values
|
|
173
177
|
*/
|
package/src/locale.ts
CHANGED
|
@@ -84,12 +84,20 @@ export type tLocaleInput = {
|
|
|
84
84
|
select_placeholder: string;
|
|
85
85
|
/** @example "Restablish field" */
|
|
86
86
|
select_restablish_field: string;
|
|
87
|
-
/** @example "Type
|
|
87
|
+
/** @example "Type for options" */
|
|
88
88
|
select_filter_options: string;
|
|
89
|
+
/** @example "Searching..." */
|
|
90
|
+
select_filter_searching: string;
|
|
91
|
+
/** @example "Type something first | No coincidences" */
|
|
92
|
+
select_filter_no_content: string;
|
|
93
|
+
/** @example "Select {value}" */
|
|
94
|
+
select_filter_select_value: string;
|
|
89
95
|
/** @example "{count} of {amount}" */
|
|
90
96
|
file_one_of_amount: string;
|
|
91
97
|
/** @example "Delete file | Delete files" */
|
|
92
98
|
file_delete_files: string;
|
|
99
|
+
/** @example "Delete file (> {maxSize}MB)" */
|
|
100
|
+
file_delete_heavy_file: string;
|
|
93
101
|
/** @example "Thumbnail" */
|
|
94
102
|
file_thumb: string;
|
|
95
103
|
/** @example "Choose a file | Choose files" */
|
|
@@ -319,6 +327,8 @@ export type tLocaleTable = {
|
|
|
319
327
|
* @localeType
|
|
320
328
|
*/
|
|
321
329
|
export type tLocalePagination = {
|
|
330
|
+
/** @example "Pagination" */
|
|
331
|
+
pagination: string;
|
|
322
332
|
/** @example "No items | Single item | {count} items" */
|
|
323
333
|
pagination_items: string;
|
|
324
334
|
/** @example "No pages | Single page | {count} pages" */
|
package/src/plugin.ts
CHANGED
|
@@ -7,19 +7,7 @@ export type tComponent = (typeof componentNames)[number];
|
|
|
7
7
|
export type tLogger = (at: string, ...logs: unknown[]) => any;
|
|
8
8
|
|
|
9
9
|
export type tSupportedLangs =
|
|
10
|
-
| "
|
|
11
|
-
| "pt"
|
|
12
|
-
| "nl"
|
|
13
|
-
| "hr"
|
|
14
|
-
| "fa"
|
|
15
|
-
| "de"
|
|
16
|
-
| "es"
|
|
17
|
-
| "en"
|
|
18
|
-
| "fr"
|
|
19
|
-
| "ja"
|
|
20
|
-
| "it"
|
|
21
|
-
| "cn"
|
|
22
|
-
| "tr";
|
|
10
|
+
"kr" | "pt" | "nl" | "hr" | "fa" | "de" | "es" | "en" | "fr" | "ja" | "it" | "cn" | "tr";
|
|
23
11
|
|
|
24
12
|
export interface iPluginOptions<ComponentType = unknown> {
|
|
25
13
|
/**
|
package/src/props.ts
CHANGED
|
@@ -2,4 +2,8 @@ export type tProp<T extends string = string> = T | Record<T, boolean>;
|
|
|
2
2
|
export type tProps<T extends string = string> = tProp<T> | tProp<T>[];
|
|
3
3
|
export type tPropsModifier<T extends string = string> = boolean | tProps<T>;
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Country indicative code type
|
|
7
|
+
* @example CO+57, US+1
|
|
8
|
+
*/
|
|
5
9
|
export type tIndicative = `${string}+${number}`;
|