blob: 16830e11f399cf8eefbdcb123a74d7f0f4402f17 (
plain) (
blame)
1
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
|
<div>
<div class="d-flex justify-content-center">
<input style="display: inline-block; width:350px;" list=delimiterOptions
placeholder="Izaberite ili ukucajte delimiter za .csv fajl" class="form-control" [(ngModel)]="delimiter"
(input)="update()">
<datalist id=delimiterOptions>
<option *ngFor="let option of delimiterOptions">{{option}}</option>
</datalist>
<label for="type" class="form-check-label">Da li .csv ima header?
<input class="mx-3 form-check-input" type="checkbox" (input)="update()" [(ngModel)]="hasHeader" type="checkbox" value="" id="checkboxHeader" checked>
</label>
<input id="fileInput" class="form-control" type="file" class="upload" (change)="changeListener($event)" accept=".csv">
</div>
<table *ngIf="csvRecords.length > 0 && hasHeader" class="table table-bordered table-light my-4">
<thead>
<tr>
<th *ngFor="let item of csvRecords[0]; let i = index">{{item}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let row of csvRecords | slice:1:11">
<td *ngFor="let col of row">{{col}}</td>
</tr>
</tbody>
</table>
<table *ngIf="csvRecords.length > 0 && !hasHeader" class="table table-bordered table-light mt-4">
<tbody>
<tr *ngFor="let row of csvRecords | slice:0:10">
<td *ngFor="let col of row">{{col}}</td>
</tr>
</tbody>
</table>
<div *ngIf="csvRecords.length > 0" id="info">
. . . <br>
{{rowsNumber}} x {{colsNumber}}
</div>
<div *ngIf="csvRecords.length > 0" class="mt-2">
<div class="row">
<div class="col d-flex justify-content-center">
<h3>Izaberite ulazne kolone:</h3>
<div id="divInputs" class="form-check">
<br>
<div *ngFor="let item of csvRecords[0]; let i = index">
<input *ngIf="i == 0" class="form-check-input" type="checkbox" value="{{item}}" id="cb_{{item}}" name="cbs" checked>
<input *ngIf="i != 0" class="form-check-input" type="checkbox" value="{{item}}" id="cb_{{item}}" name="cbs">
<label class="form-check-label" for="cb_{{item}}">
{{item}}
</label>
</div>
</div>
</div>
<div class="col d-flex justify-content-left">
<h3>Izaberite izlaznu kolonu:</h3>
<div id="divOutputs" class="form-check">
<br>
<div *ngFor="let item of csvRecords[0]; let i = index">
<input *ngIf="i == 0" class="form-check-input" type="radio" value="{{item}}" id="rb_{{item}}" name="rbs" checked>
<input *ngIf="i != 0" class="form-check-input" type="radio" value="{{item}}" id="rb_{{item}}" name="rbs">
<label class="form-check-label" for="rb_{{item}}">
{{item}}
</label>
</div>
</div>
</div>
</div>
</div>
</div>
|