comarch-disk 0.0.3
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 +150 -0
- package/fesm2022/comarch-disk.mjs +149 -0
- package/fesm2022/comarch-disk.mjs.map +1 -0
- package/index.d.ts +64 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# My Library
|
|
2
|
+
|
|
3
|
+
Nowoczesna biblioteka komponentów dla aplikacji Angular 20.
|
|
4
|
+
|
|
5
|
+
## 🚀 Instalacja
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install my-library
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 📖 Użycie
|
|
12
|
+
|
|
13
|
+
### Import komponentów
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { Button } from 'my-library';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'app-root',
|
|
20
|
+
imports: [Button],
|
|
21
|
+
template: '<lib-button>Click me</lib-button>'
|
|
22
|
+
})
|
|
23
|
+
export class AppComponent {}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Import serwisów
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { Data } from 'my-library';
|
|
30
|
+
|
|
31
|
+
@Component({
|
|
32
|
+
selector: 'app-root'
|
|
33
|
+
})
|
|
34
|
+
export class AppComponent {
|
|
35
|
+
constructor(private dataService: Data) {}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 📦 Dostępne komponenty
|
|
40
|
+
|
|
41
|
+
### Button
|
|
42
|
+
Komponent przycisku z rozszerzonymi możliwościami stylowania.
|
|
43
|
+
|
|
44
|
+
**Inputs:**
|
|
45
|
+
- `type: 'button' | 'submit' | 'reset'` - typ przycisku (domyślnie: 'button')
|
|
46
|
+
- `variant: 'primary' | 'secondary' | 'danger'` - wariant stylistyczny (domyślnie: 'primary')
|
|
47
|
+
- `disabled: boolean` - stan nieaktywny (domyślnie: false)
|
|
48
|
+
|
|
49
|
+
**Outputs:**
|
|
50
|
+
- `clicked: EventEmitter<void>` - event emitowany przy kliknięciu
|
|
51
|
+
|
|
52
|
+
**Przykład:**
|
|
53
|
+
```html
|
|
54
|
+
<lib-button
|
|
55
|
+
type="submit"
|
|
56
|
+
variant="primary"
|
|
57
|
+
(clicked)="handleClick()">
|
|
58
|
+
Submit
|
|
59
|
+
</lib-button>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 🛠️ Dostępne serwisy
|
|
63
|
+
|
|
64
|
+
### DataService
|
|
65
|
+
Serwis do zarządzania danymi aplikacji używający signals.
|
|
66
|
+
|
|
67
|
+
**Metody:**
|
|
68
|
+
- `addItem(item: DataItem): void` - dodaje nowy element
|
|
69
|
+
- `removeItem(id: number): void` - usuwa element po ID
|
|
70
|
+
- `getItem(id: number): DataItem | undefined` - pobiera element po ID
|
|
71
|
+
- `clearAll(): void` - czyści wszystkie elementy
|
|
72
|
+
- `data: Signal<DataItem[]>` - readonly signal z danymi
|
|
73
|
+
|
|
74
|
+
## 🏗️ Building
|
|
75
|
+
|
|
76
|
+
Aby zbudować bibliotekę, uruchom:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
ng build my-library
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Skompilowane pliki znajdą się w katalogu `dist/my-library/`.
|
|
83
|
+
|
|
84
|
+
## 📤 Publikacja do Nexus
|
|
85
|
+
|
|
86
|
+
### Konfiguracja
|
|
87
|
+
|
|
88
|
+
1. Upewnij się, że plik `.npmrc` zawiera poprawną konfigurację Nexus:
|
|
89
|
+
```
|
|
90
|
+
registry=https://your-nexus-url/repository/npm-group/
|
|
91
|
+
//your-nexus-url/repository/npm-hosted/:_authToken=${NPM_TOKEN}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
2. Ustaw zmienną środowiskową z tokenem:
|
|
95
|
+
```bash
|
|
96
|
+
# Windows PowerShell
|
|
97
|
+
$env:NPM_TOKEN="your-token-here"
|
|
98
|
+
|
|
99
|
+
# Linux/Mac
|
|
100
|
+
export NPM_TOKEN="your-token-here"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Publikacja
|
|
104
|
+
|
|
105
|
+
1. Zbuduj bibliotekę:
|
|
106
|
+
```bash
|
|
107
|
+
ng build my-library
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
2. Przejdź do katalogu dist:
|
|
111
|
+
```bash
|
|
112
|
+
cd dist/my-library
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
3. Opublikuj do Nexus:
|
|
116
|
+
```bash
|
|
117
|
+
npm publish --registry=https://your-nexus-url/repository/npm-hosted/
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 🧪 Testy
|
|
121
|
+
|
|
122
|
+
Aby uruchomić testy jednostkowe:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
ng test my-library
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 📚 Dokumentacja
|
|
129
|
+
|
|
130
|
+
Szczegółowa dokumentacja dostępna jest w aplikacji dokumentacyjnej. Aby ją uruchomić:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npm start
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Aplikacja będzie dostępna pod adresem `http://localhost:4200`.
|
|
137
|
+
|
|
138
|
+
## 🤝 Współpraca
|
|
139
|
+
|
|
140
|
+
Zgłoszenia błędów i pull requesty są mile widziane!
|
|
141
|
+
|
|
142
|
+
## 📄 Licencja
|
|
143
|
+
|
|
144
|
+
MIT
|
|
145
|
+
|
|
146
|
+
## 🔗 Dodatkowe zasoby
|
|
147
|
+
|
|
148
|
+
- [Angular CLI Documentation](https://angular.dev/tools/cli)
|
|
149
|
+
- [Angular 20 Documentation](https://angular.dev)
|
|
150
|
+
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, EventEmitter, Output, Input, inject, signal, Injectable, input } from '@angular/core';
|
|
3
|
+
import { HttpClient } from '@angular/common/http';
|
|
4
|
+
import { tap } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
class MyLibrary {
|
|
7
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MyLibrary, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: MyLibrary, isStandalone: true, selector: "lib-my-library", ngImport: i0, template: `
|
|
9
|
+
<p>
|
|
10
|
+
my-library works!
|
|
11
|
+
</p>
|
|
12
|
+
`, isInline: true, styles: [""] });
|
|
13
|
+
}
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MyLibrary, decorators: [{
|
|
15
|
+
type: Component,
|
|
16
|
+
args: [{ selector: 'lib-my-library', imports: [], template: `
|
|
17
|
+
<p>
|
|
18
|
+
my-library works!
|
|
19
|
+
</p>
|
|
20
|
+
` }]
|
|
21
|
+
}] });
|
|
22
|
+
|
|
23
|
+
class Button {
|
|
24
|
+
type = 'button';
|
|
25
|
+
variant = 'primary';
|
|
26
|
+
disabled = false;
|
|
27
|
+
clicked = new EventEmitter();
|
|
28
|
+
onClick() {
|
|
29
|
+
if (!this.disabled) {
|
|
30
|
+
this.clicked.emit();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: Button, isStandalone: true, selector: "lib-button", inputs: { type: "type", variant: "variant", disabled: "disabled" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button [type]=\"type\" [class]=\"'lib-btn lib-btn-' + variant\" [disabled]=\"disabled\" (click)=\"onClick()\">\r\n <ng-content></ng-content>\r\n</button>", styles: [".lib-btn{padding:.75rem 1.5rem;border:none;border-radius:6px;font-size:1rem;font-weight:600;cursor:pointer;transition:all .3s ease;outline:none}.lib-btn:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 4px 12px #00000026}.lib-btn:active:not(:disabled){transform:translateY(0)}.lib-btn:disabled{opacity:.5;cursor:not-allowed}.lib-btn-primary{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff}.lib-btn-secondary{background:#6b7280;color:#fff}.lib-btn-danger{background:#ef4444;color:#fff}\n"] });
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: Button, decorators: [{
|
|
37
|
+
type: Component,
|
|
38
|
+
args: [{ selector: 'lib-button', imports: [], template: "<button [type]=\"type\" [class]=\"'lib-btn lib-btn-' + variant\" [disabled]=\"disabled\" (click)=\"onClick()\">\r\n <ng-content></ng-content>\r\n</button>", styles: [".lib-btn{padding:.75rem 1.5rem;border:none;border-radius:6px;font-size:1rem;font-weight:600;cursor:pointer;transition:all .3s ease;outline:none}.lib-btn:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 4px 12px #00000026}.lib-btn:active:not(:disabled){transform:translateY(0)}.lib-btn:disabled{opacity:.5;cursor:not-allowed}.lib-btn-primary{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff}.lib-btn-secondary{background:#6b7280;color:#fff}.lib-btn-danger{background:#ef4444;color:#fff}\n"] }]
|
|
39
|
+
}], propDecorators: { type: [{
|
|
40
|
+
type: Input
|
|
41
|
+
}], variant: [{
|
|
42
|
+
type: Input
|
|
43
|
+
}], disabled: [{
|
|
44
|
+
type: Input
|
|
45
|
+
}], clicked: [{
|
|
46
|
+
type: Output
|
|
47
|
+
}] } });
|
|
48
|
+
|
|
49
|
+
class ComarchDiskService {
|
|
50
|
+
http = inject(HttpClient);
|
|
51
|
+
loggedUser = signal(null, ...(ngDevMode ? [{ debugName: "loggedUser" }] : []));
|
|
52
|
+
login(tgt) {
|
|
53
|
+
return this.http.post('https://tst.ibard.com/api/v1/auth', { tgt }, { withCredentials: true }).pipe(
|
|
54
|
+
// Backend sets the cookie via Set-Cookie header
|
|
55
|
+
tap(response => {
|
|
56
|
+
if (response.session) {
|
|
57
|
+
this.setLoggedUser(response.session);
|
|
58
|
+
}
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
setLoggedUser(session) {
|
|
62
|
+
this.loggedUser.set(session);
|
|
63
|
+
}
|
|
64
|
+
getUserFiles() {
|
|
65
|
+
// this.setCookie('ibsession', this.loggedUser() || '');
|
|
66
|
+
return this.http.get('https://tst.ibard.com/api/v1/storage/personal/files/0/children', { withCredentials: true });
|
|
67
|
+
}
|
|
68
|
+
setCookie(cookieName, cookieValue) {
|
|
69
|
+
document.cookie = `${cookieName}=${cookieValue}; SameSite=None; Secure`;
|
|
70
|
+
}
|
|
71
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ComarchDiskService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
72
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ComarchDiskService });
|
|
73
|
+
}
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ComarchDiskService, decorators: [{
|
|
75
|
+
type: Injectable
|
|
76
|
+
}] });
|
|
77
|
+
|
|
78
|
+
class ComarchDisk {
|
|
79
|
+
tgt = input.required(...(ngDevMode ? [{ debugName: "tgt" }] : []));
|
|
80
|
+
diskService = inject(ComarchDiskService);
|
|
81
|
+
isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
82
|
+
userFiles = signal([], ...(ngDevMode ? [{ debugName: "userFiles" }] : []));
|
|
83
|
+
ngOnInit() {
|
|
84
|
+
this.loginUser();
|
|
85
|
+
}
|
|
86
|
+
loginUser() {
|
|
87
|
+
this.isLoading.set(true);
|
|
88
|
+
this.diskService.login(this.tgt()).subscribe({
|
|
89
|
+
next: (session) => this.handleLoggedUser(session),
|
|
90
|
+
error: () => { }
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
handleLoggedUser(session) {
|
|
94
|
+
this.isLoading.set(false);
|
|
95
|
+
this.diskService.setLoggedUser(session.sessionId);
|
|
96
|
+
this.loadUserFiles();
|
|
97
|
+
}
|
|
98
|
+
loadUserFiles() {
|
|
99
|
+
this.diskService.getUserFiles().subscribe({
|
|
100
|
+
next: (files) => {
|
|
101
|
+
console.log(files);
|
|
102
|
+
this.userFiles.set(files.items);
|
|
103
|
+
},
|
|
104
|
+
error: () => { }
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ComarchDisk, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
108
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ComarchDisk, isStandalone: true, selector: "lib-comarch-disk", inputs: { tgt: { classPropertyName: "tgt", publicName: "tgt", isSignal: true, isRequired: true, transformFunction: null } }, providers: [ComarchDiskService], ngImport: i0, template: "Dzie\u0144 dobry, witaj w Dysk Comarch!\r\n<br>\r\n<br>\r\n@for(file of userFiles(); track $index){\r\n<div class=\"cdisk-row\">\r\n <p>[{{ file.folder ? \"F\" : \"p\" }}]</p>\r\n <p>{{ file.name }}</p>\r\n</div>\r\n}", styles: [".cdisk-row{height:52px;border-bottom:1px solid #ccc;display:flex;flex-direction:row;align-items:center;gap:4px}\n"] });
|
|
109
|
+
}
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ComarchDisk, decorators: [{
|
|
111
|
+
type: Component,
|
|
112
|
+
args: [{ selector: 'lib-comarch-disk', imports: [], providers: [ComarchDiskService], template: "Dzie\u0144 dobry, witaj w Dysk Comarch!\r\n<br>\r\n<br>\r\n@for(file of userFiles(); track $index){\r\n<div class=\"cdisk-row\">\r\n <p>[{{ file.folder ? \"F\" : \"p\" }}]</p>\r\n <p>{{ file.name }}</p>\r\n</div>\r\n}", styles: [".cdisk-row{height:52px;border-bottom:1px solid #ccc;display:flex;flex-direction:row;align-items:center;gap:4px}\n"] }]
|
|
113
|
+
}], propDecorators: { tgt: [{ type: i0.Input, args: [{ isSignal: true, alias: "tgt", required: true }] }] } });
|
|
114
|
+
|
|
115
|
+
class Data {
|
|
116
|
+
dataSignal = signal([], ...(ngDevMode ? [{ debugName: "dataSignal" }] : []));
|
|
117
|
+
data = this.dataSignal.asReadonly();
|
|
118
|
+
addItem(item) {
|
|
119
|
+
this.dataSignal.update(items => [...items, item]);
|
|
120
|
+
}
|
|
121
|
+
removeItem(id) {
|
|
122
|
+
this.dataSignal.update(items => items.filter(item => item.id !== id));
|
|
123
|
+
}
|
|
124
|
+
getItem(id) {
|
|
125
|
+
return this.data().find(item => item.id === id);
|
|
126
|
+
}
|
|
127
|
+
clearAll() {
|
|
128
|
+
this.dataSignal.set([]);
|
|
129
|
+
}
|
|
130
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: Data, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
131
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: Data, providedIn: 'root' });
|
|
132
|
+
}
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: Data, decorators: [{
|
|
134
|
+
type: Injectable,
|
|
135
|
+
args: [{
|
|
136
|
+
providedIn: 'root',
|
|
137
|
+
}]
|
|
138
|
+
}] });
|
|
139
|
+
|
|
140
|
+
/*
|
|
141
|
+
* Public API Surface of my-library
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Generated bundle index. Do not edit.
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
export { Button, ComarchDisk, Data, MyLibrary };
|
|
149
|
+
//# sourceMappingURL=comarch-disk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comarch-disk.mjs","sources":["../../../projects/my-library/src/lib/my-library.ts","../../../projects/my-library/src/lib/button/button.ts","../../../projects/my-library/src/lib/button/button.html","../../../projects/my-library/src/lib/comarch-disk/comarch-disk-service.ts","../../../projects/my-library/src/lib/comarch-disk/comarch-disk.ts","../../../projects/my-library/src/lib/comarch-disk/comarch-disk.html","../../../projects/my-library/src/lib/data.ts","../../../projects/my-library/src/public-api.ts","../../../projects/my-library/src/comarch-disk.ts"],"sourcesContent":["import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-my-library',\r\n imports: [],\r\n template: `\r\n <p>\r\n my-library works!\r\n </p>\r\n `,\r\n styles: ``,\r\n})\r\nexport class MyLibrary {\r\n\r\n}\r\n","import { Component, Input, Output, EventEmitter } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-button',\r\n imports: [],\r\n templateUrl: './button.html',\r\n styleUrl: './button.css',\r\n})\r\nexport class Button {\r\n @Input() type: 'button' | 'submit' | 'reset' = 'button';\r\n @Input() variant: 'primary' | 'secondary' | 'danger' = 'primary';\r\n @Input() disabled = false;\r\n @Output() clicked = new EventEmitter<void>();\r\n\r\n onClick(): void {\r\n if (!this.disabled) {\r\n this.clicked.emit();\r\n }\r\n }\r\n}\r\n","<button [type]=\"type\" [class]=\"'lib-btn lib-btn-' + variant\" [disabled]=\"disabled\" (click)=\"onClick()\">\r\n <ng-content></ng-content>\r\n</button>","import { HttpClient, HttpHeaders } from \"@angular/common/http\";\r\nimport { inject, Injectable, signal } from \"@angular/core\";\r\nimport { of, tap } from \"rxjs\";\r\n\r\n@Injectable()\r\nexport class ComarchDiskService {\r\n http = inject(HttpClient);\r\n loggedUser = signal<string | null>(null);\r\n\r\n login(tgt: string) {\r\n return this.http.post<{ session?: string }>(\r\n 'https://tst.ibard.com/api/v1/auth',\r\n { tgt },\r\n { withCredentials: true }\r\n ).pipe(\r\n // Backend sets the cookie via Set-Cookie header\r\n tap(response => {\r\n if (response.session) {\r\n this.setLoggedUser(response.session);\r\n }\r\n })\r\n );\r\n }\r\n\r\n setLoggedUser(session: string) {\r\n this.loggedUser.set(session);\r\n }\r\n\r\n getUserFiles() {\r\n // this.setCookie('ibsession', this.loggedUser() || '');\r\n\r\n return this.http.get(\r\n 'https://tst.ibard.com/api/v1/storage/personal/files/0/children',\r\n { withCredentials: true }\r\n );\r\n }\r\n\r\n setCookie(cookieName: string, cookieValue: string) {\r\n document.cookie = `${cookieName}=${cookieValue}; SameSite=None; Secure`;\r\n }\r\n}\r\n","import { Component, effect, inject, input, OnInit, Signal, signal } from '@angular/core';\r\nimport { ComarchDiskService } from './comarch-disk-service';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\n\r\n@Component({\r\n selector: 'lib-comarch-disk',\r\n imports: [],\r\n templateUrl: './comarch-disk.html',\r\n styleUrl: './comarch-disk.css',\r\n providers: [ComarchDiskService],\r\n})\r\nexport class ComarchDisk implements OnInit {\r\n tgt = input.required<string>();\r\n diskService = inject(ComarchDiskService);\r\n isLoading = signal(true);\r\n userFiles = signal<any[]>([]);\r\n\r\n ngOnInit(): void {\r\n this.loginUser();\r\n }\r\n\r\n private loginUser(): void {\r\n this.isLoading.set(true);\r\n\r\n this.diskService.login(this.tgt()).subscribe({\r\n\r\n next: (session) => this.handleLoggedUser(session),\r\n error: () => { }\r\n })\r\n }\r\n\r\n private handleLoggedUser(session: any) {\r\n this.isLoading.set(false);\r\n this.diskService.setLoggedUser(session.sessionId);\r\n this.loadUserFiles();\r\n }\r\n\r\n private loadUserFiles(): void {\r\n this.diskService.getUserFiles().subscribe({\r\n next: (files: any) => {\r\n console.log(files)\r\n this.userFiles.set(files.items);\r\n },\r\n error: () => { }\r\n })\r\n }\r\n}\r\n","Dzień dobry, witaj w Dysk Comarch!\r\n<br>\r\n<br>\r\n@for(file of userFiles(); track $index){\r\n<div class=\"cdisk-row\">\r\n <p>[{{ file.folder ? \"F\" : \"p\" }}]</p>\r\n <p>{{ file.name }}</p>\r\n</div>\r\n}","import { Injectable, signal } from '@angular/core';\r\n\r\nexport interface DataItem {\r\n id: number;\r\n name: string;\r\n value: string;\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class Data {\r\n private dataSignal = signal<DataItem[]>([]);\r\n\r\n readonly data = this.dataSignal.asReadonly();\r\n\r\n addItem(item: DataItem): void {\r\n this.dataSignal.update(items => [...items, item]);\r\n }\r\n\r\n removeItem(id: number): void {\r\n this.dataSignal.update(items => items.filter(item => item.id !== id));\r\n }\r\n\r\n getItem(id: number): DataItem | undefined {\r\n return this.data().find(item => item.id === id);\r\n }\r\n\r\n clearAll(): void {\r\n this.dataSignal.set([]);\r\n }\r\n}\r\n","/*\r\n * Public API Surface of my-library\r\n */\r\n\r\nexport * from './lib/my-library';\r\nexport * from './lib/button/button';\r\nexport * from './lib/comarch-disk/comarch-disk';\r\nexport * from './lib/data';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAYa,SAAS,CAAA;wGAAT,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,QA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IAAI,EAAA,UAAA,EAAA,CAAA;kBAHhB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACVD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
3
|
+
import * as rxjs from 'rxjs';
|
|
4
|
+
import { HttpClient } from '@angular/common/http';
|
|
5
|
+
|
|
6
|
+
declare class MyLibrary {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MyLibrary, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MyLibrary, "lib-my-library", never, {}, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare class Button {
|
|
12
|
+
type: 'button' | 'submit' | 'reset';
|
|
13
|
+
variant: 'primary' | 'secondary' | 'danger';
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
clicked: EventEmitter<void>;
|
|
16
|
+
onClick(): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Button, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Button, "lib-button", never, { "type": { "alias": "type"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "clicked": "clicked"; }, never, ["*"], true, never>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare class ComarchDiskService {
|
|
22
|
+
http: HttpClient;
|
|
23
|
+
loggedUser: i0.WritableSignal<string | null>;
|
|
24
|
+
login(tgt: string): rxjs.Observable<{
|
|
25
|
+
session?: string;
|
|
26
|
+
}>;
|
|
27
|
+
setLoggedUser(session: string): void;
|
|
28
|
+
getUserFiles(): rxjs.Observable<Object>;
|
|
29
|
+
setCookie(cookieName: string, cookieValue: string): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ComarchDiskService, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ComarchDiskService>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare class ComarchDisk implements OnInit {
|
|
35
|
+
tgt: i0.InputSignal<string>;
|
|
36
|
+
diskService: ComarchDiskService;
|
|
37
|
+
isLoading: i0.WritableSignal<boolean>;
|
|
38
|
+
userFiles: i0.WritableSignal<any[]>;
|
|
39
|
+
ngOnInit(): void;
|
|
40
|
+
private loginUser;
|
|
41
|
+
private handleLoggedUser;
|
|
42
|
+
private loadUserFiles;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ComarchDisk, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ComarchDisk, "lib-comarch-disk", never, { "tgt": { "alias": "tgt"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface DataItem {
|
|
48
|
+
id: number;
|
|
49
|
+
name: string;
|
|
50
|
+
value: string;
|
|
51
|
+
}
|
|
52
|
+
declare class Data {
|
|
53
|
+
private dataSignal;
|
|
54
|
+
readonly data: i0.Signal<DataItem[]>;
|
|
55
|
+
addItem(item: DataItem): void;
|
|
56
|
+
removeItem(id: number): void;
|
|
57
|
+
getItem(id: number): DataItem | undefined;
|
|
58
|
+
clearAll(): void;
|
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Data, never>;
|
|
60
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<Data>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { Button, ComarchDisk, Data, MyLibrary };
|
|
64
|
+
export type { DataItem };
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "comarch-disk",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Nowoczesna biblioteka komponentów Angular 20",
|
|
5
|
+
"author": "Your Name",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/yourusername/my-library.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"angular",
|
|
13
|
+
"angular20",
|
|
14
|
+
"components",
|
|
15
|
+
"library",
|
|
16
|
+
"ui"
|
|
17
|
+
],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@angular/common": "^20.3.0",
|
|
20
|
+
"@angular/core": "^20.3.0"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tslib": "^2.3.0"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"module": "fesm2022/comarch-disk.mjs",
|
|
27
|
+
"typings": "index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
"./package.json": {
|
|
30
|
+
"default": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./index.d.ts",
|
|
34
|
+
"default": "./fesm2022/comarch-disk.mjs"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|