osi-cards-lib 1.5.44 → 1.5.46

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.
@@ -10207,66 +10230,130 @@ declare class BrandColorsSectionComponent extends BaseSectionComponent implement
10207
10230
  }
10208
10231
 
10209
10232
  /**
10210
- * Chart Section Component
10233
+ * Chart data interface
10234
+ */
10235
+ interface ChartDataset {
10236
+ label?: string;
10237
+ data: number[];
10238
+ backgroundColor?: string | string[];
10239
+ borderColor?: string | string[];
10240
+ borderWidth?: number;
10241
+ }
10242
+ /**
10243
+ * Chart configuration
10244
+ */
10245
+ interface ChartConfig {
10246
+ labels: string[];
10247
+ datasets: ChartDataset[];
10248
+ type: 'bar' | 'line' | 'pie' | 'doughnut';
10249
+ }
10250
+ /**
10251
+ * Abstract base for sections with data visualizations.
10211
10252
  *
10212
- * Displays data visualizations using Frappe Charts.
10213
- * Supports: bar, line, pie, percentage (doughnut), area charts.
10253
+ * Use this for:
10254
+ * - Chart Section
10255
+ * - Analytics sections with charts
10214
10256
  *
10215
- * Note: Requires frappe-charts to be installed.
10257
+ * @example
10258
+ * ```typescript
10259
+ * @Component({...})
10260
+ * export class ChartSectionComponent extends ChartSectionBaseComponent {
10261
+ * static override readonly layoutConfig: SectionLayoutConfig = {
10262
+ * preferredColumns: 2,
10263
+ * minColumns: 1,
10264
+ * maxColumns: 4
10265
+ * };
10266
+ * }
10267
+ * ```
10216
10268
  */
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;
10269
+ declare abstract class ChartSectionBaseComponent extends BaseSectionComponent {
10230
10270
  /**
10231
- * Render chart using Frappe Charts (if available)
10271
+ * Override in subclass to customize layout behavior
10232
10272
  */
10233
- private renderChart;
10273
+ static readonly layoutConfig: SectionLayoutConfig;
10234
10274
  /**
10235
- * Update existing chart with new data
10275
+ * Whether the chart library is loaded
10236
10276
  */
10237
- private updateChart;
10277
+ protected chartLibraryLoaded: i0.WritableSignal<boolean>;
10238
10278
  /**
10239
- * Convert Chart.js data format to Frappe Charts format
10279
+ * Chart loading error
10240
10280
  */
10241
- private convertToFrappeFormat;
10281
+ protected chartError: i0.WritableSignal<string | null>;
10242
10282
  /**
10243
- * Map Chart.js chart types to Frappe Charts types
10283
+ * Chart type (bar, line, pie, doughnut)
10244
10284
  */
10245
- private mapChartType;
10285
+ readonly chartType: i0.Signal<"bar" | "line" | "pie" | "doughnut">;
10246
10286
  /**
10247
- * Extract colors from Chart.js format
10287
+ * Processed chart configuration
10248
10288
  */
10249
- private extractColors;
10289
+ readonly chartConfig: i0.Signal<ChartConfig | null>;
10290
+ /**
10291
+ * Whether the chart has valid data
10292
+ */
10293
+ readonly hasValidData: i0.Signal<boolean>;
10294
+ /**
10295
+ * Total value across all datasets
10296
+ */
10297
+ readonly totalValue: i0.Signal<number>;
10298
+ /**
10299
+ * Load the chart library dynamically
10300
+ */
10301
+ protected abstract loadChartLibrary(): Promise<void>;
10302
+ /**
10303
+ * Initialize the chart
10304
+ */
10305
+ protected abstract initializeChart(): void;
10306
+ /**
10307
+ * Update the chart with new data
10308
+ */
10309
+ protected abstract updateChart(): void;
10310
+ /**
10311
+ * Destroy the chart instance
10312
+ */
10313
+ protected abstract destroyChart(): void;
10314
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartSectionBaseComponent, never>;
10315
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartSectionBaseComponent, "ng-component", never, {}, {}, never, never, true, never>;
10316
+ }
10317
+
10318
+ /**
10319
+ * Chart Section Component
10320
+ *
10321
+ * Displays data visualizations using Chart.js library.
10322
+ * Supports bar, line, pie, and doughnut chart types.
10323
+ *
10324
+ * Note: Requires Chart.js library to be installed.
10325
+ */
10326
+ declare class ChartSectionComponent extends ChartSectionBaseComponent implements AfterViewInit, OnDestroy, OnInit {
10327
+ private readonly layoutService;
10328
+ chart?: BaseChartDirective;
10329
+ chartInitFailed: boolean;
10330
+ chartLoading: boolean;
10331
+ chartData: ChartData$1<'bar' | 'line' | 'pie' | 'doughnut'>;
10332
+ chartOptions: ChartOptions;
10333
+ chartJsType: ChartType$1;
10334
+ ngOnInit(): void;
10335
+ ngAfterViewInit(): void;
10336
+ ngOnDestroy(): void;
10250
10337
  /**
10251
- * Detect if chart data contains revenue/monetary values
10338
+ * Load Chart.js library dynamically
10252
10339
  */
10253
- private detectRevenueData;
10340
+ protected loadChartLibrary(): Promise<void>;
10254
10341
  /**
10255
- * Format value as currency
10342
+ * Initialize the chart
10256
10343
  */
10257
- private formatCurrency;
10344
+ protected initializeChart(): Promise<void>;
10258
10345
  /**
10259
- * Fix Y-axis label rendering issues
10346
+ * Update chart data from ChartConfig
10260
10347
  */
10261
- private fixYAxisLabels;
10348
+ private updateChartData;
10262
10349
  /**
10263
- * Fix legend label truncation
10350
+ * Update the chart with new data
10264
10351
  */
10265
- private fixLegendLabels;
10352
+ protected updateChart(): void;
10266
10353
  /**
10267
- * Destroy chart instance
10354
+ * Destroy the chart instance
10268
10355
  */
10269
- private destroyChart;
10356
+ protected destroyChart(): void;
10270
10357
  /**
10271
10358
  * Calculate layout preferences for chart section based on content.
10272
10359
  * Chart sections: 2 cols default, can shrink to 1, expands to 3-4 for wide charts
@@ -11572,11 +11659,11 @@ declare function packWithZeroGapsGuarantee(sections: CardSection[], columns?: nu
11572
11659
  * Do not edit manually - generated by scripts/generate-version.js
11573
11660
  *
11574
11661
  * Source of truth: version.config.json
11575
- * Last synced: 2026-01-08T11:12:12.048Z
11662
+ * Last synced: 2026-01-08T13:31:21.984Z
11576
11663
  */
11577
- declare const VERSION = "1.5.44";
11578
- declare const BUILD_DATE = "2026-01-08T11:12:12.048Z";
11579
- declare const BUILD_HASH = "ebfa0a6";
11664
+ declare const VERSION = "1.5.46";
11665
+ declare const BUILD_DATE = "2026-01-08T13:31:21.984Z";
11666
+ declare const BUILD_HASH = "1964431";
11580
11667
  declare const BUILD_BRANCH = "main";
11581
11668
  interface VersionInfo {
11582
11669
  version: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osi-cards-lib",
3
- "version": "1.5.44",
3
+ "version": "1.5.46",
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",
@@ -88,7 +88,7 @@
88
88
  .ai-section__title {
89
89
  @include section-heading-text;
90
90
  font-size: var(--osi-section-title-font-size) !important;
91
- font-weight: var(--osi-section-title-font-weight) !important;
91
+ font-weight: 700 !important;
92
92
  letter-spacing: var(--osi-section-title-letter-spacing) !important;
93
93
  line-height: var(--osi-section-title-line-height) !important;
94
94
  color: var(--osi-section-title-color) !important;