ngx-techlify-core 22.6.0 → 22.9.0
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/fesm2022/{ngx-techlify-core-base-model-DfODc3ll.mjs → ngx-techlify-core-base-model-Dov5GFWY.mjs} +2 -2
- package/fesm2022/{ngx-techlify-core-base-model-DfODc3ll.mjs.map → ngx-techlify-core-base-model-Dov5GFWY.mjs.map} +1 -1
- package/fesm2022/{ngx-techlify-core-shared.module-C0uAKgWi.mjs → ngx-techlify-core-shared.module-DX3JOTS_.mjs} +9 -7
- package/fesm2022/ngx-techlify-core-shared.module-DX3JOTS_.mjs.map +1 -0
- package/fesm2022/{ngx-techlify-core-user-config.service-BTZUoFIT.mjs → ngx-techlify-core-user-config.service-pJHP4wxq.mjs} +2 -2
- package/fesm2022/{ngx-techlify-core-user-config.service-BTZUoFIT.mjs.map → ngx-techlify-core-user-config.service-pJHP4wxq.mjs.map} +1 -1
- package/fesm2022/{ngx-techlify-core-user-sessions.module-gmNNGpCf.mjs → ngx-techlify-core-user-sessions.module-DNb36-7n.mjs} +4 -4
- package/fesm2022/{ngx-techlify-core-user-sessions.module-gmNNGpCf.mjs.map → ngx-techlify-core-user-sessions.module-DNb36-7n.mjs.map} +1 -1
- package/fesm2022/ngx-techlify-core.mjs +525 -29
- package/fesm2022/ngx-techlify-core.mjs.map +1 -1
- package/package.json +2 -1
- package/styles/list-page.scss +186 -0
- package/styles/style.scss +1 -0
- package/types/ngx-techlify-core.d.ts +113 -1
- package/fesm2022/ngx-techlify-core-shared.module-C0uAKgWi.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-techlify-core",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.9.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": ">=22",
|
|
6
6
|
"@angular/core": ">=22",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"angular-google-charts": ">=16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
+
"@fortawesome/fontawesome-free": "^6.7.2",
|
|
18
19
|
"bootstrap": "^5.3.8",
|
|
19
20
|
"tslib": "^2.0.0",
|
|
20
21
|
"ngx-doc-viewer": "^15.0.0",
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// =====================================================================
|
|
2
|
+
// List page layout — responsive, reusable structure for list screens
|
|
3
|
+
// Shipped with ngx-techlify-core (styles/list-page.scss), included via styles/index.
|
|
4
|
+
// =====================================================================
|
|
5
|
+
//
|
|
6
|
+
// Apply these classes to any list page following one of the two standard structures.
|
|
7
|
+
//
|
|
8
|
+
// A) Main column + side filter panel (e.g. employee list):
|
|
9
|
+
//
|
|
10
|
+
// <div class="list-page m-2 d-flex flex-row">
|
|
11
|
+
// <div class="list-page-main d-flex flex-column flex-grow-1">
|
|
12
|
+
// <mat-card class="list-page-header ..."> title, actions, spacer
|
|
13
|
+
// ...
|
|
14
|
+
// <app-techlify-icon name="filter" class="list-page-filter-toggle clickable"
|
|
15
|
+
// (click)="isFilterPanelOpen = !isFilterPanelOpen"></app-techlify-icon>
|
|
16
|
+
// <span class="flex-grow-1"></span>
|
|
17
|
+
// <div class="list-page-stats">...</div> optional stat pills
|
|
18
|
+
// </mat-card>
|
|
19
|
+
// <mat-card class="list-page-content ...">...table...</mat-card>
|
|
20
|
+
// </div>
|
|
21
|
+
// <div class="list-page-side side-panel ms-2" [class.is-open]="isFilterPanelOpen">
|
|
22
|
+
// <mat-card>
|
|
23
|
+
// <form class="list-page-filters d-flex flex-column">...</form>
|
|
24
|
+
// </mat-card>
|
|
25
|
+
// </div>
|
|
26
|
+
// </div>
|
|
27
|
+
//
|
|
28
|
+
// B) Filters inline in the header card, no side panel (e.g. payroll list):
|
|
29
|
+
//
|
|
30
|
+
// <div class="list-page d-flex flex-column m-2">
|
|
31
|
+
// <mat-card class="list-page-header d-flex">
|
|
32
|
+
// <div>title, actions, <app-techlify-icon name="filter" class="list-page-filter-toggle" ...></div>
|
|
33
|
+
// <span class="flex-grow-1"></span>
|
|
34
|
+
// <div class="list-page-header-filters" [class.is-open]="isFilterPanelOpen">
|
|
35
|
+
// <form class="list-page-filters d-flex flex-row">...</form>
|
|
36
|
+
// </div>
|
|
37
|
+
// </mat-card>
|
|
38
|
+
// <mat-card class="list-page-content">...table...</mat-card>
|
|
39
|
+
// </div>
|
|
40
|
+
//
|
|
41
|
+
// Desktop (>= $list-page-stack-breakpoint): unchanged.
|
|
42
|
+
// Below it:
|
|
43
|
+
// * the page stacks into one column: header -> filters -> everything else (DOM order)
|
|
44
|
+
// * filters (side panel or header row) are hidden until `.is-open` is set
|
|
45
|
+
// (the filter toggle appears)
|
|
46
|
+
// * filters flow into a responsive grid; fixed filter widths (fl-sm, fl-md) are released
|
|
47
|
+
// * the table scrolls horizontally inside its card instead of the page
|
|
48
|
+
// =====================================================================
|
|
49
|
+
|
|
50
|
+
// Bootstrap breakpoint mixins (media-breakpoint-up/down) only — no CSS is emitted.
|
|
51
|
+
// Resolved from the consuming app's node_modules (bootstrap is a dependency of this package).
|
|
52
|
+
@import "bootstrap/scss/functions";
|
|
53
|
+
@import "bootstrap/scss/variables";
|
|
54
|
+
@import "bootstrap/scss/mixins/breakpoints";
|
|
55
|
+
|
|
56
|
+
// Width below which the side panel moves under the header. Matches the
|
|
57
|
+
// header nav collapse (navbar-expand-lg) and the dashboard stacking point.
|
|
58
|
+
$list-page-stack-breakpoint: lg !default;
|
|
59
|
+
|
|
60
|
+
// Lets the main column shrink so wide tables scroll inside their card
|
|
61
|
+
// rather than pushing the whole page wider than the viewport
|
|
62
|
+
.list-page-main {
|
|
63
|
+
min-width: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.list-page-content {
|
|
67
|
+
max-width: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Filter toggle only exists in the stacked layout
|
|
71
|
+
.list-page-filter-toggle {
|
|
72
|
+
display: none !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@include media-breakpoint-down($list-page-stack-breakpoint) {
|
|
76
|
+
// Doubled class: bootstrap.min.css loads after styles.scss, so `.flex-row` would otherwise win
|
|
77
|
+
.list-page.list-page {
|
|
78
|
+
flex-direction: column !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Dissolve the main column so header / side panel / content become siblings
|
|
82
|
+
// of .list-page and can be re-ordered
|
|
83
|
+
.list-page > .list-page-main {
|
|
84
|
+
display: contents !important;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Header first, filters second; any other card keeps its DOM order after them
|
|
88
|
+
.list-page-header {
|
|
89
|
+
order: -2;
|
|
90
|
+
flex-wrap: wrap;
|
|
91
|
+
row-gap: 0.5rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.list-page > .list-page-side {
|
|
95
|
+
order: -1;
|
|
96
|
+
width: 100% !important;
|
|
97
|
+
min-width: 0 !important;
|
|
98
|
+
margin: 0.5rem 0 0 !important;
|
|
99
|
+
|
|
100
|
+
&:not(.is-open) {
|
|
101
|
+
display: none !important;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Header filters drop onto their own full-width row inside the header card
|
|
106
|
+
.list-page-header-filters {
|
|
107
|
+
flex: 1 1 100%;
|
|
108
|
+
min-width: 0;
|
|
109
|
+
|
|
110
|
+
&:not(.is-open) {
|
|
111
|
+
display: none !important;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Scroll wide tables inside the card (covers pages without their own scroll wrapper)
|
|
116
|
+
.list-page-content {
|
|
117
|
+
min-width: 0;
|
|
118
|
+
overflow-x: auto;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.list-page-filter-toggle {
|
|
122
|
+
display: inline-flex !important;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.list-page-filter-toggle.is-active {
|
|
126
|
+
color: var(--bs-primary, #0d6efd);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Filters flow into as many columns as fit, instead of a single tall column
|
|
130
|
+
.list-page .list-page-filters {
|
|
131
|
+
display: grid !important;
|
|
132
|
+
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
133
|
+
column-gap: 0.5rem !important;
|
|
134
|
+
align-items: start;
|
|
135
|
+
|
|
136
|
+
// Release fixed desktop widths such as fl-sm / fl-md
|
|
137
|
+
> * {
|
|
138
|
+
width: auto !important;
|
|
139
|
+
min-width: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.mat-mdc-form-field {
|
|
143
|
+
width: 100% !important;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Keep cells on one line so rows stay compact and the table scrolls horizontally
|
|
148
|
+
// inside its card. Add `.list-page-wrap` to a cell for long free text (e.g. address).
|
|
149
|
+
.list-page-content {
|
|
150
|
+
.mat-mdc-header-cell,
|
|
151
|
+
.mat-mdc-footer-cell,
|
|
152
|
+
.mat-mdc-cell:not(.list-page-wrap) {
|
|
153
|
+
white-space: nowrap;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.mat-mdc-cell.list-page-wrap {
|
|
157
|
+
min-width: 200px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.mat-mdc-cell,
|
|
161
|
+
.mat-mdc-header-cell,
|
|
162
|
+
.mat-mdc-footer-cell {
|
|
163
|
+
padding-inline: 8px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@include media-breakpoint-down(sm) {
|
|
169
|
+
.list-page .mat-mdc-card {
|
|
170
|
+
padding: 12px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.list-page .list-page-content.mat-mdc-card {
|
|
174
|
+
padding: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Stat pills drop under the title and share the row equally
|
|
178
|
+
.list-page-stats {
|
|
179
|
+
flex: 1 1 100%;
|
|
180
|
+
|
|
181
|
+
> * {
|
|
182
|
+
flex: 1 1 0;
|
|
183
|
+
text-align: center;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
package/styles/style.scss
CHANGED
|
@@ -5287,6 +5287,74 @@ export declare class NumberSelectorComponent implements ControlValueAccessor, Ma
|
|
|
5287
5287
|
}, {}, never, never, true, never>;
|
|
5288
5288
|
static ngAcceptInputType_required: unknown;
|
|
5289
5289
|
}
|
|
5290
|
+
export interface PeriodOption<T = any> {
|
|
5291
|
+
value: T;
|
|
5292
|
+
label: string;
|
|
5293
|
+
}
|
|
5294
|
+
export declare const DEFAULT_PERIOD_OPTIONS: PeriodOption<string>[];
|
|
5295
|
+
export declare class TechlifyPeriodSelectorComponent implements ControlValueAccessor, MatFormFieldControl<any>, OnDestroy {
|
|
5296
|
+
static nextId: number;
|
|
5297
|
+
readonly options: import("@angular/core").InputSignal<(string | PeriodOption<any>)[]>;
|
|
5298
|
+
readonly placeholderInput: import("@angular/core").InputSignal<string>;
|
|
5299
|
+
readonly requiredInput: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
5300
|
+
readonly items: import("@angular/core").Signal<PeriodOption<any>[]>;
|
|
5301
|
+
readonly selected: import("@angular/core").WritableSignal<any>;
|
|
5302
|
+
readonly isDisabled: import("@angular/core").WritableSignal<boolean>;
|
|
5303
|
+
readonly isFocused: import("@angular/core").WritableSignal<boolean>;
|
|
5304
|
+
readonly ariaDescribedBy: import("@angular/core").WritableSignal<string>;
|
|
5305
|
+
readonly ngControl: NgControl;
|
|
5306
|
+
readonly stateChanges: Subject<void>;
|
|
5307
|
+
readonly controlType = "techlify-period-selector";
|
|
5308
|
+
readonly id: string;
|
|
5309
|
+
private readonly focusMonitor;
|
|
5310
|
+
private readonly elementRef;
|
|
5311
|
+
private readonly select;
|
|
5312
|
+
private onChange;
|
|
5313
|
+
private onTouched;
|
|
5314
|
+
get value(): any;
|
|
5315
|
+
get placeholder(): string;
|
|
5316
|
+
get required(): boolean;
|
|
5317
|
+
get disabled(): boolean;
|
|
5318
|
+
get focused(): boolean;
|
|
5319
|
+
get empty(): boolean;
|
|
5320
|
+
get shouldLabelFloat(): boolean;
|
|
5321
|
+
get errorState(): boolean;
|
|
5322
|
+
constructor();
|
|
5323
|
+
setDescribedByIds(ids: string[]): void;
|
|
5324
|
+
/**
|
|
5325
|
+
* Clicking anywhere in the form field opens the options
|
|
5326
|
+
*
|
|
5327
|
+
* Except clicks from the options panel: it's rendered inside the form field, so selecting an option
|
|
5328
|
+
* bubbles here right after the select closes, which would reopen it invisibly with its backdrop blocking the page
|
|
5329
|
+
*
|
|
5330
|
+
* @param event the click in the form field
|
|
5331
|
+
*/
|
|
5332
|
+
onContainerClick(event?: MouseEvent): void;
|
|
5333
|
+
writeValue(value: any): void;
|
|
5334
|
+
registerOnChange(fn: (value: any) => void): void;
|
|
5335
|
+
registerOnTouched(fn: () => void): void;
|
|
5336
|
+
setDisabledState(isDisabled: boolean): void;
|
|
5337
|
+
handleChange(value: any): void;
|
|
5338
|
+
ngOnDestroy(): void;
|
|
5339
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TechlifyPeriodSelectorComponent, never>;
|
|
5340
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TechlifyPeriodSelectorComponent, "techlify-period-selector", never, {
|
|
5341
|
+
"options": {
|
|
5342
|
+
"alias": "options";
|
|
5343
|
+
"required": false;
|
|
5344
|
+
"isSignal": true;
|
|
5345
|
+
};
|
|
5346
|
+
"placeholderInput": {
|
|
5347
|
+
"alias": "placeholder";
|
|
5348
|
+
"required": false;
|
|
5349
|
+
"isSignal": true;
|
|
5350
|
+
};
|
|
5351
|
+
"requiredInput": {
|
|
5352
|
+
"alias": "required";
|
|
5353
|
+
"required": false;
|
|
5354
|
+
"isSignal": true;
|
|
5355
|
+
};
|
|
5356
|
+
}, {}, never, never, true, never>;
|
|
5357
|
+
}
|
|
5290
5358
|
export declare class CountryService extends TechlifyService {
|
|
5291
5359
|
protected http: HttpService;
|
|
5292
5360
|
private countries?;
|
|
@@ -6316,6 +6384,16 @@ export interface AggregateData {
|
|
|
6316
6384
|
[columnKey: string]: number;
|
|
6317
6385
|
};
|
|
6318
6386
|
}
|
|
6387
|
+
/** Ways the chart's data can be displayed */
|
|
6388
|
+
export type TechlifyChartView = 'chart' | 'table';
|
|
6389
|
+
/** A column of the table view */
|
|
6390
|
+
export interface TechlifyChartTableColumn {
|
|
6391
|
+
id: string;
|
|
6392
|
+
label: string;
|
|
6393
|
+
isNumber: boolean;
|
|
6394
|
+
/** Total of a value column, null when there's no total */
|
|
6395
|
+
total: number | null;
|
|
6396
|
+
}
|
|
6319
6397
|
/**
|
|
6320
6398
|
* Loads aggregated data from an endpoint and displays it as a google chart
|
|
6321
6399
|
*
|
|
@@ -6362,9 +6440,21 @@ export declare class TechlifyChartComponent implements OnChanges {
|
|
|
6362
6440
|
colors: {
|
|
6363
6441
|
[label: string]: string;
|
|
6364
6442
|
};
|
|
6443
|
+
/** Display the data as a chart or a table, supports two way binding, i.e. [(view)]="view" */
|
|
6444
|
+
view: TechlifyChartView;
|
|
6445
|
+
/** Show the selector to switch between the chart and table views */
|
|
6446
|
+
showViewSelector: boolean;
|
|
6447
|
+
/** Emits the view when switched by the selector */
|
|
6448
|
+
viewChange: EventEmitter<TechlifyChartView>;
|
|
6365
6449
|
/** Emits the loaded data, i.e. to show the totals */
|
|
6366
6450
|
loaded: EventEmitter<AggregateData>;
|
|
6367
6451
|
data: AggregateData;
|
|
6452
|
+
/** Columns, their def names and rows of the table view: the formatted x, then a value per column */
|
|
6453
|
+
tableColumns: TechlifyChartTableColumn[];
|
|
6454
|
+
displayedColumns: string[];
|
|
6455
|
+
tableData: any[][];
|
|
6456
|
+
/** Show a footer row of the totals, when the data has any */
|
|
6457
|
+
hasTotals: boolean;
|
|
6368
6458
|
chartColumns: any[];
|
|
6369
6459
|
chartData: any[][];
|
|
6370
6460
|
options: any;
|
|
@@ -6378,6 +6468,12 @@ export declare class TechlifyChartComponent implements OnChanges {
|
|
|
6378
6468
|
constructor();
|
|
6379
6469
|
/** The type as google chart's enum, as the type input also accepts its value, i.e. type="LineChart" */
|
|
6380
6470
|
get chartType(): ChartType;
|
|
6471
|
+
/**
|
|
6472
|
+
* Switches the view, i.e. from the view selector
|
|
6473
|
+
*
|
|
6474
|
+
* @param view the view to display
|
|
6475
|
+
*/
|
|
6476
|
+
setView(view: TechlifyChartView): void;
|
|
6381
6477
|
/**
|
|
6382
6478
|
* Reload when the request changes, otherwise only redraw, i.e. when the chart options change
|
|
6383
6479
|
*/
|
|
@@ -6389,9 +6485,16 @@ export declare class TechlifyChartComponent implements OnChanges {
|
|
|
6389
6485
|
[key: string]: any;
|
|
6390
6486
|
};
|
|
6391
6487
|
/**
|
|
6392
|
-
* Converts the data into the google chart's columns, rows and options
|
|
6488
|
+
* Converts the data into the google chart's columns, rows and options, and the table view's
|
|
6393
6489
|
*/
|
|
6394
6490
|
render(): void;
|
|
6491
|
+
/**
|
|
6492
|
+
* Converts the data into the table view's columns, rows and totals, the same data as the chart
|
|
6493
|
+
*
|
|
6494
|
+
* @param xColumn the x column
|
|
6495
|
+
* @param valueColumns a column per series value and aggregate
|
|
6496
|
+
*/
|
|
6497
|
+
renderTable(xColumn: AggregateColumn, valueColumns: AggregateColumn[]): void;
|
|
6395
6498
|
/**
|
|
6396
6499
|
* Returns a random hex color
|
|
6397
6500
|
*/
|
|
@@ -6461,7 +6564,16 @@ export declare class TechlifyChartComponent implements OnChanges {
|
|
|
6461
6564
|
"alias": "colors";
|
|
6462
6565
|
"required": false;
|
|
6463
6566
|
};
|
|
6567
|
+
"view": {
|
|
6568
|
+
"alias": "view";
|
|
6569
|
+
"required": false;
|
|
6570
|
+
};
|
|
6571
|
+
"showViewSelector": {
|
|
6572
|
+
"alias": "showViewSelector";
|
|
6573
|
+
"required": false;
|
|
6574
|
+
};
|
|
6464
6575
|
}, {
|
|
6576
|
+
"viewChange": "viewChange";
|
|
6465
6577
|
"loaded": "loaded";
|
|
6466
6578
|
}, never, ["*"], true, never>;
|
|
6467
6579
|
}
|