@rafaelaalmeidaa/primordash 0.0.1

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.
Files changed (60) hide show
  1. package/README.md +24 -0
  2. package/esm2020/lib/components/card/card.component.mjs +69 -0
  3. package/esm2020/lib/components/charts/bar-line/bar-line.component.mjs +245 -0
  4. package/esm2020/lib/components/charts/bubble/bubble.component.mjs +147 -0
  5. package/esm2020/lib/components/charts/pie/pie.component.mjs +161 -0
  6. package/esm2020/lib/components/charts/simple-card/simple-card.component.mjs +31 -0
  7. package/esm2020/lib/components/charts/table/table.component.mjs +26 -0
  8. package/esm2020/lib/components/dashboard/dashboard.component.mjs +251 -0
  9. package/esm2020/lib/components/modal-edit/modal-edit.component.mjs +133 -0
  10. package/esm2020/lib/components/modal-edit-chart/modal-edit-chart.component.mjs +56 -0
  11. package/esm2020/lib/models/dashboard.model.mjs +46 -0
  12. package/esm2020/lib/primordash.component.mjs +75 -0
  13. package/esm2020/lib/primordash.module.mjs +92 -0
  14. package/esm2020/lib/primordash.service.mjs +14 -0
  15. package/esm2020/lib/services/generic.mjs +50 -0
  16. package/esm2020/public-api.mjs +8 -0
  17. package/esm2020/rafaAlmeida-primordash.mjs +5 -0
  18. package/esm2020/rafaelaalmeidaa-primordash.mjs +5 -0
  19. package/fesm2015/rafaAlmeida-primordash.mjs +1374 -0
  20. package/fesm2015/rafaAlmeida-primordash.mjs.map +1 -0
  21. package/fesm2015/rafaelaalmeidaa-primordash.mjs +1374 -0
  22. package/fesm2015/rafaelaalmeidaa-primordash.mjs.map +1 -0
  23. package/fesm2020/rafaAlmeida-primordash.mjs +1349 -0
  24. package/fesm2020/rafaAlmeida-primordash.mjs.map +1 -0
  25. package/fesm2020/rafaelaalmeidaa-primordash.mjs +1349 -0
  26. package/fesm2020/rafaelaalmeidaa-primordash.mjs.map +1 -0
  27. package/index.d.ts +5 -0
  28. package/lib/components/card/card.component.d.ts +21 -0
  29. package/lib/components/charts/bar-line/bar-line.component.d.ts +32 -0
  30. package/lib/components/charts/bubble/bubble.component.d.ts +27 -0
  31. package/lib/components/charts/pie/pie.component.d.ts +28 -0
  32. package/lib/components/charts/simple-card/simple-card.component.d.ts +15 -0
  33. package/lib/components/charts/table/table.component.d.ts +13 -0
  34. package/lib/components/dashboard/dashboard.component.d.ts +58 -0
  35. package/lib/components/modal-edit/modal-edit.component.d.ts +32 -0
  36. package/lib/components/modal-edit-chart/modal-edit-chart.component.d.ts +16 -0
  37. package/lib/models/dashboard.model.d.ts +118 -0
  38. package/lib/primordash.component.d.ts +16 -0
  39. package/lib/primordash.module.d.ts +26 -0
  40. package/lib/primordash.service.d.ts +6 -0
  41. package/lib/services/generic.d.ts +3 -0
  42. package/package.json +40 -0
  43. package/public-api.d.ts +4 -0
  44. package/src/lib/assets/fonts/google_icons_outlined.ttf +0 -0
  45. package/src/lib/assets/fonts/google_icons_rounded.ttf +0 -0
  46. package/src/lib/assets/fonts/google_icons_sharp.ttf +0 -0
  47. package/src/lib/assets/images/bar.png +0 -0
  48. package/src/lib/assets/images/doughnut.png +0 -0
  49. package/src/lib/assets/images/halfDoughnut.png +0 -0
  50. package/src/lib/assets/images/lineBar.png +0 -0
  51. package/src/lib/assets/images/multiPie.png +0 -0
  52. package/src/lib/assets/images/pie.png +0 -0
  53. package/src/lib/assets/images/polarArea.png +0 -0
  54. package/src/lib/assets/images/verticalBar.png +0 -0
  55. package/src/lib/assets/images/verticalStackedBar.png +0 -0
  56. package/src/lib/assets/style.scss +5 -0
  57. package/src/lib/assets/styles/_colors.scss +11 -0
  58. package/src/lib/assets/styles/_fonts.scss +30 -0
  59. package/src/lib/assets/styles/_modal.scss +36 -0
  60. package/src/lib/assets/styles/_ng-select.scss +128 -0
