@bexis2/bexis2-core-ui 0.2.32 → 0.3.1

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.
@@ -20,8 +20,7 @@
20
20
 
21
21
  storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
22
22
 
23
- // stores
24
- import { helpStore } from '$store/pageStores';
23
+
25
24
  import Docs from './Docs.svelte';
26
25
 
27
26
  export let title = '';
@@ -33,7 +32,7 @@
33
32
  export let footer: boolean = true;
34
33
  export let help: boolean = false;
35
34
  export let contentLayoutType: pageContentLayoutType = pageContentLayoutType.center;
36
- export let fixLeft:boolean = true;
35
+ export let fixLeft: boolean = true;
37
36
 
38
37
  onMount(async () => {
39
38
  console.log('page');
@@ -53,7 +52,7 @@
53
52
  {/if}
54
53
 
55
54
  <div class="grid grid-cols-2">
56
- <Breadcrumb bind:title={title} />
55
+ <Breadcrumb bind:title />
57
56
  <Docs {links} {note} />
58
57
  </div>
59
58
  </svelte:fragment>
@@ -1,39 +1,41 @@
1
- <script lang="ts">
2
- import { breadcrumbStore } from '$store/pageStores';
3
- import type { breadcrumbItemType } from '$models/Page';
4
-
5
- export let title;
6
-
7
- $:update(title)
8
-
9
-
10
- function update(t)
11
- {
12
- breadcrumbStore.updateItem({ label: t, link: window.location.pathname });
13
- }
14
-
15
- let list: breadcrumbItemType[] = [];
16
- $: list;
17
-
18
- $: breadcrumbStore.subscribe((value) => {
19
- list = value?.items;
20
- });
21
- </script>
22
-
23
- <div class="px-5 py-2">
24
- <ol class="breadcrumb -p50">
25
- <!--default home-->
26
- <li class="crumb"><a class="anchor" href={'/'}>Home</a></li>
27
- <li class="crumb-separator" aria-hidden>&rsaquo;</li>
28
-
29
- {#each list as crumb, i}
30
- <!-- If crumb index is less than the breadcrumb length minus 1 -->
31
- {#if i < list.length - 1}
32
- <li class="crumb"><a class="anchor" href={crumb.link}>{crumb.label}</a></li>
33
- <li class="crumb-separator" aria-hidden>&rsaquo;</li>
34
- {:else}
35
- <li class="crumb">{crumb.label}</li>
36
- {/if}
37
- {/each}
38
- </ol>
39
- </div>
1
+ <script lang="ts">
2
+ import { breadcrumbStore } from '$store/pageStores';
3
+ import type { breadcrumbItemType } from '$models/Page';
4
+ import { browser } from '$app/environment';
5
+ import { base } from '$app/paths';
6
+
7
+ export let title;
8
+
9
+ $: update(title);
10
+
11
+ function update(t) {
12
+ if (browser) {
13
+ breadcrumbStore.updateItem({ label: t, link: window.location.pathname });
14
+ }
15
+ }
16
+
17
+ let list: breadcrumbItemType[] = [];
18
+ $: list;
19
+
20
+ $: breadcrumbStore.subscribe((value) => {
21
+ list = value?.items;
22
+ });
23
+ </script>
24
+
25
+ <div class="px-5 py-2">
26
+ <ol class="breadcrumb -p50">
27
+ <!--default home-->
28
+ <li class="crumb"><a class="anchor" href={base + '/'}>Home</a></li>
29
+ <li class="crumb-separator" aria-hidden>&rsaquo;</li>
30
+
31
+ {#each list as crumb, i}
32
+ <!-- If crumb index is less than the breadcrumb length minus 1 -->
33
+ {#if i < list.length - 1}
34
+ <li class="crumb"><a class="anchor" href={crumb.link}>{crumb.label}</a></li>
35
+ <li class="crumb-separator" aria-hidden>&rsaquo;</li>
36
+ {:else}
37
+ <li class="crumb">{crumb.label}</li>
38
+ {/if}
39
+ {/each}
40
+ </ol>
41
+ </div>
package/src/lib/index.ts CHANGED
@@ -39,6 +39,9 @@ import Notification from './components/page/Notification.svelte';
39
39
  //table placeholder
40
40
  import TablePlaceholder from './components/page/TablePlaceholder.svelte';
41
41
 
42
+ // theme
43
+ import { bexis2theme } from './themes/theme-bexis2';
44
+
42
45
  //Form
43
46
  export {
44
47
  Checkbox,
@@ -104,3 +107,6 @@ export { Table, TableFilter, columnFilter, searchFilter };
104
107
  export { CodeEditor };
105
108
 
106
109
  export type { TableConfig, Columns, Column };
110
+
111
+ // theme
112
+ export { bexis2theme }
@@ -111,7 +111,7 @@ export interface TableConfig<T> {
111
111
  toggle?: boolean; // false by default
112
112
  fitToScreen?: boolean; // true by default
113
113
  height?: null | number; // null by default
114
- columns?: Columns;
114
+ columns?: Columns;
115
115
  pageSizes?: number[]; // [5, 10, 15, 20] by default
116
116
  defaultPageSize?: number; // 10 by default
117
117
  optionsComponent?: typeof SvelteComponent;
@@ -29,3 +29,6 @@ export function setApiConfig(_host: string, _user: string, _pw: string) {
29
29
 
30
30
  //console.log('overwrite host',_host);
31
31
  }
32
+
33
+ // import { getToastStore } from '@skeletonlabs/skeleton';
34
+ // const x = getToastStore();
@@ -7,8 +7,9 @@ import type {
7
7
  } from '$models/Models';
8
8
  import type { MenuModel, breadcrumbItemType } from '$models/Page';
9
9
  import { BreadcrumbModel } from '$models/Page';
10
- import { toastStore, type ToastSettings } from '@skeletonlabs/skeleton';
11
- import { writable, type Writable } from 'svelte/store';
10
+
11
+
12
+ import { writable } from 'svelte/store';
12
13
 
13
14
  function createHelpStore() {
14
15
  // set Store Type
@@ -112,17 +113,16 @@ function createBreadcrumbStore() {
112
113
  },
113
114
 
114
115
  updateItem: (item: breadcrumbItemType) => {
115
-
116
116
  let b: BreadcrumbModel;
117
117
  breadcrumbStore.subscribe((value) => {
118
118
  value = value === undefined ? new BreadcrumbModel() : value;
119
-
120
- let v = value.items.find((i) => i.link === item.link)
121
- console.log(value.items,v);
122
-
119
+
120
+ let v = value.items.find((i) => i.link === item.link);
121
+ console.log(value.items, v);
122
+
123
123
  if (v) {
124
124
  const i = value.items.indexOf(v);
125
- value.items[i]=item
125
+ value.items[i] = item;
126
126
  v = item;
127
127
  }
128
128
 
@@ -133,7 +133,6 @@ function createBreadcrumbStore() {
133
133
  },
134
134
 
135
135
  clean: () => {
136
-
137
136
  breadcrumbStore.set(new BreadcrumbModel());
138
137
 
139
138
  //update((s) => (s = b));
@@ -182,59 +181,18 @@ function createNotificationStore() {
182
181
  message: notificationItem.message,
183
182
  btnStyle: btnStyle
184
183
  });
185
- notificationStore.subscribe((value) => {});
184
+ notificationStore.subscribe((value) => {""});
186
185
  },
187
186
 
188
- // triggers the notification to show
189
- triggerNotification: () => {
190
- let timeout: number = 30000;
191
- let classes: string = '';
192
- let message: string = '';
193
- notificationStore.subscribe((value) => {
194
- switch (value.notificationType) {
195
- case notificationType.success:
196
- classes =
197
- 'bg-success-300 border-solid border-2 border-success-500 shadow-md text-surface-900';
198
- break;
199
- case notificationType.warning:
200
- classes =
201
- 'bg-warning-300 border-solid border-2 border-warning-500 shadow-md text-surface-900';
202
- break;
203
- case notificationType.error:
204
- classes =
205
- 'bg-error-300 border-solid border-2 border-error-500 shadow-md text-surface-900';
206
- break;
207
- case notificationType.surface:
208
- classes =
209
- 'bg-surface-300 border-solid border-2 border-surface-500 shadow-md text-surface-900';
210
- break;
211
- }
212
-
213
- message = value.message;
214
- });
215
- if (classes != '' && message != '') {
216
- const notificationToast: ToastSettings = {
217
- classes: classes,
218
- message: message,
219
- timeout: timeout
220
- };
221
- toastStore.trigger(notificationToast);
222
- }
223
- },
224
-
225
- // cleans the toastStore
226
- clear: () => {
227
- toastStore.clear();
228
- },
229
187
 
230
188
  // cleans, sets, and schows the notification (all you need ;))
231
189
  showNotification: (notificationItem: notificationItemType) => {
232
- notificationStore.clear();
190
+ //notificationStore.clear();
233
191
  notificationStore.setNotification({
234
192
  notificationType: notificationItem.notificationType,
235
193
  message: notificationItem.message
236
194
  });
237
- notificationStore.triggerNotification();
195
+ // if the store is changing, the notification componend will be updated
238
196
  },
239
197
 
240
198
  // gets the dissmiss Button style
@@ -0,0 +1,103 @@
1
+
2
+ import type { CustomThemeConfig } from '@skeletonlabs/tw-plugin';
3
+
4
+ export const bexis2theme: CustomThemeConfig = {
5
+ name: 'bexis2theme',
6
+ properties: {
7
+ // =~= Theme Properties =~=
8
+ "--theme-font-family-base": `system-ui`,
9
+ "--theme-font-family-heading": `system-ui`,
10
+ "--theme-font-color-base": "var(--color-surface-900)",
11
+ "--theme-font-color-dark": "255 255 255",
12
+ "--theme-rounded-base": "4px",
13
+ "--theme-rounded-container": "4px",
14
+ "--theme-border-base": "1px",
15
+ // =~= Theme On-X Colors =~=
16
+ "--on-primary": "255 255 255",
17
+ "--on-secondary": "255 255 255",
18
+ "--on-tertiary": "0 0 0",
19
+ "--on-success": "255 255 255",
20
+ "--on-warning": "255 255 255",
21
+ "--on-error": "255 255 255",
22
+ "--on-surface": "255 255 255",
23
+ // =~= Theme Colors =~=
24
+ // primary | #45b2a1
25
+ "--color-primary-50": "227 243 241", // #e3f3f1
26
+ "--color-primary-100": "218 240 236", // #daf0ec
27
+ "--color-primary-200": "209 236 232", // #d1ece8
28
+ "--color-primary-300": "181 224 217", // #b5e0d9
29
+ "--color-primary-400": "125 201 189", // #7dc9bd
30
+ "--color-primary-500": "69 178 161", // #45b2a1
31
+ "--color-primary-600": "62 160 145", // #3ea091
32
+ "--color-primary-700": "52 134 121", // #348679
33
+ "--color-primary-800": "41 107 97", // #296b61
34
+ "--color-primary-900": "34 87 79", // #22574f
35
+ // secondary | #ff9700
36
+ "--color-secondary-50": "255 239 217", // #ffefd9
37
+ "--color-secondary-100": "255 234 204", // #ffeacc
38
+ "--color-secondary-200": "255 229 191", // #ffe5bf
39
+ "--color-secondary-300": "255 213 153", // #ffd599
40
+ "--color-secondary-400": "255 182 77", // #ffb64d
41
+ "--color-secondary-500": "255 151 0", // #ff9700
42
+ "--color-secondary-600": "230 136 0", // #e68800
43
+ "--color-secondary-700": "191 113 0", // #bf7100
44
+ "--color-secondary-800": "153 91 0", // #995b00
45
+ "--color-secondary-900": "125 74 0", // #7d4a00
46
+ // tertiary | #bee1da
47
+ "--color-tertiary-50": "245 251 249", // #f5fbf9
48
+ "--color-tertiary-100": "242 249 248", // #f2f9f8
49
+ "--color-tertiary-200": "239 248 246", // #eff8f6
50
+ "--color-tertiary-300": "229 243 240", // #e5f3f0
51
+ "--color-tertiary-400": "210 234 229", // #d2eae5
52
+ "--color-tertiary-500": "190 225 218", // #bee1da
53
+ "--color-tertiary-600": "171 203 196", // #abcbc4
54
+ "--color-tertiary-700": "143 169 164", // #8fa9a4
55
+ "--color-tertiary-800": "114 135 131", // #728783
56
+ "--color-tertiary-900": "93 110 107", // #5d6e6b
57
+ // success | #4BB543
58
+ "--color-success-50": "228 244 227", // #e4f4e3
59
+ "--color-success-100": "219 240 217", // #dbf0d9
60
+ "--color-success-200": "210 237 208", // #d2edd0
61
+ "--color-success-300": "183 225 180", // #b7e1b4
62
+ "--color-success-400": "129 203 123", // #81cb7b
63
+ "--color-success-500": "75 181 67", // #4BB543
64
+ "--color-success-600": "68 163 60", // #44a33c
65
+ "--color-success-700": "56 136 50", // #388832
66
+ "--color-success-800": "45 109 40", // #2d6d28
67
+ "--color-success-900": "37 89 33", // #255921
68
+ // warning | #EAB308
69
+ "--color-warning-50": "252 244 218", // #fcf4da
70
+ "--color-warning-100": "251 240 206", // #fbf0ce
71
+ "--color-warning-200": "250 236 193", // #faecc1
72
+ "--color-warning-300": "247 225 156", // #f7e19c
73
+ "--color-warning-400": "240 202 82", // #f0ca52
74
+ "--color-warning-500": "234 179 8", // #EAB308
75
+ "--color-warning-600": "211 161 7", // #d3a107
76
+ "--color-warning-700": "176 134 6", // #b08606
77
+ "--color-warning-800": "140 107 5", // #8c6b05
78
+ "--color-warning-900": "115 88 4", // #735804
79
+ // error | #FF0000
80
+ "--color-error-50": "255 217 217", // #ffd9d9
81
+ "--color-error-100": "255 204 204", // #ffcccc
82
+ "--color-error-200": "255 191 191", // #ffbfbf
83
+ "--color-error-300": "255 153 153", // #ff9999
84
+ "--color-error-400": "255 77 77", // #ff4d4d
85
+ "--color-error-500": "255 0 0", // #FF0000
86
+ "--color-error-600": "230 0 0", // #e60000
87
+ "--color-error-700": "191 0 0", // #bf0000
88
+ "--color-error-800": "153 0 0", // #990000
89
+ "--color-error-900": "125 0 0", // #7d0000
90
+ // surface | #c7c7c7
91
+ "--color-surface-50": "247 247 247", // #f7f7f7
92
+ "--color-surface-100": "244 244 244", // #f4f4f4
93
+ "--color-surface-200": "241 241 241", // #f1f1f1
94
+ "--color-surface-300": "233 233 233", // #e9e9e9
95
+ "--color-surface-400": "216 216 216", // #d8d8d8
96
+ "--color-surface-500": "199 199 199", // #c7c7c7
97
+ "--color-surface-600": "179 179 179", // #b3b3b3
98
+ "--color-surface-700": "149 149 149", // #959595
99
+ "--color-surface-800": "119 119 119", // #777777
100
+ "--color-surface-900": "98 98 98", // #626262
101
+
102
+ }
103
+ }