@bexis2/bexis2-core-ui 0.1.3 → 0.1.5
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 +12 -0
- package/dist/components/Table/Table.svelte +5 -3
- package/dist/components/Table/TableFilter.svelte +3 -2
- package/dist/components/Table/TableFilter.svelte.d.ts +1 -0
- package/dist/components/form/DropdownKvP.svelte +3 -3
- package/dist/components/form/DropdownKvP.svelte.d.ts +2 -2
- package/dist/components/form/MultiSelect.svelte +12 -12
- package/dist/components/form/MultiSelect.svelte.d.ts +6 -6
- package/dist/stores/apistore.js +1 -0
- package/package.json +1 -1
- package/src/lib/components/Table/Table.svelte +5 -3
- package/src/lib/components/Table/TableFilter.svelte +3 -2
- package/src/lib/components/form/DropdownKvP.svelte +3 -3
- package/src/lib/components/form/MultiSelect.svelte +12 -12
- package/src/lib/components/page/menu/Menu.svelte +1 -4
- package/src/lib/stores/apistore.ts +3 -0
package/README.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# bexis-core-ui
|
|
2
2
|
|
|
3
|
+
## v0.1.5
|
|
4
|
+
### update
|
|
5
|
+
- MultiSelect
|
|
6
|
+
- isTargetComplex -> complexTarget
|
|
7
|
+
- isComplex -> complexSource
|
|
8
|
+
- DropdownKVP
|
|
9
|
+
- targetIsComplex -> complexTarget
|
|
10
|
+
|
|
11
|
+
## v0.1.4
|
|
12
|
+
> test for deploy
|
|
13
|
+
|
|
14
|
+
|
|
3
15
|
## v0.1.3
|
|
4
16
|
> test table
|
|
5
17
|
|
|
@@ -77,7 +77,8 @@ const tableColumns = [
|
|
|
77
77
|
filterValue: filterValue2,
|
|
78
78
|
id,
|
|
79
79
|
tableId,
|
|
80
|
-
values
|
|
80
|
+
values,
|
|
81
|
+
toFilterableValueFn
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
} : void 0,
|
|
@@ -149,12 +150,13 @@ const { filterValue } = pluginStates.tableFilter;
|
|
|
149
150
|
<tr {...rowAttrs} class="bg-primary-300">
|
|
150
151
|
{#each headerRow.cells as cell (cell.id)}
|
|
151
152
|
<Subscribe attrs={cell.attrs()} props={cell.props()} let:props let:attrs>
|
|
152
|
-
<th scope="col" class="!p-2" {...attrs}>
|
|
153
|
+
<th scope="col" class="!p-2 w-min" {...attrs}>
|
|
153
154
|
<div class="flex w-full justify-between items-center">
|
|
154
155
|
<div class="flex gap-1">
|
|
155
156
|
<span
|
|
156
157
|
class:underline={props.sort.order}
|
|
157
158
|
class:normal-case={cell.id !== cell.label}
|
|
159
|
+
class:cursor-pointer={!props.sort.disabled}
|
|
158
160
|
on:click={props.sort.toggle}
|
|
159
161
|
on:keydown={props.sort.toggle}
|
|
160
162
|
>
|
|
@@ -190,7 +192,7 @@ const { filterValue } = pluginStates.tableFilter;
|
|
|
190
192
|
<tr {...rowAttrs}>
|
|
191
193
|
{#each row.cells as cell (cell?.id)}
|
|
192
194
|
<Subscribe attrs={cell.attrs()} let:attrs>
|
|
193
|
-
<td {...attrs} class="!p-2">
|
|
195
|
+
<td {...attrs} class="!p-2 w-min">
|
|
194
196
|
<div class="flex items-center w-full h-full table-cell-fit">
|
|
195
197
|
<Render of={cell.render()} />
|
|
196
198
|
</div>
|
|
@@ -5,6 +5,7 @@ export let filterValue;
|
|
|
5
5
|
export let values;
|
|
6
6
|
export let id;
|
|
7
7
|
export let tableId;
|
|
8
|
+
export let toFilterableValueFn = void 0;
|
|
8
9
|
let firstOption;
|
|
9
10
|
let firstValue;
|
|
10
11
|
let secondOption;
|
|
@@ -96,7 +97,7 @@ const popupFeatured = {
|
|
|
96
97
|
target: popupId,
|
|
97
98
|
placement: "bottom-start"
|
|
98
99
|
};
|
|
99
|
-
let type = typeof $values[0];
|
|
100
|
+
let type = typeof (toFilterableValueFn ? toFilterableValueFn($values[0]) : $values[0]);
|
|
100
101
|
if (type === "object") {
|
|
101
102
|
if ($values[0] instanceof Date) {
|
|
102
103
|
type = "date";
|
|
@@ -206,7 +207,7 @@ if (type === "object") {
|
|
|
206
207
|
on:click|preventDefault={() => {
|
|
207
208
|
active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
|
|
208
209
|
$filterValue = [firstOption, firstValue, secondOption, secondValue];
|
|
209
|
-
}}>
|
|
210
|
+
}}>Apply</button
|
|
210
211
|
>
|
|
211
212
|
</div>
|
|
212
213
|
</div>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export let invalid = false;
|
|
10
10
|
export let feedback = [''];
|
|
11
11
|
export let required = false;
|
|
12
|
-
export let
|
|
12
|
+
export let complexTarget = false;
|
|
13
13
|
|
|
14
14
|
$: selected = null;
|
|
15
15
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
function updatedSelectedValue(selection) {
|
|
20
20
|
if (selection != null) {
|
|
21
|
-
if(
|
|
21
|
+
if(complexTarget)
|
|
22
22
|
{
|
|
23
23
|
selected = selection.id;
|
|
24
24
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function updatedTarget(id) {
|
|
33
|
-
if(
|
|
33
|
+
if(complexTarget)
|
|
34
34
|
{
|
|
35
35
|
target = source.find((opt) => opt.id === id);
|
|
36
36
|
}
|
|
@@ -10,7 +10,7 @@ export default class DropdownKvP extends SvelteComponentTyped<{
|
|
|
10
10
|
invalid?: boolean | undefined;
|
|
11
11
|
valid?: boolean | undefined;
|
|
12
12
|
feedback?: string[] | undefined;
|
|
13
|
-
|
|
13
|
+
complexTarget?: boolean | undefined;
|
|
14
14
|
}, {
|
|
15
15
|
change: Event;
|
|
16
16
|
select: Event;
|
|
@@ -32,7 +32,7 @@ declare const __propDef: {
|
|
|
32
32
|
invalid?: boolean | undefined;
|
|
33
33
|
valid?: boolean | undefined;
|
|
34
34
|
feedback?: string[] | undefined;
|
|
35
|
-
|
|
35
|
+
complexTarget?: boolean | undefined;
|
|
36
36
|
};
|
|
37
37
|
events: {
|
|
38
38
|
change: Event;
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
export let target;
|
|
9
9
|
export let title;
|
|
10
10
|
export let itemId = 'value';
|
|
11
|
-
export let
|
|
11
|
+
export let itemLabel = 'label';
|
|
12
12
|
export let isMulti = true;
|
|
13
|
-
export let
|
|
14
|
-
export let
|
|
13
|
+
export let complexSource = false;
|
|
14
|
+
export let complexTarget = false;
|
|
15
15
|
export let required = false;
|
|
16
16
|
export let feedback = [];
|
|
17
17
|
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
function updateTarget(selection) {
|
|
24
24
|
//diffrent cases
|
|
25
25
|
console.log('------');
|
|
26
|
-
console.log('isComplex',
|
|
27
|
-
console.log('
|
|
26
|
+
console.log('isComplex',complexSource);
|
|
27
|
+
console.log('complexTarget',complexTarget);
|
|
28
28
|
console.log('selection',selection);
|
|
29
29
|
|
|
30
30
|
//a) source is complex model is simple
|
|
31
|
-
if (
|
|
31
|
+
if (complexSource && !complexTarget && isLoaded) {
|
|
32
32
|
console.log('a) source is complex model is simple');
|
|
33
33
|
|
|
34
34
|
target = [];
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
if (!
|
|
41
|
+
if (!complexSource && !complexTarget && isLoaded) {
|
|
42
42
|
target = [];
|
|
43
43
|
for (let i in selection) {
|
|
44
44
|
target.push(selection[i].value);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
if (
|
|
48
|
+
if (complexSource && complexTarget && isLoaded)
|
|
49
49
|
{
|
|
50
50
|
console.log("both complex",selection);
|
|
51
51
|
target = selection;
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
//console.log(source);
|
|
62
62
|
|
|
63
63
|
//a) source is complex model is simple
|
|
64
|
-
if (
|
|
64
|
+
if (complexSource && !complexTarget) {
|
|
65
65
|
let items = [];
|
|
66
66
|
// event.detail will be null unless isMulti is true and user has removed a single item
|
|
67
67
|
for (let i in target) {
|
|
@@ -76,14 +76,14 @@
|
|
|
76
76
|
//console.log(value);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
if (
|
|
79
|
+
if (complexSource && complexTarget)
|
|
80
80
|
{
|
|
81
81
|
value = target
|
|
82
82
|
isLoaded = true;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
//b) simple liust and simple model
|
|
86
|
-
if (!
|
|
86
|
+
if (!complexSource && !complexTarget) {
|
|
87
87
|
//console.log("source", source);
|
|
88
88
|
//console.log("target",target);
|
|
89
89
|
isLoaded = true;
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
class="select variant-form-material"
|
|
101
101
|
items={source}
|
|
102
102
|
{itemId}
|
|
103
|
-
{
|
|
103
|
+
label = {itemLabel}
|
|
104
104
|
multiple={isMulti}
|
|
105
105
|
bind:value
|
|
106
106
|
placeholder="-- Please select --"
|
|
@@ -6,12 +6,12 @@ export default class MultiSelect extends SvelteComponentTyped<{
|
|
|
6
6
|
source: any;
|
|
7
7
|
title: any;
|
|
8
8
|
required?: boolean | undefined;
|
|
9
|
-
label?: string | undefined;
|
|
10
9
|
feedback?: any[] | undefined;
|
|
11
|
-
|
|
12
|
-
isTargetComplex?: boolean | undefined;
|
|
10
|
+
complexTarget?: boolean | undefined;
|
|
13
11
|
itemId?: string | undefined;
|
|
12
|
+
itemLabel?: string | undefined;
|
|
14
13
|
isMulti?: boolean | undefined;
|
|
14
|
+
complexSource?: boolean | undefined;
|
|
15
15
|
}, {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
17
17
|
}, {}> {
|
|
@@ -26,12 +26,12 @@ declare const __propDef: {
|
|
|
26
26
|
source: any;
|
|
27
27
|
title: any;
|
|
28
28
|
required?: boolean | undefined;
|
|
29
|
-
label?: string | undefined;
|
|
30
29
|
feedback?: any[] | undefined;
|
|
31
|
-
|
|
32
|
-
isTargetComplex?: boolean | undefined;
|
|
30
|
+
complexTarget?: boolean | undefined;
|
|
33
31
|
itemId?: string | undefined;
|
|
32
|
+
itemLabel?: string | undefined;
|
|
34
33
|
isMulti?: boolean | undefined;
|
|
34
|
+
complexSource?: boolean | undefined;
|
|
35
35
|
};
|
|
36
36
|
events: {
|
|
37
37
|
[evt: string]: CustomEvent<any>;
|
package/dist/stores/apistore.js
CHANGED
package/package.json
CHANGED
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
filterValue,
|
|
98
98
|
id,
|
|
99
99
|
tableId,
|
|
100
|
-
values
|
|
100
|
+
values,
|
|
101
|
+
toFilterableValueFn
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
104
|
}
|
|
@@ -175,12 +176,13 @@
|
|
|
175
176
|
<tr {...rowAttrs} class="bg-primary-300">
|
|
176
177
|
{#each headerRow.cells as cell (cell.id)}
|
|
177
178
|
<Subscribe attrs={cell.attrs()} props={cell.props()} let:props let:attrs>
|
|
178
|
-
<th scope="col" class="!p-2" {...attrs}>
|
|
179
|
+
<th scope="col" class="!p-2 w-min" {...attrs}>
|
|
179
180
|
<div class="flex w-full justify-between items-center">
|
|
180
181
|
<div class="flex gap-1">
|
|
181
182
|
<span
|
|
182
183
|
class:underline={props.sort.order}
|
|
183
184
|
class:normal-case={cell.id !== cell.label}
|
|
185
|
+
class:cursor-pointer={!props.sort.disabled}
|
|
184
186
|
on:click={props.sort.toggle}
|
|
185
187
|
on:keydown={props.sort.toggle}
|
|
186
188
|
>
|
|
@@ -216,7 +218,7 @@
|
|
|
216
218
|
<tr {...rowAttrs}>
|
|
217
219
|
{#each row.cells as cell (cell?.id)}
|
|
218
220
|
<Subscribe attrs={cell.attrs()} let:attrs>
|
|
219
|
-
<td {...attrs} class="!p-2">
|
|
221
|
+
<td {...attrs} class="!p-2 w-min">
|
|
220
222
|
<div class="flex items-center w-full h-full table-cell-fit">
|
|
221
223
|
<Render of={cell.render()} />
|
|
222
224
|
</div>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export let values;
|
|
9
9
|
export let id;
|
|
10
10
|
export let tableId;
|
|
11
|
+
export let toFilterableValueFn: undefined | ((value: any) => any) = undefined;
|
|
11
12
|
|
|
12
13
|
let firstOption;
|
|
13
14
|
let firstValue;
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
placement: 'bottom-start'
|
|
105
106
|
};
|
|
106
107
|
|
|
107
|
-
let type: string = typeof $values[0];
|
|
108
|
+
let type: string = typeof (toFilterableValueFn ? toFilterableValueFn($values[0]) : $values[0]);
|
|
108
109
|
if (type === 'object') {
|
|
109
110
|
if ($values[0] instanceof Date) {
|
|
110
111
|
type = 'date';
|
|
@@ -214,7 +215,7 @@
|
|
|
214
215
|
on:click|preventDefault={() => {
|
|
215
216
|
active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
|
|
216
217
|
$filterValue = [firstOption, firstValue, secondOption, secondValue];
|
|
217
|
-
}}>
|
|
218
|
+
}}>Apply</button
|
|
218
219
|
>
|
|
219
220
|
</div>
|
|
220
221
|
</div>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export let invalid = false;
|
|
10
10
|
export let feedback = [''];
|
|
11
11
|
export let required = false;
|
|
12
|
-
export let
|
|
12
|
+
export let complexTarget = false;
|
|
13
13
|
|
|
14
14
|
$: selected = null;
|
|
15
15
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
function updatedSelectedValue(selection) {
|
|
20
20
|
if (selection != null) {
|
|
21
|
-
if(
|
|
21
|
+
if(complexTarget)
|
|
22
22
|
{
|
|
23
23
|
selected = selection.id;
|
|
24
24
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function updatedTarget(id) {
|
|
33
|
-
if(
|
|
33
|
+
if(complexTarget)
|
|
34
34
|
{
|
|
35
35
|
target = source.find((opt) => opt.id === id);
|
|
36
36
|
}
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
export let target;
|
|
9
9
|
export let title;
|
|
10
10
|
export let itemId = 'value';
|
|
11
|
-
export let
|
|
11
|
+
export let itemLabel = 'label';
|
|
12
12
|
export let isMulti = true;
|
|
13
|
-
export let
|
|
14
|
-
export let
|
|
13
|
+
export let complexSource = false;
|
|
14
|
+
export let complexTarget = false;
|
|
15
15
|
export let required = false;
|
|
16
16
|
export let feedback = [];
|
|
17
17
|
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
function updateTarget(selection) {
|
|
24
24
|
//diffrent cases
|
|
25
25
|
console.log('------');
|
|
26
|
-
console.log('isComplex',
|
|
27
|
-
console.log('
|
|
26
|
+
console.log('isComplex',complexSource);
|
|
27
|
+
console.log('complexTarget',complexTarget);
|
|
28
28
|
console.log('selection',selection);
|
|
29
29
|
|
|
30
30
|
//a) source is complex model is simple
|
|
31
|
-
if (
|
|
31
|
+
if (complexSource && !complexTarget && isLoaded) {
|
|
32
32
|
console.log('a) source is complex model is simple');
|
|
33
33
|
|
|
34
34
|
target = [];
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
if (!
|
|
41
|
+
if (!complexSource && !complexTarget && isLoaded) {
|
|
42
42
|
target = [];
|
|
43
43
|
for (let i in selection) {
|
|
44
44
|
target.push(selection[i].value);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
if (
|
|
48
|
+
if (complexSource && complexTarget && isLoaded)
|
|
49
49
|
{
|
|
50
50
|
console.log("both complex",selection);
|
|
51
51
|
target = selection;
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
//console.log(source);
|
|
62
62
|
|
|
63
63
|
//a) source is complex model is simple
|
|
64
|
-
if (
|
|
64
|
+
if (complexSource && !complexTarget) {
|
|
65
65
|
let items = [];
|
|
66
66
|
// event.detail will be null unless isMulti is true and user has removed a single item
|
|
67
67
|
for (let i in target) {
|
|
@@ -76,14 +76,14 @@
|
|
|
76
76
|
//console.log(value);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
if (
|
|
79
|
+
if (complexSource && complexTarget)
|
|
80
80
|
{
|
|
81
81
|
value = target
|
|
82
82
|
isLoaded = true;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
//b) simple liust and simple model
|
|
86
|
-
if (!
|
|
86
|
+
if (!complexSource && !complexTarget) {
|
|
87
87
|
//console.log("source", source);
|
|
88
88
|
//console.log("target",target);
|
|
89
89
|
isLoaded = true;
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
class="select variant-form-material"
|
|
101
101
|
items={source}
|
|
102
102
|
{itemId}
|
|
103
|
-
{
|
|
103
|
+
label = {itemLabel}
|
|
104
104
|
multiple={isMulti}
|
|
105
105
|
bind:value
|
|
106
106
|
placeholder="-- Please select --"
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
import { faCog } from '@fortawesome/free-solid-svg-icons'
|
|
5
5
|
|
|
6
6
|
import { onMount } from 'svelte';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
9
8
|
import { getMenuItems} from './MenuDataCaller';
|
|
10
9
|
|
|
11
10
|
import type { Menu } from "./menu";
|
|
@@ -16,9 +15,7 @@
|
|
|
16
15
|
let menu:Menu;
|
|
17
16
|
|
|
18
17
|
onMount(async () => {
|
|
19
|
-
|
|
20
18
|
|
|
21
|
-
|
|
22
19
|
menu = await getMenuItems();
|
|
23
20
|
|
|
24
21
|
})
|
|
@@ -22,7 +22,10 @@ passwordStore.subscribe((value) => {
|
|
|
22
22
|
|
|
23
23
|
export function setApiConfig(_host: string, _user: string, _pw: string) {
|
|
24
24
|
console.log('overwrite settings');
|
|
25
|
+
|
|
25
26
|
hostStore.update((h) => (h = _host));
|
|
26
27
|
usernameStore.update((u) => (u = _user));
|
|
27
28
|
passwordStore.update((p) => (p = _pw));
|
|
29
|
+
|
|
30
|
+
console.log('overwrite host',_host);
|
|
28
31
|
}
|