@bexis2/bexis2-core-ui 0.0.30 → 0.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/README.md +41 -0
- package/dist/components/Table/Table.svelte +132 -94
- package/dist/components/Table/Table.svelte.d.ts +2 -0
- package/dist/components/Table/TableFilter.svelte +50 -5
- package/dist/components/Table/TablePagination.svelte +1 -1
- package/dist/components/Table/filter.js +43 -3
- package/dist/components/form/DropdownKvP.svelte +17 -2
- package/dist/components/form/DropdownKvP.svelte.d.ts +2 -0
- package/dist/components/form/NumberInput.svelte +2 -0
- package/dist/components/form/NumberInput.svelte.d.ts +1 -0
- package/dist/components/form/TextArea.svelte +2 -0
- package/dist/components/form/TextArea.svelte.d.ts +1 -0
- package/dist/components/form/TextInput.svelte +2 -0
- package/dist/components/form/TextInput.svelte.d.ts +1 -0
- package/dist/components/page/Alert.svelte +39 -0
- package/dist/components/page/Alert.svelte.d.ts +22 -0
- package/dist/components/spinner/Spinner.svelte +11 -1
- package/dist/components/spinner/Spinner.svelte.d.ts +9 -13
- package/dist/css/themes/theme-bexis2.css +3 -3
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -1
- package/dist/models/Enums.d.ts +5 -0
- package/dist/models/Enums.js +6 -0
- package/dist/models/Models.d.ts +18 -0
- package/package.json +1 -1
- package/src/lib/components/Table/Table.svelte +230 -184
- package/src/lib/components/Table/TableFilter.svelte +50 -5
- package/src/lib/components/Table/TablePagination.svelte +1 -1
- package/src/lib/components/Table/filter.ts +141 -94
- package/src/lib/components/form/DropdownKvP.svelte +17 -2
- package/src/lib/components/form/NumberInput.svelte +2 -0
- package/src/lib/components/form/TextArea.svelte +2 -0
- package/src/lib/components/form/TextInput.svelte +3 -0
- package/src/lib/components/page/Alert.svelte +46 -0
- package/src/lib/components/spinner/Spinner.svelte +14 -1
- package/src/lib/css/themes/theme-bexis2.css +3 -3
- package/src/lib/index.ts +9 -3
- package/src/lib/models/Enums.ts +6 -0
- package/src/lib/models/Models.ts +102 -78
package/src/lib/models/Models.ts
CHANGED
|
@@ -1,78 +1,102 @@
|
|
|
1
|
-
import type { SvelteComponent } from 'svelte';
|
|
2
|
-
import type { ColumnFilterFn } from 'svelte-headless-table/lib/plugins';
|
|
3
|
-
import type { Writable } from 'svelte/store';
|
|
4
|
-
|
|
5
|
-
// page
|
|
6
|
-
export interface Link
|
|
7
|
-
{
|
|
8
|
-
label:string,
|
|
9
|
-
url:string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
import type { SvelteComponent } from 'svelte';
|
|
2
|
+
import type { ColumnFilterFn } from 'svelte-headless-table/lib/plugins';
|
|
3
|
+
import type { Writable } from 'svelte/store';
|
|
4
|
+
|
|
5
|
+
// page
|
|
6
|
+
export interface Link
|
|
7
|
+
{
|
|
8
|
+
label:string,
|
|
9
|
+
url:string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// Form
|
|
14
|
+
export interface Input {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
feedback: string[];
|
|
18
|
+
invalid: boolean;
|
|
19
|
+
valid: boolean;
|
|
20
|
+
required: boolean;
|
|
21
|
+
placeholder:string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface FileInfo {
|
|
25
|
+
name: string;
|
|
26
|
+
type: string;
|
|
27
|
+
length: number;
|
|
28
|
+
description: string;
|
|
29
|
+
validationHash: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface FileUploaderModel {
|
|
33
|
+
accept: string[];
|
|
34
|
+
existingFiles: FileInfo[];
|
|
35
|
+
descriptionType: number;
|
|
36
|
+
multiple: boolean;
|
|
37
|
+
maxSize: number;
|
|
38
|
+
lastModification: Date;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface Files {
|
|
42
|
+
accepted: Blob[];
|
|
43
|
+
rejected: Blob[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type user = {
|
|
47
|
+
name: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export interface FileObj {
|
|
51
|
+
path: string;
|
|
52
|
+
lastModified: number;
|
|
53
|
+
lastModifiedDate: Date;
|
|
54
|
+
name: string;
|
|
55
|
+
size: number;
|
|
56
|
+
type: string;
|
|
57
|
+
webkitRelativePath: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ColumnInstructions {
|
|
61
|
+
toStringFn?: (value: any) => string;
|
|
62
|
+
toSortableValueFn?: (value: any) => string | number;
|
|
63
|
+
toFilterableValueFn?: (value: any) => string | number | Date;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Table column type
|
|
67
|
+
export interface Column {
|
|
68
|
+
header?: string;
|
|
69
|
+
exclude?: boolean; // false by default
|
|
70
|
+
instructions?: ColumnInstructions;
|
|
71
|
+
disableFiltering?: boolean; // false by default
|
|
72
|
+
disableSorting?: boolean; // false by default
|
|
73
|
+
colFilterFn?: ColumnFilterFn;
|
|
74
|
+
colFilterComponent?: typeof SvelteComponent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface Columns {
|
|
78
|
+
[key: string]: Column;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Table config type
|
|
82
|
+
export interface TableConfig<T> {
|
|
83
|
+
id: string;
|
|
84
|
+
data: Writable<T[]>;
|
|
85
|
+
columns?: Columns;
|
|
86
|
+
pageSizes?: number[];
|
|
87
|
+
defaultPageSize?: number;
|
|
88
|
+
optionsComponent?: typeof SvelteComponent;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
// lists
|
|
93
|
+
export interface KvP {
|
|
94
|
+
id: number;
|
|
95
|
+
text: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface ListItem {
|
|
99
|
+
id: number;
|
|
100
|
+
text: string;
|
|
101
|
+
group: string;
|
|
102
|
+
}
|