ngx-techlify-core 22.2.0 → 22.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-techlify-core",
3
- "version": "22.2.0",
3
+ "version": "22.4.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22",
6
6
  "@angular/core": ">=22",
@@ -15,7 +15,8 @@
15
15
  "@angular/cdk": ">=22",
16
16
  "rxjs": ">=7.8.1",
17
17
  "zone.js": ">=0.15.0",
18
- "ngx-infinite-scroll": ">=22.0.0"
18
+ "ngx-infinite-scroll": ">=22.0.0",
19
+ "angular-google-charts": ">=16.0.0"
19
20
  },
20
21
  "dependencies": {
21
22
  "bootstrap": "5.2",
@@ -58,6 +58,7 @@ import * as i3$1 from "ngx-editor";
58
58
  import { Editor, Toolbar } from "ngx-editor";
59
59
  import { NgxSpinnerService } from "ngx-spinner";
60
60
  import * as i3 from "@angular/cdk/overlay";
61
+ import { ChartType } from "angular-google-charts";
61
62
  export declare class ActionPopup {
62
63
  name: string;
63
64
  title: string;
@@ -978,9 +979,17 @@ export declare class TechlifyFormButtonComponent {
978
979
  model: import("@angular/core").InputSignal<any>;
979
980
  data: import("@angular/core").InputSignal<Record<string, any>>;
980
981
  width: import("@angular/core").InputSignal<string>;
982
+ tooltip: import("@angular/core").InputSignal<string>;
983
+ /** Optional dialog component for adding multiple records at once; shows a "multi add" icon when set (create mode only) */
984
+ multiAddComponent: import("@angular/core").InputSignal<Type<any>>;
985
+ /** Dialog data for the multi add dialog; falls back to `data` when not provided */
986
+ multiAddData: import("@angular/core").InputSignal<any>;
987
+ multiAddWidth: import("@angular/core").InputSignal<string>;
988
+ multiAddTooltip: import("@angular/core").InputSignal<string>;
981
989
  saved: import("@angular/core").OutputEmitterRef<any>;
982
990
  constructor(matDialog: MatDialog);
983
991
  open(): void;
992
+ openMultiAdd(): void;
984
993
  static ɵfac: i0.ɵɵFactoryDeclaration<TechlifyFormButtonComponent, never>;
985
994
  static ɵcmp: i0.ɵɵComponentDeclaration<TechlifyFormButtonComponent, "app-techlify-form-button", never, {
986
995
  "component": {
@@ -1003,6 +1012,31 @@ export declare class TechlifyFormButtonComponent {
1003
1012
  "required": false;
1004
1013
  "isSignal": true;
1005
1014
  };
1015
+ "tooltip": {
1016
+ "alias": "tooltip";
1017
+ "required": false;
1018
+ "isSignal": true;
1019
+ };
1020
+ "multiAddComponent": {
1021
+ "alias": "multiAddComponent";
1022
+ "required": false;
1023
+ "isSignal": true;
1024
+ };
1025
+ "multiAddData": {
1026
+ "alias": "multiAddData";
1027
+ "required": false;
1028
+ "isSignal": true;
1029
+ };
1030
+ "multiAddWidth": {
1031
+ "alias": "multiAddWidth";
1032
+ "required": false;
1033
+ "isSignal": true;
1034
+ };
1035
+ "multiAddTooltip": {
1036
+ "alias": "multiAddTooltip";
1037
+ "required": false;
1038
+ "isSignal": true;
1039
+ };
1006
1040
  }, {
1007
1041
  "saved": "saved";
1008
1042
  }, never, never, true, never>;
@@ -6261,4 +6295,168 @@ export declare class DatetimeLocalDirective implements ControlValueAccessor {
6261
6295
  };
6262
6296
  }, {}, never, never, true, never>;
6263
6297
  }
6298
+ /** A column of aggregated data: the x column, then a column per series value and aggregate */
6299
+ export interface AggregateColumn {
6300
+ key: string;
6301
+ label: string;
6302
+ type: 'text' | 'date' | 'number';
6303
+ interval?: string | number;
6304
+ }
6305
+ /** Aggregated data, as returned by an aggregate endpoint, i.e. api/employee-data/aggregate */
6306
+ export interface AggregateData {
6307
+ columns: AggregateColumn[];
6308
+ rows: any[][];
6309
+ totals: {
6310
+ [columnKey: string]: number;
6311
+ };
6312
+ }
6313
+ /**
6314
+ * Loads aggregated data from an endpoint and displays it as a google chart
6315
+ *
6316
+ * The x, series, y and filters are sent as the request params, see ModelDataController in laravel-core.
6317
+ * A custom endpoint can be used instead, i.e. for a calculation the generic aggregation can't do,
6318
+ * as long as it returns the same AggregateData format
6319
+ *
6320
+ * Needs provideGoogleCharts() in the app providers, so all charts share the one script loader
6321
+ *
6322
+ * @example
6323
+ * <app-techlify-chart title="Employees per Branch" url="api/employee-data/aggregate" [filters]="filters"
6324
+ * x="branch.title" series="gender.title" y="count"></app-techlify-chart>
6325
+ */
6326
+ export declare class TechlifyChartComponent implements OnChanges {
6327
+ /** Endpoint returning AggregateData */
6328
+ url: string;
6329
+ /** Filters of the model, i.e. { branch_ids: [1, 2], date_from: '2024-01-01' }. Arrays are sent comma separated */
6330
+ filters: {
6331
+ [key: string]: any;
6332
+ };
6333
+ /** Field to group by, on the x-axis: a column, i.e. join_date, or relation.column, i.e. branch.title */
6334
+ x: string;
6335
+ /** Date fields: day|week|month|quarter|year, number fields: the bucket size, i.e. 10 for age ranges */
6336
+ xInterval: string | number;
6337
+ /** moment format for date x values, defaults by the interval */
6338
+ xFormat: string;
6339
+ /** Field to split each group by, as a line/bar per value */
6340
+ series: string;
6341
+ /** Aggregates: count, or <sum|avg|min|max>:<number field> */
6342
+ y: string | string[];
6343
+ /** Show running totals along x */
6344
+ cumulative: boolean;
6345
+ /** Any other request params, i.e. for a custom endpoint */
6346
+ params: {
6347
+ [key: string]: any;
6348
+ };
6349
+ /** Chart type, i.e. ColumnChart, LineChart or PieChart */
6350
+ type: `${ChartType}`;
6351
+ title: string;
6352
+ subtitle: string;
6353
+ /** Google chart options, merged over the defaults */
6354
+ chartOptions: any;
6355
+ /** Colors of specific series by label, i.e. { Male: '#05A9F4' }. Others keep the chart's default colors */
6356
+ colors: {
6357
+ [label: string]: string;
6358
+ };
6359
+ /** Emits the loaded data, i.e. to show the totals */
6360
+ loaded: EventEmitter<AggregateData>;
6361
+ data: AggregateData;
6362
+ chartColumns: any[];
6363
+ chartData: any[][];
6364
+ options: any;
6365
+ isLoading: boolean;
6366
+ hasError: boolean;
6367
+ private readonly http;
6368
+ private readonly requestHelperService;
6369
+ private readonly changeDetector;
6370
+ private readonly load$;
6371
+ private lastRequest;
6372
+ constructor();
6373
+ /** The type as google chart's enum, as the type input also accepts its value, i.e. type="LineChart" */
6374
+ get chartType(): ChartType;
6375
+ /**
6376
+ * Reload when the request changes, otherwise only redraw, i.e. when the chart options change
6377
+ */
6378
+ ngOnChanges(): void;
6379
+ /**
6380
+ * Returns the request params, without unset values, formatted as list filters, i.e. arrays comma separated
6381
+ */
6382
+ getParams(): {
6383
+ [key: string]: any;
6384
+ };
6385
+ /**
6386
+ * Converts the data into the google chart's columns, rows and options
6387
+ */
6388
+ render(): void;
6389
+ /**
6390
+ * Returns a random hex color
6391
+ */
6392
+ generateColor(): string;
6393
+ /**
6394
+ * Returns the x value as displayed, formatting dates and number ranges
6395
+ *
6396
+ * @param value x value of a row
6397
+ * @param column the x column
6398
+ */
6399
+ formatX(value: any, column: AggregateColumn): string;
6400
+ static ɵfac: i0.ɵɵFactoryDeclaration<TechlifyChartComponent, never>;
6401
+ static ɵcmp: i0.ɵɵComponentDeclaration<TechlifyChartComponent, "app-techlify-chart", never, {
6402
+ "url": {
6403
+ "alias": "url";
6404
+ "required": true;
6405
+ };
6406
+ "filters": {
6407
+ "alias": "filters";
6408
+ "required": false;
6409
+ };
6410
+ "x": {
6411
+ "alias": "x";
6412
+ "required": false;
6413
+ };
6414
+ "xInterval": {
6415
+ "alias": "xInterval";
6416
+ "required": false;
6417
+ };
6418
+ "xFormat": {
6419
+ "alias": "xFormat";
6420
+ "required": false;
6421
+ };
6422
+ "series": {
6423
+ "alias": "series";
6424
+ "required": false;
6425
+ };
6426
+ "y": {
6427
+ "alias": "y";
6428
+ "required": false;
6429
+ };
6430
+ "cumulative": {
6431
+ "alias": "cumulative";
6432
+ "required": false;
6433
+ };
6434
+ "params": {
6435
+ "alias": "params";
6436
+ "required": false;
6437
+ };
6438
+ "type": {
6439
+ "alias": "type";
6440
+ "required": false;
6441
+ };
6442
+ "title": {
6443
+ "alias": "title";
6444
+ "required": false;
6445
+ };
6446
+ "subtitle": {
6447
+ "alias": "subtitle";
6448
+ "required": false;
6449
+ };
6450
+ "chartOptions": {
6451
+ "alias": "chartOptions";
6452
+ "required": false;
6453
+ };
6454
+ "colors": {
6455
+ "alias": "colors";
6456
+ "required": false;
6457
+ };
6458
+ }, {
6459
+ "loaded": "loaded";
6460
+ }, never, ["*"], true, never>;
6461
+ }
6264
6462
  export { EntityFileListModule as EntityFilesViewAllModule };