@bexis2/bexis2-core-ui 0.1.1 → 0.1.2
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
CHANGED
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
function updateTarget(selection) {
|
|
24
24
|
//diffrent cases
|
|
25
25
|
console.log('------');
|
|
26
|
+
console.log('isComplex',isComplex);
|
|
27
|
+
console.log('isTargetComplex',isTargetComplex);
|
|
28
|
+
console.log('selection',selection);
|
|
26
29
|
|
|
27
30
|
//a) source is complex model is simple
|
|
28
31
|
if (isComplex && !isTargetComplex && isLoaded) {
|
|
@@ -41,8 +44,16 @@
|
|
|
41
44
|
target.push(selection[i].value);
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
|
|
48
|
+
if (isComplex && isTargetComplex && isLoaded)
|
|
49
|
+
{
|
|
50
|
+
console.log("both complex",selection);
|
|
51
|
+
target = selection;
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// console.log('selection ' + title, selection);
|
|
56
|
+
// console.log('target ' + title, target);
|
|
46
57
|
}
|
|
47
58
|
|
|
48
59
|
onMount(async () => {
|
|
@@ -55,7 +66,7 @@
|
|
|
55
66
|
// event.detail will be null unless isMulti is true and user has removed a single item
|
|
56
67
|
for (let i in target) {
|
|
57
68
|
let t = target[i];
|
|
58
|
-
items.push(source.find((item) => item
|
|
69
|
+
items.push(source.find((item) => item[itemId] === t));
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
isLoaded = true;
|
|
@@ -65,6 +76,12 @@
|
|
|
65
76
|
//console.log(value);
|
|
66
77
|
}
|
|
67
78
|
|
|
79
|
+
if (isComplex && isTargetComplex)
|
|
80
|
+
{
|
|
81
|
+
value = target
|
|
82
|
+
isLoaded = true;
|
|
83
|
+
}
|
|
84
|
+
|
|
68
85
|
//b) simple liust and simple model
|
|
69
86
|
if (!isComplex && !isTargetComplex) {
|
|
70
87
|
//console.log("source", source);
|
|
@@ -8,10 +8,10 @@ export default class MultiSelect extends SvelteComponentTyped<{
|
|
|
8
8
|
required?: boolean | undefined;
|
|
9
9
|
label?: string | undefined;
|
|
10
10
|
feedback?: any[] | undefined;
|
|
11
|
-
itemId?: string | undefined;
|
|
12
|
-
isMulti?: boolean | undefined;
|
|
13
11
|
isComplex?: boolean | undefined;
|
|
14
12
|
isTargetComplex?: boolean | undefined;
|
|
13
|
+
itemId?: string | undefined;
|
|
14
|
+
isMulti?: boolean | undefined;
|
|
15
15
|
}, {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
17
17
|
}, {}> {
|
|
@@ -28,10 +28,10 @@ declare const __propDef: {
|
|
|
28
28
|
required?: boolean | undefined;
|
|
29
29
|
label?: string | undefined;
|
|
30
30
|
feedback?: any[] | undefined;
|
|
31
|
-
itemId?: string | undefined;
|
|
32
|
-
isMulti?: boolean | undefined;
|
|
33
31
|
isComplex?: boolean | undefined;
|
|
34
32
|
isTargetComplex?: boolean | undefined;
|
|
33
|
+
itemId?: string | undefined;
|
|
34
|
+
isMulti?: boolean | undefined;
|
|
35
35
|
};
|
|
36
36
|
events: {
|
|
37
37
|
[evt: string]: CustomEvent<any>;
|
package/package.json
CHANGED
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
function updateTarget(selection) {
|
|
24
24
|
//diffrent cases
|
|
25
25
|
console.log('------');
|
|
26
|
+
console.log('isComplex',isComplex);
|
|
27
|
+
console.log('isTargetComplex',isTargetComplex);
|
|
28
|
+
console.log('selection',selection);
|
|
26
29
|
|
|
27
30
|
//a) source is complex model is simple
|
|
28
31
|
if (isComplex && !isTargetComplex && isLoaded) {
|
|
@@ -41,8 +44,16 @@
|
|
|
41
44
|
target.push(selection[i].value);
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
|
|
48
|
+
if (isComplex && isTargetComplex && isLoaded)
|
|
49
|
+
{
|
|
50
|
+
console.log("both complex",selection);
|
|
51
|
+
target = selection;
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// console.log('selection ' + title, selection);
|
|
56
|
+
// console.log('target ' + title, target);
|
|
46
57
|
}
|
|
47
58
|
|
|
48
59
|
onMount(async () => {
|
|
@@ -55,7 +66,7 @@
|
|
|
55
66
|
// event.detail will be null unless isMulti is true and user has removed a single item
|
|
56
67
|
for (let i in target) {
|
|
57
68
|
let t = target[i];
|
|
58
|
-
items.push(source.find((item) => item
|
|
69
|
+
items.push(source.find((item) => item[itemId] === t));
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
isLoaded = true;
|
|
@@ -65,6 +76,12 @@
|
|
|
65
76
|
//console.log(value);
|
|
66
77
|
}
|
|
67
78
|
|
|
79
|
+
if (isComplex && isTargetComplex)
|
|
80
|
+
{
|
|
81
|
+
value = target
|
|
82
|
+
isLoaded = true;
|
|
83
|
+
}
|
|
84
|
+
|
|
68
85
|
//b) simple liust and simple model
|
|
69
86
|
if (!isComplex && !isTargetComplex) {
|
|
70
87
|
//console.log("source", source);
|