@bexis2/bexis2-core-ui 0.4.7 → 0.4.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 +8 -1
- package/dist/components/CodeEditor/CodeEditor.svelte +1 -2
- package/dist/components/CodeEditor/CodeEditor.svelte.d.ts +8 -8
- package/dist/components/File/FileUploader.svelte +3 -6
- package/dist/components/File/FileUploader.svelte.d.ts +5 -5
- package/dist/components/Table/Table.svelte +1 -3
- package/dist/components/Table/Table.svelte.d.ts +12 -1
- package/dist/components/Table/TableContent.svelte +3 -6
- package/dist/components/Table/TableFilter.svelte +5 -8
- package/dist/components/Table/TableFilterServer.svelte +6 -10
- package/dist/components/Table/TablePagination.svelte +4 -8
- package/dist/components/Table/TablePaginationServer.svelte +6 -12
- package/dist/components/Table/shared.d.ts +2 -19
- package/dist/components/form/Checkbox.svelte.d.ts +3 -3
- package/dist/components/form/CheckboxKvPList.svelte.d.ts +2 -2
- package/dist/components/form/CheckboxList.svelte.d.ts +1 -1
- package/dist/components/form/DateInput.svelte.d.ts +9 -9
- package/dist/components/form/InputContainer.svelte.d.ts +3 -3
- package/dist/components/form/NumberInput.svelte.d.ts +10 -10
- package/dist/components/form/TextArea.svelte.d.ts +10 -10
- package/dist/components/form/TextInput.svelte.d.ts +10 -10
- package/dist/components/page/Alert.svelte +1 -2
- package/dist/components/page/Alert.svelte.d.ts +4 -4
- package/dist/components/page/Docs.svelte.d.ts +1 -1
- package/dist/components/page/Footer.svelte +1 -2
- package/dist/components/page/Header.svelte +1 -2
- package/dist/components/page/HelpPopUp.svelte +4 -6
- package/dist/components/page/HelpPopUp.svelte.d.ts +1 -1
- package/dist/components/page/Notification.svelte +2 -4
- package/dist/components/page/Page.svelte +10 -2
- package/dist/components/page/Page.svelte.d.ts +8 -8
- package/dist/components/page/Spinner.svelte.d.ts +3 -3
- package/dist/components/page/TablePlaceholder.svelte.d.ts +2 -2
- package/dist/components/page/breadcrumb/Breadcrumb.svelte +5 -8
- package/dist/components/toggle/Toggle.svelte +7 -14
- package/dist/components/toggle/Toggle.svelte.d.ts +9 -8
- package/dist/models/Models.d.ts +7 -0
- package/dist/models/Models.js +13 -0
- package/dist/services/Api.js +12 -2
- package/dist/stores/apiStores.d.ts +2 -0
- package/dist/stores/apiStores.js +2 -0
- package/dist/stores/pageStores.d.ts +0 -1
- package/dist/stores/pageStores.js +1 -1
- package/package.json +37 -37
- package/src/lib/components/page/Page.svelte +12 -3
- package/src/lib/models/Models.ts +16 -0
- package/src/lib/services/Api.ts +18 -2
- package/src/lib/stores/apiStores.ts +3 -0
- package/src/lib/stores/pageStores.ts +1 -1
package/README.md
CHANGED
|
@@ -53,8 +53,7 @@ const isValidJS = (str) => {
|
|
|
53
53
|
}
|
|
54
54
|
return true;
|
|
55
55
|
};
|
|
56
|
-
$:
|
|
57
|
-
isValid = language === "json" ? isValidJSON(value) : language === "js" ? isValidJS(value) : true;
|
|
56
|
+
$: isValid = language === "json" ? isValidJSON(value) : language === "js" ? isValidJS(value) : true;
|
|
58
57
|
</script>
|
|
59
58
|
|
|
60
59
|
<div class="grid items-stretch justify-stretch gap-1">
|
|
@@ -2,14 +2,14 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
id: string;
|
|
5
|
-
title?: string
|
|
6
|
-
initialValue?: string
|
|
7
|
-
value?: string
|
|
8
|
-
language?: string
|
|
9
|
-
dark?: boolean
|
|
10
|
-
toggle?: boolean
|
|
11
|
-
actions?: boolean
|
|
12
|
-
isValid?: boolean
|
|
5
|
+
title?: string;
|
|
6
|
+
initialValue?: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
dark?: boolean;
|
|
10
|
+
toggle?: boolean;
|
|
11
|
+
actions?: boolean;
|
|
12
|
+
isValid?: boolean;
|
|
13
13
|
styles?: any;
|
|
14
14
|
};
|
|
15
15
|
events: {
|
|
@@ -15,16 +15,13 @@ export let submit = "";
|
|
|
15
15
|
export let context = "";
|
|
16
16
|
export let data;
|
|
17
17
|
let isUploading = false;
|
|
18
|
-
$:
|
|
19
|
-
|
|
20
|
-
$:
|
|
21
|
-
submitBt = "submit";
|
|
18
|
+
$: model = data;
|
|
19
|
+
$: submitBt = "submit";
|
|
22
20
|
let maxSize = 0;
|
|
23
21
|
const dispatch = createEventDispatcher();
|
|
24
22
|
let fx;
|
|
25
23
|
let files = { accepted: [], rejected: [] };
|
|
26
|
-
$:
|
|
27
|
-
files;
|
|
24
|
+
$: files;
|
|
28
25
|
onMount(async () => {
|
|
29
26
|
if (!data) {
|
|
30
27
|
load();
|
|
@@ -2,11 +2,11 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import type { fileUploaderType } from '../../models/Models.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
id?: number
|
|
6
|
-
version?: number
|
|
7
|
-
start?: string
|
|
8
|
-
submit?: string
|
|
9
|
-
context?: string
|
|
5
|
+
id?: number;
|
|
6
|
+
version?: number;
|
|
7
|
+
start?: string;
|
|
8
|
+
submit?: string;
|
|
9
|
+
context?: string;
|
|
10
10
|
data: fileUploaderType | undefined;
|
|
11
11
|
};
|
|
12
12
|
events: {
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
|
|
2
|
+
import type { TableConfig } from '../../models/Models';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
config: TableConfig<any>;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
action: any;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
3
14
|
export type TableProps = typeof __propDef.props;
|
|
4
15
|
export type TableEvents = typeof __propDef.events;
|
|
5
16
|
export type TableSlots = typeof __propDef.slots;
|
|
@@ -301,12 +301,9 @@ const sortServer = (order, id) => {
|
|
|
301
301
|
$pageIndex = 0;
|
|
302
302
|
updateTable();
|
|
303
303
|
};
|
|
304
|
-
$:
|
|
305
|
-
|
|
306
|
-
$:
|
|
307
|
-
serverSide && updateTable();
|
|
308
|
-
$:
|
|
309
|
-
serverSide && sortServer($sortKeys[0]?.order, $sortKeys[0]?.id);
|
|
304
|
+
$: sortKeys = pluginStates.sort.sortKeys;
|
|
305
|
+
$: serverSide && updateTable();
|
|
306
|
+
$: serverSide && sortServer($sortKeys[0]?.order, $sortKeys[0]?.id);
|
|
310
307
|
</script>
|
|
311
308
|
|
|
312
309
|
<div class="grid gap-2 overflow-auto" class:w-fit={!fitToScreen} class:w-full={fitToScreen}>
|
|
@@ -179,14 +179,11 @@ const clearFilters = () => {
|
|
|
179
179
|
dropdowns = [];
|
|
180
180
|
$filters[id] = {};
|
|
181
181
|
};
|
|
182
|
-
$:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
);
|
|
188
|
-
$:
|
|
189
|
-
addFilter(options[type][0].value, void 0);
|
|
182
|
+
$: type = isDate ? "date" : type;
|
|
183
|
+
$: remainingFilters = options[type].filter(
|
|
184
|
+
(option) => !Object.keys($filters[id]).includes(option.value)
|
|
185
|
+
);
|
|
186
|
+
$: addFilter(options[type][0].value, void 0);
|
|
190
187
|
</script>
|
|
191
188
|
|
|
192
189
|
<form class="">
|
|
@@ -173,16 +173,12 @@ const applyFilters = () => {
|
|
|
173
173
|
active = true;
|
|
174
174
|
});
|
|
175
175
|
};
|
|
176
|
-
$:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
$:
|
|
183
|
-
addFilter(options[type][0].value, void 0);
|
|
184
|
-
$:
|
|
185
|
-
console.log($filters);
|
|
176
|
+
$: type = isDate ? "date" : type;
|
|
177
|
+
$: remainingFilters = options[type].filter(
|
|
178
|
+
(option) => !Object.keys($filters[id]).includes(option.value)
|
|
179
|
+
);
|
|
180
|
+
$: addFilter(options[type][0].value, void 0);
|
|
181
|
+
$: console.log($filters);
|
|
186
182
|
</script>
|
|
187
183
|
|
|
188
184
|
<form class="">
|
|
@@ -23,14 +23,10 @@ const handleChange = (e) => {
|
|
|
23
23
|
$pageIndex = value - 1;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
$:
|
|
27
|
-
|
|
28
|
-
$:
|
|
29
|
-
|
|
30
|
-
$:
|
|
31
|
-
goToNextPageDisabled = !$hasNextPage;
|
|
32
|
-
$:
|
|
33
|
-
goToPreviousPageDisabled = !$hasPreviousPage;
|
|
26
|
+
$: goToFirstPageDisabled = !$pageIndex;
|
|
27
|
+
$: goToLastPageDisabled = $pageIndex == $pageCount - 1;
|
|
28
|
+
$: goToNextPageDisabled = !$hasNextPage;
|
|
29
|
+
$: goToPreviousPageDisabled = !$hasPreviousPage;
|
|
34
30
|
</script>
|
|
35
31
|
|
|
36
32
|
<div class="flex justify-between w-full items-stretch gap-10">
|
|
@@ -45,18 +45,12 @@ const goTo = (dst) => {
|
|
|
45
45
|
}
|
|
46
46
|
updateTable();
|
|
47
47
|
};
|
|
48
|
-
$:
|
|
49
|
-
|
|
50
|
-
$:
|
|
51
|
-
|
|
52
|
-
$:
|
|
53
|
-
|
|
54
|
-
$:
|
|
55
|
-
goToNextPageDisabled = $pageIndex == pageCount - 1;
|
|
56
|
-
$:
|
|
57
|
-
goToPreviousPageDisabled = !$pageIndex;
|
|
58
|
-
$:
|
|
59
|
-
$pageSize && updateTable();
|
|
48
|
+
$: pageCount = Math.ceil($serverItemCount / $pageSize);
|
|
49
|
+
$: goToFirstPageDisabled = !$pageIndex;
|
|
50
|
+
$: goToLastPageDisabled = $pageIndex == pageCount - 1;
|
|
51
|
+
$: goToNextPageDisabled = $pageIndex == pageCount - 1;
|
|
52
|
+
$: goToPreviousPageDisabled = !$pageIndex;
|
|
53
|
+
$: $pageSize && updateTable();
|
|
60
54
|
updateTable();
|
|
61
55
|
</script>
|
|
62
56
|
|
|
@@ -4,27 +4,10 @@ export declare const minWidth: (id: string, columns: Columns | undefined) => num
|
|
|
4
4
|
export declare const fixedWidth: (id: string, columns: Columns | undefined) => number;
|
|
5
5
|
export declare const cellStyle: (id: string, columns: Columns | undefined) => string;
|
|
6
6
|
export declare const normalizeFilters: (filters: {
|
|
7
|
-
[key: string]: {
|
|
8
|
-
e?: string | number | Date | undefined;
|
|
9
|
-
ne?: string | number | Date | undefined;
|
|
10
|
-
gt?: string | number | Date | undefined;
|
|
11
|
-
lt?: string | number | Date | undefined;
|
|
12
|
-
gte?: string | number | Date | undefined;
|
|
13
|
-
lte?: string | number | Date | undefined;
|
|
14
|
-
c?: string | number | Date | undefined;
|
|
15
|
-
nc?: string | number | Date | undefined;
|
|
16
|
-
sw?: string | number | Date | undefined;
|
|
17
|
-
ew?: string | number | Date | undefined;
|
|
18
|
-
o?: string | number | Date | undefined;
|
|
19
|
-
sf?: string | number | Date | undefined;
|
|
20
|
-
a?: string | number | Date | undefined;
|
|
21
|
-
u?: string | number | Date | undefined;
|
|
22
|
-
b?: string | number | Date | undefined;
|
|
23
|
-
no?: string | number | Date | undefined;
|
|
24
|
-
};
|
|
7
|
+
[key: string]: { [key in FilterOptionsEnum]?: number | string | Date; };
|
|
25
8
|
}) => Filter[];
|
|
26
9
|
export declare const exportAsCsv: (tableId: string, exportedData: string) => void;
|
|
27
|
-
export declare const resetResize: (headerRows: any, pageRows: any, tableId: string, columns: Columns | undefined, resizable:
|
|
10
|
+
export declare const resetResize: (headerRows: any, pageRows: any, tableId: string, columns: Columns | undefined, resizable: "none" | "rows" | "columns" | "both") => void;
|
|
28
11
|
export declare const missingValuesFn: (key: number | string, missingValues: {
|
|
29
12
|
[key: string | number]: string;
|
|
30
13
|
}) => string | number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
id?: string
|
|
5
|
-
label?: string
|
|
6
|
-
checked?: boolean
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
checked?: boolean;
|
|
7
7
|
valid: boolean;
|
|
8
8
|
invalid: boolean;
|
|
9
9
|
required: boolean;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
id?: string
|
|
5
|
-
label?: string
|
|
6
|
-
value?: string
|
|
7
|
-
valid?: boolean
|
|
8
|
-
invalid?: boolean
|
|
9
|
-
required?: boolean
|
|
10
|
-
feedback?: string[]
|
|
11
|
-
help?: boolean
|
|
12
|
-
disabled?: boolean
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
valid?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
feedback?: string[];
|
|
11
|
+
help?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
13
|
};
|
|
14
14
|
events: {
|
|
15
15
|
input: Event;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
id?: string
|
|
5
|
-
label?: string
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
6
|
required: boolean;
|
|
7
7
|
feedback: string[];
|
|
8
|
-
help?: boolean
|
|
8
|
+
help?: boolean;
|
|
9
9
|
};
|
|
10
10
|
events: {
|
|
11
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
id?: string
|
|
5
|
-
label?: string
|
|
6
|
-
value?: string
|
|
7
|
-
valid?: boolean
|
|
8
|
-
invalid?: boolean
|
|
9
|
-
required?: boolean
|
|
10
|
-
feedback?: string[]
|
|
11
|
-
placeholder?: string
|
|
12
|
-
help?: boolean
|
|
13
|
-
disabled?: boolean
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
valid?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
feedback?: string[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
help?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
14
|
};
|
|
15
15
|
events: {
|
|
16
16
|
input: Event;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
id?: string
|
|
5
|
-
label?: string
|
|
6
|
-
value?: string
|
|
7
|
-
valid?: boolean
|
|
8
|
-
invalid?: boolean
|
|
9
|
-
required?: boolean
|
|
10
|
-
feedback?: string[]
|
|
11
|
-
placeholder?: string
|
|
12
|
-
help?: boolean
|
|
13
|
-
disabled?: boolean
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
valid?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
feedback?: string[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
help?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
14
|
};
|
|
15
15
|
events: {
|
|
16
16
|
input: Event;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
id?: string
|
|
5
|
-
label?: string
|
|
6
|
-
value?: string
|
|
7
|
-
valid?: boolean
|
|
8
|
-
invalid?: boolean
|
|
9
|
-
required?: boolean
|
|
10
|
-
feedback?: string[]
|
|
11
|
-
placeholder?: string
|
|
12
|
-
help?: boolean
|
|
13
|
-
disabled?: boolean
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
valid?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
feedback?: string[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
help?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
14
|
};
|
|
15
15
|
events: {
|
|
16
16
|
input: Event;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
title?: string
|
|
5
|
-
message?: string
|
|
6
|
-
cssClass?: string
|
|
7
|
-
deleteBtn?: boolean
|
|
4
|
+
title?: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
cssClass?: string;
|
|
7
|
+
deleteBtn?: boolean;
|
|
8
8
|
};
|
|
9
9
|
events: {
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -5,13 +5,11 @@ import { popup } from "@skeletonlabs/skeleton";
|
|
|
5
5
|
import delay from "delay";
|
|
6
6
|
export let active = false;
|
|
7
7
|
let hs;
|
|
8
|
-
$:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
8
|
+
$: helpStore.subscribe((value) => {
|
|
9
|
+
hs = value;
|
|
10
|
+
});
|
|
12
11
|
let helpItem = { id: void 0, name: "", description: "" };
|
|
13
|
-
$:
|
|
14
|
-
helpItem = active === true ? hs.itemId == "" ? { id: void 0, name: "", description: "" } : hs.helpItems.find((h) => h.id === hs.itemId) : { id: void 0, name: "", description: "" };
|
|
12
|
+
$: helpItem = active === true ? hs.itemId == "" ? { id: void 0, name: "", description: "" } : hs.helpItems.find((h) => h.id === hs.itemId) : { id: void 0, name: "", description: "" };
|
|
15
13
|
const helpClick = {
|
|
16
14
|
event: "click",
|
|
17
15
|
target: "helpTarget",
|
|
@@ -4,10 +4,8 @@ import { notificationStore } from "../../stores/pageStores";
|
|
|
4
4
|
import { notificationType } from "../../models/Enums";
|
|
5
5
|
const toastStore = getToastStore();
|
|
6
6
|
let btnStyle;
|
|
7
|
-
$:
|
|
8
|
-
|
|
9
|
-
$:
|
|
10
|
-
$notificationStore, triggerToast();
|
|
7
|
+
$: btnStyle = $notificationStore === void 0 || $notificationStore.btnStyle === void 0 ? notificationStore.getBtnStyle() : $notificationStore.btnStyle;
|
|
8
|
+
$: $notificationStore, triggerToast();
|
|
11
9
|
onMount(() => {
|
|
12
10
|
toastStore.clear();
|
|
13
11
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { onMount } from "svelte";
|
|
2
|
-
import { pageContentLayoutType } from "../../models/Enums";
|
|
2
|
+
import { pageContentLayoutType, notificationType } from "../../models/Enums";
|
|
3
3
|
import { AppShell, AppBar } from "@skeletonlabs/skeleton";
|
|
4
4
|
import Menu from "./menu/Menu.svelte";
|
|
5
5
|
import Footer from "./Footer.svelte";
|
|
@@ -9,7 +9,8 @@ import Breadcrumb from "./breadcrumb/Breadcrumb.svelte";
|
|
|
9
9
|
import Notification from "./Notification.svelte";
|
|
10
10
|
import { computePosition, autoUpdate, offset, shift, flip, arrow } from "@floating-ui/dom";
|
|
11
11
|
import { storePopup } from "@skeletonlabs/skeleton";
|
|
12
|
-
import { breadcrumbStore } from "../../stores/pageStores";
|
|
12
|
+
import { breadcrumbStore, notificationStore } from "../../stores/pageStores";
|
|
13
|
+
import { errorStore } from "../../stores/apiStores";
|
|
13
14
|
storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
|
|
14
15
|
import Docs from "./Docs.svelte";
|
|
15
16
|
import GoToTop from "./GoToTop.svelte";
|
|
@@ -21,6 +22,13 @@ export let footer = true;
|
|
|
21
22
|
export let help = false;
|
|
22
23
|
export let contentLayoutType = pageContentLayoutType.center;
|
|
23
24
|
export let fixLeft = true;
|
|
25
|
+
errorStore.subscribe((error) => {
|
|
26
|
+
console.log("\u{1F680} ~ errorStore.subscribe ~ value:", error.error);
|
|
27
|
+
notificationStore.showNotification({
|
|
28
|
+
notificationType: notificationType.error,
|
|
29
|
+
message: error.error
|
|
30
|
+
});
|
|
31
|
+
});
|
|
24
32
|
onMount(async () => {
|
|
25
33
|
console.log("page");
|
|
26
34
|
breadcrumbStore.clean();
|
|
@@ -3,14 +3,14 @@ import type { linkType } from '../../models/Models';
|
|
|
3
3
|
import { pageContentLayoutType } from '../../models/Enums';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
|
-
title?: string
|
|
7
|
-
note?: string
|
|
8
|
-
links?: linkType[]
|
|
9
|
-
menu?: boolean
|
|
10
|
-
footer?: boolean
|
|
11
|
-
help?: boolean
|
|
12
|
-
contentLayoutType?: pageContentLayoutType
|
|
13
|
-
fixLeft?: boolean
|
|
6
|
+
title?: string;
|
|
7
|
+
note?: string;
|
|
8
|
+
links?: linkType[];
|
|
9
|
+
menu?: boolean;
|
|
10
|
+
footer?: boolean;
|
|
11
|
+
help?: boolean;
|
|
12
|
+
contentLayoutType?: pageContentLayoutType;
|
|
13
|
+
fixLeft?: boolean;
|
|
14
14
|
};
|
|
15
15
|
events: {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
@@ -2,9 +2,9 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import { positionType } from '../../models/Enums';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
textCss?: string
|
|
6
|
-
label?: string
|
|
7
|
-
position?: positionType
|
|
5
|
+
textCss?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
position?: positionType;
|
|
8
8
|
};
|
|
9
9
|
events: {
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -3,20 +3,17 @@ import { browser } from "$app/environment";
|
|
|
3
3
|
import { onMount } from "svelte";
|
|
4
4
|
import { getApplicationName } from "./BreadcrumbDataCaller";
|
|
5
5
|
export let title;
|
|
6
|
-
$:
|
|
7
|
-
update(title);
|
|
6
|
+
$: update(title);
|
|
8
7
|
function update(t) {
|
|
9
8
|
if (browser) {
|
|
10
9
|
breadcrumbStore.updateItem({ label: t, link: window.location.pathname });
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
let list = [];
|
|
14
|
-
$:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
list = value?.items;
|
|
19
|
-
});
|
|
13
|
+
$: list;
|
|
14
|
+
$: breadcrumbStore.subscribe((value) => {
|
|
15
|
+
list = value?.items;
|
|
16
|
+
});
|
|
20
17
|
let applicationName = "BEXIS2";
|
|
21
18
|
onMount(async () => {
|
|
22
19
|
applicationName = await getApplicationName();
|
|
@@ -14,21 +14,14 @@ const cTransition = `transition-all duration-[200ms]`;
|
|
|
14
14
|
const cTrack = "cursor-pointer";
|
|
15
15
|
const cThumb = "aspect-square scale-[0.8] flex justify-center items-center";
|
|
16
16
|
const cIcon = "w-[70%] aspect-square";
|
|
17
|
-
$:
|
|
18
|
-
|
|
19
|
-
$:
|
|
20
|
-
|
|
21
|
-
$:
|
|
22
|
-
|
|
23
|
-
$:
|
|
24
|
-
iconFill = mode === true ? fillLight : fillDark;
|
|
25
|
-
$:
|
|
26
|
-
classesTrack = `${cTrack} ${cTransition} ${width} ${height} ${ring} ${rounded} ${trackBg} ${$$props.class ?? ""}`;
|
|
27
|
-
$:
|
|
28
|
-
classesThumb = `${cThumb} ${cTransition} ${height} ${rounded} ${thumbBg} ${thumbPosition}`;
|
|
17
|
+
$: trackBg = mode === true ? bgLight : bgDark;
|
|
18
|
+
$: thumbBg = mode === true ? bgDark : bgLight;
|
|
19
|
+
$: thumbPosition = mode === true ? "translate-x-[100%]" : "";
|
|
20
|
+
$: iconFill = mode === true ? fillLight : fillDark;
|
|
21
|
+
$: classesTrack = `${cTrack} ${cTransition} ${width} ${height} ${ring} ${rounded} ${trackBg} ${$$props.class ?? ""}`;
|
|
22
|
+
$: classesThumb = `${cThumb} ${cTransition} ${height} ${rounded} ${thumbBg} ${thumbPosition}`;
|
|
29
23
|
let mode = true;
|
|
30
|
-
$:
|
|
31
|
-
mode;
|
|
24
|
+
$: mode;
|
|
32
25
|
</script>
|
|
33
26
|
|
|
34
27
|
<div
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { CssClasses } from '@skeletonlabs/skeleton';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
5
6
|
title?: string | undefined;
|
|
6
|
-
bgLight?:
|
|
7
|
-
bgDark?:
|
|
8
|
-
fillLight?:
|
|
9
|
-
fillDark?:
|
|
10
|
-
width?:
|
|
11
|
-
height?:
|
|
12
|
-
ring?:
|
|
13
|
-
rounded?:
|
|
7
|
+
bgLight?: CssClasses | undefined;
|
|
8
|
+
bgDark?: CssClasses | undefined;
|
|
9
|
+
fillLight?: CssClasses | undefined;
|
|
10
|
+
fillDark?: CssClasses | undefined;
|
|
11
|
+
width?: CssClasses | undefined;
|
|
12
|
+
height?: CssClasses | undefined;
|
|
13
|
+
ring?: CssClasses | undefined;
|
|
14
|
+
rounded?: CssClasses | undefined;
|
|
14
15
|
};
|
|
15
16
|
events: {
|
|
16
17
|
click: MouseEvent;
|
package/dist/models/Models.d.ts
CHANGED
package/dist/models/Models.js
CHANGED
|
@@ -28,3 +28,16 @@ export class Receive {
|
|
|
28
28
|
this.columns = [];
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
export class errorType {
|
|
32
|
+
statusText;
|
|
33
|
+
status;
|
|
34
|
+
error;
|
|
35
|
+
stackTrace;
|
|
36
|
+
constructor() {
|
|
37
|
+
this.statusText = "";
|
|
38
|
+
this.status = 0;
|
|
39
|
+
this.error = "";
|
|
40
|
+
this.stackTrace = "";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
;
|
package/dist/services/Api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Api.js
|
|
2
2
|
import axios from 'axios';
|
|
3
|
-
import { host, username, password } from '../stores/apiStores';
|
|
3
|
+
import { host, username, password, errorStore } from '../stores/apiStores';
|
|
4
4
|
console.log('setup axios');
|
|
5
5
|
// implement a method to execute all the request from here.
|
|
6
6
|
const apiRequest = (method, url, request) => {
|
|
@@ -19,9 +19,19 @@ const apiRequest = (method, url, request) => {
|
|
|
19
19
|
headers
|
|
20
20
|
})
|
|
21
21
|
.then((res) => {
|
|
22
|
+
// console.log("res",res);
|
|
22
23
|
return Promise.resolve(res);
|
|
23
24
|
})
|
|
24
|
-
.catch((
|
|
25
|
+
.catch((er) => {
|
|
26
|
+
//console.log("🚀 ~ apiRequest ~ err:", er)
|
|
27
|
+
const err = er.response;
|
|
28
|
+
let error = {
|
|
29
|
+
status: err.status,
|
|
30
|
+
statusText: err.statusText,
|
|
31
|
+
error: err.data.error,
|
|
32
|
+
stackTrace: err.data.stackTrace,
|
|
33
|
+
};
|
|
34
|
+
errorStore.set(error);
|
|
25
35
|
return Promise.reject(err);
|
|
26
36
|
});
|
|
27
37
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { errorType } from '../models/Models';
|
|
1
2
|
export declare let host: string;
|
|
2
3
|
export declare let username: string;
|
|
3
4
|
export declare let password: string;
|
|
5
|
+
export declare const errorStore: import("svelte/store").Writable<errorType>;
|
|
4
6
|
export declare function setApiConfig(_host: string, _user: string, _pw: string): void;
|
package/dist/stores/apiStores.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
|
+
import { errorType } from '../models/Models';
|
|
2
3
|
export let host = 'window.location.origin';
|
|
3
4
|
export let username = '';
|
|
4
5
|
export let password = '';
|
|
5
6
|
const hostStore = writable(''); //writable(window.location.origin);
|
|
6
7
|
const usernameStore = writable('');
|
|
7
8
|
const passwordStore = writable('');
|
|
9
|
+
export const errorStore = writable(new errorType());
|
|
8
10
|
hostStore.subscribe((value) => {
|
|
9
11
|
host = value;
|
|
10
12
|
});
|
|
@@ -95,7 +95,7 @@ function createBreadcrumbStore() {
|
|
|
95
95
|
breadcrumbStore.subscribe((value) => {
|
|
96
96
|
value = value === undefined ? new BreadcrumbModel() : value;
|
|
97
97
|
let v = value.items.find((i) => i.link === item.link);
|
|
98
|
-
console.log(value.items, v);
|
|
98
|
+
//console.log(value.items, v);
|
|
99
99
|
if (v) {
|
|
100
100
|
const i = value.items.indexOf(v);
|
|
101
101
|
value.items[i] = item;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bexis2/bexis2-core-ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
@@ -20,31 +20,31 @@
|
|
|
20
20
|
"3.npm - publish": "npm publish --access public"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@playwright/test": "^1.
|
|
24
|
-
"@skeletonlabs/skeleton": "^2.
|
|
25
|
-
"@skeletonlabs/tw-plugin": "^0.
|
|
26
|
-
"@sveltejs/adapter-auto": "^3.2.
|
|
27
|
-
"@sveltejs/adapter-static": "^3.0.
|
|
28
|
-
"@sveltejs/package": "^2.3.
|
|
23
|
+
"@playwright/test": "^1.45.3",
|
|
24
|
+
"@skeletonlabs/skeleton": "^2.10.2",
|
|
25
|
+
"@skeletonlabs/tw-plugin": "^0.4.0",
|
|
26
|
+
"@sveltejs/adapter-auto": "^3.2.2",
|
|
27
|
+
"@sveltejs/adapter-static": "^3.0.2",
|
|
28
|
+
"@sveltejs/package": "^2.3.2",
|
|
29
29
|
"@tailwindcss/forms": "^0.5.7",
|
|
30
|
-
"@tailwindcss/typography": "^0.5.
|
|
31
|
-
"@types/node": "^
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
33
|
-
"@typescript-eslint/parser": "^
|
|
30
|
+
"@tailwindcss/typography": "^0.5.13",
|
|
31
|
+
"@types/node": "^22.0.2",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
33
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
34
34
|
"autoprefixer": "^10.4.19",
|
|
35
|
-
"eslint": "^8.0
|
|
36
|
-
"eslint-config-prettier": "^
|
|
37
|
-
"postcss": "^8.4.
|
|
38
|
-
"prettier": "^3.
|
|
39
|
-
"prettier-plugin-svelte": "^3.2.
|
|
35
|
+
"eslint": "^9.8.0",
|
|
36
|
+
"eslint-config-prettier": "^9.1.0",
|
|
37
|
+
"postcss": "^8.4.40",
|
|
38
|
+
"prettier": "^3.3.3",
|
|
39
|
+
"prettier-plugin-svelte": "^3.2.6",
|
|
40
40
|
"raw-loader": "^4.0.2",
|
|
41
|
-
"svelte": "^4.2.
|
|
42
|
-
"svelte-check": "^3.
|
|
43
|
-
"tailwindcss": "^3.4.
|
|
44
|
-
"tslib": "^2.6.
|
|
45
|
-
"typescript": "^5.
|
|
46
|
-
"vite": "^5.
|
|
47
|
-
"vitest": "^
|
|
41
|
+
"svelte": "^4.2.18",
|
|
42
|
+
"svelte-check": "^3.8.5",
|
|
43
|
+
"tailwindcss": "^3.4.7",
|
|
44
|
+
"tslib": "^2.6.3",
|
|
45
|
+
"typescript": "^5.5.4",
|
|
46
|
+
"vite": "^5.3.5",
|
|
47
|
+
"vitest": "^2.0.5"
|
|
48
48
|
},
|
|
49
49
|
"type": "module",
|
|
50
50
|
"module": "./src/lib/index.ts",
|
|
@@ -59,33 +59,33 @@
|
|
|
59
59
|
"src/lib"
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@codemirror/lang-html": "^6.4.
|
|
62
|
+
"@codemirror/lang-html": "^6.4.9",
|
|
63
63
|
"@codemirror/lang-javascript": "^6.2.2",
|
|
64
64
|
"@codemirror/lang-json": "^6.0.1",
|
|
65
|
-
"@codemirror/lint": "^6.
|
|
65
|
+
"@codemirror/lint": "^6.8.1",
|
|
66
66
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
67
|
-
"@floating-ui/dom": "^1.6.
|
|
68
|
-
"@fortawesome/fontawesome-free": "^6.
|
|
69
|
-
"@fortawesome/fontawesome-svg-core": "^6.
|
|
70
|
-
"@fortawesome/free-regular-svg-icons": "^6.
|
|
71
|
-
"@fortawesome/free-solid-svg-icons": "^6.
|
|
72
|
-
"@sveltejs/kit": "^2.5.
|
|
73
|
-
"@sveltejs/vite-plugin-svelte": "^3.1.
|
|
74
|
-
"axios": "^1.
|
|
67
|
+
"@floating-ui/dom": "^1.6.8",
|
|
68
|
+
"@fortawesome/fontawesome-free": "^6.6.0",
|
|
69
|
+
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
|
70
|
+
"@fortawesome/free-regular-svg-icons": "^6.6.0",
|
|
71
|
+
"@fortawesome/free-solid-svg-icons": "^6.6.0",
|
|
72
|
+
"@sveltejs/kit": "^2.5.19",
|
|
73
|
+
"@sveltejs/vite-plugin-svelte": "^3.1.1",
|
|
74
|
+
"axios": "^1.7.3",
|
|
75
75
|
"codemirror": "^6.0.1",
|
|
76
76
|
"dateformat": "^5.0.3",
|
|
77
77
|
"delay": "^6.0.0",
|
|
78
78
|
"dotenv": "^16.4.5",
|
|
79
79
|
"eslint4b-prebuilt": "^6.7.2",
|
|
80
|
-
"highlight.js": "^11.
|
|
80
|
+
"highlight.js": "^11.10.0",
|
|
81
81
|
"highlightjs-svelte": "^1.0.6",
|
|
82
|
-
"svelte": "^4.2.
|
|
83
|
-
"svelte-codemirror-editor": "^1.
|
|
82
|
+
"svelte": "^4.2.18",
|
|
83
|
+
"svelte-codemirror-editor": "^1.4.0",
|
|
84
84
|
"svelte-fa": "^4.0.2",
|
|
85
85
|
"svelte-file-dropzone": "^2.0.7",
|
|
86
86
|
"svelte-headless-table": "^0.18.2",
|
|
87
87
|
"svelte-select": "5.8.3",
|
|
88
|
-
"vest": "^5.
|
|
88
|
+
"vest": "^5.4.0"
|
|
89
89
|
},
|
|
90
90
|
"author": "David Schöne",
|
|
91
91
|
"license": "ISC",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
|
|
4
|
-
import type { linkType } from '$lib/models/Models';
|
|
5
|
-
import { pageContentLayoutType } from '$lib/models/Enums';
|
|
4
|
+
import type { errorType, linkType } from '$lib/models/Models';
|
|
5
|
+
import { pageContentLayoutType, notificationType } from '$lib/models/Enums';
|
|
6
6
|
|
|
7
7
|
// ui components
|
|
8
8
|
import { AppShell, AppBar } from '@skeletonlabs/skeleton';
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
//popup
|
|
17
17
|
import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
|
|
18
18
|
import { storePopup } from '@skeletonlabs/skeleton';
|
|
19
|
-
import { breadcrumbStore } from '$store/pageStores';
|
|
19
|
+
import { breadcrumbStore,notificationStore } from '$store/pageStores';
|
|
20
|
+
import { errorStore } from '$store/apiStores';
|
|
20
21
|
|
|
21
22
|
storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
|
|
22
23
|
|
|
@@ -38,6 +39,14 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
38
39
|
export let contentLayoutType: pageContentLayoutType = pageContentLayoutType.center;
|
|
39
40
|
export let fixLeft: boolean = true;
|
|
40
41
|
|
|
42
|
+
errorStore.subscribe((error:errorType) => {
|
|
43
|
+
console.log("🚀 ~ errorStore.subscribe ~ value:", error.error)
|
|
44
|
+
notificationStore.showNotification({
|
|
45
|
+
notificationType: notificationType.error,
|
|
46
|
+
message: error.error
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
|
|
41
50
|
onMount(async () => {
|
|
42
51
|
console.log('page');
|
|
43
52
|
breadcrumbStore.clean();
|
package/src/lib/models/Models.ts
CHANGED
|
@@ -221,3 +221,19 @@ export class Receive {
|
|
|
221
221
|
this.columns = [];
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
export class errorType {
|
|
227
|
+
statusText: string;
|
|
228
|
+
status: number;
|
|
229
|
+
error:string;
|
|
230
|
+
stackTrace:string
|
|
231
|
+
|
|
232
|
+
constructor() {
|
|
233
|
+
this.statusText = "";
|
|
234
|
+
this.status = 0;
|
|
235
|
+
this.error = "";
|
|
236
|
+
this.stackTrace = "";
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
};
|
package/src/lib/services/Api.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Api.js
|
|
2
2
|
import axios from 'axios';
|
|
3
|
-
import { host, username, password } from '../stores/apiStores';
|
|
3
|
+
import { host, username, password, errorStore } from '../stores/apiStores';
|
|
4
|
+
import type { errorType } from '$models/Models';
|
|
4
5
|
|
|
5
6
|
console.log('setup axios');
|
|
6
7
|
|
|
@@ -23,9 +24,24 @@ const apiRequest = (method, url, request) => {
|
|
|
23
24
|
headers
|
|
24
25
|
})
|
|
25
26
|
.then((res) => {
|
|
27
|
+
// console.log("res",res);
|
|
28
|
+
|
|
26
29
|
return Promise.resolve(res);
|
|
30
|
+
|
|
27
31
|
})
|
|
28
|
-
.catch((
|
|
32
|
+
.catch((er) => {
|
|
33
|
+
//console.log("🚀 ~ apiRequest ~ err:", er)
|
|
34
|
+
const err = er.response;
|
|
35
|
+
|
|
36
|
+
let error:errorType = {
|
|
37
|
+
status: err.status,
|
|
38
|
+
statusText: err.statusText,
|
|
39
|
+
error: err.data.error,
|
|
40
|
+
stackTrace: err.data.stackTrace,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
errorStore.set(error);
|
|
44
|
+
|
|
29
45
|
return Promise.reject(err);
|
|
30
46
|
});
|
|
31
47
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
|
+
import { errorType } from '$models/Models'
|
|
2
3
|
|
|
3
4
|
export let host = 'window.location.origin';
|
|
4
5
|
export let username = '';
|
|
@@ -8,6 +9,8 @@ const hostStore = writable(''); //writable(window.location.origin);
|
|
|
8
9
|
const usernameStore = writable('');
|
|
9
10
|
const passwordStore = writable('');
|
|
10
11
|
|
|
12
|
+
export const errorStore = writable(new errorType());
|
|
13
|
+
|
|
11
14
|
hostStore.subscribe((value) => {
|
|
12
15
|
host = value;
|
|
13
16
|
});
|
|
@@ -117,7 +117,7 @@ function createBreadcrumbStore() {
|
|
|
117
117
|
value = value === undefined ? new BreadcrumbModel() : value;
|
|
118
118
|
|
|
119
119
|
let v = value.items.find((i) => i.link === item.link);
|
|
120
|
-
console.log(value.items, v);
|
|
120
|
+
//console.log(value.items, v);
|
|
121
121
|
|
|
122
122
|
if (v) {
|
|
123
123
|
const i = value.items.indexOf(v);
|