@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.
@@ -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].value);
52
+ target.push(selection[i]);
51
53
  }
52
54
  }
53
55
 
@@ -74,72 +76,73 @@
74
76
  }
75
77
 
76
78
  onMount(async () => {
77
- setValue(target);
79
+ setValue(target);
78
80
  });
79
81
 
80
- function setValue(t)
81
- {
82
- //a) source is complex model is simple
83
- if (complexSource && !complexTarget && isMulti) {
84
- let items = [];
85
- // event.detail will be null unless isMulti is true and user has removed a single item
86
- for (let i in t) {
87
- let t = target[i];
88
- items.push(source.find((item) => item[itemId] === t));
89
- }
90
-
91
- isLoaded = true;
92
- if (items.length > 0) {
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
- if (complexSource && complexTarget && isMulti) {
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
- isLoaded = true;
102
- groupBy = (item) => item[itemGroup];
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
- //b) simple liust and simple model
106
- if (!complexSource && !complexTarget && isMulti) {
107
- ////console.log("source", source);
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 (!isMulti) {
117
- //console.log("onmount",complexSource,complexTarget,value,target)
118
- if (!complexSource && !complexTarget) {
119
- value = {
120
- value: t,
121
- label: t
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>
@@ -17,7 +17,6 @@
17
17
  let hamburger = true;
18
18
  </script>
19
19
 
20
-
21
20
  {#if $menuStore !== undefined}
22
21
  <div
23
22
  class="sm:flex h-min flex-row w-full justify-between items-center md:flex px-3 py-2 bg-tertiary-50 text-surface-800 z-50 shadow-md"
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
- //Form
34
- export {
35
- Checkbox,
36
- CheckboxKVPList,
37
- CheckboxList,
38
- DateInput,
39
- DropdownKVP,
40
- MultiSelect,
41
- NumberInput,
42
- TextArea,
43
- TextInput
44
- };
45
-
46
- //File
47
- export { FileInfo, FileIcon, FileUploader };
48
-
49
- //others
50
- export { Spinner, Page, Alert, Menu, ErrorMessage };
51
-
52
- //Api
53
- export { Api } from './services/Api.js';
54
- export { host, username, password, setApiConfig } from './stores/apiStores.js';
55
-
56
- //Type
57
- export type {
58
- userType,
59
- inputType,
60
- fileUploaderType,
61
- linkType,
62
- listItemType,
63
- keyValuePairType,
64
- fileInfoType,
65
- fileReaderInfoType,
66
- asciiFileReaderInfoType
67
- } from './models/Models.js';
68
-
69
- //help
70
- export { helpStore } from '$store/pageStores';
71
- export type { helpStoreType, helpItemType } from './models/Models';
72
-
73
- //enum
74
- export { positionType, pageContentLayoutType,decimalCharacterType,orientationType,textMarkerType,textSeperatorType } from './models/Enums';
75
-
76
- // Table
77
- export { Table, TableFilter, columnFilter, searchFilter };
78
- export type { TableConfig, Columns, Column };
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 };
@@ -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
+ }
@@ -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 {decimalCharacterType, orientationType,textMarkerType,textSeperatorType} from './Enums'
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
+ }