@bexis2/bexis2-core-ui 0.0.23 → 0.0.26
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 +3 -12
- package/dist/TableView.svelte +1 -1
- package/dist/components/ListView.svelte +5 -5
- package/dist/components/Table/Table.svelte +167 -0
- package/dist/components/Table/Table.svelte.d.ts +17 -0
- package/dist/components/Table/TableFilter.svelte +168 -0
- package/dist/components/Table/TableFilter.svelte.d.ts +21 -0
- package/dist/components/Table/TablePagination.svelte +60 -0
- package/dist/components/Table/TablePagination.svelte.d.ts +17 -0
- package/dist/components/Table/filter.d.ts +4 -0
- package/dist/components/Table/filter.js +83 -0
- package/dist/components/file/FileIcon.svelte +45 -49
- package/dist/components/file/FileInfo.svelte +13 -14
- package/dist/components/file/FileUploader.svelte +34 -37
- package/dist/components/form/Checkbox.svelte +13 -17
- package/dist/components/form/CheckboxKvPList.svelte +16 -12
- package/dist/components/form/CheckboxList.svelte +10 -10
- package/dist/components/form/DateInput.svelte +17 -18
- package/dist/components/form/DateInput.svelte.d.ts +4 -4
- package/dist/components/form/DropdownKvP.svelte +44 -52
- package/dist/components/form/DropdownKvP.svelte.d.ts +10 -10
- package/dist/components/form/InputContainer.svelte +18 -20
- package/dist/components/form/InputContainer.svelte.d.ts +1 -1
- package/dist/components/form/MultiSelect.svelte +91 -101
- package/dist/components/form/NumberInput.svelte +17 -18
- package/dist/components/form/NumberInput.svelte.d.ts +4 -4
- package/dist/components/form/TextArea.svelte +16 -18
- package/dist/components/form/TextArea.svelte.d.ts +4 -5
- package/dist/components/form/TextInput.svelte +17 -21
- package/dist/components/form/TextInput.svelte.d.ts +4 -4
- package/dist/components/spinner/Spinner.svelte +9 -8
- package/dist/css/core.ui.css +5 -2
- package/dist/css/themes/theme-bexis2.css +96 -100
- package/dist/css/themes/theme-crimson.css +3 -2
- package/dist/css/themes/theme-hamlindigo.css +3 -2
- package/dist/css/themes/theme-seafoam.css +3 -2
- package/dist/models/Models.d.ts +28 -0
- package/dist/services/Api.js +12 -11
- package/dist/stores/apistore.js +13 -13
- package/package.json +17 -4
- package/src/lib/TableView.svelte +1 -1
- package/src/lib/components/ListView.svelte +11 -13
- package/src/lib/components/Table/Table.svelte +184 -0
- package/src/lib/components/Table/TableFilter.svelte +176 -0
- package/src/lib/components/Table/TablePagination.svelte +61 -0
- package/src/lib/components/Table/filter.ts +94 -0
- package/src/lib/components/file/FileIcon.svelte +45 -49
- package/src/lib/components/file/FileInfo.svelte +13 -14
- package/src/lib/components/file/FileUploader.svelte +184 -217
- package/src/lib/components/form/Checkbox.svelte +24 -32
- package/src/lib/components/form/CheckboxKvPList.svelte +27 -24
- package/src/lib/components/form/CheckboxList.svelte +21 -22
- package/src/lib/components/form/DateInput.svelte +24 -30
- package/src/lib/components/form/DropdownKvP.svelte +44 -52
- package/src/lib/components/form/InputContainer.svelte +22 -27
- package/src/lib/components/form/MultiSelect.svelte +91 -101
- package/src/lib/components/form/NumberInput.svelte +24 -30
- package/src/lib/components/form/TextArea.svelte +23 -28
- package/src/lib/components/form/TextInput.svelte +24 -33
- package/src/lib/components/spinner/Spinner.svelte +9 -8
- package/src/lib/css/core.ui.css +5 -2
- package/src/lib/css/themes/theme-bexis2.css +96 -100
- package/src/lib/css/themes/theme-crimson.css +3 -2
- package/src/lib/css/themes/theme-hamlindigo.css +3 -2
- package/src/lib/css/themes/theme-seafoam.css +3 -2
- package/src/lib/index.ts +31 -23
- package/src/lib/models/Models.ts +70 -39
- package/src/lib/services/Api.ts +55 -58
- package/src/lib/stores/apistore.ts +28 -32
|
@@ -1,52 +1,44 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
$:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
>
|
|
46
|
-
<option value={null}>-- Please select --</option>
|
|
47
|
-
{#each source as e}
|
|
48
|
-
<option value={e.id} >{e.text}</option>
|
|
49
|
-
{/each}
|
|
50
|
-
</select>
|
|
51
|
-
</InputContainer>
|
|
52
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
export let id;
|
|
5
|
+
export let source;
|
|
6
|
+
export let target;
|
|
7
|
+
export let title;
|
|
8
|
+
export let valid = false;
|
|
9
|
+
export let invalid = false;
|
|
10
|
+
export let feedback = [''];
|
|
11
|
+
export let required = false;
|
|
12
|
+
|
|
13
|
+
$: selected = null;
|
|
14
|
+
|
|
15
|
+
$: updatedSelectedValue(target);
|
|
16
|
+
$: updatedTarget(selected);
|
|
17
|
+
|
|
18
|
+
function updatedSelectedValue(selection) {
|
|
19
|
+
if (selection != null) {
|
|
20
|
+
selected = selection.id;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function updatedTarget(id) {
|
|
25
|
+
target = source.find((opt) => opt.id === id);
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<InputContainer label={title} {feedback} {required}>
|
|
30
|
+
<select
|
|
31
|
+
{id}
|
|
32
|
+
class="select variant-form-material"
|
|
33
|
+
class:input-success={valid}
|
|
34
|
+
class:input-error={invalid}
|
|
35
|
+
bind:value={selected}
|
|
36
|
+
on:change
|
|
37
|
+
on:select
|
|
38
|
+
>
|
|
39
|
+
<option value={null}>-- Please select --</option>
|
|
40
|
+
{#each source as e}
|
|
41
|
+
<option value={e.id}>{e.text}</option>
|
|
42
|
+
{/each}
|
|
43
|
+
</select>
|
|
44
|
+
</InputContainer>
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{/if}
|
|
24
|
-
</label>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let label: string = '';
|
|
3
|
+
export let required: boolean;
|
|
4
|
+
export let feedback: string[];
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<label class="label">
|
|
8
|
+
<span
|
|
9
|
+
>{label}
|
|
10
|
+
{#if required} <span class="text-sm text-red-600">*</span> {/if}
|
|
11
|
+
</span>
|
|
12
|
+
<slot />
|
|
13
|
+
{#if feedback}
|
|
14
|
+
<span class="text-sm text-error-600">
|
|
15
|
+
<ul>
|
|
16
|
+
{#each feedback as message}
|
|
17
|
+
<li>{message}</li>
|
|
18
|
+
{/each}
|
|
19
|
+
</ul>
|
|
20
|
+
</span>
|
|
21
|
+
{/if}
|
|
22
|
+
</label>
|
|
@@ -1,101 +1,91 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{label}
|
|
93
|
-
multiple={isMulti}
|
|
94
|
-
bind:value
|
|
95
|
-
placeholder="-- Please select --"
|
|
96
|
-
|
|
97
|
-
>
|
|
98
|
-
</Select>
|
|
99
|
-
</InputContainer>
|
|
100
|
-
|
|
101
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
import Select from 'svelte-select';
|
|
5
|
+
import { onMount } from 'svelte';
|
|
6
|
+
|
|
7
|
+
export let source;
|
|
8
|
+
export let target;
|
|
9
|
+
export let title;
|
|
10
|
+
export let itemId = 'value';
|
|
11
|
+
export let label = 'label';
|
|
12
|
+
export let isMulti = true;
|
|
13
|
+
export let isComplex = false;
|
|
14
|
+
export let isTargetComplex = false;
|
|
15
|
+
export let required = false;
|
|
16
|
+
export let feedback = [];
|
|
17
|
+
|
|
18
|
+
let isLoaded = false;
|
|
19
|
+
|
|
20
|
+
$: value = null;
|
|
21
|
+
$: updateTarget(value);
|
|
22
|
+
|
|
23
|
+
function updateTarget(selection) {
|
|
24
|
+
//diffrent cases
|
|
25
|
+
console.log('------');
|
|
26
|
+
|
|
27
|
+
//a) source is complex model is simple
|
|
28
|
+
if (isComplex && !isTargetComplex && isLoaded) {
|
|
29
|
+
console.log('a) source is complex model is simple');
|
|
30
|
+
|
|
31
|
+
target = [];
|
|
32
|
+
for (let i in selection) {
|
|
33
|
+
let item = selection[i];
|
|
34
|
+
target.push(item[itemId]);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!isComplex && !isTargetComplex && isLoaded) {
|
|
39
|
+
target = [];
|
|
40
|
+
for (let i in selection) {
|
|
41
|
+
target.push(selection[i].value);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
console.log('selection ' + title, selection);
|
|
45
|
+
console.log('target ' + title, target);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
onMount(async () => {
|
|
49
|
+
//console.log("on mount multiselect");
|
|
50
|
+
//console.log(source);
|
|
51
|
+
|
|
52
|
+
//a) source is complex model is simple
|
|
53
|
+
if (isComplex && !isTargetComplex) {
|
|
54
|
+
let items = [];
|
|
55
|
+
// event.detail will be null unless isMulti is true and user has removed a single item
|
|
56
|
+
for (let i in target) {
|
|
57
|
+
let t = target[i];
|
|
58
|
+
items.push(source.find((item) => item.key === t));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
isLoaded = true;
|
|
62
|
+
if (items.length > 0) {
|
|
63
|
+
value = items;
|
|
64
|
+
}
|
|
65
|
+
//console.log(value);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//b) simple liust and simple model
|
|
69
|
+
if (!isComplex && !isTargetComplex) {
|
|
70
|
+
//console.log("source", source);
|
|
71
|
+
//console.log("target",target);
|
|
72
|
+
isLoaded = true;
|
|
73
|
+
//set target only if its nit empty
|
|
74
|
+
if (target != null && target !== undefined && target != '') {
|
|
75
|
+
value = target;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<InputContainer label={title} {feedback} {required}>
|
|
82
|
+
<Select
|
|
83
|
+
class="select variant-form-material"
|
|
84
|
+
items={source}
|
|
85
|
+
{itemId}
|
|
86
|
+
{label}
|
|
87
|
+
multiple={isMulti}
|
|
88
|
+
bind:value
|
|
89
|
+
placeholder="-- Please select --"
|
|
90
|
+
/>
|
|
91
|
+
</InputContainer>
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class:input-error="{invalid}"
|
|
26
|
-
bind:value={value}
|
|
27
|
-
on:input
|
|
28
|
-
/>
|
|
29
|
-
</InputContainer>
|
|
30
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
export let id: string = '';
|
|
5
|
+
export let label: string = '';
|
|
6
|
+
export let value: string = '';
|
|
7
|
+
|
|
8
|
+
export let valid: boolean = false;
|
|
9
|
+
export let invalid: boolean = false;
|
|
10
|
+
export let required: boolean = false;
|
|
11
|
+
export let feedback: string[] = [''];
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<InputContainer {label} {feedback} {required}>
|
|
15
|
+
<input
|
|
16
|
+
{id}
|
|
17
|
+
class="input variant-form-material"
|
|
18
|
+
type="number"
|
|
19
|
+
class:input-success={valid}
|
|
20
|
+
class:input-error={invalid}
|
|
21
|
+
bind:value
|
|
22
|
+
on:input
|
|
23
|
+
/>
|
|
24
|
+
</InputContainer>
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export let
|
|
6
|
-
export let
|
|
7
|
-
|
|
8
|
-
export let
|
|
9
|
-
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
bind:value={value}
|
|
25
|
-
on:input/>
|
|
26
|
-
</InputContainer>
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
export let id: string = '';
|
|
5
|
+
export let label: string = '';
|
|
6
|
+
export let value: string = '';
|
|
7
|
+
|
|
8
|
+
export let valid: boolean = false;
|
|
9
|
+
export let invalid: boolean = false;
|
|
10
|
+
export let required: boolean = false;
|
|
11
|
+
export let feedback: string[] = [''];
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<InputContainer {label} {feedback} {required}>
|
|
15
|
+
<textarea
|
|
16
|
+
{id}
|
|
17
|
+
class="textarea variant-form-material"
|
|
18
|
+
class:input-success={valid}
|
|
19
|
+
class:input-error={invalid}
|
|
20
|
+
bind:value
|
|
21
|
+
on:input
|
|
22
|
+
/>
|
|
23
|
+
</InputContainer>
|
|
@@ -1,33 +1,24 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export let
|
|
7
|
-
|
|
8
|
-
export let
|
|
9
|
-
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class:input-error="{invalid}"
|
|
26
|
-
bind:value={value}
|
|
27
|
-
on:input
|
|
28
|
-
/>
|
|
29
|
-
</InputContainer>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
export let id: string = '';
|
|
5
|
+
export let label: string = '';
|
|
6
|
+
export let value: string = '';
|
|
7
|
+
|
|
8
|
+
export let valid: boolean = false;
|
|
9
|
+
export let invalid: boolean = false;
|
|
10
|
+
export let required: boolean = false;
|
|
11
|
+
export let feedback: string[] = [''];
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<InputContainer {label} {feedback} {required}>
|
|
15
|
+
<input
|
|
16
|
+
{id}
|
|
17
|
+
class="input variant-form-material"
|
|
18
|
+
type="text"
|
|
19
|
+
class:input-success={valid}
|
|
20
|
+
class:input-error={invalid}
|
|
21
|
+
bind:value
|
|
22
|
+
on:input
|
|
23
|
+
/>
|
|
24
|
+
</InputContainer>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
<div
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
<div
|
|
2
|
+
class="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite] text-secundary-500"
|
|
3
|
+
role="status"
|
|
4
|
+
>
|
|
5
|
+
<span
|
|
6
|
+
class="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]"
|
|
7
|
+
>Loading...</span
|
|
8
|
+
>
|
|
9
|
+
</div>
|
package/src/lib/css/core.ui.css
CHANGED