wacom 21.1.10 → 21.1.12
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 +26 -67
- package/fesm2022/wacom.mjs +35 -2
- package/fesm2022/wacom.mjs.map +1 -1
- package/package.json +1 -1
- package/types/wacom.d.ts +15 -1
package/README.md
CHANGED
|
@@ -36,11 +36,10 @@ export const appConfig = {
|
|
|
36
36
|
provideWacom({
|
|
37
37
|
http: { url: "https://api.example.com" },
|
|
38
38
|
store: { prefix: "waStore" },
|
|
39
|
-
meta: {
|
|
40
|
-
useTitleSuffix: false,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
39
|
+
meta: {
|
|
40
|
+
useTitleSuffix: false,
|
|
41
|
+
defaults: { links: {} },
|
|
42
|
+
},
|
|
44
43
|
network: {},
|
|
45
44
|
// enable and configure sockets if needed
|
|
46
45
|
socket: false,
|
|
@@ -55,7 +54,6 @@ export const appConfig = {
|
|
|
55
54
|
| Name | Description |
|
|
56
55
|
| -------------------------------------------------------------------- | :-----------------------------------------------------------------: |
|
|
57
56
|
| [**`Core`**](https://www.npmjs.com/package/wacom#core-service) | Common supportive function which can be used in any service |
|
|
58
|
-
| [**`Base`**](https://www.npmjs.com/package/wacom#base-service) | Tracks timestamps and can refresh to the current time |
|
|
59
57
|
| [**`Http`**](https://www.npmjs.com/package/wacom#http-service) | Http layer for HttpClient |
|
|
60
58
|
| [**`Store`**](https://www.npmjs.com/package/wacom#store-service) | Service responsible for keeping information on the device |
|
|
61
59
|
| [**`Meta`**](https://www.npmjs.com/package/wacom#meta-service) | Website meta tags management within router |
|
|
@@ -504,33 +502,7 @@ In this example:
|
|
|
504
502
|
|
|
505
503
|
This ensures controlled access to the resource, preventing race conditions and ensuring data integrity.
|
|
506
504
|
|
|
507
|
-
## [
|
|
508
|
-
|
|
509
|
-
The `BaseService` provides a minimal utility for tracking the current timestamp.
|
|
510
|
-
|
|
511
|
-
### Properties
|
|
512
|
-
|
|
513
|
-
- `now` (`number`): Stores the current timestamp in milliseconds.
|
|
514
|
-
|
|
515
|
-
### Methods
|
|
516
|
-
|
|
517
|
-
#### `refreshNow(): void`
|
|
518
|
-
|
|
519
|
-
Updates the `now` property to the current timestamp.
|
|
520
|
-
|
|
521
|
-
**Example**:
|
|
522
|
-
|
|
523
|
-
```Typescript
|
|
524
|
-
import { BaseService } from 'wacom';
|
|
525
|
-
|
|
526
|
-
constructor(private baseService: BaseService) {}
|
|
527
|
-
|
|
528
|
-
refresh() {
|
|
529
|
-
this.baseService.refreshNow();
|
|
530
|
-
}
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
## [Http Service](#http-service)
|
|
505
|
+
## [Http Service](#http-service)
|
|
534
506
|
|
|
535
507
|
The `HttpService` provides an HTTP layer for `HttpClient` in Angular, supporting both callbacks and observables for various HTTP operations.
|
|
536
508
|
|
|
@@ -1000,7 +972,7 @@ Sets the title and optional title suffix, updating the `title`, `og:title`, and
|
|
|
1000
972
|
metaService.setTitle('My Page Title', ' | My Website');
|
|
1001
973
|
```
|
|
1002
974
|
|
|
1003
|
-
#### `setLink(links: { [key: string]: string }):
|
|
975
|
+
#### `setLink(links: { [key: string]: string }): void`
|
|
1004
976
|
|
|
1005
977
|
Sets link tags.
|
|
1006
978
|
|
|
@@ -1065,16 +1037,6 @@ Updates a meta tag.
|
|
|
1065
1037
|
- `value` (string): The meta tag value.
|
|
1066
1038
|
- `prop` (string): The meta tag property.
|
|
1067
1039
|
|
|
1068
|
-
#### `_warnMissingGuard(): void`
|
|
1069
|
-
|
|
1070
|
-
Warns about missing meta guards in routes.
|
|
1071
|
-
|
|
1072
|
-
**Example**:
|
|
1073
|
-
|
|
1074
|
-
```Typescript
|
|
1075
|
-
metaService._warnMissingGuard();
|
|
1076
|
-
```
|
|
1077
|
-
|
|
1078
1040
|
## [Util Service](#util-service)
|
|
1079
1041
|
|
|
1080
1042
|
The `UtilService` manages various UI-related tasks in an Angular application, including CSS management, form validation, and generating sample data for UI components.
|
|
@@ -1469,14 +1431,13 @@ interface CrudDocument {
|
|
|
1469
1431
|
|
|
1470
1432
|
```typescript
|
|
1471
1433
|
import { Injectable } from "@angular/core";
|
|
1472
|
-
import {
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
} from "wacom";
|
|
1434
|
+
import {
|
|
1435
|
+
CoreService,
|
|
1436
|
+
HttpService,
|
|
1437
|
+
StoreService,
|
|
1438
|
+
CrudService,
|
|
1439
|
+
CrudDocument,
|
|
1440
|
+
} from "wacom";
|
|
1480
1441
|
|
|
1481
1442
|
export interface Work extends CrudDocument {
|
|
1482
1443
|
name: string;
|
|
@@ -1489,21 +1450,19 @@ export interface Work extends CrudDocument {
|
|
|
1489
1450
|
export class WorkService extends CrudService<Work> {
|
|
1490
1451
|
works: Work[] = this.getDocs();
|
|
1491
1452
|
|
|
1492
|
-
constructor(
|
|
1493
|
-
_http: HttpService,
|
|
1494
|
-
_store: StoreService,
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
_core,
|
|
1506
|
-
);
|
|
1453
|
+
constructor(
|
|
1454
|
+
_http: HttpService,
|
|
1455
|
+
_store: StoreService,
|
|
1456
|
+
_core: CoreService,
|
|
1457
|
+
) {
|
|
1458
|
+
super(
|
|
1459
|
+
{
|
|
1460
|
+
name: "work",
|
|
1461
|
+
},
|
|
1462
|
+
_http,
|
|
1463
|
+
_store,
|
|
1464
|
+
_core,
|
|
1465
|
+
);
|
|
1507
1466
|
|
|
1508
1467
|
this.get();
|
|
1509
1468
|
}
|
package/fesm2022/wacom.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { toObservable } from '@angular/core/rxjs-interop';
|
|
|
10
10
|
import * as i1$1 from '@angular/common/http';
|
|
11
11
|
import { HttpHeaders, HttpErrorResponse, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
12
12
|
import * as i1$2 from '@angular/common';
|
|
13
|
-
import { CommonModule } from '@angular/common';
|
|
13
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
14
14
|
import { FormsModule } from '@angular/forms';
|
|
15
15
|
|
|
16
16
|
const CONFIG_TOKEN = new InjectionToken('config');
|
|
@@ -4195,6 +4195,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
4195
4195
|
args: [{ providedIn: 'root' }]
|
|
4196
4196
|
}], ctorParameters: () => [] });
|
|
4197
4197
|
|
|
4198
|
+
class ThemeService {
|
|
4199
|
+
constructor() {
|
|
4200
|
+
this.doc = inject(DOCUMENT);
|
|
4201
|
+
}
|
|
4202
|
+
setRadius(radius) {
|
|
4203
|
+
this.doc.documentElement.dataset['radius'] = radius;
|
|
4204
|
+
localStorage.setItem('theme.radius', radius);
|
|
4205
|
+
}
|
|
4206
|
+
setMode(mode) {
|
|
4207
|
+
this.doc.documentElement.dataset['mode'] = mode;
|
|
4208
|
+
localStorage.setItem('theme.mode', mode);
|
|
4209
|
+
}
|
|
4210
|
+
setDensity(density) {
|
|
4211
|
+
this.doc.documentElement.dataset['density'] = density;
|
|
4212
|
+
localStorage.setItem('theme.density', density);
|
|
4213
|
+
}
|
|
4214
|
+
init() {
|
|
4215
|
+
this.doc.documentElement.dataset['mode'] =
|
|
4216
|
+
localStorage.getItem('theme.mode') || 'light';
|
|
4217
|
+
this.doc.documentElement.dataset['density'] =
|
|
4218
|
+
localStorage.getItem('theme.density') ||
|
|
4219
|
+
'comfortable';
|
|
4220
|
+
this.doc.documentElement.dataset['radius'] =
|
|
4221
|
+
localStorage.getItem('theme.radius') || 'rounded';
|
|
4222
|
+
}
|
|
4223
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4224
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
|
|
4225
|
+
}
|
|
4226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ThemeService, decorators: [{
|
|
4227
|
+
type: Injectable,
|
|
4228
|
+
args: [{ providedIn: 'root' }]
|
|
4229
|
+
}] });
|
|
4230
|
+
|
|
4198
4231
|
function provideWacom(config = DEFAULT_CONFIG) {
|
|
4199
4232
|
return makeEnvironmentProviders([
|
|
4200
4233
|
{ provide: CONFIG_TOKEN, useValue: config },
|
|
@@ -4267,5 +4300,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
4267
4300
|
* Generated bundle index. Do not edit.
|
|
4268
4301
|
*/
|
|
4269
4302
|
|
|
4270
|
-
export { ArrPipe, CONFIG_TOKEN, ClickOutsideDirective, CoreService, CrudComponent, CrudService, DEFAULT_CONFIG, DEFAULT_HTTP_CONFIG, DEFAULT_NETWORK_CONFIG, DomService, EmitterService, HttpService, ManualDisabledDirective, ManualNameDirective, ManualReadonlyDirective, ManualTypeDirective, MetaGuard, MetaService, MongodatePipe, NETWORK_CONFIG, NetworkService, NumberPipe, PaginationPipe, RtcService, SafePipe, SearchPipe, SocketService, SplicePipe, SplitPipe, StoreService, TimeService, UtilService, WacomModule, provideWacom };
|
|
4303
|
+
export { ArrPipe, CONFIG_TOKEN, ClickOutsideDirective, CoreService, CrudComponent, CrudService, DEFAULT_CONFIG, DEFAULT_HTTP_CONFIG, DEFAULT_NETWORK_CONFIG, DomService, EmitterService, HttpService, ManualDisabledDirective, ManualNameDirective, ManualReadonlyDirective, ManualTypeDirective, MetaGuard, MetaService, MongodatePipe, NETWORK_CONFIG, NetworkService, NumberPipe, PaginationPipe, RtcService, SafePipe, SearchPipe, SocketService, SplicePipe, SplitPipe, StoreService, ThemeService, TimeService, UtilService, WacomModule, provideWacom };
|
|
4271
4304
|
//# sourceMappingURL=wacom.mjs.map
|