@bexis2/bexis2-core-ui 0.2.10 → 0.2.12

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.
Files changed (86) hide show
  1. package/README.md +263 -207
  2. package/dist/components/Table/Table.svelte +85 -85
  3. package/dist/components/Table/TableFilter.svelte +109 -109
  4. package/dist/components/Table/TablePagination.svelte +38 -38
  5. package/dist/components/file/FileUploader.svelte +34 -34
  6. package/dist/components/form/Checkbox.svelte.d.ts +1 -1
  7. package/dist/components/form/DropdownKvP.svelte +5 -11
  8. package/dist/components/form/InputContainer.svelte +20 -19
  9. package/dist/components/form/MultiSelect.svelte +163 -178
  10. package/dist/components/form/TextArea.svelte +13 -13
  11. package/dist/components/form/TextInput.svelte +0 -2
  12. package/dist/components/page/Alert.svelte +28 -30
  13. package/dist/components/page/BackToTop.svelte +30 -30
  14. package/dist/components/page/Docs.svelte +22 -19
  15. package/dist/components/page/Docs.svelte.d.ts +1 -1
  16. package/dist/components/page/ErrorMessage.svelte +9 -0
  17. package/dist/components/page/ErrorMessage.svelte.d.ts +16 -0
  18. package/dist/components/page/Footer.svelte +5 -5
  19. package/dist/components/page/Header.svelte +5 -4
  20. package/dist/components/page/HelpPopUp.svelte +31 -25
  21. package/dist/components/page/HelpPopUp.svelte.d.ts +5 -12
  22. package/dist/components/page/Page.svelte +56 -66
  23. package/dist/components/page/Page.svelte.d.ts +2 -2
  24. package/dist/components/page/PageCaller.js +19 -21
  25. package/dist/components/page/Spinner.svelte +12 -13
  26. package/dist/components/page/Spinner.svelte.d.ts +1 -1
  27. package/dist/components/page/breadcrumb/Breadcrumb.svelte +19 -23
  28. package/dist/components/page/menu/Menu.svelte +25 -25
  29. package/dist/components/page/menu/MenuBar.svelte +7 -14
  30. package/dist/components/page/menu/MenuBar.svelte.d.ts +2 -2
  31. package/dist/components/page/menu/MenuDataCaller.js +10 -11
  32. package/dist/components/page/menu/MenuItem.svelte +9 -13
  33. package/dist/components/page/menu/MenuItem.svelte.d.ts +2 -1
  34. package/dist/components/page/menu/MenuSublist.svelte +18 -17
  35. package/dist/components/page/menu/MenuSublist.svelte.d.ts +2 -2
  36. package/dist/components/page/menu/SettingsBar.svelte +9 -14
  37. package/dist/components/page/menu/SettingsBar.svelte.d.ts +2 -2
  38. package/dist/css/core.ui.postcss +10 -7
  39. package/dist/css/themes/theme-bexis2.css +12 -13
  40. package/dist/index.d.ts +2 -3
  41. package/dist/index.js +5 -4
  42. package/dist/models/Models.js +0 -1
  43. package/dist/models/Page.d.ts +31 -0
  44. package/dist/services/BaseCaller.js +16 -21
  45. package/dist/stores/pageStores.d.ts +4 -4
  46. package/dist/stores/pageStores.js +27 -27
  47. package/package.json +2 -2
  48. package/src/lib/components/Table/Table.svelte +246 -246
  49. package/src/lib/components/Table/TableFilter.svelte +222 -222
  50. package/src/lib/components/Table/TablePagination.svelte +61 -61
  51. package/src/lib/components/Table/filter.ts +141 -141
  52. package/src/lib/components/file/FileUploader.svelte +184 -184
  53. package/src/lib/components/form/Checkbox.svelte +1 -1
  54. package/src/lib/components/form/DateInput.svelte +0 -1
  55. package/src/lib/components/form/DropdownKvP.svelte +5 -11
  56. package/src/lib/components/form/InputContainer.svelte +36 -44
  57. package/src/lib/components/form/MultiSelect.svelte +163 -178
  58. package/src/lib/components/form/NumberInput.svelte +3 -5
  59. package/src/lib/components/form/TextArea.svelte +26 -27
  60. package/src/lib/components/form/TextInput.svelte +2 -5
  61. package/src/lib/components/page/Alert.svelte +41 -45
  62. package/src/lib/components/page/BackToTop.svelte +30 -30
  63. package/src/lib/components/page/Docs.svelte +46 -44
  64. package/src/lib/components/page/ErrorMessage.svelte +10 -0
  65. package/src/lib/components/page/Footer.svelte +18 -22
  66. package/src/lib/components/page/Header.svelte +18 -21
  67. package/src/lib/components/page/HelpPopUp.svelte +72 -66
  68. package/src/lib/components/page/Page.svelte +96 -108
  69. package/src/lib/components/page/PageCaller.js +19 -21
  70. package/src/lib/components/page/Spinner.svelte +14 -16
  71. package/src/lib/components/page/breadcrumb/Breadcrumb.svelte +31 -43
  72. package/src/lib/components/page/menu/Menu.svelte +40 -47
  73. package/src/lib/components/page/menu/MenuBar.svelte +20 -31
  74. package/src/lib/components/page/menu/MenuDataCaller.js +10 -11
  75. package/src/lib/components/page/menu/MenuItem.svelte +27 -33
  76. package/src/lib/components/page/menu/MenuSublist.svelte +43 -48
  77. package/src/lib/components/page/menu/SettingsBar.svelte +31 -40
  78. package/src/lib/css/core.ui.postcss +10 -7
  79. package/src/lib/css/themes/theme-bexis2.css +12 -13
  80. package/src/lib/index.ts +75 -76
  81. package/src/lib/models/Enums.ts +10 -11
  82. package/src/lib/models/Models.ts +113 -113
  83. package/src/lib/models/Page.ts +40 -41
  84. package/src/lib/services/BaseCaller.js +16 -21
  85. package/src/lib/stores/apiStores.ts +31 -32
  86. package/src/lib/stores/pageStores.ts +121 -126
@@ -1,222 +1,222 @@
1
- <script lang="ts">
2
- import Fa from 'svelte-fa/src/fa.svelte';
3
- import { faFilter } from '@fortawesome/free-solid-svg-icons';
4
- import { popup } from '@skeletonlabs/skeleton';
5
- import type { PopupSettings } from '@skeletonlabs/skeleton';
6
-
7
- export let filterValue;
8
- export let values;
9
- export let id;
10
- export let tableId;
11
- export let toFilterableValueFn: undefined | ((value: any) => any) = undefined;
12
-
13
- let firstOption;
14
- let firstValue;
15
- let secondOption;
16
- let secondValue;
17
- let active = false;
18
-
19
- const options = {
20
- number: [
21
- {
22
- value: 'isequal',
23
- label: 'Is equal to'
24
- },
25
- {
26
- value: 'isgreaterorequal',
27
- label: 'Is greater than or equal to'
28
- },
29
- {
30
- value: 'isgreater',
31
- label: 'Is greater than'
32
- },
33
- {
34
- value: 'islessorequal',
35
- label: 'Is less than or equal to'
36
- },
37
- {
38
- value: 'isless',
39
- label: 'Is less than'
40
- },
41
- {
42
- value: 'isnotequal',
43
- label: 'Is not equal to'
44
- }
45
- ],
46
- string: [
47
- {
48
- value: 'isequal',
49
- label: 'Is equal to'
50
- },
51
- {
52
- value: 'isnotequal',
53
- label: 'Is not equal to'
54
- },
55
- {
56
- value: 'starts',
57
- label: 'Starts with'
58
- },
59
- {
60
- value: 'contains',
61
- label: 'Contains'
62
- },
63
- {
64
- value: 'notcontains',
65
- label: 'Does not contain'
66
- },
67
- {
68
- value: 'ends',
69
- label: 'Ends with'
70
- }
71
- ],
72
- date: [
73
- {
74
- value: 'ison',
75
- label: 'Is on'
76
- },
77
- {
78
- value: 'isstartingfrom',
79
- label: 'Is starting from'
80
- },
81
- {
82
- value: 'isafter',
83
- label: 'Is after'
84
- },
85
- {
86
- value: 'isuntil',
87
- label: 'Is until'
88
- },
89
- {
90
- value: 'isbefore',
91
- label: 'Is before'
92
- },
93
- {
94
- value: 'isnoton',
95
- label: 'Is not on'
96
- }
97
- ]
98
- };
99
-
100
- const popupId = `${tableId}-${id}`;
101
-
102
- const popupFeatured: PopupSettings = {
103
- event: 'click',
104
- target: popupId,
105
- placement: 'bottom-start'
106
- };
107
-
108
- let type: string = typeof (toFilterableValueFn ? toFilterableValueFn($values[0]) : $values[0]);
109
- if (type === 'object') {
110
- if ($values[0] instanceof Date) {
111
- type = 'date';
112
- }
113
- }
114
- </script>
115
-
116
- <form class="">
117
- <button
118
- class:variant-filled-primary={active}
119
- class="btn w-max p-2"
120
- type="button"
121
- use:popup={popupFeatured}
122
- >
123
- <Fa icon={faFilter} size="12" />
124
- </button>
125
-
126
- <div data-popup={`${popupId}`}>
127
- <div class="card p-3 absolute grid gap-2 shadow-lg z-10 w-min bg-base-100">
128
- <button
129
- class="btn variant-filled-primary btn-sm"
130
- type="button"
131
- on:click|preventDefault={() => {
132
- firstOption = 'isequal';
133
- firstValue = undefined;
134
- secondOption = 'isequal';
135
- secondValue = undefined;
136
-
137
- $filterValue = [firstOption, firstValue, secondOption, secondValue];
138
- active = false;
139
- }}>Clear Filter</button
140
- >
141
-
142
- <label for="" class="label normal-case text-sm">Show rows with value that</label>
143
- <div class="grid gap-2 w-full">
144
- <select
145
- class="select border border-primary-500 text-sm p-1"
146
- aria-label="Show rows with value that"
147
- bind:value={firstOption}
148
- on:click|stopPropagation
149
- >
150
- {#each options[type] as option (option)}
151
- <option value={option.value}>{option.label}</option>
152
- {/each}
153
- </select>
154
- {#if type === 'number'}
155
- <input
156
- type="number"
157
- class="input p-1 border border-primary-500"
158
- bind:value={firstValue}
159
- on:click|stopPropagation
160
- />
161
- {:else if type === 'string'}
162
- <input
163
- type="text"
164
- class="input p-1 border border-primary-500"
165
- bind:value={firstValue}
166
- on:click|stopPropagation
167
- />
168
- {:else}
169
- <input
170
- type="date"
171
- class="input p-1 border border-primary-500"
172
- bind:value={firstValue}
173
- on:click|stopPropagation
174
- />
175
- {/if}
176
- </div>
177
- <label for="" class="label normal-case">And</label>
178
- <div class="grid gap-2 w-max">
179
- <select
180
- class="select border border-primary-500 text-sm p-1"
181
- aria-label="Show rows with value that"
182
- bind:value={secondOption}
183
- on:click|stopPropagation
184
- >
185
- {#each options[type] as option (option)}
186
- <option value={option.value}>{option.label}</option>
187
- {/each}
188
- </select>
189
- {#if type === 'number'}
190
- <input
191
- type="number"
192
- class="input p-1 border border-primary-500"
193
- bind:value={secondValue}
194
- on:click|stopPropagation
195
- />
196
- {:else if type === 'string'}
197
- <input
198
- type="text"
199
- class="input p-1 border border-primary-500"
200
- bind:value={secondValue}
201
- on:click|stopPropagation
202
- />
203
- {:else}
204
- <input
205
- type="date"
206
- class="input p-1 border border-primary-500"
207
- bind:value={secondValue}
208
- on:click|stopPropagation
209
- />
210
- {/if}
211
- </div>
212
- <button
213
- class="btn variant-filled-primary btn-sm"
214
- type="button"
215
- on:click|preventDefault={() => {
216
- active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
217
- $filterValue = [firstOption, firstValue, secondOption, secondValue];
218
- }}>Apply</button
219
- >
220
- </div>
221
- </div>
222
- </form>
1
+ <script lang="ts">
2
+ import Fa from 'svelte-fa/src/fa.svelte';
3
+ import { faFilter } from '@fortawesome/free-solid-svg-icons';
4
+ import { popup } from '@skeletonlabs/skeleton';
5
+ import type { PopupSettings } from '@skeletonlabs/skeleton';
6
+
7
+ export let filterValue;
8
+ export let values;
9
+ export let id;
10
+ export let tableId;
11
+ export let toFilterableValueFn: undefined | ((value: any) => any) = undefined;
12
+
13
+ let firstOption;
14
+ let firstValue;
15
+ let secondOption;
16
+ let secondValue;
17
+ let active = false;
18
+
19
+ const options = {
20
+ number: [
21
+ {
22
+ value: 'isequal',
23
+ label: 'Is equal to'
24
+ },
25
+ {
26
+ value: 'isgreaterorequal',
27
+ label: 'Is greater than or equal to'
28
+ },
29
+ {
30
+ value: 'isgreater',
31
+ label: 'Is greater than'
32
+ },
33
+ {
34
+ value: 'islessorequal',
35
+ label: 'Is less than or equal to'
36
+ },
37
+ {
38
+ value: 'isless',
39
+ label: 'Is less than'
40
+ },
41
+ {
42
+ value: 'isnotequal',
43
+ label: 'Is not equal to'
44
+ }
45
+ ],
46
+ string: [
47
+ {
48
+ value: 'isequal',
49
+ label: 'Is equal to'
50
+ },
51
+ {
52
+ value: 'isnotequal',
53
+ label: 'Is not equal to'
54
+ },
55
+ {
56
+ value: 'starts',
57
+ label: 'Starts with'
58
+ },
59
+ {
60
+ value: 'contains',
61
+ label: 'Contains'
62
+ },
63
+ {
64
+ value: 'notcontains',
65
+ label: 'Does not contain'
66
+ },
67
+ {
68
+ value: 'ends',
69
+ label: 'Ends with'
70
+ }
71
+ ],
72
+ date: [
73
+ {
74
+ value: 'ison',
75
+ label: 'Is on'
76
+ },
77
+ {
78
+ value: 'isstartingfrom',
79
+ label: 'Is starting from'
80
+ },
81
+ {
82
+ value: 'isafter',
83
+ label: 'Is after'
84
+ },
85
+ {
86
+ value: 'isuntil',
87
+ label: 'Is until'
88
+ },
89
+ {
90
+ value: 'isbefore',
91
+ label: 'Is before'
92
+ },
93
+ {
94
+ value: 'isnoton',
95
+ label: 'Is not on'
96
+ }
97
+ ]
98
+ };
99
+
100
+ const popupId = `${tableId}-${id}`;
101
+
102
+ const popupFeatured: PopupSettings = {
103
+ event: 'click',
104
+ target: popupId,
105
+ placement: 'bottom-start'
106
+ };
107
+
108
+ let type: string = typeof (toFilterableValueFn ? toFilterableValueFn($values[0]) : $values[0]);
109
+ if (type === 'object') {
110
+ if ($values[0] instanceof Date) {
111
+ type = 'date';
112
+ }
113
+ }
114
+ </script>
115
+
116
+ <form class="">
117
+ <button
118
+ class:variant-filled-primary={active}
119
+ class="btn w-max p-2"
120
+ type="button"
121
+ use:popup={popupFeatured}
122
+ >
123
+ <Fa icon={faFilter} size="12" />
124
+ </button>
125
+
126
+ <div data-popup={`${popupId}`}>
127
+ <div class="card p-3 absolute grid gap-2 shadow-lg z-10 w-min bg-base-100">
128
+ <button
129
+ class="btn variant-filled-primary btn-sm"
130
+ type="button"
131
+ on:click|preventDefault={() => {
132
+ firstOption = 'isequal';
133
+ firstValue = undefined;
134
+ secondOption = 'isequal';
135
+ secondValue = undefined;
136
+
137
+ $filterValue = [firstOption, firstValue, secondOption, secondValue];
138
+ active = false;
139
+ }}>Clear Filter</button
140
+ >
141
+
142
+ <label for="" class="label normal-case text-sm">Show rows with value that</label>
143
+ <div class="grid gap-2 w-full">
144
+ <select
145
+ class="select border border-primary-500 text-sm p-1"
146
+ aria-label="Show rows with value that"
147
+ bind:value={firstOption}
148
+ on:click|stopPropagation
149
+ >
150
+ {#each options[type] as option (option)}
151
+ <option value={option.value}>{option.label}</option>
152
+ {/each}
153
+ </select>
154
+ {#if type === 'number'}
155
+ <input
156
+ type="number"
157
+ class="input p-1 border border-primary-500"
158
+ bind:value={firstValue}
159
+ on:click|stopPropagation
160
+ />
161
+ {:else if type === 'string'}
162
+ <input
163
+ type="text"
164
+ class="input p-1 border border-primary-500"
165
+ bind:value={firstValue}
166
+ on:click|stopPropagation
167
+ />
168
+ {:else}
169
+ <input
170
+ type="date"
171
+ class="input p-1 border border-primary-500"
172
+ bind:value={firstValue}
173
+ on:click|stopPropagation
174
+ />
175
+ {/if}
176
+ </div>
177
+ <label for="" class="label normal-case">And</label>
178
+ <div class="grid gap-2 w-max">
179
+ <select
180
+ class="select border border-primary-500 text-sm p-1"
181
+ aria-label="Show rows with value that"
182
+ bind:value={secondOption}
183
+ on:click|stopPropagation
184
+ >
185
+ {#each options[type] as option (option)}
186
+ <option value={option.value}>{option.label}</option>
187
+ {/each}
188
+ </select>
189
+ {#if type === 'number'}
190
+ <input
191
+ type="number"
192
+ class="input p-1 border border-primary-500"
193
+ bind:value={secondValue}
194
+ on:click|stopPropagation
195
+ />
196
+ {:else if type === 'string'}
197
+ <input
198
+ type="text"
199
+ class="input p-1 border border-primary-500"
200
+ bind:value={secondValue}
201
+ on:click|stopPropagation
202
+ />
203
+ {:else}
204
+ <input
205
+ type="date"
206
+ class="input p-1 border border-primary-500"
207
+ bind:value={secondValue}
208
+ on:click|stopPropagation
209
+ />
210
+ {/if}
211
+ </div>
212
+ <button
213
+ class="btn variant-filled-primary btn-sm"
214
+ type="button"
215
+ on:click|preventDefault={() => {
216
+ active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
217
+ $filterValue = [firstOption, firstValue, secondOption, secondValue];
218
+ }}>Apply</button
219
+ >
220
+ </div>
221
+ </div>
222
+ </form>
@@ -1,61 +1,61 @@
1
- <script lang="ts">
2
- import Fa from 'svelte-fa/src/fa.svelte';
3
- import {
4
- faAnglesRight,
5
- faAngleRight,
6
- faAnglesLeft,
7
- faAngleLeft
8
- } from '@fortawesome/free-solid-svg-icons';
9
-
10
- export let pageConfig;
11
- export let pageSizes;
12
-
13
- const { pageIndex, pageCount, pageSize, hasNextPage, hasPreviousPage } = pageConfig;
14
-
15
- const goToFirstPage = () => ($pageIndex = 0);
16
- const goToLastPage = () => ($pageIndex = $pageCount - 1);
17
- const goToNextPage = () => ($pageIndex += 1);
18
- const goToPreviousPage = () => ($pageIndex -= 1);
19
-
20
- $: goToFirstPageDisabled = !$pageIndex;
21
- $: goToLastPageDisabled = $pageIndex == $pageCount - 1;
22
- $: goToNextPageDisabled = !$hasNextPage;
23
- $: goToPreviousPageDisabled = !$hasPreviousPage;
24
- </script>
25
-
26
- <div class="flex justify-center gap-1">
27
- <button
28
- class="btn btn-sm variant-filled-primary"
29
- on:click|preventDefault={goToFirstPage}
30
- disabled={goToFirstPageDisabled}
31
- >
32
- <Fa icon={faAnglesLeft} /></button
33
- >
34
- <button
35
- class="btn btn-sm variant-filled-primary"
36
- on:click|preventDefault={goToPreviousPage}
37
- disabled={goToPreviousPageDisabled}><Fa icon={faAngleLeft} /></button
38
- >
39
-
40
- <select
41
- name="pageSize"
42
- id="pageSize"
43
- class="select variant-filled-primary w-min font-bold"
44
- bind:value={$pageSize}
45
- >
46
- {#each pageSizes as size}
47
- <option value={size}>{size}</option>
48
- {/each}
49
- </select>
50
-
51
- <button
52
- class="btn btn-sm variant-filled-primary"
53
- on:click|preventDefault={goToNextPage}
54
- disabled={goToNextPageDisabled}><Fa icon={faAngleRight} /></button
55
- >
56
- <button
57
- class="btn btn-sm variant-filled-primary"
58
- on:click|preventDefault={goToLastPage}
59
- disabled={goToLastPageDisabled}><Fa icon={faAnglesRight} /></button
60
- >
61
- </div>
1
+ <script lang="ts">
2
+ import Fa from 'svelte-fa/src/fa.svelte';
3
+ import {
4
+ faAnglesRight,
5
+ faAngleRight,
6
+ faAnglesLeft,
7
+ faAngleLeft
8
+ } from '@fortawesome/free-solid-svg-icons';
9
+
10
+ export let pageConfig;
11
+ export let pageSizes;
12
+
13
+ const { pageIndex, pageCount, pageSize, hasNextPage, hasPreviousPage } = pageConfig;
14
+
15
+ const goToFirstPage = () => ($pageIndex = 0);
16
+ const goToLastPage = () => ($pageIndex = $pageCount - 1);
17
+ const goToNextPage = () => ($pageIndex += 1);
18
+ const goToPreviousPage = () => ($pageIndex -= 1);
19
+
20
+ $: goToFirstPageDisabled = !$pageIndex;
21
+ $: goToLastPageDisabled = $pageIndex == $pageCount - 1;
22
+ $: goToNextPageDisabled = !$hasNextPage;
23
+ $: goToPreviousPageDisabled = !$hasPreviousPage;
24
+ </script>
25
+
26
+ <div class="flex justify-center gap-1">
27
+ <button
28
+ class="btn btn-sm variant-filled-primary"
29
+ on:click|preventDefault={goToFirstPage}
30
+ disabled={goToFirstPageDisabled}
31
+ >
32
+ <Fa icon={faAnglesLeft} /></button
33
+ >
34
+ <button
35
+ class="btn btn-sm variant-filled-primary"
36
+ on:click|preventDefault={goToPreviousPage}
37
+ disabled={goToPreviousPageDisabled}><Fa icon={faAngleLeft} /></button
38
+ >
39
+
40
+ <select
41
+ name="pageSize"
42
+ id="pageSize"
43
+ class="select variant-filled-primary w-min font-bold"
44
+ bind:value={$pageSize}
45
+ >
46
+ {#each pageSizes as size}
47
+ <option value={size}>{size}</option>
48
+ {/each}
49
+ </select>
50
+
51
+ <button
52
+ class="btn btn-sm variant-filled-primary"
53
+ on:click|preventDefault={goToNextPage}
54
+ disabled={goToNextPageDisabled}><Fa icon={faAngleRight} /></button
55
+ >
56
+ <button
57
+ class="btn btn-sm variant-filled-primary"
58
+ on:click|preventDefault={goToLastPage}
59
+ disabled={goToLastPageDisabled}><Fa icon={faAnglesRight} /></button
60
+ >
61
+ </div>