ngx-core-components 0.3.19 → 0.3.21
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/charts/adjacency-matrix/adjacency-matrix.component.d.ts +51 -0
- package/charts/bar-chart/bar-chart.component.d.ts +16 -2
- package/charts/biplot/biplot.component.d.ts +67 -0
- package/charts/bullet-chart/bullet-chart.component.d.ts +37 -0
- package/charts/chord-diagram/chord-diagram.component.d.ts +56 -0
- package/charts/dependency-wheel/dependency-wheel.component.d.ts +56 -0
- package/charts/dumbbell-chart/dumbbell-chart.component.d.ts +61 -0
- package/charts/gantt-chart/gantt-chart.component.d.ts +1 -0
- package/charts/kagi-chart/kagi-chart.component.d.ts +59 -0
- package/charts/line-chart/line-chart.component.d.ts +17 -2
- package/charts/lollipop-chart/lollipop-chart.component.d.ts +46 -0
- package/charts/marimekko-chart/marimekko-chart.component.d.ts +61 -0
- package/charts/pareto-chart/pareto-chart.component.d.ts +52 -0
- package/charts/point-figure-chart/point-figure-chart.component.d.ts +56 -0
- package/charts/polar-area-chart/polar-area-chart.component.d.ts +67 -0
- package/charts/public-api.d.ts +33 -0
- package/charts/renko-chart/renko-chart.component.d.ts +58 -0
- package/charts/ridgeline-chart/ridgeline-chart.component.d.ts +59 -0
- package/charts/sankey-chart/sankey-chart.component.d.ts +74 -0
- package/charts/slope-chart/slope-chart.component.d.ts +52 -0
- package/charts/violin-plot/violin-plot.component.d.ts +64 -0
- package/charts/wind-rose/wind-rose.component.d.ts +68 -0
- package/dialog/dialog-container.component.d.ts +4 -0
- package/dialog/dialog.service.d.ts +1 -0
- package/fesm2022/ngx-core-components-charts.mjs +7795 -48
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components-dialog.mjs +78 -11
- package/fesm2022/ngx-core-components-dialog.mjs.map +1 -1
- package/fesm2022/ngx-core-components-feedback.mjs +8 -4
- package/fesm2022/ngx-core-components-feedback.mjs.map +1 -1
- package/fesm2022/ngx-core-components-grid.mjs +143 -115
- package/fesm2022/ngx-core-components-grid.mjs.map +1 -1
- package/fesm2022/ngx-core-components-i18n.mjs +149 -0
- package/fesm2022/ngx-core-components-i18n.mjs.map +1 -0
- package/fesm2022/ngx-core-components-inputs.mjs +152 -77
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-layout.mjs +12 -8
- package/fesm2022/ngx-core-components-layout.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +617 -221
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +2 -1
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/grid/data-grid/data-grid.component.d.ts +4 -104
- package/grid/data-grid/grid-export.service.d.ts +26 -0
- package/grid/data-grid/models.d.ts +105 -0
- package/grid/public-api.d.ts +2 -1
- package/i18n/index.d.ts +5 -0
- package/i18n/ngx-core-i18n.d.ts +111 -0
- package/i18n/public-api.d.ts +2 -0
- package/inputs/autocomplete/autocomplete.component.d.ts +3 -1
- package/inputs/date-picker/date-picker.component.d.ts +4 -2
- package/inputs/dropdown/dropdown.component.d.ts +3 -1
- package/inputs/file-upload/file-upload.component.d.ts +1 -0
- package/inputs/multi-select/multi-select.component.d.ts +3 -1
- package/inputs/tag-input/tag-input.component.d.ts +2 -0
- package/layout/accordion/accordion.component.d.ts +1 -0
- package/layout/drawer/drawer.component.d.ts +1 -0
- package/package.json +30 -12
- package/public-api.d.ts +35 -0
- package/schematics/collection.json +7 -1
- package/schematics/grid/index.js +68 -0
- package/schematics/grid/schema.json +19 -0
- package/schematics/ng-add/index.js +177 -9
- package/schematics/ng-add/schema.json +29 -0
- package/themes/theme.css +118 -26
- package/views/calendar/calendar.component.d.ts +28 -1
- package/views/kanban/kanban.component.d.ts +1 -0
- package/views/list-view/list-view.component.d.ts +1 -0
- package/views/scheduler/scheduler.component.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-core-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"schematics": "./schematics/collection.json",
|
|
5
|
-
"description": "Angular component library
|
|
5
|
+
"description": "Angular 19+ component library — 100+ production-ready UI components including Data Grid, Gantt Chart, 35+ SVG Charts, AI Chat, Kanban, Form Builder, and more. Signals-first, fully standalone, zero runtime dependencies.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"component",
|
|
12
|
-
"timeline",
|
|
13
|
-
"project-management",
|
|
8
|
+
"components",
|
|
9
|
+
"ui-library",
|
|
10
|
+
"data-grid",
|
|
14
11
|
"gantt-chart",
|
|
15
|
-
"
|
|
12
|
+
"charts",
|
|
13
|
+
"svg-charts",
|
|
14
|
+
"kanban",
|
|
15
|
+
"ai-chat",
|
|
16
|
+
"form-builder",
|
|
17
|
+
"datepicker",
|
|
18
|
+
"dropdown",
|
|
19
|
+
"autocomplete",
|
|
20
|
+
"scheduler",
|
|
21
|
+
"timeline",
|
|
22
|
+
"dashboard",
|
|
23
|
+
"pivot-grid",
|
|
24
|
+
"tree-view",
|
|
25
|
+
"dialog",
|
|
26
|
+
"angular-signals",
|
|
27
|
+
"standalone-components",
|
|
28
|
+
"enterprise",
|
|
29
|
+
"open-source",
|
|
16
30
|
"ngx"
|
|
17
31
|
],
|
|
18
32
|
"license": "MIT",
|
|
@@ -63,13 +77,17 @@
|
|
|
63
77
|
"types": "./dialog/index.d.ts",
|
|
64
78
|
"default": "./fesm2022/ngx-core-components-dialog.mjs"
|
|
65
79
|
},
|
|
80
|
+
"./grid": {
|
|
81
|
+
"types": "./grid/index.d.ts",
|
|
82
|
+
"default": "./fesm2022/ngx-core-components-grid.mjs"
|
|
83
|
+
},
|
|
66
84
|
"./feedback": {
|
|
67
85
|
"types": "./feedback/index.d.ts",
|
|
68
86
|
"default": "./fesm2022/ngx-core-components-feedback.mjs"
|
|
69
87
|
},
|
|
70
|
-
"./
|
|
71
|
-
"types": "./
|
|
72
|
-
"default": "./fesm2022/ngx-core-components-
|
|
88
|
+
"./i18n": {
|
|
89
|
+
"types": "./i18n/index.d.ts",
|
|
90
|
+
"default": "./fesm2022/ngx-core-components-i18n.mjs"
|
|
73
91
|
},
|
|
74
92
|
"./inputs": {
|
|
75
93
|
"types": "./inputs/index.d.ts",
|
package/public-api.d.ts
CHANGED
|
@@ -41,6 +41,39 @@ export { RadialBarChartComponent } from 'ngx-core-components/charts';
|
|
|
41
41
|
export type { RadialBarItem } from 'ngx-core-components/charts';
|
|
42
42
|
export { CandlestickChartComponent } from 'ngx-core-components/charts';
|
|
43
43
|
export type { CandlestickItem } from 'ngx-core-components/charts';
|
|
44
|
+
export { PolarAreaChartComponent } from 'ngx-core-components/charts';
|
|
45
|
+
export { BulletChartComponent } from 'ngx-core-components/charts';
|
|
46
|
+
export { DumbbellChartComponent } from 'ngx-core-components/charts';
|
|
47
|
+
export type { DumbbellItem } from 'ngx-core-components/charts';
|
|
48
|
+
export { LollipopChartComponent } from 'ngx-core-components/charts';
|
|
49
|
+
export { SlopeChartComponent } from 'ngx-core-components/charts';
|
|
50
|
+
export type { SlopeDataPoint } from 'ngx-core-components/charts';
|
|
51
|
+
export { SankeyChartComponent } from 'ngx-core-components/charts';
|
|
52
|
+
export type { SankeyNode, SankeyLink } from 'ngx-core-components/charts';
|
|
53
|
+
export { ViolinPlotComponent } from 'ngx-core-components/charts';
|
|
54
|
+
export type { ViolinItem } from 'ngx-core-components/charts';
|
|
55
|
+
export { RidgelineChartComponent } from 'ngx-core-components/charts';
|
|
56
|
+
export type { RidgelineItem } from 'ngx-core-components/charts';
|
|
57
|
+
export { ParetoChartComponent } from 'ngx-core-components/charts';
|
|
58
|
+
export type { ParetoItem } from 'ngx-core-components/charts';
|
|
59
|
+
export { MarimekkoChartComponent } from 'ngx-core-components/charts';
|
|
60
|
+
export type { MarimekkoItem, MarimekkoSegment } from 'ngx-core-components/charts';
|
|
61
|
+
export { ChordDiagramComponent } from 'ngx-core-components/charts';
|
|
62
|
+
export type { ChordItem } from 'ngx-core-components/charts';
|
|
63
|
+
export { DependencyWheelComponent } from 'ngx-core-components/charts';
|
|
64
|
+
export type { DependencyItem } from 'ngx-core-components/charts';
|
|
65
|
+
export { AdjacencyMatrixComponent } from 'ngx-core-components/charts';
|
|
66
|
+
export type { MatrixItem } from 'ngx-core-components/charts';
|
|
67
|
+
export { BiplotComponent } from 'ngx-core-components/charts';
|
|
68
|
+
export type { BiplotPoint, BiplotVector } from 'ngx-core-components/charts';
|
|
69
|
+
export { RenkoChartComponent } from 'ngx-core-components/charts';
|
|
70
|
+
export type { RenkoBrick } from 'ngx-core-components/charts';
|
|
71
|
+
export { KagiChartComponent } from 'ngx-core-components/charts';
|
|
72
|
+
export type { KagiSegment } from 'ngx-core-components/charts';
|
|
73
|
+
export { PointFigureChartComponent } from 'ngx-core-components/charts';
|
|
74
|
+
export type { PFCell } from 'ngx-core-components/charts';
|
|
75
|
+
export { WindRoseChartComponent } from 'ngx-core-components/charts';
|
|
76
|
+
export type { WindRoseItem, WindRoseSpeedBin } from 'ngx-core-components/charts';
|
|
44
77
|
export { GanttChartComponent } from 'ngx-core-components/charts';
|
|
45
78
|
export type { FlatRow } from 'ngx-core-components/charts';
|
|
46
79
|
export { GanttScaleService } from 'ngx-core-components/charts';
|
|
@@ -83,3 +116,5 @@ export { AIChatComponent } from 'ngx-core-components/ai';
|
|
|
83
116
|
export type { AIMessage, AgentStep, AICard, AICardAction, QuickReply, } from 'ngx-core-components/ai';
|
|
84
117
|
export { AIChatWidgetComponent } from 'ngx-core-components/ai';
|
|
85
118
|
export { AIPromptEditorComponent } from 'ngx-core-components/ai';
|
|
119
|
+
export { NGX_CORE_I18N, DEFAULT_EN_I18N, provideNgxI18n } from 'ngx-core-components/i18n';
|
|
120
|
+
export type { NgxCoreI18n } from 'ngx-core-components/i18n';
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
"schematics": {
|
|
4
4
|
"ng-add": {
|
|
5
5
|
"description": "Add ngx-core-components to the project.",
|
|
6
|
-
"factory": "./ng-add/index#ngAdd"
|
|
6
|
+
"factory": "./ng-add/index#ngAdd",
|
|
7
|
+
"schema": "./ng-add/schema.json"
|
|
8
|
+
},
|
|
9
|
+
"grid": {
|
|
10
|
+
"description": "Scaffold a pre-configured data grid component.",
|
|
11
|
+
"factory": "./grid/index#grid",
|
|
12
|
+
"schema": "./grid/schema.json"
|
|
7
13
|
}
|
|
8
14
|
}
|
|
9
15
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
function grid(options) {
|
|
2
|
+
return (tree, context) => {
|
|
3
|
+
context.logger.info('⚡ Scaffolding a pre-configured ngx-core-components DataGrid...');
|
|
4
|
+
|
|
5
|
+
const name = options.name || 'data-grid';
|
|
6
|
+
// Convert camelCase or PascalCase to dashed-case
|
|
7
|
+
const dashedName = name.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
8
|
+
// Convert dashed-case to camelCase
|
|
9
|
+
const camelName = dashedName.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
10
|
+
// Convert camelCase to PascalCase
|
|
11
|
+
const pascalName = camelName.charAt(0).toUpperCase() + camelName.slice(1);
|
|
12
|
+
|
|
13
|
+
// Default file path to src/app/name/name.component.ts
|
|
14
|
+
const filePath = `src/app/${dashedName}/${dashedName}.component.ts`;
|
|
15
|
+
|
|
16
|
+
const content = `import { Component } from '@angular/core';
|
|
17
|
+
import { CommonModule } from '@angular/common';
|
|
18
|
+
import { DataGridComponent } from 'ngx-core-components/grid';
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'app-${dashedName}',
|
|
22
|
+
standalone: true,
|
|
23
|
+
imports: [CommonModule, DataGridComponent],
|
|
24
|
+
template: \`
|
|
25
|
+
<div style="padding: 24px; background: var(--ngx-color-surface, #fff); border-radius: var(--ngx-radius-lg, 8px); box-shadow: var(--ngx-shadow-md);">
|
|
26
|
+
<h2 style="margin-top: 0; color: var(--ngx-color-text, #333); font-family: var(--ngx-font-family);">${pascalName} List</h2>
|
|
27
|
+
|
|
28
|
+
<ngx-data-grid
|
|
29
|
+
[data]="gridData"
|
|
30
|
+
[columns]="columnDefs"
|
|
31
|
+
[pageSize]="10"
|
|
32
|
+
[pageable]="true"
|
|
33
|
+
[sortable]="true"
|
|
34
|
+
[filterable]="true"
|
|
35
|
+
></ngx-data-grid>
|
|
36
|
+
</div>
|
|
37
|
+
\`
|
|
38
|
+
})
|
|
39
|
+
export class ${pascalName}Component {
|
|
40
|
+
gridData = [
|
|
41
|
+
{ id: 1, name: 'Alice Smith', email: 'alice@example.com', role: 'Admin' },
|
|
42
|
+
{ id: 2, name: 'Bob Jones', email: 'bob@example.com', role: 'User' },
|
|
43
|
+
{ id: 3, name: 'Charlie Brown', email: 'charlie@example.com', role: 'Editor' },
|
|
44
|
+
{ id: 4, name: 'Diana Prince', email: 'diana@example.com', role: 'Admin' },
|
|
45
|
+
{ id: 5, name: 'Ethan Hunt', email: 'ethan@example.com', role: 'User' }
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
columnDefs = [
|
|
49
|
+
{ field: 'id', title: 'ID', width: 80, sortable: true },
|
|
50
|
+
{ field: 'name', title: 'Name', sortable: true, filterable: true },
|
|
51
|
+
{ field: 'email', title: 'Email', sortable: true, filterable: true },
|
|
52
|
+
{ field: 'role', title: 'Role', sortable: true }
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
if (tree.exists(filePath)) {
|
|
58
|
+
context.logger.warn(`⚠️ File ${filePath} already exists. Skipping scaffolding.`);
|
|
59
|
+
} else {
|
|
60
|
+
tree.create(filePath, content);
|
|
61
|
+
context.logger.info(`✅ Generated ${pascalName}Component with pre-configured ngx-data-grid at ${filePath}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return tree;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
module.exports = { grid };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "NgxCoreComponentsGridSchema",
|
|
4
|
+
"title": "Grid Schematic Options Schema",
|
|
5
|
+
"type": "OBJECT",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the component to generate.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"required": [
|
|
17
|
+
"name"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -10,7 +10,7 @@ function ngAdd(options) {
|
|
|
10
10
|
json.dependencies = {};
|
|
11
11
|
}
|
|
12
12
|
if (!json.dependencies['ngx-core-components']) {
|
|
13
|
-
json.dependencies['ngx-core-components'] = '^0.3.
|
|
13
|
+
json.dependencies['ngx-core-components'] = '^0.3.19';
|
|
14
14
|
tree.overwrite('package.json', JSON.stringify(json, null, 2) + '\n');
|
|
15
15
|
context.logger.info('✅ Added ngx-core-components to dependencies in package.json');
|
|
16
16
|
}
|
|
@@ -28,14 +28,14 @@ function ngAdd(options) {
|
|
|
28
28
|
const project = projects[projectName];
|
|
29
29
|
|
|
30
30
|
if (project && project.architect && project.architect.build && project.architect.build.options) {
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
33
|
-
|
|
31
|
+
const buildOptions = project.architect.build.options;
|
|
32
|
+
if (!buildOptions.styles) {
|
|
33
|
+
buildOptions.styles = [];
|
|
34
34
|
}
|
|
35
35
|
const styleAsset = 'node_modules/ngx-core-components/themes/theme.css';
|
|
36
36
|
|
|
37
37
|
// Check if style asset is already added
|
|
38
|
-
const styleExists =
|
|
38
|
+
const styleExists = buildOptions.styles.some(s => {
|
|
39
39
|
if (typeof s === 'string') {
|
|
40
40
|
return s === styleAsset;
|
|
41
41
|
}
|
|
@@ -43,9 +43,9 @@ function ngAdd(options) {
|
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
if (!styleExists) {
|
|
46
|
-
|
|
46
|
+
buildOptions.styles.push(styleAsset);
|
|
47
47
|
tree.overwrite('angular.json', JSON.stringify(json, null, 2) + '\n');
|
|
48
|
-
context.logger.info('🎨 Added core
|
|
48
|
+
context.logger.info('🎨 Added ngx-core-components theme CSS to angular.json styles');
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
} catch (err) {
|
|
@@ -53,12 +53,180 @@ function ngAdd(options) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
// 3. Apply theme preference (dark mode setup)
|
|
57
|
+
const theme = options && options.theme ? options.theme : 'light';
|
|
58
|
+
if (theme === 'dark') {
|
|
59
|
+
applyDarkTheme(tree, context);
|
|
60
|
+
} else if (theme === 'custom') {
|
|
61
|
+
scaffoldCustomTheme(tree, context);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 4. Scaffold i18n provider if requested
|
|
65
|
+
if (options && options.i18n) {
|
|
66
|
+
scaffoldI18nProvider(tree, context);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
context.logger.info('');
|
|
56
70
|
context.logger.info('🎉 Successfully configured ngx-core-components!');
|
|
57
|
-
context.logger.info('
|
|
71
|
+
context.logger.info('');
|
|
72
|
+
context.logger.info('💡 All components are standalone — import them directly:');
|
|
73
|
+
context.logger.info(' import { DataGridComponent } from \'ngx-core-components/grid\';');
|
|
58
74
|
context.logger.info(' import { GanttChartComponent } from \'ngx-core-components/charts\';');
|
|
59
|
-
|
|
75
|
+
context.logger.info(' import { DropdownComponent } from \'ngx-core-components/inputs\';');
|
|
76
|
+
context.logger.info('');
|
|
77
|
+
context.logger.info('📖 Docs: https://prajaktadube.github.io/ngx-core-components/home');
|
|
78
|
+
context.logger.info('');
|
|
79
|
+
if (theme === 'dark') {
|
|
80
|
+
context.logger.info('🌙 Dark theme enabled. Add data-theme="dark" to your <body> tag,');
|
|
81
|
+
context.logger.info(' or toggle it programmatically.');
|
|
82
|
+
}
|
|
83
|
+
if (theme === 'custom') {
|
|
84
|
+
context.logger.info('🎨 Custom theme file created at src/styles/ngx-theme-overrides.css');
|
|
85
|
+
context.logger.info(' Edit this file to customize colors, spacing, and typography.');
|
|
86
|
+
}
|
|
87
|
+
|
|
60
88
|
return tree;
|
|
61
89
|
};
|
|
62
90
|
}
|
|
63
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Applies dark theme by modifying the index.html body tag.
|
|
94
|
+
*/
|
|
95
|
+
function applyDarkTheme(tree, context) {
|
|
96
|
+
const indexPaths = ['src/index.html', 'projects/demo/src/index.html'];
|
|
97
|
+
for (const indexPath of indexPaths) {
|
|
98
|
+
if (tree.exists(indexPath)) {
|
|
99
|
+
let html = tree.read(indexPath).toString('utf-8');
|
|
100
|
+
if (!html.includes('data-theme="dark"')) {
|
|
101
|
+
html = html.replace('<body', '<body data-theme="dark"');
|
|
102
|
+
tree.overwrite(indexPath, html);
|
|
103
|
+
context.logger.info(`🌙 Applied dark theme to ${indexPath}`);
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Scaffolds a custom CSS theme overrides file with all available tokens.
|
|
112
|
+
*/
|
|
113
|
+
function scaffoldCustomTheme(tree, context) {
|
|
114
|
+
const customThemePath = 'src/styles/ngx-theme-overrides.css';
|
|
115
|
+
if (tree.exists(customThemePath)) {
|
|
116
|
+
context.logger.info('ℹ️ Custom theme file already exists, skipping.');
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const content = `/**
|
|
121
|
+
* ngx-core-components — Custom Theme Overrides
|
|
122
|
+
*
|
|
123
|
+
* Uncomment and modify the variables below to customize the library's appearance.
|
|
124
|
+
* See full token reference: https://prajaktadube.github.io/ngx-core-components/theming
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
:root {
|
|
128
|
+
/* ── Brand Colors ── */
|
|
129
|
+
/* --ngx-color-primary: #4f46e5; */
|
|
130
|
+
/* --ngx-color-primary-hover: #4338ca; */
|
|
131
|
+
/* --ngx-color-primary-light: #e0e7ff; */
|
|
132
|
+
/* --ngx-color-secondary: #64748b; */
|
|
133
|
+
/* --ngx-color-success: #10b981; */
|
|
134
|
+
/* --ngx-color-warning: #f59e0b; */
|
|
135
|
+
/* --ngx-color-danger: #ef4444; */
|
|
136
|
+
|
|
137
|
+
/* ── Surface & Text ── */
|
|
138
|
+
/* --ngx-color-surface: #ffffff; */
|
|
139
|
+
/* --ngx-color-surface-alt: #f8fafc; */
|
|
140
|
+
/* --ngx-color-border: #e2e8f0; */
|
|
141
|
+
/* --ngx-color-text: #0f172a; */
|
|
142
|
+
/* --ngx-color-text-secondary: #64748b; */
|
|
143
|
+
|
|
144
|
+
/* ── Typography ── */
|
|
145
|
+
/* --ngx-font-family: system-ui, -apple-system, sans-serif; */
|
|
146
|
+
/* --ngx-font-size-sm: 0.875rem; */
|
|
147
|
+
/* --ngx-font-size-md: 1rem; */
|
|
148
|
+
|
|
149
|
+
/* ── Borders & Radius ── */
|
|
150
|
+
/* --ngx-radius-sm: 0.125rem; */
|
|
151
|
+
/* --ngx-radius-md: 0.25rem; */
|
|
152
|
+
/* --ngx-radius-lg: 0.375rem; */
|
|
153
|
+
|
|
154
|
+
/* ── Shadows ── */
|
|
155
|
+
/* --ngx-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); */
|
|
156
|
+
/* --ngx-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1); */
|
|
157
|
+
}
|
|
158
|
+
`;
|
|
159
|
+
|
|
160
|
+
tree.create(customThemePath, content);
|
|
161
|
+
|
|
162
|
+
// Also add the custom theme file to angular.json styles
|
|
163
|
+
if (tree.exists('angular.json')) {
|
|
164
|
+
try {
|
|
165
|
+
const angularJsonContent = tree.read('angular.json').toString('utf-8');
|
|
166
|
+
const json = JSON.parse(angularJsonContent);
|
|
167
|
+
const projects = json.projects;
|
|
168
|
+
const projectName = json.defaultProject || Object.keys(projects)[0];
|
|
169
|
+
const project = projects[projectName];
|
|
170
|
+
|
|
171
|
+
if (project && project.architect && project.architect.build && project.architect.build.options) {
|
|
172
|
+
const buildOptions = project.architect.build.options;
|
|
173
|
+
if (!buildOptions.styles) {
|
|
174
|
+
buildOptions.styles = [];
|
|
175
|
+
}
|
|
176
|
+
if (!buildOptions.styles.includes(customThemePath)) {
|
|
177
|
+
buildOptions.styles.push(customThemePath);
|
|
178
|
+
tree.overwrite('angular.json', JSON.stringify(json, null, 2) + '\n');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} catch (err) {
|
|
182
|
+
context.logger.warn('⚠️ Could not add custom theme to angular.json: ' + err.message);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Scaffolds an i18n provider file for overriding library labels.
|
|
189
|
+
*/
|
|
190
|
+
function scaffoldI18nProvider(tree, context) {
|
|
191
|
+
const i18nPath = 'src/app/ngx-i18n.provider.ts';
|
|
192
|
+
if (tree.exists(i18nPath)) {
|
|
193
|
+
context.logger.info('ℹ️ i18n provider file already exists, skipping.');
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const content = `import { Provider } from '@angular/core';
|
|
198
|
+
import { NGX_CORE_I18N } from 'ngx-core-components/i18n';
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Customize ngx-core-components labels here.
|
|
202
|
+
* Add this provider to your app.config.ts or app.module.ts.
|
|
203
|
+
*
|
|
204
|
+
* Example usage in app.config.ts:
|
|
205
|
+
* providers: [ngxCoreI18nProvider]
|
|
206
|
+
*/
|
|
207
|
+
export const ngxCoreI18nProvider: Provider = {
|
|
208
|
+
provide: NGX_CORE_I18N,
|
|
209
|
+
useValue: {
|
|
210
|
+
grid: {
|
|
211
|
+
noData: 'No records found',
|
|
212
|
+
filterPlaceholder: 'Filter...',
|
|
213
|
+
pageOf: (page: number, total: number) => \`Page \${page} of \${total}\`,
|
|
214
|
+
},
|
|
215
|
+
datePicker: {
|
|
216
|
+
today: 'Today',
|
|
217
|
+
clear: 'Clear',
|
|
218
|
+
},
|
|
219
|
+
dialog: {
|
|
220
|
+
close: 'Close',
|
|
221
|
+
confirm: 'Confirm',
|
|
222
|
+
cancel: 'Cancel',
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
`;
|
|
227
|
+
|
|
228
|
+
tree.create(i18nPath, content);
|
|
229
|
+
context.logger.info('🌐 Created i18n provider at ' + i18nPath);
|
|
230
|
+
}
|
|
231
|
+
|
|
64
232
|
module.exports = { ngAdd };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "NgxCoreComponentsNgAddSchema",
|
|
4
|
+
"title": "ng-add schematic options",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"theme": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Choose a theme preset for your project.",
|
|
10
|
+
"default": "light",
|
|
11
|
+
"enum": ["light", "dark", "custom"],
|
|
12
|
+
"x-prompt": {
|
|
13
|
+
"message": "Which theme would you like to use?",
|
|
14
|
+
"type": "list",
|
|
15
|
+
"items": [
|
|
16
|
+
{ "value": "light", "label": "Light (default)" },
|
|
17
|
+
{ "value": "dark", "label": "Dark mode" },
|
|
18
|
+
{ "value": "custom", "label": "Custom (scaffolds override file)" }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"i18n": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "Scaffold an i18n provider file for customizing component labels.",
|
|
25
|
+
"default": false,
|
|
26
|
+
"x-prompt": "Would you like to scaffold an i18n provider for custom labels?"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
package/themes/theme.css
CHANGED
|
@@ -1,34 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ngx-core-components — Design Token System
|
|
3
|
+
*
|
|
4
|
+
* This file declares all CSS custom properties used across the library.
|
|
5
|
+
* Override these properties globally or scope them to specific selectors.
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
:root {
|
|
2
|
-
/* Brand
|
|
3
|
-
--
|
|
4
|
-
--primary-hover: #4338ca;
|
|
5
|
-
--
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
--ngx-
|
|
9
|
-
--ngx-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
--ngx-
|
|
14
|
-
--ngx-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
/* ── 1. Global Brand & Semantic Colors ── */
|
|
10
|
+
--ngx-color-primary: #4f46e5;
|
|
11
|
+
--ngx-color-primary-hover: #4338ca;
|
|
12
|
+
--ngx-color-primary-light: #e0e7ff;
|
|
13
|
+
--ngx-color-secondary: #64748b;
|
|
14
|
+
--ngx-color-success: #10b981;
|
|
15
|
+
--ngx-color-warning: #f59e0b;
|
|
16
|
+
--ngx-color-danger: #ef4444;
|
|
17
|
+
--ngx-color-info: #06b6d4;
|
|
18
|
+
|
|
19
|
+
/* ── 2. Surface & Text Colors ── */
|
|
20
|
+
--ngx-color-surface: #ffffff;
|
|
21
|
+
--ngx-color-surface-alt: #f8fafc;
|
|
22
|
+
--ngx-color-surface-overlay: rgba(15, 23, 42, 0.05);
|
|
23
|
+
--ngx-color-border: #e2e8f0;
|
|
24
|
+
--ngx-color-text: #0f172a;
|
|
25
|
+
--ngx-color-text-secondary: #64748b;
|
|
26
|
+
--ngx-color-text-disabled: #94a3b8;
|
|
27
|
+
--ngx-color-text-inverse: #ffffff;
|
|
28
|
+
|
|
29
|
+
/* ── 3. Spacing Scale ── */
|
|
30
|
+
--ngx-space-xs: 0.25rem;
|
|
31
|
+
--ngx-space-sm: 0.5rem;
|
|
32
|
+
--ngx-space-md: 0.75rem;
|
|
33
|
+
--ngx-space-lg: 1rem;
|
|
34
|
+
--ngx-space-xl: 1.5rem;
|
|
35
|
+
--ngx-space-2xl: 2rem;
|
|
36
|
+
|
|
37
|
+
/* ── 4. Typography ── */
|
|
38
|
+
--ngx-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
39
|
+
--ngx-font-size-xs: 0.75rem;
|
|
40
|
+
--ngx-font-size-sm: 0.875rem;
|
|
41
|
+
--ngx-font-size-md: 1rem;
|
|
42
|
+
--ngx-font-size-lg: 1.125rem;
|
|
43
|
+
--ngx-font-size-xl: 1.25rem;
|
|
44
|
+
--ngx-font-weight-normal: 400;
|
|
45
|
+
--ngx-font-weight-medium: 500;
|
|
46
|
+
--ngx-font-weight-bold: 600;
|
|
47
|
+
--ngx-line-height-tight: 1.25;
|
|
48
|
+
--ngx-line-height-normal: 1.5;
|
|
49
|
+
--ngx-line-height-relaxed: 1.625;
|
|
50
|
+
|
|
51
|
+
/* ── 5. Borders & Radius ── */
|
|
52
|
+
--ngx-radius-sm: 0.125rem;
|
|
53
|
+
--ngx-radius-md: 0.25rem;
|
|
54
|
+
--ngx-radius-lg: 0.375rem;
|
|
55
|
+
--ngx-radius-xl: 0.5rem;
|
|
56
|
+
--ngx-radius-full: 9999px;
|
|
57
|
+
--ngx-border-width: 1px;
|
|
58
|
+
--ngx-border-color: var(--ngx-color-border);
|
|
59
|
+
|
|
60
|
+
/* ── 6. Shadows ── */
|
|
61
|
+
--ngx-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
62
|
+
--ngx-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
63
|
+
--ngx-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
64
|
+
--ngx-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
65
|
+
|
|
66
|
+
/* ── 7. Transitions ── */
|
|
67
|
+
--ngx-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
68
|
+
--ngx-transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
69
|
+
--ngx-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
70
|
+
|
|
71
|
+
/* ── 8. Focus Rings ── */
|
|
72
|
+
--ngx-focus-ring-color: var(--ngx-color-primary-light);
|
|
73
|
+
--ngx-focus-ring-width: 3px;
|
|
74
|
+
--ngx-focus-ring-offset: 1px;
|
|
75
|
+
|
|
76
|
+
/* ── 9. Component Specific Base Tokens ── */
|
|
77
|
+
--ngx-input-border: var(--ngx-color-border);
|
|
78
|
+
--ngx-input-bg: var(--ngx-color-surface);
|
|
79
|
+
--ngx-input-focus: var(--ngx-color-primary);
|
|
80
|
+
--ngx-input-radius: var(--ngx-radius-lg);
|
|
81
|
+
--ngx-input-height: 2.5rem;
|
|
82
|
+
|
|
83
|
+
--ngx-grid-border: var(--ngx-color-border);
|
|
84
|
+
--ngx-grid-header-bg: var(--ngx-color-surface-alt);
|
|
85
|
+
--ngx-grid-row-hover: var(--ngx-color-surface-alt);
|
|
86
|
+
--ngx-grid-stripe: rgba(15, 23, 42, 0.02);
|
|
87
|
+
|
|
88
|
+
--ngx-btn-padding: 0.5rem 1rem;
|
|
89
|
+
--ngx-btn-radius: var(--ngx-radius-lg);
|
|
90
|
+
--ngx-btn-font-weight: var(--ngx-font-weight-medium);
|
|
91
|
+
|
|
92
|
+
--ngx-dialog-overlay-bg: rgba(15, 23, 42, 0.4);
|
|
93
|
+
--ngx-dialog-radius: var(--ngx-radius-xl);
|
|
94
|
+
--ngx-dialog-shadow: var(--ngx-shadow-xl);
|
|
95
|
+
|
|
96
|
+
/* ── 10. Legacy Mapped / Compatibility Variables ── */
|
|
97
|
+
--primary-color: var(--ngx-color-primary);
|
|
98
|
+
--primary-hover: var(--ngx-color-primary-hover);
|
|
99
|
+
--secondary-color: var(--ngx-color-success);
|
|
100
|
+
|
|
101
|
+
--ngx-chart-text: var(--ngx-color-text);
|
|
102
|
+
--ngx-chart-axis-text: var(--ngx-color-text-secondary);
|
|
103
|
+
--ngx-chart-bg: var(--ngx-color-surface);
|
|
104
|
+
--ngx-chart-grid: #ebedf0;
|
|
105
|
+
--ngx-chart-axis: #ced4da;
|
|
106
|
+
|
|
17
107
|
--ngx-chart-tooltip-bg: rgba(15, 23, 42, 0.92);
|
|
18
108
|
--ngx-chart-tooltip-color: #f8fafc;
|
|
19
109
|
}
|
|
20
110
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
--ngx-
|
|
111
|
+
/* ── Dark Mode Presets ── */
|
|
112
|
+
body.dark, [data-theme="dark"] {
|
|
113
|
+
--ngx-color-surface: #0f172a;
|
|
114
|
+
--ngx-color-surface-alt: #1e293b;
|
|
115
|
+
--ngx-color-surface-overlay: rgba(255, 255, 255, 0.05);
|
|
116
|
+
--ngx-color-border: #334155;
|
|
117
|
+
--ngx-color-text: #f8fafc;
|
|
118
|
+
--ngx-color-text-secondary: #94a3b8;
|
|
119
|
+
--ngx-color-text-disabled: #64748b;
|
|
120
|
+
--ngx-color-text-inverse: #0f172a;
|
|
121
|
+
|
|
24
122
|
--ngx-chart-grid: rgba(255, 255, 255, 0.08);
|
|
25
123
|
--ngx-chart-axis: rgba(255, 255, 255, 0.15);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
--ngx-chart-text: #f8fafc; /* Slate 50 */
|
|
29
|
-
--ngx-chart-axis-text: #94a3b8; /* Slate 400 */
|
|
30
|
-
|
|
31
|
-
/* Tooltip Adjustments */
|
|
32
|
-
--ngx-chart-tooltip-bg: rgba(15, 23, 42, 0.96);
|
|
33
|
-
--ngx-chart-tooltip-color: #f8fafc;
|
|
124
|
+
|
|
125
|
+
--ngx-dialog-overlay-bg: rgba(0, 0, 0, 0.6);
|
|
34
126
|
}
|