@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,217 +1,184 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import {
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
<!--if model exist -->
|
|
186
|
-
<div>
|
|
187
|
-
|
|
188
|
-
<DropZone
|
|
189
|
-
on:drop={handleFilesSelect}
|
|
190
|
-
accept={model.accept}
|
|
191
|
-
multiple={model.multiple}
|
|
192
|
-
{maxSize}>
|
|
193
|
-
|
|
194
|
-
<b style="font-size:xx-large"><Fa icon={faFileUpload}/></b>
|
|
195
|
-
<span><b>Drag 'n' drop some files here, or click to select files</b>
|
|
196
|
-
<b>max file : {model.maxSize} mb</b></span>
|
|
197
|
-
<p>
|
|
198
|
-
{#if model.accept}
|
|
199
|
-
{#each model.accept as ext}
|
|
200
|
-
{ext} ,
|
|
201
|
-
{/each}
|
|
202
|
-
{/if}
|
|
203
|
-
</p>
|
|
204
|
-
</DropZone>
|
|
205
|
-
|
|
206
|
-
</div>
|
|
207
|
-
|
|
208
|
-
<button id="{submitBt}" color="primary" style="display:none" ><Fa icon={faSave}/></button>
|
|
209
|
-
|
|
210
|
-
{:else} <!-- while data is not loaded show a loading information -->
|
|
211
|
-
|
|
212
|
-
<Spinner/>
|
|
213
|
-
{/if}
|
|
214
|
-
|
|
215
|
-
</form>
|
|
216
|
-
|
|
217
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { FileUploaderModel, FileInfo, Files } from '../../models/Models.js';
|
|
3
|
+
|
|
4
|
+
import DropZone from 'svelte-file-dropzone/Dropzone.svelte';
|
|
5
|
+
import Fa from 'svelte-fa/src/fa.svelte';
|
|
6
|
+
|
|
7
|
+
import Spinner from '../spinner/Spinner.svelte';
|
|
8
|
+
import { createEventDispatcher } from 'svelte';
|
|
9
|
+
import { faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
10
|
+
import { faSave } from '@fortawesome/free-regular-svg-icons';
|
|
11
|
+
import { faFileUpload } from '@fortawesome/free-solid-svg-icons';
|
|
12
|
+
|
|
13
|
+
import { Api } from '../../services/Api.js';
|
|
14
|
+
|
|
15
|
+
export let id = 0;
|
|
16
|
+
export let version = 1;
|
|
17
|
+
|
|
18
|
+
import { onMount } from 'svelte';
|
|
19
|
+
|
|
20
|
+
// export let description="";
|
|
21
|
+
// export let status=0;
|
|
22
|
+
|
|
23
|
+
//action to load fileupload model
|
|
24
|
+
export let start = '';
|
|
25
|
+
//action to save selected file
|
|
26
|
+
export let submit = '';
|
|
27
|
+
|
|
28
|
+
export let context = '';
|
|
29
|
+
|
|
30
|
+
export let data: FileUploaderModel | undefined;
|
|
31
|
+
|
|
32
|
+
$: model = data;
|
|
33
|
+
$: submitBt = 'submit';
|
|
34
|
+
|
|
35
|
+
let maxSize = 0;
|
|
36
|
+
|
|
37
|
+
const dispatch = createEventDispatcher();
|
|
38
|
+
|
|
39
|
+
let fx: FileInfo[];
|
|
40
|
+
|
|
41
|
+
let files: Files = { accepted: [], rejected: [] };
|
|
42
|
+
$: files;
|
|
43
|
+
|
|
44
|
+
onMount(async () => {
|
|
45
|
+
console.log('fileupload - OnMount', data);
|
|
46
|
+
|
|
47
|
+
if (!data) {
|
|
48
|
+
load();
|
|
49
|
+
} else {
|
|
50
|
+
model = data;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (model) {
|
|
54
|
+
submitBt += context;
|
|
55
|
+
maxSize = model.maxSize * 1024 * 1024;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// load modal from server
|
|
60
|
+
async function load() {
|
|
61
|
+
let url = start + '?id=' + id + '&version=' + version;
|
|
62
|
+
|
|
63
|
+
// load menu froms server
|
|
64
|
+
const res = await Api.get(url);
|
|
65
|
+
model = await res.data();
|
|
66
|
+
|
|
67
|
+
console.log('fileupload', model);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function handleFilesSelect(e: any) {
|
|
71
|
+
console.log('handleFilesSelect', e);
|
|
72
|
+
console.log('files', files);
|
|
73
|
+
|
|
74
|
+
const { acceptedFiles, fileRejections } = e.detail;
|
|
75
|
+
|
|
76
|
+
files.accepted = [...files.accepted, ...acceptedFiles];
|
|
77
|
+
files.rejected = [...files.rejected, ...fileRejections];
|
|
78
|
+
|
|
79
|
+
console.log('acceptedFiles', acceptedFiles);
|
|
80
|
+
console.log('files.accepted', files.accepted);
|
|
81
|
+
|
|
82
|
+
if (fileRejections.length > 0) {
|
|
83
|
+
//alert("the dropped file is not supported");
|
|
84
|
+
console.log('the dropped file is not supported.');
|
|
85
|
+
console.log(files.rejected);
|
|
86
|
+
|
|
87
|
+
let messages = [''];
|
|
88
|
+
|
|
89
|
+
for (let index = 0; index < fileRejections.length; index++) {
|
|
90
|
+
const element = fileRejections[index];
|
|
91
|
+
messages.push(getErrorMessage(element));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
console.log(messages);
|
|
95
|
+
|
|
96
|
+
dispatch('error', { messages });
|
|
97
|
+
//list up the errors somewhere
|
|
98
|
+
files.rejected = [];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (acceptedFiles.length > 0) {
|
|
102
|
+
document.getElementById(submitBt)?.click();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function getErrorMessage(rejected) {
|
|
107
|
+
let message = '';
|
|
108
|
+
message = rejected.file.path + ' : ';
|
|
109
|
+
let errors = rejected.errors;
|
|
110
|
+
for (let index = 0; index < errors.length; index++) {
|
|
111
|
+
const error = errors[index];
|
|
112
|
+
message += error.message;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return message;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function handleSubmit() {
|
|
119
|
+
console.log('SUBMIT');
|
|
120
|
+
|
|
121
|
+
dispatch('submit');
|
|
122
|
+
|
|
123
|
+
let url = submit + '?id=' + id;
|
|
124
|
+
|
|
125
|
+
// console.log(model);
|
|
126
|
+
// console.log(url);
|
|
127
|
+
console.log('SUBMIT');
|
|
128
|
+
|
|
129
|
+
if (files.accepted.length > 0) {
|
|
130
|
+
console.log(files);
|
|
131
|
+
|
|
132
|
+
const formData = new FormData();
|
|
133
|
+
formData.append('files', '123');
|
|
134
|
+
// Looping over all files and add it to FormData object
|
|
135
|
+
for (var i = 0; i < files.accepted.length; i++) {
|
|
136
|
+
formData.append(files.accepted[i].name, files.accepted[i]);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const response = await Api.post(url, formData);
|
|
140
|
+
|
|
141
|
+
if (response.status == 200) {
|
|
142
|
+
dispatch('submited');
|
|
143
|
+
|
|
144
|
+
let message = files.accepted.length + ' is/are uploaded';
|
|
145
|
+
dispatch('success', { text: message });
|
|
146
|
+
|
|
147
|
+
files.accepted = [];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
</script>
|
|
152
|
+
|
|
153
|
+
<form on:submit|preventDefault={handleSubmit}>
|
|
154
|
+
{#if model}
|
|
155
|
+
<!--if model exist -->
|
|
156
|
+
<div>
|
|
157
|
+
<DropZone
|
|
158
|
+
on:drop={handleFilesSelect}
|
|
159
|
+
accept={model.accept}
|
|
160
|
+
multiple={model.multiple}
|
|
161
|
+
{maxSize}
|
|
162
|
+
>
|
|
163
|
+
<b style="font-size:xx-large"><Fa icon={faFileUpload} /></b>
|
|
164
|
+
<span
|
|
165
|
+
><b>Drag 'n' drop some files here, or click to select files</b>
|
|
166
|
+
<b>max file : {model.maxSize} mb</b></span
|
|
167
|
+
>
|
|
168
|
+
<p>
|
|
169
|
+
{#if model.accept}
|
|
170
|
+
{#each model.accept as ext}
|
|
171
|
+
{ext} ,
|
|
172
|
+
{/each}
|
|
173
|
+
{/if}
|
|
174
|
+
</p>
|
|
175
|
+
</DropZone>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<button id={submitBt} color="primary" style="display:none"><Fa icon={faSave} /></button>
|
|
179
|
+
{:else}
|
|
180
|
+
<!-- while data is not loaded show a loading information -->
|
|
181
|
+
|
|
182
|
+
<Spinner />
|
|
183
|
+
{/if}
|
|
184
|
+
</form>
|
|
@@ -1,32 +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
|
-
bind:checked={checked}
|
|
26
|
-
on:input
|
|
27
|
-
/>
|
|
28
|
-
</InputContainer>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
export let id: string = '';
|
|
5
|
+
export let label: string = '';
|
|
6
|
+
export let checked: bool = false;
|
|
7
|
+
|
|
8
|
+
export let valid: boolean;
|
|
9
|
+
export let invalid: boolean;
|
|
10
|
+
export let required: boolean;
|
|
11
|
+
export let feedback: [];
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<InputContainer {label} {feedback} {required}>
|
|
15
|
+
<input
|
|
16
|
+
{id}
|
|
17
|
+
class="input variant-form-material"
|
|
18
|
+
type="checkbox"
|
|
19
|
+
class:input-success={valid}
|
|
20
|
+
class:input-error={invalid}
|
|
21
|
+
bind:checked
|
|
22
|
+
on:input
|
|
23
|
+
/>
|
|
24
|
+
</InputContainer>
|
|
@@ -1,24 +1,27 @@
|
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
export let source;
|
|
5
|
+
export let target;
|
|
6
|
+
export let title;
|
|
7
|
+
export let description = '';
|
|
8
|
+
export let key;
|
|
9
|
+
|
|
10
|
+
let required = false;
|
|
11
|
+
let feedback: [];
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<InputContainer label={title} {feedback} {required}>
|
|
15
|
+
{#each source as item}
|
|
16
|
+
<label class="flex items-center space-x-2" for={key}>
|
|
17
|
+
<input
|
|
18
|
+
class="checkbox"
|
|
19
|
+
type="checkbox"
|
|
20
|
+
bind:group={target}
|
|
21
|
+
checked={item.key}
|
|
22
|
+
value={item.key}
|
|
23
|
+
/>
|
|
24
|
+
<p>{item.value}</p>
|
|
25
|
+
</label>
|
|
26
|
+
{/each}
|
|
27
|
+
</InputContainer>
|
|
@@ -1,22 +1,21 @@
|
|
|
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
|
-
</InputContainer>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
export let source;
|
|
5
|
+
export let target;
|
|
6
|
+
export let title;
|
|
7
|
+
export let description = '';
|
|
8
|
+
export let key;
|
|
9
|
+
|
|
10
|
+
let required = false;
|
|
11
|
+
let feedback: [];
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<InputContainer label={title} {feedback} {required}>
|
|
15
|
+
{#each source as item}
|
|
16
|
+
<label class="flex items-center space-x-2" for={key}>
|
|
17
|
+
<input class="checkbox" type="checkbox" bind:group={target} value={item} />
|
|
18
|
+
<p>{item}</p>
|
|
19
|
+
</label>
|
|
20
|
+
{/each}
|
|
21
|
+
</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="date"
|
|
19
|
+
class:input-success={valid}
|
|
20
|
+
class:input-error={invalid}
|
|
21
|
+
bind:value
|
|
22
|
+
on:input
|
|
23
|
+
/>
|
|
24
|
+
</InputContainer>
|