@@ -0,0 +1,118 @@
1
+ import { ChartData, ChartOptions, ChartType } from "chart.js";
2
+ export interface Card {
3
+ /** Identificador único do card */
4
+ id?: number;
5
+ /** Tipo do gráfico exibido no card */
6
+ type?: DashboardChartType;
7
+ /** Título exibido no topo do card */
8
+ title?: string;
9
+ /** Ordem de exibição no dashboard */
10
+ order?: number;
11
+ /** Quantidade de colunas ocupadas no grid */
12
+ cols: number;
13
+ /** Quantidade de linhas ocupadas no grid */
14
+ rows?: number;
15
+ /** Cor da fonte do card */
16
+ fontColor?: string;
17
+ /** Cor de fundo do card */
18
+ backgroundColor?: string;
19
+ /** Lista de métricas/colunas que serão exibidas */
20
+ keys?: Item[];
21
+ /** Define se o gráfico será empilhado */
22
+ stacked?: boolean;
23
+ /** Exibe valores em porcentagem */
24
+ showPorcent?: boolean;
25
+ /** Exibe rótulos dentro do gráfico */
26
+ showLabel?: boolean;
27
+ /** Orientação do eixo principal (horizontal ou vertical) */
28
+ axisOrientation?: AxisOrientation;
29
+ /** Configuração personalizada do eixo X */
30
+ axisX?: Axis;
31
+ /** Configuração personalizada do eixo Y */
32
+ axisY?: Axis;
33
+ /** Dados que alimentam o gráfico */
34
+ data?: any[];
35
+ /** Conteúdo HTML personalizado (caso não seja gráfico) */
36
+ innerHtml?: any;
37
+ }
38
+ export interface Item {
39
+ /** Nome da propriedade no objeto de dados (ex: 'totalVendas') */
40
+ key: string;
41
+ /** Nome exibido na legenda do gráfico */
42
+ label: string;
43
+ /** Chave usada para eixo X (usado em bubble chart) */
44
+ keyX?: string;
45
+ /** Chave usada para eixo Y (usado em bubble chart)*/
46
+ keyY?: string;
47
+ /** Chave usada para raio (usado em bubble chart) */
48
+ keyR?: string;
49
+ /** Cor da série no gráfico (hex, rgb, rgba, etc.) */
50
+ color?: string;
51
+ /** Identificador de empilhamento (usado quando stacked = true) */
52
+ stackKey?: string;
53
+ /** Tipo específico da série (ex: 'line' dentro de um gráfico bar misto) */
54
+ type?: SupportedChartType;
55
+ /** Define em qual eixo a série será renderizada (ex: left ou right) */
56
+ axisType?: AxisDimension;
57
+ /** Define se a área abaixo da linha será preenchida (line chart) */
58
+ fill?: boolean;
59
+ }
60
+ export interface Axis {
61
+ /** Nome da propriedade usada como eixo */
62
+ key: string;
63
+ /** Título exibido no eixo */
64
+ label: string;
65
+ /** Cor aplicada ao eixo (ticks e label) */
66
+ keyColor?: string;
67
+ }
68
+ export interface Option {
69
+ /** Identificador único da opção */
70
+ id?: number;
71
+ /** Título exibido no card/opção */
72
+ title: string;
73
+ /** Ordem de exibição */
74
+ order?: number;
75
+ /** Quantidade de colunas ocupadas no grid */
76
+ cols: number;
77
+ /** Quantidade de linhas ocupadas no grid */
78
+ rows: number;
79
+ }
80
+ export interface ModalItem {
81
+ id: string | number;
82
+ label: string;
83
+ type: ModalTypes;
84
+ value?: number;
85
+ items?: ModalItem[];
86
+ }
87
+ export interface SelectRow {
88
+ levels: ModalItem[][];
89
+ selectedPath: ModalItem[];
90
+ finalValue: string[];
91
+ finalFontColor: string;
92
+ finalBackgroudColor: string;
93
+ }
94
+ export interface Select {
95
+ id: string | number;
96
+ label: string;
97
+ }
98
+ export interface ChartOption {
99
+ id: DashboardChartType;
100
+ title: string;
101
+ }
102
+ export interface ChatConfig<T extends ChartType = ChartType> {
103
+ type: T;
104
+ data: ChartData<T>;
105
+ options: ChartOptions<T>;
106
+ }
107
+ export type DashboardChartType = typeof DASHBOARD_CHART_TYPES[number];
108
+ export declare const DASHBOARD_CHART_TYPES: readonly ["bar", "stackedBar", "verticalBar", "verticalStackedBar", "verticalProgressBar", "progressBar", "lineBar", "lineBarStacked", "line", "radar", "curveLine", "pie", "multiPie", "doughnut", "halfDoughnut", "area", "bubble", "polarArea", "simpleCard", "table", "html"];
109
+ export type DashboardBarLineType = typeof DASHBOARD_BAR_LINE_TYPES[number];
110
+ export declare const DASHBOARD_BAR_LINE_TYPES: string[];
111
+ export type SupportedChartType = typeof SUPPORTED_CHART_TYPES[number];
112
+ export declare const SUPPORTED_CHART_TYPES: readonly ["bar", "line", "radar"];
113
+ export type AxisOrientation = typeof AXIS_ORIENTATION[number];
114
+ export declare const AXIS_ORIENTATION: readonly ["x", "y"];
115
+ export type AxisDimension = typeof AXIS_DIMENSION[number];
116
+ export declare const AXIS_DIMENSION: readonly ["x", "y", "r"];
117
+ export type ModalTypes = typeof MODAL_TYPES[number];
118
+ export declare const MODAL_TYPES: readonly ["group", "option"];
@@ -0,0 +1,16 @@
1
+ import { Card, ModalItem, Option, Select } from './models/dashboard.model';
2
+ import * as i0 from "@angular/core";
3
+ export declare class PrimordashComponent {
4
+ isDark: boolean;
5
+ isResponsive: boolean;
6
+ canEdit: boolean;
7
+ cols: number;
8
+ options: Option[];
9
+ cards: Card[];
10
+ groupType: Select[];
11
+ modalData: ModalItem[];
12
+ data: any;
13
+ debug: boolean;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<PrimordashComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<PrimordashComponent, "lib-primordash", never, { "isDark": "isDark"; "isResponsive": "isResponsive"; "canEdit": "canEdit"; "cols": "cols"; "options": "options"; "cards": "cards"; "groupType": "groupType"; "modalData": "modalData"; "data": "data"; "debug": "debug"; }, {}, never, never, false, never>;
16
+ }
@@ -0,0 +1,26 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./components/dashboard/dashboard.component";
3
+ import * as i2 from "./components/card/card.component";
4
+ import * as i3 from "./components/charts/bar-line/bar-line.component";
5
+ import * as i4 from "./components/charts/bubble/bubble.component";
6
+ import * as i5 from "./components/charts/pie/pie.component";
7
+ import * as i6 from "./components/charts/simple-card/simple-card.component";
8
+ import * as i7 from "./components/charts/table/table.component";
9
+ import * as i8 from "./components/modal-edit/modal-edit.component";
10
+ import * as i9 from "./components/modal-edit-chart/modal-edit-chart.component";
11
+ import * as i10 from "./primordash.component";
12
+ import * as i11 from "@angular/platform-browser";
13
+ import * as i12 from "@angular/cdk/drag-drop";
14
+ import * as i13 from "@angular/platform-browser/animations";
15
+ import * as i14 from "@angular/material/grid-list";
16
+ import * as i15 from "@angular/material/menu";
17
+ import * as i16 from "ng2-charts";
18
+ import * as i17 from "@angular/forms";
19
+ import * as i18 from "@angular/common";
20
+ import * as i19 from "ngx-bootstrap/modal";
21
+ import * as i20 from "@ng-select/ng-select";
22
+ export declare class PrimordashModule {
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<PrimordashModule, never>;
24
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PrimordashModule, [typeof i1.DashboardComponent, typeof i2.CardComponent, typeof i3.BarLineComponent, typeof i4.BubbleComponent, typeof i5.PieComponent, typeof i6.SimpleCardComponent, typeof i7.TableComponent, typeof i8.ModalEditComponent, typeof i9.ModalEditChartComponent, typeof i10.PrimordashComponent], [typeof i11.BrowserModule, typeof i12.DragDropModule, typeof i13.BrowserAnimationsModule, typeof i14.MatGridListModule, typeof i15.MatMenuModule, typeof i16.NgChartsModule, typeof i17.ReactiveFormsModule, typeof i17.FormsModule, typeof i18.CommonModule, typeof i19.ModalModule, typeof i20.NgSelectModule], [typeof i1.DashboardComponent, typeof i10.PrimordashComponent]>;
25
+ static ɵinj: i0.ɵɵInjectorDeclaration<PrimordashModule>;
26
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class PrimordashService {
3
+ constructor();
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<PrimordashService, never>;
5
+ static ɵprov: i0.ɵɵInjectableDeclaration<PrimordashService>;
6
+ }
@@ -0,0 +1,3 @@
1
+ export declare function randomColor(): string;
2
+ export declare function getOpacityColors(listColors: string[], index: number): string[];
3
+ export declare function getContrastColor(color: string): string;
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@rafaelaalmeidaa/primordash",
3
+ "version": "0.0.1",
4
+ "description": "UI Dashboard library for Angular",
5
+ "peerDependencies": {
6
+ "@angular/common": "^15.2.0",
7
+ "@angular/core": "^15.2.0"
8
+ },
9
+ "dependencies": {
10
+ "tslib": "^2.3.0"
11
+ },
12
+ "keywords": [
13
+ "angular",
14
+ "ui",
15
+ "dashboard",
16
+ "components",
17
+ "design-system"
18
+ ],
19
+ "license": "MIT",
20
+ "sideEffects": false,
21
+ "module": "fesm2015/rafaelaalmeidaa-primordash.mjs",
22
+ "es2020": "fesm2020/rafaelaalmeidaa-primordash.mjs",
23
+ "esm2020": "esm2020/rafaelaalmeidaa-primordash.mjs",
24
+ "fesm2020": "fesm2020/rafaelaalmeidaa-primordash.mjs",
25
+ "fesm2015": "fesm2015/rafaelaalmeidaa-primordash.mjs",
26
+ "typings": "index.d.ts",
27
+ "exports": {
28
+ "./package.json": {
29
+ "default": "./package.json"
30
+ },
31
+ ".": {
32
+ "types": "./index.d.ts",
33
+ "esm2020": "./esm2020/rafaelaalmeidaa-primordash.mjs",
34
+ "es2020": "./fesm2020/rafaelaalmeidaa-primordash.mjs",
35
+ "es2015": "./fesm2015/rafaelaalmeidaa-primordash.mjs",
36
+ "node": "./fesm2015/rafaelaalmeidaa-primordash.mjs",
37
+ "default": "./fesm2020/rafaelaalmeidaa-primordash.mjs"
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,4 @@
1
+ export * from './lib/primordash.service';
2
+ export * from './lib/primordash.component';
3
+ export * from './lib/primordash.module';
4
+ export * from './lib/components/dashboard/dashboard.component';
Binary file
Binary file
@@ -0,0 +1,5 @@
1
+ @import "@ng-select/ng-select/themes/default.theme.css";
2
+ @import "./styles/colors";
3
+ @import "./styles/ng-select";
4
+ @import "./styles/fonts";
5
+ @import "./styles/modal";
@@ -0,0 +1,11 @@
1
+
2
+ $blue: #0d6efd !default;
3
+ $indigo: #6610f2 !default;
4
+ $purple: #6f42c1 !default;
5
+ $pink: #d63384 !default;
6
+ $red: #dc3545 !default;
7
+ $orange: #fd7e14 !default;
8
+ $yellow: #ffc107 !default;
9
+ $green: #198754 !default;
10
+ $teal: #20c997 !default;
11
+ $cyan: #0dcaf0 !default;
@@ -0,0 +1,30 @@
1
+
2
+ @font-face {
3
+ font-family: 'icons_outlined';
4
+ src: url('../fonts/google_icons_outlined.ttf?hlukgn') format('truetype');
5
+ font-weight: 100 900;
6
+ font-style: normal;
7
+ }
8
+ @font-face {
9
+ font-family: 'icons_rounded';
10
+ src: url('../fonts/google_icons_rounded.ttf?hlukgn') format('truetype');
11
+ font-weight: 100 900;
12
+ font-style: normal;
13
+ }
14
+ @font-face {
15
+ font-family: 'icons_sharp';
16
+ src: url('../fonts/google_icons_sharp.ttf?hlukgn') format('truetype');
17
+ font-weight: 100 900;
18
+ font-style: normal;
19
+ }
20
+ .font-icon, .font-icon-fill{
21
+ font-family: 'icons_outlined';
22
+ line-height: 1;
23
+ }
24
+ .font-icon-fill{
25
+ font-variation-settings:
26
+ 'FILL' 1,
27
+ 'wght' 400,
28
+ 'GRAD' 0,
29
+ 'opsz' 24;
30
+ }
@@ -0,0 +1,36 @@
1
+ @mixin modal-size($size) {
2
+ max-width: $size;
3
+ max-height: 90vh;
4
+
5
+ .modal-content {
6
+ width: $size;
7
+ max-height: 90vh;
8
+ overflow: hidden;
9
+ .chart{
10
+ max-height: fit-content;
11
+ }
12
+ }
13
+ }
14
+
15
+ // Mobile (default)
16
+ .modal-sm { @include modal-size(95vw); }
17
+ .modal-md { @include modal-size(95vw); }
18
+ .modal-lg { @include modal-size(95vw); }
19
+ .modal-xl { @include modal-size(95vw); }
20
+
21
+
22
+ // Tablet (≥ 768px)
23
+ @media (min-width: 768px) {
24
+ .modal-sm { @include modal-size(60vw); }
25
+ .modal-md { @include modal-size(75vw); }
26
+ .modal-lg { @include modal-size(85vw); }
27
+ .modal-xl { @include modal-size(90vw); }
28
+ }
29
+
30
+ // Desktop (≥ 1024px)
31
+ @media (min-width: 1024px) {
32
+ .modal-sm { @include modal-size(25vw); }
33
+ .modal-md { @include modal-size(50vw); }
34
+ .modal-lg { @include modal-size(70vw); }
35
+ .modal-xl { @include modal-size(90vw); }
36
+ }
@@ -0,0 +1,128 @@
1
+ // Custom style ng-select
2
+ @import "@ng-select/ng-select/themes/default.theme.css";
3
+
4
+ .ng-select-alternative {
5
+ transition: box-shadow 0.15s ease;
6
+ width: 100%;
7
+ }
8
+
9
+ .table-form {
10
+ margin-top: 5px !important;
11
+
12
+ .table-select {
13
+ overflow-x: visible !important;
14
+
15
+ @media (max-width:1224px) {
16
+ overflow-x: auto !important;
17
+ }
18
+ }
19
+
20
+ .table-form-conteiner {
21
+ @media (max-width:1024px) {
22
+ overflow-x: auto !important;
23
+ }
24
+ }
25
+
26
+ .ng-select {
27
+ .ng-select-container {
28
+ border: 1px solid #E9E9E9 !important;
29
+ min-width: 150px;
30
+ }
31
+ }
32
+
33
+ .form-control {
34
+ border: 1px solid #E9E9E9 !important;
35
+ min-width: 150px;
36
+ }
37
+
38
+ [readonly] {
39
+ cursor: no-drop;
40
+
41
+ &:focus {
42
+ border-color: #E9E9E9 !important;
43
+ }
44
+ }
45
+ }
46
+
47
+ .ng-select {
48
+ .ng-select-container {
49
+ background-color: #ffffff;
50
+ background-image: none;
51
+ border: 0;
52
+ border-radius: 8px;
53
+ display: block;
54
+ transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
55
+ padding: 5px 0 0 0;
56
+ min-height: 39px !important;
57
+
58
+ &:hover {
59
+ box-shadow: none;
60
+ }
61
+
62
+ .ng-value-container {
63
+ padding: 5px 10px;
64
+
65
+ .ng-placeholder {
66
+ font-weight: 300;
67
+ color: #B1B1B1;
68
+ margin-top: -4px;
69
+ font-size: 13px;
70
+ top: 14px !important;
71
+ }
72
+
73
+ .ng-value {
74
+ padding: 5px 0;
75
+ }
76
+ }
77
+ }
78
+
79
+ &.ng-select-focused:not(.ng-select-opened)>.ng-select-container {
80
+ box-shadow: none;
81
+ }
82
+
83
+ &.ng-select-single .ng-select-container .ng-value-container .ng-value {
84
+ font-weight: 400;
85
+ margin-top: -4px;
86
+ font-size: 13px;
87
+ }
88
+
89
+ // &.ng-select-disabled>.ng-select-container {
90
+ // top: -10px;
91
+ // height: calc(1.5em + 1.25rem + 2px);
92
+ // }
93
+
94
+ .ng-value-container .ng-input>input {
95
+ font-weight: 400;
96
+ line-height: 1.5;
97
+ color: #8898aa;
98
+ padding: 3px 0 0 0 !important;
99
+ }
100
+
101
+ .ng-dropdown-panel {
102
+ z-index: 9999999;
103
+
104
+ .ng-dropdown-panel-items .ng-option {
105
+ font-weight: 400 !important;
106
+ color: #8898aa !important;
107
+ font-size: 13px;
108
+ }
109
+ }
110
+
111
+ &.ng-dirty.ng-invalid {
112
+ .ng-select-container {
113
+ border: 1px solid $red;
114
+ }
115
+ }
116
+
117
+ &.ng-select-multiple {
118
+ .ng-select-container {
119
+ .ng-value-container {
120
+ padding-top: 0px;
121
+
122
+ .ng-placeholder {
123
+ top: 11px;
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }