@bexis2/bexis2-core-ui 0.4.18 → 0.4.20
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 +16 -8
- package/dist/components/CodeEditor/CodeEditor.svelte +4 -0
- package/dist/components/Facets/Facets.svelte +57 -20
- package/dist/components/Facets/Facets.svelte.d.ts +5 -1
- package/dist/components/Facets/ShowMore.svelte +31 -18
- package/dist/components/Facets/ShowMore.svelte.d.ts +2 -2
- package/dist/components/File/FileUploader.svelte +1 -1
- package/dist/components/Table/ColumnsMenu.svelte +5 -0
- package/dist/components/Table/TableContent.svelte +32 -16
- package/dist/components/Table/TableFilter.svelte +12 -0
- package/dist/components/Table/TableFilterServer.svelte +13 -1
- package/dist/components/Table/TablePagination.svelte +11 -6
- package/dist/components/Table/TablePaginationServer.svelte +8 -0
- package/dist/components/form/Checkbox.svelte +1 -1
- package/dist/components/form/CheckboxKvPList.svelte +2 -1
- package/dist/components/form/CheckboxList.svelte +2 -2
- package/dist/components/form/DateInput.svelte +1 -1
- package/dist/components/form/DropdownKvP.svelte +1 -1
- package/dist/components/form/InputContainer.svelte +7 -1
- package/dist/components/form/MultiSelect.svelte +100 -106
- package/dist/components/form/NumberInput.svelte +1 -1
- package/dist/components/form/TextArea.svelte +1 -1
- package/dist/components/form/TextInput.svelte +1 -1
- package/dist/components/page/Alert.svelte +1 -1
- package/dist/components/page/BackToTop.svelte +1 -1
- package/dist/components/page/Docs.svelte +1 -1
- package/dist/components/page/GoToTop.svelte +1 -0
- package/dist/components/page/HelpPopUp.svelte +1 -0
- package/dist/components/page/Page.svelte +14 -19
- package/dist/components/page/menu/MenuSublist.svelte +7 -5
- package/package.json +114 -114
- package/src/lib/components/CodeEditor/CodeEditor.svelte +4 -0
- package/src/lib/components/Facets/Facets.svelte +74 -25
- package/src/lib/components/Facets/ShowMore.svelte +33 -19
- package/src/lib/components/File/FileUploader.svelte +1 -1
- package/src/lib/components/Table/ColumnsMenu.svelte +5 -0
- package/src/lib/components/Table/TableContent.svelte +32 -16
- package/src/lib/components/Table/TableFilter.svelte +12 -0
- package/src/lib/components/Table/TableFilterServer.svelte +13 -1
- package/src/lib/components/Table/TablePagination.svelte +11 -6
- package/src/lib/components/Table/TablePaginationServer.svelte +8 -0
- package/src/lib/components/form/Checkbox.svelte +1 -1
- package/src/lib/components/form/CheckboxKvPList.svelte +2 -1
- package/src/lib/components/form/CheckboxList.svelte +2 -2
- package/src/lib/components/form/DateInput.svelte +1 -1
- package/src/lib/components/form/DropdownKvP.svelte +1 -1
- package/src/lib/components/form/InputContainer.svelte +7 -1
- package/src/lib/components/form/MultiSelect.svelte +100 -106
- package/src/lib/components/form/NumberInput.svelte +1 -1
- package/src/lib/components/form/TextArea.svelte +1 -1
- package/src/lib/components/form/TextInput.svelte +1 -1
- package/src/lib/components/page/Alert.svelte +1 -1
- package/src/lib/components/page/BackToTop.svelte +1 -1
- package/src/lib/components/page/Docs.svelte +1 -1
- package/src/lib/components/page/GoToTop.svelte +1 -0
- package/src/lib/components/page/HelpPopUp.svelte +1 -0
- package/src/lib/components/page/Page.svelte +15 -20
- package/src/lib/components/page/menu/MenuSublist.svelte +11 -8
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
import Select from 'svelte-select';
|
|
5
5
|
import { onMount } from 'svelte';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
7
|
export let source;
|
|
10
8
|
export let target;
|
|
11
9
|
export let id;
|
|
@@ -35,16 +33,14 @@
|
|
|
35
33
|
$: groupBy;
|
|
36
34
|
|
|
37
35
|
function updateTarget(selection) {
|
|
36
|
+
console.log('updateTarget', target, selection, isMulti);
|
|
37
|
+
if (selection == undefined) {
|
|
38
|
+
console.log('no update');
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
if(selection == undefined)
|
|
41
|
-
{
|
|
42
|
-
console.log("no update");
|
|
43
|
-
|
|
44
|
-
return;
|
|
40
|
+
return;
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
console.log(
|
|
43
|
+
console.log('update');
|
|
48
44
|
//different cases
|
|
49
45
|
//a) source is complex model is simple return array
|
|
50
46
|
if (complexSource && !complexTarget && isLoaded && isMulti) {
|
|
@@ -75,8 +71,8 @@
|
|
|
75
71
|
}
|
|
76
72
|
|
|
77
73
|
if (!complexSource && !complexTarget && isLoaded && !isMulti) {
|
|
78
|
-
console.log(
|
|
79
|
-
if(selection){
|
|
74
|
+
console.log('🚀 ~ updateTarget ~ selection:', selection);
|
|
75
|
+
if (selection) {
|
|
80
76
|
target = selection.value;
|
|
81
77
|
}
|
|
82
78
|
}
|
|
@@ -167,118 +163,116 @@
|
|
|
167
163
|
//console.log(t,value)
|
|
168
164
|
}
|
|
169
165
|
|
|
170
|
-
function filterItemStartFn(label, filterText, option) {
|
|
171
|
-
|
|
172
|
-
|
|
166
|
+
function filterItemStartFn(label, filterText, option) {
|
|
167
|
+
// console.log(label, filterText, option);
|
|
168
|
+
let itemFilter = label.toLowerCase().startsWith(filterText.toLowerCase());
|
|
173
169
|
|
|
174
|
-
|
|
175
|
-
}
|
|
170
|
+
return itemFilter;
|
|
171
|
+
}
|
|
176
172
|
|
|
177
|
-
function filterItemExactFn(label, filterText, option) {
|
|
178
|
-
|
|
179
|
-
|
|
173
|
+
function filterItemExactFn(label, filterText, option) {
|
|
174
|
+
// console.log(label, filterText, option);
|
|
175
|
+
let itemFilter = label.toLowerCase() == filterText.toLowerCase();
|
|
180
176
|
|
|
181
|
-
|
|
182
|
-
}
|
|
177
|
+
return itemFilter;
|
|
178
|
+
}
|
|
183
179
|
|
|
184
|
-
function filterItemIncludesFn(label, filterText, option) {
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
function filterItemIncludesFn(label, filterText, option) {
|
|
181
|
+
// console.log(label, filterText, option);
|
|
182
|
+
let itemFilter = label.toLowerCase().includes(filterText.toLowerCase());
|
|
187
183
|
|
|
188
|
-
|
|
189
|
-
}
|
|
184
|
+
return itemFilter;
|
|
185
|
+
}
|
|
190
186
|
|
|
191
|
-
function filterFn({
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}) {
|
|
205
|
-
|
|
206
|
-
|
|
187
|
+
function filterFn({
|
|
188
|
+
loadOptions,
|
|
189
|
+
filterText,
|
|
190
|
+
items,
|
|
191
|
+
multiple,
|
|
192
|
+
value,
|
|
193
|
+
itemId,
|
|
194
|
+
groupBy,
|
|
195
|
+
filterSelectedItems,
|
|
196
|
+
itemFilter,
|
|
197
|
+
convertStringItemsToObjects,
|
|
198
|
+
filterGroupedItems,
|
|
199
|
+
label
|
|
200
|
+
}) {
|
|
201
|
+
if (items && loadOptions) return items;
|
|
202
|
+
if (!items) return [];
|
|
203
|
+
|
|
204
|
+
if (items && items.length > 0 && typeof items[0] !== 'object') {
|
|
205
|
+
items = convertStringItemsToObjects(items);
|
|
206
|
+
}
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
let filterResults = filterListFn(
|
|
209
|
+
items,
|
|
210
|
+
label,
|
|
211
|
+
filterText,
|
|
212
|
+
multiple,
|
|
213
|
+
value,
|
|
214
|
+
filterSelectedItems,
|
|
215
|
+
itemId
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
if (groupBy) {
|
|
219
|
+
filterResults = filterGroupedItems(filterResults, label, filterText);
|
|
220
|
+
}
|
|
211
221
|
|
|
212
|
-
|
|
222
|
+
return filterResults;
|
|
223
|
+
}
|
|
213
224
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
225
|
+
// filter checks 3 types, exact, starts, includes
|
|
226
|
+
function filterListFn(items, label, filterText, multiple, value, filterSelectedItems, itemId) {
|
|
227
|
+
if (!items) return [];
|
|
217
228
|
|
|
218
|
-
|
|
219
|
-
|
|
229
|
+
let exact = items.filter((item) => {
|
|
230
|
+
let matchesFilter = filterItemExactFn(item[label], filterText, item);
|
|
231
|
+
if (matchesFilter && multiple && value?.length) {
|
|
232
|
+
matchesFilter = !value.some((x) => {
|
|
233
|
+
return filterSelectedItems ? x[itemId] === item[itemId] : false;
|
|
234
|
+
});
|
|
235
|
+
}
|
|
220
236
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
{
|
|
237
|
+
return matchesFilter;
|
|
238
|
+
});
|
|
224
239
|
|
|
225
|
-
|
|
240
|
+
let starts = items.filter((item) => {
|
|
241
|
+
let matchesFilter = filterItemStartFn(item[label], filterText, item);
|
|
242
|
+
if (matchesFilter && multiple && value?.length) {
|
|
243
|
+
matchesFilter = !value.some((x) => {
|
|
244
|
+
return filterSelectedItems ? x[itemId] === item[itemId] : false;
|
|
245
|
+
});
|
|
246
|
+
}
|
|
226
247
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
if (matchesFilter && multiple && value?.length) {
|
|
230
|
-
matchesFilter = !value.some((x) => {
|
|
231
|
-
return filterSelectedItems ? x[itemId] === item[itemId] : false;
|
|
232
|
-
});
|
|
233
|
-
}
|
|
248
|
+
return matchesFilter;
|
|
249
|
+
});
|
|
234
250
|
|
|
235
|
-
|
|
236
|
-
|
|
251
|
+
let includes = items.filter((item) => {
|
|
252
|
+
let matchesFilter = filterItemIncludesFn(item[label], filterText, item);
|
|
253
|
+
if (matchesFilter && multiple && value?.length) {
|
|
254
|
+
matchesFilter = !value.some((x) => {
|
|
255
|
+
return filterSelectedItems ? x[itemId] === item[itemId] : false;
|
|
256
|
+
});
|
|
257
|
+
}
|
|
237
258
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (matchesFilter && multiple && value?.length) {
|
|
241
|
-
matchesFilter = !value.some((x) => {
|
|
242
|
-
return filterSelectedItems ? x[itemId] === item[itemId] : false;
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
return matchesFilter;
|
|
247
|
-
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
let includes = items.filter((item) => {
|
|
251
|
-
let matchesFilter = filterItemIncludesFn(item[label], filterText, item);
|
|
252
|
-
if (matchesFilter && multiple && value?.length) {
|
|
253
|
-
matchesFilter = !value.some((x) => {
|
|
254
|
-
return filterSelectedItems ? x[itemId] === item[itemId] : false;
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return matchesFilter;
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
let result = [...exact,...starts,...includes];
|
|
263
|
-
return [...new Set(result)];
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function clearFn(e)
|
|
267
|
-
{
|
|
268
|
-
console.log("clear", target, e);
|
|
269
|
-
if(isMulti)
|
|
270
|
-
{
|
|
271
|
-
target = [];
|
|
272
|
-
}
|
|
273
|
-
else
|
|
274
|
-
{
|
|
275
|
-
target="";
|
|
276
|
-
}
|
|
259
|
+
return matchesFilter;
|
|
260
|
+
});
|
|
277
261
|
|
|
278
|
-
|
|
279
|
-
|
|
262
|
+
let result = [...exact, ...starts, ...includes];
|
|
263
|
+
return [...new Set(result)];
|
|
264
|
+
}
|
|
280
265
|
|
|
266
|
+
function clearFn(e) {
|
|
267
|
+
console.log('clear', target, e);
|
|
268
|
+
if (isMulti) {
|
|
269
|
+
target = [];
|
|
270
|
+
} else {
|
|
271
|
+
target = '';
|
|
272
|
+
}
|
|
281
273
|
|
|
274
|
+
console.log('after clear', target);
|
|
275
|
+
}
|
|
282
276
|
</script>
|
|
283
277
|
|
|
284
278
|
<InputContainer {id} label={title} {feedback} {required} {help}>
|
|
@@ -295,7 +289,7 @@ function clearFn(e)
|
|
|
295
289
|
{loading}
|
|
296
290
|
{clearable}
|
|
297
291
|
{disabled}
|
|
298
|
-
|
|
292
|
+
filter={filterFn}
|
|
299
293
|
on:change
|
|
300
294
|
on:input
|
|
301
295
|
on:focus
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<InputContainer {id} {label} {feedback} {required} {help}>
|
|
19
19
|
<input
|
|
20
20
|
{id}
|
|
21
|
-
class="input variant-form-material"
|
|
21
|
+
class="input variant-form-material dark:bg-zinc-700 bg-zinc-50 placeholder:text-gray-400"
|
|
22
22
|
type="number"
|
|
23
23
|
class:input-success={valid}
|
|
24
24
|
class:input-error={invalid}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<InputContainer {id} {label} {feedback} {required} {help}>
|
|
18
18
|
<textarea
|
|
19
19
|
{id}
|
|
20
|
-
class="textarea variant-form-material"
|
|
20
|
+
class="textarea variant-form-material dark:bg-zinc-700 bg-zinc-50 placeholder:text-gray-400"
|
|
21
21
|
class:input-success={valid}
|
|
22
22
|
class:input-error={invalid}
|
|
23
23
|
bind:value
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<InputContainer {id} {label} {feedback} {required} {help}>
|
|
17
17
|
<input
|
|
18
18
|
{id}
|
|
19
|
-
class="input variant-form-material"
|
|
19
|
+
class="input variant-form-material dark:bg-zinc-700 bg-zinc-50 placeholder:text-gray-400"
|
|
20
20
|
type="text"
|
|
21
21
|
class:input-success={valid}
|
|
22
22
|
class:input-error={invalid}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<slot name="actions" />
|
|
33
33
|
|
|
34
34
|
{#if deleteBtn}
|
|
35
|
-
<button class="btn hover:text-primary-100" on:click={() => (show = false)}>
|
|
35
|
+
<button class="btn hover:text-primary-100" title="Close alert" on:click={() => (show = false)}>
|
|
36
36
|
<Fa icon={faXmark} />
|
|
37
37
|
</button>
|
|
38
38
|
{/if}
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
<svelte:window on:scroll={handleOnScroll} />
|
|
27
27
|
|
|
28
28
|
<div class="w-full items-center">
|
|
29
|
-
<button class="btn ring back-to-top" on:click={goTop} class:hidden>Back to top</button>
|
|
29
|
+
<button class="btn ring back-to-top" title="Back to top" on:click={goTop} class:hidden>Back to top</button>
|
|
30
30
|
</div>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
{/if}
|
|
40
40
|
|
|
41
41
|
{#each links as link}
|
|
42
|
-
<span class="chip variant-soft hover:variant-filled" on:click={() => goTo(link.url, false)} on:keypress={() => goTo(link.url, false)}>
|
|
42
|
+
<span class="chip variant-soft hover:variant-filled" role="button" tabindex="0" on:click={() => goTo(link.url, false)} on:keypress={() => goTo(link.url, false)}>
|
|
43
43
|
<span>{link.label}</span>
|
|
44
44
|
</span>
|
|
45
45
|
{/each}
|
|
@@ -61,27 +61,23 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
61
61
|
</script>
|
|
62
62
|
|
|
63
63
|
<div class="app" bind:this={app}>
|
|
64
|
-
<
|
|
64
|
+
<div class="w-full h-full flex flex-col overflow-hidden">
|
|
65
65
|
<!--header-->
|
|
66
|
-
<
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<Menu />
|
|
72
|
-
{/if}
|
|
73
|
-
|
|
74
|
-
<div class="grid grid-cols-2">
|
|
75
|
-
<Breadcrumb bind:title />
|
|
76
|
-
<Docs {links} {note} />
|
|
77
|
-
</div>
|
|
78
|
-
</svelte:fragment>
|
|
79
|
-
</AppBar>
|
|
80
|
-
</svelte:fragment>
|
|
66
|
+
<header class="flex-none z-10">
|
|
67
|
+
<Header />
|
|
68
|
+
{#if true}
|
|
69
|
+
<Menu />
|
|
70
|
+
{/if}
|
|
81
71
|
|
|
82
|
-
|
|
72
|
+
<div class="grid grid-cols-2">
|
|
73
|
+
<Breadcrumb bind:title />
|
|
74
|
+
<Docs {links} {note} />
|
|
75
|
+
</div>
|
|
76
|
+
</header>
|
|
77
|
+
|
|
78
|
+
<footer >
|
|
83
79
|
<Footer />
|
|
84
|
-
</
|
|
80
|
+
</footer>
|
|
85
81
|
|
|
86
82
|
<slot name="description" />
|
|
87
83
|
|
|
@@ -118,6 +114,5 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
118
114
|
<GoToTop/>
|
|
119
115
|
<HelpPopUp active={help} />
|
|
120
116
|
<Notification />
|
|
121
|
-
</AppShell>
|
|
122
117
|
</div>
|
|
123
|
-
|
|
118
|
+
</div>
|
|
@@ -23,24 +23,27 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function clickFn(item)
|
|
26
|
+
function clickFn(item, newWindow = false)
|
|
27
27
|
{
|
|
28
28
|
if(item.Title =="Log Off")
|
|
29
29
|
{
|
|
30
30
|
logOffFn();
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
else{
|
|
33
|
+
else if (newWindow == false){
|
|
34
34
|
goTo(item.Url)
|
|
35
35
|
}
|
|
36
|
+
else{
|
|
37
|
+
window.open(item.Url)
|
|
38
|
+
}
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
|
|
39
42
|
async function logOffFn() {
|
|
40
43
|
|
|
41
44
|
console.log('logoff');
|
|
42
45
|
// Prepare the body content for the POST request
|
|
43
|
-
|
|
46
|
+
|
|
44
47
|
|
|
45
48
|
let bodyContent = '__RequestVerificationToken='+ window.antiForgeryToken;
|
|
46
49
|
|
|
@@ -55,7 +58,7 @@
|
|
|
55
58
|
});
|
|
56
59
|
if (response.ok) {
|
|
57
60
|
// Redirect to login page after logout
|
|
58
|
-
window.location.href = '/Account/Login';
|
|
61
|
+
window.location.href = '/Account/Login';
|
|
59
62
|
} else {
|
|
60
63
|
console.error('Logout failed');
|
|
61
64
|
}
|
|
@@ -69,8 +72,8 @@
|
|
|
69
72
|
|
|
70
73
|
<ListBox class="sm:bg-white sm:border overflow-y-auto max-h-[500px]">
|
|
71
74
|
{#each items as item}
|
|
72
|
-
{#if isNewModule(item.Module)}<hr class="text-surface-800"
|
|
73
|
-
|
|
75
|
+
{#if isNewModule(item.Module)}<hr class="text-surface-800"/>{/if}
|
|
76
|
+
<span on:auxclick={() => clickFn(item, true)}>
|
|
74
77
|
<ListBoxItem
|
|
75
78
|
class="text-md sm:text-sm text-surface-800 py-1 hover:text-secondary-500 bg-transparent hover:bg-surface-200"
|
|
76
79
|
bind:group={item.Title}
|
|
@@ -80,6 +83,6 @@
|
|
|
80
83
|
>
|
|
81
84
|
{item.Title}
|
|
82
85
|
</ListBoxItem>
|
|
83
|
-
|
|
86
|
+
</span>
|
|
84
87
|
{/each}
|
|
85
88
|
</ListBox>
|