@brickclay-org/ui 0.0.69 → 0.0.71

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
@@ -622,7 +622,7 @@ interface TableColumn<T = any> {
622
622
  cellClass?: string;
623
623
  formatter?: (row: T) => string;
624
624
  badges?: TableBadge[];
625
- icons?: TableIcon[];
625
+ icons?: TableIcon[] | ((row: T) => TableIcon[]);
626
626
  /** show / hide both th + td */
627
627
  visible?: boolean;
628
628
  }
@@ -674,6 +674,7 @@ declare class BkGrid<T = any> {
674
674
  onDragMoved(event: CdkDragMove<any>): void;
675
675
  onDragStart(event: CdkDragStart<any>): void;
676
676
  getBadge(row: T, column: TableColumn<T>): TableBadge | undefined;
677
+ getIcons(row: T, column: TableColumn<T>): TableIcon[];
677
678
  static ɵfac: i0.ɵɵFactoryDeclaration<BkGrid<any>, never>;
678
679
  static ɵcmp: i0.ɵɵComponentDeclaration<BkGrid<any>, "bk-grid", never, { "draggable": { "alias": "draggable"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "result": { "alias": "result"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; }, { "actionClick": "actionClick"; "sortChange": "sortChange"; "dragDropChange": "dragDropChange"; }, never, never, true, never>;
679
680
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickclay-org/ui",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "ng-add": {
6
6
  "save": "dependencies"
@@ -31,5 +31,6 @@
31
31
  "types": "./index.d.ts",
32
32
  "default": "./fesm2022/brickclay-org-ui.mjs"
33
33
  }
34
- }
34
+ },
35
+ "description": "A comprehensive Angular UI component library with calendar, checkbox, radio, and toggle components"
35
36
  }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const tasks_1 = require("@angular-devkit/schematics/tasks");
5
+ const dependencies_1 = require("@schematics/angular/utility/dependencies");
6
+ function default_1(options) {
7
+ return (tree, context) => {
8
+ context.logger.info('🚀 Setting up @brickclay-org/ui library...');
9
+ // 1. Read user's Angular version from package.json
10
+ const angularCore = (0, dependencies_1.getPackageJsonDependency)(tree, '@angular/core');
11
+ if (!angularCore) {
12
+ throw new Error('❌ Cannot find @angular/core in package.json. Make sure this is an Angular project.');
13
+ }
14
+ // 2. Extract major version (e.g., "^19.0.0" -> "19" or "~18.2.0" -> "18")
15
+ const angularVersion = angularCore.version;
16
+ const majorVersionMatch = angularVersion.match(/(\d+)/);
17
+ if (!majorVersionMatch) {
18
+ throw new Error(`❌ Could not determine Angular version from ${angularVersion}`);
19
+ }
20
+ const majorVersion = parseInt(majorVersionMatch[0], 10);
21
+ // 3. Validate Angular version is in supported range (17-21)
22
+ if (majorVersion < 17 || majorVersion > 21) {
23
+ throw new Error(`❌ @brickclay-org/ui library supports Angular versions 17-21, but found Angular ${majorVersion}.\n` +
24
+ `Please upgrade or downgrade your Angular version.`);
25
+ }
26
+ context.logger.info(`✅ Detected Angular version: ${majorVersion}`);
27
+ // 4. Check if user already has CDK installed
28
+ const existingCdk = (0, dependencies_1.getPackageJsonDependency)(tree, '@angular/cdk');
29
+ if (existingCdk) {
30
+ const existingCdkMajor = existingCdk.version.match(/(\d+)/)?.[0];
31
+ // Check if existing CDK version matches Angular version
32
+ if (existingCdkMajor && parseInt(existingCdkMajor) === majorVersion) {
33
+ context.logger.info(`✅ Using existing @angular/cdk@${existingCdk.version}`);
34
+ }
35
+ else {
36
+ context.logger.warn(`⚠️ Found @angular/cdk@${existingCdk.version} but you have Angular ${majorVersion}.\n` +
37
+ ` Consider updating CDK to match your Angular version: npm install @angular/cdk@^${majorVersion}.0.0`);
38
+ }
39
+ }
40
+ else {
41
+ // Install matching CDK version
42
+ const cdkVersion = `^${majorVersion}.0.0`;
43
+ (0, dependencies_1.addPackageJsonDependency)(tree, {
44
+ type: dependencies_1.NodeDependencyType.Default,
45
+ name: '@angular/cdk',
46
+ version: cdkVersion,
47
+ });
48
+ context.logger.info(`✅ Installing @angular/cdk@${cdkVersion} to match Angular ${majorVersion}`);
49
+ }
50
+ // 5. Schedule npm install
51
+ context.addTask(new tasks_1.NodePackageInstallTask());
52
+ context.logger.info('');
53
+ context.logger.info('🎉 Brickclay library has been successfully configured!');
54
+ context.logger.info('');
55
+ context.logger.info('📚 Next steps:');
56
+ context.logger.info(' 1. Import components from "@brickclay-org/ui" in your modules or standalone components');
57
+ context.logger.info('');
58
+ return tree;
59
+ };
60
+ }