@bexis2/bexis2-core-ui 0.2.17 → 0.2.18
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 +303 -293
- package/dist/components/file/FileUploader.svelte +34 -34
- package/dist/components/form/MultiSelect.svelte +61 -58
- package/dist/components/page/Notification.svelte +8 -0
- package/dist/components/page/Notification.svelte.d.ts +14 -0
- package/dist/components/page/Page.svelte +2 -0
- package/dist/components/page/TablePlaceholder.svelte +16 -0
- package/dist/components/page/TablePlaceholder.svelte.d.ts +17 -0
- package/dist/components/page/menu/Menu.svelte +0 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +10 -0
- package/dist/models/Enums.d.ts +6 -0
- package/dist/models/Enums.js +8 -0
- package/dist/models/Models.d.ts +10 -1
- package/dist/models/Models.js +1 -1
- package/dist/stores/pageStores.d.ts +13 -2
- package/dist/stores/pageStores.js +106 -0
- package/package.json +101 -101
- package/src/lib/components/file/FileUploader.svelte +189 -184
- package/src/lib/components/form/MultiSelect.svelte +61 -58
- package/src/lib/components/page/Notification.svelte +12 -0
- package/src/lib/components/page/Page.svelte +2 -0
- package/src/lib/components/page/TablePlaceholder.svelte +17 -0
- package/src/lib/components/page/menu/Menu.svelte +0 -1
- package/src/lib/index.ts +99 -78
- package/src/lib/models/Enums.ts +40 -32
- package/src/lib/models/Models.ts +19 -3
- package/src/lib/stores/pageStores.ts +240 -121
|
@@ -26,12 +26,13 @@
|
|
|
26
26
|
|
|
27
27
|
$: value = null;
|
|
28
28
|
$: updateTarget(value);
|
|
29
|
-
$:target, setValue(target);
|
|
29
|
+
$: target, setValue(target);
|
|
30
30
|
|
|
31
31
|
let groupBy;
|
|
32
32
|
$: groupBy;
|
|
33
33
|
|
|
34
34
|
function updateTarget(selection) {
|
|
35
|
+
console.log("UPDATE target",selection);
|
|
35
36
|
//different cases
|
|
36
37
|
//a) source is complex model is simple return array
|
|
37
38
|
if (complexSource && !complexTarget && isLoaded && isMulti) {
|
|
@@ -46,8 +47,9 @@
|
|
|
46
47
|
|
|
47
48
|
if (!complexSource && !complexTarget && isLoaded && isMulti) {
|
|
48
49
|
target = [];
|
|
50
|
+
|
|
49
51
|
for (let i in selection) {
|
|
50
|
-
target.push(selection[i]
|
|
52
|
+
target.push(selection[i]);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
|
|
@@ -74,72 +76,73 @@
|
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
onMount(async () => {
|
|
77
|
-
|
|
79
|
+
setValue(target);
|
|
78
80
|
});
|
|
79
81
|
|
|
80
|
-
function setValue(t)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
value = items;
|
|
94
|
-
}
|
|
95
|
-
////console.log(value);
|
|
96
|
-
groupBy = (item) => item[itemGroup];
|
|
82
|
+
function setValue(t) {
|
|
83
|
+
//a) source is complex model is simple
|
|
84
|
+
if (complexSource && !complexTarget && isMulti) {
|
|
85
|
+
let items = [];
|
|
86
|
+
// event.detail will be null unless isMulti is true and user has removed a single item
|
|
87
|
+
for (let i in t) {
|
|
88
|
+
let t = target[i];
|
|
89
|
+
items.push(source.find((item) => item[itemId] === t));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
isLoaded = true;
|
|
93
|
+
if (items.length > 0) {
|
|
94
|
+
value = items;
|
|
97
95
|
}
|
|
96
|
+
////console.log(value);
|
|
97
|
+
groupBy = (item) => item[itemGroup];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (complexSource && complexTarget && isMulti) {
|
|
101
|
+
value = t;
|
|
102
|
+
isLoaded = true;
|
|
103
|
+
groupBy = (item) => item[itemGroup];
|
|
104
|
+
}
|
|
98
105
|
|
|
99
|
-
|
|
106
|
+
//b) simple liust and simple model
|
|
107
|
+
if (!complexSource && !complexTarget && isMulti) {
|
|
108
|
+
console.log('b) simple liust and simple model');
|
|
109
|
+
console.log('source', source);
|
|
110
|
+
//console.log("target",t);
|
|
111
|
+
isLoaded = true;
|
|
112
|
+
//set target only if its nit empty
|
|
113
|
+
if (t != null && t !== undefined && t != '') {
|
|
114
|
+
console.log('target', t);
|
|
100
115
|
value = t;
|
|
101
|
-
|
|
102
|
-
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (!isMulti) {
|
|
120
|
+
//console.log("onmount",complexSource,complexTarget,value,target)
|
|
121
|
+
if (!complexSource && !complexTarget) {
|
|
122
|
+
value = {
|
|
123
|
+
value: t,
|
|
124
|
+
label: t
|
|
125
|
+
};
|
|
103
126
|
}
|
|
104
127
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
////console.log("target",target);
|
|
109
|
-
isLoaded = true;
|
|
110
|
-
//set target only if its nit empty
|
|
111
|
-
if (t != null && t !== undefined && t != '') {
|
|
112
|
-
value = t;
|
|
113
|
-
}
|
|
128
|
+
if (complexSource && complexTarget) {
|
|
129
|
+
value = t;
|
|
130
|
+
groupBy = (item) => item[itemGroup];
|
|
114
131
|
}
|
|
115
132
|
|
|
116
|
-
if (!
|
|
117
|
-
//
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (complexSource && complexTarget) {
|
|
126
|
-
value = t;
|
|
127
|
-
groupBy = (item) => item[itemGroup];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (complexSource && !complexTarget) {
|
|
131
|
-
//value = target
|
|
132
|
-
console.log(
|
|
133
|
-
'this case is currently not supported (complexSource,complexTarget,isMulti)',
|
|
134
|
-
complexSource,
|
|
135
|
-
complexTarget,
|
|
136
|
-
isMulti
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
isLoaded = true;
|
|
133
|
+
if (complexSource && !complexTarget) {
|
|
134
|
+
//value = target
|
|
135
|
+
console.log(
|
|
136
|
+
'this case is currently not supported (complexSource,complexTarget,isMulti)',
|
|
137
|
+
complexSource,
|
|
138
|
+
complexTarget,
|
|
139
|
+
isMulti
|
|
140
|
+
);
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
|
|
143
|
+
isLoaded = true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
143
146
|
</script>
|
|
144
147
|
|
|
145
148
|
<InputContainer {id} label={title} {feedback} {required} {help}>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Toast } from '@skeletonlabs/skeleton';
|
|
3
|
+
import { notificationStore } from '$store/pageStores';
|
|
4
|
+
|
|
5
|
+
let btnStyle: string;
|
|
6
|
+
$: btnStyle =
|
|
7
|
+
$notificationStore === undefined || $notificationStore.btnStyle === undefined
|
|
8
|
+
? notificationStore.getBtnStyle()
|
|
9
|
+
: $notificationStore.btnStyle;
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Toast position="t" buttonDismiss={btnStyle} />
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import Header from './Header.svelte';
|
|
12
12
|
import HelpPopUp from './HelpPopUp.svelte';
|
|
13
13
|
import Breadcrumb from './breadcrumb/Breadcrumb.svelte';
|
|
14
|
+
import Notification from './Notification.svelte';
|
|
14
15
|
|
|
15
16
|
//popup
|
|
16
17
|
import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
|
|
@@ -93,4 +94,5 @@
|
|
|
93
94
|
</div>
|
|
94
95
|
|
|
95
96
|
<HelpPopUp active={help} />
|
|
97
|
+
<Notification />
|
|
96
98
|
</AppShell>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let cols: number = 1;
|
|
3
|
+
export let rows: number = 10;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div class="placeholder animate-pulse w-full h-10 sp" />
|
|
7
|
+
<div class="table-container w-full">
|
|
8
|
+
<table class="table table-compact w-full">
|
|
9
|
+
{#each Array(rows) as _}
|
|
10
|
+
<tr class="w-full">
|
|
11
|
+
{#each Array(cols) as _}
|
|
12
|
+
<td class="p-3"><div class="placeholder animate-pulse h-9 w-full" /></td>
|
|
13
|
+
{/each}
|
|
14
|
+
</tr>
|
|
15
|
+
{/each}
|
|
16
|
+
</table>
|
|
17
|
+
</div>
|
package/src/lib/index.ts
CHANGED
|
@@ -1,78 +1,99 @@
|
|
|
1
|
-
// Reexport your entry components here
|
|
2
|
-
// import ListView from './components/ListView.svelte';
|
|
3
|
-
// import TableView from './TableView.svelte';
|
|
4
|
-
|
|
5
|
-
import FileIcon from './components/file/FileIcon.svelte';
|
|
6
|
-
import FileInfo from './components/file/FileInfo.svelte';
|
|
7
|
-
import FileUploader from './components/file/FileUploader.svelte';
|
|
8
|
-
|
|
9
|
-
//page
|
|
10
|
-
import Spinner from './components/page/Spinner.svelte';
|
|
11
|
-
import Page from './components/page/Page.svelte';
|
|
12
|
-
import Alert from './components/page/Alert.svelte';
|
|
13
|
-
import Menu from './components/page/menu/Menu.svelte';
|
|
14
|
-
import ErrorMessage from './components/page/ErrorMessage.svelte';
|
|
15
|
-
|
|
16
|
-
// input
|
|
17
|
-
import Checkbox from './components/form/Checkbox.svelte';
|
|
18
|
-
import CheckboxKVPList from './components/form/CheckboxKvPList.svelte';
|
|
19
|
-
import CheckboxList from './components/form/CheckboxList.svelte';
|
|
20
|
-
import DateInput from './components/form/DateInput.svelte';
|
|
21
|
-
import DropdownKVP from './components/form/DropdownKvP.svelte';
|
|
22
|
-
import MultiSelect from './components/form/MultiSelect.svelte';
|
|
23
|
-
import NumberInput from './components/form/NumberInput.svelte';
|
|
24
|
-
import TextInput from './components/form/TextInput.svelte';
|
|
25
|
-
import TextArea from './components/form/TextArea.svelte';
|
|
26
|
-
|
|
27
|
-
//table
|
|
28
|
-
import Table from './components/Table/Table.svelte';
|
|
29
|
-
import TableFilter from './components/Table/TableFilter.svelte';
|
|
30
|
-
import { columnFilter, searchFilter } from './components/Table/filter';
|
|
31
|
-
import type { TableConfig, Columns, Column } from './models/Models';
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
export {
|
|
78
|
-
|
|
1
|
+
// Reexport your entry components here
|
|
2
|
+
// import ListView from './components/ListView.svelte';
|
|
3
|
+
// import TableView from './TableView.svelte';
|
|
4
|
+
|
|
5
|
+
import FileIcon from './components/file/FileIcon.svelte';
|
|
6
|
+
import FileInfo from './components/file/FileInfo.svelte';
|
|
7
|
+
import FileUploader from './components/file/FileUploader.svelte';
|
|
8
|
+
|
|
9
|
+
//page
|
|
10
|
+
import Spinner from './components/page/Spinner.svelte';
|
|
11
|
+
import Page from './components/page/Page.svelte';
|
|
12
|
+
import Alert from './components/page/Alert.svelte';
|
|
13
|
+
import Menu from './components/page/menu/Menu.svelte';
|
|
14
|
+
import ErrorMessage from './components/page/ErrorMessage.svelte';
|
|
15
|
+
|
|
16
|
+
// input
|
|
17
|
+
import Checkbox from './components/form/Checkbox.svelte';
|
|
18
|
+
import CheckboxKVPList from './components/form/CheckboxKvPList.svelte';
|
|
19
|
+
import CheckboxList from './components/form/CheckboxList.svelte';
|
|
20
|
+
import DateInput from './components/form/DateInput.svelte';
|
|
21
|
+
import DropdownKVP from './components/form/DropdownKvP.svelte';
|
|
22
|
+
import MultiSelect from './components/form/MultiSelect.svelte';
|
|
23
|
+
import NumberInput from './components/form/NumberInput.svelte';
|
|
24
|
+
import TextInput from './components/form/TextInput.svelte';
|
|
25
|
+
import TextArea from './components/form/TextArea.svelte';
|
|
26
|
+
|
|
27
|
+
//table
|
|
28
|
+
import Table from './components/Table/Table.svelte';
|
|
29
|
+
import TableFilter from './components/Table/TableFilter.svelte';
|
|
30
|
+
import { columnFilter, searchFilter } from './components/Table/filter';
|
|
31
|
+
import type { TableConfig, Columns, Column } from './models/Models';
|
|
32
|
+
|
|
33
|
+
//notification
|
|
34
|
+
import Notification from './components/page/Notification.svelte';
|
|
35
|
+
|
|
36
|
+
//table placeholder
|
|
37
|
+
import TablePlaceholder from './components/page/TablePlaceholder.svelte';
|
|
38
|
+
|
|
39
|
+
//Form
|
|
40
|
+
export {
|
|
41
|
+
Checkbox,
|
|
42
|
+
CheckboxKVPList,
|
|
43
|
+
CheckboxList,
|
|
44
|
+
DateInput,
|
|
45
|
+
DropdownKVP,
|
|
46
|
+
MultiSelect,
|
|
47
|
+
NumberInput,
|
|
48
|
+
TextArea,
|
|
49
|
+
TextInput
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//File
|
|
53
|
+
export { FileInfo, FileIcon, FileUploader };
|
|
54
|
+
|
|
55
|
+
//others
|
|
56
|
+
export { Spinner, Page, Alert, Menu, ErrorMessage };
|
|
57
|
+
|
|
58
|
+
//Api
|
|
59
|
+
export { Api } from './services/Api.js';
|
|
60
|
+
export { host, username, password, setApiConfig } from './stores/apiStores.js';
|
|
61
|
+
|
|
62
|
+
//Type
|
|
63
|
+
export type {
|
|
64
|
+
userType,
|
|
65
|
+
inputType,
|
|
66
|
+
fileUploaderType,
|
|
67
|
+
linkType,
|
|
68
|
+
listItemType,
|
|
69
|
+
keyValuePairType,
|
|
70
|
+
fileInfoType,
|
|
71
|
+
fileReaderInfoType,
|
|
72
|
+
asciiFileReaderInfoType
|
|
73
|
+
} from './models/Models.js';
|
|
74
|
+
|
|
75
|
+
//help
|
|
76
|
+
export { helpStore } from '$store/pageStores';
|
|
77
|
+
export type { helpStoreType, helpItemType } from './models/Models';
|
|
78
|
+
|
|
79
|
+
//notification
|
|
80
|
+
export { notificationStore } from '$store/pageStores';
|
|
81
|
+
export type { notificationItemType, notificationStoreType } from './models/Models';
|
|
82
|
+
export { notificationType } from './models/Enums';
|
|
83
|
+
export { Notification };
|
|
84
|
+
|
|
85
|
+
//table placholder
|
|
86
|
+
export { TablePlaceholder };
|
|
87
|
+
//enum
|
|
88
|
+
export {
|
|
89
|
+
positionType,
|
|
90
|
+
pageContentLayoutType,
|
|
91
|
+
decimalCharacterType,
|
|
92
|
+
orientationType,
|
|
93
|
+
textMarkerType,
|
|
94
|
+
textSeperatorType
|
|
95
|
+
} from './models/Enums';
|
|
96
|
+
|
|
97
|
+
// Table
|
|
98
|
+
export { Table, TableFilter, columnFilter, searchFilter };
|
|
99
|
+
export type { TableConfig, Columns, Column };
|
package/src/lib/models/Enums.ts
CHANGED
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
export enum positionType {
|
|
2
|
-
start = 'start',
|
|
3
|
-
end = 'end',
|
|
4
|
-
center = 'center'
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export enum pageContentLayoutType {
|
|
8
|
-
full = 'full',
|
|
9
|
-
center = 'center'
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export enum decimalCharacterType {
|
|
13
|
-
point,
|
|
14
|
-
comma
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export enum orientationType {
|
|
18
|
-
columnwise,
|
|
19
|
-
rowwise
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export enum textSeperatorType {
|
|
23
|
-
tab = 9,
|
|
24
|
-
comma = 44,
|
|
25
|
-
semicolon = 59,
|
|
26
|
-
space = 32
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export enum textMarkerType {
|
|
30
|
-
quotes,
|
|
31
|
-
doubleQuotes
|
|
32
|
-
}
|
|
1
|
+
export enum positionType {
|
|
2
|
+
start = 'start',
|
|
3
|
+
end = 'end',
|
|
4
|
+
center = 'center'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export enum pageContentLayoutType {
|
|
8
|
+
full = 'full',
|
|
9
|
+
center = 'center'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum decimalCharacterType {
|
|
13
|
+
point,
|
|
14
|
+
comma
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum orientationType {
|
|
18
|
+
columnwise,
|
|
19
|
+
rowwise
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export enum textSeperatorType {
|
|
23
|
+
tab = 9,
|
|
24
|
+
comma = 44,
|
|
25
|
+
semicolon = 59,
|
|
26
|
+
space = 32
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum textMarkerType {
|
|
30
|
+
quotes,
|
|
31
|
+
doubleQuotes
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//types for the notification styling
|
|
35
|
+
export enum notificationType {
|
|
36
|
+
success,
|
|
37
|
+
warning,
|
|
38
|
+
error,
|
|
39
|
+
surface
|
|
40
|
+
}
|
package/src/lib/models/Models.ts
CHANGED
|
@@ -2,7 +2,13 @@ import type { SvelteComponent } from 'svelte';
|
|
|
2
2
|
import type { ColumnFilterFn } from 'svelte-headless-table/lib/plugins';
|
|
3
3
|
import type { Writable } from 'svelte/store';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import type {
|
|
6
|
+
decimalCharacterType,
|
|
7
|
+
notificationType,
|
|
8
|
+
orientationType,
|
|
9
|
+
textMarkerType,
|
|
10
|
+
textSeperatorType
|
|
11
|
+
} from './Enums';
|
|
6
12
|
|
|
7
13
|
// page
|
|
8
14
|
export interface linkType {
|
|
@@ -43,7 +49,6 @@ export interface asciiFileReaderInfoType extends fileReaderInfoType {
|
|
|
43
49
|
textMarker: textMarkerType;
|
|
44
50
|
}
|
|
45
51
|
|
|
46
|
-
|
|
47
52
|
export interface fileReaderInfoType {
|
|
48
53
|
decimal: decimalCharacterType;
|
|
49
54
|
orientation: orientationType;
|
|
@@ -55,7 +60,6 @@ export interface fileReaderInfoType {
|
|
|
55
60
|
dateformat: string;
|
|
56
61
|
}
|
|
57
62
|
|
|
58
|
-
|
|
59
63
|
export interface filesType {
|
|
60
64
|
accepted: Blob[];
|
|
61
65
|
rejected: Blob[];
|
|
@@ -132,3 +136,15 @@ export interface helpStoreType {
|
|
|
132
136
|
itemId?: string;
|
|
133
137
|
helpItems: helpItemType[];
|
|
134
138
|
}
|
|
139
|
+
|
|
140
|
+
// notifications (toasts)
|
|
141
|
+
export interface notificationItemType {
|
|
142
|
+
notificationType?: notificationType;
|
|
143
|
+
message: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface notificationStoreType {
|
|
147
|
+
notificationType: notificationType;
|
|
148
|
+
message: string;
|
|
149
|
+
btnStyle: string;
|
|
150
|
+
}
|