osi-cards-lib 1.5.45 → 1.5.47

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/index.d.ts CHANGED
@@ -3,6 +3,8 @@ import { InjectionToken, OnDestroy, Type, OnChanges, EventEmitter, ChangeDetecto
3
3
  import * as rxjs from 'rxjs';
4
4
  import { Observable, Subscription } from 'rxjs';
5
5
  import * as lucide_angular from 'lucide-angular';
6
+ import { ChartData as ChartData$1, ChartOptions, ChartType as ChartType$1 } from 'chart.js';
7
+ import { BaseChartDirective } from 'ng2-charts';
6
8
 
7
9
  /**
8
10
  * OSI Cards Branded Types
@@ -2969,6 +2971,27 @@ interface SectionDesignParams extends SectionColorParams, SectionBorderParams, S
2969
2971
  customVars?: Record<string, string>;
2970
2972
  }
2971
2973
 
2974
+ /**
2975
+ * Layout configuration for a section type.
2976
+ * Each section component defines its own static layoutConfig.
2977
+ * @deprecated Use SectionLayoutPreferences instead
2978
+ */
2979
+ interface SectionLayoutConfig {
2980
+ /** Preferred column span (1-4) */
2981
+ preferredColumns: number;
2982
+ /** Minimum columns the section should span */
2983
+ minColumns: number;
2984
+ /** Maximum columns the section can span */
2985
+ maxColumns: number;
2986
+ /** Expand by 1 column when field count exceeds this threshold */
2987
+ expandOnFieldCount?: number;
2988
+ /** Expand by 1 column when item count exceeds this threshold */
2989
+ expandOnItemCount?: number;
2990
+ /** Expand by 1 column when description exceeds this character count */
2991
+ expandOnDescriptionLength?: number;
2992
+ /** For horizontal layouts: set columns to match item count (up to maxColumns) */
2993
+ matchItemCount?: boolean;
2994
+ }
2972
2995
  /**
2973
2996
  * Layout preferences for a section component.
2974
2997
  * Each section component defines its own responsive behavior dynamically.
@@ -6838,6 +6861,7 @@ declare const ICONS: {
6838
6861
  Code2: lucide_angular.LucideIconData;
6839
6862
  Calculator: lucide_angular.LucideIconData;
6840
6863
  Cog: lucide_angular.LucideIconData;
6864
+ Copy: lucide_angular.LucideIconData;
6841
6865
  ExternalLink: lucide_angular.LucideIconData;
6842
6866
  Facebook: lucide_angular.LucideIconData;
6843
6867
  DollarSign: lucide_angular.LucideIconData;
@@ -10207,66 +10231,130 @@ declare class BrandColorsSectionComponent extends BaseSectionComponent implement
10207
10231
  }
10208
10232
 
10209
10233
  /**
10210
- * Chart Section Component
10234
+ * Chart data interface
10235
+ */
10236
+ interface ChartDataset {
10237
+ label?: string;
10238
+ data: number[];
10239
+ backgroundColor?: string | string[];
10240
+ borderColor?: string | string[];
10241
+ borderWidth?: number;
10242
+ }
10243
+ /**
10244
+ * Chart configuration
10245
+ */
10246
+ interface ChartConfig {
10247
+ labels: string[];
10248
+ datasets: ChartDataset[];
10249
+ type: 'bar' | 'line' | 'pie' | 'doughnut';
10250
+ }
10251
+ /**
10252
+ * Abstract base for sections with data visualizations.
10211
10253
  *
10212
- * Displays data visualizations using Frappe Charts.
10213
- * Supports: bar, line, pie, percentage (doughnut), area charts.
10254
+ * Use this for:
10255
+ * - Chart Section
10256
+ * - Analytics sections with charts
10214
10257
  *
10215
- * Note: Requires frappe-charts to be installed.
10258
+ * @example
10259
+ * ```typescript
10260
+ * @Component({...})
10261
+ * export class ChartSectionComponent extends ChartSectionBaseComponent {
10262
+ * static override readonly layoutConfig: SectionLayoutConfig = {
10263
+ * preferredColumns: 2,
10264
+ * minColumns: 1,
10265
+ * maxColumns: 4
10266
+ * };
10267
+ * }
10268
+ * ```
10216
10269
  */
10217
- declare class ChartSectionComponent extends BaseSectionComponent implements AfterViewInit, OnDestroy, OnInit, OnChanges {
10218
- private readonly layoutService;
10219
- ngOnInit(): void;
10220
- chartContainer?: ElementRef<HTMLDivElement>;
10221
- private chartInstance;
10222
- protected chartLibraryLoaded: boolean;
10223
- protected chartError: string | null;
10224
- private previousChartType;
10225
- private previousChartDataHash;
10226
- private isRendering;
10227
- ngAfterViewInit(): void;
10228
- ngOnDestroy(): void;
10229
- ngOnChanges(changes: SimpleChanges): void;
10270
+ declare abstract class ChartSectionBaseComponent extends BaseSectionComponent {
10230
10271
  /**
10231
- * Render chart using Frappe Charts (if available)
10272
+ * Override in subclass to customize layout behavior
10232
10273
  */
10233
- private renderChart;
10274
+ static readonly layoutConfig: SectionLayoutConfig;
10234
10275
  /**
10235
- * Update existing chart with new data
10276
+ * Whether the chart library is loaded
10236
10277
  */
10237
- private updateChart;
10278
+ protected chartLibraryLoaded: i0.WritableSignal<boolean>;
10238
10279
  /**
10239
- * Convert Chart.js data format to Frappe Charts format
10280
+ * Chart loading error
10240
10281
  */
10241
- private convertToFrappeFormat;
10282
+ protected chartError: i0.WritableSignal<string | null>;
10242
10283
  /**
10243
- * Map Chart.js chart types to Frappe Charts types
10284
+ * Chart type (bar, line, pie, doughnut)
10244
10285
  */
10245
- private mapChartType;
10286
+ readonly chartType: i0.Signal<"bar" | "line" | "pie" | "doughnut">;
10246
10287
  /**
10247
- * Extract colors from Chart.js format
10288
+ * Processed chart configuration
10248
10289
  */
10249
- private extractColors;
10290
+ readonly chartConfig: i0.Signal<ChartConfig | null>;
10291
+ /**
10292
+ * Whether the chart has valid data
10293
+ */
10294
+ readonly hasValidData: i0.Signal<boolean>;
10295
+ /**
10296
+ * Total value across all datasets
10297
+ */
10298
+ readonly totalValue: i0.Signal<number>;
10299
+ /**
10300
+ * Load the chart library dynamically
10301
+ */
10302
+ protected abstract loadChartLibrary(): Promise<void>;
10303
+ /**
10304
+ * Initialize the chart
10305
+ */
10306
+ protected abstract initializeChart(): void;
10307
+ /**
10308
+ * Update the chart with new data
10309
+ */
10310
+ protected abstract updateChart(): void;
10311
+ /**
10312
+ * Destroy the chart instance
10313
+ */
10314
+ protected abstract destroyChart(): void;
10315
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartSectionBaseComponent, never>;
10316
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartSectionBaseComponent, "ng-component", never, {}, {}, never, never, true, never>;
10317
+ }
10318
+
10319
+ /**
10320
+ * Chart Section Component
10321
+ *
10322
+ * Displays data visualizations using Chart.js library.
10323
+ * Supports bar, line, pie, and doughnut chart types.
10324
+ *
10325
+ * Note: Requires Chart.js library to be installed.
10326
+ */
10327
+ declare class ChartSectionComponent extends ChartSectionBaseComponent implements AfterViewInit, OnDestroy, OnInit {
10328
+ private readonly layoutService;
10329
+ chart?: BaseChartDirective;
10330
+ chartInitFailed: boolean;
10331
+ chartLoading: boolean;
10332
+ chartData: ChartData$1<'bar' | 'line' | 'pie' | 'doughnut'>;
10333
+ chartOptions: ChartOptions;
10334
+ chartJsType: ChartType$1;
10335
+ ngOnInit(): void;
10336
+ ngAfterViewInit(): void;
10337
+ ngOnDestroy(): void;
10250
10338
  /**
10251
- * Detect if chart data contains revenue/monetary values
10339
+ * Load Chart.js library dynamically
10252
10340
  */
10253
- private detectRevenueData;
10341
+ protected loadChartLibrary(): Promise<void>;
10254
10342
  /**
10255
- * Format value as currency
10343
+ * Initialize the chart
10256
10344
  */
10257
- private formatCurrency;
10345
+ protected initializeChart(): Promise<void>;
10258
10346
  /**
10259
- * Fix Y-axis label rendering issues
10347
+ * Update chart data from ChartConfig
10260
10348
  */
10261
- private fixYAxisLabels;
10349
+ private updateChartData;
10262
10350
  /**
10263
- * Fix legend label truncation
10351
+ * Update the chart with new data
10264
10352
  */
10265
- private fixLegendLabels;
10353
+ protected updateChart(): void;
10266
10354
  /**
10267
- * Destroy chart instance
10355
+ * Destroy the chart instance
10268
10356
  */
10269
- private destroyChart;
10357
+ protected destroyChart(): void;
10270
10358
  /**
10271
10359
  * Calculate layout preferences for chart section based on content.
10272
10360
  * Chart sections: 2 cols default, can shrink to 1, expands to 3-4 for wide charts
@@ -11572,11 +11660,11 @@ declare function packWithZeroGapsGuarantee(sections: CardSection[], columns?: nu
11572
11660
  * Do not edit manually - generated by scripts/generate-version.js
11573
11661
  *
11574
11662
  * Source of truth: version.config.json
11575
- * Last synced: 2026-01-08T11:23:10.755Z
11663
+ * Last synced: 2026-01-08T14:14:54.922Z
11576
11664
  */
11577
- declare const VERSION = "1.5.45";
11578
- declare const BUILD_DATE = "2026-01-08T11:23:10.755Z";
11579
- declare const BUILD_HASH = "6af2c47";
11665
+ declare const VERSION = "1.5.47";
11666
+ declare const BUILD_DATE = "2026-01-08T14:14:54.922Z";
11667
+ declare const BUILD_HASH = "6b4fcd2";
11580
11668
  declare const BUILD_BRANCH = "main";
11581
11669
  interface VersionInfo {
11582
11670
  version: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osi-cards-lib",
3
- "version": "1.5.45",
3
+ "version": "1.5.47",
4
4
  "description": "Standalone OSI Cards library for Angular applications with CSS Layer support for easy style overrides",
5
5
  "keywords": [
6
6
  "angular",
@@ -20,6 +20,9 @@
20
20
  "url": "https://github.com/Inutilepat83/OSI-Cards/issues"
21
21
  },
22
22
  "homepage": "https://github.com/Inutilepat83/OSI-Cards#readme",
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
23
26
  "peerDependencies": {
24
27
  "@angular/core": "^18.0.0 || ^20.0.0",
25
28
  "@angular/common": "^18.0.0 || ^20.0.0",