@bexis2/bexis2-core-ui 0.2.32 → 0.3.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 +4 -1
- package/dist/components/CodeEditor/CodeEditor.svelte +2 -1
- package/dist/components/form/DropdownKvP.svelte.d.ts +2 -2
- package/dist/components/form/MultiSelect.svelte +180 -181
- package/dist/components/form/MultiSelect.svelte.d.ts +2 -2
- package/dist/components/page/Notification.svelte +39 -1
- package/dist/components/page/Page.svelte +1 -2
- package/dist/components/page/breadcrumb/Breadcrumb.svelte +24 -20
- package/dist/stores/apiStores.js +2 -0
- package/dist/stores/pageStores.d.ts +1 -4
- package/dist/stores/pageStores.js +3 -41
- package/dist/themes/theme-bexis2.d.ts +2 -0
- package/dist/themes/theme-bexis2.js +99 -0
- package/package.json +4 -2
- package/src/lib/components/CodeEditor/CodeEditor.svelte +2 -1
- package/src/lib/components/file/FileUploader.svelte +3 -4
- package/src/lib/components/form/MultiSelect.svelte +180 -181
- package/src/lib/components/page/Notification.svelte +56 -1
- package/src/lib/components/page/Page.svelte +3 -4
- package/src/lib/components/page/breadcrumb/Breadcrumb.svelte +41 -39
- package/src/lib/models/Models.ts +1 -1
- package/src/lib/stores/apiStores.ts +3 -0
- package/src/lib/stores/pageStores.ts +11 -53
- package/src/lib/themes/theme-bexis2.ts +103 -0
package/README.md
CHANGED
|
@@ -7,7 +7,8 @@ import { javascript, esLint } from "@codemirror/lang-javascript";
|
|
|
7
7
|
import { lintGutter, linter } from "@codemirror/lint";
|
|
8
8
|
import { json, jsonParseLinter } from "@codemirror/lang-json";
|
|
9
9
|
import { oneDark } from "@codemirror/theme-one-dark";
|
|
10
|
-
import { Modal,
|
|
10
|
+
import { Modal, getModalStore } from "@skeletonlabs/skeleton";
|
|
11
|
+
const modalStore = getModalStore();
|
|
11
12
|
import { faMoon, faSave, faSun } from "@fortawesome/free-regular-svg-icons";
|
|
12
13
|
import { faArrowRotateLeft, faXmark } from "@fortawesome/free-solid-svg-icons";
|
|
13
14
|
export let id;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
export default class DropdownKvP extends SvelteComponentTyped<{
|
|
5
5
|
target: any;
|
|
6
6
|
id: any;
|
|
7
|
-
title: any;
|
|
8
7
|
source: any;
|
|
8
|
+
title: any;
|
|
9
9
|
required?: boolean | undefined;
|
|
10
10
|
invalid?: boolean | undefined;
|
|
11
11
|
valid?: boolean | undefined;
|
|
@@ -27,8 +27,8 @@ declare const __propDef: {
|
|
|
27
27
|
props: {
|
|
28
28
|
target: any;
|
|
29
29
|
id: any;
|
|
30
|
-
title: any;
|
|
31
30
|
source: any;
|
|
31
|
+
title: any;
|
|
32
32
|
required?: boolean | undefined;
|
|
33
33
|
invalid?: boolean | undefined;
|
|
34
34
|
valid?: boolean | undefined;
|
|
@@ -1,181 +1,180 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import InputContainer from './InputContainer.svelte';
|
|
3
|
-
|
|
4
|
-
import Select from 'svelte-select';
|
|
5
|
-
import { onMount } from 'svelte';
|
|
6
|
-
|
|
7
|
-
export let source;
|
|
8
|
-
export let target;
|
|
9
|
-
export let id;
|
|
10
|
-
export let title;
|
|
11
|
-
export let itemId = 'value';
|
|
12
|
-
export let itemLabel = 'label';
|
|
13
|
-
export let itemGroup = 'group';
|
|
14
|
-
export let isMulti = true;
|
|
15
|
-
export let complexSource = false;
|
|
16
|
-
export let complexTarget = false;
|
|
17
|
-
export let required = false;
|
|
18
|
-
export let feedback = [''];
|
|
19
|
-
export let placeholder = '-- Please select --';
|
|
20
|
-
export let invalid = false;
|
|
21
|
-
export let loading = false;
|
|
22
|
-
export let help = false;
|
|
23
|
-
export let clearable = true;
|
|
24
|
-
export let disabled = false;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
$: value
|
|
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
|
-
//console.log('
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
//console.log('
|
|
116
|
-
//console.log(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
{
|
|
160
|
-
|
|
161
|
-
{
|
|
162
|
-
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
{
|
|
167
|
-
|
|
168
|
-
{
|
|
169
|
-
{
|
|
170
|
-
|
|
171
|
-
on:
|
|
172
|
-
on:
|
|
173
|
-
on:
|
|
174
|
-
on:
|
|
175
|
-
on:
|
|
176
|
-
on:
|
|
177
|
-
on:
|
|
178
|
-
on:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
</InputContainer>
|
|
1
|
+
<script>
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
import Select from 'svelte-select';
|
|
5
|
+
import { onMount } from 'svelte';
|
|
6
|
+
|
|
7
|
+
export let source;
|
|
8
|
+
export let target;
|
|
9
|
+
export let id;
|
|
10
|
+
export let title;
|
|
11
|
+
export let itemId = 'value';
|
|
12
|
+
export let itemLabel = 'label';
|
|
13
|
+
export let itemGroup = 'group';
|
|
14
|
+
export let isMulti = true;
|
|
15
|
+
export let complexSource = false;
|
|
16
|
+
export let complexTarget = false;
|
|
17
|
+
export let required = false;
|
|
18
|
+
export let feedback = [''];
|
|
19
|
+
export let placeholder = '-- Please select --';
|
|
20
|
+
export let invalid = false;
|
|
21
|
+
export let loading = false;
|
|
22
|
+
export let help = false;
|
|
23
|
+
export let clearable = true;
|
|
24
|
+
export let disabled = false;
|
|
25
|
+
|
|
26
|
+
let isLoaded = false;
|
|
27
|
+
|
|
28
|
+
$: value = null;
|
|
29
|
+
$: updateTarget(value);
|
|
30
|
+
$: target, setValue(target);
|
|
31
|
+
|
|
32
|
+
let groupBy;
|
|
33
|
+
$: groupBy;
|
|
34
|
+
|
|
35
|
+
function updateTarget(selection) {
|
|
36
|
+
//console.log("UPDATE target",selection);
|
|
37
|
+
//different cases
|
|
38
|
+
//a) source is complex model is simple return array
|
|
39
|
+
if (complexSource && !complexTarget && isLoaded && isMulti) {
|
|
40
|
+
//console.log('a) source is complex model is simple');
|
|
41
|
+
|
|
42
|
+
target = [];
|
|
43
|
+
for (let i in selection) {
|
|
44
|
+
let item = selection[i];
|
|
45
|
+
target.push(item[itemId]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!complexSource && !complexTarget && isLoaded && isMulti) {
|
|
50
|
+
target = [];
|
|
51
|
+
|
|
52
|
+
for (let i in selection) {
|
|
53
|
+
target.push(selection[i].value);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (complexSource && complexTarget && isLoaded && isMulti) {
|
|
58
|
+
//console.log("both complex",selection);
|
|
59
|
+
target = selection;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (complexSource && complexTarget && isLoaded && !isMulti) {
|
|
63
|
+
target = selection;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!complexSource && !complexTarget && isLoaded && !isMulti) {
|
|
67
|
+
target = selection.value;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (complexSource && !complexTarget && isLoaded && !isMulti) {
|
|
71
|
+
target = selection[itemLabel];
|
|
72
|
+
//console.log('selection', selection);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//console.log('selection ' + title, selection);
|
|
76
|
+
//console.log('target ' + title, target);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
onMount(async () => {
|
|
80
|
+
//console.log("OnMount", target)
|
|
81
|
+
if (complexSource && complexTarget) {
|
|
82
|
+
// after on mount a setValue is needed when data is complex
|
|
83
|
+
setValue(target);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
function setValue(t) {
|
|
88
|
+
//console.log("Set Value",t);
|
|
89
|
+
//a) source is complex model is simple
|
|
90
|
+
if (complexSource && !complexTarget && isMulti) {
|
|
91
|
+
let items = [];
|
|
92
|
+
// event.detail will be null unless isMulti is true and user has removed a single item
|
|
93
|
+
for (let i in t) {
|
|
94
|
+
let t = target[i];
|
|
95
|
+
items.push(source.find((item) => item[itemId] === t));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
isLoaded = true;
|
|
99
|
+
if (items.length > 0) {
|
|
100
|
+
value = items;
|
|
101
|
+
}
|
|
102
|
+
////console.log(value);
|
|
103
|
+
groupBy = (item) => item[itemGroup];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (complexSource && complexTarget && isMulti) {
|
|
107
|
+
value = t;
|
|
108
|
+
isLoaded = true;
|
|
109
|
+
groupBy = (item) => item[itemGroup];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
//b) simple liust and simple model
|
|
113
|
+
if (!complexSource && !complexTarget && isMulti) {
|
|
114
|
+
//console.log('b) simple liust and simple model');
|
|
115
|
+
//console.log('source', source);
|
|
116
|
+
//console.log("target",t);
|
|
117
|
+
isLoaded = true;
|
|
118
|
+
//set target only if its nit empty
|
|
119
|
+
if (t != null && t !== undefined && t != '') {
|
|
120
|
+
//console.log('target', t);
|
|
121
|
+
value = t;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (!isMulti) {
|
|
126
|
+
//console.log("onmount",complexSource,complexTarget,value,target)
|
|
127
|
+
if (!complexSource && !complexTarget) {
|
|
128
|
+
value = {
|
|
129
|
+
value: t,
|
|
130
|
+
label: t
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (complexSource && complexTarget) {
|
|
135
|
+
value = t;
|
|
136
|
+
groupBy = (item) => item[itemGroup];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (complexSource && !complexTarget) {
|
|
140
|
+
//value = target
|
|
141
|
+
console.log(
|
|
142
|
+
'this case is currently not supported (complexSource,complexTarget,isMulti)',
|
|
143
|
+
complexSource,
|
|
144
|
+
complexTarget,
|
|
145
|
+
isMulti
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
isLoaded = true;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
//console.log(t,value)
|
|
153
|
+
}
|
|
154
|
+
</script>
|
|
155
|
+
|
|
156
|
+
<InputContainer {id} label={title} {feedback} {required} {help}>
|
|
157
|
+
<Select
|
|
158
|
+
{id}
|
|
159
|
+
items={source}
|
|
160
|
+
{groupBy}
|
|
161
|
+
{itemId}
|
|
162
|
+
label={itemLabel}
|
|
163
|
+
multiple={isMulti}
|
|
164
|
+
bind:value
|
|
165
|
+
{placeholder}
|
|
166
|
+
hasError={invalid}
|
|
167
|
+
{loading}
|
|
168
|
+
{clearable}
|
|
169
|
+
{disabled}
|
|
170
|
+
on:change
|
|
171
|
+
on:input
|
|
172
|
+
on:focus
|
|
173
|
+
on:blur
|
|
174
|
+
on:clear
|
|
175
|
+
on:loaded
|
|
176
|
+
on:error
|
|
177
|
+
on:filter
|
|
178
|
+
on:hoverItem
|
|
179
|
+
/>
|
|
180
|
+
</InputContainer>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
export default class MultiSelect extends SvelteComponentTyped<{
|
|
5
5
|
target: any;
|
|
6
6
|
id: any;
|
|
7
|
-
title: any;
|
|
8
7
|
source: any;
|
|
8
|
+
title: any;
|
|
9
9
|
disabled?: boolean | undefined;
|
|
10
10
|
required?: boolean | undefined;
|
|
11
11
|
invalid?: boolean | undefined;
|
|
@@ -42,8 +42,8 @@ declare const __propDef: {
|
|
|
42
42
|
props: {
|
|
43
43
|
target: any;
|
|
44
44
|
id: any;
|
|
45
|
-
title: any;
|
|
46
45
|
source: any;
|
|
46
|
+
title: any;
|
|
47
47
|
disabled?: boolean | undefined;
|
|
48
48
|
required?: boolean | undefined;
|
|
49
49
|
invalid?: boolean | undefined;
|
|
@@ -1,8 +1,46 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { onMount } from "svelte";
|
|
2
|
+
import { Toast, getToastStore } from "@skeletonlabs/skeleton";
|
|
2
3
|
import { notificationStore } from "../../stores/pageStores";
|
|
4
|
+
import { notificationType } from "../../models/Enums";
|
|
5
|
+
const toastStore = getToastStore();
|
|
3
6
|
let btnStyle;
|
|
4
7
|
$:
|
|
5
8
|
btnStyle = $notificationStore === void 0 || $notificationStore.btnStyle === void 0 ? notificationStore.getBtnStyle() : $notificationStore.btnStyle;
|
|
9
|
+
$:
|
|
10
|
+
$notificationStore, triggerToast();
|
|
11
|
+
onMount(() => {
|
|
12
|
+
toastStore.clear();
|
|
13
|
+
});
|
|
14
|
+
function triggerToast() {
|
|
15
|
+
toastStore.clear();
|
|
16
|
+
const timeout = 3e4;
|
|
17
|
+
let classes = "";
|
|
18
|
+
if ($notificationStore.message != void 0 && $notificationStore.message != "") {
|
|
19
|
+
switch ($notificationStore.notificationType) {
|
|
20
|
+
case notificationType.success:
|
|
21
|
+
classes = "bg-success-300 border-solid border-2 border-success-500 shadow-md text-surface-900";
|
|
22
|
+
break;
|
|
23
|
+
case notificationType.warning:
|
|
24
|
+
classes = "bg-warning-300 border-solid border-2 border-warning-500 shadow-md text-surface-900";
|
|
25
|
+
break;
|
|
26
|
+
case notificationType.error:
|
|
27
|
+
classes = "bg-error-300 border-solid border-2 border-error-500 shadow-md text-surface-900";
|
|
28
|
+
break;
|
|
29
|
+
case notificationType.surface:
|
|
30
|
+
classes = "bg-surface-300 border-solid border-2 border-surface-500 shadow-md text-surface-900";
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
const notificationToast = {
|
|
34
|
+
classes,
|
|
35
|
+
message: $notificationStore.message,
|
|
36
|
+
timeout,
|
|
37
|
+
callback: () => {
|
|
38
|
+
toastStore.clear();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
toastStore.trigger(notificationToast);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
6
44
|
</script>
|
|
7
45
|
|
|
8
46
|
<Toast position="t" buttonDismiss={btnStyle} />
|
|
@@ -11,7 +11,6 @@ import { computePosition, autoUpdate, offset, shift, flip, arrow } from "@floati
|
|
|
11
11
|
import { storePopup } from "@skeletonlabs/skeleton";
|
|
12
12
|
import { breadcrumbStore } from "../../stores/pageStores";
|
|
13
13
|
storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
|
|
14
|
-
import { helpStore } from "../../stores/pageStores";
|
|
15
14
|
import Docs from "./Docs.svelte";
|
|
16
15
|
export let title = "";
|
|
17
16
|
export let note = "";
|
|
@@ -39,7 +38,7 @@ onMount(async () => {
|
|
|
39
38
|
{/if}
|
|
40
39
|
|
|
41
40
|
<div class="grid grid-cols-2">
|
|
42
|
-
<Breadcrumb bind:title
|
|
41
|
+
<Breadcrumb bind:title />
|
|
43
42
|
<Docs {links} {note} />
|
|
44
43
|
</div>
|
|
45
44
|
</svelte:fragment>
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
<script>import { breadcrumbStore } from "../../../stores/pageStores";
|
|
2
|
+
import { browser } from "$app/environment";
|
|
3
|
+
import { base } from "$app/paths";
|
|
2
4
|
export let title;
|
|
3
5
|
$:
|
|
4
6
|
update(title);
|
|
5
7
|
function update(t) {
|
|
6
|
-
|
|
8
|
+
if (browser) {
|
|
9
|
+
breadcrumbStore.updateItem({ label: t, link: window.location.pathname });
|
|
10
|
+
}
|
|
7
11
|
}
|
|
8
12
|
let list = [];
|
|
9
13
|
$:
|
|
@@ -12,22 +16,22 @@ $:
|
|
|
12
16
|
breadcrumbStore.subscribe((value) => {
|
|
13
17
|
list = value?.items;
|
|
14
18
|
});
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div class="px-5 py-2">
|
|
18
|
-
<ol class="breadcrumb -p50">
|
|
19
|
-
<!--default home-->
|
|
20
|
-
<li class="crumb"><a class="anchor" href={'/'}>Home</a></li>
|
|
21
|
-
<li class="crumb-separator" aria-hidden>›</li>
|
|
22
|
-
|
|
23
|
-
{#each list as crumb, i}
|
|
24
|
-
<!-- If crumb index is less than the breadcrumb length minus 1 -->
|
|
25
|
-
{#if i < list.length - 1}
|
|
26
|
-
<li class="crumb"><a class="anchor" href={crumb.link}>{crumb.label}</a></li>
|
|
27
|
-
<li class="crumb-separator" aria-hidden>›</li>
|
|
28
|
-
{:else}
|
|
29
|
-
<li class="crumb">{crumb.label}</li>
|
|
30
|
-
{/if}
|
|
31
|
-
{/each}
|
|
32
|
-
</ol>
|
|
33
|
-
</div>
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class="px-5 py-2">
|
|
22
|
+
<ol class="breadcrumb -p50">
|
|
23
|
+
<!--default home-->
|
|
24
|
+
<li class="crumb"><a class="anchor" href={base + '/'}>Home</a></li>
|
|
25
|
+
<li class="crumb-separator" aria-hidden>›</li>
|
|
26
|
+
|
|
27
|
+
{#each list as crumb, i}
|
|
28
|
+
<!-- If crumb index is less than the breadcrumb length minus 1 -->
|
|
29
|
+
{#if i < list.length - 1}
|
|
30
|
+
<li class="crumb"><a class="anchor" href={crumb.link}>{crumb.label}</a></li>
|
|
31
|
+
<li class="crumb-separator" aria-hidden>›</li>
|
|
32
|
+
{:else}
|
|
33
|
+
<li class="crumb">{crumb.label}</li>
|
|
34
|
+
{/if}
|
|
35
|
+
{/each}
|
|
36
|
+
</ol>
|
|
37
|
+
</div>
|
package/dist/stores/apiStores.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { helpItemType, helpStoreType, notificationItemType, notificationStoreType } from '../models/Models';
|
|
2
2
|
import type { MenuModel, breadcrumbItemType } from '../models/Page';
|
|
3
3
|
import { BreadcrumbModel } from '../models/Page';
|
|
4
|
-
import { type Writable } from 'svelte/store';
|
|
5
4
|
export declare const helpStore: {
|
|
6
5
|
subscribe: (this: void, run: import("svelte/store").Subscriber<helpStoreType>, invalidate?: ((value?: helpStoreType | undefined) => void) | undefined) => import("svelte/store").Unsubscriber;
|
|
7
6
|
set: (this: void, value: helpStoreType) => void;
|
|
@@ -16,7 +15,7 @@ export declare const helpStore: {
|
|
|
16
15
|
reset: () => void;
|
|
17
16
|
clear: () => void;
|
|
18
17
|
};
|
|
19
|
-
export declare const menuStore: Writable<MenuModel>;
|
|
18
|
+
export declare const menuStore: import("svelte/store").Writable<MenuModel>;
|
|
20
19
|
export declare const breadcrumbStore: {
|
|
21
20
|
subscribe: (this: void, run: import("svelte/store").Subscriber<BreadcrumbModel>, invalidate?: ((value?: BreadcrumbModel | undefined) => void) | undefined) => import("svelte/store").Unsubscriber;
|
|
22
21
|
set: (this: void, value: BreadcrumbModel) => void;
|
|
@@ -30,8 +29,6 @@ export declare const notificationStore: {
|
|
|
30
29
|
set: (this: void, value: notificationStoreType) => void;
|
|
31
30
|
update: (this: void, updater: import("svelte/store").Updater<notificationStoreType>) => void;
|
|
32
31
|
setNotification: (notificationItem: notificationItemType) => void;
|
|
33
|
-
triggerNotification: () => void;
|
|
34
|
-
clear: () => void;
|
|
35
32
|
showNotification: (notificationItem: notificationItemType) => void;
|
|
36
33
|
getBtnStyle: () => string;
|
|
37
34
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { notificationType } from '../models/Enums';
|
|
2
2
|
import { BreadcrumbModel } from '../models/Page';
|
|
3
|
-
import { toastStore } from '@skeletonlabs/skeleton';
|
|
4
3
|
import { writable } from 'svelte/store';
|
|
5
4
|
function createHelpStore() {
|
|
6
5
|
// set Store Type
|
|
@@ -149,55 +148,18 @@ function createNotificationStore() {
|
|
|
149
148
|
message: notificationItem.message,
|
|
150
149
|
btnStyle: btnStyle
|
|
151
150
|
});
|
|
152
|
-
notificationStore.subscribe((value) => { });
|
|
153
|
-
},
|
|
154
|
-
// triggers the notification to show
|
|
155
|
-
triggerNotification: () => {
|
|
156
|
-
let timeout = 30000;
|
|
157
|
-
let classes = '';
|
|
158
|
-
let message = '';
|
|
159
151
|
notificationStore.subscribe((value) => {
|
|
160
|
-
|
|
161
|
-
case notificationType.success:
|
|
162
|
-
classes =
|
|
163
|
-
'bg-success-300 border-solid border-2 border-success-500 shadow-md text-surface-900';
|
|
164
|
-
break;
|
|
165
|
-
case notificationType.warning:
|
|
166
|
-
classes =
|
|
167
|
-
'bg-warning-300 border-solid border-2 border-warning-500 shadow-md text-surface-900';
|
|
168
|
-
break;
|
|
169
|
-
case notificationType.error:
|
|
170
|
-
classes =
|
|
171
|
-
'bg-error-300 border-solid border-2 border-error-500 shadow-md text-surface-900';
|
|
172
|
-
break;
|
|
173
|
-
case notificationType.surface:
|
|
174
|
-
classes =
|
|
175
|
-
'bg-surface-300 border-solid border-2 border-surface-500 shadow-md text-surface-900';
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
message = value.message;
|
|
152
|
+
"";
|
|
179
153
|
});
|
|
180
|
-
if (classes != '' && message != '') {
|
|
181
|
-
const notificationToast = {
|
|
182
|
-
classes: classes,
|
|
183
|
-
message: message,
|
|
184
|
-
timeout: timeout
|
|
185
|
-
};
|
|
186
|
-
toastStore.trigger(notificationToast);
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
// cleans the toastStore
|
|
190
|
-
clear: () => {
|
|
191
|
-
toastStore.clear();
|
|
192
154
|
},
|
|
193
155
|
// cleans, sets, and schows the notification (all you need ;))
|
|
194
156
|
showNotification: (notificationItem) => {
|
|
195
|
-
notificationStore.clear();
|
|
157
|
+
//notificationStore.clear();
|
|
196
158
|
notificationStore.setNotification({
|
|
197
159
|
notificationType: notificationItem.notificationType,
|
|
198
160
|
message: notificationItem.message
|
|
199
161
|
});
|
|
200
|
-
|
|
162
|
+
// if the store is changing, the notification componend will be updated
|
|
201
163
|
},
|
|
202
164
|
// gets the dissmiss Button style
|
|
203
165
|
getBtnStyle: () => {
|